From e5b60ac4b87cfc4ca7139b36a0cf48628ffcb0cb Mon Sep 17 00:00:00 2001 From: "Plasmo G.A.T Deployer" Date: Sun, 15 Jan 2023 23:59:39 +0000 Subject: [PATCH] Updates --- index.js | 98 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/index.js b/index.js index a01ca0a..5ec5709 100644 --- a/index.js +++ b/index.js @@ -1,32 +1,74 @@ -"use strict";var Pc=Object.create;var ss=Object.defineProperty;var xc=Object.getOwnPropertyDescriptor;var kc=Object.getOwnPropertyNames;var Ac=Object.getPrototypeOf,qc=Object.prototype.hasOwnProperty;var ce=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Cc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of kc(t))!qc.call(e,o)&&o!==r&&ss(e,o,{get:()=>t[o],enumerable:!(n=xc(t,o))||n.enumerable});return e};var as=(e,t,r)=>(r=e!=null?Pc(Ac(e)):{},Cc(t||!e||!e.__esModule?ss(r,"default",{value:e,enumerable:!0}):r,e));var ls=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(u){o(u)}},s=l=>{try{a(r.throw(l))}catch(u){o(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())});var Qr=ce(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.toCommandProperties=Kt.toCommandValue=void 0;function jc(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}Kt.toCommandValue=jc;function Ic(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}Kt.toCommandProperties=Ic});var ds=ce(Be=>{"use strict";var $c=Be&&Be.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Mc=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Lc=Be&&Be.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&$c(t,e,r);return Mc(t,e),t};Object.defineProperty(Be,"__esModule",{value:!0});Be.issue=Be.issueCommand=void 0;var Nc=Lc(require("os")),cs=Qr();function hs(e,t,r){let n=new bo(e,t,r);process.stdout.write(n.toString()+Nc.EOL)}Be.issueCommand=hs;function Bc(e,t=""){hs(e,{},t)}Be.issue=Bc;var us="::",bo=class{constructor(t,r,n){t||(t="missing.command"),this.command=t,this.properties=r,this.message=n}toString(){let t=us+this.command;if(this.properties&&Object.keys(this.properties).length>0){t+=" ";let r=!0;for(let n in this.properties)if(this.properties.hasOwnProperty(n)){let o=this.properties[n];o&&(r?r=!1:t+=",",t+=`${n}=${zc(o)}`)}}return t+=`${us}${Uc(this.message)}`,t}};function Uc(e){return cs.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function zc(e){return cs.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});var _o=ce(vo=>{"use strict";Object.defineProperty(vo,"__esModule",{value:!0});vo.default=Fc;var Dc=Hc(require("crypto"));function Hc(e){return e&&e.__esModule?e:{default:e}}var Xr=new Uint8Array(256),Yr=Xr.length;function Fc(){return Yr>Xr.length-16&&(Dc.default.randomFillSync(Xr),Yr=0),Xr.slice(Yr,Yr+=16)}});var fs=ce(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.default=void 0;var Wc=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;Zr.default=Wc});var gr=ce(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.default=void 0;var Vc=Gc(fs());function Gc(e){return e&&e.__esModule?e:{default:e}}function Jc(e){return typeof e=="string"&&Vc.default.test(e)}var Kc=Jc;en.default=Kc});var br=ce(tn=>{"use strict";Object.defineProperty(tn,"__esModule",{value:!0});tn.default=void 0;var Qc=Yc(gr());function Yc(e){return e&&e.__esModule?e:{default:e}}var _e=[];for(let e=0;e<256;++e)_e.push((e+256).toString(16).substr(1));function Xc(e,t=0){let r=(_e[e[t+0]]+_e[e[t+1]]+_e[e[t+2]]+_e[e[t+3]]+"-"+_e[e[t+4]]+_e[e[t+5]]+"-"+_e[e[t+6]]+_e[e[t+7]]+"-"+_e[e[t+8]]+_e[e[t+9]]+"-"+_e[e[t+10]]+_e[e[t+11]]+_e[e[t+12]]+_e[e[t+13]]+_e[e[t+14]]+_e[e[t+15]]).toLowerCase();if(!(0,Qc.default)(r))throw TypeError("Stringified UUID is invalid");return r}var Zc=Xc;tn.default=Zc});var ys=ce(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.default=void 0;var eh=ms(_o()),th=ms(br());function ms(e){return e&&e.__esModule?e:{default:e}}var ps,wo,So=0,Eo=0;function rh(e,t,r){let n=t&&r||0,o=t||new Array(16);e=e||{};let i=e.node||ps,s=e.clockseq!==void 0?e.clockseq:wo;if(i==null||s==null){let c=e.random||(e.rng||eh.default)();i==null&&(i=ps=[c[0]|1,c[1],c[2],c[3],c[4],c[5]]),s==null&&(s=wo=(c[6]<<8|c[7])&16383)}let a=e.msecs!==void 0?e.msecs:Date.now(),l=e.nsecs!==void 0?e.nsecs:Eo+1,u=a-So+(l-Eo)/1e4;if(u<0&&e.clockseq===void 0&&(s=s+1&16383),(u<0||a>So)&&e.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");So=a,Eo=l,wo=s,a+=122192928e5;let d=((a&268435455)*1e4+l)%4294967296;o[n++]=d>>>24&255,o[n++]=d>>>16&255,o[n++]=d>>>8&255,o[n++]=d&255;let h=a/4294967296*1e4&268435455;o[n++]=h>>>8&255,o[n++]=h&255,o[n++]=h>>>24&15|16,o[n++]=h>>>16&255,o[n++]=s>>>8|128,o[n++]=s&255;for(let c=0;c<6;++c)o[n+c]=i[c];return t||(0,th.default)(o)}var nh=rh;rn.default=nh});var To=ce(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.default=void 0;var oh=ih(gr());function ih(e){return e&&e.__esModule?e:{default:e}}function sh(e){if(!(0,oh.default)(e))throw TypeError("Invalid UUID");let t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}var ah=sh;nn.default=ah});var Oo=ce(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.default=hh;Tt.URL=Tt.DNS=void 0;var lh=gs(br()),uh=gs(To());function gs(e){return e&&e.__esModule?e:{default:e}}function ch(e){e=unescape(encodeURIComponent(e));let t=[];for(let r=0;r{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.default=void 0;var dh=fh(require("crypto"));function fh(e){return e&&e.__esModule?e:{default:e}}function ph(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),dh.default.createHash("md5").update(e).digest()}var mh=ph;on.default=mh});var Ss=ce(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.default=void 0;var yh=ws(Oo()),gh=ws(_s());function ws(e){return e&&e.__esModule?e:{default:e}}var bh=(0,yh.default)("v3",48,gh.default),vh=bh;sn.default=vh});var Ts=ce(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.default=void 0;var _h=Es(_o()),wh=Es(br());function Es(e){return e&&e.__esModule?e:{default:e}}function Sh(e,t,r){e=e||{};let n=e.random||(e.rng||_h.default)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let o=0;o<16;++o)t[r+o]=n[o];return t}return(0,wh.default)(n)}var Eh=Sh;an.default=Eh});var Os=ce(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.default=void 0;var Th=Oh(require("crypto"));function Oh(e){return e&&e.__esModule?e:{default:e}}function Rh(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),Th.default.createHash("sha1").update(e).digest()}var Ph=Rh;ln.default=Ph});var Ps=ce(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.default=void 0;var xh=Rs(Oo()),kh=Rs(Os());function Rs(e){return e&&e.__esModule?e:{default:e}}var Ah=(0,xh.default)("v5",80,kh.default),qh=Ah;un.default=qh});var xs=ce(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.default=void 0;var Ch="00000000-0000-0000-0000-000000000000";cn.default=Ch});var ks=ce(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.default=void 0;var jh=Ih(gr());function Ih(e){return e&&e.__esModule?e:{default:e}}function $h(e){if(!(0,jh.default)(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var Mh=$h;hn.default=Mh});var As=ce(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});Object.defineProperty(We,"v1",{enumerable:!0,get:function(){return Lh.default}});Object.defineProperty(We,"v3",{enumerable:!0,get:function(){return Nh.default}});Object.defineProperty(We,"v4",{enumerable:!0,get:function(){return Bh.default}});Object.defineProperty(We,"v5",{enumerable:!0,get:function(){return Uh.default}});Object.defineProperty(We,"NIL",{enumerable:!0,get:function(){return zh.default}});Object.defineProperty(We,"version",{enumerable:!0,get:function(){return Dh.default}});Object.defineProperty(We,"validate",{enumerable:!0,get:function(){return Hh.default}});Object.defineProperty(We,"stringify",{enumerable:!0,get:function(){return Fh.default}});Object.defineProperty(We,"parse",{enumerable:!0,get:function(){return Wh.default}});var Lh=lt(ys()),Nh=lt(Ss()),Bh=lt(Ts()),Uh=lt(Ps()),zh=lt(xs()),Dh=lt(ks()),Hh=lt(gr()),Fh=lt(br()),Wh=lt(To());function lt(e){return e&&e.__esModule?e:{default:e}}});var Is=ce(Ue=>{"use strict";var Vh=Ue&&Ue.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Gh=Ue&&Ue.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Cs=Ue&&Ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Vh(t,e,r);return Gh(t,e),t};Object.defineProperty(Ue,"__esModule",{value:!0});Ue.prepareKeyValueMessage=Ue.issueFileCommand=void 0;var qs=Cs(require("fs")),Ro=Cs(require("os")),Jh=As(),js=Qr();function Kh(e,t){let r=process.env[`GITHUB_${e}`];if(!r)throw new Error(`Unable to find environment variable for file command ${e}`);if(!qs.existsSync(r))throw new Error(`Missing file at path: ${r}`);qs.appendFileSync(r,`${js.toCommandValue(t)}${Ro.EOL}`,{encoding:"utf8"})}Ue.issueFileCommand=Kh;function Qh(e,t){let r=`ghadelimiter_${Jh.v4()}`,n=js.toCommandValue(t);if(e.includes(r))throw new Error(`Unexpected input: name should not contain the delimiter "${r}"`);if(n.includes(r))throw new Error(`Unexpected input: value should not contain the delimiter "${r}"`);return`${e}<<${r}${Ro.EOL}${n}${Ro.EOL}${r}`}Ue.prepareKeyValueMessage=Qh});var Ms=ce(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.checkBypass=Qt.getProxyUrl=void 0;function Yh(e){let t=e.protocol==="https:";if($s(e))return;let r=(()=>t?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(r)return new URL(r)}Qt.getProxyUrl=Yh;function $s(e){if(!e.hostname)return!1;let t=process.env.no_proxy||process.env.NO_PROXY||"";if(!t)return!1;let r;e.port?r=Number(e.port):e.protocol==="http:"?r=80:e.protocol==="https:"&&(r=443);let n=[e.hostname.toUpperCase()];typeof r=="number"&&n.push(`${n[0]}:${r}`);for(let o of t.split(",").map(i=>i.trim().toUpperCase()).filter(i=>i))if(n.some(i=>i===o))return!0;return!1}Qt.checkBypass=$s});var Us=ce(Yt=>{"use strict";var wg=require("net"),Xh=require("tls"),Po=require("http"),Ls=require("https"),Zh=require("events"),Sg=require("assert"),ed=require("util");Yt.httpOverHttp=td;Yt.httpsOverHttp=rd;Yt.httpOverHttps=nd;Yt.httpsOverHttps=od;function td(e){var t=new ut(e);return t.request=Po.request,t}function rd(e){var t=new ut(e);return t.request=Po.request,t.createSocket=Ns,t.defaultPort=443,t}function nd(e){var t=new ut(e);return t.request=Ls.request,t}function od(e){var t=new ut(e);return t.request=Ls.request,t.createSocket=Ns,t.defaultPort=443,t}function ut(e){var t=this;t.options=e||{},t.proxyOptions=t.options.proxy||{},t.maxSockets=t.options.maxSockets||Po.Agent.defaultMaxSockets,t.requests=[],t.sockets=[],t.on("free",function(n,o,i,s){for(var a=Bs(o,i,s),l=0,u=t.requests.length;l=this.maxSockets){i.requests.push(s);return}i.createSocket(s,function(a){a.on("free",l),a.on("close",u),a.on("agentRemove",u),t.onSocket(a);function l(){i.emit("free",a,s)}function u(d){i.removeSocket(a),a.removeListener("free",l),a.removeListener("close",u),a.removeListener("agentRemove",u)}})};ut.prototype.createSocket=function(t,r){var n=this,o={};n.sockets.push(o);var i=xo({},n.proxyOptions,{method:"CONNECT",path:t.host+":"+t.port,agent:!1,headers:{host:t.host+":"+t.port}});t.localAddress&&(i.localAddress=t.localAddress),i.proxyAuth&&(i.headers=i.headers||{},i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")),yt("making CONNECT request");var s=n.request(i);s.useChunkedEncodingByDefault=!1,s.once("response",a),s.once("upgrade",l),s.once("connect",u),s.once("error",d),s.end();function a(h){h.upgrade=!0}function l(h,c,p){process.nextTick(function(){u(h,c,p)})}function u(h,c,p){if(s.removeAllListeners(),c.removeAllListeners(),h.statusCode!==200){yt("tunneling socket could not be established, statusCode=%d",h.statusCode),c.destroy();var m=new Error("tunneling socket could not be established, statusCode="+h.statusCode);m.code="ECONNRESET",t.request.emit("error",m),n.removeSocket(o);return}if(p.length>0){yt("got illegal response body from proxy"),c.destroy();var m=new Error("got illegal response body from proxy");m.code="ECONNRESET",t.request.emit("error",m),n.removeSocket(o);return}return yt("tunneling connection has established"),n.sockets[n.sockets.indexOf(o)]=c,r(c)}function d(h){s.removeAllListeners(),yt(`tunneling socket could not be established, cause=%s -`,h.message,h.stack);var c=new Error("tunneling socket could not be established, cause="+h.message);c.code="ECONNRESET",t.request.emit("error",c),n.removeSocket(o)}};ut.prototype.removeSocket=function(t){var r=this.sockets.indexOf(t);if(r!==-1){this.sockets.splice(r,1);var n=this.requests.shift();n&&this.createSocket(n,function(o){n.request.onSocket(o)})}};function Ns(e,t){var r=this;ut.prototype.createSocket.call(r,e,function(n){var o=e.request.getHeader("host"),i=xo({},r.options,{socket:n,servername:o?o.replace(/:.*$/,""):e.host}),s=Xh.connect(0,i);r.sockets[r.sockets.indexOf(n)]=s,t(s)})}function Bs(e,t,r){return typeof e=="string"?{host:e,port:t,localAddress:r}:e}function xo(e){for(var t=1,r=arguments.length;t{zs.exports=Us()});var Fs=ce(ue=>{"use strict";var id=ue&&ue.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),sd=ue&&ue.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),yn=ue&&ue.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&id(t,e,r);return sd(t,e),t},ye=ue&&ue.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(ue,"__esModule",{value:!0});ue.HttpClient=ue.isHttps=ue.HttpClientResponse=ue.HttpClientError=ue.getProxyUrl=ue.MediaTypes=ue.Headers=ue.HttpCodes=void 0;var dn=yn(require("http")),ko=yn(require("https")),Hs=yn(Ms()),fn=yn(Ds()),Ve;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Ve=ue.HttpCodes||(ue.HttpCodes={}));var Oe;(function(e){e.Accept="accept",e.ContentType="content-type"})(Oe=ue.Headers||(ue.Headers={}));var gt;(function(e){e.ApplicationJson="application/json"})(gt=ue.MediaTypes||(ue.MediaTypes={}));function ad(e){let t=Hs.getProxyUrl(new URL(e));return t?t.href:""}ue.getProxyUrl=ad;var ld=[Ve.MovedPermanently,Ve.ResourceMoved,Ve.SeeOther,Ve.TemporaryRedirect,Ve.PermanentRedirect],ud=[Ve.BadGateway,Ve.ServiceUnavailable,Ve.GatewayTimeout],cd=["OPTIONS","GET","DELETE","HEAD"],hd=10,dd=5,Xt=class extends Error{constructor(t,r){super(t),this.name="HttpClientError",this.statusCode=r,Object.setPrototypeOf(this,Xt.prototype)}};ue.HttpClientError=Xt;var mn=class{constructor(t){this.message=t}readBody(){return ye(this,void 0,void 0,function*(){return new Promise(t=>ye(this,void 0,void 0,function*(){let r=Buffer.alloc(0);this.message.on("data",n=>{r=Buffer.concat([r,n])}),this.message.on("end",()=>{t(r.toString())})}))})}};ue.HttpClientResponse=mn;function fd(e){return new URL(e).protocol==="https:"}ue.isHttps=fd;var Ao=class{constructor(t,r,n){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=t,this.handlers=r||[],this.requestOptions=n,n&&(n.ignoreSslError!=null&&(this._ignoreSslError=n.ignoreSslError),this._socketTimeout=n.socketTimeout,n.allowRedirects!=null&&(this._allowRedirects=n.allowRedirects),n.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=n.allowRedirectDowngrade),n.maxRedirects!=null&&(this._maxRedirects=Math.max(n.maxRedirects,0)),n.keepAlive!=null&&(this._keepAlive=n.keepAlive),n.allowRetries!=null&&(this._allowRetries=n.allowRetries),n.maxRetries!=null&&(this._maxRetries=n.maxRetries))}options(t,r){return ye(this,void 0,void 0,function*(){return this.request("OPTIONS",t,null,r||{})})}get(t,r){return ye(this,void 0,void 0,function*(){return this.request("GET",t,null,r||{})})}del(t,r){return ye(this,void 0,void 0,function*(){return this.request("DELETE",t,null,r||{})})}post(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("POST",t,r,n||{})})}patch(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("PATCH",t,r,n||{})})}put(t,r,n){return ye(this,void 0,void 0,function*(){return this.request("PUT",t,r,n||{})})}head(t,r){return ye(this,void 0,void 0,function*(){return this.request("HEAD",t,null,r||{})})}sendStream(t,r,n,o){return ye(this,void 0,void 0,function*(){return this.request(t,r,n,o)})}getJson(t,r={}){return ye(this,void 0,void 0,function*(){r[Oe.Accept]=this._getExistingOrDefaultHeader(r,Oe.Accept,gt.ApplicationJson);let n=yield this.get(t,r);return this._processResponse(n,this.requestOptions)})}postJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.post(t,o,n);return this._processResponse(i,this.requestOptions)})}putJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.put(t,o,n);return this._processResponse(i,this.requestOptions)})}patchJson(t,r,n={}){return ye(this,void 0,void 0,function*(){let o=JSON.stringify(r,null,2);n[Oe.Accept]=this._getExistingOrDefaultHeader(n,Oe.Accept,gt.ApplicationJson),n[Oe.ContentType]=this._getExistingOrDefaultHeader(n,Oe.ContentType,gt.ApplicationJson);let i=yield this.patch(t,o,n);return this._processResponse(i,this.requestOptions)})}request(t,r,n,o){return ye(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let i=new URL(r),s=this._prepareRequest(t,i,o),a=this._allowRetries&&cd.includes(t)?this._maxRetries+1:1,l=0,u;do{if(u=yield this.requestRaw(s,n),u&&u.message&&u.message.statusCode===Ve.Unauthorized){let h;for(let c of this.handlers)if(c.canHandleAuthentication(u)){h=c;break}return h?h.handleAuthentication(this,s,n):u}let d=this._maxRedirects;for(;u.message.statusCode&&ld.includes(u.message.statusCode)&&this._allowRedirects&&d>0;){let h=u.message.headers.location;if(!h)break;let c=new URL(h);if(i.protocol==="https:"&&i.protocol!==c.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield u.readBody(),c.hostname!==i.hostname)for(let p in o)p.toLowerCase()==="authorization"&&delete o[p];s=this._prepareRequest(t,c,o),u=yield this.requestRaw(s,n),d--}if(!u.message.statusCode||!ud.includes(u.message.statusCode))return u;l+=1,l{function i(s,a){s?o(s):a?n(a):o(new Error("Unknown error"))}this.requestRawWithCallback(t,r,i)})})}requestRawWithCallback(t,r,n){typeof r=="string"&&(t.options.headers||(t.options.headers={}),t.options.headers["Content-Length"]=Buffer.byteLength(r,"utf8"));let o=!1;function i(l,u){o||(o=!0,n(l,u))}let s=t.httpModule.request(t.options,l=>{let u=new mn(l);i(void 0,u)}),a;s.on("socket",l=>{a=l}),s.setTimeout(this._socketTimeout||3*6e4,()=>{a&&a.end(),i(new Error(`Request timeout: ${t.options.path}`))}),s.on("error",function(l){i(l)}),r&&typeof r=="string"&&s.write(r,"utf8"),r&&typeof r!="string"?(r.on("close",function(){s.end()}),r.pipe(s)):s.end()}getAgent(t){let r=new URL(t);return this._getAgent(r)}_prepareRequest(t,r,n){let o={};o.parsedUrl=r;let i=o.parsedUrl.protocol==="https:";o.httpModule=i?ko:dn;let s=i?443:80;if(o.options={},o.options.host=o.parsedUrl.hostname,o.options.port=o.parsedUrl.port?parseInt(o.parsedUrl.port):s,o.options.path=(o.parsedUrl.pathname||"")+(o.parsedUrl.search||""),o.options.method=t,o.options.headers=this._mergeHeaders(n),this.userAgent!=null&&(o.options.headers["user-agent"]=this.userAgent),o.options.agent=this._getAgent(o.parsedUrl),this.handlers)for(let a of this.handlers)a.prepareRequest(o.options);return o}_mergeHeaders(t){return this.requestOptions&&this.requestOptions.headers?Object.assign({},pn(this.requestOptions.headers),pn(t||{})):pn(t||{})}_getExistingOrDefaultHeader(t,r,n){let o;return this.requestOptions&&this.requestOptions.headers&&(o=pn(this.requestOptions.headers)[r]),t[r]||o||n}_getAgent(t){let r,n=Hs.getProxyUrl(t),o=n&&n.hostname;if(this._keepAlive&&o&&(r=this._proxyAgent),this._keepAlive&&!o&&(r=this._agent),r)return r;let i=t.protocol==="https:",s=100;if(this.requestOptions&&(s=this.requestOptions.maxSockets||dn.globalAgent.maxSockets),n&&n.hostname){let a={maxSockets:s,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(n.username||n.password)&&{proxyAuth:`${n.username}:${n.password}`}),{host:n.hostname,port:n.port})},l,u=n.protocol==="https:";i?l=u?fn.httpsOverHttps:fn.httpsOverHttp:l=u?fn.httpOverHttps:fn.httpOverHttp,r=l(a),this._proxyAgent=r}if(this._keepAlive&&!r){let a={keepAlive:this._keepAlive,maxSockets:s};r=i?new ko.Agent(a):new dn.Agent(a),this._agent=r}return r||(r=i?ko.globalAgent:dn.globalAgent),i&&this._ignoreSslError&&(r.options=Object.assign(r.options||{},{rejectUnauthorized:!1})),r}_performExponentialBackoff(t){return ye(this,void 0,void 0,function*(){t=Math.min(hd,t);let r=dd*Math.pow(2,t);return new Promise(n=>setTimeout(()=>n(),r))})}_processResponse(t,r){return ye(this,void 0,void 0,function*(){return new Promise((n,o)=>ye(this,void 0,void 0,function*(){let i=t.message.statusCode||0,s={statusCode:i,result:null,headers:{}};i===Ve.NotFound&&n(s);function a(d,h){if(typeof h=="string"){let c=new Date(h);if(!isNaN(c.valueOf()))return c}return h}let l,u;try{u=yield t.readBody(),u&&u.length>0&&(r&&r.deserializeDates?l=JSON.parse(u,a):l=JSON.parse(u),s.result=l),s.headers=t.message.headers}catch{}if(i>299){let d;l&&l.message?d=l.message:u&&u.length>0?d=u:d=`Failed request: (${i})`;let h=new Xt(d,i);h.result=s.result,o(h)}else n(s)}))})}};ue.HttpClient=Ao;var pn=e=>Object.keys(e).reduce((t,r)=>(t[r.toLowerCase()]=e[r],t),{})});var Ws=ce(rt=>{"use strict";var Io=rt&&rt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(rt,"__esModule",{value:!0});rt.PersonalAccessTokenCredentialHandler=rt.BearerCredentialHandler=rt.BasicCredentialHandler=void 0;var qo=class{constructor(t,r){this.username=t,this.password=r}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.BasicCredentialHandler=qo;var Co=class{constructor(t){this.token=t}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.BearerCredentialHandler=Co;var jo=class{constructor(t){this.token=t}prepareRequest(t){if(!t.headers)throw Error("The request has no headers");t.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Io(this,void 0,void 0,function*(){throw new Error("not implemented")})}};rt.PersonalAccessTokenCredentialHandler=jo});var Js=ce(Zt=>{"use strict";var Vs=Zt&&Zt.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(Zt,"__esModule",{value:!0});Zt.OidcClient=void 0;var pd=Fs(),md=Ws(),Gs=$o(),bt=class{static createHttpClient(t=!0,r=10){let n={allowRetries:t,maxRetries:r};return new pd.HttpClient("actions/oidc-client",[new md.BearerCredentialHandler(bt.getRequestToken())],n)}static getRequestToken(){let t=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!t)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return t}static getIDTokenUrl(){let t=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!t)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return t}static getCall(t){var r;return Vs(this,void 0,void 0,function*(){let i=(r=(yield bt.createHttpClient().getJson(t).catch(s=>{throw new Error(`Failed to get ID Token. +"use strict";var M1=Object.create;var Yi=Object.defineProperty;var B1=Object.getOwnPropertyDescriptor;var D1=Object.getOwnPropertyNames;var z1=Object.getPrototypeOf,F1=Object.prototype.hasOwnProperty;var ut=(e,r)=>()=>(e&&(r=e(e=0)),r);var Tt=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),U1=(e,r)=>{for(var n in r)Yi(e,n,{get:r[n],enumerable:!0})},Zf=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of D1(r))!F1.call(e,s)&&s!==n&&Yi(e,s,{get:()=>r[s],enumerable:!(i=B1(r,s))||i.enumerable});return e};var Po=(e,r,n)=>(n=e!=null?M1(z1(e)):{},Zf(r||!e||!e.__esModule?Yi(n,"default",{value:e,enumerable:!0}):n,e)),H1=e=>Zf(Yi({},"__esModule",{value:!0}),e);var ed=(e,r,n)=>new Promise((i,s)=>{var u=h=>{try{c(n.next(h))}catch(p){s(p)}},l=h=>{try{c(n.throw(h))}catch(p){s(p)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(u,l);c((n=n.apply(e,r)).next())});var Qi=Tt(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.toCommandProperties=Dn.toCommandValue=void 0;function W1(e){return e==null?"":typeof e=="string"||e instanceof String?e:JSON.stringify(e)}Dn.toCommandValue=W1;function V1(e){return Object.keys(e).length?{title:e.title,file:e.file,line:e.startLine,endLine:e.endLine,col:e.startColumn,endColumn:e.endColumn}:{}}Dn.toCommandProperties=V1});var od=Tt($t=>{"use strict";var G1=$t&&$t.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[n]}})}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),K1=$t&&$t.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),J1=$t&&$t.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&G1(r,e,n);return K1(r,e),r};Object.defineProperty($t,"__esModule",{value:!0});$t.issue=$t.issueCommand=void 0;var Y1=J1(require("os")),rd=Qi();function nd(e,r,n){let i=new Pu(e,r,n);process.stdout.write(i.toString()+Y1.EOL)}$t.issueCommand=nd;function Q1(e,r=""){nd(e,{},r)}$t.issue=Q1;var td="::",Pu=class{constructor(r,n,i){r||(r="missing.command"),this.command=r,this.properties=n,this.message=i}toString(){let r=td+this.command;if(this.properties&&Object.keys(this.properties).length>0){r+=" ";let n=!0;for(let i in this.properties)if(this.properties.hasOwnProperty(i)){let s=this.properties[i];s&&(n?n=!1:r+=",",r+=`${i}=${Z1(s)}`)}}return r+=`${td}${X1(this.message)}`,r}};function X1(e){return rd.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function Z1(e){return rd.toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}});function Co(){return Xi>Zi.length-16&&(id.default.randomFillSync(Zi),Xi=0),Zi.slice(Xi,Xi+=16)}var id,Zi,Xi,Cu=ut(()=>{id=Po(require("crypto")),Zi=new Uint8Array(256),Xi=Zi.length});var sd,ad=ut(()=>{sd=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i});function eS(e){return typeof e=="string"&&sd.test(e)}var Mr,Io=ut(()=>{ad();Mr=eS});function tS(e,r=0){let n=(Ze[e[r+0]]+Ze[e[r+1]]+Ze[e[r+2]]+Ze[e[r+3]]+"-"+Ze[e[r+4]]+Ze[e[r+5]]+"-"+Ze[e[r+6]]+Ze[e[r+7]]+"-"+Ze[e[r+8]]+Ze[e[r+9]]+"-"+Ze[e[r+10]]+Ze[e[r+11]]+Ze[e[r+12]]+Ze[e[r+13]]+Ze[e[r+14]]+Ze[e[r+15]]).toLowerCase();if(!Mr(n))throw TypeError("Stringified UUID is invalid");return n}var Ze,Br,jo=ut(()=>{Io();Ze=[];for(let e=0;e<256;++e)Ze.push((e+256).toString(16).substr(1));Br=tS});function rS(e,r,n){let i=r&&n||0,s=r||new Array(16);e=e||{};let u=e.node||ud,l=e.clockseq!==void 0?e.clockseq:Iu;if(u==null||l==null){let m=e.random||(e.rng||Co)();u==null&&(u=ud=[m[0]|1,m[1],m[2],m[3],m[4],m[5]]),l==null&&(l=Iu=(m[6]<<8|m[7])&16383)}let c=e.msecs!==void 0?e.msecs:Date.now(),h=e.nsecs!==void 0?e.nsecs:qu+1,p=c-ju+(h-qu)/1e4;if(p<0&&e.clockseq===void 0&&(l=l+1&16383),(p<0||c>ju)&&e.nsecs===void 0&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");ju=c,qu=h,Iu=l,c+=122192928e5;let y=((c&268435455)*1e4+h)%4294967296;s[i++]=y>>>24&255,s[i++]=y>>>16&255,s[i++]=y>>>8&255,s[i++]=y&255;let d=c/4294967296*1e4&268435455;s[i++]=d>>>8&255,s[i++]=d&255,s[i++]=d>>>24&15|16,s[i++]=d>>>16&255,s[i++]=l>>>8|128,s[i++]=l&255;for(let m=0;m<6;++m)s[i+m]=u[m];return r||Br(s)}var ud,Iu,ju,qu,ld,cd=ut(()=>{Cu();jo();ju=0,qu=0;ld=rS});function nS(e){if(!Mr(e))throw TypeError("Invalid UUID");let r,n=new Uint8Array(16);return n[0]=(r=parseInt(e.slice(0,8),16))>>>24,n[1]=r>>>16&255,n[2]=r>>>8&255,n[3]=r&255,n[4]=(r=parseInt(e.slice(9,13),16))>>>8,n[5]=r&255,n[6]=(r=parseInt(e.slice(14,18),16))>>>8,n[7]=r&255,n[8]=(r=parseInt(e.slice(19,23),16))>>>8,n[9]=r&255,n[10]=(r=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=r/4294967296&255,n[12]=r>>>24&255,n[13]=r>>>16&255,n[14]=r>>>8&255,n[15]=r&255,n}var es,$u=ut(()=>{Io();es=nS});function oS(e){e=unescape(encodeURIComponent(e));let r=[];for(let n=0;n{jo();$u();iS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",sS="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});function aS(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),hd.default.createHash("md5").update(e).digest()}var hd,fd,dd=ut(()=>{hd=Po(require("crypto"));fd=aS});var uS,pd,md=ut(()=>{Lu();dd();uS=ts("v3",48,fd),pd=uS});function lS(e,r,n){e=e||{};let i=e.random||(e.rng||Co)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,r){n=n||0;for(let s=0;s<16;++s)r[n+s]=i[s];return r}return Br(i)}var yd,gd=ut(()=>{Cu();jo();yd=lS});function cS(e){return Array.isArray(e)?e=Buffer.from(e):typeof e=="string"&&(e=Buffer.from(e,"utf8")),vd.default.createHash("sha1").update(e).digest()}var vd,bd,_d=ut(()=>{vd=Po(require("crypto"));bd=cS});var hS,wd,Ed=ut(()=>{Lu();_d();hS=ts("v5",80,bd),wd=hS});var Sd,Td=ut(()=>{Sd="00000000-0000-0000-0000-000000000000"});function fS(e){if(!Mr(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}var Rd,Od=ut(()=>{Io();Rd=fS});var xd={};U1(xd,{NIL:()=>Sd,parse:()=>es,stringify:()=>Br,v1:()=>ld,v3:()=>pd,v4:()=>yd,v5:()=>wd,validate:()=>Mr,version:()=>Rd});var Ad=ut(()=>{cd();md();gd();Ed();Td();Od();Io();jo();$u()});var Id=Tt(Lt=>{"use strict";var dS=Lt&&Lt.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[n]}})}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),pS=Lt&&Lt.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Pd=Lt&&Lt.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&dS(r,e,n);return pS(r,e),r};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.prepareKeyValueMessage=Lt.issueFileCommand=void 0;var kd=Pd(require("fs")),Nu=Pd(require("os")),mS=(Ad(),H1(xd)),Cd=Qi();function yS(e,r){let n=process.env[`GITHUB_${e}`];if(!n)throw new Error(`Unable to find environment variable for file command ${e}`);if(!kd.existsSync(n))throw new Error(`Missing file at path: ${n}`);kd.appendFileSync(n,`${Cd.toCommandValue(r)}${Nu.EOL}`,{encoding:"utf8"})}Lt.issueFileCommand=yS;function gS(e,r){let n=`ghadelimiter_${mS.v4()}`,i=Cd.toCommandValue(r);if(e.includes(n))throw new Error(`Unexpected input: name should not contain the delimiter "${n}"`);if(i.includes(n))throw new Error(`Unexpected input: value should not contain the delimiter "${n}"`);return`${e}<<${n}${Nu.EOL}${i}${Nu.EOL}${n}`}Lt.prepareKeyValueMessage=gS});var qd=Tt(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.checkBypass=zn.getProxyUrl=void 0;function vS(e){let r=e.protocol==="https:";if(jd(e))return;let n=(()=>r?process.env.https_proxy||process.env.HTTPS_PROXY:process.env.http_proxy||process.env.HTTP_PROXY)();if(n)return new URL(n)}zn.getProxyUrl=vS;function jd(e){if(!e.hostname)return!1;let r=process.env.no_proxy||process.env.NO_PROXY||"";if(!r)return!1;let n;e.port?n=Number(e.port):e.protocol==="http:"?n=80:e.protocol==="https:"&&(n=443);let i=[e.hostname.toUpperCase()];typeof n=="number"&&i.push(`${i[0]}:${n}`);for(let s of r.split(",").map(u=>u.trim().toUpperCase()).filter(u=>u))if(i.some(u=>u===s))return!0;return!1}zn.checkBypass=jd});var Md=Tt(Fn=>{"use strict";var Lk=require("net"),bS=require("tls"),Mu=require("http"),$d=require("https"),_S=require("events"),Nk=require("assert"),wS=require("util");Fn.httpOverHttp=ES;Fn.httpsOverHttp=SS;Fn.httpOverHttps=TS;Fn.httpsOverHttps=RS;function ES(e){var r=new _r(e);return r.request=Mu.request,r}function SS(e){var r=new _r(e);return r.request=Mu.request,r.createSocket=Ld,r.defaultPort=443,r}function TS(e){var r=new _r(e);return r.request=$d.request,r}function RS(e){var r=new _r(e);return r.request=$d.request,r.createSocket=Ld,r.defaultPort=443,r}function _r(e){var r=this;r.options=e||{},r.proxyOptions=r.options.proxy||{},r.maxSockets=r.options.maxSockets||Mu.Agent.defaultMaxSockets,r.requests=[],r.sockets=[],r.on("free",function(i,s,u,l){for(var c=Nd(s,u,l),h=0,p=r.requests.length;h=this.maxSockets){u.requests.push(l);return}u.createSocket(l,function(c){c.on("free",h),c.on("close",p),c.on("agentRemove",p),r.onSocket(c);function h(){u.emit("free",c,l)}function p(y){u.removeSocket(c),c.removeListener("free",h),c.removeListener("close",p),c.removeListener("agentRemove",p)}})};_r.prototype.createSocket=function(r,n){var i=this,s={};i.sockets.push(s);var u=Bu({},i.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:!1,headers:{host:r.host+":"+r.port}});r.localAddress&&(u.localAddress=r.localAddress),u.proxyAuth&&(u.headers=u.headers||{},u.headers["Proxy-Authorization"]="Basic "+new Buffer(u.proxyAuth).toString("base64")),Dr("making CONNECT request");var l=i.request(u);l.useChunkedEncodingByDefault=!1,l.once("response",c),l.once("upgrade",h),l.once("connect",p),l.once("error",y),l.end();function c(d){d.upgrade=!0}function h(d,m,_){process.nextTick(function(){p(d,m,_)})}function p(d,m,_){if(l.removeAllListeners(),m.removeAllListeners(),d.statusCode!==200){Dr("tunneling socket could not be established, statusCode=%d",d.statusCode),m.destroy();var A=new Error("tunneling socket could not be established, statusCode="+d.statusCode);A.code="ECONNRESET",r.request.emit("error",A),i.removeSocket(s);return}if(_.length>0){Dr("got illegal response body from proxy"),m.destroy();var A=new Error("got illegal response body from proxy");A.code="ECONNRESET",r.request.emit("error",A),i.removeSocket(s);return}return Dr("tunneling connection has established"),i.sockets[i.sockets.indexOf(s)]=m,n(m)}function y(d){l.removeAllListeners(),Dr(`tunneling socket could not be established, cause=%s +`,d.message,d.stack);var m=new Error("tunneling socket could not be established, cause="+d.message);m.code="ECONNRESET",r.request.emit("error",m),i.removeSocket(s)}};_r.prototype.removeSocket=function(r){var n=this.sockets.indexOf(r);if(n!==-1){this.sockets.splice(n,1);var i=this.requests.shift();i&&this.createSocket(i,function(s){i.request.onSocket(s)})}};function Ld(e,r){var n=this;_r.prototype.createSocket.call(n,e,function(i){var s=e.request.getHeader("host"),u=Bu({},n.options,{socket:i,servername:s?s.replace(/:.*$/,""):e.host}),l=bS.connect(0,u);n.sockets[n.sockets.indexOf(i)]=l,r(l)})}function Nd(e,r,n){return typeof e=="string"?{host:e,port:r,localAddress:n}:e}function Bu(e){for(var r=1,n=arguments.length;r{Bd.exports=Md()});var Fd=Tt(Pe=>{"use strict";var OS=Pe&&Pe.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[n]}})}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),xS=Pe&&Pe.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),ss=Pe&&Pe.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&OS(r,e,n);return xS(r,e),r},Ge=Pe&&Pe.__awaiter||function(e,r,n,i){function s(u){return u instanceof n?u:new n(function(l){l(u)})}return new(n||(n=Promise))(function(u,l){function c(y){try{p(i.next(y))}catch(d){l(d)}}function h(y){try{p(i.throw(y))}catch(d){l(d)}}function p(y){y.done?u(y.value):s(y.value).then(c,h)}p((i=i.apply(e,r||[])).next())})};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.HttpClient=Pe.isHttps=Pe.HttpClientResponse=Pe.HttpClientError=Pe.getProxyUrl=Pe.MediaTypes=Pe.Headers=Pe.HttpCodes=void 0;var rs=ss(require("http")),Du=ss(require("https")),zd=ss(qd()),ns=ss(Dd()),Gt;(function(e){e[e.OK=200]="OK",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.ResourceMoved=302]="ResourceMoved",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.TooManyRequests=429]="TooManyRequests",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout"})(Gt=Pe.HttpCodes||(Pe.HttpCodes={}));var lt;(function(e){e.Accept="accept",e.ContentType="content-type"})(lt=Pe.Headers||(Pe.Headers={}));var zr;(function(e){e.ApplicationJson="application/json"})(zr=Pe.MediaTypes||(Pe.MediaTypes={}));function AS(e){let r=zd.getProxyUrl(new URL(e));return r?r.href:""}Pe.getProxyUrl=AS;var kS=[Gt.MovedPermanently,Gt.ResourceMoved,Gt.SeeOther,Gt.TemporaryRedirect,Gt.PermanentRedirect],PS=[Gt.BadGateway,Gt.ServiceUnavailable,Gt.GatewayTimeout],CS=["OPTIONS","GET","DELETE","HEAD"],IS=10,jS=5,Un=class extends Error{constructor(r,n){super(r),this.name="HttpClientError",this.statusCode=n,Object.setPrototypeOf(this,Un.prototype)}};Pe.HttpClientError=Un;var is=class{constructor(r){this.message=r}readBody(){return Ge(this,void 0,void 0,function*(){return new Promise(r=>Ge(this,void 0,void 0,function*(){let n=Buffer.alloc(0);this.message.on("data",i=>{n=Buffer.concat([n,i])}),this.message.on("end",()=>{r(n.toString())})}))})}};Pe.HttpClientResponse=is;function qS(e){return new URL(e).protocol==="https:"}Pe.isHttps=qS;var zu=class{constructor(r,n,i){this._ignoreSslError=!1,this._allowRedirects=!0,this._allowRedirectDowngrade=!1,this._maxRedirects=50,this._allowRetries=!1,this._maxRetries=1,this._keepAlive=!1,this._disposed=!1,this.userAgent=r,this.handlers=n||[],this.requestOptions=i,i&&(i.ignoreSslError!=null&&(this._ignoreSslError=i.ignoreSslError),this._socketTimeout=i.socketTimeout,i.allowRedirects!=null&&(this._allowRedirects=i.allowRedirects),i.allowRedirectDowngrade!=null&&(this._allowRedirectDowngrade=i.allowRedirectDowngrade),i.maxRedirects!=null&&(this._maxRedirects=Math.max(i.maxRedirects,0)),i.keepAlive!=null&&(this._keepAlive=i.keepAlive),i.allowRetries!=null&&(this._allowRetries=i.allowRetries),i.maxRetries!=null&&(this._maxRetries=i.maxRetries))}options(r,n){return Ge(this,void 0,void 0,function*(){return this.request("OPTIONS",r,null,n||{})})}get(r,n){return Ge(this,void 0,void 0,function*(){return this.request("GET",r,null,n||{})})}del(r,n){return Ge(this,void 0,void 0,function*(){return this.request("DELETE",r,null,n||{})})}post(r,n,i){return Ge(this,void 0,void 0,function*(){return this.request("POST",r,n,i||{})})}patch(r,n,i){return Ge(this,void 0,void 0,function*(){return this.request("PATCH",r,n,i||{})})}put(r,n,i){return Ge(this,void 0,void 0,function*(){return this.request("PUT",r,n,i||{})})}head(r,n){return Ge(this,void 0,void 0,function*(){return this.request("HEAD",r,null,n||{})})}sendStream(r,n,i,s){return Ge(this,void 0,void 0,function*(){return this.request(r,n,i,s)})}getJson(r,n={}){return Ge(this,void 0,void 0,function*(){n[lt.Accept]=this._getExistingOrDefaultHeader(n,lt.Accept,zr.ApplicationJson);let i=yield this.get(r,n);return this._processResponse(i,this.requestOptions)})}postJson(r,n,i={}){return Ge(this,void 0,void 0,function*(){let s=JSON.stringify(n,null,2);i[lt.Accept]=this._getExistingOrDefaultHeader(i,lt.Accept,zr.ApplicationJson),i[lt.ContentType]=this._getExistingOrDefaultHeader(i,lt.ContentType,zr.ApplicationJson);let u=yield this.post(r,s,i);return this._processResponse(u,this.requestOptions)})}putJson(r,n,i={}){return Ge(this,void 0,void 0,function*(){let s=JSON.stringify(n,null,2);i[lt.Accept]=this._getExistingOrDefaultHeader(i,lt.Accept,zr.ApplicationJson),i[lt.ContentType]=this._getExistingOrDefaultHeader(i,lt.ContentType,zr.ApplicationJson);let u=yield this.put(r,s,i);return this._processResponse(u,this.requestOptions)})}patchJson(r,n,i={}){return Ge(this,void 0,void 0,function*(){let s=JSON.stringify(n,null,2);i[lt.Accept]=this._getExistingOrDefaultHeader(i,lt.Accept,zr.ApplicationJson),i[lt.ContentType]=this._getExistingOrDefaultHeader(i,lt.ContentType,zr.ApplicationJson);let u=yield this.patch(r,s,i);return this._processResponse(u,this.requestOptions)})}request(r,n,i,s){return Ge(this,void 0,void 0,function*(){if(this._disposed)throw new Error("Client has already been disposed.");let u=new URL(n),l=this._prepareRequest(r,u,s),c=this._allowRetries&&CS.includes(r)?this._maxRetries+1:1,h=0,p;do{if(p=yield this.requestRaw(l,i),p&&p.message&&p.message.statusCode===Gt.Unauthorized){let d;for(let m of this.handlers)if(m.canHandleAuthentication(p)){d=m;break}return d?d.handleAuthentication(this,l,i):p}let y=this._maxRedirects;for(;p.message.statusCode&&kS.includes(p.message.statusCode)&&this._allowRedirects&&y>0;){let d=p.message.headers.location;if(!d)break;let m=new URL(d);if(u.protocol==="https:"&&u.protocol!==m.protocol&&!this._allowRedirectDowngrade)throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");if(yield p.readBody(),m.hostname!==u.hostname)for(let _ in s)_.toLowerCase()==="authorization"&&delete s[_];l=this._prepareRequest(r,m,s),p=yield this.requestRaw(l,i),y--}if(!p.message.statusCode||!PS.includes(p.message.statusCode))return p;h+=1,h{function u(l,c){l?s(l):c?i(c):s(new Error("Unknown error"))}this.requestRawWithCallback(r,n,u)})})}requestRawWithCallback(r,n,i){typeof n=="string"&&(r.options.headers||(r.options.headers={}),r.options.headers["Content-Length"]=Buffer.byteLength(n,"utf8"));let s=!1;function u(h,p){s||(s=!0,i(h,p))}let l=r.httpModule.request(r.options,h=>{let p=new is(h);u(void 0,p)}),c;l.on("socket",h=>{c=h}),l.setTimeout(this._socketTimeout||3*6e4,()=>{c&&c.end(),u(new Error(`Request timeout: ${r.options.path}`))}),l.on("error",function(h){u(h)}),n&&typeof n=="string"&&l.write(n,"utf8"),n&&typeof n!="string"?(n.on("close",function(){l.end()}),n.pipe(l)):l.end()}getAgent(r){let n=new URL(r);return this._getAgent(n)}_prepareRequest(r,n,i){let s={};s.parsedUrl=n;let u=s.parsedUrl.protocol==="https:";s.httpModule=u?Du:rs;let l=u?443:80;if(s.options={},s.options.host=s.parsedUrl.hostname,s.options.port=s.parsedUrl.port?parseInt(s.parsedUrl.port):l,s.options.path=(s.parsedUrl.pathname||"")+(s.parsedUrl.search||""),s.options.method=r,s.options.headers=this._mergeHeaders(i),this.userAgent!=null&&(s.options.headers["user-agent"]=this.userAgent),s.options.agent=this._getAgent(s.parsedUrl),this.handlers)for(let c of this.handlers)c.prepareRequest(s.options);return s}_mergeHeaders(r){return this.requestOptions&&this.requestOptions.headers?Object.assign({},os(this.requestOptions.headers),os(r||{})):os(r||{})}_getExistingOrDefaultHeader(r,n,i){let s;return this.requestOptions&&this.requestOptions.headers&&(s=os(this.requestOptions.headers)[n]),r[n]||s||i}_getAgent(r){let n,i=zd.getProxyUrl(r),s=i&&i.hostname;if(this._keepAlive&&s&&(n=this._proxyAgent),this._keepAlive&&!s&&(n=this._agent),n)return n;let u=r.protocol==="https:",l=100;if(this.requestOptions&&(l=this.requestOptions.maxSockets||rs.globalAgent.maxSockets),i&&i.hostname){let c={maxSockets:l,keepAlive:this._keepAlive,proxy:Object.assign(Object.assign({},(i.username||i.password)&&{proxyAuth:`${i.username}:${i.password}`}),{host:i.hostname,port:i.port})},h,p=i.protocol==="https:";u?h=p?ns.httpsOverHttps:ns.httpsOverHttp:h=p?ns.httpOverHttps:ns.httpOverHttp,n=h(c),this._proxyAgent=n}if(this._keepAlive&&!n){let c={keepAlive:this._keepAlive,maxSockets:l};n=u?new Du.Agent(c):new rs.Agent(c),this._agent=n}return n||(n=u?Du.globalAgent:rs.globalAgent),u&&this._ignoreSslError&&(n.options=Object.assign(n.options||{},{rejectUnauthorized:!1})),n}_performExponentialBackoff(r){return Ge(this,void 0,void 0,function*(){r=Math.min(IS,r);let n=jS*Math.pow(2,r);return new Promise(i=>setTimeout(()=>i(),n))})}_processResponse(r,n){return Ge(this,void 0,void 0,function*(){return new Promise((i,s)=>Ge(this,void 0,void 0,function*(){let u=r.message.statusCode||0,l={statusCode:u,result:null,headers:{}};u===Gt.NotFound&&i(l);function c(y,d){if(typeof d=="string"){let m=new Date(d);if(!isNaN(m.valueOf()))return m}return d}let h,p;try{p=yield r.readBody(),p&&p.length>0&&(n&&n.deserializeDates?h=JSON.parse(p,c):h=JSON.parse(p),l.result=h),l.headers=r.message.headers}catch{}if(u>299){let y;h&&h.message?y=h.message:p&&p.length>0?y=p:y=`Failed request: (${u})`;let d=new Un(y,u);d.result=l.result,s(d)}else i(l)}))})}};Pe.HttpClient=zu;var os=e=>Object.keys(e).reduce((r,n)=>(r[n.toLowerCase()]=e[n],r),{})});var Ud=Tt(or=>{"use strict";var Wu=or&&or.__awaiter||function(e,r,n,i){function s(u){return u instanceof n?u:new n(function(l){l(u)})}return new(n||(n=Promise))(function(u,l){function c(y){try{p(i.next(y))}catch(d){l(d)}}function h(y){try{p(i.throw(y))}catch(d){l(d)}}function p(y){y.done?u(y.value):s(y.value).then(c,h)}p((i=i.apply(e,r||[])).next())})};Object.defineProperty(or,"__esModule",{value:!0});or.PersonalAccessTokenCredentialHandler=or.BearerCredentialHandler=or.BasicCredentialHandler=void 0;var Fu=class{constructor(r,n){this.username=r,this.password=n}prepareRequest(r){if(!r.headers)throw Error("The request has no headers");r.headers.Authorization=`Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Wu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};or.BasicCredentialHandler=Fu;var Uu=class{constructor(r){this.token=r}prepareRequest(r){if(!r.headers)throw Error("The request has no headers");r.headers.Authorization=`Bearer ${this.token}`}canHandleAuthentication(){return!1}handleAuthentication(){return Wu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};or.BearerCredentialHandler=Uu;var Hu=class{constructor(r){this.token=r}prepareRequest(r){if(!r.headers)throw Error("The request has no headers");r.headers.Authorization=`Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`}canHandleAuthentication(){return!1}handleAuthentication(){return Wu(this,void 0,void 0,function*(){throw new Error("not implemented")})}};or.PersonalAccessTokenCredentialHandler=Hu});var Vd=Tt(Hn=>{"use strict";var Hd=Hn&&Hn.__awaiter||function(e,r,n,i){function s(u){return u instanceof n?u:new n(function(l){l(u)})}return new(n||(n=Promise))(function(u,l){function c(y){try{p(i.next(y))}catch(d){l(d)}}function h(y){try{p(i.throw(y))}catch(d){l(d)}}function p(y){y.done?u(y.value):s(y.value).then(c,h)}p((i=i.apply(e,r||[])).next())})};Object.defineProperty(Hn,"__esModule",{value:!0});Hn.OidcClient=void 0;var $S=Fd(),LS=Ud(),Wd=Vu(),Fr=class{static createHttpClient(r=!0,n=10){let i={allowRetries:r,maxRetries:n};return new $S.HttpClient("actions/oidc-client",[new LS.BearerCredentialHandler(Fr.getRequestToken())],i)}static getRequestToken(){let r=process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!r)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable");return r}static getIDTokenUrl(){let r=process.env.ACTIONS_ID_TOKEN_REQUEST_URL;if(!r)throw new Error("Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable");return r}static getCall(r){var n;return Hd(this,void 0,void 0,function*(){let u=(n=(yield Fr.createHttpClient().getJson(r).catch(l=>{throw new Error(`Failed to get ID Token. - Error Code : ${s.statusCode} + Error Code : ${l.statusCode} - Error Message: ${s.result.message}`)})).result)===null||r===void 0?void 0:r.value;if(!i)throw new Error("Response json body do not have ID Token field");return i})}static getIDToken(t){return Vs(this,void 0,void 0,function*(){try{let r=bt.getIDTokenUrl();if(t){let o=encodeURIComponent(t);r=`${r}&audience=${o}`}Gs.debug(`ID token url is ${r}`);let n=yield bt.getCall(r);return Gs.setSecret(n),n}catch(r){throw new Error(`Error message: ${r.message}`)}})}};Zt.OidcClient=bt});var Bo=ce(ke=>{"use strict";var Mo=ke&&ke.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(ke,"__esModule",{value:!0});ke.summary=ke.markdownSummary=ke.SUMMARY_DOCS_URL=ke.SUMMARY_ENV_VAR=void 0;var yd=require("os"),Lo=require("fs"),{access:gd,appendFile:bd,writeFile:vd}=Lo.promises;ke.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";ke.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var No=class{constructor(){this._buffer=""}filePath(){return Mo(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let t=process.env[ke.SUMMARY_ENV_VAR];if(!t)throw new Error(`Unable to find environment variable for $${ke.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield gd(t,Lo.constants.R_OK|Lo.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${t}'. Check if the file has correct read/write permissions.`)}return this._filePath=t,this._filePath})}wrap(t,r,n={}){let o=Object.entries(n).map(([i,s])=>` ${i}="${s}"`).join("");return r?`<${t}${o}>${r}`:`<${t}${o}>`}write(t){return Mo(this,void 0,void 0,function*(){let r=!!t?.overwrite,n=yield this.filePath();return yield(r?vd:bd)(n,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Mo(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(t,r=!1){return this._buffer+=t,r?this.addEOL():this}addEOL(){return this.addRaw(yd.EOL)}addCodeBlock(t,r){let n=Object.assign({},r&&{lang:r}),o=this.wrap("pre",this.wrap("code",t),n);return this.addRaw(o).addEOL()}addList(t,r=!1){let n=r?"ol":"ul",o=t.map(s=>this.wrap("li",s)).join(""),i=this.wrap(n,o);return this.addRaw(i).addEOL()}addTable(t){let r=t.map(o=>{let i=o.map(s=>{if(typeof s=="string")return this.wrap("td",s);let{header:a,data:l,colspan:u,rowspan:d}=s,h=a?"th":"td",c=Object.assign(Object.assign({},u&&{colspan:u}),d&&{rowspan:d});return this.wrap(h,l,c)}).join("");return this.wrap("tr",i)}).join(""),n=this.wrap("table",r);return this.addRaw(n).addEOL()}addDetails(t,r){let n=this.wrap("details",this.wrap("summary",t)+r);return this.addRaw(n).addEOL()}addImage(t,r,n){let{width:o,height:i}=n||{},s=Object.assign(Object.assign({},o&&{width:o}),i&&{height:i}),a=this.wrap("img",null,Object.assign({src:t,alt:r},s));return this.addRaw(a).addEOL()}addHeading(t,r){let n=`h${r}`,o=["h1","h2","h3","h4","h5","h6"].includes(n)?n:"h1",i=this.wrap(o,t);return this.addRaw(i).addEOL()}addSeparator(){let t=this.wrap("hr",null);return this.addRaw(t).addEOL()}addBreak(){let t=this.wrap("br",null);return this.addRaw(t).addEOL()}addQuote(t,r){let n=Object.assign({},r&&{cite:r}),o=this.wrap("blockquote",t,n);return this.addRaw(o).addEOL()}addLink(t,r){let n=this.wrap("a",t,{href:r});return this.addRaw(n).addEOL()}},Ks=new No;ke.markdownSummary=Ks;ke.summary=Ks});var Qs=ce(Ae=>{"use strict";var _d=Ae&&Ae.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),wd=Ae&&Ae.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Sd=Ae&&Ae.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&_d(t,e,r);return wd(t,e),t};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.toPlatformPath=Ae.toWin32Path=Ae.toPosixPath=void 0;var Ed=Sd(require("path"));function Td(e){return e.replace(/[\\]/g,"/")}Ae.toPosixPath=Td;function Od(e){return e.replace(/[/]/g,"\\")}Ae.toWin32Path=Od;function Rd(e){return e.replace(/[/\\]/g,Ed.sep)}Ae.toPlatformPath=Rd});var $o=ce(V=>{"use strict";var Pd=V&&V.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),xd=V&&V.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Ys=V&&V.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.hasOwnProperty.call(e,r)&&Pd(t,e,r);return xd(t,e),t},Xs=V&&V.__awaiter||function(e,t,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(d){try{u(n.next(d))}catch(h){s(h)}}function l(d){try{u(n.throw(d))}catch(h){s(h)}}function u(d){d.done?i(d.value):o(d.value).then(a,l)}u((n=n.apply(e,t||[])).next())})};Object.defineProperty(V,"__esModule",{value:!0});V.getIDToken=V.getState=V.saveState=V.group=V.endGroup=V.startGroup=V.info=V.notice=V.warning=V.error=V.debug=V.isDebug=V.setFailed=V.setCommandEcho=V.setOutput=V.getBooleanInput=V.getMultilineInput=V.getInput=V.addPath=V.setSecret=V.exportVariable=V.ExitCode=void 0;var ze=ds(),Ot=Is(),er=Qr(),Zs=Ys(require("os")),kd=Ys(require("path")),Ad=Js(),ea;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(ea=V.ExitCode||(V.ExitCode={}));function qd(e,t){let r=er.toCommandValue(t);if(process.env[e]=r,process.env.GITHUB_ENV||"")return Ot.issueFileCommand("ENV",Ot.prepareKeyValueMessage(e,t));ze.issueCommand("set-env",{name:e},r)}V.exportVariable=qd;function Cd(e){ze.issueCommand("add-mask",{},e)}V.setSecret=Cd;function jd(e){process.env.GITHUB_PATH||""?Ot.issueFileCommand("PATH",e):ze.issueCommand("add-path",{},e),process.env.PATH=`${e}${kd.delimiter}${process.env.PATH}`}V.addPath=jd;function Uo(e,t){let r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r)throw new Error(`Input required and not supplied: ${e}`);return t&&t.trimWhitespace===!1?r:r.trim()}V.getInput=Uo;function Id(e,t){let r=Uo(e,t).split(` -`).filter(n=>n!=="");return t&&t.trimWhitespace===!1?r:r.map(n=>n.trim())}V.getMultilineInput=Id;function $d(e,t){let r=["true","True","TRUE"],n=["false","False","FALSE"],o=Uo(e,t);if(r.includes(o))return!0;if(n.includes(o))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e} -Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}V.getBooleanInput=$d;function Md(e,t){if(process.env.GITHUB_OUTPUT||"")return Ot.issueFileCommand("OUTPUT",Ot.prepareKeyValueMessage(e,t));process.stdout.write(Zs.EOL),ze.issueCommand("set-output",{name:e},er.toCommandValue(t))}V.setOutput=Md;function Ld(e){ze.issue("echo",e?"on":"off")}V.setCommandEcho=Ld;function Nd(e){process.exitCode=ea.Failure,ta(e)}V.setFailed=Nd;function Bd(){return process.env.RUNNER_DEBUG==="1"}V.isDebug=Bd;function Ud(e){ze.issueCommand("debug",{},e)}V.debug=Ud;function ta(e,t={}){ze.issueCommand("error",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.error=ta;function zd(e,t={}){ze.issueCommand("warning",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.warning=zd;function Dd(e,t={}){ze.issueCommand("notice",er.toCommandProperties(t),e instanceof Error?e.toString():e)}V.notice=Dd;function Hd(e){process.stdout.write(e+Zs.EOL)}V.info=Hd;function ra(e){ze.issue("group",e)}V.startGroup=ra;function na(){ze.issue("endgroup")}V.endGroup=na;function Fd(e,t){return Xs(this,void 0,void 0,function*(){ra(e);let r;try{r=yield t()}finally{na()}return r})}V.group=Fd;function Wd(e,t){if(process.env.GITHUB_STATE||"")return Ot.issueFileCommand("STATE",Ot.prepareKeyValueMessage(e,t));ze.issueCommand("save-state",{name:e},er.toCommandValue(t))}V.saveState=Wd;function Vd(e){return process.env[`STATE_${e}`]||""}V.getState=Vd;function Gd(e){return Xs(this,void 0,void 0,function*(){return yield Ad.OidcClient.getIDToken(e)})}V.getIDToken=Gd;var Jd=Bo();Object.defineProperty(V,"summary",{enumerable:!0,get:function(){return Jd.summary}});var Kd=Bo();Object.defineProperty(V,"markdownSummary",{enumerable:!0,get:function(){return Kd.markdownSummary}});var zo=Qs();Object.defineProperty(V,"toPosixPath",{enumerable:!0,get:function(){return zo.toPosixPath}});Object.defineProperty(V,"toWin32Path",{enumerable:!0,get:function(){return zo.toWin32Path}});Object.defineProperty(V,"toPlatformPath",{enumerable:!0,get:function(){return zo.toPlatformPath}})});var Qu=ce((Cg,Ku)=>{var Qd=Object.create,Br=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,Xd=Object.getOwnPropertyNames,Dn=Object.getOwnPropertySymbols,Zd=Object.getPrototypeOf,Ti=Object.prototype.hasOwnProperty,sl=Object.prototype.propertyIsEnumerable,oa=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oi=(e,t)=>{for(var r in t||={})Ti.call(t,r)&&oa(e,r,t[r]);if(Dn)for(var r of Dn(t))sl.call(t,r)&&oa(e,r,t[r]);return e},Ri=(e,t)=>{var r={};for(var n in e)Ti.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dn)for(var n of Dn(e))t.indexOf(n)<0&&sl.call(e,n)&&(r[n]=e[n]);return r},W=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ef=(e,t)=>{for(var r in t)Br(e,r,{get:t[r],enumerable:!0})},al=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xd(t))!Ti.call(e,o)&&o!==r&&Br(e,o,{get:()=>t[o],enumerable:!(n=Yd(t,o))||n.enumerable});return e},me=(e,t,r)=>(r=e!=null?Qd(Zd(e)):{},al(t||!e||!e.__esModule?Br(r,"default",{value:e,enumerable:!0}):r,e)),tf=e=>al(Br({},"__esModule",{value:!0}),e),Vt=(e,t,r)=>new Promise((n,o)=>{var i=l=>{try{a(r.next(l))}catch(u){o(u)}},s=l=>{try{a(r.throw(l))}catch(u){o(u)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(i,s);a((r=r.apply(e,t)).next())}),rf=W((e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function r(o){return o.encrypted}var n=(o,i)=>{let s;typeof i=="function"?s={connect:i}:s=i;let a=typeof s.connect=="function",l=typeof s.secureConnect=="function",u=typeof s.close=="function",d=()=>{a&&s.connect(),r(o)&&l&&(o.authorized?s.secureConnect():o.authorizationError||o.once("secureConnect",s.secureConnect)),u&&o.once("close",s.close)};o.writable&&!o.connecting?d():o.connecting?o.once("connect",d):o.destroyed&&u&&s.close(o._hadError)};e.default=n,t.exports=n,t.exports.default=n}),nf=W((e,t)=>{"use strict";var{PassThrough:r}=require("stream");t.exports=n=>{n={...n};let{array:o}=n,{encoding:i}=n,s=i==="buffer",a=!1;o?a=!(i||s):i=i||"utf8",s&&(i=null);let l=new r({objectMode:a});i&&l.setEncoding(i);let u=0,d=[];return l.on("data",h=>{d.push(h),a?u=d.length:u+=h.length}),l.getBufferedValue=()=>o?d:s?Buffer.concat(d,u):d.join(""),l.getBufferedLength=()=>u,l}}),ll=W((e,t)=>{"use strict";var{constants:r}=require("buffer"),n=require("stream"),{promisify:o}=require("util"),i=nf(),s=o(n.pipeline),a=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function l(u,d){if(!u)throw new Error("Expected a stream");d={maxBuffer:1/0,...d};let{maxBuffer:h}=d,c=i(d);return await new Promise((p,m)=>{let O=g=>{g&&c.getBufferedLength()<=r.MAX_LENGTH&&(g.bufferedData=c.getBufferedValue()),m(g)};(async()=>{try{await s(u,c),p()}catch(g){O(g)}})(),c.on("data",()=>{c.getBufferedLength()>h&&O(new a)})}),c.getBufferedValue()}t.exports=l,t.exports.buffer=(u,d)=>l(u,{...d,encoding:"buffer"}),t.exports.array=(u,d)=>l(u,{...d,array:!0}),t.exports.MaxBufferError=a}),of=W((e,t)=>{"use strict";var r=new Set([200,203,204,206,300,301,404,405,410,414,501]),n=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),o=new Set([500,502,503,504]),i={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},s={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function a(h){let c=parseInt(h,10);return isFinite(c)?c:0}function l(h){return h?o.has(h.status):!0}function u(h){let c={};if(!h)return c;let p=h.trim().split(/\s*,\s*/);for(let m of p){let[O,g]=m.split(/\s*=\s*/,2);c[O]=g===void 0?!0:g.replace(/^"|"$/g,"")}return c}function d(h){let c=[];for(let p in h){let m=h[p];c.push(m===!0?p:p+"="+m)}if(c.length)return c.join(", ")}t.exports=class{constructor(h,c,{shared:p,cacheHeuristic:m,immutableMinTimeToLive:O,ignoreCargoCult:g,_fromObject:M}={}){if(M){this._fromObject(M);return}if(!c||!c.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(h),this._responseTime=this.now(),this._isShared=p!==!1,this._cacheHeuristic=m!==void 0?m:.1,this._immutableMinTtl=O!==void 0?O:24*3600*1e3,this._status="status"in c?c.status:200,this._resHeaders=c.headers,this._rescc=u(c.headers["cache-control"]),this._method="method"in h?h.method:"GET",this._url=h.url,this._host=h.headers.host,this._noAuthorization=!h.headers.authorization,this._reqHeaders=c.headers.vary?h.headers:null,this._reqcc=u(h.headers["cache-control"]),g&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":d(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),c.headers["cache-control"]==null&&/no-cache/.test(c.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&n.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||r.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(h){if(!h||!h.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(h){this._assertRequestHasHeaders(h);let c=u(h.headers["cache-control"]);return c["no-cache"]||/no-cache/.test(h.headers.pragma)||c["max-age"]&&this.age()>c["max-age"]||c["min-fresh"]&&this.timeToLive()<1e3*c["min-fresh"]||this.stale()&&!(c["max-stale"]&&!this._rescc["must-revalidate"]&&(c["max-stale"]===!0||c["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(h,!1)}_requestMatches(h,c){return(!this._url||this._url===h.url)&&this._host===h.headers.host&&(!h.method||this._method===h.method||c&&h.method==="HEAD")&&this._varyMatches(h)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(h){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let c=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let p of c)if(h.headers[p]!==this._reqHeaders[p])return!1;return!0}_copyWithoutHopByHopHeaders(h){let c={};for(let p in h)i[p]||(c[p]=h[p]);if(h.connection){let p=h.connection.trim().split(/\s*,\s*/);for(let m of p)delete c[m]}if(c.warning){let p=c.warning.split(/,/).filter(m=>!/^\s*1[0-9][0-9]/.test(m));p.length?c.warning=p.join(",").trim():delete c.warning}return c}responseHeaders(){let h=this._copyWithoutHopByHopHeaders(this._resHeaders),c=this.age();return c>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(h.warning=(h.warning?`${h.warning}, `:"")+'113 - "rfc7234 5.5.4"'),h.age=`${Math.round(c)}`,h.date=new Date(this.now()).toUTCString(),h}date(){let h=Date.parse(this._resHeaders.date);return isFinite(h)?h:this._responseTime}age(){let h=this._ageValue(),c=(this.now()-this._responseTime)/1e3;return h+c}_ageValue(){return a(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return a(this._rescc["s-maxage"])}if(this._rescc["max-age"])return a(this._rescc["max-age"]);let h=this._rescc.immutable?this._immutableMinTtl:0,c=this.date();if(this._resHeaders.expires){let p=Date.parse(this._resHeaders.expires);return Number.isNaN(p)||pp)return Math.max(h,(c-p)/1e3*this._cacheHeuristic)}return h}timeToLive(){let h=this.maxAge()-this.age(),c=h+a(this._rescc["stale-if-error"]),p=h+a(this._rescc["stale-while-revalidate"]);return Math.max(0,h,c,p)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+a(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+a(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(h){return new this(void 0,void 0,{_fromObject:h})}_fromObject(h){if(this._responseTime)throw Error("Reinitialized");if(!h||h.v!==1)throw Error("Invalid serialization");this._responseTime=h.t,this._isShared=h.sh,this._cacheHeuristic=h.ch,this._immutableMinTtl=h.imm!==void 0?h.imm:24*3600*1e3,this._status=h.st,this._resHeaders=h.resh,this._rescc=h.rescc,this._method=h.m,this._url=h.u,this._host=h.h,this._noAuthorization=h.a,this._reqHeaders=h.reqh,this._reqcc=h.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(h){this._assertRequestHasHeaders(h);let c=this._copyWithoutHopByHopHeaders(h.headers);if(delete c["if-range"],!this._requestMatches(h,!0)||!this.storable())return delete c["if-none-match"],delete c["if-modified-since"],c;if(this._resHeaders.etag&&(c["if-none-match"]=c["if-none-match"]?`${c["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),c["accept-ranges"]||c["if-match"]||c["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete c["if-modified-since"],c["if-none-match"]){let p=c["if-none-match"].split(/,/).filter(m=>!/^\s*W\//.test(m));p.length?c["if-none-match"]=p.join(",").trim():delete c["if-none-match"]}}else this._resHeaders["last-modified"]&&!c["if-modified-since"]&&(c["if-modified-since"]=this._resHeaders["last-modified"]);return c}revalidatedPolicy(h,c){if(this._assertRequestHasHeaders(h),this._useStaleIfError()&&l(c))return{modified:!1,matches:!1,policy:this};if(!c||!c.headers)throw Error("Response headers missing");let p=!1;if(c.status!==void 0&&c.status!=304?p=!1:c.headers.etag&&!/^\s*W\//.test(c.headers.etag)?p=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===c.headers.etag:this._resHeaders.etag&&c.headers.etag?p=this._resHeaders.etag.replace(/^\s*W\//,"")===c.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?p=this._resHeaders["last-modified"]===c.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!c.headers.etag&&!c.headers["last-modified"]&&(p=!0),!p)return{policy:new this.constructor(h,c),modified:c.status!=304,matches:!1};let m={};for(let g in this._resHeaders)m[g]=g in c.headers&&!s[g]?c.headers[g]:this._resHeaders[g];let O=Object.assign({},c,{status:this._status,method:this._method,headers:m});return{policy:new this.constructor(h,O,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),sf=W(e=>{e.stringify=function t(r){if(typeof r>"u")return r;if(r&&Buffer.isBuffer(r))return JSON.stringify(":base64:"+r.toString("base64"));if(r&&r.toJSON&&(r=r.toJSON()),r&&typeof r=="object"){var n="",o=Array.isArray(r);n=o?"[":"{";var i=!0;for(var s in r){var a=typeof r[s]=="function"||!o&&typeof r[s]>"u";Object.hasOwnProperty.call(r,s)&&!a&&(i||(n+=","),i=!1,o?r[s]==null?n+="null":n+=t(r[s]):r[s]!==void 0&&(n+=t(s)+":"+t(r[s])))}return n+=o?"]":"}",n}else return typeof r=="string"?JSON.stringify(/^:/.test(r)?":"+r:r):typeof r>"u"?"null":JSON.stringify(r)},e.parse=function(t){return JSON.parse(t,function(r,n){return typeof n=="string"?/^:base64:/.test(n)?Buffer.from(n.substring(8),"base64"):/^:/.test(n)?n.substring(1):n:n})}}),af=W((e,t)=>{"use strict";var r=require("events"),n=sf(),o=a=>{let l={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(a.adapter||a.uri){let u=a.adapter||/^[^:+]*/.exec(a.uri)[0];return new(require(l[u]))(a)}return new Map},i=["sqlite","postgres","mysql","mongo","redis","tiered"],s=class extends r{constructor(a,{emitErrors:l=!0,...u}={}){if(super(),this.opts={namespace:"keyv",serialize:n.stringify,deserialize:n.parse,...typeof a=="string"?{uri:a}:a,...u},!this.opts.store){let h={...this.opts};this.opts.store=o(h)}if(this.opts.compression){let h=this.opts.compression,{serialize:c,deserialize:p}=h.opts;this.opts.serialize=c,this.opts.deserialize=p}typeof this.opts.store.on=="function"&&l&&this.opts.store.on("error",h=>this.emit("error",h)),this.opts.store.namespace=this.opts.namespace;let d=h=>async function*(){for await(let[c,p]of typeof h=="function"?h(this.opts.store.namespace):h){let m=this.opts.deserialize(p);if(!(this.opts.store.namespace&&!c.includes(this.opts.store.namespace))){if(typeof m.expires=="number"&&Date.now()>m.expires){this.delete(c);continue}yield[this._getKeyUnprefix(c),m.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=d(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=d(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return i.includes(this.opts.store.opts.dialect)||i.findIndex(a=>this.opts.store.opts.url.includes(a))>=0}_getKeyPrefix(a){return`${this.opts.namespace}:${a}`}_getKeyPrefixArray(a){return a.map(l=>`${this.opts.namespace}:${l}`)}_getKeyUnprefix(a){return a.split(":").splice(1).join(":")}get(a,l){let{store:u}=this.opts,d=Array.isArray(a),h=d?this._getKeyPrefixArray(a):this._getKeyPrefix(a);if(d&&u.getMany===void 0){let c=[];for(let p of h)c.push(Promise.resolve().then(()=>u.get(p)).then(m=>typeof m=="string"?this.opts.deserialize(m):m).then(m=>{if(m!=null)return typeof m.expires=="number"&&Date.now()>m.expires?this.delete(p).then(()=>{}):l&&l.raw?m:m.value}));return Promise.allSettled(c).then(p=>{let m=[];for(let O of p)m.push(O.value);return m})}return Promise.resolve().then(()=>d?u.getMany(h):u.get(h)).then(c=>typeof c=="string"?this.opts.deserialize(c):c).then(c=>{if(c!=null){if(d){let p=[];for(let m of c){if(typeof m=="string"&&(m=this.opts.deserialize(m)),m==null){p.push(void 0);continue}typeof m.expires=="number"&&Date.now()>m.expires?(this.delete(a).then(()=>{}),p.push(void 0)):p.push(l&&l.raw?m:m.value)}return p}return typeof c.expires=="number"&&Date.now()>c.expires?this.delete(a).then(()=>{}):l&&l.raw?c:c.value}})}set(a,l,u){let d=this._getKeyPrefix(a);typeof u>"u"&&(u=this.opts.ttl),u===0&&(u=void 0);let{store:h}=this.opts;return Promise.resolve().then(()=>{let c=typeof u=="number"?Date.now()+u:null;return typeof l=="symbol"&&this.emit("error","symbol cannot be serialized"),l={value:l,expires:c},this.opts.serialize(l)}).then(c=>h.set(d,c,u)).then(()=>!0)}delete(a){let{store:l}=this.opts;if(Array.isArray(a)){let d=this._getKeyPrefixArray(a);if(l.deleteMany===void 0){let h=[];for(let c of d)h.push(l.delete(c));return Promise.allSettled(h).then(c=>c.every(p=>p.value===!0))}return Promise.resolve().then(()=>l.deleteMany(d))}let u=this._getKeyPrefix(a);return Promise.resolve().then(()=>l.delete(u))}clear(){let{store:a}=this.opts;return Promise.resolve().then(()=>a.clear())}has(a){let l=this._getKeyPrefix(a),{store:u}=this.opts;return Promise.resolve().then(async()=>typeof u.has=="function"?u.has(l):await u.get(l)!==void 0)}disconnect(){let{store:a}=this.opts;if(typeof a.disconnect=="function")return a.disconnect()}};t.exports=s}),lf=W((e,t)=>{"use strict";var r=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];t.exports=(n,o)=>{if(o._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let i=new Set(Object.keys(n).concat(r)),s={};for(let a of i)a in o||(s[a]={get(){let l=n[a];return typeof l=="function"?l.bind(n):l},set(l){n[a]=l},enumerable:!0,configurable:!1});return Object.defineProperties(o,s),n.once("aborted",()=>{o.destroy(),o.emit("aborted")}),n.once("close",()=>{n.complete&&o.readable?o.once("end",()=>{o.emit("close")}):o.emit("close")}),o}}),uf=W((e,t)=>{"use strict";var{Transform:r,PassThrough:n}=require("stream"),o=require("zlib"),i=lf();t.exports=s=>{let a=(s.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(a))return s;let l=a==="br";if(l&&typeof o.createBrotliDecompress!="function")return s.destroy(new Error("Brotli is not supported on Node.js < 12")),s;let u=!0,d=new r({transform(p,m,O){u=!1,O(null,p)},flush(p){p()}}),h=new n({autoDestroy:!1,destroy(p,m){s.destroy(),m(p)}}),c=l?o.createBrotliDecompress():o.createUnzip();return c.once("error",p=>{if(u&&!s.readable){h.end();return}h.destroy(p)}),i(s,h),s.pipe(d).pipe(c).pipe(h),h}}),ul=W((e,t)=>{"use strict";var r=class{constructor(n={}){if(!(n.maxSize&&n.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=n.maxSize,this.onEviction=n.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(n,o){if(this.cache.set(n,o),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[i,s]of this.oldCache.entries())this.onEviction(i,s);this.oldCache=this.cache,this.cache=new Map}}get(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n)){let o=this.oldCache.get(n);return this.oldCache.delete(n),this._set(n,o),o}}set(n,o){return this.cache.has(n)?this.cache.set(n,o):this._set(n,o),this}has(n){return this.cache.has(n)||this.oldCache.has(n)}peek(n){if(this.cache.has(n))return this.cache.get(n);if(this.oldCache.has(n))return this.oldCache.get(n)}delete(n){let o=this.cache.delete(n);return o&&this._size--,this.oldCache.delete(n)||o}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[n]of this)yield n}*values(){for(let[,n]of this)yield n}*[Symbol.iterator](){for(let n of this.cache)yield n;for(let n of this.oldCache){let[o]=n;this.cache.has(o)||(yield n)}}get size(){let n=0;for(let o of this.oldCache.keys())this.cache.has(o)||n++;return Math.min(this._size+n,this.maxSize)}};t.exports=r}),cl=W((e,t)=>{"use strict";t.exports=r=>{if(r.listenerCount("error")!==0)return r;r.__destroy=r._destroy,r._destroy=(...o)=>{let i=o.pop();r.__destroy(...o,async s=>{await Promise.resolve(),i(s)})};let n=o=>{Promise.resolve().then(()=>{r.emit("error",o)})};return r.once("error",n),Promise.resolve().then(()=>{r.off("error",n)}),r}}),fr=W((e,t)=>{"use strict";var{URL:r}=require("url"),n=require("events"),o=require("tls"),i=require("http2"),s=ul(),a=cl(),l=Symbol("currentStreamCount"),u=Symbol("request"),d=Symbol("cachedOriginSet"),h=Symbol("gracefullyClosing"),c=Symbol("length"),p=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],m=(y,_,v)=>{let R=0,$=y.length;for(;R<$;){let x=R+$>>>1;v(y[x],_)?R=x+1:$=x}return R},O=(y,_)=>y.remoteSettings.maxConcurrentStreams>_.remoteSettings.maxConcurrentStreams,g=(y,_)=>{for(let v=0;v0&&R[d].length<_[d].length&&R[d].every($=>_[d].includes($))&&R[l]+_[l]<=_.remoteSettings.maxConcurrentStreams&&I(R)}},M=(y,_)=>{for(let v=0;v0&&_[d].lengthR[d].includes($))&&_[l]+R[l]<=R.remoteSettings.maxConcurrentStreams)return I(_),!0}return!1},I=y=>{y[h]=!0,y[l]===0&&y.close()},S=class extends n{constructor({timeout:y=0,maxSessions:_=Number.POSITIVE_INFINITY,maxEmptySessions:v=10,maxCachedTlsSessions:R=100}={}){super(),this.sessions={},this.queue={},this.timeout=y,this.maxSessions=_,this.maxEmptySessions=v,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new s({maxSize:R})}get protocol(){return"https:"}normalizeOptions(y){let _="";for(let v=0;v=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let y in this.queue)for(let _ in this.queue[y]){let v=this.queue[y][_];v.completed||(v.completed=!0,v())}}_isBetterSession(y,_){return y>_}_accept(y,_,v,R){let $=0;for(;$<_.length&&y[l]0&&(this.getSession(v,R,_),_.length=0)}getSession(y,_,v){return new Promise((R,$)=>{Array.isArray(v)&&v.length>0?(v=[...v],R()):v=[{resolve:R,reject:$}];try{if(typeof y=="string")y=new r(y);else if(!(y instanceof r))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(_){let{servername:j}=_,{hostname:w}=y;if(j&&w!==j)throw new Error(`Origin ${w} differs from servername ${j}`)}}catch(j){for(let w=0;w=Z||H[h]||H.destroyed||(U||(w=Z),this._isBetterSession(te,C)&&(U=H,C=te))}if(U){this._accept(U,v,q,_);return}}if(x in this.queue){if(q in this.queue[x]){this.queue[x][q].listeners.push(...v);return}}else this.queue[x]={[c]:0};let N=()=>{x in this.queue&&this.queue[x][q]===J&&(delete this.queue[x][q],--this.queue[x][c]===0&&delete this.queue[x])},J=async()=>{this._sessionCount++;let j=`${q}:${x}`,w=!1,C;try{let U={..._};U.settings===void 0&&(U.settings=this.settings),U.session===void 0&&(U.session=this.tlsSessionCache.get(j)),C=await(U.createConnection||this.createConnection).call(this,y,U),U.createConnection=()=>C;let A=i.connect(y,U);A[l]=0,A[h]=!1;let H=()=>{let{socket:Y}=A,re;return Y.servername===!1?(Y.servername=Y.remoteAddress,re=A.originSet,Y.servername=!1):re=A.originSet,re},Z=()=>A[l]{this.tlsSessionCache.set(j,Y)}),A.once("error",Y=>{for(let re=0;re{A.destroy()}),A.once("close",()=>{if(this._sessionCount--,w){this._emptySessionCount--;let Y=this.sessions[x];Y.length===1?delete this.sessions[x]:Y.splice(Y.indexOf(A),1)}else{N();let Y=new Error("Session closed without receiving a SETTINGS frame");Y.code="HTTP2WRAPPER_NOSETTINGS";for(let re=0;re{let Y=this.queue[x];if(!Y)return;let re=A[d];for(let be=0;be{A[d]=H()||[],A[h]=!1,M(this.sessions[x],A),!(A[h]||!Z())&&(te(),Z()&&g(this.sessions[x],A))}),A.once("remoteSettings",()=>{if(J.destroyed){let Y=new Error("Agent has been destroyed");for(let re=0;rethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),A.on("remoteSettings",()=>{!Z()||(te(),Z()&&g(this.sessions[x],A))})}),A[u]=A.request,A.request=(Y,re)=>{if(A[h])throw new Error("The session is gracefully closing. No new streams are allowed.");let be=A[u](Y,re);return A.ref(),A[l]++===0&&this._emptySessionCount--,be.once("close",()=>{if(--A[l]===0&&(this._emptySessionCount++,A.unref(),this._emptySessionCount>this.maxEmptySessions||A[h])){A.close();return}A.destroyed||A.closed||Z()&&!M(this.sessions[x],A)&&(g(this.sessions[x],A),te(),A[l]===0&&this._processQueue())}),be}}catch(U){N(),this._sessionCount--;for(let A=0;A{this.getSession(y,_,[{reject:x,resolve:q=>{try{let N=q.request(v,R);a(N),$(N)}catch(N){x(N)}}}])})}async createConnection(y,_){return S.connect(y,_)}static connect(y,_){_.ALPNProtocols=["h2"];let v=y.port||443,R=y.hostname;typeof _.servername>"u"&&(_.servername=R);let $=o.connect(v,R,_);return _.socket&&($._peername={family:void 0,address:void 0,port:v}),$}closeEmptySessions(y=Number.POSITIVE_INFINITY){let _=0,{sessions:v}=this;for(let R in v){let $=v[R];for(let x=0;x<$.length;x++){let q=$[x];if(q[l]===0&&(_++,q.close(),_>=y))return _}}return _}destroy(y){let{sessions:_,queue:v}=this;for(let R in _){let $=_[R];for(let x=0;x<$.length;x++)$[x].destroy(y)}for(let R in v){let $=v[R];for(let x in $)$[x].destroyed=!0}this.queue={},this.tlsSessionCache.clear()}get emptySessionCount(){return this._emptySessionCount}get pendingSessionCount(){return this._sessionCount-this._emptySessionCount}get sessionCount(){return this._sessionCount}};S.kCurrentStreamCount=l,S.kGracefullyClosing=h,t.exports={Agent:S,globalAgent:new S}}),hl=W((e,t)=>{"use strict";var{Readable:r}=require("stream"),n=class extends r{constructor(o,i){super({emitClose:!1,autoDestroy:!0,highWaterMark:i}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=o,this._dumped=!1}get connection(){return this.socket}set connection(o){this.socket=o}_destroy(o,i){this.readableEnded||(this.aborted=!0),i(),this.req._request.destroy(o)}setTimeout(o,i){return this.req.setTimeout(o,i),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};t.exports=n}),cf=W((e,t)=>{"use strict";t.exports=(r,n,o)=>{for(let i of o)r.on(i,(...s)=>n.emit(i,...s))}}),to=W((e,t)=>{"use strict";var r=(n,o,i)=>{t.exports[o]=class extends n{constructor(...s){super(typeof i=="string"?i:i(s)),this.name=`${super.name} [${o}]`,this.code=o}}};r(TypeError,"ERR_INVALID_ARG_TYPE",n=>{let o=n[0].includes(".")?"property":"argument",i=n[1],s=Array.isArray(i);return s&&(i=`${i.slice(0,-1).join(", ")} or ${i.slice(-1)}`),`The "${n[0]}" ${o} must be ${s?"one of":"of"} type ${i}. Received ${typeof n[2]}`}),r(TypeError,"ERR_INVALID_PROTOCOL",n=>`Protocol "${n[0]}" not supported. Expected "${n[1]}"`),r(Error,"ERR_HTTP_HEADERS_SENT",n=>`Cannot ${n[0]} headers after they are sent to the client`),r(TypeError,"ERR_INVALID_HTTP_TOKEN",n=>`${n[0]} must be a valid HTTP token [${n[1]}]`),r(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",n=>`Invalid value "${n[0]} for header "${n[1]}"`),r(TypeError,"ERR_INVALID_CHAR",n=>`Invalid character in ${n[0]} [${n[1]}]`),r(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),hf=W((e,t)=>{"use strict";t.exports=r=>{switch(r){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),dl=W((e,t)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:r}=to(),n=hf(),o=/^[\^`\-\w!#$%&*+.|~]+$/;t.exports=i=>{if(typeof i!="string"||!o.test(i)&&!n(i))throw new r("Header name",i)}}),fl=W((e,t)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:r,ERR_INVALID_CHAR:n}=to(),o=/[^\t\u0020-\u007E\u0080-\u00FF]/;t.exports=(i,s)=>{if(typeof s>"u")throw new r(s,i);if(o.test(s))throw new n("header content",i)}}),df=W((e,t)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:r}=to(),n={has(o,i){let s=o.session===void 0?o:o.session.socket;return i in o||i in s},get(o,i){switch(i){case"on":case"once":case"end":case"emit":case"destroy":return o[i].bind(o);case"writable":case"destroyed":return o[i];case"readable":return o.destroyed?!1:o.readable;case"setTimeout":{let{session:s}=o;return s!==void 0?s.setTimeout.bind(s):o.setTimeout.bind(o)}case"write":case"read":case"pause":case"resume":throw new r;default:{let s=o.session===void 0?o:o.session.socket,a=s[i];return typeof a=="function"?a.bind(s):a}}},getPrototypeOf(o){return o.session!==void 0?Reflect.getPrototypeOf(o.session.socket):Reflect.getPrototypeOf(o)},set(o,i,s){switch(i){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return o[i]=s,!0;case"setTimeout":{let{session:a}=o;return a===void 0?o.setTimeout=s:a.setTimeout=s,!0}case"write":case"read":case"pause":case"resume":throw new r;default:{let a=o.session===void 0?o:o.session.socket;return a[i]=s,!0}}}};t.exports=n}),pl=W((e,t)=>{"use strict";var{URL:r,urlToHttpOptions:n}=require("url"),o=require("http2"),{Writable:i}=require("stream"),{Agent:s,globalAgent:a}=fr(),l=hl(),u=cf(),{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_PROTOCOL:h,ERR_HTTP_HEADERS_SENT:c}=to(),p=dl(),m=fl(),O=df(),{HTTP2_HEADER_STATUS:g,HTTP2_HEADER_METHOD:M,HTTP2_HEADER_PATH:I,HTTP2_HEADER_AUTHORITY:S,HTTP2_METHOD_CONNECT:y}=o.constants,_=Symbol("headers"),v=Symbol("origin"),R=Symbol("session"),$=Symbol("options"),x=Symbol("flushedHeaders"),q=Symbol("jobs"),N=Symbol("pendingAgentPromise"),J=class extends i{constructor(j,w,C){if(super({autoDestroy:!1,emitClose:!1}),typeof j=="string"?j=n(new r(j)):j instanceof r?j=n(j):j={...j},typeof w=="function"||w===void 0?(C=w,w=j):w=Object.assign(j,w),w.h2session){if(this[R]=w.h2session,this[R].destroyed)throw new Error("The session has been closed already");this.protocol=this[R].socket.encrypted?"https:":"http:"}else if(w.agent===!1)this.agent=new s({maxEmptySessions:0});else if(typeof w.agent>"u"||w.agent===null)this.agent=a;else if(typeof w.agent.request=="function")this.agent=w.agent;else throw new d("options.agent",["http2wrapper.Agent-like Object","undefined","false"],w.agent);if(this.agent&&(this.protocol=this.agent.protocol),w.protocol&&w.protocol!==this.protocol)throw new h(w.protocol,this.protocol);w.port||(w.port=w.defaultPort||this.agent&&this.agent.defaultPort||443),w.host=w.hostname||w.host||"localhost",delete w.hostname;let{timeout:U}=w;w.timeout=void 0,this[_]=Object.create(null),this[q]=[],this[N]=void 0,this.socket=null,this.connection=null,this.method=w.method||"GET",this.method==="CONNECT"&&(w.path==="/"||w.path===void 0)||(this.path=w.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:A}=w;if(A)for(let Z in A)this.setHeader(Z,A[Z]);w.auth&&!("authorization"in this[_])&&(this[_].authorization="Basic "+Buffer.from(w.auth).toString("base64")),w.session=w.tlsSession,w.path=w.socketPath,this[$]=w,this[v]=new r(`${this.protocol}//${w.servername||w.host}:${w.port}`);let H=w._reuseSocket;H&&(w.createConnection=(...Z)=>H.destroyed?this.agent.createConnection(...Z):H,this.agent.getSession(this[v],this[$]).catch(()=>{})),U&&this.setTimeout(U),C&&this.once("response",C),this[x]=!1}get method(){return this[_][M]}set method(j){j&&(this[_][M]=j.toUpperCase())}get path(){let j=this.method==="CONNECT"?S:I;return this[_][j]}set path(j){if(j){let w=this.method==="CONNECT"?S:I;this[_][w]=j}}get host(){return this[v].hostname}set host(j){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(j,w,C){if(this._mustNotHaveABody){C(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let U=()=>this._request.write(j,w,C);this._request?U():this[q].push(U)}_final(j){this.flushHeaders();let w=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){j();return}this._request.end(j)};this._request?w():this[q].push(w)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(j,w){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[N]}catch(C){this.aborted&&(j=C)}w(j)}async flushHeaders(){if(this[x]||this.destroyed)return;this[x]=!0;let j=this.method===y,w=C=>{if(this._request=C,this.destroyed){C.destroy();return}j||u(C,this,["timeout","continue"]),C.once("error",A=>{this.destroy(A)}),C.once("aborted",()=>{let{res:A}=this;A?(A.aborted=!0,A.emit("aborted"),A.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let U=(A,H,Z)=>{let te=new l(this.socket,C.readableHighWaterMark);this.res=te,te.url=`${this[v].origin}${this.path}`,te.req=this,te.statusCode=A[g],te.headers=A,te.rawHeaders=Z,te.once("end",()=>{te.complete=!0,te.socket=null,te.connection=null}),j?(te.upgrade=!0,this.emit("connect",te,C,Buffer.alloc(0))?this.emit("close"):C.destroy()):(C.on("data",Y=>{!te._dumped&&!te.push(Y)&&C.pause()}),C.once("end",()=>{this.aborted||te.push(null)}),this.emit("response",te)||te._dump())};C.once("response",U),C.once("headers",A=>this.emit("information",{statusCode:A[g]})),C.once("trailers",(A,H,Z)=>{let{res:te}=this;if(te===null){U(A,H,Z);return}te.trailers=A,te.rawTrailers=Z}),C.once("close",()=>{let{aborted:A,res:H}=this;if(H){A&&(H.aborted=!0,H.emit("aborted"),H.destroy());let Z=()=>{H.emit("close"),this.destroy(),this.emit("close")};H.readable?H.once("end",Z):Z();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(C,O);for(let A of this[q])A();this.emit("socket",this.socket)};if(!(S in this[_])&&!j&&(this[_][S]=this[v].host),this[R])try{w(this[R].request(this[_]))}catch(C){this.destroy(C)}else{this.reusedSocket=!0;try{let C=this.agent.request(this[v],this[$],this[_]);this[N]=C,w(await C),this[N]=!1}catch(C){this[N]=!1,this.destroy(C)}}}get connection(){return this.socket}set connection(j){this.socket=j}getHeaderNames(){return Object.keys(this[_])}hasHeader(j){if(typeof j!="string")throw new d("name","string",j);return Boolean(this[_][j.toLowerCase()])}getHeader(j){if(typeof j!="string")throw new d("name","string",j);return this[_][j.toLowerCase()]}get headersSent(){return this[x]}removeHeader(j){if(typeof j!="string")throw new d("name","string",j);if(this.headersSent)throw new c("remove");delete this[_][j.toLowerCase()]}setHeader(j,w){if(this.headersSent)throw new c("set");p(j),m(j,w);let C=j.toLowerCase();if(C==="connection"){if(w.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${w}`)}C==="host"&&this.method==="CONNECT"?this[_][S]=w:this[_][C]=w}setNoDelay(){}setSocketKeepAlive(){}setTimeout(j,w){let C=()=>this._request.setTimeout(j,w);return this._request?C():this[q].push(C),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(j){}};t.exports=J}),ff=W((e,t)=>{"use strict";var r=require("tls");t.exports=(n={},o=r.connect)=>new Promise((i,s)=>{let a=!1,l,u=async()=>{await h,l.off("timeout",d),l.off("error",s),n.resolveSocket?(i({alpnProtocol:l.alpnProtocol,socket:l,timeout:a}),a&&(await Promise.resolve(),l.emit("timeout"))):(l.destroy(),i({alpnProtocol:l.alpnProtocol,timeout:a}))},d=async()=>{a=!0,u()},h=(async()=>{try{l=await o(n,u),l.on("error",s),l.once("timeout",d)}catch(c){s(c)}})()})}),pf=W((e,t)=>{"use strict";var{isIP:r}=require("net"),n=require("assert"),o=i=>{if(i[0]==="["){let a=i.indexOf("]");return n(a!==-1),i.slice(1,a)}let s=i.indexOf(":");return s===-1?i:i.slice(0,s)};t.exports=i=>{let s=o(i);return r(s)?"":s}}),mf=W((e,t)=>{"use strict";var{URL:r,urlToHttpOptions:n}=require("url"),o=require("http"),i=require("https"),s=ff(),a=ul(),{Agent:l,globalAgent:u}=fr(),d=pl(),h=pf(),c=cl(),p=new a({maxSize:100}),m=new Map,O=(I,S,y)=>{S._httpMessage={shouldKeepAlive:!0};let _=()=>{I.emit("free",S,y)};S.on("free",_);let v=()=>{I.removeSocket(S,y)};S.on("close",v);let R=()=>{let{freeSockets:x}=I;for(let q of Object.values(x))if(q.includes(S)){S.destroy();return}};S.on("timeout",R);let $=()=>{I.removeSocket(S,y),S.off("close",v),S.off("free",_),S.off("timeout",R),S.off("agentRemove",$)};S.on("agentRemove",$),I.emit("free",S,y)},g=(I,S=new Map,y=void 0)=>async _=>{let v=`${_.host}:${_.port}:${_.ALPNProtocols.sort()}`;if(!I.has(v)){if(S.has(v))return{alpnProtocol:(await S.get(v)).alpnProtocol};let{path:R}=_;_.path=_.socketPath;let $=s(_,y);S.set(v,$);try{let x=await $;return I.set(v,x.alpnProtocol),S.delete(v),_.path=R,x}catch(x){throw S.delete(v),_.path=R,x}}return{alpnProtocol:I.get(v)}},M=g(p,m);t.exports=async(I,S,y)=>{if(typeof I=="string"?I=n(new r(I)):I instanceof r?I=n(I):I={...I},typeof S=="function"||S===void 0?(y=S,S=I):S=Object.assign(I,S),S.ALPNProtocols=S.ALPNProtocols||["h2","http/1.1"],!Array.isArray(S.ALPNProtocols)||S.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");S.protocol=S.protocol||"https:";let _=S.protocol==="https:";S.host=S.hostname||S.host||"localhost",S.session=S.tlsSession,S.servername=S.servername||h(S.headers&&S.headers.host||S.host),S.port=S.port||(_?443:80),S._defaultAgent=_?i.globalAgent:o.globalAgent;let v=S.resolveProtocol||M,{agent:R}=S;if(R!==void 0&&R!==!1&&R.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(_){S.resolveSocket=!0;let{socket:$,alpnProtocol:x,timeout:q}=await v(S);if(q){$&&$.destroy();let J=new Error(`Timed out resolving ALPN: ${S.timeout} ms`);throw J.code="ETIMEDOUT",J.ms=S.timeout,J}$&&S.createConnection&&($.destroy(),$=void 0),delete S.resolveSocket;let N=x==="h2";if(R&&(R=N?R.http2:R.https,S.agent=R),R===void 0&&(R=N?u:i.globalAgent),$)if(R===!1)$.destroy();else{let J=(N?l:i.Agent).prototype.createConnection;R.createConnection===J?N?S._reuseSocket=$:O(R,$,S):$.destroy()}if(N)return c(new d(S,y))}else R&&(S.agent=R.http);return c(o.request(S,y))},t.exports.protocolCache=p,t.exports.resolveProtocol=M,t.exports.createResolveProtocol=g}),ml=W((e,t)=>{"use strict";var r=require("stream"),n=require("tls"),o=new n.TLSSocket(new r.PassThrough)._handle._parentWrap.constructor;t.exports=o}),yl=W((e,t)=>{"use strict";var r=class extends Error{constructor(n){super(`The proxy server rejected the request with status code ${n}`),this.statusCode=n}};t.exports=r}),yf=W((e,t)=>{"use strict";var r=(n,o,i)=>{if(!i.some(s=>typeof s=="string"?typeof o===s:o instanceof s)){let s=i.map(a=>typeof a=="string"?a:a.name);throw new TypeError(`Expected '${n}' to be a type of ${s.join(" or ")}, got ${typeof o}`)}};t.exports=r}),gl=W((e,t)=>{"use strict";var{URL:r}=require("url"),n=yf();t.exports=(o,i)=>{n("proxyOptions",i,["object"]),n("proxyOptions.headers",i.headers,["object","undefined"]),n("proxyOptions.raw",i.raw,["boolean","undefined"]),n("proxyOptions.url",i.url,[r,"string"]);let s=new r(i.url);o.proxyOptions={raw:!0,...i,headers:{...i.headers},url:s}}}),Pi=W((e,t)=>{"use strict";t.exports=r=>{let{username:n,password:o}=r.proxyOptions.url;if(n||o){let i=`${n}:${o}`,s=`Basic ${Buffer.from(i).toString("base64")}`;return{"proxy-authorization":s,authorization:s}}return{}}}),gf=W((e,t)=>{"use strict";var r=require("tls"),n=require("http"),o=require("https"),i=ml(),{globalAgent:s}=fr(),a=yl(),l=gl(),u=Pi(),d=(p,m,O)=>{(async()=>{try{let{proxyOptions:g}=p,{url:M,headers:I,raw:S}=g,y=await s.request(M,g,{...u(p),...I,":method":"CONNECT",":authority":`${m.host}:${m.port}`});y.once("error",O),y.once("response",_=>{let v=_[":status"];if(v!==200){O(new a(v));return}let R=p instanceof o.Agent;if(S&&R){m.socket=y;let x=r.connect(m);x.once("close",()=>{y.destroy()}),O(null,x);return}let $=new i(y);$.encrypted=!1,$._handle.getpeername=x=>{x.family=void 0,x.address=void 0,x.port=void 0},O(null,$)})}catch(g){O(g)}})()},h=class extends n.Agent{constructor(p){super(p),l(this,p.proxyOptions)}createConnection(p,m){d(this,p,m)}},c=class extends o.Agent{constructor(p){super(p),l(this,p.proxyOptions)}createConnection(p,m){d(this,p,m)}};t.exports={HttpOverHttp2:h,HttpsOverHttp2:c}}),bl=W((e,t)=>{"use strict";var{Agent:r}=fr(),n=ml(),o=yl(),i=gl(),s=class extends r{constructor(a){super(a),i(this,a.proxyOptions)}async createConnection(a,l){let u=`${a.hostname}:${a.port||443}`,[d,h]=await this._getProxyStream(u);if(h!==200)throw new o(h);if(this.proxyOptions.raw)l.socket=d;else{let c=new n(d);return c.encrypted=!1,c._handle.getpeername=p=>{p.family=void 0,p.address=void 0,p.port=void 0},c}return super.createConnection(a,l)}};t.exports=s}),bf=W((e,t)=>{"use strict";var{globalAgent:r}=fr(),n=bl(),o=Pi(),i=a=>new Promise((l,u)=>{a.once("error",u),a.once("response",d=>{a.off("error",u),l(d[":status"])})}),s=class extends n{async _getProxyStream(a){let{proxyOptions:l}=this,u={...o(this),...l.headers,":method":"CONNECT",":authority":a},d=await r.request(l.url,l,u),h=await i(d);return[d,h]}};t.exports=s}),vf=W((e,t)=>{"use strict";var r=require("http"),n=require("https"),o=bl(),i=Pi(),s=l=>new Promise((u,d)=>{let h=(c,p,m)=>{p.unshift(m),l.off("error",d),u([p,c.statusCode])};l.once("error",d),l.once("connect",h)}),a=class extends o{async _getProxyStream(l){let{proxyOptions:u}=this,{url:d,headers:h}=this.proxyOptions,c=(d.protocol==="https:"?n:r).request({...u,hostname:d.hostname,port:d.port,path:l,headers:{...i(this),...h,host:l},method:"CONNECT"}).end();return s(c)}};t.exports={Http2OverHttp:a,Http2OverHttps:a}}),_f=W((e,t)=>{"use strict";var r=require("http2"),{Agent:n,globalAgent:o}=fr(),i=pl(),s=hl(),a=mf(),{HttpOverHttp2:l,HttpsOverHttp2:u}=gf(),d=bf(),{Http2OverHttp:h,Http2OverHttps:c}=vf(),p=dl(),m=fl(),O=(M,I,S)=>new i(M,I,S),g=(M,I,S)=>{let y=new i(M,I,S);return y.end(),y};t.exports={...r,ClientRequest:i,IncomingMessage:s,Agent:n,globalAgent:o,request:O,get:g,auto:a,proxies:{HttpOverHttp2:l,HttpsOverHttp2:u,Http2OverHttp2:d,Http2OverHttp:h,Http2OverHttps:c},validateHeaderName:p,validateHeaderValue:m}}),wf=W((e,t)=>{if(!globalThis.DOMException)try{let{MessageChannel:r}=require("worker_threads"),n=new r().port1,o=new ArrayBuffer;n.postMessage(o,[o,o])}catch(r){r.constructor.name==="DOMException"&&(globalThis.DOMException=r.constructor)}t.exports=globalThis.DOMException}),Ur=W((e,t)=>{var r=require("buffer"),n=r.Buffer;function o(s,a){for(var l in s)a[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=i);function i(s,a,l){return n(s,a,l)}i.prototype=Object.create(n.prototype),o(n,i),i.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,a,l)},i.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var u=n(s);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},i.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},i.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}}),vl=W((e,t)=>{var r=Ur().Buffer,n=require("stream"),o=require("util");function i(s){if(this.buffer=null,this.writable=!0,this.readable=!0,!s)return this.buffer=r.alloc(0),this;if(typeof s.pipe=="function")return this.buffer=r.alloc(0),s.pipe(this),this;if(s.length||typeof s=="object")return this.buffer=s,this.writable=!1,process.nextTick(function(){this.emit("end",s),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof s+")")}o.inherits(i,n),i.prototype.write=function(s){this.buffer=r.concat([this.buffer,r.from(s)]),this.emit("data",s)},i.prototype.end=function(s){s&&this.write(s),this.emit("end",s),this.emit("close"),this.writable=!1,this.readable=!1},t.exports=i}),Sf=W((e,t)=>{"use strict";var r=require("buffer").Buffer,n=require("buffer").SlowBuffer;t.exports=o;function o(a,l){if(!r.isBuffer(a)||!r.isBuffer(l)||a.length!==l.length)return!1;for(var u=0,d=0;d{"use strict";function r(i){var s=(i/8|0)+(i%8===0?0:1);return s}var n={ES256:r(256),ES384:r(384),ES512:r(521)};function o(i){var s=n[i];if(s)return s;throw new Error('Unknown algorithm "'+i+'"')}t.exports=o}),Tf=W((e,t)=>{"use strict";var r=Ur().Buffer,n=Ef(),o=128,i=0,s=32,a=16,l=2,u=a|s|i<<6,d=l|i<<6;function h(g){return g.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function c(g){if(r.isBuffer(g))return g;if(typeof g=="string")return r.from(g,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function p(g,M){g=c(g);var I=n(M),S=I+1,y=g.length,_=0;if(g[_++]!==u)throw new Error('Could not find expected "seq"');var v=g[_++];if(v===(o|1)&&(v=g[_++]),y-_=o;return y&&--S,S}function O(g,M){g=c(g);var I=n(M),S=g.length;if(S!==I*2)throw new TypeError('"'+M+'" signatures must be "'+I*2+'" bytes, saw "'+S+'"');var y=m(g,0,I),_=m(g,I,g.length),v=I-y,R=I-_,$=1+1+v+1+1+R,x=${var r=Sf(),n=Ur().Buffer,o=require("crypto"),i=Tf(),s=require("util"),a=`"%s" is not a valid algorithm. + Error Message: ${l.result.message}`)})).result)===null||n===void 0?void 0:n.value;if(!u)throw new Error("Response json body do not have ID Token field");return u})}static getIDToken(r){return Hd(this,void 0,void 0,function*(){try{let n=Fr.getIDTokenUrl();if(r){let s=encodeURIComponent(r);n=`${n}&audience=${s}`}Wd.debug(`ID token url is ${n}`);let i=yield Fr.getCall(n);return Wd.setSecret(i),i}catch(n){throw new Error(`Error message: ${n.message}`)}})}};Hn.OidcClient=Fr});var Yu=Tt(yt=>{"use strict";var Gu=yt&&yt.__awaiter||function(e,r,n,i){function s(u){return u instanceof n?u:new n(function(l){l(u)})}return new(n||(n=Promise))(function(u,l){function c(y){try{p(i.next(y))}catch(d){l(d)}}function h(y){try{p(i.throw(y))}catch(d){l(d)}}function p(y){y.done?u(y.value):s(y.value).then(c,h)}p((i=i.apply(e,r||[])).next())})};Object.defineProperty(yt,"__esModule",{value:!0});yt.summary=yt.markdownSummary=yt.SUMMARY_DOCS_URL=yt.SUMMARY_ENV_VAR=void 0;var NS=require("os"),Ku=require("fs"),{access:MS,appendFile:BS,writeFile:DS}=Ku.promises;yt.SUMMARY_ENV_VAR="GITHUB_STEP_SUMMARY";yt.SUMMARY_DOCS_URL="https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary";var Ju=class{constructor(){this._buffer=""}filePath(){return Gu(this,void 0,void 0,function*(){if(this._filePath)return this._filePath;let r=process.env[yt.SUMMARY_ENV_VAR];if(!r)throw new Error(`Unable to find environment variable for $${yt.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);try{yield MS(r,Ku.constants.R_OK|Ku.constants.W_OK)}catch{throw new Error(`Unable to access summary file: '${r}'. Check if the file has correct read/write permissions.`)}return this._filePath=r,this._filePath})}wrap(r,n,i={}){let s=Object.entries(i).map(([u,l])=>` ${u}="${l}"`).join("");return n?`<${r}${s}>${n}`:`<${r}${s}>`}write(r){return Gu(this,void 0,void 0,function*(){let n=!!r?.overwrite,i=yield this.filePath();return yield(n?DS:BS)(i,this._buffer,{encoding:"utf8"}),this.emptyBuffer()})}clear(){return Gu(this,void 0,void 0,function*(){return this.emptyBuffer().write({overwrite:!0})})}stringify(){return this._buffer}isEmptyBuffer(){return this._buffer.length===0}emptyBuffer(){return this._buffer="",this}addRaw(r,n=!1){return this._buffer+=r,n?this.addEOL():this}addEOL(){return this.addRaw(NS.EOL)}addCodeBlock(r,n){let i=Object.assign({},n&&{lang:n}),s=this.wrap("pre",this.wrap("code",r),i);return this.addRaw(s).addEOL()}addList(r,n=!1){let i=n?"ol":"ul",s=r.map(l=>this.wrap("li",l)).join(""),u=this.wrap(i,s);return this.addRaw(u).addEOL()}addTable(r){let n=r.map(s=>{let u=s.map(l=>{if(typeof l=="string")return this.wrap("td",l);let{header:c,data:h,colspan:p,rowspan:y}=l,d=c?"th":"td",m=Object.assign(Object.assign({},p&&{colspan:p}),y&&{rowspan:y});return this.wrap(d,h,m)}).join("");return this.wrap("tr",u)}).join(""),i=this.wrap("table",n);return this.addRaw(i).addEOL()}addDetails(r,n){let i=this.wrap("details",this.wrap("summary",r)+n);return this.addRaw(i).addEOL()}addImage(r,n,i){let{width:s,height:u}=i||{},l=Object.assign(Object.assign({},s&&{width:s}),u&&{height:u}),c=this.wrap("img",null,Object.assign({src:r,alt:n},l));return this.addRaw(c).addEOL()}addHeading(r,n){let i=`h${n}`,s=["h1","h2","h3","h4","h5","h6"].includes(i)?i:"h1",u=this.wrap(s,r);return this.addRaw(u).addEOL()}addSeparator(){let r=this.wrap("hr",null);return this.addRaw(r).addEOL()}addBreak(){let r=this.wrap("br",null);return this.addRaw(r).addEOL()}addQuote(r,n){let i=Object.assign({},n&&{cite:n}),s=this.wrap("blockquote",r,i);return this.addRaw(s).addEOL()}addLink(r,n){let i=this.wrap("a",r,{href:n});return this.addRaw(i).addEOL()}},Gd=new Ju;yt.markdownSummary=Gd;yt.summary=Gd});var Kd=Tt(gt=>{"use strict";var zS=gt&>.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[n]}})}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),FS=gt&>.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),US=gt&>.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&zS(r,e,n);return FS(r,e),r};Object.defineProperty(gt,"__esModule",{value:!0});gt.toPlatformPath=gt.toWin32Path=gt.toPosixPath=void 0;var HS=US(require("path"));function WS(e){return e.replace(/[\\]/g,"/")}gt.toPosixPath=WS;function VS(e){return e.replace(/[/]/g,"\\")}gt.toWin32Path=VS;function GS(e){return e.replace(/[/\\]/g,HS.sep)}gt.toPlatformPath=GS});var Vu=Tt(le=>{"use strict";var KS=le&&le.__createBinding||(Object.create?function(e,r,n,i){i===void 0&&(i=n),Object.defineProperty(e,i,{enumerable:!0,get:function(){return r[n]}})}:function(e,r,n,i){i===void 0&&(i=n),e[i]=r[n]}),JS=le&&le.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),Jd=le&&le.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n in e)n!=="default"&&Object.hasOwnProperty.call(e,n)&&KS(r,e,n);return JS(r,e),r},Yd=le&&le.__awaiter||function(e,r,n,i){function s(u){return u instanceof n?u:new n(function(l){l(u)})}return new(n||(n=Promise))(function(u,l){function c(y){try{p(i.next(y))}catch(d){l(d)}}function h(y){try{p(i.throw(y))}catch(d){l(d)}}function p(y){y.done?u(y.value):s(y.value).then(c,h)}p((i=i.apply(e,r||[])).next())})};Object.defineProperty(le,"__esModule",{value:!0});le.getIDToken=le.getState=le.saveState=le.group=le.endGroup=le.startGroup=le.info=le.notice=le.warning=le.error=le.debug=le.isDebug=le.setFailed=le.setCommandEcho=le.setOutput=le.getBooleanInput=le.getMultilineInput=le.getInput=le.addPath=le.setSecret=le.exportVariable=le.ExitCode=void 0;var Nt=od(),nn=Id(),Wn=Qi(),Qd=Jd(require("os")),YS=Jd(require("path")),QS=Vd(),Xd;(function(e){e[e.Success=0]="Success",e[e.Failure=1]="Failure"})(Xd=le.ExitCode||(le.ExitCode={}));function XS(e,r){let n=Wn.toCommandValue(r);if(process.env[e]=n,process.env.GITHUB_ENV||"")return nn.issueFileCommand("ENV",nn.prepareKeyValueMessage(e,r));Nt.issueCommand("set-env",{name:e},n)}le.exportVariable=XS;function ZS(e){Nt.issueCommand("add-mask",{},e)}le.setSecret=ZS;function eT(e){process.env.GITHUB_PATH||""?nn.issueFileCommand("PATH",e):Nt.issueCommand("add-path",{},e),process.env.PATH=`${e}${YS.delimiter}${process.env.PATH}`}le.addPath=eT;function Qu(e,r){let n=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(r&&r.required&&!n)throw new Error(`Input required and not supplied: ${e}`);return r&&r.trimWhitespace===!1?n:n.trim()}le.getInput=Qu;function tT(e,r){let n=Qu(e,r).split(` +`).filter(i=>i!=="");return r&&r.trimWhitespace===!1?n:n.map(i=>i.trim())}le.getMultilineInput=tT;function rT(e,r){let n=["true","True","TRUE"],i=["false","False","FALSE"],s=Qu(e,r);if(n.includes(s))return!0;if(i.includes(s))return!1;throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${e} +Support boolean input list: \`true | True | TRUE | false | False | FALSE\``)}le.getBooleanInput=rT;function nT(e,r){if(process.env.GITHUB_OUTPUT||"")return nn.issueFileCommand("OUTPUT",nn.prepareKeyValueMessage(e,r));process.stdout.write(Qd.EOL),Nt.issueCommand("set-output",{name:e},Wn.toCommandValue(r))}le.setOutput=nT;function oT(e){Nt.issue("echo",e?"on":"off")}le.setCommandEcho=oT;function iT(e){process.exitCode=Xd.Failure,Zd(e)}le.setFailed=iT;function sT(){return process.env.RUNNER_DEBUG==="1"}le.isDebug=sT;function aT(e){Nt.issueCommand("debug",{},e)}le.debug=aT;function Zd(e,r={}){Nt.issueCommand("error",Wn.toCommandProperties(r),e instanceof Error?e.toString():e)}le.error=Zd;function uT(e,r={}){Nt.issueCommand("warning",Wn.toCommandProperties(r),e instanceof Error?e.toString():e)}le.warning=uT;function lT(e,r={}){Nt.issueCommand("notice",Wn.toCommandProperties(r),e instanceof Error?e.toString():e)}le.notice=lT;function cT(e){process.stdout.write(e+Qd.EOL)}le.info=cT;function ep(e){Nt.issue("group",e)}le.startGroup=ep;function tp(){Nt.issue("endgroup")}le.endGroup=tp;function hT(e,r){return Yd(this,void 0,void 0,function*(){ep(e);let n;try{n=yield r()}finally{tp()}return n})}le.group=hT;function fT(e,r){if(process.env.GITHUB_STATE||"")return nn.issueFileCommand("STATE",nn.prepareKeyValueMessage(e,r));Nt.issueCommand("save-state",{name:e},Wn.toCommandValue(r))}le.saveState=fT;function dT(e){return process.env[`STATE_${e}`]||""}le.getState=dT;function pT(e){return Yd(this,void 0,void 0,function*(){return yield QS.OidcClient.getIDToken(e)})}le.getIDToken=pT;var mT=Yu();Object.defineProperty(le,"summary",{enumerable:!0,get:function(){return mT.summary}});var yT=Yu();Object.defineProperty(le,"markdownSummary",{enumerable:!0,get:function(){return yT.markdownSummary}});var Xu=Kd();Object.defineProperty(le,"toPosixPath",{enumerable:!0,get:function(){return Xu.toPosixPath}});Object.defineProperty(le,"toWin32Path",{enumerable:!0,get:function(){return Xu.toWin32Path}});Object.defineProperty(le,"toPlatformPath",{enumerable:!0,get:function(){return Xu.toPlatformPath}})});var Qy=Tt((Gk,Yy)=>{var gT=Object.create,ei=Object.defineProperty,vT=Object.getOwnPropertyDescriptor,bT=Object.getOwnPropertyNames,js=Object.getOwnPropertySymbols,_T=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty,nm=Object.prototype.propertyIsEnumerable,rp=(e,r,n)=>r in e?ei(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,$l=(e,r)=>{for(var n in r||={})ql.call(r,n)&&rp(e,n,r[n]);if(js)for(var n of js(r))nm.call(r,n)&&rp(e,n,r[n]);return e},Ll=(e,r)=>{var n={};for(var i in e)ql.call(e,i)&&r.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&js)for(var i of js(e))r.indexOf(i)<0&&nm.call(e,i)&&(n[i]=e[i]);return n},Q=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),wT=(e,r)=>{for(var n in r)ei(e,n,{get:r[n],enumerable:!0})},om=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of bT(r))!ql.call(e,s)&&s!==n&&ei(e,s,{get:()=>r[s],enumerable:!(i=vT(r,s))||i.enumerable});return e},He=(e,r,n)=>(n=e!=null?gT(_T(e)):{},om(r||!e||!e.__esModule?ei(n,"default",{value:e,enumerable:!0}):n,e)),ET=e=>om(ei({},"__esModule",{value:!0}),e),Tn=(e,r,n)=>new Promise((i,s)=>{var u=h=>{try{c(n.next(h))}catch(p){s(p)}},l=h=>{try{c(n.throw(h))}catch(p){s(p)}},c=h=>h.done?i(h.value):Promise.resolve(h.value).then(u,l);c((n=n.apply(e,r)).next())}),ST=Q((e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});function n(s){return s.encrypted}var i=(s,u)=>{let l;typeof u=="function"?l={connect:u}:l=u;let c=typeof l.connect=="function",h=typeof l.secureConnect=="function",p=typeof l.close=="function",y=()=>{c&&l.connect(),n(s)&&h&&(s.authorized?l.secureConnect():s.authorizationError||s.once("secureConnect",l.secureConnect)),p&&s.once("close",l.close)};s.writable&&!s.connecting?y():s.connecting?s.once("connect",y):s.destroyed&&p&&l.close(s._hadError)};e.default=i,r.exports=i,r.exports.default=i}),TT=Q((e,r)=>{"use strict";var{PassThrough:n}=require("stream");r.exports=i=>{i={...i};let{array:s}=i,{encoding:u}=i,l=u==="buffer",c=!1;s?c=!(u||l):u=u||"utf8",l&&(u=null);let h=new n({objectMode:c});u&&h.setEncoding(u);let p=0,y=[];return h.on("data",d=>{y.push(d),c?p=y.length:p+=d.length}),h.getBufferedValue=()=>s?y:l?Buffer.concat(y,p):y.join(""),h.getBufferedLength=()=>p,h}}),im=Q((e,r)=>{"use strict";var{constants:n}=require("buffer"),i=require("stream"),{promisify:s}=require("util"),u=TT(),l=s(i.pipeline),c=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function h(p,y){if(!p)throw new Error("Expected a stream");y={maxBuffer:1/0,...y};let{maxBuffer:d}=y,m=u(y);return await new Promise((_,A)=>{let P=R=>{R&&m.getBufferedLength()<=n.MAX_LENGTH&&(R.bufferedData=m.getBufferedValue()),A(R)};(async()=>{try{await l(p,m),_()}catch(R){P(R)}})(),m.on("data",()=>{m.getBufferedLength()>d&&P(new c)})}),m.getBufferedValue()}r.exports=h,r.exports.buffer=(p,y)=>h(p,{...y,encoding:"buffer"}),r.exports.array=(p,y)=>h(p,{...y,array:!0}),r.exports.MaxBufferError=c}),RT=Q((e,r)=>{"use strict";var n=new Set([200,203,204,206,300,301,404,405,410,414,501]),i=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),s=new Set([500,502,503,504]),u={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},l={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function c(d){let m=parseInt(d,10);return isFinite(m)?m:0}function h(d){return d?s.has(d.status):!0}function p(d){let m={};if(!d)return m;let _=d.trim().split(/\s*,\s*/);for(let A of _){let[P,R]=A.split(/\s*=\s*/,2);m[P]=R===void 0?!0:R.replace(/^"|"$/g,"")}return m}function y(d){let m=[];for(let _ in d){let A=d[_];m.push(A===!0?_:_+"="+A)}if(m.length)return m.join(", ")}r.exports=class{constructor(d,m,{shared:_,cacheHeuristic:A,immutableMinTimeToLive:P,ignoreCargoCult:R,_fromObject:V}={}){if(V){this._fromObject(V);return}if(!m||!m.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(d),this._responseTime=this.now(),this._isShared=_!==!1,this._cacheHeuristic=A!==void 0?A:.1,this._immutableMinTtl=P!==void 0?P:24*3600*1e3,this._status="status"in m?m.status:200,this._resHeaders=m.headers,this._rescc=p(m.headers["cache-control"]),this._method="method"in d?d.method:"GET",this._url=d.url,this._host=d.headers.host,this._noAuthorization=!d.headers.authorization,this._reqHeaders=m.headers.vary?d.headers:null,this._reqcc=p(d.headers["cache-control"]),R&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":y(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),m.headers["cache-control"]==null&&/no-cache/.test(m.headers.pragma)&&(this._rescc["no-cache"]=!0)}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&(this._method==="GET"||this._method==="HEAD"||this._method==="POST"&&this._hasExplicitExpiration())&&i.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||n.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(d){if(!d||!d.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(d){this._assertRequestHasHeaders(d);let m=p(d.headers["cache-control"]);return m["no-cache"]||/no-cache/.test(d.headers.pragma)||m["max-age"]&&this.age()>m["max-age"]||m["min-fresh"]&&this.timeToLive()<1e3*m["min-fresh"]||this.stale()&&!(m["max-stale"]&&!this._rescc["must-revalidate"]&&(m["max-stale"]===!0||m["max-stale"]>this.age()-this.maxAge()))?!1:this._requestMatches(d,!1)}_requestMatches(d,m){return(!this._url||this._url===d.url)&&this._host===d.headers.host&&(!d.method||this._method===d.method||m&&d.method==="HEAD")&&this._varyMatches(d)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(d){if(!this._resHeaders.vary)return!0;if(this._resHeaders.vary==="*")return!1;let m=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(let _ of m)if(d.headers[_]!==this._reqHeaders[_])return!1;return!0}_copyWithoutHopByHopHeaders(d){let m={};for(let _ in d)u[_]||(m[_]=d[_]);if(d.connection){let _=d.connection.trim().split(/\s*,\s*/);for(let A of _)delete m[A]}if(m.warning){let _=m.warning.split(/,/).filter(A=>!/^\s*1[0-9][0-9]/.test(A));_.length?m.warning=_.join(",").trim():delete m.warning}return m}responseHeaders(){let d=this._copyWithoutHopByHopHeaders(this._resHeaders),m=this.age();return m>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24&&(d.warning=(d.warning?`${d.warning}, `:"")+'113 - "rfc7234 5.5.4"'),d.age=`${Math.round(m)}`,d.date=new Date(this.now()).toUTCString(),d}date(){let d=Date.parse(this._resHeaders.date);return isFinite(d)?d:this._responseTime}age(){let d=this._ageValue(),m=(this.now()-this._responseTime)/1e3;return d+m}_ageValue(){return c(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]||this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable||this._resHeaders.vary==="*")return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return c(this._rescc["s-maxage"])}if(this._rescc["max-age"])return c(this._rescc["max-age"]);let d=this._rescc.immutable?this._immutableMinTtl:0,m=this.date();if(this._resHeaders.expires){let _=Date.parse(this._resHeaders.expires);return Number.isNaN(_)||__)return Math.max(d,(m-_)/1e3*this._cacheHeuristic)}return d}timeToLive(){let d=this.maxAge()-this.age(),m=d+c(this._rescc["stale-if-error"]),_=d+c(this._rescc["stale-while-revalidate"]);return Math.max(0,d,m,_)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+c(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+c(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(d){return new this(void 0,void 0,{_fromObject:d})}_fromObject(d){if(this._responseTime)throw Error("Reinitialized");if(!d||d.v!==1)throw Error("Invalid serialization");this._responseTime=d.t,this._isShared=d.sh,this._cacheHeuristic=d.ch,this._immutableMinTtl=d.imm!==void 0?d.imm:24*3600*1e3,this._status=d.st,this._resHeaders=d.resh,this._rescc=d.rescc,this._method=d.m,this._url=d.u,this._host=d.h,this._noAuthorization=d.a,this._reqHeaders=d.reqh,this._reqcc=d.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(d){this._assertRequestHasHeaders(d);let m=this._copyWithoutHopByHopHeaders(d.headers);if(delete m["if-range"],!this._requestMatches(d,!0)||!this.storable())return delete m["if-none-match"],delete m["if-modified-since"],m;if(this._resHeaders.etag&&(m["if-none-match"]=m["if-none-match"]?`${m["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),m["accept-ranges"]||m["if-match"]||m["if-unmodified-since"]||this._method&&this._method!="GET"){if(delete m["if-modified-since"],m["if-none-match"]){let _=m["if-none-match"].split(/,/).filter(A=>!/^\s*W\//.test(A));_.length?m["if-none-match"]=_.join(",").trim():delete m["if-none-match"]}}else this._resHeaders["last-modified"]&&!m["if-modified-since"]&&(m["if-modified-since"]=this._resHeaders["last-modified"]);return m}revalidatedPolicy(d,m){if(this._assertRequestHasHeaders(d),this._useStaleIfError()&&h(m))return{modified:!1,matches:!1,policy:this};if(!m||!m.headers)throw Error("Response headers missing");let _=!1;if(m.status!==void 0&&m.status!=304?_=!1:m.headers.etag&&!/^\s*W\//.test(m.headers.etag)?_=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===m.headers.etag:this._resHeaders.etag&&m.headers.etag?_=this._resHeaders.etag.replace(/^\s*W\//,"")===m.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?_=this._resHeaders["last-modified"]===m.headers["last-modified"]:!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!m.headers.etag&&!m.headers["last-modified"]&&(_=!0),!_)return{policy:new this.constructor(d,m),modified:m.status!=304,matches:!1};let A={};for(let R in this._resHeaders)A[R]=R in m.headers&&!l[R]?m.headers[R]:this._resHeaders[R];let P=Object.assign({},m,{status:this._status,method:this._method,headers:A});return{policy:new this.constructor(d,P,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}}),OT=Q(e=>{e.stringify=function r(n){if(typeof n>"u")return n;if(n&&Buffer.isBuffer(n))return JSON.stringify(":base64:"+n.toString("base64"));if(n&&n.toJSON&&(n=n.toJSON()),n&&typeof n=="object"){var i="",s=Array.isArray(n);i=s?"[":"{";var u=!0;for(var l in n){var c=typeof n[l]=="function"||!s&&typeof n[l]>"u";Object.hasOwnProperty.call(n,l)&&!c&&(u||(i+=","),u=!1,s?n[l]==null?i+="null":i+=r(n[l]):n[l]!==void 0&&(i+=r(l)+":"+r(n[l])))}return i+=s?"]":"}",i}else return typeof n=="string"?JSON.stringify(/^:/.test(n)?":"+n:n):typeof n>"u"?"null":JSON.stringify(n)},e.parse=function(r){return JSON.parse(r,function(n,i){return typeof i=="string"?/^:base64:/.test(i)?Buffer.from(i.substring(8),"base64"):/^:/.test(i)?i.substring(1):i:i})}}),xT=Q((e,r)=>{"use strict";var n=require("events"),i=OT(),s=c=>{let h={redis:"@keyv/redis",rediss:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql",etcd:"@keyv/etcd",offline:"@keyv/offline",tiered:"@keyv/tiered"};if(c.adapter||c.uri){let p=c.adapter||/^[^:+]*/.exec(c.uri)[0];return new(require(h[p]))(c)}return new Map},u=["sqlite","postgres","mysql","mongo","redis","tiered"],l=class extends n{constructor(c,{emitErrors:h=!0,...p}={}){if(super(),this.opts={namespace:"keyv",serialize:i.stringify,deserialize:i.parse,...typeof c=="string"?{uri:c}:c,...p},!this.opts.store){let d={...this.opts};this.opts.store=s(d)}if(this.opts.compression){let d=this.opts.compression;this.opts.serialize=d.serialize.bind(d),this.opts.deserialize=d.deserialize.bind(d)}typeof this.opts.store.on=="function"&&h&&this.opts.store.on("error",d=>this.emit("error",d)),this.opts.store.namespace=this.opts.namespace;let y=d=>async function*(){for await(let[m,_]of typeof d=="function"?d(this.opts.store.namespace):d){let A=this.opts.deserialize(_);if(!(this.opts.store.namespace&&!m.includes(this.opts.store.namespace))){if(typeof A.expires=="number"&&Date.now()>A.expires){this.delete(m);continue}yield[this._getKeyUnprefix(m),A.value]}}};typeof this.opts.store[Symbol.iterator]=="function"&&this.opts.store instanceof Map?this.iterator=y(this.opts.store):typeof this.opts.store.iterator=="function"&&this.opts.store.opts&&this._checkIterableAdaptar()&&(this.iterator=y(this.opts.store.iterator.bind(this.opts.store)))}_checkIterableAdaptar(){return u.includes(this.opts.store.opts.dialect)||u.findIndex(c=>this.opts.store.opts.url.includes(c))>=0}_getKeyPrefix(c){return`${this.opts.namespace}:${c}`}_getKeyPrefixArray(c){return c.map(h=>`${this.opts.namespace}:${h}`)}_getKeyUnprefix(c){return c.split(":").splice(1).join(":")}get(c,h){let{store:p}=this.opts,y=Array.isArray(c),d=y?this._getKeyPrefixArray(c):this._getKeyPrefix(c);if(y&&p.getMany===void 0){let m=[];for(let _ of d)m.push(Promise.resolve().then(()=>p.get(_)).then(A=>typeof A=="string"?this.opts.deserialize(A):this.opts.compression?this.opts.deserialize(A):A).then(A=>{if(A!=null)return typeof A.expires=="number"&&Date.now()>A.expires?this.delete(_).then(()=>{}):h&&h.raw?A:A.value}));return Promise.allSettled(m).then(_=>{let A=[];for(let P of _)A.push(P.value);return A})}return Promise.resolve().then(()=>y?p.getMany(d):p.get(d)).then(m=>typeof m=="string"?this.opts.deserialize(m):this.opts.compression?this.opts.deserialize(m):m).then(m=>{if(m!=null){if(y){let _=[];for(let A of m){if(typeof A=="string"&&(A=this.opts.deserialize(A)),A==null){_.push(void 0);continue}typeof A.expires=="number"&&Date.now()>A.expires?(this.delete(c).then(()=>{}),_.push(void 0)):_.push(h&&h.raw?A:A.value)}return _}return typeof m.expires=="number"&&Date.now()>m.expires?this.delete(c).then(()=>{}):h&&h.raw?m:m.value}})}set(c,h,p){let y=this._getKeyPrefix(c);typeof p>"u"&&(p=this.opts.ttl),p===0&&(p=void 0);let{store:d}=this.opts;return Promise.resolve().then(()=>{let m=typeof p=="number"?Date.now()+p:null;return typeof h=="symbol"&&this.emit("error","symbol cannot be serialized"),h={value:h,expires:m},this.opts.serialize(h)}).then(m=>d.set(y,m,p)).then(()=>!0)}delete(c){let{store:h}=this.opts;if(Array.isArray(c)){let y=this._getKeyPrefixArray(c);if(h.deleteMany===void 0){let d=[];for(let m of y)d.push(h.delete(m));return Promise.allSettled(d).then(m=>m.every(_=>_.value===!0))}return Promise.resolve().then(()=>h.deleteMany(y))}let p=this._getKeyPrefix(c);return Promise.resolve().then(()=>h.delete(p))}clear(){let{store:c}=this.opts;return Promise.resolve().then(()=>c.clear())}has(c){let h=this._getKeyPrefix(c),{store:p}=this.opts;return Promise.resolve().then(async()=>typeof p.has=="function"?p.has(h):await p.get(h)!==void 0)}disconnect(){let{store:c}=this.opts;if(typeof c.disconnect=="function")return c.disconnect()}};r.exports=l}),AT=Q((e,r)=>{"use strict";var n=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];r.exports=(i,s)=>{if(s._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let u=new Set(Object.keys(i).concat(n)),l={};for(let c of u)c in s||(l[c]={get(){let h=i[c];return typeof h=="function"?h.bind(i):h},set(h){i[c]=h},enumerable:!0,configurable:!1});return Object.defineProperties(s,l),i.once("aborted",()=>{s.destroy(),s.emit("aborted")}),i.once("close",()=>{i.complete&&s.readable?s.once("end",()=>{s.emit("close")}):s.emit("close")}),s}}),kT=Q((e,r)=>{"use strict";var{Transform:n,PassThrough:i}=require("stream"),s=require("zlib"),u=AT();r.exports=l=>{let c=(l.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(c))return l;let h=c==="br";if(h&&typeof s.createBrotliDecompress!="function")return l.destroy(new Error("Brotli is not supported on Node.js < 12")),l;let p=!0,y=new n({transform(_,A,P){p=!1,P(null,_)},flush(_){_()}}),d=new i({autoDestroy:!1,destroy(_,A){l.destroy(),A(_)}}),m=h?s.createBrotliDecompress():s.createUnzip();return m.once("error",_=>{if(p&&!l.readable){d.end();return}d.destroy(_)}),u(l,d),l.pipe(y).pipe(m).pipe(d),d}}),sm=Q((e,r)=>{"use strict";var n=class{constructor(i={}){if(!(i.maxSize&&i.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=i.maxSize,this.onEviction=i.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(i,s){if(this.cache.set(i,s),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[u,l]of this.oldCache.entries())this.onEviction(u,l);this.oldCache=this.cache,this.cache=new Map}}get(i){if(this.cache.has(i))return this.cache.get(i);if(this.oldCache.has(i)){let s=this.oldCache.get(i);return this.oldCache.delete(i),this._set(i,s),s}}set(i,s){return this.cache.has(i)?this.cache.set(i,s):this._set(i,s),this}has(i){return this.cache.has(i)||this.oldCache.has(i)}peek(i){if(this.cache.has(i))return this.cache.get(i);if(this.oldCache.has(i))return this.oldCache.get(i)}delete(i){let s=this.cache.delete(i);return s&&this._size--,this.oldCache.delete(i)||s}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[i]of this)yield i}*values(){for(let[,i]of this)yield i}*[Symbol.iterator](){for(let i of this.cache)yield i;for(let i of this.oldCache){let[s]=i;this.cache.has(s)||(yield i)}}get size(){let i=0;for(let s of this.oldCache.keys())this.cache.has(s)||i++;return Math.min(this._size+i,this.maxSize)}};r.exports=n}),am=Q((e,r)=>{"use strict";r.exports=n=>{if(n.listenerCount("error")!==0)return n;n.__destroy=n._destroy,n._destroy=(...s)=>{let u=s.pop();n.__destroy(...s,async l=>{await Promise.resolve(),u(l)})};let i=s=>{Promise.resolve().then(()=>{n.emit("error",s)})};return n.once("error",i),Promise.resolve().then(()=>{n.off("error",i)}),n}}),oo=Q((e,r)=>{"use strict";var{URL:n}=require("url"),i=require("events"),s=require("tls"),u=require("http2"),l=sm(),c=am(),h=Symbol("currentStreamCount"),p=Symbol("request"),y=Symbol("cachedOriginSet"),d=Symbol("gracefullyClosing"),m=Symbol("length"),_=["createConnection","maxDeflateDynamicTableSize","maxSettings","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","peerMaxConcurrentStreams","settings","family","localAddress","rejectUnauthorized","pskCallback","minDHSize","path","socket","ca","cert","sigalgs","ciphers","clientCertEngine","crl","dhparam","ecdhCurve","honorCipherOrder","key","privateKeyEngine","privateKeyIdentifier","maxVersion","minVersion","pfx","secureOptions","secureProtocol","sessionIdContext","ticketKeys"],A=(B,v,q)=>{let C=0,k=B.length;for(;C>>1;q(B[L],v)?C=L+1:k=L}return C},P=(B,v)=>B.remoteSettings.maxConcurrentStreams>v.remoteSettings.maxConcurrentStreams,R=(B,v)=>{for(let q=0;q0&&C[y].lengthv[y].includes(k))&&C[h]+v[h]<=v.remoteSettings.maxConcurrentStreams&&z(C)}},V=(B,v)=>{for(let q=0;q0&&v[y].lengthC[y].includes(k))&&v[h]+C[h]<=C.remoteSettings.maxConcurrentStreams)return z(v),!0}return!1},z=B=>{B[d]=!0,B[h]===0&&B.close()},S=class extends i{constructor({timeout:B=0,maxSessions:v=Number.POSITIVE_INFINITY,maxEmptySessions:q=10,maxCachedTlsSessions:C=100}={}){super(),this.sessions={},this.queue={},this.timeout=B,this.maxSessions=v,this.maxEmptySessions=q,this._emptySessionCount=0,this._sessionCount=0,this.settings={enablePush:!1,initialWindowSize:1024*1024*32},this.tlsSessionCache=new l({maxSize:C})}get protocol(){return"https:"}normalizeOptions(B){let v="";for(let q=0;q<_.length;q++){let C=_[q];v+=":",B&&B[C]!==void 0&&(v+=B[C])}return v}_processQueue(){if(this._sessionCount>=this.maxSessions){this.closeEmptySessions(this.maxSessions-this._sessionCount+1);return}for(let B in this.queue)for(let v in this.queue[B]){let q=this.queue[B][v];q.completed||(q.completed=!0,q())}}_isBetterSession(B,v){return B>v}_accept(B,v,q,C){let k=0;for(;k0&&(this.getSession(q,C,v),v.length=0)}getSession(B,v,q){return new Promise((C,k)=>{Array.isArray(q)&&q.length>0?(q=[...q],C()):q=[{resolve:C,reject:k}];try{if(typeof B=="string")B=new n(B);else if(!(B instanceof n))throw new TypeError("The `origin` argument needs to be a string or an URL object");if(v){let{servername:T}=v,{hostname:E}=B;if(T&&E!==T)throw new Error(`Origin ${E} differs from servername ${T}`)}}catch(T){for(let E=0;E=ee||W[d]||W.destroyed||(F||(E=ee),this._isBetterSession(se,N)&&(F=W,N=se))}if(F){this._accept(F,q,H,v);return}}if(L in this.queue){if(H in this.queue[L]){this.queue[L][H].listeners.push(...q);return}}else this.queue[L]={[m]:0};let Y=()=>{L in this.queue&&this.queue[L][H]===ne&&(delete this.queue[L][H],--this.queue[L][m]===0&&delete this.queue[L])},ne=async()=>{this._sessionCount++;let T=`${H}:${L}`,E=!1,N;try{let F={...v};F.settings===void 0&&(F.settings=this.settings),F.session===void 0&&(F.session=this.tlsSessionCache.get(T)),N=await(F.createConnection||this.createConnection).call(this,B,F),F.createConnection=()=>N;let j=u.connect(B,F);j[h]=0,j[d]=!1;let W=()=>{let{socket:te}=j,ie;return te.servername===!1?(te.servername=te.remoteAddress,ie=j.originSet,te.servername=!1):ie=j.originSet,ie},ee=()=>j[h]{this.tlsSessionCache.set(T,te)}),j.once("error",te=>{for(let ie=0;ie{j.destroy()}),j.once("close",()=>{if(this._sessionCount--,E){this._emptySessionCount--;let te=this.sessions[L];te.length===1?delete this.sessions[L]:te.splice(te.indexOf(j),1)}else{Y();let te=new Error("Session closed without receiving a SETTINGS frame");te.code="HTTP2WRAPPER_NOSETTINGS";for(let ie=0;ie{let te=this.queue[L];if(!te)return;let ie=j[y];for(let Ae=0;Ae{j[y]=W()||[],j[d]=!1,V(this.sessions[L],j),!(j[d]||!ee())&&(se(),ee()&&R(this.sessions[L],j))}),j.once("remoteSettings",()=>{if(ne.destroyed){let te=new Error("Agent has been destroyed");for(let ie=0;iethis.maxEmptySessions&&this.closeEmptySessions(this._emptySessionCount-this.maxEmptySessions),j.on("remoteSettings",()=>{ee()&&(se(),ee()&&R(this.sessions[L],j))})}),j[p]=j.request,j.request=(te,ie)=>{if(j[d])throw new Error("The session is gracefully closing. No new streams are allowed.");let Ae=j[p](te,ie);return j.ref(),j[h]++===0&&this._emptySessionCount--,Ae.once("close",()=>{if(--j[h]===0&&(this._emptySessionCount++,j.unref(),this._emptySessionCount>this.maxEmptySessions||j[d])){j.close();return}j.destroyed||j.closed||ee()&&!V(this.sessions[L],j)&&(R(this.sessions[L],j),se(),j[h]===0&&this._processQueue())}),Ae}}catch(F){Y(),this._sessionCount--;for(let j=0;j{this.getSession(B,v,[{reject:L,resolve:H=>{try{let Y=H.request(q,C);c(Y),k(Y)}catch(Y){L(Y)}}}])})}async createConnection(B,v){return S.connect(B,v)}static connect(B,v){v.ALPNProtocols=["h2"];let q=B.port||443,C=B.hostname;typeof v.servername>"u"&&(v.servername=C);let k=s.connect(q,C,v);return v.socket&&(k._peername={family:void 0,address:void 0,port:q}),k}closeEmptySessions(B=Number.POSITIVE_INFINITY){let v=0,{sessions:q}=this;for(let C in q){let k=q[C];for(let L=0;L=B))return v}}return v}destroy(B){let{sessions:v,queue:q}=this;for(let C in v){let k=v[C];for(let L=0;L{"use strict";var{Readable:n}=require("stream"),i=class extends n{constructor(s,u){super({emitClose:!1,autoDestroy:!0,highWaterMark:u}),this.statusCode=null,this.statusMessage="",this.httpVersion="2.0",this.httpVersionMajor=2,this.httpVersionMinor=0,this.headers={},this.trailers={},this.req=null,this.aborted=!1,this.complete=!1,this.upgrade=null,this.rawHeaders=[],this.rawTrailers=[],this.socket=s,this._dumped=!1}get connection(){return this.socket}set connection(s){this.socket=s}_destroy(s,u){this.readableEnded||(this.aborted=!0),u(),this.req._request.destroy(s)}setTimeout(s,u){return this.req.setTimeout(s,u),this}_dump(){this._dumped||(this._dumped=!0,this.removeAllListeners("data"),this.resume())}_read(){this.req&&this.req._request.resume()}};r.exports=i}),PT=Q((e,r)=>{"use strict";r.exports=(n,i,s)=>{for(let u of s)n.on(u,(...l)=>i.emit(u,...l))}}),Vs=Q((e,r)=>{"use strict";var n=(i,s,u)=>{r.exports[s]=class extends i{constructor(...l){super(typeof u=="string"?u:u(l)),this.name=`${super.name} [${s}]`,this.code=s}}};n(TypeError,"ERR_INVALID_ARG_TYPE",i=>{let s=i[0].includes(".")?"property":"argument",u=i[1],l=Array.isArray(u);return l&&(u=`${u.slice(0,-1).join(", ")} or ${u.slice(-1)}`),`The "${i[0]}" ${s} must be ${l?"one of":"of"} type ${u}. Received ${typeof i[2]}`}),n(TypeError,"ERR_INVALID_PROTOCOL",i=>`Protocol "${i[0]}" not supported. Expected "${i[1]}"`),n(Error,"ERR_HTTP_HEADERS_SENT",i=>`Cannot ${i[0]} headers after they are sent to the client`),n(TypeError,"ERR_INVALID_HTTP_TOKEN",i=>`${i[0]} must be a valid HTTP token [${i[1]}]`),n(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",i=>`Invalid value "${i[0]} for header "${i[1]}"`),n(TypeError,"ERR_INVALID_CHAR",i=>`Invalid character in ${i[0]} [${i[1]}]`),n(Error,"ERR_HTTP2_NO_SOCKET_MANIPULATION","HTTP/2 sockets should not be directly manipulated (e.g. read and written)")}),CT=Q((e,r)=>{"use strict";r.exports=n=>{switch(n){case":method":case":scheme":case":authority":case":path":return!0;default:return!1}}}),lm=Q((e,r)=>{"use strict";var{ERR_INVALID_HTTP_TOKEN:n}=Vs(),i=CT(),s=/^[\^`\-\w!#$%&*+.|~]+$/;r.exports=u=>{if(typeof u!="string"||!s.test(u)&&!i(u))throw new n("Header name",u)}}),cm=Q((e,r)=>{"use strict";var{ERR_HTTP_INVALID_HEADER_VALUE:n,ERR_INVALID_CHAR:i}=Vs(),s=/[^\t\u0020-\u007E\u0080-\u00FF]/;r.exports=(u,l)=>{if(typeof l>"u")throw new n(l,u);if(s.test(l))throw new i("header content",u)}}),IT=Q((e,r)=>{"use strict";var{ERR_HTTP2_NO_SOCKET_MANIPULATION:n}=Vs(),i={has(s,u){let l=s.session===void 0?s:s.session.socket;return u in s||u in l},get(s,u){switch(u){case"on":case"once":case"end":case"emit":case"destroy":return s[u].bind(s);case"writable":case"destroyed":return s[u];case"readable":return s.destroyed?!1:s.readable;case"setTimeout":{let{session:l}=s;return l!==void 0?l.setTimeout.bind(l):s.setTimeout.bind(s)}case"write":case"read":case"pause":case"resume":throw new n;default:{let l=s.session===void 0?s:s.session.socket,c=l[u];return typeof c=="function"?c.bind(l):c}}},getPrototypeOf(s){return s.session!==void 0?Reflect.getPrototypeOf(s.session.socket):Reflect.getPrototypeOf(s)},set(s,u,l){switch(u){case"writable":case"readable":case"destroyed":case"on":case"once":case"end":case"emit":case"destroy":return s[u]=l,!0;case"setTimeout":{let{session:c}=s;return c===void 0?s.setTimeout=l:c.setTimeout=l,!0}case"write":case"read":case"pause":case"resume":throw new n;default:{let c=s.session===void 0?s:s.session.socket;return c[u]=l,!0}}}};r.exports=i}),hm=Q((e,r)=>{"use strict";var{URL:n,urlToHttpOptions:i}=require("url"),s=require("http2"),{Writable:u}=require("stream"),{Agent:l,globalAgent:c}=oo(),h=um(),p=PT(),{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_PROTOCOL:d,ERR_HTTP_HEADERS_SENT:m}=Vs(),_=lm(),A=cm(),P=IT(),{HTTP2_HEADER_STATUS:R,HTTP2_HEADER_METHOD:V,HTTP2_HEADER_PATH:z,HTTP2_HEADER_AUTHORITY:S,HTTP2_METHOD_CONNECT:B}=s.constants,v=Symbol("headers"),q=Symbol("origin"),C=Symbol("session"),k=Symbol("options"),L=Symbol("flushedHeaders"),H=Symbol("jobs"),Y=Symbol("pendingAgentPromise"),ne=class extends u{constructor(T,E,N){if(super({autoDestroy:!1,emitClose:!1}),typeof T=="string"?T=i(new n(T)):T instanceof n?T=i(T):T={...T},typeof E=="function"||E===void 0?(N=E,E=T):E=Object.assign(T,E),E.h2session){if(this[C]=E.h2session,this[C].destroyed)throw new Error("The session has been closed already");this.protocol=this[C].socket.encrypted?"https:":"http:"}else if(E.agent===!1)this.agent=new l({maxEmptySessions:0});else if(typeof E.agent>"u"||E.agent===null)this.agent=c;else if(typeof E.agent.request=="function")this.agent=E.agent;else throw new y("options.agent",["http2wrapper.Agent-like Object","undefined","false"],E.agent);if(this.agent&&(this.protocol=this.agent.protocol),E.protocol&&E.protocol!==this.protocol)throw new d(E.protocol,this.protocol);E.port||(E.port=E.defaultPort||this.agent&&this.agent.defaultPort||443),E.host=E.hostname||E.host||"localhost",delete E.hostname;let{timeout:F}=E;E.timeout=void 0,this[v]=Object.create(null),this[H]=[],this[Y]=void 0,this.socket=null,this.connection=null,this.method=E.method||"GET",this.method==="CONNECT"&&(E.path==="/"||E.path===void 0)||(this.path=E.path),this.res=null,this.aborted=!1,this.reusedSocket=!1;let{headers:j}=E;if(j)for(let ee in j)this.setHeader(ee,j[ee]);E.auth&&!("authorization"in this[v])&&(this[v].authorization="Basic "+Buffer.from(E.auth).toString("base64")),E.session=E.tlsSession,E.path=E.socketPath,this[k]=E,this[q]=new n(`${this.protocol}//${E.servername||E.host}:${E.port}`);let W=E._reuseSocket;W&&(E.createConnection=(...ee)=>W.destroyed?this.agent.createConnection(...ee):W,this.agent.getSession(this[q],this[k]).catch(()=>{})),F&&this.setTimeout(F),N&&this.once("response",N),this[L]=!1}get method(){return this[v][V]}set method(T){T&&(this[v][V]=T.toUpperCase())}get path(){let T=this.method==="CONNECT"?S:z;return this[v][T]}set path(T){if(T){let E=this.method==="CONNECT"?S:z;this[v][E]=T}}get host(){return this[q].hostname}set host(T){}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(T,E,N){if(this._mustNotHaveABody){N(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();let F=()=>this._request.write(T,E,N);this._request?F():this[H].push(F)}_final(T){this.flushHeaders();let E=()=>{if(this._mustNotHaveABody||this.method==="CONNECT"){T();return}this._request.end(T)};this._request?E():this[H].push(E)}abort(){this.res&&this.res.complete||(this.aborted||process.nextTick(()=>this.emit("abort")),this.aborted=!0,this.destroy())}async _destroy(T,E){this.res&&this.res._dump(),this._request?this._request.destroy():process.nextTick(()=>{this.emit("close")});try{await this[Y]}catch(N){this.aborted&&(T=N)}E(T)}async flushHeaders(){if(this[L]||this.destroyed)return;this[L]=!0;let T=this.method===B,E=N=>{if(this._request=N,this.destroyed){N.destroy();return}T||p(N,this,["timeout","continue"]),N.once("error",j=>{this.destroy(j)}),N.once("aborted",()=>{let{res:j}=this;j?(j.aborted=!0,j.emit("aborted"),j.destroy()):this.destroy(new Error("The server aborted the HTTP/2 stream"))});let F=(j,W,ee)=>{let se=new h(this.socket,N.readableHighWaterMark);this.res=se,se.url=`${this[q].origin}${this.path}`,se.req=this,se.statusCode=j[R],se.headers=j,se.rawHeaders=ee,se.once("end",()=>{se.complete=!0,se.socket=null,se.connection=null}),T?(se.upgrade=!0,this.emit("connect",se,N,Buffer.alloc(0))?this.emit("close"):N.destroy()):(N.on("data",te=>{!se._dumped&&!se.push(te)&&N.pause()}),N.once("end",()=>{this.aborted||se.push(null)}),this.emit("response",se)||se._dump())};N.once("response",F),N.once("headers",j=>this.emit("information",{statusCode:j[R]})),N.once("trailers",(j,W,ee)=>{let{res:se}=this;if(se===null){F(j,W,ee);return}se.trailers=j,se.rawTrailers=ee}),N.once("close",()=>{let{aborted:j,res:W}=this;if(W){j&&(W.aborted=!0,W.emit("aborted"),W.destroy());let ee=()=>{W.emit("close"),this.destroy(),this.emit("close")};W.readable?W.once("end",ee):ee();return}if(!this.destroyed){this.destroy(new Error("The HTTP/2 stream has been early terminated")),this.emit("close");return}this.destroy(),this.emit("close")}),this.socket=new Proxy(N,P);for(let j of this[H])j();this[H].length=0,this.emit("socket",this.socket)};if(!(S in this[v])&&!T&&(this[v][S]=this[q].host),this[C])try{E(this[C].request(this[v]))}catch(N){this.destroy(N)}else{this.reusedSocket=!0;try{let N=this.agent.request(this[q],this[k],this[v]);this[Y]=N,E(await N),this[Y]=!1}catch(N){this[Y]=!1,this.destroy(N)}}}get connection(){return this.socket}set connection(T){this.socket=T}getHeaderNames(){return Object.keys(this[v])}hasHeader(T){if(typeof T!="string")throw new y("name","string",T);return Boolean(this[v][T.toLowerCase()])}getHeader(T){if(typeof T!="string")throw new y("name","string",T);return this[v][T.toLowerCase()]}get headersSent(){return this[L]}removeHeader(T){if(typeof T!="string")throw new y("name","string",T);if(this.headersSent)throw new m("remove");delete this[v][T.toLowerCase()]}setHeader(T,E){if(this.headersSent)throw new m("set");_(T),A(T,E);let N=T.toLowerCase();if(N==="connection"){if(E.toLowerCase()==="keep-alive")return;throw new Error(`Invalid 'connection' header: ${E}`)}N==="host"&&this.method==="CONNECT"?this[v][S]=E:this[v][N]=E}setNoDelay(){}setSocketKeepAlive(){}setTimeout(T,E){let N=()=>this._request.setTimeout(T,E);return this._request?N():this[H].push(N),this}get maxHeadersCount(){if(!this.destroyed&&this._request)return this._request.session.localSettings.maxHeaderListSize}set maxHeadersCount(T){}};r.exports=ne}),jT=Q((e,r)=>{"use strict";var n=require("tls");r.exports=(i={},s=n.connect)=>new Promise((u,l)=>{let c=!1,h,p=async()=>{await d,h.off("timeout",y),h.off("error",l),i.resolveSocket?(u({alpnProtocol:h.alpnProtocol,socket:h,timeout:c}),c&&(await Promise.resolve(),h.emit("timeout"))):(h.destroy(),u({alpnProtocol:h.alpnProtocol,timeout:c}))},y=async()=>{c=!0,p()},d=(async()=>{try{h=await s(i,p),h.on("error",l),h.once("timeout",y)}catch(m){l(m)}})()})}),qT=Q((e,r)=>{"use strict";var{isIP:n}=require("net"),i=require("assert"),s=u=>{if(u[0]==="["){let c=u.indexOf("]");return i(c!==-1),u.slice(1,c)}let l=u.indexOf(":");return l===-1?u:u.slice(0,l)};r.exports=u=>{let l=s(u);return n(l)?"":l}}),$T=Q((e,r)=>{"use strict";var{URL:n,urlToHttpOptions:i}=require("url"),s=require("http"),u=require("https"),l=jT(),c=sm(),{Agent:h,globalAgent:p}=oo(),y=hm(),d=qT(),m=am(),_=new c({maxSize:100}),A=new Map,P=(z,S,B)=>{S._httpMessage={shouldKeepAlive:!0};let v=()=>{z.emit("free",S,B)};S.on("free",v);let q=()=>{z.removeSocket(S,B)};S.on("close",q);let C=()=>{let{freeSockets:L}=z;for(let H of Object.values(L))if(H.includes(S)){S.destroy();return}};S.on("timeout",C);let k=()=>{z.removeSocket(S,B),S.off("close",q),S.off("free",v),S.off("timeout",C),S.off("agentRemove",k)};S.on("agentRemove",k),z.emit("free",S,B)},R=(z,S=new Map,B=void 0)=>async v=>{let q=`${v.host}:${v.port}:${v.ALPNProtocols.sort()}`;if(!z.has(q)){if(S.has(q))return{alpnProtocol:(await S.get(q)).alpnProtocol};let{path:C}=v;v.path=v.socketPath;let k=l(v,B);S.set(q,k);try{let L=await k;return z.set(q,L.alpnProtocol),S.delete(q),v.path=C,L}catch(L){throw S.delete(q),v.path=C,L}}return{alpnProtocol:z.get(q)}},V=R(_,A);r.exports=async(z,S,B)=>{if(typeof z=="string"?z=i(new n(z)):z instanceof n?z=i(z):z={...z},typeof S=="function"||S===void 0?(B=S,S=z):S=Object.assign(z,S),S.ALPNProtocols=S.ALPNProtocols||["h2","http/1.1"],!Array.isArray(S.ALPNProtocols)||S.ALPNProtocols.length===0)throw new Error("The `ALPNProtocols` option must be an Array with at least one entry");S.protocol=S.protocol||"https:";let v=S.protocol==="https:";S.host=S.hostname||S.host||"localhost",S.session=S.tlsSession,S.servername=S.servername||d(S.headers&&S.headers.host||S.host),S.port=S.port||(v?443:80),S._defaultAgent=v?u.globalAgent:s.globalAgent;let q=S.resolveProtocol||V,{agent:C}=S;if(C!==void 0&&C!==!1&&C.constructor.name!=="Object")throw new Error("The `options.agent` can be only an object `http`, `https` or `http2` properties");if(v){S.resolveSocket=!0;let{socket:k,alpnProtocol:L,timeout:H}=await q(S);if(H){k&&k.destroy();let ne=new Error(`Timed out resolving ALPN: ${S.timeout} ms`);throw ne.code="ETIMEDOUT",ne.ms=S.timeout,ne}k&&S.createConnection&&(k.destroy(),k=void 0),delete S.resolveSocket;let Y=L==="h2";if(C&&(C=Y?C.http2:C.https,S.agent=C),C===void 0&&(C=Y?p:u.globalAgent),k)if(C===!1)k.destroy();else{let ne=(Y?h:u.Agent).prototype.createConnection;C.createConnection===ne?Y?S._reuseSocket=k:P(C,k,S):k.destroy()}if(Y)return m(new y(S,B))}else C&&(S.agent=C.http);return m(s.request(S,B))},r.exports.protocolCache=_,r.exports.resolveProtocol=V,r.exports.createResolveProtocol=R}),fm=Q((e,r)=>{"use strict";var n=require("stream"),i=require("tls"),s=new i.TLSSocket(new n.PassThrough)._handle._parentWrap.constructor;r.exports=s}),dm=Q((e,r)=>{"use strict";var n=class extends Error{constructor(i,s=""){super(`The proxy server rejected the request with status code ${i} (${s||"empty status message"})`),this.statusCode=i,this.statusMessage=s}};r.exports=n}),LT=Q((e,r)=>{"use strict";var n=(i,s,u)=>{if(!u.some(l=>typeof l=="string"?typeof s===l:s instanceof l)){let l=u.map(c=>typeof c=="string"?c:c.name);throw new TypeError(`Expected '${i}' to be a type of ${l.join(" or ")}, got ${typeof s}`)}};r.exports=n}),pm=Q((e,r)=>{"use strict";var{URL:n}=require("url"),i=LT();r.exports=(s,u)=>{i("proxyOptions",u,["object"]),i("proxyOptions.headers",u.headers,["object","undefined"]),i("proxyOptions.raw",u.raw,["boolean","undefined"]),i("proxyOptions.url",u.url,[n,"string"]);let l=new n(u.url);s.proxyOptions={raw:!0,...u,headers:{...u.headers},url:l}}}),Nl=Q((e,r)=>{"use strict";r.exports=n=>{let{username:i,password:s}=n.proxyOptions.url;if(i||s){let u=`${i}:${s}`,l=`Basic ${Buffer.from(u).toString("base64")}`;return{"proxy-authorization":l,authorization:l}}return{}}}),NT=Q((e,r)=>{"use strict";var n=require("tls"),i=require("http"),s=require("https"),u=fm(),{globalAgent:l}=oo(),c=dm(),h=pm(),p=Nl(),y=(_,A,P)=>{(async()=>{try{let{proxyOptions:R}=_,{url:V,headers:z,raw:S}=R,B=await l.request(V,R,{...p(_),...z,":method":"CONNECT",":authority":`${A.host}:${A.port}`});B.once("error",P),B.once("response",v=>{let q=v[":status"];if(q!==200){P(new c(q,""));return}let C=_ instanceof s.Agent;if(S&&C){A.socket=B;let L=n.connect(A);L.once("close",()=>{B.destroy()}),P(null,L);return}let k=new u(B);k.encrypted=!1,k._handle.getpeername=L=>{L.family=void 0,L.address=void 0,L.port=void 0},P(null,k)})}catch(R){P(R)}})()},d=class extends i.Agent{constructor(_){super(_),h(this,_.proxyOptions)}createConnection(_,A){y(this,_,A)}},m=class extends s.Agent{constructor(_){super(_),h(this,_.proxyOptions)}createConnection(_,A){y(this,_,A)}};r.exports={HttpOverHttp2:d,HttpsOverHttp2:m}}),mm=Q((e,r)=>{"use strict";var{Agent:n}=oo(),i=fm(),s=dm(),u=pm(),l=class extends n{constructor(c){super(c),u(this,c.proxyOptions)}async createConnection(c,h){let p=`${c.hostname}:${c.port||443}`,[y,d,m]=await this._getProxyStream(p);if(d!==200)throw new s(d,m);if(this.proxyOptions.raw)h.socket=y;else{let _=new i(y);return _.encrypted=!1,_._handle.getpeername=A=>{A.family=void 0,A.address=void 0,A.port=void 0},_}return super.createConnection(c,h)}};r.exports=l}),MT=Q((e,r)=>{"use strict";var{globalAgent:n}=oo(),i=mm(),s=Nl(),u=c=>new Promise((h,p)=>{c.once("error",p),c.once("response",y=>{c.off("error",p),h(y[":status"])})}),l=class extends i{async _getProxyStream(c){let{proxyOptions:h}=this,p={...s(this),...h.headers,":method":"CONNECT",":authority":c},y=await n.request(h.url,h,p),d=await u(y);return[y,d,""]}};r.exports=l}),BT=Q((e,r)=>{"use strict";var n=require("http"),i=require("https"),s=mm(),u=Nl(),l=h=>new Promise((p,y)=>{let d=(m,_,A)=>{_.unshift(A),h.off("error",y),p([_,m.statusCode,m.statusMessage])};h.once("error",y),h.once("connect",d)}),c=class extends s{async _getProxyStream(h){let{proxyOptions:p}=this,{url:y,headers:d}=this.proxyOptions,m=(y.protocol==="https:"?i:n).request({...p,hostname:y.hostname,port:y.port,path:h,headers:{...u(this),...d,host:h},method:"CONNECT"}).end();return l(m)}};r.exports={Http2OverHttp:c,Http2OverHttps:c}}),DT=Q((e,r)=>{"use strict";var n=require("http2"),{Agent:i,globalAgent:s}=oo(),u=hm(),l=um(),c=$T(),{HttpOverHttp2:h,HttpsOverHttp2:p}=NT(),y=MT(),{Http2OverHttp:d,Http2OverHttps:m}=BT(),_=lm(),A=cm(),P=(V,z,S)=>new u(V,z,S),R=(V,z,S)=>{let B=new u(V,z,S);return B.end(),B};r.exports={...n,ClientRequest:u,IncomingMessage:l,Agent:i,globalAgent:s,request:P,get:R,auto:c,proxies:{HttpOverHttp2:h,HttpsOverHttp2:p,Http2OverHttp2:y,Http2OverHttp:d,Http2OverHttps:m},validateHeaderName:_,validateHeaderValue:A}}),zT=Q((e,r)=>{if(!globalThis.DOMException)try{let{MessageChannel:n}=require("worker_threads"),i=new n().port1,s=new ArrayBuffer;i.postMessage(s,[s,s])}catch(n){n.constructor.name==="DOMException"&&(globalThis.DOMException=n.constructor)}r.exports=globalThis.DOMException}),Gs=Q((e,r)=>{var n=function(i,s){Error.call(this,i),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=i,s&&(this.inner=s)};n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,r.exports=n}),ym=Q((e,r)=>{var n=Gs(),i=function(s,u){n.call(this,s),this.name="NotBeforeError",this.date=u};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,r.exports=i}),gm=Q((e,r)=>{var n=Gs(),i=function(s,u){n.call(this,s),this.name="TokenExpiredError",this.expiredAt=u};i.prototype=Object.create(n.prototype),i.prototype.constructor=i,r.exports=i}),ti=Q((e,r)=>{var n=require("buffer"),i=n.Buffer;function s(l,c){for(var h in l)c[h]=l[h]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?r.exports=n:(s(n,e),e.Buffer=u);function u(l,c,h){return i(l,c,h)}u.prototype=Object.create(i.prototype),s(i,u),u.from=function(l,c,h){if(typeof l=="number")throw new TypeError("Argument must not be a number");return i(l,c,h)},u.alloc=function(l,c,h){if(typeof l!="number")throw new TypeError("Argument must be a number");var p=i(l);return c!==void 0?typeof h=="string"?p.fill(c,h):p.fill(c):p.fill(0),p},u.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return i(l)},u.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(l)}}),vm=Q((e,r)=>{var n=ti().Buffer,i=require("stream"),s=require("util");function u(l){if(this.buffer=null,this.writable=!0,this.readable=!0,!l)return this.buffer=n.alloc(0),this;if(typeof l.pipe=="function")return this.buffer=n.alloc(0),l.pipe(this),this;if(l.length||typeof l=="object")return this.buffer=l,this.writable=!1,process.nextTick(function(){this.emit("end",l),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof l+")")}s.inherits(u,i),u.prototype.write=function(l){this.buffer=n.concat([this.buffer,n.from(l)]),this.emit("data",l)},u.prototype.end=function(l){l&&this.write(l),this.emit("end",l),this.emit("close"),this.writable=!1,this.readable=!1},r.exports=u}),FT=Q((e,r)=>{"use strict";var n=require("buffer").Buffer,i=require("buffer").SlowBuffer;r.exports=s;function s(c,h){if(!n.isBuffer(c)||!n.isBuffer(h)||c.length!==h.length)return!1;for(var p=0,y=0;y{"use strict";function n(u){var l=(u/8|0)+(u%8===0?0:1);return l}var i={ES256:n(256),ES384:n(384),ES512:n(521)};function s(u){var l=i[u];if(l)return l;throw new Error('Unknown algorithm "'+u+'"')}r.exports=s}),HT=Q((e,r)=>{"use strict";var n=ti().Buffer,i=UT(),s=128,u=0,l=32,c=16,h=2,p=c|l|u<<6,y=h|u<<6;function d(R){return R.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function m(R){if(n.isBuffer(R))return R;if(typeof R=="string")return n.from(R,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function _(R,V){R=m(R);var z=i(V),S=z+1,B=R.length,v=0;if(R[v++]!==p)throw new Error('Could not find expected "seq"');var q=R[v++];if(q===(s|1)&&(q=R[v++]),B-v=s;return B&&--S,S}function P(R,V){R=m(R);var z=i(V),S=R.length;if(S!==z*2)throw new TypeError('"'+V+'" signatures must be "'+z*2+'" bytes, saw "'+S+'"');var B=A(R,0,z),v=A(R,z,R.length),q=z-B,C=z-v,k=1+1+q+1+1+C,L=k{var n=FT(),i=ti().Buffer,s=require("crypto"),u=HT(),l=require("util"),c=`"%s" is not a valid algorithm. Supported algorithms are: - "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,l="secret must be a string or buffer",u="key must be a string or a buffer",d="key must be a string, a buffer or an object",h=typeof o.createPublicKey=="function";h&&(u+=" or a KeyObject",l+="or a KeyObject");function c(w){if(!n.isBuffer(w)&&typeof w!="string"&&(!h||typeof w!="object"||typeof w.type!="string"||typeof w.asymmetricKeyType!="string"||typeof w.export!="function"))throw M(u)}function p(w){if(!n.isBuffer(w)&&typeof w!="string"&&typeof w!="object")throw M(d)}function m(w){if(!n.isBuffer(w)){if(typeof w=="string")return w;if(!h||typeof w!="object"||w.type!=="secret"||typeof w.export!="function")throw M(l)}}function O(w){return w.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function g(w){w=w.toString();var C=4-w.length%4;if(C!==4)for(var U=0;U{var r=require("buffer").Buffer;t.exports=function(n){return typeof n=="string"?n:typeof n=="number"||r.isBuffer(n)?n.toString():JSON.stringify(n)}}),Of=W((e,t)=>{var r=Ur().Buffer,n=vl(),o=_l(),i=require("stream"),s=wl(),a=require("util");function l(c,p){return r.from(c,p).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(c,p,m){m=m||"utf8";var O=l(s(c),"binary"),g=l(s(p),m);return a.format("%s.%s",O,g)}function d(c){var p=c.header,m=c.payload,O=c.secret||c.privateKey,g=c.encoding,M=o(p.alg),I=u(p,m,g),S=M.sign(I,O);return a.format("%s.%s",I,S)}function h(c){var p=c.secret||c.privateKey||c.key,m=new n(p);this.readable=!0,this.header=c.header,this.encoding=c.encoding,this.secret=this.privateKey=this.key=m,this.payload=new n(c.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a.inherits(h,i),h.prototype.sign=function(){try{var c=d({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",c),this.emit("data",c),this.emit("end"),this.readable=!1,c}catch(p){this.readable=!1,this.emit("error",p),this.emit("close")}},h.sign=d,t.exports=h}),Rf=W((e,t)=>{var r=Ur().Buffer,n=vl(),o=_l(),i=require("stream"),s=wl(),a=require("util"),l=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function u(S){return Object.prototype.toString.call(S)==="[object Object]"}function d(S){if(u(S))return S;try{return JSON.parse(S)}catch{return}}function h(S){var y=S.split(".",1)[0];return d(r.from(y,"base64").toString("binary"))}function c(S){return S.split(".",2).join(".")}function p(S){return S.split(".")[2]}function m(S,y){y=y||"utf8";var _=S.split(".")[1];return r.from(_,"base64").toString(y)}function O(S){return l.test(S)&&!!h(S)}function g(S,y,_){if(!y){var v=new Error("Missing algorithm parameter for jws.verify");throw v.code="MISSING_ALGORITHM",v}S=s(S);var R=p(S),$=c(S),x=o(y);return x.verify($,R,_)}function M(S,y){if(y=y||{},S=s(S),!O(S))return null;var _=h(S);if(!_)return null;var v=m(S);return(_.typ==="JWT"||y.json)&&(v=JSON.parse(v,y.encoding)),{header:_,payload:v,signature:p(S)}}function I(S){S=S||{};var y=S.secret||S.publicKey||S.key,_=new n(y);this.readable=!0,this.algorithm=S.algorithm,this.encoding=S.encoding,this.secret=this.publicKey=this.key=_,this.signature=new n(S.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a.inherits(I,i),I.prototype.verify=function(){try{var S=g(this.signature.buffer,this.algorithm,this.key.buffer),y=M(this.signature.buffer,this.encoding);return this.emit("done",S,y),this.emit("data",S),this.emit("end"),this.readable=!1,S}catch(_){this.readable=!1,this.emit("error",_),this.emit("close")}},I.decode=M,I.isValid=O,I.verify=g,t.exports=I}),xi=W(e=>{var t=Of(),r=Rf(),n=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=n,e.sign=t.sign,e.verify=r.verify,e.decode=r.decode,e.isValid=r.isValid,e.createSign=function(o){return new t(o)},e.createVerify=function(o){return new r(o)}}),Sl=W((e,t)=>{var r=xi();t.exports=function(n,o){o=o||{};var i=r.decode(n,o);if(!i)return null;var s=i.payload;if(typeof s=="string")try{var a=JSON.parse(s);a!==null&&typeof a=="object"&&(s=a)}catch{}return o.complete===!0?{header:i.header,payload:s,signature:i.signature}:s}}),ro=W((e,t)=>{var r=function(n,o){Error.call(this,n),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=n,o&&(this.inner=o)};r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,t.exports=r}),El=W((e,t)=>{var r=ro(),n=function(o,i){r.call(this,o),this.name="NotBeforeError",this.date=i};n.prototype=Object.create(r.prototype),n.prototype.constructor=n,t.exports=n}),Tl=W((e,t)=>{var r=ro(),n=function(o,i){r.call(this,o),this.name="TokenExpiredError",this.expiredAt=i};n.prototype=Object.create(r.prototype),n.prototype.constructor=n,t.exports=n}),Pf=W((e,t)=>{var r=1e3,n=r*60,o=n*60,i=o*24,s=i*7,a=i*365.25;t.exports=function(c,p){p=p||{};var m=typeof c;if(m==="string"&&c.length>0)return l(c);if(m==="number"&&isFinite(c))return p.long?d(c):u(c);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(c))};function l(c){if(c=String(c),!(c.length>100)){var p=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(c);if(p){var m=parseFloat(p[1]),O=(p[2]||"ms").toLowerCase();switch(O){case"years":case"year":case"yrs":case"yr":case"y":return m*a;case"weeks":case"week":case"w":return m*s;case"days":case"day":case"d":return m*i;case"hours":case"hour":case"hrs":case"hr":case"h":return m*o;case"minutes":case"minute":case"mins":case"min":case"m":return m*n;case"seconds":case"second":case"secs":case"sec":case"s":return m*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function u(c){var p=Math.abs(c);return p>=i?Math.round(c/i)+"d":p>=o?Math.round(c/o)+"h":p>=n?Math.round(c/n)+"m":p>=r?Math.round(c/r)+"s":c+"ms"}function d(c){var p=Math.abs(c);return p>=i?h(c,p,i,"day"):p>=o?h(c,p,o,"hour"):p>=n?h(c,p,n,"minute"):p>=r?h(c,p,r,"second"):c+" ms"}function h(c,p,m,O){var g=p>=m*1.5;return Math.round(c/m)+" "+O+(g?"s":"")}}),Ol=W((e,t)=>{var r=Pf();t.exports=function(n,o){var i=o||Math.floor(Date.now()/1e3);if(typeof n=="string"){var s=r(n);return typeof s>"u"?void 0:Math.floor(i+s/1e3)}else return typeof n=="number"?i+n:void 0}}),xf=W((e,t)=>{e=t.exports=K;var r;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?r=function(){var f=Array.prototype.slice.call(arguments,0);f.unshift("SEMVER"),console.log.apply(console,f)}:r=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,i=16,s=e.re=[],a=e.src=[],l=0,u=l++;a[u]="0|[1-9]\\d*";var d=l++;a[d]="[0-9]+";var h=l++;a[h]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var c=l++;a[c]="("+a[u]+")\\.("+a[u]+")\\.("+a[u]+")";var p=l++;a[p]="("+a[d]+")\\.("+a[d]+")\\.("+a[d]+")";var m=l++;a[m]="(?:"+a[u]+"|"+a[h]+")";var O=l++;a[O]="(?:"+a[d]+"|"+a[h]+")";var g=l++;a[g]="(?:-("+a[m]+"(?:\\."+a[m]+")*))";var M=l++;a[M]="(?:-?("+a[O]+"(?:\\."+a[O]+")*))";var I=l++;a[I]="[0-9A-Za-z-]+";var S=l++;a[S]="(?:\\+("+a[I]+"(?:\\."+a[I]+")*))";var y=l++,_="v?"+a[c]+a[g]+"?"+a[S]+"?";a[y]="^"+_+"$";var v="[v=\\s]*"+a[p]+a[M]+"?"+a[S]+"?",R=l++;a[R]="^"+v+"$";var $=l++;a[$]="((?:<|>)?=?)";var x=l++;a[x]=a[d]+"|x|X|\\*";var q=l++;a[q]=a[u]+"|x|X|\\*";var N=l++;a[N]="[v=\\s]*("+a[q]+")(?:\\.("+a[q]+")(?:\\.("+a[q]+")(?:"+a[g]+")?"+a[S]+"?)?)?";var J=l++;a[J]="[v=\\s]*("+a[x]+")(?:\\.("+a[x]+")(?:\\.("+a[x]+")(?:"+a[M]+")?"+a[S]+"?)?)?";var j=l++;a[j]="^"+a[$]+"\\s*"+a[N]+"$";var w=l++;a[w]="^"+a[$]+"\\s*"+a[J]+"$";var C=l++;a[C]="(?:^|[^\\d])(\\d{1,"+i+"})(?:\\.(\\d{1,"+i+"}))?(?:\\.(\\d{1,"+i+"}))?(?:$|[^\\d])";var U=l++;a[U]="(?:~>?)";var A=l++;a[A]="(\\s*)"+a[U]+"\\s+",s[A]=new RegExp(a[A],"g");var H="$1~",Z=l++;a[Z]="^"+a[U]+a[N]+"$";var te=l++;a[te]="^"+a[U]+a[J]+"$";var Y=l++;a[Y]="(?:\\^)";var re=l++;a[re]="(\\s*)"+a[Y]+"\\s+",s[re]=new RegExp(a[re],"g");var be="$1^",Pe=l++;a[Pe]="^"+a[Y]+a[N]+"$";var Ie=l++;a[Ie]="^"+a[Y]+a[J]+"$";var $e=l++;a[$e]="^"+a[$]+"\\s*("+v+")$|^$";var qe=l++;a[qe]="^"+a[$]+"\\s*("+_+")$|^$";var Xe=l++;a[Xe]="(\\s*)"+a[$]+"\\s*("+v+"|"+a[N]+")",s[Xe]=new RegExp(a[Xe],"g");var fo="$1$2$3",Fr=l++;a[Fr]="^\\s*("+a[N]+")\\s+-\\s+("+a[N]+")\\s*$";var Wr=l++;a[Wr]="^\\s*("+a[J]+")\\s+-\\s+("+a[J]+")\\s*$";var Vr=l++;for(a[Vr]="(<|>)?=?\\s*\\*",Ze=0;Zen)return null;var P=E.loose?s[R]:s[y];if(!P.test(f))return null;try{return new K(f,E)}catch{return null}}e.valid=Q;function Q(f,E){var P=k(f,E);return P?P.version:null}e.clean=ee;function ee(f,E){var P=k(f.trim().replace(/^[=v]+/,""),E);return P?P.version:null}e.SemVer=K;function K(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof K){if(f.loose===E.loose)return f;f=f.version}else if(typeof f!="string")throw new TypeError("Invalid Version: "+f);if(f.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof K))return new K(f,E);r("SemVer",f,E),this.options=E,this.loose=!!E.loose;var P=f.trim().match(E.loose?s[R]:s[y]);if(!P)throw new TypeError("Invalid Version: "+f);if(this.raw=f,this.major=+P[1],this.minor=+P[2],this.patch=+P[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");P[4]?this.prerelease=P[4].split(".").map(function(B){if(/^[0-9]+$/.test(B)){var D=+B;if(D>=0&&D=0;)typeof this.prerelease[P]=="number"&&(this.prerelease[P]++,P=-2);P===-1&&this.prerelease.push(0)}E&&(this.prerelease[0]===E?isNaN(this.prerelease[1])&&(this.prerelease=[E,0]):this.prerelease=[E,0]);break;default:throw new Error("invalid increment argument: "+f)}return this.format(),this.raw=this.version,this},e.inc=xe;function xe(f,E,P,B){typeof P=="string"&&(B=P,P=void 0);try{return new K(f,P).inc(E,B).version}catch{return null}}e.diff=Me;function Me(f,E){if(po(f,E))return null;var P=k(f),B=k(E),D="";if(P.prerelease.length||B.prerelease.length){D="pre";var F="prerelease"}for(var G in P)if((G==="major"||G==="minor"||G==="patch")&&P[G]!==B[G])return D+G;return F}e.compareIdentifiers=Jt;var os=/^[0-9]+$/;function Jt(f,E){var P=os.test(f),B=os.test(E);return P&&B&&(f=+f,E=+E),f===E?0:P&&!B?-1:B&&!P?1:f0}e.lt=Gr;function Gr(f,E,P){return at(f,E,P)<0}e.eq=po;function po(f,E,P){return at(f,E,P)===0}e.neq=is;function is(f,E,P){return at(f,E,P)!==0}e.gte=mo;function mo(f,E,P){return at(f,E,P)>=0}e.lte=yo;function yo(f,E,P){return at(f,E,P)<=0}e.cmp=Jr;function Jr(f,E,P,B){switch(E){case"===":return typeof f=="object"&&(f=f.version),typeof P=="object"&&(P=P.version),f===P;case"!==":return typeof f=="object"&&(f=f.version),typeof P=="object"&&(P=P.version),f!==P;case"":case"=":case"==":return po(f,P,B);case"!=":return is(f,P,B);case">":return mr(f,P,B);case">=":return mo(f,P,B);case"<":return Gr(f,P,B);case"<=":return yo(f,P,B);default:throw new TypeError("Invalid operator: "+E)}}e.Comparator=Le;function Le(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof Le){if(f.loose===!!E.loose)return f;f=f.value}if(!(this instanceof Le))return new Le(f,E);r("comparator",f,E),this.options=E,this.loose=!!E.loose,this.parse(f),this.semver===yr?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}var yr={};Le.prototype.parse=function(f){var E=this.options.loose?s[$e]:s[qe],P=f.match(E);if(!P)throw new TypeError("Invalid comparator: "+f);this.operator=P[1],this.operator==="="&&(this.operator=""),P[2]?this.semver=new K(P[2],this.options.loose):this.semver=yr},Le.prototype.toString=function(){return this.value},Le.prototype.test=function(f){return r("Comparator.test",f,this.options.loose),this.semver===yr?!0:(typeof f=="string"&&(f=new K(f,this.options)),Jr(f,this.operator,this.semver,this.options))},Le.prototype.intersects=function(f,E){if(!(f instanceof Le))throw new TypeError("a Comparator is required");(!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1});var P;if(this.operator==="")return P=new fe(f.value,E),Kr(this.value,P,E);if(f.operator==="")return P=new fe(this.value,E),Kr(f.semver,P,E);var B=(this.operator===">="||this.operator===">")&&(f.operator===">="||f.operator===">"),D=(this.operator==="<="||this.operator==="<")&&(f.operator==="<="||f.operator==="<"),F=this.semver.version===f.semver.version,G=(this.operator===">="||this.operator==="<=")&&(f.operator===">="||f.operator==="<="),ie=Jr(this.semver,"<",f.semver,E)&&(this.operator===">="||this.operator===">")&&(f.operator==="<="||f.operator==="<"),oe=Jr(this.semver,">",f.semver,E)&&(this.operator==="<="||this.operator==="<")&&(f.operator===">="||f.operator===">");return B||D||F&&G||ie||oe},e.Range=fe;function fe(f,E){if((!E||typeof E!="object")&&(E={loose:!!E,includePrerelease:!1}),f instanceof fe)return f.loose===!!E.loose&&f.includePrerelease===!!E.includePrerelease?f:new fe(f.raw,E);if(f instanceof Le)return new fe(f.value,E);if(!(this instanceof fe))return new fe(f,E);if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=f,this.set=f.split(/\s*\|\|\s*/).map(function(P){return this.parseRange(P.trim())},this).filter(function(P){return P.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+f);this.format()}fe.prototype.format=function(){return this.range=this.set.map(function(f){return f.join(" ").trim()}).join("||").trim(),this.range},fe.prototype.toString=function(){return this.range},fe.prototype.parseRange=function(f){var E=this.options.loose;f=f.trim();var P=E?s[Wr]:s[Fr];f=f.replace(P,yc),r("hyphen replace",f),f=f.replace(s[Xe],fo),r("comparator trim",f,s[Xe]),f=f.replace(s[A],H),f=f.replace(s[re],be),f=f.split(/\s+/).join(" ");var B=E?s[$e]:s[qe],D=f.split(" ").map(function(F){return lc(F,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(D=D.filter(function(F){return!!F.match(B)})),D=D.map(function(F){return new Le(F,this.options)},this),D},fe.prototype.intersects=function(f,E){if(!(f instanceof fe))throw new TypeError("a Range is required");return this.set.some(function(P){return P.every(function(B){return f.set.some(function(D){return D.every(function(F){return B.intersects(F,E)})})})})},e.toComparators=ac;function ac(f,E){return new fe(f,E).set.map(function(P){return P.map(function(B){return B.value}).join(" ").trim().split(" ")})}function lc(f,E){return r("comp",f,E),f=hc(f,E),r("caret",f),f=uc(f,E),r("tildes",f),f=fc(f,E),r("xrange",f),f=mc(f,E),r("stars",f),f}function Te(f){return!f||f.toLowerCase()==="x"||f==="*"}function uc(f,E){return f.trim().split(/\s+/).map(function(P){return cc(P,E)}).join(" ")}function cc(f,E){var P=E.loose?s[te]:s[Z];return f.replace(P,function(B,D,F,G,ie){r("tilde",f,B,D,F,G,ie);var oe;return Te(D)?oe="":Te(F)?oe=">="+D+".0.0 <"+(+D+1)+".0.0":Te(G)?oe=">="+D+"."+F+".0 <"+D+"."+(+F+1)+".0":ie?(r("replaceTilde pr",ie),oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+(+F+1)+".0"):oe=">="+D+"."+F+"."+G+" <"+D+"."+(+F+1)+".0",r("tilde return",oe),oe})}function hc(f,E){return f.trim().split(/\s+/).map(function(P){return dc(P,E)}).join(" ")}function dc(f,E){r("caret",f,E);var P=E.loose?s[Ie]:s[Pe];return f.replace(P,function(B,D,F,G,ie){r("caret",f,B,D,F,G,ie);var oe;return Te(D)?oe="":Te(F)?oe=">="+D+".0.0 <"+(+D+1)+".0.0":Te(G)?D==="0"?oe=">="+D+"."+F+".0 <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+".0 <"+(+D+1)+".0.0":ie?(r("replaceCaret pr",ie),D==="0"?F==="0"?oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+F+"."+(+G+1):oe=">="+D+"."+F+"."+G+"-"+ie+" <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+"."+G+"-"+ie+" <"+(+D+1)+".0.0"):(r("no pr"),D==="0"?F==="0"?oe=">="+D+"."+F+"."+G+" <"+D+"."+F+"."+(+G+1):oe=">="+D+"."+F+"."+G+" <"+D+"."+(+F+1)+".0":oe=">="+D+"."+F+"."+G+" <"+(+D+1)+".0.0"),r("caret return",oe),oe})}function fc(f,E){return r("replaceXRanges",f,E),f.split(/\s+/).map(function(P){return pc(P,E)}).join(" ")}function pc(f,E){f=f.trim();var P=E.loose?s[w]:s[j];return f.replace(P,function(B,D,F,G,ie,oe){r("xRange",f,B,D,F,G,ie,oe);var et=Te(F),tt=et||Te(G),Ne=tt||Te(ie),Ce=Ne;return D==="="&&Ce&&(D=""),et?D===">"||D==="<"?B="<0.0.0":B="*":D&&Ce?(tt&&(G=0),ie=0,D===">"?(D=">=",tt?(F=+F+1,G=0,ie=0):(G=+G+1,ie=0)):D==="<="&&(D="<",tt?F=+F+1:G=+G+1),B=D+F+"."+G+"."+ie):tt?B=">="+F+".0.0 <"+(+F+1)+".0.0":Ne&&(B=">="+F+"."+G+".0 <"+F+"."+(+G+1)+".0"),r("xRange return",B),B})}function mc(f,E){return r("replaceStars",f,E),f.trim().replace(s[Vr],"")}function yc(f,E,P,B,D,F,G,ie,oe,et,tt,Ne,Ce){return Te(P)?E="":Te(B)?E=">="+P+".0.0":Te(D)?E=">="+P+"."+B+".0":E=">="+E,Te(oe)?ie="":Te(et)?ie="<"+(+oe+1)+".0.0":Te(tt)?ie="<"+oe+"."+(+et+1)+".0":Ne?ie="<="+oe+"."+et+"."+tt+"-"+Ne:ie="<="+ie,(E+" "+ie).trim()}fe.prototype.test=function(f){if(!f)return!1;typeof f=="string"&&(f=new K(f,this.options));for(var E=0;E0){var D=f[B].semver;if(D.major===E.major&&D.minor===E.minor&&D.patch===E.patch)return!0}return!1}return!0}e.satisfies=Kr;function Kr(f,E,P){try{E=new fe(E,P)}catch{return!1}return E.test(f)}e.maxSatisfying=bc;function bc(f,E,P){var B=null,D=null;try{var F=new fe(E,P)}catch{return null}return f.forEach(function(G){F.test(G)&&(!B||D.compare(G)===-1)&&(B=G,D=new K(B,P))}),B}e.minSatisfying=vc;function vc(f,E,P){var B=null,D=null;try{var F=new fe(E,P)}catch{return null}return f.forEach(function(G){F.test(G)&&(!B||D.compare(G)===1)&&(B=G,D=new K(B,P))}),B}e.minVersion=_c;function _c(f,E){f=new fe(f,E);var P=new K("0.0.0");if(f.test(P)||(P=new K("0.0.0-0"),f.test(P)))return P;P=null;for(var B=0;B":G.prerelease.length===0?G.patch++:G.prerelease.push(0),G.raw=G.format();case"":case">=":(!P||mr(P,G))&&(P=G);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+F.operator)}})}return P&&f.test(P)?P:null}e.validRange=wc;function wc(f,E){try{return new fe(f,E).range||"*"}catch{return null}}e.ltr=Sc;function Sc(f,E,P){return go(f,E,"<",P)}e.gtr=Ec;function Ec(f,E,P){return go(f,E,">",P)}e.outside=go;function go(f,E,P,B){f=new K(f,B),E=new fe(E,B);var D,F,G,ie,oe;switch(P){case">":D=mr,F=yo,G=Gr,ie=">",oe=">=";break;case"<":D=Gr,F=mo,G=mr,ie="<",oe="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kr(f,E,B))return!1;for(var et=0;et=0.0.0")),Ne=Ne||mt,Ce=Ce||mt,D(mt.semver,Ne.semver,B)?Ne=mt:G(mt.semver,Ce.semver,B)&&(Ce=mt)}),Ne.operator===ie||Ne.operator===oe||(!Ce.operator||Ce.operator===ie)&&F(f,Ce.semver)||Ce.operator===oe&&G(f,Ce.semver))return!1}return!0}e.prerelease=Tc;function Tc(f,E){var P=k(f,E);return P&&P.prerelease.length?P.prerelease:null}e.intersects=Oc;function Oc(f,E,P){return f=new fe(f,P),E=new fe(E,P),f.intersects(E)}e.coerce=Rc;function Rc(f){if(f instanceof K)return f;if(typeof f!="string")return null;var E=f.match(s[C]);return E==null?null:k(E[1]+"."+(E[2]||"0")+"."+(E[3]||"0"))}}),Rl=W((e,t)=>{var r=xf();t.exports=r.satisfies(process.version,"^6.12.0 || >=8.0.0")}),kf=W((e,t)=>{var r=ro(),n=El(),o=Tl(),i=Sl(),s=Ol(),a=Rl(),l=xi(),u=["RS256","RS384","RS512","ES256","ES384","ES512"],d=["RS256","RS384","RS512"],h=["HS256","HS384","HS512"];a&&(u.splice(3,0,"PS256","PS384","PS512"),d.splice(3,0,"PS256","PS384","PS512")),t.exports=function(c,p,m,O){typeof m=="function"&&!O&&(O=m,m={}),m||(m={}),m=Object.assign({},m);var g;if(O?g=O:g=function(v,R){if(v)throw v;return R},m.clockTimestamp&&typeof m.clockTimestamp!="number")return g(new r("clockTimestamp must be a number"));if(m.nonce!==void 0&&(typeof m.nonce!="string"||m.nonce.trim()===""))return g(new r("nonce must be a non-empty string"));var M=m.clockTimestamp||Math.floor(Date.now()/1e3);if(!c)return g(new r("jwt must be provided"));if(typeof c!="string")return g(new r("jwt must be a string"));var I=c.split(".");if(I.length!==3)return g(new r("jwt malformed"));var S;try{S=i(c,{complete:!0})}catch(v){return g(v)}if(!S)return g(new r("invalid token"));var y=S.header,_;if(typeof p=="function"){if(!O)return g(new r("verify must be called asynchronous if secret or public key is provided as a callback"));_=p}else _=function(v,R){return R(null,p)};return _(y,function(v,R){if(v)return g(new r("error in secret or public key callback: "+v.message));var $=I[2].trim()!=="";if(!$&&R)return g(new r("jwt signature is required"));if($&&!R)return g(new r("secret or public key must be provided"));if(!$&&!m.algorithms&&(m.algorithms=["none"]),m.algorithms||(m.algorithms=~R.toString().indexOf("BEGIN CERTIFICATE")||~R.toString().indexOf("BEGIN PUBLIC KEY")?u:~R.toString().indexOf("BEGIN RSA PUBLIC KEY")?d:h),!~m.algorithms.indexOf(S.header.alg))return g(new r("invalid algorithm"));var x;try{x=l.verify(c,S.header.alg,R)}catch(A){return g(A)}if(!x)return g(new r("invalid signature"));var q=S.payload;if(typeof q.nbf<"u"&&!m.ignoreNotBefore){if(typeof q.nbf!="number")return g(new r("invalid nbf value"));if(q.nbf>M+(m.clockTolerance||0))return g(new n("jwt not active",new Date(q.nbf*1e3)))}if(typeof q.exp<"u"&&!m.ignoreExpiration){if(typeof q.exp!="number")return g(new r("invalid exp value"));if(M>=q.exp+(m.clockTolerance||0))return g(new o("jwt expired",new Date(q.exp*1e3)))}if(m.audience){var N=Array.isArray(m.audience)?m.audience:[m.audience],J=Array.isArray(q.aud)?q.aud:[q.aud],j=J.some(function(A){return N.some(function(H){return H instanceof RegExp?H.test(A):H===A})});if(!j)return g(new r("jwt audience invalid. expected: "+N.join(" or ")))}if(m.issuer){var w=typeof m.issuer=="string"&&q.iss!==m.issuer||Array.isArray(m.issuer)&&m.issuer.indexOf(q.iss)===-1;if(w)return g(new r("jwt issuer invalid. expected: "+m.issuer))}if(m.subject&&q.sub!==m.subject)return g(new r("jwt subject invalid. expected: "+m.subject));if(m.jwtid&&q.jti!==m.jwtid)return g(new r("jwt jwtid invalid. expected: "+m.jwtid));if(m.nonce&&q.nonce!==m.nonce)return g(new r("jwt nonce invalid. expected: "+m.nonce));if(m.maxAge){if(typeof q.iat!="number")return g(new r("iat required when maxAge is specified"));var C=s(m.maxAge,q.iat);if(typeof C>"u")return g(new r('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(M>=C+(m.clockTolerance||0))return g(new o("maxAge exceeded",new Date(C*1e3)))}if(m.complete===!0){var U=S.signature;return g(null,{header:y,payload:q,signature:U})}return g(null,q)})}}),Af=W((e,t)=>{var r=1/0,n=9007199254740991,o=17976931348623157e292,i=0/0,s="[object Arguments]",a="[object Function]",l="[object GeneratorFunction]",u="[object String]",d="[object Symbol]",h=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,O=/^(?:0|[1-9]\d*)$/,g=parseInt;function M(k,Q){for(var ee=-1,K=k?k.length:0,xe=Array(K);++ee-1&&k%1==0&&k-1:!!xe&&S(k,Q,ee)>-1}function Z(k){return re(k)&&x.call(k,"callee")&&(!N.call(k,"callee")||q.call(k)==s)}var te=Array.isArray;function Y(k){return k!=null&&Pe(k.length)&&!be(k)}function re(k){return $e(k)&&Y(k)}function be(k){var Q=Ie(k)?q.call(k):"";return Q==a||Q==l}function Pe(k){return typeof k=="number"&&k>-1&&k%1==0&&k<=n}function Ie(k){var Q=typeof k;return!!k&&(Q=="object"||Q=="function")}function $e(k){return!!k&&typeof k=="object"}function qe(k){return typeof k=="string"||!te(k)&&$e(k)&&q.call(k)==u}function Xe(k){return typeof k=="symbol"||$e(k)&&q.call(k)==d}function fo(k){if(!k)return k===0?k:0;if(k=Wr(k),k===r||k===-r){var Q=k<0?-1:1;return Q*o}return k===k?k:0}function Fr(k){var Q=fo(k),ee=Q%1;return Q===Q?ee?Q-ee:Q:0}function Wr(k){if(typeof k=="number")return k;if(Xe(k))return i;if(Ie(k)){var Q=typeof k.valueOf=="function"?k.valueOf():k;k=Ie(Q)?Q+"":Q}if(typeof k!="string")return k===0?k:+k;k=k.replace(h,"");var ee=p.test(k);return ee||m.test(k)?g(k.slice(2),ee?2:8):c.test(k)?i:+k}function Vr(k){return Y(k)?w(k):C(k)}function Ze(k){return k?v(k,Vr(k)):[]}t.exports=H}),qf=W((e,t)=>{var r="[object Boolean]",n=Object.prototype,o=n.toString;function i(a){return a===!0||a===!1||s(a)&&o.call(a)==r}function s(a){return!!a&&typeof a=="object"}t.exports=i}),Cf=W((e,t)=>{var r=1/0,n=17976931348623157e292,o=0/0,i="[object Symbol]",s=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,u=/^0o[0-7]+$/i,d=parseInt,h=Object.prototype,c=h.toString;function p(y){return typeof y=="number"&&y==I(y)}function m(y){var _=typeof y;return!!y&&(_=="object"||_=="function")}function O(y){return!!y&&typeof y=="object"}function g(y){return typeof y=="symbol"||O(y)&&c.call(y)==i}function M(y){if(!y)return y===0?y:0;if(y=S(y),y===r||y===-r){var _=y<0?-1:1;return _*n}return y===y?y:0}function I(y){var _=M(y),v=_%1;return _===_?v?_-v:_:0}function S(y){if(typeof y=="number")return y;if(g(y))return o;if(m(y)){var _=typeof y.valueOf=="function"?y.valueOf():y;y=m(_)?_+"":_}if(typeof y!="string")return y===0?y:+y;y=y.replace(s,"");var v=l.test(y);return v||u.test(y)?d(y.slice(2),v?2:8):a.test(y)?o:+y}t.exports=p}),jf=W((e,t)=>{var r="[object Number]",n=Object.prototype,o=n.toString;function i(a){return!!a&&typeof a=="object"}function s(a){return typeof a=="number"||i(a)&&o.call(a)==r}t.exports=s}),If=W((e,t)=>{var r="[object Object]";function n(m){var O=!1;if(m!=null&&typeof m.toString!="function")try{O=!!(m+"")}catch{}return O}function o(m,O){return function(g){return m(O(g))}}var i=Function.prototype,s=Object.prototype,a=i.toString,l=s.hasOwnProperty,u=a.call(Object),d=s.toString,h=o(Object.getPrototypeOf,Object);function c(m){return!!m&&typeof m=="object"}function p(m){if(!c(m)||d.call(m)!=r||n(m))return!1;var O=h(m);if(O===null)return!0;var g=l.call(O,"constructor")&&O.constructor;return typeof g=="function"&&g instanceof g&&a.call(g)==u}t.exports=p}),$f=W((e,t)=>{var r="[object String]",n=Object.prototype,o=n.toString,i=Array.isArray;function s(l){return!!l&&typeof l=="object"}function a(l){return typeof l=="string"||!i(l)&&s(l)&&o.call(l)==r}t.exports=a}),Mf=W((e,t)=>{var r="Expected a function",n=1/0,o=17976931348623157e292,i=0/0,s="[object Symbol]",a=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,d=/^0o[0-7]+$/i,h=parseInt,c=Object.prototype,p=c.toString;function m(v,R){var $;if(typeof R!="function")throw new TypeError(r);return v=y(v),function(){return--v>0&&($=R.apply(this,arguments)),v<=1&&(R=void 0),$}}function O(v){return m(2,v)}function g(v){var R=typeof v;return!!v&&(R=="object"||R=="function")}function M(v){return!!v&&typeof v=="object"}function I(v){return typeof v=="symbol"||M(v)&&p.call(v)==s}function S(v){if(!v)return v===0?v:0;if(v=_(v),v===n||v===-n){var R=v<0?-1:1;return R*o}return v===v?v:0}function y(v){var R=S(v),$=R%1;return R===R?$?R-$:R:0}function _(v){if(typeof v=="number")return v;if(I(v))return i;if(g(v)){var R=typeof v.valueOf=="function"?v.valueOf():v;v=g(R)?R+"":R}if(typeof v!="string")return v===0?v:+v;v=v.replace(a,"");var $=u.test(v);return $||d.test(v)?h(v.slice(2),$?2:8):l.test(v)?i:+v}t.exports=O}),Lf=W((e,t)=>{var r=Ol(),n=Rl(),o=xi(),i=Af(),s=qf(),a=Cf(),l=jf(),u=If(),d=$f(),h=Mf(),c=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];n&&c.splice(3,0,"PS256","PS384","PS512");var p={expiresIn:{isValid:function(y){return a(y)||d(y)&&y},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(y){return a(y)||d(y)&&y},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(y){return d(y)||Array.isArray(y)},message:'"audience" must be a string or array'},algorithm:{isValid:i.bind(null,c),message:'"algorithm" must be a valid string enum value'},header:{isValid:u,message:'"header" must be an object'},encoding:{isValid:d,message:'"encoding" must be a string'},issuer:{isValid:d,message:'"issuer" must be a string'},subject:{isValid:d,message:'"subject" must be a string'},jwtid:{isValid:d,message:'"jwtid" must be a string'},noTimestamp:{isValid:s,message:'"noTimestamp" must be a boolean'},keyid:{isValid:d,message:'"keyid" must be a string'},mutatePayload:{isValid:s,message:'"mutatePayload" must be a boolean'}},m={iat:{isValid:l,message:'"iat" should be a number of seconds'},exp:{isValid:l,message:'"exp" should be a number of seconds'},nbf:{isValid:l,message:'"nbf" should be a number of seconds'}};function O(y,_,v,R){if(!u(v))throw new Error('Expected "'+R+'" to be a plain object.');Object.keys(v).forEach(function($){var x=y[$];if(!x){if(!_)throw new Error('"'+$+'" is not allowed in "'+R+'"');return}if(!x.isValid(v[$]))throw new Error(x.message)})}function g(y){return O(p,!1,y,"options")}function M(y){return O(m,!0,y,"payload")}var I={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},S=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];t.exports=function(y,_,v,R){typeof v=="function"?(R=v,v={}):v=v||{};var $=typeof y=="object"&&!Buffer.isBuffer(y),x=Object.assign({alg:v.algorithm||"HS256",typ:$?"JWT":void 0,kid:v.keyid},v.header);function q(w){if(R)return R(w);throw w}if(!_&&v.algorithm!=="none")return q(new Error("secretOrPrivateKey must have a value"));if(typeof y>"u")return q(new Error("payload is required"));if($){try{M(y)}catch(w){return q(w)}v.mutatePayload||(y=Object.assign({},y))}else{var N=S.filter(function(w){return typeof v[w]<"u"});if(N.length>0)return q(new Error("invalid "+N.join(",")+" option for "+typeof y+" payload"))}if(typeof y.exp<"u"&&typeof v.expiresIn<"u")return q(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof y.nbf<"u"&&typeof v.notBefore<"u")return q(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{g(v)}catch(w){return q(w)}var J=y.iat||Math.floor(Date.now()/1e3);if(v.noTimestamp?delete y.iat:$&&(y.iat=J),typeof v.notBefore<"u"){try{y.nbf=r(v.notBefore,J)}catch(w){return q(w)}if(typeof y.nbf>"u")return q(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof v.expiresIn<"u"&&typeof y=="object"){try{y.exp=r(v.expiresIn,J)}catch(w){return q(w)}if(typeof y.exp>"u")return q(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(I).forEach(function(w){var C=I[w];if(typeof v[w]<"u"){if(typeof y[C]<"u")return q(new Error('Bad "options.'+w+'" option. The payload already has an "'+C+'" property.'));y[C]=v[w]}});var j=v.encoding||"utf8";if(typeof R=="function")R=R&&h(R),o.createSign({header:x,privateKey:_,payload:y,encoding:j}).once("error",R).once("done",function(w){R(null,w)});else return o.sign({header:x,payload:y,secret:_,encoding:j})}}),Nf=W((e,t)=>{t.exports={decode:Sl(),verify:kf(),sign:Lf(),JsonWebTokenError:ro(),NotBeforeError:El(),TokenExpiredError:Tl()}}),Pl={};ef(Pl,{BrowserName:()=>xl,marketNameMap:()=>kl,submitChrome:()=>ey,submitEdge:()=>ay,submitFirefox:()=>Yy,submitOpera:()=>Zy,supportedBrowserSet:()=>Bf});Ku.exports=tf(Pl);var xl=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e))(xl||{}),Bf=new Set(["chrome","edge","firefox"]),kl={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons"},Uf=require("fs"),Al=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function zf(e){return Al.includes(e)}var Df=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Al];function Hf(e){return Df.includes(e)}var Ff=["null","undefined","string","number","bigint","boolean","symbol"];function Wf(e){return Ff.includes(e)}function pr(e){return t=>typeof t===e}var{toString:Vf}=Object.prototype,zr=e=>{let t=Vf.call(e).slice(8,-1);if(/HTML\w+Element/.test(t)&&b.domElement(e))return"HTMLElement";if(Hf(t))return t},he=e=>t=>zr(t)===e;function b(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(b.observable(e))return"Observable";if(b.array(e))return"Array";if(b.buffer(e))return"Buffer";let t=zr(e);if(t)return t;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}b.undefined=pr("undefined");b.string=pr("string");var Gf=pr("number");b.number=e=>Gf(e)&&!b.nan(e);b.bigint=pr("bigint");b.function_=pr("function");b.null_=e=>e===null;b.class_=e=>b.function_(e)&&e.toString().startsWith("class ");b.boolean=e=>e===!0||e===!1;b.symbol=pr("symbol");b.numericString=e=>b.string(e)&&!b.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));b.array=(e,t)=>Array.isArray(e)?b.function_(t)?e.every(r=>t(r)):!0:!1;b.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;b.blob=e=>he("Blob")(e);b.nullOrUndefined=e=>b.null_(e)||b.undefined(e);b.object=e=>!b.null_(e)&&(typeof e=="object"||b.function_(e));b.iterable=e=>b.function_(e?.[Symbol.iterator]);b.asyncIterable=e=>b.function_(e?.[Symbol.asyncIterator]);b.generator=e=>b.iterable(e)&&b.function_(e?.next)&&b.function_(e?.throw);b.asyncGenerator=e=>b.asyncIterable(e)&&b.function_(e.next)&&b.function_(e.throw);b.nativePromise=e=>he("Promise")(e);var Jf=e=>b.function_(e?.then)&&b.function_(e?.catch);b.promise=e=>b.nativePromise(e)||Jf(e);b.generatorFunction=he("GeneratorFunction");b.asyncGeneratorFunction=e=>zr(e)==="AsyncGeneratorFunction";b.asyncFunction=e=>zr(e)==="AsyncFunction";b.boundFunction=e=>b.function_(e)&&!e.hasOwnProperty("prototype");b.regExp=he("RegExp");b.date=he("Date");b.error=he("Error");b.map=e=>he("Map")(e);b.set=e=>he("Set")(e);b.weakMap=e=>he("WeakMap")(e);b.weakSet=e=>he("WeakSet")(e);b.weakRef=e=>he("WeakRef")(e);b.int8Array=he("Int8Array");b.uint8Array=he("Uint8Array");b.uint8ClampedArray=he("Uint8ClampedArray");b.int16Array=he("Int16Array");b.uint16Array=he("Uint16Array");b.int32Array=he("Int32Array");b.uint32Array=he("Uint32Array");b.float32Array=he("Float32Array");b.float64Array=he("Float64Array");b.bigInt64Array=he("BigInt64Array");b.bigUint64Array=he("BigUint64Array");b.arrayBuffer=he("ArrayBuffer");b.sharedArrayBuffer=he("SharedArrayBuffer");b.dataView=he("DataView");b.enumCase=(e,t)=>Object.values(t).includes(e);b.directInstanceOf=(e,t)=>Object.getPrototypeOf(e)===t.prototype;b.urlInstance=e=>he("URL")(e);b.urlString=e=>{if(!b.string(e))return!1;try{return new URL(e),!0}catch{return!1}};b.truthy=e=>Boolean(e);b.falsy=e=>!e;b.nan=e=>Number.isNaN(e);b.primitive=e=>b.null_(e)||Wf(typeof e);b.integer=e=>Number.isInteger(e);b.safeInteger=e=>Number.isSafeInteger(e);b.plainObject=e=>{if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};b.typedArray=e=>zf(zr(e));var Kf=e=>b.safeInteger(e)&&e>=0;b.arrayLike=e=>!b.nullOrUndefined(e)&&!b.function_(e)&&Kf(e.length);b.inRange=(e,t)=>{if(b.number(t))return e>=Math.min(0,t)&&e<=Math.max(t,0);if(b.array(t)&&t.length===2)return e>=Math.min(...t)&&e<=Math.max(...t);throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)};var Qf=1,Yf=["innerHTML","ownerDocument","style","attributes","nodeValue"];b.domElement=e=>b.object(e)&&e.nodeType===Qf&&b.string(e.nodeName)&&!b.plainObject(e)&&Yf.every(t=>t in e);b.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;b.nodeStream=e=>b.object(e)&&b.function_(e.pipe)&&!b.observable(e);b.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var ql=e=>t=>b.integer(t)&&Math.abs(t%2)===e;b.evenInteger=ql(0);b.oddInteger=ql(1);b.emptyArray=e=>b.array(e)&&e.length===0;b.nonEmptyArray=e=>b.array(e)&&e.length>0;b.emptyString=e=>b.string(e)&&e.length===0;var Xf=e=>b.string(e)&&!/\S/.test(e);b.emptyStringOrWhitespace=e=>b.emptyString(e)||Xf(e);b.nonEmptyString=e=>b.string(e)&&e.length>0;b.nonEmptyStringAndNotWhitespace=e=>b.string(e)&&!b.emptyStringOrWhitespace(e);b.emptyObject=e=>b.object(e)&&!b.map(e)&&!b.set(e)&&Object.keys(e).length===0;b.nonEmptyObject=e=>b.object(e)&&!b.map(e)&&!b.set(e)&&Object.keys(e).length>0;b.emptySet=e=>b.set(e)&&e.size===0;b.nonEmptySet=e=>b.set(e)&&e.size>0;b.emptyMap=e=>b.map(e)&&e.size===0;b.nonEmptyMap=e=>b.map(e)&&e.size>0;b.propertyKey=e=>b.any([b.string,b.number,b.symbol],e);b.formData=e=>he("FormData")(e);b.urlSearchParams=e=>he("URLSearchParams")(e);var Cl=(e,t,r)=>{if(!b.function_(t))throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`);if(r.length===0)throw new TypeError("Invalid number of values");return e.call(r,t)};b.any=(e,...t)=>(b.array(e)?e:[e]).some(r=>Cl(Array.prototype.some,r,t));b.all=(e,...t)=>Cl(Array.prototype.every,e,t);var z=(e,t,r,n={})=>{if(!e){let{multipleValues:o}=n,i=o?`received values of types ${[...new Set(r.map(s=>`\`${b(s)}\``))].join(", ")}`:`received value of type \`${b(r)}\``;throw new TypeError(`Expected value which is \`${t}\`, ${i}.`)}},L={undefined:e=>z(b.undefined(e),"undefined",e),string:e=>z(b.string(e),"string",e),number:e=>z(b.number(e),"number",e),bigint:e=>z(b.bigint(e),"bigint",e),function_:e=>z(b.function_(e),"Function",e),null_:e=>z(b.null_(e),"null",e),class_:e=>z(b.class_(e),"Class",e),boolean:e=>z(b.boolean(e),"boolean",e),symbol:e=>z(b.symbol(e),"symbol",e),numericString:e=>z(b.numericString(e),"string with a number",e),array:(e,t)=>{z(b.array(e),"Array",e),t&&e.forEach(t)},buffer:e=>z(b.buffer(e),"Buffer",e),blob:e=>z(b.blob(e),"Blob",e),nullOrUndefined:e=>z(b.nullOrUndefined(e),"null or undefined",e),object:e=>z(b.object(e),"Object",e),iterable:e=>z(b.iterable(e),"Iterable",e),asyncIterable:e=>z(b.asyncIterable(e),"AsyncIterable",e),generator:e=>z(b.generator(e),"Generator",e),asyncGenerator:e=>z(b.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>z(b.nativePromise(e),"native Promise",e),promise:e=>z(b.promise(e),"Promise",e),generatorFunction:e=>z(b.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>z(b.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>z(b.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>z(b.boundFunction(e),"Function",e),regExp:e=>z(b.regExp(e),"RegExp",e),date:e=>z(b.date(e),"Date",e),error:e=>z(b.error(e),"Error",e),map:e=>z(b.map(e),"Map",e),set:e=>z(b.set(e),"Set",e),weakMap:e=>z(b.weakMap(e),"WeakMap",e),weakSet:e=>z(b.weakSet(e),"WeakSet",e),weakRef:e=>z(b.weakRef(e),"WeakRef",e),int8Array:e=>z(b.int8Array(e),"Int8Array",e),uint8Array:e=>z(b.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>z(b.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>z(b.int16Array(e),"Int16Array",e),uint16Array:e=>z(b.uint16Array(e),"Uint16Array",e),int32Array:e=>z(b.int32Array(e),"Int32Array",e),uint32Array:e=>z(b.uint32Array(e),"Uint32Array",e),float32Array:e=>z(b.float32Array(e),"Float32Array",e),float64Array:e=>z(b.float64Array(e),"Float64Array",e),bigInt64Array:e=>z(b.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>z(b.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>z(b.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>z(b.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>z(b.dataView(e),"DataView",e),enumCase:(e,t)=>z(b.enumCase(e,t),"EnumCase",e),urlInstance:e=>z(b.urlInstance(e),"URL",e),urlString:e=>z(b.urlString(e),"string with a URL",e),truthy:e=>z(b.truthy(e),"truthy",e),falsy:e=>z(b.falsy(e),"falsy",e),nan:e=>z(b.nan(e),"NaN",e),primitive:e=>z(b.primitive(e),"primitive",e),integer:e=>z(b.integer(e),"integer",e),safeInteger:e=>z(b.safeInteger(e),"integer",e),plainObject:e=>z(b.plainObject(e),"plain object",e),typedArray:e=>z(b.typedArray(e),"TypedArray",e),arrayLike:e=>z(b.arrayLike(e),"array-like",e),domElement:e=>z(b.domElement(e),"HTMLElement",e),observable:e=>z(b.observable(e),"Observable",e),nodeStream:e=>z(b.nodeStream(e),"Node.js Stream",e),infinite:e=>z(b.infinite(e),"infinite number",e),emptyArray:e=>z(b.emptyArray(e),"empty array",e),nonEmptyArray:e=>z(b.nonEmptyArray(e),"non-empty array",e),emptyString:e=>z(b.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>z(b.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>z(b.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>z(b.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>z(b.emptyObject(e),"empty object",e),nonEmptyObject:e=>z(b.nonEmptyObject(e),"non-empty object",e),emptySet:e=>z(b.emptySet(e),"empty set",e),nonEmptySet:e=>z(b.nonEmptySet(e),"non-empty set",e),emptyMap:e=>z(b.emptyMap(e),"empty map",e),nonEmptyMap:e=>z(b.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>z(b.propertyKey(e),"PropertyKey",e),formData:e=>z(b.formData(e),"FormData",e),urlSearchParams:e=>z(b.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>z(b.evenInteger(e),"even integer",e),oddInteger:e=>z(b.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>z(b.directInstanceOf(e,t),"T",e),inRange:(e,t)=>z(b.inRange(e,t),"in range",e),any:(e,...t)=>z(b.any(e,...t),"predicate returns truthy for any value",t,{multipleValues:!0}),all:(e,...t)=>z(b.all(e,...t),"predicate returns truthy for all values",t,{multipleValues:!0})};Object.defineProperties(b,{class:{value:b.class_},function:{value:b.function_},null:{value:b.null_}});Object.defineProperties(L,{class:{value:L.class_},function:{value:L.function_},null:{value:L.null_}});var T=b,Zf=require("node:events"),ep=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},ki=class{static fn(e){return(...t)=>new ki((r,n,o)=>{t.push(o),e(...t).then(r,n)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((t,r)=>{this._reject=r;let n=s=>{(!this._isCanceled||!i.shouldReject)&&(this._isPending=!1,t(s))},o=s=>{this._isPending=!1,r(s)},i=s=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(s)};Object.defineProperties(i,{shouldReject:{get:()=>this._rejectOnCancel,set:s=>{this._rejectOnCancel=s}}}),e(n,o,i)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let t of this._cancelHandlers)t()}catch(t){this._reject(t);return}this._rejectOnCancel&&this._reject(new ep(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(ki.prototype,Promise.prototype);function tp(e){return T.object(e)&&"_onResponse"in e}var ge=class extends Error{constructor(e,t,r){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=t.code??"ERR_GOT_REQUEST_ERROR",this.input=t.input,tp(r)?(Object.defineProperty(this,"request",{enumerable:!1,value:r}),Object.defineProperty(this,"response",{enumerable:!1,value:r.response}),this.options=r.options):this.options=r,this.timings=this.request?.timings,T.string(t.stack)&&T.string(this.stack)){let n=this.stack.indexOf(this.message)+this.message.length,o=this.stack.slice(n).split(` -`).reverse(),i=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split(` -`).reverse();for(;i.length>0&&i[0]===o[0];)o.shift();this.stack=`${this.stack.slice(0,n)}${o.reverse().join(` -`)}${i.reverse().join(` -`)}`}}},rp=class extends ge{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},Hn=class extends ge{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},np=class extends ge{constructor(e,t){super(e.message,e,t),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},ia=class extends ge{constructor(e,t){super(e.message,e,t),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},op=class extends ge{constructor(e,t,r){super(e.message,e,r),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=t}},sa=class extends ge{constructor(e,t){super(e.message,e,t),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},ip=class extends ge{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},aa=class extends ge{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},jl=me(require("node:process"),1),Do=require("node:buffer"),sp=require("node:stream"),la=require("node:url"),Ho=me(require("node:http"),1),ap=require("events"),lp=require("util"),up=me(rf(),1),cp=e=>{if(e.timings)return e.timings;let t={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};e.timings=t;let r=s=>{s.once(ap.errorMonitor,()=>{t.error=Date.now(),t.phases.total=t.error-t.start})};r(e);let n=()=>{t.abort=Date.now(),t.phases.total=t.abort-t.start};e.prependOnceListener("abort",n);let o=s=>{if(t.socket=Date.now(),t.phases.wait=t.socket-t.start,lp.types.isProxy(s))return;let a=()=>{t.lookup=Date.now(),t.phases.dns=t.lookup-t.socket};s.prependOnceListener("lookup",a),(0,up.default)(s,{connect:()=>{t.connect=Date.now(),t.lookup===void 0&&(s.removeListener("lookup",a),t.lookup=t.connect,t.phases.dns=t.lookup-t.socket),t.phases.tcp=t.connect-t.lookup},secureConnect:()=>{t.secureConnect=Date.now(),t.phases.tls=t.secureConnect-t.connect}})};e.socket?o(e.socket):e.prependOnceListener("socket",o);let i=()=>{t.upload=Date.now(),t.phases.request=t.upload-(t.secureConnect??t.connect)};return e.writableFinished?i():e.prependOnceListener("finish",i),e.prependOnceListener("response",s=>{t.response=Date.now(),t.phases.firstByte=t.response-t.upload,s.timings=t,r(s),s.prependOnceListener("end",()=>{e.off("abort",n),s.off("aborted",n),!t.phases.total&&(t.end=Date.now(),t.phases.download=t.end-t.response,t.phases.total=t.end-t.start)}),s.prependOnceListener("aborted",n)}),t},hp=cp,dp=me(require("node:events"),1),gn=me(require("node:url"),1),fp=me(require("node:crypto"),1),Il=me(require("node:stream"),1),pp="text/plain",mp="us-ascii",Fo=(e,t)=>t.some(r=>r instanceof RegExp?r.test(e):r===e),yp=(e,{stripHash:t})=>{let r=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!r)throw new Error(`Invalid URL: ${e}`);let{type:n,data:o,hash:i}=r.groups,s=n.split(";");i=t?"":i;let a=!1;s[s.length-1]==="base64"&&(s.pop(),a=!0);let l=(s.shift()||"").toLowerCase(),u=[...s.map(d=>{let[h,c=""]=d.split("=").map(p=>p.trim());return h==="charset"&&(c=c.toLowerCase(),c===mp)?"":`${h}${c?`=${c}`:""}`}).filter(Boolean)];return a&&u.push("base64"),(u.length>0||l&&l!==pp)&&u.unshift(l),`data:${u.join(";")},${a?o.trim():o}${i?`#${i}`:""}`};function gp(e,t){if(t={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...t},e=e.trim(),/^data:/i.test(e))return yp(e,t);if(/^view-source:/i.test(e))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=e.startsWith("//");!r&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol));let n=new URL(e);if(t.forceHttp&&t.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(t.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),t.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),t.stripAuthentication&&(n.username="",n.password=""),t.stripHash?n.hash="":t.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname){let i=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,s=0,a="";for(;;){let u=i.exec(n.pathname);if(!u)break;let d=u[0],h=u.index,c=n.pathname.slice(s,h);a+=c.replace(/\/{2,}/g,"/"),a+=d,s=h+d.length}let l=n.pathname.slice(s,n.pathname.length);a+=l.replace(/\/{2,}/g,"/"),n.pathname=a}if(n.pathname)try{n.pathname=decodeURI(n.pathname)}catch{}if(t.removeDirectoryIndex===!0&&(t.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(t.removeDirectoryIndex)&&t.removeDirectoryIndex.length>0){let i=n.pathname.split("/"),s=i[i.length-1];Fo(s,t.removeDirectoryIndex)&&(i=i.slice(0,-1),n.pathname=i.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),t.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(t.removeQueryParameters))for(let i of[...n.searchParams.keys()])Fo(i,t.removeQueryParameters)&&n.searchParams.delete(i);if(!Array.isArray(t.keepQueryParameters)&&t.removeQueryParameters===!0&&(n.search=""),Array.isArray(t.keepQueryParameters)&&t.keepQueryParameters.length>0)for(let i of[...n.searchParams.keys()])Fo(i,t.keepQueryParameters)||n.searchParams.delete(i);if(t.sortQueryParameters){n.searchParams.sort();try{n.search=decodeURIComponent(n.search)}catch{}}t.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,"")),t.removeExplicitPort&&n.port&&(n.port="");let o=e;return e=n.toString(),!t.removeSingleSlash&&n.pathname==="/"&&!o.endsWith("/")&&n.hash===""&&(e=e.replace(/\/$/,"")),(t.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&t.removeSingleSlash&&(e=e.replace(/\/$/,"")),r&&!t.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),t.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var bp=me(ll(),1),Wo=me(of(),1),vp=require("node:stream");function hi(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[t.toLowerCase(),r]))}var ua=class extends vp.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:t,body:r,url:n}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof t!="object")throw new TypeError("Argument `headers` should be an object");if(!(r instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof n!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(r),this.push(null)}}),this.statusCode=e,this.headers=hi(t),this.body=r,this.url=n}},bn=me(af(),1),_p=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function wp(e,t){if(t._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let r=new Set([...Object.keys(e),..._p]),n={};for(let o of r)o in t||(n[o]={get(){let i=e[o];return typeof i=="function"?i.bind(e):i},set(i){e[o]=i},enumerable:!0,configurable:!1});return Object.defineProperties(t,n),e.once("aborted",()=>{t.destroy(),t.emit("aborted")}),e.once("close",()=>{e.complete&&t.readable?t.once("end",()=>{t.emit("close")}):t.emit("close")}),t}var Sp=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},xr=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},Ep=class{constructor(e,t){this.hooks=new Map,this.request=()=>(r,n)=>{let o;if(typeof r=="string")o=Vo(gn.default.parse(r)),r={};else if(r instanceof gn.default.URL)o=Vo(gn.default.parse(r.toString())),r={};else{let[h,...c]=(r.path??"").split("?"),p=c.length>0?`?${c.join("?")}`:"";o=Vo({...r,pathname:h,search:p})}r={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...r,...Rp(o)},r.headers=Object.fromEntries(Tp(r.headers).map(([h,c])=>[h.toLowerCase(),c]));let i=new dp.default,s=gp(gn.default.format(o),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),a=`${r.method}:${s}`;r.body&&r.method!==void 0&&["POST","PATCH","PUT"].includes(r.method)&&(r.body instanceof Il.default.Readable?r.cache=!1:a+=`:${fp.default.createHash("md5").update(r.body).digest("hex")}`);let l=!1,u=!1,d=h=>{u=!0;let c=!1,p=()=>{},m=new Promise(g=>{p=()=>{c||(c=!0,g())}}),O=async g=>{if(l){g.status=g.statusCode;let I=Wo.default.fromObject(l.cachePolicy).revalidatedPolicy(h,g);if(!I.modified){g.resume(),await new Promise(y=>{g.once("end",y)});let S=ca(I.policy.responseHeaders());g=new ua({statusCode:l.statusCode,headers:S,body:l.body,url:l.url}),g.cachePolicy=I.policy,g.fromCache=!0}}g.fromCache||(g.cachePolicy=new Wo.default(h,g,h),g.fromCache=!1);let M;h.cache&&g.cachePolicy.storable()?(M=Op(g),(async()=>{try{let I=bp.default.buffer(g);await Promise.race([m,new Promise(v=>g.once("end",v))]);let S=await I,y={url:g.url,statusCode:g.fromCache?l.statusCode:g.statusCode,body:S,cachePolicy:g.cachePolicy.toObject()},_=h.strictTtl?g.cachePolicy.timeToLive():void 0;if(h.maxTtl&&(_=_?Math.min(_,h.maxTtl):h.maxTtl),this.hooks.size>0)for(let v of this.hooks.keys())y=await this.runHook(v,y,g);await this.cache.set(a,y,_)}catch(I){i.emit("error",new xr(I))}})()):h.cache&&l&&(async()=>{try{await this.cache.delete(a)}catch(I){i.emit("error",new xr(I))}})(),i.emit("response",M??g),typeof n=="function"&&n(M??g)};try{let g=this.cacheRequest(h,O);g.once("error",p),g.once("abort",p),i.emit("request",g)}catch(g){i.emit("error",new Sp(g))}};return(async()=>{let h=async p=>{await Promise.resolve();let m=p.cache?await this.cache.get(a):void 0;if(typeof m>"u"&&!p.forceRefresh){d(p);return}let O=Wo.default.fromObject(m.cachePolicy);if(O.satisfiesWithoutRevalidation(p)&&!p.forceRefresh){let g=ca(O.responseHeaders()),M=new ua({statusCode:m.statusCode,headers:g,body:m.body,url:m.url});M.cachePolicy=O,M.fromCache=!0,i.emit("response",M),typeof n=="function"&&n(M)}else O.satisfiesWithoutRevalidation(p)&&Date.now()>=O.timeToLive()&&p.forceRefresh?(await this.cache.delete(a),p.headers=O.revalidationHeaders(p),d(p)):(l=m,p.headers=O.revalidationHeaders(p),d(p))},c=p=>i.emit("error",new xr(p));if(this.cache instanceof bn.default){let p=this.cache;p.once("error",c),i.on("error",()=>p.removeListener("error",c))}try{await h(r)}catch(p){r.automaticFailover&&!u&&d(r),i.emit("error",new xr(p))}})(),i},this.addHook=(r,n)=>{this.hooks.has(r)||this.hooks.set(r,n)},this.removeHook=r=>this.hooks.delete(r),this.getHook=r=>this.hooks.get(r),this.runHook=async(r,...n)=>this.hooks.get(r)?.(...n),t instanceof bn.default?this.cache=t:typeof t=="string"?this.cache=new bn.default({uri:t,namespace:"cacheable-request"}):this.cache=new bn.default({store:t,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},Tp=Object.entries,Op=e=>{let t=new Il.PassThrough({autoDestroy:!1});return wp(e,t),e.pipe(t)},Rp=e=>{let t={...e};return t.path=`${e.pathname||"/"}${e.search||""}`,delete t.pathname,delete t.search,t},Vo=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),ca=e=>{let t=[];for(let r of Object.keys(e))t[r.toLowerCase()]=e[r];return t},Pp=Ep,xp=me(uf(),1),kp=me(ll(),1),ha="abcdefghijklmnopqrstuvwxyz0123456789";function Ap(){let e=16,t="";for(;e--;)t+=ha[Math.random()*ha.length<<0];return t}var da=e=>String(e).replace(/\r|\n/g,(t,r,n)=>t==="\r"&&n[r+1]!==` -`||t===` -`&&n[r-1]!=="\r"?`\r -`:t),qp=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function fa(e){if(qp(e)!=="object")return!1;let t=Object.getPrototypeOf(e);return t==null?!0:(t.constructor&&t.constructor.toString())===Object.toString()}function pa(e,t){if(typeof t=="string"){for(let[r,n]of Object.entries(e))if(t.toLowerCase()===r.toLowerCase())return n}}var Cp=e=>new Proxy(e,{get:(t,r)=>pa(t,r),has:(t,r)=>pa(t,r)!==void 0}),It=e=>typeof e=="function",Ai=e=>Boolean(e&&It(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&It(e.append)&&It(e.getAll)&&It(e.entries)&&It(e[Symbol.iterator])),ma=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),Rt=e=>Boolean(e&&typeof e=="object"&&It(e.constructor)&&e[Symbol.toStringTag]==="File"&&It(e.stream)&&e.name!=null),vr=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},de=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},_r,vt,wr,vn,Sr,Pt,Er,Tr,_n,Go,ya,jp={enableAdditionalHeaders:!1},wn={writable:!1,configurable:!1},Ip=class{constructor(e,t,r){if(_r.add(this),vt.set(this,`\r -`),wr.set(this,void 0),vn.set(this,void 0),Sr.set(this,"-".repeat(2)),Pt.set(this,new TextEncoder),Er.set(this,void 0),Tr.set(this,void 0),_n.set(this,void 0),!Ai(e))throw new TypeError("Expected first argument to be a FormData instance.");let n;if(fa(t)?r=t:n=t,n||(n=Ap()),typeof n!="string")throw new TypeError("Expected boundary argument to be a string.");if(r&&!fa(r))throw new TypeError("Expected options argument to be an object.");vr(this,Tr,Array.from(e.entries()),"f"),vr(this,_n,{...jp,...r},"f"),vr(this,wr,de(this,Pt,"f").encode(de(this,vt,"f")),"f"),vr(this,vn,de(this,wr,"f").byteLength,"f"),this.boundary=`form-data-boundary-${n}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,vr(this,Er,de(this,Pt,"f").encode(`${de(this,Sr,"f")}${this.boundary}${de(this,Sr,"f")}${de(this,vt,"f").repeat(2)}`),"f");let o={"Content-Type":this.contentType},i=de(this,_r,"m",ya).call(this);i&&(this.contentLength=i,o["Content-Length"]=i),this.headers=Cp(Object.freeze(o)),Object.defineProperties(this,{boundary:wn,contentType:wn,contentLength:wn,headers:wn})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,t]of de(this,Tr,"f")){let r=Rt(t)?t:de(this,Pt,"f").encode(da(t));yield de(this,_r,"m",Go).call(this,e,r),yield r,yield de(this,wr,"f")}yield de(this,Er,"f")}async*encode(){for(let e of this.values())Rt(e)?yield*e.stream():yield e}[(vt=new WeakMap,wr=new WeakMap,vn=new WeakMap,Sr=new WeakMap,Pt=new WeakMap,Er=new WeakMap,Tr=new WeakMap,_n=new WeakMap,_r=new WeakSet,Go=function(e,t){let r="";r+=`${de(this,Sr,"f")}${this.boundary}${de(this,vt,"f")}`,r+=`Content-Disposition: form-data; name="${ma(e)}"`,Rt(t)&&(r+=`; filename="${ma(t.name)}"${de(this,vt,"f")}`,r+=`Content-Type: ${t.type||"application/octet-stream"}`);let n=Rt(t)?t.size:t.byteLength;return de(this,_n,"f").enableAdditionalHeaders===!0&&n!=null&&!isNaN(n)&&(r+=`${de(this,vt,"f")}Content-Length: ${Rt(t)?t.size:t.byteLength}`),de(this,Pt,"f").encode(`${r}${de(this,vt,"f").repeat(2)}`)},ya=function(){let e=0;for(let[t,r]of de(this,Tr,"f")){let n=Rt(r)?r:de(this,Pt,"f").encode(da(r)),o=Rt(n)?n.size:n.byteLength;if(o==null||isNaN(o))return;e+=de(this,_r,"m",Go).call(this,t,n).byteLength,e+=o,e+=de(this,vn,"f")}return String(e+de(this,Er,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},$p=require("node:buffer"),Mp=require("node:util");function $l(e){return T.nodeStream(e)&&T.function_(e.getBoundary)}async function Lp(e,t){if(t&&"content-length"in t)return Number(t["content-length"]);if(!e)return 0;if(T.string(e))return $p.Buffer.byteLength(e);if(T.buffer(e))return e.length;if($l(e))return(0,Mp.promisify)(e.getLength.bind(e))()}function Ml(e,t,r){let n={};for(let o of r){let i=(...s)=>{t.emit(o,...s)};n[o]=i,e.on(o,i)}return()=>{for(let[o,i]of Object.entries(n))e.off(o,i)}}var Np=me(require("node:net"),1);function Bp(){let e=[];return{once(t,r,n){t.once(r,n),e.push({origin:t,event:r,fn:n})},unhandleAll(){for(let t of e){let{origin:r,event:n,fn:o}=t;r.removeListener(n,o)}e.length=0}}}var ga=Symbol("reentry"),Up=()=>{},Ll=class extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function zp(e,t,r){if(ga in e)return Up;e[ga]=!0;let n=[],{once:o,unhandleAll:i}=Bp(),s=(O,g,M)=>{let I=setTimeout(g,O,O,M);I.unref?.();let S=()=>{clearTimeout(I)};return n.push(S),S},{host:a,hostname:l}=r,u=(O,g)=>{e.destroy(new Ll(O,g))},d=()=>{for(let O of n)O();i()};if(e.once("error",O=>{if(d(),e.listenerCount("error")===0)throw O}),typeof t.request<"u"){let O=s(t.request,u,"request");o(e,"response",g=>{o(g,"end",O)})}if(typeof t.socket<"u"){let{socket:O}=t,g=()=>{u(O,"socket")};e.setTimeout(O,g),n.push(()=>{e.removeListener("timeout",g)})}let h=typeof t.lookup<"u",c=typeof t.connect<"u",p=typeof t.secureConnect<"u",m=typeof t.send<"u";return(h||c||p||m)&&o(e,"socket",O=>{let{socketPath:g}=e;if(O.connecting){let M=Boolean(g??Np.default.isIP(l??a??"")!==0);if(h&&!M&&typeof O.address().address>"u"){let I=s(t.lookup,u,"lookup");o(O,"lookup",I)}if(c){let I=()=>s(t.connect,u,"connect");M?o(O,"connect",I()):o(O,"lookup",S=>{S===null&&o(O,"connect",I())})}p&&r.protocol==="https:"&&o(O,"connect",()=>{let I=s(t.secureConnect,u,"secureConnect");o(O,"secureConnect",I)})}if(m){let M=()=>s(t.send,u,"send");O.connecting?o(O,"connect",()=>{o(e,"upload-complete",M())}):o(e,"upload-complete",M())}}),typeof t.response<"u"&&o(e,"upload-complete",()=>{let O=s(t.response,u,"response");o(e,"response",O)}),typeof t.read<"u"&&o(e,"response",O=>{let g=s(t.read,u,"read");o(O,"end",g)}),d}function Dp(e){e=e;let t={protocol:e.protocol,hostname:T.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return T.string(e.port)&&e.port.length>0&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username||""}:${e.password||""}`),t}var Hp=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,t){typeof e=="object"?this.weakMap.set(e,t):this.map.set(e,t)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}},Fp=({attemptCount:e,retryOptions:t,error:r,retryAfter:n,computedValue:o})=>{if(r.name==="RetryError")return 1;if(e>t.limit)return 0;let i=t.methods.includes(r.options.method),s=t.errorCodes.includes(r.code),a=r.response&&t.statusCodes.includes(r.response.statusCode);if(!i||!s&&!a)return 0;if(r.response){if(n)return n>o?0:n;if(r.response.statusCode===413)return 0}let l=Math.random()*t.noise;return Math.min(2**(e-1)*1e3,t.backoffLimit)+l},Wp=Fp,Vp=me(require("node:process"),1),Jo=require("node:util"),$t=require("node:url"),Gp=require("node:tls"),Jp=me(require("node:http"),1),Kp=me(require("node:https"),1),or=require("node:dns"),Ko=require("node:util"),Qp=me(require("node:os"),1),{Resolver:ba}=or.promises,tr=Symbol("cacheableLookupCreateConnection"),Qo=Symbol("cacheableLookupInstance"),va=Symbol("expires"),Yp=typeof or.ALL=="number",_a=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},Xp=e=>{for(let t of e)t.family!==6&&(t.address=`::ffff:${t.address}`,t.family=6)},wa=()=>{let e=!1,t=!1;for(let r of Object.values(Qp.default.networkInterfaces()))for(let n of r)if(!n.internal&&(n.family==="IPv6"?t=!0:e=!0,e&&t))return{has4:e,has6:t};return{has4:e,has6:t}},Zp=e=>Symbol.iterator in e,Sn=e=>e.catch(t=>{if(t.code==="ENODATA"||t.code==="ENOTFOUND"||t.code==="ENOENT")return[];throw t}),Sa={ttl:!0},em={all:!0},tm={all:!0,family:4},rm={all:!0,family:6},nm=class{constructor({cache:e=new Map,maxTtl:t=1/0,fallbackDuration:r=3600,errorTtl:n=.15,resolver:o=new ba,lookup:i=or.lookup}={}){if(this.maxTtl=t,this.errorTtl=n,this._cache=e,this._resolver=o,this._dnsLookup=i&&(0,Ko.promisify)(i),this.stats={cache:0,query:0},this._resolver instanceof ba?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,Ko.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,Ko.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=wa(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=r,r>0){let s=setInterval(()=>{this._hostnamesToFallback.clear()},r*1e3);s.unref&&s.unref(),this._fallbackInterval=s}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,r){if(typeof t=="function"?(r=t,t={}):typeof t=="number"&&(t={family:t}),!r)throw new Error("Callback must be a function.");this.lookupAsync(e,t).then(n=>{t.all?r(null,n):r(null,n.address,n.family,n.expires,n.ttl,n.source)},r)}async lookupAsync(e,t={}){typeof t=="number"&&(t={family:t});let r=await this.query(e);if(t.family===6){let n=r.filter(o=>o.family===6);t.hints&or.V4MAPPED&&(Yp&&t.hints&or.ALL||n.length===0)?Xp(r):r=n}else t.family===4&&(r=r.filter(n=>n.family===4));if(t.hints&or.ADDRCONFIG){let{_iface:n}=this;r=r.filter(o=>o.family===6?n.has6:n.has4)}if(r.length===0){let n=new Error(`cacheableLookup ENOTFOUND ${e}`);throw n.code="ENOTFOUND",n.hostname=e,n}return t.all?r:r[0]}async query(e){let t="cache",r=await this._cache.get(e);if(r&&this.stats.cache++,!r){let n=this._pending[e];if(n)this.stats.cache++,r=await n;else{t="query";let o=this.queryAndCache(e);this._pending[e]=o,this.stats.query++;try{r=await o}finally{delete this._pending[e]}}}return r=r.map(n=>({...n,source:t})),r}async _resolve(e){let[t,r]=await Promise.all([Sn(this._resolve4(e,Sa)),Sn(this._resolve6(e,Sa))]),n=0,o=0,i=0,s=Date.now();for(let a of t)a.family=4,a.expires=s+a.ttl*1e3,n=Math.max(n,a.ttl);for(let a of r)a.family=6,a.expires=s+a.ttl*1e3,o=Math.max(o,a.ttl);return t.length>0?r.length>0?i=Math.min(n,o):i=n:i=o,{entries:[...t,...r],cacheTtl:i}}async _lookup(e){try{let[t,r]=await Promise.all([Sn(this._dnsLookup(e,tm)),Sn(this._dnsLookup(e,rm))]);return{entries:[...t,...r],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,t,r){if(this.maxTtl>0&&r>0){r=Math.min(r,this.maxTtl)*1e3,t[va]=Date.now()+r;try{await this._cache.set(e,t,r)}catch(n){this.lookupAsync=async()=>{let o=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw o.cause=n,o}}Zp(this._cache)&&this._tick(r)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,em);let t=await this._resolve(e);t.entries.length===0&&this._dnsLookup&&(t=await this._lookup(e),t.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let r=t.entries.length===0?this.errorTtl:t.cacheTtl;return await this._set(e,t.entries,r),t.entries}_tick(e){let t=this._nextRemovalTime;(!t||e{this._nextRemovalTime=!1;let r=1/0,n=Date.now();for(let[o,i]of this._cache){let s=i[va];n>=s?this._cache.delete(o):s("lookup"in t||(t.lookup=this.lookup),e[tr](t,r))}uninstall(e){if(_a(e),e[tr]){if(e[Qo]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[tr],delete e[tr],delete e[Qo]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=wa(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}},om=me(_f(),1);function im(e){let t=[],r=e.split(",");for(let n of r){let[o,...i]=n.split(";"),s=o.trim();if(s[0]!=="<"||s[s.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${s}`);let a=s.slice(1,-1),l={};if(i.length===0)throw new Error(`Unexpected end of Link header parameters: ${i.join(";")}`);for(let u of i){let d=u.trim(),h=d.indexOf("=");if(h===-1)throw new Error(`Failed to parse Link header: ${e}`);let c=d.slice(0,h).trim(),p=d.slice(h+1).trim();l[c]=p}t.push({reference:a,parameters:l})}return t}var[Ea,sm]=Vp.default.versions.node.split(".").map(Number);function am(e){for(let t in e){let r=e[t];L.any([T.string,T.number,T.boolean,T.null_,T.undefined],r)}}var lm=new Map,Yo,um=()=>Yo||(Yo=new nm,Yo),cm={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:e})=>e,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(e){return e.request.options.responseType==="json"?e.body:JSON.parse(e.body)},paginate({response:e}){let t=e.headers.link;if(typeof t!="string"||t.trim()==="")return!1;let r=im(t).find(n=>n.parameters.rel==="next"||n.parameters.rel==='"next"');return r?{url:new $t.URL(r.reference,e.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},hm=e=>{let{hooks:t,retry:r}=e,n={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...r,errorCodes:[...r.errorCodes],methods:[...r.methods],statusCodes:[...r.statusCodes]},timeout:{...e.timeout},hooks:{init:[...t.init],beforeRequest:[...t.beforeRequest],beforeError:[...t.beforeError],beforeRedirect:[...t.beforeRedirect],beforeRetry:[...t.beforeRetry],afterResponse:[...t.afterResponse]},searchParams:e.searchParams?new $t.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return n.url!==void 0&&(n.prefixUrl=""),n},dm=e=>{let{hooks:t,retry:r}=e,n={...e};return T.object(e.context)&&(n.context={...e.context}),T.object(e.cacheOptions)&&(n.cacheOptions={...e.cacheOptions}),T.object(e.https)&&(n.https={...e.https}),T.object(e.cacheOptions)&&(n.cacheOptions={...n.cacheOptions}),T.object(e.agent)&&(n.agent={...e.agent}),T.object(e.headers)&&(n.headers={...e.headers}),T.object(r)&&(n.retry={...r},T.array(r.errorCodes)&&(n.retry.errorCodes=[...r.errorCodes]),T.array(r.methods)&&(n.retry.methods=[...r.methods]),T.array(r.statusCodes)&&(n.retry.statusCodes=[...r.statusCodes])),T.object(e.timeout)&&(n.timeout={...e.timeout}),T.object(t)&&(n.hooks={...t},T.array(t.init)&&(n.hooks.init=[...t.init]),T.array(t.beforeRequest)&&(n.hooks.beforeRequest=[...t.beforeRequest]),T.array(t.beforeError)&&(n.hooks.beforeError=[...t.beforeError]),T.array(t.beforeRedirect)&&(n.hooks.beforeRedirect=[...t.beforeRedirect]),T.array(t.beforeRetry)&&(n.hooks.beforeRetry=[...t.beforeRetry]),T.array(t.afterResponse)&&(n.hooks.afterResponse=[...t.afterResponse])),T.object(e.pagination)&&(n.pagination={...e.pagination}),n},fm=e=>{let t=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(r=>typeof r=="number");if(t.length>0)return Math.min(...t)},Ta=(e,t,r)=>{let n=e.hooks?.init;if(n)for(let o of n)o(t,r)},ht=class{constructor(e,t,r){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),L.any([T.string,T.urlInstance,T.object,T.undefined],e),L.any([T.object,T.undefined],t),L.any([T.object,T.undefined],r),e instanceof ht||t instanceof ht)throw new TypeError("The defaults must be passed as the third argument");this._internals=hm(r?._internals??r??cm),this._init=[...r?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if(T.plainObject(e))try{this.merge(e),this.merge(t)}finally{this.url=e.url}else try{this.merge(t)}finally{if(t?.url!==void 0)if(e===void 0)this.url=t.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(n){throw n.options=this,n}}merge(e){if(e){if(e instanceof ht){for(let t of e._init)this.merge(t);return}e=dm(e),Ta(this,e,this),Ta(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let t=!1;for(let r in e)if(!(r==="mutableDefaults"||r==="handlers")&&r!=="url"){if(!(r in this))throw new Error(`Unexpected option: ${r}`);this[r]=e[r],t=!0}t&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){L.any([T.function_,T.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){L.plainObject(e);for(let t in e){if(!(t in this._internals.agent))throw new TypeError(`Unexpected agent option: ${t}`);L.any([T.object,T.undefined],e[t])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){L.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){L.plainObject(e);for(let t in e){if(!(t in this._internals.timeout))throw new Error(`Unexpected timeout option: ${t}`);L.any([T.number,T.undefined],e[t])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if(L.any([T.string,T.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:t}=this._internals.url;this._internals.url.href=e+t.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){L.any([T.string,T.buffer,T.nodeStream,T.generator,T.asyncGenerator,Ai,T.undefined],e),T.nodeStream(e)&&L.truthy(e.readable),e!==void 0&&(L.undefined(this._internals.form),L.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){L.any([T.plainObject,T.undefined],e),e!==void 0&&(L.undefined(this._internals.body),L.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(L.undefined(this._internals.body),L.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(L.any([T.string,T.urlInstance,T.undefined],e),e===void 0){this._internals.url=void 0;return}if(T.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let t=`${this.prefixUrl}${e.toString()}`,r=new $t.URL(t);if(this._internals.url=r,decodeURI(t),r.protocol==="unix:"&&(r.href=`http://unix${r.pathname}${r.search}`),r.protocol!=="http:"&&r.protocol!=="https:"){let n=new Error(`Unsupported protocol: ${r.protocol}`);throw n.code="ERR_UNSUPPORTED_PROTOCOL",n}if(this._internals.username&&(r.username=this._internals.username,this._internals.username=""),this._internals.password&&(r.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(r.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),r.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let n=/(?.+?):(?.+)/.exec(`${r.pathname}${r.search}`);if(n?.groups){let{socketPath:o,path:i}=n.groups;this._unixOptions={socketPath:o,path:i,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(L.any([T.object,T.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:t,getCookieString:r}=e;L.function_(t),L.function_(r),t.length===4&&r.length===0?(t=(0,Jo.promisify)(t.bind(e)),r=(0,Jo.promisify)(r.bind(e)),this._internals.cookieJar={setCookie:t,getCookieString:r}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){L.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){L.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new $t.URLSearchParams),this._internals.searchParams)}set searchParams(e){L.any([T.string,T.object,T.undefined],e);let t=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,t&&(t.search="");return}let r=this.searchParams,n;if(T.string(e))n=new $t.URLSearchParams(e);else if(e instanceof $t.URLSearchParams)n=e;else{am(e),n=new $t.URLSearchParams;for(let o in e){let i=e[o];i===null?n.append(o,""):i===void 0?r.delete(o):n.append(o,i)}}if(this._merging){for(let o of n.keys())r.delete(o);for(let[o,i]of n)r.append(o,i)}else t?t.search=r.toString():this._internals.searchParams=r}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){L.any([T.function_,T.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){L.any([T.object,T.boolean,T.undefined],e),e===!0?this._internals.dnsCache=um():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){L.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){L.object(e);for(let t in e){if(!(t in this._internals.hooks))throw new Error(`Unexpected hook event: ${t}`);let r=t,n=e[r];if(L.any([T.array,T.undefined],n),n)for(let o of n)L.function_(o);if(this._merging)n&&this._internals.hooks[r].push(...n);else{if(!n)throw new Error(`Missing hook event: ${t}`);this._internals.hooks[t]=[...n]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){L.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){L.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){L.any([T.object,T.string,T.boolean,T.undefined],e),e===!0?this._internals.cache=lm:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){L.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,t=e?e.username:this._internals.username;return decodeURIComponent(t)}set username(e){L.string(e);let t=this._internals.url,r=encodeURIComponent(e);t?t.username=r:this._internals.username=r}get password(){let e=this._internals.url,t=e?e.password:this._internals.password;return decodeURIComponent(t)}set password(e){L.string(e);let t=this._internals.url,r=encodeURIComponent(e);t?t.password=r:this._internals.password=r}get http2(){return this._internals.http2}set http2(e){L.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){L.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){L.plainObject(e),this._merging?Object.assign(this._internals.headers,hi(e)):this._internals.headers=hi(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){L.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){L.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){L.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(L.plainObject(e),L.any([T.function_,T.undefined],e.calculateDelay),L.any([T.number,T.undefined],e.maxRetryAfter),L.any([T.number,T.undefined],e.limit),L.any([T.array,T.undefined],e.methods),L.any([T.array,T.undefined],e.statusCodes),L.any([T.array,T.undefined],e.errorCodes),L.any([T.number,T.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let r in e)if(!(r in this._internals.retry))throw new Error(`Unexpected retry option: ${r}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:t}=this._internals;t.methods=[...new Set(t.methods.map(r=>r.toUpperCase()))],t.statusCodes=[...new Set(t.statusCodes)],t.errorCodes=[...new Set(t.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){L.any([T.string,T.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){L.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){L.any([T.function_,T.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){L.plainObject(e),L.any([T.boolean,T.undefined],e.shared),L.any([T.number,T.undefined],e.cacheHeuristic),L.any([T.number,T.undefined],e.immutableMinTimeToLive),L.any([T.boolean,T.undefined],e.ignoreCargoCult);for(let t in e)if(!(t in this._internals.cacheOptions))throw new Error(`Cache option \`${t}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){L.plainObject(e),L.any([T.boolean,T.undefined],e.rejectUnauthorized),L.any([T.function_,T.undefined],e.checkServerIdentity),L.any([T.string,T.object,T.array,T.undefined],e.certificateAuthority),L.any([T.string,T.object,T.array,T.undefined],e.key),L.any([T.string,T.object,T.array,T.undefined],e.certificate),L.any([T.string,T.undefined],e.passphrase),L.any([T.string,T.buffer,T.array,T.undefined],e.pfx),L.any([T.array,T.undefined],e.alpnProtocols),L.any([T.string,T.undefined],e.ciphers),L.any([T.string,T.buffer,T.undefined],e.dhparam),L.any([T.string,T.undefined],e.signatureAlgorithms),L.any([T.string,T.undefined],e.minVersion),L.any([T.string,T.undefined],e.maxVersion),L.any([T.boolean,T.undefined],e.honorCipherOrder),L.any([T.number,T.undefined],e.tlsSessionLifetime),L.any([T.string,T.undefined],e.ecdhCurve),L.any([T.string,T.buffer,T.array,T.undefined],e.certificateRevocationLists);for(let t in e)if(!(t in this._internals.https))throw new Error(`HTTPS option \`${t}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");L.any([T.string,T.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){L.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){L.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){L.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){L.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){L.any([T.number,T.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){L.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,t){return(0,Jo.inspect)(this._internals,t)}createNativeRequestOptions(){let e=this._internals,t=e.url,r;t.protocol==="https:"?r=e.http2?e.agent:e.agent.https:r=e.agent.http;let{https:n}=e,{pfx:o}=n;return T.array(o)&&T.plainObject(o[0])&&(o=o.map(i=>({buf:i.buffer,passphrase:i.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:n.alpnProtocols,ca:n.certificateAuthority,cert:n.certificate,key:n.key,passphrase:n.passphrase,pfx:n.pfx,rejectUnauthorized:n.rejectUnauthorized,checkServerIdentity:n.checkServerIdentity??Gp.checkServerIdentity,ciphers:n.ciphers,honorCipherOrder:n.honorCipherOrder,minVersion:n.minVersion,maxVersion:n.maxVersion,sigalgs:n.signatureAlgorithms,sessionTimeout:n.tlsSessionLifetime,dhparam:n.dhparam,ecdhCurve:n.ecdhCurve,crl:n.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:r,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?fm(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:t}=this._internals;return!t&&e?this.getFallbackRequestFunction():t}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(Ea<15||Ea===15&&sm<10){let t=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw t.code="EUNSUPPORTED",t}return om.default.auto}return Kp.default.request}return Jp.default.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}},Fn=e=>{let{statusCode:t}=e,r=e.request.options.followRedirect?299:399;return t>=200&&t<=r||t===304},Oa=class extends ge{constructor(e,t){let{options:r}=t.request;super(`${e.message} in "${r.url.toString()}"`,e,t.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Ra=(e,t,r,n)=>{let{rawBody:o}=e;try{if(t==="text")return o.toString(n);if(t==="json")return o.length===0?"":r(o.toString(n));if(t==="buffer")return o}catch(i){throw new Oa(i,e)}throw new Oa({message:`Unknown body type '${t}'`,name:"Error"},e)};function pm(e){return e.writable&&!e.writableEnded}var mm=pm;function Pa(e){return e.protocol==="unix:"||e.hostname==="unix"}var ym=T.string(jl.default.versions.brotli),gm=new Set(["GET","HEAD"]),Xo=new Hp,bm=new Set([300,301,302,303,304,307,308]),vm=["socket","connect","continue","information","upgrade"],Zo=()=>{},qi=class extends sp.Duplex{constructor(e,t,r){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=Zo,this._triggerRead=!1,this._cancelTimeouts=Zo,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=Zo,this.on("pipe",o=>{o.headers&&Object.assign(this.options.headers,o.headers)}),this.on("newListener",o=>{if(o==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new ht(e,t,r),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(o){let{options:i}=o;i&&(this.options=i),this.flush=async()=>{this.flush=async()=>{},this.destroy(o)};return}this.options.signal?.aborted&&this.destroy(new aa(this)),this.options.signal?.addEventListener("abort",()=>{this.destroy(new aa(this))});let{body:n}=this.options;T.nodeStream(n)&&n.once("error",o=>{this._flushed?this._beforeError(new ia(o,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new ia(o,this))}})}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:t,options:r}=this,n=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof ge||(e=new ge(e.message,e,this));let o=e;(async()=>{if(t?.readable&&!t.rawBody&&!this._request?.socket?.destroyed&&(t.setEncoding(this.readableEncoding),await this._setRawBody(t)&&(t.body=t.rawBody.toString())),this.listenerCount("retry")!==0){let i;try{let s;t&&"retry-after"in t.headers&&(s=Number(t.headers["retry-after"]),Number.isNaN(s)?(s=Date.parse(t.headers["retry-after"])-Date.now(),s<=0&&(s=1)):s*=1e3);let a=r.retry;i=await a.calculateDelay({attemptCount:n,retryOptions:a,error:o,retryAfter:s,computedValue:Wp({attemptCount:n,retryOptions:a,error:o,retryAfter:s,computedValue:a.maxRetryAfter??r.timeout.request??Number.POSITIVE_INFINITY})})}catch(s){this._error(new ge(s.message,s,this));return}if(i){if(await new Promise(s=>{let a=setTimeout(s,i);this._stopRetry=()=>{clearTimeout(a),s()}}),this.destroyed)return;try{for(let s of this.options.hooks.beforeRetry)await s(o,this.retryCount+1)}catch(s){this._error(new ge(s.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,s=>{let a=new qi(r.url,s,r);return a.retryCount=this.retryCount+1,jl.default.nextTick(()=>{a.flush()}),a});return}}this._error(o)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let t;for(;(t=e.read())!==null;){this._downloadedSize+=t.length;let r=this.downloadProgress;r.percent<1&&this.emit("downloadProgress",r),this.push(t)}}}_write(e,t,r){let n=()=>{this._writeRequest(e,t,r)};this._requestInitialized?n():this._jobs.push(n)}_final(e){let t=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(r=>{this._request._writableState?.errored||(r||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(r))})};this._requestInitialized?t():this._jobs.push(t)}_destroy(e,t){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this.options){let{body:r}=this.options;T.nodeStream(r)&&r.destroy()}this._request&&this._request.destroy(),e!==null&&!T.undefined(e)&&!(e instanceof ge)&&(e=new ge(e.message,e,this)),t(e)}pipe(e,t){return e instanceof Ho.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,t)}unpipe(e){return e instanceof Ho.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:t}=e,r=!T.undefined(e.form),n=!T.undefined(e.json),o=!T.undefined(e.body),i=gm.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=i,r||n||o){if(i)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let s=!T.string(t["content-type"]);if(o){if(Ai(e.body)){let l=new Ip(e.body);s&&(t["content-type"]=l.headers["Content-Type"]),"Content-Length"in l.headers&&(t["content-length"]=l.headers["Content-Length"]),e.body=l.encode()}$l(e.body)&&s&&(t["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(r){s&&(t["content-type"]="application/x-www-form-urlencoded");let{form:l}=e;e.form=void 0,e.body=new la.URLSearchParams(l).toString()}else{s&&(t["content-type"]="application/json");let{json:l}=e;e.json=void 0,e.body=e.stringifyJson(l)}let a=await Lp(e.body,e.headers);T.undefined(t["content-length"])&&T.undefined(t["transfer-encoding"])&&!i&&!T.undefined(a)&&(t["content-length"]=String(a))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(t["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:t}=this,{url:r}=t;this._nativeResponse=e,t.decompress&&(e=(0,xp.default)(e));let n=e.statusCode,o=e;o.statusMessage=o.statusMessage?o.statusMessage:Ho.default.STATUS_CODES[n],o.url=t.url.toString(),o.requestUrl=this.requestUrl,o.redirectUrls=this.redirectUrls,o.request=this,o.isFromCache=this._nativeResponse.fromCache??!1,o.ip=this.ip,o.retryCount=this.retryCount,o.ok=Fn(o),this._isFromCache=o.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=o,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",s=>{this._aborted=!0,e.destroy(),this._beforeError(new sa(s,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new sa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let i=e.headers["set-cookie"];if(T.object(t.cookieJar)&&i){let s=i.map(async a=>t.cookieJar.setCookie(a,r.toString()));t.ignoreInvalidCookies&&(s=s.map(async a=>{try{await a}catch{}}));try{await Promise.all(s)}catch(a){this._beforeError(a);return}}if(!this.isAborted){if(t.followRedirect&&e.headers.location&&bm.has(n)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=t.maxRedirects){this._beforeError(new rp(this));return}this._request=void 0;let s=new ht(void 0,void 0,this.options),a=n===303&&s.method!=="GET"&&s.method!=="HEAD",l=n!==307&&n!==308,u=s.methodRewriting&&l;(a||u)&&(s.method="GET",s.body=void 0,s.json=void 0,s.form=void 0,delete s.headers["content-length"]);try{let d=Do.Buffer.from(e.headers.location,"binary").toString(),h=new la.URL(d,r);if(!Pa(r)&&Pa(h)){this._beforeError(new ge("Cannot redirect to UNIX socket",{},this));return}h.hostname!==r.hostname||h.port!==r.port?("host"in s.headers&&delete s.headers.host,"cookie"in s.headers&&delete s.headers.cookie,"authorization"in s.headers&&delete s.headers.authorization,(s.username||s.password)&&(s.username="",s.password="")):(h.username=s.username,h.password=s.password),this.redirectUrls.push(h),s.prefixUrl="",s.url=h;for(let c of s.hooks.beforeRedirect)await c(s,o);this.emit("redirect",s,o),this.options=s,await this._makeRequest()}catch(d){this._beforeError(d);return}return}if(t.isStream&&t.throwHttpErrors&&!Fn(o)){this._beforeError(new Hn(o));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let s of this._pipedServerResponses)if(!s.headersSent){for(let a in e.headers){let l=t.decompress?a!=="content-encoding":!0,u=e.headers[a];l&&s.setHeader(a,u)}s.statusCode=n}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let t=await(0,kp.buffer)(e);if(!this.isAborted)return this.response.rawBody=t,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(t){this._beforeError(t)}}_onRequest(e){let{options:t}=this,{timeout:r,url:n}=t;hp(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=zp(e,r,n);let o=t.cache?"cacheableResponse":"response";e.once(o,i=>{this._onResponse(i)}),e.once("error",i=>{this._aborted=!0,e.destroy(),i=i instanceof Ll?new op(i,this.timings,this):new ge(i.message,i,this),this._beforeError(i)}),this._unproxyEvents=Ml(e,this,vm),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((t,r)=>{super.write(e,n=>{if(n){r(n);return}t()})})}_sendBody(){let{body:e}=this.options,t=this.redirectUrls.length===0?this:this._request??this;T.nodeStream(e)?e.pipe(t):T.generator(e)||T.asyncGenerator(e)?(async()=>{try{for await(let r of e)await this._asyncWrite(r);super.end()}catch(r){this._beforeError(r)}})():T.undefined(e)?(this._cannotHaveBody||this._noPipe)&&t.end():(this._writeRequest(e,void 0,()=>{}),t.end())}_prepareCache(e){if(!Xo.has(e)){let t=new Pp((r,n)=>{let o=r._request(r,n);return T.promise(o)&&(o.once=(i,s)=>{if(i==="error")(async()=>{try{await o}catch(a){s(a)}})();else if(i==="abort")(async()=>{try{(await o).once("abort",s)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${i}`);return o}),o},e);Xo.set(e,t.request())}}async _createCacheableRequest(e,t){return new Promise((r,n)=>{Object.assign(t,Dp(e));let o,i=Xo.get(t.cache)(t,async s=>{if(s._readableState.autoDestroy=!1,o){let a=()=>{s.req&&(s.complete=s.req.res.complete)};s.prependOnceListener("end",a),a(),(await o).emit("cacheableResponse",s)}r(s)});i.once("error",n),i.once("request",async s=>{o=s,r(o)})})}async _makeRequest(){let{options:e}=this,{headers:t,username:r,password:n}=e,o=e.cookieJar;for(let l in t)if(T.undefined(t[l]))delete t[l];else if(T.null_(t[l]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${l}\` header`);if(e.decompress&&T.undefined(t["accept-encoding"])&&(t["accept-encoding"]=ym?"gzip, deflate, br":"gzip, deflate"),r||n){let l=Do.Buffer.from(`${r}:${n}`).toString("base64");t.authorization=`Basic ${l}`}if(o){let l=await o.getCookieString(e.url.toString());T.nonEmptyString(l)&&(t.cookie=l)}e.prefixUrl="";let i;for(let l of e.hooks.beforeRequest){let u=await l(e);if(!T.undefined(u)){i=()=>u;break}}i||(i=e.getRequestFunction());let s=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=i,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let a=e.cache?this._createCacheableRequest:i;try{let l=a(s,this._requestOptions);T.promise(l)&&(l=await l),T.undefined(l)&&(l=e.getFallbackRequestFunction()(s,this._requestOptions),T.promise(l)&&(l=await l)),mm(l)?this._onRequest(l):this.writable?(this.once("finish",()=>{this._onResponse(l)}),this._sendBody()):this._onResponse(l)}catch(l){throw l instanceof xr?new np(l,this):l}}async _error(e){try{if(!(e instanceof Hn&&!this.options.throwHttpErrors))for(let t of this.options.hooks.beforeError)e=await t(e)}catch(t){e=new ge(t.message,t,this)}this.destroy(e)}_writeRequest(e,t,r){!this._request||this._request.destroyed||this._request.write(e,t,n=>{if(!n&&!this._request.destroyed){this._uploadedSize+=Do.Buffer.byteLength(e,t);let o=this.uploadProgress;o.percent<1&&this.emit("uploadProgress",o)}r(n)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}},_m=class extends ge{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},wm=["request","response","redirect","uploadProgress","downloadProgress"];function xa(e){let t,r,n,o=new Zf.EventEmitter,i=new ki((a,l,u)=>{u(()=>{t.destroy()}),u.shouldReject=!1,u(()=>{l(new _m(t))});let d=h=>{u(()=>{});let c=e??new qi(void 0,void 0,n);c.retryCount=h,c._noPipe=!0,t=c,c.once("response",async O=>{let g=(O.headers["content-encoding"]??"").toLowerCase(),M=g==="gzip"||g==="deflate"||g==="br",{options:I}=c;if(M&&!I.decompress)O.body=O.rawBody;else try{O.body=Ra(O,I.responseType,I.parseJson,I.encoding)}catch(S){if(O.body=O.rawBody.toString(),Fn(O)){c._beforeError(S);return}}try{let S=I.hooks.afterResponse;for(let[y,_]of S.entries())if(O=await _(O,async v=>{throw I.merge(v),I.prefixUrl="",v.url&&(I.url=v.url),I.hooks.afterResponse=I.hooks.afterResponse.slice(0,y),new ip(c)}),!(T.object(O)&&T.number(O.statusCode)&&!T.nullOrUndefined(O.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(S){c._beforeError(S);return}if(r=O,!Fn(O)){c._beforeError(new Hn(O));return}c.destroy(),a(c.options.resolveBodyOnly?O.body:O)});let p=O=>{if(i.isCanceled)return;let{options:g}=c;if(O instanceof Hn&&!g.throwHttpErrors){let{response:M}=O;c.destroy(),a(c.options.resolveBodyOnly?M.body:M);return}l(O)};c.once("error",p);let m=c.options?.body;c.once("retry",(O,g)=>{e=void 0;let M=c.options.body;if(m===M&&T.nodeStream(M)){g.message="Cannot retry with consumed body stream",p(g);return}n=c.options,d(O)}),Ml(c,o,wm),T.undefined(e)&&c.flush()};d(0)});i.on=(a,l)=>(o.on(a,l),i),i.off=(a,l)=>(o.off(a,l),i);let s=a=>{let l=(async()=>{await i;let{options:u}=r.request;return Ra(r,a,u.parseJson,u.encoding)})();return Object.defineProperties(l,Object.getOwnPropertyDescriptors(i)),l};return i.json=()=>{if(t.options){let{headers:a}=t.options;!t.writableFinished&&!("accept"in a)&&(a.accept="application/json")}return s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}var Sm=async e=>new Promise(t=>{setTimeout(t,e)}),Em=e=>T.function_(e),Tm=["get","post","put","patch","head","delete"],Nl=e=>{e={options:new ht(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let t=(n,o,i=e.options)=>{let s=new qi(n,o,i),a,l=h=>(s.options=h,s._noPipe=!h.isStream,s.flush(),h.isStream?s:(a||(a=xa(s)),a)),u=0,d=h=>{let c=(e.handlers[u++]??l)(h,d);if(T.promise(c)&&!s.options.isStream&&(a||(a=xa(s)),c!==a)){let p=Object.getOwnPropertyDescriptors(a);for(let m in p)m in c&&delete p[m];Object.defineProperties(c,p),c.cancel=a.cancel}return c};return d(s.options)};t.extend=(...n)=>{let o=new ht(void 0,void 0,e.options),i=[...e.handlers],s;for(let a of n)Em(a)?(o.merge(a.defaults.options),i.push(...a.defaults.handlers),s=a.defaults.mutableDefaults):(o.merge(a),a.handlers&&i.push(...a.handlers),s=a.mutableDefaults);return Nl({options:o,handlers:i,mutableDefaults:Boolean(s)})};let r=async function*(n,o){let i=new ht(n,o,e.options);i.resolveBodyOnly=!1;let{pagination:s}=i;L.function_(s.transform),L.function_(s.shouldContinue),L.function_(s.filter),L.function_(s.paginate),L.number(s.countLimit),L.number(s.requestLimit),L.number(s.backoff);let a=[],{countLimit:l}=s,u=0;for(;u{let i=[];for await(let s of r(n,o))i.push(s);return i},t.paginate.each=r,t.stream=(n,o)=>t(n,{...o,isStream:!0});for(let n of Tm)t[n]=(o,i)=>t(o,{...i,method:n}),t.stream[n]=(o,i)=>t(o,{...i,method:n,isStream:!0});return e.mutableDefaults||(Object.freeze(e.handlers),e.options.freeze()),Object.defineProperty(t,"defaults",{value:e,writable:!1,configurable:!1,enumerable:!0}),t},Om=Nl,Rm={options:new ht,handlers:[],mutableDefaults:!1},Pm=Om(Rm),De=Pm,Mn="https://www.googleapis.com",xm=`${Mn}/oauth2/v4/token`,Ci={extId:"No extension ID provided, e.g. https://chrome.google.com/webstore/detail/EXT_ID",clientId:"No client ID provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",clientSecret:"No client secret provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",refreshToken:"No refresh token provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md"},km=Object.keys(Ci),Am=class{options={};constructor(e){for(let t of km){if(!e[t])throw new Error(Ci[t]);this.options[t]=e[t]}}get uploadEndpoint(){return`${Mn}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${Mn}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${Mn}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:t="default"}){let r=await this.getAccessToken(),{uploadState:n,itemError:o}=await this.upload({readStream:(0,Uf.createReadStream)(e)},r);if(n==="FAILURE"||n==="NOT_FOUND")throw new Error(o.map(({error_detail:i})=>i).join(` -`));return this.publish({target:t},r)}async upload({readStream:e=null},t=""){if(!e)throw new Error("Read stream missing");let r=t||await this.getAccessToken();return De.put(this.uploadEndpoint,{headers:this.getHeaders(r),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},t=""){let r=t||await this.getAccessToken();return De.post(this.getPublishEndpoint(e),{headers:this.getHeaders(r)}).json()}async get({projection:e="DRAFT"},t=""){let r=t||await this.getAccessToken();return De.get(this.getInfoEndpoint(e),{headers:this.getHeaders(r)}).json()}async getAccessToken(){return(await De.post(xm,{json:{client_id:this.options.clientId,refresh_token:this.options.refreshToken,grant_type:"refresh_token",client_secret:this.options.clientSecret}}).json()).access_token}getHeaders(e){return{Authorization:`Bearer ${e}`,"x-goog-api-version":"2"}}},qm=require("module"),Cm=(0,qm.createRequire)("/"),jm;try{jm=Cm("worker_threads").Worker}catch{}var je=Uint8Array,Dt=Uint16Array,Bl=Uint32Array,Ul=new je([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,0,0,0]),zl=new je([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,0,0]),Im=new je([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dl=function(e,t){for(var r=new Dt(31),n=0;n<31;++n)r[n]=t+=1<>>1|(ae&21845)<<1,ct=(ct&52428)>>>2|(ct&13107)<<2,ct=(ct&61680)>>>4|(ct&3855)<<4,di[ae]=((ct&65280)>>>8|(ct&255)<<8)>>>1;var ct,ae,qr=function(e,t,r){for(var n=e.length,o=0,i=new Dt(t);o>>l]=u}else for(a=new Dt(n),o=0;o>>15-e[o]);return a},Dr=new je(288);for(ae=0;ae<144;++ae)Dr[ae]=8;var ae;for(ae=144;ae<256;++ae)Dr[ae]=9;var ae;for(ae=256;ae<280;++ae)Dr[ae]=7;var ae;for(ae=280;ae<288;++ae)Dr[ae]=8;var ae,Vl=new je(32);for(ae=0;ae<32;++ae)Vl[ae]=5;var ae,Lm=qr(Dr,9,1),Nm=qr(Vl,5,1),ei=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},Ge=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},ti=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Bm=function(e){return(e+7)/8|0},ji=function(e,t,r){(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length);var n=new(e.BYTES_PER_ELEMENT==2?Dt:e.BYTES_PER_ELEMENT==4?Bl:je)(r-t);return n.set(e.subarray(t,r)),n},Um=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Je=function(e,t,r){var n=new Error(t||Um[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,Je),!r)throw n;return n},zm=function(e,t,r){var n=e.length;if(!n||r&&r.f&&!r.l)return t||new je(0);var o=!t||r,i=!r||r.i;r||(r={}),t||(t=new je(n*3));var s=function($e){var qe=t.length;if($e>qe){var Xe=new je(Math.max(qe*2,$e));Xe.set(t),t=Xe}},a=r.f||0,l=r.p||0,u=r.b||0,d=r.l,h=r.d,c=r.m,p=r.n,m=n*8;do{if(!d){a=Ge(e,l,1);var O=Ge(e,l+1,3);if(l+=3,O)if(O==1)d=Lm,h=Nm,c=9,p=5;else if(O==2){var g=Ge(e,l,31)+257,M=Ge(e,l+10,15)+4,I=g+Ge(e,l+5,31)+1;l+=14;for(var S=new je(I),y=new je(19),_=0;_>>4;if(q<16)S[_++]=q;else{var N=0,J=0;for(q==16?(J=3+Ge(e,l,3),l+=2,N=S[_-1]):q==17?(J=3+Ge(e,l,7),l+=3):q==18&&(J=11+Ge(e,l,127),l+=7);J--;)S[_++]=N}}var j=S.subarray(0,g),w=S.subarray(g);c=ei(j),p=ei(w),d=qr(j,c,1),h=qr(w,p,1)}else Je(1);else{var q=Bm(l)+4,C=e[q-4]|e[q-3]<<8,U=q+C;if(U>n){i&&Je(0);break}o&&s(u+C),t.set(e.subarray(q,U),u),r.b=u+=C,r.p=l=U*8,r.f=a;continue}if(l>m){i&&Je(0);break}}o&&s(u+131072);for(var A=(1<>>4;if(l+=N&15,l>m){i&&Je(0);break}if(N||Je(2),te<256)t[u++]=te;else if(te==256){Z=l,d=null;break}else{var Y=te-254;if(te>264){var _=te-257,re=Ul[_];Y=Ge(e,l,(1<>>4;be||Je(3),l+=be&15;var w=Mm[Pe];if(Pe>3){var re=zl[Pe];w+=ti(e,l)&(1<m){i&&Je(0);break}o&&s(u+131072);for(var Ie=u+Y;u>>0},ri=function(e,t){return Ke(e,t)+Ke(e,t+4)*4294967296};function Hm(e,t){return zm(e,t)}var fi=typeof TextDecoder<"u"&&new TextDecoder,Fm=0;try{fi.decode(Dm,{stream:!0}),Fm=1}catch{}var Wm=function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return[t,ji(e,r-1)];o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function Gl(e,t){if(t){for(var r="",n=0;n65558)&&Je(13);var o=it(e,n+8);if(!o)return{};var i=Ke(e,n+16),s=i==4294967295||o==65535;if(s){var a=Ke(e,n-12);s=Ke(e,a)==101075792,s&&(o=Ke(e,a+32),i=Ke(e,a+48))}for(var l=t&&t.filter,u=0;u(0,Qm.resolve)((0,Ym.cwd)(),e),Jl=e=>(0,Ii.existsSync)($i(e));function no({zip:e="",file:t="",versionFile:r="package.json"}){let n=e||t;if(Jl(r)&&n.includes("{version}")){let o=JSON.parse((0,Ii.readFileSync)(r).toString());return n.replace("{version}",o.version||"")}else return n}function oo(e){let t=(0,Ii.readFileSync)($i(e)),r=Km(t),n=Gl(r["manifest.json"]);return JSON.parse(n)}function Mi({extId:e=null,market:t="",zip:r=""}){let{name:n,version:o}=oo(r),i=kl[t]||t;console.log(`Successfully updated "${e}" (${n}) to version ${o} on ${i}!`)}var En={};function Kl({message:e="Message",prefix:t="",market:r=""}){var n;En[r]=1+((n=En?.[r])!=null?n:0);let o=`${r}: Step ${En[r]}) ${e}`;return t!=="Error"&&(t=t||"Info",o=`${t} ${o}`),t==="Info"?o=o.trim():t==="Error"&&(o=o.trimStart()),o}var Ql={},io=e=>{Ql[e]=!0,process.env.VERBOSE="true"};function Li(e=""){return t=>Ql[e]&&console.log(Kl({market:e,message:t}))}var Ni=(e,t,r)=>{let n=new Error(Kl({market:t,message:`Item "${r}": ${e.message}`,prefix:"Error"}));return n.stack=e.stack,n};function ni(e,t){return`${e}: ${t}`}var so=({market:e="chrome",options:t={},errorMap:r={}})=>{if(Object.keys(r).some(o=>{if(!t[o])throw new Error(ni(e,r[o]))}),!t.zip&&!t.file)throw new Error(ni(e,"No extension bundle provided"));let n=t.zip||t.file;if(!Jl(n))throw new Error(ni(e,`Extension bundle file doesn't exist: ${$i(n)}`))},Ir="chrome",Xm=Li(Ir);function Zm(e){return Vt(this,null,function*(){var t=e,{extId:r,target:n="default",zip:o,dryRun:i}=t,s=Ri(t,["extId","target","zip","dryRun"]);let a=new Am(Oi({extId:r},s));if(Xm(`Updating extension with ID ${r}`),i)return!0;try{return yield a.submit({filePath:o,target:n}),Mi({extId:r,market:Ir,zip:o}),!0}catch(l){let u=oo(o);throw Ni(l,Ir,`"${r}" (${u.name})`)}})}function ey(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io(Ir),so({market:Ir,options:e,errorMap:Ci}),Zm(e)})}var ty=require("fs"),Bi={productId:"Product ID is required. To get one, go to: https://partner.microsoft.com/en-us/dashboard/microsoftedge/{product-id}/package/dashboard",clientId:"Client ID is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",clientSecret:"Client Secret is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",accessTokenUrl:"Access token URL is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi"},ry=Object.keys(Bi),ny=e=>new Promise(t=>setTimeout(t,e)),ka="https://api.addons.microsoftedge.microsoft.com",oy=class{options={};constructor(e){for(let t of ry){if(!e[t])throw new Error(Bi[t]);this.options[t]=e[t]}}get productEndpoint(){return`${ka}/v1/products/${this.options.productId}`}get publishEndpoint(){return`${this.productEndpoint}/submissions`}get uploadEndpoint(){return`${this.publishEndpoint}/draft/package`}async submit({filePath:e="",notes:t=""}){let r=await this.getAccessToken(),n=await this.upload((0,ty.createReadStream)(e),r);return await this.waitForUpload(n,r),this.publish(t,r)}async publish(e="",t=null){let r={headers:{Authorization:`Bearer ${t||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(r.body=`{ "notes"="${e}" }`);let n=await De.post(this.publishEndpoint,r);return this.handleTempStatus(n.statusCode,"Submit"),n.headers.location}async upload(e=null,t=null){let r=t||await this.getAccessToken(),n=await De.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/zip"}});return this.handleTempStatus(n.statusCode,"Upload"),n.headers.location}async getPublishStatus(e,t=null){let r=t||await this.getAccessToken(),n=`${this.publishEndpoint}/operations/${e}`;return De.get(n,{headers:{Authorization:`Bearer ${r}`}}).json()}async waitForUpload(e,t=null,r=5,n=3e3){let o=t||await this.getAccessToken(),i=`${this.uploadEndpoint}/operations/${e}`,s,a,l=0;for(;a!=="Succeeded"&&l{if(e!==202)throw e>=500?new Error("Edge server error, please try again later"):new Error(`${t} failed, double check your api credentials`)};getAccessToken=async()=>(await De.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${ka}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},$r="edge",iy=Li($r);function sy(e){return Vt(this,null,function*(){var t=e,{productId:r,notes:n,zip:o,dryRun:i}=t,s=Ri(t,["productId","notes","zip","dryRun"]);let a=oo(o),l=new oy(Oi({productId:r},s));if(iy(`Updating extension with Product ID ${r}`),i)return!0;try{return yield l.submit({filePath:o,notes:n}),Mi({extId:r,market:$r,zip:o}),!0}catch(u){throw Ni(u,$r,`"${r}" (${a.name})`)}})}function ay(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io($r),so({market:$r,options:e,errorMap:Bi}),sy(e)})}var ve=e=>typeof e=="function",ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function Yl(){}function Ee(e){return typeof e=="object"&&e!==null||typeof e=="function"}var Xl=Yl;function se(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}var Ui=Promise,ly=Promise.prototype.then,uy=Promise.resolve.bind(Ui),cy=Promise.reject.bind(Ui);function Re(e){return new Ui(e)}function le(e){return uy(e)}function X(e){return cy(e)}function dt(e,t,r){return ly.call(e,t,r)}function Se(e,t,r){dt(dt(e,t,r),void 0,Xl)}function Aa(e,t){Se(e,t)}function qa(e,t){Se(e,void 0,t)}function Qe(e,t,r){return dt(e,t,r)}function lr(e){dt(e,void 0,Xl)}var Ln=e=>{if(typeof queueMicrotask=="function")Ln=queueMicrotask;else{let t=le(void 0);Ln=r=>dt(t,r)}return Ln(e)};function ao(e,t,r){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,r)}function Gt(e,t,r){try{return le(ao(e,t,r))}catch(n){return X(n)}}var He=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,r=t;t._elements.length===16383&&(r={_elements:[],_next:void 0}),t._elements.push(e),r!==t&&(this._back=r,t._next=r),++this._size}shift(){let e=this._front,t=e,r=this._cursor,n=r+1,o=e._elements,i=o[r];return n===16384&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),o[r]=void 0,i}forEach(e){let t=this._cursor,r=this._front,n=r._elements;for(;!(t===n.length&&r._next===void 0||t===n.length&&(r=r._next,n=r._elements,t=0,n.length===0));)e(n[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}},Zl=ne("[[AbortSteps]]"),eu=ne("[[ErrorSteps]]"),zi=ne("[[CancelSteps]]"),Di=ne("[[PullSteps]]"),Hi=ne("[[ReleaseSteps]]");function tu(e,t){e._ownerReadableStream=t,t._reader=e,t._state==="readable"?pi(e):t._state==="closed"?function(r){pi(r),iu(r)}(e):ou(e,t._storedError)}function ru(e,t){return Mu(e._ownerReadableStream,t)}function nu(e){let t=e._ownerReadableStream;t._state==="readable"?Fi(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(r,n){ou(r,n)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),t._readableStreamController[Hi](),t._reader=void 0,e._ownerReadableStream=void 0}function ur(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function pi(e){e._closedPromise=Re((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r})}function ou(e,t){pi(e),Fi(e,t)}function Fi(e,t){e._closedPromise_reject!==void 0&&(lr(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function iu(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var Ca=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},hy=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function ft(e,t){if(e!==void 0&&typeof(r=e)!="object"&&typeof r!="function")throw new TypeError(`${t} is not an object.`);var r}function Ye(e,t){if(typeof e!="function")throw new TypeError(`${t} is not a function.`)}function su(e,t){if(!function(r){return typeof r=="object"&&r!==null||typeof r=="function"}(e))throw new TypeError(`${t} is not an object.`)}function pt(e,t,r){if(e===void 0)throw new TypeError(`Parameter ${t} is required in '${r}'.`)}function mi(e,t,r){if(e===void 0)throw new TypeError(`${t} is required in '${r}'.`)}function Wi(e){return Number(e)}function ja(e){return e===0?0:e}function au(e,t){let r=Number.MAX_SAFE_INTEGER,n=Number(e);if(n=ja(n),!Ca(n))throw new TypeError(`${t} is not a finite number`);if(n=function(o){return ja(hy(o))}(n),n<0||n>r)throw new TypeError(`${t} is outside the accepted range of 0 to ${r}, inclusive`);return Ca(n)&&n!==0?n:0}function kr(e){if(!Ee(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function lu(e){if(!Ee(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function uu(e,t){if(!Ft(e))throw new TypeError(`${t} is not a ReadableStream.`)}function cu(e,t){e._reader._readRequests.push(t)}function Vi(e,t,r){let n=e._reader._readRequests.shift();r?n._closeSteps():n._chunkSteps(t)}function lo(e){return e._reader._readRequests.length}function hu(e){let t=e._reader;return t!==void 0&&!!Ht(t)}var Mt=class{constructor(e){if(pt(e,1,"ReadableStreamDefaultReader"),uu(e,"First parameter"),hr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");tu(this,e),this._readRequests=new He}get closed(){return Ht(this)?this._closedPromise:X(Tn("closed"))}cancel(e){return Ht(this)?this._ownerReadableStream===void 0?X(ur("cancel")):ru(this,e):X(Tn("cancel"))}read(){if(!Ht(this))return X(Tn("read"));if(this._ownerReadableStream===void 0)return X(ur("read from"));let e,t,r=Re((n,o)=>{e=n,t=o});return function(n,o){let i=n._ownerReadableStream;i._disturbed=!0,i._state==="closed"?o._closeSteps():i._state==="errored"?o._errorSteps(i._storedError):i._readableStreamController[Di](o)}(this,{_chunkSteps:n=>e({value:n,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:n=>t(n)}),r}releaseLock(){if(!Ht(this))throw Tn("releaseLock");this._ownerReadableStream!==void 0&&function(e){nu(e);let t=new TypeError("Reader was released");du(e,t)}(this)}};function Ht(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof Mt}function du(e,t){let r=e._readRequests;e._readRequests=new He,r.forEach(n=>{n._errorSteps(t)})}function Tn(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(Mt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),se(Mt.prototype.cancel,"cancel"),se(Mt.prototype.read,"read"),se(Mt.prototype.releaseLock,"releaseLock"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Mt.prototype,ne.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var fu=class{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Qe(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise?Qe(this._ongoingPromise,t,t):t()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;return e===void 0?X(ur("iterate")):dt(e.read(),t=>{var r;return this._ongoingPromise=void 0,t.done&&(this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0),t},t=>{var r;throw this._ongoingPromise=void 0,this._isFinished=!0,(r=this._reader)===null||r===void 0||r.releaseLock(),this._reader=void 0,t})}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(t===void 0)return X(ur("finish iterating"));if(this._reader=void 0,!this._preventCancel){let r=t.cancel(e);return t.releaseLock(),Qe(r,()=>({value:e,done:!0}))}return t.releaseLock(),le({value:e,done:!0})}},pu={next(){return Ia(this)?this._asyncIteratorImpl.next():X($a("next"))},return(e){return Ia(this)?this._asyncIteratorImpl.return(e):X($a("return"))}};function Ia(e){if(!Ee(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof fu}catch{return!1}}function $a(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof ne.asyncIterator=="symbol"&&Object.defineProperty(pu,ne.asyncIterator,{value(){return this},writable:!0,configurable:!0});var mu=Number.isNaN||function(e){return e!=e};function yu(e,t,r,n,o){new Uint8Array(e).set(new Uint8Array(r,n,o),t)}function Ma(e){let t=function(r,n,o){if(r.slice)return r.slice(n,o);let i=o-n,s=new ArrayBuffer(i);return yu(s,0,r,n,i),s}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function yi(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function Gi(e,t,r){if(typeof(n=r)!="number"||mu(n)||n<0||r===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var n;e._queue.push({value:t,size:r}),e._queueTotalSize+=r}function Et(e){e._queue=new He,e._queueTotalSize=0}var ir=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!oi(this))throw ii("view");return this._view}respond(e){if(!oi(this))throw ii("respond");if(pt(e,1,"respond"),e=au(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(t,r){let n=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(r!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(r===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(n.bytesFilled+r>n.byteLength)throw new RangeError("bytesWritten out of range")}n.buffer=n.buffer,La(t,r)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!oi(this))throw ii("respondWithNewView");if(pt(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");e.buffer,function(t,r){let n=t._pendingPullIntos.peek();if(t._controlledReadableByteStream._state==="closed"){if(r.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(r.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(n.byteOffset+n.bytesFilled!==r.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(n.bufferByteLength!==r.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(n.bytesFilled+r.byteLength>n.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let o=r.byteLength;n.buffer=r.buffer,La(t,o)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(ir.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),se(ir.prototype.respond,"respond"),se(ir.prototype.respondWithNewView,"respondWithNewView"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(ir.prototype,ne.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Lt=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!nr(this))throw Or("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),r=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),n=Object.create(ir.prototype);(function(o,i,s){o._associatedReadableByteStreamController=i,o._view=s})(n,e,r),e._byobRequest=n}return e._byobRequest}(this)}get desiredSize(){if(!nr(this))throw Or("desiredSize");return Tu(this)}close(){if(!nr(this))throw Or("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);(function(t){let r=t._controlledReadableByteStream;if(!(t._closeRequested||r._state!=="readable")){if(t._queueTotalSize>0)return void(t._closeRequested=!0);if(t._pendingPullIntos.length>0&&t._pendingPullIntos.peek().bytesFilled>0){let n=new TypeError("Insufficient bytes to fill elements in the given buffer");throw cr(t,n),n}Wn(t),Lr(r)}})(this)}enqueue(e){if(!nr(this))throw Or("enqueue");if(pt(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let t=this._controlledReadableByteStream._state;if(t!=="readable")throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);(function(r,n){let o=r._controlledReadableByteStream;if(r._closeRequested||o._state!=="readable")return;let i=n.buffer,s=n.byteOffset,a=n.byteLength,l=i;if(r._pendingPullIntos.length>0){let u=r._pendingPullIntos.peek();u.buffer,Ji(r),u.buffer=u.buffer,u.readerType==="none"&&_u(r,u)}hu(o)?(function(u){let d=u._controlledReadableByteStream._reader;for(;d._readRequests.length>0;){if(u._queueTotalSize===0)return;Na(u,d._readRequests.shift())}}(r),lo(o)===0?Nn(r,l,s,a):(r._pendingPullIntos.length>0&&ar(r),Vi(o,new Uint8Array(l,s,a),!1))):Ki(o)?(Nn(r,l,s,a),bi(r)):Nn(r,l,s,a),Wt(r)})(this,e)}error(e){if(!nr(this))throw Or("error");cr(this,e)}[zi](e){gu(this),Et(this);let t=this._cancelAlgorithm(e);return Wn(this),t}[Di](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Na(this,e);let r=this._autoAllocateChunkSize;if(r!==void 0){let n;try{n=new ArrayBuffer(r)}catch(i){return void e._errorSteps(i)}let o={buffer:n,bufferByteLength:r,byteOffset:0,byteLength:r,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}cu(t,e),Wt(this)}[Hi](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new He,this._pendingPullIntos.push(e)}}};function nr(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof Lt}function oi(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof ir}function Wt(e){if(function(t){let r=t._controlledReadableByteStream;return r._state!=="readable"||t._closeRequested||!t._started?!1:!!(hu(r)&&lo(r)>0||Ki(r)&&Ou(r)>0||Tu(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Se(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Wt(e)),null),t=>(cr(e,t),null))}}function gu(e){Ji(e),e._pendingPullIntos=new He}function gi(e,t){let r=!1;e._state==="closed"&&(r=!0);let n=bu(t);t.readerType==="default"?Vi(e,n,r):function(o,i,s){let a=o._reader._readIntoRequests.shift();s?a._closeSteps(i):a._chunkSteps(i)}(e,n,r)}function bu(e){let t=e.bytesFilled,r=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/r)}function Nn(e,t,r,n){e._queue.push({buffer:t,byteOffset:r,byteLength:n}),e._queueTotalSize+=n}function vu(e,t,r,n){let o;try{o=t.slice(r,r+n)}catch(i){throw cr(e,i),i}Nn(e,o,0,n)}function _u(e,t){t.bytesFilled>0&&vu(e,t.buffer,t.byteOffset,t.bytesFilled),ar(e)}function wu(e,t){let r=t.elementSize,n=t.bytesFilled-t.bytesFilled%r,o=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),i=t.bytesFilled+o,s=i-i%r,a=o,l=!1;s>n&&(a=s-t.bytesFilled,l=!0);let u=e._queue;for(;a>0;){let d=u.peek(),h=Math.min(a,d.byteLength),c=t.byteOffset+t.bytesFilled;yu(t.buffer,c,d.buffer,d.byteOffset,h),d.byteLength===h?u.shift():(d.byteOffset+=h,d.byteLength-=h),e._queueTotalSize-=h,Su(e,h,t),a-=h}return l}function Su(e,t,r){r.bytesFilled+=t}function Eu(e){e._queueTotalSize===0&&e._closeRequested?(Wn(e),Lr(e._controlledReadableByteStream)):Wt(e)}function Ji(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function bi(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let t=e._pendingPullIntos.peek();wu(e,t)&&(ar(e),gi(e._controlledReadableByteStream,t))}}function La(e,t){let r=e._pendingPullIntos.peek();Ji(e),e._controlledReadableByteStream._state==="closed"?function(n,o){o.readerType==="none"&&ar(n);let i=n._controlledReadableByteStream;if(Ki(i))for(;Ou(i)>0;)gi(i,ar(n))}(e,r):function(n,o,i){if(Su(0,o,i),i.readerType==="none")return _u(n,i),void bi(n);if(i.bytesFilled0){let a=i.byteOffset+i.bytesFilled;vu(n,i.buffer,a-s,s)}i.bytesFilled-=s,gi(n._controlledReadableByteStream,i),bi(n)}(e,t,r),Wt(e)}function ar(e){return e._pendingPullIntos.shift()}function Wn(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function cr(e,t){let r=e._controlledReadableByteStream;r._state==="readable"&&(gu(e),Et(e),Wn(e),Lu(r,t))}function Na(e,t){let r=e._queue.shift();e._queueTotalSize-=r.byteLength,Eu(e);let n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n)}function Tu(e){let t=e._controlledReadableByteStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function dy(e,t,r){let n=Object.create(Lt.prototype),o,i,s;o=t.start!==void 0?()=>t.start(n):()=>{},i=t.pull!==void 0?()=>t.pull(n):()=>le(void 0),s=t.cancel!==void 0?l=>t.cancel(l):()=>le(void 0);let a=t.autoAllocateChunkSize;if(a===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(l,u,d,h,c,p,m){u._controlledReadableByteStream=l,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,Et(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=p,u._pullAlgorithm=h,u._cancelAlgorithm=c,u._autoAllocateChunkSize=m,u._pendingPullIntos=new He,l._readableStreamController=u,Se(le(d()),()=>(u._started=!0,Wt(u),null),O=>(cr(u,O),null))})(e,n,o,i,s,r,a)}function ii(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Or(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Ba(e,t){e._reader._readIntoRequests.push(t)}function Ou(e){return e._reader._readIntoRequests.length}function Ki(e){let t=e._reader;return t!==void 0&&!!sr(t)}Object.defineProperties(Lt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),se(Lt.prototype.close,"close"),se(Lt.prototype.enqueue,"enqueue"),se(Lt.prototype.error,"error"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Lt.prototype,ne.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var Nt=class{constructor(e){if(pt(e,1,"ReadableStreamBYOBReader"),uu(e,"First parameter"),hr(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!nr(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");tu(this,e),this._readIntoRequests=new He}get closed(){return sr(this)?this._closedPromise:X(On("closed"))}cancel(e){return sr(this)?this._ownerReadableStream===void 0?X(ur("cancel")):ru(this,e):X(On("cancel"))}read(e){if(!sr(this))return X(On("read"));if(!ArrayBuffer.isView(e))return X(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return X(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return X(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return X(ur("read from"));let t,r,n=Re((o,i)=>{t=o,r=i});return function(o,i,s){let a=o._ownerReadableStream;a._disturbed=!0,a._state==="errored"?s._errorSteps(a._storedError):function(l,u,d){let h=l._controlledReadableByteStream,c=1;u.constructor!==DataView&&(c=u.constructor.BYTES_PER_ELEMENT);let p=u.constructor,m=u.buffer,O={buffer:m,bufferByteLength:m.byteLength,byteOffset:u.byteOffset,byteLength:u.byteLength,bytesFilled:0,elementSize:c,viewConstructor:p,readerType:"byob"};if(l._pendingPullIntos.length>0)return l._pendingPullIntos.push(O),void Ba(h,d);if(h._state!=="closed"){if(l._queueTotalSize>0){if(wu(l,O)){let g=bu(O);return Eu(l),void d._chunkSteps(g)}if(l._closeRequested){let g=new TypeError("Insufficient bytes to fill elements in the given buffer");return cr(l,g),void d._errorSteps(g)}}l._pendingPullIntos.push(O),Ba(h,d),Wt(l)}else{let g=new p(O.buffer,O.byteOffset,0);d._closeSteps(g)}}(a._readableStreamController,i,s)}(this,e,{_chunkSteps:o=>t({value:o,done:!1}),_closeSteps:o=>t({value:o,done:!0}),_errorSteps:o=>r(o)}),n}releaseLock(){if(!sr(this))throw On("releaseLock");this._ownerReadableStream!==void 0&&function(e){nu(e);let t=new TypeError("Reader was released");Ru(e,t)}(this)}};function sr(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof Nt}function Ru(e,t){let r=e._readIntoRequests;e._readIntoRequests=new He,r.forEach(n=>{n._errorSteps(t)})}function On(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Mr(e,t){let{highWaterMark:r}=e;if(r===void 0)return t;if(mu(r)||r<0)throw new RangeError("Invalid highWaterMark");return r}function Vn(e){let{size:t}=e;return t||(()=>1)}function Gn(e,t){ft(e,t);let r=e?.highWaterMark,n=e?.size;return{highWaterMark:r===void 0?void 0:Wi(r),size:n===void 0?void 0:fy(n,`${t} has member 'size' that`)}}function fy(e,t){return Ye(e,t),r=>Wi(e(r))}function py(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function my(e,t,r){return Ye(e,r),()=>Gt(e,t,[])}function yy(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function gy(e,t,r){return Ye(e,r),(n,o)=>Gt(e,t,[n,o])}Object.defineProperties(Nt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),se(Nt.prototype.cancel,"cancel"),se(Nt.prototype.read,"read"),se(Nt.prototype.releaseLock,"releaseLock"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Nt.prototype,ne.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var by=typeof AbortController=="function",Bt=class{constructor(e={},t={}){e===void 0?e=null:su(e,"First parameter");let r=Gn(t,"Second parameter"),n=function(s,a){ft(s,a);let l=s?.abort,u=s?.close,d=s?.start,h=s?.type,c=s?.write;return{abort:l===void 0?void 0:py(l,s,`${a} has member 'abort' that`),close:u===void 0?void 0:my(u,s,`${a} has member 'close' that`),start:d===void 0?void 0:yy(d,s,`${a} has member 'start' that`),write:c===void 0?void 0:gy(c,s,`${a} has member 'write' that`),type:h}}(e,"First parameter");var o;if((o=this)._state="writable",o._storedError=void 0,o._writer=void 0,o._writableStreamController=void 0,o._writeRequests=new He,o._inFlightWriteRequest=void 0,o._closeRequest=void 0,o._inFlightCloseRequest=void 0,o._pendingAbortRequest=void 0,o._backpressure=!1,n.type!==void 0)throw new RangeError("Invalid type is specified");let i=Vn(r);(function(s,a,l,u){let d=Object.create(Jn.prototype),h,c,p,m;h=a.start!==void 0?()=>a.start(d):()=>{},c=a.write!==void 0?O=>a.write(O,d):()=>le(void 0),p=a.close!==void 0?()=>a.close():()=>le(void 0),m=a.abort!==void 0?O=>a.abort(O):()=>le(void 0),function(O,g,M,I,S,y,_,v){g._controlledWritableStream=O,O._writableStreamController=g,g._queue=void 0,g._queueTotalSize=void 0,Et(g),g._abortReason=void 0,g._abortController=function(){if(by)return new AbortController}(),g._started=!1,g._strategySizeAlgorithm=v,g._strategyHWM=_,g._writeAlgorithm=I,g._closeAlgorithm=S,g._abortAlgorithm=y;let R=Zi(g);Xi(O,R);let $=M();Se(le($),()=>(g._started=!0,uo(g),null),x=>(g._started=!0,vi(O,x),null))}(s,d,h,c,p,m,l,u)})(this,n,Mr(r,1),i)}get locked(){if(!st(this))throw Pn("locked");return Bn(this)}abort(e){return st(this)?Bn(this)?X(new TypeError("Cannot abort a stream that already has a writer")):Pu(this,e):X(Pn("abort"))}close(){return st(this)?Bn(this)?X(new TypeError("Cannot close a stream that already has a writer")):St(this)?X(new TypeError("Cannot close an already-closing stream")):xu(this):X(Pn("close"))}getWriter(){if(!st(this))throw Pn("getWriter");return new wt(this)}};function st(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof Bt}function Bn(e){return e._writer!==void 0}function Pu(e,t){var r;if(e._state==="closed"||e._state==="errored")return le(void 0);e._writableStreamController._abortReason=t,(r=e._writableStreamController._abortController)===null||r===void 0||r.abort(t);let n=e._state;if(n==="closed"||n==="errored")return le(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let o=!1;n==="erroring"&&(o=!0,t=void 0);let i=Re((s,a)=>{e._pendingAbortRequest={_promise:void 0,_resolve:s,_reject:a,_reason:t,_wasAlreadyErroring:o}});return e._pendingAbortRequest._promise=i,o||Qi(e,t),i}function xu(e){let t=e._state;if(t==="closed"||t==="errored")return X(new TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let r=Re((i,s)=>{let a={_resolve:i,_reject:s};e._closeRequest=a}),n=e._writer;var o;return n!==void 0&&e._backpressure&&t==="writable"&&ts(n),Gi(o=e._writableStreamController,Au,0),uo(o),r}function vi(e,t){e._state!=="writable"?Yi(e):Qi(e,t)}function Qi(e,t){let r=e._writableStreamController;e._state="erroring",e._storedError=t;let n=e._writer;n!==void 0&&ku(n,t),!function(o){return!(o._inFlightWriteRequest===void 0&&o._inFlightCloseRequest===void 0)}(e)&&r._started&&Yi(e)}function Yi(e){e._state="errored",e._writableStreamController[eu]();let t=e._storedError;if(e._writeRequests.forEach(n=>{n._reject(t)}),e._writeRequests=new He,e._pendingAbortRequest===void 0)return void Rn(e);let r=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,r._wasAlreadyErroring)return r._reject(t),void Rn(e);Se(e._writableStreamController[Zl](r._reason),()=>(r._resolve(),Rn(e),null),n=>(r._reject(n),Rn(e),null))}function St(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function Rn(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;t!==void 0&&es(t,e._storedError)}function Xi(e,t){let r=e._writer;r!==void 0&&t!==e._backpressure&&(t?function(n){co(n)}(r):ts(r)),e._backpressure=t}Object.defineProperties(Bt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),se(Bt.prototype.abort,"abort"),se(Bt.prototype.close,"close"),se(Bt.prototype.getWriter,"getWriter"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Bt.prototype,ne.toStringTag,{value:"WritableStream",configurable:!0});var wt=class{constructor(e){if(pt(e,1,"WritableStreamDefaultWriter"),function(n,o){if(!st(n))throw new TypeError(`${o} is not a WritableStream.`)}(e,"First parameter"),Bn(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let t=e._state;if(t==="writable")!St(e)&&e._backpressure?co(this):Da(this),Un(this);else if(t==="erroring")_i(this,e._storedError),Un(this);else if(t==="closed")Da(this),Un(r=this),ju(r);else{let n=e._storedError;_i(this,n),za(this,n)}var r}get closed(){return xt(this)?this._closedPromise:X(kt("closed"))}get desiredSize(){if(!xt(this))throw kt("desiredSize");if(this._ownerWritableStream===void 0)throw Rr("desiredSize");return function(e){let t=e._ownerWritableStream,r=t._state;return r==="errored"||r==="erroring"?null:r==="closed"?0:qu(t._writableStreamController)}(this)}get ready(){return xt(this)?this._readyPromise:X(kt("ready"))}abort(e){return xt(this)?this._ownerWritableStream===void 0?X(Rr("abort")):function(t,r){return Pu(t._ownerWritableStream,r)}(this,e):X(kt("abort"))}close(){if(!xt(this))return X(kt("close"));let e=this._ownerWritableStream;return e===void 0?X(Rr("close")):St(e)?X(new TypeError("Cannot close an already-closing stream")):xu(this._ownerWritableStream)}releaseLock(){if(!xt(this))throw kt("releaseLock");this._ownerWritableStream!==void 0&&function(e){let t=e._ownerWritableStream,r=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ku(e,r),function(n,o){n._closedPromiseState==="pending"?es(n,o):function(i,s){za(i,s)}(n,o)}(e,r),t._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return xt(this)?this._ownerWritableStream===void 0?X(Rr("write to")):function(t,r){let n=t._ownerWritableStream,o=n._writableStreamController,i=function(l,u){try{return l._strategySizeAlgorithm(u)}catch(d){return Ua(l,d),1}}(o,r);if(n!==t._ownerWritableStream)return X(Rr("write to"));let s=n._state;if(s==="errored")return X(n._storedError);if(St(n)||s==="closed")return X(new TypeError("The stream is closing or closed and cannot be written to"));if(s==="erroring")return X(n._storedError);let a=function(l){return Re((u,d)=>{let h={_resolve:u,_reject:d};l._writeRequests.push(h)})}(n);return function(l,u,d){try{Gi(l,u,d)}catch(c){return void Ua(l,c)}let h=l._controlledWritableStream;!St(h)&&h._state==="writable"&&Xi(h,Zi(l)),uo(l)}(o,r,i),a}(this,e):X(kt("write"))}};function xt(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof wt}function ku(e,t){e._readyPromiseState==="pending"?Iu(e,t):function(r,n){_i(r,n)}(e,t)}Object.defineProperties(wt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),se(wt.prototype.abort,"abort"),se(wt.prototype.close,"close"),se(wt.prototype.releaseLock,"releaseLock"),se(wt.prototype.write,"write"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(wt.prototype,ne.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Au={},Jn=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!si(this))throw ai("abortReason");return this._abortReason}get signal(){if(!si(this))throw ai("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!si(this))throw ai("error");this._controlledWritableStream._state==="writable"&&Cu(this,e)}[Zl](e){let t=this._abortAlgorithm(e);return Kn(this),t}[eu](){Et(this)}};function si(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Jn}function Kn(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function qu(e){return e._strategyHWM-e._queueTotalSize}function uo(e){let t=e._controlledWritableStream;if(!e._started||t._inFlightWriteRequest!==void 0)return;if(t._state==="erroring")return void Yi(t);if(e._queue.length===0)return;let r=e._queue.peek().value;r===Au?function(n){let o=n._controlledWritableStream;(function(s){s._inFlightCloseRequest=s._closeRequest,s._closeRequest=void 0})(o),yi(n);let i=n._closeAlgorithm();Kn(n),Se(i,()=>(function(s){s._inFlightCloseRequest._resolve(void 0),s._inFlightCloseRequest=void 0,s._state==="erroring"&&(s._storedError=void 0,s._pendingAbortRequest!==void 0&&(s._pendingAbortRequest._resolve(),s._pendingAbortRequest=void 0)),s._state="closed";let a=s._writer;a!==void 0&&ju(a)}(o),null),s=>(function(a,l){a._inFlightCloseRequest._reject(l),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(l),a._pendingAbortRequest=void 0),vi(a,l)}(o,s),null))}(e):function(n,o){let i=n._controlledWritableStream;(function(s){s._inFlightWriteRequest=s._writeRequests.shift()})(i),Se(n._writeAlgorithm(o),()=>{(function(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0})(i);let s=i._state;if(yi(n),!St(i)&&s==="writable"){let a=Zi(n);Xi(i,a)}return uo(n),null},s=>(i._state==="writable"&&Kn(n),function(a,l){a._inFlightWriteRequest._reject(l),a._inFlightWriteRequest=void 0,vi(a,l)}(i,s),null))}(e,r)}function Ua(e,t){e._controlledWritableStream._state==="writable"&&Cu(e,t)}function Zi(e){return qu(e)<=0}function Cu(e,t){let r=e._controlledWritableStream;Kn(e),Qi(r,t)}function Pn(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function ai(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function kt(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Rr(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Un(e){e._closedPromise=Re((t,r)=>{e._closedPromise_resolve=t,e._closedPromise_reject=r,e._closedPromiseState="pending"})}function za(e,t){Un(e),es(e,t)}function es(e,t){e._closedPromise_reject!==void 0&&(lr(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function ju(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function co(e){e._readyPromise=Re((t,r)=>{e._readyPromise_resolve=t,e._readyPromise_reject=r}),e._readyPromiseState="pending"}function _i(e,t){co(e),Iu(e,t)}function Da(e){co(e),ts(e)}function Iu(e,t){e._readyPromise_reject!==void 0&&(lr(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function ts(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Jn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Jn.prototype,ne.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Ha=typeof DOMException<"u"?DOMException:void 0,vy=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(Ha)?Ha:function(){let e=function(t,r){this.message=t||"",this.name=r||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Fa(e,t,r,n,o,i){let s=e.getReader(),a=t.getWriter();Ft(e)&&(e._disturbed=!0);let l,u,d,h=!1,c=!1,p="readable",m="writable",O=!1,g=!1,M=Re(S=>{d=S}),I=Promise.resolve(void 0);return Re((S,y)=>{let _;function v(){if(h)return;let j=Re((w,C)=>{(function U(A){A?w():dt(function(){return h?le(!0):dt(a.ready,()=>dt(s.read(),H=>!!H.done||(I=a.write(H.value),lr(I),!1)))}(),U,C)})(!1)});lr(j)}function R(){return p="closed",r?N():q(()=>(st(t)&&(O=St(t),m=t._state),O||m==="closed"?le(void 0):m==="erroring"||m==="errored"?X(u):(O=!0,a.close())),!1,void 0),null}function $(j){return h||(p="errored",l=j,n?N(!0,j):q(()=>a.abort(j),!0,j)),null}function x(j){return c||(m="errored",u=j,o?N(!0,j):q(()=>s.cancel(j),!0,j)),null}if(i!==void 0&&(_=()=>{let j=i.reason!==void 0?i.reason:new vy("Aborted","AbortError"),w=[];n||w.push(()=>m==="writable"?a.abort(j):le(void 0)),o||w.push(()=>p==="readable"?s.cancel(j):le(void 0)),q(()=>Promise.all(w.map(C=>C())),!0,j)},i.aborted?_():i.addEventListener("abort",_)),Ft(e)&&(p=e._state,l=e._storedError),st(t)&&(m=t._state,u=t._storedError,O=St(t)),Ft(e)&&st(t)&&(g=!0,d()),p==="errored")$(l);else if(m==="erroring"||m==="errored")x(u);else if(p==="closed")R();else if(O||m==="closed"){let j=new TypeError("the destination writable stream closed before all data could be piped to it");o?N(!0,j):q(()=>s.cancel(j),!0,j)}function q(j,w,C){function U(){return m!=="writable"||O?A():Aa(function(){let H;return le(function Z(){if(H!==I)return H=I,Qe(I,Z,Z)}())}(),A),null}function A(){return j?Se(j(),()=>J(w,C),H=>J(!0,H)):J(w,C),null}h||(h=!0,g?U():Aa(M,U))}function N(j,w){q(void 0,j,w)}function J(j,w){return c=!0,a.releaseLock(),s.releaseLock(),i!==void 0&&i.removeEventListener("abort",_),j?y(w):S(void 0),null}h||(Se(s.closed,R,$),Se(a.closed,function(){return c||(m="closed"),null},x)),g?v():Ln(()=>{g=!0,d(),v()})})}function _y(e,t){return function(r){try{return r.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(r){let n,o,i,s,a,l=r.getReader(),u=!1,d=!1,h=!1,c=!1,p=!1,m=!1,O=Re(x=>{a=x});function g(x){qa(x.closed,q=>(x!==l||(i.error(q),s.error(q),p&&m||a(void 0)),null))}function M(){u&&(l.releaseLock(),l=r.getReader(),g(l),u=!1),Se(l.read(),x=>{var q,N;if(h=!1,c=!1,x.done)return p||i.close(),m||s.close(),(q=i.byobRequest)===null||q===void 0||q.respond(0),(N=s.byobRequest)===null||N===void 0||N.respond(0),p&&m||a(void 0),null;let J=x.value,j=J,w=J;if(!p&&!m)try{w=Ma(J)}catch(C){return i.error(C),s.error(C),a(l.cancel(C)),null}return p||i.enqueue(j),m||s.enqueue(w),d=!1,h?S():c&&y(),null},()=>(d=!1,null))}function I(x,q){u||(l.releaseLock(),l=r.getReader({mode:"byob"}),g(l),u=!0);let N=q?s:i,J=q?i:s;Se(l.read(x),j=>{var w;h=!1,c=!1;let C=q?m:p,U=q?p:m;if(j.done){C||N.close(),U||J.close();let H=j.value;return H!==void 0&&(C||N.byobRequest.respondWithNewView(H),U||(w=J.byobRequest)===null||w===void 0||w.respond(0)),C&&U||a(void 0),null}let A=j.value;if(U)C||N.byobRequest.respondWithNewView(A);else{let H;try{H=Ma(A)}catch(Z){return N.error(Z),J.error(Z),a(l.cancel(Z)),null}C||N.byobRequest.respondWithNewView(A),J.enqueue(H)}return d=!1,h?S():c&&y(),null},()=>(d=!1,null))}function S(){if(d)return h=!0,le(void 0);d=!0;let x=i.byobRequest;return x===null?M():I(x.view,!1),le(void 0)}function y(){if(d)return c=!0,le(void 0);d=!0;let x=s.byobRequest;return x===null?M():I(x.view,!0),le(void 0)}function _(x){if(p=!0,n=x,m){let q=[n,o],N=l.cancel(q);a(N)}return O}function v(x){if(m=!0,o=x,p){let q=[n,o],N=l.cancel(q);a(N)}return O}let R=new we({type:"bytes",start(x){i=x},pull:S,cancel:_}),$=new we({type:"bytes",start(x){s=x},pull:y,cancel:v});return g(l),[R,$]}(e):function(r,n){let o=r.getReader(),i,s,a,l,u,d=!1,h=!1,c=!1,p=!1,m=Re(y=>{u=y});function O(){return d?(h=!0,le(void 0)):(d=!0,Se(o.read(),y=>{if(h=!1,y.done)return c||a.close(),p||l.close(),c&&p||u(void 0),null;let _=y.value,v=_,R=_;return c||a.enqueue(v),p||l.enqueue(R),d=!1,h&&O(),null},()=>(d=!1,null)),le(void 0))}function g(y){if(c=!0,i=y,p){let _=[i,s],v=o.cancel(_);u(v)}return m}function M(y){if(p=!0,s=y,c){let _=[i,s],v=o.cancel(_);u(v)}return m}let I=new we({start(y){a=y},pull:O,cancel:g}),S=new we({start(y){l=y},pull:O,cancel:M});return qa(o.closed,y=>(a.error(y),l.error(y),c&&p||u(void 0),null)),[I,S]}(e)}var Ut=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!xn(this))throw kn("desiredSize");return $u(this)}close(){if(!xn(this))throw kn("close");if(!Ar(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!Ar(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(zn(e),Lr(t))})(this)}enqueue(e){if(!xn(this))throw kn("enqueue");if(!Ar(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(t,r){if(!Ar(t))return;let n=t._controlledReadableStream;if(hr(n)&&lo(n)>0)Vi(n,r,!1);else{let o;try{o=t._strategySizeAlgorithm(r)}catch(i){throw jr(t,i),i}try{Gi(t,r,o)}catch(i){throw jr(t,i),i}}Cr(t)}(this,e)}error(e){if(!xn(this))throw kn("error");jr(this,e)}[zi](e){Et(this);let t=this._cancelAlgorithm(e);return zn(this),t}[Di](e){let t=this._controlledReadableStream;if(this._queue.length>0){let r=yi(this);this._closeRequested&&this._queue.length===0?(zn(this),Lr(t)):Cr(this),e._chunkSteps(r)}else cu(t,e),Cr(this)}[Hi](){}};function xn(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof Ut}function Cr(e){if(function(t){let r=t._controlledReadableStream;return!Ar(t)||!t._started?!1:!!(hr(r)&&lo(r)>0||$u(t)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,Se(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Cr(e)),null),t=>(jr(e,t),null))}}function zn(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function jr(e,t){let r=e._controlledReadableStream;r._state==="readable"&&(Et(e),zn(e),Lu(r,t))}function $u(e){let t=e._controlledReadableStream._state;return t==="errored"?null:t==="closed"?0:e._strategyHWM-e._queueTotalSize}function Ar(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function wy(e,t,r,n){let o=Object.create(Ut.prototype),i,s,a;i=t.start!==void 0?()=>t.start(o):()=>{},s=t.pull!==void 0?()=>t.pull(o):()=>le(void 0),a=t.cancel!==void 0?l=>t.cancel(l):()=>le(void 0),function(l,u,d,h,c,p,m){u._controlledReadableStream=l,u._queue=void 0,u._queueTotalSize=void 0,Et(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=m,u._strategyHWM=p,u._pullAlgorithm=h,u._cancelAlgorithm=c,l._readableStreamController=u,Se(le(d()),()=>(u._started=!0,Cr(u),null),O=>(jr(u,O),null))}(e,o,i,s,a,r,n)}function kn(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function Sy(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function Ey(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function Ty(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function Oy(e,t){if((e=`${e}`)!="bytes")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function Ry(e,t){if((e=`${e}`)!="byob")throw new TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Wa(e,t){ft(e,t);let r=e?.preventAbort,n=e?.preventCancel,o=e?.preventClose,i=e?.signal;return i!==void 0&&function(s,a){if(!function(l){if(typeof l!="object"||l===null)return!1;try{return typeof l.aborted=="boolean"}catch{return!1}}(s))throw new TypeError(`${a} is not an AbortSignal.`)}(i,`${t} has member 'signal' that`),{preventAbort:Boolean(r),preventCancel:Boolean(n),preventClose:Boolean(o),signal:i}}function Py(e,t){ft(e,t);let r=e?.readable;mi(r,"readable","ReadableWritablePair"),function(o,i){if(!kr(o))throw new TypeError(`${i} is not a ReadableStream.`)}(r,`${t} has member 'readable' that`);let n=e?.writable;return mi(n,"writable","ReadableWritablePair"),function(o,i){if(!lu(o))throw new TypeError(`${i} is not a WritableStream.`)}(n,`${t} has member 'writable' that`),{readable:r,writable:n}}Object.defineProperties(Ut.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),se(Ut.prototype.close,"close"),se(Ut.prototype.enqueue,"enqueue"),se(Ut.prototype.error,"error"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Ut.prototype,ne.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var we=class{constructor(e={},t={}){e===void 0?e=null:su(e,"First parameter");let r=Gn(t,"Second parameter"),n=function(i,s){ft(i,s);let a=i,l=a?.autoAllocateChunkSize,u=a?.cancel,d=a?.pull,h=a?.start,c=a?.type;return{autoAllocateChunkSize:l===void 0?void 0:au(l,`${s} has member 'autoAllocateChunkSize' that`),cancel:u===void 0?void 0:Sy(u,a,`${s} has member 'cancel' that`),pull:d===void 0?void 0:Ey(d,a,`${s} has member 'pull' that`),start:h===void 0?void 0:Ty(h,a,`${s} has member 'start' that`),type:c===void 0?void 0:Oy(c,`${s} has member 'type' that`)}}(e,"First parameter");var o;if((o=this)._state="readable",o._reader=void 0,o._storedError=void 0,o._disturbed=!1,n.type==="bytes"){if(r.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");dy(this,n,Mr(r,0))}else{let i=Vn(r);wy(this,n,Mr(r,1),i)}}get locked(){if(!Ft(this))throw At("locked");return hr(this)}cancel(e){return Ft(this)?hr(this)?X(new TypeError("Cannot cancel a stream that already has a reader")):Mu(this,e):X(At("cancel"))}getReader(e){if(!Ft(this))throw At("getReader");return function(t,r){ft(t,r);let n=t?.mode;return{mode:n===void 0?void 0:Ry(n,`${r} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new Mt(this):function(t){return new Nt(t)}(this)}pipeThrough(e,t={}){if(!kr(this))throw At("pipeThrough");pt(e,1,"pipeThrough");let r=Py(e,"First parameter"),n=Wa(t,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(r.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return lr(Fa(this,r.writable,n.preventClose,n.preventAbort,n.preventCancel,n.signal)),r.readable}pipeTo(e,t={}){if(!kr(this))return X(At("pipeTo"));if(e===void 0)return X("Parameter 1 is required in 'pipeTo'.");if(!lu(e))return X(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let r;try{r=Wa(t,"Second parameter")}catch(n){return X(n)}return this.locked?X(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?X(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Fa(this,e,r.preventClose,r.preventAbort,r.preventCancel,r.signal)}tee(){if(!kr(this))throw At("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return _y(this)}values(e){if(!kr(this))throw At("values");return function(t,r){let n=t.getReader(),o=new fu(n,r),i=Object.create(pu);return i._asyncIteratorImpl=o,i}(this,function(t,r){ft(t,r);let n=t?.preventCancel;return{preventCancel:Boolean(n)}}(e,"First parameter").preventCancel)}};function Ft(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof we}function hr(e){return e._reader!==void 0}function Mu(e,t){if(e._disturbed=!0,e._state==="closed")return le(void 0);if(e._state==="errored")return X(e._storedError);Lr(e);let r=e._reader;if(r!==void 0&&sr(r)){let n=r._readIntoRequests;r._readIntoRequests=new He,n.forEach(o=>{o._closeSteps(void 0)})}return Qe(e._readableStreamController[zi](t),Yl)}function Lr(e){e._state="closed";let t=e._reader;if(t!==void 0&&(iu(t),Ht(t))){let r=t._readRequests;t._readRequests=new He,r.forEach(n=>{n._closeSteps()})}}function Lu(e,t){e._state="errored",e._storedError=t;let r=e._reader;r!==void 0&&(Fi(r,t),Ht(r)?du(r,t):Ru(r,t))}function At(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function Nu(e,t){ft(e,t);let r=e?.highWaterMark;return mi(r,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Wi(r)}}Object.defineProperties(we.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),se(we.prototype.cancel,"cancel"),se(we.prototype.getReader,"getReader"),se(we.prototype.pipeThrough,"pipeThrough"),se(we.prototype.pipeTo,"pipeTo"),se(we.prototype.tee,"tee"),se(we.prototype.values,"values"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(we.prototype,ne.toStringTag,{value:"ReadableStream",configurable:!0}),typeof ne.asyncIterator=="symbol"&&Object.defineProperty(we.prototype,ne.asyncIterator,{value:we.prototype.values,writable:!0,configurable:!0});var Bu=e=>e.byteLength;se(Bu,"size");var wi=class{constructor(e){pt(e,1,"ByteLengthQueuingStrategy"),e=Nu(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ga(this))throw Va("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Ga(this))throw Va("size");return Bu}};function Va(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Ga(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof wi}Object.defineProperties(wi.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(wi.prototype,ne.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var Uu=()=>1;se(Uu,"size");var Si=class{constructor(e){pt(e,1,"CountQueuingStrategy"),e=Nu(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Ka(this))throw Ja("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Ka(this))throw Ja("size");return Uu}};function Ja(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Ka(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Si}function xy(e,t,r){return Ye(e,r),n=>Gt(e,t,[n])}function ky(e,t,r){return Ye(e,r),n=>ao(e,t,[n])}function Ay(e,t,r){return Ye(e,r),(n,o)=>Gt(e,t,[n,o])}Object.defineProperties(Si.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Si.prototype,ne.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var Ei=class{constructor(e={},t={},r={}){e===void 0&&(e=null);let n=Gn(t,"Second parameter"),o=Gn(r,"Third parameter"),i=function(h,c){ft(h,c);let p=h?.flush,m=h?.readableType,O=h?.start,g=h?.transform,M=h?.writableType;return{flush:p===void 0?void 0:xy(p,h,`${c} has member 'flush' that`),readableType:m,start:O===void 0?void 0:ky(O,h,`${c} has member 'start' that`),transform:g===void 0?void 0:Ay(g,h,`${c} has member 'transform' that`),writableType:M}}(e,"First parameter");if(i.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(i.writableType!==void 0)throw new RangeError("Invalid writableType specified");let s=Mr(o,0),a=Vn(o),l=Mr(n,1),u=Vn(n),d;(function(h,c,p,m,O,g){function M(){return c}function I(R){return function($,x){let q=$._transformStreamController;return $._backpressure?Qe($._backpressureChangePromise,()=>{if((st($._writable)?$._writable._state:$._writableState)==="erroring")throw st($._writable)?$._writable._storedError:$._writableStoredError;return Ya(q,x)}):Ya(q,x)}(h,R)}function S(R){return function($,x){return Qn($,x),le(void 0)}(h,R)}function y(){return function(R){let $=R._transformStreamController,x=$._flushAlgorithm();return zu($),Qe(x,()=>{if(R._readableState==="errored")throw R._readableStoredError;Xn(R)&&Hu(R)},q=>{throw Qn(R,q),R._readableStoredError})}(h)}function _(){return function(R){return Yn(R,!1),R._backpressureChangePromise}(h)}function v(R){return ho(h,R),le(void 0)}h._writableState="writable",h._writableStoredError=void 0,h._writableHasInFlightOperation=!1,h._writableStarted=!1,h._writable=function(R,$,x,q,N,J,j){return new Bt({start(w){R._writableController=w;try{let C=w.signal;C!==void 0&&C.addEventListener("abort",()=>{R._writableState==="writable"&&(R._writableState="erroring",C.reason&&(R._writableStoredError=C.reason))})}catch{}return Qe($(),()=>(R._writableStarted=!0,Za(R),null),C=>{throw R._writableStarted=!0,li(R,C),C})},write:w=>(function(C){C._writableHasInFlightOperation=!0}(R),Qe(x(w),()=>(function(C){C._writableHasInFlightOperation=!1}(R),Za(R),null),C=>{throw function(U,A){U._writableHasInFlightOperation=!1,li(U,A)}(R,C),C})),close:()=>(function(w){w._writableHasInFlightOperation=!0}(R),Qe(q(),()=>(function(w){w._writableHasInFlightOperation=!1,w._writableState==="erroring"&&(w._writableStoredError=void 0),w._writableState="closed"}(R),null),w=>{throw function(C,U){C._writableHasInFlightOperation=!1,C._writableState,li(C,U)}(R,w),w})),abort:w=>(R._writableState="errored",R._writableStoredError=w,N(w))},{highWaterMark:J,size:j})}(h,M,I,y,S,p,m),h._readableState="readable",h._readableStoredError=void 0,h._readableCloseRequested=!1,h._readablePulling=!1,h._readable=function(R,$,x,q,N,J){return new we({start:j=>(R._readableController=j,$().catch(w=>{Zn(R,w)})),pull:()=>(R._readablePulling=!0,x().catch(j=>{Zn(R,j)})),cancel:j=>(R._readableState="closed",q(j))},{highWaterMark:N,size:J})}(h,M,_,v,O,g),h._backpressure=void 0,h._backpressureChangePromise=void 0,h._backpressureChangePromise_resolve=void 0,Yn(h,!0),h._transformStreamController=void 0})(this,Re(h=>{d=h}),l,u,s,a),function(h,c){let p=Object.create(zt.prototype),m,O;m=c.transform!==void 0?g=>c.transform(g,p):g=>{try{return Du(p,g),le(void 0)}catch(M){return X(M)}},O=c.flush!==void 0?()=>c.flush(p):()=>le(void 0),function(g,M,I,S){M._controlledTransformStream=g,g._transformStreamController=M,M._transformAlgorithm=I,M._flushAlgorithm=S}(h,p,m,O)}(this,i),i.start!==void 0?d(i.start(this._transformStreamController)):d(void 0)}get readable(){if(!Qa(this))throw Xa("readable");return this._readable}get writable(){if(!Qa(this))throw Xa("writable");return this._writable}};function Qa(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof Ei}function Qn(e,t){Zn(e,t),ho(e,t)}function ho(e,t){zu(e._transformStreamController),function(r,n){r._writableController.error(n),r._writableState==="writable"&&Wu(r,n)}(e,t),e._backpressure&&Yn(e,!1)}function Yn(e,t){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=Re(r=>{e._backpressureChangePromise_resolve=r}),e._backpressure=t}Object.defineProperties(Ei.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof ne.toStringTag=="symbol"&&Object.defineProperty(Ei.prototype,ne.toStringTag,{value:"TransformStream",configurable:!0});var zt=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!An(this))throw qn("desiredSize");return Fu(this._controlledTransformStream)}enqueue(e){if(!An(this))throw qn("enqueue");Du(this,e)}error(e){if(!An(this))throw qn("error");var t;t=e,Qn(this._controlledTransformStream,t)}terminate(){if(!An(this))throw qn("terminate");(function(e){let t=e._controlledTransformStream;Xn(t)&&Hu(t);let r=new TypeError("TransformStream terminated");ho(t,r)})(this)}};function An(e){return!!Ee(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof zt}function zu(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Du(e,t){let r=e._controlledTransformStream;if(!Xn(r))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(n,o){n._readablePulling=!1;try{n._readableController.enqueue(o)}catch(i){throw Zn(n,i),i}})(r,t)}catch(n){throw ho(r,n),r._readableStoredError}(function(n){return!function(o){return Xn(o)?!!(o._readablePulling||Fu(o)>0):!1}(n)})(r)!==r._backpressure&&Yn(r,!0)}function Ya(e,t){return Qe(e._transformAlgorithm(t),void 0,r=>{throw Qn(e._controlledTransformStream,r),r})}function qn(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Xa(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function Xn(e){return!e._readableCloseRequested&&e._readableState==="readable"}function Hu(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function Zn(e,t){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=t),e._readableController.error(t)}function Fu(e){return e._readableController.desiredSize}function li(e,t){e._writableState!=="writable"?rs(e):Wu(e,t)}function Wu(e,t){e._writableState="erroring",e._writableStoredError=t,!function(r){return r._writableHasInFlightOperation}(e)&&e._writableStarted&&rs(e)}function rs(e){e._writableState="errored"}function Za(e){e._writableState==="erroring"&&rs(e)}Object.defineProperties(zt.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),se(zt.prototype.enqueue,"enqueue"),se(zt.prototype.error,"error"),se(zt.prototype.terminate,"terminate"),typeof ne.toStringTag=="symbol"&&Object.defineProperty(zt.prototype,ne.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Vu=65536;async function*qy(e){let t=e.byteOffset+e.byteLength,r=e.byteOffset;for(;r!==t;){let n=Math.min(t-r,Vu),o=e.buffer.slice(r,r+n);r+=o.byteLength,yield new Uint8Array(o)}}async function*Cy(e){let t=0;for(;t!==e.size;){let r=await e.slice(t,Math.min(e.size,t+Vu)).arrayBuffer();t+=r.byteLength,yield new Uint8Array(r)}}async function*ui(e,t=!1){for(let r of e)ArrayBuffer.isView(r)?t?yield*qy(r):yield r:ve(r.stream)?yield*r.stream():yield*Cy(r)}function*jy(e,t,r=0,n){n??(n=t);let o=r<0?Math.max(t+r,0):Math.min(r,t),i=n<0?Math.max(t+n,0):Math.min(n,t),s=Math.max(i-o,0),a=0;for(let l of e){if(a>=s)break;let u=ArrayBuffer.isView(l)?l.byteLength:l.size;if(o&&u<=o)o-=u,i-=u;else{let d;ArrayBuffer.isView(l)?(d=l.subarray(o,Math.min(u,i)),a+=d.byteLength):(d=l.slice(o,Math.min(u,i)),a+=d.size),i-=u,o=0,yield d}}}var _t=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},el=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},qt,Cn,Pr,dr=class{constructor(e=[],t={}){if(qt.set(this,[]),Cn.set(this,""),Pr.set(this,0),t??(t={}),typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(!ve(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof t!="object"&&!ve(t))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let r=new TextEncoder;for(let o of e){let i;ArrayBuffer.isView(o)?i=new Uint8Array(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)):o instanceof ArrayBuffer?i=new Uint8Array(o.slice(0)):o instanceof dr?i=o:i=r.encode(String(o)),el(this,Pr,_t(this,Pr,"f")+(ArrayBuffer.isView(i)?i.byteLength:i.size),"f"),_t(this,qt,"f").push(i)}let n=t.type===void 0?"":String(t.type);el(this,Cn,/^[\x20-\x7E]*$/.test(n)?n:"","f")}static[(qt=new WeakMap,Cn=new WeakMap,Pr=new WeakMap,Symbol.hasInstance)](e){return Boolean(e&&typeof e=="object"&&ve(e.constructor)&&(ve(e.stream)||ve(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}get type(){return _t(this,Cn,"f")}get size(){return _t(this,Pr,"f")}slice(e,t,r){return new dr(jy(_t(this,qt,"f"),this.size,e,t),{type:r})}async text(){let e=new TextDecoder,t="";for await(let r of ui(_t(this,qt,"f")))t+=e.decode(r,{stream:!0});return t+=e.decode(),t}async arrayBuffer(){let e=new Uint8Array(this.size),t=0;for await(let r of ui(_t(this,qt,"f")))e.set(r,t),t+=r.length;return e.buffer}stream(){let e=ui(_t(this,qt,"f"),!0);return new we({async pull(t){let{value:r,done:n}=await e.next();if(n)return queueMicrotask(()=>t.close());t.enqueue(r)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(dr.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var Iy=e=>e instanceof dr,tl=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},rl=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},jn,In,eo=class extends dr{constructor(e,t,r={}){if(super(e,r),jn.set(this,void 0),In.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);tl(this,jn,String(t),"f");let n=r.lastModified===void 0?Date.now():Number(r.lastModified);Number.isNaN(n)||tl(this,In,n,"f")}static[(jn=new WeakMap,In=new WeakMap,Symbol.hasInstance)](e){return e instanceof dr&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}get name(){return rl(this,jn,"f")}get webkitRelativePath(){return""}get lastModified(){return rl(this,In,"f")}get[Symbol.toStringTag](){return"File"}},$y=e=>e instanceof eo,nt=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},$n,ot,ci,My=class{constructor(){$n.add(this),ot.set(this,new Map)}static[(ot=new WeakMap,$n=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let t=e;return Boolean(ve(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&ve(t.append)&&ve(t.set)&&ve(t.get)&&ve(t.getAll)&&ve(t.has)&&ve(t.delete)&&ve(t.entries)&&ve(t.values)&&ve(t.keys)&&ve(t[Symbol.iterator])&&ve(t.forEach))}append(e,t,r){nt(this,$n,"m",ci).call(this,{name:e,fileName:r,append:!0,rawValue:t,argsLength:arguments.length})}set(e,t,r){nt(this,$n,"m",ci).call(this,{name:e,fileName:r,append:!1,rawValue:t,argsLength:arguments.length})}get(e){let t=nt(this,ot,"f").get(String(e));return t?t[0]:null}getAll(e){let t=nt(this,ot,"f").get(String(e));return t?t.slice():[]}has(e){return nt(this,ot,"f").has(String(e))}delete(e){nt(this,ot,"f").delete(String(e))}*keys(){for(let e of nt(this,ot,"f").keys())yield e}*entries(){for(let e of this.keys()){let t=this.getAll(e);for(let r of t)yield[e,r]}}*values(){for(let[,e]of this)yield e}[(ci=function({name:e,rawValue:t,append:r,fileName:n,argsLength:o}){let i=r?"append":"set";if(o<2)throw new TypeError(`Failed to execute '${i}' on 'FormData': 2 arguments required, but only ${o} present.`);e=String(e);let s;if($y(t))s=n===void 0?t:new eo([t],n,{type:t.type,lastModified:t.lastModified});else if(Iy(t))s=new eo([t],n===void 0?"blob":n,{type:t.type});else{if(n)throw new TypeError(`Failed to execute '${i}' on 'FormData': parameter 2 is not of type 'Blob'.`);s=String(t)}let a=nt(this,ot,"f").get(e);if(!a)return void nt(this,ot,"f").set(e,[s]);if(!r)return void nt(this,ot,"f").set(e,[s]);a.push(s)},Symbol.iterator)](){return this.entries()}forEach(e,t){for(let[r,n]of this)e.call(t,n,r,this)}get[Symbol.toStringTag](){return"FormData"}},Ly=require("node:fs"),Gu=require("node:fs/promises"),Ny=require("node:path"),By=me(wf(),1),Uy=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function zy(e){if(Uy(e)!=="object")return!1;let t=Object.getPrototypeOf(e);return t==null?!0:(t.constructor&&t.constructor.toString())===Object.toString()}var Dy=zy,nl=function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},Ct=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},jt,rr,Hy="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",Ju=class{constructor(e){jt.set(this,void 0),rr.set(this,void 0),nl(this,jt,e.path,"f"),nl(this,rr,e.start||0,"f"),this.name=(0,Ny.basename)(Ct(this,jt,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,t){return new Ju({path:Ct(this,jt,"f"),lastModified:this.lastModified,start:Ct(this,rr,"f")+e,size:t-e})}async*stream(){let{mtimeMs:e}=await(0,Gu.stat)(Ct(this,jt,"f"));if(e>this.lastModified)throw new By.default(Hy,"NotReadableError");this.size&&(yield*(0,Ly.createReadStream)(Ct(this,jt,"f"),{start:Ct(this,rr,"f"),end:Ct(this,rr,"f")+this.size-1}))}get[(jt=new WeakMap,rr=new WeakMap,Symbol.toStringTag)](){return"File"}};function Fy(e,{mtimeMs:t,size:r},n,o={}){let i;Dy(n)?[o,i]=[n,void 0]:i=n;let s=new Ju({path:e,size:r,lastModified:t});return i||(i=s.name),new eo([s],i,{...o,lastModified:s.lastModified})}async function Wy(e,t,r){let n=await(0,Gu.stat)(e);return Fy(e,n,t,r)}var Vy=me(Nf(),1),ns={apiKey:"API Key is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key",apiSecret:"API Secret is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key"},Gy=Object.keys(ns),ol="https://addons.mozilla.org/api",Jy=class{options={};get productEndpoint(){return`${ol}/v5/addons/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let t of Gy){if(!e[t])throw new Error(ns[t]);this.options[t]=e[t]}typeof e.extId=="string"&&e.extId.length>0&&!e.extId.includes("@")&&(e.extId.startsWith("{")||(e.extId="{"+e.extId),e.extId.endsWith("}")||(e.extId+="}")),this.options.extId=e.extId}submit=async({filePath:e,version:t="1.0.0"})=>{let r=`${this.productEndpoint}/versions/${encodeURIComponent(t)}/`,n=new My;n.append("upload",await Wy(e));let o=await this.getAccessToken(),i=await De.put(r,{throwHttpErrors:!1,body:n,headers:{Authorization:`JWT ${o}`}});if(i.statusCode>=400)throw i.statusCode===401?new Error("Invalid access token"):i.statusCode===403?new Error("You do not own this add-on"):i.statusCode===409?new Error(`Version ${t} already exists`):(console.log(i.body),new Error(JSON.parse(i.body).error||"Unknown error"));return JSON.parse(i.body)};getUploadStatus=async({version:e="1.0.0"})=>{let t=await this.getAccessToken(),r=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return De.get(r,{headers:{Authorization:`JWT ${t}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),t=`${ol}/v5/accounts/profile`;return De.get(t,{headers:{Authorization:`JWT ${e}`}}).json()};getAccessToken=async()=>{let e=Math.floor(Date.now()/1e3),t={iss:this.options.apiKey,jti:Math.random().toString(),iat:e,exp:e+60*5};return Vy.default.sign(t,this.options.apiSecret,{algorithm:"HS256"})}},Nr="firefox",Ky=Li(Nr);function Qy(e){return Vt(this,null,function*(){var t=e,{extId:r,zip:n,dryRun:o}=t,i=Ri(t,["extId","zip","dryRun"]),s,a,l,u;let d=oo(n),h=((a=(s=d.browser_specific_settings)==null?void 0:s.gecko)==null?void 0:a.id)||((u=(l=d.applications)==null?void 0:l.gecko)==null?void 0:u.id)||r,c=new Jy(Oi({extId:h},i));if(Ky(`Updating extension with ID ${h}`),o)return!0;try{return yield c.submit({filePath:n,version:d.version}),Mi({extId:h,market:Nr,zip:n}),!0}catch(p){throw Ni(p,Nr,`"${h}" (${d.name})`)}})}function Yy(e){return Vt(this,null,function*(){return e.zip=no(e),e.verbose&&io(Nr),so({market:Nr,options:e,errorMap:ns}),Qy(e)})}var Xy={packageId:"No package ID is provided, e.g. https://addons.opera.com/developer/package/PACKAGE_ID",sessionid:`No "sessionid" is provided. If you have a hard time obtaining it, run: + "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,h="secret must be a string or buffer",p="key must be a string or a buffer",y="key must be a string, a buffer or an object",d=typeof s.createPublicKey=="function";d&&(p+=" or a KeyObject",h+="or a KeyObject");function m(E){if(!i.isBuffer(E)&&typeof E!="string"&&(!d||typeof E!="object"||typeof E.type!="string"||typeof E.asymmetricKeyType!="string"||typeof E.export!="function"))throw V(p)}function _(E){if(!i.isBuffer(E)&&typeof E!="string"&&typeof E!="object")throw V(y)}function A(E){if(!i.isBuffer(E)){if(typeof E=="string")return E;if(!d||typeof E!="object"||E.type!=="secret"||typeof E.export!="function")throw V(h)}}function P(E){return E.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function R(E){E=E.toString();var N=4-E.length%4;if(N!==4)for(var F=0;F{var n=require("buffer").Buffer;r.exports=function(i){return typeof i=="string"?i:typeof i=="number"||n.isBuffer(i)?i.toString():JSON.stringify(i)}}),WT=Q((e,r)=>{var n=ti().Buffer,i=vm(),s=bm(),u=require("stream"),l=_m(),c=require("util");function h(m,_){return n.from(m,_).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function p(m,_,A){A=A||"utf8";var P=h(l(m),"binary"),R=h(l(_),A);return c.format("%s.%s",P,R)}function y(m){var _=m.header,A=m.payload,P=m.secret||m.privateKey,R=m.encoding,V=s(_.alg),z=p(_,A,R),S=V.sign(z,P);return c.format("%s.%s",z,S)}function d(m){var _=m.secret||m.privateKey||m.key,A=new i(_);this.readable=!0,this.header=m.header,this.encoding=m.encoding,this.secret=this.privateKey=this.key=A,this.payload=new i(m.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}c.inherits(d,u),d.prototype.sign=function(){try{var m=y({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",m),this.emit("data",m),this.emit("end"),this.readable=!1,m}catch(_){this.readable=!1,this.emit("error",_),this.emit("close")}},d.sign=y,r.exports=d}),VT=Q((e,r)=>{var n=ti().Buffer,i=vm(),s=bm(),u=require("stream"),l=_m(),c=require("util"),h=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function p(S){return Object.prototype.toString.call(S)==="[object Object]"}function y(S){if(p(S))return S;try{return JSON.parse(S)}catch{return}}function d(S){var B=S.split(".",1)[0];return y(n.from(B,"base64").toString("binary"))}function m(S){return S.split(".",2).join(".")}function _(S){return S.split(".")[2]}function A(S,B){B=B||"utf8";var v=S.split(".")[1];return n.from(v,"base64").toString(B)}function P(S){return h.test(S)&&!!d(S)}function R(S,B,v){if(!B){var q=new Error("Missing algorithm parameter for jws.verify");throw q.code="MISSING_ALGORITHM",q}S=l(S);var C=_(S),k=m(S),L=s(B);return L.verify(k,C,v)}function V(S,B){if(B=B||{},S=l(S),!P(S))return null;var v=d(S);if(!v)return null;var q=A(S);return(v.typ==="JWT"||B.json)&&(q=JSON.parse(q,B.encoding)),{header:v,payload:q,signature:_(S)}}function z(S){S=S||{};var B=S.secret||S.publicKey||S.key,v=new i(B);this.readable=!0,this.algorithm=S.algorithm,this.encoding=S.encoding,this.secret=this.publicKey=this.key=v,this.signature=new i(S.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}c.inherits(z,u),z.prototype.verify=function(){try{var S=R(this.signature.buffer,this.algorithm,this.key.buffer),B=V(this.signature.buffer,this.encoding);return this.emit("done",S,B),this.emit("data",S),this.emit("end"),this.readable=!1,S}catch(v){this.readable=!1,this.emit("error",v),this.emit("close")}},z.decode=V,z.isValid=P,z.verify=R,r.exports=z}),Ml=Q(e=>{var r=WT(),n=VT(),i=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];e.ALGORITHMS=i,e.sign=r.sign,e.verify=n.verify,e.decode=n.decode,e.isValid=n.isValid,e.createSign=function(s){return new r(s)},e.createVerify=function(s){return new n(s)}}),wm=Q((e,r)=>{var n=Ml();r.exports=function(i,s){s=s||{};var u=n.decode(i,s);if(!u)return null;var l=u.payload;if(typeof l=="string")try{var c=JSON.parse(l);c!==null&&typeof c=="object"&&(l=c)}catch{}return s.complete===!0?{header:u.header,payload:l,signature:u.signature}:l}}),GT=Q((e,r)=>{var n=1e3,i=n*60,s=i*60,u=s*24,l=u*7,c=u*365.25;r.exports=function(m,_){_=_||{};var A=typeof m;if(A==="string"&&m.length>0)return h(m);if(A==="number"&&isFinite(m))return _.long?y(m):p(m);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(m))};function h(m){if(m=String(m),!(m.length>100)){var _=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(m);if(_){var A=parseFloat(_[1]),P=(_[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return A*c;case"weeks":case"week":case"w":return A*l;case"days":case"day":case"d":return A*u;case"hours":case"hour":case"hrs":case"hr":case"h":return A*s;case"minutes":case"minute":case"mins":case"min":case"m":return A*i;case"seconds":case"second":case"secs":case"sec":case"s":return A*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function p(m){var _=Math.abs(m);return _>=u?Math.round(m/u)+"d":_>=s?Math.round(m/s)+"h":_>=i?Math.round(m/i)+"m":_>=n?Math.round(m/n)+"s":m+"ms"}function y(m){var _=Math.abs(m);return _>=u?d(m,_,u,"day"):_>=s?d(m,_,s,"hour"):_>=i?d(m,_,i,"minute"):_>=n?d(m,_,n,"second"):m+" ms"}function d(m,_,A,P){var R=_>=A*1.5;return Math.round(m/A)+" "+P+(R?"s":"")}}),Em=Q((e,r)=>{var n=GT();r.exports=function(i,s){var u=s||Math.floor(Date.now()/1e3);if(typeof i=="string"){var l=n(i);return typeof l>"u"?void 0:Math.floor(u+l/1e3)}else return typeof i=="number"?u+i:void 0}}),Ks=Q((e,r)=>{var n="2.0.0",i=Number.MAX_SAFE_INTEGER||9007199254740991,s=16;r.exports={SEMVER_SPEC_VERSION:n,MAX_LENGTH:256,MAX_SAFE_INTEGER:i,MAX_SAFE_COMPONENT_LENGTH:s}}),Js=Q((e,r)=>{var n=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...i)=>console.error("SEMVER",...i):()=>{};r.exports=n}),io=Q((e,r)=>{var{MAX_SAFE_COMPONENT_LENGTH:n}=Ks(),i=Js();e=r.exports={};var s=e.re=[],u=e.src=[],l=e.t={},c=0,h=(p,y,d)=>{let m=c++;i(p,m,y),l[p]=m,u[m]=y,s[m]=new RegExp(y,d?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","[0-9]+"),h("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),h("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),h("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER","[0-9A-Za-z-]+"),h("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),h("FULL",`^${u[l.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),h("LOOSE",`^${u[l.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),h("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),h("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),h("COERCERTL",u[l.COERCE],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",h("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",h("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),Ys=Q((e,r)=>{var n=["includePrerelease","loose","rtl"],i=s=>s?typeof s!="object"?{loose:!0}:n.filter(u=>s[u]).reduce((u,l)=>(u[l]=!0,u),{}):{};r.exports=i}),Sm=Q((e,r)=>{var n=/^[0-9]+$/,i=(u,l)=>{let c=n.test(u),h=n.test(l);return c&&h&&(u=+u,l=+l),u===l?0:c&&!h?-1:h&&!c?1:ui(l,u);r.exports={compareIdentifiers:i,rcompareIdentifiers:s}}),ht=Q((e,r)=>{var n=Js(),{MAX_LENGTH:i,MAX_SAFE_INTEGER:s}=Ks(),{re:u,t:l}=io(),c=Ys(),{compareIdentifiers:h}=Sm(),p=class{constructor(y,d){if(d=c(d),y instanceof p){if(y.loose===!!d.loose&&y.includePrerelease===!!d.includePrerelease)return y;y=y.version}else if(typeof y!="string")throw new TypeError(`Invalid Version: ${y}`);if(y.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",y,d),this.options=d,this.loose=!!d.loose,this.includePrerelease=!!d.includePrerelease;let m=y.trim().match(d.loose?u[l.LOOSE]:u[l.FULL]);if(!m)throw new TypeError(`Invalid Version: ${y}`);if(this.raw=y,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(_=>{if(/^[0-9]+$/.test(_)){let A=+_;if(A>=0&&A=0;)typeof this.prerelease[m]=="number"&&(this.prerelease[m]++,m=-2);m===-1&&this.prerelease.push(0)}d&&(h(this.prerelease[0],d)===0?isNaN(this.prerelease[1])&&(this.prerelease=[d,0]):this.prerelease=[d,0]);break;default:throw new Error(`invalid increment argument: ${y}`)}return this.format(),this.raw=this.version,this}};r.exports=p}),so=Q((e,r)=>{var{MAX_LENGTH:n}=Ks(),{re:i,t:s}=io(),u=ht(),l=Ys(),c=(h,p)=>{if(p=l(p),h instanceof u)return h;if(typeof h!="string"||h.length>n||!(p.loose?i[s.LOOSE]:i[s.FULL]).test(h))return null;try{return new u(h,p)}catch{return null}};r.exports=c}),KT=Q((e,r)=>{var n=so(),i=(s,u)=>{let l=n(s,u);return l?l.version:null};r.exports=i}),JT=Q((e,r)=>{var n=so(),i=(s,u)=>{let l=n(s.trim().replace(/^[=v]+/,""),u);return l?l.version:null};r.exports=i}),YT=Q((e,r)=>{var n=ht(),i=(s,u,l,c)=>{typeof l=="string"&&(c=l,l=void 0);try{return new n(s instanceof n?s.version:s,l).inc(u,c).version}catch{return null}};r.exports=i}),Xt=Q((e,r)=>{var n=ht(),i=(s,u,l)=>new n(s,l).compare(new n(u,l));r.exports=i}),Bl=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)===0;r.exports=i}),QT=Q((e,r)=>{var n=so(),i=Bl(),s=(u,l)=>{if(i(u,l))return null;{let c=n(u),h=n(l),p=c.prerelease.length||h.prerelease.length,y=p?"pre":"",d=p?"prerelease":"";for(let m in c)if((m==="major"||m==="minor"||m==="patch")&&c[m]!==h[m])return y+m;return d}};r.exports=s}),XT=Q((e,r)=>{var n=ht(),i=(s,u)=>new n(s,u).major;r.exports=i}),ZT=Q((e,r)=>{var n=ht(),i=(s,u)=>new n(s,u).minor;r.exports=i}),eR=Q((e,r)=>{var n=ht(),i=(s,u)=>new n(s,u).patch;r.exports=i}),tR=Q((e,r)=>{var n=so(),i=(s,u)=>{let l=n(s,u);return l&&l.prerelease.length?l.prerelease:null};r.exports=i}),rR=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(u,s,l);r.exports=i}),nR=Q((e,r)=>{var n=Xt(),i=(s,u)=>n(s,u,!0);r.exports=i}),Dl=Q((e,r)=>{var n=ht(),i=(s,u,l)=>{let c=new n(s,l),h=new n(u,l);return c.compare(h)||c.compareBuild(h)};r.exports=i}),oR=Q((e,r)=>{var n=Dl(),i=(s,u)=>s.sort((l,c)=>n(l,c,u));r.exports=i}),iR=Q((e,r)=>{var n=Dl(),i=(s,u)=>s.sort((l,c)=>n(c,l,u));r.exports=i}),Qs=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)>0;r.exports=i}),zl=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)<0;r.exports=i}),Tm=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)!==0;r.exports=i}),Fl=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)>=0;r.exports=i}),Ul=Q((e,r)=>{var n=Xt(),i=(s,u,l)=>n(s,u,l)<=0;r.exports=i}),Rm=Q((e,r)=>{var n=Bl(),i=Tm(),s=Qs(),u=Fl(),l=zl(),c=Ul(),h=(p,y,d,m)=>{switch(y){case"===":return typeof p=="object"&&(p=p.version),typeof d=="object"&&(d=d.version),p===d;case"!==":return typeof p=="object"&&(p=p.version),typeof d=="object"&&(d=d.version),p!==d;case"":case"=":case"==":return n(p,d,m);case"!=":return i(p,d,m);case">":return s(p,d,m);case">=":return u(p,d,m);case"<":return l(p,d,m);case"<=":return c(p,d,m);default:throw new TypeError(`Invalid operator: ${y}`)}};r.exports=h}),sR=Q((e,r)=>{var n=ht(),i=so(),{re:s,t:u}=io(),l=(c,h)=>{if(c instanceof n)return c;if(typeof c=="number"&&(c=String(c)),typeof c!="string")return null;h=h||{};let p=null;if(!h.rtl)p=c.match(s[u.COERCE]);else{let y;for(;(y=s[u.COERCERTL].exec(c))&&(!p||p.index+p[0].length!==c.length);)(!p||y.index+y[0].length!==p.index+p[0].length)&&(p=y),s[u.COERCERTL].lastIndex=y.index+y[1].length+y[2].length;s[u.COERCERTL].lastIndex=-1}return p===null?null:i(`${p[2]}.${p[3]||"0"}.${p[4]||"0"}`,h)};r.exports=l}),aR=Q((e,r)=>{"use strict";r.exports=function(n){n.prototype[Symbol.iterator]=function*(){for(let i=this.head;i;i=i.next)yield i.value}}}),uR=Q((e,r)=>{"use strict";r.exports=n,n.Node=l,n.create=n;function n(c){var h=this;if(h instanceof n||(h=new n),h.tail=null,h.head=null,h.length=0,c&&typeof c.forEach=="function")c.forEach(function(d){h.push(d)});else if(arguments.length>0)for(var p=0,y=arguments.length;p1)p=h;else if(this.head)y=this.head.next,p=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=0;y!==null;d++)p=c(p,y.value,d),y=y.next;return p},n.prototype.reduceReverse=function(c,h){var p,y=this.tail;if(arguments.length>1)p=h;else if(this.tail)y=this.tail.prev,p=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=this.length-1;y!==null;d--)p=c(p,y.value,d),y=y.prev;return p},n.prototype.toArray=function(){for(var c=new Array(this.length),h=0,p=this.head;p!==null;h++)c[h]=p.value,p=p.next;return c},n.prototype.toArrayReverse=function(){for(var c=new Array(this.length),h=0,p=this.tail;p!==null;h++)c[h]=p.value,p=p.prev;return c},n.prototype.slice=function(c,h){h=h||this.length,h<0&&(h+=this.length),c=c||0,c<0&&(c+=this.length);var p=new n;if(hthis.length&&(h=this.length);for(var y=0,d=this.head;d!==null&&ythis.length&&(h=this.length);for(var y=this.length,d=this.tail;d!==null&&y>h;y--)d=d.prev;for(;d!==null&&y>c;y--,d=d.prev)p.push(d.value);return p},n.prototype.splice=function(c,h,...p){c>this.length&&(c=this.length-1),c<0&&(c=this.length+c);for(var y=0,d=this.head;d!==null&&y{"use strict";var n=uR(),i=Symbol("max"),s=Symbol("length"),u=Symbol("lengthCalculator"),l=Symbol("allowStale"),c=Symbol("maxAge"),h=Symbol("dispose"),p=Symbol("noDisposeOnSet"),y=Symbol("lruList"),d=Symbol("cache"),m=Symbol("updateAgeOnGet"),_=()=>1,A=class{constructor(v){if(typeof v=="number"&&(v={max:v}),v||(v={}),v.max&&(typeof v.max!="number"||v.max<0))throw new TypeError("max must be a non-negative number");let q=this[i]=v.max||1/0,C=v.length||_;if(this[u]=typeof C!="function"?_:C,this[l]=v.stale||!1,v.maxAge&&typeof v.maxAge!="number")throw new TypeError("maxAge must be a number");this[c]=v.maxAge||0,this[h]=v.dispose,this[p]=v.noDisposeOnSet||!1,this[m]=v.updateAgeOnGet||!1,this.reset()}set max(v){if(typeof v!="number"||v<0)throw new TypeError("max must be a non-negative number");this[i]=v||1/0,V(this)}get max(){return this[i]}set allowStale(v){this[l]=!!v}get allowStale(){return this[l]}set maxAge(v){if(typeof v!="number")throw new TypeError("maxAge must be a non-negative number");this[c]=v,V(this)}get maxAge(){return this[c]}set lengthCalculator(v){typeof v!="function"&&(v=_),v!==this[u]&&(this[u]=v,this[s]=0,this[y].forEach(q=>{q.length=this[u](q.value,q.key),this[s]+=q.length})),V(this)}get lengthCalculator(){return this[u]}get length(){return this[s]}get itemCount(){return this[y].length}rforEach(v,q){q=q||this;for(let C=this[y].tail;C!==null;){let k=C.prev;B(this,v,C,q),C=k}}forEach(v,q){q=q||this;for(let C=this[y].head;C!==null;){let k=C.next;B(this,v,C,q),C=k}}keys(){return this[y].toArray().map(v=>v.key)}values(){return this[y].toArray().map(v=>v.value)}reset(){this[h]&&this[y]&&this[y].length&&this[y].forEach(v=>this[h](v.key,v.value)),this[d]=new Map,this[y]=new n,this[s]=0}dump(){return this[y].map(v=>R(this,v)?!1:{k:v.key,v:v.value,e:v.now+(v.maxAge||0)}).toArray().filter(v=>v)}dumpLru(){return this[y]}set(v,q,C){if(C=C||this[c],C&&typeof C!="number")throw new TypeError("maxAge must be a number");let k=C?Date.now():0,L=this[u](q,v);if(this[d].has(v)){if(L>this[i])return z(this,this[d].get(v)),!1;let Y=this[d].get(v).value;return this[h]&&(this[p]||this[h](v,Y.value)),Y.now=k,Y.maxAge=C,Y.value=q,this[s]+=L-Y.length,Y.length=L,this.get(v),V(this),!0}let H=new S(v,q,L,k,C);return H.length>this[i]?(this[h]&&this[h](v,q),!1):(this[s]+=H.length,this[y].unshift(H),this[d].set(v,this[y].head),V(this),!0)}has(v){if(!this[d].has(v))return!1;let q=this[d].get(v).value;return!R(this,q)}get(v){return P(this,v,!0)}peek(v){return P(this,v,!1)}pop(){let v=this[y].tail;return v?(z(this,v),v.value):null}del(v){z(this,this[d].get(v))}load(v){this.reset();let q=Date.now();for(let C=v.length-1;C>=0;C--){let k=v[C],L=k.e||0;if(L===0)this.set(k.k,k.v);else{let H=L-q;H>0&&this.set(k.k,k.v,H)}}}prune(){this[d].forEach((v,q)=>P(this,q,!1))}},P=(v,q,C)=>{let k=v[d].get(q);if(k){let L=k.value;if(R(v,L)){if(z(v,k),!v[l])return}else C&&(v[m]&&(k.value.now=Date.now()),v[y].unshiftNode(k));return L.value}},R=(v,q)=>{if(!q||!q.maxAge&&!v[c])return!1;let C=Date.now()-q.now;return q.maxAge?C>q.maxAge:v[c]&&C>v[c]},V=v=>{if(v[s]>v[i])for(let q=v[y].tail;v[s]>v[i]&&q!==null;){let C=q.prev;z(v,q),q=C}},z=(v,q)=>{if(q){let C=q.value;v[h]&&v[h](C.key,C.value),v[s]-=C.length,v[d].delete(C.key),v[y].removeNode(q)}},S=class{constructor(v,q,C,k,L){this.key=v,this.value=q,this.length=C,this.now=k,this.maxAge=L||0}},B=(v,q,C,k)=>{let L=C.value;R(v,L)&&(z(v,C),v[l]||(L=void 0)),L&&q.call(k,L.value,L.key,v)};r.exports=A}),Zt=Q((e,r)=>{var n=class{constructor(T,E){if(E=u(E),T instanceof n)return T.loose===!!E.loose&&T.includePrerelease===!!E.includePrerelease?T:new n(T.raw,E);if(T instanceof l)return this.raw=T.value,this.set=[[T]],this.format(),this;if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=T,this.set=T.split("||").map(N=>this.parseRange(N.trim())).filter(N=>N.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${T}`);if(this.set.length>1){let N=this.set[0];if(this.set=this.set.filter(F=>!A(F[0])),this.set.length===0)this.set=[N];else if(this.set.length>1){for(let F of this.set)if(F.length===1&&P(F[0])){this.set=[F];break}}}this.format()}format(){return this.range=this.set.map(T=>T.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(T){T=T.trim();let E=`parseRange:${Object.keys(this.options).join(",")}:${T}`,N=s.get(E);if(N)return N;let F=this.options.loose,j=F?p[y.HYPHENRANGELOOSE]:p[y.HYPHENRANGE];T=T.replace(j,Y(this.options.includePrerelease)),c("hyphen replace",T),T=T.replace(p[y.COMPARATORTRIM],d),c("comparator trim",T),T=T.replace(p[y.TILDETRIM],m),T=T.replace(p[y.CARETTRIM],_),T=T.split(/\s+/).join(" ");let W=T.split(" ").map(ie=>V(ie,this.options)).join(" ").split(/\s+/).map(ie=>H(ie,this.options));F&&(W=W.filter(ie=>(c("loose invalid filter",ie,this.options),!!ie.match(p[y.COMPARATORLOOSE])))),c("range list",W);let ee=new Map,se=W.map(ie=>new l(ie,this.options));for(let ie of se){if(A(ie))return[ie];ee.set(ie.value,ie)}ee.size>1&&ee.has("")&&ee.delete("");let te=[...ee.values()];return s.set(E,te),te}intersects(T,E){if(!(T instanceof n))throw new TypeError("a Range is required");return this.set.some(N=>R(N,E)&&T.set.some(F=>R(F,E)&&N.every(j=>F.every(W=>j.intersects(W,E)))))}test(T){if(!T)return!1;if(typeof T=="string")try{T=new h(T,this.options)}catch{return!1}for(let E=0;ET.value==="<0.0.0-0",P=T=>T.value==="",R=(T,E)=>{let N=!0,F=T.slice(),j=F.pop();for(;N&&F.length;)N=F.every(W=>j.intersects(W,E)),j=F.pop();return N},V=(T,E)=>(c("comp",T,E),T=v(T,E),c("caret",T),T=S(T,E),c("tildes",T),T=C(T,E),c("xrange",T),T=L(T,E),c("stars",T),T),z=T=>!T||T.toLowerCase()==="x"||T==="*",S=(T,E)=>T.trim().split(/\s+/).map(N=>B(N,E)).join(" "),B=(T,E)=>{let N=E.loose?p[y.TILDELOOSE]:p[y.TILDE];return T.replace(N,(F,j,W,ee,se)=>{c("tilde",T,F,j,W,ee,se);let te;return z(j)?te="":z(W)?te=`>=${j}.0.0 <${+j+1}.0.0-0`:z(ee)?te=`>=${j}.${W}.0 <${j}.${+W+1}.0-0`:se?(c("replaceTilde pr",se),te=`>=${j}.${W}.${ee}-${se} <${j}.${+W+1}.0-0`):te=`>=${j}.${W}.${ee} <${j}.${+W+1}.0-0`,c("tilde return",te),te})},v=(T,E)=>T.trim().split(/\s+/).map(N=>q(N,E)).join(" "),q=(T,E)=>{c("caret",T,E);let N=E.loose?p[y.CARETLOOSE]:p[y.CARET],F=E.includePrerelease?"-0":"";return T.replace(N,(j,W,ee,se,te)=>{c("caret",T,j,W,ee,se,te);let ie;return z(W)?ie="":z(ee)?ie=`>=${W}.0.0${F} <${+W+1}.0.0-0`:z(se)?W==="0"?ie=`>=${W}.${ee}.0${F} <${W}.${+ee+1}.0-0`:ie=`>=${W}.${ee}.0${F} <${+W+1}.0.0-0`:te?(c("replaceCaret pr",te),W==="0"?ee==="0"?ie=`>=${W}.${ee}.${se}-${te} <${W}.${ee}.${+se+1}-0`:ie=`>=${W}.${ee}.${se}-${te} <${W}.${+ee+1}.0-0`:ie=`>=${W}.${ee}.${se}-${te} <${+W+1}.0.0-0`):(c("no pr"),W==="0"?ee==="0"?ie=`>=${W}.${ee}.${se}${F} <${W}.${ee}.${+se+1}-0`:ie=`>=${W}.${ee}.${se}${F} <${W}.${+ee+1}.0-0`:ie=`>=${W}.${ee}.${se} <${+W+1}.0.0-0`),c("caret return",ie),ie})},C=(T,E)=>(c("replaceXRanges",T,E),T.split(/\s+/).map(N=>k(N,E)).join(" ")),k=(T,E)=>{T=T.trim();let N=E.loose?p[y.XRANGELOOSE]:p[y.XRANGE];return T.replace(N,(F,j,W,ee,se,te)=>{c("xRange",T,F,j,W,ee,se,te);let ie=z(W),Ae=ie||z(ee),Fe=Ae||z(se),Ue=Fe;return j==="="&&Ue&&(j=""),te=E.includePrerelease?"-0":"",ie?j===">"||j==="<"?F="<0.0.0-0":F="*":j&&Ue?(Ae&&(ee=0),se=0,j===">"?(j=">=",Ae?(W=+W+1,ee=0,se=0):(ee=+ee+1,se=0)):j==="<="&&(j="<",Ae?W=+W+1:ee=+ee+1),j==="<"&&(te="-0"),F=`${j+W}.${ee}.${se}${te}`):Ae?F=`>=${W}.0.0${te} <${+W+1}.0.0-0`:Fe&&(F=`>=${W}.${ee}.0${te} <${W}.${+ee+1}.0-0`),c("xRange return",F),F})},L=(T,E)=>(c("replaceStars",T,E),T.trim().replace(p[y.STAR],"")),H=(T,E)=>(c("replaceGTE0",T,E),T.trim().replace(p[E.includePrerelease?y.GTE0PRE:y.GTE0],"")),Y=T=>(E,N,F,j,W,ee,se,te,ie,Ae,Fe,Ue,Ot)=>(z(F)?N="":z(j)?N=`>=${F}.0.0${T?"-0":""}`:z(W)?N=`>=${F}.${j}.0${T?"-0":""}`:ee?N=`>=${N}`:N=`>=${N}${T?"-0":""}`,z(ie)?te="":z(Ae)?te=`<${+ie+1}.0.0-0`:z(Fe)?te=`<${ie}.${+Ae+1}.0-0`:Ue?te=`<=${ie}.${Ae}.${Fe}-${Ue}`:T?te=`<${ie}.${Ae}.${+Fe+1}-0`:te=`<=${te}`,`${N} ${te}`.trim()),ne=(T,E,N)=>{for(let F=0;F0){let j=T[F].semver;if(j.major===E.major&&j.minor===E.minor&&j.patch===E.patch)return!0}return!1}return!0}}),Xs=Q((e,r)=>{var n=Symbol("SemVer ANY"),i=class{static get ANY(){return n}constructor(d,m){if(m=s(m),d instanceof i){if(d.loose===!!m.loose)return d;d=d.value}h("comparator",d,m),this.options=m,this.loose=!!m.loose,this.parse(d),this.semver===n?this.value="":this.value=this.operator+this.semver.version,h("comp",this)}parse(d){let m=this.options.loose?u[l.COMPARATORLOOSE]:u[l.COMPARATOR],_=d.match(m);if(!_)throw new TypeError(`Invalid comparator: ${d}`);this.operator=_[1]!==void 0?_[1]:"",this.operator==="="&&(this.operator=""),_[2]?this.semver=new p(_[2],this.options.loose):this.semver=n}toString(){return this.value}test(d){if(h("Comparator.test",d,this.options.loose),this.semver===n||d===n)return!0;if(typeof d=="string")try{d=new p(d,this.options)}catch{return!1}return c(d,this.operator,this.semver,this.options)}intersects(d,m){if(!(d instanceof i))throw new TypeError("a Comparator is required");if((!m||typeof m!="object")&&(m={loose:!!m,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new y(d.value,m).test(this.value);if(d.operator==="")return d.value===""?!0:new y(this.value,m).test(d.semver);let _=(this.operator===">="||this.operator===">")&&(d.operator===">="||d.operator===">"),A=(this.operator==="<="||this.operator==="<")&&(d.operator==="<="||d.operator==="<"),P=this.semver.version===d.semver.version,R=(this.operator===">="||this.operator==="<=")&&(d.operator===">="||d.operator==="<="),V=c(this.semver,"<",d.semver,m)&&(this.operator===">="||this.operator===">")&&(d.operator==="<="||d.operator==="<"),z=c(this.semver,">",d.semver,m)&&(this.operator==="<="||this.operator==="<")&&(d.operator===">="||d.operator===">");return _||A||P&&R||V||z}};r.exports=i;var s=Ys(),{re:u,t:l}=io(),c=Rm(),h=Js(),p=ht(),y=Zt()}),Zs=Q((e,r)=>{var n=Zt(),i=(s,u,l)=>{try{u=new n(u,l)}catch{return!1}return u.test(s)};r.exports=i}),cR=Q((e,r)=>{var n=Zt(),i=(s,u)=>new n(s,u).set.map(l=>l.map(c=>c.value).join(" ").trim().split(" "));r.exports=i}),hR=Q((e,r)=>{var n=ht(),i=Zt(),s=(u,l,c)=>{let h=null,p=null,y=null;try{y=new i(l,c)}catch{return null}return u.forEach(d=>{y.test(d)&&(!h||p.compare(d)===-1)&&(h=d,p=new n(h,c))}),h};r.exports=s}),fR=Q((e,r)=>{var n=ht(),i=Zt(),s=(u,l,c)=>{let h=null,p=null,y=null;try{y=new i(l,c)}catch{return null}return u.forEach(d=>{y.test(d)&&(!h||p.compare(d)===1)&&(h=d,p=new n(h,c))}),h};r.exports=s}),dR=Q((e,r)=>{var n=ht(),i=Zt(),s=Qs(),u=(l,c)=>{l=new i(l,c);let h=new n("0.0.0");if(l.test(h)||(h=new n("0.0.0-0"),l.test(h)))return h;h=null;for(let p=0;p{let _=new n(m.semver.version);switch(m.operator){case">":_.prerelease.length===0?_.patch++:_.prerelease.push(0),_.raw=_.format();case"":case">=":(!d||s(_,d))&&(d=_);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${m.operator}`)}}),d&&(!h||s(h,d))&&(h=d)}return h&&l.test(h)?h:null};r.exports=u}),pR=Q((e,r)=>{var n=Zt(),i=(s,u)=>{try{return new n(s,u).range||"*"}catch{return null}};r.exports=i}),Hl=Q((e,r)=>{var n=ht(),i=Xs(),{ANY:s}=i,u=Zt(),l=Zs(),c=Qs(),h=zl(),p=Ul(),y=Fl(),d=(m,_,A,P)=>{m=new n(m,P),_=new u(_,P);let R,V,z,S,B;switch(A){case">":R=c,V=p,z=h,S=">",B=">=";break;case"<":R=h,V=y,z=c,S="<",B="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(l(m,_,P))return!1;for(let v=0;v<_.set.length;++v){let q=_.set[v],C=null,k=null;if(q.forEach(L=>{L.semver===s&&(L=new i(">=0.0.0")),C=C||L,k=k||L,R(L.semver,C.semver,P)?C=L:z(L.semver,k.semver,P)&&(k=L)}),C.operator===S||C.operator===B||(!k.operator||k.operator===S)&&V(m,k.semver)||k.operator===B&&z(m,k.semver))return!1}return!0};r.exports=d}),mR=Q((e,r)=>{var n=Hl(),i=(s,u,l)=>n(s,u,">",l);r.exports=i}),yR=Q((e,r)=>{var n=Hl(),i=(s,u,l)=>n(s,u,"<",l);r.exports=i}),gR=Q((e,r)=>{var n=Zt(),i=(s,u,l)=>(s=new n(s,l),u=new n(u,l),s.intersects(u));r.exports=i}),vR=Q((e,r)=>{var n=Zs(),i=Xt();r.exports=(s,u,l)=>{let c=[],h=null,p=null,y=s.sort((A,P)=>i(A,P,l));for(let A of y)n(A,u,l)?(p=A,h||(h=A)):(p&&c.push([h,p]),p=null,h=null);h&&c.push([h,null]);let d=[];for(let[A,P]of c)A===P?d.push(A):!P&&A===y[0]?d.push("*"):P?A===y[0]?d.push(`<=${P}`):d.push(`${A} - ${P}`):d.push(`>=${A}`);let m=d.join(" || "),_=typeof u.raw=="string"?u.raw:String(u);return m.length<_.length?m:u}}),bR=Q((e,r)=>{var n=Zt(),i=Xs(),{ANY:s}=i,u=Zs(),l=Xt(),c=(d,m,_={})=>{if(d===m)return!0;d=new n(d,_),m=new n(m,_);let A=!1;e:for(let P of d.set){for(let R of m.set){let V=h(P,R,_);if(A=A||V!==null,V)continue e}if(A)return!1}return!0},h=(d,m,_)=>{if(d===m)return!0;if(d.length===1&&d[0].semver===s){if(m.length===1&&m[0].semver===s)return!0;_.includePrerelease?d=[new i(">=0.0.0-0")]:d=[new i(">=0.0.0")]}if(m.length===1&&m[0].semver===s){if(_.includePrerelease)return!0;m=[new i(">=0.0.0")]}let A=new Set,P,R;for(let k of d)k.operator===">"||k.operator===">="?P=p(P,k,_):k.operator==="<"||k.operator==="<="?R=y(R,k,_):A.add(k.semver);if(A.size>1)return null;let V;if(P&&R&&(V=l(P.semver,R.semver,_),V>0||V===0&&(P.operator!==">="||R.operator!=="<=")))return null;for(let k of A){if(P&&!u(k,String(P),_)||R&&!u(k,String(R),_))return null;for(let L of m)if(!u(k,String(L),_))return!1;return!0}let z,S,B,v,q=R&&!_.includePrerelease&&R.semver.prerelease.length?R.semver:!1,C=P&&!_.includePrerelease&&P.semver.prerelease.length?P.semver:!1;q&&q.prerelease.length===1&&R.operator==="<"&&q.prerelease[0]===0&&(q=!1);for(let k of m){if(v=v||k.operator===">"||k.operator===">=",B=B||k.operator==="<"||k.operator==="<=",P){if(C&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===C.major&&k.semver.minor===C.minor&&k.semver.patch===C.patch&&(C=!1),k.operator===">"||k.operator===">="){if(z=p(P,k,_),z===k&&z!==P)return!1}else if(P.operator===">="&&!u(P.semver,String(k),_))return!1}if(R){if(q&&k.semver.prerelease&&k.semver.prerelease.length&&k.semver.major===q.major&&k.semver.minor===q.minor&&k.semver.patch===q.patch&&(q=!1),k.operator==="<"||k.operator==="<="){if(S=y(R,k,_),S===k&&S!==R)return!1}else if(R.operator==="<="&&!u(R.semver,String(k),_))return!1}if(!k.operator&&(R||P)&&V!==0)return!1}return!(P&&B&&!R&&V!==0||R&&v&&!P&&V!==0||C||q)},p=(d,m,_)=>{if(!d)return m;let A=l(d.semver,m.semver,_);return A>0?d:A<0||m.operator===">"&&d.operator===">="?m:d},y=(d,m,_)=>{if(!d)return m;let A=l(d.semver,m.semver,_);return A<0?d:A>0||m.operator==="<"&&d.operator==="<="?m:d};r.exports=c}),Wl=Q((e,r)=>{var n=io(),i=Ks(),s=ht(),u=Sm(),l=so(),c=KT(),h=JT(),p=YT(),y=QT(),d=XT(),m=ZT(),_=eR(),A=tR(),P=Xt(),R=rR(),V=nR(),z=Dl(),S=oR(),B=iR(),v=Qs(),q=zl(),C=Bl(),k=Tm(),L=Fl(),H=Ul(),Y=Rm(),ne=sR(),T=Xs(),E=Zt(),N=Zs(),F=cR(),j=hR(),W=fR(),ee=dR(),se=pR(),te=Hl(),ie=mR(),Ae=yR(),Fe=gR(),Ue=vR(),Ot=bR();r.exports={parse:l,valid:c,clean:h,inc:p,diff:y,major:d,minor:m,patch:_,prerelease:A,compare:P,rcompare:R,compareLoose:V,compareBuild:z,sort:S,rsort:B,gt:v,lt:q,eq:C,neq:k,gte:L,lte:H,cmp:Y,coerce:ne,Comparator:T,Range:E,satisfies:N,toComparators:F,maxSatisfying:j,minSatisfying:W,minVersion:ee,validRange:se,outside:te,gtr:ie,ltr:Ae,intersects:Fe,simplifyRange:Ue,subset:Ot,SemVer:s,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,compareIdentifiers:u.compareIdentifiers,rcompareIdentifiers:u.rcompareIdentifiers}}),_R=Q((e,r)=>{var n=Wl();r.exports=n.satisfies(process.version,">=15.7.0")}),wR=Q((e,r)=>{var n=Wl();r.exports=n.satisfies(process.version,">=16.9.0")}),Om=Q((e,r)=>{var n=_R(),i=wR(),s={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},u={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};r.exports=function(l,c){if(!l||!c)return;let h=c.asymmetricKeyType;if(!h)return;let p=s[h];if(!p)throw new Error(`Unknown key type "${h}".`);if(!p.includes(l))throw new Error(`"alg" parameter for "${h}" key type must be one of: ${p.join(", ")}.`);if(n)switch(h){case"ec":let y=c.asymmetricKeyDetails.namedCurve,d=u[l];if(y!==d)throw new Error(`"alg" parameter "${l}" requires curve "${d}".`);break;case"rsa-pss":if(i){let m=parseInt(l.slice(-3),10),{hashAlgorithm:_,mgf1HashAlgorithm:A,saltLength:P}=c.asymmetricKeyDetails;if(_!==`sha${m}`||A!==_)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${l}.`);if(P!==void 0&&P>m>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${l}.`)}break}}}),xm=Q((e,r)=>{var n=Wl();r.exports=n.satisfies(process.version,"^6.12.0 || >=8.0.0")}),ER=Q((e,r)=>{var n=Gs(),i=ym(),s=gm(),u=wm(),l=Em(),c=Om(),h=xm(),p=Ml(),{KeyObject:y,createSecretKey:d,createPublicKey:m}=require("crypto"),_=["RS256","RS384","RS512"],A=["ES256","ES384","ES512"],P=["RS256","RS384","RS512"],R=["HS256","HS384","HS512"];h&&(_.splice(_.length,0,"PS256","PS384","PS512"),P.splice(P.length,0,"PS256","PS384","PS512")),r.exports=function(V,z,S,B){typeof S=="function"&&!B&&(B=S,S={}),S||(S={}),S=Object.assign({},S);let v;if(B?v=B:v=function(Y,ne){if(Y)throw Y;return ne},S.clockTimestamp&&typeof S.clockTimestamp!="number")return v(new n("clockTimestamp must be a number"));if(S.nonce!==void 0&&(typeof S.nonce!="string"||S.nonce.trim()===""))return v(new n("nonce must be a non-empty string"));if(S.allowInvalidAsymmetricKeyTypes!==void 0&&typeof S.allowInvalidAsymmetricKeyTypes!="boolean")return v(new n("allowInvalidAsymmetricKeyTypes must be a boolean"));let q=S.clockTimestamp||Math.floor(Date.now()/1e3);if(!V)return v(new n("jwt must be provided"));if(typeof V!="string")return v(new n("jwt must be a string"));let C=V.split(".");if(C.length!==3)return v(new n("jwt malformed"));let k;try{k=u(V,{complete:!0})}catch(Y){return v(Y)}if(!k)return v(new n("invalid token"));let L=k.header,H;if(typeof z=="function"){if(!B)return v(new n("verify must be called asynchronous if secret or public key is provided as a callback"));H=z}else H=function(Y,ne){return ne(null,z)};return H(L,function(Y,ne){if(Y)return v(new n("error in secret or public key callback: "+Y.message));let T=C[2].trim()!=="";if(!T&&ne)return v(new n("jwt signature is required"));if(T&&!ne)return v(new n("secret or public key must be provided"));if(!T&&!S.algorithms)return v(new n('please specify "none" in "algorithms" to verify unsigned tokens'));if(ne!=null&&!(ne instanceof y))try{ne=m(ne)}catch{try{ne=d(typeof ne=="string"?Buffer.from(ne):ne)}catch{return v(new n("secretOrPublicKey is not valid key material"))}}if(S.algorithms||(ne.type==="secret"?S.algorithms=R:["rsa","rsa-pss"].includes(ne.asymmetricKeyType)?S.algorithms=P:ne.asymmetricKeyType==="ec"?S.algorithms=A:S.algorithms=_),S.algorithms.indexOf(k.header.alg)===-1)return v(new n("invalid algorithm"));if(L.alg.startsWith("HS")&&ne.type!=="secret")return v(new n(`secretOrPublicKey must be a symmetric key when using ${L.alg}`));if(/^(?:RS|PS|ES)/.test(L.alg)&&ne.type!=="public")return v(new n(`secretOrPublicKey must be an asymmetric key when using ${L.alg}`));if(!S.allowInvalidAsymmetricKeyTypes)try{c(L.alg,ne)}catch(F){return v(F)}let E;try{E=p.verify(V,k.header.alg,ne)}catch(F){return v(F)}if(!E)return v(new n("invalid signature"));let N=k.payload;if(typeof N.nbf<"u"&&!S.ignoreNotBefore){if(typeof N.nbf!="number")return v(new n("invalid nbf value"));if(N.nbf>q+(S.clockTolerance||0))return v(new i("jwt not active",new Date(N.nbf*1e3)))}if(typeof N.exp<"u"&&!S.ignoreExpiration){if(typeof N.exp!="number")return v(new n("invalid exp value"));if(q>=N.exp+(S.clockTolerance||0))return v(new s("jwt expired",new Date(N.exp*1e3)))}if(S.audience){let F=Array.isArray(S.audience)?S.audience:[S.audience];if(!(Array.isArray(N.aud)?N.aud:[N.aud]).some(function(j){return F.some(function(W){return W instanceof RegExp?W.test(j):W===j})}))return v(new n("jwt audience invalid. expected: "+F.join(" or ")))}if(S.issuer&&(typeof S.issuer=="string"&&N.iss!==S.issuer||Array.isArray(S.issuer)&&S.issuer.indexOf(N.iss)===-1))return v(new n("jwt issuer invalid. expected: "+S.issuer));if(S.subject&&N.sub!==S.subject)return v(new n("jwt subject invalid. expected: "+S.subject));if(S.jwtid&&N.jti!==S.jwtid)return v(new n("jwt jwtid invalid. expected: "+S.jwtid));if(S.nonce&&N.nonce!==S.nonce)return v(new n("jwt nonce invalid. expected: "+S.nonce));if(S.maxAge){if(typeof N.iat!="number")return v(new n("iat required when maxAge is specified"));let F=l(S.maxAge,N.iat);if(typeof F>"u")return v(new n('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(q>=F+(S.clockTolerance||0))return v(new s("maxAge exceeded",new Date(F*1e3)))}if(S.complete===!0){let F=k.signature;return v(null,{header:L,payload:N,signature:F})}return v(null,N)})}}),SR=Q((e,r)=>{(function(){var n,i="4.17.21",s=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",p=500,y="__lodash_placeholder__",d=1,m=2,_=4,A=1,P=2,R=1,V=2,z=4,S=8,B=16,v=32,q=64,C=128,k=256,L=512,H=30,Y="...",ne=800,T=16,E=1,N=2,F=3,j=1/0,W=9007199254740991,ee=17976931348623157e292,se=0/0,te=4294967295,ie=te-1,Ae=te>>>1,Fe=[["ary",C],["bind",R],["bindKey",V],["curry",S],["curryRight",B],["flip",L],["partial",v],["partialRight",q],["rearg",k]],Ue="[object Arguments]",Ot="[object Array]",lr="[object AsyncFunction]",xr="[object Boolean]",uo="[object Date]",eg="[object DOMException]",ii="[object Error]",si="[object Function]",wc="[object GeneratorFunction]",zt="[object Map]",lo="[object Number]",tg="[object Null]",cr="[object Object]",Ec="[object Promise]",rg="[object Proxy]",co="[object RegExp]",Ft="[object Set]",ho="[object String]",ai="[object Symbol]",ng="[object Undefined]",fo="[object WeakMap]",og="[object WeakSet]",po="[object ArrayBuffer]",On="[object DataView]",la="[object Float32Array]",ca="[object Float64Array]",ha="[object Int8Array]",fa="[object Int16Array]",da="[object Int32Array]",pa="[object Uint8Array]",ma="[object Uint8ClampedArray]",ya="[object Uint16Array]",ga="[object Uint32Array]",ig=/\b__p \+= '';/g,sg=/\b(__p \+=) '' \+/g,ag=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Sc=/&(?:amp|lt|gt|quot|#39);/g,Tc=/[&<>"']/g,ug=RegExp(Sc.source),lg=RegExp(Tc.source),cg=/<%-([\s\S]+?)%>/g,hg=/<%([\s\S]+?)%>/g,Rc=/<%=([\s\S]+?)%>/g,fg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dg=/^\w*$/,pg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,va=/[\\^$.*+?()[\]{}|]/g,mg=RegExp(va.source),ba=/^\s+/,yg=/\s/,gg=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vg=/\{\n\/\* \[wrapped with (.+)\] \*/,bg=/,? & /,_g=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wg=/[()=,{}\[\]\/\s]/,Eg=/\\(\\)?/g,Sg=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Oc=/\w*$/,Tg=/^[-+]0x[0-9a-f]+$/i,Rg=/^0b[01]+$/i,Og=/^\[object .+?Constructor\]$/,xg=/^0o[0-7]+$/i,Ag=/^(?:0|[1-9]\d*)$/,kg=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ui=/($^)/,Pg=/['\n\r\u2028\u2029\\]/g,li="\\ud800-\\udfff",Cg="\\u0300-\\u036f",Ig="\\ufe20-\\ufe2f",jg="\\u20d0-\\u20ff",xc=Cg+Ig+jg,Ac="\\u2700-\\u27bf",kc="a-z\\xdf-\\xf6\\xf8-\\xff",qg="\\xac\\xb1\\xd7\\xf7",$g="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Lg="\\u2000-\\u206f",Ng=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pc="A-Z\\xc0-\\xd6\\xd8-\\xde",Cc="\\ufe0e\\ufe0f",Ic=qg+$g+Lg+Ng,_a="['\u2019]",Mg="["+li+"]",jc="["+Ic+"]",ci="["+xc+"]",qc="\\d+",Bg="["+Ac+"]",$c="["+kc+"]",Lc="[^"+li+Ic+qc+Ac+kc+Pc+"]",wa="\\ud83c[\\udffb-\\udfff]",Dg="(?:"+ci+"|"+wa+")",Nc="[^"+li+"]",Ea="(?:\\ud83c[\\udde6-\\uddff]){2}",Sa="[\\ud800-\\udbff][\\udc00-\\udfff]",xn="["+Pc+"]",Mc="\\u200d",Bc="(?:"+$c+"|"+Lc+")",zg="(?:"+xn+"|"+Lc+")",Dc="(?:"+_a+"(?:d|ll|m|re|s|t|ve))?",zc="(?:"+_a+"(?:D|LL|M|RE|S|T|VE))?",Fc=Dg+"?",Uc="["+Cc+"]?",Fg="(?:"+Mc+"(?:"+[Nc,Ea,Sa].join("|")+")"+Uc+Fc+")*",Ug="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Hc=Uc+Fc+Fg,Wg="(?:"+[Bg,Ea,Sa].join("|")+")"+Hc,Vg="(?:"+[Nc+ci+"?",ci,Ea,Sa,Mg].join("|")+")",Gg=RegExp(_a,"g"),Kg=RegExp(ci,"g"),Ta=RegExp(wa+"(?="+wa+")|"+Vg+Hc,"g"),Jg=RegExp([xn+"?"+$c+"+"+Dc+"(?="+[jc,xn,"$"].join("|")+")",zg+"+"+zc+"(?="+[jc,xn+Bc,"$"].join("|")+")",xn+"?"+Bc+"+"+Dc,xn+"+"+zc,Hg,Ug,qc,Wg].join("|"),"g"),Yg=RegExp("["+Mc+li+xc+Cc+"]"),Qg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Xg=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Zg=-1,qe={};qe[la]=qe[ca]=qe[ha]=qe[fa]=qe[da]=qe[pa]=qe[ma]=qe[ya]=qe[ga]=!0,qe[Ue]=qe[Ot]=qe[po]=qe[xr]=qe[On]=qe[uo]=qe[ii]=qe[si]=qe[zt]=qe[lo]=qe[cr]=qe[co]=qe[Ft]=qe[ho]=qe[fo]=!1;var je={};je[Ue]=je[Ot]=je[po]=je[On]=je[xr]=je[uo]=je[la]=je[ca]=je[ha]=je[fa]=je[da]=je[zt]=je[lo]=je[cr]=je[co]=je[Ft]=je[ho]=je[ai]=je[pa]=je[ma]=je[ya]=je[ga]=!0,je[ii]=je[si]=je[fo]=!1;var ev={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},tv={"&":"&","<":"<",">":">",'"':""","'":"'"},rv={"&":"&","<":"<",">":">",""":'"',"'":"'"},nv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ov=parseFloat,iv=parseInt,Wc=typeof global=="object"&&global&&global.Object===Object&&global,sv=typeof self=="object"&&self&&self.Object===Object&&self,Je=Wc||sv||Function("return this")(),Ra=typeof e=="object"&&e&&!e.nodeType&&e,Kr=Ra&&typeof r=="object"&&r&&!r.nodeType&&r,Vc=Kr&&Kr.exports===Ra,Oa=Vc&&Wc.process,xt=function(){try{var M=Kr&&Kr.require&&Kr.require("util").types;return M||Oa&&Oa.binding&&Oa.binding("util")}catch{}}(),Gc=xt&&xt.isArrayBuffer,Kc=xt&&xt.isDate,Jc=xt&&xt.isMap,Yc=xt&&xt.isRegExp,Qc=xt&&xt.isSet,Xc=xt&&xt.isTypedArray;function vt(M,G,U){switch(U.length){case 0:return M.call(G);case 1:return M.call(G,U[0]);case 2:return M.call(G,U[0],U[1]);case 3:return M.call(G,U[0],U[1],U[2])}return M.apply(G,U)}function av(M,G,U,ae){for(var pe=-1,Te=M==null?0:M.length;++pe-1}function xa(M,G,U){for(var ae=-1,pe=M==null?0:M.length;++ae-1;);return U}function sh(M,G){for(var U=M.length;U--&&An(G,M[U],0)>-1;);return U}function yv(M,G){for(var U=M.length,ae=0;U--;)M[U]===G&&++ae;return ae}var gv=Ca(ev),vv=Ca(tv);function bv(M){return"\\"+nv[M]}function _v(M,G){return M==null?n:M[G]}function kn(M){return Yg.test(M)}function wv(M){return Qg.test(M)}function Ev(M){for(var G,U=[];!(G=M.next()).done;)U.push(G.value);return U}function $a(M){var G=-1,U=Array(M.size);return M.forEach(function(ae,pe){U[++G]=[pe,ae]}),U}function ah(M,G){return function(U){return M(G(U))}}function Pr(M,G){for(var U=-1,ae=M.length,pe=0,Te=[];++U-1}function l0(t,o){var a=this.__data__,f=Ai(a,t);return f<0?(++this.size,a.push([t,o])):a[f][1]=o,this}hr.prototype.clear=i0,hr.prototype.delete=s0,hr.prototype.get=a0,hr.prototype.has=u0,hr.prototype.set=l0;function fr(t){var o=-1,a=t==null?0:t.length;for(this.clear();++o=o?t:o)),t}function Ct(t,o,a,f,g,w){var O,I=o&d,D=o&m,K=o&_;if(a&&(O=g?a(t,f,g,w):a(t)),O!==n)return O;if(!Ne(t))return t;var J=me(t);if(J){if(O=db(t),!I)return ft(t,O)}else{var X=rt(t),oe=X==si||X==wc;if(Nr(t))return Uh(t,I);if(X==cr||X==Ue||oe&&!g){if(O=D||oe?{}:lf(t),!I)return D?rb(t,R0(O,t)):tb(t,bh(O,t))}else{if(!je[X])return g?t:{};O=pb(t,X,I)}}w||(w=new Ht);var ue=w.get(t);if(ue)return ue;w.set(t,O),Mf(t)?t.forEach(function(fe){O.add(Ct(fe,o,a,fe,t,w))}):Lf(t)&&t.forEach(function(fe,be){O.set(be,Ct(fe,o,a,be,t,w))});var he=K?D?au:su:D?pt:Ye,ge=J?n:he(t);return At(ge||t,function(fe,be){ge&&(be=fe,fe=t[be]),wo(O,be,Ct(fe,o,a,be,t,w))}),O}function O0(t){var o=Ye(t);return function(a){return _h(a,t,o)}}function _h(t,o,a){var f=a.length;if(t==null)return!f;for(t=Ie(t);f--;){var g=a[f],w=o[g],O=t[g];if(O===n&&!(g in t)||!w(O))return!1}return!0}function wh(t,o,a){if(typeof t!="function")throw new kt(l);return Ao(function(){t.apply(n,a)},o)}function Eo(t,o,a,f){var g=-1,w=hi,O=!0,I=t.length,D=[],K=o.length;if(!I)return D;a&&(o=Le(o,bt(a))),f?(w=xa,O=!1):o.length>=s&&(w=mo,O=!1,o=new Qr(o));e:for(;++gg?0:g+a),f=f===n||f>g?g:ye(f),f<0&&(f+=g),f=a>f?0:Df(f);a0&&a(I)?o>1?Xe(I,o-1,a,f,g):kr(g,I):f||(g[g.length]=I)}return g}var Fa=Jh(),Th=Jh(!0);function tr(t,o){return t&&Fa(t,o,Ye)}function Ua(t,o){return t&&Th(t,o,Ye)}function Pi(t,o){return Ar(o,function(a){return gr(t[a])})}function Zr(t,o){o=$r(o,t);for(var a=0,f=o.length;t!=null&&ao}function k0(t,o){return t!=null&&ke.call(t,o)}function P0(t,o){return t!=null&&o in Ie(t)}function C0(t,o,a){return t>=tt(o,a)&&t=120&&J.length>=120)?new Qr(O&&J):n}J=t[0];var X=-1,oe=I[0];e:for(;++X-1;)I!==t&&wi.call(I,D,1),wi.call(t,D,1);return t}function $h(t,o){for(var a=t?o.length:0,f=a-1;a--;){var g=o[a];if(a==f||g!==w){var w=g;yr(g)?wi.call(t,g,1):Za(t,g)}}return t}function Ya(t,o){return t+Ti(mh()*(o-t+1))}function H0(t,o,a,f){for(var g=-1,w=Ve(Si((o-t)/(a||1)),0),O=U(w);w--;)O[f?w:++g]=t,t+=a;return O}function Qa(t,o){var a="";if(!t||o<1||o>W)return a;do o%2&&(a+=t),o=Ti(o/2),o&&(t+=t);while(o);return a}function ve(t,o){return pu(ff(t,o,mt),t+"")}function W0(t){return vh(Bn(t))}function V0(t,o){var a=Bn(t);return zi(a,Xr(o,0,a.length))}function Ro(t,o,a,f){if(!Ne(t))return t;o=$r(o,t);for(var g=-1,w=o.length,O=w-1,I=t;I!=null&&++gg?0:g+o),a=a>g?g:a,a<0&&(a+=g),g=o>a?0:a-o>>>0,o>>>=0;for(var w=U(g);++f>>1,O=t[w];O!==null&&!wt(O)&&(a?O<=o:O=s){var K=o?null:sb(t);if(K)return di(K);O=!1,g=mo,D=new Qr}else D=o?[]:I;e:for(;++f=f?t:It(t,o,a)}var Fh=Nv||function(t){return Je.clearTimeout(t)};function Uh(t,o){if(o)return t.slice();var a=t.length,f=ch?ch(a):new t.constructor(a);return t.copy(f),f}function nu(t){var o=new t.constructor(t.byteLength);return new bi(o).set(new bi(t)),o}function Q0(t,o){var a=o?nu(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.byteLength)}function X0(t){var o=new t.constructor(t.source,Oc.exec(t));return o.lastIndex=t.lastIndex,o}function Z0(t){return _o?Ie(_o.call(t)):{}}function Hh(t,o){var a=o?nu(t.buffer):t.buffer;return new t.constructor(a,t.byteOffset,t.length)}function Wh(t,o){if(t!==o){var a=t!==n,f=t===null,g=t===t,w=wt(t),O=o!==n,I=o===null,D=o===o,K=wt(o);if(!I&&!K&&!w&&t>o||w&&O&&D&&!I&&!K||f&&O&&D||!a&&D||!g)return 1;if(!f&&!w&&!K&&t=I)return D;var K=a[f];return D*(K=="desc"?-1:1)}}return t.index-o.index}function Vh(t,o,a,f){for(var g=-1,w=t.length,O=a.length,I=-1,D=o.length,K=Ve(w-O,0),J=U(D+K),X=!f;++I1?a[g-1]:n,O=g>2?a[2]:n;for(w=t.length>3&&typeof w=="function"?(g--,w):n,O&&st(a[0],a[1],O)&&(w=g<3?n:w,g=1),o=Ie(o);++f-1?g[w?o[O]:O]:n}}function Xh(t){return mr(function(o){var a=o.length,f=a,g=Pt.prototype.thru;for(t&&o.reverse();f--;){var w=o[f];if(typeof w!="function")throw new kt(l);if(g&&!O&&Bi(w)=="wrapper")var O=new Pt([],!0)}for(f=O?f:a;++f1&&we.reverse(),J&&DI))return!1;var K=w.get(t),J=w.get(o);if(K&&J)return K==o&&J==t;var X=-1,oe=!0,ue=a&P?new Qr:n;for(w.set(t,o),w.set(o,t);++X1?"& ":"")+o[f],o=o.join(a>2?", ":" "),t.replace(gg,`{ +/* [wrapped with `+o+`] */ +`)}function yb(t){return me(t)||rn(t)||!!(dh&&t&&t[dh])}function yr(t,o){var a=typeof t;return o=o??W,!!o&&(a=="number"||a!="symbol"&&Ag.test(t))&&t>-1&&t%1==0&&t0){if(++o>=ne)return arguments[0]}else o=0;return t.apply(n,arguments)}}function zi(t,o){var a=-1,f=t.length,g=f-1;for(o=o===n?f:o;++a1?t[o-1]:n;return a=typeof a=="function"?(t.pop(),a):n,Tf(t,a)});function Rf(t){var o=b(t);return o.__chain__=!0,o}function x_(t,o){return o(t),t}function Fi(t,o){return o(t)}var A_=mr(function(t){var o=t.length,a=o?t[0]:0,f=this.__wrapped__,g=function(w){return za(w,t)};return o>1||this.__actions__.length||!(f instanceof _e)||!yr(a)?this.thru(g):(f=f.slice(a,+a+(o?1:0)),f.__actions__.push({func:Fi,args:[g],thisArg:n}),new Pt(f,this.__chain__).thru(function(w){return o&&!w.length&&w.push(n),w}))});function k_(){return Rf(this)}function P_(){return new Pt(this.value(),this.__chain__)}function C_(){this.__values__===n&&(this.__values__=Bf(this.value()));var t=this.__index__>=this.__values__.length,o=t?n:this.__values__[this.__index__++];return{done:t,value:o}}function I_(){return this}function j_(t){for(var o,a=this;a instanceof xi;){var f=vf(a);f.__index__=0,f.__values__=n,o?g.__wrapped__=f:o=f;var g=f;a=a.__wrapped__}return g.__wrapped__=t,o}function q_(){var t=this.__wrapped__;if(t instanceof _e){var o=t;return this.__actions__.length&&(o=new _e(this)),o=o.reverse(),o.__actions__.push({func:Fi,args:[mu],thisArg:n}),new Pt(o,this.__chain__)}return this.thru(mu)}function $_(){return Dh(this.__wrapped__,this.__actions__)}var L_=qi(function(t,o,a){ke.call(t,a)?++t[a]:dr(t,a,1)});function N_(t,o,a){var f=me(t)?Zc:x0;return a&&st(t,o,a)&&(o=n),f(t,ce(o,3))}function M_(t,o){var a=me(t)?Ar:Sh;return a(t,ce(o,3))}var B_=Qh(bf),D_=Qh(_f);function z_(t,o){return Xe(Ui(t,o),1)}function F_(t,o){return Xe(Ui(t,o),j)}function U_(t,o,a){return a=a===n?1:ye(a),Xe(Ui(t,o),a)}function Of(t,o){var a=me(t)?At:jr;return a(t,ce(o,3))}function xf(t,o){var a=me(t)?uv:Eh;return a(t,ce(o,3))}var H_=qi(function(t,o,a){ke.call(t,a)?t[a].push(o):dr(t,a,[o])});function W_(t,o,a,f){t=dt(t)?t:Bn(t),a=a&&!f?ye(a):0;var g=t.length;return a<0&&(a=Ve(g+a,0)),Ki(t)?a<=g&&t.indexOf(o,a)>-1:!!g&&An(t,o,a)>-1}var V_=ve(function(t,o,a){var f=-1,g=typeof o=="function",w=dt(t)?U(t.length):[];return jr(t,function(O){w[++f]=g?vt(o,O,a):So(O,o,a)}),w}),G_=qi(function(t,o,a){dr(t,a,o)});function Ui(t,o){var a=me(t)?Le:kh;return a(t,ce(o,3))}function K_(t,o,a,f){return t==null?[]:(me(o)||(o=o==null?[]:[o]),a=f?n:a,me(a)||(a=a==null?[]:[a]),jh(t,o,a))}var J_=qi(function(t,o,a){t[a?0:1].push(o)},function(){return[[],[]]});function Y_(t,o,a){var f=me(t)?Aa:nh,g=arguments.length<3;return f(t,ce(o,4),a,g,jr)}function Q_(t,o,a){var f=me(t)?lv:nh,g=arguments.length<3;return f(t,ce(o,4),a,g,Eh)}function X_(t,o){var a=me(t)?Ar:Sh;return a(t,Vi(ce(o,3)))}function Z_(t){var o=me(t)?vh:W0;return o(t)}function ew(t,o,a){(a?st(t,o,a):o===n)?o=1:o=ye(o);var f=me(t)?E0:V0;return f(t,o)}function tw(t){var o=me(t)?S0:K0;return o(t)}function rw(t){if(t==null)return 0;if(dt(t))return Ki(t)?Pn(t):t.length;var o=rt(t);return o==zt||o==Ft?t.size:Ga(t).length}function nw(t,o,a){var f=me(t)?ka:J0;return a&&st(t,o,a)&&(o=n),f(t,ce(o,3))}var ow=ve(function(t,o){if(t==null)return[];var a=o.length;return a>1&&st(t,o[0],o[1])?o=[]:a>2&&st(o[0],o[1],o[2])&&(o=[o[0]]),jh(t,Xe(o,1),[])}),Hi=Mv||function(){return Je.Date.now()};function iw(t,o){if(typeof o!="function")throw new kt(l);return t=ye(t),function(){if(--t<1)return o.apply(this,arguments)}}function Af(t,o,a){return o=a?n:o,o=t&&o==null?t.length:o,pr(t,C,n,n,n,n,o)}function kf(t,o){var a;if(typeof o!="function")throw new kt(l);return t=ye(t),function(){return--t>0&&(a=o.apply(this,arguments)),t<=1&&(o=n),a}}var gu=ve(function(t,o,a){var f=R;if(a.length){var g=Pr(a,Nn(gu));f|=v}return pr(t,f,o,a,g)}),Pf=ve(function(t,o,a){var f=R|V;if(a.length){var g=Pr(a,Nn(Pf));f|=v}return pr(o,f,t,a,g)});function Cf(t,o,a){o=a?n:o;var f=pr(t,S,n,n,n,n,n,o);return f.placeholder=Cf.placeholder,f}function If(t,o,a){o=a?n:o;var f=pr(t,B,n,n,n,n,n,o);return f.placeholder=If.placeholder,f}function jf(t,o,a){var f,g,w,O,I,D,K=0,J=!1,X=!1,oe=!0;if(typeof t!="function")throw new kt(l);o=qt(o)||0,Ne(a)&&(J=!!a.leading,X="maxWait"in a,w=X?Ve(qt(a.maxWait)||0,o):w,oe="trailing"in a?!!a.trailing:oe);function ue(ze){var Vt=f,br=g;return f=g=n,K=ze,O=t.apply(br,Vt),O}function he(ze){return K=ze,I=Ao(be,o),J?ue(ze):O}function ge(ze){var Vt=ze-D,br=ze-K,Xf=o-Vt;return X?tt(Xf,w-br):Xf}function fe(ze){var Vt=ze-D,br=ze-K;return D===n||Vt>=o||Vt<0||X&&br>=w}function be(){var ze=Hi();if(fe(ze))return we(ze);I=Ao(be,ge(ze))}function we(ze){return I=n,oe&&f?ue(ze):(f=g=n,O)}function Et(){I!==n&&Fh(I),K=0,f=D=g=I=n}function at(){return I===n?O:we(Hi())}function St(){var ze=Hi(),Vt=fe(ze);if(f=arguments,g=this,D=ze,Vt){if(I===n)return he(D);if(X)return Fh(I),I=Ao(be,o),ue(D)}return I===n&&(I=Ao(be,o)),O}return St.cancel=Et,St.flush=at,St}var sw=ve(function(t,o){return wh(t,1,o)}),aw=ve(function(t,o,a){return wh(t,qt(o)||0,a)});function uw(t){return pr(t,L)}function Wi(t,o){if(typeof t!="function"||o!=null&&typeof o!="function")throw new kt(l);var a=function(){var f=arguments,g=o?o.apply(this,f):f[0],w=a.cache;if(w.has(g))return w.get(g);var O=t.apply(this,f);return a.cache=w.set(g,O)||w,O};return a.cache=new(Wi.Cache||fr),a}Wi.Cache=fr;function Vi(t){if(typeof t!="function")throw new kt(l);return function(){var o=arguments;switch(o.length){case 0:return!t.call(this);case 1:return!t.call(this,o[0]);case 2:return!t.call(this,o[0],o[1]);case 3:return!t.call(this,o[0],o[1],o[2])}return!t.apply(this,o)}}function lw(t){return kf(2,t)}var cw=Y0(function(t,o){o=o.length==1&&me(o[0])?Le(o[0],bt(ce())):Le(Xe(o,1),bt(ce()));var a=o.length;return ve(function(f){for(var g=-1,w=tt(f.length,a);++g=o}),rn=Oh(function(){return arguments}())?Oh:function(t){return Be(t)&&ke.call(t,"callee")&&!fh.call(t,"callee")},me=U.isArray,Rw=Gc?bt(Gc):j0;function dt(t){return t!=null&&Gi(t.length)&&!gr(t)}function De(t){return Be(t)&&dt(t)}function Ow(t){return t===!0||t===!1||Be(t)&&it(t)==xr}var Nr=Dv||ku,xw=Kc?bt(Kc):q0;function Aw(t){return Be(t)&&t.nodeType===1&&!ko(t)}function kw(t){if(t==null)return!0;if(dt(t)&&(me(t)||typeof t=="string"||typeof t.splice=="function"||Nr(t)||Mn(t)||rn(t)))return!t.length;var o=rt(t);if(o==zt||o==Ft)return!t.size;if(xo(t))return!Ga(t).length;for(var a in t)if(ke.call(t,a))return!1;return!0}function Pw(t,o){return To(t,o)}function Cw(t,o,a){a=typeof a=="function"?a:n;var f=a?a(t,o):n;return f===n?To(t,o,n,a):!!f}function bu(t){if(!Be(t))return!1;var o=it(t);return o==ii||o==eg||typeof t.message=="string"&&typeof t.name=="string"&&!ko(t)}function Iw(t){return typeof t=="number"&&ph(t)}function gr(t){if(!Ne(t))return!1;var o=it(t);return o==si||o==wc||o==lr||o==rg}function $f(t){return typeof t=="number"&&t==ye(t)}function Gi(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=W}function Ne(t){var o=typeof t;return t!=null&&(o=="object"||o=="function")}function Be(t){return t!=null&&typeof t=="object"}var Lf=Jc?bt(Jc):L0;function jw(t,o){return t===o||Va(t,o,lu(o))}function qw(t,o,a){return a=typeof a=="function"?a:n,Va(t,o,lu(o),a)}function $w(t){return Nf(t)&&t!=+t}function Lw(t){if(bb(t))throw new pe(u);return xh(t)}function Nw(t){return t===null}function Mw(t){return t==null}function Nf(t){return typeof t=="number"||Be(t)&&it(t)==lo}function ko(t){if(!Be(t)||it(t)!=cr)return!1;var o=_i(t);if(o===null)return!0;var a=ke.call(o,"constructor")&&o.constructor;return typeof a=="function"&&a instanceof a&&yi.call(a)==qv}var _u=Yc?bt(Yc):N0;function Bw(t){return $f(t)&&t>=-W&&t<=W}var Mf=Qc?bt(Qc):M0;function Ki(t){return typeof t=="string"||!me(t)&&Be(t)&&it(t)==ho}function wt(t){return typeof t=="symbol"||Be(t)&&it(t)==ai}var Mn=Xc?bt(Xc):B0;function Dw(t){return t===n}function zw(t){return Be(t)&&rt(t)==fo}function Fw(t){return Be(t)&&it(t)==og}var Uw=Mi(Ka),Hw=Mi(function(t,o){return t<=o});function Bf(t){if(!t)return[];if(dt(t))return Ki(t)?Ut(t):ft(t);if(yo&&t[yo])return Ev(t[yo]());var o=rt(t),a=o==zt?$a:o==Ft?di:Bn;return a(t)}function vr(t){if(!t)return t===0?t:0;if(t=qt(t),t===j||t===-j){var o=t<0?-1:1;return o*ee}return t===t?t:0}function ye(t){var o=vr(t),a=o%1;return o===o?a?o-a:o:0}function Df(t){return t?Xr(ye(t),0,te):0}function qt(t){if(typeof t=="number")return t;if(wt(t))return se;if(Ne(t)){var o=typeof t.valueOf=="function"?t.valueOf():t;t=Ne(o)?o+"":o}if(typeof t!="string")return t===0?t:+t;t=oh(t);var a=Rg.test(t);return a||xg.test(t)?iv(t.slice(2),a?2:8):Tg.test(t)?se:+t}function zf(t){return rr(t,pt(t))}function Ww(t){return t?Xr(ye(t),-W,W):t===0?t:0}function xe(t){return t==null?"":_t(t)}var Vw=$n(function(t,o){if(xo(o)||dt(o)){rr(o,Ye(o),t);return}for(var a in o)ke.call(o,a)&&wo(t,a,o[a])}),Ff=$n(function(t,o){rr(o,pt(o),t)}),Ji=$n(function(t,o,a,f){rr(o,pt(o),t,f)}),Gw=$n(function(t,o,a,f){rr(o,Ye(o),t,f)}),Kw=mr(za);function Jw(t,o){var a=qn(t);return o==null?a:bh(a,o)}var Yw=ve(function(t,o){t=Ie(t);var a=-1,f=o.length,g=f>2?o[2]:n;for(g&&st(o[0],o[1],g)&&(f=1);++a1),w}),rr(t,au(t),a),f&&(a=Ct(a,d|m|_,ab));for(var g=o.length;g--;)Za(a,o[g]);return a});function pE(t,o){return Hf(t,Vi(ce(o)))}var mE=mr(function(t,o){return t==null?{}:F0(t,o)});function Hf(t,o){if(t==null)return{};var a=Le(au(t),function(f){return[f]});return o=ce(o),qh(t,a,function(f,g){return o(f,g[0])})}function yE(t,o,a){o=$r(o,t);var f=-1,g=o.length;for(g||(g=1,t=n);++fo){var f=t;t=o,o=f}if(a||t%1||o%1){var g=mh();return tt(t+g*(o-t+ov("1e-"+((g+"").length-1))),o)}return Ya(t,o)}var xE=Ln(function(t,o,a){return o=o.toLowerCase(),t+(a?Gf(o):o)});function Gf(t){return Su(xe(t).toLowerCase())}function Kf(t){return t=xe(t),t&&t.replace(kg,gv).replace(Kg,"")}function AE(t,o,a){t=xe(t),o=_t(o);var f=t.length;a=a===n?f:Xr(ye(a),0,f);var g=a;return a-=o.length,a>=0&&t.slice(a,g)==o}function kE(t){return t=xe(t),t&&lg.test(t)?t.replace(Tc,vv):t}function PE(t){return t=xe(t),t&&mg.test(t)?t.replace(va,"\\$&"):t}var CE=Ln(function(t,o,a){return t+(a?"-":"")+o.toLowerCase()}),IE=Ln(function(t,o,a){return t+(a?" ":"")+o.toLowerCase()}),jE=Yh("toLowerCase");function qE(t,o,a){t=xe(t),o=ye(o);var f=o?Pn(t):0;if(!o||f>=o)return t;var g=(o-f)/2;return Ni(Ti(g),a)+t+Ni(Si(g),a)}function $E(t,o,a){t=xe(t),o=ye(o);var f=o?Pn(t):0;return o&&f>>0,a?(t=xe(t),t&&(typeof o=="string"||o!=null&&!_u(o))&&(o=_t(o),!o&&kn(t))?Lr(Ut(t),0,a):t.split(o,a)):[]}var FE=Ln(function(t,o,a){return t+(a?" ":"")+Su(o)});function UE(t,o,a){return t=xe(t),a=a==null?0:Xr(ye(a),0,t.length),o=_t(o),t.slice(a,a+o.length)==o}function HE(t,o,a){var f=b.templateSettings;a&&st(t,o,a)&&(o=n),t=xe(t),o=Ji({},o,f,nf);var g=Ji({},o.imports,f.imports,nf),w=Ye(g),O=qa(g,w),I,D,K=0,J=o.interpolate||ui,X="__p += '",oe=La((o.escape||ui).source+"|"+J.source+"|"+(J===Rc?Sg:ui).source+"|"+(o.evaluate||ui).source+"|$","g"),ue="//# sourceURL="+(ke.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Zg+"]")+` +`;t.replace(oe,function(fe,be,we,Et,at,St){return we||(we=Et),X+=t.slice(K,St).replace(Pg,bv),be&&(I=!0,X+=`' + +__e(`+be+`) + +'`),at&&(D=!0,X+=`'; +`+at+`; +__p += '`),we&&(X+=`' + +((__t = (`+we+`)) == null ? '' : __t) + +'`),K=St+fe.length,fe}),X+=`'; +`;var he=ke.call(o,"variable")&&o.variable;if(!he)X=`with (obj) { +`+X+` +} +`;else if(wg.test(he))throw new pe(c);X=(D?X.replace(ig,""):X).replace(sg,"$1").replace(ag,"$1;"),X="function("+(he||"obj")+`) { +`+(he?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(I?", __e = _.escape":"")+(D?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+X+`return __p +}`;var ge=Yf(function(){return Te(w,ue+"return "+X).apply(n,O)});if(ge.source=X,bu(ge))throw ge;return ge}function WE(t){return xe(t).toLowerCase()}function VE(t){return xe(t).toUpperCase()}function GE(t,o,a){if(t=xe(t),t&&(a||o===n))return oh(t);if(!t||!(o=_t(o)))return t;var f=Ut(t),g=Ut(o),w=ih(f,g),O=sh(f,g)+1;return Lr(f,w,O).join("")}function KE(t,o,a){if(t=xe(t),t&&(a||o===n))return t.slice(0,uh(t)+1);if(!t||!(o=_t(o)))return t;var f=Ut(t),g=sh(f,Ut(o))+1;return Lr(f,0,g).join("")}function JE(t,o,a){if(t=xe(t),t&&(a||o===n))return t.replace(ba,"");if(!t||!(o=_t(o)))return t;var f=Ut(t),g=ih(f,Ut(o));return Lr(f,g).join("")}function YE(t,o){var a=H,f=Y;if(Ne(o)){var g="separator"in o?o.separator:g;a="length"in o?ye(o.length):a,f="omission"in o?_t(o.omission):f}t=xe(t);var w=t.length;if(kn(t)){var O=Ut(t);w=O.length}if(a>=w)return t;var I=a-Pn(f);if(I<1)return f;var D=O?Lr(O,0,I).join(""):t.slice(0,I);if(g===n)return D+f;if(O&&(I+=D.length-I),_u(g)){if(t.slice(I).search(g)){var K,J=D;for(g.global||(g=La(g.source,xe(Oc.exec(g))+"g")),g.lastIndex=0;K=g.exec(J);)var X=K.index;D=D.slice(0,X===n?I:X)}}else if(t.indexOf(_t(g),I)!=I){var oe=D.lastIndexOf(g);oe>-1&&(D=D.slice(0,oe))}return D+f}function QE(t){return t=xe(t),t&&ug.test(t)?t.replace(Sc,Ov):t}var XE=Ln(function(t,o,a){return t+(a?" ":"")+o.toUpperCase()}),Su=Yh("toUpperCase");function Jf(t,o,a){return t=xe(t),o=a?n:o,o===n?wv(t)?kv(t):fv(t):t.match(o)||[]}var Yf=ve(function(t,o){try{return vt(t,n,o)}catch(a){return bu(a)?a:new pe(a)}}),ZE=mr(function(t,o){return At(o,function(a){a=nr(a),dr(t,a,gu(t[a],t))}),t});function e1(t){var o=t==null?0:t.length,a=ce();return t=o?Le(t,function(f){if(typeof f[1]!="function")throw new kt(l);return[a(f[0]),f[1]]}):[],ve(function(f){for(var g=-1;++gW)return[];var a=te,f=tt(t,te);o=ce(o),t-=te;for(var g=ja(f,o);++a0||o<0)?new _e(a):(t<0?a=a.takeRight(-t):t&&(a=a.drop(t)),o!==n&&(o=ye(o),a=o<0?a.dropRight(-o):a.take(o-t)),a)},_e.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},_e.prototype.toArray=function(){return this.take(te)},tr(_e.prototype,function(t,o){var a=/^(?:filter|find|map|reject)|While$/.test(o),f=/^(?:head|last)$/.test(o),g=b[f?"take"+(o=="last"?"Right":""):o],w=f||/^find/.test(o);g&&(b.prototype[o]=function(){var O=this.__wrapped__,I=f?[1]:arguments,D=O instanceof _e,K=I[0],J=D||me(O),X=function(be){var we=g.apply(b,kr([be],I));return f&&oe?we[0]:we};J&&a&&typeof K=="function"&&K.length!=1&&(D=J=!1);var oe=this.__chain__,ue=!!this.__actions__.length,he=w&&!oe,ge=D&&!ue;if(!w&&J){O=ge?O:new _e(this);var fe=t.apply(O,I);return fe.__actions__.push({func:Fi,args:[X],thisArg:n}),new Pt(fe,oe)}return he&&ge?t.apply(this,I):(fe=this.thru(X),he?f?fe.value()[0]:fe.value():fe)})}),At(["pop","push","shift","sort","splice","unshift"],function(t){var o=pi[t],a=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",f=/^(?:pop|shift)$/.test(t);b.prototype[t]=function(){var g=arguments;if(f&&!this.__chain__){var w=this.value();return o.apply(me(w)?w:[],g)}return this[a](function(O){return o.apply(me(O)?O:[],g)})}}),tr(_e.prototype,function(t,o){var a=b[o];if(a){var f=a.name+"";ke.call(jn,f)||(jn[f]=[]),jn[f].push({name:o,func:a})}}),jn[$i(n,V).name]=[{name:"wrapper",func:n}],_e.prototype.clone=Qv,_e.prototype.reverse=Xv,_e.prototype.value=Zv,b.prototype.at=A_,b.prototype.chain=k_,b.prototype.commit=P_,b.prototype.next=C_,b.prototype.plant=j_,b.prototype.reverse=q_,b.prototype.toJSON=b.prototype.valueOf=b.prototype.value=$_,b.prototype.first=b.prototype.head,yo&&(b.prototype[yo]=I_),b},Cr=Pv();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Je._=Cr,define(function(){return Cr})):Kr?((Kr.exports=Cr)._=Cr,Ra._=Cr):Je._=Cr}).call(e)}),TR=Q((e,r)=>{var n=Em(),i=xm(),s=Om(),u=Ml(),{includes:l,isBoolean:c,isInteger:h,isNumber:p,isPlainObject:y,isString:d,once:m}=SR(),{KeyObject:_,createSecretKey:A,createPrivateKey:P}=require("crypto"),R=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];i&&R.splice(3,0,"PS256","PS384","PS512");var V={expiresIn:{isValid:function(k){return h(k)||d(k)&&k},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(k){return h(k)||d(k)&&k},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(k){return d(k)||Array.isArray(k)},message:'"audience" must be a string or array'},algorithm:{isValid:l.bind(null,R),message:'"algorithm" must be a valid string enum value'},header:{isValid:y,message:'"header" must be an object'},encoding:{isValid:d,message:'"encoding" must be a string'},issuer:{isValid:d,message:'"issuer" must be a string'},subject:{isValid:d,message:'"subject" must be a string'},jwtid:{isValid:d,message:'"jwtid" must be a string'},noTimestamp:{isValid:c,message:'"noTimestamp" must be a boolean'},keyid:{isValid:d,message:'"keyid" must be a string'},mutatePayload:{isValid:c,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:c,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:c,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},z={iat:{isValid:p,message:'"iat" should be a number of seconds'},exp:{isValid:p,message:'"exp" should be a number of seconds'},nbf:{isValid:p,message:'"nbf" should be a number of seconds'}};function S(k,L,H,Y){if(!y(H))throw new Error('Expected "'+Y+'" to be a plain object.');Object.keys(H).forEach(function(ne){let T=k[ne];if(!T){if(!L)throw new Error('"'+ne+'" is not allowed in "'+Y+'"');return}if(!T.isValid(H[ne]))throw new Error(T.message)})}function B(k){return S(V,!1,k,"options")}function v(k){return S(z,!0,k,"payload")}var q={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},C=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];r.exports=function(k,L,H,Y){typeof H=="function"?(Y=H,H={}):H=H||{};let ne=typeof k=="object"&&!Buffer.isBuffer(k),T=Object.assign({alg:H.algorithm||"HS256",typ:ne?"JWT":void 0,kid:H.keyid},H.header);function E(j){if(Y)return Y(j);throw j}if(!L&&H.algorithm!=="none")return E(new Error("secretOrPrivateKey must have a value"));if(L!=null&&!(L instanceof _))try{L=P(L)}catch{try{L=A(typeof L=="string"?Buffer.from(L):L)}catch{return E(new Error("secretOrPrivateKey is not valid key material"))}}if(T.alg.startsWith("HS")&&L.type!=="secret")return E(new Error(`secretOrPrivateKey must be a symmetric key when using ${T.alg}`));if(/^(?:RS|PS|ES)/.test(T.alg)){if(L.type!=="private")return E(new Error(`secretOrPrivateKey must be an asymmetric key when using ${T.alg}`));if(!H.allowInsecureKeySizes&&!T.alg.startsWith("ES")&&L.asymmetricKeyDetails!==void 0&&L.asymmetricKeyDetails.modulusLength<2048)return E(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${T.alg}`))}if(typeof k>"u")return E(new Error("payload is required"));if(ne){try{v(k)}catch(j){return E(j)}H.mutatePayload||(k=Object.assign({},k))}else{let j=C.filter(function(W){return typeof H[W]<"u"});if(j.length>0)return E(new Error("invalid "+j.join(",")+" option for "+typeof k+" payload"))}if(typeof k.exp<"u"&&typeof H.expiresIn<"u")return E(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof k.nbf<"u"&&typeof H.notBefore<"u")return E(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{B(H)}catch(j){return E(j)}if(!H.allowInvalidAsymmetricKeyTypes)try{s(T.alg,L)}catch(j){return E(j)}let N=k.iat||Math.floor(Date.now()/1e3);if(H.noTimestamp?delete k.iat:ne&&(k.iat=N),typeof H.notBefore<"u"){try{k.nbf=n(H.notBefore,N)}catch(j){return E(j)}if(typeof k.nbf>"u")return E(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof H.expiresIn<"u"&&typeof k=="object"){try{k.exp=n(H.expiresIn,N)}catch(j){return E(j)}if(typeof k.exp>"u")return E(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(q).forEach(function(j){let W=q[j];if(typeof H[j]<"u"){if(typeof k[W]<"u")return E(new Error('Bad "options.'+j+'" option. The payload already has an "'+W+'" property.'));k[W]=H[j]}});let F=H.encoding||"utf8";if(typeof Y=="function")Y=Y&&m(Y),u.createSign({header:T,privateKey:L,payload:k,encoding:F}).once("error",Y).once("done",function(j){if(!H.allowInsecureKeySizes&&/^(?:RS|PS)/.test(T.alg)&&j.length<256)return Y(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${T.alg}`));Y(null,j)});else{let j=u.sign({header:T,payload:k,secret:L,encoding:F});if(!H.allowInsecureKeySizes&&/^(?:RS|PS)/.test(T.alg)&&j.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${T.alg}`);return j}}}),RR=Q((e,r)=>{r.exports={verify:ER(),sign:TR(),JsonWebTokenError:Gs(),NotBeforeError:ym(),TokenExpiredError:gm()},Object.defineProperty(r.exports,"decode",{enumerable:!1,value:wm()})}),Am={};wT(Am,{BrowserName:()=>km,marketNameMap:()=>Pm,submitChrome:()=>Gx,submitEdge:()=>eA,submitFirefox:()=>HA,submitOpera:()=>VA,supportedBrowserSet:()=>OR});Yy.exports=ET(Am);var km=(e=>(e.Chrome="chrome",e.Firefox="firefox",e.Opera="opera",e.Edge="edge",e))(km||{}),OR=new Set(["chrome","edge","firefox"]),Pm={chrome:"Chrome Web Store",edge:"Edge Add-ons",firefox:"Firefox Add-ons"},xR=require("fs"),Cm=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function AR(e){return Cm.includes(e)}var kR=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Blob","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","WeakRef","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement","NaN",...Cm];function PR(e){return kR.includes(e)}var CR=["null","undefined","string","number","bigint","boolean","symbol"];function IR(e){return CR.includes(e)}function ao(e){return r=>typeof r===e}var{toString:jR}=Object.prototype,ri=e=>{let r=jR.call(e).slice(8,-1);if(/HTML\w+Element/.test(r)&&x.domElement(e))return"HTMLElement";if(PR(r))return r},Ce=e=>r=>ri(r)===e;function x(e){if(e===null)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"NaN":"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(x.observable(e))return"Observable";if(x.array(e))return"Array";if(x.buffer(e))return"Buffer";let r=ri(e);if(r)return r;if(e instanceof String||e instanceof Boolean||e instanceof Number)throw new TypeError("Please don't use object wrappers for primitive types");return"Object"}x.undefined=ao("undefined");x.string=ao("string");var qR=ao("number");x.number=e=>qR(e)&&!x.nan(e);x.bigint=ao("bigint");x.function_=ao("function");x.null_=e=>e===null;x.class_=e=>x.function_(e)&&e.toString().startsWith("class ");x.boolean=e=>e===!0||e===!1;x.symbol=ao("symbol");x.numericString=e=>x.string(e)&&!x.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e));x.array=(e,r)=>Array.isArray(e)?x.function_(r)?e.every(n=>r(n)):!0:!1;x.buffer=e=>e?.constructor?.isBuffer?.(e)??!1;x.blob=e=>Ce("Blob")(e);x.nullOrUndefined=e=>x.null_(e)||x.undefined(e);x.object=e=>!x.null_(e)&&(typeof e=="object"||x.function_(e));x.iterable=e=>x.function_(e?.[Symbol.iterator]);x.asyncIterable=e=>x.function_(e?.[Symbol.asyncIterator]);x.generator=e=>x.iterable(e)&&x.function_(e?.next)&&x.function_(e?.throw);x.asyncGenerator=e=>x.asyncIterable(e)&&x.function_(e.next)&&x.function_(e.throw);x.nativePromise=e=>Ce("Promise")(e);var $R=e=>x.function_(e?.then)&&x.function_(e?.catch);x.promise=e=>x.nativePromise(e)||$R(e);x.generatorFunction=Ce("GeneratorFunction");x.asyncGeneratorFunction=e=>ri(e)==="AsyncGeneratorFunction";x.asyncFunction=e=>ri(e)==="AsyncFunction";x.boundFunction=e=>x.function_(e)&&!e.hasOwnProperty("prototype");x.regExp=Ce("RegExp");x.date=Ce("Date");x.error=Ce("Error");x.map=e=>Ce("Map")(e);x.set=e=>Ce("Set")(e);x.weakMap=e=>Ce("WeakMap")(e);x.weakSet=e=>Ce("WeakSet")(e);x.weakRef=e=>Ce("WeakRef")(e);x.int8Array=Ce("Int8Array");x.uint8Array=Ce("Uint8Array");x.uint8ClampedArray=Ce("Uint8ClampedArray");x.int16Array=Ce("Int16Array");x.uint16Array=Ce("Uint16Array");x.int32Array=Ce("Int32Array");x.uint32Array=Ce("Uint32Array");x.float32Array=Ce("Float32Array");x.float64Array=Ce("Float64Array");x.bigInt64Array=Ce("BigInt64Array");x.bigUint64Array=Ce("BigUint64Array");x.arrayBuffer=Ce("ArrayBuffer");x.sharedArrayBuffer=Ce("SharedArrayBuffer");x.dataView=Ce("DataView");x.enumCase=(e,r)=>Object.values(r).includes(e);x.directInstanceOf=(e,r)=>Object.getPrototypeOf(e)===r.prototype;x.urlInstance=e=>Ce("URL")(e);x.urlString=e=>{if(!x.string(e))return!1;try{return new URL(e),!0}catch{return!1}};x.truthy=e=>Boolean(e);x.falsy=e=>!e;x.nan=e=>Number.isNaN(e);x.primitive=e=>x.null_(e)||IR(typeof e);x.integer=e=>Number.isInteger(e);x.safeInteger=e=>Number.isSafeInteger(e);x.plainObject=e=>{if(typeof e!="object"||e===null)return!1;let r=Object.getPrototypeOf(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};x.typedArray=e=>AR(ri(e));var LR=e=>x.safeInteger(e)&&e>=0;x.arrayLike=e=>!x.nullOrUndefined(e)&&!x.function_(e)&&LR(e.length);x.inRange=(e,r)=>{if(x.number(r))return e>=Math.min(0,r)&&e<=Math.max(r,0);if(x.array(r)&&r.length===2)return e>=Math.min(...r)&&e<=Math.max(...r);throw new TypeError(`Invalid range: ${JSON.stringify(r)}`)};var NR=1,MR=["innerHTML","ownerDocument","style","attributes","nodeValue"];x.domElement=e=>x.object(e)&&e.nodeType===NR&&x.string(e.nodeName)&&!x.plainObject(e)&&MR.every(r=>r in e);x.observable=e=>e?e===e[Symbol.observable]?.()||e===e["@@observable"]?.():!1;x.nodeStream=e=>x.object(e)&&x.function_(e.pipe)&&!x.observable(e);x.infinite=e=>e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY;var Im=e=>r=>x.integer(r)&&Math.abs(r%2)===e;x.evenInteger=Im(0);x.oddInteger=Im(1);x.emptyArray=e=>x.array(e)&&e.length===0;x.nonEmptyArray=e=>x.array(e)&&e.length>0;x.emptyString=e=>x.string(e)&&e.length===0;var BR=e=>x.string(e)&&!/\S/.test(e);x.emptyStringOrWhitespace=e=>x.emptyString(e)||BR(e);x.nonEmptyString=e=>x.string(e)&&e.length>0;x.nonEmptyStringAndNotWhitespace=e=>x.string(e)&&!x.emptyStringOrWhitespace(e);x.emptyObject=e=>x.object(e)&&!x.map(e)&&!x.set(e)&&Object.keys(e).length===0;x.nonEmptyObject=e=>x.object(e)&&!x.map(e)&&!x.set(e)&&Object.keys(e).length>0;x.emptySet=e=>x.set(e)&&e.size===0;x.nonEmptySet=e=>x.set(e)&&e.size>0;x.emptyMap=e=>x.map(e)&&e.size===0;x.nonEmptyMap=e=>x.map(e)&&e.size>0;x.propertyKey=e=>x.any([x.string,x.number,x.symbol],e);x.formData=e=>Ce("FormData")(e);x.urlSearchParams=e=>Ce("URLSearchParams")(e);var jm=(e,r,n)=>{if(!x.function_(r))throw new TypeError(`Invalid predicate: ${JSON.stringify(r)}`);if(n.length===0)throw new TypeError("Invalid number of values");return e.call(n,r)};x.any=(e,...r)=>(x.array(e)?e:[e]).some(n=>jm(Array.prototype.some,n,r));x.all=(e,...r)=>jm(Array.prototype.every,e,r);var re=(e,r,n,i={})=>{if(!e){let{multipleValues:s}=i,u=s?`received values of types ${[...new Set(n.map(l=>`\`${x(l)}\``))].join(", ")}`:`received value of type \`${x(n)}\``;throw new TypeError(`Expected value which is \`${r}\`, ${u}.`)}},Z={undefined:e=>re(x.undefined(e),"undefined",e),string:e=>re(x.string(e),"string",e),number:e=>re(x.number(e),"number",e),bigint:e=>re(x.bigint(e),"bigint",e),function_:e=>re(x.function_(e),"Function",e),null_:e=>re(x.null_(e),"null",e),class_:e=>re(x.class_(e),"Class",e),boolean:e=>re(x.boolean(e),"boolean",e),symbol:e=>re(x.symbol(e),"symbol",e),numericString:e=>re(x.numericString(e),"string with a number",e),array:(e,r)=>{re(x.array(e),"Array",e),r&&e.forEach(r)},buffer:e=>re(x.buffer(e),"Buffer",e),blob:e=>re(x.blob(e),"Blob",e),nullOrUndefined:e=>re(x.nullOrUndefined(e),"null or undefined",e),object:e=>re(x.object(e),"Object",e),iterable:e=>re(x.iterable(e),"Iterable",e),asyncIterable:e=>re(x.asyncIterable(e),"AsyncIterable",e),generator:e=>re(x.generator(e),"Generator",e),asyncGenerator:e=>re(x.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>re(x.nativePromise(e),"native Promise",e),promise:e=>re(x.promise(e),"Promise",e),generatorFunction:e=>re(x.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>re(x.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>re(x.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>re(x.boundFunction(e),"Function",e),regExp:e=>re(x.regExp(e),"RegExp",e),date:e=>re(x.date(e),"Date",e),error:e=>re(x.error(e),"Error",e),map:e=>re(x.map(e),"Map",e),set:e=>re(x.set(e),"Set",e),weakMap:e=>re(x.weakMap(e),"WeakMap",e),weakSet:e=>re(x.weakSet(e),"WeakSet",e),weakRef:e=>re(x.weakRef(e),"WeakRef",e),int8Array:e=>re(x.int8Array(e),"Int8Array",e),uint8Array:e=>re(x.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>re(x.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>re(x.int16Array(e),"Int16Array",e),uint16Array:e=>re(x.uint16Array(e),"Uint16Array",e),int32Array:e=>re(x.int32Array(e),"Int32Array",e),uint32Array:e=>re(x.uint32Array(e),"Uint32Array",e),float32Array:e=>re(x.float32Array(e),"Float32Array",e),float64Array:e=>re(x.float64Array(e),"Float64Array",e),bigInt64Array:e=>re(x.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>re(x.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>re(x.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>re(x.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>re(x.dataView(e),"DataView",e),enumCase:(e,r)=>re(x.enumCase(e,r),"EnumCase",e),urlInstance:e=>re(x.urlInstance(e),"URL",e),urlString:e=>re(x.urlString(e),"string with a URL",e),truthy:e=>re(x.truthy(e),"truthy",e),falsy:e=>re(x.falsy(e),"falsy",e),nan:e=>re(x.nan(e),"NaN",e),primitive:e=>re(x.primitive(e),"primitive",e),integer:e=>re(x.integer(e),"integer",e),safeInteger:e=>re(x.safeInteger(e),"integer",e),plainObject:e=>re(x.plainObject(e),"plain object",e),typedArray:e=>re(x.typedArray(e),"TypedArray",e),arrayLike:e=>re(x.arrayLike(e),"array-like",e),domElement:e=>re(x.domElement(e),"HTMLElement",e),observable:e=>re(x.observable(e),"Observable",e),nodeStream:e=>re(x.nodeStream(e),"Node.js Stream",e),infinite:e=>re(x.infinite(e),"infinite number",e),emptyArray:e=>re(x.emptyArray(e),"empty array",e),nonEmptyArray:e=>re(x.nonEmptyArray(e),"non-empty array",e),emptyString:e=>re(x.emptyString(e),"empty string",e),emptyStringOrWhitespace:e=>re(x.emptyStringOrWhitespace(e),"empty string or whitespace",e),nonEmptyString:e=>re(x.nonEmptyString(e),"non-empty string",e),nonEmptyStringAndNotWhitespace:e=>re(x.nonEmptyStringAndNotWhitespace(e),"non-empty string and not whitespace",e),emptyObject:e=>re(x.emptyObject(e),"empty object",e),nonEmptyObject:e=>re(x.nonEmptyObject(e),"non-empty object",e),emptySet:e=>re(x.emptySet(e),"empty set",e),nonEmptySet:e=>re(x.nonEmptySet(e),"non-empty set",e),emptyMap:e=>re(x.emptyMap(e),"empty map",e),nonEmptyMap:e=>re(x.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>re(x.propertyKey(e),"PropertyKey",e),formData:e=>re(x.formData(e),"FormData",e),urlSearchParams:e=>re(x.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>re(x.evenInteger(e),"even integer",e),oddInteger:e=>re(x.oddInteger(e),"odd integer",e),directInstanceOf:(e,r)=>re(x.directInstanceOf(e,r),"T",e),inRange:(e,r)=>re(x.inRange(e,r),"in range",e),any:(e,...r)=>re(x.any(e,...r),"predicate returns truthy for any value",r,{multipleValues:!0}),all:(e,...r)=>re(x.all(e,...r),"predicate returns truthy for all values",r,{multipleValues:!0})};Object.defineProperties(x,{class:{value:x.class_},function:{value:x.function_},null:{value:x.null_}});Object.defineProperties(Z,{class:{value:Z.class_},function:{value:Z.function_},null:{value:Z.null_}});var $=x,DR=require("node:events"),zR=class extends Error{constructor(e){super(e||"Promise was canceled"),this.name="CancelError"}get isCanceled(){return!0}},Vl=class{static fn(e){return(...r)=>new Vl((n,i,s)=>{r.push(s),e(...r).then(n,i)})}constructor(e){this._cancelHandlers=[],this._isPending=!0,this._isCanceled=!1,this._rejectOnCancel=!0,this._promise=new Promise((r,n)=>{this._reject=n;let i=l=>{(!this._isCanceled||!u.shouldReject)&&(this._isPending=!1,r(l))},s=l=>{this._isPending=!1,n(l)},u=l=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(l)};Object.defineProperties(u,{shouldReject:{get:()=>this._rejectOnCancel,set:l=>{this._rejectOnCancel=l}}}),e(i,s,u)})}then(e,r){return this._promise.then(e,r)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!(!this._isPending||this._isCanceled)){if(this._isCanceled=!0,this._cancelHandlers.length>0)try{for(let r of this._cancelHandlers)r()}catch(r){this._reject(r);return}this._rejectOnCancel&&this._reject(new zR(e))}}get isCanceled(){return this._isCanceled}};Object.setPrototypeOf(Vl.prototype,Promise.prototype);function FR(e){return $.object(e)&&"_onResponse"in e}var Ke=class extends Error{constructor(e,r,n){if(super(e),Object.defineProperty(this,"input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Error.captureStackTrace(this,this.constructor),this.name="RequestError",this.code=r.code??"ERR_GOT_REQUEST_ERROR",this.input=r.input,FR(n)?(Object.defineProperty(this,"request",{enumerable:!1,value:n}),Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),this.options=n.options):this.options=n,this.timings=this.request?.timings,$.string(r.stack)&&$.string(this.stack)){let i=this.stack.indexOf(this.message)+this.message.length,s=this.stack.slice(i).split(` +`).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(` +`).reverse();for(;u.length>0&&u[0]===s[0];)s.shift();this.stack=`${this.stack.slice(0,i)}${s.reverse().join(` +`)}${u.reverse().join(` +`)}`}}},UR=class extends Ke{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}},qs=class extends Ke{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}},HR=class extends Ke{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}},np=class extends Ke{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}},WR=class extends Ke{constructor(e,r,n){super(e.message,e,n),Object.defineProperty(this,"timings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.event=e.event,this.timings=r}},op=class extends Ke{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}},VR=class extends Ke{constructor(e){super("Retrying",{},e),this.name="RetryError",this.code="ERR_RETRYING"}},GR=class extends Ke{constructor(e){super("This operation was aborted.",{},e),this.code="ERR_ABORTED",this.name="AbortError"}},qm=He(require("node:process"),1),Zu=require("node:buffer"),KR=require("node:stream"),ip=require("node:url"),el=He(require("node:http"),1),JR=require("events"),YR=require("util"),QR=He(ST(),1),XR=e=>{if(e.timings)return e.timings;let r={start:Date.now(),socket:void 0,lookup:void 0,connect:void 0,secureConnect:void 0,upload:void 0,response:void 0,end:void 0,error:void 0,abort:void 0,phases:{wait:void 0,dns:void 0,tcp:void 0,tls:void 0,request:void 0,firstByte:void 0,download:void 0,total:void 0}};e.timings=r;let n=l=>{l.once(JR.errorMonitor,()=>{r.error=Date.now(),r.phases.total=r.error-r.start})};n(e);let i=()=>{r.abort=Date.now(),r.phases.total=r.abort-r.start};e.prependOnceListener("abort",i);let s=l=>{if(r.socket=Date.now(),r.phases.wait=r.socket-r.start,YR.types.isProxy(l))return;let c=()=>{r.lookup=Date.now(),r.phases.dns=r.lookup-r.socket};l.prependOnceListener("lookup",c),(0,QR.default)(l,{connect:()=>{r.connect=Date.now(),r.lookup===void 0&&(l.removeListener("lookup",c),r.lookup=r.connect,r.phases.dns=r.lookup-r.socket),r.phases.tcp=r.connect-r.lookup},secureConnect:()=>{r.secureConnect=Date.now(),r.phases.tls=r.secureConnect-r.connect}})};e.socket?s(e.socket):e.prependOnceListener("socket",s);let u=()=>{r.upload=Date.now(),r.phases.request=r.upload-(r.secureConnect??r.connect)};return e.writableFinished?u():e.prependOnceListener("finish",u),e.prependOnceListener("response",l=>{r.response=Date.now(),r.phases.firstByte=r.response-r.upload,l.timings=r,n(l),l.prependOnceListener("end",()=>{e.off("abort",i),l.off("aborted",i),!r.phases.total&&(r.end=Date.now(),r.phases.download=r.end-r.response,r.phases.total=r.end-r.start)}),l.prependOnceListener("aborted",i)}),r},ZR=XR,eO=He(require("node:events"),1),as=He(require("node:url"),1),tO=He(require("node:crypto"),1),$m=He(require("node:stream"),1),rO="text/plain",nO="us-ascii",tl=(e,r)=>r.some(n=>n instanceof RegExp?n.test(e):n===e),oO=new Set(["https:","http:","file:"]),iO=e=>{try{let{protocol:r}=new URL(e);return r.endsWith(":")&&!oO.has(r)}catch{return!1}},sO=(e,{stripHash:r})=>{let n=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!n)throw new Error(`Invalid URL: ${e}`);let{type:i,data:s,hash:u}=n.groups,l=i.split(";");u=r?"":u;let c=!1;l[l.length-1]==="base64"&&(l.pop(),c=!0);let h=l.shift()?.toLowerCase()??"",p=[...l.map(y=>{let[d,m=""]=y.split("=").map(_=>_.trim());return d==="charset"&&(m=m.toLowerCase(),m===nO)?"":`${d}${m?`=${m}`:""}`}).filter(Boolean)];return c&&p.push("base64"),(p.length>0||h&&h!==rO)&&p.unshift(h),`data:${p.join(";")},${c?s.trim():s}${u?`#${u}`:""}`};function aO(e,r){if(r={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...r},typeof r.defaultProtocol=="string"&&!r.defaultProtocol.endsWith(":")&&(r.defaultProtocol=`${r.defaultProtocol}:`),e=e.trim(),/^data:/i.test(e))return sO(e,r);if(iO(e))return e;let n=e.startsWith("//");!n&&/^\.*\//.test(e)||(e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,r.defaultProtocol));let i=new URL(e);if(r.forceHttp&&r.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(r.forceHttp&&i.protocol==="https:"&&(i.protocol="http:"),r.forceHttps&&i.protocol==="http:"&&(i.protocol="https:"),r.stripAuthentication&&(i.username="",i.password=""),r.stripHash?i.hash="":r.stripTextFragment&&(i.hash=i.hash.replace(/#?:~:text.*?$/i,"")),i.pathname){let u=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,l=0,c="";for(;;){let p=u.exec(i.pathname);if(!p)break;let y=p[0],d=p.index,m=i.pathname.slice(l,d);c+=m.replace(/\/{2,}/g,"/"),c+=y,l=d+y.length}let h=i.pathname.slice(l,i.pathname.length);c+=h.replace(/\/{2,}/g,"/"),i.pathname=c}if(i.pathname)try{i.pathname=decodeURI(i.pathname)}catch{}if(r.removeDirectoryIndex===!0&&(r.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(r.removeDirectoryIndex)&&r.removeDirectoryIndex.length>0){let u=i.pathname.split("/"),l=u[u.length-1];tl(l,r.removeDirectoryIndex)&&(u=u.slice(0,-1),i.pathname=u.slice(1).join("/")+"/")}if(i.hostname&&(i.hostname=i.hostname.replace(/\.$/,""),r.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(i.hostname)&&(i.hostname=i.hostname.replace(/^www\./,""))),Array.isArray(r.removeQueryParameters))for(let u of[...i.searchParams.keys()])tl(u,r.removeQueryParameters)&&i.searchParams.delete(u);if(!Array.isArray(r.keepQueryParameters)&&r.removeQueryParameters===!0&&(i.search=""),Array.isArray(r.keepQueryParameters)&&r.keepQueryParameters.length>0)for(let u of[...i.searchParams.keys()])tl(u,r.keepQueryParameters)||i.searchParams.delete(u);if(r.sortQueryParameters){i.searchParams.sort();try{i.search=decodeURIComponent(i.search)}catch{}}r.removeTrailingSlash&&(i.pathname=i.pathname.replace(/\/$/,"")),r.removeExplicitPort&&i.port&&(i.port="");let s=e;return e=i.toString(),!r.removeSingleSlash&&i.pathname==="/"&&!s.endsWith("/")&&i.hash===""&&(e=e.replace(/\/$/,"")),(r.removeTrailingSlash||i.pathname==="/")&&i.hash===""&&r.removeSingleSlash&&(e=e.replace(/\/$/,"")),n&&!r.normalizeProtocol&&(e=e.replace(/^http:\/\//,"//")),r.stripProtocol&&(e=e.replace(/^(?:https?:)?\/\//,"")),e}var uO=He(im(),1),rl=He(RT(),1),lO=require("node:stream");function wl(e){return Object.fromEntries(Object.entries(e).map(([r,n])=>[r.toLowerCase(),n]))}var sp=class extends lO.Readable{statusCode;headers;body;url;constructor({statusCode:e,headers:r,body:n,url:i}){if(typeof e!="number")throw new TypeError("Argument `statusCode` should be a number");if(typeof r!="object")throw new TypeError("Argument `headers` should be an object");if(!(n instanceof Uint8Array))throw new TypeError("Argument `body` should be a buffer");if(typeof i!="string")throw new TypeError("Argument `url` should be a string");super({read(){this.push(n),this.push(null)}}),this.statusCode=e,this.headers=wl(r),this.body=n,this.url=i}},us=He(xT(),1),cO=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];function hO(e,r){if(r._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let n=new Set([...Object.keys(e),...cO]),i={};for(let s of n)s in r||(i[s]={get(){let u=e[s];return typeof u=="function"?u.bind(e):u},set(u){e[s]=u},enumerable:!0,configurable:!1});return Object.defineProperties(r,i),e.once("aborted",()=>{r.destroy(),r.emit("aborted")}),e.once("close",()=>{e.complete&&r.readable?r.once("end",()=>{r.emit("close")}):r.emit("close")}),r}var fO=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},Uo=class extends Error{constructor(e){super(e.message),Object.assign(this,e)}},dO=class{constructor(e,r){this.hooks=new Map,this.request=()=>(n,i)=>{let s;if(typeof n=="string")s=nl(as.default.parse(n)),n={};else if(n instanceof as.default.URL)s=nl(as.default.parse(n.toString())),n={};else{let[d,...m]=(n.path??"").split("?"),_=m.length>0?`?${m.join("?")}`:"";s=nl({...n,pathname:d,search:_})}n={headers:{},method:"GET",cache:!0,strictTtl:!1,automaticFailover:!1,...n,...yO(s)},n.headers=Object.fromEntries(pO(n.headers).map(([d,m])=>[d.toLowerCase(),m]));let u=new eO.default,l=aO(as.default.format(s),{stripWWW:!1,removeTrailingSlash:!1,stripAuthentication:!1}),c=`${n.method}:${l}`;n.body&&n.method!==void 0&&["POST","PATCH","PUT"].includes(n.method)&&(n.body instanceof $m.default.Readable?n.cache=!1:c+=`:${tO.default.createHash("md5").update(n.body).digest("hex")}`);let h=!1,p=!1,y=d=>{p=!0;let m=!1,_=()=>{},A=new Promise(R=>{_=()=>{m||(m=!0,R())}}),P=async R=>{if(h){R.status=R.statusCode;let z=rl.default.fromObject(h.cachePolicy).revalidatedPolicy(d,R);if(!z.modified){R.resume(),await new Promise(B=>{R.once("end",B)});let S=ap(z.policy.responseHeaders());R=new sp({statusCode:h.statusCode,headers:S,body:h.body,url:h.url}),R.cachePolicy=z.policy,R.fromCache=!0}}R.fromCache||(R.cachePolicy=new rl.default(d,R,d),R.fromCache=!1);let V;d.cache&&R.cachePolicy.storable()?(V=mO(R),(async()=>{try{let z=uO.default.buffer(R);await Promise.race([A,new Promise(q=>R.once("end",q)),new Promise(q=>R.once("close",q))]);let S=await z,B={url:R.url,statusCode:R.fromCache?h.statusCode:R.statusCode,body:S,cachePolicy:R.cachePolicy.toObject()},v=d.strictTtl?R.cachePolicy.timeToLive():void 0;if(d.maxTtl&&(v=v?Math.min(v,d.maxTtl):d.maxTtl),this.hooks.size>0)for(let q of this.hooks.keys())B=await this.runHook(q,B,R);await this.cache.set(c,B,v)}catch(z){u.emit("error",new Uo(z))}})()):d.cache&&h&&(async()=>{try{await this.cache.delete(c)}catch(z){u.emit("error",new Uo(z))}})(),u.emit("response",V??R),typeof i=="function"&&i(V??R)};try{let R=this.cacheRequest(d,P);R.once("error",_),R.once("abort",_),R.once("destroy",_),u.emit("request",R)}catch(R){u.emit("error",new fO(R))}};return(async()=>{let d=async _=>{await Promise.resolve();let A=_.cache?await this.cache.get(c):void 0;if(typeof A>"u"&&!_.forceRefresh){y(_);return}let P=rl.default.fromObject(A.cachePolicy);if(P.satisfiesWithoutRevalidation(_)&&!_.forceRefresh){let R=ap(P.responseHeaders()),V=new sp({statusCode:A.statusCode,headers:R,body:A.body,url:A.url});V.cachePolicy=P,V.fromCache=!0,u.emit("response",V),typeof i=="function"&&i(V)}else P.satisfiesWithoutRevalidation(_)&&Date.now()>=P.timeToLive()&&_.forceRefresh?(await this.cache.delete(c),_.headers=P.revalidationHeaders(_),y(_)):(h=A,_.headers=P.revalidationHeaders(_),y(_))},m=_=>u.emit("error",new Uo(_));if(this.cache instanceof us.default){let _=this.cache;_.once("error",m),u.on("error",()=>_.removeListener("error",m))}try{await d(n)}catch(_){n.automaticFailover&&!p&&y(n),u.emit("error",new Uo(_))}})(),u},this.addHook=(n,i)=>{this.hooks.has(n)||this.hooks.set(n,i)},this.removeHook=n=>this.hooks.delete(n),this.getHook=n=>this.hooks.get(n),this.runHook=async(n,...i)=>this.hooks.get(n)?.(...i),r instanceof us.default?this.cache=r:typeof r=="string"?this.cache=new us.default({uri:r,namespace:"cacheable-request"}):this.cache=new us.default({store:r,namespace:"cacheable-request"}),this.request=this.request.bind(this),this.cacheRequest=e}},pO=Object.entries,mO=e=>{let r=new $m.PassThrough({autoDestroy:!1});return hO(e,r),e.pipe(r)},yO=e=>{let r={...e};return r.path=`${e.pathname||"/"}${e.search||""}`,delete r.pathname,delete r.search,r},nl=e=>({protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}),ap=e=>{let r=[];for(let n of Object.keys(e))r[n.toLowerCase()]=e[n];return r},gO=dO,vO=He(kT(),1),bO=He(im(),1),Er=e=>typeof e=="function",_O=e=>Er(e[Symbol.asyncIterator]);async function*wO(e){let r=e.getReader();for(;;){let{done:n,value:i}=await r.read();if(n)break;yield i}}var EO=e=>{if(_O(e))return e;if(Er(e.getReader))return wO(e);throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")},up="abcdefghijklmnopqrstuvwxyz0123456789";function SO(){let e=16,r="";for(;e--;)r+=up[Math.random()*up.length<<0];return r}var lp=e=>String(e).replace(/\r|\n/g,(r,n,i)=>r==="\r"&&i[n+1]!==` +`||r===` +`&&i[n-1]!=="\r"?`\r +`:r),TO=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function cp(e){if(TO(e)!=="object")return!1;let r=Object.getPrototypeOf(e);return r==null?!0:(r.constructor&&r.constructor.toString())===Object.toString()}function hp(e,r){if(typeof r=="string"){for(let[n,i]of Object.entries(e))if(r.toLowerCase()===n.toLowerCase())return i}}var RO=e=>new Proxy(e,{get:(r,n)=>hp(r,n),has:(r,n)=>hp(r,n)!==void 0}),Gl=e=>Boolean(e&&Er(e.constructor)&&e[Symbol.toStringTag]==="FormData"&&Er(e.append)&&Er(e.getAll)&&Er(e.entries)&&Er(e[Symbol.iterator])),fp=e=>String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),on=e=>Boolean(e&&typeof e=="object"&&Er(e.constructor)&&e[Symbol.toStringTag]==="File"&&Er(e.stream)&&e.name!=null),qo=function(e,r,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,n):s?s.value=n:r.set(e,n),n},$e=function(e,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:r.get(e)},$o,Ur,Lo,ls,No,sn,Mo,Bo,cs,ol,dp,OO={enableAdditionalHeaders:!1},hs={writable:!1,configurable:!1},xO=class{constructor(e,r,n){if($o.add(this),Ur.set(this,`\r +`),Lo.set(this,void 0),ls.set(this,void 0),No.set(this,"-".repeat(2)),sn.set(this,new TextEncoder),Mo.set(this,void 0),Bo.set(this,void 0),cs.set(this,void 0),!Gl(e))throw new TypeError("Expected first argument to be a FormData instance.");let i;if(cp(r)?n=r:i=r,i||(i=SO()),typeof i!="string")throw new TypeError("Expected boundary argument to be a string.");if(n&&!cp(n))throw new TypeError("Expected options argument to be an object.");qo(this,Bo,Array.from(e.entries()),"f"),qo(this,cs,{...OO,...n},"f"),qo(this,Lo,$e(this,sn,"f").encode($e(this,Ur,"f")),"f"),qo(this,ls,$e(this,Lo,"f").byteLength,"f"),this.boundary=`form-data-boundary-${i}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,qo(this,Mo,$e(this,sn,"f").encode(`${$e(this,No,"f")}${this.boundary}${$e(this,No,"f")}${$e(this,Ur,"f").repeat(2)}`),"f");let s={"Content-Type":this.contentType},u=$e(this,$o,"m",dp).call(this);u&&(this.contentLength=u,s["Content-Length"]=u),this.headers=RO(Object.freeze(s)),Object.defineProperties(this,{boundary:hs,contentType:hs,contentLength:hs,headers:hs})}getContentLength(){return this.contentLength==null?void 0:Number(this.contentLength)}*values(){for(let[e,r]of $e(this,Bo,"f")){let n=on(r)?r:$e(this,sn,"f").encode(lp(r));yield $e(this,$o,"m",ol).call(this,e,n),yield n,yield $e(this,Lo,"f")}yield $e(this,Mo,"f")}async*encode(){for(let e of this.values())on(e)?yield*EO(e.stream()):yield e}[(Ur=new WeakMap,Lo=new WeakMap,ls=new WeakMap,No=new WeakMap,sn=new WeakMap,Mo=new WeakMap,Bo=new WeakMap,cs=new WeakMap,$o=new WeakSet,ol=function(e,r){let n="";n+=`${$e(this,No,"f")}${this.boundary}${$e(this,Ur,"f")}`,n+=`Content-Disposition: form-data; name="${fp(e)}"`,on(r)&&(n+=`; filename="${fp(r.name)}"${$e(this,Ur,"f")}`,n+=`Content-Type: ${r.type||"application/octet-stream"}`);let i=on(r)?r.size:r.byteLength;return $e(this,cs,"f").enableAdditionalHeaders===!0&&i!=null&&!isNaN(i)&&(n+=`${$e(this,Ur,"f")}Content-Length: ${on(r)?r.size:r.byteLength}`),$e(this,sn,"f").encode(`${n}${$e(this,Ur,"f").repeat(2)}`)},dp=function(){let e=0;for(let[r,n]of $e(this,Bo,"f")){let i=on(n)?n:$e(this,sn,"f").encode(lp(n)),s=on(i)?i.size:i.byteLength;if(s==null||isNaN(s))return;e+=$e(this,$o,"m",ol).call(this,r,i).byteLength,e+=s,e+=$e(this,ls,"f")}return String(e+$e(this,Mo,"f").byteLength)},Symbol.iterator)](){return this.values()}[Symbol.asyncIterator](){return this.encode()}},AO=require("node:buffer"),kO=require("node:util");function Lm(e){return $.nodeStream(e)&&$.function_(e.getBoundary)}async function PO(e,r){if(r&&"content-length"in r)return Number(r["content-length"]);if(!e)return 0;if($.string(e))return AO.Buffer.byteLength(e);if($.buffer(e))return e.length;if(Lm(e))return(0,kO.promisify)(e.getLength.bind(e))()}function Nm(e,r,n){let i={};for(let s of n){let u=(...l)=>{r.emit(s,...l)};i[s]=u,e.on(s,u)}return()=>{for(let[s,u]of Object.entries(i))e.off(s,u)}}var CO=He(require("node:net"),1);function IO(){let e=[];return{once(r,n,i){r.once(n,i),e.push({origin:r,event:n,fn:i})},unhandleAll(){for(let r of e){let{origin:n,event:i,fn:s}=r;n.removeListener(i,s)}e.length=0}}}var pp=Symbol("reentry"),jO=()=>{},Mm=class extends Error{constructor(e,r){super(`Timeout awaiting '${r}' for ${e}ms`),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.code="ETIMEDOUT"}};function qO(e,r,n){if(pp in e)return jO;e[pp]=!0;let i=[],{once:s,unhandleAll:u}=IO(),l=(P,R,V)=>{let z=setTimeout(R,P,P,V);z.unref?.();let S=()=>{clearTimeout(z)};return i.push(S),S},{host:c,hostname:h}=n,p=(P,R)=>{e.destroy(new Mm(P,R))},y=()=>{for(let P of i)P();u()};if(e.once("error",P=>{if(y(),e.listenerCount("error")===0)throw P}),typeof r.request<"u"){let P=l(r.request,p,"request");s(e,"response",R=>{s(R,"end",P)})}if(typeof r.socket<"u"){let{socket:P}=r,R=()=>{p(P,"socket")};e.setTimeout(P,R),i.push(()=>{e.removeListener("timeout",R)})}let d=typeof r.lookup<"u",m=typeof r.connect<"u",_=typeof r.secureConnect<"u",A=typeof r.send<"u";return(d||m||_||A)&&s(e,"socket",P=>{let{socketPath:R}=e;if(P.connecting){let V=Boolean(R??CO.default.isIP(h??c??"")!==0);if(d&&!V&&typeof P.address().address>"u"){let z=l(r.lookup,p,"lookup");s(P,"lookup",z)}if(m){let z=()=>l(r.connect,p,"connect");V?s(P,"connect",z()):s(P,"lookup",S=>{S===null&&s(P,"connect",z())})}_&&n.protocol==="https:"&&s(P,"connect",()=>{let z=l(r.secureConnect,p,"secureConnect");s(P,"secureConnect",z)})}if(A){let V=()=>l(r.send,p,"send");P.connecting?s(P,"connect",()=>{s(e,"upload-complete",V())}):s(e,"upload-complete",V())}}),typeof r.response<"u"&&s(e,"upload-complete",()=>{let P=l(r.response,p,"response");s(e,"response",P)}),typeof r.read<"u"&&s(e,"response",P=>{let R=l(r.read,p,"read");s(P,"end",R)}),y}function $O(e){e=e;let r={protocol:e.protocol,hostname:$.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};return $.string(e.port)&&e.port.length>0&&(r.port=Number(e.port)),(e.username||e.password)&&(r.auth=`${e.username||""}:${e.password||""}`),r}var LO=class{constructor(){Object.defineProperty(this,"weakMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.weakMap=new WeakMap,this.map=new Map}set(e,r){typeof e=="object"?this.weakMap.set(e,r):this.map.set(e,r)}get(e){return typeof e=="object"?this.weakMap.get(e):this.map.get(e)}has(e){return typeof e=="object"?this.weakMap.has(e):this.map.has(e)}},NO=({attemptCount:e,retryOptions:r,error:n,retryAfter:i,computedValue:s})=>{if(n.name==="RetryError")return 1;if(e>r.limit)return 0;let u=r.methods.includes(n.options.method),l=r.errorCodes.includes(n.code),c=n.response&&r.statusCodes.includes(n.response.statusCode);if(!u||!l&&!c)return 0;if(n.response){if(i)return i>s?0:i;if(n.response.statusCode===413)return 0}let h=Math.random()*r.noise;return Math.min(2**(e-1)*1e3,r.backoffLimit)+h},MO=NO,BO=He(require("node:process"),1),il=require("node:util"),dn=require("node:url"),DO=require("node:tls"),zO=He(require("node:http"),1),FO=He(require("node:https"),1),Jn=require("node:dns"),sl=require("node:util"),UO=He(require("node:os"),1),{Resolver:mp}=Jn.promises,Vn=Symbol("cacheableLookupCreateConnection"),al=Symbol("cacheableLookupInstance"),yp=Symbol("expires"),HO=typeof Jn.ALL=="number",gp=e=>{if(!(e&&typeof e.createConnection=="function"))throw new Error("Expected an Agent instance as the first argument")},WO=e=>{for(let r of e)r.family!==6&&(r.address=`::ffff:${r.address}`,r.family=6)},vp=()=>{let e=!1,r=!1;for(let n of Object.values(UO.default.networkInterfaces()))for(let i of n)if(!i.internal&&(i.family==="IPv6"?r=!0:e=!0,e&&r))return{has4:e,has6:r};return{has4:e,has6:r}},VO=e=>Symbol.iterator in e,fs=e=>e.catch(r=>{if(r.code==="ENODATA"||r.code==="ENOTFOUND"||r.code==="ENOENT")return[];throw r}),bp={ttl:!0},GO={all:!0},KO={all:!0,family:4},JO={all:!0,family:6},YO=class{constructor({cache:e=new Map,maxTtl:r=1/0,fallbackDuration:n=3600,errorTtl:i=.15,resolver:s=new mp,lookup:u=Jn.lookup}={}){if(this.maxTtl=r,this.errorTtl=i,this._cache=e,this._resolver=s,this._dnsLookup=u&&(0,sl.promisify)(u),this.stats={cache:0,query:0},this._resolver instanceof mp?(this._resolve4=this._resolver.resolve4.bind(this._resolver),this._resolve6=this._resolver.resolve6.bind(this._resolver)):(this._resolve4=(0,sl.promisify)(this._resolver.resolve4.bind(this._resolver)),this._resolve6=(0,sl.promisify)(this._resolver.resolve6.bind(this._resolver))),this._iface=vp(),this._pending={},this._nextRemovalTime=!1,this._hostnamesToFallback=new Set,this.fallbackDuration=n,n>0){let l=setInterval(()=>{this._hostnamesToFallback.clear()},n*1e3);l.unref&&l.unref(),this._fallbackInterval=l}this.lookup=this.lookup.bind(this),this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear(),this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,r,n){if(typeof r=="function"?(n=r,r={}):typeof r=="number"&&(r={family:r}),!n)throw new Error("Callback must be a function.");this.lookupAsync(e,r).then(i=>{r.all?n(null,i):n(null,i.address,i.family,i.expires,i.ttl,i.source)},n)}async lookupAsync(e,r={}){typeof r=="number"&&(r={family:r});let n=await this.query(e);if(r.family===6){let i=n.filter(s=>s.family===6);r.hints&Jn.V4MAPPED&&(HO&&r.hints&Jn.ALL||i.length===0)?WO(n):n=i}else r.family===4&&(n=n.filter(i=>i.family===4));if(r.hints&Jn.ADDRCONFIG){let{_iface:i}=this;n=n.filter(s=>s.family===6?i.has6:i.has4)}if(n.length===0){let i=new Error(`cacheableLookup ENOTFOUND ${e}`);throw i.code="ENOTFOUND",i.hostname=e,i}return r.all?n:n[0]}async query(e){let r="cache",n=await this._cache.get(e);if(n&&this.stats.cache++,!n){let i=this._pending[e];if(i)this.stats.cache++,n=await i;else{r="query";let s=this.queryAndCache(e);this._pending[e]=s,this.stats.query++;try{n=await s}finally{delete this._pending[e]}}}return n=n.map(i=>({...i,source:r})),n}async _resolve(e){let[r,n]=await Promise.all([fs(this._resolve4(e,bp)),fs(this._resolve6(e,bp))]),i=0,s=0,u=0,l=Date.now();for(let c of r)c.family=4,c.expires=l+c.ttl*1e3,i=Math.max(i,c.ttl);for(let c of n)c.family=6,c.expires=l+c.ttl*1e3,s=Math.max(s,c.ttl);return r.length>0?n.length>0?u=Math.min(i,s):u=i:u=s,{entries:[...r,...n],cacheTtl:u}}async _lookup(e){try{let[r,n]=await Promise.all([fs(this._dnsLookup(e,KO)),fs(this._dnsLookup(e,JO))]);return{entries:[...r,...n],cacheTtl:0}}catch{return{entries:[],cacheTtl:0}}}async _set(e,r,n){if(this.maxTtl>0&&n>0){n=Math.min(n,this.maxTtl)*1e3,r[yp]=Date.now()+n;try{await this._cache.set(e,r,n)}catch(i){this.lookupAsync=async()=>{let s=new Error("Cache Error. Please recreate the CacheableLookup instance.");throw s.cause=i,s}}VO(this._cache)&&this._tick(n)}}async queryAndCache(e){if(this._hostnamesToFallback.has(e))return this._dnsLookup(e,GO);let r=await this._resolve(e);r.entries.length===0&&this._dnsLookup&&(r=await this._lookup(e),r.entries.length!==0&&this.fallbackDuration>0&&this._hostnamesToFallback.add(e));let n=r.entries.length===0?this.errorTtl:r.cacheTtl;return await this._set(e,r.entries,n),r.entries}_tick(e){let r=this._nextRemovalTime;(!r||e{this._nextRemovalTime=!1;let n=1/0,i=Date.now();for(let[s,u]of this._cache){let l=u[yp];i>=l?this._cache.delete(s):l("lookup"in r||(r.lookup=this.lookup),e[Vn](r,n))}uninstall(e){if(gp(e),e[Vn]){if(e[al]!==this)throw new Error("The agent is not owned by this CacheableLookup instance");e.createConnection=e[Vn],delete e[Vn],delete e[al]}}updateInterfaceInfo(){let{_iface:e}=this;this._iface=vp(),(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6)&&this._cache.clear()}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}},QO=He(DT(),1);function XO(e){let r=[],n=e.split(",");for(let i of n){let[s,...u]=i.split(";"),l=s.trim();if(l[0]!=="<"||l[l.length-1]!==">")throw new Error(`Invalid format of the Link header reference: ${l}`);let c=l.slice(1,-1),h={};if(u.length===0)throw new Error(`Unexpected end of Link header parameters: ${u.join(";")}`);for(let p of u){let y=p.trim(),d=y.indexOf("=");if(d===-1)throw new Error(`Failed to parse Link header: ${e}`);let m=y.slice(0,d).trim(),_=y.slice(d+1).trim();h[m]=_}r.push({reference:c,parameters:h})}return r}var[_p,ZO]=BO.default.versions.node.split(".").map(Number);function ex(e){for(let r in e){let n=e[r];Z.any([$.string,$.number,$.boolean,$.null_,$.undefined],n)}}var tx=new Map,ul,rx=()=>ul||(ul=new YO,ul),nx={request:void 0,agent:{http:void 0,https:void 0,http2:void 0},h2session:void 0,decompress:!0,timeout:{connect:void 0,lookup:void 0,read:void 0,request:void 0,response:void 0,secureConnect:void 0,send:void 0,socket:void 0},prefixUrl:"",body:void 0,form:void 0,json:void 0,cookieJar:void 0,ignoreInvalidCookies:!1,searchParams:void 0,dnsLookup:void 0,dnsCache:void 0,context:{},hooks:{init:[],beforeRequest:[],beforeError:[],beforeRedirect:[],beforeRetry:[],afterResponse:[]},followRedirect:!0,maxRedirects:10,cache:void 0,throwHttpErrors:!0,username:"",password:"",http2:!1,allowGetBody:!1,headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},methodRewriting:!1,dnsLookupIpVersion:void 0,parseJson:JSON.parse,stringifyJson:JSON.stringify,retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:e})=>e,backoffLimit:Number.POSITIVE_INFINITY,noise:100},localAddress:void 0,method:"GET",createConnection:void 0,cacheOptions:{shared:void 0,cacheHeuristic:void 0,immutableMinTimeToLive:void 0,ignoreCargoCult:void 0},https:{alpnProtocols:void 0,rejectUnauthorized:void 0,checkServerIdentity:void 0,certificateAuthority:void 0,key:void 0,certificate:void 0,passphrase:void 0,pfx:void 0,ciphers:void 0,honorCipherOrder:void 0,minVersion:void 0,maxVersion:void 0,signatureAlgorithms:void 0,tlsSessionLifetime:void 0,dhparam:void 0,ecdhCurve:void 0,certificateRevocationLists:void 0},encoding:void 0,resolveBodyOnly:!1,isStream:!1,responseType:"text",url:void 0,pagination:{transform(e){return e.request.options.responseType==="json"?e.body:JSON.parse(e.body)},paginate({response:e}){let r=e.headers.link;if(typeof r!="string"||r.trim()==="")return!1;let n=XO(r).find(i=>i.parameters.rel==="next"||i.parameters.rel==='"next"');return n?{url:new dn.URL(n.reference,e.url)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:Number.POSITIVE_INFINITY,backoff:0,requestLimit:1e4,stackAllItems:!1},setHost:!0,maxHeaderSize:void 0,signal:void 0,enableUnixSockets:!0},ox=e=>{let{hooks:r,retry:n}=e,i={...e,context:{...e.context},cacheOptions:{...e.cacheOptions},https:{...e.https},agent:{...e.agent},headers:{...e.headers},retry:{...n,errorCodes:[...n.errorCodes],methods:[...n.methods],statusCodes:[...n.statusCodes]},timeout:{...e.timeout},hooks:{init:[...r.init],beforeRequest:[...r.beforeRequest],beforeError:[...r.beforeError],beforeRedirect:[...r.beforeRedirect],beforeRetry:[...r.beforeRetry],afterResponse:[...r.afterResponse]},searchParams:e.searchParams?new dn.URLSearchParams(e.searchParams):void 0,pagination:{...e.pagination}};return i.url!==void 0&&(i.prefixUrl=""),i},ix=e=>{let{hooks:r,retry:n}=e,i={...e};return $.object(e.context)&&(i.context={...e.context}),$.object(e.cacheOptions)&&(i.cacheOptions={...e.cacheOptions}),$.object(e.https)&&(i.https={...e.https}),$.object(e.cacheOptions)&&(i.cacheOptions={...i.cacheOptions}),$.object(e.agent)&&(i.agent={...e.agent}),$.object(e.headers)&&(i.headers={...e.headers}),$.object(n)&&(i.retry={...n},$.array(n.errorCodes)&&(i.retry.errorCodes=[...n.errorCodes]),$.array(n.methods)&&(i.retry.methods=[...n.methods]),$.array(n.statusCodes)&&(i.retry.statusCodes=[...n.statusCodes])),$.object(e.timeout)&&(i.timeout={...e.timeout}),$.object(r)&&(i.hooks={...r},$.array(r.init)&&(i.hooks.init=[...r.init]),$.array(r.beforeRequest)&&(i.hooks.beforeRequest=[...r.beforeRequest]),$.array(r.beforeError)&&(i.hooks.beforeError=[...r.beforeError]),$.array(r.beforeRedirect)&&(i.hooks.beforeRedirect=[...r.beforeRedirect]),$.array(r.beforeRetry)&&(i.hooks.beforeRetry=[...r.beforeRetry]),$.array(r.afterResponse)&&(i.hooks.afterResponse=[...r.afterResponse])),$.object(e.pagination)&&(i.pagination={...e.pagination}),i},sx=e=>{let r=[e.timeout.socket,e.timeout.connect,e.timeout.lookup,e.timeout.request,e.timeout.secureConnect].filter(n=>typeof n=="number");if(r.length>0)return Math.min(...r)},wp=(e,r,n)=>{let i=e.hooks?.init;if(i)for(let s of i)s(r,n)},Sr=class{constructor(e,r,n){if(Object.defineProperty(this,"_unixOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_internals",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_merging",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_init",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Z.any([$.string,$.urlInstance,$.object,$.undefined],e),Z.any([$.object,$.undefined],r),Z.any([$.object,$.undefined],n),e instanceof Sr||r instanceof Sr)throw new TypeError("The defaults must be passed as the third argument");this._internals=ox(n?._internals??n??nx),this._init=[...n?._init??[]],this._merging=!1,this._unixOptions=void 0;try{if($.plainObject(e))try{this.merge(e),this.merge(r)}finally{this.url=e.url}else try{this.merge(r)}finally{if(r?.url!==void 0)if(e===void 0)this.url=r.url;else throw new TypeError("The `url` option is mutually exclusive with the `input` argument");else e!==void 0&&(this.url=e)}}catch(i){throw i.options=this,i}}merge(e){if(e){if(e instanceof Sr){for(let r of e._init)this.merge(r);return}e=ix(e),wp(this,e,this),wp(e,e,this),this._merging=!0,"isStream"in e&&(this.isStream=e.isStream);try{let r=!1;for(let n in e)if(!(n==="mutableDefaults"||n==="handlers")&&n!=="url"){if(!(n in this))throw new Error(`Unexpected option: ${n}`);this[n]=e[n],r=!0}r&&this._init.push(e)}finally{this._merging=!1}}}get request(){return this._internals.request}set request(e){Z.any([$.function_,$.undefined],e),this._internals.request=e}get agent(){return this._internals.agent}set agent(e){Z.plainObject(e);for(let r in e){if(!(r in this._internals.agent))throw new TypeError(`Unexpected agent option: ${r}`);Z.any([$.object,$.undefined],e[r])}this._merging?Object.assign(this._internals.agent,e):this._internals.agent={...e}}get h2session(){return this._internals.h2session}set h2session(e){this._internals.h2session=e}get decompress(){return this._internals.decompress}set decompress(e){Z.boolean(e),this._internals.decompress=e}get timeout(){return this._internals.timeout}set timeout(e){Z.plainObject(e);for(let r in e){if(!(r in this._internals.timeout))throw new Error(`Unexpected timeout option: ${r}`);Z.any([$.number,$.undefined],e[r])}this._merging?Object.assign(this._internals.timeout,e):this._internals.timeout={...e}}get prefixUrl(){return this._internals.prefixUrl}set prefixUrl(e){if(Z.any([$.string,$.urlInstance],e),e===""){this._internals.prefixUrl="";return}if(e=e.toString(),e.endsWith("/")||(e+="/"),this._internals.prefixUrl&&this._internals.url){let{href:r}=this._internals.url;this._internals.url.href=e+r.slice(this._internals.prefixUrl.length)}this._internals.prefixUrl=e}get body(){return this._internals.body}set body(e){Z.any([$.string,$.buffer,$.nodeStream,$.generator,$.asyncGenerator,Gl,$.undefined],e),$.nodeStream(e)&&Z.truthy(e.readable),e!==void 0&&(Z.undefined(this._internals.form),Z.undefined(this._internals.json)),this._internals.body=e}get form(){return this._internals.form}set form(e){Z.any([$.plainObject,$.undefined],e),e!==void 0&&(Z.undefined(this._internals.body),Z.undefined(this._internals.json)),this._internals.form=e}get json(){return this._internals.json}set json(e){e!==void 0&&(Z.undefined(this._internals.body),Z.undefined(this._internals.form)),this._internals.json=e}get url(){return this._internals.url}set url(e){if(Z.any([$.string,$.urlInstance,$.undefined],e),e===void 0){this._internals.url=void 0;return}if($.string(e)&&e.startsWith("/"))throw new Error("`url` must not start with a slash");let r=`${this.prefixUrl}${e.toString()}`,n=new dn.URL(r);if(this._internals.url=n,decodeURI(r),n.protocol==="unix:"&&(n.href=`http://unix${n.pathname}${n.search}`),n.protocol!=="http:"&&n.protocol!=="https:"){let i=new Error(`Unsupported protocol: ${n.protocol}`);throw i.code="ERR_UNSUPPORTED_PROTOCOL",i}if(this._internals.username&&(n.username=this._internals.username,this._internals.username=""),this._internals.password&&(n.password=this._internals.password,this._internals.password=""),this._internals.searchParams&&(n.search=this._internals.searchParams.toString(),this._internals.searchParams=void 0),n.hostname==="unix"){if(!this._internals.enableUnixSockets)throw new Error("Using UNIX domain sockets but option `enableUnixSockets` is not enabled");let i=/(?.+?):(?.+)/.exec(`${n.pathname}${n.search}`);if(i?.groups){let{socketPath:s,path:u}=i.groups;this._unixOptions={socketPath:s,path:u,host:""}}else this._unixOptions=void 0;return}this._unixOptions=void 0}get cookieJar(){return this._internals.cookieJar}set cookieJar(e){if(Z.any([$.object,$.undefined],e),e===void 0){this._internals.cookieJar=void 0;return}let{setCookie:r,getCookieString:n}=e;Z.function_(r),Z.function_(n),r.length===4&&n.length===0?(r=(0,il.promisify)(r.bind(e)),n=(0,il.promisify)(n.bind(e)),this._internals.cookieJar={setCookie:r,getCookieString:n}):this._internals.cookieJar=e}get signal(){return this._internals.signal}set signal(e){Z.object(e),this._internals.signal=e}get ignoreInvalidCookies(){return this._internals.ignoreInvalidCookies}set ignoreInvalidCookies(e){Z.boolean(e),this._internals.ignoreInvalidCookies=e}get searchParams(){return this._internals.url?this._internals.url.searchParams:(this._internals.searchParams===void 0&&(this._internals.searchParams=new dn.URLSearchParams),this._internals.searchParams)}set searchParams(e){Z.any([$.string,$.object,$.undefined],e);let r=this._internals.url;if(e===void 0){this._internals.searchParams=void 0,r&&(r.search="");return}let n=this.searchParams,i;if($.string(e))i=new dn.URLSearchParams(e);else if(e instanceof dn.URLSearchParams)i=e;else{ex(e),i=new dn.URLSearchParams;for(let s in e){let u=e[s];u===null?i.append(s,""):u===void 0?n.delete(s):i.append(s,u)}}if(this._merging){for(let s of i.keys())n.delete(s);for(let[s,u]of i)n.append(s,u)}else r?r.search=n.toString():this._internals.searchParams=n}get searchParameters(){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}set searchParameters(e){throw new Error("The `searchParameters` option does not exist. Use `searchParams` instead.")}get dnsLookup(){return this._internals.dnsLookup}set dnsLookup(e){Z.any([$.function_,$.undefined],e),this._internals.dnsLookup=e}get dnsCache(){return this._internals.dnsCache}set dnsCache(e){Z.any([$.object,$.boolean,$.undefined],e),e===!0?this._internals.dnsCache=rx():e===!1?this._internals.dnsCache=void 0:this._internals.dnsCache=e}get context(){return this._internals.context}set context(e){Z.object(e),this._merging?Object.assign(this._internals.context,e):this._internals.context={...e}}get hooks(){return this._internals.hooks}set hooks(e){Z.object(e);for(let r in e){if(!(r in this._internals.hooks))throw new Error(`Unexpected hook event: ${r}`);let n=r,i=e[n];if(Z.any([$.array,$.undefined],i),i)for(let s of i)Z.function_(s);if(this._merging)i&&this._internals.hooks[n].push(...i);else{if(!i)throw new Error(`Missing hook event: ${r}`);this._internals.hooks[r]=[...i]}}}get followRedirect(){return this._internals.followRedirect}set followRedirect(e){Z.boolean(e),this._internals.followRedirect=e}get followRedirects(){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}set followRedirects(e){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}get maxRedirects(){return this._internals.maxRedirects}set maxRedirects(e){Z.number(e),this._internals.maxRedirects=e}get cache(){return this._internals.cache}set cache(e){Z.any([$.object,$.string,$.boolean,$.undefined],e),e===!0?this._internals.cache=tx:e===!1?this._internals.cache=void 0:this._internals.cache=e}get throwHttpErrors(){return this._internals.throwHttpErrors}set throwHttpErrors(e){Z.boolean(e),this._internals.throwHttpErrors=e}get username(){let e=this._internals.url,r=e?e.username:this._internals.username;return decodeURIComponent(r)}set username(e){Z.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.username=n:this._internals.username=n}get password(){let e=this._internals.url,r=e?e.password:this._internals.password;return decodeURIComponent(r)}set password(e){Z.string(e);let r=this._internals.url,n=encodeURIComponent(e);r?r.password=n:this._internals.password=n}get http2(){return this._internals.http2}set http2(e){Z.boolean(e),this._internals.http2=e}get allowGetBody(){return this._internals.allowGetBody}set allowGetBody(e){Z.boolean(e),this._internals.allowGetBody=e}get headers(){return this._internals.headers}set headers(e){Z.plainObject(e),this._merging?Object.assign(this._internals.headers,wl(e)):this._internals.headers=wl(e)}get methodRewriting(){return this._internals.methodRewriting}set methodRewriting(e){Z.boolean(e),this._internals.methodRewriting=e}get dnsLookupIpVersion(){return this._internals.dnsLookupIpVersion}set dnsLookupIpVersion(e){if(e!==void 0&&e!==4&&e!==6)throw new TypeError(`Invalid DNS lookup IP version: ${e}`);this._internals.dnsLookupIpVersion=e}get parseJson(){return this._internals.parseJson}set parseJson(e){Z.function_(e),this._internals.parseJson=e}get stringifyJson(){return this._internals.stringifyJson}set stringifyJson(e){Z.function_(e),this._internals.stringifyJson=e}get retry(){return this._internals.retry}set retry(e){if(Z.plainObject(e),Z.any([$.function_,$.undefined],e.calculateDelay),Z.any([$.number,$.undefined],e.maxRetryAfter),Z.any([$.number,$.undefined],e.limit),Z.any([$.array,$.undefined],e.methods),Z.any([$.array,$.undefined],e.statusCodes),Z.any([$.array,$.undefined],e.errorCodes),Z.any([$.number,$.undefined],e.noise),e.noise&&Math.abs(e.noise)>100)throw new Error(`The maximum acceptable retry noise is +/- 100ms, got ${e.noise}`);for(let n in e)if(!(n in this._internals.retry))throw new Error(`Unexpected retry option: ${n}`);this._merging?Object.assign(this._internals.retry,e):this._internals.retry={...e};let{retry:r}=this._internals;r.methods=[...new Set(r.methods.map(n=>n.toUpperCase()))],r.statusCodes=[...new Set(r.statusCodes)],r.errorCodes=[...new Set(r.errorCodes)]}get localAddress(){return this._internals.localAddress}set localAddress(e){Z.any([$.string,$.undefined],e),this._internals.localAddress=e}get method(){return this._internals.method}set method(e){Z.string(e),this._internals.method=e.toUpperCase()}get createConnection(){return this._internals.createConnection}set createConnection(e){Z.any([$.function_,$.undefined],e),this._internals.createConnection=e}get cacheOptions(){return this._internals.cacheOptions}set cacheOptions(e){Z.plainObject(e),Z.any([$.boolean,$.undefined],e.shared),Z.any([$.number,$.undefined],e.cacheHeuristic),Z.any([$.number,$.undefined],e.immutableMinTimeToLive),Z.any([$.boolean,$.undefined],e.ignoreCargoCult);for(let r in e)if(!(r in this._internals.cacheOptions))throw new Error(`Cache option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.cacheOptions,e):this._internals.cacheOptions={...e}}get https(){return this._internals.https}set https(e){Z.plainObject(e),Z.any([$.boolean,$.undefined],e.rejectUnauthorized),Z.any([$.function_,$.undefined],e.checkServerIdentity),Z.any([$.string,$.object,$.array,$.undefined],e.certificateAuthority),Z.any([$.string,$.object,$.array,$.undefined],e.key),Z.any([$.string,$.object,$.array,$.undefined],e.certificate),Z.any([$.string,$.undefined],e.passphrase),Z.any([$.string,$.buffer,$.array,$.undefined],e.pfx),Z.any([$.array,$.undefined],e.alpnProtocols),Z.any([$.string,$.undefined],e.ciphers),Z.any([$.string,$.buffer,$.undefined],e.dhparam),Z.any([$.string,$.undefined],e.signatureAlgorithms),Z.any([$.string,$.undefined],e.minVersion),Z.any([$.string,$.undefined],e.maxVersion),Z.any([$.boolean,$.undefined],e.honorCipherOrder),Z.any([$.number,$.undefined],e.tlsSessionLifetime),Z.any([$.string,$.undefined],e.ecdhCurve),Z.any([$.string,$.buffer,$.array,$.undefined],e.certificateRevocationLists);for(let r in e)if(!(r in this._internals.https))throw new Error(`HTTPS option \`${r}\` does not exist`);this._merging?Object.assign(this._internals.https,e):this._internals.https={...e}}get encoding(){return this._internals.encoding}set encoding(e){if(e===null)throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead");Z.any([$.string,$.undefined],e),this._internals.encoding=e}get resolveBodyOnly(){return this._internals.resolveBodyOnly}set resolveBodyOnly(e){Z.boolean(e),this._internals.resolveBodyOnly=e}get isStream(){return this._internals.isStream}set isStream(e){Z.boolean(e),this._internals.isStream=e}get responseType(){return this._internals.responseType}set responseType(e){if(e===void 0){this._internals.responseType="text";return}if(e!=="text"&&e!=="buffer"&&e!=="json")throw new Error(`Invalid \`responseType\` option: ${e}`);this._internals.responseType=e}get pagination(){return this._internals.pagination}set pagination(e){Z.object(e),this._merging?Object.assign(this._internals.pagination,e):this._internals.pagination=e}get auth(){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}set auth(e){throw new Error("Parameter `auth` is deprecated. Use `username` / `password` instead.")}get setHost(){return this._internals.setHost}set setHost(e){Z.boolean(e),this._internals.setHost=e}get maxHeaderSize(){return this._internals.maxHeaderSize}set maxHeaderSize(e){Z.any([$.number,$.undefined],e),this._internals.maxHeaderSize=e}get enableUnixSockets(){return this._internals.enableUnixSockets}set enableUnixSockets(e){Z.boolean(e),this._internals.enableUnixSockets=e}toJSON(){return{...this._internals}}[Symbol.for("nodejs.util.inspect.custom")](e,r){return(0,il.inspect)(this._internals,r)}createNativeRequestOptions(){let e=this._internals,r=e.url,n;r.protocol==="https:"?n=e.http2?e.agent:e.agent.https:n=e.agent.http;let{https:i}=e,{pfx:s}=i;return $.array(s)&&$.plainObject(s[0])&&(s=s.map(u=>({buf:u.buffer,passphrase:u.passphrase}))),{...e.cacheOptions,...this._unixOptions,ALPNProtocols:i.alpnProtocols,ca:i.certificateAuthority,cert:i.certificate,key:i.key,passphrase:i.passphrase,pfx:i.pfx,rejectUnauthorized:i.rejectUnauthorized,checkServerIdentity:i.checkServerIdentity??DO.checkServerIdentity,ciphers:i.ciphers,honorCipherOrder:i.honorCipherOrder,minVersion:i.minVersion,maxVersion:i.maxVersion,sigalgs:i.signatureAlgorithms,sessionTimeout:i.tlsSessionLifetime,dhparam:i.dhparam,ecdhCurve:i.ecdhCurve,crl:i.certificateRevocationLists,lookup:e.dnsLookup??e.dnsCache?.lookup,family:e.dnsLookupIpVersion,agent:n,setHost:e.setHost,method:e.method,maxHeaderSize:e.maxHeaderSize,localAddress:e.localAddress,headers:e.headers,createConnection:e.createConnection,timeout:e.http2?sx(e):void 0,h2session:e.h2session}}getRequestFunction(){let e=this._internals.url,{request:r}=this._internals;return!r&&e?this.getFallbackRequestFunction():r}getFallbackRequestFunction(){let e=this._internals.url;if(e){if(e.protocol==="https:"){if(this._internals.http2){if(_p<15||_p===15&&ZO<10){let r=new Error("To use the `http2` option, install Node.js 15.10.0 or above");throw r.code="EUNSUPPORTED",r}return QO.default.auto}return FO.default.request}return zO.default.request}}freeze(){let e=this._internals;Object.freeze(e),Object.freeze(e.hooks),Object.freeze(e.hooks.afterResponse),Object.freeze(e.hooks.beforeError),Object.freeze(e.hooks.beforeRedirect),Object.freeze(e.hooks.beforeRequest),Object.freeze(e.hooks.beforeRetry),Object.freeze(e.hooks.init),Object.freeze(e.https),Object.freeze(e.cacheOptions),Object.freeze(e.agent),Object.freeze(e.headers),Object.freeze(e.timeout),Object.freeze(e.retry),Object.freeze(e.retry.errorCodes),Object.freeze(e.retry.methods),Object.freeze(e.retry.statusCodes)}},$s=e=>{let{statusCode:r}=e,n=e.request.options.followRedirect?299:399;return r>=200&&r<=n||r===304},Ep=class extends Ke{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code="ERR_BODY_PARSE_FAILURE"}},Sp=(e,r,n,i)=>{let{rawBody:s}=e;try{if(r==="text")return s.toString(i);if(r==="json")return s.length===0?"":n(s.toString(i));if(r==="buffer")return s}catch(u){throw new Ep(u,e)}throw new Ep({message:`Unknown body type '${r}'`,name:"Error"},e)};function ax(e){return e.writable&&!e.writableEnded}var ux=ax;function Tp(e){return e.protocol==="unix:"||e.hostname==="unix"}var lx=$.string(qm.default.versions.brotli),cx=new Set(["GET","HEAD"]),ll=new LO,hx=new Set([300,301,302,303,304,307,308]),fx=["socket","connect","continue","information","upgrade"],ds=()=>{},Kl=class extends KR.Duplex{constructor(e,r,n){super({autoDestroy:!1,highWaterMark:0}),Object.defineProperty(this,"constructor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_noPipe",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"requestUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"redirectUrls",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopRetry",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downloadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_uploadedSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_stopReading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pipedServerResponses",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_responseSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bodySize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_unproxyEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isFromCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cannotHaveBody",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_triggerRead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_cancelTimeouts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_removeListeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nativeResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_flushed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_aborted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_requestInitialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._downloadedSize=0,this._uploadedSize=0,this._stopReading=!1,this._pipedServerResponses=new Set,this._cannotHaveBody=!1,this._unproxyEvents=ds,this._triggerRead=!1,this._cancelTimeouts=ds,this._removeListeners=ds,this._jobs=[],this._flushed=!1,this._requestInitialized=!1,this._aborted=!1,this.redirectUrls=[],this.retryCount=0,this._stopRetry=ds,this.on("pipe",s=>{s.headers&&Object.assign(this.options.headers,s.headers)}),this.on("newListener",s=>{if(s==="retry"&&this.listenerCount("retry")>0)throw new Error("A retry listener has been attached already.")});try{if(this.options=new Sr(e,r,n),!this.options.url){if(this.options.prefixUrl==="")throw new TypeError("Missing `url` property");this.options.url=""}this.requestUrl=this.options.url}catch(s){let{options:u}=s;u&&(this.options=u),this.flush=async()=>{this.flush=async()=>{},this.destroy(s)};return}let{body:i}=this.options;if($.nodeStream(i)&&i.once("error",s=>{this._flushed?this._beforeError(new np(s,this)):this.flush=async()=>{this.flush=async()=>{},this._beforeError(new np(s,this))}}),this.options.signal){let s=()=>{this.destroy(new GR(this))};this.options.signal.aborted?s():(this.options.signal.addEventListener("abort",s),this._removeListeners=()=>{this.options.signal.removeEventListener("abort",s)})}}async flush(){if(!this._flushed){this._flushed=!0;try{if(await this._finalizeBody(),this.destroyed)return;if(await this._makeRequest(),this.destroyed){this._request?.destroy();return}for(let e of this._jobs)e();this._jobs.length=0,this._requestInitialized=!0}catch(e){this._beforeError(e)}}}_beforeError(e){if(this._stopReading)return;let{response:r,options:n}=this,i=this.retryCount+(e.name==="RetryError"?0:1);this._stopReading=!0,e instanceof Ke||(e=new Ke(e.message,e,this));let s=e;(async()=>{if(r?.readable&&!r.rawBody&&!this._request?.socket?.destroyed&&(r.setEncoding(this.readableEncoding),await this._setRawBody(r)&&(r.body=r.rawBody.toString())),this.listenerCount("retry")!==0){let u;try{let l;r&&"retry-after"in r.headers&&(l=Number(r.headers["retry-after"]),Number.isNaN(l)?(l=Date.parse(r.headers["retry-after"])-Date.now(),l<=0&&(l=1)):l*=1e3);let c=n.retry;u=await c.calculateDelay({attemptCount:i,retryOptions:c,error:s,retryAfter:l,computedValue:MO({attemptCount:i,retryOptions:c,error:s,retryAfter:l,computedValue:c.maxRetryAfter??n.timeout.request??Number.POSITIVE_INFINITY})})}catch(l){this._error(new Ke(l.message,l,this));return}if(u){if(await new Promise(l=>{let c=setTimeout(l,u);this._stopRetry=()=>{clearTimeout(c),l()}}),this.destroyed)return;try{for(let l of this.options.hooks.beforeRetry)await l(s,this.retryCount+1)}catch(l){this._error(new Ke(l.message,e,this));return}if(this.destroyed)return;this.destroy(),this.emit("retry",this.retryCount+1,e,l=>{let c=new Kl(n.url,l,n);return c.retryCount=this.retryCount+1,qm.default.nextTick(()=>{c.flush()}),c});return}}this._error(s)})()}_read(){this._triggerRead=!0;let{response:e}=this;if(e&&!this._stopReading){e.readableLength&&(this._triggerRead=!1);let r;for(;(r=e.read())!==null;){this._downloadedSize+=r.length;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this._requestInitialized?i():this._jobs.push(i)}_final(e){let r=()=>{if(!this._request||this._request.destroyed){e();return}this._request.end(n=>{this._request._writableState?.errored||(n||(this._bodySize=this._uploadedSize,this.emit("uploadProgress",this.uploadProgress),this._request.emit("upload-complete")),e(n))})};this._requestInitialized?r():this._jobs.push(r)}_destroy(e,r){if(this._stopReading=!0,this.flush=async()=>{},this._stopRetry(),this._cancelTimeouts(),this._removeListeners(),this.options){let{body:n}=this.options;$.nodeStream(n)&&n.destroy()}this._request&&this._request.destroy(),e!==null&&!$.undefined(e)&&!(e instanceof Ke)&&(e=new Ke(e.message,e,this)),r(e)}pipe(e,r){return e instanceof el.ServerResponse&&this._pipedServerResponses.add(e),super.pipe(e,r)}unpipe(e){return e instanceof el.ServerResponse&&this._pipedServerResponses.delete(e),super.unpipe(e),this}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!$.undefined(e.form),i=!$.undefined(e.json),s=!$.undefined(e.body),u=cx.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=u,n||i||s){if(u)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);let l=!$.string(r["content-type"]);if(s){if(Gl(e.body)){let h=new xO(e.body);l&&(r["content-type"]=h.headers["Content-Type"]),"Content-Length"in h.headers&&(r["content-length"]=h.headers["Content-Length"]),e.body=h.encode()}Lm(e.body)&&l&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`)}else if(n){l&&(r["content-type"]="application/x-www-form-urlencoded");let{form:h}=e;e.form=void 0,e.body=new ip.URLSearchParams(h).toString()}else{l&&(r["content-type"]="application/json");let{json:h}=e;e.json=void 0,e.body=e.stringifyJson(h)}let c=await PO(e.body,e.headers);$.undefined(r["content-length"])&&$.undefined(r["transfer-encoding"])&&!u&&!$.undefined(c)&&(r["content-length"]=String(c))}e.responseType==="json"&&!("accept"in e.headers)&&(e.headers.accept="application/json"),this._bodySize=Number(r["content-length"])||void 0}async _onResponseBase(e){if(this.isAborted)return;let{options:r}=this,{url:n}=r;this._nativeResponse=e,r.decompress&&(e=(0,vO.default)(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:el.default.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirectUrls,s.request=this,s.isFromCache=this._nativeResponse.fromCache??!1,s.ip=this.ip,s.retryCount=this.retryCount,s.ok=$s(s),this._isFromCache=s.isFromCache,this._responseSize=Number(e.headers["content-length"])||void 0,this.response=s,e.once("end",()=>{this._responseSize=this._downloadedSize,this.emit("downloadProgress",this.downloadProgress)}),e.once("error",l=>{this._aborted=!0,e.destroy(),this._beforeError(new op(l,this))}),e.once("aborted",()=>{this._aborted=!0,this._beforeError(new op({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let u=e.headers["set-cookie"];if($.object(r.cookieJar)&&u){let l=u.map(async c=>r.cookieJar.setCookie(c,n.toString()));r.ignoreInvalidCookies&&(l=l.map(async c=>{try{await c}catch{}}));try{await Promise.all(l)}catch(c){this._beforeError(c);return}}if(!this.isAborted){if(r.followRedirect&&e.headers.location&&hx.has(i)){if(e.resume(),this._cancelTimeouts(),this._unproxyEvents(),this.redirectUrls.length>=r.maxRedirects){this._beforeError(new UR(this));return}this._request=void 0;let l=new Sr(void 0,void 0,this.options),c=i===303&&l.method!=="GET"&&l.method!=="HEAD",h=i!==307&&i!==308,p=l.methodRewriting&&h;(c||p)&&(l.method="GET",l.body=void 0,l.json=void 0,l.form=void 0,delete l.headers["content-length"]);try{let y=Zu.Buffer.from(e.headers.location,"binary").toString(),d=new ip.URL(y,n);if(!Tp(n)&&Tp(d)){this._beforeError(new Ke("Cannot redirect to UNIX socket",{},this));return}d.hostname!==n.hostname||d.port!==n.port?("host"in l.headers&&delete l.headers.host,"cookie"in l.headers&&delete l.headers.cookie,"authorization"in l.headers&&delete l.headers.authorization,(l.username||l.password)&&(l.username="",l.password="")):(d.username=l.username,d.password=l.password),this.redirectUrls.push(d),l.prefixUrl="",l.url=d;for(let m of l.hooks.beforeRedirect)await m(l,s);this.emit("redirect",l,s),this.options=l,await this._makeRequest()}catch(y){this._beforeError(y);return}return}if(r.isStream&&r.throwHttpErrors&&!$s(s)){this._beforeError(new qs(s));return}if(e.on("readable",()=>{this._triggerRead&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this._noPipe){await this._setRawBody()&&this.emit("response",e);return}this.emit("response",e);for(let l of this._pipedServerResponses)if(!l.headersSent){for(let c in e.headers){let h=r.decompress?c!=="content-encoding":!0,p=e.headers[c];h&&l.setHeader(c,p)}l.statusCode=i}}}async _setRawBody(e=this){if(e.readableEnded)return!1;try{let r=await(0,bO.buffer)(e);if(!this.isAborted)return this.response.rawBody=r,!0}catch{}return!1}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;ZR(e),this.options.http2&&e.setTimeout(0),this._cancelTimeouts=qO(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{this._aborted=!0,e.destroy(),u=u instanceof Mm?new WR(u,this.timings,this):new Ke(u.message,u,this),this._beforeError(u)}),this._unproxyEvents=Nm(e,this,fx),this._request=e,this.emit("uploadProgress",this.uploadProgress),this._sendBody(),this.emit("request",e)}async _asyncWrite(e){return new Promise((r,n)=>{super.write(e,i=>{if(i){n(i);return}r()})})}_sendBody(){let{body:e}=this.options,r=this.redirectUrls.length===0?this:this._request??this;$.nodeStream(e)?e.pipe(r):$.generator(e)||$.asyncGenerator(e)?(async()=>{try{for await(let n of e)await this._asyncWrite(n);super.end()}catch(n){this._beforeError(n)}})():$.undefined(e)?(this._cannotHaveBody||this._noPipe)&&r.end():(this._writeRequest(e,void 0,()=>{}),r.end())}_prepareCache(e){if(!ll.has(e)){let r=new gO((n,i)=>{let s=n._request(n,i);return $.promise(s)&&(s.once=(u,l)=>{if(u==="error")(async()=>{try{await s}catch(c){l(c)}})();else if(u==="abort")(async()=>{try{(await s).once("abort",l)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${u}`);return s}),s},e);ll.set(e,r.request())}}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,$O(e));let s,u=ll.get(r.cache)(r,async l=>{if(l._readableState.autoDestroy=!1,s){let c=()=>{l.req&&(l.complete=l.req.res.complete)};l.prependOnceListener("end",c),c(),(await s).emit("cacheableResponse",l)}n(l)});u.once("error",i),u.once("request",async l=>{s=l,n(s)})})}async _makeRequest(){let{options:e}=this,{headers:r,username:n,password:i}=e,s=e.cookieJar;for(let h in r)if($.undefined(r[h]))delete r[h];else if($.null_(r[h]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${h}\` header`);if(e.decompress&&$.undefined(r["accept-encoding"])&&(r["accept-encoding"]=lx?"gzip, deflate, br":"gzip, deflate"),n||i){let h=Zu.Buffer.from(`${n}:${i}`).toString("base64");r.authorization=`Basic ${h}`}if(s){let h=await s.getCookieString(e.url.toString());$.nonEmptyString(h)&&(r.cookie=h)}e.prefixUrl="";let u;for(let h of e.hooks.beforeRequest){let p=await h(e);if(!$.undefined(p)){u=()=>p;break}}u||(u=e.getRequestFunction());let l=e.url;this._requestOptions=e.createNativeRequestOptions(),e.cache&&(this._requestOptions._request=u,this._requestOptions.cache=e.cache,this._requestOptions.body=e.body,this._prepareCache(e.cache));let c=e.cache?this._createCacheableRequest:u;try{let h=c(l,this._requestOptions);$.promise(h)&&(h=await h),$.undefined(h)&&(h=e.getFallbackRequestFunction()(l,this._requestOptions),$.promise(h)&&(h=await h)),ux(h)?this._onRequest(h):this.writable?(this.once("finish",()=>{this._onResponse(h)}),this._sendBody()):this._onResponse(h)}catch(h){throw h instanceof Uo?new HR(h,this):h}}async _error(e){try{if(!(e instanceof qs&&!this.options.throwHttpErrors))for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ke(r.message,r,this)}this.destroy(e)}_writeRequest(e,r,n){!this._request||this._request.destroyed||this._request.write(e,r,i=>{if(!i&&!this._request.destroyed){this._uploadedSize+=Zu.Buffer.byteLength(e,r);let s=this.uploadProgress;s.percent<1&&this.emit("uploadProgress",s)}n(i)})}get ip(){return this.socket?.remoteAddress}get isAborted(){return this._aborted}get socket(){return this._request?.socket??void 0}get downloadProgress(){let e;return this._responseSize?e=this._downloadedSize/this._responseSize:this._responseSize===this._downloadedSize?e=1:e=0,{percent:e,transferred:this._downloadedSize,total:this._responseSize}}get uploadProgress(){let e;return this._bodySize?e=this._uploadedSize/this._bodySize:this._bodySize===this._uploadedSize?e=1:e=0,{percent:e,transferred:this._uploadedSize,total:this._bodySize}}get timings(){return this._request?.timings}get isFromCache(){return this._isFromCache}get reusedSocket(){return this._request?.reusedSocket}},dx=class extends Ke{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}},px=["request","response","redirect","uploadProgress","downloadProgress"];function Rp(e){let r,n,i,s=new DR.EventEmitter,u=new Vl((c,h,p)=>{p(()=>{r.destroy()}),p.shouldReject=!1,p(()=>{h(new dx(r))});let y=d=>{p(()=>{});let m=e??new Kl(void 0,void 0,i);m.retryCount=d,m._noPipe=!0,r=m,m.once("response",async P=>{let R=(P.headers["content-encoding"]??"").toLowerCase(),V=R==="gzip"||R==="deflate"||R==="br",{options:z}=m;if(V&&!z.decompress)P.body=P.rawBody;else try{P.body=Sp(P,z.responseType,z.parseJson,z.encoding)}catch(S){if(P.body=P.rawBody.toString(),$s(P)){m._beforeError(S);return}}try{let S=z.hooks.afterResponse;for(let[B,v]of S.entries())if(P=await v(P,async q=>{throw z.merge(q),z.prefixUrl="",q.url&&(z.url=q.url),z.hooks.afterResponse=z.hooks.afterResponse.slice(0,B),new VR(m)}),!($.object(P)&&$.number(P.statusCode)&&!$.nullOrUndefined(P.body)))throw new TypeError("The `afterResponse` hook returned an invalid value")}catch(S){m._beforeError(S);return}if(n=P,!$s(P)){m._beforeError(new qs(P));return}m.destroy(),c(m.options.resolveBodyOnly?P.body:P)});let _=P=>{if(u.isCanceled)return;let{options:R}=m;if(P instanceof qs&&!R.throwHttpErrors){let{response:V}=P;m.destroy(),c(m.options.resolveBodyOnly?V.body:V);return}h(P)};m.once("error",_);let A=m.options?.body;m.once("retry",(P,R)=>{e=void 0;let V=m.options.body;if(A===V&&$.nodeStream(V)){R.message="Cannot retry with consumed body stream",_(R);return}i=m.options,y(P)}),Nm(m,s,px),$.undefined(e)&&m.flush()};y(0)});u.on=(c,h)=>(s.on(c,h),u),u.off=(c,h)=>(s.off(c,h),u);let l=c=>{let h=(async()=>{await u;let{options:p}=n.request;return Sp(n,c,p.parseJson,p.encoding)})();return Object.defineProperties(h,Object.getOwnPropertyDescriptors(u)),h};return u.json=()=>{if(r.options){let{headers:c}=r.options;!r.writableFinished&&!("accept"in c)&&(c.accept="application/json")}return l("json")},u.buffer=()=>l("buffer"),u.text=()=>l("text"),u}var mx=async e=>new Promise(r=>{setTimeout(r,e)}),yx=e=>$.function_(e),gx=["get","post","put","patch","head","delete"],Bm=e=>{e={options:new Sr(void 0,void 0,e.options),handlers:[...e.handlers],mutableDefaults:e.mutableDefaults},Object.defineProperty(e,"mutableDefaults",{enumerable:!0,configurable:!1,writable:!1});let r=(i,s,u=e.options)=>{let l=new Kl(i,s,u),c,h=d=>(l.options=d,l._noPipe=!d.isStream,l.flush(),d.isStream?l:(c||(c=Rp(l)),c)),p=0,y=d=>{let m=(e.handlers[p++]??h)(d,y);if($.promise(m)&&!l.options.isStream&&(c||(c=Rp(l)),m!==c)){let _=Object.getOwnPropertyDescriptors(c);for(let A in _)A in m&&delete _[A];Object.defineProperties(m,_),m.cancel=c.cancel}return m};return y(l.options)};r.extend=(...i)=>{let s=new Sr(void 0,void 0,e.options),u=[...e.handlers],l;for(let c of i)yx(c)?(s.merge(c.defaults.options),u.push(...c.defaults.handlers),l=c.defaults.mutableDefaults):(s.merge(c),c.handlers&&u.push(...c.handlers),l=c.mutableDefaults);return Bm({options:s,handlers:u,mutableDefaults:Boolean(l)})};let n=async function*(i,s){let u=new Sr(i,s,e.options);u.resolveBodyOnly=!1;let{pagination:l}=u;Z.function_(l.transform),Z.function_(l.shouldContinue),Z.function_(l.filter),Z.function_(l.paginate),Z.number(l.countLimit),Z.number(l.requestLimit),Z.number(l.backoff);let c=[],{countLimit:h}=l,p=0;for(;p{let u=[];for await(let l of n(i,s))u.push(l);return u},r.paginate.each=n,r.stream=(i,s)=>r(i,{...s,isStream:!0});for(let i of gx)r[i]=(s,u)=>r(s,{...u,method:i}),r.stream[i]=(s,u)=>r(s,{...u,method:i,isStream:!0});return e.mutableDefaults||(Object.freeze(e.handlers),e.options.freeze()),Object.defineProperty(r,"defaults",{value:e,writable:!1,configurable:!1,enumerable:!0}),r},vx=Bm,bx={options:new Sr,handlers:[],mutableDefaults:!1},_x=vx(bx),Mt=_x,xs="https://www.googleapis.com",wx=`${xs}/oauth2/v4/token`,Jl={extId:"No extension ID provided, e.g. https://chrome.google.com/webstore/detail/EXT_ID",clientId:"No client ID provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",clientSecret:"No client secret provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md",refreshToken:"No refresh token provided. To get one: https://github.com/PlasmoHQ/chrome-webstore-api/blob/main/token.md"},Ex=Object.keys(Jl),Sx=class{options={};constructor(e){for(let r of Ex){if(!e[r])throw new Error(Jl[r]);this.options[r]=e[r]}}get uploadEndpoint(){return`${xs}/upload/chromewebstore/v1.1/items/${this.options.extId}`}getPublishEndpoint(e){return`${xs}/chromewebstore/v1.1/items/${this.options.extId}/publish?publishTarget=${e}`}getInfoEndpoint(e){return`${xs}/chromewebstore/v1.1/items/${this.options.extId}?projection=${e}`}async submit({filePath:e="",target:r="default"}){let n=await this.getAccessToken(),{uploadState:i,itemError:s}=await this.upload({readStream:(0,xR.createReadStream)(e)},n);if(i==="FAILURE"||i==="NOT_FOUND")throw new Error(s.map(({error_detail:u})=>u).join(` +`));return this.publish({target:r},n)}async upload({readStream:e=null},r=""){if(!e)throw new Error("Read stream missing");let n=r||await this.getAccessToken();return Mt.put(this.uploadEndpoint,{headers:this.getHeaders(n),body:e,throwHttpErrors:!1}).json()}async publish({target:e="default"},r=""){let n=r||await this.getAccessToken();return Mt.post(this.getPublishEndpoint(e),{headers:this.getHeaders(n)}).json()}async get({projection:e="DRAFT"},r=""){let n=r||await this.getAccessToken();return Mt.get(this.getInfoEndpoint(e),{headers:this.getHeaders(n)}).json()}async getAccessToken(){return(await Mt.post(wx,{json:{client_id:this.options.clientId,refresh_token:this.options.refreshToken,grant_type:"refresh_token",client_secret:this.options.clientSecret}}).json()).access_token}getHeaders(e){return{Authorization:`Bearer ${e}`,"x-goog-api-version":"2"}}},Tx=require("module"),Rx=(0,Tx.createRequire)("/"),Ox;try{Ox=Rx("worker_threads").Worker}catch{}var Rt=Uint8Array,_n=Uint16Array,Dm=Uint32Array,zm=new Rt([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,0,0,0]),Fm=new Rt([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,0,0]),xx=new Rt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Um=function(e,r){for(var n=new _n(31),i=0;i<31;++i)n[i]=r+=1<>>1|(Re&21845)<<1,wr=(wr&52428)>>>2|(wr&13107)<<2,wr=(wr&61680)>>>4|(wr&3855)<<4,El[Re]=((wr&65280)>>>8|(wr&255)<<8)>>>1;var wr,Re,Vo=function(e,r,n){for(var i=e.length,s=0,u=new _n(r);s>>h]=p}else for(c=new _n(i),s=0;s>>15-e[s]);return c},ni=new Rt(288);for(Re=0;Re<144;++Re)ni[Re]=8;var Re;for(Re=144;Re<256;++Re)ni[Re]=9;var Re;for(Re=256;Re<280;++Re)ni[Re]=7;var Re;for(Re=280;Re<288;++Re)ni[Re]=8;var Re,Gm=new Rt(32);for(Re=0;Re<32;++Re)Gm[Re]=5;var Re,Px=Vo(ni,9,1),Cx=Vo(Gm,5,1),cl=function(e){for(var r=e[0],n=1;nr&&(r=e[n]);return r},Kt=function(e,r,n){var i=r/8|0;return(e[i]|e[i+1]<<8)>>(r&7)&n},hl=function(e,r){var n=r/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(r&7)},Ix=function(e){return(e+7)/8|0},Yl=function(e,r,n){(r==null||r<0)&&(r=0),(n==null||n>e.length)&&(n=e.length);var i=new(e.BYTES_PER_ELEMENT==2?_n:e.BYTES_PER_ELEMENT==4?Dm:Rt)(n-r);return i.set(e.subarray(r,n)),i},jx=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Jt=function(e,r,n){var i=new Error(r||jx[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,Jt),!n)throw i;return i},qx=function(e,r,n){var i=e.length;if(!i||n&&n.f&&!n.l)return r||new Rt(0);var s=!r||n,u=!n||n.i;n||(n={}),r||(r=new Rt(i*3));var l=function(Ot){var lr=r.length;if(Ot>lr){var xr=new Rt(Math.max(lr*2,Ot));xr.set(r),r=xr}},c=n.f||0,h=n.p||0,p=n.b||0,y=n.l,d=n.d,m=n.m,_=n.n,A=i*8;do{if(!y){c=Kt(e,h,1);var P=Kt(e,h+1,3);if(h+=3,P)if(P==1)y=Px,d=Cx,m=9,_=5;else if(P==2){var R=Kt(e,h,31)+257,V=Kt(e,h+10,15)+4,z=R+Kt(e,h+5,31)+1;h+=14;for(var S=new Rt(z),B=new Rt(19),v=0;v>>4;if(H<16)S[v++]=H;else{var Y=0,ne=0;for(H==16?(ne=3+Kt(e,h,3),h+=2,Y=S[v-1]):H==17?(ne=3+Kt(e,h,7),h+=3):H==18&&(ne=11+Kt(e,h,127),h+=7);ne--;)S[v++]=Y}}var T=S.subarray(0,R),E=S.subarray(R);m=cl(T),_=cl(E),y=Vo(T,m,1),d=Vo(E,_,1)}else Jt(1);else{var H=Ix(h)+4,N=e[H-4]|e[H-3]<<8,F=H+N;if(F>i){u&&Jt(0);break}s&&l(p+N),r.set(e.subarray(H,F),p),n.b=p+=N,n.p=h=F*8,n.f=c;continue}if(h>A){u&&Jt(0);break}}s&&l(p+131072);for(var j=(1<>>4;if(h+=Y&15,h>A){u&&Jt(0);break}if(Y||Jt(2),se<256)r[p++]=se;else if(se==256){ee=h,y=null;break}else{var te=se-254;if(se>264){var v=se-257,ie=zm[v];te=Kt(e,h,(1<>>4;Ae||Jt(3),h+=Ae&15;var E=kx[Fe];if(Fe>3){var ie=Fm[Fe];E+=hl(e,h)&(1<A){u&&Jt(0);break}s&&l(p+131072);for(var Ue=p+te;p>>0},fl=function(e,r){return Yt(e,r)+Yt(e,r+4)*4294967296};function Lx(e,r){return qx(e,r)}var Sl=typeof TextDecoder<"u"&&new TextDecoder,Nx=0;try{Sl.decode($x,{stream:!0}),Nx=1}catch{}var Mx=function(e){for(var r="",n=0;;){var i=e[n++],s=(i>127)+(i>223)+(i>239);if(n+s>e.length)return[r,Yl(e,n-1)];s?s==3?(i=((i&15)<<18|(e[n++]&63)<<12|(e[n++]&63)<<6|e[n++]&63)-65536,r+=String.fromCharCode(55296|i>>10,56320|i&1023)):s&1?r+=String.fromCharCode((i&31)<<6|e[n++]&63):r+=String.fromCharCode((i&15)<<12|(e[n++]&63)<<6|e[n++]&63):r+=String.fromCharCode(i)}};function Km(e,r){if(r){for(var n="",i=0;i65558)&&Jt(13);var s=ar(e,i+8);if(!s)return{};var u=Yt(e,i+16),l=u==4294967295||s==65535;if(l){var c=Yt(e,i-12);l=Yt(e,c)==101075792,l&&(s=Yt(e,c+32),u=Yt(e,c+48))}for(var h=r&&r.filter,p=0;p(0,Ux.resolve)((0,Hx.cwd)(),e),Jm=e=>(0,Ql.existsSync)(Xl(e));function ea({zip:e="",file:r="",versionFile:n="package.json"}){let i=e||r;if(Jm(n)&&i.includes("{version}")){let s=JSON.parse((0,Ql.readFileSync)(n).toString());return i.replace("{version}",s.version||"")}else return i}function ta(e){let r=(0,Ql.readFileSync)(Xl(e)),n=Fx(r),i=Km(n["manifest.json"]);return JSON.parse(i)}function Zl({extId:e=null,market:r="",zip:n=""}){let{name:i,version:s}=ta(n),u=Pm[r]||r;console.log(`Successfully updated "${e}" (${i}) to version ${s} on ${u}!`)}var ps={};function Ym({message:e="Message",prefix:r="",market:n=""}){var i;ps[n]=1+((i=ps?.[n])!=null?i:0);let s=`${n}: Step ${ps[n]}) ${e}`;return r!=="Error"&&(r=r||"Info",s=`${r} ${s}`),r==="Info"?s=s.trim():r==="Error"&&(s=s.trimStart()),s}var Qm={},ra=e=>{Qm[e]=!0,process.env.VERBOSE="true"};function ec(e=""){return r=>Qm[e]&&console.log(Ym({market:e,message:r}))}var tc=(e,r,n)=>{let i=new Error(Ym({market:r,message:`Item "${n}": ${e.message}`,prefix:"Error"}));return i.stack=e.stack,i};function dl(e,r){return`${e}: ${r}`}var na=({market:e="chrome",options:r={},errorMap:n={}})=>{if(Object.keys(n).some(s=>{if(!r[s])throw new Error(dl(e,n[s]))}),!r.zip&&!r.file)throw new Error(dl(e,"No extension bundle provided"));let i=r.zip||r.file;if(!Jm(i))throw new Error(dl(e,`Extension bundle file doesn't exist: ${Xl(i)}`))},Jo="chrome",Wx=ec(Jo);function Vx(e){return Tn(this,null,function*(){var r=e,{extId:n,target:i="default",zip:s,dryRun:u}=r,l=Ll(r,["extId","target","zip","dryRun"]);let c=new Sx($l({extId:n},l));if(Wx(`Updating extension with ID ${n}`),u)return!0;try{return yield c.submit({filePath:s,target:i}),Zl({extId:n,market:Jo,zip:s}),!0}catch(h){let p=ta(s);throw tc(h,Jo,`"${n}" (${p.name})`)}})}function Gx(e){return Tn(this,null,function*(){return e.zip=ea(e),e.verbose&&ra(Jo),na({market:Jo,options:e,errorMap:Jl}),Vx(e)})}var Kx=require("fs"),rc={productId:"Product ID is required. To get one, go to: https://partner.microsoft.com/en-us/dashboard/microsoftedge/{product-id}/package/dashboard",clientId:"Client ID is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",clientSecret:"Client Secret is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi",accessTokenUrl:"Access token URL is required. To get one: https://partner.microsoft.com/en-us/dashboard/microsoftedge/publishapi"},Jx=Object.keys(rc),Yx=e=>new Promise(r=>setTimeout(r,e)),Op="https://api.addons.microsoftedge.microsoft.com",Qx=class{options={};constructor(e){for(let r of Jx){if(!e[r])throw new Error(rc[r]);this.options[r]=e[r]}}get productEndpoint(){return`${Op}/v1/products/${this.options.productId}`}get publishEndpoint(){return`${this.productEndpoint}/submissions`}get uploadEndpoint(){return`${this.publishEndpoint}/draft/package`}async submit({filePath:e="",notes:r=""}){let n=await this.getAccessToken(),i=await this.upload((0,Kx.createReadStream)(e),n);return await this.waitForUpload(i,n),this.publish(r,n)}async publish(e="",r=null){let n={headers:{Authorization:`Bearer ${r||await this.getAccessToken()}`,"Content-Type":"application/x-www-form-urlencoded"}};e.length>0&&(n.body=`{ "notes"="${e}" }`);let i=await Mt.post(this.publishEndpoint,n);return this.handleTempStatus(i.statusCode,"Submit"),i.headers.location}async upload(e=null,r=null){let n=r||await this.getAccessToken(),i=await Mt.post(this.uploadEndpoint,{body:e,headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/zip"}});return this.handleTempStatus(i.statusCode,"Upload"),i.headers.location}async getPublishStatus(e,r=null){let n=r||await this.getAccessToken(),i=`${this.publishEndpoint}/operations/${e}`;return Mt.get(i,{headers:{Authorization:`Bearer ${n}`}}).json()}async waitForUpload(e,r=null,n=5,i=3e3){let s=r||await this.getAccessToken(),u=`${this.uploadEndpoint}/operations/${e}`,l,c,h=0;for(;c!=="Succeeded"&&h{if(e!==202)throw e>=500?new Error("Edge server error, please try again later"):new Error(`${r} failed, double check your api credentials`)};getAccessToken=async()=>(await Mt.post(`${this.options.accessTokenUrl}`,{body:`client_id=${this.options.clientId}&scope=${Op}/.default&client_secret=${this.options.clientSecret}&grant_type=client_credentials`,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).json()).access_token},Yo="edge",Xx=ec(Yo);function Zx(e){return Tn(this,null,function*(){var r=e,{productId:n,notes:i,zip:s,dryRun:u}=r,l=Ll(r,["productId","notes","zip","dryRun"]);let c=ta(s),h=new Qx($l({productId:n},l));if(Xx(`Updating extension with Product ID ${n}`),u)return!0;try{return yield h.submit({filePath:s,notes:i}),Zl({extId:n,market:Yo,zip:s}),!0}catch(p){throw tc(p,Yo,`"${n}" (${c.name})`)}})}function eA(e){return Tn(this,null,function*(){return e.zip=ea(e),e.verbose&&ra(Yo),na({market:Yo,options:e,errorMap:rc}),Zx(e)})}var Qe=e=>typeof e=="function",Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:e=>`Symbol(${e})`;function Xm(){}function ot(e){return typeof e=="object"&&e!==null||typeof e=="function"}var Zm=Xm;function Se(e,r){try{Object.defineProperty(e,"name",{value:r,configurable:!0})}catch{}}var nc=Promise,tA=Promise.prototype.then,rA=Promise.resolve.bind(nc),nA=Promise.reject.bind(nc);function ct(e){return new nc(e)}function Oe(e){return rA(e)}function de(e){return nA(e)}function Tr(e,r,n){return tA.call(e,r,n)}function nt(e,r,n){Tr(Tr(e,r,n),void 0,Zm)}function xp(e,r){nt(e,r)}function Ap(e,r){nt(e,void 0,r)}function Qt(e,r,n){return Tr(e,r,n)}function Zn(e){Tr(e,void 0,Zm)}var As=e=>{if(typeof queueMicrotask=="function")As=queueMicrotask;else{let r=Oe(void 0);As=n=>Tr(r,n)}return As(e)};function oa(e,r,n){if(typeof e!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(e,r,n)}function Rn(e,r,n){try{return Oe(oa(e,r,n))}catch(i){return de(i)}}var Bt=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let r=this._back,n=r;r._elements.length===16383&&(n={_elements:[],_next:void 0}),r._elements.push(e),n!==r&&(this._back=n,r._next=n),++this._size}shift(){let e=this._front,r=e,n=this._cursor,i=n+1,s=e._elements,u=s[n];return i===16384&&(r=e._next,i=0),--this._size,this._cursor=i,e!==r&&(this._front=r),s[n]=void 0,u}forEach(e){let r=this._cursor,n=this._front,i=n._elements;for(;!(r===i.length&&n._next===void 0||r===i.length&&(n=n._next,i=n._elements,r=0,i.length===0));)e(i[r]),++r}peek(){let e=this._front,r=this._cursor;return e._elements[r]}},ey=Ee("[[AbortSteps]]"),ty=Ee("[[ErrorSteps]]"),oc=Ee("[[CancelSteps]]"),ic=Ee("[[PullSteps]]"),sc=Ee("[[ReleaseSteps]]");function ry(e,r){e._ownerReadableStream=r,r._reader=e,r._state==="readable"?Tl(e):r._state==="closed"?function(n){Tl(n),sy(n)}(e):iy(e,r._storedError)}function ny(e,r){return Ny(e._ownerReadableStream,r)}function oy(e){let r=e._ownerReadableStream;r._state==="readable"?ac(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(n,i){iy(n,i)}(e,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),r._readableStreamController[sc](),r._reader=void 0,e._ownerReadableStream=void 0}function eo(e){return new TypeError("Cannot "+e+" a stream using a released reader")}function Tl(e){e._closedPromise=ct((r,n)=>{e._closedPromise_resolve=r,e._closedPromise_reject=n})}function iy(e,r){Tl(e),ac(e,r)}function ac(e,r){e._closedPromise_reject!==void 0&&(Zn(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function sy(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var kp=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},oA=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function Rr(e,r){if(e!==void 0&&typeof(n=e)!="object"&&typeof n!="function")throw new TypeError(`${r} is not an object.`);var n}function er(e,r){if(typeof e!="function")throw new TypeError(`${r} is not a function.`)}function ay(e,r){if(!function(n){return typeof n=="object"&&n!==null||typeof n=="function"}(e))throw new TypeError(`${r} is not an object.`)}function Or(e,r,n){if(e===void 0)throw new TypeError(`Parameter ${r} is required in '${n}'.`)}function Rl(e,r,n){if(e===void 0)throw new TypeError(`${r} is required in '${n}'.`)}function uc(e){return Number(e)}function Pp(e){return e===0?0:e}function uy(e,r){let n=Number.MAX_SAFE_INTEGER,i=Number(e);if(i=Pp(i),!kp(i))throw new TypeError(`${r} is not a finite number`);if(i=function(s){return Pp(oA(s))}(i),i<0||i>n)throw new TypeError(`${r} is outside the accepted range of 0 to ${n}, inclusive`);return kp(i)&&i!==0?i:0}function Ho(e){if(!ot(e)||typeof e.getReader!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function ly(e){if(!ot(e)||typeof e.getWriter!="function")return!1;try{return typeof e.locked=="boolean"}catch{return!1}}function cy(e,r){if(!En(e))throw new TypeError(`${r} is not a ReadableStream.`)}function hy(e,r){e._reader._readRequests.push(r)}function lc(e,r,n){let i=e._reader._readRequests.shift();n?i._closeSteps():i._chunkSteps(r)}function ia(e){return e._reader._readRequests.length}function fy(e){let r=e._reader;return r!==void 0&&!!wn(r)}var pn=class{constructor(e){if(Or(e,1,"ReadableStreamDefaultReader"),cy(e,"First parameter"),ro(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");ry(this,e),this._readRequests=new Bt}get closed(){return wn(this)?this._closedPromise:de(ms("closed"))}cancel(e){return wn(this)?this._ownerReadableStream===void 0?de(eo("cancel")):ny(this,e):de(ms("cancel"))}read(){if(!wn(this))return de(ms("read"));if(this._ownerReadableStream===void 0)return de(eo("read from"));let e,r,n=ct((i,s)=>{e=i,r=s});return function(i,s){let u=i._ownerReadableStream;u._disturbed=!0,u._state==="closed"?s._closeSteps():u._state==="errored"?s._errorSteps(u._storedError):u._readableStreamController[ic](s)}(this,{_chunkSteps:i=>e({value:i,done:!1}),_closeSteps:()=>e({value:void 0,done:!0}),_errorSteps:i=>r(i)}),n}releaseLock(){if(!wn(this))throw ms("releaseLock");this._ownerReadableStream!==void 0&&function(e){oy(e);let r=new TypeError("Reader was released");dy(e,r)}(this)}};function wn(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof pn}function dy(e,r){let n=e._readRequests;e._readRequests=new Bt,n.forEach(i=>{i._errorSteps(r)})}function ms(e){return new TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}Object.defineProperties(pn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Se(pn.prototype.cancel,"cancel"),Se(pn.prototype.read,"read"),Se(pn.prototype.releaseLock,"releaseLock"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(pn.prototype,Ee.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});var py=class{constructor(e,r){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=r}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?Qt(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let r=()=>this._returnSteps(e);return this._ongoingPromise?Qt(this._ongoingPromise,r,r):r()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader;return e===void 0?de(eo("iterate")):Tr(e.read(),r=>{var n;return this._ongoingPromise=void 0,r.done&&(this._isFinished=!0,(n=this._reader)===null||n===void 0||n.releaseLock(),this._reader=void 0),r},r=>{var n;throw this._ongoingPromise=void 0,this._isFinished=!0,(n=this._reader)===null||n===void 0||n.releaseLock(),this._reader=void 0,r})}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let r=this._reader;if(r===void 0)return de(eo("finish iterating"));if(this._reader=void 0,!this._preventCancel){let n=r.cancel(e);return r.releaseLock(),Qt(n,()=>({value:e,done:!0}))}return r.releaseLock(),Oe({value:e,done:!0})}},my={next(){return Cp(this)?this._asyncIteratorImpl.next():de(Ip("next"))},return(e){return Cp(this)?this._asyncIteratorImpl.return(e):de(Ip("return"))}};function Cp(e){if(!ot(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof py}catch{return!1}}function Ip(e){return new TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}typeof Ee.asyncIterator=="symbol"&&Object.defineProperty(my,Ee.asyncIterator,{value(){return this},writable:!0,configurable:!0});var yy=Number.isNaN||function(e){return e!=e};function gy(e,r,n,i,s){new Uint8Array(e).set(new Uint8Array(n,i,s),r)}function jp(e){let r=function(n,i,s){if(n.slice)return n.slice(i,s);let u=s-i,l=new ArrayBuffer(u);return gy(l,0,n,i,u),l}(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(r)}function Ol(e){let r=e._queue.shift();return e._queueTotalSize-=r.size,e._queueTotalSize<0&&(e._queueTotalSize=0),r.value}function cc(e,r,n){if(typeof(i=n)!="number"||yy(i)||i<0||n===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");var i;e._queue.push({value:r,size:n}),e._queueTotalSize+=n}function Gr(e){e._queue=new Bt,e._queueTotalSize=0}var Yn=class{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!pl(this))throw ml("view");return this._view}respond(e){if(!pl(this))throw ml("respond");if(Or(e,1,"respond"),e=uy(e,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");this._view.buffer,function(r,n){let i=r._pendingPullIntos.peek();if(r._controlledReadableByteStream._state==="closed"){if(n!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(n===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(i.bytesFilled+n>i.byteLength)throw new RangeError("bytesWritten out of range")}i.buffer=i.buffer,qp(r,n)}(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!pl(this))throw ml("respondWithNewView");if(Or(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");e.buffer,function(r,n){let i=r._pendingPullIntos.peek();if(r._controlledReadableByteStream._state==="closed"){if(n.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(n.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(i.byteOffset+i.bytesFilled!==n.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(i.bufferByteLength!==n.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(i.bytesFilled+n.byteLength>i.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let s=n.byteLength;i.buffer=n.buffer,qp(r,s)}(this._associatedReadableByteStreamController,e)}};Object.defineProperties(Yn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),Se(Yn.prototype.respond,"respond"),Se(Yn.prototype.respondWithNewView,"respondWithNewView"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(Yn.prototype,Ee.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var mn=class{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Kn(this))throw Do("byobRequest");return function(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let r=e._pendingPullIntos.peek(),n=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled),i=Object.create(Yn.prototype);(function(s,u,l){s._associatedReadableByteStreamController=u,s._view=l})(i,e,n),e._byobRequest=i}return e._byobRequest}(this)}get desiredSize(){if(!Kn(this))throw Do("desiredSize");return Ry(this)}close(){if(!Kn(this))throw Do("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let e=this._controlledReadableByteStream._state;if(e!=="readable")throw new TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);(function(r){let n=r._controlledReadableByteStream;if(!(r._closeRequested||n._state!=="readable")){if(r._queueTotalSize>0)return void(r._closeRequested=!0);if(r._pendingPullIntos.length>0&&r._pendingPullIntos.peek().bytesFilled>0){let i=new TypeError("Insufficient bytes to fill elements in the given buffer");throw to(r,i),i}Ls(r),Xo(n)}})(this)}enqueue(e){if(!Kn(this))throw Do("enqueue");if(Or(e,1,"enqueue"),!ArrayBuffer.isView(e))throw new TypeError("chunk must be an array buffer view");if(e.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(e.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");let r=this._controlledReadableByteStream._state;if(r!=="readable")throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`);(function(n,i){let s=n._controlledReadableByteStream;if(n._closeRequested||s._state!=="readable")return;let u=i.buffer,l=i.byteOffset,c=i.byteLength,h=u;if(n._pendingPullIntos.length>0){let p=n._pendingPullIntos.peek();p.buffer,hc(n),p.buffer=p.buffer,p.readerType==="none"&&wy(n,p)}fy(s)?(function(p){let y=p._controlledReadableByteStream._reader;for(;y._readRequests.length>0;){if(p._queueTotalSize===0)return;$p(p,y._readRequests.shift())}}(n),ia(s)===0?ks(n,h,l,c):(n._pendingPullIntos.length>0&&Xn(n),lc(s,new Uint8Array(h,l,c),!1))):fc(s)?(ks(n,h,l,c),Al(n)):ks(n,h,l,c),Sn(n)})(this,e)}error(e){if(!Kn(this))throw Do("error");to(this,e)}[oc](e){vy(this),Gr(this);let r=this._cancelAlgorithm(e);return Ls(this),r}[ic](e){let r=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void $p(this,e);let n=this._autoAllocateChunkSize;if(n!==void 0){let i;try{i=new ArrayBuffer(n)}catch(u){return void e._errorSteps(u)}let s={buffer:i,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(s)}hy(r,e),Sn(this)}[sc](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType="none",this._pendingPullIntos=new Bt,this._pendingPullIntos.push(e)}}};function Kn(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof mn}function pl(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof Yn}function Sn(e){if(function(r){let n=r._controlledReadableByteStream;return n._state!=="readable"||r._closeRequested||!r._started?!1:!!(fy(n)&&ia(n)>0||fc(n)&&Oy(n)>0||Ry(r)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,nt(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Sn(e)),null),r=>(to(e,r),null))}}function vy(e){hc(e),e._pendingPullIntos=new Bt}function xl(e,r){let n=!1;e._state==="closed"&&(n=!0);let i=by(r);r.readerType==="default"?lc(e,i,n):function(s,u,l){let c=s._reader._readIntoRequests.shift();l?c._closeSteps(u):c._chunkSteps(u)}(e,i,n)}function by(e){let r=e.bytesFilled,n=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,r/n)}function ks(e,r,n,i){e._queue.push({buffer:r,byteOffset:n,byteLength:i}),e._queueTotalSize+=i}function _y(e,r,n,i){let s;try{s=r.slice(n,n+i)}catch(u){throw to(e,u),u}ks(e,s,0,i)}function wy(e,r){r.bytesFilled>0&&_y(e,r.buffer,r.byteOffset,r.bytesFilled),Xn(e)}function Ey(e,r){let n=r.elementSize,i=r.bytesFilled-r.bytesFilled%n,s=Math.min(e._queueTotalSize,r.byteLength-r.bytesFilled),u=r.bytesFilled+s,l=u-u%n,c=s,h=!1;l>i&&(c=l-r.bytesFilled,h=!0);let p=e._queue;for(;c>0;){let y=p.peek(),d=Math.min(c,y.byteLength),m=r.byteOffset+r.bytesFilled;gy(r.buffer,m,y.buffer,y.byteOffset,d),y.byteLength===d?p.shift():(y.byteOffset+=d,y.byteLength-=d),e._queueTotalSize-=d,Sy(e,d,r),c-=d}return h}function Sy(e,r,n){n.bytesFilled+=r}function Ty(e){e._queueTotalSize===0&&e._closeRequested?(Ls(e),Xo(e._controlledReadableByteStream)):Sn(e)}function hc(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function Al(e){for(;e._pendingPullIntos.length>0;){if(e._queueTotalSize===0)return;let r=e._pendingPullIntos.peek();Ey(e,r)&&(Xn(e),xl(e._controlledReadableByteStream,r))}}function qp(e,r){let n=e._pendingPullIntos.peek();hc(e),e._controlledReadableByteStream._state==="closed"?function(i,s){s.readerType==="none"&&Xn(i);let u=i._controlledReadableByteStream;if(fc(u))for(;Oy(u)>0;)xl(u,Xn(i))}(e,n):function(i,s,u){if(Sy(0,s,u),u.readerType==="none")return wy(i,u),void Al(i);if(u.bytesFilled0){let c=u.byteOffset+u.bytesFilled;_y(i,u.buffer,c-l,l)}u.bytesFilled-=l,xl(i._controlledReadableByteStream,u),Al(i)}(e,r,n),Sn(e)}function Xn(e){return e._pendingPullIntos.shift()}function Ls(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function to(e,r){let n=e._controlledReadableByteStream;n._state==="readable"&&(vy(e),Gr(e),Ls(e),My(n,r))}function $p(e,r){let n=e._queue.shift();e._queueTotalSize-=n.byteLength,Ty(e);let i=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);r._chunkSteps(i)}function Ry(e){let r=e._controlledReadableByteStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function iA(e,r,n){let i=Object.create(mn.prototype),s,u,l;s=r.start!==void 0?()=>r.start(i):()=>{},u=r.pull!==void 0?()=>r.pull(i):()=>Oe(void 0),l=r.cancel!==void 0?h=>r.cancel(h):()=>Oe(void 0);let c=r.autoAllocateChunkSize;if(c===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");(function(h,p,y,d,m,_,A){p._controlledReadableByteStream=h,p._pullAgain=!1,p._pulling=!1,p._byobRequest=null,p._queue=p._queueTotalSize=void 0,Gr(p),p._closeRequested=!1,p._started=!1,p._strategyHWM=_,p._pullAlgorithm=d,p._cancelAlgorithm=m,p._autoAllocateChunkSize=A,p._pendingPullIntos=new Bt,h._readableStreamController=p,nt(Oe(y()),()=>(p._started=!0,Sn(p),null),P=>(to(p,P),null))})(e,i,s,u,l,n,c)}function ml(e){return new TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Do(e){return new TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function Lp(e,r){e._reader._readIntoRequests.push(r)}function Oy(e){return e._reader._readIntoRequests.length}function fc(e){let r=e._reader;return r!==void 0&&!!Qn(r)}Object.defineProperties(mn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),Se(mn.prototype.close,"close"),Se(mn.prototype.enqueue,"enqueue"),Se(mn.prototype.error,"error"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Ee.toStringTag,{value:"ReadableByteStreamController",configurable:!0});var yn=class{constructor(e){if(Or(e,1,"ReadableStreamBYOBReader"),cy(e,"First parameter"),ro(e))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Kn(e._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");ry(this,e),this._readIntoRequests=new Bt}get closed(){return Qn(this)?this._closedPromise:de(ys("closed"))}cancel(e){return Qn(this)?this._ownerReadableStream===void 0?de(eo("cancel")):ny(this,e):de(ys("cancel"))}read(e){if(!Qn(this))return de(ys("read"));if(!ArrayBuffer.isView(e))return de(new TypeError("view must be an array buffer view"));if(e.byteLength===0)return de(new TypeError("view must have non-zero byteLength"));if(e.buffer.byteLength===0)return de(new TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,this._ownerReadableStream===void 0)return de(eo("read from"));let r,n,i=ct((s,u)=>{r=s,n=u});return function(s,u,l){let c=s._ownerReadableStream;c._disturbed=!0,c._state==="errored"?l._errorSteps(c._storedError):function(h,p,y){let d=h._controlledReadableByteStream,m=1;p.constructor!==DataView&&(m=p.constructor.BYTES_PER_ELEMENT);let _=p.constructor,A=p.buffer,P={buffer:A,bufferByteLength:A.byteLength,byteOffset:p.byteOffset,byteLength:p.byteLength,bytesFilled:0,elementSize:m,viewConstructor:_,readerType:"byob"};if(h._pendingPullIntos.length>0)return h._pendingPullIntos.push(P),void Lp(d,y);if(d._state!=="closed"){if(h._queueTotalSize>0){if(Ey(h,P)){let R=by(P);return Ty(h),void y._chunkSteps(R)}if(h._closeRequested){let R=new TypeError("Insufficient bytes to fill elements in the given buffer");return to(h,R),void y._errorSteps(R)}}h._pendingPullIntos.push(P),Lp(d,y),Sn(h)}else{let R=new _(P.buffer,P.byteOffset,0);y._closeSteps(R)}}(c._readableStreamController,u,l)}(this,e,{_chunkSteps:s=>r({value:s,done:!1}),_closeSteps:s=>r({value:s,done:!0}),_errorSteps:s=>n(s)}),i}releaseLock(){if(!Qn(this))throw ys("releaseLock");this._ownerReadableStream!==void 0&&function(e){oy(e);let r=new TypeError("Reader was released");xy(e,r)}(this)}};function Qn(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof yn}function xy(e,r){let n=e._readIntoRequests;e._readIntoRequests=new Bt,n.forEach(i=>{i._errorSteps(r)})}function ys(e){return new TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Qo(e,r){let{highWaterMark:n}=e;if(n===void 0)return r;if(yy(n)||n<0)throw new RangeError("Invalid highWaterMark");return n}function Ns(e){let{size:r}=e;return r||(()=>1)}function Ms(e,r){Rr(e,r);let n=e?.highWaterMark,i=e?.size;return{highWaterMark:n===void 0?void 0:uc(n),size:i===void 0?void 0:sA(i,`${r} has member 'size' that`)}}function sA(e,r){return er(e,r),n=>uc(e(n))}function aA(e,r,n){return er(e,n),i=>Rn(e,r,[i])}function uA(e,r,n){return er(e,n),()=>Rn(e,r,[])}function lA(e,r,n){return er(e,n),i=>oa(e,r,[i])}function cA(e,r,n){return er(e,n),(i,s)=>Rn(e,r,[i,s])}Object.defineProperties(yn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),Se(yn.prototype.cancel,"cancel"),Se(yn.prototype.read,"read"),Se(yn.prototype.releaseLock,"releaseLock"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(yn.prototype,Ee.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var hA=typeof AbortController=="function",gn=class{constructor(e={},r={}){e===void 0?e=null:ay(e,"First parameter");let n=Ms(r,"Second parameter"),i=function(l,c){Rr(l,c);let h=l?.abort,p=l?.close,y=l?.start,d=l?.type,m=l?.write;return{abort:h===void 0?void 0:aA(h,l,`${c} has member 'abort' that`),close:p===void 0?void 0:uA(p,l,`${c} has member 'close' that`),start:y===void 0?void 0:lA(y,l,`${c} has member 'start' that`),write:m===void 0?void 0:cA(m,l,`${c} has member 'write' that`),type:d}}(e,"First parameter");var s;if((s=this)._state="writable",s._storedError=void 0,s._writer=void 0,s._writableStreamController=void 0,s._writeRequests=new Bt,s._inFlightWriteRequest=void 0,s._closeRequest=void 0,s._inFlightCloseRequest=void 0,s._pendingAbortRequest=void 0,s._backpressure=!1,i.type!==void 0)throw new RangeError("Invalid type is specified");let u=Ns(n);(function(l,c,h,p){let y=Object.create(Bs.prototype),d,m,_,A;d=c.start!==void 0?()=>c.start(y):()=>{},m=c.write!==void 0?P=>c.write(P,y):()=>Oe(void 0),_=c.close!==void 0?()=>c.close():()=>Oe(void 0),A=c.abort!==void 0?P=>c.abort(P):()=>Oe(void 0),function(P,R,V,z,S,B,v,q){R._controlledWritableStream=P,P._writableStreamController=R,R._queue=void 0,R._queueTotalSize=void 0,Gr(R),R._abortReason=void 0,R._abortController=function(){if(hA)return new AbortController}(),R._started=!1,R._strategySizeAlgorithm=q,R._strategyHWM=v,R._writeAlgorithm=z,R._closeAlgorithm=S,R._abortAlgorithm=B;let C=yc(R);mc(P,C);let k=V();nt(Oe(k),()=>(R._started=!0,sa(R),null),L=>(R._started=!0,kl(P,L),null))}(l,y,d,m,_,A,h,p)})(this,i,Qo(n,1),u)}get locked(){if(!ur(this))throw vs("locked");return Ps(this)}abort(e){return ur(this)?Ps(this)?de(new TypeError("Cannot abort a stream that already has a writer")):Ay(this,e):de(vs("abort"))}close(){return ur(this)?Ps(this)?de(new TypeError("Cannot close a stream that already has a writer")):Vr(this)?de(new TypeError("Cannot close an already-closing stream")):ky(this):de(vs("close"))}getWriter(){if(!ur(this))throw vs("getWriter");return new Wr(this)}};function ur(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof gn}function Ps(e){return e._writer!==void 0}function Ay(e,r){var n;if(e._state==="closed"||e._state==="errored")return Oe(void 0);e._writableStreamController._abortReason=r,(n=e._writableStreamController._abortController)===null||n===void 0||n.abort(r);let i=e._state;if(i==="closed"||i==="errored")return Oe(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let s=!1;i==="erroring"&&(s=!0,r=void 0);let u=ct((l,c)=>{e._pendingAbortRequest={_promise:void 0,_resolve:l,_reject:c,_reason:r,_wasAlreadyErroring:s}});return e._pendingAbortRequest._promise=u,s||dc(e,r),u}function ky(e){let r=e._state;if(r==="closed"||r==="errored")return de(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`));let n=ct((u,l)=>{let c={_resolve:u,_reject:l};e._closeRequest=c}),i=e._writer;var s;return i!==void 0&&e._backpressure&&r==="writable"&&vc(i),cc(s=e._writableStreamController,Cy,0),sa(s),n}function kl(e,r){e._state!=="writable"?pc(e):dc(e,r)}function dc(e,r){let n=e._writableStreamController;e._state="erroring",e._storedError=r;let i=e._writer;i!==void 0&&Py(i,r),!function(s){return!(s._inFlightWriteRequest===void 0&&s._inFlightCloseRequest===void 0)}(e)&&n._started&&pc(e)}function pc(e){e._state="errored",e._writableStreamController[ty]();let r=e._storedError;if(e._writeRequests.forEach(i=>{i._reject(r)}),e._writeRequests=new Bt,e._pendingAbortRequest===void 0)return void gs(e);let n=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,n._wasAlreadyErroring)return n._reject(r),void gs(e);nt(e._writableStreamController[ey](n._reason),()=>(n._resolve(),gs(e),null),i=>(n._reject(i),gs(e),null))}function Vr(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function gs(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let r=e._writer;r!==void 0&&gc(r,e._storedError)}function mc(e,r){let n=e._writer;n!==void 0&&r!==e._backpressure&&(r?function(i){aa(i)}(n):vc(n)),e._backpressure=r}Object.defineProperties(gn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),Se(gn.prototype.abort,"abort"),Se(gn.prototype.close,"close"),Se(gn.prototype.getWriter,"getWriter"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(gn.prototype,Ee.toStringTag,{value:"WritableStream",configurable:!0});var Wr=class{constructor(e){if(Or(e,1,"WritableStreamDefaultWriter"),function(i,s){if(!ur(i))throw new TypeError(`${s} is not a WritableStream.`)}(e,"First parameter"),Ps(e))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;let r=e._state;if(r==="writable")!Vr(e)&&e._backpressure?aa(this):Bp(this),Cs(this);else if(r==="erroring")Pl(this,e._storedError),Cs(this);else if(r==="closed")Bp(this),Cs(n=this),qy(n);else{let i=e._storedError;Pl(this,i),Mp(this,i)}var n}get closed(){return an(this)?this._closedPromise:de(un("closed"))}get desiredSize(){if(!an(this))throw un("desiredSize");if(this._ownerWritableStream===void 0)throw zo("desiredSize");return function(e){let r=e._ownerWritableStream,n=r._state;return n==="errored"||n==="erroring"?null:n==="closed"?0:Iy(r._writableStreamController)}(this)}get ready(){return an(this)?this._readyPromise:de(un("ready"))}abort(e){return an(this)?this._ownerWritableStream===void 0?de(zo("abort")):function(r,n){return Ay(r._ownerWritableStream,n)}(this,e):de(un("abort"))}close(){if(!an(this))return de(un("close"));let e=this._ownerWritableStream;return e===void 0?de(zo("close")):Vr(e)?de(new TypeError("Cannot close an already-closing stream")):ky(this._ownerWritableStream)}releaseLock(){if(!an(this))throw un("releaseLock");this._ownerWritableStream!==void 0&&function(e){let r=e._ownerWritableStream,n=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Py(e,n),function(i,s){i._closedPromiseState==="pending"?gc(i,s):function(u,l){Mp(u,l)}(i,s)}(e,n),r._writer=void 0,e._ownerWritableStream=void 0}(this)}write(e){return an(this)?this._ownerWritableStream===void 0?de(zo("write to")):function(r,n){let i=r._ownerWritableStream,s=i._writableStreamController,u=function(h,p){try{return h._strategySizeAlgorithm(p)}catch(y){return Np(h,y),1}}(s,n);if(i!==r._ownerWritableStream)return de(zo("write to"));let l=i._state;if(l==="errored")return de(i._storedError);if(Vr(i)||l==="closed")return de(new TypeError("The stream is closing or closed and cannot be written to"));if(l==="erroring")return de(i._storedError);let c=function(h){return ct((p,y)=>{let d={_resolve:p,_reject:y};h._writeRequests.push(d)})}(i);return function(h,p,y){try{cc(h,p,y)}catch(m){return void Np(h,m)}let d=h._controlledWritableStream;!Vr(d)&&d._state==="writable"&&mc(d,yc(h)),sa(h)}(s,n,u),c}(this,e):de(un("write"))}};function an(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof Wr}function Py(e,r){e._readyPromiseState==="pending"?$y(e,r):function(n,i){Pl(n,i)}(e,r)}Object.defineProperties(Wr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),Se(Wr.prototype.abort,"abort"),Se(Wr.prototype.close,"close"),Se(Wr.prototype.releaseLock,"releaseLock"),Se(Wr.prototype.write,"write"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(Wr.prototype,Ee.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var Cy={},Bs=class{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!yl(this))throw gl("abortReason");return this._abortReason}get signal(){if(!yl(this))throw gl("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(e){if(!yl(this))throw gl("error");this._controlledWritableStream._state==="writable"&&jy(this,e)}[ey](e){let r=this._abortAlgorithm(e);return Ds(this),r}[ty](){Gr(this)}};function yl(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof Bs}function Ds(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Iy(e){return e._strategyHWM-e._queueTotalSize}function sa(e){let r=e._controlledWritableStream;if(!e._started||r._inFlightWriteRequest!==void 0)return;if(r._state==="erroring")return void pc(r);if(e._queue.length===0)return;let n=e._queue.peek().value;n===Cy?function(i){let s=i._controlledWritableStream;(function(l){l._inFlightCloseRequest=l._closeRequest,l._closeRequest=void 0})(s),Ol(i);let u=i._closeAlgorithm();Ds(i),nt(u,()=>(function(l){l._inFlightCloseRequest._resolve(void 0),l._inFlightCloseRequest=void 0,l._state==="erroring"&&(l._storedError=void 0,l._pendingAbortRequest!==void 0&&(l._pendingAbortRequest._resolve(),l._pendingAbortRequest=void 0)),l._state="closed";let c=l._writer;c!==void 0&&qy(c)}(s),null),l=>(function(c,h){c._inFlightCloseRequest._reject(h),c._inFlightCloseRequest=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._reject(h),c._pendingAbortRequest=void 0),kl(c,h)}(s,l),null))}(e):function(i,s){let u=i._controlledWritableStream;(function(l){l._inFlightWriteRequest=l._writeRequests.shift()})(u),nt(i._writeAlgorithm(s),()=>{(function(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0})(u);let l=u._state;if(Ol(i),!Vr(u)&&l==="writable"){let c=yc(i);mc(u,c)}return sa(i),null},l=>(u._state==="writable"&&Ds(i),function(c,h){c._inFlightWriteRequest._reject(h),c._inFlightWriteRequest=void 0,kl(c,h)}(u,l),null))}(e,n)}function Np(e,r){e._controlledWritableStream._state==="writable"&&jy(e,r)}function yc(e){return Iy(e)<=0}function jy(e,r){let n=e._controlledWritableStream;Ds(e),dc(n,r)}function vs(e){return new TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function gl(e){return new TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function un(e){return new TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function zo(e){return new TypeError("Cannot "+e+" a stream using a released writer")}function Cs(e){e._closedPromise=ct((r,n)=>{e._closedPromise_resolve=r,e._closedPromise_reject=n,e._closedPromiseState="pending"})}function Mp(e,r){Cs(e),gc(e,r)}function gc(e,r){e._closedPromise_reject!==void 0&&(Zn(e._closedPromise),e._closedPromise_reject(r),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function qy(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function aa(e){e._readyPromise=ct((r,n)=>{e._readyPromise_resolve=r,e._readyPromise_reject=n}),e._readyPromiseState="pending"}function Pl(e,r){aa(e),$y(e,r)}function Bp(e){aa(e),vc(e)}function $y(e,r){e._readyPromise_reject!==void 0&&(Zn(e._readyPromise),e._readyPromise_reject(r),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function vc(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}Object.defineProperties(Bs.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(Bs.prototype,Ee.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});var Dp=typeof DOMException<"u"?DOMException:void 0,fA=function(e){if(typeof e!="function"&&typeof e!="object")return!1;try{return new e,!0}catch{return!1}}(Dp)?Dp:function(){let e=function(r,n){this.message=r||"",this.name=n||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function zp(e,r,n,i,s,u){let l=e.getReader(),c=r.getWriter();En(e)&&(e._disturbed=!0);let h,p,y,d=!1,m=!1,_="readable",A="writable",P=!1,R=!1,V=ct(S=>{y=S}),z=Promise.resolve(void 0);return ct((S,B)=>{let v;function q(){if(d)return;let T=ct((E,N)=>{(function F(j){j?E():Tr(function(){return d?Oe(!0):Tr(c.ready,()=>Tr(l.read(),W=>!!W.done||(z=c.write(W.value),Zn(z),!1)))}(),F,N)})(!1)});Zn(T)}function C(){return _="closed",n?Y():H(()=>(ur(r)&&(P=Vr(r),A=r._state),P||A==="closed"?Oe(void 0):A==="erroring"||A==="errored"?de(p):(P=!0,c.close())),!1,void 0),null}function k(T){return d||(_="errored",h=T,i?Y(!0,T):H(()=>c.abort(T),!0,T)),null}function L(T){return m||(A="errored",p=T,s?Y(!0,T):H(()=>l.cancel(T),!0,T)),null}if(u!==void 0&&(v=()=>{let T=u.reason!==void 0?u.reason:new fA("Aborted","AbortError"),E=[];i||E.push(()=>A==="writable"?c.abort(T):Oe(void 0)),s||E.push(()=>_==="readable"?l.cancel(T):Oe(void 0)),H(()=>Promise.all(E.map(N=>N())),!0,T)},u.aborted?v():u.addEventListener("abort",v)),En(e)&&(_=e._state,h=e._storedError),ur(r)&&(A=r._state,p=r._storedError,P=Vr(r)),En(e)&&ur(r)&&(R=!0,y()),_==="errored")k(h);else if(A==="erroring"||A==="errored")L(p);else if(_==="closed")C();else if(P||A==="closed"){let T=new TypeError("the destination writable stream closed before all data could be piped to it");s?Y(!0,T):H(()=>l.cancel(T),!0,T)}function H(T,E,N){function F(){return A!=="writable"||P?j():xp(function(){let W;return Oe(function ee(){if(W!==z)return W=z,Qt(z,ee,ee)}())}(),j),null}function j(){return T?nt(T(),()=>ne(E,N),W=>ne(!0,W)):ne(E,N),null}d||(d=!0,R?F():xp(V,F))}function Y(T,E){H(void 0,T,E)}function ne(T,E){return m=!0,c.releaseLock(),l.releaseLock(),u!==void 0&&u.removeEventListener("abort",v),T?B(E):S(void 0),null}d||(nt(l.closed,C,k),nt(c.closed,function(){return m||(A="closed"),null},L)),R?q():As(()=>{R=!0,y(),q()})})}function dA(e,r){return function(n){try{return n.getReader({mode:"byob"}).releaseLock(),!0}catch{return!1}}(e)?function(n){let i,s,u,l,c,h=n.getReader(),p=!1,y=!1,d=!1,m=!1,_=!1,A=!1,P=ct(L=>{c=L});function R(L){Ap(L.closed,H=>(L!==h||(u.error(H),l.error(H),_&&A||c(void 0)),null))}function V(){p&&(h.releaseLock(),h=n.getReader(),R(h),p=!1),nt(h.read(),L=>{var H,Y;if(d=!1,m=!1,L.done)return _||u.close(),A||l.close(),(H=u.byobRequest)===null||H===void 0||H.respond(0),(Y=l.byobRequest)===null||Y===void 0||Y.respond(0),_&&A||c(void 0),null;let ne=L.value,T=ne,E=ne;if(!_&&!A)try{E=jp(ne)}catch(N){return u.error(N),l.error(N),c(h.cancel(N)),null}return _||u.enqueue(T),A||l.enqueue(E),y=!1,d?S():m&&B(),null},()=>(y=!1,null))}function z(L,H){p||(h.releaseLock(),h=n.getReader({mode:"byob"}),R(h),p=!0);let Y=H?l:u,ne=H?u:l;nt(h.read(L),T=>{var E;d=!1,m=!1;let N=H?A:_,F=H?_:A;if(T.done){N||Y.close(),F||ne.close();let W=T.value;return W!==void 0&&(N||Y.byobRequest.respondWithNewView(W),F||(E=ne.byobRequest)===null||E===void 0||E.respond(0)),N&&F||c(void 0),null}let j=T.value;if(F)N||Y.byobRequest.respondWithNewView(j);else{let W;try{W=jp(j)}catch(ee){return Y.error(ee),ne.error(ee),c(h.cancel(ee)),null}N||Y.byobRequest.respondWithNewView(j),ne.enqueue(W)}return y=!1,d?S():m&&B(),null},()=>(y=!1,null))}function S(){if(y)return d=!0,Oe(void 0);y=!0;let L=u.byobRequest;return L===null?V():z(L.view,!1),Oe(void 0)}function B(){if(y)return m=!0,Oe(void 0);y=!0;let L=l.byobRequest;return L===null?V():z(L.view,!0),Oe(void 0)}function v(L){if(_=!0,i=L,A){let H=[i,s],Y=h.cancel(H);c(Y)}return P}function q(L){if(A=!0,s=L,_){let H=[i,s],Y=h.cancel(H);c(Y)}return P}let C=new et({type:"bytes",start(L){u=L},pull:S,cancel:v}),k=new et({type:"bytes",start(L){l=L},pull:B,cancel:q});return R(h),[C,k]}(e):function(n,i){let s=n.getReader(),u,l,c,h,p,y=!1,d=!1,m=!1,_=!1,A=ct(B=>{p=B});function P(){return y?(d=!0,Oe(void 0)):(y=!0,nt(s.read(),B=>{if(d=!1,B.done)return m||c.close(),_||h.close(),m&&_||p(void 0),null;let v=B.value,q=v,C=v;return m||c.enqueue(q),_||h.enqueue(C),y=!1,d&&P(),null},()=>(y=!1,null)),Oe(void 0))}function R(B){if(m=!0,u=B,_){let v=[u,l],q=s.cancel(v);p(q)}return A}function V(B){if(_=!0,l=B,m){let v=[u,l],q=s.cancel(v);p(q)}return A}let z=new et({start(B){c=B},pull:P,cancel:R}),S=new et({start(B){h=B},pull:P,cancel:V});return Ap(s.closed,B=>(c.error(B),h.error(B),m&&_||p(void 0),null)),[z,S]}(e)}var vn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!bs(this))throw _s("desiredSize");return Ly(this)}close(){if(!bs(this))throw _s("close");if(!Wo(this))throw new TypeError("The stream is not in a state that permits close");(function(e){if(!Wo(e))return;let r=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(Is(e),Xo(r))})(this)}enqueue(e){if(!bs(this))throw _s("enqueue");if(!Wo(this))throw new TypeError("The stream is not in a state that permits enqueue");return function(r,n){if(!Wo(r))return;let i=r._controlledReadableStream;if(ro(i)&&ia(i)>0)lc(i,n,!1);else{let s;try{s=r._strategySizeAlgorithm(n)}catch(u){throw Ko(r,u),u}try{cc(r,n,s)}catch(u){throw Ko(r,u),u}}Go(r)}(this,e)}error(e){if(!bs(this))throw _s("error");Ko(this,e)}[oc](e){Gr(this);let r=this._cancelAlgorithm(e);return Is(this),r}[ic](e){let r=this._controlledReadableStream;if(this._queue.length>0){let n=Ol(this);this._closeRequested&&this._queue.length===0?(Is(this),Xo(r)):Go(this),e._chunkSteps(n)}else hy(r,e),Go(this)}[sc](){}};function bs(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof vn}function Go(e){if(function(r){let n=r._controlledReadableStream;return!Wo(r)||!r._started?!1:!!(ro(n)&&ia(n)>0||Ly(r)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,nt(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,Go(e)),null),r=>(Ko(e,r),null))}}function Is(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function Ko(e,r){let n=e._controlledReadableStream;n._state==="readable"&&(Gr(e),Is(e),My(n,r))}function Ly(e){let r=e._controlledReadableStream._state;return r==="errored"?null:r==="closed"?0:e._strategyHWM-e._queueTotalSize}function Wo(e){return!e._closeRequested&&e._controlledReadableStream._state==="readable"}function pA(e,r,n,i){let s=Object.create(vn.prototype),u,l,c;u=r.start!==void 0?()=>r.start(s):()=>{},l=r.pull!==void 0?()=>r.pull(s):()=>Oe(void 0),c=r.cancel!==void 0?h=>r.cancel(h):()=>Oe(void 0),function(h,p,y,d,m,_,A){p._controlledReadableStream=h,p._queue=void 0,p._queueTotalSize=void 0,Gr(p),p._started=!1,p._closeRequested=!1,p._pullAgain=!1,p._pulling=!1,p._strategySizeAlgorithm=A,p._strategyHWM=_,p._pullAlgorithm=d,p._cancelAlgorithm=m,h._readableStreamController=p,nt(Oe(y()),()=>(p._started=!0,Go(p),null),P=>(Ko(p,P),null))}(e,s,u,l,c,n,i)}function _s(e){return new TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function mA(e,r,n){return er(e,n),i=>Rn(e,r,[i])}function yA(e,r,n){return er(e,n),i=>Rn(e,r,[i])}function gA(e,r,n){return er(e,n),i=>oa(e,r,[i])}function vA(e,r){if((e=`${e}`)!="bytes")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function bA(e,r){if((e=`${e}`)!="byob")throw new TypeError(`${r} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Fp(e,r){Rr(e,r);let n=e?.preventAbort,i=e?.preventCancel,s=e?.preventClose,u=e?.signal;return u!==void 0&&function(l,c){if(!function(h){if(typeof h!="object"||h===null)return!1;try{return typeof h.aborted=="boolean"}catch{return!1}}(l))throw new TypeError(`${c} is not an AbortSignal.`)}(u,`${r} has member 'signal' that`),{preventAbort:Boolean(n),preventCancel:Boolean(i),preventClose:Boolean(s),signal:u}}function _A(e,r){Rr(e,r);let n=e?.readable;Rl(n,"readable","ReadableWritablePair"),function(s,u){if(!Ho(s))throw new TypeError(`${u} is not a ReadableStream.`)}(n,`${r} has member 'readable' that`);let i=e?.writable;return Rl(i,"writable","ReadableWritablePair"),function(s,u){if(!ly(s))throw new TypeError(`${u} is not a WritableStream.`)}(i,`${r} has member 'writable' that`),{readable:n,writable:i}}Object.defineProperties(vn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),Se(vn.prototype.close,"close"),Se(vn.prototype.enqueue,"enqueue"),Se(vn.prototype.error,"error"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(vn.prototype,Ee.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var et=class{constructor(e={},r={}){e===void 0?e=null:ay(e,"First parameter");let n=Ms(r,"Second parameter"),i=function(u,l){Rr(u,l);let c=u,h=c?.autoAllocateChunkSize,p=c?.cancel,y=c?.pull,d=c?.start,m=c?.type;return{autoAllocateChunkSize:h===void 0?void 0:uy(h,`${l} has member 'autoAllocateChunkSize' that`),cancel:p===void 0?void 0:mA(p,c,`${l} has member 'cancel' that`),pull:y===void 0?void 0:yA(y,c,`${l} has member 'pull' that`),start:d===void 0?void 0:gA(d,c,`${l} has member 'start' that`),type:m===void 0?void 0:vA(m,`${l} has member 'type' that`)}}(e,"First parameter");var s;if((s=this)._state="readable",s._reader=void 0,s._storedError=void 0,s._disturbed=!1,i.type==="bytes"){if(n.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");iA(this,i,Qo(n,0))}else{let u=Ns(n);pA(this,i,Qo(n,1),u)}}get locked(){if(!En(this))throw ln("locked");return ro(this)}cancel(e){return En(this)?ro(this)?de(new TypeError("Cannot cancel a stream that already has a reader")):Ny(this,e):de(ln("cancel"))}getReader(e){if(!En(this))throw ln("getReader");return function(r,n){Rr(r,n);let i=r?.mode;return{mode:i===void 0?void 0:bA(i,`${n} has member 'mode' that`)}}(e,"First parameter").mode===void 0?new pn(this):function(r){return new yn(r)}(this)}pipeThrough(e,r={}){if(!Ho(this))throw ln("pipeThrough");Or(e,1,"pipeThrough");let n=_A(e,"First parameter"),i=Fp(r,"Second parameter");if(this.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(n.writable.locked)throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return Zn(zp(this,n.writable,i.preventClose,i.preventAbort,i.preventCancel,i.signal)),n.readable}pipeTo(e,r={}){if(!Ho(this))return de(ln("pipeTo"));if(e===void 0)return de("Parameter 1 is required in 'pipeTo'.");if(!ly(e))return de(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let n;try{n=Fp(r,"Second parameter")}catch(i){return de(i)}return this.locked?de(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):e.locked?de(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):zp(this,e,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!Ho(this))throw ln("tee");if(this.locked)throw new TypeError("Cannot tee a stream that already has a reader");return dA(this)}values(e){if(!Ho(this))throw ln("values");return function(r,n){let i=r.getReader(),s=new py(i,n),u=Object.create(my);return u._asyncIteratorImpl=s,u}(this,function(r,n){Rr(r,n);let i=r?.preventCancel;return{preventCancel:Boolean(i)}}(e,"First parameter").preventCancel)}};function En(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof et}function ro(e){return e._reader!==void 0}function Ny(e,r){if(e._disturbed=!0,e._state==="closed")return Oe(void 0);if(e._state==="errored")return de(e._storedError);Xo(e);let n=e._reader;if(n!==void 0&&Qn(n)){let i=n._readIntoRequests;n._readIntoRequests=new Bt,i.forEach(s=>{s._closeSteps(void 0)})}return Qt(e._readableStreamController[oc](r),Xm)}function Xo(e){e._state="closed";let r=e._reader;if(r!==void 0&&(sy(r),wn(r))){let n=r._readRequests;r._readRequests=new Bt,n.forEach(i=>{i._closeSteps()})}}function My(e,r){e._state="errored",e._storedError=r;let n=e._reader;n!==void 0&&(ac(n,r),wn(n)?dy(n,r):xy(n,r))}function ln(e){return new TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function By(e,r){Rr(e,r);let n=e?.highWaterMark;return Rl(n,"highWaterMark","QueuingStrategyInit"),{highWaterMark:uc(n)}}Object.defineProperties(et.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),Se(et.prototype.cancel,"cancel"),Se(et.prototype.getReader,"getReader"),Se(et.prototype.pipeThrough,"pipeThrough"),Se(et.prototype.pipeTo,"pipeTo"),Se(et.prototype.tee,"tee"),Se(et.prototype.values,"values"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(et.prototype,Ee.toStringTag,{value:"ReadableStream",configurable:!0}),typeof Ee.asyncIterator=="symbol"&&Object.defineProperty(et.prototype,Ee.asyncIterator,{value:et.prototype.values,writable:!0,configurable:!0});var Dy=e=>e.byteLength;Se(Dy,"size");var Cl=class{constructor(e){Or(e,1,"ByteLengthQueuingStrategy"),e=By(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Hp(this))throw Up("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Hp(this))throw Up("size");return Dy}};function Up(e){return new TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Hp(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof Cl}Object.defineProperties(Cl.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(Cl.prototype,Ee.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var zy=()=>1;Se(zy,"size");var Il=class{constructor(e){Or(e,1,"CountQueuingStrategy"),e=By(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Vp(this))throw Wp("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Vp(this))throw Wp("size");return zy}};function Wp(e){return new TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Vp(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof Il}function wA(e,r,n){return er(e,n),i=>Rn(e,r,[i])}function EA(e,r,n){return er(e,n),i=>oa(e,r,[i])}function SA(e,r,n){return er(e,n),(i,s)=>Rn(e,r,[i,s])}Object.defineProperties(Il.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(Il.prototype,Ee.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var jl=class{constructor(e={},r={},n={}){e===void 0&&(e=null);let i=Ms(r,"Second parameter"),s=Ms(n,"Third parameter"),u=function(d,m){Rr(d,m);let _=d?.flush,A=d?.readableType,P=d?.start,R=d?.transform,V=d?.writableType;return{flush:_===void 0?void 0:wA(_,d,`${m} has member 'flush' that`),readableType:A,start:P===void 0?void 0:EA(P,d,`${m} has member 'start' that`),transform:R===void 0?void 0:SA(R,d,`${m} has member 'transform' that`),writableType:V}}(e,"First parameter");if(u.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(u.writableType!==void 0)throw new RangeError("Invalid writableType specified");let l=Qo(s,0),c=Ns(s),h=Qo(i,1),p=Ns(i),y;(function(d,m,_,A,P,R){function V(){return m}function z(C){return function(k,L){let H=k._transformStreamController;return k._backpressure?Qt(k._backpressureChangePromise,()=>{if((ur(k._writable)?k._writable._state:k._writableState)==="erroring")throw ur(k._writable)?k._writable._storedError:k._writableStoredError;return Kp(H,L)}):Kp(H,L)}(d,C)}function S(C){return function(k,L){return zs(k,L),Oe(void 0)}(d,C)}function B(){return function(C){let k=C._transformStreamController,L=k._flushAlgorithm();return Fy(k),Qt(L,()=>{if(C._readableState==="errored")throw C._readableStoredError;Us(C)&&Hy(C)},H=>{throw zs(C,H),C._readableStoredError})}(d)}function v(){return function(C){return Fs(C,!1),C._backpressureChangePromise}(d)}function q(C){return ua(d,C),Oe(void 0)}d._writableState="writable",d._writableStoredError=void 0,d._writableHasInFlightOperation=!1,d._writableStarted=!1,d._writable=function(C,k,L,H,Y,ne,T){return new gn({start(E){C._writableController=E;try{let N=E.signal;N!==void 0&&N.addEventListener("abort",()=>{C._writableState==="writable"&&(C._writableState="erroring",N.reason&&(C._writableStoredError=N.reason))})}catch{}return Qt(k(),()=>(C._writableStarted=!0,Yp(C),null),N=>{throw C._writableStarted=!0,vl(C,N),N})},write:E=>(function(N){N._writableHasInFlightOperation=!0}(C),Qt(L(E),()=>(function(N){N._writableHasInFlightOperation=!1}(C),Yp(C),null),N=>{throw function(F,j){F._writableHasInFlightOperation=!1,vl(F,j)}(C,N),N})),close:()=>(function(E){E._writableHasInFlightOperation=!0}(C),Qt(H(),()=>(function(E){E._writableHasInFlightOperation=!1,E._writableState==="erroring"&&(E._writableStoredError=void 0),E._writableState="closed"}(C),null),E=>{throw function(N,F){N._writableHasInFlightOperation=!1,N._writableState,vl(N,F)}(C,E),E})),abort:E=>(C._writableState="errored",C._writableStoredError=E,Y(E))},{highWaterMark:ne,size:T})}(d,V,z,B,S,_,A),d._readableState="readable",d._readableStoredError=void 0,d._readableCloseRequested=!1,d._readablePulling=!1,d._readable=function(C,k,L,H,Y,ne){return new et({start:T=>(C._readableController=T,k().catch(E=>{Hs(C,E)})),pull:()=>(C._readablePulling=!0,L().catch(T=>{Hs(C,T)})),cancel:T=>(C._readableState="closed",H(T))},{highWaterMark:Y,size:ne})}(d,V,v,q,P,R),d._backpressure=void 0,d._backpressureChangePromise=void 0,d._backpressureChangePromise_resolve=void 0,Fs(d,!0),d._transformStreamController=void 0})(this,ct(d=>{y=d}),h,p,l,c),function(d,m){let _=Object.create(bn.prototype),A,P;A=m.transform!==void 0?R=>m.transform(R,_):R=>{try{return Uy(_,R),Oe(void 0)}catch(V){return de(V)}},P=m.flush!==void 0?()=>m.flush(_):()=>Oe(void 0),function(R,V,z,S){V._controlledTransformStream=R,R._transformStreamController=V,V._transformAlgorithm=z,V._flushAlgorithm=S}(d,_,A,P)}(this,u),u.start!==void 0?y(u.start(this._transformStreamController)):y(void 0)}get readable(){if(!Gp(this))throw Jp("readable");return this._readable}get writable(){if(!Gp(this))throw Jp("writable");return this._writable}};function Gp(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof jl}function zs(e,r){Hs(e,r),ua(e,r)}function ua(e,r){Fy(e._transformStreamController),function(n,i){n._writableController.error(i),n._writableState==="writable"&&Vy(n,i)}(e,r),e._backpressure&&Fs(e,!1)}function Fs(e,r){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=ct(n=>{e._backpressureChangePromise_resolve=n}),e._backpressure=r}Object.defineProperties(jl.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(jl.prototype,Ee.toStringTag,{value:"TransformStream",configurable:!0});var bn=class{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ws(this))throw Es("desiredSize");return Wy(this._controlledTransformStream)}enqueue(e){if(!ws(this))throw Es("enqueue");Uy(this,e)}error(e){if(!ws(this))throw Es("error");var r;r=e,zs(this._controlledTransformStream,r)}terminate(){if(!ws(this))throw Es("terminate");(function(e){let r=e._controlledTransformStream;Us(r)&&Hy(r);let n=new TypeError("TransformStream terminated");ua(r,n)})(this)}};function ws(e){return!!ot(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof bn}function Fy(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function Uy(e,r){let n=e._controlledTransformStream;if(!Us(n))throw new TypeError("Readable side is not in a state that permits enqueue");try{(function(i,s){i._readablePulling=!1;try{i._readableController.enqueue(s)}catch(u){throw Hs(i,u),u}})(n,r)}catch(i){throw ua(n,i),n._readableStoredError}(function(i){return!function(s){return Us(s)?!!(s._readablePulling||Wy(s)>0):!1}(i)})(n)!==n._backpressure&&Fs(n,!0)}function Kp(e,r){return Qt(e._transformAlgorithm(r),void 0,n=>{throw zs(e._controlledTransformStream,n),n})}function Es(e){return new TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function Jp(e){return new TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}function Us(e){return!e._readableCloseRequested&&e._readableState==="readable"}function Hy(e){e._readableState="closed",e._readableCloseRequested=!0,e._readableController.close()}function Hs(e,r){e._readableState==="readable"&&(e._readableState="errored",e._readableStoredError=r),e._readableController.error(r)}function Wy(e){return e._readableController.desiredSize}function vl(e,r){e._writableState!=="writable"?bc(e):Vy(e,r)}function Vy(e,r){e._writableState="erroring",e._writableStoredError=r,!function(n){return n._writableHasInFlightOperation}(e)&&e._writableStarted&&bc(e)}function bc(e){e._writableState="errored"}function Yp(e){e._writableState==="erroring"&&bc(e)}Object.defineProperties(bn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),Se(bn.prototype.enqueue,"enqueue"),Se(bn.prototype.error,"error"),Se(bn.prototype.terminate,"terminate"),typeof Ee.toStringTag=="symbol"&&Object.defineProperty(bn.prototype,Ee.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});var Gy=65536;async function*TA(e){let r=e.byteOffset+e.byteLength,n=e.byteOffset;for(;n!==r;){let i=Math.min(r-n,Gy),s=e.buffer.slice(n,n+i);n+=s.byteLength,yield new Uint8Array(s)}}async function*RA(e){let r=0;for(;r!==e.size;){let n=await e.slice(r,Math.min(e.size,r+Gy)).arrayBuffer();r+=n.byteLength,yield new Uint8Array(n)}}async function*bl(e,r=!1){for(let n of e)ArrayBuffer.isView(n)?r?yield*TA(n):yield n:Qe(n.stream)?yield*n.stream():yield*RA(n)}function*OA(e,r,n=0,i){i??(i=r);let s=n<0?Math.max(r+n,0):Math.min(n,r),u=i<0?Math.max(r+i,0):Math.min(i,r),l=Math.max(u-s,0),c=0;for(let h of e){if(c>=l)break;let p=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&p<=s)s-=p,u-=p;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(p,u)),c+=y.byteLength):(y=h.slice(s,Math.min(p,u)),c+=y.size),u-=p,s=0,yield y}}}var Hr=function(e,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:r.get(e)},Qp=function(e,r,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,n):s?s.value=n:r.set(e,n),n},cn,Ss,Fo,no=class{constructor(e=[],r={}){if(cn.set(this,[]),Ss.set(this,""),Fo.set(this,0),r??(r={}),typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(!Qe(e[Symbol.iterator]))throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&!Qe(r))throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");let n=new TextEncoder;for(let s of e){let u;ArrayBuffer.isView(s)?u=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?u=new Uint8Array(s.slice(0)):s instanceof no?u=s:u=n.encode(String(s)),Qp(this,Fo,Hr(this,Fo,"f")+(ArrayBuffer.isView(u)?u.byteLength:u.size),"f"),Hr(this,cn,"f").push(u)}let i=r.type===void 0?"":String(r.type);Qp(this,Ss,/^[\x20-\x7E]*$/.test(i)?i:"","f")}static[(cn=new WeakMap,Ss=new WeakMap,Fo=new WeakMap,Symbol.hasInstance)](e){return Boolean(e&&typeof e=="object"&&Qe(e.constructor)&&(Qe(e.stream)||Qe(e.arrayBuffer))&&/^(Blob|File)$/.test(e[Symbol.toStringTag]))}get type(){return Hr(this,Ss,"f")}get size(){return Hr(this,Fo,"f")}slice(e,r,n){return new no(OA(Hr(this,cn,"f"),this.size,e,r),{type:n})}async text(){let e=new TextDecoder,r="";for await(let n of bl(Hr(this,cn,"f")))r+=e.decode(n,{stream:!0});return r+=e.decode(),r}async arrayBuffer(){let e=new Uint8Array(this.size),r=0;for await(let n of bl(Hr(this,cn,"f")))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=bl(Hr(this,cn,"f"),!0);return new et({async pull(r){let{value:n,done:i}=await e.next();if(i)return queueMicrotask(()=>r.close());r.enqueue(n)},async cancel(){await e.return()}})}get[Symbol.toStringTag](){return"Blob"}};Object.defineProperties(no.prototype,{type:{enumerable:!0},size:{enumerable:!0},slice:{enumerable:!0},stream:{enumerable:!0},text:{enumerable:!0},arrayBuffer:{enumerable:!0}});var xA=e=>e instanceof no,Xp=function(e,r,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,n):s?s.value=n:r.set(e,n),n},Zp=function(e,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:r.get(e)},Ts,Rs,Ws=class extends no{constructor(e,r,n={}){if(super(e,n),Ts.set(this,void 0),Rs.set(this,0),arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);Xp(this,Ts,String(r),"f");let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||Xp(this,Rs,i,"f")}static[(Ts=new WeakMap,Rs=new WeakMap,Symbol.hasInstance)](e){return e instanceof no&&e[Symbol.toStringTag]==="File"&&typeof e.name=="string"}get name(){return Zp(this,Ts,"f")}get webkitRelativePath(){return""}get lastModified(){return Zp(this,Rs,"f")}get[Symbol.toStringTag](){return"File"}},AA=e=>e instanceof Ws,ir=function(e,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:r.get(e)},Os,sr,_l,kA=class{constructor(){Os.add(this),sr.set(this,new Map)}static[(sr=new WeakMap,Os=new WeakSet,Symbol.hasInstance)](e){if(!e)return!1;let r=e;return Boolean(Qe(r.constructor)&&r[Symbol.toStringTag]==="FormData"&&Qe(r.append)&&Qe(r.set)&&Qe(r.get)&&Qe(r.getAll)&&Qe(r.has)&&Qe(r.delete)&&Qe(r.entries)&&Qe(r.values)&&Qe(r.keys)&&Qe(r[Symbol.iterator])&&Qe(r.forEach))}append(e,r,n){ir(this,Os,"m",_l).call(this,{name:e,fileName:n,append:!0,rawValue:r,argsLength:arguments.length})}set(e,r,n){ir(this,Os,"m",_l).call(this,{name:e,fileName:n,append:!1,rawValue:r,argsLength:arguments.length})}get(e){let r=ir(this,sr,"f").get(String(e));return r?r[0]:null}getAll(e){let r=ir(this,sr,"f").get(String(e));return r?r.slice():[]}has(e){return ir(this,sr,"f").has(String(e))}delete(e){ir(this,sr,"f").delete(String(e))}*keys(){for(let e of ir(this,sr,"f").keys())yield e}*entries(){for(let e of this.keys()){let r=this.getAll(e);for(let n of r)yield[e,n]}}*values(){for(let[,e]of this)yield e}[(_l=function({name:e,rawValue:r,append:n,fileName:i,argsLength:s}){let u=n?"append":"set";if(s<2)throw new TypeError(`Failed to execute '${u}' on 'FormData': 2 arguments required, but only ${s} present.`);e=String(e);let l;if(AA(r))l=i===void 0?r:new Ws([r],i,{type:r.type,lastModified:r.lastModified});else if(xA(r))l=new Ws([r],i===void 0?"blob":i,{type:r.type});else{if(i)throw new TypeError(`Failed to execute '${u}' on 'FormData': parameter 2 is not of type 'Blob'.`);l=String(r)}let c=ir(this,sr,"f").get(e);if(!c)return void ir(this,sr,"f").set(e,[l]);if(!n)return void ir(this,sr,"f").set(e,[l]);c.push(l)},Symbol.iterator)](){return this.entries()}forEach(e,r){for(let[n,i]of this)e.call(r,i,n,this)}get[Symbol.toStringTag](){return"FormData"}},PA=require("node:fs"),Ky=require("node:fs/promises"),CA=require("node:path"),IA=He(zT(),1),jA=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase();function qA(e){if(jA(e)!=="object")return!1;let r=Object.getPrototypeOf(e);return r==null?!0:(r.constructor&&r.constructor.toString())===Object.toString()}var $A=qA,em=function(e,r,n,i,s){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?e!==r||!s:!r.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?s.call(e,n):s?s.value=n:r.set(e,n),n},hn=function(e,r,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?e!==r||!i:!r.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:r.get(e)},fn,Gn,LA="The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.",Jy=class{constructor(e){fn.set(this,void 0),Gn.set(this,void 0),em(this,fn,e.path,"f"),em(this,Gn,e.start||0,"f"),this.name=(0,CA.basename)(hn(this,fn,"f")),this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new Jy({path:hn(this,fn,"f"),lastModified:this.lastModified,start:hn(this,Gn,"f")+e,size:r-e})}async*stream(){let{mtimeMs:e}=await(0,Ky.stat)(hn(this,fn,"f"));if(e>this.lastModified)throw new IA.default(LA,"NotReadableError");this.size&&(yield*(0,PA.createReadStream)(hn(this,fn,"f"),{start:hn(this,Gn,"f"),end:hn(this,Gn,"f")+this.size-1}))}get[(fn=new WeakMap,Gn=new WeakMap,Symbol.toStringTag)](){return"File"}};function NA(e,{mtimeMs:r,size:n},i,s={}){let u;$A(i)?[s,u]=[i,void 0]:u=i;let l=new Jy({path:e,size:n,lastModified:r});return u||(u=l.name),new Ws([l],u,{...s,lastModified:l.lastModified})}async function MA(e,r,n){let i=await(0,Ky.stat)(e);return NA(e,i,r,n)}var BA=He(RR(),1),_c={apiKey:"API Key is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key",apiSecret:"API Secret is required. To get one: https://addons.mozilla.org/en-US/developers/addon/api/key"},DA=Object.keys(_c),tm="https://addons.mozilla.org/api",zA=class{options={};get productEndpoint(){return`${tm}/v5/addons/${encodeURIComponent(this.options.extId)}`}constructor(e){for(let r of DA){if(!e[r])throw new Error(_c[r]);this.options[r]=e[r]}typeof e.extId=="string"&&e.extId.length>0&&!e.extId.includes("@")&&(e.extId.startsWith("{")||(e.extId="{"+e.extId),e.extId.endsWith("}")||(e.extId+="}")),this.options.extId=e.extId}submit=async({filePath:e,version:r="1.0.0"})=>{let n=`${this.productEndpoint}/versions/${encodeURIComponent(r)}/`,i=new kA;i.append("upload",await MA(e));let s=await this.getAccessToken(),u=await Mt.put(n,{throwHttpErrors:!1,body:i,headers:{Authorization:`JWT ${s}`}});if(u.statusCode>=400)throw u.statusCode===401?new Error("Invalid access token"):u.statusCode===403?new Error("You do not own this add-on"):u.statusCode===409?new Error(`Version ${r} already exists`):(console.log(u.body),new Error(JSON.parse(u.body).error||"Unknown error"));return JSON.parse(u.body)};getUploadStatus=async({version:e="1.0.0"})=>{let r=await this.getAccessToken(),n=`${this.productEndpoint}/versions/${encodeURIComponent(e)}/`;return Mt.get(n,{headers:{Authorization:`JWT ${r}`}}).json()};getProfile=async()=>{let e=await this.getAccessToken(),r=`${tm}/v5/accounts/profile`;return Mt.get(r,{headers:{Authorization:`JWT ${e}`}}).json()};getAccessToken=async()=>{let e=Math.floor(Date.now()/1e3),r={iss:this.options.apiKey,jti:Math.random().toString(),iat:e,exp:e+60*5};return BA.default.sign(r,this.options.apiSecret,{algorithm:"HS256"})}},Zo="firefox",FA=ec(Zo);function UA(e){return Tn(this,null,function*(){var r=e,{extId:n,zip:i,dryRun:s}=r,u=Ll(r,["extId","zip","dryRun"]),l,c,h,p;let y=ta(i),d=((c=(l=y.browser_specific_settings)==null?void 0:l.gecko)==null?void 0:c.id)||((p=(h=y.applications)==null?void 0:h.gecko)==null?void 0:p.id)||n,m=new zA($l({extId:d},u));if(FA(`Updating extension with ID ${d}`),s)return!0;try{return yield m.submit({filePath:i,version:y.version}),Zl({extId:d,market:Zo,zip:i}),!0}catch(_){throw tc(_,Zo,`"${d}" (${y.name})`)}})}function HA(e){return Tn(this,null,function*(){return e.zip=ea(e),e.verbose&&ra(Zo),na({market:Zo,options:e,errorMap:_c}),UA(e)})}var WA={packageId:"No package ID is provided, e.g. https://addons.opera.com/developer/package/PACKAGE_ID",sessionid:`No "sessionid" is provided. If you have a hard time obtaining it, run: web-ext-deploy --get-cookies=opera`,csrftoken:`No "csrftoken" is provided. If you have a hard time obtaining it, run: -web-ext-deploy --get-cookies=opera`},il="opera";function Zy(e){return Vt(this,null,function*(){throw e.zip=no(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` -`)),e.verbose&&io(il),so({market:il,options:e,errorMap:Xy}),new Error("Opera submission is not supported at this time, due to lack of automation API - their CSRF token and cookies expires in 24 hours. It will be faster to just drag/drop the zip on their dev portal.")})}});var pe=as($o()),Fe=as(Qu());var Hr=e=>`${e.padEnd(9)} |`,Xu=e=>e.zip||e.file,Yu=e=>!!Xu(e);function eg(){return ls(this,null,function*(){try{(0,pe.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,pe.getInput)("keys",{required:!0})),t=(0,pe.getInput)("file")||(0,pe.getInput)("zip")||(0,pe.getInput)("artifact"),r=(0,pe.getInput)("version-file"),n=(0,pe.getInput)("notes")||(0,pe.getInput)("edge-notes"),o=!!(0,pe.getInput)("verbose");o&&(console.log=pe.info);let i=Object.keys(e).filter(u=>Fe.supportedBrowserSet.has(u));if(i.length===0)throw new Error("No supported browser found");for(let u of i){let d=(0,pe.getInput)(`${u}-file`),h=Xu(e[u]);d?e[u].zip=d:h?e[u].zip=h:t?e[u].zip=t:(0,pe.warning)(`${Hr("\u{1F7E1} SKIP")} No artifact available to submit for ${u}`),o&&(e[u].verbose=o),r&&(e[u].versionFile=r)}if(!i.some(u=>Yu(e[u])))throw new Error("No artifact found for deployment");if(e.edge&&n&&(e.edge.notes=n),process.env.NODE_ENV==="test"){(0,pe.debug)(JSON.stringify({artifact:t,versionFile:r,verbose:o})),(0,pe.debug)(i.join(","));return}let a=i.map(u=>{if(!Yu(e[u]))return!1;switch((0,pe.info)(`${Hr("\u{1F7E1} QUEUE")} Prepare for ${u} submission`),u){case Fe.BrowserName.Chrome:return(0,Fe.submitChrome)(e[u]);case Fe.BrowserName.Firefox:return(0,Fe.submitFirefox)(e[u]);case Fe.BrowserName.Edge:return(0,Fe.submitEdge)(e[u])}});(yield Promise.allSettled(a)).forEach((u,d)=>{u.status==="rejected"?(0,pe.setFailed)(`${Hr("\u{1F534} ERROR")} ${u.reason}`):u.value&&(0,pe.info)(`${Hr("\u{1F7E2} DONE")} ${i[d]} submission successful`)})}catch(e){e instanceof Error&&(0,pe.setFailed)(`${Hr("\u{1F534} ERROR")} ${e.message}`)}})}eg(); -/*! Based on fetch-blob. MIT License. Jimmy Wärting & David Frank */ -/*! node-domexception. MIT License. Jimmy Wärting */ -/*! safe-buffer. MIT License. Feross Aboukhadijeh */ -/** - * @license - * web-streams-polyfill v4.0.0-beta.3 - * Copyright 2021 Mattias Buelens, Diwank Singh Tomer and other contributors. - * This code is released under the MIT license. - * SPDX-License-Identifier: MIT - */ +web-ext-deploy --get-cookies=opera`},rm="opera";function VA(e){return Tn(this,null,function*(){throw e.zip=ea(e),e.changelog&&(e.changelog=e.changelog.replace(/\/\/n/g,` +`)),e.verbose&&ra(rm),na({market:rm,options:e,errorMap:WA}),new Error("Opera submission is not supported at this time, due to lack of automation API - their CSRF token and cookies expires in 24 hours. It will be faster to just drag/drop the zip on their dev portal.")})}});var Me=Po(Vu()),Dt=Po(Qy());var oi=e=>`${e.padEnd(9)} |`,Zy=e=>e.zip||e.file,Xy=e=>!!Zy(e);function GA(){return ed(this,null,function*(){try{(0,Me.info)("\u{1F7E3} Plasmo Browser Platform Publish v3");let e=JSON.parse((0,Me.getInput)("keys",{required:!0})),r=(0,Me.getInput)("file")||(0,Me.getInput)("zip")||(0,Me.getInput)("artifact"),n=(0,Me.getInput)("version-file"),i=(0,Me.getInput)("notes")||(0,Me.getInput)("edge-notes"),s=!!(0,Me.getInput)("verbose");s&&(console.log=Me.info);let u=Object.keys(e).filter(p=>Dt.supportedBrowserSet.has(p));if(u.length===0)throw new Error("No supported browser found");for(let p of u){let y=(0,Me.getInput)(`${p}-file`),d=Zy(e[p]);y?e[p].zip=y:d?e[p].zip=d:r?e[p].zip=r:(0,Me.warning)(`${oi("\u{1F7E1} SKIP")} No artifact available to submit for ${p}`),s&&(e[p].verbose=s),n&&(e[p].versionFile=n)}if(!u.some(p=>Xy(e[p])))throw new Error("No artifact found for deployment");if(e.edge&&i&&(e.edge.notes=i),process.env.NODE_ENV==="test"){(0,Me.debug)(JSON.stringify({artifact:r,versionFile:n,verbose:s})),(0,Me.debug)(u.join(","));return}let c=u.map(p=>{if(!Xy(e[p]))return!1;switch((0,Me.info)(`${oi("\u{1F7E1} QUEUE")} Prepare for ${p} submission`),p){case Dt.BrowserName.Chrome:return(0,Dt.submitChrome)(e[p]);case Dt.BrowserName.Firefox:return(0,Dt.submitFirefox)(e[p]);case Dt.BrowserName.Edge:return(0,Dt.submitEdge)(e[p])}});(yield Promise.allSettled(c)).forEach((p,y)=>{p.status==="rejected"?(0,Me.setFailed)(`${oi("\u{1F534} ERROR")} ${p.reason}`):p.value&&(0,Me.info)(`${oi("\u{1F7E2} DONE")} ${u[y]} submission successful`)})}catch(e){e instanceof Error&&(0,Me.setFailed)(`${oi("\u{1F534} ERROR")} ${e.message}`)}})}GA(); +/*! Bundled license information: + +node-domexception/index.js: + (*! node-domexception. MIT License. Jimmy Wärting *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +lodash/lodash.js: + (** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +web-streams-polyfill/dist/ponyfill.mjs: + (** + * @license + * web-streams-polyfill v4.0.0-beta.3 + * Copyright 2021 Mattias Buelens, Diwank Singh Tomer and other contributors. + * This code is released under the MIT license. + * SPDX-License-Identifier: MIT + *) + +formdata-node/lib/blobHelpers.js: + (*! Based on fetch-blob. MIT License. Jimmy Wärting & David Frank *) + +formdata-node/lib/Blob.js: + (*! Based on fetch-blob. MIT License. Jimmy Wärting & David Frank *) +*/