Files
2026-06-03 07:05:44 +00:00

150 lines
175 KiB
JavaScript

import{a as e,c as t,d as n,f as r,i,l as a,m as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./github-DTObde6f.js";import{b as m,c as h,g,p as _,t as v,y}from"./lt-CTruzcfj.js";import{createRequire as b}from"node:module";import x from"node:fs/promises";import S from"node:path";import{promises as C}from"fs";import{relative as w,resolve as T}from"path";const E=async(e,t)=>(await e.graphql(`
query getRepositoryMetadata(
$owner: String!
$repo: String!
$baseRef: String!
$targetRef: String!
) {
repository(owner: $owner, name: $repo) {
id
baseRef: ref(qualifiedName: $baseRef) {
id
target {
oid
... on Tag {
target {
oid
}
}
}
}
targetBranch: ref(qualifiedName: $targetRef) {
id
target {
oid
}
}
}
}
`,t)).repository,D=async(e,t)=>e.graphql(`
mutation createCommitOnBranch($input: CreateCommitOnBranchInput!) {
createCommitOnBranch(input: $input) {
commit {
oid
}
ref {
id
}
}
}
`,t),O=e=>`branch`in e?`refs/heads/${e.branch}`:`tag`in e?`refs/tags/${e.tag}`:`HEAD`,k=(e,t)=>{if(`commit`in e)return e.commit;if(!t?.target)throw Error(`Could not determine oid from ref: ${JSON.stringify(t)}`);return`target`in t.target?t.target.target.oid:t.target.oid},A=e=>typeof e==`object`&&!!e&&`status`in e&&`message`in e&&typeof e.status==`number`&&typeof e.message==`string`&&e.status===422&&e.message.includes(`Reference already exists`),j=async({octokit:e,refId:t,baseOid:n,message:r,fileChanges:i})=>{let a=typeof r==`string`?{headline:r.split(`
`)[0]?.trim()??``,body:r.split(`
`).slice(1).join(`
`).trim()}:r;return D(e,{input:{branch:{id:t},expectedHeadOid:n,message:a,fileChanges:i}})},M=async({octokit:e,owner:t,repo:n,branch:r,base:i,force:a=!1,message:o,fileChanges:s,log:c})=>{let l=`${t}/${n}`,u=O(i),d=`refs/heads/${r}`;c?.debug(`Getting repo info ${l}`);let f=await E(e,{owner:t,repo:n,baseRef:u,targetRef:d});if(c?.debug(`Repo info: ${JSON.stringify(f,null,2)}`),!f)throw Error(`Repository ${JSON.stringify(l)} not found`);if(!(`commit`in i)&&!f.baseRef)throw Error(`Ref ${JSON.stringify(u)} not found`);let p=f.baseRef,m=k(i,f.baseRef),h=f.targetBranch?.target?.oid??null,g=`branch`in i&&i.branch===r,_;if(g)_=a?`force-update`:`update`;else if(h===null)_=`create`;else if(a)_=`force-update`;else if(h===m)_=`update`;else throw Error(`Branch ${r} exists already and does not match base ${m}, force is set to false`);if(_===`force-update`){let i=`changesets-ghcommit-temp/${r}`,a;try{let r=(await e.rest.git.createRef({owner:t,repo:n,ref:`refs/heads/${i}`,sha:m})).data.node_id;if(!r)throw Error(`Failed to create temporary branch ${i}`);a=r}catch(r){if(!A(r))throw r;let o=(await e.rest.git.updateRef({owner:t,repo:n,ref:`heads/${i}`,sha:m,force:!0})).data.node_id;if(!o)throw Error(`Failed to update temporary branch ${i}`);a=o}c?.debug(`Creating commit on branch ${i}`);let l=(await j({octokit:e,refId:a,baseOid:m,message:o,fileChanges:s})).createCommitOnBranch?.commit?.oid;if(!l)throw Error(`Failed to determine head commit of temporary branch ${i}`);let u=(await e.rest.git.updateRef({owner:t,repo:n,ref:`heads/${r}`,sha:l,force:!0})).data.node_id;if(!u)throw Error(`Failed to update branch ${r}`);return await e.rest.git.deleteRef({owner:t,repo:n,ref:`heads/${i}`}),{refId:u}}let v;if(_===`create`){let i=(await e.rest.git.createRef({owner:t,repo:n,ref:`refs/heads/${r}`,sha:m})).data.node_id;if(!i)throw Error(`Failed to create branch ${r}`);v=i}else v=g?p.id:f.targetBranch.id;return c?.debug(`Creating commit on branch ${r}`),{refId:(await j({octokit:e,refId:v,baseOid:m,message:o,fileChanges:s})).createCommitOnBranch?.ref?.id??null}},N=async({fileChanges:e,...t})=>M({...t,fileChanges:{additions:e.additions?.map(({path:e,contents:t})=>({path:e,contents:t.toString(`base64`)})),deletions:e.deletions?.map(e=>({path:e}))}});var P=r(((e,t)=>{var n=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw 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||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r||={};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&=(clearTimeout(l),null),u&&=(clearTimeout(u),null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||=(o?r?a(r):i(c):typeof n==`function`&&n(r,c),!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&=(clearTimeout(c),null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),ee=r(((e,t)=>{t.exports=P()})),te=r(((e,t)=>{typeof Object.create==`function`?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),ne=r(((e,t)=>{try{var n=l(`util`);if(typeof n.inherits!=`function`)throw``;t.exports=n.inherits}catch{t.exports=te()}})),F=r(((e,t)=>{var n=l(`buffer`),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),re=r(((e,t)=>{var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}})),ie=r(((e,t)=>{t.exports=TypeError})),ae=r(((e,t)=>{t.exports=Object})),oe=r(((e,t)=>{t.exports=Error})),I=r(((e,t)=>{t.exports=EvalError})),L=r(((e,t)=>{t.exports=RangeError})),se=r(((e,t)=>{t.exports=ReferenceError})),ce=r(((e,t)=>{t.exports=SyntaxError})),le=r(((e,t)=>{t.exports=URIError})),ue=r(((e,t)=>{t.exports=Math.abs})),R=r(((e,t)=>{t.exports=Math.floor})),de=r(((e,t)=>{t.exports=Math.max})),z=r(((e,t)=>{t.exports=Math.min})),B=r(((e,t)=>{t.exports=Math.pow})),V=r(((e,t)=>{t.exports=Math.round})),H=r(((e,t)=>{t.exports=Number.isNaN||function(e){return e!==e}})),fe=r(((e,t)=>{var n=H();t.exports=function(e){return n(e)||e===0?e:e<0?-1:1}})),pe=r(((e,t)=>{t.exports=Object.getOwnPropertyDescriptor})),U=r(((e,t)=>{var n=pe();if(n)try{n([],`length`)}catch{n=null}t.exports=n})),W=r(((e,t)=>{var n=Object.defineProperty||!1;if(n)try{n({},`a`,{value:1})}catch{n=!1}t.exports=n})),G=r(((e,t)=>{t.exports=function(){if(typeof Symbol!=`function`||typeof Object.getOwnPropertySymbols!=`function`)return!1;if(typeof Symbol.iterator==`symbol`)return!0;var e={},t=Symbol(`test`),n=Object(t);if(typeof t==`string`||Object.prototype.toString.call(t)!==`[object Symbol]`||Object.prototype.toString.call(n)!==`[object Symbol]`)return!1;var r=42;for(var i in e[t]=r,e)return!1;if(typeof Object.keys==`function`&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames==`function`&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor==`function`){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==r||o.enumerable!==!0)return!1}return!0}})),K=r(((e,t)=>{var n=typeof Symbol<`u`&&Symbol,r=G();t.exports=function(){return typeof n!=`function`||typeof Symbol!=`function`||typeof n(`foo`)!=`symbol`||typeof Symbol(`bar`)!=`symbol`?!1:r()}})),q=r(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect.getPrototypeOf||null})),J=r(((e,t)=>{t.exports=ae().getPrototypeOf||null})),me=r(((e,t)=>{var n=`Function.prototype.bind called on incompatible `,r=Object.prototype.toString,i=Math.max,a=`[object Function]`,o=function(e,t){for(var n=[],r=0;r<e.length;r+=1)n[r]=e[r];for(var i=0;i<t.length;i+=1)n[i+e.length]=t[i];return n},s=function(e,t){for(var n=[],r=t||0,i=0;r<e.length;r+=1,i+=1)n[i]=e[r];return n},c=function(e,t){for(var n=``,r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n};t.exports=function(e){var t=this;if(typeof t!=`function`||r.apply(t)!==a)throw TypeError(n+t);for(var l=s(arguments,1),u,d=function(){if(this instanceof u){var n=t.apply(this,o(l,arguments));return Object(n)===n?n:this}return t.apply(e,o(l,arguments))},f=i(0,t.length-l.length),p=[],m=0;m<f;m++)p[m]=`$`+m;if(u=Function(`binder`,`return function (`+c(p,`,`)+`){ return binder.apply(this,arguments); }`)(d),t.prototype){var h=function(){};h.prototype=t.prototype,u.prototype=new h,h.prototype=null}return u}})),Y=r(((e,t)=>{var n=me();t.exports=Function.prototype.bind||n})),he=r(((e,t)=>{t.exports=Function.prototype.call})),ge=r(((e,t)=>{t.exports=Function.prototype.apply})),X=r(((e,t)=>{t.exports=typeof Reflect<`u`&&Reflect&&Reflect.apply})),_e=r(((e,t)=>{var n=Y(),r=ge(),i=he();t.exports=X()||n.call(i,r)})),ve=r(((e,t)=>{var n=Y(),r=ie(),i=he(),a=_e();t.exports=function(e){if(e.length<1||typeof e[0]!=`function`)throw new r(`a function is required`);return a(n,i,e)}})),Z=r(((e,t)=>{var n=ve(),r=U(),i;try{i=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!=`object`||!(`code`in e)||e.code!==`ERR_PROTO_ACCESS`)throw e}var a=!!i&&r&&r(Object.prototype,`__proto__`),o=Object,s=o.getPrototypeOf;t.exports=a&&typeof a.get==`function`?n([a.get]):typeof s==`function`?function(e){return s(e==null?e:o(e))}:!1})),Q=r(((e,t)=>{var n=q(),r=J(),i=Z();t.exports=n?function(e){return n(e)}:r?function(e){if(!e||typeof e!=`object`&&typeof e!=`function`)throw TypeError(`getProto: not an object`);return r(e)}:i?function(e){return i(e)}:null})),ye=r(((e,t)=>{var n=Function.prototype.call,r=Object.prototype.hasOwnProperty;t.exports=Y().call(n,r)})),be=r(((e,t)=>{var n,r=ae(),i=oe(),a=I(),o=L(),s=se(),c=ce(),l=ie(),u=le(),d=ue(),f=R(),p=de(),m=z(),h=B(),g=V(),_=fe(),v=Function,y=function(e){try{return v(`"use strict"; return (`+e+`).constructor;`)()}catch{}},b=U(),x=W(),S=function(){throw new l},C=b?function(){try{return arguments.callee,S}catch{try{return b(arguments,`callee`).get}catch{return S}}}():S,w=K()(),T=Q(),E=J(),D=q(),O=ge(),k=he(),A={},j=typeof Uint8Array>`u`||!T?n:T(Uint8Array),M={__proto__:null,"%AggregateError%":typeof AggregateError>`u`?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>`u`?n:ArrayBuffer,"%ArrayIteratorPrototype%":w&&T?T([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":A,"%AsyncGenerator%":A,"%AsyncGeneratorFunction%":A,"%AsyncIteratorPrototype%":A,"%Atomics%":typeof Atomics>`u`?n:Atomics,"%BigInt%":typeof BigInt>`u`?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>`u`?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>`u`?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>`u`?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":a,"%Float16Array%":typeof Float16Array>`u`?n:Float16Array,"%Float32Array%":typeof Float32Array>`u`?n:Float32Array,"%Float64Array%":typeof Float64Array>`u`?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>`u`?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":A,"%Int8Array%":typeof Int8Array>`u`?n:Int8Array,"%Int16Array%":typeof Int16Array>`u`?n:Int16Array,"%Int32Array%":typeof Int32Array>`u`?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":w&&T?T(T([][Symbol.iterator]())):n,"%JSON%":typeof JSON==`object`?JSON:n,"%Map%":typeof Map>`u`?n:Map,"%MapIteratorPrototype%":typeof Map>`u`||!w||!T?n:T(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":r,"%Object.getOwnPropertyDescriptor%":b,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>`u`?n:Promise,"%Proxy%":typeof Proxy>`u`?n:Proxy,"%RangeError%":o,"%ReferenceError%":s,"%Reflect%":typeof Reflect>`u`?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>`u`?n:Set,"%SetIteratorPrototype%":typeof Set>`u`||!w||!T?n:T(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>`u`?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":w&&T?T(``[Symbol.iterator]()):n,"%Symbol%":w?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":C,"%TypedArray%":j,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>`u`?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>`u`?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>`u`?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>`u`?n:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>`u`?n:WeakMap,"%WeakRef%":typeof WeakRef>`u`?n:WeakRef,"%WeakSet%":typeof WeakSet>`u`?n:WeakSet,"%Function.prototype.call%":k,"%Function.prototype.apply%":O,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":E,"%Math.abs%":d,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":m,"%Math.pow%":h,"%Math.round%":g,"%Math.sign%":_,"%Reflect.getPrototypeOf%":D};if(T)try{null.error}catch(e){M[`%Error.prototype%`]=T(T(e))}var N=function e(t){var n;if(t===`%AsyncFunction%`)n=y(`async function () {}`);else if(t===`%GeneratorFunction%`)n=y(`function* () {}`);else if(t===`%AsyncGeneratorFunction%`)n=y(`async function* () {}`);else if(t===`%AsyncGenerator%`){var r=e(`%AsyncGeneratorFunction%`);r&&(n=r.prototype)}else if(t===`%AsyncIteratorPrototype%`){var i=e(`%AsyncGenerator%`);i&&T&&(n=T(i.prototype))}return M[t]=n,n},P={__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`]},ee=Y(),te=ye(),ne=ee.call(k,Array.prototype.concat),F=ee.call(O,Array.prototype.splice),re=ee.call(k,String.prototype.replace),H=ee.call(k,String.prototype.slice),pe=ee.call(k,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,me=/\\(\\)?/g,X=function(e){var t=H(e,0,1),n=H(e,-1);if(t===`%`&&n!==`%`)throw new c("invalid intrinsic syntax, expected closing `%`");if(n===`%`&&t!==`%`)throw new c("invalid intrinsic syntax, expected opening `%`");var r=[];return re(e,G,function(e,t,n,i){r[r.length]=n?re(i,me,`$1`):t||e}),r},_e=function(e,t){var n=e,r;if(te(P,n)&&(r=P[n],n=`%`+r[0]+`%`),te(M,n)){var i=M[n];if(i===A&&(i=N(n)),i===void 0&&!t)throw new l(`intrinsic `+e+` exists, but is not available. Please file an issue!`);return{alias:r,name:n,value:i}}throw new c(`intrinsic `+e+` does not exist!`)};t.exports=function(e,t){if(typeof e!=`string`||e.length===0)throw new l(`intrinsic name must be a non-empty string`);if(arguments.length>1&&typeof t!=`boolean`)throw new l(`"allowMissing" argument must be a boolean`);if(pe(/^%?[^%]*%?$/,e)===null)throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=X(e),r=n.length>0?n[0]:``,i=_e(`%`+r+`%`,t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(r=u[0],F(n,ne([0,1],u)));for(var d=1,f=!0;d<n.length;d+=1){var p=n[d],m=H(p,0,1),h=H(p,-1);if((m===`"`||m===`'`||m==="`"||h===`"`||h===`'`||h==="`")&&m!==h)throw new c(`property names with quotes must have matching quotes`);if((p===`constructor`||!f)&&(s=!0),r+=`.`+p,a=`%`+r+`%`,te(M,a))o=M[a];else if(o!=null){if(!(p in o)){if(!t)throw new l(`base intrinsic for `+e+` exists, but the property is not available.`);return}if(b&&d+1>=n.length){var g=b(o,p);f=!!g,o=f&&`get`in g&&!(`originalValue`in g.get)?g.get:o[p]}else f=te(o,p),o=o[p];f&&!s&&(M[a]=o)}}return o}})),xe=r(((e,t)=>{var n=be(),r=ve(),i=r([n(`%String.prototype.indexOf%`)]);t.exports=function(e,t){var a=n(e,!!t);return typeof a==`function`&&i(e,`.prototype.`)>-1?r([a]):a}})),Se=r(((e,t)=>{var n=Function.prototype.toString,r=typeof Reflect==`object`&&Reflect!==null&&Reflect.apply,i,a;if(typeof r==`function`&&typeof Object.defineProperty==`function`)try{i=Object.defineProperty({},`length`,{get:function(){throw a}}),a={},r(function(){throw 42},null,i)}catch(e){e!==a&&(r=null)}else r=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch{return!1}},c=function(e){try{return s(e)?!1:(n.call(e),!0)}catch{return!1}},l=Object.prototype.toString,u=`[object Object]`,d=`[object Function]`,f=`[object GeneratorFunction]`,p=`[object HTMLAllCollection]`,m=`[object HTML document.all class]`,h=`[object HTMLCollection]`,g=typeof Symbol==`function`&&!!Symbol.toStringTag,_=!(0 in[,]),v=function(){return!1};if(typeof document==`object`){var y=document.all;l.call(y)===l.call(document.all)&&(v=function(e){if((_||!e)&&(e===void 0||typeof e==`object`))try{var t=l.call(e);return(t===p||t===m||t===h||t===u)&&e(``)==null}catch{}return!1})}t.exports=r?function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;try{r(e,null,i)}catch(e){if(e!==a)return!1}return!s(e)&&c(e)}:function(e){if(v(e))return!0;if(!e||typeof e!=`function`&&typeof e!=`object`)return!1;if(g)return c(e);if(s(e))return!1;var t=l.call(e);return t!==d&&t!==f&&!/^\[object HTML/.test(t)?!1:c(e)}})),Ce=r(((e,t)=>{var n=Se(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,n){for(var r=0,a=e.length;r<a;r++)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))},o=function(e,t,n){for(var r=0,i=e.length;r<i;r++)n==null?t(e.charAt(r),r,e):t.call(n,e.charAt(r),r,e)},s=function(e,t,n){for(var r in e)i.call(e,r)&&(n==null?t(e[r],r,e):t.call(n,e[r],r,e))};function c(e){return r.call(e)===`[object Array]`}t.exports=function(e,t,r){if(!n(t))throw TypeError(`iterator must be a function`);var i;arguments.length>=3&&(i=r),c(e)?a(e,t,i):typeof e==`string`?o(e,t,i):s(e,t,i)}})),$=r(((e,t)=>{t.exports=[`Float16Array`,`Float32Array`,`Float64Array`,`Int8Array`,`Int16Array`,`Int32Array`,`Uint8Array`,`Uint8ClampedArray`,`Uint16Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`]})),we=r(((e,t)=>{var n=$(),r=typeof globalThis>`u`?global:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)typeof r[n[t]]==`function`&&(e[e.length]=n[t]);return e}})),Te=r(((e,t)=>{var n=W(),r=ce(),i=ie(),a=U();t.exports=function(e,t,o){if(!e||typeof e!=`object`&&typeof e!=`function`)throw new i("`obj` must be an object or a function`");if(typeof t!=`string`&&typeof t!=`symbol`)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=`boolean`&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=`boolean`&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=`boolean`&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=`boolean`)throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,d=!!a&&a(e,t);if(n)n(e,t,{configurable:l===null&&d?d.configurable:!l,enumerable:s===null&&d?d.enumerable:!s,value:o,writable:c===null&&d?d.writable:!c});else if(u||!s&&!c&&!l)e[t]=o;else throw new r(`This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.`)}})),Ee=r(((e,t)=>{var n=W(),r=function(){return!!n};r.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],`length`,{value:1}).length!==1}catch{return!0}},t.exports=r})),De=r(((e,t)=>{var n=be(),r=Te(),i=Ee()(),a=U(),o=ie(),s=n(`%Math.floor%`);t.exports=function(e,t){if(typeof e!=`function`)throw new o("`fn` is not a function");if(typeof t!=`number`||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],c=!0,l=!0;if(`length`in e&&a){var u=a(e,`length`);u&&!u.configurable&&(c=!1),u&&!u.writable&&(l=!1)}return(c||l||!n)&&(i?r(e,`length`,t,!0,!0):r(e,`length`,t)),e}})),Oe=r(((e,t)=>{var n=Y(),r=ge(),i=_e();t.exports=function(){return i(n,r,arguments)}})),ke=r(((e,t)=>{var n=De(),r=W(),i=ve(),a=Oe();t.exports=function(e){var t=i(arguments),r=1+e.length-(arguments.length-1);return n(t,r>0?r:0,!0)},r?r(t.exports,`apply`,{value:a}):t.exports.apply=a})),Ae=r(((e,t)=>{var n=G();t.exports=function(){return n()&&!!Symbol.toStringTag}})),je=r(((e,t)=>{var n=Ce(),r=we(),i=ke(),a=xe(),o=U(),s=Q(),c=a(`Object.prototype.toString`),l=Ae()(),u=typeof globalThis>`u`?global:globalThis,d=r(),f=a(`String.prototype.slice`),p=a(`Array.prototype.indexOf`,!0)||function(e,t){for(var n=0;n<e.length;n+=1)if(e[n]===t)return n;return-1},m={__proto__:null};l&&o&&s?n(d,function(e){var t=new u[e];if(Symbol.toStringTag in t&&s){var n=s(t),r=o(n,Symbol.toStringTag);if(!r&&n&&(r=o(s(n),Symbol.toStringTag)),r&&r.get){var a=i(r.get);m[`$`+e]=a}}}):n(d,function(e){var t=new u[e],n=t.slice||t.set;if(n){var r=i(n);m[`$`+e]=r}});var h=function(e){var t=!1;return n(m,function(n,r){if(!t)try{`$`+n(e)===r&&(t=f(r,1))}catch{}}),t},g=function(e){var t=!1;return n(m,function(n,r){if(!t)try{n(e),t=f(r,1)}catch{}}),t};t.exports=function(e){if(!e||typeof e!=`object`)return!1;if(!l){var t=f(c(e),8,-1);return p(d,t)>-1?t:t===`Object`?g(e):!1}return o?h(e):null}})),Me=r(((e,t)=>{var n=je();t.exports=function(e){return!!n(e)}})),Ne=r(((e,t)=>{var n=ie(),r=xe()(`TypedArray.prototype.buffer`,!0),i=Me();t.exports=r||function(e){if(!i(e))throw new n(`Not a Typed Array`);return e.buffer}})),Pe=r(((e,t)=>{var n=F().Buffer,r=re(),i=Ne(),a=ArrayBuffer.isView||function(e){try{return i(e),!0}catch{return!1}},o=typeof Uint8Array<`u`,s=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,c=s&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);t.exports=function(e,t){if(n.isBuffer(e))return e.constructor&&!(`isBuffer`in e)?n.from(e):e;if(typeof e==`string`)return n.from(e,t);if(s&&a(e)){if(e.byteLength===0)return n.alloc(0);if(c){var i=n.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var l=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),u=n.from(l);if(u.length===e.byteLength)return u}if(o&&e instanceof Uint8Array)return n.from(e);var d=r(e);if(d)for(var f=0;f<e.length;f+=1){var p=e[f];if(typeof p!=`number`||p<0||p>255||~~p!==p)throw RangeError(`Array items must be numbers in the range 0-255.`)}if(d||n.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e))return n.from(e);throw TypeError(`The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.`)}})),Fe=r(((e,t)=>{var n=F().Buffer,r=Pe();function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){e=r(e,t||`utf8`);for(var n=this._block,i=this._blockSize,a=e.length,o=this._len,s=0;s<a;){for(var c=o%i,l=Math.min(a-s,i-c),u=0;u<l;u++)n[c+u]=e[s+u];o+=l,s+=l,o%i===0&&this._update(n)}return this._len+=a,this},i.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 n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a},i.prototype._update=function(){throw Error(`_update must be implemented by subclass`)},t.exports=i})),Ie=r(((e,t)=>{var n=ne(),r=Fe(),i=F().Buffer,a=[1518500249,1859775393,-1894007588,-899497514],o=Array(80);function s(){this.init(),this._w=o,r.call(this,64,56)}n(s,r),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function c(e){return e<<1|e>>>31}function l(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function d(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}s.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,o=this._d|0,s=this._e|0,f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<80;++f)t[f]=c(t[f-3]^t[f-8]^t[f-14]^t[f-16]);for(var p=0;p<80;++p){var m=~~(p/20),h=l(n)+d(m,r,i,o)+s+t[p]+a[m]|0;s=o,o=i,i=u(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0},s.prototype._hash=function(){var e=i.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},t.exports=s})),Le=r((e=>{(function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14];function b(e,t){for(var r=t^-1,i=0,a=e.length;i<a;)r=r>>>8^n[(r^e.charCodeAt(i++))&255];return~r}function x(e,t){for(var r=t^-1,i=e.length-15,b=0;b<i;)r=y[e[b++]^r&255]^v[e[b++]^r>>8&255]^_[e[b++]^r>>16&255]^g[e[b++]^r>>>24]^h[e[b++]]^m[e[b++]]^p[e[b++]]^f[e[b++]]^d[e[b++]]^u[e[b++]]^l[e[b++]]^c[e[b++]]^s[e[b++]]^o[e[b++]]^a[e[b++]]^n[e[b++]];for(i+=15;b<i;)r=r>>>8^n[(r^e[b++])&255];return~r}function S(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i<a;)o=e.charCodeAt(i++),o<128?r=r>>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=b,e.buf=x,e.str=S})})),Re=r((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.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 TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),ze=r((e=>{var t=Re(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,T=[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],E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var j=Array(h*2);o(j);var M=Array(k);o(M);var N=Array(d-u+1);o(N);var P=Array(f);o(P);var ee=Array(h);o(ee);function te(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var ne,F,re;function ie(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ae(e){return e<256?M[e]:M[256+(e>>>7)]}function oe(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,oe(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function L(e,t,n){I(e,n[t*2],n[t*2+1])}function se(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function ce(e){e.bi_valid===16?(oe(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 le(e,t){var n=t.dyn_tree,r=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,u,d,f,p,m,h=0;for(f=0;f<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function ue(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=se(r[s]++,s))}}function R(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(P[r]=n,e=0;e<1<<T[r];e++)N[n++]=r;for(N[n-1]=r,i=0,r=0;r<16;r++)for(ee[r]=i,e=0;e<1<<E[r];e++)M[i++]=r;for(i>>=7;r<h;r++)for(ee[r]=i<<7,e=0;e<1<<E[r]-7;e++)M[256+ i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(ue(A,m+1,a),e=0;e<h;e++)j[e*2+1]=5,j[e*2]=se(e,5);ne=new te(A,T,p+1,m,v),F=new te(j,E,0,h,v),re=new te([],D,0,g,b)}function de(e){var t;for(t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function z(e){e.bi_valid>8?oe(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 B(e,n,r,i){z(e),i&&(oe(e,r),oe(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function V(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function H(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&V(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!V(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function fe(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=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++,r===0?L(e,i,t):(o=N[i],L(e,o+p+1,t),s=T[o],s!==0&&(i-=P[o],I(e,i,s)),r--,o=ae(r),L(e,o,n),s=E[o],s!==0&&(r-=ee[o],I(e,r,s)));while(a<e.last_lit);L(e,x,t)}function pe(e,t){var n=t.dyn_tree,r=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=_,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)H(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],H(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,H(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],le(e,t),ue(n,c,e.bl_count)}function U(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function W(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do L(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(L(e,C,e.bl_tree),I(e,s-3,3)):(L(e,w,e.bl_tree),I(e,s-11,7)):(a!==i&&(L(e,a,e.bl_tree),s--),L(e,S,e.bl_tree),I(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function G(e){var t;for(U(e,e.dyn_ltree,e.l_desc.max_code),U(e,e.dyn_dtree,e.d_desc.max_code),pe(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function K(e,t,n,r){var i;for(I(e,t-257,5),I(e,n-1,5),I(e,r-4,4),i=0;i<r;i++)I(e,e.bl_tree[O[i]*2+1],3);W(e,e.dyn_ltree,t-1),W(e,e.dyn_dtree,n-1)}function q(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var J=!1;function me(e){J||=(R(),!0),e.l_desc=new ie(e.dyn_ltree,ne),e.d_desc=new ie(e.dyn_dtree,F),e.bl_desc=new ie(e.bl_tree,re),e.bi_buf=0,e.bi_valid=0,de(e)}function Y(e,t,n,r){I(e,(s<<1)+ +!!r,3),B(e,t,n,!0)}function he(e){I(e,c<<1,3),L(e,x,A),ce(e)}function ge(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=q(e)),pe(e,e.l_desc),pe(e,e.d_desc),u=G(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?Y(e,t,r,i):e.strategy===n||s===o?(I(e,(c<<1)+ +!!i,3),fe(e,A,j)):(I(e,(l<<1)+ +!!i,3),K(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),fe(e,e.dyn_ltree,e.dyn_dtree)),de(e),i&&z(e)}function X(e,t,n){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]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(N[n]+p+1)*2]++,e.dyn_dtree[ae(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=me,e._tr_stored_block=Y,e._tr_flush_block=ge,e._tr_tally=X,e._tr_align=he})),Be=r(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}t.exports=n})),Ve=r(((e,t)=>{function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),He=r(((e,t)=>{t.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`}})),Ue=r((e=>{var t=Re(),n=ze(),r=Be(),i=Ve(),a=He(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,j=15,M=3,N=258,P=N+M+1,ee=32,te=42,ne=69,F=73,re=91,ie=103,ae=113,oe=666,I=1,L=2,se=3,ce=4,le=3;function ue(e,t){return e.msg=a[t],t}function R(e){return(e<<1)-(e>4?9:0)}function de(e){for(var t=e.length;--t>=0;)e[t]=0}function z(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function B(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,z(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function H(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function fe(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function pe(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+N,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=N-(f-r),r=f-N,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function U(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-P)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=fe(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=M)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+M-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<P&&e.strm.avail_in!==0)}function W(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(U(e),e.lookahead===0&&t===o)return I;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,B(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-P&&(B(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===l?(B(e,!0),e.strm.avail_out===0?se:ce):(e.strstart>e.block_start&&(B(e,!1),e.strm.avail_out),I)}function G(e,t){for(var r,i;;){if(e.lookahead<P){if(U(e),e.lookahead<P&&t===o)return I;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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-P&&(e.match_length=pe(e,r)),e.match_length>=M)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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 i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(B(e,!1),e.strm.avail_out===0))return I}return e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(B(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(B(e,!1),e.strm.avail_out===0)?I:L}function K(e,t){for(var r,i,a;;){if(e.lookahead<P){if(U(e),e.lookahead<P&&t===o)return I;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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=M-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-P&&(e.match_length=pe(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-M,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-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=M-1,e.strstart++,i&&(B(e,!1),e.strm.avail_out===0))return I}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&B(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return I}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(B(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(B(e,!1),e.strm.avail_out===0)?I:L}function q(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=N){if(U(e),e.lookahead<=N&&t===o)return I;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+N;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=N-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=n._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(B(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===l?(B(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(B(e,!1),e.strm.avail_out===0)?I:L}function J(e,t){for(var r;;){if(e.lookahead===0&&(U(e),e.lookahead===0)){if(t===o)return I;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(B(e,!1),e.strm.avail_out===0))return I}return e.insert=0,t===l?(B(e,!0),e.strm.avail_out===0?se:ce):e.last_lit&&(B(e,!1),e.strm.avail_out===0)?I:L}function me(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var Y=[new me(0,0,0,0,W),new me(4,4,8,4,G),new me(4,5,16,8,G),new me(4,6,32,32,G),new me(4,4,16,16,K),new me(8,16,32,32,K),new me(8,16,128,128,K),new me(8,32,128,256,K),new me(32,128,258,1024,K),new me(32,258,258,4096,K)];function he(e){e.window_size=2*e.w_size,de(e.head),e.max_lazy_match=Y[e.level].max_lazy,e.good_match=Y[e.level].good_length,e.nice_match=Y[e.level].nice_length,e.max_chain_length=Y[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function ge(){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=C,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 t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),de(this.dyn_ltree),de(this.dyn_dtree),de(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(j+1),this.heap=new t.Buf16(2*D+1),de(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),de(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 X(e){var t;return!e||!e.state?ue(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?te:ae,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function _e(e){var t=X(e);return t===d&&he(e.state),t}function ve(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function Z(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return ue(e,p);i===8&&(i=9);var c=new ge;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+M-1)/M),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,_e(e)}function Q(e,t){return Z(e,t,C,T,E,x)}function ye(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?ue(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===oe&&t!==l)return ue(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===te)if(a.wrap===2)e.adler=0,V(a,31),V(a,139),V(a,8),a.gzhead?(V(a,+!!a.gzhead.text+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),V(a,a.gzhead.time&255),V(a,a.gzhead.time>>8&255),V(a,a.gzhead.time>>16&255),V(a,a.gzhead.time>>24&255),V(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),V(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(V(a,a.gzhead.extra.length&255),V(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=ne):(V(a,0),V(a,0),V(a,0),V(a,0),V(a,0),V(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),V(a,le),a.status=ae);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=ee),_+=31-_%31,a.status=ae,H(a,_),a.strstart!==0&&(H(a,e.adler>>>16),H(a,e.adler&65535)),e.adler=1}if(a.status===ne)if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),z(e),m=a.pending,a.pending===a.pending_buf_size));)V(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=F)}else a.status=F;if(a.status===F)if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),z(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,V(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=re)}else a.status=re;if(a.status===re)if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),z(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,V(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=ie)}else a.status=ie;if(a.status===ie&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&z(e),a.pending+2<=a.pending_buf_size&&(V(a,e.adler&255),V(a,e.adler>>8&255),e.adler=0,a.status=ae)):a.status=ae),a.pending!==0){if(z(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&R(t)<=R(r)&&t!==l)return ue(e,h);if(a.status===oe&&e.avail_in!==0)return ue(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==oe){var x=a.strategy===v?J(a,t):a.strategy===y?q(a,t):Y[a.level].func(a,t);if((x===se||x===ce)&&(a.status=oe),x===I||x===se)return e.avail_out===0&&(a.last_flush=-1),d;if(x===L&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(de(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),z(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(V(a,e.adler&255),V(a,e.adler>>8&255),V(a,e.adler>>16&255),V(a,e.adler>>24&255),V(a,e.total_in&255),V(a,e.total_in>>8&255),V(a,e.total_in>>16&255),V(a,e.total_in>>24&255)):(H(a,e.adler>>>16),H(a,e.adler&65535)),z(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function be(e){var t;return!e||!e.state?p:(t=e.state.status,t!==te&&t!==ne&&t!==F&&t!==re&&t!==ie&&t!==ae&&t!==oe?ue(e,p):(e.state=null,t===ae?ue(e,m):d))}function xe(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==te||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(de(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,U(a);a.lookahead>=M;){o=a.strstart,s=a.lookahead-(M-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+M-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=M-1,U(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=M-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=Q,e.deflateInit2=Z,e.deflateReset=_e,e.deflateResetKeep=X,e.deflateSetHeader=ve,e.deflate=ye,e.deflateEnd=be,e.deflateSetDictionary=xe,e.deflateInfo=`pako deflate (from Nodeca project)`})),We=r((e=>{var t=Re(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;){if(a=e[n++],a<128){l[r++]=a;continue}if(s=i[a],s>4){l[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;if(s>1){l[r++]=65533;continue}a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),Ge=r(((e,t)=>{function n(){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}t.exports=n})),Ke=r((e=>{var t=Ue(),n=Re(),r=We(),i=He(),a=Ge(),o=Object.prototype.toString,s=0,c=4,l=0,u=1,d=2,f=-1,p=0,m=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==l)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var u=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,u),c!==l)throw Error(i[c]);this._dict_set=!0}}h.prototype.push=function(e,i){var a=this.strm,f=this.options.chunkSize,p,m;if(this.ended)return!1;m=i===~~i?i:i===!0?c:s,typeof e==`string`?a.input=r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(f),a.next_out=0,a.avail_out=f),p=t.deflate(a,m),p!==u&&p!==l)return this.onEnd(p),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(m===c||m===d))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&p!==u);return m===c?(p=t.deflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===l):m===d?(this.onEnd(l),a.avail_out=0,!0):!0},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function g(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function _(e,t){return t||={},t.raw=!0,g(e,t)}function v(e,t){return t||={},t.gzip=!0,g(e,t)}e.Deflate=h,e.deflate=g,e.deflateRaw=_,e.gzip=v})),qe=r(((e,t)=>{var n=30,r=12;t.exports=function(e,t){var i=e.state,a=e.next_in,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.input,O;o=a+(e.avail_in-5),s=e.next_out,O=e.output,c=s-(t-e.avail_out),l=s+(e.avail_out-257),u=i.dmax,d=i.wsize,f=i.whave,p=i.wnext,m=i.window,h=i.hold,g=i.bits,_=i.lencode,v=i.distcode,y=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;top:do{g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=_[h&y];dolen:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S===0)O[s++]=x&65535;else if(S&16){C=x&65535,S&=15,S&&(g<S&&(h+=D[a++]<<g,g+=8),C+=h&(1<<S)-1,h>>>=S,g-=S),g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=v[h&b];dodist:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S&16){if(w=x&65535,S&=15,g<S&&(h+=D[a++]<<g,g+=8,g<S&&(h+=D[a++]<<g,g+=8)),w+=h&(1<<S)-1,w>u){e.msg=`invalid distance too far back`,i.mode=n;break top}if(h>>>=S,g-=S,S=s-c,w>S){if(S=w-S,S>f&&i.sane){e.msg=`invalid distance too far back`,i.mode=n;break top}if(T=0,E=m,p===0){if(T+=d-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}else if(p<S){if(T+=d+p-S,S-=p,S<C){C-=S;do O[s++]=m[T++];while(--S);if(T=0,p<C){S=p,C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}}else if(T+=p-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}for(;C>2;)O[s++]=E[T++],O[s++]=E[T++],O[s++]=E[T++],C-=3;C&&(O[s++]=E[T++],C>1&&(O[s++]=E[T++]))}else{T=s-w;do O[s++]=O[T++],O[s++]=O[T++],O[s++]=O[T++],C-=3;while(C>2);C&&(O[s++]=O[T++],C>1&&(O[s++]=O[T++]))}}else if(S&64){e.msg=`invalid distance code`,i.mode=n;break top}else{x=v[(x&65535)+(h&(1<<S)-1)];continue dodist}break}}else if(!(S&64)){x=_[(x&65535)+(h&(1<<S)-1)];continue dolen}else if(S&32){i.mode=r;break top}else{e.msg=`invalid literal/length code`,i.mode=n;break top}break}}while(a<o&&s<l);C=g>>3,a-=C,g-=C<<3,h&=(1<<g)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<l?257+(l-s):257-(s-l),i.hold=h,i.bits=g}})),Je=r(((e,t)=>{var n=Re(),r=15,i=852,a=592,o=0,s=1,c=2,l=[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],u=[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],d=[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],f=[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];t.exports=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,j,M,N,P,ee=null,te=0,ne,F=new n.Buf16(r+1),re=new n.Buf16(r+1),ie=null,ae=0,oe,I,L;for(b=0;b<=r;b++)F[b]=0;for(x=0;x<m;x++)F[t[p+x]]++;for(w=y,C=r;C>=1&&F[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&F[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=F[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(re[1]=0,b=1;b<r;b++)re[b+1]=re[b]+F[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[re[t[p+x]]++]=x);if(e===o?(ee=ie=_,ne=19):e===s?(ee=l,te-=257,ie=u,ae-=257,ne=256):(ee=d,ie=f,ne=-1),k=0,x=0,b=S,P=g,T=w,E=0,M=-1,O=1<<w,N=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){oe=b-E,_[x]<ne?(I=0,L=_[x]):_[x]>ne?(I=ie[ae+_[x]],L=ee[te+_[x]]):(I=96,L=0),A=1<<b-E,j=1<<T,S=j;do j-=A,h[P+(k>>E)+j]=oe<<24|I<<16|L|0;while(j!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--F[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&N)!==M){for(E===0&&(E=w),P+=S,T=b-E,D=1<<T;T+E<C&&(D-=F[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;M=k&N,h[M]=w<<24|T<<16|P-g|0}}return k!==0&&(h[P+k]=b-E<<24|4194304),v.bits=w,0}})),Ye=r((e=>{var t=Re(),n=Be(),r=Ve(),i=qe(),a=Je(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,N=14,P=15,ee=16,te=17,ne=18,F=19,re=20,ie=21,ae=22,oe=23,I=24,L=25,se=26,ce=27,le=28,ue=29,R=30,de=31,z=32,B=852,V=592,H=15;function fe(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function pe(){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 t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function U(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(B),n.distcode=n.distdyn=new t.Buf32(V),n.sane=1,n.back=-1,f)}function W(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,U(e))}function G(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,W(e))}function K(e,t){var n,r;return e?(r=new pe,e.state=r,r.window=null,n=G(e,t),n!==f&&(e.state=null),n):h}function q(e){return K(e,H)}var J=!0,me,Y;function he(e){if(J){var n;for(me=new t.Buf32(512),Y=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,me,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,Y,0,e.work,{bits:5}),J=!1}e.lencode=me,e.lenbits=9,e.distcode=Y,e.distbits=5}function ge(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function X(e,B){var V,H,pe,U,W,G,K,q,J,me,Y,X,_e,ve,Z=0,Q,ye,be,xe,Se,Ce,$,we,Te=new t.Buf8(4),Ee,De,Oe=[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 h;V=e.state,V.mode===j&&(V.mode=M),W=e.next_out,pe=e.output,K=e.avail_out,U=e.next_in,H=e.input,G=e.avail_in,q=V.hold,J=V.bits,me=G,Y=K,we=f;inf_leave:for(;;)switch(V.mode){case b:if(V.wrap===0){V.mode=M;break}for(;J<16;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(V.wrap&2&&q===35615){V.check=0,Te[0]=q&255,Te[1]=q>>>8&255,V.check=r(V.check,Te,2,0),q=0,J=0,V.mode=x;break}if(V.flags=0,V.head&&(V.head.done=!1),!(V.wrap&1)||(((q&255)<<8)+(q>>8))%31){e.msg=`incorrect header check`,V.mode=R;break}if((q&15)!==y){e.msg=`unknown compression method`,V.mode=R;break}if(q>>>=4,J-=4,$=(q&15)+8,V.wbits===0)V.wbits=$;else if($>V.wbits){e.msg=`invalid window size`,V.mode=R;break}V.dmax=1<<$,e.adler=V.check=1,V.mode=q&512?k:j,q=0,J=0;break;case x:for(;J<16;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(V.flags=q,(V.flags&255)!==y){e.msg=`unknown compression method`,V.mode=R;break}if(V.flags&57344){e.msg=`unknown header flags set`,V.mode=R;break}V.head&&(V.head.text=q>>8&1),V.flags&512&&(Te[0]=q&255,Te[1]=q>>>8&255,V.check=r(V.check,Te,2,0)),q=0,J=0,V.mode=S;case S:for(;J<32;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.head&&(V.head.time=q),V.flags&512&&(Te[0]=q&255,Te[1]=q>>>8&255,Te[2]=q>>>16&255,Te[3]=q>>>24&255,V.check=r(V.check,Te,4,0)),q=0,J=0,V.mode=C;case C:for(;J<16;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.head&&(V.head.xflags=q&255,V.head.os=q>>8),V.flags&512&&(Te[0]=q&255,Te[1]=q>>>8&255,V.check=r(V.check,Te,2,0)),q=0,J=0,V.mode=w;case w:if(V.flags&1024){for(;J<16;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.length=q,V.head&&(V.head.extra_len=q),V.flags&512&&(Te[0]=q&255,Te[1]=q>>>8&255,V.check=r(V.check,Te,2,0)),q=0,J=0}else V.head&&(V.head.extra=null);V.mode=T;case T:if(V.flags&1024&&(X=V.length,X>G&&(X=G),X&&(V.head&&($=V.head.extra_len-V.length,V.head.extra||(V.head.extra=Array(V.head.extra_len)),t.arraySet(V.head.extra,H,U,X,$)),V.flags&512&&(V.check=r(V.check,H,X,U)),G-=X,U+=X,V.length-=X),V.length))break inf_leave;V.length=0,V.mode=E;case E:if(V.flags&2048){if(G===0)break inf_leave;X=0;do $=H[U+ X++],V.head&&$&&V.length<65536&&(V.head.name+=String.fromCharCode($));while($&&X<G);if(V.flags&512&&(V.check=r(V.check,H,X,U)),G-=X,U+=X,$)break inf_leave}else V.head&&(V.head.name=null);V.length=0,V.mode=D;case D:if(V.flags&4096){if(G===0)break inf_leave;X=0;do $=H[U+ X++],V.head&&$&&V.length<65536&&(V.head.comment+=String.fromCharCode($));while($&&X<G);if(V.flags&512&&(V.check=r(V.check,H,X,U)),G-=X,U+=X,$)break inf_leave}else V.head&&(V.head.comment=null);V.mode=O;case O:if(V.flags&512){for(;J<16;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(q!==(V.check&65535)){e.msg=`header crc mismatch`,V.mode=R;break}q=0,J=0}V.head&&(V.head.hcrc=V.flags>>9&1,V.head.done=!0),e.adler=V.check=0,V.mode=j;break;case k:for(;J<32;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}e.adler=V.check=fe(q),q=0,J=0,V.mode=A;case A:if(V.havedict===0)return e.next_out=W,e.avail_out=K,e.next_in=U,e.avail_in=G,V.hold=q,V.bits=J,m;e.adler=V.check=1,V.mode=j;case j:if(B===u||B===d)break inf_leave;case M:if(V.last){q>>>=J&7,J-=J&7,V.mode=ce;break}for(;J<3;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}switch(V.last=q&1,q>>>=1,--J,q&3){case 0:V.mode=N;break;case 1:if(he(V),V.mode=re,B===d){q>>>=2,J-=2;break inf_leave}break;case 2:V.mode=te;break;case 3:e.msg=`invalid block type`,V.mode=R}q>>>=2,J-=2;break;case N:for(q>>>=J&7,J-=J&7;J<32;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if((q&65535)!=(q>>>16^65535)){e.msg=`invalid stored block lengths`,V.mode=R;break}if(V.length=q&65535,q=0,J=0,V.mode=P,B===d)break inf_leave;case P:V.mode=ee;case ee:if(X=V.length,X){if(X>G&&(X=G),X>K&&(X=K),X===0)break inf_leave;t.arraySet(pe,H,U,X,W),G-=X,U+=X,K-=X,W+=X,V.length-=X;break}V.mode=j;break;case te:for(;J<14;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(V.nlen=(q&31)+257,q>>>=5,J-=5,V.ndist=(q&31)+1,q>>>=5,J-=5,V.ncode=(q&15)+4,q>>>=4,J-=4,V.nlen>286||V.ndist>30){e.msg=`too many length or distance symbols`,V.mode=R;break}V.have=0,V.mode=ne;case ne:for(;V.have<V.ncode;){for(;J<3;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.lens[Oe[V.have++]]=q&7,q>>>=3,J-=3}for(;V.have<19;)V.lens[Oe[V.have++]]=0;if(V.lencode=V.lendyn,V.lenbits=7,Ee={bits:V.lenbits},we=a(o,V.lens,0,19,V.lencode,0,V.work,Ee),V.lenbits=Ee.bits,we){e.msg=`invalid code lengths set`,V.mode=R;break}V.have=0,V.mode=F;case F:for(;V.have<V.nlen+V.ndist;){for(;Z=V.lencode[q&(1<<V.lenbits)-1],Q=Z>>>24,ye=Z>>>16&255,be=Z&65535,!(Q<=J);){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(be<16)q>>>=Q,J-=Q,V.lens[V.have++]=be;else{if(be===16){for(De=Q+2;J<De;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(q>>>=Q,J-=Q,V.have===0){e.msg=`invalid bit length repeat`,V.mode=R;break}$=V.lens[V.have-1],X=3+(q&3),q>>>=2,J-=2}else if(be===17){for(De=Q+3;J<De;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}q>>>=Q,J-=Q,$=0,X=3+(q&7),q>>>=3,J-=3}else{for(De=Q+7;J<De;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}q>>>=Q,J-=Q,$=0,X=11+(q&127),q>>>=7,J-=7}if(V.have+X>V.nlen+V.ndist){e.msg=`invalid bit length repeat`,V.mode=R;break}for(;X--;)V.lens[V.have++]=$}}if(V.mode===R)break;if(V.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,V.mode=R;break}if(V.lenbits=9,Ee={bits:V.lenbits},we=a(s,V.lens,0,V.nlen,V.lencode,0,V.work,Ee),V.lenbits=Ee.bits,we){e.msg=`invalid literal/lengths set`,V.mode=R;break}if(V.distbits=6,V.distcode=V.distdyn,Ee={bits:V.distbits},we=a(c,V.lens,V.nlen,V.ndist,V.distcode,0,V.work,Ee),V.distbits=Ee.bits,we){e.msg=`invalid distances set`,V.mode=R;break}if(V.mode=re,B===d)break inf_leave;case re:V.mode=ie;case ie:if(G>=6&&K>=258){e.next_out=W,e.avail_out=K,e.next_in=U,e.avail_in=G,V.hold=q,V.bits=J,i(e,Y),W=e.next_out,pe=e.output,K=e.avail_out,U=e.next_in,H=e.input,G=e.avail_in,q=V.hold,J=V.bits,V.mode===j&&(V.back=-1);break}for(V.back=0;Z=V.lencode[q&(1<<V.lenbits)-1],Q=Z>>>24,ye=Z>>>16&255,be=Z&65535,!(Q<=J);){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(ye&&!(ye&240)){for(xe=Q,Se=ye,Ce=be;Z=V.lencode[Ce+((q&(1<<xe+Se)-1)>>xe)],Q=Z>>>24,ye=Z>>>16&255,be=Z&65535,!(xe+Q<=J);){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}q>>>=xe,J-=xe,V.back+=xe}if(q>>>=Q,J-=Q,V.back+=Q,V.length=be,ye===0){V.mode=se;break}if(ye&32){V.back=-1,V.mode=j;break}if(ye&64){e.msg=`invalid literal/length code`,V.mode=R;break}V.extra=ye&15,V.mode=ae;case ae:if(V.extra){for(De=V.extra;J<De;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.length+=q&(1<<V.extra)-1,q>>>=V.extra,J-=V.extra,V.back+=V.extra}V.was=V.length,V.mode=oe;case oe:for(;Z=V.distcode[q&(1<<V.distbits)-1],Q=Z>>>24,ye=Z>>>16&255,be=Z&65535,!(Q<=J);){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(!(ye&240)){for(xe=Q,Se=ye,Ce=be;Z=V.distcode[Ce+((q&(1<<xe+Se)-1)>>xe)],Q=Z>>>24,ye=Z>>>16&255,be=Z&65535,!(xe+Q<=J);){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}q>>>=xe,J-=xe,V.back+=xe}if(q>>>=Q,J-=Q,V.back+=Q,ye&64){e.msg=`invalid distance code`,V.mode=R;break}V.offset=be,V.extra=ye&15,V.mode=I;case I:if(V.extra){for(De=V.extra;J<De;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}V.offset+=q&(1<<V.extra)-1,q>>>=V.extra,J-=V.extra,V.back+=V.extra}if(V.offset>V.dmax){e.msg=`invalid distance too far back`,V.mode=R;break}V.mode=L;case L:if(K===0)break inf_leave;if(X=Y-K,V.offset>X){if(X=V.offset-X,X>V.whave&&V.sane){e.msg=`invalid distance too far back`,V.mode=R;break}X>V.wnext?(X-=V.wnext,_e=V.wsize-X):_e=V.wnext-X,X>V.length&&(X=V.length),ve=V.window}else ve=pe,_e=W-V.offset,X=V.length;X>K&&(X=K),K-=X,V.length-=X;do pe[W++]=ve[_e++];while(--X);V.length===0&&(V.mode=ie);break;case se:if(K===0)break inf_leave;pe[W++]=V.length,K--,V.mode=ie;break;case ce:if(V.wrap){for(;J<32;){if(G===0)break inf_leave;G--,q|=H[U++]<<J,J+=8}if(Y-=K,e.total_out+=Y,V.total+=Y,Y&&(e.adler=V.check=V.flags?r(V.check,pe,Y,W-Y):n(V.check,pe,Y,W-Y)),Y=K,(V.flags?q:fe(q))!==V.check){e.msg=`incorrect data check`,V.mode=R;break}q=0,J=0}V.mode=le;case le:if(V.wrap&&V.flags){for(;J<32;){if(G===0)break inf_leave;G--,q+=H[U++]<<J,J+=8}if(q!==(V.total&4294967295)){e.msg=`incorrect length check`,V.mode=R;break}q=0,J=0}V.mode=ue;case ue:we=p;break inf_leave;case R:we=g;break inf_leave;case de:return _;case z:default:return h}return e.next_out=W,e.avail_out=K,e.next_in=U,e.avail_in=G,V.hold=q,V.bits=J,(V.wsize||Y!==e.avail_out&&V.mode<R&&(V.mode<ce||B!==l))&&ge(e,e.output,e.next_out,Y-e.avail_out)?(V.mode=de,_):(me-=e.avail_in,Y-=e.avail_out,e.total_in+=me,e.total_out+=Y,V.total+=Y,V.wrap&&Y&&(e.adler=V.check=V.flags?r(V.check,pe,Y,e.next_out-Y):n(V.check,pe,Y,e.next_out-Y)),e.data_type=V.bits+(V.last?64:0)+(V.mode===j?128:0)+(V.mode===re||V.mode===P?256:0),(me===0&&Y===0||B===l)&&we===f&&(we=v),we)}function _e(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function ve(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function Z(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=ge(e,t,r,r),o?(i.mode=de,_):(i.havedict=1,f))}e.inflateReset=W,e.inflateReset2=G,e.inflateResetKeep=U,e.inflateInit=q,e.inflateInit2=K,e.inflate=X,e.inflateEnd=_e,e.inflateGetHeader=ve,e.inflateSetDictionary=Z,e.inflateInfo=`pako inflate (from Nodeca project)`})),Xe=r(((e,t)=>{t.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}})),Ze=r(((e,t)=>{function n(){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}t.exports=n})),Qe=r((e=>{var t=Ye(),n=Re(),r=We(),i=Xe(),a=He(),o=Ge(),s=Ze(),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(e&&e.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15||(u.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var d=t.inflateInit2(this.strm,u.windowBits);if(d!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),u.dictionary&&(typeof u.dictionary==`string`?u.dictionary=r.string2buf(u.dictionary):c.call(u.dictionary)===`[object ArrayBuffer]`&&(u.dictionary=new Uint8Array(u.dictionary)),u.raw&&(d=t.inflateSetDictionary(this.strm,u.dictionary),d!==i.Z_OK))))throw Error(a[d])}l.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,l=this.options.dictionary,u,d,f,p,m,h=!1;if(this.ended)return!1;d=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,typeof e==`string`?o.input=r.binstring2buf(e):c.call(e)===`[object ArrayBuffer]`?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),u=t.inflate(o,i.Z_NO_FLUSH),u===i.Z_NEED_DICT&&l&&(u=t.inflateSetDictionary(this.strm,l)),u===i.Z_BUF_ERROR&&h===!0&&(u=i.Z_OK,h=!1),u!==i.Z_STREAM_END&&u!==i.Z_OK)return this.onEnd(u),this.ended=!0,!1;o.next_out&&(o.avail_out===0||u===i.Z_STREAM_END||o.avail_in===0&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(f=r.utf8border(o.output,o.next_out),p=o.next_out-f,m=r.buf2string(o.output,f),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,f,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&u!==i.Z_STREAM_END);return u===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(u=t.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===i.Z_OK):d===i.Z_SYNC_FLUSH?(this.onEnd(i.Z_OK),o.avail_out=0,!0):!0},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===i.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function u(e,t){var n=new l(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function d(e,t){return t||={},t.raw=!0,u(e,t)}e.Inflate=l,e.inflate=u,e.inflateRaw=d,e.ungzip=u})),$e=r(((e,t)=>{var n=Re().assign,r=Ke(),i=Qe(),a=Xe(),o={};n(o,r,i,a),t.exports=o})),et=r(((e,t)=>{function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t,r){return t=t instanceof RegExp?t:new RegExp(n(t),`g`),e.replace(t,r)}t.exports={clean:function(e){if(typeof e!=`string`)throw Error(`Expected a string, received: `+e);return e=r(e,`./`,`/`),e=r(e,`..`,`.`),e=r(e,` `,`-`),e=r(e,/^[~^:?*\\\-]/g,``),e=r(e,/[~^:?*\\]/g,`-`),e=r(e,/[~^:?*\\\-]$/g,``),e=r(e,`@{`,`-`),e=r(e,/\.$/g,``),e=r(e,/\/$/g,``),e=r(e,/\.lock$/g,``),e}}})),tt=r(((e,t)=>{t.exports=function(e,t){var n=e,r=t,i=n.length,a=r.length,o=!1,s=null,c=i+1,l=[],u=[],d=[],f=``,p=-1,m=0,h=1,g,_,v=function(){i>=a&&(g=n,_=i,n=r,r=g,i=a,a=_,o=!0,c=i+1)},y=function(e,t,n){return{x:e,y:t,k:n}},b=function(e,t){return{elem:e,t}},x=function(e,t,o){var s=t>o?l[e-1+c]:l[e+1+c],d,f=Math.max(t,o);for(d=f-e;d<i&&f<a&&n[d]===r[f];)++d,++f;return l[e+c]=u.length,u[u.length]=new y(d,f,s),f},S=function(e){var t=i=1,i,a=s=0,s,c;for(c=e.length-1;c>=0;--c)for(;a<e[c].x||s<e[c].y;)e[c].y-e[c].x>s-a?(o?d[d.length]=new b(r[s],p):d[d.length]=new b(r[s],h),++i,++s):e[c].y-e[c].x<s-a?(o?d[d.length]=new b(n[a],h):d[d.length]=new b(n[a],p),++t,++a):(d[d.length]=new b(n[a],m),f+=n[a],++t,++i,++a,++s)};return v(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return s},getlcs:function(){return f},getses:function(){return d},compose:function(){var e=a-i,t=i+a+3,n={},r,o,d,f,p;for(f=0;f<t;++f)n[f]=-1,l[f]=-1;r=-1;do{for(++r,p=-r;p<=e-1;++p)n[p+c]=x(p,n[p-1+c]+1,n[p+1+c]);for(p=e+r;p>=e+1;--p)n[p+c]=x(p,n[p-1+c]+1,n[p+1+c]);n[e+c]=x(e,n[e-1+c]+1,n[e+1+c])}while(n[e+c]!==a);for(s=e+2*r,o=l[e+c],d=[];o!==-1;)d[d.length]=new y(u[o].x,u[o].y,null),o=u[o].k;S(d)}}}})),nt=r(((e,t)=>{var n=tt();function r(e,t){var r=new n(e,t);r.compose();for(var i=r.getses(),a,o,s=e.length-1,c=t.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:c,chain:null},o=o.chain):(a={file1index:s,file2index:c,chain:null},o=a),s--,c--):i[l].t===r.SES_DELETE?s--:i[l].t===r.SES_ADD&&c--;var u={file1index:-1,file2index:-1,chain:null};return o?(o.chain=u,a):u}function i(e,t){for(var n=[],i=e.length,a=t.length,o=r(e,t);o!==null;o=o.chain){var s=i-o.file1index-1,c=a-o.file2index-1;i=o.file1index,a=o.file2index,(s||c)&&n.push({file1:[i+1,s],file2:[a+1,c]})}return n.reverse(),n}function a(e,t,n){var r,a=i(t,e),o=i(t,n),s=[];function c(e,t){s.push([e.file1[0],t,e.file1[1],e.file2[0],e.file2[1]])}for(r=0;r<a.length;r++)c(a[r],0);for(r=0;r<o.length;r++)c(o[r],2);s.sort(function(e,t){return e[0]-t[0]});var l=[],u=0;function d(e){e>u&&(l.push([1,u,e-u]),u=e)}for(var f=0;f<s.length;f++){for(var p=f,m=s[f],h=m[0],g=h+m[2];f<s.length-1;){var _=s[f+1],v=_[0];if(v>g)break;g=Math.max(g,v+_[2]),f++}if(d(h),p==f)m[4]>0&&l.push([m[1],m[3],m[4]]);else{var y={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=p;r<=f;r++){m=s[r];var b=y[m[1]],x=m[0],S=x+m[2],C=m[3],w=C+m[4];b[0]=Math.min(C,b[0]),b[1]=Math.max(w,b[1]),b[2]=Math.min(x,b[2]),b[3]=Math.max(S,b[3])}var T=y[0][0]+(h-y[0][2]),E=y[0][1]+(g-y[0][3]),D=y[2][0]+(h-y[2][2]),O=y[2][1]+(g-y[2][3]);l.push([-1,T,E-T,h,g-h,D,O-D])}u=g}return d(t.length),l}function o(e,t,n){var r=[],i=[e,t,n],o=a(e,t,n),s=[];function c(){s.length&&r.push({ok:s}),s=[]}function l(e){for(var t=0;t<e.length;t++)s.push(e[t])}function u(t){if(t[2]!=t[6])return!0;for(var r=t[1],i=t[5],a=0;a<t[2];a++)if(e[a+r]!=n[a+i])return!0;return!1}for(var d=0;d<o.length;d++){var f=o[d],p=f[0];p==-1?u(f)?(c(),r.push({conflict:{a:e.slice(f[1],f[1]+f[2]),aIndex:f[1],o:t.slice(f[3],f[3]+f[4]),oIndex:f[3],b:n.slice(f[5],f[5]+f[6]),bIndex:f[5]}})):l(i[0].slice(f[1],f[1]+f[2])):l(i[p].slice(f[1],f[1]+f[2]))}return c(),r}t.exports=o})),rt=o(r((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e){return e&&typeof e==`object`&&`default`in e?e.default:e}var n=t(ee()),r=t(Ie()),i=t(Le()),a=t($e()),o=l(`crypto`),s=t(m()),c=t(y());t(et()),t(nt());var u=class e extends Error{constructor(e){super(e),this.caller=``}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){let n=new e(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}},d=class e extends u{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}}};d.code=`UnmergedPathsError`;var f=class e extends u{constructor(t){super(`An internal error caused this command to fail.\n\nIf you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.\n\nPlease file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=e.code,this.data={message:t}}};f.code=`InternalError`;var p=class e extends u{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=e.code,this.data={filepath:t}}};p.code=`UnsafeFilepathError`;var h=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let t=this.buffer.slice(this._start,this._start+e);return this._start+=e,t}toString(e,t){let n=this.buffer.toString(e,this._start,this._start+t);return this._start+=t,n}write(e,t,n){let r=this.buffer.write(e,this._start,t,n);return this._start+=t,r}copy(e,t,n){let r=e.copy(this.buffer,this._start,t,n);return this._start+=r,r}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let t=this.buffer.writeUInt8(e,this._start);return this._start+=1,t}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let t=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,t}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let t=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,t}};function g(e,t){return-(e<t)||+(e>t)}function _(e,t){return g(e.path,t.path)}function v(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n=n&73?493:420,t!==8&&(n=0),(t<<12)+n}let b=2**32;function x(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());let i=Math.floor(n/1e3);return[i,(n-i*1e3)*1e6]}function S(e){let[t,n]=x(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,i]=x(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%b,ctimeNanoseconds:n%b,mtimeSeconds:r%b,mtimeNanoseconds:i%b,dev:e.dev%b,ino:e.ino%b,mode:v(e.mode%b),uid:e.uid%b,gid:e.gid%b,size:e.size>-1?e.size%b:0}}function C(e){let t=``;for(let n of new Uint8Array(e))n<16&&(t+=`0`),t+=n.toString(16);return t}let w=null;async function T(e){return w===null&&(w=await O()),w?D(e):E(e)}function E(e){return new r().update(e).digest(`hex`)}async function D(e){return C(await crypto.subtle.digest(`SHA-1`,e))}async function O(){try{return await D(new Uint8Array([]))===`da39a3ee5e6b4b0d3255bfef95601890afd80709`}catch{}return!1}function k(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function A(e){let t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}var j=class e{constructor(e,t){this._dirty=!1,this._unmergedPaths=t||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let t=this._entries.get(e.path);t||=(this._entries.set(e.path,e),e),t.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(t){if(Buffer.isBuffer(t))return e.fromBuffer(t);if(t===null)return new e(null);throw new f(`invalid type passed to GitIndex.from`)}static async fromBuffer(t){if(t.length===0)throw new f(`Index file is empty (.git/index)`);let n=new e,r=new h(t),i=r.toString(`utf8`,4);if(i!==`DIRC`)throw new f(`Invalid dircache magic file number: ${i}`);let a=await T(t.slice(0,-20)),o=t.slice(-20).toString(`hex`);if(o!==a)throw new f(`Invalid checksum in GitIndex buffer: expected ${o} but saw ${a}`);let s=r.readUInt32BE();if(s!==2)throw new f(`Unsupported dircache version: ${s}`);let c=r.readUInt32BE(),l=0;for(;!r.eof()&&l<c;){let e={};e.ctimeSeconds=r.readUInt32BE(),e.ctimeNanoseconds=r.readUInt32BE(),e.mtimeSeconds=r.readUInt32BE(),e.mtimeNanoseconds=r.readUInt32BE(),e.dev=r.readUInt32BE(),e.ino=r.readUInt32BE(),e.mode=r.readUInt32BE(),e.uid=r.readUInt32BE(),e.gid=r.readUInt32BE(),e.size=r.readUInt32BE(),e.oid=r.slice(20).toString(`hex`),e.flags=k(r.readUInt16BE());let i=t.indexOf(0,r.tell()+1)-r.tell();if(i<1)throw new f(`Got a path length of: ${i}`);if(e.path=r.toString(`utf8`,i),e.path.includes(`..\\`)||e.path.includes(`../`))throw new p(e.path);let a=8-(r.tell()-12)%8;for(a===0&&(a=8);a--;){let t=r.readUInt8();if(t!==0)throw new f(`Expected 1-8 null characters but got '${t}' after ${e.path}`);if(r.eof())throw new f(`Unexpected end of file`)}e.stages=[],n._addEntry(e),l++}return n}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(_)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(e=>e):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:t,oid:n,stage:r=0}){t||={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0},t=S(t);let i=Buffer.from(e),a={ctimeSeconds:t.ctimeSeconds,ctimeNanoseconds:t.ctimeNanoseconds,mtimeSeconds:t.mtimeSeconds,mtimeNanoseconds:t.mtimeNanoseconds,dev:t.dev,ino:t.ino,mode:t.mode||33188,uid:t.uid,gid:t.gid,size:t.size,path:e,oid:n,flags:{assumeValid:!1,extended:!1,stage:r,nameLength:i.length<4095?i.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let t of this._entries.keys())t.startsWith(e+`/`)&&this._entries.delete(t);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(`
`)}static async _entryToBuffer(e){let t=Buffer.from(e.path),n=Math.ceil((62+t.length+1)/8)*8,r=Buffer.alloc(n),i=new h(r),a=S(e);return i.writeUInt32BE(a.ctimeSeconds),i.writeUInt32BE(a.ctimeNanoseconds),i.writeUInt32BE(a.mtimeSeconds),i.writeUInt32BE(a.mtimeNanoseconds),i.writeUInt32BE(a.dev),i.writeUInt32BE(a.ino),i.writeUInt32BE(a.mode),i.writeUInt32BE(a.uid),i.writeUInt32BE(a.gid),i.writeUInt32BE(a.size),i.write(e.oid,20,`hex`),i.writeUInt16BE(A(e)),i.write(e.path,t.length,`utf8`),r}async toObject(){let t=Buffer.alloc(12),n=new h(t);n.write(`DIRC`,4,`utf8`),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(let t of this.entries)if(r.push(e._entryToBuffer(t)),t.stages.length>1)for(let n of t.stages)n&&n!==t&&r.push(e._entryToBuffer(n));r=await Promise.all(r);let i=Buffer.concat(r),a=Buffer.concat([t,i]),o=await T(a);return Buffer.concat([a,Buffer.from(o,`hex`)])}};function M(e,t,n=!0,r=!0){let i=S(e),a=S(t);return n&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||r&&i.ino!==a.ino||i.size!==a.size}let N=null,P=Symbol(`IndexCache`);function te(){return{map:new Map,stats:new Map}}async function ne(e,t,n){let[r,i]=await Promise.all([e.lstat(t),e.read(t)]),a=await j.from(i);n.map.set(t,a),n.stats.set(t,r)}async function F(e,t,n){let r=n.stats.get(t);if(r===void 0)return!0;if(r===null)return!1;let i=await e.lstat(t);return i===null?!1:M(r,i)}var re=class{static async acquire({fs:e,gitdir:t,cache:r,allowUnmerged:i=!0},a){r[P]||(r[P]=te());let o=`${t}/index`;N===null&&(N=new n({maxPending:1/0}));let s,c=[];return await N.acquire(o,async()=>{let t=r[P];await F(e,o,t)&&await ne(e,o,t);let n=t.map.get(o);if(c=n.unmergedPaths,c.length&&!i)throw new d(c);if(s=await a(n),n._dirty){let r=await n.toObject();await e.write(o,r),t.stats.set(o,await e.lstat(o)),n._dirty=!1}}),s}};function ie(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>-1&&(e=e.slice(t+1)),e}function ae(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t===-1?`.`:t===0?`/`:e.slice(0,t)}let oe=Symbol(`GitWalkSymbol`);var I=class e extends u{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};I.code=`NotFoundError`;var L=class e extends u{constructor(t,n,r,i){super(`Object ${t} ${i?`at ${i}`:``}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=e.code,this.data={oid:t,actual:n,expected:r,filepath:i}}};L.code=`ObjectTypeError`;var se=class e extends u{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};se.code=`InvalidOidError`;var ce=class e extends u{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
[remote "${t}"]
\tfetch = +refs/heads/*:refs/remotes/origin/*
`),this.code=this.name=e.code,this.data={remote:t}}};ce.code=`NoRefspecError`;var le=class e{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let t=null;this.parsedConfig=e.trim().split(`
`).map(e=>{if(/^\s*#/.test(e))return{line:e,comment:!0};let n=e.indexOf(` `);if(e.startsWith(`^`)){let n=e.slice(1);return this.refs.set(t+`^{}`,n),{line:e,ref:t,peeled:n}}else{let r=e.slice(0,n);return t=e.slice(n+1),this.refs.set(t,r),{line:e,ref:t,oid:r}}})}return this}static from(t){return new e(t)}delete(e){this.parsedConfig=this.parsedConfig.filter(t=>t.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
`)+`
`}},ue=class e{constructor({remotePath:e,localPath:t,force:n,matchPrefix:r}){Object.assign(this,{remotePath:e,localPath:t,force:n,matchPrefix:r})}static from(t){let[n,r,i,a,o]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),s=n===`+`,c=i===`*`;if(c!==(o===`*`))throw new f(`Invalid refspec`);return new e({remotePath:r,localPath:a,force:s,matchPrefix:c})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,``)}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,``)}else if(e===this.localPath)return this.remotePath;return null}},R=class e{constructor(e=[]){this.rules=e}static from(t){let n=[];for(let e of t)n.push(ue.from(e));return new e(n)}add(e){let t=ue.from(e);this.rules.push(t)}translate(e){let t=[];for(let n of this.rules)for(let r of e){let e=n.translate(r);e&&t.push([r,e])}return t}translateOne(e){let t=null;for(let n of this.rules){let r=n.translate(e);r&&(t=r)}return t}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,``))}};function de(e,t){let n=e.replace(/\^\{\}$/,``),r=t.replace(/\^\{\}$/,``),i=-(n<r)||+(n>r);return i===0?e.endsWith(`^{}`)?1:-1:i}function z(e,t){let n=``,r=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;else o=`/`;if(o===`/`){if(!(i===s-1||a===1))if(a===2){if(n.length<2||r!==2||n.at(-1)!==`.`||n.at(-2)!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}else if(n.length!==0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}function B(e){if(!e.length)return`.`;let t=e[0]===`/`,n=e.at(-1)===`/`;return e=z(e,!t),e.length?(n&&(e+=`/`),t?`/${e}`:e):t?`/`:n?`./`:`.`}function V(...e){if(e.length===0)return`.`;let t;for(let n=0;n<e.length;++n){let r=e[n];r.length>0&&(t===void 0?t=r:t+=`/`+r)}return t===void 0?`.`:B(t)}let H=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},fe=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}`)},pe={core:{filemode:fe,bare:fe,logallrefupdates:fe,symlinks:fe,ignorecase:fe,bigFileThreshold:H}},U=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,W=/^[A-Za-z0-9-.]+$/,G=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,K=/^[A-Za-z][A-Za-z-]*$/,q=/^(.*?)( *[#;].*)$/,J=e=>{let t=U.exec(e);if(t!=null){let[e,n]=t.slice(1);return[e,n]}return null},me=e=>{let t=G.exec(e);if(t!=null){let[e,n=`true`]=t.slice(1);return[e,ge(Y(n))]}return null},Y=e=>{let t=q.exec(e);if(t==null)return e;let[n,r]=t.slice(1);return he(n)&&he(r)?`${n}${r}`:n},he=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!=0,ge=e=>e.split(``).reduce((e,t,n,r)=>{let i=t===`"`&&r[n-1]!==`\\`,a=t===`\\`&&r[n+1]===`"`;return i||a?e:e+t},``),X=e=>e==null?null:e.toLowerCase(),_e=(e,t,n)=>[X(e),t,X(n)].filter(e=>e!=null).join(`.`),ve=e=>{let t=e.split(`.`),n=t.shift(),r=t.pop(),i=t.length?t.join(`.`):void 0;return{section:n,subsection:i,name:r,path:_e(n,i,r),sectionPath:_e(n,i,null),isSection:!!n}},Z=(e,t)=>e.reduce((e,n,r)=>t(n)?r:e,-1);var Q=class e{constructor(e){let t=null,n=null;this.parsedConfig=e?e.split(`
`).map(e=>{let r=null,i=null,a=e.trim(),o=J(a),s=o!=null;if(s)[t,n]=o;else{let e=me(a);e!=null&&([r,i]=e)}let c=_e(t,n,r);return{line:e,isSection:s,section:t,subsection:n,name:r,value:i,path:c}}):[]}static from(t){return new e(t)}async get(e,t=!1){let n=ve(e).path,r=this.parsedConfig.filter(e=>e.path===n).map(({section:e,name:t,value:n})=>{let r=pe[e]&&pe[e][t];return r?r(n):n});return t?r:r.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(t=>t.isSection&&t.section===e).map(e=>e.subsection)}async deleteSection(e,t){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===e&&n.subsection===t))}async append(e,t){return this.set(e,t,!0)}async set(e,t,n=!1){let{section:r,subsection:i,name:a,path:o,sectionPath:s,isSection:c}=ve(e),l=Z(this.parsedConfig,e=>e.path===o);if(t==null)l!==-1&&this.parsedConfig.splice(l,1);else if(l!==-1){let e=this.parsedConfig[l],r=Object.assign({},e,{name:a,value:t,modified:!0});n?this.parsedConfig.splice(l+1,0,r):this.parsedConfig[l]=r}else{let e=this.parsedConfig.findIndex(e=>e.path===s),n={section:r,subsection:i,name:a,value:t,modified:!0,path:o};if(W.test(r)&&K.test(a))if(e>=0)this.parsedConfig.splice(e+1,0,n);else{let e={isSection:c,section:r,subsection:i,modified:!0,path:s};this.parsedConfig.push(e,n)}}}toString(){return this.parsedConfig.map(({line:e,section:t,subsection:n,name:r,value:i,modified:a=!1})=>a?r!=null&&i!=null?typeof i==`string`&&/[#;]/.test(i)?`\t${r} = "${i}"`:`\t${r} = ${i}`:n==null?`[${t}]`:`[${t} "${n}"]`:e).join(`
`)}},ye=class{static async get({fs:e,gitdir:t}){let n=await e.read(`${t}/config`,{encoding:`utf8`});return Q.from(n)}static async save({fs:e,gitdir:t,config:n}){await e.write(`${t}/config`,n.toString(),{encoding:`utf8`})}};let be=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],xe=[`config`,`description`,`index`,`shallow`,`commondir`],Se;async function Ce(e,t){return Se===void 0&&(Se=new n),Se.acquire(e,t)}var $=class e{static async updateRemoteRefs({fs:t,gitdir:n,remote:r,refs:i,symrefs:a,tags:o,refspecs:s=void 0,prune:c=!1,pruneTags:l=!1}){for(let e of i.values())if(!e.match(/[0-9a-f]{40}/))throw new se(e);let u=await ye.get({fs:t,gitdir:n});if(!s){if(s=await u.getall(`remote.${r}.fetch`),s.length===0)throw new ce(r);s.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}let d=R.from(s),f=new Map;if(l){let r=await e.listRefs({fs:t,gitdir:n,filepath:`refs/tags`});await e.deleteRefs({fs:t,gitdir:n,refs:r.map(e=>`refs/tags/${e}`)})}if(o){for(let r of i.keys())if(r.startsWith(`refs/tags`)&&!r.endsWith(`^{}`)&&!await e.exists({fs:t,gitdir:n,ref:r})){let e=i.get(r);f.set(r,e)}}let p=d.translate([...i.keys()]);for(let[e,t]of p){let n=i.get(e);f.set(t,n)}let m=d.translate([...a.keys()]);for(let[e,t]of m){let n=a.get(e),r=d.translateOne(n);r&&f.set(t,`ref: ${r}`)}let h=[];if(c){for(let r of d.localNamespaces()){let i=(await e.listRefs({fs:t,gitdir:n,filepath:r})).map(e=>`${r}/${e}`);for(let e of i)f.has(e)||h.push(e)}h.length>0&&await e.deleteRefs({fs:t,gitdir:n,refs:h})}for(let[e,r]of f)await Ce(e,async()=>t.write(V(n,e),`${r.trim()}\n`,`utf8`));return{pruned:h}}static async writeRef({fs:e,gitdir:t,ref:n,value:r}){if(!r.match(/[0-9a-f]{40}/))throw new se(r);await Ce(n,async()=>e.write(V(t,n),`${r.trim()}\n`,`utf8`))}static async writeSymbolicRef({fs:e,gitdir:t,ref:n,value:r}){await Ce(n,async()=>e.write(V(t,n),`ref: ${r.trim()}\n`,`utf8`))}static async deleteRef({fs:t,gitdir:n,ref:r}){return e.deleteRefs({fs:t,gitdir:n,refs:[r]})}static async deleteRefs({fs:e,gitdir:t,refs:n}){await Promise.all(n.map(n=>e.rm(V(t,n))));let r=await Ce(`packed-refs`,async()=>e.read(`${t}/packed-refs`,{encoding:`utf8`})),i=le.from(r),a=i.refs.size;for(let e of n)i.refs.has(e)&&i.delete(e);i.refs.size<a&&(r=i.toString(),await Ce(`packed-refs`,async()=>e.write(`${t}/packed-refs`,r,{encoding:`utf8`})))}static async resolve({fs:t,gitdir:n,ref:r,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return r;if(r.startsWith(`ref: `))return r=r.slice(5),e.resolve({fs:t,gitdir:n,ref:r,depth:i});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let a=await e.packedRefs({fs:t,gitdir:n}),o=be(r).filter(e=>!xe.includes(e));for(let r of o){let o=await Ce(r,async()=>await t.read(`${n}/${r}`,{encoding:`utf8`})||a.get(r));if(o)return e.resolve({fs:t,gitdir:n,ref:o.trim(),depth:i})}throw new I(r)}static async exists({fs:t,gitdir:n,ref:r}){try{return await e.expand({fs:t,gitdir:n,ref:r}),!0}catch{return!1}}static async expand({fs:t,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let i=await e.packedRefs({fs:t,gitdir:n}),a=be(r);for(let e of a)if(await Ce(e,async()=>t.exists(`${n}/${e}`))||i.has(e))return e;throw new I(r)}static async expandAgainstMap({ref:e,map:t}){let n=be(e);for(let e of n)if(await t.has(e))return e;throw new I(e)}static resolveAgainstMap({ref:t,fullref:n=t,depth:r=void 0,map:i}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:t};if(t.startsWith(`ref: `))return t=t.slice(5),e.resolveAgainstMap({ref:t,fullref:n,depth:r,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:n,oid:t};let a=be(t);for(let t of a){let n=i.get(t);if(n)return e.resolveAgainstMap({ref:n.trim(),fullref:t,depth:r,map:i})}throw new I(t)}static async packedRefs({fs:e,gitdir:t}){let n=await Ce(`packed-refs`,async()=>e.read(`${t}/packed-refs`,{encoding:`utf8`}));return le.from(n).refs}static async listRefs({fs:t,gitdir:n,filepath:r}){let i=e.packedRefs({fs:t,gitdir:n}),a=null;try{a=await t.readdirDeep(`${n}/${r}`),a=a.map(e=>e.replace(`${n}/${r}/`,``))}catch{a=[]}for(let e of(await i).keys())e.startsWith(r)&&(e=e.replace(r+`/`,``),a.includes(e)||a.push(e));return a.sort(de),a}static async listBranches({fs:t,gitdir:n,remote:r}){return r?e.listRefs({fs:t,gitdir:n,filepath:`refs/remotes/${r}`}):e.listRefs({fs:t,gitdir:n,filepath:`refs/heads`})}static async listTags({fs:t,gitdir:n}){return(await e.listRefs({fs:t,gitdir:n,filepath:`refs/tags`})).filter(e=>!e.endsWith(`^{}`))}};function we(e,t){return g(Te(e),Te(t))}function Te(e){return e.mode===`040000`?e.path+`/`:e.path}function Ee(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 f(`Unexpected GitTree entry mode: ${e}`)}function De(e){let t=[],n=0;for(;n<e.length;){let r=e.indexOf(32,n);if(r===-1)throw new f(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next space character.`);let i=e.indexOf(0,n);if(i===-1)throw new f(`GitTree: Error parsing buffer at byte location ${n}: Could not find the next null character.`);let a=e.slice(n,r).toString(`utf8`);a===`40000`&&(a=`040000`);let o=Ee(a),s=e.slice(r+1,i).toString(`utf8`);if(s.includes(`\\`)||s.includes(`/`))throw new p(s);let c=e.slice(i+1,i+21).toString(`hex`);n=i+21,t.push({mode:a,path:s,oid:c,type:o})}return t}function Oe(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 f(`Could not understand file mode: ${e}`)}function ke(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=Oe(e.mode),e.type||=Ee(e.mode),e}var Ae=class e{constructor(e){if(Buffer.isBuffer(e))this._entries=De(e);else if(Array.isArray(e))this._entries=e.map(ke);else throw new f(`invalid type passed to GitTree constructor`);this._entries.sort(_)}static from(t){return new e(t)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
`)}toObject(){let e=[...this._entries];return e.sort(we),Buffer.concat(e.map(e=>{let t=Buffer.from(e.mode.replace(/^0/,``)),n=Buffer.from(` `),r=Buffer.from(e.path,`utf8`),i=Buffer.from([0]),a=Buffer.from(e.oid,`hex`);return Buffer.concat([t,n,r,i,a])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},je=class{static wrap({type:e,object:t}){let n=`${e} ${t.length}\x00`,r=n.length,i=r+t.length,a=new Uint8Array(i);for(let e=0;e<r;e++)a[e]=n.charCodeAt(e);return a.set(t,r),a}static unwrap(e){let t=e.indexOf(32),n=e.indexOf(0),r=e.slice(0,t).toString(`utf8`),i=e.slice(t+1,n).toString(`utf8`),a=e.length-(n+1);if(parseInt(i)!==a)throw new f(`Length mismatch: expected ${i} bytes but got ${a} instead.`);return{type:r,object:Buffer.from(e.slice(n+1))}}};async function Me({fs:e,gitdir:t,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`,i=await e.read(`${t}/${r}`);return i?{object:i,format:`deflated`,source:r}:null}function Ne(e,t){let n=new h(e),r=Pe(n);if(r!==t.byteLength)throw new f(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);let i=Pe(n),a,o=Re(n,t);if(o.byteLength===i)a=o;else{a=Buffer.alloc(i);let e=new h(a);for(e.copy(o);!n.eof();)e.copy(Re(n,t));let r=e.tell();if(i!==r)throw new f(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${r} bytes`)}return a}function Pe(e){let t=0,n=0,r=null;do r=e.readUInt8(),t|=(r&127)<<n,n+=7;while(r&128);return t}function Fe(e,t,n){let r=0,i=0;for(;n--;)t&1&&(r|=e.readUInt8()<<i),t>>=1,i+=8;return r}function Re(e,t){let n=e.readUInt8();if(n&128){let r=Fe(e,n&15,4),i=Fe(e,(n&112)>>4,3);return i===0&&(i=65536),t.slice(r,r+i)}else return e.slice(n)}function ze(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function Be(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:ze(e)}var Ve=class{constructor(e){if(typeof Buffer>`u`)throw Error(`Missing Buffer dependency`);this.stream=Be(e),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(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:t}=await this.stream.next();return e&&(this._ended=!0,!t)?Buffer.alloc(0):(t&&=Buffer.from(t),t)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let t=[this.buffer];for(;this.cursor+e>He(t);){let e=await this._next();if(this._ended)break;t.push(e)}this.buffer=Buffer.concat(t)}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 He(e){return e.reduce((e,t)=>e+t.length,0)}async function Ue(e,t){let n=new Ve(e),r=await n.read(4);if(r=r.toString(`utf8`),r!==`PACK`)throw new f(`Invalid PACK header '${r}'`);let i=await n.read(4);if(i=i.readUInt32BE(0),i!==2)throw new f(`Invalid packfile version: ${i}`);let o=await n.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!n.eof()&&o--;){let e=n.tell(),{type:r,length:i,ofs:s,reference:c}=await We(n),l=new a.Inflate;for(;!l.result;){let a=await n.chunk();if(!a)break;if(l.push(a,!1),l.err)throw new f(`Pako error: ${l.msg}`);if(l.result){if(l.result.length!==i)throw new f(`Inflated object size is different from that stated in packfile.`);await n.undo(),await n.read(a.length-l.strm.avail_in);let u=n.tell();await t({data:l.result,type:r,num:o,offset:e,end:u,reference:c,ofs:s})}}}}async function We(e){let t=await e.byte(),n=t>>4&7,r=t&15;if(t&128){let n=4;do t=await e.byte(),r|=(t&127)<<n,n+=7;while(t&128)}let i,a;if(n===6){let n=0;i=0;let r=[];do t=await e.byte(),i|=(t&127)<<n,n+=7,r.push(t);while(t&128);a=Buffer.from(r)}return n===7&&(a=await e.read(20)),{type:n,length:r,ofs:i,reference:a}}let Ge=!1;async function Ke(e){return Ge===null&&(Ge=Je()),Ge?qe(e):a.inflate(e)}async function qe(e){let t=new DecompressionStream(`deflate`),n=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(n).arrayBuffer())}function Je(){try{if(new DecompressionStream(`deflate`))return!0}catch{}return!1}function Ye(e){let t=[],n=0,r=0;do{n=e.readUInt8();let i=n&127;t.push(i),r=n&128}while(r);return t.reduce((e,t)=>e+1<<7|t,-1)}function Xe(e,t){let n=t,r=4,i=null;do i=e.readUInt8(),n|=(i&127)<<r,r+=7;while(i&128);return n}var Ze=class e{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:t,getExternalRefDelta:n}){let r=new h(t);if(r.slice(4).toString(`hex`)!==`ff744f63`)return;let i=r.readUInt32BE();if(i!==2)throw new f(`Unable to read version ${i} packfile IDX. (Only version 2 supported)`);if(t.byteLength>2048*1024*1024)throw new f(`To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.`);r.seek(r.tell()+1020);let a=r.readUInt32BE(),o=[];for(let e=0;e<a;e++)o[e]=r.slice(20).toString(`hex`);r.seek(r.tell()+4*a);let s=new Map;for(let e=0;e<a;e++)s.set(o[e],r.readUInt32BE());return new e({hashes:o,crcs:{},offsets:s,packfileSha:r.slice(20).toString(`hex`),getExternalRefDelta:n})}static async fromPack({pack:t,getExternalRefDelta:n,onProgress:r}){let a={1:`commit`,2:`tree`,3:`blob`,4:`tag`,6:`ofs-delta`,7:`ref-delta`},o={},s=t.slice(-20).toString(`hex`),c=[],l={},u=new Map,d=null,f=null;await Ue([t],async({data:e,type:t,reference:n,offset:i,num:s})=>{d===null&&(d=s);let c=Math.floor((d-s)*100/d);c!==f&&r&&await r({phase:`Receiving objects`,loaded:d-s,total:d}),f=c,t=a[t],([`commit`,`tree`,`blob`,`tag`].includes(t)||t===`ofs-delta`||t===`ref-delta`)&&(o[i]={type:t,offset:i})});let p=Object.keys(o).map(Number);for(let[e,n]of p.entries()){let r=e+1===p.length?t.byteLength-20:p[e+1],a=o[n],s=i.buf(t.slice(n,r))>>>0;a.end=r,a.crc=s}let m=new e({pack:Promise.resolve(t),packfileSha:s,crcs:l,hashes:c,offsets:u,getExternalRefDelta:n});f=null;let h=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let e in o){e=Number(e);let t=Math.floor(h*100/d);t!==f&&r&&await r({phase:`Resolving deltas`,loaded:h,total:d}),h++,f=t;let n=o[e];if(!n.oid)try{m.readDepth=0,m.externalReadDepth=0;let{type:t,object:r}=await m.readSlice({start:e});g[m.readDepth]+=1;let i=await T(je.wrap({type:t,object:r}));n.oid=i,c.push(i),u.set(i,e),l[i]=n.crc}catch{continue}}return c.sort(),m}async toBuffer(){let e=[],t=(t,n)=>{e.push(Buffer.from(t,n))};t(`ff744f63`,`hex`),t(`00000002`,`hex`);let n=new h(Buffer.alloc(256*4));for(let e=0;e<256;e++){let t=0;for(let n of this.hashes)parseInt(n.slice(0,2),16)<=e&&t++;n.writeUInt32BE(t)}e.push(n.buffer);for(let e of this.hashes)t(e,`hex`);let r=new h(Buffer.alloc(this.hashes.length*4));for(let e of this.hashes)r.writeUInt32BE(this.crcs[e]);e.push(r.buffer);let i=new h(Buffer.alloc(this.hashes.length*4));for(let e of this.hashes)i.writeUInt32BE(this.offsets.get(e));e.push(i.buffer),t(this.packfileSha,`hex`);let a=Buffer.concat(e),o=await T(a),s=Buffer.alloc(20);return s.write(o,`hex`),Buffer.concat([a,s])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new f(`Could not read object ${e} from packfile`)}let t=this.offsets.get(e);return this.readSlice({start:t})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let t={16:`commit`,32:`tree`,48:`blob`,64:`tag`,96:`ofs_delta`,112:`ref_delta`},n=await this.pack;if(!n)throw new f(`Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.`);let r=n.slice(e),i=new h(r),a=i.readUInt8(),o=a&112,s=t[o];if(s===void 0)throw new f(`Unrecognized type: 0b`+o.toString(2));let c=a&15,l=c;a&128&&(l=Xe(i,c));let u=null,d=null;if(s===`ofs_delta`){let t=e-Ye(i);({object:u,type:s}=await this.readSlice({start:t}))}if(s===`ref_delta`){let e=i.slice(20).toString(`hex`);({object:u,type:s}=await this.read({oid:e}))}let p=r.slice(i.tell());if(d=Buffer.from(await Ke(p)),d.byteLength!==l)throw new f(`Packfile told us object would have length ${l} but it had length ${d.byteLength}`);return u&&(d=Buffer.from(Ne(d,u))),this.readDepth>3&&(this.offsetCache[e]={type:s,object:d}),{type:s,format:`content`,object:d}}};let Qe=Symbol(`PackfileCache`);async function tt({fs:e,filename:t,getExternalRefDelta:n,emitter:r,emitterPrefix:i}){let a=await e.read(t);return Ze.fromIdx({idx:a,getExternalRefDelta:n})}function rt({fs:e,cache:t,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}){t[Qe]||(t[Qe]=new Map);let o=t[Qe].get(n);return o||(o=tt({fs:e,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}),t[Qe].set(n,o)),o}let it=8*1024*1024;async function at(e,{start:t=0,end:n=e.length}={}){let r=o.createHash(`sha1`);for(let i=t;i<n;i+=it)r.update(e.subarray(i,Math.min(i+it,n)));return r.digest(`hex`)}async function ot({fs:e,cache:t,gitdir:n,oid:r,format:i=`content`,getExternalRefDelta:a}){let o=await e.readdir(V(n,`objects/pack`));o=o.filter(e=>e.endsWith(`.idx`));for(let i of o){let o=`${n}/objects/pack/${i}`,s=await rt({fs:e,cache:t,filename:o,getExternalRefDelta:a});if(s.error)throw new f(s.error);if(s.offsets.has(r)){let t=o.replace(/idx$/,`pack`);s.pack||=e.read(t);let n=await s.pack;if(!n)throw s.pack=null,new f(`Could not read packfile at ${t}. The file may be missing, corrupted, or too large to read into memory.`);if(!s._checksumVerified){let e=s.packfileSha,t=n.subarray(-20),r=Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``);if(r!==e)throw new f(`Packfile trailer mismatch: expected ${e}, got ${r}. The packfile may be corrupted.`);let i=await at(n,{start:0,end:n.length-20});if(i!==e)throw new f(`Packfile payload corrupted: calculated ${i} but expected ${e}. The packfile may have been tampered with.`);s._checksumVerified=!0}let c=await s.read({oid:r,getExternalRefDelta:a});return c.format=`content`,c.source=`objects/pack/${i.replace(/idx$/,`pack`)}`,c}}return null}async function st({fs:e,cache:t,gitdir:n,oid:r,format:i=`content`}){let a=r=>st({fs:e,cache:t,gitdir:n,oid:r}),o;if(r===`4b825dc642cb6eb9a060e54bf8d69288fbee4904`&&(o={format:`wrapped`,object:Buffer.from(`tree 0\0`)}),o||=await Me({fs:e,gitdir:n,oid:r}),!o){if(o=await ot({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:a}),!o)throw new I(r);return o}if(i===`deflated`||(o.format===`deflated`&&(o.object=Buffer.from(await Ke(o.object)),o.format=`wrapped`),i===`wrapped`))return o;let s=await T(o.object);if(s!==r)throw new f(`SHA check failed! Expected ${r}, computed ${s}`);let{object:c,type:l}=je.unwrap(o.object);if(o.type=l,o.object=c,o.format=`content`,i===`content`)return o;throw new f(`invalid requested format "${i}"`)}var ct=class e extends u{constructor(t,n,r=!0){super(`Failed to create ${t} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:``}`),this.code=this.name=e.code,this.data={noun:t,where:n,canForce:r}}};ct.code=`AlreadyExistsError`;var lt=class e extends u{constructor(t,n,r){super(`Found multiple ${t} matching "${n}" (${r.join(`, `)}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=e.code,this.data={nouns:t,short:n,matches:r}}};lt.code=`AmbiguousError`;var ut=class e extends u{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}}};ut.code=`CheckoutConflictError`;var dt=class e extends u{constructor(t,n){super(`Cannot cherry-pick merge commit ${t}. Merge commits have ${n} parents and require specifying which parent to use as the base.`),this.code=this.name=e.code,this.data={oid:t,parentCount:n}}};dt.code=`CherryPickMergeCommitError`;var ft=class e extends u{constructor(t){super(`Cannot cherry-pick root commit ${t}. Root commits have no parents.`),this.code=this.name=e.code,this.data={oid:t}}};ft.code=`CherryPickRootCommitError`;var pt=class e extends u{constructor(t,n){super(`Failed to checkout "${t}" because commit ${n} 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:n}}};pt.code=`CommitNotFetchedError`;var mt=class e extends u{constructor(){super(`Empty response from git server.`),this.code=this.name=e.code,this.data={}}};mt.code=`EmptyServerResponseError`;var ht=class e extends u{constructor(){super(`A simple fast-forward merge was not possible.`),this.code=this.name=e.code,this.data={}}};ht.code=`FastForwardError`;var gt=class e extends u{constructor(t,n){super(`One or more branches were not updated: ${t}`),this.code=this.name=e.code,this.data={prettyDetails:t,result:n}}};gt.code=`GitPushError`;var _t=class e extends u{constructor(t,n,r){super(`HTTP Error: ${t} ${n}`),this.code=this.name=e.code,this.data={statusCode:t,statusMessage:n,response:r}}};_t.code=`HttpError`;var vt=class e extends u{constructor(t){let n=`invalid filepath`;t===`leading-slash`||t===`trailing-slash`?n=`"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.`:t===`directory`&&(n=`"filepath" should not be a directory.`),super(n),this.code=this.name=e.code,this.data={reason:t}}};vt.code=`InvalidFilepathError`;var yt=class e extends u{constructor(t,n){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=e.code,this.data={ref:t,suggestion:n}}};yt.code=`InvalidRefNameError`;var bt=class e extends u{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=e.code,this.data={depth:t}}};bt.code=`MaxDepthError`;var xt=class e extends u{constructor(){super(`Merges with conflicts are not supported yet.`),this.code=this.name=e.code,this.data={}}};xt.code=`MergeNotSupportedError`;var St=class e extends u{constructor(t,n,r,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:n,deleteByUs:r,deleteByTheirs:i}}};St.code=`MergeConflictError`;var Ct=class e extends u{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}}};Ct.code=`MissingNameError`;var wt=class e extends u{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=e.code,this.data={parameter:t}}};wt.code=`MissingParameterError`;var Tt=class e extends u{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}};Tt.code=`MultipleGitError`;var Et=class e extends u{constructor(t,n){super(`Expected "${t}" but received "${n}".`),this.code=this.name=e.code,this.data={expected:t,actual:n}}};Et.code=`ParseError`;var Dt=class e extends u{constructor(t){let n=``;t===`not-fast-forward`?n=` because it was not a simple fast-forward`:t===`tag-exists`&&(n=` because tag already exists`),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=e.code,this.data={reason:t}}};Dt.code=`PushRejectedError`;var Ot=class e extends u{constructor(t,n){super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`),this.code=this.name=e.code,this.data={capability:t,parameter:n}}};Ot.code=`RemoteCapabilityError`;var kt=class e extends u{constructor(t,n){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:n}}};kt.code=`SmartHttpError`;var At=class e extends u{constructor(t,n,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=e.code,this.data={url:t,transport:n,suggestion:r}}};At.code=`UnknownTransportError`;var jt=class e extends u{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=e.code,this.data={url:t}}};jt.code=`UrlParseError`;var Mt=class e extends u{constructor(){super(`The operation was canceled.`),this.code=this.name=e.code,this.data={}}};Mt.code=`UserCanceledError`;var Nt=class e extends u{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}}};Nt.code=`IndexResetError`;var Pt=class e extends u{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}}};Pt.code=`NoCommitError`;function Ft({name:e,email:t,timestamp:n,timezoneOffset:r}){return r=It(r),`${e} <${t}> ${n} ${r}`}function It(e){let t=Lt(Rt(e));e=Math.abs(e);let n=Math.floor(e/60);e-=n*60;let r=String(n),i=String(e);return r.length<2&&(r=`0`+r),i.length<2&&(i=`0`+i),(t===-1?`-`:`+`)+r+i}function Lt(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function Rt(e){return e===0?e:-e}function zt(e){return e=e.replace(/\r/g,``),e=e.replace(/^\n+/,``),e=e.replace(/\n+$/,``)+`
`,e}function Bt(e){let[,t,n,r,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:n,timestamp:Number(r),timezoneOffset:Vt(i)}}function Vt(e){let[,t,n,r]=e.match(/(\+|-)(\d\d)(\d\d)/);return r=(t===`+`?1:-1)*(Number(n)*60+Number(r)),Ht(r)}function Ht(e){return e===0?e:-e}var Ut=class e{constructor(t){if(typeof t==`string`)this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString(`utf8`);else if(typeof t==`object`)this._tag=e.render(t);else throw new f(`invalid type passed to GitAnnotatedTag constructor`)}static from(t){return new e(t)}static render(e){return`object ${e.object}
type ${e.type}
tag ${e.tag}
tagger ${Ft(e.tagger)}
${e.message}
${e.gpgsig?e.gpgsig:``}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(`
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
`),t=[];for(let n of e)n[0]===` `?t[t.length-1]+=`
`+n.slice(1):t.push(n);let n={};for(let e of t){let t=e.slice(0,e.indexOf(` `)),r=e.slice(e.indexOf(` `)+1);Array.isArray(n[t])?n[t].push(r):n[t]=r}return n.tagger&&=Bt(n.tagger),n.committer&&=Bt(n.committer),n}withoutSignature(){let e=zt(this._tag);return e.indexOf(`
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
-----BEGIN PGP SIGNATURE-----`)!==-1)return zt(this._tag.slice(this._tag.indexOf(`-----BEGIN PGP SIGNATURE-----`),this._tag.indexOf(`-----END PGP SIGNATURE-----`)+27))}payload(){return this.withoutSignature()+`
`}toObject(){return Buffer.from(this._tag,`utf8`)}static async sign(t,n,r){let i=t.payload(),{signature:a}=await n({payload:i,secretKey:r});a=zt(a);let o=i+a;return e.from(o)}};function Wt(e){return e.trim().split(`
`).map(e=>` `+e).join(`
`)+`
`}function Gt(e){return e.split(`
`).map(e=>e.replace(/^ /,``)).join(`
`)}var Kt=class e{constructor(t){if(typeof t==`string`)this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString(`utf8`);else if(typeof t==`object`)this._commit=e.render(t);else throw new f(`invalid type passed to GitCommit constructor`)}static fromPayloadSignature({payload:t,signature:n}){let r=e.justHeaders(t),i=e.justMessage(t);return new e(zt(r+`
gpgsig`+Wt(n)+`
`+i))}static from(t){return new e(t)}toObject(){return 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(e){return zt(e.slice(e.indexOf(`
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
`))}parseHeaders(){let t=e.justHeaders(this._commit).split(`
`),n=[];for(let e of t)e[0]===` `?n[n.length-1]+=`
`+e.slice(1):n.push(e);let r={parent:[]};for(let e of n){let t=e.slice(0,e.indexOf(` `)),n=e.slice(e.indexOf(` `)+1);Array.isArray(r[t])?r[t].push(n):r[t]=n}return r.author&&=Bt(r.author),r.committer&&=Bt(r.committer),r}static renderHeaders(e){let t=``;if(e.tree?t+=`tree ${e.tree}\n`:t+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
`,e.parent){if(e.parent.length===void 0)throw new f(`commit 'parent' property should be an array`);for(let n of e.parent)t+=`parent ${n}\n`}let n=e.author;t+=`author ${Ft(n)}\n`;let r=e.committer||e.author;return t+=`committer ${Ft(r)}\n`,e.gpgsig&&(t+=`gpgsig`+Wt(e.gpgsig)),t}static render(t){return e.renderHeaders(t)+`
`+zt(t.message)}render(){return this._commit}withoutSignature(){let e=zt(this._commit);if(e.indexOf(`
gpgsig`)===-1)return e;let t=e.slice(0,e.indexOf(`
gpgsig`)),n=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
`)+28);return zt(t+`
`+n)}isolateSignature(){return Gt(this._commit.slice(this._commit.indexOf(`-----BEGIN PGP SIGNATURE-----`),this._commit.indexOf(`-----END PGP SIGNATURE-----`)+27))}static async sign(t,n,r){let i=t.withoutSignature(),a=e.justMessage(t._commit),{signature:o}=await n({payload:i,secretKey:r});o=zt(o);let s=e.justHeaders(t._commit)+`
gpgsig`+Wt(o)+`
`+a;return e.from(s)}};async function qt({fs:e,cache:t,gitdir:n,oid:r}){if(r===`4b825dc642cb6eb9a060e54bf8d69288fbee4904`)return{tree:Ae.from([]),oid:r};let{type:i,object:a}=await st({fs:e,cache:t,gitdir:n,oid:r});if(i===`tag`)return r=Ut.from(a).parse().object,qt({fs:e,cache:t,gitdir:n,oid:r});if(i===`commit`)return r=Kt.from(a).parse().tree,qt({fs:e,cache:t,gitdir:n,oid:r});if(i!==`tree`)throw new L(r,i,`tree`);return{tree:Ae.from(a),oid:r}}var Jt=class{constructor({fs:e,gitdir:t,ref:n,cache:r}){this.fs=e,this.cache=r,this.gitdir=t,this.mapPromise=(async()=>{let r=new Map,i;try{i=await $.resolve({fs:e,gitdir:t,ref:n})}catch(e){e instanceof I&&(i=`4b825dc642cb6eb9a060e54bf8d69288fbee4904`)}let a=await qt({fs:e,cache:this.cache,gitdir:t,oid:i});return a.type=`tree`,a.mode=`40000`,r.set(`.`,a),r})();let i=this;this.ConstructEntry=class{constructor(e){this._fullpath=e,this._type=!1,this._mode=!1,this._stat=!1,this._content=!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(e){let t=e._fullpath,{fs:n,cache:r,gitdir:i}=this,a=await this.mapPromise,o=a.get(t);if(!o)throw Error(`No obj for ${t}`);let s=o.oid;if(!s)throw Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!==`tree`)return null;let{type:c,object:l}=await st({fs:n,cache:r,gitdir:i,oid:s});if(c!==o.type)throw new L(s,c,o.type);let u=Ae.from(l);for(let e of u)a.set(V(t,e.path),e);return u.entries().map(e=>V(t,e.path))}async type(e){if(e._type===!1){let{type:t}=(await this.mapPromise).get(e._fullpath);e._type=t}return e._type}async mode(e){if(e._mode===!1){let{mode:t}=(await this.mapPromise).get(e._fullpath);e._mode=v(parseInt(t,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let t=await this.mapPromise,{fs:n,cache:r,gitdir:i}=this,a=t.get(e._fullpath).oid,{type:o,object:s}=await st({fs:n,cache:r,gitdir:i,oid:a});o===`blob`?e._content=new Uint8Array(s):e._content=void 0}return e._content}async oid(e){return e._oid===!1&&(e._oid=(await this.mapPromise).get(e._fullpath).oid),e._oid}};function Yt({ref:e=`HEAD`}={}){let t=Object.create(null);return Object.defineProperty(t,oe,{value:function({fs:t,gitdir:n,cache:r}){return new Jt({fs:t,gitdir:n,ref:e,cache:r})}}),Object.freeze(t),t}var Xt=class{constructor({fs:e,dir:t,gitdir:n,cache:r,refresh:i=!0}){this.fs=e,this.cache=r,this.dir=t,this.gitdir=n,this.refresh=i,this.config=null;let a=this;this.ConstructEntry=class{constructor(e){this._fullpath=e,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(e){let t=e._fullpath,{fs:n,dir:r}=this,i=await n.readdir(V(r,t));return i===null?null:i.map(e=>V(t,e))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:t,dir:n}=this,r=await t.lstat(`${n}/${e._fullpath}`);if(!r)throw Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let i=r.isDirectory()?`tree`:`blob`;i===`blob`&&!r.isFile()&&!r.isSymbolicLink()&&(i=`special`),e._type=i,r=S(r),e._mode=r.mode,r.size===-1&&e._actualSize&&(r.size=e._actualSize),e._stat=r}return e._stat}async content(e){if(e._content===!1){let{fs:t,dir:n,gitdir:r}=this;if(await e.type()===`tree`)e._content=void 0;else{let i;if(await e.mode()>>12==10)i=await t.readlink(`${n}/${e._fullpath}`);else{let a=await(await this._getGitConfig(t,r)).get(`core.autocrlf`);i=await t.read(`${n}/${e._fullpath}`,{autocrlf:a})}e._actualSize=i.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(i)}}return e._content}async oid(e){if(e._oid===!1){let t=this,{fs:n,gitdir:r,cache:i}=this,a;await re.acquire({fs:n,gitdir:r,cache:i},async function(i){let o=i.entriesMap.get(e._fullpath),s=await e.stat(),c=await(await t._getGitConfig(n,r)).get(`core.filemode`),l=typeof process<`u`?process.platform!==`win32`:!0;if(!o||M(s,o,c,l)){let n=await e.content();n===void 0?a=void 0:(a=await T(je.wrap({type:`blob`,object:n})),t.refresh&&o&&a===o.oid&&(!c||s.mode===o.mode)&&M(s,o,c,l)&&i.insert({filepath:e._fullpath,stats:s,oid:a}))}else a=o.oid}),e._oid=a}return e._oid}async _getGitConfig(e,t){return this.config||=await ye.get({fs:e,gitdir:t}),this.config}};function Zt({refresh:e=!0}={}){let t=Object.create(null);return Object.defineProperty(t,oe,{value:function({fs:t,dir:n,gitdir:r,cache:i}){return new Xt({fs:t,dir:n,gitdir:r,cache:i,refresh:e})}}),Object.freeze(t),t}function Qt(e,t){let n=t-e;return Array.from({length:n},(t,n)=>e+n)}let $t=Array.prototype.flat===void 0?e=>e.reduce((e,t)=>e.concat(t),[]):e=>e.flat();var en=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null||e<this.value)&&(this.value=e)}reset(){this.value=null}};function*tn(e){let t=new en,n,r=[],i=e.length;for(let n=0;n<i;n++)r[n]=e[n].next().value,r[n]!==void 0&&t.consider(r[n]);if(t.value!==null)for(;;){let a=[];n=t.value,t.reset();for(let o=0;o<i;o++)r[o]!==void 0&&r[o]===n?(a[o]=r[o],r[o]=e[o].next().value):a[o]=null,r[o]!==void 0&&t.consider(r[o]);if(yield a,t.value===null)return}}async function nn({fs:e,cache:t,dir:n,gitdir:r,trees:i,map:a=async(e,t)=>t,reduce:o=async(e,t)=>{let n=$t(t);return e!==void 0&&n.unshift(e),n},iterate:s=(e,t)=>Promise.all([...t].map(e))}){let c=i.map(i=>i[oe]({fs:e,dir:n,gitdir:r,cache:t})),l=Array(c.length).fill(`.`),u=Qt(0,c.length),d=async e=>(u.forEach(t=>{let n=e[t];e[t]=n&&new c[t].ConstructEntry(n)}),{entries:e,children:tn((await Promise.all(u.map(t=>{let n=e[t];return n?c[t].readdir(n):[]}))).map(e=>(e===null?[]:e)[Symbol.iterator]()))}),f=async e=>{let{entries:t,children:n}=await d(e),r=t.find(e=>e&&e._fullpath)._fullpath,i=await a(r,t);if(i!==null){let e=await s(f,n);return e=e.filter(e=>e!==void 0),o(i,e)}};return f(l)}async function rn(e,t){let n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(n=>{let r=V(t,n);return e.lstat(r).then(t=>{if(t)return t.isDirectory()?rn(e,r):e.rm(r)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function an(e){return on(e)&&sn(e.then)&&sn(e.catch)}function on(e){return e&&typeof e==`object`}function sn(e){return typeof e==`function`}function cn(e){return an((e=>{try{return e.readFile().catch(e=>e)}catch(e){return e}})(e))}let ln=[`readFile`,`writeFile`,`mkdir`,`rmdir`,`unlink`,`stat`,`lstat`,`readdir`,`readlink`,`symlink`];function un(e,t){if(cn(t))for(let n of ln)e[`_${n}`]=t[n].bind(t);else for(let n of ln)e[`_${n}`]=s(t[n].bind(t));cn(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=rn.bind(null,e)):(t.cp&&(e._cp=s(t.cp.bind(t))),t.rm?e._rm=s(t.rm.bind(t)):t.rmdir.length>2?e._rm=s(t.rmdir.bind(t)):e._rm=rn.bind(null,e))}var dn=class{constructor(e){if(e._original_unwrapped_fs!==void 0)return e;let t=Object.getOwnPropertyDescriptor(e,`promises`);t&&t.enumerable?un(this,e.promises):un(this,e),this._original_unwrapped_fs=e}async exists(e,t={}){try{return await this._stat(e),!0}catch(e){if(e.code===`ENOENT`||e.code===`ENOTDIR`||(e.code||``).includes(`ENS`))return!1;throw console.log(`Unhandled error in "FileSystem.exists()" function`,e),e}}async read(e,t={}){try{let n=await this._readFile(e,t);if(t.autocrlf===`true`)try{n=new TextDecoder(`utf8`,{fatal:!0}).decode(n),n=n.replace(/\r\n/g,`
`),n=new TextEncoder().encode(n)}catch{}return typeof n!=`string`&&(n=Buffer.from(n)),n}catch{return null}}async write(e,t,n={}){try{await this._writeFile(e,t,n)}catch{await this.mkdir(ae(e)),await this._writeFile(e,t,n)}}async mkdir(e,t=!1){try{await this._mkdir(e)}catch(n){if(n===null||n.code===`EEXIST`)return;if(t)throw n;if(n.code===`ENOENT`){let t=ae(e);if(t===`.`||t===`/`||t===e)throw n;await this.mkdir(t),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(e){if(e.code!==`ENOENT`)throw e}}async rmdir(e,t){try{t&&t.recursive?await this._rm(e,t):await this._rmdir(e)}catch(e){if(e.code!==`ENOENT`)throw e}}async readdir(e){try{let t=await this._readdir(e);return t.sort(g),t}catch(e){return e.code===`ENOTDIR`?null:[]}}async readdirDeep(e){let t=await this._readdir(e);return(await Promise.all(t.map(async t=>{let n=e+`/`+t;return(await this._stat(n)).isDirectory()?this.readdirDeep(n):n}))).reduce((e,t)=>e.concat(t),[])}async lstat(e){try{return await this._lstat(e)}catch(e){if(e.code===`ENOENT`||(e.code||``).includes(`ENS`))return null;throw e}}async readlink(e,t={encoding:`buffer`}){try{let n=await this._readlink(e,t);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(e){if(e.code===`ENOENT`||(e.code||``).includes(`ENS`))return null;throw e}}async writelink(e,t){return this._symlink(t.toString(`utf8`),e)}};function fn(e,t){if(t===void 0)throw new wt(e)}function pn(e){return e.startsWith(`/`)||/^[a-zA-Z]:[\\/]/.test(e)}async function mn({fsp:e,dotgit:t}){fn(`fsp`,e),fn(`dotgit`,t);let n=await e._stat(t).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return n.isDirectory()?t:n.isFile()?e._readFile(t,`utf8`).then(e=>e.trimRight().substr(8)).then(e=>pn(e)?e:V(ae(t),e)):t}var hn=class{static async isIgnored({fs:e,dir:t,gitdir:n=V(t,`.git`),filepath:r}){if(ie(r)===`.git`)return!0;if(r===`.`)return!1;let i=``,a=V(n,`info`,`exclude`);await e.exists(a)&&(i=await e.read(a,`utf8`));let o=[{gitignore:V(t,`.gitignore`),filepath:r}],s=r.split(`/`).filter(Boolean);for(let e=1;e<s.length;e++){let n=s.slice(0,e).join(`/`),r=s.slice(e).join(`/`);o.push({gitignore:V(t,n,`.gitignore`),filepath:r})}let l=!1;for(let t of o){let n;try{n=await e.read(t.gitignore,`utf8`)}catch(e){if(e.code===`NOENT`)continue}let r=c().add(i);r.add(n);let a=ae(t.filepath);if(a!==`.`&&r.ignores(a))return!0;l=l?!r.test(t.filepath).unignored:r.test(t.filepath).ignored}return l}};async function gn({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await st({fs:e,cache:t,gitdir:n,oid:r});if(i===`tag`)return r=Ut.from(a).parse().object,gn({fs:e,cache:t,gitdir:n,oid:r});if(i!==`commit`)throw new L(r,i,`commit`);return{commit:Kt.from(a),oid:r}}async function _n({fs:e,cache:t,gitdir:n,oid:r}){let{commit:i,oid:a}=await gn({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}async function vn({fs:e,cache:t,gitdir:n,oid:r,filepath:i}){if(i.startsWith(`/`))throw new vt(`leading-slash`);if(i.endsWith(`/`))throw new vt(`trailing-slash`);let a=r,o=await qt({fs:e,cache:t,gitdir:n,oid:r}),s=o.tree;return r=i===``?o.oid:await yn({fs:e,cache:t,gitdir:n,tree:s,pathArray:i.split(`/`),oid:a,filepath:i}),r}async function yn({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:o}){let s=i.shift();for(let c of r)if(c.path===s){if(i.length===0)return c.oid;{let{type:s,object:l}=await st({fs:e,cache:t,gitdir:n,oid:c.oid});if(s!==`tree`)throw new L(a,s,`tree`,o);return r=Ae.from(l),yn({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:o})}}throw new I(`file or directory found at "${a}:${o}"`)}let bn=null;var xn=class{static async read({fs:e,gitdir:t}){bn===null&&(bn=new n);let r=V(t,`shallow`),i=new Set;return await bn.acquire(r,async function(){let t=await e.read(r,{encoding:`utf8`});if(t===null||t.trim()===``)return i;t.trim().split(`
`).map(e=>i.add(e))}),i}static async write({fs:e,gitdir:t,oids:r}){bn===null&&(bn=new n);let i=V(t,`shallow`);if(r.size>0){let t=[...r].join(`
`)+`
`;await bn.acquire(i,async function(){await e.write(i,t,{encoding:`utf8`})})}else await bn.acquire(i,async function(){await e.rm(i)})}};async function Sn({fs:e,filepath:t}){if(await e.exists(V(t,`.git`)))return t;{let n=ae(t);if(n===t)throw new I(`git root for ${t}`);return Sn({fs:e,filepath:n})}}async function Cn({fs:e,filepath:t}){try{return fn(`fs`,e),fn(`filepath`,t),await Sn({fs:new dn(e),filepath:t})}catch(e){throw e.caller=`git.findRoot`,e}}async function wn({fs:e,dir:t,gitdir:n=V(t,`.git`),filepath:r}){try{fn(`fs`,e),fn(`dir`,t),fn(`gitdir`,n),fn(`filepath`,r);let i=new dn(e),a=await mn({fsp:i,dotgit:n});return hn.isIgnored({fs:i,dir:t,gitdir:a,filepath:r})}catch(e){throw e.caller=`git.isIgnored`,e}}function Tn(e,t){return e.committer.timestamp-t.committer.timestamp}async function En({fs:e,cache:t,gitdir:n,oid:r,fileId:i}){if(i===`e69de29bb2d1d6434b8b29ae775ad8c2e48c5391`)return;let a=r,o,s=await qt({fs:e,cache:t,gitdir:n,oid:r}),c=s.tree;return i===s.oid?o=s.path:(o=await Dn({fs:e,cache:t,gitdir:n,tree:c,fileId:i,oid:a}),Array.isArray(o)&&(o.length===0?o=void 0:o.length===1&&(o=o[0]))),o}async function Dn({fs:e,cache:t,gitdir:n,tree:r,fileId:i,oid:a,filepaths:o=[],parentPath:s=``}){let c=r.entries().map(function(r){let c;return r.oid===i?(c=V(s,r.path),o.push(c)):r.type===`tree`&&(c=st({fs:e,cache:t,gitdir:n,oid:r.oid}).then(function({object:c}){return Dn({fs:e,cache:t,gitdir:n,tree:Ae.from(c),fileId:i,oid:a,filepaths:o,parentPath:V(s,r.path)})})),c});return await Promise.all(c),o}async function On({fs:e,cache:t,gitdir:n,filepath:r,ref:i,depth:a,since:o,force:s,follow:c}){let l=o===void 0?void 0:Math.floor(o.valueOf()/1e3),u=[],d=await xn.read({fs:e,gitdir:n}),f=[await _n({fs:e,cache:t,gitdir:n,oid:await $.resolve({fs:e,gitdir:n,ref:i})})],p,m,h;function g(e){h&&r&&u.push(e)}for(;f.length>0;){let i=f.pop();if(l!==void 0&&i.commit.committer.timestamp<=l)break;if(r){let a;try{a=await vn({fs:e,cache:t,gitdir:n,oid:i.commit.tree,filepath:r}),m&&p!==a&&u.push(m),p=a,m=i,h=!0}catch(a){if(a instanceof I){let o=c&&p;if(o&&(o=await En({fs:e,cache:t,gitdir:n,oid:i.commit.tree,fileId:p}),o))if(Array.isArray(o)){if(m){let i=await En({fs:e,cache:t,gitdir:n,oid:m.commit.tree,fileId:p});if(Array.isArray(i))if(o=o.filter(e=>i.indexOf(e)===-1),o.length===1)o=o[0],r=o,m&&u.push(m);else{o=!1,m&&u.push(m);break}}}else r=o,m&&u.push(m);if(!o){if(h&&p&&(u.push(m),!s))break;if(!s&&!c)throw a}m=i,h=!1}else throw a}}else u.push(i);if(a!==void 0&&u.length===a){g(i);break}if(!d.has(i.oid))for(let r of i.commit.parent){let i=await _n({fs:e,cache:t,gitdir:n,oid:r});f.map(e=>e.oid).includes(i.oid)||f.push(i)}f.length===0&&g(i),f.sort((e,t)=>Tn(e.commit,t.commit))}return u}async function kn({fs:e,dir:t,gitdir:n=V(t,`.git`),filepath:r,ref:i=`HEAD`,depth:a,since:o,force:s,follow:c,cache:l={}}){try{fn(`fs`,e),fn(`gitdir`,n),fn(`ref`,i);let t=new dn(e);return await On({fs:t,cache:l,gitdir:await mn({fsp:t,dotgit:n}),filepath:r,ref:i,depth:a,since:o,force:s,follow:c})}catch(e){throw e.caller=`git.log`,e}}async function An({fs:e,dir:t,gitdir:n=V(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{fn(`fs`,e),fn(`gitdir`,n),fn(`trees`,r);let c=new dn(e);return await nn({fs:c,cache:s,dir:t,gitdir:await mn({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}e.TREE=Yt,e.WORKDIR=Zt,e.findRoot=Cn,e.isIgnored=wn,e.log=kn,e.walk=An}))(),1);const it={directory:16384,file:33188,executableFile:33261,symlink:40960},at=async({base:e,cwd:t,recursivelyFindRoot:n=!0,filterFiles:r,log:i,...a})=>{let o=e?.commit??`HEAD`,s=T(t),c=n?await rt.findRoot({fs:C,filepath:s}):s,l=(await rt.log({fs:C,dir:c,ref:o,depth:1}))[0]?.oid;if(!l)throw Error(`Could not determine oid for ${o}`);let u=s===c?null:w(c,s)+`/`,d=[rt.TREE({ref:l}),rt.WORKDIR()],f=[],p=[],m={additions:f,deletions:p};return await rt.walk({fs:C,dir:c,trees:d,map:async(e,[t,n])=>{if(await rt.isIgnored({fs:C,dir:c,filepath:e})||await t?.oid()===await n?.oid()&&!t==!n)return null;if(await t?.mode()===it.symlink||await n?.mode()===it.symlink)throw Error(`Unexpected symlink at ${e}, GitHub API only supports files and directories. You may need to add this file to .gitignore`);if(await n?.mode()===it.executableFile)throw Error(`Unexpected executable file at ${e}, GitHub API only supports non-executable files and directories. You may need to add this file to .gitignore`);if(await t?.type()===`tree`||await n?.type()===`tree`)return!0;if(u&&!e.startsWith(u)||r&&!r(e))return null;if(n){let t=await n.content();if(!t)throw Error(`Could not determine content of file ${e}`);f.push({path:e,contents:Buffer.from(t)})}else return p.push(e),null;return!0}}),N({...a,fileChanges:m,log:i,base:{commit:l}})},ot=async(e,t)=>{await p(`git`,[`push`,`origin`,`HEAD:${e}`,`--force`],t)},st=async(e,t)=>{let{stderr:r}=await n(`git`,[`checkout`,e],{ignoreReturnCode:!0,...t});r.toString().includes(`Switched to a new branch '${e}'`)||await p(`git`,[`checkout`,`-b`,e],t)},ct=async(e,t)=>{await p(`git`,[`reset`,`--hard`,e],t)},lt=async(e,t)=>{await p(`git`,[`add`,`.`],t),await p(`git`,[`commit`,`-m`,e],t)},ut=async e=>{let{stdout:t}=await n(`git`,[`status`,`--porcelain`],e);return!t.length};var dt=class{octokit;cwd;constructor(e){this.octokit=e.octokit??null,this.cwd=e.cwd}async setupUser(){this.octokit||(await p(`git`,[`config`,`user.name`,`"github-actions[bot]"`],{cwd:this.cwd}),await p(`git`,[`config`,`user.email`,`"41898282+github-actions[bot]@users.noreply.github.com"`],{cwd:this.cwd}))}async pushTag(e){if(this.octokit)return this.octokit.rest.git.createRef({...f.repo,ref:`refs/tags/${e}`,sha:f.sha}).catch(t=>{a(`Failed to create tag ${e}: ${t.message}`)});await p(`git`,[`push`,`origin`,e],{cwd:this.cwd})}async prepareBranch(e){this.octokit||(await st(e,{cwd:this.cwd}),await ct(f.sha,{cwd:this.cwd}))}async pushChanges({branch:e,message:t}){if(this.octokit)return this.cwd,at({octokit:this.octokit,...f.repo,branch:e,message:t,base:{commit:f.sha},cwd:this.cwd,force:!0});await ut({cwd:this.cwd})||await lt(t,{cwd:this.cwd}),await ot(e,{cwd:this.cwd})}},ft=o(r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.Bottleneck=r()})(e,(function(){var e=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function t(e){return e&&e.default||e}var n={load:function(e,t,n={}){var r,i;for(r in t)i=t[r],n[r]=e[r]??i;return n},overwrite:function(e,t,n={}){var r,i;for(r in e)i=e[r],t[r]!==void 0&&(n[r]=i);return n}},r=class{constructor(e,t){this.incr=e,this.decr=t,this._first=null,this._last=null,this.length=0}push(e){var t;this.length++,typeof this.incr==`function`&&this.incr(),t={value:e,prev:this._last,next:null},this._last==null?this._first=this._last=t:(this._last.next=t,this._last=t)}shift(){var e;if(this._first!=null)return this.length--,typeof this.decr==`function`&&this.decr(),e=this._first.value,(this._first=this._first.next)==null?this._last=null:this._first.prev=null,e}first(){if(this._first!=null)return this._first.value}getArray(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,t.value));return n}forEachShift(e){for(var t=this.shift();t!=null;)e(t),t=this.shift()}debug(){for(var e=this._first,t,n=[];e!=null;)n.push((t=e,e=e.next,{value:t.value,prev:t.prev?.value,next:t.next?.value}));return n}},i=class{constructor(e){if(this.instance=e,this._events={},this.instance.on!=null||this.instance.once!=null||this.instance.removeAllListeners!=null)throw Error(`An Emitter already exists for this object`);this.instance.on=(e,t)=>this._addListener(e,`many`,t),this.instance.once=(e,t)=>this._addListener(e,`once`,t),this.instance.removeAllListeners=(e=null)=>e==null?this._events={}:delete this._events[e]}_addListener(e,t,n){var r;return(r=this._events)[e]??(r[e]=[]),this._events[e].push({cb:n,status:t}),this.instance}listenerCount(e){return this._events[e]==null?0:this._events[e].length}async trigger(e,...t){var n,r;try{return e!==`debug`&&this.trigger(`debug`,`Event triggered: ${e}`,t),this._events[e]==null?void 0:(this._events[e]=this._events[e].filter(function(e){return e.status!==`none`}),r=this._events[e].map(async e=>{var n,r;if(e.status!==`none`){e.status===`once`&&(e.status=`none`);try{return r=typeof e.cb==`function`?e.cb(...t):void 0,typeof r?.then==`function`?await r:r}catch(e){return n=e,this.trigger(`error`,n),null}}}),(await Promise.all(r)).find(function(e){return e!=null}))}catch(e){return n=e,this.trigger(`error`,n),null}}},a=r,o=i,s=class{constructor(e){this.Events=new o(this),this._length=0,this._lists=(function(){var t,n,r=[];for(t=1,n=e;1<=n?t<=n:t>=n;1<=n?++t:--t)r.push(new a((()=>this.incr()),(()=>this.decr())));return r}).call(this)}incr(){if(this._length++===0)return this.Events.trigger(`leftzero`)}decr(){if(--this._length===0)return this.Events.trigger(`zero`)}push(e){return this._lists[e.options.priority].push(e)}queued(e){return e==null?this._length:this._lists[e].length}shiftAll(e){return this._lists.forEach(function(t){return t.forEachShift(e)})}getFirst(e=this._lists){var t,n,r;for(t=0,n=e.length;t<n;t++)if(r=e[t],r.length>0)return r;return[]}shiftLastFrom(e){return this.getFirst(this._lists.slice(e).reverse()).shift()}},c=class extends Error{},l,u,d,f=10,p;u=5,p=n,l=c,d=class{constructor(e,t,n,r,i,a,o,s){this.task=e,this.args=t,this.rejectOnDrop=i,this.Events=a,this._states=o,this.Promise=s,this.options=p.load(n,r),this.options.priority=this._sanitizePriority(this.options.priority),this.options.id===r.id&&(this.options.id=`${this.options.id}-${this._randomIndex()}`),this.promise=new this.Promise((e,t)=>{this._resolve=e,this._reject=t}),this.retryCount=0}_sanitizePriority(e){var t=~~e===e?e:u;return t<0?0:t>f-1?f-1:t}_randomIndex(){return Math.random().toString(36).slice(2)}doDrop({error:e,message:t=`This job has been dropped by Bottleneck`}={}){return this._states.remove(this.options.id)?(this.rejectOnDrop&&this._reject(e??new l(t)),this.Events.trigger(`dropped`,{args:this.args,options:this.options,task:this.task,promise:this.promise}),!0):!1}_assertStatus(e){var t=this._states.jobStatus(this.options.id);if(!(t===e||e===`DONE`&&t===null))throw new l(`Invalid job status ${t}, expected ${e}. Please open an issue at https://github.com/SGrondin/bottleneck/issues`)}doReceive(){return this._states.start(this.options.id),this.Events.trigger(`received`,{args:this.args,options:this.options})}doQueue(e,t){return this._assertStatus(`RECEIVED`),this._states.next(this.options.id),this.Events.trigger(`queued`,{args:this.args,options:this.options,reachedHWM:e,blocked:t})}doRun(){return this.retryCount===0?(this._assertStatus(`QUEUED`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),this.Events.trigger(`scheduled`,{args:this.args,options:this.options})}async doExecute(e,t,n,r){var i,a,o;this.retryCount===0?(this._assertStatus(`RUNNING`),this._states.next(this.options.id)):this._assertStatus(`EXECUTING`),a={args:this.args,options:this.options,retryCount:this.retryCount},this.Events.trigger(`executing`,a);try{if(o=await(e==null?this.task(...this.args):e.schedule(this.options,this.task,...this.args)),t())return this.doDone(a),await r(this.options,a),this._assertStatus(`DONE`),this._resolve(o)}catch(e){return i=e,this._onFailure(i,a,t,n,r)}}doExpire(e,t,n){var r,i;return this._states.jobStatus(this.options.id===`RUNNING`)&&this._states.next(this.options.id),this._assertStatus(`EXECUTING`),i={args:this.args,options:this.options,retryCount:this.retryCount},r=new l(`This job timed out after ${this.options.expiration} ms.`),this._onFailure(r,i,e,t,n)}async _onFailure(e,t,n,r,i){var a,o;if(n())return a=await this.Events.trigger(`failed`,e,t),a==null?(this.doDone(t),await i(this.options,t),this._assertStatus(`DONE`),this._reject(e)):(o=~~a,this.Events.trigger(`retry`,`Retrying ${this.options.id} after ${o} ms`,t),this.retryCount++,r(o))}doDone(e){return this._assertStatus(`EXECUTING`),this._states.next(this.options.id),this.Events.trigger(`done`,e)}};var m=d,h,g,_=n;h=c,g=class{constructor(e,t,n){this.instance=e,this.storeOptions=t,this.clientId=this.instance._randomIndex(),_.load(n,n,this),this._nextRequest=this._lastReservoirRefresh=this._lastReservoirIncrease=Date.now(),this._running=0,this._done=0,this._unblockTime=0,this.ready=this.Promise.resolve(),this.clients={},this._startHeartbeat()}_startHeartbeat(){var e;return this.heartbeat==null&&(this.storeOptions.reservoirRefreshInterval!=null&&this.storeOptions.reservoirRefreshAmount!=null||this.storeOptions.reservoirIncreaseInterval!=null&&this.storeOptions.reservoirIncreaseAmount!=null)?typeof(e=this.heartbeat=setInterval(()=>{var e,t,n,r=Date.now(),i;if(this.storeOptions.reservoirRefreshInterval!=null&&r>=this._lastReservoirRefresh+this.storeOptions.reservoirRefreshInterval&&(this._lastReservoirRefresh=r,this.storeOptions.reservoir=this.storeOptions.reservoirRefreshAmount,this.instance._drainAll(this.computeCapacity())),this.storeOptions.reservoirIncreaseInterval!=null&&r>=this._lastReservoirIncrease+this.storeOptions.reservoirIncreaseInterval&&({reservoirIncreaseAmount:e,reservoirIncreaseMaximum:n,reservoir:i}=this.storeOptions,this._lastReservoirIncrease=r,t=n==null?e:Math.min(e,n-i),t>0))return this.storeOptions.reservoir+=t,this.instance._drainAll(this.computeCapacity())},this.heartbeatInterval)).unref==`function`?e.unref():void 0:clearInterval(this.heartbeat)}async __publish__(e){return await this.yieldLoop(),this.instance.Events.trigger(`message`,e.toString())}async __disconnect__(e){return await this.yieldLoop(),clearInterval(this.heartbeat),this.Promise.resolve()}yieldLoop(e=0){return new this.Promise(function(t,n){return setTimeout(t,e)})}computePenalty(){return this.storeOptions.penalty??(15*this.storeOptions.minTime||5e3)}async __updateSettings__(e){return await this.yieldLoop(),_.overwrite(e,e,this.storeOptions),this._startHeartbeat(),this.instance._drainAll(this.computeCapacity()),!0}async __running__(){return await this.yieldLoop(),this._running}async __queued__(){return await this.yieldLoop(),this.instance.queued()}async __done__(){return await this.yieldLoop(),this._done}async __groupCheck__(e){return await this.yieldLoop(),this._nextRequest+this.timeout<e}computeCapacity(){var e,t;return{maxConcurrent:e,reservoir:t}=this.storeOptions,e!=null&&t!=null?Math.min(e-this._running,t):e==null?t??null:e-this._running}conditionsCheck(e){var t=this.computeCapacity();return t==null||e<=t}async __incrementReservoir__(e){var t;return await this.yieldLoop(),t=this.storeOptions.reservoir+=e,this.instance._drainAll(this.computeCapacity()),t}async __currentReservoir__(){return await this.yieldLoop(),this.storeOptions.reservoir}isBlocked(e){return this._unblockTime>=e}check(e,t){return this.conditionsCheck(e)&&this._nextRequest-t<=0}async __check__(e){var t;return await this.yieldLoop(),t=Date.now(),this.check(e,t)}async __register__(e,t,n){var r,i;return await this.yieldLoop(),r=Date.now(),this.conditionsCheck(t)?(this._running+=t,this.storeOptions.reservoir!=null&&(this.storeOptions.reservoir-=t),i=Math.max(this._nextRequest-r,0),this._nextRequest=r+i+this.storeOptions.minTime,{success:!0,wait:i,reservoir:this.storeOptions.reservoir}):{success:!1}}strategyIsBlock(){return this.storeOptions.strategy===3}async __submit__(e,t){var n,r,i;if(await this.yieldLoop(),this.storeOptions.maxConcurrent!=null&&t>this.storeOptions.maxConcurrent)throw new h(`Impossible to add a job having a weight of ${t} to a limiter having a maxConcurrent setting of ${this.storeOptions.maxConcurrent}`);return r=Date.now(),i=this.storeOptions.highWater!=null&&e===this.storeOptions.highWater&&!this.check(t,r),n=this.strategyIsBlock()&&(i||this.isBlocked(r)),n&&(this._unblockTime=r+this.computePenalty(),this._nextRequest=this._unblockTime+this.storeOptions.minTime,this.instance._dropAllQueued()),{reachedHWM:i,blocked:n,strategy:this.storeOptions.strategy}}async __free__(e,t){return await this.yieldLoop(),this._running-=t,this._done+=t,this.instance._drainAll(this.computeCapacity()),{running:this._running}}};var v=g,y=c,b=class{constructor(e){this.status=e,this._jobs={},this.counts=this.status.map(function(){return 0})}next(e){var t=this._jobs[e],n=t+1;if(t!=null&&n<this.status.length)return this.counts[t]--,this.counts[n]++,this._jobs[e]++;if(t!=null)return this.counts[t]--,delete this._jobs[e]}start(e){var t=0;return this._jobs[e]=t,this.counts[t]++}remove(e){var t=this._jobs[e];return t!=null&&(this.counts[t]--,delete this._jobs[e]),t!=null}jobStatus(e){return this.status[this._jobs[e]]??null}statusJobs(e){var t,n,r,i,a;if(e!=null){if(n=this.status.indexOf(e),n<0)throw new y(`status must be one of ${this.status.join(`, `)}`);for(t in r=this._jobs,i=[],r)a=r[t],a===n&&i.push(t);return i}else return Object.keys(this._jobs)}statusCounts(){return this.counts.reduce(((e,t,n)=>(e[this.status[n]]=t,e)),{})}},x=r,S=class{constructor(e,t){this.schedule=this.schedule.bind(this),this.name=e,this.Promise=t,this._running=0,this._queue=new x}isEmpty(){return this._queue.length===0}async _tryToRun(){var e,t,n,r,i,a,o;if(this._running<1&&this._queue.length>0)return this._running++,{task:o,args:e,resolve:i,reject:r}=this._queue.shift(),t=await(async function(){try{return a=await o(...e),function(){return i(a)}}catch(e){return n=e,function(){return r(n)}}})(),this._running--,this._tryToRun(),t()}schedule(e,...t){var n,r,i=r=null;return n=new this.Promise(function(e,t){return i=e,r=t}),this._queue.push({task:e,args:t,resolve:i,reject:r}),this._tryToRun(),n}},C=`2.19.5`,w=Object.freeze({version:C,default:{version:C}}),T=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),E=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),D=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),O,k,A,j,M,N=n;O=i,j=T,A=E,M=D,k=(function(){class e{constructor(e={}){this.deleteKey=this.deleteKey.bind(this),this.limiterOptions=e,N.load(this.limiterOptions,this.defaults,this),this.Events=new O(this),this.instances={},this.Bottleneck=V,this._startAutoCleanup(),this.sharedConnection=this.connection!=null,this.connection??(this.limiterOptions.datastore===`redis`?this.connection=new j(Object.assign({},this.limiterOptions,{Events:this.Events})):this.limiterOptions.datastore===`ioredis`&&(this.connection=new A(Object.assign({},this.limiterOptions,{Events:this.Events}))))}key(e=``){return this.instances[e]??(()=>{var t=this.instances[e]=new this.Bottleneck(Object.assign(this.limiterOptions,{id:`${this.id}-${e}`,timeout:this.timeout,connection:this.connection}));return this.Events.trigger(`created`,t,e),t})()}async deleteKey(e=``){var t,n=this.instances[e];return this.connection&&(t=await this.connection.__runCommand__([`del`,...M.allKeys(`${this.id}-${e}`)])),n!=null&&(delete this.instances[e],await n.disconnect()),n!=null||t>0}limiters(){var e,t=this.instances,n=[],r;for(e in t)r=t[e],n.push({key:e,limiter:r});return n}keys(){return Object.keys(this.instances)}async clusterKeys(){var e,t,n,r,i,a,o,s,c;if(this.connection==null)return this.Promise.resolve(this.keys());for(a=[],e=null,c=`b_${this.id}-`.length,t=9;e!==0;)for([s,n]=await this.connection.__runCommand__([`scan`,e??0,`match`,`b_${this.id}-*_settings`,`count`,1e4]),e=~~s,r=0,o=n.length;r<o;r++)i=n[r],a.push(i.slice(c,-t));return a}_startAutoCleanup(){var e;return clearInterval(this.interval),typeof(e=this.interval=setInterval(async()=>{var e,t,n,r,i=Date.now(),a;for(t in n=this.instances,r=[],n){a=n[t];try{await a._store.__groupCheck__(i)?r.push(this.deleteKey(t)):r.push(void 0)}catch(t){e=t,r.push(a.Events.trigger(`error`,e))}}return r},this.timeout/2)).unref==`function`?e.unref():void 0}updateSettings(e={}){if(N.overwrite(e,this.defaults,this),N.overwrite(e,e,this.limiterOptions),e.timeout!=null)return this._startAutoCleanup()}disconnect(e=!0){if(!this.sharedConnection)return this.connection?.disconnect(e)}}return e.prototype.defaults={timeout:1e3*60*5,connection:null,Promise,id:`group-key`},e}).call(e);var P=k,ee,te,ne=n;te=i,ee=(function(){class e{constructor(e={}){this.options=e,ne.load(this.options,this.defaults,this),this.Events=new te(this),this._arr=[],this._resetPromise(),this._lastFlush=Date.now()}_resetPromise(){return this._promise=new this.Promise((e,t)=>this._resolve=e)}_flush(){return clearTimeout(this._timeout),this._lastFlush=Date.now(),this._resolve(),this.Events.trigger(`batch`,this._arr),this._arr=[],this._resetPromise()}add(e){var t;return this._arr.push(e),t=this._promise,this._arr.length===this.maxSize?this._flush():this.maxTime!=null&&this._arr.length===1&&(this._timeout=setTimeout(()=>this._flush(),this.maxTime)),t}}return e.prototype.defaults={maxTime:null,maxSize:null,Promise},e}).call(e);var F=ee,re=()=>console.log(`You must import the full version of Bottleneck in order to use this feature.`),ie=t(w),ae,oe,I,L,se,ce,le,ue,R,de,z,B=[].splice;ce=10,oe=5,z=n,le=s,L=m,se=v,ue=re,I=i,R=b,de=S,ae=(function(){class e{constructor(t={},...n){var r,i;this._addToQueue=this._addToQueue.bind(this),this._validateOptions(t,n),z.load(t,this.instanceDefaults,this),this._queues=new le(ce),this._scheduled={},this._states=new R([`RECEIVED`,`QUEUED`,`RUNNING`,`EXECUTING`].concat(this.trackDoneStatus?[`DONE`]:[])),this._limiter=null,this.Events=new I(this),this._submitLock=new de(`submit`,this.Promise),this._registerLock=new de(`register`,this.Promise),i=z.load(t,this.storeDefaults,{}),this._store=(function(){if(this.datastore===`redis`||this.datastore===`ioredis`||this.connection!=null)return r=z.load(t,this.redisStoreDefaults,{}),new ue(this,i,r);if(this.datastore===`local`)return r=z.load(t,this.localStoreDefaults,{}),new se(this,i,r);throw new e.prototype.BottleneckError(`Invalid datastore type: ${this.datastore}`)}).call(this),this._queues.on(`leftzero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.ref==`function`?e.ref():void 0}),this._queues.on(`zero`,()=>{var e;return(e=this._store.heartbeat)==null?void 0:typeof e.unref==`function`?e.unref():void 0})}_validateOptions(t,n){if(!(typeof t==`object`&&t&&n.length===0))throw new e.prototype.BottleneckError(`Bottleneck v2 takes a single object argument. Refer to https://github.com/SGrondin/bottleneck#upgrading-to-v2 if you're upgrading from Bottleneck v1.`)}ready(){return this._store.ready}clients(){return this._store.clients}channel(){return`b_${this.id}`}channel_client(){return`b_${this.id}_${this._store.clientId}`}publish(e){return this._store.__publish__(e)}disconnect(e=!0){return this._store.__disconnect__(e)}chain(e){return this._limiter=e,this}queued(e){return this._queues.queued(e)}clusterQueued(){return this._store.__queued__()}empty(){return this.queued()===0&&this._submitLock.isEmpty()}running(){return this._store.__running__()}done(){return this._store.__done__()}jobStatus(e){return this._states.jobStatus(e)}jobs(e){return this._states.statusJobs(e)}counts(){return this._states.statusCounts()}_randomIndex(){return Math.random().toString(36).slice(2)}check(e=1){return this._store.__check__(e)}_clearGlobalState(e){return this._scheduled[e]==null?!1:(clearTimeout(this._scheduled[e].expiration),delete this._scheduled[e],!0)}async _free(e,t,n,r){var i,a;try{if({running:a}=await this._store.__free__(e,n.weight),this.Events.trigger(`debug`,`Freed ${n.id}`,r),a===0&&this.empty())return this.Events.trigger(`idle`)}catch(e){return i=e,this.Events.trigger(`error`,i)}}_run(e,t,n){var r,i,a;return t.doRun(),r=this._clearGlobalState.bind(this,e),a=this._run.bind(this,e,t),i=this._free.bind(this,e,t),this._scheduled[e]={timeout:setTimeout(()=>t.doExecute(this._limiter,r,a,i),n),expiration:t.options.expiration==null?void 0:setTimeout(function(){return t.doExpire(r,a,i)},n+t.options.expiration),job:t}}_drainOne(e){return this._registerLock.schedule(()=>{var t,n,r,i,a;return this.queued()===0||(a=this._queues.getFirst(),{options:i,args:t}=r=a.first(),e!=null&&i.weight>e)?this.Promise.resolve(null):(this.Events.trigger(`debug`,`Draining ${i.id}`,{args:t,options:i}),n=this._randomIndex(),this._store.__register__(n,i.weight,i.expiration).then(({success:e,wait:o,reservoir:s})=>{var c;return this.Events.trigger(`debug`,`Drained ${i.id}`,{success:e,args:t,options:i}),e?(a.shift(),c=this.empty(),c&&this.Events.trigger(`empty`),s===0&&this.Events.trigger(`depleted`,c),this._run(n,r,o),this.Promise.resolve(i.weight)):this.Promise.resolve(null)}))})}_drainAll(e,t=0){return this._drainOne(e).then(n=>{var r;return n==null?this.Promise.resolve(t):(r=e==null?e:e-n,this._drainAll(r,t+n))}).catch(e=>this.Events.trigger(`error`,e))}_dropAllQueued(e){return this._queues.shiftAll(function(t){return t.doDrop({message:e})})}stop(t={}){var n,r;return t=z.load(t,this.stopDefaults),r=e=>{var t=()=>{var t=this._states.counts;return t[0]+t[1]+t[2]+t[3]===e};return new this.Promise((e,n)=>t()?e():this.on(`done`,()=>{if(t())return this.removeAllListeners(`done`),e()}))},n=t.dropWaitingJobs?(this._run=function(e,n){return n.doDrop({message:t.dropErrorMessage})},this._drainOne=()=>this.Promise.resolve(null),this._registerLock.schedule(()=>this._submitLock.schedule(()=>{var e,n=this._scheduled,i;for(e in n)i=n[e],this.jobStatus(i.job.options.id)===`RUNNING`&&(clearTimeout(i.timeout),clearTimeout(i.expiration),i.job.doDrop({message:t.dropErrorMessage}));return this._dropAllQueued(t.dropErrorMessage),r(0)}))):this.schedule({priority:ce-1,weight:0},()=>r(1)),this._receive=function(n){return n._reject(new e.prototype.BottleneckError(t.enqueueErrorMessage))},this.stop=()=>this.Promise.reject(new e.prototype.BottleneckError(`stop() has already been called`)),n}async _addToQueue(t){var n,r,i,a,o,s,c;({args:n,options:a}=t);try{({reachedHWM:o,blocked:r,strategy:c}=await this._store.__submit__(this.queued(),a.weight))}catch(e){return i=e,this.Events.trigger(`debug`,`Could not queue ${a.id}`,{args:n,options:a,error:i}),t.doDrop({error:i}),!1}return r?(t.doDrop(),!0):o&&(s=c===e.prototype.strategy.LEAK?this._queues.shiftLastFrom(a.priority):c===e.prototype.strategy.OVERFLOW_PRIORITY?this._queues.shiftLastFrom(a.priority+1):c===e.prototype.strategy.OVERFLOW?t:void 0,s?.doDrop(),s==null||c===e.prototype.strategy.OVERFLOW)?(s??t.doDrop(),o):(t.doQueue(o,r),this._queues.push(t),await this._drainAll(),o)}_receive(t){return this._states.jobStatus(t.options.id)==null?(t.doReceive(),this._submitLock.schedule(this._addToQueue,t)):(t._reject(new e.prototype.BottleneckError(`A job with the same id already exists (id=${t.options.id})`)),!1)}submit(...e){var t,n,r,i,a,o,s;return typeof e[0]==`function`?(a=e,[n,...e]=a,[t]=B.call(e,-1),i=z.load({},this.jobDefaults)):(o=e,[i,n,...e]=o,[t]=B.call(e,-1),i=z.load(i,this.jobDefaults)),s=(...e)=>new this.Promise(function(t,r){return n(...e,function(...e){return(e[0]==null?t:r)(e)})}),r=new L(s,e,i,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),r.promise.then(function(e){return typeof t==`function`?t(...e):void 0}).catch(function(e){return Array.isArray(e)?typeof t==`function`?t(...e):void 0:typeof t==`function`?t(e):void 0}),this._receive(r)}schedule(...e){var t,n,r;return typeof e[0]==`function`?([r,...e]=e,n={}):[n,r,...e]=e,t=new L(r,e,n,this.jobDefaults,this.rejectOnDrop,this.Events,this._states,this.Promise),this._receive(t),t.promise}wrap(e){var t=this.schedule.bind(this),n=function(...n){return t(e.bind(this),...n)};return n.withOptions=function(n,...r){return t(n,e,...r)},n}async updateSettings(e={}){return await this._store.__updateSettings__(z.overwrite(e,this.storeDefaults)),z.overwrite(e,this.instanceDefaults,this),this}currentReservoir(){return this._store.__currentReservoir__()}incrementReservoir(e=0){return this._store.__incrementReservoir__(e)}}return e.default=e,e.Events=I,e.version=e.prototype.version=ie.version,e.strategy=e.prototype.strategy={LEAK:1,OVERFLOW:2,OVERFLOW_PRIORITY:4,BLOCK:3},e.BottleneckError=e.prototype.BottleneckError=c,e.Group=e.prototype.Group=P,e.RedisConnection=e.prototype.RedisConnection=T,e.IORedisConnection=e.prototype.IORedisConnection=E,e.Batcher=e.prototype.Batcher=F,e.prototype.jobDefaults={priority:oe,weight:1,expiration:null,id:`<no-id>`},e.prototype.storeDefaults={maxConcurrent:null,minTime:0,highWater:null,strategy:e.prototype.strategy.LEAK,penalty:null,reservoir:null,reservoirRefreshInterval:null,reservoirRefreshAmount:null,reservoirIncreaseInterval:null,reservoirIncreaseAmount:null,reservoirIncreaseMaximum:null},e.prototype.localStoreDefaults={Promise,timeout:null,heartbeatInterval:250},e.prototype.redisStoreDefaults={Promise,timeout:null,heartbeatInterval:5e3,clientTimeout:1e4,Redis:null,clientOptions:{},clusterNodes:null,clearDatastore:!1,connection:null},e.prototype.instanceDefaults={datastore:`local`,connection:null,id:`<no-id>`,rejectOnDrop:!0,trackDoneStatus:!1,Promise},e.prototype.stopDefaults={enqueueErrorMessage:`This limiter has been stopped and cannot accept new jobs.`,dropWaitingJobs:!0,dropErrorMessage:`This limiter has been stopped.`},e}).call(e);var V=ae;return V}))}))(),1),pt=`0.0.0-development`,mt=()=>Promise.resolve();function ht(e,t,n){return e.retryLimiter.schedule(gt,e,t,n)}async function gt(e,t,n){let{pathname:r}=new URL(n.url,`http://github.test`),i=_t(n.method,r),a=!i&&n.method!==`GET`&&n.method!==`HEAD`,o=n.method===`GET`&&r.startsWith(`/search/`),s=r.startsWith(`/graphql`),c=~~t.retryCount>0?{priority:0,weight:0}:{};e.clustering&&(c.expiration=1e3*60),(a||s)&&await e.write.key(e.id).schedule(c,mt),a&&e.triggersNotification(r)&&await e.notifications.key(e.id).schedule(c,mt),o&&await e.search.key(e.id).schedule(c,mt);let l=(i?e.auth:e.global).key(e.id).schedule(c,t,n);if(s){let e=await l;if(e.data.errors!=null&&e.data.errors.some(e=>e.type===`RATE_LIMITED`))throw Object.assign(Error(`GraphQL Rate Limit Exceeded`),{response:e,data:e.data})}return l}function _t(e,t){return e===`PATCH`&&/^\/applications\/[^/]+\/token\/scoped$/.test(t)||e===`POST`&&(/^\/applications\/[^/]+\/token$/.test(t)||/^\/app\/installations\/[^/]+\/access_tokens$/.test(t)||t===`/login/oauth/access_token`)}var vt=[`/orgs/{org}/invitations`,`/orgs/{org}/invitations/{invitation_id}`,`/orgs/{org}/teams/{team_slug}/discussions`,`/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments`,`/repos/{owner}/{repo}/collaborators/{username}`,`/repos/{owner}/{repo}/commits/{commit_sha}/comments`,`/repos/{owner}/{repo}/issues`,`/repos/{owner}/{repo}/issues/{issue_number}/comments`,`/repos/{owner}/{repo}/issues/{issue_number}/sub_issue`,`/repos/{owner}/{repo}/issues/{issue_number}/sub_issues/priority`,`/repos/{owner}/{repo}/pulls`,`/repos/{owner}/{repo}/pulls/{pull_number}/comments`,`/repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies`,`/repos/{owner}/{repo}/pulls/{pull_number}/merge`,`/repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers`,`/repos/{owner}/{repo}/pulls/{pull_number}/reviews`,`/repos/{owner}/{repo}/releases`,`/teams/{team_id}/discussions`,`/teams/{team_id}/discussions/{discussion_number}/comments`];function yt(e){let t=`^(?:${e.map(e=>e.split(`/`).map(e=>e.startsWith(`{`)?`(?:.+?)`:e).join(`/`)).map(e=>`(?:${e})`).join(`|`)})[^/]*$`;return new RegExp(t,`i`)}var bt=yt(vt),xt=bt.test.bind(bt),St={},Ct=function(e,t){St.global=new e.Group({id:`octokit-global`,maxConcurrent:10,...t}),St.auth=new e.Group({id:`octokit-auth`,maxConcurrent:1,...t}),St.search=new e.Group({id:`octokit-search`,maxConcurrent:1,minTime:2e3,...t}),St.write=new e.Group({id:`octokit-write`,maxConcurrent:1,minTime:1e3,...t}),St.notifications=new e.Group({id:`octokit-notifications`,maxConcurrent:1,minTime:3e3,...t})};function wt(e,t){let{enabled:n=!0,Bottleneck:r=ft.default,id:i=`no-id`,timeout:a=1e3*60*2,connection:o}=t.throttle||{};if(!n)return{};let s={timeout:a};o!==void 0&&(s.connection=o),St.global??Ct(r,s);let c=Object.assign({clustering:o!=null,triggersNotification:xt,fallbackSecondaryRateRetryAfter:60,retryAfterBaseValue:1e3,retryLimiter:new r,id:i,...St},t.throttle);if(typeof c.onSecondaryRateLimit!=`function`||typeof c.onRateLimit!=`function`)throw Error(`octokit/plugin-throttling error:
You must pass the onSecondaryRateLimit and onRateLimit error handlers.
See https://octokit.github.io/rest.js/#throttling
const octokit = new Octokit({
throttle: {
onSecondaryRateLimit: (retryAfter, options) => {/* ... */},
onRateLimit: (retryAfter, options) => {/* ... */}
}
})
`);let l={},u=new r.Events(l);return l.on(`secondary-limit`,c.onSecondaryRateLimit),l.on(`rate-limit`,c.onRateLimit),l.on(`error`,t=>e.log.warn(`Error in throttling-plugin limit handler`,t)),c.retryLimiter.on(`failed`,async function(t,n){let[r,i,a]=n.args,{pathname:o}=new URL(a.url,`http://github.test`);if(!(o.startsWith(`/graphql`)&&t.status!==401||t.status===403||t.status===429))return;let s=~~i.retryCount;i.retryCount=s,a.request.retryCount=s;let{wantRetry:c,retryAfter:l=0}=await(async function(){if(/\bsecondary rate\b/i.test(t.message)){let n=Number(t.response.headers[`retry-after`])||r.fallbackSecondaryRateRetryAfter;return{wantRetry:await u.trigger(`secondary-limit`,n,a,e,s),retryAfter:n}}if(t.response.headers!=null&&t.response.headers[`x-ratelimit-remaining`]===`0`||(t.response.data?.errors??[]).some(e=>e.type===`RATE_LIMITED`)){let n=new Date(~~t.response.headers[`x-ratelimit-reset`]*1e3).getTime(),r=Math.max(Math.ceil((n-Date.now())/1e3)+1,0);return{wantRetry:await u.trigger(`rate-limit`,r,a,e,s),retryAfter:r}}return{}})();if(c)return i.retryCount++,l*r.retryAfterBaseValue}),e.hook.wrap(`request`,ht.bind(null,c)),{}}wt.VERSION=pt,wt.triggersNotification=xt;const Tt=e=>s(e,{throttle:{onRateLimit:(e,t,n,r)=>{if(a(`Request quota exhausted for request ${t.method} ${t.url}`),r<=2)return c(`Retrying after ${e} seconds!`),!0},onSecondaryRateLimit:(e,t,n,r)=>{if(a(`SecondaryRateLimit detected for request ${t.method} ${t.url}`),r<=2)return c(`Retrying after ${e} seconds!`),!0}}},wt);async function Et(e=process.cwd()){let t=await _(e),n=await h(e);if(t!==void 0&&t.mode===`pre`){let e=new Set(t.changesets);return{preState:t,changesets:n.filter(t=>!e.has(t.id))}}return{preState:void 0,changesets:n}}var Dt=o(v(),1),Ot=g();const kt={dep:0,patch:1,minor:2,major:3};async function At(e){let{packages:t}=await(0,Ot.getPackages)(e);return new Map(t.map(e=>[e.dir,e.packageJson.version]))}async function jt(e,t){let{packages:n}=await(0,Ot.getPackages)(e),r=new Set;for(let e of n)t.get(e.dir)!==e.packageJson.version&&r.add(e);return[...r]}function Mt(e,t){let n=kt.dep,r,i,a=/^(#{1,6})\s(.*)$|^(`{3,})/gm,o;for(;(o=a.exec(e))!=null;){if(o[3]){let t=RegExp(`^${o[3]}`,`gm`);if(t.lastIndex=a.lastIndex,t.exec(e)){a.lastIndex=t.lastIndex;continue}else break}let s=o[1].length,c=o[2].trim(),l=/(major|minor|patch)/.exec(c.toLowerCase());if(l!=null){let e=kt[l[0]];n=Math.max(e,n)}if(c===t){r={index:a.lastIndex,depth:s};continue}if(r&&s===r.depth){i=o.index;break}}return{content:e.slice(r?.index,i).trim(),highestLevel:n}}function Nt(e,t){return e.private===t.private?t.highestLevel-e.highestLevel:e.private?1:-1}function Pt(e,t){return typeof e==`object`&&!!e&&`code`in e&&e.code===t}function Ft(e){return x.access(e,x.constants.F_OK).then(()=>!0,()=>!1)}const It=b(import.meta.url),Lt=async(e,{pkg:t,tagName:n})=>{let r;try{r=await x.readFile(S.join(t.dir,`CHANGELOG.md`),`utf8`)}catch(e){if(Pt(e,`ENOENT`))return;throw e}let i=Mt(r,t.packageJson.version);if(!i)throw Error(`Could not find changelog entry for ${t.packageJson.name}@${t.packageJson.version}`);await e.rest.repos.createRelease({name:n,tag_name:n,body:i.content,prerelease:t.packageJson.version.includes(`-`),...f.repo})};async function Rt({script:e,githubToken:t,git:r,octokit:i,createGithubReleases:a,cwd:o}){let s=await n(e,void 0,{cwd:o,ignoreReturnCode:!0,env:{...process.env,GITHUB_TOKEN:t}}),{packages:c,tool:l}=await(0,Ot.getPackages)(o),u=[];if(l!==`root`){let e=/New tag:\s+(@[^/]+\/[^@]+|[^/]+)@([^\s]+)/,t=new Map(c.map(e=>[e.packageJson.name,e]));for(let n of s.stdout.split(`
`)){let r=n.match(e);if(r===null)continue;let i=r[1],a=t.get(i);if(a===void 0)throw Error(`Package "${i}" not found.This is probably a bug in the action, please open an issue`);u.push(a)}a&&await Promise.all(u.map(async e=>{let t=`${e.packageJson.name}@${e.packageJson.version}`;await r.pushTag(t),await Lt(i,{pkg:e,tagName:t})}))}else{if(c.length===0)throw Error(`No package found.This is probably a bug in the action, please open an issue`);let e=c[0],t=/New tag:/;for(let n of s.stdout.split(`
`))if(n.match(t)){if(u.push(e),a){let t=`v${e.packageJson.version}`;await r.pushTag(t),await Lt(i,{pkg:e,tagName:t})}break}}return u.length?{published:!0,publishedPackages:u.map(e=>({name:e.packageJson.name,version:e.packageJson.version})),exitCode:s.exitCode}:{published:!1,exitCode:s.exitCode}}const zt=e=>{try{return It(It.resolve(`@changesets/cli/package.json`,{paths:[e]}))}catch(t){throw Pt(t,`MODULE_NOT_FOUND`)?Error(`Have you forgotten to install \`@changesets/cli\` in "${e}"?`,{cause:t}):t}};async function Bt({hasPublishScript:e,preState:t,changedPackagesInfo:n,prBodyMaxCharacters:r,branch:i}){let a=`This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and ${e?`the packages will be published to npm automatically`:`publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing)`}. If you're not ready to do a release yet, that's fine, whenever you add more changesets to ${i}, this PR will be updated.
`,o=t?`⚠️⚠️⚠️⚠️⚠️⚠️
\`${i}\` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run \`changeset pre exit\` on \`${i}\`.
⚠️⚠️⚠️⚠️⚠️⚠️
`:``,s=`# Releases`,c=[a,o,s,...n.map(e=>`${e.header}\n\n${e.content}`)].join(`
`);return c.length>r&&(c=[a,o,s,`
> The changelog information of each package has been omitted from this message, as the content exceeds the size limit.
`,...n.map(e=>`${e.header}\n\n`)].join(`
`)),c.length>r&&(c=[a,o,s,`
> All release information have been omitted from this message, as the content exceeds the size limit.`].join(`
`)),c}async function Vt({script:e,githubToken:t,git:n,octokit:r,cwd:i=process.cwd(),prTitle:a=`Version Packages`,commitMessage:o=`Version Packages`,hasPublishScript:s=!1,prBodyMaxCharacters:l=6e4,branch:u=f.ref.replace(`refs/heads/`,``),prDraft:d}){let m=`changeset-release/${u}`,{preState:h}=await Et(i);await n.prepareBranch(m);let g=await At(i),_={...process.env,GITHUB_TOKEN:t};if(e)await p(e,void 0,{cwd:i,env:_});else{let e=(0,Dt.default)(zt(i).version,`2.0.0`)?`bump`:`version`;await p(`node`,[It.resolve(`@changesets/cli/bin.js`,{paths:[i]}),e],{cwd:i,env:_})}let v=await jt(i,g),y=Promise.all(v.map(async e=>{let t=Mt(await x.readFile(S.join(e.dir,`CHANGELOG.md`),`utf8`),e.packageJson.version);return{highestLevel:t.highestLevel,private:!!e.packageJson.private,content:t.content,header:`## ${e.packageJson.name}@${e.packageJson.version}`}})),b=`${a}${h?` (${h.tag})`:``}`,C=`${o}${h?` (${h.tag})`:``}`,w=await r.rest.pulls.list({...f.repo,state:`open`,head:`${f.repo.owner}:${m}`,base:u});c(`Existing pull requests: ${JSON.stringify(w.data,null,2)}`),await n.pushChanges({branch:m,message:C});let T=await Bt({hasPublishScript:s,preState:h,branch:u,changedPackagesInfo:(await y).filter(e=>e).sort(Nt),prBodyMaxCharacters:l});if(w.data.length===0){c(`creating pull request`);let{data:e}=await r.rest.pulls.create({base:u,head:m,title:b,body:T,draft:d!==void 0,...f.repo});return{pullRequestNumber:e.number}}else{let[e]=w.data;c(`updating found pull request #${e.number}`);let t=`
mutation UpdatePullRequest(
$pullRequestId: ID!
$title: String!
$body: String!
) {
${d===`always`?`
convertPullRequestToDraft(
input: {
pullRequestId: $pullRequestId
}
) {
pullRequest {
id
}
}`:``}
updatePullRequest(
input: {
pullRequestId: $pullRequestId
title: $title
body: $body
state: OPEN
}
) {
pullRequest {
id
}
}
}
`;return await r.graphql(t,{pullRequestId:e.node_id,title:b,body:T}),{pullRequestNumber:e.number}}}const Ht=t=>e(t)||void 0;(async()=>{let n=process.env.GITHUB_TOKEN||e(`github-token`);if(!n){d(`Please add the GITHUB_TOKEN to the changesets action`);return}let r=S.resolve(Ht(`cwd`)??``);c(`using resolved cwd: ${r}`);let a=Tt(n),o=Ht(`commitMode`)??`git-cli`,s=Ht(`prDraft`);if(o!==`git-cli`&&o!==`github-api`){d(`Invalid commit mode: ${o}`);return}if(s!==void 0&&s!==`always`&&s!==`create`){d(`Invalid prDraft: ${s}`);return}let l=new dt({octokit:o===`github-api`?a:void 0,cwd:r});i(`setupGitUser`)&&(c(`setting git user`),await l.setupUser()),c(`setting GitHub credentials`),await x.writeFile(`${process.env.HOME}/.netrc`,`machine github.com\nlogin github-actions[bot]\npassword ${n}`);let{changesets:f}=await Et(r),p=e(`publish`),m=f.length!==0,h=f.some(e=>e.releases.length>0),g=!!p;switch(t(`published`,`false`),t(`publishedPackages`,`[]`),t(`hasChangesets`,String(m)),!0){case!m&&!g:c(`No changesets present or were removed by merging release PR. Not publishing because no publish script found.`);return;case!m&&g:{if(c(`No changesets found. Attempting to publish any unpublished packages to npm`),process.env.NPM_TOKEN){let e=`${process.env.HOME}/.npmrc`;await Ft(e)?(c(`Found existing user .npmrc file`),(await x.readFile(e,`utf8`)).split(`
`).find(e=>/^\s*\/\/registry\.npmjs\.org\/:[_-]authToken=/i.test(e))?c(`Found existing auth token for the npm registry in the user .npmrc file`):(c(`Didn't find existing auth token for the npm registry in the user .npmrc file, creating one`),await x.appendFile(e,`\n//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`))):(c(`No user .npmrc file found, creating one with NPM_TOKEN used as auth token`),await x.writeFile(e,`//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}\n`))}else process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN&&process.env.ACTIONS_ID_TOKEN_REQUEST_URL?c(`No NPM_TOKEN found, but OIDC is available - using npm trusted publishing`):c(`No NPM_TOKEN or OIDC available - assuming npm is already authenticated`);let e=await Rt({script:p,githubToken:n,git:l,octokit:a,createGithubReleases:i(`createGithubReleases`),cwd:r});e.published&&(t(`published`,`true`),t(`publishedPackages`,JSON.stringify(e.publishedPackages))),e.exitCode!==0&&(u(`Publish command exited with code ${e.exitCode}${e.published?`, but some packages were published: ${e.publishedPackages.map(e=>`${e.name}@${e.version}`).join(`, `)}`:``}`),process.exit(e.exitCode));return}case m&&!h:c(`All changesets are empty; not creating PR`);return;case m:{let e=Tt(n),{pullRequestNumber:i}=await Vt({script:Ht(`version`),githubToken:n,git:l,octokit:e,cwd:r,prTitle:Ht(`title`),commitMessage:Ht(`commit`),hasPublishScript:g,prDraft:s,branch:Ht(`branch`)});t(`pullRequestNumber`,String(i));return}}})().catch(e=>{u(e),d(e.message)});export{};