@activepieces/piece-google-contacts 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.js CHANGED
@@ -1,52 +1,106 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.googleContacts = exports.googleContactsAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const shared_1 = require("@activepieces/shared");
8
- const create_contact_1 = require("./lib/action/create-contact");
9
- const update_contact_1 = require("./lib/action/update-contact");
10
- const search_contact_1 = require("./lib/action/search-contact");
11
- const common_1 = require("./lib/common");
12
- const new_contact_1 = require("./lib/trigger/new-contact");
13
- exports.googleContactsAuth = pieces_framework_1.PieceAuth.OAuth2({
14
- description: '',
15
- authUrl: 'https://accounts.google.com/o/oauth2/auth',
16
- tokenUrl: 'https://oauth2.googleapis.com/token',
17
- required: true,
18
- scope: ['https://www.googleapis.com/auth/contacts'],
19
- });
20
- exports.googleContacts = (0, pieces_framework_1.createPiece)({
21
- minimumSupportedRelease: '0.30.0',
22
- logoUrl: 'https://cdn.activepieces.com/pieces/google-contacts.png',
23
- categories: [shared_1.PieceCategory.SALES_AND_CRM],
24
- actions: [
25
- create_contact_1.googleContactsAddContactAction,
26
- update_contact_1.googleContactsUpdateContactAction,
27
- search_contact_1.googleContactsSearchContactsAction,
28
- (0, pieces_common_1.createCustomApiCallAction)({
29
- baseUrl: () => common_1.googleContactsCommon.baseUrl,
30
- auth: exports.googleContactsAuth,
31
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
32
- return ({
33
- Authorization: `Bearer ${(auth).access_token}`,
34
- });
35
- }),
36
- }),
37
- ],
38
- displayName: 'Google Contacts',
39
- description: 'Stay connected and organized',
40
- authors: [
41
- 'Abdallah-Alwarawreh',
42
- 'Salem-Alaa',
43
- 'kishanprmr',
44
- 'MoShizzle',
45
- 'khaledmashaly',
46
- 'abuaboud',
47
- 'ikus060',
48
- ],
49
- triggers: [new_contact_1.googleContactNewOrUpdatedContact],
50
- auth: exports.googleContactsAuth,
51
- });
52
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Lw=Object.create;var Ai=Object.defineProperty;var Fw=Object.getOwnPropertyDescriptor;var Bw=Object.getOwnPropertyNames;var qw=Object.getPrototypeOf,Vw=Object.prototype.hasOwnProperty;var o=(t,e)=>Ai(t,"name",{value:e,configurable:!0});var ht=(t,e)=>()=>(t&&(e=t(t=0)),e);var k=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ms=(t,e)=>{for(var r in e)Ai(t,r,{get:e[r],enumerable:!0})},ph=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Bw(e))!Vw.call(t,i)&&i!==r&&Ai(t,i,{get:()=>e[i],enumerable:!(n=Fw(e,i))||n.enumerable});return t};var pt=(t,e,r)=>(r=t!=null?Lw(qw(t)):{},ph(e||!t||!t.__esModule?Ai(r,"default",{value:t,enumerable:!0}):r,t)),Hw=t=>ph(Ai({},"__esModule",{value:!0}),t);var Rg=k((Ig,ks)=>{(function(t){"use strict";let e="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${e}\\.${e}\\.${e}\\.${e}$`,"i"),threeOctet:new RegExp(`^${e}\\.${e}\\.${e}$`,"i"),twoOctet:new RegExp(`^${e}\\.${e}$`,"i"),longValue:new RegExp(`^${e}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${s})?$`,"i")};function l(g,y){if(g.indexOf("::")!==g.lastIndexOf("::"))return null;let T=0,P=-1,x=(g.match(d.zoneIndex)||[])[0],N,L;for(x&&(x=x.substring(1),g=g.replace(/%.+$/,""));(P=g.indexOf(":",P+1))>=0;)T++;if(g.substr(0,2)==="::"&&T--,g.substr(-2,2)==="::"&&T--,T>y)return null;for(L=y-T,N=":";L--;)N+="0:";return g=g.replace("::",N),g[0]===":"&&(g=g.slice(1)),g[g.length-1]===":"&&(g=g.slice(0,-1)),y=function(){let X=g.split(":"),W=[];for(let G=0;G<X.length;G++)W.push(parseInt(X[G],16));return W}(),{parts:y,zoneId:x}}o(l,"expandIPv6");function p(g,y,T,P){if(g.length!==y.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,N;for(;P>0;){if(N=T-P,N<0&&(N=0),g[x]>>N!==y[x]>>N)return!1;P-=T,x+=1}return!0}o(p,"matchCIDR");function f(g){if(i.test(g))return parseInt(g,16);if(g[0]==="0"&&!isNaN(parseInt(g[1],10))){if(n.test(g))return parseInt(g,8);throw new Error(`ipaddr: cannot parse ${g} as octal`)}return parseInt(g,10)}o(f,"parseIntAuto");function _(g,y){for(;g.length<y;)g=`0${g}`;return g}o(_,"padPart");let h={};h.IPv4=function(){function g(y){if(y.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,P;for(T=0;T<y.length;T++)if(P=y[T],!(0<=P&&P<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=y}return o(g,"IPv4"),g.prototype.SpecialRanges={unspecified:[[new g([0,0,0,0]),8]],broadcast:[[new g([255,255,255,255]),32]],multicast:[[new g([224,0,0,0]),4]],linkLocal:[[new g([169,254,0,0]),16]],loopback:[[new g([127,0,0,0]),8]],carrierGradeNat:[[new g([100,64,0,0]),10]],private:[[new g([10,0,0,0]),8],[new g([172,16,0,0]),12],[new g([192,168,0,0]),16]],reserved:[[new g([192,0,0,0]),24],[new g([192,0,2,0]),24],[new g([192,88,99,0]),24],[new g([198,18,0,0]),15],[new g([198,51,100,0]),24],[new g([203,0,113,0]),24],[new g([240,0,0,0]),4]],as112:[[new g([192,175,48,0]),24],[new g([192,31,196,0]),24]],amt:[[new g([192,52,193,0]),24]]},g.prototype.kind=function(){return"ipv4"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,y.octets,8,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,N,L;for(x=3;x>=0;x-=1)if(N=this.octets[x],N in P){if(L=P[N],T&&L!==0)return null;L!==8&&(T=!0),y+=L}else return null;return 32-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){return this.octets.slice(0)},g.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},g.prototype.toNormalizedString=function(){return this.toString()},g.prototype.toString=function(){return this.octets.join(".")},g}(),h.IPv4.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<4;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(g){return this.parser(g)!==null},h.IPv4.isValid=function(g){try{return new this(this.parser(g)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(g){try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(g){return!!(h.IPv4.isValid(g)&&g.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(g){let y=g.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(g)||!y?!1:h.IPv4.isValidFourPartDecimal(y[1])},h.IPv4.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<4;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(g){let y=this.parser(g);if(y===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(y)},h.IPv4.parseCIDR=function(g){let y;if(y=g.match(/^(.+)\/(\d+)$/)){let T=parseInt(y[2]);if(T>=0&&T<=32){let P=[this.parse(y[1]),T];return Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(g){let y,T,P;if(y=g.match(r.fourOctet))return function(){let x=y.slice(1,6),N=[];for(let L=0;L<x.length;L++)T=x[L],N.push(f(T));return N}();if(y=g.match(r.longValue)){if(P=f(y[1]),P>4294967295||P<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],N;for(N=0;N<=24;N+=8)x.push(P>>N&255);return x}().reverse()}else return(y=g.match(r.twoOctet))?function(){let x=y.slice(1,4),N=[];if(P=f(x[1]),P>16777215||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(P>>16&255),N.push(P>>8&255),N.push(P&255),N}():(y=g.match(r.threeOctet))?function(){let x=y.slice(1,5),N=[];if(P=f(x[2]),P>65535||P<0)throw new Error("ipaddr: address outside defined range");return N.push(f(x[0])),N.push(f(x[1])),N.push(P>>8&255),N.push(P&255),N}():null},h.IPv4.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>32)throw new Error("ipaddr: invalid IPv4 prefix length");let y=[0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<4&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.IPv6=function(){function g(y,T){let P,x;if(y.length===16)for(this.parts=[],P=0;P<=14;P+=2)this.parts.push(y[P]<<8|y[P+1]);else if(y.length===8)this.parts=y;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(P=0;P<this.parts.length;P++)if(x=this.parts[P],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(g,"IPv6"),g.prototype.SpecialRanges={unspecified:[new g([0,0,0,0,0,0,0,0]),128],linkLocal:[new g([65152,0,0,0,0,0,0,0]),10],multicast:[new g([65280,0,0,0,0,0,0,0]),8],loopback:[new g([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new g([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new g([0,0,0,0,0,65535,0,0]),96],discard:[new g([256,0,0,0,0,0,0,0]),64],rfc6145:[new g([0,0,0,0,65535,0,0,0]),96],rfc6052:[new g([100,65435,0,0,0,0,0,0]),96],"6to4":[new g([8194,0,0,0,0,0,0,0]),16],teredo:[new g([8193,0,0,0,0,0,0,0]),32],benchmarking:[new g([8193,2,0,0,0,0,0,0]),48],amt:[new g([8193,3,0,0,0,0,0,0]),32],as112v6:[[new g([8193,4,274,0,0,0,0,0]),48],[new g([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new g([8193,16,0,0,0,0,0,0]),28],orchid2:[new g([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new g([8193,48,0,0,0,0,0,0]),28],reserved:[[new g([8193,0,0,0,0,0,0,0]),23],[new g([8193,3512,0,0,0,0,0,0]),32]]},g.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},g.prototype.kind=function(){return"ipv6"},g.prototype.match=function(y,T){let P;if(T===void 0&&(P=y,y=P[0],T=P[1]),y.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,y.parts,16,T)},g.prototype.prefixLengthFromSubnetMask=function(){let y=0,T=!1,P={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,N;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in P){if(N=P[x],T&&N!==0)return null;N!==16&&(T=!0),y+=N}else return null;return 128-y},g.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},g.prototype.toByteArray=function(){let y,T=[],P=this.parts;for(let x=0;x<P.length;x++)y=P[x],T.push(y>>8),T.push(y&255);return T},g.prototype.toFixedLengthString=function(){let y=function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(_(this.parts[x].toString(16),4));return P}.call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let y=this.parts.slice(-2),T=y[0],P=y[1];return new h.IPv4([T>>8,T&255,P>>8,P&255])},g.prototype.toNormalizedString=function(){let y=function(){let P=[];for(let x=0;x<this.parts.length;x++)P.push(this.parts[x].toString(16));return P}.call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),y+T},g.prototype.toRFC5952String=function(){let y=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),P=0,x=-1,N;for(;N=y.exec(T);)N[0].length>x&&(P=N.index,x=N[0].length);return x<0?T:`${T.substring(0,P)}::${T.substring(P+x)}`},g.prototype.toString=function(){return this.toRFC5952String()},g}(),h.IPv6.broadcastAddressFromCIDR=function(g){try{let y=this.parseCIDR(g),T=y[0].toByteArray(),P=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],N=0;for(;N<16;)x.push(parseInt(T[N],10)|parseInt(P[N],10)^255),N++;return new this(x)}catch(y){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${y})`)}},h.IPv6.isIPv6=function(g){return this.parser(g)!==null},h.IPv6.isValid=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{let y=this.parser(g);return new this(y.parts,y.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(g){if(typeof g=="string"&&g.indexOf(":")===-1)return!1;try{return this.parseCIDR(g),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(g){let y,T,P,x,N;try{for(y=this.parseCIDR(g),P=y[0].toByteArray(),N=this.subnetMaskFromPrefixLength(y[1]).toByteArray(),x=[],T=0;T<16;)x.push(parseInt(P[T],10)&parseInt(N[T],10)),T++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},h.IPv6.parse=function(g){let y=this.parser(g);if(y.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(y.parts,y.zoneId)},h.IPv6.parseCIDR=function(g){let y,T,P;if((T=g.match(/^(.+)\/(\d+)$/))&&(y=parseInt(T[2]),y>=0&&y<=128))return P=[this.parse(T[1]),y],Object.defineProperty(P,"toString",{value:o(function(){return this.join("/")},"value")}),P;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(g){let y,T,P,x,N,L;if(P=g.match(d.deprecatedTransitional))return this.parser(`::ffff:${P[1]}`);if(d.native.test(g))return l(g,8);if((P=g.match(d.transitional))&&(L=P[6]||"",y=P[1],P[1].endsWith("::")||(y=y.slice(0,-1)),y=l(y+L,6),y.parts)){for(N=[parseInt(P[2]),parseInt(P[3]),parseInt(P[4]),parseInt(P[5])],T=0;T<N.length;T++)if(x=N[T],!(0<=x&&x<=255))return null;return y.parts.push(N[0]<<8|N[1]),y.parts.push(N[2]<<8|N[3]),{parts:y.parts,zoneId:y.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(g){if(g=parseInt(g),g<0||g>128)throw new Error("ipaddr: invalid IPv6 prefix length");let y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,P=Math.floor(g/8);for(;T<P;)y[T]=255,T++;return P<16&&(y[P]=Math.pow(2,g%8)-1<<8-g%8),new this(y)},h.fromByteArray=function(g){let y=g.length;if(y===4)return new h.IPv4(g);if(y===16)return new h.IPv6(g);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(g){return h.IPv6.isValid(g)||h.IPv4.isValid(g)},h.isValidCIDR=function(g){return h.IPv6.isValidCIDR(g)||h.IPv4.isValidCIDR(g)},h.parse=function(g){if(h.IPv6.isValid(g))return h.IPv6.parse(g);if(h.IPv4.isValid(g))return h.IPv4.parse(g);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(g){try{return h.IPv6.parseCIDR(g)}catch{try{return h.IPv4.parseCIDR(g)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(g){let y=this.parse(g);return y.kind()==="ipv6"&&y.isIPv4MappedAddress()?y.toIPv4Address():y},h.subnetMatch=function(g,y,T){let P,x,N,L;T==null&&(T="unicast");for(x in y)if(Object.prototype.hasOwnProperty.call(y,x)){for(N=y[x],N[0]&&!(N[0]instanceof Array)&&(N=[N]),P=0;P<N.length;P++)if(L=N[P],g.kind()===L[0].kind()&&g.match.apply(g,L))return x}return T},typeof ks<"u"&&ks.exports?ks.exports=h:t.ipaddr=h})(Ig)});var wy=k((N3,xy)=>{var Ty=require("stream").Stream,bR=require("util");xy.exports=fr;function fr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fr,"DelayedStream");bR.inherits(fr,Ty);fr.create=function(t,e){var r=new this;e=e||{};for(var n in e)r[n]=e[n];r.source=t;var i=t.emit;return t.emit=function(){return r._handleEmit(arguments),i.apply(t,arguments)},t.on("error",function(){}),r.pauseStream&&t.pause(),r};Object.defineProperty(fr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fr.prototype.resume=function(){this._released||this.release(),this.source.resume()};fr.prototype.pause=function(){this.source.pause()};fr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};fr.prototype.pipe=function(){var t=Ty.prototype.pipe.apply(this,arguments);return this.resume(),t};fr.prototype._handleEmit=function(t){if(this._released){this.emit.apply(this,t);return}t[0]==="data"&&(this.dataSize+=t[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(t)};fr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(t))}}});var Oy=k((D3,Ry)=>{var PR=require("util"),Iy=require("stream").Stream,Ay=wy();Ry.exports=ot;function ot(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(ot,"CombinedStream");PR.inherits(ot,Iy);ot.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};ot.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};ot.prototype.append=function(t){var e=ot.isStreamLike(t);if(e){if(!(t instanceof Ay)){var r=Ay.create(t,{maxDataSize:1/0,pauseStream:this.pauseStreams});t.on("data",this._checkDataSize.bind(this)),t=r}this._handleErrors(t),this.pauseStreams&&t.pause()}return this._streams.push(t),this};ot.prototype.pipe=function(t,e){return Iy.prototype.pipe.call(this,t,e),this.resume(),t};ot.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};ot.prototype._realGetNext=function(){var t=this._streams.shift();if(typeof t>"u"){this.end();return}if(typeof t!="function"){this._pipeNext(t);return}var e=t;e(function(r){var n=ot.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ot.prototype._pipeNext=function(t){this._currentStream=t;var e=ot.isStreamLike(t);if(e){t.on("end",this._getNext.bind(this)),t.pipe(this,{end:!1});return}var r=t;this.write(r),this._getNext()};ot.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};ot.prototype.write=function(t){this.emit("data",t)};ot.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ot.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};ot.prototype.end=function(){this._reset(),this.emit("end")};ot.prototype.destroy=function(){this._reset(),this.emit("close")};ot.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ot.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};ot.prototype._updateDataSize=function(){this.dataSize=0;var t=this;this._streams.forEach(function(e){e.dataSize&&(t.dataSize+=e.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};ot.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var $y=k((M3,Cy)=>{"use strict";Cy.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var zy=k(Rt=>{"use strict";var js=$y(),SR=require("path").extname,ky=/^\s*([^;\s]*)(?:;|\s|$)/,ER=/^text\//i;Rt.charset=Ny;Rt.charsets={lookup:Ny};Rt.contentType=TR;Rt.extension=xR;Rt.extensions=Object.create(null);Rt.lookup=wR;Rt.types=Object.create(null);AR(Rt.extensions,Rt.types);function Ny(t){if(!t||typeof t!="string")return!1;var e=ky.exec(t),r=e&&js[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&ER.test(e[1])?"UTF-8":!1}o(Ny,"charset");function TR(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Rt.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Rt.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(TR,"contentType");function xR(t){if(!t||typeof t!="string")return!1;var e=ky.exec(t),r=e&&Rt.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(xR,"extension");function wR(t){if(!t||typeof t!="string")return!1;var e=SR("x."+t).toLowerCase().substr(1);return e&&Rt.types[e]||!1}o(wR,"lookup");function AR(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(js).forEach(o(function(i){var s=js[i],c=s.extensions;if(!(!c||!c.length)){t[i]=c;for(var d=0;d<c.length;d++){var l=c[d];if(e[l]){var p=r.indexOf(js[e[l]].source),f=r.indexOf(s.source);if(e[l]!=="application/octet-stream"&&(p>f||p===f&&e[l].substr(0,12)==="application/"))continue}e[l]=i}}},"forEachMimeType"))}o(AR,"populateMaps")});var Uy=k((F3,Dy)=>{Dy.exports=IR;function IR(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(IR,"defer")});var Ll=k((q3,jy)=>{var My=Uy();jy.exports=RR;function RR(t){var e=!1;return My(function(){e=!0}),o(function(n,i){e?t(n,i):My(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(RR,"async")});var Fl=k((H3,Ly)=>{Ly.exports=OR;function OR(t){Object.keys(t.jobs).forEach(CR.bind(t)),t.jobs={}}o(OR,"abort");function CR(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(CR,"clean")});var Bl=k((W3,By)=>{var Fy=Ll(),$R=Fl();By.exports=kR;function kR(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=NR(e,i,t[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?$R(r):r.results[i]=c,n(s,r.results))})}o(kR,"iterate");function NR(t,e,r,n){var i;return t.length==2?i=t(r,Fy(n)):i=t(r,e,Fy(n)),i}o(NR,"runJob")});var ql=k((K3,qy)=>{qy.exports=zR;function zR(t,e){var r=!Array.isArray(t),n={index:0,keyedList:r||e?Object.keys(t):null,jobs:{},results:r?{}:[],size:r?Object.keys(t).length:t.length};return e&&n.keyedList.sort(r?e:function(i,s){return e(t[i],t[s])}),n}o(zR,"state")});var Vl=k((Y3,Vy)=>{var DR=Fl(),UR=Ll();Vy.exports=MR;function MR(t){Object.keys(this.jobs).length&&(this.index=this.size,DR(this),UR(t)(null,this.results))}o(MR,"terminator")});var Gy=k((Q3,Hy)=>{var jR=Bl(),LR=ql(),FR=Vl();Hy.exports=BR;function BR(t,e,r){for(var n=LR(t);n.index<(n.keyedList||t).length;)jR(t,e,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return FR.bind(n,r)}o(BR,"parallel")});var Hl=k((tK,Ls)=>{var Wy=Bl(),qR=ql(),VR=Vl();Ls.exports=HR;Ls.exports.ascending=Zy;Ls.exports.descending=GR;function HR(t,e,r,n){var i=qR(t,r);return Wy(t,e,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||t).length){Wy(t,e,i,s);return}n(null,i.results)},"iteratorHandler")),VR.bind(i,n)}o(HR,"serialOrdered");function Zy(t,e){return t<e?-1:t>e?1:0}o(Zy,"ascending");function GR(t,e){return-1*Zy(t,e)}o(GR,"descending")});var Jy=k((nK,Ky)=>{var WR=Hl();Ky.exports=ZR;function ZR(t,e,r){return WR(t,e,null,r)}o(ZR,"serial")});var Xy=k((iK,Yy)=>{Yy.exports={parallel:Gy(),serial:Jy(),serialOrdered:Hl()}});var Gl=k((aK,Qy)=>{"use strict";Qy.exports=Object});var t_=k((sK,e_)=>{"use strict";e_.exports=Error});var n_=k((uK,r_)=>{"use strict";r_.exports=EvalError});var i_=k((cK,o_)=>{"use strict";o_.exports=RangeError});var s_=k((lK,a_)=>{"use strict";a_.exports=ReferenceError});var c_=k((dK,u_)=>{"use strict";u_.exports=SyntaxError});var In=k((pK,l_)=>{"use strict";l_.exports=TypeError});var p_=k((fK,d_)=>{"use strict";d_.exports=URIError});var m_=k((mK,f_)=>{"use strict";f_.exports=Math.abs});var g_=k((hK,h_)=>{"use strict";h_.exports=Math.floor});var __=k((gK,y_)=>{"use strict";y_.exports=Math.max});var b_=k((yK,v_)=>{"use strict";v_.exports=Math.min});var S_=k((_K,P_)=>{"use strict";P_.exports=Math.pow});var T_=k((vK,E_)=>{"use strict";E_.exports=Math.round});var w_=k((bK,x_)=>{"use strict";x_.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var I_=k((SK,A_)=>{"use strict";var KR=w_();A_.exports=o(function(e){return KR(e)||e===0?e:e<0?-1:1},"sign")});var O_=k((TK,R_)=>{"use strict";R_.exports=Object.getOwnPropertyDescriptor});var Wl=k((xK,C_)=>{"use strict";var Fs=O_();if(Fs)try{Fs([],"length")}catch{Fs=null}C_.exports=Fs});var k_=k((wK,$_)=>{"use strict";var Bs=Object.defineProperty||!1;if(Bs)try{Bs({},"a",{value:1})}catch{Bs=!1}$_.exports=Bs});var Zl=k((AK,N_)=>{"use strict";N_.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var c=Object.getOwnPropertySymbols(e);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(e,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var U_=k((RK,D_)=>{"use strict";var z_=typeof Symbol<"u"&&Symbol,JR=Zl();D_.exports=o(function(){return typeof z_!="function"||typeof Symbol!="function"||typeof z_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:JR()},"hasNativeSymbols")});var Kl=k((CK,M_)=>{"use strict";M_.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Jl=k(($K,j_)=>{"use strict";var YR=Gl();j_.exports=YR.getPrototypeOf||null});var B_=k((kK,F_)=>{"use strict";var XR="Function.prototype.bind called on incompatible ",QR=Object.prototype.toString,eO=Math.max,tO="[object Function]",L_=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var s=0;s<r.length;s+=1)n[s+e.length]=r[s];return n},"concatty"),rO=o(function(e,r){for(var n=[],i=r||0,s=0;i<e.length;i+=1,s+=1)n[s]=e[i];return n},"slicy"),nO=o(function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r},"joiny");F_.exports=o(function(e){var r=this;if(typeof r!="function"||QR.apply(r)!==tO)throw new TypeError(XR+r);for(var n=rO(arguments,1),i,s=o(function(){if(this instanceof i){var f=r.apply(this,L_(n,arguments));return Object(f)===f?f:this}return r.apply(e,L_(n,arguments))},"binder"),c=eO(0,r.length-n.length),d=[],l=0;l<c;l++)d[l]="$"+l;if(i=Function("binder","return function ("+nO(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var p=o(function(){},"Empty");p.prototype=r.prototype,i.prototype=new p,p.prototype=null}return i},"bind")});var jo=k((zK,q_)=>{"use strict";var oO=B_();q_.exports=Function.prototype.bind||oO});var qs=k((DK,V_)=>{"use strict";V_.exports=Function.prototype.call});var Yl=k((UK,H_)=>{"use strict";H_.exports=Function.prototype.apply});var W_=k((MK,G_)=>{"use strict";G_.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var K_=k((jK,Z_)=>{"use strict";var iO=jo(),aO=Yl(),sO=qs(),uO=W_();Z_.exports=uO||iO.call(sO,aO)});var Xl=k((LK,J_)=>{"use strict";var cO=jo(),lO=In(),dO=qs(),pO=K_();J_.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new lO("a function is required");return pO(cO,dO,e)},"callBindBasic")});var rv=k((BK,tv)=>{"use strict";var fO=Xl(),Y_=Wl(),Q_;try{Q_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ql=!!Q_&&Y_&&Y_(Object.prototype,"__proto__"),ev=Object,X_=ev.getPrototypeOf;tv.exports=Ql&&typeof Ql.get=="function"?fO([Ql.get]):typeof X_=="function"?o(function(e){return X_(e==null?e:ev(e))},"getDunder"):!1});var sv=k((VK,av)=>{"use strict";var nv=Kl(),ov=Jl(),iv=rv();av.exports=nv?o(function(e){return nv(e)},"getProto"):ov?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ov(e)},"getProto"):iv?o(function(e){return iv(e)},"getProto"):null});var ed=k((GK,uv)=>{"use strict";var mO=Function.prototype.call,hO=Object.prototype.hasOwnProperty,gO=jo();uv.exports=gO.call(mO,hO)});var Yi=k((WK,mv)=>{"use strict";var ke,yO=Gl(),_O=t_(),vO=n_(),bO=i_(),PO=s_(),qo=c_(),Bo=In(),SO=p_(),EO=m_(),TO=g_(),xO=__(),wO=b_(),AO=S_(),IO=T_(),RO=I_(),pv=Function,td=o(function(t){try{return pv('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Zi=Wl(),OO=k_(),rd=o(function(){throw new Bo},"throwTypeError"),CO=Zi?function(){try{return arguments.callee,rd}catch{try{return Zi(arguments,"callee").get}catch{return rd}}}():rd,Lo=U_()(),gt=sv(),$O=Jl(),kO=Kl(),fv=Yl(),Ki=qs(),Fo={},NO=typeof Uint8Array>"u"||!gt?ke:gt(Uint8Array),Xn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ke:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ke:ArrayBuffer,"%ArrayIteratorPrototype%":Lo&&gt?gt([][Symbol.iterator]()):ke,"%AsyncFromSyncIteratorPrototype%":ke,"%AsyncFunction%":Fo,"%AsyncGenerator%":Fo,"%AsyncGeneratorFunction%":Fo,"%AsyncIteratorPrototype%":Fo,"%Atomics%":typeof Atomics>"u"?ke:Atomics,"%BigInt%":typeof BigInt>"u"?ke:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ke:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ke:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ke:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":_O,"%eval%":eval,"%EvalError%":vO,"%Float16Array%":typeof Float16Array>"u"?ke:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ke:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ke:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ke:FinalizationRegistry,"%Function%":pv,"%GeneratorFunction%":Fo,"%Int8Array%":typeof Int8Array>"u"?ke:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ke:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ke:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Lo&&gt?gt(gt([][Symbol.iterator]())):ke,"%JSON%":typeof JSON=="object"?JSON:ke,"%Map%":typeof Map>"u"?ke:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Lo||!gt?ke:gt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":yO,"%Object.getOwnPropertyDescriptor%":Zi,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ke:Promise,"%Proxy%":typeof Proxy>"u"?ke:Proxy,"%RangeError%":bO,"%ReferenceError%":PO,"%Reflect%":typeof Reflect>"u"?ke:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ke:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Lo||!gt?ke:gt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ke:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Lo&&gt?gt(""[Symbol.iterator]()):ke,"%Symbol%":Lo?Symbol:ke,"%SyntaxError%":qo,"%ThrowTypeError%":CO,"%TypedArray%":NO,"%TypeError%":Bo,"%Uint8Array%":typeof Uint8Array>"u"?ke:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ke:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ke:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ke:Uint32Array,"%URIError%":SO,"%WeakMap%":typeof WeakMap>"u"?ke:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ke:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ke:WeakSet,"%Function.prototype.call%":Ki,"%Function.prototype.apply%":fv,"%Object.defineProperty%":OO,"%Object.getPrototypeOf%":$O,"%Math.abs%":EO,"%Math.floor%":TO,"%Math.max%":xO,"%Math.min%":wO,"%Math.pow%":AO,"%Math.round%":IO,"%Math.sign%":RO,"%Reflect.getPrototypeOf%":kO};if(gt)try{null.error}catch(t){cv=gt(gt(t)),Xn["%Error.prototype%"]=cv}var cv,zO=o(function t(e){var r;if(e==="%AsyncFunction%")r=td("async function () {}");else if(e==="%GeneratorFunction%")r=td("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=td("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&gt&&(r=gt(i.prototype))}return Xn[e]=r,r},"doEval"),lv={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ji=jo(),Vs=ed(),DO=Ji.call(Ki,Array.prototype.concat),UO=Ji.call(fv,Array.prototype.splice),dv=Ji.call(Ki,String.prototype.replace),Hs=Ji.call(Ki,String.prototype.slice),MO=Ji.call(Ki,RegExp.prototype.exec),jO=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,LO=/\\(\\)?/g,FO=o(function(e){var r=Hs(e,0,1),n=Hs(e,-1);if(r==="%"&&n!=="%")throw new qo("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qo("invalid intrinsic syntax, expected opening `%`");var i=[];return dv(e,jO,function(s,c,d,l){i[i.length]=d?dv(l,LO,"$1"):c||s}),i},"stringToPath"),BO=o(function(e,r){var n=e,i;if(Vs(lv,n)&&(i=lv[n],n="%"+i[0]+"%"),Vs(Xn,n)){var s=Xn[n];if(s===Fo&&(s=zO(n)),typeof s>"u"&&!r)throw new Bo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new qo("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");mv.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Bo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Bo('"allowMissing" argument must be a boolean');if(MO(/^%?[^%]*%?$/,e)===null)throw new qo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=FO(e),i=n.length>0?n[0]:"",s=BO("%"+i+"%",r),c=s.name,d=s.value,l=!1,p=s.alias;p&&(i=p[0],UO(n,DO([0,1],p)));for(var f=1,_=!0;f<n.length;f+=1){var h=n[f],g=Hs(h,0,1),y=Hs(h,-1);if((g==='"'||g==="'"||g==="`"||y==='"'||y==="'"||y==="`")&&g!==y)throw new qo("property names with quotes must have matching quotes");if((h==="constructor"||!_)&&(l=!0),i+="."+h,c="%"+i+"%",Vs(Xn,c))d=Xn[c];else if(d!=null){if(!(h in d)){if(!r)throw new Bo("base intrinsic for "+e+" exists, but the property is not available.");return}if(Zi&&f+1>=n.length){var T=Zi(d,h);_=!!T,_&&"get"in T&&!("originalValue"in T.get)?d=T.get:d=d[h]}else _=Vs(d,h),d=d[h];_&&!l&&(Xn[c]=d)}}return d},"GetIntrinsic")});var gv=k((KK,hv)=>{"use strict";var qO=Zl();hv.exports=o(function(){return qO()&&!!Symbol.toStringTag},"hasToStringTagShams")});var vv=k((YK,_v)=>{"use strict";var VO=Yi(),yv=VO("%Object.defineProperty%",!0),HO=gv()(),GO=ed(),WO=In(),Gs=HO?Symbol.toStringTag:null;_v.exports=o(function(e,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new WO("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Gs&&(n||!GO(e,Gs))&&(yv?yv(e,Gs,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Gs]=r)},"setToStringTag")});var Pv=k((QK,bv)=>{"use strict";var ZO=Function.prototype.call,KO=Object.prototype.hasOwnProperty,JO=jo();bv.exports=JO.call(ZO,KO)});var Ev=k((eJ,Sv)=>{"use strict";Sv.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var wv=k((tJ,xv)=>{"use strict";var ad=Oy(),YO=require("util"),nd=require("path"),XO=require("http"),QO=require("https"),e0=require("url").parse,t0=require("fs"),r0=require("stream").Stream,n0=require("crypto"),od=zy(),o0=Xy(),i0=vv(),Rn=Pv(),id=Ev();function Tv(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Tv,"escapeHeaderParam");function Ue(t){if(!(this instanceof Ue))return new Ue(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ad.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Ue,"FormData");YO.inherits(Ue,ad);Ue.LINE_BREAK=`\r
2
+ `;Ue.DEFAULT_CONTENT_TYPE="application/octet-stream";Ue.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ad.prototype.append.bind(this);if((typeof e=="number"||e==null)&&(e=String(e)),Array.isArray(e)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(t,e,r),s=this._multiPartFooter();n(i),n(e),n(s),this._trackLength(i,e,r)};Ue.prototype._trackLength=function(t,e,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(e)?n=e.length:typeof e=="string"&&(n=Buffer.byteLength(e)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(t)+Ue.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Rn(e,"httpVersion"))&&!(e instanceof r0))&&(r.knownLength||this._valuesToMeasure.push(e))};Ue.prototype._lengthRetriever=function(t,e){Rn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):t0.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Rn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Rn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ue.prototype._multiPartHeader=function(t,e,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(e,r),i=this._getContentType(e,r),s="",c={"Content-Disposition":["form-data",'name="'+Tv(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&id(c,r.header);var d;for(var l in c)if(Rn(c,l)){if(d=c[l],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=l+": "+d.join("; ")+Ue.LINE_BREAK)}return"--"+this.getBoundary()+Ue.LINE_BREAK+s+Ue.LINE_BREAK};Ue.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=nd.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=nd.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Rn(t,"httpVersion")&&(r=nd.basename(t.client._httpMessage.path||"")),r)return'filename="'+Tv(r)+'"'};Ue.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=od.lookup(t.name)),!r&&t&&t.path&&(r=od.lookup(t.path)),!r&&t&&t.readable&&Rn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=od.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ue.DEFAULT_CONTENT_TYPE),r};Ue.prototype._multiPartFooter=function(){return function(t){var e=Ue.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ue.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ue.LINE_BREAK};Ue.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Rn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ue.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ue.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ue.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?t=Buffer.concat([t,this._streams[r]]):t=Buffer.concat([t,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Ue.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ue.prototype._generateBoundary=function(){this._boundary="--------------------------"+n0.randomBytes(12).toString("hex")};Ue.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Ue.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ue.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(t.bind(this,null,e));return}o0.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Ue.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=e0(t),n=id({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=id(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=QO.request(n):r=XO.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var d,l=o(function(p,f){return r.removeListener("error",l),r.removeListener("response",d),e.call(this,p,f)},"callback");d=l.bind(this,null),r.on("error",l),r.on("response",d)}}.bind(this)),r};Ue.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ue.prototype.toString=function(){return"[object FormData]"};i0(Ue.prototype,"FormData");xv.exports=Ue});var Qi=k((WJ,Lv)=>{"use strict";var Ws=Object.prototype.hasOwnProperty,jv=Object.prototype.toString,kv=Object.defineProperty,Nv=Object.getOwnPropertyDescriptor,zv=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):jv.call(e)==="[object Array]"},"isArray"),Dv=o(function(e){if(!e||jv.call(e)!=="[object Object]")return!1;var r=Ws.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Ws.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Ws.call(e,i)},"isPlainObject"),Uv=o(function(e,r){kv&&r.name==="__proto__"?kv(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),Mv=o(function(e,r){if(r==="__proto__")if(Ws.call(e,r)){if(Nv)return Nv(e,r).value}else return;return e[r]},"getProperty");Lv.exports=o(function t(){var e,r,n,i,s,c,d=arguments[0],l=1,p=arguments.length,f=!1;for(typeof d=="boolean"&&(f=d,d=arguments[1]||{},l=2),(d==null||typeof d!="object"&&typeof d!="function")&&(d={});l<p;++l)if(e=arguments[l],e!=null)for(r in e)n=Mv(d,r),i=Mv(e,r),d!==i&&(f&&i&&(Dv(i)||(s=zv(i)))?(s?(s=!1,c=n&&zv(n)?n:[]):c=n&&Dv(n)?n:{},Uv(d,{name:r,newValue:t(f,c,i)})):typeof i<"u"&&Uv(d,{name:r,newValue:i}));return d},"extend")});var Fv=k((KJ,m0)=>{m0.exports={name:"gaxios",version:"7.1.3",description:"A simple common HTTP client specifically for Google APIs and services.",main:"build/cjs/src/index.js",types:"build/cjs/src/index.d.ts",files:["build/"],exports:{".":{import:{types:"./build/esm/src/index.d.ts",default:"./build/esm/src/index.js"},require:{types:"./build/cjs/src/index.d.ts",default:"./build/cjs/src/index.js"}}},scripts:{lint:"gts check --no-inline-config",test:"c8 mocha build/esm/test","presystem-test":"npm run compile","system-test":"mocha build/esm/system-test --timeout 80000",compile:"tsc -b ./tsconfig.json ./tsconfig.cjs.json && node utils/enable-esm.mjs",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",webpack:"webpack","prebrowser-test":"npm run compile","browser-test":"node build/browser-test/browser-test-runner.js",docs:"jsdoc -c .jsdoc.js","docs-test":"linkinator docs","predocs-test":"npm run docs","samples-test":"cd samples/ && npm link ../ && npm test && cd ../",prelint:"cd samples; npm link ../; npm install",clean:"gts clean"},repository:{type:"git",directory:"packages/gaxios",url:"https://github.com/googleapis/google-cloud-node-core.git"},keywords:["google"],engines:{node:">=18"},author:"Google, LLC",license:"Apache-2.0",devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/cors":"^2.8.6","@types/express":"^5.0.0","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/multiparty":"4.2.1","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","@types/tmp":"0.2.6",assert:"^2.0.0",browserify:"^17.0.0",c8:"^10.0.0",cors:"^2.8.5",express:"^5.0.0",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",linkinator:"^6.1.2",mocha:"^11.1.0",multiparty:"^4.2.1",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.0-beta.13","null-loader":"^4.0.0","pack-n-play":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","stream-browserify":"^3.0.0",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"^5.8.3",webpack:"^5.35.0","webpack-cli":"^6.0.1"},dependencies:{extend:"^3.0.2","https-proxy-agent":"^7.0.1","node-fetch":"^3.3.2",rimraf:"^5.0.1"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/gaxios"}});var qv=k((JJ,Bv)=>{"use strict";var h0=Fv();Bv.exports={pkg:h0}});var cd=k(er=>{"use strict";var Hv=er&&er.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(er,"__esModule",{value:!0});er.GaxiosError=er.GAXIOS_ERROR_SYMBOL=void 0;er.defaultErrorRedactor=Gv;var Vv=Hv(Qi()),g0=Hv(qv()),sd=g0.default.pkg;er.GAXIOS_ERROR_SYMBOL=Symbol.for(`${sd.name}-gaxios-error`);var ud=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[er.GAXIOS_ERROR_SYMBOL]=sd.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&er.GAXIOS_ERROR_SYMBOL in e&&e[er.GAXIOS_ERROR_SYMBOL]===sd.version?!0:Function.prototype[Symbol.hasInstance].call(t,e)}constructor(e,r,n,i){if(super(e,{cause:i}),this.config=r,this.response=n,this.error=i instanceof Error?i:void 0,this.config=(0,Vv.default)(!0,{},r),this.response&&(this.response.config=(0,Vv.default)(!0,{},this.response.config)),this.response){try{this.response.data=y0(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}i instanceof DOMException?this.code=i.name:i&&typeof i=="object"&&"code"in i&&(typeof i.code=="string"||typeof i.code=="number")&&(this.code=i.code)}static extractAPIErrorFromResponse(e,r="The request failed"){let n=r;if(typeof e.data=="string"&&(n=e.data),e.data&&typeof e.data=="object"&&"error"in e.data&&e.data.error&&!e.ok){if(typeof e.data.error=="string")return{message:e.data.error,code:e.status,status:e.statusText};if(typeof e.data.error=="object"){n="message"in e.data.error&&typeof e.data.error.message=="string"?e.data.error.message:n;let i="status"in e.data.error&&typeof e.data.error.status=="string"?e.data.error.status:e.statusText,s="code"in e.data.error&&typeof e.data.error.code=="number"?e.data.error.code:e.status;if("errors"in e.data.error&&Array.isArray(e.data.error.errors)){let c=[];for(let d of e.data.error.errors)typeof d=="object"&&"message"in d&&typeof d.message=="string"&&c.push(d.message);return Object.assign({message:c.join(`
3
+ `)||n,code:s,status:i},e.data.error)}return Object.assign({message:n,code:s,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};er.GaxiosError=ud;function y0(t,e){switch(t){case"stream":return e;case"json":return JSON.parse(JSON.stringify(e));case"arraybuffer":return JSON.parse(Buffer.from(e).toString("utf8"));case"blob":return JSON.parse(e.text());default:return e}}o(y0,"translateData");function Gv(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(s){s&&s.forEach((c,d)=>{(/^authentication$/i.test(d)||/^authorization$/i.test(d)||/secret/i.test(d))&&s.set(d,e)})}o(r,"redactHeaders");function n(s,c){if(typeof s=="object"&&s!==null&&typeof s[c]=="string"){let d=s[c];(/grant_type=/i.test(d)||/assertion=/i.test(d)||/secret/i.test(d))&&(s[c]=e)}}o(n,"redactString");function i(s){!s||typeof s!="object"||(s instanceof FormData||s instanceof URLSearchParams||"forEach"in s&&"set"in s?s.forEach((c,d)=>{(["grant_type","assertion"].includes(d)||/secret/.test(d))&&s.set(d,e)}):("grant_type"in s&&(s.grant_type=e),"assertion"in s&&(s.assertion=e),"client_secret"in s&&(s.client_secret=e)))}return o(i,"redactObject"),t.config&&(r(t.config.headers),n(t.config,"data"),i(t.config.data),n(t.config,"body"),i(t.config.body),t.config.url.searchParams.has("token")&&t.config.url.searchParams.set("token",e),t.config.url.searchParams.has("client_secret")&&t.config.url.searchParams.set("client_secret",e)),t.response&&(Gv({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(Gv,"defaultErrorRedactor")});var Zv=k(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});ld.getRetryConfig=_0;async function _0(t){let e=Wv(t);if(!t||!t.config||!e&&!t.config.retry)return{shouldRetry:!1};e=e||{},e.currentRetryAttempt=e.currentRetryAttempt||0,e.retry=e.retry===void 0||e.retry===null?3:e.retry,e.httpMethodsToRetry=e.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],e.noResponseRetries=e.noResponseRetries===void 0||e.noResponseRetries===null?2:e.noResponseRetries,e.retryDelayMultiplier=e.retryDelayMultiplier?e.retryDelayMultiplier:2,e.timeOfFirstRequest=e.timeOfFirstRequest?e.timeOfFirstRequest:Date.now(),e.totalTimeout=e.totalTimeout?e.totalTimeout:Number.MAX_SAFE_INTEGER,e.maxRetryDelay=e.maxRetryDelay?e.maxRetryDelay:Number.MAX_SAFE_INTEGER;let r=[[100,199],[408,408],[429,429],[500,599]];if(e.statusCodesToRetry=e.statusCodesToRetry||r,t.config.retryConfig=e,!await(e.shouldRetry||v0)(t))return{shouldRetry:!1,config:t.config};let i=b0(e);t.config.retryConfig.currentRetryAttempt+=1;let s=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await s,{shouldRetry:!0,config:t.config}}o(_0,"getRetryConfig");function v0(t){let e=Wv(t);if(t.config.signal?.aborted&&t.code!=="TimeoutError"||t.code==="AbortError"||!e||e.retry===0||!t.response&&(e.currentRetryAttempt||0)>=e.noResponseRetries||!e.httpMethodsToRetry||!e.httpMethodsToRetry.includes(t.config.method?.toUpperCase()||"GET"))return!1;if(t.response&&t.response.status){let r=!1;for(let[n,i]of e.statusCodesToRetry){let s=t.response.status;if(s>=n&&s<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(v0,"shouldRetryRequest");function Wv(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(Wv,"getConfig");function b0(t){let r=(t.currentRetryAttempt?0:t.retryDelay??100)+(Math.pow(t.retryDelayMultiplier,t.currentRetryAttempt)-1)/2*1e3,n=t.totalTimeout-(Date.now()-t.timeOfFirstRequest);return Math.min(r,n,t.maxRetryDelay)}o(b0,"getNextRetryDelay")});var pd=k(Zs=>{"use strict";Object.defineProperty(Zs,"__esModule",{value:!0});Zs.GaxiosInterceptorManager=void 0;var dd=class extends Set{static{o(this,"GaxiosInterceptorManager")}};Zs.GaxiosInterceptorManager=dd});var Jv=k((n8,Kv)=>{var Vo=1e3,Ho=Vo*60,Go=Ho*60,Qn=Go*24,P0=Qn*7,S0=Qn*365.25;Kv.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return E0(t);if(r==="number"&&isFinite(t))return e.long?x0(t):T0(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function E0(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*S0;case"weeks":case"week":case"w":return r*P0;case"days":case"day":case"d":return r*Qn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Go;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ho;case"seconds":case"second":case"secs":case"sec":case"s":return r*Vo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(E0,"parse");function T0(t){var e=Math.abs(t);return e>=Qn?Math.round(t/Qn)+"d":e>=Go?Math.round(t/Go)+"h":e>=Ho?Math.round(t/Ho)+"m":e>=Vo?Math.round(t/Vo)+"s":t+"ms"}o(T0,"fmtShort");function x0(t){var e=Math.abs(t);return e>=Qn?Ks(t,e,Qn,"day"):e>=Go?Ks(t,e,Go,"hour"):e>=Ho?Ks(t,e,Ho,"minute"):e>=Vo?Ks(t,e,Vo,"second"):t+" ms"}o(x0,"fmtLong");function Ks(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(Ks,"plural")});var fd=k((i8,Yv)=>{function w0(t){r.debug=r,r.default=r,r.coerce=l,r.disable=c,r.enable=i,r.enabled=d,r.humanize=Jv(),r.destroy=p,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let _=0;for(let h=0;h<f.length;h++)_=(_<<5)-_+f.charCodeAt(h),_|=0;return r.colors[Math.abs(_)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(f){let _,h=null,g,y;function T(...P){if(!T.enabled)return;let x=T,N=Number(new Date),L=N-(_||N);x.diff=L,x.prev=_,x.curr=N,_=N,P[0]=r.coerce(P[0]),typeof P[0]!="string"&&P.unshift("%O");let X=0;P[0]=P[0].replace(/%([a-zA-Z%])/g,(G,K)=>{if(G==="%%")return"%";X++;let ee=r.formatters[K];if(typeof ee=="function"){let Y=P[X];G=ee.call(x,Y),P.splice(X,1),X--}return G}),r.formatArgs.call(x,P),(x.log||r.log).apply(x,P)}return o(T,"debug"),T.namespace=f,T.useColors=r.useColors(),T.color=r.selectColor(f),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>h!==null?h:(g!==r.namespaces&&(g=r.namespaces,y=r.enabled(f)),y),"get"),set:o(P=>{h=P},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(f,_){let h=r(this.namespace+(typeof _>"u"?":":_)+f);return h.log=this.log,h}o(n,"extend");function i(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let _=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of _)h[0]==="-"?r.skips.push(h.slice(1)):r.names.push(h)}o(i,"enable");function s(f,_){let h=0,g=0,y=-1,T=0;for(;h<f.length;)if(g<_.length&&(_[g]===f[h]||_[g]==="*"))_[g]==="*"?(y=g,T=h,g++):(h++,g++);else if(y!==-1)g=y+1,T++,h=T;else return!1;for(;g<_.length&&_[g]==="*";)g++;return g===_.length}o(s,"matchesTemplate");function c(){let f=[...r.names,...r.skips.map(_=>"-"+_)].join(",");return r.enable(""),f}o(c,"disable");function d(f){for(let _ of r.skips)if(s(f,_))return!1;for(let _ of r.names)if(s(f,_))return!0;return!1}o(d,"enabled");function l(f){return f instanceof Error?f.stack||f.message:f}o(l,"coerce");function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return o(p,"destroy"),r.enable(r.load()),r}o(w0,"setup");Yv.exports=w0});var Xv=k((Ot,Js)=>{Ot.formatArgs=I0;Ot.save=R0;Ot.load=O0;Ot.useColors=A0;Ot.storage=C0();Ot.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ot.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function A0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}o(A0,"useColors");function I0(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Js.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,n=0;t[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),t.splice(n,0,e)}o(I0,"formatArgs");Ot.log=console.debug||console.log||(()=>{});function R0(t){try{t?Ot.storage.setItem("debug",t):Ot.storage.removeItem("debug")}catch{}}o(R0,"save");function O0(){let t;try{t=Ot.storage.getItem("debug")||Ot.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(O0,"load");function C0(){try{return localStorage}catch{}}o(C0,"localstorage");Js.exports=fd()(Ot);var{formatters:$0}=Js.exports;$0.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var eb=k((u8,Qv)=>{"use strict";Qv.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",n=e.indexOf(r+t),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var nb=k((c8,rb)=>{"use strict";var k0=require("os"),tb=require("tty"),tr=eb(),{env:yt}=process,Cn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Cn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Cn=1);"FORCE_COLOR"in yt&&(yt.FORCE_COLOR==="true"?Cn=1:yt.FORCE_COLOR==="false"?Cn=0:Cn=yt.FORCE_COLOR.length===0?1:Math.min(parseInt(yt.FORCE_COLOR,10),3));function md(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(md,"translateLevel");function hd(t,e){if(Cn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(t&&!e&&Cn===void 0)return 0;let r=Cn||0;if(yt.TERM==="dumb")return r;if(process.platform==="win32"){let n=k0.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in yt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in yt)||yt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in yt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(yt.TEAMCITY_VERSION)?1:0;if(yt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in yt){let n=parseInt((yt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(yt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(yt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(yt.TERM)||"COLORTERM"in yt?1:r}o(hd,"supportsColor");function N0(t){let e=hd(t,t&&t.isTTY);return md(e)}o(N0,"getSupportLevel");rb.exports={supportsColor:N0,stdout:md(hd(!0,tb.isatty(1))),stderr:md(hd(!0,tb.isatty(2)))}});var ib=k((_t,Xs)=>{var z0=require("tty"),Ys=require("util");_t.init=B0;_t.log=j0;_t.formatArgs=U0;_t.save=L0;_t.load=F0;_t.useColors=D0;_t.destroy=Ys.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");_t.colors=[6,2,3,4,5,1];try{let t=nb();t&&(t.stderr||t).level>=2&&(_t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}_t.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),t[r]=n,t},{});function D0(){return"colors"in _t.inspectOpts?!!_t.inspectOpts.colors:z0.isatty(process.stderr.fd)}o(D0,"useColors");function U0(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
4
+ `).join(`
5
+ `+s),t.push(i+"m+"+Xs.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=M0()+e+" "+t[0]}o(U0,"formatArgs");function M0(){return _t.inspectOpts.hideDate?"":new Date().toISOString()+" "}o(M0,"getDate");function j0(...t){return process.stderr.write(Ys.formatWithOptions(_t.inspectOpts,...t)+`
6
+ `)}o(j0,"log");function L0(t){t?process.env.DEBUG=t:delete process.env.DEBUG}o(L0,"save");function F0(){return process.env.DEBUG}o(F0,"load");function B0(t){t.inspectOpts={};let e=Object.keys(_t.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=_t.inspectOpts[e[r]]}o(B0,"init");Xs.exports=fd()(_t);var{formatters:ob}=Xs.exports;ob.o=function(t){return this.inspectOpts.colors=this.useColors,Ys.inspect(t,this.inspectOpts).split(`
7
+ `).map(e=>e.trim()).join(" ")};ob.O=function(t){return this.inspectOpts.colors=this.useColors,Ys.inspect(t,this.inspectOpts)}});var yd=k((p8,gd)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?gd.exports=Xv():gd.exports=ib()});var ub=k(Ct=>{"use strict";var q0=Ct&&Ct.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),V0=Ct&&Ct.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ab=Ct&&Ct.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&q0(e,t,r);return V0(e,t),e};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.req=Ct.json=Ct.toBuffer=void 0;var H0=ab(require("http")),G0=ab(require("https"));async function sb(t){let e=0,r=[];for await(let n of t)e+=n.length,r.push(n);return Buffer.concat(r,e)}o(sb,"toBuffer");Ct.toBuffer=sb;async function W0(t){let r=(await sb(t)).toString("utf8");try{return JSON.parse(r)}catch(n){let i=n;throw i.message+=` (input: ${r})`,i}}o(W0,"json");Ct.json=W0;function Z0(t,e={}){let n=((typeof t=="string"?t:t.href).startsWith("https:")?G0:H0).request(t,e),i=new Promise((s,c)=>{n.once("response",s).once("error",c).end()});return n.then=i.then.bind(i),n}o(Z0,"req");Ct.req=Z0});var pb=k(jt=>{"use strict";var lb=jt&&jt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),K0=jt&&jt.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),db=jt&&jt.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lb(e,t,r);return K0(e,t),e},J0=jt&&jt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&lb(e,t,r)};Object.defineProperty(jt,"__esModule",{value:!0});jt.Agent=void 0;var Y0=db(require("net")),cb=db(require("http")),X0=require("https");J0(ub(),jt);var Ar=Symbol("AgentBaseInternalState"),_d=class extends cb.Agent{static{o(this,"Agent")}constructor(e){super(e),this[Ar]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
8
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let r=new Y0.Socket({writable:!1});return this.sockets[e].push(r),this.totalSocketCount++,r}decrementSockets(e,r){if(!this.sockets[e]||r===null)return;let n=this.sockets[e],i=n.indexOf(r);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?X0.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,r,n){let i={...r,secureEndpoint:this.isSecureEndpoint(r)},s=this.getName(i),c=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(d=>{if(this.decrementSockets(s,c),d instanceof cb.Agent)try{return d.addRequest(e,i)}catch(l){return n(l)}this[Ar].currentSocket=d,super.createSocket(e,r,n)},d=>{this.decrementSockets(s,c),n(d)})}createConnection(){let e=this[Ar].currentSocket;if(this[Ar].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Ar].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Ar]&&(this[Ar].defaultPort=e)}get protocol(){return this[Ar].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Ar]&&(this[Ar].protocol=e)}};jt.Agent=_d});var fb=k(Wo=>{"use strict";var Q0=Wo&&Wo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.parseProxyResponse=void 0;var eC=Q0(yd()),Qs=(0,eC.default)("https-proxy-agent:parse-proxy-response");function tC(t){return new Promise((e,r)=>{let n=0,i=[];function s(){let f=t.read();f?p(f):t.once("readable",s)}o(s,"read");function c(){t.removeListener("end",d),t.removeListener("error",l),t.removeListener("readable",s)}o(c,"cleanup");function d(){c(),Qs("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}o(d,"onend");function l(f){c(),Qs("onerror %o",f),r(f)}o(l,"onerror");function p(f){i.push(f),n+=f.length;let _=Buffer.concat(i,n),h=_.indexOf(`\r
9
+ \r
10
+ `);if(h===-1){Qs("have not received end of HTTP headers yet..."),s();return}let g=_.slice(0,h).toString("ascii").split(`\r
11
+ `),y=g.shift();if(!y)return t.destroy(),r(new Error("No header received from proxy CONNECT response"));let T=y.split(" "),P=+T[1],x=T.slice(2).join(" "),N={};for(let L of g){if(!L)continue;let X=L.indexOf(":");if(X===-1)return t.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${L}"`));let W=L.slice(0,X).toLowerCase(),G=L.slice(X+1).trimStart(),K=N[W];typeof K=="string"?N[W]=[K,G]:Array.isArray(K)?K.push(G):N[W]=G}Qs("got proxy server response: %o %o",y,N),c(),e({connect:{statusCode:P,statusText:x,headers:N},buffered:_})}o(p,"ondata"),t.on("error",l),t.on("end",d),s()})}o(tC,"parseProxyResponse");Wo.parseProxyResponse=tC});var vb=k(rr=>{"use strict";var rC=rr&&rr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),nC=rr&&rr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yb=rr&&rr.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&rC(e,t,r);return nC(e,t),e},_b=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.HttpsProxyAgent=void 0;var eu=yb(require("net")),mb=yb(require("tls")),oC=_b(require("assert")),iC=_b(yd()),aC=pb(),sC=require("url"),uC=fb(),ea=(0,iC.default)("https-proxy-agent"),hb=o(t=>t.servername===void 0&&t.host&&!eu.isIP(t.host)?{...t,servername:t.host}:t,"setServernameFromNonIpHost"),tu=class extends aC.Agent{static{o(this,"HttpsProxyAgent")}constructor(e,r){super(r),this.options={path:void 0},this.proxy=typeof e=="string"?new sC.URL(e):e,this.proxyHeaders=r?.headers??{},ea("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?gb(r,"headers"):null,host:n,port:i}}async connect(e,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(ea("Creating `tls.Socket`: %o",this.connectOpts),i=mb.connect(hb(this.connectOpts))):(ea("Creating `net.Socket`: %o",this.connectOpts),i=eu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},c=eu.isIPv6(r.host)?`[${r.host}]`:r.host,d=`CONNECT ${c}:${r.port} HTTP/1.1\r
12
+ `;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}s.Host=`${c}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(s))d+=`${h}: ${s[h]}\r
13
+ `;let l=(0,uC.parseProxyResponse)(i);i.write(`${d}\r
14
+ `);let{connect:p,buffered:f}=await l;if(e.emit("proxyConnect",p),this.emit("proxyConnect",p,e),p.statusCode===200)return e.once("socket",cC),r.secureEndpoint?(ea("Upgrading socket connection to TLS"),mb.connect({...gb(hb(r),"host","path","port"),socket:i})):i;i.destroy();let _=new eu.Socket({writable:!1});return _.readable=!0,e.once("socket",h=>{ea("Replaying proxy buffer for failed request"),(0,oC.default)(h.listenerCount("data")>0),h.push(f),h.push(null)}),_}};tu.protocols=["http","https"];rr.HttpsProxyAgent=tu;function cC(t){t.resume()}o(cC,"resume");function gb(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(gb,"omit")});function lC(t){if(!/^data:/i.test(t))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');t=t.replace(/\r?\n/g,"");let e=t.indexOf(",");if(e===-1||e<=4)throw new TypeError("malformed data: URI");let r=t.substring(5,e).split(";"),n="",i=!1,s=r[0]||"text/plain",c=s;for(let f=1;f<r.length;f++)r[f]==="base64"?i=!0:r[f]&&(c+=`;${r[f]}`,r[f].indexOf("charset=")===0&&(n=r[f].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let d=i?"base64":"ascii",l=unescape(t.substring(e+1)),p=Buffer.from(l,d);return p.type=s,p.typeFull=c,p.charset=n,p}var bb,Pb=ht(()=>{o(lC,"dataUriToBuffer");bb=lC});var Eb=k((ru,Sb)=>{(function(t,e){typeof ru=="object"&&typeof Sb<"u"?e(ru):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})(ru,function(t){"use strict";function e(){}o(e,"noop");function r(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(r,"typeIsObject");let n=e;function i(a,u){try{Object.defineProperty(a,"name",{value:u,configurable:!0})}catch{}}o(i,"setFunctionName");let s=Promise,c=Promise.prototype.then,d=Promise.reject.bind(s);function l(a){return new s(a)}o(l,"newPromise");function p(a){return l(u=>u(a))}o(p,"promiseResolvedWith");function f(a){return d(a)}o(f,"promiseRejectedWith");function _(a,u,m){return c.call(a,u,m)}o(_,"PerformPromiseThen");function h(a,u,m){_(_(a,u,m),void 0,n)}o(h,"uponPromise");function g(a,u){h(a,u)}o(g,"uponFulfillment");function y(a,u){h(a,void 0,u)}o(y,"uponRejection");function T(a,u,m){return _(a,u,m)}o(T,"transformPromiseWith");function P(a){_(a,void 0,n)}o(P,"setPromiseIsHandledToTrue");let x=o(a=>{if(typeof queueMicrotask=="function")x=queueMicrotask;else{let u=p(void 0);x=o(m=>_(u,m),"_queueMicrotask")}return x(a)},"_queueMicrotask");function N(a,u,m){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,u,m)}o(N,"reflectCall");function L(a,u,m){try{return p(N(a,u,m))}catch(S){return f(S)}}o(L,"promiseCall");let X=16384;class W{static{o(this,"SimpleQueue")}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(u){let m=this._back,S=m;m._elements.length===X-1&&(S={_elements:[],_next:void 0}),m._elements.push(u),S!==m&&(this._back=S,m._next=S),++this._size}shift(){let u=this._front,m=u,S=this._cursor,A=S+1,M=u._elements,F=M[S];return A===X&&(m=u._next,A=0),--this._size,this._cursor=A,u!==m&&(this._front=m),M[S]=void 0,F}forEach(u){let m=this._cursor,S=this._front,A=S._elements;for(;(m!==A.length||S._next!==void 0)&&!(m===A.length&&(S=S._next,A=S._elements,m=0,A.length===0));)u(A[m]),++m}peek(){let u=this._front,m=this._cursor;return u._elements[m]}}let G=Symbol("[[AbortSteps]]"),K=Symbol("[[ErrorSteps]]"),ee=Symbol("[[CancelSteps]]"),Y=Symbol("[[PullSteps]]"),Se=Symbol("[[ReleaseSteps]]");function te(a,u){a._ownerReadableStream=u,u._reader=a,u._state==="readable"?Z(a):u._state==="closed"?oe(a):re(a,u._storedError)}o(te,"ReadableStreamReaderGenericInitialize");function q(a,u){let m=a._ownerReadableStream;return lr(m,u)}o(q,"ReadableStreamReaderGenericCancel");function B(a){let u=a._ownerReadableStream;u._state==="readable"?Ae(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Oe(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),u._readableStreamController[Se](),u._reader=void 0,a._ownerReadableStream=void 0}o(B,"ReadableStreamReaderGenericRelease");function J(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(J,"readerLockException");function Z(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m})}o(Z,"defaultReaderClosedPromiseInitialize");function re(a,u){Z(a),Ae(a,u)}o(re,"defaultReaderClosedPromiseInitializeAsRejected");function oe(a){Z(a),Fe(a)}o(oe,"defaultReaderClosedPromiseInitializeAsResolved");function Ae(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ae,"defaultReaderClosedPromiseReject");function Oe(a,u){re(a,u)}o(Oe,"defaultReaderClosedPromiseResetToRejected");function Fe(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Fe,"defaultReaderClosedPromiseResolve");let Ge=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},mt=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function Q(a){return typeof a=="object"||typeof a=="function"}o(Q,"isDictionary");function et(a,u){if(a!==void 0&&!Q(a))throw new TypeError(`${u} is not an object.`)}o(et,"assertDictionary");function it(a,u){if(typeof a!="function")throw new TypeError(`${u} is not a function.`)}o(it,"assertFunction");function Nt(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(Nt,"isObject");function Le(a,u){if(!Nt(a))throw new TypeError(`${u} is not an object.`)}o(Le,"assertObject");function Be(a,u,m){if(a===void 0)throw new TypeError(`Parameter ${u} is required in '${m}'.`)}o(Be,"assertRequiredArgument");function v(a,u,m){if(a===void 0)throw new TypeError(`${u} is required in '${m}'.`)}o(v,"assertRequiredField");function E(a){return Number(a)}o(E,"convertUnrestrictedDouble");function w(a){return a===0?0:a}o(w,"censorNegativeZero");function D(a){return w(mt(a))}o(D,"integerPart");function R(a,u){let S=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=w(A),!Ge(A))throw new TypeError(`${u} is not a finite number`);if(A=D(A),A<0||A>S)throw new TypeError(`${u} is outside the accepted range of 0 to ${S}, inclusive`);return!Ge(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,u){if(!hn(a))throw new TypeError(`${u} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new V(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,u){a._reader._readRequests.push(u)}o(I,"ReadableStreamAddReadRequest");function O(a,u,m){let A=a._reader._readRequests.shift();m?A._closeSteps():A._chunkSteps(u)}o(O,"ReadableStreamFulfillReadRequest");function U(a){return a._reader._readRequests.length}o(U,"ReadableStreamGetNumReadRequests");function z(a){let u=a._reader;return!(u===void 0||!ie(u))}o(z,"ReadableStreamHasDefaultReader");class V{static{o(this,"ReadableStreamDefaultReader")}constructor(u){if(Be(u,1,"ReadableStreamDefaultReader"),$(u,"First parameter"),gn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");te(this,u),this._readRequests=new W}get closed(){return ie(this)?this._closedPromise:f(Ye("closed"))}cancel(u=void 0){return ie(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Ye("cancel"))}read(){if(!ie(this))return f(Ye("read"));if(this._ownerReadableStream===void 0)return f(J("read from"));let u,m,S=l((M,F)=>{u=M,m=F});return se(this,{_chunkSteps:o(M=>u({value:M,done:!1}),"_chunkSteps"),_closeSteps:o(()=>u({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(M=>m(M),"_errorSteps")}),S}releaseLock(){if(!ie(this))throw Ye("releaseLock");this._ownerReadableStream!==void 0&&De(this)}}Object.defineProperties(V.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(V.prototype.cancel,"cancel"),i(V.prototype.read,"read"),i(V.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(V.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof V}o(ie,"IsReadableStreamDefaultReader");function se(a,u){let m=a._ownerReadableStream;m._disturbed=!0,m._state==="closed"?u._closeSteps():m._state==="errored"?u._errorSteps(m._storedError):m._readableStreamController[Y](u)}o(se,"ReadableStreamDefaultReaderRead");function De(a){B(a);let u=new TypeError("Reader was released");Je(a,u)}o(De,"ReadableStreamDefaultReaderRelease");function Je(a,u){let m=a._readRequests;a._readRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(Je,"ReadableStreamDefaultReaderErrorReadRequests");function Ye(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(Ye,"defaultReaderBrandCheckException");let ze=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class je{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(u,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=u,this._preventCancel=m}next(){let u=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,u,u):u(),this._ongoingPromise}return(u){let m=o(()=>this._returnSteps(u),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let u=this._reader,m,S,A=l((F,ne)=>{m=F,S=ne});return se(u,{_chunkSteps:o(F=>{this._ongoingPromise=void 0,x(()=>m({value:F,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(F=>{this._ongoingPromise=void 0,this._isFinished=!0,B(u),S(F)},"_errorSteps")}),A}_returnSteps(u){if(this._isFinished)return Promise.resolve({value:u,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let S=q(m,u);return B(m),T(S,()=>({value:u,done:!0}))}return B(m),p({value:u,done:!0})}}let lt={next(){return ho(this)?this._asyncIteratorImpl.next():f(go("next"))},return(a){return ho(this)?this._asyncIteratorImpl.return(a):f(go("return"))}};Object.setPrototypeOf(lt,ze);function mo(a,u){let m=j(a),S=new je(m,u),A=Object.create(lt);return A._asyncIteratorImpl=S,A}o(mo,"AcquireReadableStreamAsyncIterator");function ho(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof je}catch{return!1}}o(ho,"IsReadableStreamAsyncIterator");function go(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(go,"streamAsyncIteratorBrandCheckException");let zt=Number.isNaN||function(a){return a!==a};var Br,Pt,dt;function qe(a){return a.slice()}o(qe,"CreateArrayFromList");function lm(a,u,m,S,A){new Uint8Array(a).set(new Uint8Array(m,S,A),u)}o(lm,"CopyDataBlockBytes");let qr=o(a=>(typeof a.transfer=="function"?qr=o(u=>u.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?qr=o(u=>structuredClone(u,{transfer:[u]}),"TransferArrayBuffer"):qr=o(u=>u,"TransferArrayBuffer"),qr(a)),"TransferArrayBuffer"),dn=o(a=>(typeof a.detached=="boolean"?dn=o(u=>u.detached,"IsDetachedBuffer"):dn=o(u=>u.byteLength===0,"IsDetachedBuffer"),dn(a)),"IsDetachedBuffer");function dm(a,u,m){if(a.slice)return a.slice(u,m);let S=m-u,A=new ArrayBuffer(S);return lm(A,0,a,u,S),A}o(dm,"ArrayBufferSlice");function Fa(a,u){let m=a[u];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(u)} is not a function`);return m}}o(Fa,"GetMethod");function ix(a){let u={[Symbol.iterator]:()=>a.iterator},m=async function*(){return yield*u}(),S=m.next;return{iterator:m,nextMethod:S,done:!1}}o(ix,"CreateAsyncFromSyncIterator");let Ic=(dt=(Br=Symbol.asyncIterator)!==null&&Br!==void 0?Br:(Pt=Symbol.for)===null||Pt===void 0?void 0:Pt.call(Symbol,"Symbol.asyncIterator"))!==null&&dt!==void 0?dt:"@@asyncIterator";function pm(a,u="sync",m){if(m===void 0)if(u==="async"){if(m=Fa(a,Ic),m===void 0){let M=Fa(a,Symbol.iterator),F=pm(a,"sync",M);return ix(F)}}else m=Fa(a,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let S=N(m,a,[]);if(!r(S))throw new TypeError("The iterator method must return an object");let A=S.next;return{iterator:S,nextMethod:A,done:!1}}o(pm,"GetIterator");function ax(a){let u=N(a.nextMethod,a.iterator,[]);if(!r(u))throw new TypeError("The iterator.next() method must return an object");return u}o(ax,"IteratorNext");function sx(a){return!!a.done}o(sx,"IteratorComplete");function ux(a){return a.value}o(ux,"IteratorValue");function cx(a){return!(typeof a!="number"||zt(a)||a<0)}o(cx,"IsNonNegativeNumber");function fm(a){let u=dm(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(u)}o(fm,"CloneAsUint8Array");function Rc(a){let u=a._queue.shift();return a._queueTotalSize-=u.size,a._queueTotalSize<0&&(a._queueTotalSize=0),u.value}o(Rc,"DequeueValue");function Oc(a,u,m){if(!cx(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:u,size:m}),a._queueTotalSize+=m}o(Oc,"EnqueueValueWithSize");function lx(a){return a._queue.peek().value}o(lx,"PeekQueueValue");function pn(a){a._queue=new W,a._queueTotalSize=0}o(pn,"ResetQueue");function mm(a){return a===DataView}o(mm,"isDataViewConstructor");function dx(a){return mm(a.constructor)}o(dx,"isDataView");function px(a){return mm(a)?1:a.BYTES_PER_ELEMENT}o(px,"arrayBufferViewElementSize");class Fn{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Cc(this))throw Dc("view");return this._view}respond(u){if(!Cc(this))throw Dc("respond");if(Be(u,1,"respond"),u=R(u,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(dn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");Ha(this._associatedReadableByteStreamController,u)}respondWithNewView(u){if(!Cc(this))throw Dc("respondWithNewView");if(Be(u,1,"respondWithNewView"),!ArrayBuffer.isView(u))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");if(dn(u.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Ga(this._associatedReadableByteStreamController,u)}}Object.defineProperties(Fn.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i(Fn.prototype.respond,"respond"),i(Fn.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Fn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class Vr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Bn(this))throw bi("byobRequest");return zc(this)}get desiredSize(){if(!Bn(this))throw bi("desiredSize");return Tm(this)}close(){if(!Bn(this))throw bi("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let u=this._controlledReadableByteStream._state;if(u!=="readable")throw new TypeError(`The stream (in ${u} state) is not in the readable state and cannot be closed`);vi(this)}enqueue(u){if(!Bn(this))throw bi("enqueue");if(Be(u,1,"enqueue"),!ArrayBuffer.isView(u))throw new TypeError("chunk must be an array buffer view");if(u.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(u.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 m=this._controlledReadableByteStream._state;if(m!=="readable")throw new TypeError(`The stream (in ${m} state) is not in the readable state and cannot be enqueued to`);Va(this,u)}error(u=void 0){if(!Bn(this))throw bi("error");Yt(this,u)}[ee](u){hm(this),pn(this);let m=this._cancelAlgorithm(u);return qa(this),m}[Y](u){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){Em(this,u);return}let S=this._autoAllocateChunkSize;if(S!==void 0){let A;try{A=new ArrayBuffer(S)}catch(F){u._errorSteps(F);return}let M={buffer:A,bufferByteLength:S,byteOffset:0,byteLength:S,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(M)}I(m,u),qn(this)}[Se](){if(this._pendingPullIntos.length>0){let u=this._pendingPullIntos.peek();u.readerType="none",this._pendingPullIntos=new W,this._pendingPullIntos.push(u)}}}Object.defineProperties(Vr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Vr.prototype.close,"close"),i(Vr.prototype.enqueue,"enqueue"),i(Vr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Vr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Bn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof Vr}o(Bn,"IsReadableByteStreamController");function Cc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof Fn}o(Cc,"IsReadableStreamBYOBRequest");function qn(a){if(!yx(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,qn(a)),null),S=>(Yt(a,S),null))}o(qn,"ReadableByteStreamControllerCallPullIfNeeded");function hm(a){kc(a),a._pendingPullIntos=new W}o(hm,"ReadableByteStreamControllerClearPendingPullIntos");function $c(a,u){let m=!1;a._state==="closed"&&(m=!0);let S=gm(u);u.readerType==="default"?O(a,S,m):Ex(a,S,m)}o($c,"ReadableByteStreamControllerCommitPullIntoDescriptor");function gm(a){let u=a.bytesFilled,m=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,u/m)}o(gm,"ReadableByteStreamControllerConvertPullIntoDescriptor");function Ba(a,u,m,S){a._queue.push({buffer:u,byteOffset:m,byteLength:S}),a._queueTotalSize+=S}o(Ba,"ReadableByteStreamControllerEnqueueChunkToQueue");function ym(a,u,m,S){let A;try{A=dm(u,m,m+S)}catch(M){throw Yt(a,M),M}Ba(a,A,0,S)}o(ym,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function _m(a,u){u.bytesFilled>0&&ym(a,u.buffer,u.byteOffset,u.bytesFilled),yo(a)}o(_m,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function vm(a,u){let m=Math.min(a._queueTotalSize,u.byteLength-u.bytesFilled),S=u.bytesFilled+m,A=m,M=!1,F=S%u.elementSize,ne=S-F;ne>=u.minimumFill&&(A=ne-u.bytesFilled,M=!0);let he=a._queue;for(;A>0;){let le=he.peek(),Ee=Math.min(A,le.byteLength),Ce=u.byteOffset+u.bytesFilled;lm(u.buffer,Ce,le.buffer,le.byteOffset,Ee),le.byteLength===Ee?he.shift():(le.byteOffset+=Ee,le.byteLength-=Ee),a._queueTotalSize-=Ee,bm(a,Ee,u),A-=Ee}return M}o(vm,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function bm(a,u,m){m.bytesFilled+=u}o(bm,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function Pm(a){a._queueTotalSize===0&&a._closeRequested?(qa(a),wi(a._controlledReadableByteStream)):qn(a)}o(Pm,"ReadableByteStreamControllerHandleQueueDrain");function kc(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(kc,"ReadableByteStreamControllerInvalidateBYOBRequest");function Nc(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let u=a._pendingPullIntos.peek();vm(a,u)&&(yo(a),$c(a._controlledReadableByteStream,u))}}o(Nc,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function fx(a){let u=a._controlledReadableByteStream._reader;for(;u._readRequests.length>0;){if(a._queueTotalSize===0)return;let m=u._readRequests.shift();Em(a,m)}}o(fx,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function mx(a,u,m,S){let A=a._controlledReadableByteStream,M=u.constructor,F=px(M),{byteOffset:ne,byteLength:he}=u,le=m*F,Ee;try{Ee=qr(u.buffer)}catch(We){S._errorSteps(We);return}let Ce={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:ne,byteLength:he,bytesFilled:0,minimumFill:le,elementSize:F,viewConstructor:M,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(Ce),Am(A,S);return}if(A._state==="closed"){let We=new M(Ce.buffer,Ce.byteOffset,0);S._closeSteps(We);return}if(a._queueTotalSize>0){if(vm(a,Ce)){let We=gm(Ce);Pm(a),S._chunkSteps(We);return}if(a._closeRequested){let We=new TypeError("Insufficient bytes to fill elements in the given buffer");Yt(a,We),S._errorSteps(We);return}}a._pendingPullIntos.push(Ce),Am(A,S),qn(a)}o(mx,"ReadableByteStreamControllerPullInto");function hx(a,u){u.readerType==="none"&&yo(a);let m=a._controlledReadableByteStream;if(Uc(m))for(;Im(m)>0;){let S=yo(a);$c(m,S)}}o(hx,"ReadableByteStreamControllerRespondInClosedState");function gx(a,u,m){if(bm(a,u,m),m.readerType==="none"){_m(a,m),Nc(a);return}if(m.bytesFilled<m.minimumFill)return;yo(a);let S=m.bytesFilled%m.elementSize;if(S>0){let A=m.byteOffset+m.bytesFilled;ym(a,m.buffer,A-S,S)}m.bytesFilled-=S,$c(a._controlledReadableByteStream,m),Nc(a)}o(gx,"ReadableByteStreamControllerRespondInReadableState");function Sm(a,u){let m=a._pendingPullIntos.peek();kc(a),a._controlledReadableByteStream._state==="closed"?hx(a,m):gx(a,u,m),qn(a)}o(Sm,"ReadableByteStreamControllerRespondInternal");function yo(a){return a._pendingPullIntos.shift()}o(yo,"ReadableByteStreamControllerShiftPendingPullInto");function yx(a){let u=a._controlledReadableByteStream;return u._state!=="readable"||a._closeRequested||!a._started?!1:!!(z(u)&&U(u)>0||Uc(u)&&Im(u)>0||Tm(a)>0)}o(yx,"ReadableByteStreamControllerShouldCallPull");function qa(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(qa,"ReadableByteStreamControllerClearAlgorithms");function vi(a){let u=a._controlledReadableByteStream;if(!(a._closeRequested||u._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let m=a._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let S=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Yt(a,S),S}}qa(a),wi(u)}}o(vi,"ReadableByteStreamControllerClose");function Va(a,u){let m=a._controlledReadableByteStream;if(a._closeRequested||m._state!=="readable")return;let{buffer:S,byteOffset:A,byteLength:M}=u;if(dn(S))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let F=qr(S);if(a._pendingPullIntos.length>0){let ne=a._pendingPullIntos.peek();if(dn(ne.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");kc(a),ne.buffer=qr(ne.buffer),ne.readerType==="none"&&_m(a,ne)}if(z(m))if(fx(a),U(m)===0)Ba(a,F,A,M);else{a._pendingPullIntos.length>0&&yo(a);let ne=new Uint8Array(F,A,M);O(m,ne,!1)}else Uc(m)?(Ba(a,F,A,M),Nc(a)):Ba(a,F,A,M);qn(a)}o(Va,"ReadableByteStreamControllerEnqueue");function Yt(a,u){let m=a._controlledReadableByteStream;m._state==="readable"&&(hm(a),pn(a),qa(a),Xm(m,u))}o(Yt,"ReadableByteStreamControllerError");function Em(a,u){let m=a._queue.shift();a._queueTotalSize-=m.byteLength,Pm(a);let S=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);u._chunkSteps(S)}o(Em,"ReadableByteStreamControllerFillReadRequestFromQueue");function zc(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let u=a._pendingPullIntos.peek(),m=new Uint8Array(u.buffer,u.byteOffset+u.bytesFilled,u.byteLength-u.bytesFilled),S=Object.create(Fn.prototype);vx(S,a,m),a._byobRequest=S}return a._byobRequest}o(zc,"ReadableByteStreamControllerGetBYOBRequest");function Tm(a){let u=a._controlledReadableByteStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Tm,"ReadableByteStreamControllerGetDesiredSize");function Ha(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(u===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+u>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=qr(m.buffer),Sm(a,u)}o(Ha,"ReadableByteStreamControllerRespond");function Ga(a,u){let m=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(u.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(u.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(m.byteOffset+m.bytesFilled!==u.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==u.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+u.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=u.byteLength;m.buffer=qr(u.buffer),Sm(a,A)}o(Ga,"ReadableByteStreamControllerRespondWithNewView");function xm(a,u,m,S,A,M,F){u._controlledReadableByteStream=a,u._pullAgain=!1,u._pulling=!1,u._byobRequest=null,u._queue=u._queueTotalSize=void 0,pn(u),u._closeRequested=!1,u._started=!1,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=A,u._autoAllocateChunkSize=F,u._pendingPullIntos=new W,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,qn(u),null),he=>(Yt(u,he),null))}o(xm,"SetUpReadableByteStreamController");function _x(a,u,m){let S=Object.create(Vr.prototype),A,M,F;u.start!==void 0?A=o(()=>u.start(S),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),u.pull!==void 0?M=o(()=>u.pull(S),"pullAlgorithm"):M=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?F=o(he=>u.cancel(he),"cancelAlgorithm"):F=o(()=>p(void 0),"cancelAlgorithm");let ne=u.autoAllocateChunkSize;if(ne===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");xm(a,S,A,M,F,m,ne)}o(_x,"SetUpReadableByteStreamControllerFromUnderlyingSource");function vx(a,u,m){a._associatedReadableByteStreamController=u,a._view=m}o(vx,"SetUpReadableStreamBYOBRequest");function Dc(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(Dc,"byobRequestBrandCheckException");function bi(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(bi,"byteStreamControllerBrandCheckException");function bx(a,u){et(a,u);let m=a?.mode;return{mode:m===void 0?void 0:Px(m,`${u} has member 'mode' that`)}}o(bx,"convertReaderOptions");function Px(a,u){if(a=`${a}`,a!=="byob")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(Px,"convertReadableStreamReaderMode");function Sx(a,u){var m;et(a,u);let S=(m=a?.min)!==null&&m!==void 0?m:1;return{min:R(S,`${u} has member 'min' that`)}}o(Sx,"convertByobReadOptions");function wm(a){return new fn(a)}o(wm,"AcquireReadableStreamBYOBReader");function Am(a,u){a._reader._readIntoRequests.push(u)}o(Am,"ReadableStreamAddReadIntoRequest");function Ex(a,u,m){let A=a._reader._readIntoRequests.shift();m?A._closeSteps(u):A._chunkSteps(u)}o(Ex,"ReadableStreamFulfillReadIntoRequest");function Im(a){return a._reader._readIntoRequests.length}o(Im,"ReadableStreamGetNumReadIntoRequests");function Uc(a){let u=a._reader;return!(u===void 0||!Vn(u))}o(Uc,"ReadableStreamHasBYOBReader");class fn{static{o(this,"ReadableStreamBYOBReader")}constructor(u){if(Be(u,1,"ReadableStreamBYOBReader"),$(u,"First parameter"),gn(u))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Bn(u._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");te(this,u),this._readIntoRequests=new W}get closed(){return Vn(this)?this._closedPromise:f(Wa("closed"))}cancel(u=void 0){return Vn(this)?this._ownerReadableStream===void 0?f(J("cancel")):q(this,u):f(Wa("cancel"))}read(u,m={}){if(!Vn(this))return f(Wa("read"));if(!ArrayBuffer.isView(u))return f(new TypeError("view must be an array buffer view"));if(u.byteLength===0)return f(new TypeError("view must have non-zero byteLength"));if(u.buffer.byteLength===0)return f(new TypeError("view's buffer must have non-zero byteLength"));if(dn(u.buffer))return f(new TypeError("view's buffer has been detached"));let S;try{S=Sx(m,"options")}catch(le){return f(le)}let A=S.min;if(A===0)return f(new TypeError("options.min must be greater than 0"));if(dx(u)){if(A>u.byteLength)return f(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>u.length)return f(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return f(J("read from"));let M,F,ne=l((le,Ee)=>{M=le,F=Ee});return Rm(this,u,A,{_chunkSteps:o(le=>M({value:le,done:!1}),"_chunkSteps"),_closeSteps:o(le=>M({value:le,done:!0}),"_closeSteps"),_errorSteps:o(le=>F(le),"_errorSteps")}),ne}releaseLock(){if(!Vn(this))throw Wa("releaseLock");this._ownerReadableStream!==void 0&&Tx(this)}}Object.defineProperties(fn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(fn.prototype.cancel,"cancel"),i(fn.prototype.read,"read"),i(fn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Vn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof fn}o(Vn,"IsReadableStreamBYOBReader");function Rm(a,u,m,S){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?S._errorSteps(A._storedError):mx(A._readableStreamController,u,m,S)}o(Rm,"ReadableStreamBYOBReaderRead");function Tx(a){B(a);let u=new TypeError("Reader was released");Om(a,u)}o(Tx,"ReadableStreamBYOBReaderRelease");function Om(a,u){let m=a._readIntoRequests;a._readIntoRequests=new W,m.forEach(S=>{S._errorSteps(u)})}o(Om,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Wa(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Wa,"byobReaderBrandCheckException");function Pi(a,u){let{highWaterMark:m}=a;if(m===void 0)return u;if(zt(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}o(Pi,"ExtractHighWaterMark");function Za(a){let{size:u}=a;return u||(()=>1)}o(Za,"ExtractSizeAlgorithm");function Ka(a,u){et(a,u);let m=a?.highWaterMark,S=a?.size;return{highWaterMark:m===void 0?void 0:E(m),size:S===void 0?void 0:xx(S,`${u} has member 'size' that`)}}o(Ka,"convertQueuingStrategy");function xx(a,u){return it(a,u),m=>E(a(m))}o(xx,"convertQueuingStrategySize");function wx(a,u){et(a,u);let m=a?.abort,S=a?.close,A=a?.start,M=a?.type,F=a?.write;return{abort:m===void 0?void 0:Ax(m,a,`${u} has member 'abort' that`),close:S===void 0?void 0:Ix(S,a,`${u} has member 'close' that`),start:A===void 0?void 0:Rx(A,a,`${u} has member 'start' that`),write:F===void 0?void 0:Ox(F,a,`${u} has member 'write' that`),type:M}}o(wx,"convertUnderlyingSink");function Ax(a,u,m){return it(a,m),S=>L(a,u,[S])}o(Ax,"convertUnderlyingSinkAbortCallback");function Ix(a,u,m){return it(a,m),()=>L(a,u,[])}o(Ix,"convertUnderlyingSinkCloseCallback");function Rx(a,u,m){return it(a,m),S=>N(a,u,[S])}o(Rx,"convertUnderlyingSinkStartCallback");function Ox(a,u,m){return it(a,m),(S,A)=>L(a,u,[S,A])}o(Ox,"convertUnderlyingSinkWriteCallback");function Cm(a,u){if(!_o(a))throw new TypeError(`${u} is not a WritableStream.`)}o(Cm,"assertWritableStream");function Cx(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(Cx,"isAbortSignal");let $x=typeof AbortController=="function";function kx(){if($x)return new AbortController}o(kx,"createAbortController");class mn{static{o(this,"WritableStream")}constructor(u={},m={}){u===void 0?u=null:Le(u,"First parameter");let S=Ka(m,"Second parameter"),A=wx(u,"First parameter");if(km(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let F=Za(S),ne=Pi(S,1);Wx(this,A,ne,F)}get locked(){if(!_o(this))throw es("locked");return vo(this)}abort(u=void 0){return _o(this)?vo(this)?f(new TypeError("Cannot abort a stream that already has a writer")):Ja(this,u):f(es("abort"))}close(){return _o(this)?vo(this)?f(new TypeError("Cannot close a stream that already has a writer")):Tr(this)?f(new TypeError("Cannot close an already-closing stream")):Nm(this):f(es("close"))}getWriter(){if(!_o(this))throw es("getWriter");return $m(this)}}Object.defineProperties(mn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(mn.prototype.abort,"abort"),i(mn.prototype.close,"close"),i(mn.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(mn.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function $m(a){return new Hr(a)}o($m,"AcquireWritableStreamDefaultWriter");function Nx(a,u,m,S,A=1,M=()=>1){let F=Object.create(mn.prototype);km(F);let ne=Object.create(bo.prototype);return Lm(F,ne,a,u,m,S,A,M),F}o(Nx,"CreateWritableStream");function km(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new W,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(km,"InitializeWritableStream");function _o(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof mn}o(_o,"IsWritableStream");function vo(a){return a._writer!==void 0}o(vo,"IsWritableStreamLocked");function Ja(a,u){var m;if(a._state==="closed"||a._state==="errored")return p(void 0);a._writableStreamController._abortReason=u,(m=a._writableStreamController._abortController)===null||m===void 0||m.abort(u);let S=a._state;if(S==="closed"||S==="errored")return p(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;S==="erroring"&&(A=!0,u=void 0);let M=l((F,ne)=>{a._pendingAbortRequest={_promise:void 0,_resolve:F,_reject:ne,_reason:u,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=M,A||jc(a,u),M}o(Ja,"WritableStreamAbort");function Nm(a){let u=a._state;if(u==="closed"||u==="errored")return f(new TypeError(`The stream (in ${u} state) is not in the writable state and cannot be closed`));let m=l((A,M)=>{let F={_resolve:A,_reject:M};a._closeRequest=F}),S=a._writer;return S!==void 0&&a._backpressure&&u==="writable"&&Wc(S),Zx(a._writableStreamController),m}o(Nm,"WritableStreamClose");function zx(a){return l((m,S)=>{let A={_resolve:m,_reject:S};a._writeRequests.push(A)})}o(zx,"WritableStreamAddWriteRequest");function Mc(a,u){if(a._state==="writable"){jc(a,u);return}Lc(a)}o(Mc,"WritableStreamDealWithRejection");function jc(a,u){let m=a._writableStreamController;a._state="erroring",a._storedError=u;let S=a._writer;S!==void 0&&Dm(S,u),!Lx(a)&&m._started&&Lc(a)}o(jc,"WritableStreamStartErroring");function Lc(a){a._state="errored",a._writableStreamController[K]();let u=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(u)}),a._writeRequests=new W,a._pendingAbortRequest===void 0){Ya(a);return}let m=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(u),Ya(a);return}let S=a._writableStreamController[G](m._reason);h(S,()=>(m._resolve(),Ya(a),null),A=>(m._reject(A),Ya(a),null))}o(Lc,"WritableStreamFinishErroring");function Dx(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(Dx,"WritableStreamFinishInFlightWrite");function Ux(a,u){a._inFlightWriteRequest._reject(u),a._inFlightWriteRequest=void 0,Mc(a,u)}o(Ux,"WritableStreamFinishInFlightWriteWithError");function Mx(a){a._inFlightCloseRequest._resolve(void 0),a._inFlightCloseRequest=void 0,a._state==="erroring"&&(a._storedError=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._resolve(),a._pendingAbortRequest=void 0)),a._state="closed";let m=a._writer;m!==void 0&&Vm(m)}o(Mx,"WritableStreamFinishInFlightClose");function jx(a,u){a._inFlightCloseRequest._reject(u),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(u),a._pendingAbortRequest=void 0),Mc(a,u)}o(jx,"WritableStreamFinishInFlightCloseWithError");function Tr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Tr,"WritableStreamCloseQueuedOrInFlight");function Lx(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(Lx,"WritableStreamHasOperationMarkedInFlight");function Fx(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(Fx,"WritableStreamMarkCloseRequestInFlight");function Bx(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(Bx,"WritableStreamMarkFirstWriteRequestInFlight");function Ya(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let u=a._writer;u!==void 0&&Hc(u,a._storedError)}o(Ya,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Fc(a,u){let m=a._writer;m!==void 0&&u!==a._backpressure&&(u?tw(m):Wc(m)),a._backpressure=u}o(Fc,"WritableStreamUpdateBackpressure");class Hr{static{o(this,"WritableStreamDefaultWriter")}constructor(u){if(Be(u,1,"WritableStreamDefaultWriter"),Cm(u,"First parameter"),vo(u))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=u,u._writer=this;let m=u._state;if(m==="writable")!Tr(u)&&u._backpressure?rs(this):Hm(this),ts(this);else if(m==="erroring")Gc(this,u._storedError),ts(this);else if(m==="closed")Hm(this),Qx(this);else{let S=u._storedError;Gc(this,S),qm(this,S)}}get closed(){return Hn(this)?this._closedPromise:f(Gn("closed"))}get desiredSize(){if(!Hn(this))throw Gn("desiredSize");if(this._ownerWritableStream===void 0)throw Ei("desiredSize");return Gx(this)}get ready(){return Hn(this)?this._readyPromise:f(Gn("ready"))}abort(u=void 0){return Hn(this)?this._ownerWritableStream===void 0?f(Ei("abort")):qx(this,u):f(Gn("abort"))}close(){if(!Hn(this))return f(Gn("close"));let u=this._ownerWritableStream;return u===void 0?f(Ei("close")):Tr(u)?f(new TypeError("Cannot close an already-closing stream")):zm(this)}releaseLock(){if(!Hn(this))throw Gn("releaseLock");this._ownerWritableStream!==void 0&&Um(this)}write(u=void 0){return Hn(this)?this._ownerWritableStream===void 0?f(Ei("write to")):Mm(this,u):f(Gn("write"))}}Object.defineProperties(Hr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Hr.prototype.abort,"abort"),i(Hr.prototype.close,"close"),i(Hr.prototype.releaseLock,"releaseLock"),i(Hr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Hn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Hr}o(Hn,"IsWritableStreamDefaultWriter");function qx(a,u){let m=a._ownerWritableStream;return Ja(m,u)}o(qx,"WritableStreamDefaultWriterAbort");function zm(a){let u=a._ownerWritableStream;return Nm(u)}o(zm,"WritableStreamDefaultWriterClose");function Vx(a){let u=a._ownerWritableStream,m=u._state;return Tr(u)||m==="closed"?p(void 0):m==="errored"?f(u._storedError):zm(a)}o(Vx,"WritableStreamDefaultWriterCloseWithErrorPropagation");function Hx(a,u){a._closedPromiseState==="pending"?Hc(a,u):ew(a,u)}o(Hx,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function Dm(a,u){a._readyPromiseState==="pending"?Gm(a,u):rw(a,u)}o(Dm,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function Gx(a){let u=a._ownerWritableStream,m=u._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:Fm(u._writableStreamController)}o(Gx,"WritableStreamDefaultWriterGetDesiredSize");function Um(a){let u=a._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");Dm(a,m),Hx(a,m),u._writer=void 0,a._ownerWritableStream=void 0}o(Um,"WritableStreamDefaultWriterRelease");function Mm(a,u){let m=a._ownerWritableStream,S=m._writableStreamController,A=Kx(S,u);if(m!==a._ownerWritableStream)return f(Ei("write to"));let M=m._state;if(M==="errored")return f(m._storedError);if(Tr(m)||M==="closed")return f(new TypeError("The stream is closing or closed and cannot be written to"));if(M==="erroring")return f(m._storedError);let F=zx(m);return Jx(S,u,A),F}o(Mm,"WritableStreamDefaultWriterWrite");let jm={};class bo{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Bc(this))throw Vc("abortReason");return this._abortReason}get signal(){if(!Bc(this))throw Vc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(u=void 0){if(!Bc(this))throw Vc("error");this._controlledWritableStream._state==="writable"&&Bm(this,u)}[G](u){let m=this._abortAlgorithm(u);return Xa(this),m}[K](){pn(this)}}Object.defineProperties(bo.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bo.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Bc(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof bo}o(Bc,"IsWritableStreamDefaultController");function Lm(a,u,m,S,A,M,F,ne){u._controlledWritableStream=a,a._writableStreamController=u,u._queue=void 0,u._queueTotalSize=void 0,pn(u),u._abortReason=void 0,u._abortController=kx(),u._started=!1,u._strategySizeAlgorithm=ne,u._strategyHWM=F,u._writeAlgorithm=S,u._closeAlgorithm=A,u._abortAlgorithm=M;let he=qc(u);Fc(a,he);let le=m(),Ee=p(le);h(Ee,()=>(u._started=!0,Qa(u),null),Ce=>(u._started=!0,Mc(a,Ce),null))}o(Lm,"SetUpWritableStreamDefaultController");function Wx(a,u,m,S){let A=Object.create(bo.prototype),M,F,ne,he;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.write!==void 0?F=o(le=>u.write(le,A),"writeAlgorithm"):F=o(()=>p(void 0),"writeAlgorithm"),u.close!==void 0?ne=o(()=>u.close(),"closeAlgorithm"):ne=o(()=>p(void 0),"closeAlgorithm"),u.abort!==void 0?he=o(le=>u.abort(le),"abortAlgorithm"):he=o(()=>p(void 0),"abortAlgorithm"),Lm(a,A,M,F,ne,he,m,S)}o(Wx,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function Xa(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(Xa,"WritableStreamDefaultControllerClearAlgorithms");function Zx(a){Oc(a,jm,0),Qa(a)}o(Zx,"WritableStreamDefaultControllerClose");function Kx(a,u){try{return a._strategySizeAlgorithm(u)}catch(m){return Si(a,m),1}}o(Kx,"WritableStreamDefaultControllerGetChunkSize");function Fm(a){return a._strategyHWM-a._queueTotalSize}o(Fm,"WritableStreamDefaultControllerGetDesiredSize");function Jx(a,u,m){try{Oc(a,u,m)}catch(A){Si(a,A);return}let S=a._controlledWritableStream;if(!Tr(S)&&S._state==="writable"){let A=qc(a);Fc(S,A)}Qa(a)}o(Jx,"WritableStreamDefaultControllerWrite");function Qa(a){let u=a._controlledWritableStream;if(!a._started||u._inFlightWriteRequest!==void 0)return;if(u._state==="erroring"){Lc(u);return}if(a._queue.length===0)return;let S=lx(a);S===jm?Yx(a):Xx(a,S)}o(Qa,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function Si(a,u){a._controlledWritableStream._state==="writable"&&Bm(a,u)}o(Si,"WritableStreamDefaultControllerErrorIfNeeded");function Yx(a){let u=a._controlledWritableStream;Fx(u),Rc(a);let m=a._closeAlgorithm();Xa(a),h(m,()=>(Mx(u),null),S=>(jx(u,S),null))}o(Yx,"WritableStreamDefaultControllerProcessClose");function Xx(a,u){let m=a._controlledWritableStream;Bx(m);let S=a._writeAlgorithm(u);h(S,()=>{Dx(m);let A=m._state;if(Rc(a),!Tr(m)&&A==="writable"){let M=qc(a);Fc(m,M)}return Qa(a),null},A=>(m._state==="writable"&&Xa(a),Ux(m,A),null))}o(Xx,"WritableStreamDefaultControllerProcessWrite");function qc(a){return Fm(a)<=0}o(qc,"WritableStreamDefaultControllerGetBackpressure");function Bm(a,u){let m=a._controlledWritableStream;Xa(a),jc(m,u)}o(Bm,"WritableStreamDefaultControllerError");function es(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(es,"streamBrandCheckException$2");function Vc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(Vc,"defaultControllerBrandCheckException$2");function Gn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(Gn,"defaultWriterBrandCheckException");function Ei(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(Ei,"defaultWriterLockException");function ts(a){a._closedPromise=l((u,m)=>{a._closedPromise_resolve=u,a._closedPromise_reject=m,a._closedPromiseState="pending"})}o(ts,"defaultWriterClosedPromiseInitialize");function qm(a,u){ts(a),Hc(a,u)}o(qm,"defaultWriterClosedPromiseInitializeAsRejected");function Qx(a){ts(a),Vm(a)}o(Qx,"defaultWriterClosedPromiseInitializeAsResolved");function Hc(a,u){a._closedPromise_reject!==void 0&&(P(a._closedPromise),a._closedPromise_reject(u),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(Hc,"defaultWriterClosedPromiseReject");function ew(a,u){qm(a,u)}o(ew,"defaultWriterClosedPromiseResetToRejected");function Vm(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="resolved")}o(Vm,"defaultWriterClosedPromiseResolve");function rs(a){a._readyPromise=l((u,m)=>{a._readyPromise_resolve=u,a._readyPromise_reject=m}),a._readyPromiseState="pending"}o(rs,"defaultWriterReadyPromiseInitialize");function Gc(a,u){rs(a),Gm(a,u)}o(Gc,"defaultWriterReadyPromiseInitializeAsRejected");function Hm(a){rs(a),Wc(a)}o(Hm,"defaultWriterReadyPromiseInitializeAsResolved");function Gm(a,u){a._readyPromise_reject!==void 0&&(P(a._readyPromise),a._readyPromise_reject(u),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(Gm,"defaultWriterReadyPromiseReject");function tw(a){rs(a)}o(tw,"defaultWriterReadyPromiseReset");function rw(a,u){Gc(a,u)}o(rw,"defaultWriterReadyPromiseResetToRejected");function Wc(a){a._readyPromise_resolve!==void 0&&(a._readyPromise_resolve(void 0),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="fulfilled")}o(Wc,"defaultWriterReadyPromiseResolve");function nw(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(nw,"getGlobals");let Zc=nw();function ow(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(ow,"isDOMExceptionConstructor");function iw(){let a=Zc?.DOMException;return ow(a)?a:void 0}o(iw,"getFromGlobal");function aw(){let a=o(function(m,S){this.message=m||"",this.name=S||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return i(a,"DOMException"),a.prototype=Object.create(Error.prototype),Object.defineProperty(a.prototype,"constructor",{value:a,writable:!0,configurable:!0}),a}o(aw,"createPolyfill");let sw=iw()||aw();function Wm(a,u,m,S,A,M){let F=j(a),ne=$m(u);a._disturbed=!0;let he=!1,le=p(void 0);return l((Ee,Ce)=>{let We;if(M!==void 0){if(We=o(()=>{let de=M.reason!==void 0?M.reason:new sw("Aborted","AbortError"),Ne=[];S||Ne.push(()=>u._state==="writable"?Ja(u,de):p(void 0)),A||Ne.push(()=>a._state==="readable"?lr(a,de):p(void 0)),It(()=>Promise.all(Ne.map(Ze=>Ze())),!0,de)},"abortAlgorithm"),M.aborted){We();return}M.addEventListener("abort",We)}function dr(){return l((de,Ne)=>{function Ze(Dt){Dt?de():_(To(),Ze,Ne)}o(Ze,"next"),Ze(!1)})}o(dr,"pipeLoop");function To(){return he?p(!0):_(ne._readyPromise,()=>l((de,Ne)=>{se(F,{_chunkSteps:o(Ze=>{le=_(Mm(ne,Ze),void 0,e),de(!1)},"_chunkSteps"),_closeSteps:o(()=>de(!0),"_closeSteps"),_errorSteps:Ne})}))}if(o(To,"pipeStep"),Wr(a,F._closedPromise,de=>(S?Xt(!0,de):It(()=>Ja(u,de),!0,de),null)),Wr(u,ne._closedPromise,de=>(A?Xt(!0,de):It(()=>lr(a,de),!0,de),null)),Tt(a,F._closedPromise,()=>(m?Xt():It(()=>Vx(ne)),null)),Tr(u)||u._state==="closed"){let de=new TypeError("the destination writable stream closed before all data could be piped to it");A?Xt(!0,de):It(()=>lr(a,de),!0,de)}P(dr());function _n(){let de=le;return _(le,()=>de!==le?_n():void 0)}o(_n,"waitForWritesToFinish");function Wr(de,Ne,Ze){de._state==="errored"?Ze(de._storedError):y(Ne,Ze)}o(Wr,"isOrBecomesErrored");function Tt(de,Ne,Ze){de._state==="closed"?Ze():g(Ne,Ze)}o(Tt,"isOrBecomesClosed");function It(de,Ne,Ze){if(he)return;he=!0,u._state==="writable"&&!Tr(u)?g(_n(),Dt):Dt();function Dt(){return h(de(),()=>Zr(Ne,Ze),xo=>Zr(!0,xo)),null}o(Dt,"doTheRest")}o(It,"shutdownWithAction");function Xt(de,Ne){he||(he=!0,u._state==="writable"&&!Tr(u)?g(_n(),()=>Zr(de,Ne)):Zr(de,Ne))}o(Xt,"shutdown");function Zr(de,Ne){return Um(ne),B(F),M!==void 0&&M.removeEventListener("abort",We),de?Ce(Ne):Ee(void 0),null}o(Zr,"finalize")})}o(Wm,"ReadableStreamPipeTo");class Gr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ns(this))throw is("desiredSize");return Kc(this)}close(){if(!ns(this))throw is("close");if(!So(this))throw new TypeError("The stream is not in a state that permits close");Wn(this)}enqueue(u=void 0){if(!ns(this))throw is("enqueue");if(!So(this))throw new TypeError("The stream is not in a state that permits enqueue");return Po(this,u)}error(u=void 0){if(!ns(this))throw is("error");cr(this,u)}[ee](u){pn(this);let m=this._cancelAlgorithm(u);return os(this),m}[Y](u){let m=this._controlledReadableStream;if(this._queue.length>0){let S=Rc(this);this._closeRequested&&this._queue.length===0?(os(this),wi(m)):Ti(this),u._chunkSteps(S)}else I(m,u),Ti(this)}[Se](){}}Object.defineProperties(Gr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Gr.prototype.close,"close"),i(Gr.prototype.enqueue,"enqueue"),i(Gr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Gr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function ns(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Gr}o(ns,"IsReadableStreamDefaultController");function Ti(a){if(!Zm(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let m=a._pullAlgorithm();h(m,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,Ti(a)),null),S=>(cr(a,S),null))}o(Ti,"ReadableStreamDefaultControllerCallPullIfNeeded");function Zm(a){let u=a._controlledReadableStream;return!So(a)||!a._started?!1:!!(gn(u)&&U(u)>0||Kc(a)>0)}o(Zm,"ReadableStreamDefaultControllerShouldCallPull");function os(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(os,"ReadableStreamDefaultControllerClearAlgorithms");function Wn(a){if(!So(a))return;let u=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(os(a),wi(u))}o(Wn,"ReadableStreamDefaultControllerClose");function Po(a,u){if(!So(a))return;let m=a._controlledReadableStream;if(gn(m)&&U(m)>0)O(m,u,!1);else{let S;try{S=a._strategySizeAlgorithm(u)}catch(A){throw cr(a,A),A}try{Oc(a,u,S)}catch(A){throw cr(a,A),A}}Ti(a)}o(Po,"ReadableStreamDefaultControllerEnqueue");function cr(a,u){let m=a._controlledReadableStream;m._state==="readable"&&(pn(a),os(a),Xm(m,u))}o(cr,"ReadableStreamDefaultControllerError");function Kc(a){let u=a._controlledReadableStream._state;return u==="errored"?null:u==="closed"?0:a._strategyHWM-a._queueTotalSize}o(Kc,"ReadableStreamDefaultControllerGetDesiredSize");function uw(a){return!Zm(a)}o(uw,"ReadableStreamDefaultControllerHasBackpressure");function So(a){let u=a._controlledReadableStream._state;return!a._closeRequested&&u==="readable"}o(So,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Km(a,u,m,S,A,M,F){u._controlledReadableStream=a,u._queue=void 0,u._queueTotalSize=void 0,pn(u),u._started=!1,u._closeRequested=!1,u._pullAgain=!1,u._pulling=!1,u._strategySizeAlgorithm=F,u._strategyHWM=M,u._pullAlgorithm=S,u._cancelAlgorithm=A,a._readableStreamController=u;let ne=m();h(p(ne),()=>(u._started=!0,Ti(u),null),he=>(cr(u,he),null))}o(Km,"SetUpReadableStreamDefaultController");function cw(a,u,m,S){let A=Object.create(Gr.prototype),M,F,ne;u.start!==void 0?M=o(()=>u.start(A),"startAlgorithm"):M=o(()=>{},"startAlgorithm"),u.pull!==void 0?F=o(()=>u.pull(A),"pullAlgorithm"):F=o(()=>p(void 0),"pullAlgorithm"),u.cancel!==void 0?ne=o(he=>u.cancel(he),"cancelAlgorithm"):ne=o(()=>p(void 0),"cancelAlgorithm"),Km(a,A,M,F,ne,m,S)}o(cw,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function is(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o(is,"defaultControllerBrandCheckException$1");function lw(a,u){return Bn(a._readableStreamController)?pw(a):dw(a)}o(lw,"ReadableStreamTee");function dw(a,u){let m=j(a),S=!1,A=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(Tt=>{Ce=Tt});function dr(){return S?(A=!0,p(void 0)):(S=!0,se(m,{_chunkSteps:o(It=>{x(()=>{A=!1;let Xt=It,Zr=It;M||Po(le._readableStreamController,Xt),F||Po(Ee._readableStreamController,Zr),S=!1,A&&dr()})},"_chunkSteps"),_closeSteps:o(()=>{S=!1,M||Wn(le._readableStreamController),F||Wn(Ee._readableStreamController),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{S=!1},"_errorSteps")}),p(void 0))}o(dr,"pullAlgorithm");function To(Tt){if(M=!0,ne=Tt,F){let It=qe([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(To,"cancel1Algorithm");function _n(Tt){if(F=!0,he=Tt,M){let It=qe([ne,he]),Xt=lr(a,It);Ce(Xt)}return We}o(_n,"cancel2Algorithm");function Wr(){}return o(Wr,"startAlgorithm"),le=xi(Wr,dr,To),Ee=xi(Wr,dr,_n),y(m._closedPromise,Tt=>(cr(le._readableStreamController,Tt),cr(Ee._readableStreamController,Tt),(!M||!F)&&Ce(void 0),null)),[le,Ee]}o(dw,"ReadableStreamDefaultTee");function pw(a){let u=j(a),m=!1,S=!1,A=!1,M=!1,F=!1,ne,he,le,Ee,Ce,We=l(de=>{Ce=de});function dr(de){y(de._closedPromise,Ne=>(de!==u||(Yt(le._readableStreamController,Ne),Yt(Ee._readableStreamController,Ne),(!M||!F)&&Ce(void 0)),null))}o(dr,"forwardReaderError");function To(){Vn(u)&&(B(u),u=j(a),dr(u)),se(u,{_chunkSteps:o(Ne=>{x(()=>{S=!1,A=!1;let Ze=Ne,Dt=Ne;if(!M&&!F)try{Dt=fm(Ne)}catch(xo){Yt(le._readableStreamController,xo),Yt(Ee._readableStreamController,xo),Ce(lr(a,xo));return}M||Va(le._readableStreamController,Ze),F||Va(Ee._readableStreamController,Dt),m=!1,S?Wr():A&&Tt()})},"_chunkSteps"),_closeSteps:o(()=>{m=!1,M||vi(le._readableStreamController),F||vi(Ee._readableStreamController),le._readableStreamController._pendingPullIntos.length>0&&Ha(le._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&Ha(Ee._readableStreamController,0),(!M||!F)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(To,"pullWithDefaultReader");function _n(de,Ne){ie(u)&&(B(u),u=wm(a),dr(u));let Ze=Ne?Ee:le,Dt=Ne?le:Ee;Rm(u,de,1,{_chunkSteps:o(wo=>{x(()=>{S=!1,A=!1;let Ao=Ne?F:M;if(Ne?M:F)Ao||Ga(Ze._readableStreamController,wo);else{let dh;try{dh=fm(wo)}catch(el){Yt(Ze._readableStreamController,el),Yt(Dt._readableStreamController,el),Ce(lr(a,el));return}Ao||Ga(Ze._readableStreamController,wo),Va(Dt._readableStreamController,dh)}m=!1,S?Wr():A&&Tt()})},"_chunkSteps"),_closeSteps:o(wo=>{m=!1;let Ao=Ne?F:M,fs=Ne?M:F;Ao||vi(Ze._readableStreamController),fs||vi(Dt._readableStreamController),wo!==void 0&&(Ao||Ga(Ze._readableStreamController,wo),!fs&&Dt._readableStreamController._pendingPullIntos.length>0&&Ha(Dt._readableStreamController,0)),(!Ao||!fs)&&Ce(void 0)},"_closeSteps"),_errorSteps:o(()=>{m=!1},"_errorSteps")})}o(_n,"pullWithBYOBReader");function Wr(){if(m)return S=!0,p(void 0);m=!0;let de=zc(le._readableStreamController);return de===null?To():_n(de._view,!1),p(void 0)}o(Wr,"pull1Algorithm");function Tt(){if(m)return A=!0,p(void 0);m=!0;let de=zc(Ee._readableStreamController);return de===null?To():_n(de._view,!0),p(void 0)}o(Tt,"pull2Algorithm");function It(de){if(M=!0,ne=de,F){let Ne=qe([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(It,"cancel1Algorithm");function Xt(de){if(F=!0,he=de,M){let Ne=qe([ne,he]),Ze=lr(a,Ne);Ce(Ze)}return We}o(Xt,"cancel2Algorithm");function Zr(){}return o(Zr,"startAlgorithm"),le=Ym(Zr,Wr,It),Ee=Ym(Zr,Tt,Xt),dr(u),[le,Ee]}o(pw,"ReadableByteStreamTee");function fw(a){return r(a)&&typeof a.getReader<"u"}o(fw,"isReadableStreamLike");function mw(a){return fw(a)?gw(a.getReader()):hw(a)}o(mw,"ReadableStreamFrom");function hw(a){let u,m=pm(a,"async"),S=e;function A(){let F;try{F=ax(m)}catch(he){return f(he)}let ne=p(F);return T(ne,he=>{if(!r(he))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(sx(he))Wn(u._readableStreamController);else{let Ee=ux(he);Po(u._readableStreamController,Ee)}})}o(A,"pullAlgorithm");function M(F){let ne=m.iterator,he;try{he=Fa(ne,"return")}catch(Ce){return f(Ce)}if(he===void 0)return p(void 0);let le;try{le=N(he,ne,[F])}catch(Ce){return f(Ce)}let Ee=p(le);return T(Ee,Ce=>{if(!r(Ce))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(M,"cancelAlgorithm"),u=xi(S,A,M,0),u}o(hw,"ReadableStreamFromIterable");function gw(a){let u,m=e;function S(){let M;try{M=a.read()}catch(F){return f(F)}return T(M,F=>{if(!r(F))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(F.done)Wn(u._readableStreamController);else{let ne=F.value;Po(u._readableStreamController,ne)}})}o(S,"pullAlgorithm");function A(M){try{return p(a.cancel(M))}catch(F){return f(F)}}return o(A,"cancelAlgorithm"),u=xi(m,S,A,0),u}o(gw,"ReadableStreamFromDefaultReader");function yw(a,u){et(a,u);let m=a,S=m?.autoAllocateChunkSize,A=m?.cancel,M=m?.pull,F=m?.start,ne=m?.type;return{autoAllocateChunkSize:S===void 0?void 0:R(S,`${u} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:_w(A,m,`${u} has member 'cancel' that`),pull:M===void 0?void 0:vw(M,m,`${u} has member 'pull' that`),start:F===void 0?void 0:bw(F,m,`${u} has member 'start' that`),type:ne===void 0?void 0:Pw(ne,`${u} has member 'type' that`)}}o(yw,"convertUnderlyingDefaultOrByteSource");function _w(a,u,m){return it(a,m),S=>L(a,u,[S])}o(_w,"convertUnderlyingSourceCancelCallback");function vw(a,u,m){return it(a,m),S=>L(a,u,[S])}o(vw,"convertUnderlyingSourcePullCallback");function bw(a,u,m){return it(a,m),S=>N(a,u,[S])}o(bw,"convertUnderlyingSourceStartCallback");function Pw(a,u){if(a=`${a}`,a!=="bytes")throw new TypeError(`${u} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(Pw,"convertReadableStreamType");function Sw(a,u){return et(a,u),{preventCancel:!!a?.preventCancel}}o(Sw,"convertIteratorOptions");function Jm(a,u){et(a,u);let m=a?.preventAbort,S=a?.preventCancel,A=a?.preventClose,M=a?.signal;return M!==void 0&&Ew(M,`${u} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!S,preventClose:!!A,signal:M}}o(Jm,"convertPipeOptions");function Ew(a,u){if(!Cx(a))throw new TypeError(`${u} is not an AbortSignal.`)}o(Ew,"assertAbortSignal");function Tw(a,u){et(a,u);let m=a?.readable;v(m,"readable","ReadableWritablePair"),$(m,`${u} has member 'readable' that`);let S=a?.writable;return v(S,"writable","ReadableWritablePair"),Cm(S,`${u} has member 'writable' that`),{readable:m,writable:S}}o(Tw,"convertReadableWritablePair");class St{static{o(this,"ReadableStream")}constructor(u={},m={}){u===void 0?u=null:Le(u,"First parameter");let S=Ka(m,"Second parameter"),A=yw(u,"First parameter");if(Jc(this),A.type==="bytes"){if(S.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let M=Pi(S,0);_x(this,A,M)}else{let M=Za(S),F=Pi(S,1);cw(this,A,F,M)}}get locked(){if(!hn(this))throw Zn("locked");return gn(this)}cancel(u=void 0){return hn(this)?gn(this)?f(new TypeError("Cannot cancel a stream that already has a reader")):lr(this,u):f(Zn("cancel"))}getReader(u=void 0){if(!hn(this))throw Zn("getReader");return bx(u,"First parameter").mode===void 0?j(this):wm(this)}pipeThrough(u,m={}){if(!hn(this))throw Zn("pipeThrough");Be(u,1,"pipeThrough");let S=Tw(u,"First parameter"),A=Jm(m,"Second parameter");if(gn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(vo(S.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let M=Wm(this,S.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return P(M),S.readable}pipeTo(u,m={}){if(!hn(this))return f(Zn("pipeTo"));if(u===void 0)return f("Parameter 1 is required in 'pipeTo'.");if(!_o(u))return f(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let S;try{S=Jm(m,"Second parameter")}catch(A){return f(A)}return gn(this)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):vo(u)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Wm(this,u,S.preventClose,S.preventAbort,S.preventCancel,S.signal)}tee(){if(!hn(this))throw Zn("tee");let u=lw(this);return qe(u)}values(u=void 0){if(!hn(this))throw Zn("values");let m=Sw(u,"First parameter");return mo(this,m.preventCancel)}[Ic](u){return this.values(u)}static from(u){return mw(u)}}Object.defineProperties(St,{from:{enumerable:!0}}),Object.defineProperties(St.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(St.from,"from"),i(St.prototype.cancel,"cancel"),i(St.prototype.getReader,"getReader"),i(St.prototype.pipeThrough,"pipeThrough"),i(St.prototype.pipeTo,"pipeTo"),i(St.prototype.tee,"tee"),i(St.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(St.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(St.prototype,Ic,{value:St.prototype.values,writable:!0,configurable:!0});function xi(a,u,m,S=1,A=()=>1){let M=Object.create(St.prototype);Jc(M);let F=Object.create(Gr.prototype);return Km(M,F,a,u,m,S,A),M}o(xi,"CreateReadableStream");function Ym(a,u,m){let S=Object.create(St.prototype);Jc(S);let A=Object.create(Vr.prototype);return xm(S,A,a,u,m,0,void 0),S}o(Ym,"CreateReadableByteStream");function Jc(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(Jc,"InitializeReadableStream");function hn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof St}o(hn,"IsReadableStream");function gn(a){return a._reader!==void 0}o(gn,"IsReadableStreamLocked");function lr(a,u){if(a._disturbed=!0,a._state==="closed")return p(void 0);if(a._state==="errored")return f(a._storedError);wi(a);let m=a._reader;if(m!==void 0&&Vn(m)){let A=m._readIntoRequests;m._readIntoRequests=new W,A.forEach(M=>{M._closeSteps(void 0)})}let S=a._readableStreamController[ee](u);return T(S,e)}o(lr,"ReadableStreamCancel");function wi(a){a._state="closed";let u=a._reader;if(u!==void 0&&(Fe(u),ie(u))){let m=u._readRequests;u._readRequests=new W,m.forEach(S=>{S._closeSteps()})}}o(wi,"ReadableStreamClose");function Xm(a,u){a._state="errored",a._storedError=u;let m=a._reader;m!==void 0&&(Ae(m,u),ie(m)?Je(m,u):Om(m,u))}o(Xm,"ReadableStreamError");function Zn(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Zn,"streamBrandCheckException$1");function Qm(a,u){et(a,u);let m=a?.highWaterMark;return v(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:E(m)}}o(Qm,"convertQueuingStrategyInit");let eh=o(a=>a.byteLength,"byteLengthSizeFunction");i(eh,"size");class as{static{o(this,"ByteLengthQueuingStrategy")}constructor(u){Be(u,1,"ByteLengthQueuingStrategy"),u=Qm(u,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!rh(this))throw th("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!rh(this))throw th("size");return eh}}Object.defineProperties(as.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(as.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function th(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(th,"byteLengthBrandCheckException");function rh(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof as}o(rh,"IsByteLengthQueuingStrategy");let nh=o(()=>1,"countSizeFunction");i(nh,"size");class ss{static{o(this,"CountQueuingStrategy")}constructor(u){Be(u,1,"CountQueuingStrategy"),u=Qm(u,"First parameter"),this._countQueuingStrategyHighWaterMark=u.highWaterMark}get highWaterMark(){if(!ih(this))throw oh("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!ih(this))throw oh("size");return nh}}Object.defineProperties(ss.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ss.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function oh(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(oh,"countBrandCheckException");function ih(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof ss}o(ih,"IsCountQueuingStrategy");function xw(a,u){et(a,u);let m=a?.cancel,S=a?.flush,A=a?.readableType,M=a?.start,F=a?.transform,ne=a?.writableType;return{cancel:m===void 0?void 0:Rw(m,a,`${u} has member 'cancel' that`),flush:S===void 0?void 0:ww(S,a,`${u} has member 'flush' that`),readableType:A,start:M===void 0?void 0:Aw(M,a,`${u} has member 'start' that`),transform:F===void 0?void 0:Iw(F,a,`${u} has member 'transform' that`),writableType:ne}}o(xw,"convertTransformer");function ww(a,u,m){return it(a,m),S=>L(a,u,[S])}o(ww,"convertTransformerFlushCallback");function Aw(a,u,m){return it(a,m),S=>N(a,u,[S])}o(Aw,"convertTransformerStartCallback");function Iw(a,u,m){return it(a,m),(S,A)=>L(a,u,[S,A])}o(Iw,"convertTransformerTransformCallback");function Rw(a,u,m){return it(a,m),S=>L(a,u,[S])}o(Rw,"convertTransformerCancelCallback");class us{static{o(this,"TransformStream")}constructor(u={},m={},S={}){u===void 0&&(u=null);let A=Ka(m,"Second parameter"),M=Ka(S,"Third parameter"),F=xw(u,"First parameter");if(F.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(F.writableType!==void 0)throw new RangeError("Invalid writableType specified");let ne=Pi(M,0),he=Za(M),le=Pi(A,1),Ee=Za(A),Ce,We=l(dr=>{Ce=dr});Ow(this,We,le,Ee,ne,he),$w(this,F),F.start!==void 0?Ce(F.start(this._transformStreamController)):Ce(void 0)}get readable(){if(!ah(this))throw lh("readable");return this._readable}get writable(){if(!ah(this))throw lh("writable");return this._writable}}Object.defineProperties(us.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(us.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function Ow(a,u,m,S,A,M){function F(){return u}o(F,"startAlgorithm");function ne(We){return zw(a,We)}o(ne,"writeAlgorithm");function he(We){return Dw(a,We)}o(he,"abortAlgorithm");function le(){return Uw(a)}o(le,"closeAlgorithm"),a._writable=Nx(F,ne,le,he,m,S);function Ee(){return Mw(a)}o(Ee,"pullAlgorithm");function Ce(We){return jw(a,We)}o(Ce,"cancelAlgorithm"),a._readable=xi(F,Ee,Ce,A,M),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,cs(a,!0),a._transformStreamController=void 0}o(Ow,"InitializeTransformStream");function ah(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof us}o(ah,"IsTransformStream");function sh(a,u){cr(a._readable._readableStreamController,u),Yc(a,u)}o(sh,"TransformStreamError");function Yc(a,u){ds(a._transformStreamController),Si(a._writable._writableStreamController,u),Xc(a)}o(Yc,"TransformStreamErrorWritableAndUnblockWrite");function Xc(a){a._backpressure&&cs(a,!1)}o(Xc,"TransformStreamUnblockWrite");function cs(a,u){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=l(m=>{a._backpressureChangePromise_resolve=m}),a._backpressure=u}o(cs,"TransformStreamSetBackpressure");class yn{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ls(this))throw ps("desiredSize");let u=this._controlledTransformStream._readable._readableStreamController;return Kc(u)}enqueue(u=void 0){if(!ls(this))throw ps("enqueue");uh(this,u)}error(u=void 0){if(!ls(this))throw ps("error");kw(this,u)}terminate(){if(!ls(this))throw ps("terminate");Nw(this)}}Object.defineProperties(yn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(yn.prototype.enqueue,"enqueue"),i(yn.prototype.error,"error"),i(yn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ls(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof yn}o(ls,"IsTransformStreamDefaultController");function Cw(a,u,m,S,A){u._controlledTransformStream=a,a._transformStreamController=u,u._transformAlgorithm=m,u._flushAlgorithm=S,u._cancelAlgorithm=A,u._finishPromise=void 0,u._finishPromise_resolve=void 0,u._finishPromise_reject=void 0}o(Cw,"SetUpTransformStreamDefaultController");function $w(a,u){let m=Object.create(yn.prototype),S,A,M;u.transform!==void 0?S=o(F=>u.transform(F,m),"transformAlgorithm"):S=o(F=>{try{return uh(m,F),p(void 0)}catch(ne){return f(ne)}},"transformAlgorithm"),u.flush!==void 0?A=o(()=>u.flush(m),"flushAlgorithm"):A=o(()=>p(void 0),"flushAlgorithm"),u.cancel!==void 0?M=o(F=>u.cancel(F),"cancelAlgorithm"):M=o(()=>p(void 0),"cancelAlgorithm"),Cw(a,m,S,A,M)}o($w,"SetUpTransformStreamDefaultControllerFromTransformer");function ds(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ds,"TransformStreamDefaultControllerClearAlgorithms");function uh(a,u){let m=a._controlledTransformStream,S=m._readable._readableStreamController;if(!So(S))throw new TypeError("Readable side is not in a state that permits enqueue");try{Po(S,u)}catch(M){throw Yc(m,M),m._readable._storedError}uw(S)!==m._backpressure&&cs(m,!0)}o(uh,"TransformStreamDefaultControllerEnqueue");function kw(a,u){sh(a._controlledTransformStream,u)}o(kw,"TransformStreamDefaultControllerError");function ch(a,u){let m=a._transformAlgorithm(u);return T(m,void 0,S=>{throw sh(a._controlledTransformStream,S),S})}o(ch,"TransformStreamDefaultControllerPerformTransform");function Nw(a){let u=a._controlledTransformStream,m=u._readable._readableStreamController;Wn(m);let S=new TypeError("TransformStream terminated");Yc(u,S)}o(Nw,"TransformStreamDefaultControllerTerminate");function zw(a,u){let m=a._transformStreamController;if(a._backpressure){let S=a._backpressureChangePromise;return T(S,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return ch(m,u)})}return ch(m,u)}o(zw,"TransformStreamDefaultSinkWriteAlgorithm");function Dw(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._readable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let A=m._cancelAlgorithm(u);return ds(m),h(A,()=>(S._state==="errored"?Eo(m,S._storedError):(cr(S._readableStreamController,u),Qc(m)),null),M=>(cr(S._readableStreamController,M),Eo(m,M),null)),m._finishPromise}o(Dw,"TransformStreamDefaultSinkAbortAlgorithm");function Uw(a){let u=a._transformStreamController;if(u._finishPromise!==void 0)return u._finishPromise;let m=a._readable;u._finishPromise=l((A,M)=>{u._finishPromise_resolve=A,u._finishPromise_reject=M});let S=u._flushAlgorithm();return ds(u),h(S,()=>(m._state==="errored"?Eo(u,m._storedError):(Wn(m._readableStreamController),Qc(u)),null),A=>(cr(m._readableStreamController,A),Eo(u,A),null)),u._finishPromise}o(Uw,"TransformStreamDefaultSinkCloseAlgorithm");function Mw(a){return cs(a,!1),a._backpressureChangePromise}o(Mw,"TransformStreamDefaultSourcePullAlgorithm");function jw(a,u){let m=a._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let S=a._writable;m._finishPromise=l((M,F)=>{m._finishPromise_resolve=M,m._finishPromise_reject=F});let A=m._cancelAlgorithm(u);return ds(m),h(A,()=>(S._state==="errored"?Eo(m,S._storedError):(Si(S._writableStreamController,u),Xc(a),Qc(m)),null),M=>(Si(S._writableStreamController,M),Xc(a),Eo(m,M),null)),m._finishPromise}o(jw,"TransformStreamDefaultSourceCancelAlgorithm");function ps(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(ps,"defaultControllerBrandCheckException");function Qc(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Qc,"defaultControllerFinishPromiseResolve");function Eo(a,u){a._finishPromise_reject!==void 0&&(P(a._finishPromise),a._finishPromise_reject(u),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(Eo,"defaultControllerFinishPromiseReject");function lh(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(lh,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=as,t.CountQueuingStrategy=ss,t.ReadableByteStreamController=Vr,t.ReadableStream=St,t.ReadableStreamBYOBReader=fn,t.ReadableStreamBYOBRequest=Fn,t.ReadableStreamDefaultController=Gr,t.ReadableStreamDefaultReader=V,t.TransformStream=us,t.TransformStreamDefaultController=yn,t.WritableStream=mn,t.WritableStreamDefaultController=bo,t.WritableStreamDefaultWriter=Hr})});var Tb=k(()=>{if(!globalThis.ReadableStream)try{let t=require("node:process"),{emitWarning:e}=t;try{t.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),t.emitWarning=e}catch(r){throw t.emitWarning=e,r}}catch{Object.assign(globalThis,Eb())}try{let{Blob:t}=require("buffer");t&&!t.prototype.stream&&(t.prototype.stream=o(function(r){let n=0,i=this;return new ReadableStream({type:"bytes",async pull(s){let d=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=d.byteLength,s.enqueue(new Uint8Array(d)),n===i.size&&s.close()}})},"name"))}catch{}});async function*vd(t,e=!0){for(let r of t)if("stream"in r)yield*r.stream();else if(ArrayBuffer.isView(r))if(e){let n=r.byteOffset,i=r.byteOffset+r.byteLength;for(;n!==i;){let s=Math.min(i-n,xb),c=r.buffer.slice(n,n+s);n+=c.byteLength,yield new Uint8Array(c)}}else yield r;else{let n=0,i=r;for(;n!==i.size;){let c=await i.slice(n,Math.min(i.size,n+xb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var A8,xb,wb,dC,hr,ta=ht(()=>{A8=pt(Tb(),1);xb=65536;o(vd,"toIterator");wb=class bd{static{o(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(e=[],r={}){if(typeof e!="object"||e===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof e[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof r!="object"&&typeof r!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");r===null&&(r={});let n=new TextEncoder;for(let s of e){let c;ArrayBuffer.isView(s)?c=new Uint8Array(s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength)):s instanceof ArrayBuffer?c=new Uint8Array(s.slice(0)):s instanceof bd?c=s:c=n.encode(`${s}`),this.#r+=ArrayBuffer.isView(c)?c.byteLength:c.size,this.#e.push(c)}this.#n=`${r.endings===void 0?"transparent":r.endings}`;let i=r.type===void 0?"":String(r.type);this.#t=/^[\x20-\x7E]*$/.test(i)?i:""}get size(){return this.#r}get type(){return this.#t}async text(){let e=new TextDecoder,r="";for await(let n of vd(this.#e,!1))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 vd(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=vd(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(r){let n=await e.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await e.return()}})}slice(e=0,r=this.size,n=""){let{size:i}=this,s=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),d=Math.max(c-s,0),l=this.#e,p=[],f=0;for(let h of l){if(f>=d)break;let g=ArrayBuffer.isView(h)?h.byteLength:h.size;if(s&&g<=s)s-=g,c-=g;else{let y;ArrayBuffer.isView(h)?(y=h.subarray(s,Math.min(g,c)),f+=y.byteLength):(y=h.slice(s,Math.min(g,c)),f+=y.size),c-=g,p.push(y),s=0}}let _=new bd([],{type:String(n).toLowerCase()});return _.#r=d,_.#e=p,_}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](e){return e&&typeof e=="object"&&typeof e.constructor=="function"&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}};Object.defineProperties(wb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});dC=wb,hr=dC});var pC,fC,$n,Pd=ht(()=>{ta();pC=class extends hr{static{o(this,"File")}#e=0;#t="";constructor(e,r,n={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(e,n),n===null&&(n={});let i=n.lastModified===void 0?Date.now():Number(n.lastModified);Number.isNaN(i)||(this.#e=i),this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](e){return!!e&&e instanceof hr&&/^(File)$/.test(e[Symbol.toStringTag])}},fC=pC,$n=fC});function Rb(t,e=hr){var r=`${Ab()}${Ab()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
15
+ Content-Disposition: form-data; name="`;return t.forEach((s,c)=>typeof s=="string"?n.push(i+Sd(c)+`"\r
16
+ \r
17
+ ${s.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
18
+ `)}\r
19
+ `):n.push(i+Sd(c)+`"; filename="${Sd(s.name,1)}"\r
20
+ Content-Type: ${s.type||"application/octet-stream"}\r
21
+ \r
22
+ `,s,`\r
23
+ `)),n.push(`--${r}--`),new e(n,{type:"multipart/form-data; boundary="+r})}var ra,mC,hC,Ab,gC,Ib,Sd,eo,kn,nu=ht(()=>{ta();Pd();({toStringTag:ra,iterator:mC,hasInstance:hC}=Symbol),Ab=Math.random,gC="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Ib=o((t,e,r)=>(t+="",/^(Blob|File)$/.test(e&&e[ra])?[(r=r!==void 0?r+"":e[ra]=="File"?e.name:"blob",t),e.name!==r||e[ra]=="blob"?new $n([e],r,e):e]:[t,e+""]),"f"),Sd=o((t,e)=>(e?t:t.replace(/\r?\n|\r/g,`\r
24
+ `)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),eo=o((t,e,r)=>{if(e.length<r)throw new TypeError(`Failed to execute '${t}' on 'FormData': ${r} arguments required, but only ${e.length} present.`)},"x"),kn=class{static{o(this,"FormData")}#e=[];constructor(...e){if(e.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[ra](){return"FormData"}[mC](){return this.entries()}static[hC](e){return e&&typeof e=="object"&&e[ra]==="FormData"&&!gC.some(r=>typeof e[r]!="function")}append(...e){eo("append",arguments,2),this.#e.push(Ib(...e))}delete(e){eo("delete",arguments,1),e+="",this.#e=this.#e.filter(([r])=>r!==e)}get(e){eo("get",arguments,1),e+="";for(var r=this.#e,n=r.length,i=0;i<n;i++)if(r[i][0]===e)return r[i][1];return null}getAll(e,r){return eo("getAll",arguments,1),r=[],e+="",this.#e.forEach(n=>n[0]===e&&r.push(n[1])),r}has(e){return eo("has",arguments,1),e+="",this.#e.some(r=>r[0]===e)}forEach(e,r){eo("forEach",arguments,1);for(var[n,i]of this)e.call(r,i,n,this)}set(...e){eo("set",arguments,2);var r=[],n=!0;e=Ib(...e),this.#e.forEach(i=>{i[0]===e[0]?n&&(n=!r.push(e)):r.push(i)}),n&&r.push(e),this.#e=r}*entries(){yield*this.#e}*keys(){for(var[e]of this)yield e}*values(){for(var[,e]of this)yield e}};o(Rb,"formDataToBlob")});var tn,ou=ht(()=>{tn=class extends Error{static{o(this,"FetchBaseError")}constructor(e,r){super(e),Error.captureStackTrace(this,this.constructor),this.type=r}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var wt,Ed=ht(()=>{ou();wt=class extends tn{static{o(this,"FetchError")}constructor(e,r,n){super(e,r),n&&(this.code=this.errno=n.code,this.erroredSysCall=n.syscall)}}});var iu,Td,na,Ob,Cb,$b,au=ht(()=>{iu=Symbol.toStringTag,Td=o(t=>typeof t=="object"&&typeof t.append=="function"&&typeof t.delete=="function"&&typeof t.get=="function"&&typeof t.getAll=="function"&&typeof t.has=="function"&&typeof t.set=="function"&&typeof t.sort=="function"&&t[iu]==="URLSearchParams","isURLSearchParameters"),na=o(t=>t&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.constructor=="function"&&/^(Blob|File)$/.test(t[iu]),"isBlob"),Ob=o(t=>typeof t=="object"&&(t[iu]==="AbortSignal"||t[iu]==="EventTarget"),"isAbortSignal"),Cb=o((t,e)=>{let r=new URL(e).hostname,n=new URL(t).hostname;return r===n||r.endsWith(`.${n}`)},"isDomainOrSubdomain"),$b=o((t,e)=>{let r=new URL(e).protocol,n=new URL(t).protocol;return r===n},"isSameProtocol")});var Nb=k((G8,kb)=>{if(!globalThis.DOMException)try{let{MessageChannel:t}=require("worker_threads"),e=new t().port1,r=new ArrayBuffer;e.postMessage(r,[r,r])}catch(t){t.constructor.name==="DOMException"&&(globalThis.DOMException=t.constructor)}kb.exports=globalThis.DOMException});var to,zb,Db,xd,Ub,Mb,jb,Lb,Fb,Bb,su,wd=ht(()=>{to=require("node:fs"),zb=require("node:path"),Db=pt(Nb(),1);Pd();ta();({stat:xd}=to.promises),Ub=o((t,e)=>Fb((0,to.statSync)(t),t,e),"blobFromSync"),Mb=o((t,e)=>xd(t).then(r=>Fb(r,t,e)),"blobFrom"),jb=o((t,e)=>xd(t).then(r=>Bb(r,t,e)),"fileFrom"),Lb=o((t,e)=>Bb((0,to.statSync)(t),t,e),"fileFromSync"),Fb=o((t,e,r="")=>new hr([new su({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],{type:r}),"fromBlob"),Bb=o((t,e,r="")=>new $n([new su({path:e,size:t.size,lastModified:t.mtimeMs,start:0})],(0,zb.basename)(e),{type:r,lastModified:t.mtimeMs}),"fromFile"),su=class t{static{o(this,"BlobDataItem")}#e;#t;constructor(e){this.#e=e.path,this.#t=e.start,this.size=e.size,this.lastModified=e.lastModified}slice(e,r){return new t({path:this.#e,lastModified:this.lastModified,size:r-e,start:this.#t+e})}async*stream(){let{mtimeMs:e}=await xd(this.#e);if(e>this.lastModified)throw new Db.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError");yield*(0,to.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var Vb={};ms(Vb,{toFormData:()=>EC});function SC(t){let e=t.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!e)return;let r=e[2]||e[3]||"",n=r.slice(r.lastIndexOf("\\")+1);return n=n.replace(/%22/g,'"'),n=n.replace(/&#(\d{4});/g,(i,s)=>String.fromCharCode(s)),n}async function EC(t,e){if(!/multipart/i.test(e))throw new TypeError("Failed to fetch");let r=e.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!r)throw new TypeError("no or bad content-type header, no multipart boundary");let n=new Ad(r[1]||r[2]),i,s,c,d,l,p,f=[],_=new kn,h=o(x=>{c+=P.decode(x,{stream:!0})},"onPartData"),g=o(x=>{f.push(x)},"appendToFile"),y=o(()=>{let x=new $n(f,p,{type:l});_.append(d,x)},"appendFileToFormData"),T=o(()=>{_.append(d,c)},"appendEntryToFormData"),P=new TextDecoder("utf-8");P.decode(),n.onPartBegin=function(){n.onPartData=h,n.onPartEnd=T,i="",s="",c="",d="",l="",p=null,f.length=0},n.onHeaderField=function(x){i+=P.decode(x,{stream:!0})},n.onHeaderValue=function(x){s+=P.decode(x,{stream:!0})},n.onHeaderEnd=function(){if(s+=P.decode(),i=i.toLowerCase(),i==="content-disposition"){let x=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);x&&(d=x[2]||x[3]||""),p=SC(s),p&&(n.onPartData=g,n.onPartEnd=y)}else i==="content-type"&&(l=s);s="",i=""};for await(let x of t)n.write(x);return n.end(),_}var Ir,Ke,qb,Nn,uu,cu,yC,oa,_C,vC,bC,PC,ro,Ad,Hb=ht(()=>{wd();nu();Ir=0,Ke={START_BOUNDARY:Ir++,HEADER_FIELD_START:Ir++,HEADER_FIELD:Ir++,HEADER_VALUE_START:Ir++,HEADER_VALUE:Ir++,HEADER_VALUE_ALMOST_DONE:Ir++,HEADERS_ALMOST_DONE:Ir++,PART_DATA_START:Ir++,PART_DATA:Ir++,END:Ir++},qb=1,Nn={PART_BOUNDARY:qb,LAST_BOUNDARY:qb*=2},uu=10,cu=13,yC=32,oa=45,_C=58,vC=97,bC=122,PC=o(t=>t|32,"lower"),ro=o(()=>{},"noop"),Ad=class{static{o(this,"MultipartParser")}constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=ro,this.onHeaderField=ro,this.onHeadersEnd=ro,this.onHeaderValue=ro,this.onPartBegin=ro,this.onPartData=ro,this.onPartEnd=ro,this.boundaryChars={},e=`\r
25
+ --`+e;let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n),this.boundaryChars[r[n]]=!0;this.boundary=r,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Ke.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:s,boundary:c,boundaryChars:d,index:l,state:p,flags:f}=this,_=this.boundary.length,h=_-1,g=e.length,y,T,P=o(X=>{this[X+"Mark"]=r},"mark"),x=o(X=>{delete this[X+"Mark"]},"clear"),N=o((X,W,G,K)=>{(W===void 0||W!==G)&&this[X](K&&K.subarray(W,G))},"callback"),L=o((X,W)=>{let G=X+"Mark";G in this&&(W?(N(X,this[G],r,e),delete this[G]):(N(X,this[G],e.length,e),this[G]=0))},"dataCallback");for(r=0;r<n;r++)switch(y=e[r],p){case Ke.START_BOUNDARY:if(l===c.length-2){if(y===oa)f|=Nn.LAST_BOUNDARY;else if(y!==cu)return;l++;break}else if(l-1===c.length-2){if(f&Nn.LAST_BOUNDARY&&y===oa)p=Ke.END,f=0;else if(!(f&Nn.LAST_BOUNDARY)&&y===uu)l=0,N("onPartBegin"),p=Ke.HEADER_FIELD_START;else return;break}y!==c[l+2]&&(l=-2),y===c[l+2]&&l++;break;case Ke.HEADER_FIELD_START:p=Ke.HEADER_FIELD,P("onHeaderField"),l=0;case Ke.HEADER_FIELD:if(y===cu){x("onHeaderField"),p=Ke.HEADERS_ALMOST_DONE;break}if(l++,y===oa)break;if(y===_C){if(l===1)return;L("onHeaderField",!0),p=Ke.HEADER_VALUE_START;break}if(T=PC(y),T<vC||T>bC)return;break;case Ke.HEADER_VALUE_START:if(y===yC)break;P("onHeaderValue"),p=Ke.HEADER_VALUE;case Ke.HEADER_VALUE:y===cu&&(L("onHeaderValue",!0),N("onHeaderEnd"),p=Ke.HEADER_VALUE_ALMOST_DONE);break;case Ke.HEADER_VALUE_ALMOST_DONE:if(y!==uu)return;p=Ke.HEADER_FIELD_START;break;case Ke.HEADERS_ALMOST_DONE:if(y!==uu)return;N("onHeadersEnd"),p=Ke.PART_DATA_START;break;case Ke.PART_DATA_START:p=Ke.PART_DATA,P("onPartData");case Ke.PART_DATA:if(i=l,l===0){for(r+=h;r<g&&!(e[r]in d);)r+=_;r-=h,y=e[r]}if(l<c.length)c[l]===y?(l===0&&L("onPartData",!0),l++):l=0;else if(l===c.length)l++,y===cu?f|=Nn.PART_BOUNDARY:y===oa?f|=Nn.LAST_BOUNDARY:l=0;else if(l-1===c.length)if(f&Nn.PART_BOUNDARY){if(l=0,y===uu){f&=~Nn.PART_BOUNDARY,N("onPartEnd"),N("onPartBegin"),p=Ke.HEADER_FIELD_START;break}}else f&Nn.LAST_BOUNDARY&&y===oa?(N("onPartEnd"),p=Ke.END,f=0):l=0;if(l>0)s[l-1]=y;else if(i>0){let X=new Uint8Array(s.buffer,s.byteOffset,s.byteLength);N("onPartData",0,i,X),i=0,P("onPartData"),r--}break;case Ke.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}L("onHeaderField"),L("onHeaderValue"),L("onPartData"),this.index=l,this.state=p,this.flags=f}end(){if(this.state===Ke.HEADER_FIELD_START&&this.index===0||this.state===Ke.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Ke.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(SC,"_fileName");o(EC,"toFormData")});async function Id(t){if(t[$t].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[$t].disturbed=!0,t[$t].error)throw t[$t].error;let{body:e}=t;if(e===null)return Lt.Buffer.alloc(0);if(!(e instanceof nr.default))return Lt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let s=new wt(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(s),s}n+=i.length,r.push(i)}}catch(i){throw i instanceof tn?i:new wt(`Invalid response body while trying to fetch ${t.url}: ${i.message}`,"system",i)}if(e.readableEnded===!0||e._readableState.ended===!0)try{return r.every(i=>typeof i=="string")?Lt.Buffer.from(r.join("")):Lt.Buffer.concat(r,n)}catch(i){throw new wt(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new wt(`Premature close of server response while trying to fetch ${t.url}`)}var nr,rn,Lt,TC,$t,Rr,Zo,xC,lu,Gb,Wb,du=ht(()=>{nr=pt(require("node:stream"),1),rn=require("node:util"),Lt=require("node:buffer");ta();nu();Ed();ou();au();TC=(0,rn.promisify)(nr.default.pipeline),$t=Symbol("Body internals"),Rr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Td(e)?e=Lt.Buffer.from(e.toString()):na(e)||Lt.Buffer.isBuffer(e)||(rn.types.isAnyArrayBuffer(e)?e=Lt.Buffer.from(e):ArrayBuffer.isView(e)?e=Lt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof nr.default||(e instanceof kn?(e=Rb(e),n=e.type.split("=")[1]):e=Lt.Buffer.from(String(e))));let i=e;Lt.Buffer.isBuffer(e)?i=nr.default.Readable.from(e):na(e)&&(i=nr.default.Readable.from(e.stream())),this[$t]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof nr.default&&e.on("error",s=>{let c=s instanceof tn?s:new wt(`Invalid response body while trying to fetch ${this.url}: ${s.message}`,"system",s);this[$t].error=c})}get body(){return this[$t].stream}get bodyUsed(){return this[$t].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Id(this);return e.slice(r,r+n)}async formData(){let e=this.headers.get("content-type");if(e.startsWith("application/x-www-form-urlencoded")){let n=new kn,i=new URLSearchParams(await this.text());for(let[s,c]of i)n.append(s,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(Hb(),Vb));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[$t].body&&this[$t].body.type||"",r=await this.arrayBuffer();return new hr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Id(this);return new TextDecoder().decode(e)}buffer(){return Id(this)}};Rr.prototype.buffer=(0,rn.deprecate)(Rr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Rr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,rn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Id,"consumeBody");Zo=o((t,e)=>{let r,n,{body:i}=t[$t];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof nr.default&&typeof i.getBoundary!="function"&&(r=new nr.PassThrough({highWaterMark:e}),n=new nr.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[$t].stream=r,i=n),i},"clone"),xC=(0,rn.deprecate)(t=>t.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),lu=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Td(t)?"application/x-www-form-urlencoded;charset=UTF-8":na(t)?t.type||null:Lt.Buffer.isBuffer(t)||rn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof kn?`multipart/form-data; boundary=${e[$t].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${xC(t)}`:t instanceof nr.default?null:"text/plain;charset=UTF-8","extractContentType"),Gb=o(t=>{let{body:e}=t[$t];return e===null?0:na(e)?e.size:Lt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),Wb=o(async(t,{body:e})=>{e===null?t.end():await TC(e,t)},"writeToStream")});function Zb(t=[]){return new kt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return pu(e),Od(e,String(r)),!0}catch{return!1}}))}var Rd,ia,pu,Od,kt,fu=ht(()=>{Rd=require("node:util"),ia=pt(require("node:http"),1),pu=typeof ia.default.validateHeaderName=="function"?ia.default.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){let e=new TypeError(`Header name must be a valid HTTP token [${t}]`);throw Object.defineProperty(e,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),e}},Od=typeof ia.default.validateHeaderValue=="function"?ia.default.validateHeaderValue:(t,e)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(e)){let r=new TypeError(`Invalid character in header content ["${t}"]`);throw Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"}),r}},kt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,s]of Object.entries(n))r.push(...s.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!Rd.types.isBoxedPrimitive(e)){let n=e[Symbol.iterator];if(n==null)r.push(...Object.entries(e));else{if(typeof n!="function")throw new TypeError("Header pairs must be iterable");r=[...e].map(i=>{if(typeof i!="object"||Rd.types.isBoxedPrimitive(i))throw new TypeError("Each header pair must be an iterable object");return[...i]}).map(i=>{if(i.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...i]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return r=r.length>0?r.map(([n,i])=>(pu(n),Od(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,s){switch(i){case"append":case"set":return(c,d)=>(pu(c),Od(c,String(d)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(d)));case"delete":case"has":case"getAll":return c=>(pu(c),URLSearchParams.prototype[i].call(n,String(c).toLowerCase()));case"keys":return()=>(n.sort(),new Set(URLSearchParams.prototype.keys.call(n)).keys());default:return Reflect.get(n,i,s)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(e){let r=this.getAll(e);if(r.length===0)return null;let n=r.join(", ");return/^content-encoding$/i.test(e)&&(n=n.toLowerCase()),n}forEach(e,r=void 0){for(let n of this.keys())Reflect.apply(e,r,[this.get(n),n,this])}*values(){for(let e of this.keys())yield this.get(e)}*entries(){for(let e of this.keys())yield[e,this.get(e)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((e,r)=>(e[r]=this.getAll(r),e),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((e,r)=>{let n=this.getAll(r);return r==="host"?e[r]=n[0]:e[r]=n.length>1?n:n[0],e},{})}};Object.defineProperties(kt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(Zb,"fromRawHeaders")});var wC,aa,Cd=ht(()=>{wC=new Set([301,302,303,307,308]),aa=o(t=>wC.has(t),"isRedirect")});var gr,Ft,Kb=ht(()=>{fu();du();Cd();gr=Symbol("Response internals"),Ft=class t extends Rr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new kt(r.headers);if(e!==null&&!i.has("Content-Type")){let s=lu(e,this);s&&i.append("Content-Type",s)}this[gr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[gr].type}get url(){return this[gr].url||""}get status(){return this[gr].status}get ok(){return this[gr].status>=200&&this[gr].status<300}get redirected(){return this[gr].counter>0}get statusText(){return this[gr].statusText}get headers(){return this[gr].headers}get highWaterMark(){return this[gr].highWaterMark}clone(){return new t(Zo(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(e,r=302){if(!aa(r))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new t(null,{headers:{location:new URL(e).toString()},status:r})}static error(){let e=new t(null,{status:0,statusText:""});return e[gr].type="error",e}static json(e=void 0,r={}){let n=JSON.stringify(e);if(n===void 0)throw new TypeError("data is not JSON serializable");let i=new kt(r&&r.headers);return i.has("content-type")||i.set("content-type","application/json"),new t(n,{...r,headers:i})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(Ft.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})});var Jb,Yb=ht(()=>{Jb=o(t=>{if(t.search)return t.search;let e=t.href.length-1,r=t.hash||(t.href[e]==="#"?"#":"");return t.href[e-r.length]==="?"?"?":""},"getSearch")});function Xb(t,e=!1){return t==null||(t=new URL(t),/^(about|blob|data):$/.test(t.protocol))?"no-referrer":(t.username="",t.password="",t.hash="",e&&(t.pathname="",t.search=""),t)}function rP(t){if(!eP.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function AC(t){if(/^(http|ws)s:$/.test(t.protocol))return!0;let e=t.host.replace(/(^\[)|(]$)/g,""),r=(0,Qb.isIP)(e);return r===4&&/^127\./.test(e)||r===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(e)?!0:t.host==="localhost"||t.host.endsWith(".localhost")?!1:t.protocol==="file:"}function Ko(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:AC(t)}function nP(t,{referrerURLCallback:e,referrerOriginCallback:r}={}){if(t.referrer==="no-referrer"||t.referrerPolicy==="")return null;let n=t.referrerPolicy;if(t.referrer==="about:client")return"no-referrer";let i=t.referrer,s=Xb(i),c=Xb(i,!0);s.toString().length>4096&&(s=c),e&&(s=e(s)),r&&(c=r(c));let d=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return s;case"strict-origin":return Ko(s)&&!Ko(d)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return s.origin===d.origin?s:Ko(s)&&!Ko(d)?"no-referrer":c;case"same-origin":return s.origin===d.origin?s:"no-referrer";case"origin-when-cross-origin":return s.origin===d.origin?s:c;case"no-referrer-when-downgrade":return Ko(s)&&!Ko(d)?"no-referrer":s;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function oP(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&eP.has(n)&&(r=n);return r}var Qb,eP,tP,$d=ht(()=>{Qb=require("node:net");o(Xb,"stripURLForUseAsAReferrer");eP=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),tP="strict-origin-when-cross-origin";o(rP,"validateReferrerPolicy");o(AC,"isOriginPotentiallyTrustworthy");o(Ko,"isUrlPotentiallyTrustworthy");o(nP,"determineRequestsReferrer");o(oP,"parseReferrerPolicyFromHeader")});var iP,aP,vt,sa,IC,zn,sP,uP=ht(()=>{iP=require("node:url"),aP=require("node:util");fu();du();au();Yb();$d();vt=Symbol("Request internals"),sa=o(t=>typeof t=="object"&&typeof t[vt]=="object","isRequest"),IC=(0,aP.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),zn=class t extends Rr{static{o(this,"Request")}constructor(e,r={}){let n;if(sa(e)?n=new URL(e.url):(n=new URL(e),e={}),n.username!==""||n.password!=="")throw new TypeError(`${n} is an url with embedded credentials.`);let i=r.method||e.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(i)&&(i=i.toUpperCase()),!sa(r)&&"data"in r&&IC(),(r.body!=null||sa(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let s=r.body?r.body:sa(e)&&e.body!==null?Zo(e):null;super(s,{size:r.size||e.size||0});let c=new kt(r.headers||e.headers||{});if(s!==null&&!c.has("Content-Type")){let p=lu(s,this);p&&c.set("Content-Type",p)}let d=sa(e)?e.signal:null;if("signal"in r&&(d=r.signal),d!=null&&!Ob(d))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let l=r.referrer==null?e.referrer:r.referrer;if(l==="")l="no-referrer";else if(l){let p=new URL(l);l=/^about:(\/\/)?client$/.test(p)?"client":p}else l=void 0;this[vt]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:d,referrer:l},this.follow=r.follow===void 0?e.follow===void 0?20:e.follow:r.follow,this.compress=r.compress===void 0?e.compress===void 0?!0:e.compress:r.compress,this.counter=r.counter||e.counter||0,this.agent=r.agent||e.agent,this.highWaterMark=r.highWaterMark||e.highWaterMark||16384,this.insecureHTTPParser=r.insecureHTTPParser||e.insecureHTTPParser||!1,this.referrerPolicy=r.referrerPolicy||e.referrerPolicy||""}get method(){return this[vt].method}get url(){return(0,iP.format)(this[vt].parsedURL)}get headers(){return this[vt].headers}get redirect(){return this[vt].redirect}get signal(){return this[vt].signal}get referrer(){if(this[vt].referrer==="no-referrer")return"";if(this[vt].referrer==="client")return"about:client";if(this[vt].referrer)return this[vt].referrer.toString()}get referrerPolicy(){return this[vt].referrerPolicy}set referrerPolicy(e){this[vt].referrerPolicy=rP(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(zn.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});sP=o(t=>{let{parsedURL:e}=t[vt],r=new kt(t[vt].headers);r.has("Accept")||r.set("Accept","*/*");let n=null;if(t.body===null&&/^(post|put)$/i.test(t.method)&&(n="0"),t.body!==null){let d=Gb(t);typeof d=="number"&&!Number.isNaN(d)&&(n=String(d))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=tP),t.referrer&&t.referrer!=="no-referrer"?t[vt].referrer=nP(t):t[vt].referrer="no-referrer",t[vt].referrer instanceof URL&&r.set("Referer",t.referrer),r.has("User-Agent")||r.set("User-Agent","node-fetch"),t.compress&&!r.has("Accept-Encoding")&&r.set("Accept-Encoding","gzip, deflate, br");let{agent:i}=t;typeof i=="function"&&(i=i(e));let s=Jb(e),c={path:e.pathname+s,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var ua,cP=ht(()=>{ou();ua=class extends tn{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var pP={};ms(pP,{AbortError:()=>ua,Blob:()=>hr,FetchError:()=>wt,File:()=>$n,FormData:()=>kn,Headers:()=>kt,Request:()=>zn,Response:()=>Ft,blobFrom:()=>Mb,blobFromSync:()=>Ub,default:()=>kd,fileFrom:()=>jb,fileFromSync:()=>Lb,isRedirect:()=>aa});async function kd(t,e){return new Promise((r,n)=>{let i=new zn(t,e),{parsedURL:s,options:c}=sP(i);if(!RC.has(s.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${s.protocol.replace(/:$/,"")}" is not supported.`);if(s.protocol==="data:"){let y=bb(i.url),T=new Ft(y,{headers:{"Content-Type":y.typeFull}});r(T);return}let d=(s.protocol==="https:"?dP.default:lP.default).request,{signal:l}=i,p=null,f=o(()=>{let y=new ua("The operation was aborted.");n(y),i.body&&i.body instanceof Bt.default.Readable&&i.body.destroy(y),!(!p||!p.body)&&p.body.emit("error",y)},"abort");if(l&&l.aborted){f();return}let _=o(()=>{f(),g()},"abortAndFinalize"),h=d(s.toString(),c);l&&l.addEventListener("abort",_);let g=o(()=>{h.abort(),l&&l.removeEventListener("abort",_)},"finalize");h.on("error",y=>{n(new wt(`request to ${i.url} failed, reason: ${y.message}`,"system",y)),g()}),OC(h,y=>{p&&p.body&&p.body.destroy(y)}),process.version<"v14"&&h.on("socket",y=>{let T;y.prependListener("end",()=>{T=y._eventsCount}),y.prependListener("close",P=>{if(p&&T<y._eventsCount&&!P){let x=new Error("Premature close");x.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",x)}})}),h.on("response",y=>{h.setTimeout(0);let T=Zb(y.rawHeaders);if(aa(y.statusCode)){let X=T.get("Location"),W=null;try{W=X===null?null:new URL(X,i.url)}catch{if(i.redirect!=="manual"){n(new wt(`uri requested responds with an invalid redirect URL: ${X}`,"invalid-redirect")),g();return}}switch(i.redirect){case"error":n(new wt(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),g();return;case"manual":break;case"follow":{if(W===null)break;if(i.counter>=i.follow){n(new wt(`maximum redirect reached at: ${i.url}`,"max-redirect")),g();return}let G={headers:new kt(i.headers),follow:i.follow,counter:i.counter+1,agent:i.agent,compress:i.compress,method:i.method,body:Zo(i),signal:i.signal,size:i.size,referrer:i.referrer,referrerPolicy:i.referrerPolicy};if(!Cb(i.url,W)||!$b(i.url,W))for(let ee of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ee);if(y.statusCode!==303&&i.body&&e.body instanceof Bt.default.Readable){n(new wt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),g();return}(y.statusCode===303||(y.statusCode===301||y.statusCode===302)&&i.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let K=oP(T);K&&(G.referrerPolicy=K),r(kd(new zn(W,G))),g();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}l&&y.once("end",()=>{l.removeEventListener("abort",_)});let P=(0,Bt.pipeline)(y,new Bt.PassThrough,X=>{X&&n(X)});process.version<"v12.10"&&y.on("aborted",_);let x={url:i.url,status:y.statusCode,statusText:y.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},N=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||N===null||y.statusCode===204||y.statusCode===304){p=new Ft(P,x),r(p);return}let L={flush:no.default.Z_SYNC_FLUSH,finishFlush:no.default.Z_SYNC_FLUSH};if(N==="gzip"||N==="x-gzip"){P=(0,Bt.pipeline)(P,no.default.createGunzip(L),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}if(N==="deflate"||N==="x-deflate"){let X=(0,Bt.pipeline)(y,new Bt.PassThrough,W=>{W&&n(W)});X.once("data",W=>{(W[0]&15)===8?P=(0,Bt.pipeline)(P,no.default.createInflate(),G=>{G&&n(G)}):P=(0,Bt.pipeline)(P,no.default.createInflateRaw(),G=>{G&&n(G)}),p=new Ft(P,x),r(p)}),X.once("end",()=>{p||(p=new Ft(P,x),r(p))});return}if(N==="br"){P=(0,Bt.pipeline)(P,no.default.createBrotliDecompress(),X=>{X&&n(X)}),p=new Ft(P,x),r(p);return}p=new Ft(P,x),r(p)}),Wb(h,i).catch(n)})}function OC(t,e){let r=ca.Buffer.from(`0\r
26
+ \r
27
+ `),n=!1,i=!1,s;t.on("response",c=>{let{headers:d}=c;n=d["transfer-encoding"]==="chunked"&&!d["content-length"]}),t.on("socket",c=>{let d=o(()=>{if(n&&!i){let p=new Error("Premature close");p.code="ERR_STREAM_PREMATURE_CLOSE",e(p)}},"onSocketClose"),l=o(p=>{i=ca.Buffer.compare(p.slice(-5),r)===0,!i&&s&&(i=ca.Buffer.compare(s.slice(-3),r.slice(0,3))===0&&ca.Buffer.compare(p.slice(-2),r.slice(3))===0),s=p},"onData");c.prependListener("close",d),c.on("data",l),t.on("close",()=>{c.removeListener("close",d),c.removeListener("data",l)})})}var lP,dP,no,Bt,ca,RC,fP=ht(()=>{lP=pt(require("node:http"),1),dP=pt(require("node:https"),1),no=pt(require("node:zlib"),1),Bt=pt(require("node:stream"),1),ca=require("node:buffer");Pb();du();Kb();fu();uP();Ed();cP();Cd();nu();au();$d();wd();RC=new Set(["data:","http:","https:"]);o(kd,"fetch");o(OC,"fixResponseChunkedTransferBadEnding")});var gP=k(Yo=>{"use strict";var CC=Yo&&Yo.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Jo;Object.defineProperty(Yo,"__esModule",{value:!0});Yo.Gaxios=void 0;var $C=CC(Qi()),kC=require("https"),oo=cd(),NC=Zv(),mP=require("stream"),hP=pd(),zC=o(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),DC=204,mu=class{static{o(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(e){this.defaults=e||{},this.interceptors={request:new hP.GaxiosInterceptorManager,response:new hP.GaxiosInterceptorManager}}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&Jo.mergeHeaders(s,r.headers),n&&Jo.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}async request(e={}){let r=await this.#n(e);return r=await this.#t(r),this.#r(this._request(r))}async _defaultAdapter(e){let r=e.fetchImplementation||this.defaults.fetchImplementation||await Jo.#u(),n={...e};delete n.data;let i=await r(e.url,n),s=await this.getResponseData(e,i);return Object.getOwnPropertyDescriptor(i,"data")?.configurable||Object.defineProperties(i,{data:{configurable:!0,writable:!0,enumerable:!0,value:s}}),Object.assign(i,{config:e,data:s})}async _request(e){try{let r;if(e.adapter?r=await e.adapter(e,this._defaultAdapter.bind(this)):r=await this._defaultAdapter(e),!e.validateStatus(r.status)){if(e.responseType==="stream"){let i=[];for await(let s of r.data)i.push(s);r.data=i.toString()}let n=oo.GaxiosError.extractAPIErrorFromResponse(r,`Request failed with status code ${r.status}`);throw new oo.GaxiosError(n?.message,e,r,n)}return r}catch(r){let n;r instanceof oo.GaxiosError?n=r:r instanceof Error?n=new oo.GaxiosError(r.message,e,void 0,r):n=new oo.GaxiosError("Unexpected Gaxios Error",e,void 0,r);let{shouldRetry:i,config:s}=await(0,NC.getRetryConfig)(n);if(i&&s)return n.config.retryConfig.currentRetryAttempt=s.retryConfig.currentRetryAttempt,e.retryConfig=n.config?.retryConfig,this.#o(e),this._request(e);throw e.errorRedactor&&e.errorRedactor(n),n}}async getResponseData(e,r){if(r.status===DC)return"";if(e.maxContentLength&&r.headers.has("content-length")&&e.maxContentLength<Number.parseInt(r.headers?.get("content-length")||""))throw new oo.GaxiosError("Response's `Content-Length` is over the limit.",e,Object.assign(r,{config:e}));switch(e.responseType){case"stream":return r.body;case"json":{let n=await r.text();try{return JSON.parse(n)}catch{return n}}case"arraybuffer":return r.arrayBuffer();case"blob":return r.blob();case"text":return r.text();default:return this.getResponseDataFromContentType(r)}}#e(e,r=[]){let n=new URL(e),i=[...r],s=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let c of s)i.push(c.trim());for(let c of i)if(c instanceof RegExp){if(c.test(n.toString()))return!1}else if(c instanceof URL){if(c.origin===n.origin)return!1}else if(c.startsWith("*.")||c.startsWith(".")){let d=c.replace(/^\*\./,".");if(n.hostname.endsWith(d))return!1}else if(c===n.origin||c===n.hostname||c===n.href)return!1;return!0}async#t(e){let r=Promise.resolve(e);for(let n of this.interceptors.request.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#r(e){let r=Promise.resolve(e);for(let n of this.interceptors.response.values())n&&(r=r.then(n.resolved,n.rejected));return r}async#n(e){let r=new Headers(this.defaults.headers);Jo.mergeHeaders(r,e.headers);let n=(0,$C.default)(!0,{},this.defaults,e);if(!n.url)throw new Error("URL is required.");if(n.baseURL&&(n.url=new URL(n.url,n.baseURL)),n.url=new URL(n.url),n.params)if(n.paramsSerializer){let c=n.paramsSerializer(n.params);c.startsWith("?")&&(c=c.slice(1));let d=n.url.toString().includes("?")?"&":"?";n.url=n.url+d+c}else{let c=n.url instanceof URL?n.url:new URL(n.url);for(let[d,l]of new URLSearchParams(n.params))c.searchParams.append(d,l);n.url=c}typeof e.maxContentLength=="number"&&(n.size=e.maxContentLength),typeof e.maxRedirects=="number"&&(n.follow=e.maxRedirects);let i=typeof n.data=="string"||n.data instanceof ArrayBuffer||n.data instanceof Blob||globalThis.File&&n.data instanceof File||n.data instanceof FormData||n.data instanceof mP.Readable||n.data instanceof ReadableStream||n.data instanceof String||n.data instanceof URLSearchParams||ArrayBuffer.isView(n.data)||["Blob","File","FormData"].includes(n.data?.constructor?.name||"");if(n.multipart?.length){let c=await zC();r.set("content-type",`multipart/related; boundary=${c}`),n.body=mP.Readable.from(this.getMultipartRequest(n.multipart,c))}else i?n.body=n.data:typeof n.data=="object"?r.get("Content-Type")==="application/x-www-form-urlencoded"?n.body=n.paramsSerializer?n.paramsSerializer(n.data):new URLSearchParams(n.data):(r.has("content-type")||r.set("content-type","application/json"),n.body=JSON.stringify(n.data)):n.data&&(n.body=n.data);n.validateStatus=n.validateStatus||this.validateStatus,n.responseType=n.responseType||"unknown",!r.has("accept")&&n.responseType==="json"&&r.set("accept","application/json");let s=n.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!n.agent)if(s&&this.#e(n.url,n.noProxy)){let c=await Jo.#s();this.agentCache.has(s)?n.agent=this.agentCache.get(s):(n.agent=new c(s,{cert:n.cert,key:n.key}),this.agentCache.set(s,n.agent))}else n.cert&&n.key&&(this.agentCache.has(n.key)?n.agent=this.agentCache.get(n.key):(n.agent=new kC.Agent({cert:n.cert,key:n.key}),this.agentCache.set(n.key,n.agent)));return typeof n.errorRedactor!="function"&&n.errorRedactor!==!1&&(n.errorRedactor=oo.defaultErrorRedactor),n.body&&!("duplex"in n)&&(n.duplex="half"),this.#o(n),Object.assign(n,{headers:r,url:n.url instanceof URL?n.url:new URL(n.url)})}#o(e){if(e.timeout){let r=AbortSignal.timeout(e.timeout);e.signal&&!e.signal.aborted?e.signal=AbortSignal.any([e.signal,r]):e.signal=r}}validateStatus(e){return e>=200&&e<300}async getResponseDataFromContentType(e){let r=e.headers.get("Content-Type");if(r===null)return e.text();if(r=r.toLowerCase(),r.includes("application/json")){let n=await e.text();try{n=JSON.parse(n)}catch{}return n}else return r.match(/^text\//)?e.text():e.blob()}async*getMultipartRequest(e,r){let n=`--${r}--`;for(let i of e){let s=i.headers.get("Content-Type")||"application/octet-stream";yield`--${r}\r
28
+ Content-Type: ${s}\r
29
+ \r
30
+ `,typeof i.content=="string"?yield i.content:yield*i.content,yield`\r
31
+ `}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>pt(vb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(fP(),pP))).default,this.#a}static mergeHeaders(e,...r){e=e instanceof Headers?e:new Headers(e);for(let n of r)(n instanceof Headers?n:new Headers(n)).forEach((s,c)=>{c==="set-cookie"?e.append(c,s):e.set(c,s)});return e}};Yo.Gaxios=mu;Jo=mu});var at=k(At=>{"use strict";var UC=At&&At.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),MC=At&&At.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&UC(e,t,r)};Object.defineProperty(At,"__esModule",{value:!0});At.instance=At.Gaxios=At.GaxiosError=void 0;At.request=LC;var yP=gP();Object.defineProperty(At,"Gaxios",{enumerable:!0,get:o(function(){return yP.Gaxios},"get")});var jC=cd();Object.defineProperty(At,"GaxiosError",{enumerable:!0,get:o(function(){return jC.GaxiosError},"get")});MC(pd(),At);At.instance=new yP.Gaxios;async function LC(t){return At.instance.request(t)}o(LC,"request")});var Nd=k((_P,hu)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,s="[BigNumber Error] ",c=s+"Number primitive has more than 15 significant digits: ",d=1e14,l=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,h=1e9;function g(W){var G,K,ee,Y=Q.prototype={constructor:Q,toString:null,valueOf:null},Se=new Q(1),te=20,q=4,B=-7,J=21,Z=-1e7,re=1e7,oe=!1,Ae=1,Oe=0,Fe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Ge="0123456789abcdefghijklmnopqrstuvwxyz",mt=!0;function Q(v,E){var w,D,R,$,j,I,O,U,z=this;if(!(z instanceof Q))return new Q(v,E);if(E==null){if(v&&v._isBigNumber===!0){z.s=v.s,!v.c||v.e>re?z.c=z.e=null:v.e<Z?z.c=[z.e=0]:(z.e=v.e,z.c=v.c.slice());return}if((I=typeof v=="number")&&v*0==0){if(z.s=1/v<0?(v=-v,-1):1,v===~~v){for($=0,j=v;j>=10;j/=10,$++);$>re?z.c=z.e=null:(z.e=$,z.c=[v]);return}U=String(v)}else{if(!r.test(U=String(v)))return ee(z,U,I);z.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}($=U.indexOf("."))>-1&&(U=U.replace(".","")),(j=U.search(/e/i))>0?($<0&&($=j),$+=+U.slice(j+1),U=U.substring(0,j)):$<0&&($=U.length)}else{if(x(E,2,Ge.length,"Base"),E==10&&mt)return z=new Q(v),Le(z,te+z.e+1,q);if(U=String(v),I=typeof v=="number"){if(v*0!=0)return ee(z,U,I,E);if(z.s=1/v<0?(U=U.slice(1),-1):1,Q.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(c+v)}else z.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(w=Ge.slice(0,E),$=j=0,O=U.length;j<O;j++)if(w.indexOf(D=U.charAt(j))<0){if(D=="."){if(j>$){$=O;continue}}else if(!R&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){R=!0,j=-1,$=0;continue}return ee(z,String(v),I,E)}I=!1,U=K(U,E,10,z.s),($=U.indexOf("."))>-1?U=U.replace(".",""):$=U.length}for(j=0;U.charCodeAt(j)===48;j++);for(O=U.length;U.charCodeAt(--O)===48;);if(U=U.slice(j,++O)){if(O-=j,I&&Q.DEBUG&&O>15&&(v>p||v!==i(v)))throw Error(c+z.s*v);if(($=$-j-1)>re)z.c=z.e=null;else if($<Z)z.c=[z.e=0];else{if(z.e=$,z.c=[],j=($+1)%l,$<0&&(j+=l),j<O){for(j&&z.c.push(+U.slice(0,j)),O-=l;j<O;)z.c.push(+U.slice(j,j+=l));j=l-(U=U.slice(j)).length}else j-=O;for(;j--;U+="0");z.c.push(+U)}}else z.c=[z.e=0]}o(Q,"BigNumber"),Q.clone=g,Q.ROUND_UP=0,Q.ROUND_DOWN=1,Q.ROUND_CEIL=2,Q.ROUND_FLOOR=3,Q.ROUND_HALF_UP=4,Q.ROUND_HALF_DOWN=5,Q.ROUND_HALF_EVEN=6,Q.ROUND_HALF_CEIL=7,Q.ROUND_HALF_FLOOR=8,Q.EUCLID=9,Q.config=Q.set=function(v){var E,w;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(E="DECIMAL_PLACES")&&(w=v[E],x(w,0,h,E),te=w),v.hasOwnProperty(E="ROUNDING_MODE")&&(w=v[E],x(w,0,8,E),q=w),v.hasOwnProperty(E="EXPONENTIAL_AT")&&(w=v[E],w&&w.pop?(x(w[0],-h,0,E),x(w[1],0,h,E),B=w[0],J=w[1]):(x(w,-h,h,E),B=-(J=w<0?-w:w))),v.hasOwnProperty(E="RANGE"))if(w=v[E],w&&w.pop)x(w[0],-h,-1,E),x(w[1],1,h,E),Z=w[0],re=w[1];else if(x(w,-h,h,E),w)Z=-(re=w<0?-w:w);else throw Error(s+E+" cannot be zero: "+w);if(v.hasOwnProperty(E="CRYPTO"))if(w=v[E],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))oe=w;else throw oe=!w,Error(s+"crypto unavailable");else oe=w;else throw Error(s+E+" not true or false: "+w);if(v.hasOwnProperty(E="MODULO_MODE")&&(w=v[E],x(w,0,9,E),Ae=w),v.hasOwnProperty(E="POW_PRECISION")&&(w=v[E],x(w,0,h,E),Oe=w),v.hasOwnProperty(E="FORMAT"))if(w=v[E],typeof w=="object")Fe=w;else throw Error(s+E+" not an object: "+w);if(v.hasOwnProperty(E="ALPHABET"))if(w=v[E],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))mt=w.slice(0,10)=="0123456789",Ge=w;else throw Error(s+E+" invalid: "+w)}else throw Error(s+"Object expected: "+v);return{DECIMAL_PLACES:te,ROUNDING_MODE:q,EXPONENTIAL_AT:[B,J],RANGE:[Z,re],CRYPTO:oe,MODULO_MODE:Ae,POW_PRECISION:Oe,FORMAT:Fe,ALPHABET:Ge}},Q.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!Q.DEBUG)return!0;var E,w,D=v.c,R=v.e,$=v.s;e:if({}.toString.call(D)=="[object Array]"){if(($===1||$===-1)&&R>=-h&&R<=h&&R===i(R)){if(D[0]===0){if(R===0&&D.length===1)return!0;break e}if(E=(R+1)%l,E<1&&(E+=l),String(D[0]).length==E){for(E=0;E<D.length;E++)if(w=D[E],w<0||w>=d||w!==i(w))break e;if(w!==0)return!0}}}else if(D===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(s+"Invalid BigNumber: "+v)},Q.maximum=Q.max=function(){return it(arguments,-1)},Q.minimum=Q.min=function(){return it(arguments,1)},Q.random=function(){var v=9007199254740992,E=Math.random()*v&2097151?function(){return i(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var D,R,$,j,I,O=0,U=[],z=new Q(Se);if(w==null?w=te:x(w,0,h),j=n(w/l),oe)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(j*=2));O<j;)I=D[O]*131072+(D[O+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),D[O]=R[0],D[O+1]=R[1]):(U.push(I%1e14),O+=2);O=j/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(j*=7);O<j;)I=(D[O]&31)*281474976710656+D[O+1]*1099511627776+D[O+2]*4294967296+D[O+3]*16777216+(D[O+4]<<16)+(D[O+5]<<8)+D[O+6],I>=9e15?crypto.randomBytes(7).copy(D,O):(U.push(I%1e14),O+=7);O=j/7}else throw oe=!1,Error(s+"crypto unavailable");if(!oe)for(;O<j;)I=E(),I<9e15&&(U[O++]=I%1e14);for(j=U[--O],w%=l,j&&w&&(I=f[l-w],U[O]=i(j/I)*I);U[O]===0;U.pop(),O--);if(O<0)U=[$=0];else{for($=-1;U[0]===0;U.splice(0,1),$-=l);for(O=1,I=U[0];I>=10;I/=10,O++);O<l&&($-=l-O)}return z.e=$,z.c=U,z}}(),Q.sum=function(){for(var v=1,E=arguments,w=new Q(E[0]);v<E.length;)w=w.plus(E[v++]);return w},K=function(){var v="0123456789";function E(w,D,R,$){for(var j,I=[0],O,U=0,z=w.length;U<z;){for(O=I.length;O--;I[O]*=D);for(I[0]+=$.indexOf(w.charAt(U++)),j=0;j<I.length;j++)I[j]>R-1&&(I[j+1]==null&&(I[j+1]=0),I[j+1]+=I[j]/R|0,I[j]%=R)}return I.reverse()}return o(E,"toBaseOut"),function(w,D,R,$,j){var I,O,U,z,V,ie,se,De,Je=w.indexOf("."),Ye=te,ze=q;for(Je>=0&&(z=Oe,Oe=0,w=w.replace(".",""),De=new Q(D),ie=De.pow(w.length-Je),Oe=z,De.c=E(X(T(ie.c),ie.e,"0"),10,R,v),De.e=De.c.length),se=E(w,D,R,j?(I=Ge,v):(I=v,Ge)),U=z=se.length;se[--z]==0;se.pop());if(!se[0])return I.charAt(0);if(Je<0?--U:(ie.c=se,ie.e=U,ie.s=$,ie=G(ie,De,Ye,ze,R),se=ie.c,V=ie.r,U=ie.e),O=U+Ye+1,Je=se[O],z=R/2,V=V||O<0||se[O+1]!=null,V=ze<4?(Je!=null||V)&&(ze==0||ze==(ie.s<0?3:2)):Je>z||Je==z&&(ze==4||V||ze==6&&se[O-1]&1||ze==(ie.s<0?8:7)),O<1||!se[0])w=V?X(I.charAt(1),-Ye,I.charAt(0)):I.charAt(0);else{if(se.length=O,V)for(--R;++se[--O]>R;)se[O]=0,O||(++U,se=[1].concat(se));for(z=se.length;!se[--z];);for(Je=0,w="";Je<=z;w+=I.charAt(se[Je++]));w=X(w,U,I.charAt(0))}return w}}(),G=function(){function v(D,R,$){var j,I,O,U,z=0,V=D.length,ie=R%_,se=R/_|0;for(D=D.slice();V--;)O=D[V]%_,U=D[V]/_|0,j=se*O+U*ie,I=ie*O+j%_*_+z,z=(I/$|0)+(j/_|0)+se*U,D[V]=I%$;return z&&(D=[z].concat(D)),D}o(v,"multiply");function E(D,R,$,j){var I,O;if($!=j)O=$>j?1:-1;else for(I=O=0;I<$;I++)if(D[I]!=R[I]){O=D[I]>R[I]?1:-1;break}return O}o(E,"compare");function w(D,R,$,j){for(var I=0;$--;)D[$]-=I,I=D[$]<R[$]?1:0,D[$]=I*j+D[$]-R[$];for(;!D[0]&&D.length>1;D.splice(0,1));}return o(w,"subtract"),function(D,R,$,j,I){var O,U,z,V,ie,se,De,Je,Ye,ze,je,lt,mo,ho,go,zt,Br,Pt=D.s==R.s?1:-1,dt=D.c,qe=R.c;if(!dt||!dt[0]||!qe||!qe[0])return new Q(!D.s||!R.s||(dt?qe&&dt[0]==qe[0]:!qe)?NaN:dt&&dt[0]==0||!qe?Pt*0:Pt/0);for(Je=new Q(Pt),Ye=Je.c=[],U=D.e-R.e,Pt=$+U+1,I||(I=d,U=y(D.e/l)-y(R.e/l),Pt=Pt/l|0),z=0;qe[z]==(dt[z]||0);z++);if(qe[z]>(dt[z]||0)&&U--,Pt<0)Ye.push(1),V=!0;else{for(ho=dt.length,zt=qe.length,z=0,Pt+=2,ie=i(I/(qe[0]+1)),ie>1&&(qe=v(qe,ie,I),dt=v(dt,ie,I),zt=qe.length,ho=dt.length),mo=zt,ze=dt.slice(0,zt),je=ze.length;je<zt;ze[je++]=0);Br=qe.slice(),Br=[0].concat(Br),go=qe[0],qe[1]>=I/2&&go++;do{if(ie=0,O=E(qe,ze,zt,je),O<0){if(lt=ze[0],zt!=je&&(lt=lt*I+(ze[1]||0)),ie=i(lt/go),ie>1)for(ie>=I&&(ie=I-1),se=v(qe,ie,I),De=se.length,je=ze.length;E(se,ze,De,je)==1;)ie--,w(se,zt<De?Br:qe,De,I),De=se.length,O=1;else ie==0&&(O=ie=1),se=qe.slice(),De=se.length;if(De<je&&(se=[0].concat(se)),w(ze,se,je,I),je=ze.length,O==-1)for(;E(qe,ze,zt,je)<1;)ie++,w(ze,zt<je?Br:qe,je,I),je=ze.length}else O===0&&(ie++,ze=[0]);Ye[z++]=ie,ze[0]?ze[je++]=dt[mo]||0:(ze=[dt[mo]],je=1)}while((mo++<ho||ze[0]!=null)&&Pt--);V=ze[0]!=null,Ye[0]||Ye.splice(0,1)}if(I==d){for(z=1,Pt=Ye[0];Pt>=10;Pt/=10,z++);Le(Je,$+(Je.e=z+U*l-1)+1,j,V)}else Je.e=U,Je.r=+V;return Je}}();function et(v,E,w,D){var R,$,j,I,O;if(w==null?w=q:x(w,0,8),!v.c)return v.toString();if(R=v.c[0],j=v.e,E==null)O=T(v.c),O=D==1||D==2&&(j<=B||j>=J)?L(O,j):X(O,j,"0");else if(v=Le(new Q(v),E,w),$=v.e,O=T(v.c),I=O.length,D==1||D==2&&(E<=$||$<=B)){for(;I<E;O+="0",I++);O=L(O,$)}else if(E-=j+(D===2&&$>j),O=X(O,$,"0"),$+1>I){if(--E>0)for(O+=".";E--;O+="0");}else if(E+=$-I,E>0)for($+1==I&&(O+=".");E--;O+="0");return v.s<0&&R?"-"+O:O}o(et,"format");function it(v,E){for(var w,D,R=1,$=new Q(v[0]);R<v.length;R++)D=new Q(v[R]),(!D.s||(w=P($,D))===E||w===0&&$.s===E)&&($=D);return $}o(it,"maxOrMin");function Nt(v,E,w){for(var D=1,R=E.length;!E[--R];E.pop());for(R=E[0];R>=10;R/=10,D++);return(w=D+w*l-1)>re?v.c=v.e=null:w<Z?v.c=[v.e=0]:(v.e=w,v.c=E),v}o(Nt,"normalise"),ee=function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,E=/^([^.]+)\.$/,w=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,O){var U,z=I?j:j.replace(R,"");if(D.test(z))$.s=isNaN(z)?null:z<0?-1:1;else{if(!I&&(z=z.replace(v,function(V,ie,se){return U=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!O||O==U?ie:V}),O&&(U=O,z=z.replace(E,"$1").replace(w,"0.$1")),j!=z))return new Q(z,U);if(Q.DEBUG)throw Error(s+"Not a"+(O?" base "+O:"")+" number: "+j);$.s=null}$.c=$.e=null}}();function Le(v,E,w,D){var R,$,j,I,O,U,z,V=v.c,ie=f;if(V){e:{for(R=1,I=V[0];I>=10;I/=10,R++);if($=E-R,$<0)$+=l,j=E,O=V[U=0],z=i(O/ie[R-j-1]%10);else if(U=n(($+1)/l),U>=V.length)if(D){for(;V.length<=U;V.push(0));O=z=0,R=1,$%=l,j=$-l+1}else break e;else{for(O=I=V[U],R=1;I>=10;I/=10,R++);$%=l,j=$-l+R,z=j<0?0:i(O/ie[R-j-1]%10)}if(D=D||E<0||V[U+1]!=null||(j<0?O:O%ie[R-j-1]),D=w<4?(z||D)&&(w==0||w==(v.s<0?3:2)):z>5||z==5&&(w==4||D||w==6&&($>0?j>0?O/ie[R-j]:0:V[U-1])%10&1||w==(v.s<0?8:7)),E<1||!V[0])return V.length=0,D?(E-=v.e+1,V[0]=ie[(l-E%l)%l],v.e=-E||0):V[0]=v.e=0,v;if($==0?(V.length=U,I=1,U--):(V.length=U+1,I=ie[l-$],V[U]=j>0?i(O/ie[R-j]%ie[j])*I:0),D)for(;;)if(U==0){for($=1,j=V[0];j>=10;j/=10,$++);for(j=V[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(v.e++,V[0]==d&&(V[0]=1));break}else{if(V[U]+=I,V[U]!=d)break;V[U--]=0,I=1}for($=V.length;V[--$]===0;V.pop());}v.e>re?v.c=v.e=null:v.e<Z&&(v.c=[v.e=0])}return v}o(Le,"round");function Be(v){var E,w=v.e;return w===null?v.toString():(E=T(v.c),E=w<=B||w>=J?L(E,w):X(E,w,"0"),v.s<0?"-"+E:E)}return o(Be,"valueOf"),Y.absoluteValue=Y.abs=function(){var v=new Q(this);return v.s<0&&(v.s=1),v},Y.comparedTo=function(v,E){return P(this,new Q(v,E))},Y.decimalPlaces=Y.dp=function(v,E){var w,D,R,$=this;if(v!=null)return x(v,0,h),E==null?E=q:x(E,0,8),Le(new Q($),v+$.e+1,E);if(!(w=$.c))return null;if(D=((R=w.length-1)-y(this.e/l))*l,R=w[R])for(;R%10==0;R/=10,D--);return D<0&&(D=0),D},Y.dividedBy=Y.div=function(v,E){return G(this,new Q(v,E),te,q)},Y.dividedToIntegerBy=Y.idiv=function(v,E){return G(this,new Q(v,E),0,1)},Y.exponentiatedBy=Y.pow=function(v,E){var w,D,R,$,j,I,O,U,z,V=this;if(v=new Q(v),v.c&&!v.isInteger())throw Error(s+"Exponent not an integer: "+Be(v));if(E!=null&&(E=new Q(E)),I=v.e>14,!V.c||!V.c[0]||V.c[0]==1&&!V.e&&V.c.length==1||!v.c||!v.c[0])return z=new Q(Math.pow(+Be(V),I?v.s*(2-N(v)):+Be(v))),E?z.mod(E):z;if(O=v.s<0,E){if(E.c?!E.c[0]:!E.s)return new Q(NaN);D=!O&&V.isInteger()&&E.isInteger(),D&&(V=V.mod(E))}else{if(v.e>9&&(V.e>0||V.e<-1||(V.e==0?V.c[0]>1||I&&V.c[1]>=24e7:V.c[0]<8e13||I&&V.c[0]<=9999975e7)))return $=V.s<0&&N(v)?-0:0,V.e>-1&&($=1/$),new Q(O?1/$:$);Oe&&($=n(Oe/l+2))}for(I?(w=new Q(.5),O&&(v.s=1),U=N(v)):(R=Math.abs(+Be(v)),U=R%2),z=new Q(Se);;){if(U){if(z=z.times(V),!z.c)break;$?z.c.length>$&&(z.c.length=$):D&&(z=z.mod(E))}if(R){if(R=i(R/2),R===0)break;U=R%2}else if(v=v.times(w),Le(v,v.e+1,1),v.e>14)U=N(v);else{if(R=+Be(v),R===0)break;U=R%2}V=V.times(V),$?V.c&&V.c.length>$&&(V.c.length=$):D&&(V=V.mod(E))}return D?z:(O&&(z=Se.div(z)),E?z.mod(E):$?Le(z,Oe,q,j):z)},Y.integerValue=function(v){var E=new Q(this);return v==null?v=q:x(v,0,8),Le(E,E.e+1,v)},Y.isEqualTo=Y.eq=function(v,E){return P(this,new Q(v,E))===0},Y.isFinite=function(){return!!this.c},Y.isGreaterThan=Y.gt=function(v,E){return P(this,new Q(v,E))>0},Y.isGreaterThanOrEqualTo=Y.gte=function(v,E){return(E=P(this,new Q(v,E)))===1||E===0},Y.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},Y.isLessThan=Y.lt=function(v,E){return P(this,new Q(v,E))<0},Y.isLessThanOrEqualTo=Y.lte=function(v,E){return(E=P(this,new Q(v,E)))===-1||E===0},Y.isNaN=function(){return!this.s},Y.isNegative=function(){return this.s<0},Y.isPositive=function(){return this.s>0},Y.isZero=function(){return!!this.c&&this.c[0]==0},Y.minus=function(v,E){var w,D,R,$,j=this,I=j.s;if(v=new Q(v,E),E=v.s,!I||!E)return new Q(NaN);if(I!=E)return v.s=-E,j.plus(v);var O=j.e/l,U=v.e/l,z=j.c,V=v.c;if(!O||!U){if(!z||!V)return z?(v.s=-E,v):new Q(V?j:NaN);if(!z[0]||!V[0])return V[0]?(v.s=-E,v):new Q(z[0]?j:q==3?-0:0)}if(O=y(O),U=y(U),z=z.slice(),I=O-U){for(($=I<0)?(I=-I,R=z):(U=O,R=V),R.reverse(),E=I;E--;R.push(0));R.reverse()}else for(D=($=(I=z.length)<(E=V.length))?I:E,I=E=0;E<D;E++)if(z[E]!=V[E]){$=z[E]<V[E];break}if($&&(R=z,z=V,V=R,v.s=-v.s),E=(D=V.length)-(w=z.length),E>0)for(;E--;z[w++]=0);for(E=d-1;D>I;){if(z[--D]<V[D]){for(w=D;w&&!z[--w];z[w]=E);--z[w],z[D]+=d}z[D]-=V[D]}for(;z[0]==0;z.splice(0,1),--U);return z[0]?Nt(v,z,U):(v.s=q==3?-1:1,v.c=[v.e=0],v)},Y.modulo=Y.mod=function(v,E){var w,D,R=this;return v=new Q(v,E),!R.c||!v.s||v.c&&!v.c[0]?new Q(NaN):!v.c||R.c&&!R.c[0]?new Q(R):(Ae==9?(D=v.s,v.s=1,w=G(R,v,0,3),v.s=D,w.s*=D):w=G(R,v,0,Ae),v=R.minus(w.times(v)),!v.c[0]&&Ae==1&&(v.s=R.s),v)},Y.multipliedBy=Y.times=function(v,E){var w,D,R,$,j,I,O,U,z,V,ie,se,De,Je,Ye,ze=this,je=ze.c,lt=(v=new Q(v,E)).c;if(!je||!lt||!je[0]||!lt[0])return!ze.s||!v.s||je&&!je[0]&&!lt||lt&&!lt[0]&&!je?v.c=v.e=v.s=null:(v.s*=ze.s,!je||!lt?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(D=y(ze.e/l)+y(v.e/l),v.s*=ze.s,O=je.length,V=lt.length,O<V&&(De=je,je=lt,lt=De,R=O,O=V,V=R),R=O+V,De=[];R--;De.push(0));for(Je=d,Ye=_,R=V;--R>=0;){for(w=0,ie=lt[R]%Ye,se=lt[R]/Ye|0,j=O,$=R+j;$>R;)U=je[--j]%Ye,z=je[j]/Ye|0,I=se*U+z*ie,U=ie*U+I%Ye*Ye+De[$]+w,w=(U/Je|0)+(I/Ye|0)+se*z,De[$--]=U%Je;De[$]=w}return w?++D:De.splice(0,1),Nt(v,De,D)},Y.negated=function(){var v=new Q(this);return v.s=-v.s||null,v},Y.plus=function(v,E){var w,D=this,R=D.s;if(v=new Q(v,E),E=v.s,!R||!E)return new Q(NaN);if(R!=E)return v.s=-E,D.minus(v);var $=D.e/l,j=v.e/l,I=D.c,O=v.c;if(!$||!j){if(!I||!O)return new Q(R/0);if(!I[0]||!O[0])return O[0]?v:new Q(I[0]?D:R*0)}if($=y($),j=y(j),I=I.slice(),R=$-j){for(R>0?(j=$,w=O):(R=-R,w=I),w.reverse();R--;w.push(0));w.reverse()}for(R=I.length,E=O.length,R-E<0&&(w=O,O=I,I=w,E=R),R=0;E;)R=(I[--E]=I[E]+O[E]+R)/d|0,I[E]=d===I[E]?0:I[E]%d;return R&&(I=[R].concat(I),++j),Nt(v,I,j)},Y.precision=Y.sd=function(v,E){var w,D,R,$=this;if(v!=null&&v!==!!v)return x(v,1,h),E==null?E=q:x(E,0,8),Le(new Q($),v,E);if(!(w=$.c))return null;if(R=w.length-1,D=R*l+1,R=w[R]){for(;R%10==0;R/=10,D--);for(R=w[0];R>=10;R/=10,D++);}return v&&$.e+1>D&&(D=$.e+1),D},Y.shiftedBy=function(v){return x(v,-p,p),this.times("1e"+v)},Y.squareRoot=Y.sqrt=function(){var v,E,w,D,R,$=this,j=$.c,I=$.s,O=$.e,U=te+4,z=new Q("0.5");if(I!==1||!j||!j[0])return new Q(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+Be($)),I==0||I==1/0?(E=T(j),(E.length+O)%2==0&&(E+="0"),I=Math.sqrt(+E),O=y((O+1)/2)-(O<0||O%2),I==1/0?E="5e"+O:(E=I.toExponential(),E=E.slice(0,E.indexOf("e")+1)+O),w=new Q(E)):w=new Q(I+""),w.c[0]){for(O=w.e,I=O+U,I<3&&(I=0);;)if(R=w,w=z.times(R.plus(G($,R,U,1))),T(R.c).slice(0,I)===(E=T(w.c)).slice(0,I))if(w.e<O&&--I,E=E.slice(I-3,I+1),E=="9999"||!D&&E=="4999"){if(!D&&(Le(R,R.e+te+2,0),R.times(R).eq($))){w=R;break}U+=4,I+=4,D=1}else{(!+E||!+E.slice(1)&&E.charAt(0)=="5")&&(Le(w,w.e+te+2,1),v=!w.times(w).eq($));break}}return Le(w,w.e+te+1,q,v)},Y.toExponential=function(v,E){return v!=null&&(x(v,0,h),v++),et(this,v,E,1)},Y.toFixed=function(v,E){return v!=null&&(x(v,0,h),v=v+this.e+1),et(this,v,E)},Y.toFormat=function(v,E,w){var D,R=this;if(w==null)v!=null&&E&&typeof E=="object"?(w=E,E=null):v&&typeof v=="object"?(w=v,v=E=null):w=Fe;else if(typeof w!="object")throw Error(s+"Argument not an object: "+w);if(D=R.toFixed(v,E),R.c){var $,j=D.split("."),I=+w.groupSize,O=+w.secondaryGroupSize,U=w.groupSeparator||"",z=j[0],V=j[1],ie=R.s<0,se=ie?z.slice(1):z,De=se.length;if(O&&($=I,I=O,O=$,De-=$),I>0&&De>0){for($=De%I||I,z=se.substr(0,$);$<De;$+=I)z+=U+se.substr($,I);O>0&&(z+=U+se.slice($)),ie&&(z="-"+z)}D=V?z+(w.decimalSeparator||"")+((O=+w.fractionGroupSize)?V.replace(new RegExp("\\d{"+O+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):V):z}return(w.prefix||"")+D+(w.suffix||"")},Y.toFraction=function(v){var E,w,D,R,$,j,I,O,U,z,V,ie,se=this,De=se.c;if(v!=null&&(I=new Q(v),!I.isInteger()&&(I.c||I.s!==1)||I.lt(Se)))throw Error(s+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+Be(I));if(!De)return new Q(se);for(E=new Q(Se),U=w=new Q(Se),D=O=new Q(Se),ie=T(De),$=E.e=ie.length-se.e-1,E.c[0]=f[(j=$%l)<0?l+j:j],v=!v||I.comparedTo(E)>0?$>0?E:U:I,j=re,re=1/0,I=new Q(ie),O.c[0]=0;z=G(I,E,0,1),R=w.plus(z.times(D)),R.comparedTo(v)!=1;)w=D,D=R,U=O.plus(z.times(R=U)),O=R,E=I.minus(z.times(R=E)),I=R;return R=G(v.minus(w),D,0,1),O=O.plus(R.times(U)),w=w.plus(R.times(D)),O.s=U.s=se.s,$=$*2,V=G(U,D,$,q).minus(se).abs().comparedTo(G(O,w,$,q).minus(se).abs())<1?[U,D]:[O,w],re=j,V},Y.toNumber=function(){return+Be(this)},Y.toPrecision=function(v,E){return v!=null&&x(v,1,h),et(this,v,E,2)},Y.toString=function(v){var E,w=this,D=w.s,R=w.e;return R===null?D?(E="Infinity",D<0&&(E="-"+E)):E="NaN":(v==null?E=R<=B||R>=J?L(T(w.c),R):X(T(w.c),R,"0"):v===10&&mt?(w=Le(new Q(w),te+R+1,q),E=X(T(w.c),w.e,"0")):(x(v,2,Ge.length,"Base"),E=K(X(T(w.c),R,"0"),10,v,D,!0)),D<0&&w.c[0]&&(E="-"+E)),E},Y.valueOf=Y.toJSON=function(){return Be(this)},Y._isBigNumber=!0,W!=null&&Q.set(W),Q}o(g,"clone");function y(W){var G=W|0;return W>0||W===G?G:G-1}o(y,"bitFloor");function T(W){for(var G,K,ee=1,Y=W.length,Se=W[0]+"";ee<Y;){for(G=W[ee++]+"",K=l-G.length;K--;G="0"+G);Se+=G}for(Y=Se.length;Se.charCodeAt(--Y)===48;);return Se.slice(0,Y+1||1)}o(T,"coeffToString");function P(W,G){var K,ee,Y=W.c,Se=G.c,te=W.s,q=G.s,B=W.e,J=G.e;if(!te||!q)return null;if(K=Y&&!Y[0],ee=Se&&!Se[0],K||ee)return K?ee?0:-q:te;if(te!=q)return te;if(K=te<0,ee=B==J,!Y||!Se)return ee?0:!Y^K?1:-1;if(!ee)return B>J^K?1:-1;for(q=(B=Y.length)<(J=Se.length)?B:J,te=0;te<q;te++)if(Y[te]!=Se[te])return Y[te]>Se[te]^K?1:-1;return B==J?0:B>J^K?1:-1}o(P,"compare");function x(W,G,K,ee){if(W<G||W>K||W!==i(W))throw Error(s+(ee||"Argument")+(typeof W=="number"?W<G||W>K?" out of range: ":" not an integer: ":" not a primitive number: ")+String(W))}o(x,"intCheck");function N(W){var G=W.c.length-1;return y(W.e/l)==G&&W.c[G]%2!=0}o(N,"isOdd");function L(W,G){return(W.length>1?W.charAt(0)+"."+W.slice(1):W)+(G<0?"e":"e+")+G}o(L,"toExponential");function X(W,G,K){var ee,Y;if(G<0){for(Y=K+".";++G;Y+=K);W=Y+W}else if(ee=W.length,++G>ee){for(Y=K,G-=ee;--G;Y+=K);W+=Y}else G<ee&&(W=W.slice(0,G)+"."+W.slice(G));return W}o(X,"toFixedPoint"),e=g(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof hu<"u"&&hu.exports?hu.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(_P)});var SP=k((Z9,PP)=>{var vP=Nd(),bP=PP.exports;(function(){"use strict";function t(p){return p<10?"0"+p:p}o(t,"f");var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,r=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,i,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function d(p){return r.lastIndex=0,r.test(p)?'"'+p.replace(r,function(f){var _=s[f];return typeof _=="string"?_:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}o(d,"quote");function l(p,f){var _,h,g,y,T=n,P,x=f[p],N=x!=null&&(x instanceof vP||vP.isBigNumber(x));switch(x&&typeof x=="object"&&typeof x.toJSON=="function"&&(x=x.toJSON(p)),typeof c=="function"&&(x=c.call(f,p,x)),typeof x){case"string":return N?x:d(x);case"number":return isFinite(x)?String(x):"null";case"boolean":case"null":case"bigint":return String(x);case"object":if(!x)return"null";if(n+=i,P=[],Object.prototype.toString.apply(x)==="[object Array]"){for(y=x.length,_=0;_<y;_+=1)P[_]=l(_,x)||"null";return g=P.length===0?"[]":n?`[
32
+ `+n+P.join(`,
33
+ `+n)+`
34
+ `+T+"]":"["+P.join(",")+"]",n=T,g}if(c&&typeof c=="object")for(y=c.length,_=0;_<y;_+=1)typeof c[_]=="string"&&(h=c[_],g=l(h,x),g&&P.push(d(h)+(n?": ":":")+g));else Object.keys(x).forEach(function(L){var X=l(L,x);X&&P.push(d(L)+(n?": ":":")+X)});return g=P.length===0?"{}":n?`{
35
+ `+n+P.join(`,
36
+ `+n)+`
37
+ `+T+"}":"{"+P.join(",")+"}",n=T,g}}o(l,"str"),typeof bP.stringify!="function"&&(bP.stringify=function(p,f,_){var h;if(n="",i="",typeof _=="number")for(h=0;h<_;h+=1)i+=" ";else typeof _=="string"&&(i=_);if(c=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return l("",{"":p})})})()});var TP=k((J9,EP)=>{var gu=null,FC=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,BC=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/,qC=o(function(t){"use strict";var e={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(t!=null){if(t.strict===!0&&(e.strict=!0),t.storeAsString===!0&&(e.storeAsString=!0),e.alwaysParseAsBig=t.alwaysParseAsBig===!0?t.alwaysParseAsBig:!1,e.useNativeBigInt=t.useNativeBigInt===!0?t.useNativeBigInt:!1,typeof t.constructorAction<"u")if(t.constructorAction==="error"||t.constructorAction==="ignore"||t.constructorAction==="preserve")e.constructorAction=t.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${t.constructorAction}`);if(typeof t.protoAction<"u")if(t.protoAction==="error"||t.protoAction==="ignore"||t.protoAction==="preserve")e.protoAction=t.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${t.protoAction}`)}var r,n,i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
38
+ `,r:"\r",t:" "},s,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:s}},"error"),d=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=s.charAt(r),r+=1,n},"next"),l=o(function(){var T,P="";for(n==="-"&&(P="-",d("-"));n>="0"&&n<="9";)P+=n,d();if(n===".")for(P+=".";d()&&n>="0"&&n<="9";)P+=n;if(n==="e"||n==="E")for(P+=n,d(),(n==="-"||n==="+")&&(P+=n,d());n>="0"&&n<="9";)P+=n,d();if(T=+P,!isFinite(T))c("Bad number");else return gu==null&&(gu=Nd()),P.length>15?e.storeAsString?P:e.useNativeBigInt?BigInt(P):new gu(P):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new gu(T):T},"number"),p=o(function(){var T,P,x="",N;if(n==='"')for(var L=r;d();){if(n==='"')return r-1>L&&(x+=s.substring(L,r-1)),d(),x;if(n==="\\"){if(r-1>L&&(x+=s.substring(L,r-1)),d(),n==="u"){for(N=0,P=0;P<4&&(T=parseInt(d(),16),!!isFinite(T));P+=1)N=N*16+T;x+=String.fromCharCode(N)}else if(typeof i[n]=="string")x+=i[n];else break;L=r}}c("Bad string")},"string"),f=o(function(){for(;n&&n<=" ";)d()},"white"),_=o(function(){switch(n){case"t":return d("t"),d("r"),d("u"),d("e"),!0;case"f":return d("f"),d("a"),d("l"),d("s"),d("e"),!1;case"n":return d("n"),d("u"),d("l"),d("l"),null}c("Unexpected '"+n+"'")},"word"),h,g=o(function(){var T=[];if(n==="["){if(d("["),f(),n==="]")return d("]"),T;for(;n;){if(T.push(h()),f(),n==="]")return d("]"),T;d(","),f()}}c("Bad array")},"array"),y=o(function(){var T,P=Object.create(null);if(n==="{"){if(d("{"),f(),n==="}")return d("}"),P;for(;n;){if(T=p(),f(),d(":"),e.strict===!0&&Object.hasOwnProperty.call(P,T)&&c('Duplicate key "'+T+'"'),FC.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?h():P[T]=h():BC.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?h():P[T]=h():P[T]=h(),f(),n==="}")return d("}"),P;d(","),f()}}c("Bad object")},"object");return h=o(function(){switch(f(),n){case"{":return y();case"[":return g();case'"':return p();case"-":return l();default:return n>="0"&&n<="9"?l():_()}},"value"),function(T,P){var x;return s=T+"",r=0,n=" ",x=h(),f(),n&&c("Syntax error"),typeof P=="function"?o(function N(L,X){var W,G,K=L[X];return K&&typeof K=="object"&&Object.keys(K).forEach(function(ee){G=N(K,ee),G!==void 0?K[ee]=G:delete K[ee]}),P.call(L,X,K)},"walk")({"":x},""):x}},"json_parse");EP.exports=qC});var AP=k((X9,yu)=>{var xP=SP().stringify,wP=TP();yu.exports=function(t){return{parse:wP(t),stringify:xP}};yu.exports.parse=wP();yu.exports.stringify=xP});var zd=k(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.GCE_LINUX_BIOS_PATHS=void 0;yr.isGoogleCloudServerless=OP;yr.isGoogleComputeEngineLinux=CP;yr.isGoogleComputeEngineMACAddress=$P;yr.isGoogleComputeEngine=kP;yr.detectGCPResidency=HC;var IP=require("fs"),RP=require("os");yr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var VC=/^42:01/;function OP(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(OP,"isGoogleCloudServerless");function CP(){if((0,RP.platform)()!=="linux")return!1;try{(0,IP.statSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,IP.readFileSync)(yr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(CP,"isGoogleComputeEngineLinux");function $P(){let t=(0,RP.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(VC.test(r))return!0}return!1}o($P,"isGoogleComputeEngineMACAddress");function kP(){return CP()||$P()}o(kP,"isGoogleComputeEngine");function HC(){return OP()||kP()}o(HC,"detectGCPResidency")});var NP=k(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.Colours=void 0;var Et=class t{static{o(this,"Colours")}static isEnabled(e){return e&&e.isTTY&&(typeof e.getColorDepth=="function"?e.getColorDepth()>2:!0)}static refresh(){t.enabled=t.isEnabled(process==null?void 0:process.stderr),this.enabled?(t.reset="\x1B[0m",t.bright="\x1B[1m",t.dim="\x1B[2m",t.red="\x1B[31m",t.green="\x1B[32m",t.yellow="\x1B[33m",t.blue="\x1B[34m",t.magenta="\x1B[35m",t.cyan="\x1B[36m",t.white="\x1B[37m",t.grey="\x1B[90m"):(t.reset="",t.bright="",t.dim="",t.red="",t.green="",t.yellow="",t.blue="",t.magenta="",t.cyan="",t.white="",t.grey="")}};_u.Colours=Et;Et.enabled=!1;Et.reset="";Et.bright="";Et.dim="";Et.red="";Et.green="";Et.yellow="";Et.blue="";Et.magenta="";Et.cyan="";Et.white="";Et.grey="";Et.refresh()});var MP=k(He=>{"use strict";var GC=He&&He.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WC=He&&He.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zP=He&&He.__importStar||function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&GC(r,e,n[i]);return WC(r,e),r}}();Object.defineProperty(He,"__esModule",{value:!0});He.env=He.DebugLogBackendBase=He.placeholder=He.AdhocDebugLogger=He.LogSeverity=void 0;He.getNodeBackend=Ud;He.getDebugBackend=KC;He.getStructuredBackend=JC;He.setBackend=YC;He.log=UP;var ZC=require("events"),la=zP(require("process")),DP=zP(require("util")),qt=NP(),_r;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(_r||(He.LogSeverity=_r={}));var da=class extends ZC.EventEmitter{static{o(this,"AdhocDebugLogger")}constructor(e,r){super(),this.namespace=e,this.upstream=r,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:o((n,i)=>this.on(n,i),"on")}),this.func.debug=(...n)=>this.invokeSeverity(_r.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(_r.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(_r.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(_r.ERROR,...n),this.func.sublog=n=>UP(n,this.func)}invoke(e,...r){if(this.upstream)try{this.upstream(e,...r)}catch{}try{this.emit("log",e,r)}catch{}}invokeSeverity(e,...r){this.invoke({severity:e},...r)}};He.AdhocDebugLogger=da;He.placeholder=new da("",()=>{}).func;var Xo=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=la.env[He.env.nodeEnables])!==null&&e!==void 0?e:"*";r==="all"&&(r="*"),this.filters=r.split(",")}log(e,r,...n){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let i=this.cached.get(e);i||(i=this.makeLogger(e),this.cached.set(e,i)),i(r,...n)}catch(i){console.error(i)}}};He.DebugLogBackendBase=Xo;var Dd=class extends Xo{static{o(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(e){return this.enabledRegexp.test(e)}makeLogger(e){return this.enabledRegexp.test(e)?(r,...n)=>{var i;let s=`${qt.Colours.green}${e}${qt.Colours.reset}`,c=`${qt.Colours.yellow}${la.pid}${qt.Colours.reset}`,d;switch(r.severity){case _r.ERROR:d=`${qt.Colours.red}${r.severity}${qt.Colours.reset}`;break;case _r.INFO:d=`${qt.Colours.magenta}${r.severity}${qt.Colours.reset}`;break;case _r.WARNING:d=`${qt.Colours.yellow}${r.severity}${qt.Colours.reset}`;break;default:d=(i=r.severity)!==null&&i!==void 0?i:_r.DEFAULT;break}let l=DP.formatWithOptions({colors:qt.Colours.enabled},...n),p=Object.assign({},r);delete p.severity;let f=Object.getOwnPropertyNames(p).length?JSON.stringify(p):"",_=f?`${qt.Colours.grey}${f}${qt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,s,d,l,f?` ${_}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function Ud(){return new Dd}o(Ud,"getNodeBackend");var Md=class extends Xo{static{o(this,"DebugBackend")}constructor(e){super(),this.debugPkg=e}makeLogger(e){let r=this.debugPkg(e);return(n,...i)=>{r(i[0],...i.slice(1))}}setFilters(){var e;let r=(e=la.env.NODE_DEBUG)!==null&&e!==void 0?e:"";la.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function KC(t){return new Md(t)}o(KC,"getDebugBackend");var jd=class extends Xo{static{o(this,"StructuredBackend")}constructor(e){var r;super(),this.upstream=(r=e)!==null&&r!==void 0?r:void 0}makeLogger(e){var r;let n=(r=this.upstream)===null||r===void 0?void 0:r.makeLogger(e);return(i,...s)=>{var c;let d=(c=i.severity)!==null&&c!==void 0?c:_r.INFO,l=Object.assign({severity:d,message:DP.format(...s)},i),p=JSON.stringify(l);n?n(i,p):console.log("%s",p)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function JC(t){return new jd(t)}o(JC,"getStructuredBackend");He.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var Ld=new Map,Vt;function YC(t){Vt=t,Ld.clear()}o(YC,"setBackend");function UP(t,e){if(!Vt&&!la.env[He.env.nodeEnables]||!t)return He.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=Ld.get(t);if(r)return r.func;if(Vt===null)return He.placeholder;Vt===void 0&&(Vt=Ud());let n=(()=>{let i;return new da(t,(c,...d)=>{if(i!==Vt){if(Vt===null)return;Vt===void 0&&(Vt=Ud()),i=Vt}Vt?.log(t,c,...d)})})();return Ld.set(t,n),n.func}o(UP,"log")});var Fd=k(io=>{"use strict";var XC=io&&io.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QC=io&&io.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&XC(e,t,r)};Object.defineProperty(io,"__esModule",{value:!0});QC(MP(),io)});var fa=k(pe=>{"use strict";var LP=pe&&pe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),e$=pe&&pe.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),t$=pe&&pe.__importStar||function(){var t=o(function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&LP(r,e,n[i]);return e$(r,e),r}}(),r$=pe&&pe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LP(e,t,r)};Object.defineProperty(pe,"__esModule",{value:!0});pe.gcpResidencyCache=pe.METADATA_SERVER_DETECTION=pe.HEADERS=pe.HEADER_VALUE=pe.HEADER_NAME=pe.SECONDARY_HOST_ADDRESS=pe.HOST_ADDRESS=pe.BASE_PATH=void 0;pe.instance=u$;pe.project=c$;pe.universe=l$;pe.bulk=d$;pe.isAvailable=f$;pe.resetIsAvailableCache=m$;pe.getGCPResidency=Vd;pe.setGCPResidency=FP;pe.requestTimeout=BP;var Bd=at(),n$=AP(),o$=zd(),i$=t$(Fd());pe.BASE_PATH="/computeMetadata/v1";pe.HOST_ADDRESS="http://169.254.169.254";pe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";pe.HEADER_NAME="Metadata-Flavor";pe.HEADER_VALUE="Google";pe.HEADERS=Object.freeze({[pe.HEADER_NAME]:pe.HEADER_VALUE});var jP=i$.log("gcp-metadata");pe.METADATA_SERVER_DETECTION=Object.freeze({"assume-present":"don't try to ping the metadata server, but assume it's present",none:"don't try to ping the metadata server, but don't try to use it either","bios-only":"treat the result of a BIOS probe as canonical (don't fall back to pinging)","ping-only":"skip the BIOS probe, and go straight to pinging"});function qd(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||pe.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(pe.BASE_PATH,t).href}o(qd,"getBaseUrl");function a$(t){Object.keys(t).forEach(e=>{switch(e){case"params":case"property":case"headers":break;case"qs":throw new Error("'qs' is not a valid configuration option. Please use 'params' instead.");default:throw new Error(`'${e}' is not a valid configuration option.`)}})}o(a$,"validate");async function pa(t,e={},r=3,n=!1){let i=new Headers(pe.HEADERS),s="",c={};if(typeof t=="object"){let _=t;new Headers(_.headers).forEach((h,g)=>i.set(g,h)),s=_.metadataKey,c=_.params||c,r=_.noResponseRetries||r,n=_.fastFail||n}else s=t;typeof e=="string"?s+=`/${e}`:(a$(e),e.property&&(s+=`/${e.property}`),new Headers(e.headers).forEach((_,h)=>i.set(h,_)),c=e.params||c);let d=n?s$:Bd.request,l={url:`${qd()}/${s}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:BP()};jP.info("instance request %j",l);let p=await d(l);jP.info("instance metadata is %s",p.data);let f=p.headers.get(pe.HEADER_NAME);if(f!==pe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${pe.HEADER_NAME} header. Expected '${pe.HEADER_VALUE}', got ${f?`'${f}'`:"no header"}`);if(typeof p.data=="string")try{return n$.parse(p.data)}catch{}return p.data}o(pa,"metadataAccessor");async function s$(t){let e={...t,url:t.url?.toString().replace(qd(),qd(pe.SECONDARY_HOST_ADDRESS))},r=(0,Bd.request)(t),n=(0,Bd.request)(e);return Promise.any([r,n])}o(s$,"fastFailMetadataRequest");function u$(t){return pa("instance",t)}o(u$,"instance");function c$(t){return pa("project",t)}o(c$,"project");function l$(t){return pa("universe",t)}o(l$,"universe");async function d$(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await pa(r),i=r.metadataKey;e[i]=n})())),e}o(d$,"bulk");function p$(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(p$,"detectGCPAvailableRetries");var vu;async function f$(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in pe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(pe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return Vd();case"ping-only":}}try{return vu===void 0&&(vu=pa("instance",void 0,p$(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await vu,!0}catch(t){let e=t;if(process.env.DEBUG_AUTH&&console.info(e),e.type==="request-timeout"||e.response&&e.response.status===404)return!1;if(!(e.response&&e.response.status===404)&&(!e.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(e.code.toString()))){let r="UNKNOWN";e.code&&(r=e.code.toString()),process.emitWarning(`received unexpected error = ${e.message} code = ${r}`,"MetadataLookupWarning")}return!1}}o(f$,"isAvailable");function m$(){vu=void 0}o(m$,"resetIsAvailableCache");pe.gcpResidencyCache=null;function Vd(){return pe.gcpResidencyCache===null&&FP(),pe.gcpResidencyCache}o(Vd,"getGCPResidency");function FP(t=null){pe.gcpResidencyCache=t!==null?t:(0,o$.detectGCPResidency)()}o(FP,"setGCPResidency");function BP(){return Vd()?0:3e3}o(BP,"requestTimeout");r$(zd(),pe)});var HP=k(bu=>{"use strict";bu.byteLength=g$;bu.toByteArray=_$;bu.fromByteArray=P$;var Or=[],or=[],h$=typeof Uint8Array<"u"?Uint8Array:Array,Hd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ao=0,qP=Hd.length;ao<qP;++ao)Or[ao]=Hd[ao],or[Hd.charCodeAt(ao)]=ao;var ao,qP;or[45]=62;or[95]=63;function VP(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}o(VP,"getLens");function g$(t){var e=VP(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(g$,"byteLength");function y$(t,e,r){return(e+r)*3/4-r}o(y$,"_byteLength");function _$(t){var e,r=VP(t),n=r[0],i=r[1],s=new h$(y$(t,n,i)),c=0,d=i>0?n-4:n,l;for(l=0;l<d;l+=4)e=or[t.charCodeAt(l)]<<18|or[t.charCodeAt(l+1)]<<12|or[t.charCodeAt(l+2)]<<6|or[t.charCodeAt(l+3)],s[c++]=e>>16&255,s[c++]=e>>8&255,s[c++]=e&255;return i===2&&(e=or[t.charCodeAt(l)]<<2|or[t.charCodeAt(l+1)]>>4,s[c++]=e&255),i===1&&(e=or[t.charCodeAt(l)]<<10|or[t.charCodeAt(l+1)]<<4|or[t.charCodeAt(l+2)]>>2,s[c++]=e>>8&255,s[c++]=e&255),s}o(_$,"toByteArray");function v$(t){return Or[t>>18&63]+Or[t>>12&63]+Or[t>>6&63]+Or[t&63]}o(v$,"tripletToBase64");function b$(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(v$(n));return i.join("")}o(b$,"encodeChunk");function P$(t){for(var e,r=t.length,n=r%3,i=[],s=16383,c=0,d=r-n;c<d;c+=s)i.push(b$(t,c,c+s>d?d:c+s));return n===1?(e=t[r-1],i.push(Or[e>>2]+Or[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Or[e>>10]+Or[e>>4&63]+Or[e<<2&63]+"=")),i.join("")}o(P$,"fromByteArray")});var Wd=k(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});Gd.fromArrayBufferToHex=S$;function S$(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(S$,"fromArrayBufferToHex")});var GP=k(Pu=>{"use strict";Object.defineProperty(Pu,"__esModule",{value:!0});Pu.BrowserCrypto=void 0;var Qo=HP(),E$=Wd(),Zd=class t{static{o(this,"BrowserCrypto")}constructor(){if(typeof window>"u"||window.crypto===void 0||window.crypto.subtle===void 0)throw new Error("SubtleCrypto not found. Make sure it's an https:// website.")}async sha256DigestBase64(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return Qo.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),Qo.fromByteArray(r)}static padBase64(e){for(;e.length%4!==0;)e+="=";return e}async verify(e,r,n){let i={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},s=new TextEncoder().encode(r),c=Qo.toByteArray(t.padBase64(n)),d=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,d,c,s)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),s=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,s,i);return Qo.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=Qo.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return Qo.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,E$.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,s=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",s,i.encode(r))}};Pu.BrowserCrypto=Zd});var WP=k(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.NodeCrypto=void 0;var ei=require("crypto"),Kd=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return ei.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return ei.randomBytes(e).toString("base64")}async verify(e,r,n){let i=ei.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=ei.createSign("RSA-SHA256");return n.update(r),n.end(),n.sign(e,"base64")}decodeBase64StringUtf8(e){return Buffer.from(e,"base64").toString("utf-8")}encodeBase64StringUtf8(e){return Buffer.from(e,"utf-8").toString("base64")}async sha256DigestHex(e){return ei.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:x$(e);return T$(ei.createHmac("sha256",n).update(r).digest())}};Su.NodeCrypto=Kd;function T$(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(T$,"toArrayBuffer");function x$(t){return Buffer.from(t)}o(x$,"toBuffer")});var ma=k(nn=>{"use strict";var w$=nn&&nn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),A$=nn&&nn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w$(e,t,r)};Object.defineProperty(nn,"__esModule",{value:!0});nn.createCrypto=O$;nn.hasBrowserCrypto=ZP;var I$=GP(),R$=WP();A$(Wd(),nn);function O$(){return ZP()?new I$.BrowserCrypto:new R$.NodeCrypto}o(O$,"createCrypto");function ZP(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(ZP,"hasBrowserCrypto")});var ti=k((Jd,JP)=>{var Eu=require("buffer"),Cr=Eu.Buffer;function KP(t,e){for(var r in t)e[r]=t[r]}o(KP,"copyProps");Cr.from&&Cr.alloc&&Cr.allocUnsafe&&Cr.allocUnsafeSlow?JP.exports=Eu:(KP(Eu,Jd),Jd.Buffer=so);function so(t,e,r){return Cr(t,e,r)}o(so,"SafeBuffer");so.prototype=Object.create(Cr.prototype);KP(Cr,so);so.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Cr(t,e,r)};so.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Cr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};so.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Cr(t)};so.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Eu.SlowBuffer(t)}});var XP=k((b5,YP)=>{"use strict";function Yd(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(Yd,"getParamSize");var C$={ES256:Yd(256),ES384:Yd(384),ES512:Yd(521)};function $$(t){var e=C$[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o($$,"getParamBytesForAlg");YP.exports=$$});var Xd=k((S5,oS)=>{"use strict";var Tu=ti().Buffer,eS=XP(),xu=128,tS=0,k$=32,N$=16,z$=2,rS=N$|k$|tS<<6,wu=z$|tS<<6;function D$(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(D$,"base64Url");function nS(t){if(Tu.isBuffer(t))return t;if(typeof t=="string")return Tu.from(t,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}o(nS,"signatureAsBuffer");function U$(t,e){t=nS(t);var r=eS(e),n=r+1,i=t.length,s=0;if(t[s++]!==rS)throw new Error('Could not find expected "seq"');var c=t[s++];if(c===(xu|1)&&(c=t[s++]),i-s<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-s)+'" remaining');if(t[s++]!==wu)throw new Error('Could not find expected "int" for "r"');var d=t[s++];if(i-s-2<d)throw new Error('"r" specified length of "'+d+'", only "'+(i-s-2)+'" available');if(n<d)throw new Error('"r" specified length of "'+d+'", max of "'+n+'" is acceptable');var l=s;if(s+=d,t[s++]!==wu)throw new Error('Could not find expected "int" for "s"');var p=t[s++];if(i-s!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(i-s)+'"');if(n<p)throw new Error('"s" specified length of "'+p+'", max of "'+n+'" is acceptable');var f=s;if(s+=p,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var _=r-d,h=r-p,g=Tu.allocUnsafe(_+d+h+p);for(s=0;s<_;++s)g[s]=0;t.copy(g,s,l+Math.max(-_,0),l+d),s=r;for(var y=s;s<y+h;++s)g[s]=0;return t.copy(g,s,f+Math.max(-h,0),f+p),g=g.toString("base64"),g=D$(g),g}o(U$,"derToJose");function QP(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=xu;return i&&--n,n}o(QP,"countPadding");function M$(t,e){t=nS(t);var r=eS(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=QP(t,0,r),s=QP(t,r,t.length),c=r-i,d=r-s,l=2+c+1+1+d,p=l<xu,f=Tu.allocUnsafe((p?2:3)+l),_=0;return f[_++]=rS,p?f[_++]=l:(f[_++]=xu|1,f[_++]=l&255),f[_++]=wu,f[_++]=c,i<0?(f[_++]=0,_+=t.copy(f,_,0,r)):_+=t.copy(f,_,i,r),f[_++]=wu,f[_++]=d,s<0?(f[_++]=0,t.copy(f,_,r)):t.copy(f,_,r+s),f}o(M$,"joseToDer");oS.exports={derToJose:U$,joseToDer:M$}});var vr=k(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.LRUCache=void 0;on.snakeToCamel=aS;on.originalOrCamelOptions=B$;on.removeUndefinedValuesInObject=q$;on.isValidFile=V$;on.getWellKnownCertificateConfigFileLocation=H$;var j$=require("fs"),L$=require("os"),Qd=require("path"),F$="certificate_config.json",iS="gcloud";function aS(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(aS,"snakeToCamel");function B$(t){function e(r){let n=t||{};return n[r]??n[aS(r)]}return o(e,"get"),{get:e}}o(B$,"originalOrCamelOptions");var ep=class{static{o(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(e){this.capacity=e.capacity,this.maxAge=e.maxAge}#t(e,r){this.#e.delete(e),this.#e.set(e,{value:r,lastAccessed:Date.now()})}set(e,r){this.#t(e,r),this.#r()}get(e){let r=this.#e.get(e);if(r)return this.#t(e,r.value),this.#r(),r.value}#r(){let e=this.maxAge?Date.now()-this.maxAge:0,r=this.#e.entries().next();for(;!r.done&&(this.#e.size>this.capacity||r.value[1].lastAccessed<e);)this.#e.delete(r.value[0]),r=this.#e.entries().next()}};on.LRUCache=ep;function q$(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(q$,"removeUndefinedValuesInObject");async function V$(t){try{return(await j$.promises.lstat(t)).isFile()}catch{return!1}}o(V$,"isValidFile");function H$(){let t=process.env.CLOUDSDK_CONFIG||(G$()?Qd.join(process.env.APPDATA||"",iS):Qd.join(process.env.HOME||"",".config",iS));return Qd.join(t,F$)}o(H$,"getWellKnownCertificateConfigFileLocation");function G$(){return L$.platform().startsWith("win")}o(G$,"_isWindows")});var sS=k((w5,W$)=>{W$.exports={name:"google-auth-library",version:"10.5.0",author:"Google Inc.",description:"Google APIs Authentication Client Library for Node.js",engines:{node:">=18"},main:"./build/src/index.js",types:"./build/src/index.d.ts",repository:"googleapis/google-auth-library-nodejs.git",keywords:["google","api","google apis","client","client library"],dependencies:{"base64-js":"^1.3.0","ecdsa-sig-formatter":"^1.0.11",gaxios:"^7.0.0","gcp-metadata":"^8.0.0","google-logging-utils":"^1.0.0",gtoken:"^8.0.0",jws:"^4.0.0"},devDependencies:{"@types/base64-js":"^1.2.5","@types/jws":"^3.1.0","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.1","@types/node":"^22.0.0","@types/sinon":"^17.0.0","assert-rejects":"^1.0.0",c8:"^10.0.0",codecov:"^3.0.2",gts:"^6.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.0","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",keypair:"^1.0.4",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.0",puppeteer:"^24.0.0",sinon:"^21.0.0","ts-loader":"^8.0.0",typescript:"5.8.2",webpack:"^5.21.2","webpack-cli":"^4.0.0"},files:["build/src","!build/src/**/*.map"],scripts:{test:"c8 mocha build/test",clean:"gts clean",prepare:"npm run compile",lint:"gts check --no-inline-config",compile:"tsc -p .",fix:"gts fix",pretest:"npm run compile -- --sourceMap",docs:"jsdoc -c .jsdoc.js","samples-setup":"cd samples/ && npm link ../ && npm run setup && cd ../","samples-test":"cd samples/ && npm link ../ && npm test && cd ../","system-test":"mocha build/system-test --timeout 60000","presystem-test":"npm run compile -- --sourceMap",webpack:"webpack","browser-test":"karma start","docs-test":"echo 'disabled until linkinator is fixed'","predocs-test":"npm run docs",prelint:"cd samples; npm link ../; npm install"},license:"Apache-2.0"}});var tp=k(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.USER_AGENT=Dn.PRODUCT_NAME=Dn.pkg=void 0;var uS=sS();Dn.pkg=uS;var cS="google-api-nodejs-client";Dn.PRODUCT_NAME=cS;var Z$=`${cS}/${uS.version}`;Dn.USER_AGENT=Z$});var Ht=k(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});br.AuthClient=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=br.DEFAULT_UNIVERSE=void 0;var K$=require("events"),rp=at(),J$=vr(),Y$=Fd(),np=tp();br.DEFAULT_UNIVERSE="googleapis.com";br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=5*60*1e3;var op=class t extends K$.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=br.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=br.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,J$.originalOrCamelOptions)(e);this.apiKey=e.apiKey,this.projectId=r.get("project_id")??null,this.quotaProjectId=r.get("quota_project_id"),this.credentials=r.get("credentials")??{},this.universeDomain=r.get("universe_domain")??br.DEFAULT_UNIVERSE,this.transporter=e.transporter??new rp.Gaxios(e.transporterOptions),r.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(t.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(t.DEFAULT_RESPONSE_INTERCEPTOR)),e.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=e.forceRefreshOnFailure??!1}fetch(...e){let r=e[0],n=e[1],i,s=new Headers;return typeof r=="string"?i=new URL(r):r instanceof URL?i=r:r&&r.url&&(i=new URL(r.url)),r&&typeof r=="object"&&"headers"in r&&rp.Gaxios.mergeHeaders(s,r.headers),n&&rp.Gaxios.mergeHeaders(s,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:s,url:i}):this.request({...n,headers:s,url:i})}setCredentials(e){this.credentials=e}addSharedMetadataHeaders(e){return!e.has("x-goog-user-project")&&this.quotaProjectId&&e.set("x-goog-user-project",this.quotaProjectId),e}addUserProjectAndAuthHeaders(e,r){let n=r.get("x-goog-user-project"),i=r.get("authorization");return n&&e.set("x-goog-user-project",n),i&&e.set("authorization",i),e}static log=(0,Y$.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:o(async e=>{if(!e.headers.has("x-goog-api-client")){let n=process.version.replace(/^v/,"");e.headers.set("x-goog-api-client",`gl-node/${n}`)}let r=e.headers.get("User-Agent");r?r.includes(`${np.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${np.USER_AGENT}`):e.headers.set("User-Agent",np.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],s=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=s;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,s,c):t.log.info("[%s] request %j",s,c)}catch{}return e},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] response %j",n,i,e.data):t.log.info("[%s] response %j",i,e.data)}catch{}return e},"resolved"),rejected:o(async e=>{try{let r=e.config,n=r[t.RequestMethodNameSymbol],i=r[t.RequestLogIdSymbol];n?t.log.info("%s [%s] error %j",n,i,e.response?.data):t.log.error("[%s] error %j",i,e.response?.data)}catch{}throw e},"rejected")};static setMethodName(e,r){try{let n=e;n[t.RequestMethodNameSymbol]=r}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};br.AuthClient=op});var ap=k(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.LoginTicket=void 0;var ip=class{static{o(this,"LoginTicket")}envelope;payload;constructor(e,r){this.envelope=e,this.payload=r}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let e=this.getPayload();return e&&e.sub?e.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};Au.LoginTicket=ip});var uo=k($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.OAuth2Client=$r.ClientAuthentication=$r.CertificateFormat=$r.CodeChallengeMethod=void 0;var lS=at(),X$=require("querystring"),Q$=require("stream"),ek=Xd(),dS=vr(),sp=ma(),ri=Ht(),tk=ap(),pS;(function(t){t.Plain="plain",t.S256="S256"})(pS||($r.CodeChallengeMethod=pS={}));var an;(function(t){t.PEM="PEM",t.JWK="JWK"})(an||($r.CertificateFormat=an={}));var ha;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ha||($r.ClientAuthentication=ha={}));var up=class t extends ri.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=an.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(e={},r,n){super(typeof e=="object"?e:{}),typeof e!="object"&&(e={clientId:e,clientSecret:r,redirectUri:n}),this._clientId=e.clientId||e.client_id,this._clientSecret=e.clientSecret||e.client_secret,this.redirectUri=e.redirectUri||e.redirect_uris?.[0],this.endpoints={tokenInfoUrl:"https://oauth2.googleapis.com/tokeninfo",oauth2AuthBaseUrl:"https://accounts.google.com/o/oauth2/v2/auth",oauth2TokenUrl:"https://oauth2.googleapis.com/token",oauth2RevokeUrl:"https://oauth2.googleapis.com/revoke",oauth2FederatedSignonPemCertsUrl:"https://www.googleapis.com/oauth2/v1/certs",oauth2FederatedSignonJwkCertsUrl:"https://www.googleapis.com/oauth2/v3/certs",oauth2IapPublicKeyUrl:"https://www.gstatic.com/iap/verify/public_key",...e.endpoints},this.clientAuthentication=e.clientAuthentication||ha.ClientSecretPost,this.issuers=e.issuers||["accounts.google.com","https://accounts.google.com",this.universeDomain]}static GOOGLE_TOKEN_INFO_URL="https://oauth2.googleapis.com/tokeninfo";static CLOCK_SKEW_SECS_=300;static DEFAULT_MAX_TOKEN_LIFETIME_SECS_=86400;generateAuthUrl(e={}){if(e.code_challenge_method&&!e.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return e.response_type=e.response_type||"code",e.client_id=e.client_id||this._clientId,e.redirect_uri=e.redirect_uri||this.redirectUri,Array.isArray(e.scope)&&(e.scope=e.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+X$.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,sp.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),s=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:s}}getToken(e,r){let n=typeof e=="string"?{code:e}:e;if(r)this.getTokenAsync(n).then(i=>r(null,i.tokens,i.res),i=>r(i,null,i.response));else return this.getTokenAsync(n)}async getTokenAsync(e){let r=this.endpoints.oauth2TokenUrl.toString(),n=new Headers,i={client_id:e.client_id||this._clientId,code_verifier:e.codeVerifier,code:e.code,grant_type:"authorization_code",redirect_uri:e.redirect_uri||this.redirectUri};if(this.clientAuthentication===ha.ClientSecretBasic){let l=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${l.toString("base64")}`)}this.clientAuthentication===ha.ClientSecretPost&&(i.client_secret=this._clientSecret);let s={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,dS.removeUndefinedValuesInObject)(i)),headers:n};ri.AuthClient.setMethodName(s,"getTokenAsync");let c=await this.transporter.request(s),d=c.data;return c.data&&c.data.expires_in&&(d.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete d.expires_in),this.emit("tokens",d),{tokens:d,res:c}}async refreshToken(e){if(!e)return this.refreshTokenNoCache(e);if(this.refreshTokenPromises.has(e))return this.refreshTokenPromises.get(e);let r=this.refreshTokenNoCache(e).then(n=>(this.refreshTokenPromises.delete(e),n),n=>{throw this.refreshTokenPromises.delete(e),n});return this.refreshTokenPromises.set(e,r),r}async refreshTokenNoCache(e){if(!e)throw new Error("No refresh token is set.");let r=this.endpoints.oauth2TokenUrl.toString(),n={refresh_token:e,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},i;try{let c={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,dS.removeUndefinedValuesInObject)(n))};ri.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof lS.GaxiosError&&c.message==="invalid_grant"&&c.response?.data&&/ReAuth/i.test(c.response.data.error_description)&&(c.message=JSON.stringify(c.response.data)),c}let s=i.data;return i.data&&i.data.expires_in&&(s.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete s.expires_in),this.emit("tokens",s),{tokens:s,res:i}}refreshAccessToken(e){if(e)this.refreshAccessTokenAsync().then(r=>e(null,r.credentials,r.res),e);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let e=await this.refreshToken(this.credentials.refresh_token),r=e.tokens;return r.refresh_token=this.credentials.refresh_token,this.credentials=r,{credentials:this.credentials,res:e.res}}getAccessToken(e){if(e)this.getAccessTokenAsync().then(r=>e(null,r.token,r.res),e);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let n=await this.processAndValidateRefreshHandler();if(n?.access_token)return this.setCredentials(n),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let r=await this.refreshAccessTokenAsync();if(!r.credentials||r.credentials&&!r.credentials.access_token)throw new Error("Could not refresh access token.");return{token:r.credentials.access_token,res:r.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(e){return(await this.getRequestMetadataAsync(e)).headers}async getRequestMetadataAsync(e){let r=this.credentials;if(!r.access_token&&!r.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(r.access_token&&!this.isTokenExpiring()){r.token_type=r.token_type||"Bearer";let d=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(d)}}if(this.refreshHandler){let d=await this.processAndValidateRefreshHandler();if(d?.access_token){this.setCredentials(d);let l=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(l)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let n=null,i=null;try{n=await this.refreshToken(r.refresh_token),i=n.tokens}catch(d){let l=d;throw l.response&&(l.response.status===403||l.response.status===404)&&(l.message=`Could not refresh access token: ${l.message}`),l}let s=this.credentials;s.token_type=s.token_type||"Bearer",i.refresh_token=s.refresh_token,this.credentials=i;let c=new Headers({authorization:s.token_type+" "+i.access_token});return{headers:this.addSharedMetadataHeaders(c),res:n.res}}static getRevokeTokenUrl(e){return new t().getRevokeTokenURL(e).toString()}getRevokeTokenURL(e){let r=new URL(this.endpoints.oauth2RevokeUrl);return r.searchParams.append("token",e),r}revokeToken(e,r){let n={...t.RETRY_CONFIG,url:this.getRevokeTokenURL(e).toString(),method:"POST"};if(ri.AuthClient.setMethodName(n,"revokeToken"),r)this.transporter.request(n).then(i=>r(null,i),r);else return this.transporter.request(n)}revokeCredentials(e){if(e)this.revokeCredentialsAsync().then(r=>e(null,r),e);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let e=this.credentials.access_token;if(this.credentials={},e)return this.revokeToken(e);throw new Error("No access token to revoke.")}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){try{let n=await this.getRequestMetadataAsync();return e.headers=lS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,n.headers),this.apiKey&&e.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(e)}catch(n){let i=n.response;if(i){let s=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),d=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,l=i.config.data instanceof Q$.Readable,p=s===401||s===403;if(!r&&p&&!l&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&p&&!l&&d){let f=await this.processAndValidateRefreshHandler();return f?.access_token&&this.setCredentials(f),this.requestAsync(e,!0)}}throw n}}verifyIdToken(e,r){if(r&&typeof r!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(r)this.verifyIdTokenAsync(e).then(n=>r(null,n),r);else return this.verifyIdTokenAsync(e)}async verifyIdTokenAsync(e){if(!e.idToken)throw new Error("The verifyIdToken method requires an ID Token");let r=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(e.idToken,r.certs,e.audience,this.issuers,e.maxExpiry)}async getTokenInfo(e){let{data:r}=await this.transporter.request({...t.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${e}`},url:this.endpoints.tokenInfoUrl.toString()}),n=Object.assign({expiry_date:new Date().getTime()+r.expires_in*1e3,scopes:r.scope.split(" ")},r);return delete n.expires_in,delete n.scope,n}getFederatedSignonCerts(e){if(e)this.getFederatedSignonCertsAsync().then(r=>e(null,r.certs,r.res),e);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let e=new Date().getTime(),r=(0,sp.hasBrowserCrypto)()?an.JWK:an.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case an.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case an.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let p={...t.RETRY_CONFIG,url:i};ri.AuthClient.setMethodName(p,"getFederatedSignonCertsAsync"),n=await this.transporter.request(p)}catch(p){throw p instanceof Error&&(p.message=`Failed to retrieve verification certificates: ${p.message}`),p}let s=n?.headers.get("cache-control"),c=-1;if(s){let p=/max-age=(?<maxAge>[0-9]+)/.exec(s)?.groups?.maxAge;p&&(c=Number(p)*1e3)}let d={};switch(r){case an.PEM:d=n.data;break;case an.JWK:for(let p of n.data.keys)d[p.kid]=p;break;default:throw new Error(`Unsupported certificate format ${r}`)}let l=new Date;return this.certificateExpiry=c===-1?null:new Date(l.getTime()+c),this.certificateCache=d,this.certificateCacheFormat=r,{certs:d,format:r,res:n}}getIapPublicKeys(e){if(e)this.getIapPublicKeysAsync().then(r=>e(null,r.pubkeys,r.res),e);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let e,r=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let n={...t.RETRY_CONFIG,url:r};ri.AuthClient.setMethodName(n,"getIapPublicKeysAsync"),e=await this.transporter.request(n)}catch(n){throw n instanceof Error&&(n.message=`Failed to retrieve verification certificates: ${n.message}`),n}return{pubkeys:e.data,res:e}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(e,r,n,i,s){let c=(0,sp.createCrypto)();s||(s=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let d=e.split(".");if(d.length!==3)throw new Error("Wrong number of segments in token: "+e);let l=d[0]+"."+d[1],p=d[2],f,_;try{f=JSON.parse(c.decodeBase64StringUtf8(d[0]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token envelope: ${d[0]}': ${L.message}`),L}if(!f)throw new Error("Can't parse token envelope: "+d[0]);try{_=JSON.parse(c.decodeBase64StringUtf8(d[1]))}catch(L){throw L instanceof Error&&(L.message=`Can't parse token payload '${d[0]}`),L}if(!_)throw new Error("Can't parse token payload: "+d[1]);if(!Object.prototype.hasOwnProperty.call(r,f.kid))throw new Error("No pem found for envelope: "+JSON.stringify(f));let h=r[f.kid];if(f.alg==="ES256"&&(p=ek.joseToDer(p,"ES256").toString("base64")),!await c.verify(h,l,p))throw new Error("Invalid token signature: "+e);if(!_.iat)throw new Error("No issue time in token: "+JSON.stringify(_));if(!_.exp)throw new Error("No expiration time in token: "+JSON.stringify(_));let y=Number(_.iat);if(isNaN(y))throw new Error("iat field using invalid format");let T=Number(_.exp);if(isNaN(T))throw new Error("exp field using invalid format");let P=new Date().getTime()/1e3;if(T>=P+s)throw new Error("Expiration time too far in future: "+JSON.stringify(_));let x=y-t.CLOCK_SKEW_SECS_,N=T+t.CLOCK_SKEW_SECS_;if(P<x)throw new Error("Token used too early, "+P+" < "+x+": "+JSON.stringify(_));if(P>N)throw new Error("Token used too late, "+P+" > "+N+": "+JSON.stringify(_));if(i&&i.indexOf(_.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+_.iss);if(typeof n<"u"&&n!==null){let L=_.aud,X=!1;if(n.constructor===Array?X=n.indexOf(L)>-1:X=L===n,!X)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new tk.LoginTicket(f,_)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let e=await this.refreshHandler();if(!e.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return e}}isTokenExpiring(){let e=this.credentials.expiry_date;return e?e<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};$r.OAuth2Client=up});var lp=k(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.Compute=void 0;var rk=at(),fS=fa(),nk=uo(),cp=class extends nk.OAuth2Client{static{o(this,"Compute")}serviceAccountEmail;scopes;constructor(e={}){super(e),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=e.serviceAccountEmail||"default",this.scopes=Array.isArray(e.scopes)?e.scopes:e.scopes?[e.scopes]:[]}async refreshTokenNoCache(){let e=`service-accounts/${this.serviceAccountEmail}/token`,r;try{let i={property:e};this.scopes.length>0&&(i.params={scopes:this.scopes.join(",")}),r=await fS.instance(i)}catch(i){throw i instanceof rk.GaxiosError&&(i.message=`Could not refresh access token: ${i.message}`,this.wrapError(i)),i}let n=r;return r&&r.expires_in&&(n.expiry_date=new Date().getTime()+r.expires_in*1e3,delete n.expires_in),this.emit("tokens",n),{tokens:n,res:null}}async fetchIdToken(e){let r=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${e}`,n;try{let i={property:r};n=await fS.instance(i)}catch(i){throw i instanceof Error&&(i.message=`Could not fetch ID token: ${i.message}`),i}return n}wrapError(e){let r=e.response;r&&r.status&&(e.status=r.status,r.status===403?e.message="A Forbidden error was returned while attempting to retrieve an access token for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have the correct permission scopes specified: "+e.message:r.status===404&&(e.message="A Not Found error was returned while attempting to retrieve an accesstoken for the Compute Engine built-in service account. This may be because the Compute Engine instance does not have any permission scopes specified: "+e.message))}};Iu.Compute=cp});var pp=k(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.IdTokenClient=void 0;var ok=uo(),dp=class extends ok.OAuth2Client{static{o(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(e){super(e),this.targetAudience=e.targetAudience,this.idTokenProvider=e.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let r=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:r,expiry_date:this.getIdTokenExpiryDate(r)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(e){let r=e.split(".")[1];if(r)return JSON.parse(Buffer.from(r,"base64").toString("ascii")).exp*1e3}};Ru.IdTokenClient=dp});var fp=k(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.GCPEnv=void 0;ni.clear=ik;ni.getEnv=ak;var mS=fa(),kr;(function(t){t.APP_ENGINE="APP_ENGINE",t.KUBERNETES_ENGINE="KUBERNETES_ENGINE",t.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",t.COMPUTE_ENGINE="COMPUTE_ENGINE",t.CLOUD_RUN="CLOUD_RUN",t.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",t.NONE="NONE"})(kr||(ni.GCPEnv=kr={}));var ga;function ik(){ga=void 0}o(ik,"clear");async function ak(){return ga||(ga=sk(),ga)}o(ak,"getEnv");async function sk(){let t=kr.NONE;return uk()?t=kr.APP_ENGINE:ck()?t=kr.CLOUD_FUNCTIONS:await fk()?await pk()?t=kr.KUBERNETES_ENGINE:lk()?t=kr.CLOUD_RUN:dk()?t=kr.CLOUD_RUN_JOBS:t=kr.COMPUTE_ENGINE:t=kr.NONE,t}o(sk,"getEnvMemoized");function uk(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(uk,"isAppEngine");function ck(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(ck,"isCloudFunction");function lk(){return!!process.env.K_CONFIGURATION}o(lk,"isCloudRun");function dk(){return!!process.env.CLOUD_RUN_JOB}o(dk,"isCloudRunJob");async function pk(){try{return await mS.instance("attributes/cluster-name"),!0}catch{return!1}}o(pk,"isKubernetesEngine");async function fk(){return mS.isAvailable()}o(fk,"isComputeEngine")});var mp=k((L5,hS)=>{var Ou=ti().Buffer,mk=require("stream"),hk=require("util");function Cu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=Ou.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=Ou.alloc(0),t.pipe(this),this;if(t.length||typeof t=="object")return this.buffer=t,this.writable=!1,process.nextTick(function(){this.emit("end",t),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof t+")")}o(Cu,"DataStream");hk.inherits(Cu,mk);Cu.prototype.write=o(function(e){this.buffer=Ou.concat([this.buffer,Ou.from(e)]),this.emit("data",e)},"write");Cu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");hS.exports=Cu});var yS=k((B5,gS)=>{"use strict";var ya=require("buffer").Buffer,hp=require("buffer").SlowBuffer;gS.exports=$u;function $u(t,e){if(!ya.isBuffer(t)||!ya.isBuffer(e)||t.length!==e.length)return!1;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return r===0}o($u,"bufferEq");$u.install=function(){ya.prototype.equal=hp.prototype.equal=o(function(e){return $u(this,e)},"equal")};var gk=ya.prototype.equal,yk=hp.prototype.equal;$u.restore=function(){ya.prototype.equal=gk,hp.prototype.equal=yk}});var vp=k((V5,wS)=>{var ii=ti().Buffer,ir=require("crypto"),vS=Xd(),_S=require("util"),_k=`"%s" is not a valid algorithm.
39
+ Supported algorithms are:
40
+ "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,_a="secret must be a string or buffer",oi="key must be a string or a buffer",vk="key must be a string, a buffer or an object",yp=typeof ir.createPublicKey=="function";yp&&(oi+=" or a KeyObject",_a+="or a KeyObject");function bS(t){if(!ii.isBuffer(t)&&typeof t!="string"&&(!yp||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Pr(oi)}o(bS,"checkIsPublicKey");function PS(t){if(!ii.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Pr(vk)}o(PS,"checkIsPrivateKey");function bk(t){if(!ii.isBuffer(t)){if(typeof t=="string")return t;if(!yp||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Pr(_a)}}o(bk,"checkIsSecretKey");function _p(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(_p,"fromBase64");function SS(t){t=t.toString();var e=4-t.length%4;if(e!==4)for(var r=0;r<e;++r)t+="=";return t.replace(/\-/g,"+").replace(/_/g,"/")}o(SS,"toBase64");function Pr(t){var e=[].slice.call(arguments,1),r=_S.format.bind(_S,t).apply(null,e);return new TypeError(r)}o(Pr,"typeError");function Pk(t){return ii.isBuffer(t)||typeof t=="string"}o(Pk,"bufferOrString");function va(t){return Pk(t)||(t=JSON.stringify(t)),t}o(va,"normalizeInput");function ES(t){return o(function(r,n){bk(n),r=va(r);var i=ir.createHmac("sha"+t,n),s=(i.update(r),i.digest("base64"));return _p(s)},"sign")}o(ES,"createHmacSigner");var gp,Sk="timingSafeEqual"in ir?o(function(e,r){return e.byteLength!==r.byteLength?!1:ir.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return gp||(gp=yS()),gp(e,r)},"timingSafeEqual");function Ek(t){return o(function(r,n,i){var s=ES(t)(r,i);return Sk(ii.from(n),ii.from(s))},"verify")}o(Ek,"createHmacVerifier");function TS(t){return o(function(r,n){PS(n),r=va(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign(n,"base64"));return _p(s)},"sign")}o(TS,"createKeySigner");function xS(t){return o(function(r,n,i){bS(i),r=va(r),n=SS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify(i,n,"base64")},"verify")}o(xS,"createKeyVerifier");function Tk(t){return o(function(r,n){PS(n),r=va(r);var i=ir.createSign("RSA-SHA"+t),s=(i.update(r),i.sign({key:n,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return _p(s)},"sign")}o(Tk,"createPSSKeySigner");function xk(t){return o(function(r,n,i){bS(i),r=va(r),n=SS(n);var s=ir.createVerify("RSA-SHA"+t);return s.update(r),s.verify({key:i,padding:ir.constants.RSA_PKCS1_PSS_PADDING,saltLength:ir.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(xk,"createPSSKeyVerifier");function wk(t){var e=TS(t);return o(function(){var n=e.apply(null,arguments);return n=vS.derToJose(n,"ES"+t),n},"sign")}o(wk,"createECDSASigner");function Ak(t){var e=xS(t);return o(function(n,i,s){i=vS.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,s);return c},"verify")}o(Ak,"createECDSAVerifer");function Ik(){return o(function(){return""},"sign")}o(Ik,"createNoneSigner");function Rk(){return o(function(e,r){return r===""},"verify")}o(Rk,"createNoneVerifier");wS.exports=o(function(e){var r={hs:ES,rs:TS,ps:Tk,es:wk,none:Ik},n={hs:Ek,rs:xS,ps:xk,es:Ak,none:Rk},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Pr(_k,e);var s=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[s](c),verify:n[s](c)}},"jwa")});var bp=k((G5,AS)=>{var Ok=require("buffer").Buffer;AS.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||Ok.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var kS=k((Z5,$S)=>{var Ck=ti().Buffer,IS=mp(),$k=vp(),kk=require("stream"),RS=bp(),Pp=require("util");function OS(t,e){return Ck.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(OS,"base64url");function Nk(t,e,r){r=r||"utf8";var n=OS(RS(t),"binary"),i=OS(RS(e),r);return Pp.format("%s.%s",n,i)}o(Nk,"jwsSecuredInput");function CS(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,s=$k(e.alg),c=Nk(e,r,i),d=s.sign(c,n);return Pp.format("%s.%s",c,d)}o(CS,"jwsSign");function ku(t){var e=t.secret;if(e=e??t.privateKey,e=e??t.key,/^hs/i.test(t.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new IS(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new IS(t.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))}o(ku,"SignStream");Pp.inherits(ku,kk);ku.prototype.sign=o(function(){try{var e=CS({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}},"sign");ku.sign=CS;$S.exports=ku});var qS=k((J5,BS)=>{var zS=ti().Buffer,NS=mp(),zk=vp(),Dk=require("stream"),DS=bp(),Uk=require("util"),Mk=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function jk(t){return Object.prototype.toString.call(t)==="[object Object]"}o(jk,"isObject");function Lk(t){if(jk(t))return t;try{return JSON.parse(t)}catch{return}}o(Lk,"safeJsonParse");function US(t){var e=t.split(".",1)[0];return Lk(zS.from(e,"base64").toString("binary"))}o(US,"headerFromJWS");function Fk(t){return t.split(".",2).join(".")}o(Fk,"securedInputFromJWS");function MS(t){return t.split(".")[2]}o(MS,"signatureFromJWS");function Bk(t,e){e=e||"utf8";var r=t.split(".")[1];return zS.from(r,"base64").toString(e)}o(Bk,"payloadFromJWS");function jS(t){return Mk.test(t)&&!!US(t)}o(jS,"isValidJws");function LS(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=DS(t);var i=MS(t),s=Fk(t),c=zk(e);return c.verify(s,i,r)}o(LS,"jwsVerify");function FS(t,e){if(e=e||{},t=DS(t),!jS(t))return null;var r=US(t);if(!r)return null;var n=Bk(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:MS(t)}}o(FS,"jwsDecode");function ai(t){t=t||{};var e=t.secret;if(e=e??t.publicKey,e=e??t.key,/^hs/i.test(t.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new NS(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new NS(t.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))}o(ai,"VerifyStream");Uk.inherits(ai,Dk);ai.prototype.verify=o(function(){try{var e=LS(this.signature.buffer,this.algorithm,this.key.buffer),r=FS(this.signature.buffer,this.encoding);return this.emit("done",e,r),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"verify");ai.decode=FS;ai.isValid=jS;ai.verify=LS;BS.exports=ai});var Sp=k(Un=>{var VS=kS(),Nu=qS(),qk=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Un.ALGORITHMS=qk;Un.sign=VS.sign;Un.verify=Nu.verify;Un.decode=Nu.decode;Un.isValid=Nu.isValid;Un.createSign=o(function(e){return new VS(e)},"createSign");Un.createVerify=o(function(e){return new Nu(e)},"createVerify")});var iE=k(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.GoogleToken=void 0;var HS=zu(require("fs")),Vk=at(),Hk=zu(Sp()),Gk=zu(require("path")),Wk=require("util");function zu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(zu=o(function(s,c){if(!c&&s&&s.__esModule)return s;var d,l,p={__proto__:null,default:s};if(s===null||sn(s)!="object"&&typeof s!="function")return p;if(d=c?n:r){if(d.has(s))return d.get(s);d.set(s,p)}for(var f in s)f!=="default"&&{}.hasOwnProperty.call(s,f)&&((l=(d=Object.defineProperty)&&Object.getOwnPropertyDescriptor(s,f))&&(l.get||l.set)?d(p,f,l):p[f]=s[f]);return p},"_interopRequireWildcard"))(t,e)}o(zu,"_interopRequireWildcard");function sn(t){"@babel/helpers - typeof";return sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sn(t)}o(sn,"_typeof");function Zk(t,e){eE(t,e),e.add(t)}o(Zk,"_classPrivateMethodInitSpec");function Kk(t,e,r){eE(t,e),e.set(t,r)}o(Kk,"_classPrivateFieldInitSpec");function eE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(eE,"_checkPrivateRedeclaration");function GS(t,e,r){return t.set(Sr(t,e),r),r}o(GS,"_classPrivateFieldSet");function WS(t,e){return t.get(Sr(t,e))}o(WS,"_classPrivateFieldGet");function Sr(t,e,r){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")}o(Sr,"_assertClassBrand");function ZS(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,nE(n.key),n)}}o(ZS,"_defineProperties");function tE(t,e,r){return e&&ZS(t.prototype,e),r&&ZS(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(tE,"_createClass");function rE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(rE,"_classCallCheck");function Jk(t,e,r){return e=Ea(e),Yk(t,Ip()?Reflect.construct(e,r||[],Ea(t).constructor):e.apply(t,r))}o(Jk,"_callSuper");function Yk(t,e){if(e&&(sn(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xk(t)}o(Yk,"_possibleConstructorReturn");function Xk(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(Xk,"_assertThisInitialized");function Qk(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Sa(t,e)}o(Qk,"_inherits");function Ep(t){var e=typeof Map=="function"?new Map:void 0;return Ep=o(function(n){if(n===null||!tN(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return eN(n,arguments,Ea(this).constructor)}return o(i,"Wrapper"),i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Sa(i,n)},"_wrapNativeSuper"),Ep(t)}o(Ep,"_wrapNativeSuper");function eN(t,e,r){if(Ip())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&Sa(i,r.prototype),i}o(eN,"_construct");function Ip(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ip=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Ip,"_isNativeReflectConstruct");function tN(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(tN,"_isNativeFunction");function Sa(t,e){return Sa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Sa(t,e)}o(Sa,"_setPrototypeOf");function Ea(t){return Ea=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ea(t)}o(Ea,"_getPrototypeOf");function Gt(t,e,r){return(e=nE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Gt,"_defineProperty");function nE(t){var e=rN(t,"string");return sn(e)=="symbol"?e:e+""}o(nE,"_toPropertyKey");function rN(t,e){if(sn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(sn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(rN,"_toPrimitive");function Zt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function s(g,y,T,P){var x=y&&y.prototype instanceof d?y:d,N=Object.create(x.prototype);return Wt(N,"_invoke",function(L,X,W){var G,K,ee,Y=0,Se=W||[],te=!1,q={p:0,n:0,v:t,a:B,f:B.bind(t,4),d:o(function(Z,re){return G=Z,K=0,ee=t,q.n=re,c},"d")};function B(J,Z){for(K=J,ee=Z,e=0;!te&&Y&&!re&&e<Se.length;e++){var re,oe=Se[e],Ae=q.p,Oe=oe[2];J>3?(re=Oe===Z)&&(ee=oe[(K=oe[4])?5:(K=3,3)],oe[4]=oe[5]=t):oe[0]<=Ae&&((re=J<2&&Ae<oe[1])?(K=0,q.v=Z,q.n=oe[1]):Ae<Oe&&(re=J<3||oe[0]>Z||Z>Oe)&&(oe[4]=J,oe[5]=Z,q.n=Oe,K=0))}if(re||J>1)return c;throw te=!0,Z}return o(B,"d"),function(J,Z,re){if(Y>1)throw TypeError("Generator is already running");for(te&&Z===1&&B(Z,re),K=Z,ee=re;(e=K<2?t:ee)||!te;){G||(K?K<3?(K>1&&(q.n=-1),B(K,ee)):q.n=ee:q.v=ee);try{if(Y=2,G){if(K||(J="next"),e=G[J]){if(!(e=e.call(G,ee)))throw TypeError("iterator result is not an object");if(!e.done)return e;ee=e.value,K<2&&(K=0)}else K===1&&(e=G.return)&&e.call(G),K<2&&(ee=TypeError("The iterator does not provide a '"+J+"' method"),K=1);G=t}else if((e=(te=q.n<0)?ee:L.call(X,q))!==c)break}catch(oe){G=t,K=1,ee=oe}finally{Y=1}}return{value:e,done:te}}}(g,T,P),!0),N}o(s,"i");var c={};function d(){}o(d,"Generator");function l(){}o(l,"GeneratorFunction");function p(){}o(p,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var f=[][n]?e(e([][n]())):(Wt(e={},n,function(){return this}),e),_=p.prototype=d.prototype=Object.create(f);function h(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,p):(g.__proto__=p,Wt(g,i,"GeneratorFunction")),g.prototype=Object.create(_),g}return o(h,"f"),l.prototype=p,Wt(_,"constructor",p),Wt(p,"constructor",l),l.displayName="GeneratorFunction",Wt(p,i,"GeneratorFunction"),Wt(_),Wt(_,i,"Generator"),Wt(_,n,function(){return this}),Wt(_,"toString",function(){return"[object Generator]"}),(Zt=o(function(){return{w:s,m:h}},"_regenerator"))()}o(Zt,"_regenerator");function Wt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Wt=o(function(c,d,l,p){if(d)i?i(c,d,{value:l,enumerable:!p,configurable:!p,writable:!p}):c[d]=l;else{var f=o(function(h,g){Wt(c,h,function(y){return this._invoke(h,g,y)})},"o");f("next",0),f("throw",1),f("return",2)}},"_regeneratorDefine"),Wt(t,e,r,n)}o(Wt,"_regeneratorDefine2");function KS(t,e,r,n,i,s,c){try{var d=t[s](c),l=d.value}catch(p){return void r(p)}d.done?e(l):Promise.resolve(l).then(n,i)}o(KS,"asyncGeneratorStep");function si(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var s=t.apply(e,r);function c(l){KS(s,n,i,c,d,"next",l)}o(c,"_next");function d(l){KS(s,n,i,c,d,"throw",l)}o(d,"_throw"),c(void 0)})}}o(si,"_asyncToGenerator");var JS=HS.readFile?(0,Wk.promisify)(HS.readFile):si(Zt().m(o(function t(){return Zt().w(function(e){for(;;)switch(e.n){case 0:throw new Pa("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),YS="https://oauth2.googleapis.com/token",nN="https://oauth2.googleapis.com/revoke?token=",Pa=function(t){function e(r,n){var i;return rE(this,e),i=Jk(this,e,[r]),Gt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),Qk(e,t),tE(e)}(Ep(Error)),ba=new WeakMap,Nr=new WeakSet,eY=Du.GoogleToken=function(){function t(e){rE(this,t),Zk(this,Nr),Gt(this,"expiresAt",void 0),Gt(this,"key",void 0),Gt(this,"keyFile",void 0),Gt(this,"iss",void 0),Gt(this,"sub",void 0),Gt(this,"scope",void 0),Gt(this,"rawToken",void 0),Gt(this,"tokenExpires",void 0),Gt(this,"email",void 0),Gt(this,"additionalClaims",void 0),Gt(this,"eagerRefreshThresholdMillis",void 0),Gt(this,"transporter",{request:o(function(n){return(0,Vk.request)(n)},"request")}),Kk(this,ba,void 0),Sr(Nr,this,oE).call(this,e)}return o(t,"GoogleToken"),tE(t,[{key:"accessToken",get:o(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:o(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:o(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:o(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:o(function(){var r=new Date().getTime();return this.rawToken&&this.expiresAt?r>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:o(function(){var r,n=new Date().getTime(),i=(r=this.eagerRefreshThresholdMillis)!==null&&r!==void 0?r:0;return this.rawToken&&this.expiresAt?this.expiresAt<=n+i:!0},"isTokenExpiring")},{key:"getToken",value:o(function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(sn(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Sr(Nr,this,XS).call(this,n).then(function(s){return i(null,s)},r);return}return Sr(Nr,this,XS).call(this,n)},"getToken")},{key:"getCredentials",value:function(){var e=si(Zt().m(o(function n(i){var s,c,d,l,p,f,_;return Zt().w(function(h){for(;;)switch(h.n){case 0:s=Gk.extname(i),_=s,h.n=_===".json"?1:_===".der"||_===".crt"||_===".pem"?4:_===".p12"||_===".pfx"?6:7;break;case 1:return h.n=2,JS(i,"utf8");case 2:if(c=h.v,d=JSON.parse(c),l=d.private_key,p=d.client_email,!(!l||!p)){h.n=3;break}throw new Pa("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return h.a(2,{privateKey:l,clientEmail:p});case 4:return h.n=5,JS(i,"utf8");case 5:return f=h.v,h.a(2,{privateKey:f});case 6:throw new Pa("*.p12 certificates are not supported after v6.1.2. Consider utilizing *.json format or converting *.p12 to *.pem using the OpenSSL CLI.","UNKNOWN_CERTIFICATE_TYPE");case 7:throw new Pa("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return h.a(2)}},n)},"_callee2")));function r(n){return e.apply(this,arguments)}return o(r,"getCredentials"),r}()},{key:"revokeToken",value:o(function(r){if(r){Sr(Nr,this,QS).call(this).then(function(){return r()},r);return}return Sr(Nr,this,QS).call(this)},"revokeToken")}])}();function XS(t){return Tp.apply(this,arguments)}o(XS,"_getTokenAsync");function Tp(){return Tp=si(Zt().m(o(function t(e){return Zt().w(function(r){for(;;)switch(r.n){case 0:if(!(WS(ba,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,WS(ba,this));case 1:return r.p=1,r.n=2,GS(ba,this,Sr(Nr,this,oN).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,GS(ba,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Tp.apply(this,arguments)}o(Tp,"_getTokenAsync2");function oN(t){return xp.apply(this,arguments)}o(oN,"_getTokenAsyncInner");function xp(){return xp=si(Zt().m(o(function t(e){var r;return Zt().w(function(n){for(;;)switch(n.n){case 0:if(!(this.isTokenExpiring()===!1&&e.forceRefresh===!1)){n.n=1;break}return n.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){n.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){n.n=4;break}return n.n=3,this.getCredentials(this.keyFile);case 3:r=n.v,this.key=r.privateKey,this.iss=r.clientEmail||this.iss,r.clientEmail||Sr(Nr,this,iN).call(this);case 4:return n.a(2,Sr(Nr,this,aN).call(this))}},t,this)},"_callee4"))),xp.apply(this,arguments)}o(xp,"_getTokenAsyncInner2");function iN(){if(!this.iss)throw new Pa("email is required.","MISSING_CREDENTIALS")}o(iN,"_ensureEmail");function QS(){return wp.apply(this,arguments)}o(QS,"_revokeTokenAsync");function wp(){return wp=si(Zt().m(o(function t(){var e;return Zt().w(function(r){for(;;)switch(r.n){case 0:if(this.accessToken){r.n=1;break}throw new Error("No token to revoke.");case 1:return e=nN+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Sr(Nr,this,oE).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return r.a(2)}},t,this)},"_callee5"))),wp.apply(this,arguments)}o(wp,"_revokeTokenAsync2");function oE(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=t.keyFile,this.key=t.key,this.rawToken=void 0,this.iss=t.email||t.iss,this.sub=t.sub,this.additionalClaims=t.additionalClaims,sn(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(oE,"_configure");function aN(){return Ap.apply(this,arguments)}o(aN,"_requestToken");function Ap(){return Ap=si(Zt().m(o(function t(){var e,r,n,i,s,c,d,l,p,f;return Zt().w(function(_){for(;;)switch(_.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:YS,exp:e+3600,iat:e,sub:this.sub},r),i=Hk.sign({header:{alg:"RS256"},payload:n,secret:this.key}),_.p=1,_.n=2,this.transporter.request({method:"POST",url:YS,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return s=_.v,this.rawToken=s.data,this.expiresAt=s.data.expires_in===null||s.data.expires_in===void 0?void 0:(e+s.data.expires_in)*1e3,_.a(2,this.rawToken);case 3:throw _.p=3,f=_.v,this.rawToken=void 0,this.tokenExpires=void 0,l=f.response&&(c=f.response)!==null&&c!==void 0&&c.data?(d=f.response)===null||d===void 0?void 0:d.data:{},l.error&&(p=l.error_description?": ".concat(l.error_description):"",f.message="".concat(l.error).concat(p)),f;case 4:return _.a(2)}},t,this,[[1,3]])},"_callee6"))),Ap.apply(this,arguments)}o(Ap,"_requestToken2")});var Op=k(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.JWTAccess=void 0;var sN=Sp(),uN=vr(),aE={alg:"RS256",typ:"JWT"},Rp=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new uN.LRUCache({capacity:500,maxAge:60*60*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??5*60*1e3}getCachedKey(e,r){let n=e;if(r&&Array.isArray(r)&&r.length?n=e?`${e}_${r.join("_")}`:`${r.join("_")}`:typeof r=="string"&&(n=e?`${e}_${r}`:r),!n)throw Error("Scopes or url must be provided");return n}getRequestHeaders(e,r,n){let i=this.getCachedKey(e,n),s=this.cache.get(i),c=Date.now();if(s&&s.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(s.headers);let d=Math.floor(Date.now()/1e3),l=t.getExpirationTime(d),p;if(Array.isArray(n)&&(n=n.join(" ")),n?p={iss:this.email,sub:this.email,scope:n,exp:l,iat:d}:p={iss:this.email,sub:this.email,aud:e,exp:l,iat:d},r){for(let y in p)if(r[y])throw new Error(`The '${y}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let f=this.keyId?{...aE,kid:this.keyId}:aE,_=Object.assign(p,r),h=sN.sign({header:f,payload:_,secret:this.key}),g=new Headers({authorization:`Bearer ${h}`});return this.cache.set(i,{expiration:l*1e3,headers:g}),g}static getExpirationTime(e){return e+3600}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{e||n(new Error("Must pass in a stream containing the service account auth settings."));let i="";e.setEncoding("utf8").on("data",s=>i+=s).on("error",n).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}};Uu.JWTAccess=Rp});var $p=k(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.JWT=void 0;var sE=iE(),cN=Op(),lN=uo(),Mu=Ht(),Cp=class t extends lN.OAuth2Client{static{o(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(e={}){super(e),this.email=e.email,this.keyFile=e.keyFile,this.key=e.key,this.keyId=e.keyId,this.scopes=e.scopes,this.subject=e.subject,this.additionalClaims=e.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(e){let r=new t(this);return r.scopes=e,r}async getRequestMetadataAsync(e){e=this.defaultServicePath?`https://${this.defaultServicePath}/`:e;let r=!this.hasUserScopes()&&e||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==Mu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==Mu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${Mu.DEFAULT_UNIVERSE}`);if(!this.apiKey&&r)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:n}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${n.id_token}`}))}}else{this.access||(this.access=new cN.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let n;this.hasUserScopes()?n=this.scopes:e||(n=this.defaultScopes);let i=this.useJWTAccessWithScope||this.universeDomain!==Mu.DEFAULT_UNIVERSE,s=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(s)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new sE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:e},transporter:this.transporter});if(await r.getToken({forceRefresh:!0}),!r.idToken)throw new Error("Unknown error: Failed to fetch ID token");return r.idToken}hasUserScopes(){return this.scopes?this.scopes.length>0:!1}hasAnyScopes(){return!!(this.scopes&&this.scopes.length>0||this.defaultScopes&&this.defaultScopes.length>0)}authorize(e){if(e)this.authorizeAsync().then(r=>e(null,r),e);else return this.authorizeAsync()}async authorizeAsync(){let e=await this.refreshToken();if(!e)throw new Error("No result returned");return this.credentials=e.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,e.tokens}async refreshTokenNoCache(){let e=this.createGToken(),n={access_token:(await e.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:e.expiresAt,id_token:e.idToken};return this.emit("tokens",n),{res:null,tokens:n}}createGToken(){return this.gtoken||(this.gtoken=new sE.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:this.additionalClaims,transporter:this.transporter})),this.gtoken}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!e.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!e.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=e.client_email,this.key=e.private_key,this.keyId=e.private_key_id,this.projectId=e.project_id,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}fromStreamAsync(e){return new Promise((r,n)=>{if(!e)throw new Error("Must pass in a stream containing the service account auth settings.");let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);this.fromJSON(s),r()}catch(s){n(s)}})})}fromAPIKey(e){if(typeof e!="string")throw new Error("Must provide an API Key string.");this.apiKey=e}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let r=await this.createGToken().getCredentials(this.keyFile);return{private_key:r.privateKey,client_email:r.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};ju.JWT=Cp});var Np=k(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.UserRefreshClient=ui.USER_REFRESH_ACCOUNT_TYPE=void 0;var dN=uo(),pN=Ht();ui.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var kp=class t extends dN.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,s){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:s};super(c),this._refreshToken=c.refreshToken,this.credentials.refresh_token=c.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(e){let r={...t.RETRY_CONFIG,url:this.endpoints.oauth2TokenUrl,method:"POST",data:new URLSearchParams({client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token",refresh_token:this._refreshToken,target_audience:e})};return pN.AuthClient.setMethodName(r,"fetchIdToken"),(await this.transporter.request(r)).data.id_token}fromJSON(e){if(!e)throw new Error("Must pass in a JSON object containing the user refresh token");if(e.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!e.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!e.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!e.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=e.client_id,this._clientSecret=e.client_secret,this._refreshToken=e.refresh_token,this.credentials.refresh_token=e.refresh_token,this.quotaProjectId=e.quota_project_id,this.universeDomain=e.universe_domain||this.universeDomain}fromStream(e,r){if(r)this.fromStreamAsync(e).then(()=>r(),r);else return this.fromStreamAsync(e)}async fromStreamAsync(e){return new Promise((r,n)=>{if(!e)return n(new Error("Must pass in a stream containing the user refresh token."));let i="";e.setEncoding("utf8").on("error",n).on("data",s=>i+=s).on("end",()=>{try{let s=JSON.parse(i);return this.fromJSON(s),r()}catch(s){return n(s)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};ui.UserRefreshClient=kp});var Dp=k(ci=>{"use strict";Object.defineProperty(ci,"__esModule",{value:!0});ci.Impersonated=ci.IMPERSONATED_ACCOUNT_TYPE=void 0;var uE=uo(),fN=at(),mN=vr();ci.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var zp=class t extends uE.OAuth2Client{static{o(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(e={}){if(super(e),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=e.sourceClient??new uE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,mN.originalOrCamelOptions)(e).get("universe_domain"))this.universeDomain=this.sourceClient.universeDomain;else if(this.sourceClient.universeDomain!==this.universeDomain)throw new RangeError(`Universe domain ${this.sourceClient.universeDomain} in source credentials does not match ${this.universeDomain} universe domain set for impersonated credentials.`);this.endpoint=e.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(e){await this.sourceClient.getAccessToken();let r=`projects/-/serviceAccounts/${this.targetPrincipal}`,n=`${this.endpoint}/v1/${r}:signBlob`,i={delegates:this.delegates,payload:Buffer.from(e).toString("base64")};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:n,data:i,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let e="projects/-/serviceAccounts/"+this.targetPrincipal,r=`${this.endpoint}/v1/${e}:generateAccessToken`,n={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},i=await this.sourceClient.request({...t.RETRY_CONFIG,url:r,data:n,method:"POST"}),s=i.data;return this.credentials.access_token=s.accessToken,this.credentials.expiry_date=Date.parse(s.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof fN.GaxiosError&&(r=e?.response?.data?.error?.status,n=e?.response?.data?.error?.message),r&&n?(e.message=`${r}: unable to impersonate: ${n}`,e):(e.message=`unable to impersonate: ${e}`,e)}}async fetchIdToken(e,r){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,i=`${this.endpoint}/v1/${n}:generateIdToken`,s={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:s,method:"POST"})).data.token}};ci.Impersonated=zp});var Mp=k(Ta=>{"use strict";Object.defineProperty(Ta,"__esModule",{value:!0});Ta.OAuthClientAuthHandler=void 0;Ta.getErrorFromOAuthErrorResponse=yN;var li=at(),hN=ma(),gN=["PUT","POST","PATCH"],Up=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,hN.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new li.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new li.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=li.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=li.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=li.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",s=this.#e.encodeBase64StringUtf8(`${n}:${i}`);li.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${s}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!gN.includes(r))throw new Error(`${r} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let i=new Headers(e.headers).get("content-type");if(i?.startsWith("application/x-www-form-urlencoded")||e.data instanceof URLSearchParams){let s=new URLSearchParams(e.data??"");s.append("client_id",this.#t.clientId),s.append("client_secret",this.#t.clientSecret||""),e.data=s}else if(i?.startsWith("application/json"))e.data=e.data||{},Object.assign(e.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${i} content-types are not supported with ${this.#t.confidentialClientType} client authentication`)}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Ta.OAuthClientAuthHandler=Up;function yN(t,e){let r=t.error,n=t.error_description,i=t.error_uri,s=`Error code ${r}`;typeof n<"u"&&(s+=`: ${n}`),typeof i<"u"&&(s+=` - ${i}`);let c=new Error(s);if(e){let d=Object.keys(e);e.stack&&d.push("stack"),d.forEach(l=>{l!=="message"&&Object.defineProperty(c,l,{value:e[l],writable:!1,enumerable:!0})})}return c}o(yN,"getErrorFromOAuthErrorResponse")});var Fu=k(Lu=>{"use strict";Object.defineProperty(Lu,"__esModule",{value:!0});Lu.StsCredentials=void 0;var _N=at(),vN=Ht(),cE=Mp(),bN=vr(),jp=class t extends cE.OAuthClientAuthHandler{static{o(this,"StsCredentials")}#e;constructor(e={tokenExchangeEndpoint:""},r){(typeof e!="object"||e instanceof URL)&&(e={tokenExchangeEndpoint:e,clientAuthentication:r}),super(e),this.#e=e.tokenExchangeEndpoint}async exchangeToken(e,r,n){let i={grant_type:e.grantType,resource:e.resource,audience:e.audience,scope:e.scope?.join(" "),requested_token_type:e.requestedTokenType,subject_token:e.subjectToken,subject_token_type:e.subjectTokenType,actor_token:e.actingParty?.actorToken,actor_token_type:e.actingParty?.actorTokenType,options:n&&JSON.stringify(n)},s={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,bN.removeUndefinedValuesInObject)(i))};vN.AuthClient.setMethodName(s,"exchangeToken"),this.applyClientAuthenticationOptions(s);try{let c=await this.transporter.request(s),d=c.data;return d.res=c,d}catch(c){throw c instanceof _N.GaxiosError&&c.response?(0,cE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};Lu.StsCredentials=jp});var Mn=k(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.BaseExternalAccountClient=ar.CLOUD_RESOURCE_MANAGER=ar.EXTERNAL_ACCOUNT_TYPE=ar.EXPIRATION_TIME_OFFSET=void 0;var PN=at(),SN=require("stream"),Lp=Ht(),EN=Fu(),lE=vr(),TN=tp(),xN="urn:ietf:params:oauth:grant-type:token-exchange",wN="urn:ietf:params:oauth:token-type:access_token",Fp="https://www.googleapis.com/auth/cloud-platform",AN=3600;ar.EXPIRATION_TIME_OFFSET=5*60*1e3;ar.EXTERNAL_ACCOUNT_TYPE="external_account";ar.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var IN="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",RN="https://sts.{universeDomain}/v1/token",Bp=class t extends Lp.AuthClient{static{o(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(e){super(e);let r=(0,lE.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ar.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ar.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),s=r.get("client_secret");this.tokenUrl=r.get("token_url")??RN.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),d=r.get("workforce_pool_user_project"),l=r.get("service_account_impersonation_url"),p=r.get("service_account_impersonation"),f=(0,lE.originalOrCamelOptions)(p).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(r.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),i&&(this.clientAuth={confidentialClientType:"basic",clientId:i,clientSecret:s}),this.stsCredential=new EN.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[Fp],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=d;let _=new RegExp(IN);if(this.workforcePoolUserProject&&!this.audience.match(_))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=l,this.serviceAccountImpersonationLifetime=f,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=AN),this.projectNumber=this.getProjectNumber(this.audience),this.supplierContext={audience:this.audience,subjectTokenType:this.subjectTokenType,transporter:this.transporter}}getServiceAccountEmail(){if(this.serviceAccountImpersonationUrl){if(this.serviceAccountImpersonationUrl.length>256)throw new RangeError(`URL is too long: ${this.serviceAccountImpersonationUrl}`);return/serviceAccounts\/(?<email>[^:]+):generateAccessToken$/.exec(this.serviceAccountImpersonationUrl)?.groups?.email||null}return null}setCredentials(e){super.setCredentials(e),this.cachedAccessToken=e}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async getProjectId(){let e=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(e){let r=await this.getRequestHeaders(),n={...t.RETRY_CONFIG,headers:r,url:`${this.cloudResourceManagerURL.toString()}${e}`};Lp.AuthClient.setMethodName(n,"getProjectId");let i=await this.transporter.request(n);return this.projectId=i.data.projectId,this.projectId}return null}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=PN.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof SN.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let e=await this.retrieveSubjectToken(),r={grantType:xN,audience:this.audience,requestedTokenType:wN,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[Fp]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),s=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(s.access_token):s.expires_in?this.cachedAccessToken={access_token:s.access_token,expiry_date:new Date().getTime()+s.expires_in*1e3,res:s.res}:this.cachedAccessToken={access_token:s.access_token,res:s.res},this.credentials={},Object.assign(this.credentials,this.cachedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedAccessToken.expiry_date,access_token:this.cachedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedAccessToken}getProjectNumber(e){let r=e.match(/\/projects\/([^/]+)/);return r?r[1]:null}async getImpersonatedAccessToken(e){let r={...t.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${e}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};Lp.AuthClient.setMethodName(r,"getImpersonatedAccessToken");let n=await this.transporter.request(r),i=n.data;return{access_token:i.accessToken,expiry_date:new Date(i.expireTime).getTime(),res:n}}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[Fp]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${TN.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ar.BaseExternalAccountClient=Bp});var dE=k(Bu=>{"use strict";Object.defineProperty(Bu,"__esModule",{value:!0});Bu.FileSubjectTokenSupplier=void 0;var Vp=require("util"),Hp=require("fs"),ON=(0,Vp.promisify)(Hp.readFile??(()=>{})),CN=(0,Vp.promisify)(Hp.realpath??(()=>{})),$N=(0,Vp.promisify)(Hp.lstat??(()=>{})),qp=class{static{o(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(e){this.filePath=e.filePath,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName}async getSubjectToken(){let e=this.filePath;try{if(e=await CN(e),!(await $N(e)).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let r,n=await ON(e,{encoding:"utf8"});if(this.formatType==="text"?r=n:this.formatType==="json"&&this.subjectTokenFieldName&&(r=JSON.parse(n)[this.subjectTokenFieldName]),!r)throw new Error("Unable to parse the subject_token from the credential_source file");return r}};Bu.FileSubjectTokenSupplier=qp});var pE=k(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.UrlSubjectTokenSupplier=void 0;var kN=Ht(),Gp=class{static{o(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(e){this.url=e.url,this.formatType=e.formatType,this.subjectTokenFieldName=e.subjectTokenFieldName,this.headers=e.headers,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getSubjectToken(e){let r={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};kN.AuthClient.setMethodName(r,"getSubjectToken");let n;if(this.formatType==="text"?n=(await e.transporter.request(r)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(n=(await e.transporter.request(r)).data[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source URL");return n}};qu.UrlSubjectTokenSupplier=Gp});var fE=k(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});Kt.CertificateSubjectTokenSupplier=Kt.InvalidConfigurationError=Kt.CertificateSourceUnavailableError=Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Vu=vr(),Hu=require("fs"),Gu=require("crypto"),NN=require("https");Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var zr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Kt.CertificateSourceUnavailableError=zr;var sr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Kt.InvalidConfigurationError=sr;var Wp=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new sr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new sr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new sr("Cannot create mTLS Agent with missing certificate or key");return new NN.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:e,keyPath:r}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(e,r),await this.#n(this.cert)}async#e(){let e=this.certificateConfigPath;if(e){if(await(0,Vu.isValidFile)(e))return e;throw new zr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Vu.isValidFile)(r))return r;throw new zr(`Path from environment variable "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Vu.getWellKnownCertificateConfigFileLocation)();if(await(0,Vu.isValidFile)(n))return n;throw new zr(`Could not find certificate configuration file. Searched override path, the "${Kt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Hu.promises.readFile(e,"utf8")}catch{throw new zr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,s=n?.cert_configs?.workload?.key_path;if(!i||!s)throw new sr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:s}}catch(n){throw n instanceof sr?n:new sr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Hu.promises.readFile(e),new Gu.X509Certificate(n)}catch(s){let c=s instanceof Error?s.message:String(s);throw new zr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Hu.promises.readFile(r),(0,Gu.createPrivateKey)(i)}catch(s){let c=s instanceof Error?s.message:String(s);throw new zr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Gu.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let s=((await Hu.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((l,p)=>{try{return new Gu.X509Certificate(l)}catch(f){let _=f instanceof Error?f.message:String(f);throw new sr(`Failed to parse certificate at index ${p} in trust chain file ${this.trustChainPath}: ${_}`)}}),c=s.findIndex(l=>r.raw.equals(l.raw)),d;if(c===-1)d=[r,...s];else if(c===0)d=s;else throw new sr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(d.map(l=>l.raw.toString("base64")))}catch(n){if(n instanceof sr)throw n;let i=n instanceof Error?n.message:String(n);throw new zr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Kt.CertificateSubjectTokenSupplier=Wp});var Jp=k(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.IdentityPoolClient=void 0;var zN=Mn(),Zp=vr(),DN=dE(),UN=pE(),mE=fE(),MN=Fu(),hE=at(),Kp=class t extends zN.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,Zp.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("subject_token_supplier");if(!n&&!i)throw new Error("A credential source or subject token supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or subject token supplier can be specified.");if(i)this.subjectTokenSupplier=i,this.credentialSourceType="programmatic";else{let s=(0,Zp.originalOrCamelOptions)(n),c=(0,Zp.originalOrCamelOptions)(s.get("format")),d=c.get("type")||"text",l=c.get("subject_token_field_name");if(d!=="json"&&d!=="text")throw new Error(`Invalid credential_source format "${d}"`);if(d==="json"&&!l)throw new Error("Missing subject_token_field_name for JSON credential_source format");let p=s.get("file"),f=s.get("url"),_=s.get("certificate"),h=s.get("headers");if(p&&f||f&&_||p&&_)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(p)this.credentialSourceType="file",this.subjectTokenSupplier=new DN.FileSubjectTokenSupplier({filePath:p,formatType:d,subjectTokenFieldName:l});else if(f)this.credentialSourceType="url",this.subjectTokenSupplier=new UN.UrlSubjectTokenSupplier({url:f,formatType:d,subjectTokenFieldName:l,headers:h,additionalGaxiosOptions:t.RETRY_CONFIG});else if(_){this.credentialSourceType="certificate";let g=new mE.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:_.use_default_certificate_config,certificateConfigLocation:_.certificate_config_location,trustChainPath:_.trust_chain_path});this.subjectTokenSupplier=g}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let e=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof mE.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new MN.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new hE.Gaxios({agent:r})}),this.transporter=new hE.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Wu.IdentityPoolClient=Kp});var Xp=k(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.AwsRequestSigner=void 0;var Zu=at(),yE=ma(),gE="AWS4-HMAC-SHA256",jN="aws4_request",Yp=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,yE.createCrypto)()}async getRequestOptions(e){if(!e.url)throw new RangeError('"url" is required in "amzOptions"');let r=typeof e.data=="object"?JSON.stringify(e.data):e.data,n=e.url,i=e.method||"GET",s=e.body||r,c=e.headers,d=await this.getCredentials(),l=new URL(n);if(typeof s!="string"&&s!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${s}`);let p=await FN({crypto:this.crypto,host:l.host,canonicalUri:l.pathname,canonicalQuerystring:l.search.slice(1),method:i,region:this.region,securityCredentials:d,requestPayload:s,additionalAmzHeaders:c}),f=Zu.Gaxios.mergeHeaders(p.amzDate?{"x-amz-date":p.amzDate}:{},{authorization:p.authorizationHeader,host:l.host},c||{});d.token&&Zu.Gaxios.mergeHeaders(f,{"x-amz-security-token":d.token});let _={url:n,method:i,headers:f};return s!==void 0&&(_.body=s),_}};Ku.AwsRequestSigner=Yp;async function xa(t,e,r){return await t.signWithHmacSha256(e,r)}o(xa,"sign");async function LN(t,e,r,n,i){let s=await xa(t,`AWS4${e}`,r),c=await xa(t,s,n),d=await xa(t,c,i);return await xa(t,d,"aws4_request")}o(LN,"getSigningKey");async function FN(t){let e=Zu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,s=i.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),c=i.toISOString().replace(/[-]/g,"").replace(/T.*/,"");t.securityCredentials.token&&e.set("x-amz-security-token",t.securityCredentials.token);let d=Zu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":s},e),l="",p=[...d.keys()].sort();p.forEach(N=>{l+=`${N}:${d.get(N)}
41
+ `});let f=p.join(";"),_=await t.crypto.sha256DigestHex(r),h=`${t.method.toUpperCase()}
42
+ ${t.canonicalUri}
43
+ ${t.canonicalQuerystring}
44
+ ${l}
45
+ ${f}
46
+ ${_}`,g=`${c}/${t.region}/${n}/${jN}`,y=`${gE}
47
+ ${s}
48
+ ${g}
49
+ `+await t.crypto.sha256DigestHex(h),T=await LN(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),P=await xa(t.crypto,T,y),x=`${gE} Credential=${t.securityCredentials.accessKeyId}/${g}, SignedHeaders=${f}, Signature=${(0,yE.fromArrayBufferToHex)(P)}`;return{amzDate:e.has("date")?void 0:s,authorizationHeader:x,canonicalQuerystring:t.canonicalQuerystring}}o(FN,"generateAuthenticationHeaderMap")});var _E=k(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DefaultAwsSecurityCredentialsSupplier=void 0;var Ju=Ht(),Qp=class{static{o(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(e){this.regionUrl=e.regionUrl,this.securityCredentialsUrl=e.securityCredentialsUrl,this.imdsV2SessionTokenUrl=e.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=e.additionalGaxiosOptions}async getAwsRegion(e){if(this.#n)return this.#n;let r=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let n={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:r};Ju.AuthClient.setMethodName(n,"getAwsRegion");let i=await e.transporter.request(n);return i.data.substr(0,i.data.length-1)}async getAwsSecurityCredentials(e){if(this.#o)return this.#o;let r=new Headers;this.imdsV2SessionTokenUrl&&r.set("x-aws-ec2-metadata-token",await this.#e(e.transporter));let n=await this.#t(r,e.transporter),i=await this.#r(n,r,e.transporter);return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,token:i.Token}}async#e(e){let r={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return Ju.AuthClient.setMethodName(r,"#getImdsV2SessionToken"),(await e.request(r)).data}async#t(e,r){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let n={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:e};return Ju.AuthClient.setMethodName(n,"#getAwsRoleName"),(await r.request(n)).data}async#r(e,r,n){let i={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${e}`,headers:r};return Ju.AuthClient.setMethodName(i,"#retrieveAwsSecurityCredentials"),(await n.request(i)).data}get#n(){return process.env.AWS_REGION||process.env.AWS_DEFAULT_REGION||null}get#o(){return process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY?{accessKeyId:process.env.AWS_ACCESS_KEY_ID,secretAccessKey:process.env.AWS_SECRET_ACCESS_KEY,token:process.env.AWS_SESSION_TOKEN}:null}};Yu.DefaultAwsSecurityCredentialsSupplier=Qp});var tf=k(Xu=>{"use strict";Object.defineProperty(Xu,"__esModule",{value:!0});Xu.AwsClient=void 0;var BN=Xp(),qN=Mn(),VN=_E(),vE=vr(),HN=at(),ef=class t extends qN.BaseExternalAccountClient{static{o(this,"AwsClient")}environmentId;awsSecurityCredentialsSupplier;regionalCredVerificationUrl;awsRequestSigner;region;static#e="https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15";static AWS_EC2_METADATA_IPV4_ADDRESS="169.254.169.254";static AWS_EC2_METADATA_IPV6_ADDRESS="fd00:ec2::254";constructor(e){super(e);let r=(0,vE.originalOrCamelOptions)(e),n=r.get("credential_source"),i=r.get("aws_security_credentials_supplier");if(!n&&!i)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(n&&i)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(i)this.awsSecurityCredentialsSupplier=i,this.regionalCredVerificationUrl=t.#e,this.credentialSourceType="programmatic";else{let s=(0,vE.originalOrCamelOptions)(n);this.environmentId=s.get("environment_id");let c=s.get("region_url"),d=s.get("url"),l=s.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new VN.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:d,imdsV2SessionTokenUrl:l}),this.regionalCredVerificationUrl=s.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let e=this.environmentId?.match(/^(aws)(\d+)$/);if(!e||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(e[2],10)!==1)throw new Error(`aws version "${e[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new BN.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let e=await this.awsRequestSigner.getRequestOptions({...t.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),r=[];return HN.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,s)=>r.push({key:s,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};Xu.AwsClient=ef});var sf=k(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.InvalidSubjectTokenError=ct.InvalidMessageFieldError=ct.InvalidCodeFieldError=ct.InvalidTokenTypeFieldError=ct.InvalidExpirationTimeFieldError=ct.InvalidSuccessFieldError=ct.InvalidVersionFieldError=ct.ExecutableResponseError=ct.ExecutableResponse=void 0;var Qu="urn:ietf:params:oauth:token-type:saml2",rf="urn:ietf:params:oauth:token-type:id_token",nf="urn:ietf:params:oauth:token-type:jwt",of=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new ec("Executable response must contain a 'version' field.");if(e.success===void 0)throw new tc("Executable response must contain a 'success' field.");if(this.version=e.version,this.success=e.success,this.success){if(this.expirationTime=e.expiration_time,this.tokenType=e.token_type,this.tokenType!==Qu&&this.tokenType!==rf&&this.tokenType!==nf)throw new rc(`Executable response must contain a 'token_type' field when successful and it must be one of ${rf}, ${nf}, or ${Qu}.`);if(this.tokenType===Qu){if(!e.saml_response)throw new wa(`Executable response must contain a 'saml_response' field when token_type=${Qu}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new wa(`Executable response must contain a 'id_token' field when token_type=${rf} or ${nf}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new nc("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new oc("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=e.code,this.errorMessage=e.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};ct.ExecutableResponse=of;var Dr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};ct.ExecutableResponseError=Dr;var ec=class extends Dr{static{o(this,"InvalidVersionFieldError")}};ct.InvalidVersionFieldError=ec;var tc=class extends Dr{static{o(this,"InvalidSuccessFieldError")}};ct.InvalidSuccessFieldError=tc;var af=class extends Dr{static{o(this,"InvalidExpirationTimeFieldError")}};ct.InvalidExpirationTimeFieldError=af;var rc=class extends Dr{static{o(this,"InvalidTokenTypeFieldError")}};ct.InvalidTokenTypeFieldError=rc;var nc=class extends Dr{static{o(this,"InvalidCodeFieldError")}};ct.InvalidCodeFieldError=nc;var oc=class extends Dr{static{o(this,"InvalidMessageFieldError")}};ct.InvalidMessageFieldError=oc;var wa=class extends Dr{static{o(this,"InvalidSubjectTokenError")}};ct.InvalidSubjectTokenError=wa});var lf=k(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.PluggableAuthHandler=di.ExecutableError=void 0;var co=sf(),GN=require("child_process"),uf=require("fs"),ic=class extends Error{static{o(this,"ExecutableError")}code;constructor(e,r){super(`The executable failed with exit code: ${r} and error message: ${e}.`),this.code=r,Object.setPrototypeOf(this,new.target.prototype)}};di.ExecutableError=ic;var cf=class t{static{o(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(e){if(!e.command)throw new Error("No command provided.");if(this.commandComponents=t.parseCommand(e.command),this.timeoutMillis=e.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=e.outputFile}retrieveResponseFromExecutable(e){return new Promise((r,n)=>{let i=GN.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),s="";i.stdout.on("data",d=>{s+=d}),i.stderr.on("data",d=>{s+=d});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",d=>{if(clearTimeout(c),d===0)try{let l=JSON.parse(s),p=new co.ExecutableResponse(l);return r(p)}catch(l){return l instanceof co.ExecutableResponseError?n(l):n(new co.ExecutableResponseError(`The executable returned an invalid response: ${s}`))}else return n(new ic(s,d.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await uf.promises.realpath(this.outputFile)}catch{return}if(!(await uf.promises.lstat(e)).isFile())return;let r=await uf.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new co.ExecutableResponse(n).isValid()?new co.ExecutableResponse(n):void 0}catch(n){throw n instanceof co.ExecutableResponseError?n:new co.ExecutableResponseError(`The output file contained an invalid response: ${r}`)}}static parseCommand(e){let r=e.match(/(?:[^\s"]+|"[^"]*")+/g);if(!r)throw new Error(`Provided command: "${e}" could not be parsed.`);for(let n=0;n<r.length;n++)r[n][0]==='"'&&r[n].slice(-1)==='"'&&(r[n]=r[n].slice(1,-1));return r}};di.PluggableAuthHandler=cf});var pf=k(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.PluggableAuthClient=pi.ExecutableError=void 0;var WN=Mn(),ZN=sf(),bE=lf(),KN=lf();Object.defineProperty(pi,"ExecutableError",{enumerable:!0,get:o(function(){return KN.ExecutableError},"get")});var JN=30*1e3,PE=5*1e3,SE=120*1e3,YN="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",EE=1,df=class extends WN.BaseExternalAccountClient{static{o(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(e){if(super(e),!e.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=e.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(e.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=JN;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<PE||this.timeoutMillis>SE)throw new Error(`Timeout must be between ${PE} and ${SE} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new bE.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[YN]!=="1")throw new Error("Pluggable Auth executables need to be explicitly allowed to run by setting the GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES environment Variable to 1.");let e;if(this.outputFile&&(e=await this.handler.retrieveCachedResponse()),!e){let r=new Map;r.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),r.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),r.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&r.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let n=this.getServiceAccountEmail();n&&r.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",n),e=await this.handler.retrieveResponseFromExecutable(r)}if(e.version>EE)throw new Error(`Version of executable is not currently supported, maximum supported version is ${EE}.`);if(!e.success)throw new bE.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new ZN.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(e.isExpired())throw new Error("Executable response is expired.");return e.subjectToken}};pi.PluggableAuthClient=df});var mf=k(ac=>{"use strict";Object.defineProperty(ac,"__esModule",{value:!0});ac.ExternalAccountClient=void 0;var XN=Mn(),QN=Jp(),ez=tf(),tz=pf(),ff=class{static{o(this,"ExternalAccountClient")}constructor(){throw new Error("ExternalAccountClients should be initialized via: ExternalAccountClient.fromJSON(), directly via explicit constructors, eg. new AwsClient(options), new IdentityPoolClient(options), newPluggableAuthClientOptions, or via new GoogleAuth(options).getClient()")}static fromJSON(e){return e&&e.type===XN.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new ez.AwsClient(e):e.credential_source?.executable?new tz.PluggableAuthClient(e):new QN.IdentityPoolClient(e):null}};ac.ExternalAccountClient=ff});var yf=k(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.ExternalAccountAuthorizedUserClient=fi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var xE=Ht(),TE=Mp(),wE=at(),rz=require("stream"),nz=Mn();fi.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var oz="https://sts.{universeDomain}/v1/oauthtoken",hf=class t extends TE.OAuthClientAuthHandler{static{o(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(e){super(e),this.#e=e.tokenRefreshEndpoint}async refreshToken(e,r){let n={...t.RETRY_CONFIG,url:this.#e,method:"POST",headers:r,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:e})};xE.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),s=i.data;return s.res=i,s}catch(i){throw i instanceof wE.GaxiosError&&i.response?(0,TE.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},gf=class extends xE.AuthClient{static{o(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(e){super(e),e.universe_domain&&(this.universeDomain=e.universe_domain),this.refreshToken=e.refresh_token;let r={confidentialClientType:"basic",clientId:e.client_id,clientSecret:e.client_secret};this.externalAccountAuthorizedUserHandler=new hf({tokenRefreshEndpoint:e.token_url??oz.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=nz.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!e?.forceRefreshOnFailure}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=wE.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof rz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:e.access_token,expiry_date:new Date().getTime()+e.expires_in*1e3,res:e.res},e.refresh_token!==void 0&&(this.refreshToken=e.refresh_token),this.cachedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};fi.ExternalAccountAuthorizedUserClient=gf});var OE=k(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.GoogleAuth=Er.GoogleAuthExceptionMessages=void 0;var iz=require("child_process"),Aa=require("fs"),az=at(),Ia=fa(),sz=require("os"),_f=require("path"),uz=ma(),cz=lp(),lz=pp(),dz=fp(),mi=$p(),AE=Np(),hi=Dp(),pz=mf(),Ra=Mn(),vf=Ht(),IE=yf(),RE=vr();Er.GoogleAuthExceptionMessages={API_KEY_WITH_CREDENTIALS:"API Keys and Credentials are mutually exclusive authentication methods and cannot be used together.",NO_PROJECT_ID_FOUND:`Unable to detect a Project Id in the current environment.
50
+ To learn more about authentication and Google APIs, visit:
51
+ https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
52
+ To learn more about authentication and Google APIs, visit:
53
+ https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment.
54
+ To learn more about Universe Domain retrieval, visit:
55
+ https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var bf=class{static{o(this,"GoogleAuth")}checkIsGCE=void 0;useJWTAccessWithScope;defaultServicePath;get isGCE(){return this.checkIsGCE}_findProjectIdPromise;_cachedProjectId;jsonContent=null;apiKey;cachedCredential=null;#e=null;defaultScopes;keyFilename;scopes;clientOptions={};constructor(e={}){if(this._cachedProjectId=e.projectId||null,this.cachedCredential=e.authClient||null,this.keyFilename=e.keyFilename||e.keyFile,this.scopes=e.scopes,this.clientOptions=e.clientOptions||{},this.jsonContent=e.credentials||null,this.apiKey=e.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Er.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);e.universeDomain&&(this.clientOptions.universeDomain=e.universeDomain)}setGapicJWTValues(e){e.defaultServicePath=this.defaultServicePath,e.useJWTAccessWithScope=this.useJWTAccessWithScope,e.defaultScopes=this.defaultScopes}getProjectId(e){if(e)this.getProjectIdAsync().then(r=>e(null,r),e);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(e){if(e instanceof Error&&e.message===Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw e}}async findAndCacheProjectId(){let e=null;if(e||=await this.getProductionProjectId(),e||=await this.getFileProjectId(),e||=await this.getDefaultServiceProjectId(),e||=await this.getGCEProjectId(),e||=await this.getExternalAccountClientProjectId(),e)return this._cachedProjectId=e,e;throw new Error(Er.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let e;try{e=await Ia.universe("universe-domain"),e||=vf.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=vf.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,RE.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=vf.DEFAULT_UNIVERSE}return e}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(e={},r){let n;if(typeof e=="function"?r=e:n=e,r)this.getApplicationDefaultAsync(n).then(i=>r(null,i.credential,i.projectId),r);else return this.getApplicationDefaultAsync(n)}async getApplicationDefaultAsync(e={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let r;if(r=await this._tryGetApplicationCredentialsFromEnvironmentVariable(e),r)return r instanceof mi.JWT?r.scopes=this.scopes:r instanceof Ra.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof mi.JWT?r.scopes=this.scopes:r instanceof Ra.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new cz.Compute(e));throw new Error(Er.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(e,r=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let n=await this.getProjectIdOptional();return r&&(e.quotaProjectId=r),this.cachedCredential=e,{credential:e,projectId:n}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=Ia.getGCPResidency()||await Ia.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(e){let r=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!r||r.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(r,e)}catch(n){throw n instanceof Error&&(n.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${n.message}`),n}}async _tryGetApplicationCredentialsFromWellKnownFile(e){let r=null;if(this._isWindows())r=process.env.APPDATA;else{let i=process.env.HOME;i&&(r=_f.join(i,".config"))}return r&&(r=_f.join(r,"gcloud","application_default_credentials.json"),Aa.existsSync(r)||(r=null)),r?await this._getApplicationCredentialsFromFilePath(r,e):null}async _getApplicationCredentialsFromFilePath(e,r={}){if(!e||e.length===0)throw new Error("The file path is invalid.");try{if(e=Aa.realpathSync(e),!Aa.lstatSync(e).isFile())throw new Error}catch(i){throw i instanceof Error&&(i.message=`The file at ${e} does not exist, or it is not a file. ${i.message}`),i}let n=Aa.createReadStream(e);return this.fromStream(n,r)}fromImpersonatedJSON(e){if(!e)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(e.type!==hi.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${hi.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!e.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!e.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let r=this.fromJSON(e.source_credentials);if(e.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${e.service_account_impersonation_url}`);let n=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(e.service_account_impersonation_url)?.groups?.target;if(!n)throw new RangeError(`Cannot extract target principal from ${e.service_account_impersonation_url}`);let i=(this.scopes||e.scopes||this.defaultScopes)??[];return new hi.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,RE.originalOrCamelOptions)(r).get("universe_domain");return e.type===AE.USER_REFRESH_ACCOUNT_TYPE?(n=new AE.UserRefreshClient(r),n.fromJSON(e)):e.type===hi.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===Ra.EXTERNAL_ACCOUNT_TYPE?(n=pz.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===IE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new IE.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new mi.JWT(r),this.setGapicJWTValues(n),n.fromJSON(e)),i&&(n.universeDomain=i),n}_cacheClientFromJSON(e,r){let n=this.fromJSON(e,r);return this.jsonContent=e,this.cachedCredential=n,n}fromStream(e,r={},n){let i={};if(typeof r=="function"?n=r:i=r,n)this.fromStreamAsync(e,i).then(s=>n(null,s),n);else return this.fromStreamAsync(e,i)}fromStreamAsync(e,r){return new Promise((n,i)=>{if(!e)throw new Error("Must pass in a stream containing the Google auth settings.");let s=[];e.setEncoding("utf8").on("error",i).on("data",c=>s.push(c)).on("end",()=>{try{try{let c=JSON.parse(s.join("")),d=this._cacheClientFromJSON(c,r);return n(d)}catch(c){if(!this.keyFilename)throw c;let d=new mi.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=d,this.setGapicJWTValues(d),n(d)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new mi.JWT({...r,apiKey:e})}_isWindows(){let e=sz.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,iz.exec)("gcloud config config-helper --format json",(r,n)=>{if(!r&&n)try{let i=JSON.parse(n).configuration.properties.core.project;e(i);return}catch{}e(null)})})}getProductionProjectId(){return process.env.GCLOUD_PROJECT||process.env.GOOGLE_CLOUD_PROJECT||process.env.gcloud_project||process.env.google_cloud_project}async getFileProjectId(){if(this.cachedCredential)return this.cachedCredential.projectId;if(this.keyFilename){let r=await this.getClient();if(r&&r.projectId)return r.projectId}let e=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return e?e.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==Ra.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await Ia.project("project-id")}catch{return null}}getCredentials(e){if(e)this.getCredentialsAsync().then(r=>e(null,r),e);else return this.getCredentialsAsync()}async getCredentialsAsync(){let e=await this.getClient();if(e instanceof hi.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof Ra.BaseExternalAccountClient){let r=e.getServiceAccountEmail();if(r)return{client_email:r,universe_domain:e.universeDomain}}if(this.jsonContent)return{client_email:this.jsonContent.client_email,private_key:this.jsonContent.private_key,universe_domain:this.jsonContent.universe_domain};if(await this._checkIsGCE()){let[r,n]=await Promise.all([Ia.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Er.GoogleAuthExceptionMessages.NO_CREDENTIALS_FOUND)}async getClient(){if(this.cachedCredential)return this.cachedCredential;this.#e=this.#e||this.#r();try{return await this.#e}finally{this.#e=null}}async#r(){if(this.jsonContent)return this._cacheClientFromJSON(this.jsonContent,this.clientOptions);if(this.keyFilename){let e=_f.resolve(this.keyFilename),r=Aa.createReadStream(e);return await this.fromStreamAsync(r,this.clientOptions)}else if(this.apiKey){let e=await this.fromAPIKey(this.apiKey,this.clientOptions);e.scopes=this.scopes;let{credential:r}=await this.#t(e);return r}else{let{credential:e}=await this.getApplicationDefaultAsync(this.clientOptions);return e}}async getIdTokenClient(e){let r=await this.getClient();if(!("fetchIdToken"in r))throw new Error("Cannot fetch ID token in this environment, use GCE or set the GOOGLE_APPLICATION_CREDENTIALS environment variable to a service account credentials JSON file.");return new lz.IdTokenClient({targetAudience:e,idTokenProvider:r})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(e){return(await this.getClient()).getRequestHeaders(e)}async authorizeRequest(e={}){let r=e.url,i=await(await this.getClient()).getRequestHeaders(r);return e.headers=az.Gaxios.mergeHeaders(e.headers,i),e}async fetch(...e){return(await this.getClient()).fetch(...e)}async request(e){return(await this.getClient()).request(e)}getEnv(){return(0,dz.getEnv)()}async sign(e,r){let n=await this.getClient(),i=await this.getUniverseDomain();if(r=r||`https://iamcredentials.${i}/v1/projects/-/serviceAccounts/`,n instanceof hi.Impersonated)return(await n.sign(e)).signedBlob;let s=(0,uz.createCrypto)();if(n instanceof mi.JWT&&n.key)return await s.sign(n.key,e);let c=await this.getCredentials();if(!c.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(s,c.client_email,e,r)}async signBlob(e,r,n,i){let s=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:s.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Er.GoogleAuth=bf});var CE=k(sc=>{"use strict";Object.defineProperty(sc,"__esModule",{value:!0});sc.IAMAuth=void 0;var Pf=class{static{o(this,"IAMAuth")}selector;token;constructor(e,r){this.selector=e,this.token=r,this.selector=e,this.token=r}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};sc.IAMAuth=Pf});var $E=k(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.DownscopedClient=Ur.EXPIRATION_TIME_OFFSET=Ur.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var fz=at(),mz=require("stream"),Sf=Ht(),hz=Fu(),gz="urn:ietf:params:oauth:grant-type:token-exchange",yz="urn:ietf:params:oauth:token-type:access_token",_z="urn:ietf:params:oauth:token-type:access_token";Ur.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Ur.EXPIRATION_TIME_OFFSET=5*60*1e3;var Ef=class extends Sf.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof Sf.AuthClient?{}:e),e instanceof Sf.AuthClient?(this.authClient=e,this.credentialAccessBoundary=r):(this.authClient=e.authClient,this.credentialAccessBoundary=e.credentialAccessBoundary),this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length===0)throw new Error("At least one access boundary rule needs to be defined.");if(this.credentialAccessBoundary.accessBoundary.accessBoundaryRules.length>Ur.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Ur.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let n of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(n.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new hz.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(e){if(!e.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(e),this.cachedDownscopedAccessToken=e}async getAccessToken(){return(!this.cachedDownscopedAccessToken||this.isExpired(this.cachedDownscopedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedDownscopedAccessToken.access_token,expirationTime:this.cachedDownscopedAccessToken.expiry_date,res:this.cachedDownscopedAccessToken.res}}async getRequestHeaders(){let e=await this.getAccessToken(),r=new Headers({authorization:`Bearer ${e.token}`});return this.addSharedMetadataHeaders(r)}request(e,r){if(r)this.requestAsync(e).then(n=>r(null,n),n=>r(n,n.response));else return this.requestAsync(e)}async requestAsync(e,r=!1){let n;try{let i=await this.getRequestHeaders();e.headers=fz.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let s=i.response;if(s){let c=s.status,d=s.config.data instanceof mz.Readable;if(!r&&(c===401||c===403)&&!d&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(e,!0)}throw i}return n}async refreshAccessTokenAsync(){let e=(await this.authClient.getAccessToken()).token,r={grantType:gz,requestedTokenType:yz,subjectToken:e,subjectTokenType:_z},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,s=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:s,res:n.res},this.credentials={},Object.assign(this.credentials,this.cachedDownscopedAccessToken),delete this.credentials.res,this.emit("tokens",{refresh_token:null,expiry_date:this.cachedDownscopedAccessToken.expiry_date,access_token:this.cachedDownscopedAccessToken.access_token,token_type:"Bearer",id_token:null}),this.cachedDownscopedAccessToken}isExpired(e){let r=new Date().getTime();return e.expiry_date?r>=e.expiry_date-this.eagerRefreshThresholdMillis:!1}};Ur.DownscopedClient=Ef});var kE=k(uc=>{"use strict";Object.defineProperty(uc,"__esModule",{value:!0});uc.PassThroughClient=void 0;var vz=Ht(),Tf=class extends vz.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};uc.PassThroughClient=Tf});var Oa=k(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.GoogleAuth=ae.auth=ae.PassThroughClient=ae.ExternalAccountAuthorizedUserClient=ae.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ae.ExecutableError=ae.PluggableAuthClient=ae.DownscopedClient=ae.BaseExternalAccountClient=ae.ExternalAccountClient=ae.IdentityPoolClient=ae.AwsRequestSigner=ae.AwsClient=ae.UserRefreshClient=ae.LoginTicket=ae.ClientAuthentication=ae.OAuth2Client=ae.CodeChallengeMethod=ae.Impersonated=ae.JWT=ae.JWTAccess=ae.IdTokenClient=ae.IAMAuth=ae.GCPEnv=ae.Compute=ae.DEFAULT_UNIVERSE=ae.AuthClient=ae.gaxios=ae.gcpMetadata=void 0;var NE=OE();Object.defineProperty(ae,"GoogleAuth",{enumerable:!0,get:o(function(){return NE.GoogleAuth},"get")});ae.gcpMetadata=fa();ae.gaxios=at();var zE=Ht();Object.defineProperty(ae,"AuthClient",{enumerable:!0,get:o(function(){return zE.AuthClient},"get")});Object.defineProperty(ae,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return zE.DEFAULT_UNIVERSE},"get")});var bz=lp();Object.defineProperty(ae,"Compute",{enumerable:!0,get:o(function(){return bz.Compute},"get")});var Pz=fp();Object.defineProperty(ae,"GCPEnv",{enumerable:!0,get:o(function(){return Pz.GCPEnv},"get")});var Sz=CE();Object.defineProperty(ae,"IAMAuth",{enumerable:!0,get:o(function(){return Sz.IAMAuth},"get")});var Ez=pp();Object.defineProperty(ae,"IdTokenClient",{enumerable:!0,get:o(function(){return Ez.IdTokenClient},"get")});var Tz=Op();Object.defineProperty(ae,"JWTAccess",{enumerable:!0,get:o(function(){return Tz.JWTAccess},"get")});var xz=$p();Object.defineProperty(ae,"JWT",{enumerable:!0,get:o(function(){return xz.JWT},"get")});var wz=Dp();Object.defineProperty(ae,"Impersonated",{enumerable:!0,get:o(function(){return wz.Impersonated},"get")});var xf=uo();Object.defineProperty(ae,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return xf.CodeChallengeMethod},"get")});Object.defineProperty(ae,"OAuth2Client",{enumerable:!0,get:o(function(){return xf.OAuth2Client},"get")});Object.defineProperty(ae,"ClientAuthentication",{enumerable:!0,get:o(function(){return xf.ClientAuthentication},"get")});var Az=ap();Object.defineProperty(ae,"LoginTicket",{enumerable:!0,get:o(function(){return Az.LoginTicket},"get")});var Iz=Np();Object.defineProperty(ae,"UserRefreshClient",{enumerable:!0,get:o(function(){return Iz.UserRefreshClient},"get")});var Rz=tf();Object.defineProperty(ae,"AwsClient",{enumerable:!0,get:o(function(){return Rz.AwsClient},"get")});var Oz=Xp();Object.defineProperty(ae,"AwsRequestSigner",{enumerable:!0,get:o(function(){return Oz.AwsRequestSigner},"get")});var Cz=Jp();Object.defineProperty(ae,"IdentityPoolClient",{enumerable:!0,get:o(function(){return Cz.IdentityPoolClient},"get")});var $z=mf();Object.defineProperty(ae,"ExternalAccountClient",{enumerable:!0,get:o(function(){return $z.ExternalAccountClient},"get")});var kz=Mn();Object.defineProperty(ae,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return kz.BaseExternalAccountClient},"get")});var Nz=$E();Object.defineProperty(ae,"DownscopedClient",{enumerable:!0,get:o(function(){return Nz.DownscopedClient},"get")});var DE=pf();Object.defineProperty(ae,"PluggableAuthClient",{enumerable:!0,get:o(function(){return DE.PluggableAuthClient},"get")});Object.defineProperty(ae,"ExecutableError",{enumerable:!0,get:o(function(){return DE.ExecutableError},"get")});var UE=yf();Object.defineProperty(ae,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return UE.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ae,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return UE.ExternalAccountAuthorizedUserClient},"get")});var zz=kE();Object.defineProperty(ae,"PassThroughClient",{enumerable:!0,get:o(function(){return zz.PassThroughClient},"get")});var Dz=new NE.GoogleAuth;ae.auth=Dz});var ME=k(wf=>{"use strict";Object.defineProperty(wf,"__esModule",{value:!0});wf.getAPI=Uz;function Uz(t,e,r,n){let i;if(typeof e=="string")i=e,e={};else if(typeof e=="object")i=e.version,delete e.version;else throw new Error("Argument error: Accepts only string or object");try{let s=r[i],c=new s(e,n);return Object.freeze(c)}catch(s){throw new Error(`Unable to load endpoint ${t}("${i}"): ${s.message}`)}}o(Uz,"getAPI")});var LE=k((QY,jE)=>{jE.exports=require("util").inspect});var za=k((eX,aT)=>{var Df=typeof Map=="function"&&Map.prototype,Af=Object.getOwnPropertyDescriptor&&Df?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,lc=Df&&Af&&typeof Af.get=="function"?Af.get:null,FE=Df&&Map.prototype.forEach,Uf=typeof Set=="function"&&Set.prototype,If=Object.getOwnPropertyDescriptor&&Uf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,dc=Uf&&If&&typeof If.get=="function"?If.get:null,BE=Uf&&Set.prototype.forEach,Mz=typeof WeakMap=="function"&&WeakMap.prototype,$a=Mz?WeakMap.prototype.has:null,jz=typeof WeakSet=="function"&&WeakSet.prototype,ka=jz?WeakSet.prototype.has:null,Lz=typeof WeakRef=="function"&&WeakRef.prototype,qE=Lz?WeakRef.prototype.deref:null,Fz=Boolean.prototype.valueOf,Bz=Object.prototype.toString,qz=Function.prototype.toString,Vz=String.prototype.match,Mf=String.prototype.slice,jn=String.prototype.replace,Hz=String.prototype.toUpperCase,VE=String.prototype.toLowerCase,QE=RegExp.prototype.test,HE=Array.prototype.concat,Mr=Array.prototype.join,Gz=Array.prototype.slice,GE=Math.floor,Cf=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Rf=Object.getOwnPropertySymbols,$f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,gi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Na=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===gi||!0)?Symbol.toStringTag:null,eT=Object.prototype.propertyIsEnumerable,WE=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function ZE(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||QE.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-GE(-t):GE(t);if(n!==t){var i=String(n),s=Mf.call(e,i.length+1);return jn.call(i,r,"$&_")+"."+jn.call(jn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return jn.call(e,r,"$&_")}o(ZE,"addNumericSeparator");var kf=LE(),KE=kf.custom,JE=nT(KE)?KE:null,tT={__proto__:null,double:'"',single:"'"},Wz={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};aT.exports=o(function t(e,r,n,i){var s=r||{};if(un(s,"quoteStyle")&&!un(tT,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(un(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=un(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(un(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(un(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return iT(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return d?ZE(e,l):l}if(typeof e=="bigint"){var p=String(e)+"n";return d?ZE(e,p):p}var f=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=f&&f>0&&typeof e=="object")return Nf(e)?"[Array]":"[Object]";var _=dD(s,n);if(typeof i>"u")i=[];else if(oT(i,e)>=0)return"[Circular]";function h(B,J,Z){if(J&&(i=Gz.call(i),i.push(J)),Z){var re={depth:s.depth};return un(s,"quoteStyle")&&(re.quoteStyle=s.quoteStyle),t(B,re,n+1,i)}return t(B,s,n+1,i)}if(o(h,"inspect"),typeof e=="function"&&!YE(e)){var g=rD(e),y=cc(e,h);return"[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+Mr.call(y,", ")+" }":"")}if(nT(e)){var T=gi?jn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):$f.call(e);return typeof e=="object"&&!gi?Ca(T):T}if(uD(e)){for(var P="<"+VE.call(String(e.nodeName)),x=e.attributes||[],N=0;N<x.length;N++)P+=" "+x[N].name+"="+rT(Zz(x[N].value),"double",s);return P+=">",e.childNodes&&e.childNodes.length&&(P+="..."),P+="</"+VE.call(String(e.nodeName))+">",P}if(Nf(e)){if(e.length===0)return"[]";var L=cc(e,h);return _&&!lD(L)?"["+zf(L,_)+"]":"[ "+Mr.call(L,", ")+" ]"}if(Jz(e)){var X=cc(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!eT.call(e,"cause")?"{ ["+String(e)+"] "+Mr.call(HE.call("[cause]: "+h(e.cause),X),", ")+" }":X.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Mr.call(X,", ")+" }"}if(typeof e=="object"&&c){if(JE&&typeof e[JE]=="function"&&kf)return kf(e,{depth:f-n});if(c!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(nD(e)){var W=[];return FE&&FE.call(e,function(B,J){W.push(h(J,e,!0)+" => "+h(B,e))}),XE("Map",lc.call(e),W,_)}if(aD(e)){var G=[];return BE&&BE.call(e,function(B){G.push(h(B,e))}),XE("Set",dc.call(e),G,_)}if(oD(e))return Of("WeakMap");if(sD(e))return Of("WeakSet");if(iD(e))return Of("WeakRef");if(Xz(e))return Ca(h(Number(e)));if(eD(e))return Ca(h(Cf.call(e)));if(Qz(e))return Ca(Fz.call(e));if(Yz(e))return Ca(h(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof global<"u"&&e===global)return"{ [object globalThis] }";if(!Kz(e)&&!YE(e)){var K=cc(e,h),ee=WE?WE(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",Se=!ee&&Na&&Object(e)===e&&Na in e?Mf.call(Ln(e),8,-1):Y?"Object":"",te=ee||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",q=te+(Se||Y?"["+Mr.call(HE.call([],Se||[],Y||[]),": ")+"] ":"");return K.length===0?q+"{}":_?q+"{"+zf(K,_)+"}":q+"{ "+Mr.call(K,", ")+" }"}return String(e)},"inspect_");function rT(t,e,r){var n=r.quoteStyle||e,i=tT[n];return i+t+i}o(rT,"wrapQuotes");function Zz(t){return jn.call(String(t),/"/g,"&quot;")}o(Zz,"quote");function lo(t){return!Na||!(typeof t=="object"&&(Na in t||typeof t[Na]<"u"))}o(lo,"canTrustToString");function Nf(t){return Ln(t)==="[object Array]"&&lo(t)}o(Nf,"isArray");function Kz(t){return Ln(t)==="[object Date]"&&lo(t)}o(Kz,"isDate");function YE(t){return Ln(t)==="[object RegExp]"&&lo(t)}o(YE,"isRegExp");function Jz(t){return Ln(t)==="[object Error]"&&lo(t)}o(Jz,"isError");function Yz(t){return Ln(t)==="[object String]"&&lo(t)}o(Yz,"isString");function Xz(t){return Ln(t)==="[object Number]"&&lo(t)}o(Xz,"isNumber");function Qz(t){return Ln(t)==="[object Boolean]"&&lo(t)}o(Qz,"isBoolean");function nT(t){if(gi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!$f)return!1;try{return $f.call(t),!0}catch{}return!1}o(nT,"isSymbol");function eD(t){if(!t||typeof t!="object"||!Cf)return!1;try{return Cf.call(t),!0}catch{}return!1}o(eD,"isBigInt");var tD=Object.prototype.hasOwnProperty||function(t){return t in this};function un(t,e){return tD.call(t,e)}o(un,"has");function Ln(t){return Bz.call(t)}o(Ln,"toStr");function rD(t){if(t.name)return t.name;var e=Vz.call(qz.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}o(rD,"nameOf");function oT(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}o(oT,"indexOf");function nD(t){if(!lc||!t||typeof t!="object")return!1;try{lc.call(t);try{dc.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}o(nD,"isMap");function oD(t){if(!$a||!t||typeof t!="object")return!1;try{$a.call(t,$a);try{ka.call(t,ka)}catch{return!0}return t instanceof WeakMap}catch{}return!1}o(oD,"isWeakMap");function iD(t){if(!qE||!t||typeof t!="object")return!1;try{return qE.call(t),!0}catch{}return!1}o(iD,"isWeakRef");function aD(t){if(!dc||!t||typeof t!="object")return!1;try{dc.call(t);try{lc.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}o(aD,"isSet");function sD(t){if(!ka||!t||typeof t!="object")return!1;try{ka.call(t,ka);try{$a.call(t,$a)}catch{return!0}return t instanceof WeakSet}catch{}return!1}o(sD,"isWeakSet");function uD(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}o(uD,"isElement");function iT(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return iT(Mf.call(t,0,e.maxStringLength),e)+n}var i=Wz[e.quoteStyle||"single"];i.lastIndex=0;var s=jn.call(jn.call(t,i,"\\$1"),/[\x00-\x1f]/g,cD);return rT(s,"single",e)}o(iT,"inspectString");function cD(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Hz.call(e.toString(16))}o(cD,"lowbyte");function Ca(t){return"Object("+t+")"}o(Ca,"markBoxed");function Of(t){return t+" { ? }"}o(Of,"weakCollectionOf");function XE(t,e,r,n){var i=n?zf(r,n):Mr.call(r,", ");return t+" ("+e+") {"+i+"}"}o(XE,"collectionOf");function lD(t){for(var e=0;e<t.length;e++)if(oT(t[e],`
56
+ `)>=0)return!1;return!0}o(lD,"singleLineValues");function dD(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Mr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Mr.call(Array(e+1),r)}}o(dD,"getIndent");function zf(t,e){if(t.length===0)return"";var r=`
57
+ `+e.prev+e.base;return r+Mr.call(t,","+r)+`
58
+ `+e.prev}o(zf,"indentedJoin");function cc(t,e){var r=Nf(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=un(t,i)?e(t[i],t):""}var s=typeof Rf=="function"?Rf(t):[],c;if(gi){c={};for(var d=0;d<s.length;d++)c["$"+s[d]]=s[d]}for(var l in t)un(t,l)&&(r&&String(Number(l))===l&&l<t.length||gi&&c["$"+l]instanceof Symbol||(QE.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof Rf=="function")for(var p=0;p<s.length;p++)eT.call(t,s[p])&&n.push("["+e(s[p])+"]: "+e(t[s[p]],t));return n}o(cc,"arrObjKeys")});var uT=k((rX,sT)=>{"use strict";var pD=za(),fD=In(),pc=o(function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},"listGetNode"),mD=o(function(t,e){if(t){var r=pc(t,e);return r&&r.value}},"listGet"),hD=o(function(t,e,r){var n=pc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),gD=o(function(t,e){return t?!!pc(t,e):!1},"listHas"),yD=o(function(t,e){if(t)return pc(t,e,!0)},"listDelete");sT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new fD("Side channel does not contain "+pD(n))},"assert"),delete:o(function(n){var i=yD(e,n);return i&&e&&!e.next&&(e=void 0),!!i},"delete"),get:o(function(n){return mD(e,n)},"get"),has:o(function(n){return gD(e,n)},"has"),set:o(function(n,i){e||(e={next:void 0}),hD(e,n,i)},"set")};return r},"getSideChannelList")});var jf=k((oX,dT)=>{"use strict";var cT=Yi(),lT=Xl(),_D=lT([cT("%String.prototype.indexOf%")]);dT.exports=o(function(e,r){var n=cT(e,!!r);return typeof n=="function"&&_D(e,".prototype.")>-1?lT([n]):n},"callBoundIntrinsic")});var Lf=k((aX,fT)=>{"use strict";var vD=Yi(),Da=jf(),bD=za(),PD=In(),pT=vD("%Map%",!0),SD=Da("Map.prototype.get",!0),ED=Da("Map.prototype.set",!0),TD=Da("Map.prototype.has",!0),xD=Da("Map.prototype.delete",!0),wD=Da("Map.prototype.size",!0);fT.exports=!!pT&&o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new PD("Side channel does not contain "+bD(n))},"assert"),delete:o(function(n){if(e){var i=xD(e,n);return wD(e)===0&&(e=void 0),i}return!1},"delete"),get:o(function(n){if(e)return SD(e,n)},"get"),has:o(function(n){return e?TD(e,n):!1},"has"),set:o(function(n,i){e||(e=new pT),ED(e,n,i)},"set")};return r},"getSideChannelMap")});var hT=k((uX,mT)=>{"use strict";var AD=Yi(),mc=jf(),ID=za(),fc=Lf(),RD=In(),yi=AD("%WeakMap%",!0),OD=mc("WeakMap.prototype.get",!0),CD=mc("WeakMap.prototype.set",!0),$D=mc("WeakMap.prototype.has",!0),kD=mc("WeakMap.prototype.delete",!0);mT.exports=yi?o(function(){var e,r,n={assert:o(function(i){if(!n.has(i))throw new RD("Side channel does not contain "+ID(i))},"assert"),delete:o(function(i){if(yi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return kD(e,i)}else if(fc&&r)return r.delete(i);return!1},"delete"),get:o(function(i){return yi&&i&&(typeof i=="object"||typeof i=="function")&&e?OD(e,i):r&&r.get(i)},"get"),has:o(function(i){return yi&&i&&(typeof i=="object"||typeof i=="function")&&e?$D(e,i):!!r&&r.has(i)},"has"),set:o(function(i,s){yi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new yi),CD(e,i,s)):fc&&(r||(r=fc()),r.set(i,s))},"set")};return n},"getSideChannelWeakMap"):fc});var Ff=k((lX,gT)=>{"use strict";var ND=In(),zD=za(),DD=uT(),UD=Lf(),MD=hT(),jD=MD||UD||DD;gT.exports=o(function(){var e,r={assert:o(function(n){if(!r.has(n))throw new ND("Side channel does not contain "+zD(n))},"assert"),delete:o(function(n){return!!e&&e.delete(n)},"delete"),get:o(function(n){return e&&e.get(n)},"get"),has:o(function(n){return!!e&&e.has(n)},"has"),set:o(function(n,i){e||(e=jD()),e.set(n,i)},"set")};return r},"getSideChannel")});var hc=k((pX,yT)=>{"use strict";var LD=String.prototype.replace,FD=/%20/g,Bf={RFC1738:"RFC1738",RFC3986:"RFC3986"};yT.exports={default:Bf.RFC3986,formatters:{RFC1738:o(function(t){return LD.call(t,FD,"+")},"RFC1738"),RFC3986:o(function(t){return String(t)},"RFC3986")},RFC1738:Bf.RFC1738,RFC3986:Bf.RFC3986}});var Gf=k((mX,_T)=>{"use strict";var BD=hc(),qD=Ff(),qf=Object.prototype.hasOwnProperty,po=Array.isArray,gc=qD(),_i=o(function(e,r){return gc.set(e,r),e},"markOverflow"),fo=o(function(e){return gc.has(e)},"isOverflow"),Ua=o(function(e){return gc.get(e)},"getMaxIndex"),Hf=o(function(e,r){gc.set(e,r)},"setMaxIndex"),jr=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),VD=o(function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(po(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&(i[i.length]=n[s]);r.obj[r.prop]=i}}},"compactQueue"),Ma=o(function(e,r){for(var n=r&&r.plainObjects?{__proto__:null}:{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},"arrayToObject"),HD=o(function t(e,r,n){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(po(e)){var i=e.length;if(n&&typeof n.arrayLimit=="number"&&i>n.arrayLimit)return _i(Ma(e.concat(r),n),i);e[i]=r}else if(e&&typeof e=="object")if(fo(e)){var s=Ua(e)+1;e[s]=r,Hf(e,s)}else{if(n&&n.strictMerge)return[e,r];(n&&(n.plainObjects||n.allowPrototypes)||!qf.call(Object.prototype,r))&&(e[r]=!0)}else return[e,r];return e}if(!e||typeof e!="object"){if(fo(r)){for(var c=Object.keys(r),d=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},l=0;l<c.length;l++){var p=parseInt(c[l],10);d[p+1]=r[c[l]]}return _i(d,Ua(r)+1)}var f=[e].concat(r);return n&&typeof n.arrayLimit=="number"&&f.length>n.arrayLimit?_i(Ma(f,n),f.length-1):f}var _=e;return po(e)&&!po(r)&&(_=Ma(e,n)),po(e)&&po(r)?(r.forEach(function(h,g){if(qf.call(e,g)){var y=e[g];y&&typeof y=="object"&&h&&typeof h=="object"?e[g]=t(y,h,n):e[e.length]=h}else e[g]=h}),e):Object.keys(r).reduce(function(h,g){var y=r[g];if(qf.call(h,g)?h[g]=t(h[g],y,n):h[g]=y,fo(r)&&!fo(h)&&_i(h,Ua(r)),fo(h)){var T=parseInt(g,10);String(T)===g&&T>=0&&T>Ua(h)&&Hf(h,T)}return h},_)},"merge"),GD=o(function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},"assignSingleSource"),WD=o(function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},"decode"),Vf=1024,ZD=o(function(e,r,n,i,s){if(e.length===0)return e;var c=e;if(typeof e=="symbol"?c=Symbol.prototype.toString.call(e):typeof e!="string"&&(c=String(e)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(g){return"%26%23"+parseInt(g.slice(2),16)+"%3B"});for(var d="",l=0;l<c.length;l+=Vf){for(var p=c.length>=Vf?c.slice(l,l+Vf):c,f=[],_=0;_<p.length;++_){var h=p.charCodeAt(_);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||s===BD.RFC1738&&(h===40||h===41)){f[f.length]=p.charAt(_);continue}if(h<128){f[f.length]=jr[h];continue}if(h<2048){f[f.length]=jr[192|h>>6]+jr[128|h&63];continue}if(h<55296||h>=57344){f[f.length]=jr[224|h>>12]+jr[128|h>>6&63]+jr[128|h&63];continue}_+=1,h=65536+((h&1023)<<10|p.charCodeAt(_)&1023),f[f.length]=jr[240|h>>18]+jr[128|h>>12&63]+jr[128|h>>6&63]+jr[128|h&63]}d+=f.join("")}return d},"encode"),KD=o(function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],c=s.obj[s.prop],d=Object.keys(c),l=0;l<d.length;++l){var p=d[l],f=c[p];typeof f=="object"&&f!==null&&n.indexOf(f)===-1&&(r[r.length]={obj:c,prop:p},n[n.length]=f)}return VD(r),e},"compact"),JD=o(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),YD=o(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),XD=o(function(e,r,n,i){if(fo(e)){var s=Ua(e)+1;return e[s]=r,Hf(e,s),e}var c=[].concat(e,r);return c.length>n?_i(Ma(c,{plainObjects:i}),c.length-1):c},"combine"),QD=o(function(e,r){if(po(e)){for(var n=[],i=0;i<e.length;i+=1)n[n.length]=r(e[i]);return n}return r(e)},"maybeMap");_T.exports={arrayToObject:Ma,assign:GD,combine:XD,compact:KD,decode:WD,encode:ZD,isBuffer:YD,isOverflow:fo,isRegExp:JD,markOverflow:_i,maybeMap:QD,merge:HD}});var TT=k((gX,ET)=>{"use strict";var bT=Ff(),yc=Gf(),ja=hc(),eU=Object.prototype.hasOwnProperty,PT={brackets:o(function(e){return e+"[]"},"brackets"),comma:"comma",indices:o(function(e,r){return e+"["+r+"]"},"indices"),repeat:o(function(e){return e},"repeat")},Lr=Array.isArray,tU=Array.prototype.push,ST=o(function(t,e){tU.apply(t,Lr(e)?e:[e])},"pushToArray"),rU=Date.prototype.toISOString,vT=ja.default,ft={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:yc.encode,encodeValuesOnly:!1,filter:void 0,format:vT,formatter:ja.formatters[vT],indices:!1,serializeDate:o(function(e){return rU.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},nU=o(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Wf={},oU=o(function t(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N){for(var L=e,X=N,W=0,G=!1;(X=X.get(Wf))!==void 0&&!G;){var K=X.get(e);if(W+=1,typeof K<"u"){if(K===W)throw new RangeError("Cyclic object value");G=!0}typeof X.get(Wf)>"u"&&(W=0)}if(typeof f=="function"?L=f(r,L):L instanceof Date?L=g(L):n==="comma"&&Lr(L)&&(L=yc.maybeMap(L,function(Fe){return Fe instanceof Date?g(Fe):Fe})),L===null){if(c)return p&&!P?p(r,ft.encoder,x,"key",y):r;L=""}if(nU(L)||yc.isBuffer(L)){if(p){var ee=P?r:p(r,ft.encoder,x,"key",y);return[T(ee)+"="+T(p(L,ft.encoder,x,"value",y))]}return[T(r)+"="+T(String(L))]}var Y=[];if(typeof L>"u")return Y;var Se;if(n==="comma"&&Lr(L))P&&p&&(L=yc.maybeMap(L,p)),Se=[{value:L.length>0?L.join(",")||null:void 0}];else if(Lr(f))Se=f;else{var te=Object.keys(L);Se=_?te.sort(_):te}var q=l?String(r).replace(/\./g,"%2E"):String(r),B=i&&Lr(L)&&L.length===1?q+"[]":q;if(s&&Lr(L)&&L.length===0)return B+"[]";for(var J=0;J<Se.length;++J){var Z=Se[J],re=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:L[Z];if(!(d&&re===null)){var oe=h&&l?String(Z).replace(/\./g,"%2E"):String(Z),Ae=Lr(L)?typeof n=="function"?n(B,oe):B:B+(h?"."+oe:"["+oe+"]");N.set(e,W);var Oe=bT();Oe.set(Wf,N),ST(Y,t(re,Ae,n,i,s,c,d,l,n==="comma"&&P&&Lr(L)?null:p,f,_,h,g,y,T,P,x,Oe))}}return Y},"stringify"),iU=o(function(e){if(!e)return ft;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ft.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ja.default;if(typeof e.format<"u"){if(!eU.call(ja.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ja.formatters[n],s=ft.filter;(typeof e.filter=="function"||Lr(e.filter))&&(s=e.filter);var c;if(e.arrayFormat in PT?c=e.arrayFormat:"indices"in e?c=e.indices?"indices":"repeat":c=ft.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var d=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:ft.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ft.addQueryPrefix,allowDots:d,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ft.allowEmptyArrays,arrayFormat:c,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ft.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?ft.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ft.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:ft.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:ft.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ft.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ft.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ft.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ft.strictNullHandling}},"normalizeStringifyOptions");ET.exports=function(t,e){var r=t,n=iU(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Lr(n.filter)&&(s=n.filter,i=s);var c=[];if(typeof r!="object"||r===null)return"";var d=PT[n.arrayFormat],l=d==="comma"&&n.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=bT(),f=0;f<i.length;++f){var _=i[f],h=r[_];n.skipNulls&&h===null||ST(c,oU(h,_,d,l,n.allowEmptyArrays,n.strictNullHandling,n.skipNulls,n.encodeDotInKeys,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var g=c.join(n.delimiter),y=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),g.length>0?y+g:""}});var AT=k((_X,wT)=>{"use strict";var Fr=Gf(),_c=Object.prototype.hasOwnProperty,Zf=Array.isArray,Qe={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Fr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},aU=o(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),xT=o(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),sU="utf8=%26%2310003%3B",uU="utf8=%E2%9C%93",cU=o(function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=r.parameterLimit===1/0?void 0:r.parameterLimit,c=i.split(r.delimiter,r.throwOnLimitExceeded&&typeof s<"u"?s+1:s);if(r.throwOnLimitExceeded&&typeof s<"u"&&c.length>s)throw new RangeError("Parameter limit exceeded. Only "+s+" parameter"+(s===1?"":"s")+" allowed.");var d=-1,l,p=r.charset;if(r.charsetSentinel)for(l=0;l<c.length;++l)c[l].indexOf("utf8=")===0&&(c[l]===uU?p="utf-8":c[l]===sU&&(p="iso-8859-1"),d=l,l=c.length);for(l=0;l<c.length;++l)if(l!==d){var f=c[l],_=f.indexOf("]="),h=_===-1?f.indexOf("="):_+1,g,y;if(h===-1?(g=r.decoder(f,Qe.decoder,p,"key"),y=r.strictNullHandling?null:""):(g=r.decoder(f.slice(0,h),Qe.decoder,p,"key"),g!==null&&(y=Fr.maybeMap(xT(f.slice(h+1),r,Zf(n[g])?n[g].length:0),function(P){return r.decoder(P,Qe.decoder,p,"value")}))),y&&r.interpretNumericEntities&&p==="iso-8859-1"&&(y=aU(String(y))),f.indexOf("[]=")>-1&&(y=Zf(y)?[y]:y),r.comma&&Zf(y)&&y.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");y=Fr.combine([],y,r.arrayLimit,r.plainObjects)}if(g!==null){var T=_c.call(n,g);T&&(r.duplicates==="combine"||f.indexOf("[]=")>-1)?n[g]=Fr.combine(n[g],y,r.arrayLimit,r.plainObjects):(!T||r.duplicates==="last")&&(n[g]=y)}}return n},"parseQueryStringValues"),lU=o(function(t,e,r,n){var i=0;if(t.length>0&&t[t.length-1]==="[]"){var s=t.slice(0,-1).join("");i=Array.isArray(e)&&e[s]?e[s].length:0}for(var c=n?e:xT(e,r,i),d=t.length-1;d>=0;--d){var l,p=t[d];if(p==="[]"&&r.parseArrays)Fr.isOverflow(c)?l=c:l=r.allowEmptyArrays&&(c===""||r.strictNullHandling&&c===null)?[]:Fr.combine([],c,r.arrayLimit,r.plainObjects);else{l=r.plainObjects?{__proto__:null}:{};var f=p.charAt(0)==="["&&p.charAt(p.length-1)==="]"?p.slice(1,-1):p,_=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,h=parseInt(_,10),g=!isNaN(h)&&p!==_&&String(h)===_&&h>=0&&r.parseArrays;if(!r.parseArrays&&_==="")l={0:c};else if(g&&h<r.arrayLimit)l=[],l[h]=c;else{if(g&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");g?(l[h]=c,Fr.markOverflow(l,h)):_!=="__proto__"&&(l[_]=c)}}c=l}return c},"parseObject"),dU=o(function(e,r){var n=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(r.depth<=0)return!r.plainObjects&&_c.call(Object.prototype,n)&&!r.allowPrototypes?void 0:[n];var i=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,c=i.exec(n),d=c?n.slice(0,c.index):n,l=[];if(d){if(!r.plainObjects&&_c.call(Object.prototype,d)&&!r.allowPrototypes)return;l[l.length]=d}for(var p=0;(c=s.exec(n))!==null&&p<r.depth;){p+=1;var f=c[1].slice(1,-1);if(!r.plainObjects&&_c.call(Object.prototype,f)&&!r.allowPrototypes)return;l[l.length]=c[1]}if(c){if(r.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");l[l.length]="["+n.slice(c.index)+"]"}return l},"splitKeyIntoSegments"),pU=o(function(e,r,n,i){if(e){var s=dU(e,n);if(s)return lU(s,r,n,i)}},"parseQueryStringKeys"),fU=o(function(e){if(!e)return Qe;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?Qe.charset:e.charset,n=typeof e.duplicates>"u"?Qe.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var i=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Qe.allowDots:!!e.allowDots;return{allowDots:i,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Qe.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Qe.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Qe.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Qe.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Qe.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Qe.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Qe.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Qe.decoder,delimiter:typeof e.delimiter=="string"||Fr.isRegExp(e.delimiter)?e.delimiter:Qe.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Qe.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Qe.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Qe.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Qe.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Qe.strictDepth,strictMerge:typeof e.strictMerge=="boolean"?!!e.strictMerge:Qe.strictMerge,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Qe.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");wT.exports=function(t,e){var r=fU(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?cU(t,r):t,i=r.plainObjects?{__proto__:null}:{},s=Object.keys(n),c=0;c<s.length;++c){var d=s[c],l=pU(d,n[d],r,typeof t=="string");i=Fr.merge(i,l,r)}return r.allowSparse===!0?i:Fr.compact(i)}});var Kf=k((bX,IT)=>{"use strict";var mU=TT(),hU=AT(),gU=hc();IT.exports={formats:gU,parse:hU,stringify:mU}});var OT=k((Jf,RT)=>{(function(t,e){typeof Jf=="object"?RT.exports=e():typeof define=="function"&&define.amd?define([],e):t.urltemplate=e()})(Jf,function(){function t(){}return o(t,"UrlTemplate"),t.prototype.encodeReserved=function(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(r){return/%[0-9A-Fa-f]/.test(r)||(r=encodeURI(r).replace(/%5B/g,"[").replace(/%5D/g,"]")),r}).join("")},t.prototype.encodeUnreserved=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})},t.prototype.encodeValue=function(e,r,n){return r=e==="+"||e==="#"?this.encodeReserved(r):this.encodeUnreserved(r),n?this.encodeUnreserved(n)+"="+r:r},t.prototype.isDefined=function(e){return e!=null},t.prototype.isKeyOperator=function(e){return e===";"||e==="&"||e==="?"},t.prototype.getValues=function(e,r,n,i){var s=e[n],c=[];if(this.isDefined(s)&&s!=="")if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")s=s.toString(),i&&i!=="*"&&(s=s.substring(0,parseInt(i,10))),c.push(this.encodeValue(r,s,this.isKeyOperator(r)?n:null));else if(i==="*")Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){c.push(this.encodeValue(r,l,this.isKeyOperator(r)?n:null))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&c.push(this.encodeValue(r,s[l],l))},this);else{var d=[];Array.isArray(s)?s.filter(this.isDefined).forEach(function(l){d.push(this.encodeValue(r,l))},this):Object.keys(s).forEach(function(l){this.isDefined(s[l])&&(d.push(this.encodeUnreserved(l)),d.push(this.encodeValue(r,s[l].toString())))},this),this.isKeyOperator(r)?c.push(this.encodeUnreserved(n)+"="+d.join(",")):d.length!==0&&c.push(d.join(","))}else r===";"?this.isDefined(s)&&c.push(this.encodeUnreserved(n)):s===""&&(r==="&"||r==="?")?c.push(this.encodeUnreserved(n)+"="):s===""&&c.push("");return c},t.prototype.parse=function(e){var r=this,n=["+","#",".","/",";","?","&"];return{expand:o(function(i){return e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(s,c,d){if(c){var l=null,p=[];if(n.indexOf(c.charAt(0))!==-1&&(l=c.charAt(0),c=c.substr(1)),c.split(/,/g).forEach(function(_){var h=/([^:\*]*)(?::(\d+)|(\*))?/.exec(_);p.push.apply(p,r.getValues(i,l,h[1],h[2]||h[3]))}),l&&l!=="+"){var f=",";return l==="?"?f="&":l!=="#"&&(f=l),(p.length!==0?l:"")+p.join(f)}else return p.join(",")}else return r.encodeReserved(d)})},"expand")}},new t})});var CT=k(Yf=>{"use strict";Object.defineProperty(Yf,"__esModule",{value:!0});Yf.isBrowser=yU;function yU(){return typeof window<"u"}o(yU,"isBrowser")});var bc=k(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.headersToClassicHeaders=$T;vc.marshallGaxiosResponse=_U;function $T(t){let e={};if(t instanceof Headers)t.forEach((r,n)=>{e[n]=r});else if(Array.isArray(t))for(let[r,n]of t)e[r]=n;else e=t||{};return e}o($T,"headersToClassicHeaders");function _U(t){return Object.defineProperties(t||{},{headers:{configurable:!0,writable:!0,enumerable:!0,value:$T(t?.headers)}})}o(_U,"marshallGaxiosResponse")});var zT=k(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.sessions=void 0;Jt.request=CU;Jt.closeSession=Xf;var NT=require("http2"),vU=require("zlib"),bU=require("url"),PU=Kf(),SU=Qi(),EU=require("stream"),TU=require("util"),xU=require("process"),wU=bc(),{HTTP2_HEADER_CONTENT_ENCODING:AU,HTTP2_HEADER_CONTENT_TYPE:kT,HTTP2_HEADER_METHOD:IU,HTTP2_HEADER_PATH:RU,HTTP2_HEADER_STATUS:OU}=NT.constants,La=!!xU.env.HTTP2_DEBUG;Jt.sessions={};async function CU(t){let e=SU(!0,{},t);e.validateStatus=e.validateStatus||$U,e.responseType=e.responseType||"json";let r=new bU.URL(e.url),n=kU(r.host);n.timeoutHandle!==void 0&&clearTimeout(n.timeoutHandle);let i=r.pathname;if(t.params&&Object.keys(t.params).length>0){let _=(t.paramsSerializer||PU.stringify)(e.params);i+=`?${_}`}let s=(0,wU.headersToClassicHeaders)(e.headers);s[RU]=i,s[IU]=t.method||"GET",e.headers=s,s[kT]||e.responseType!=="text"&&(s[kT]="application/json");let c={config:t,headers:{},status:0,data:{},statusText:""},d=[],l=n.session,p;return new Promise((f,_)=>{try{p=l.request(s).on("response",h=>{Object.assign(c,{headers:h,status:h[OU]});let g=p;if(h[AU]==="gzip"&&(g=p.pipe(vU.createGunzip())),e.responseType==="stream"){c.data=g,f(c);return}g.on("data",y=>{d.push(y)}).on("error",y=>{_(y)}).on("end",()=>{let y=Buffer.concat(d),T=y;if(y){if(e.responseType==="json")try{T=JSON.parse(y.toString("utf8"))}catch{T=y.toString("utf8")}else e.responseType==="text"?T=y.toString("utf8"):e.responseType==="arraybuffer"&&(T=y.buffer);c.data=T}if(!e.validateStatus(c.status)){let P=`Request failed with status code ${c.status}. `;if(c.data&&typeof c.data=="object"){let x=TU.inspect(c.data,{depth:5});P=`${P}
59
+ '${x}`}_(new Error(P,{cause:c}))}f(c)})}).on("error",h=>{_(h)})}catch(h){Xf(r).then(()=>_(h)).catch(_);return}if(c.request=p,t.data){if(t.data instanceof EU.Stream)t.data.pipe(p);else if(typeof t.data=="string"){let h=Buffer.from(t.data);p.end(h)}else if(typeof t.data=="object"){let h=JSON.stringify(t.data);p.end(h)}}n.timeoutHandle=setTimeout(()=>Xf(r),500)})}o(CU,"request");function $U(t){return t>=200&&t<300}o($U,"validateStatus");function kU(t){if(Jt.sessions[t])La&&console.log(`Used cached client for ${t}`);else{La&&console.log(`Creating client for ${t}`);let e=NT.connect(`https://${t}`);e.on("error",r=>{console.error(`*ERROR*: ${r}`),delete Jt.sessions[t]}).on("goaway",(r,n)=>{console.error(`*GOAWAY*: ${r} : ${n}`),delete Jt.sessions[t]}),Jt.sessions[t]={session:e}}return Jt.sessions[t]}o(kU,"_getClient");async function Xf(t){let e=Jt.sessions[t.host];if(!e)return;let{session:r}=e;delete Jt.sessions[t.host],La&&console.error(`Closing ${t.host}`),r.close(()=>{La&&console.error(`Closed ${t.host}`)}),setTimeout(()=>{r&&!r.destroyed&&(La&&console.log(`Forcing close ${t.host}`),r&&r.destroy())},1e3)}o(Xf,"closeSession")});var DT=k((IX,NU)=>{NU.exports={name:"googleapis-common",version:"8.0.2",description:"A common tooling library used by the googleapis npm module. You probably don't want to use this directly.",repository:{type:"git",directory:"packages/nodejs-googleapis-common",url:"https://github.com/googleapis/google-cloud-node-core.git"},main:"build/src/index.js",types:"build/src/index.d.ts",files:["build/src","!build/src/**/*.map"],scripts:{prebenchmark:"npm run compile",benchmark:"node build/benchmark/bench.js",compile:"tsc -p .",test:"c8 mocha build/test","system-test":"c8 mocha build/system-test --timeout 600000","presystem-test":"npm run compile",fix:"gts fix",prepare:"npm run compile",pretest:"npm run compile",lint:"gts check","samples-test":"mocha build/samples-test",docs:"jsdoc -c .jsdoc.js",webpack:"webpack","browser-test":"karma start",prelint:"cd samples; npm link ../; npm install",clean:"gts clean",precompile:"gts clean"},keywords:[],author:"Google LLC",license:"Apache-2.0",dependencies:{extend:"^3.0.2",gaxios:"7.1.3","google-auth-library":"10.5.0","google-logging-utils":"1.1.3",qs:"^6.7.0","url-template":"^2.0.8"},devDependencies:{"@babel/plugin-proposal-private-methods":"^7.18.6","@types/extend":"^3.0.1","@types/mocha":"^10.0.10","@types/mv":"^2.1.0","@types/ncp":"^2.0.8","@types/nock":"^11.0.0","@types/proxyquire":"^1.3.31","@types/qs":"^6.5.3","@types/sinon":"^21.0.0","@types/tmp":"^0.2.6","@types/url-template":"^2.0.28",c8:"^10.1.3",codecov:"^3.8.3",gts:"^6.0.2",http2spy:"^2.0.0","is-docker":"^3.0.0",jsdoc:"^4.0.4","jsdoc-fresh":"^5.0.0","jsdoc-region-tag":"^4.0.0",karma:"^6.0.0","karma-chrome-launcher":"^3.0.0","karma-coverage":"^2.0.0","karma-firefox-launcher":"^2.0.0","karma-mocha":"^2.0.0","karma-remap-coverage":"^0.1.5","karma-sourcemap-loader":"^0.4.0","karma-webpack":"^5.0.1",mocha:"^11.1.0",mv:"^2.1.1",ncp:"^2.0.0",nock:"^14.0.5","null-loader":"^4.0.1","path-to-regexp":"^6.0.0",proxyquire:"^2.1.3",puppeteer:"^24.0.0",sinon:"21.0.3",tmp:"0.2.5","ts-loader":"^9.5.2",typescript:"5.8.3",webpack:"^5.97.1","webpack-cli":"^6.0.1"},engines:{node:">=18.0.0"},homepage:"https://github.com/googleapis/google-cloud-node-core/tree/main/packages/nodejs-googleapis-common"}});var Pc=k(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.createAPIRequest=jU;var Qf=at(),zU=Kf(),FT=require("stream"),UT=OT(),MT=Qi(),tm=CT(),DU=zT(),em=bc(),BT=DT(),jT=o(()=>globalThis.crypto?.randomUUID()||require("crypto").randomUUID(),"randomUUID");function UU(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object"}o(UU,"isReadableStream");function MU(t,e){let r=new Array;return e.forEach(n=>{t[n]===void 0&&r.push(n)}),r.length>0?r:null}o(MU,"getMissingParams");function jU(t,e){if(e)LT(t).then(r=>e(null,r),e);else return LT(t)}o(jU,"createAPIRequest");async function LT(t){let e=MT(!0,{},t.context.google?._options||{},t.context._options||{},t.options),r=MT(!0,{},e.params,t.params);e.userAgentDirectives=e.userAgentDirectives||[];let n=r.media||{},i=r.requestBody;!r.requestBody&&r.resource&&(!t.requiredParams.includes("resource")||typeof r.resource!="string")&&(i=r.resource,delete r.resource),delete r.requestBody;let s=r.auth||e.auth,c=typeof n.body=="string"?"text/plain":"application/octet-stream";delete r.media,delete r.auth;let d=(0,em.headersToClassicHeaders)(r.headers||{});LU(d,e.apiVersion),delete r.headers,Object.keys(r).forEach(g=>{if(g.slice(-1)==="_"){let y=g.slice(0,-1);r[y]=r[g],delete r[g]}});let l=MU(r,t.requiredParams);if(l)throw new Error("Missing required parameters: "+l.join(", "));if(e.url){let g=e.url;typeof g=="object"&&(g=g.toString()),e.url=UT.parse(g).expand(r)}if(t.mediaUrl&&(t.mediaUrl=UT.parse(t.mediaUrl).expand(r)),t.context._options.rootUrl!==void 0&&e.url!==void 0){let g=new URL(e.url),y=g.href.substr(g.origin.length);e.url=new URL(y,t.context._options.rootUrl).href}e.paramsSerializer=g=>zU.stringify(g,{arrayFormat:"repeat"}),t.pathParams.forEach(g=>delete r[g]),typeof s=="string"&&(r.key=r.key||s,s=void 0);function p(g){let y=jT(),T=`--${y}--`,P=new FT.PassThrough({flush(L){this.push(`\r
60
+ `),this.push(T),L()}}),x=new rm,N=UU(g[1].body);d["content-type"]=`multipart/related; boundary=${y}`;for(let L of g){let X=`--${y}\r
61
+ content-type: ${L["content-type"]}\r
62
+ \r
63
+ `;P.push(X),typeof L.body=="string"?(P.push(L.body),P.push(`\r
64
+ `)):(x.on("progress",W=>{e.onUploadProgress&&e.onUploadProgress({bytesRead:W})}),L.body.pipe(x).pipe(P))}N||(P.push(T),P.push(null)),e.data=P}o(p,"multipartUpload");function f(g){let y=jT(),T=`--${y}--`;d["content-type"]=`multipart/related; boundary=${y}`;let P="";for(let x of g){let N=`--${y}\r
65
+ content-type: ${x["content-type"]}\r
66
+ \r
67
+ `;P+=N,typeof x.body=="string"&&(P+=x.body,P+=`\r
68
+ `)}P+=T,e.data=P}if(o(f,"browserMultipartUpload"),t.mediaUrl&&n.body)if(e.url=t.mediaUrl,i){r.uploadType="multipart";let g=[{"content-type":"application/json",body:JSON.stringify(i)},{"content-type":n.mimeType||i&&i.mimeType||c,body:n.body}];(0,tm.isBrowser)()?f(g):p(g)}else r.uploadType="media",Object.assign(d,{"content-type":n.mimeType||c}),e.data=n.body;else e.data=i||void 0;if(e.headers=Qf.Gaxios.mergeHeaders(e.headers||{},d),e.params=r,!(0,tm.isBrowser)()){e.headers.set("Accept-Encoding","gzip"),e.userAgentDirectives.push({product:"google-api-nodejs-client",version:BT.version,comment:"gzip"});let g=e.userAgentDirectives.map(y=>{let T=`${y.product}/${y.version}`;return y.comment&&(T+=` (${y.comment})`),T}).join(" ");e.headers.set("User-Agent",g)}if(e.validateStatus||(e.validateStatus=g=>g>=200&&g<300||g===304),e.retry=e.retry===void 0?!0:e.retry,delete e.auth,e.universeDomain&&e.universe_domain&&e.universeDomain!==e.universe_domain)throw new Error("Please set either universe_domain or universeDomain, but not both.");let _=typeof process=="object"&&typeof process.env=="object"?process.env.GOOGLE_CLOUD_UNIVERSE_DOMAIN:void 0,h=e.universeDomain??e.universe_domain??_??"googleapis.com";if(h!=="googleapis.com"&&e.url){let g=new URL(e.url);g.hostname.endsWith(".googleapis.com")&&(g.hostname=g.hostname.replace(/googleapis\.com$/,h),e.url=g.toString())}if(Object.keys(e.params).length||(delete e.params,delete e.paramsSerializer),s&&typeof s=="object"){let g=typeof s.getUniverseDomain=="function"?await s.getUniverseDomain():void 0;if(g&&h!==g)throw new Error(`The configured universe domain (${h}) does not match the universe domain found in the credentials (${g}). If you haven't configured the universe domain explicitly, googleapis.com is the default.`);if(e.http2){let y=await s.getRequestHeaders(e.url),T=Object.assign({},e);return T.headers=Qf.Gaxios.mergeHeaders(T.headers,y),DU.request(T)}else{let y=await s.request(e);return(0,em.marshallGaxiosResponse)(y)}}else return new Qf.Gaxios().request(e).then(g=>(0,em.marshallGaxiosResponse)(g))}o(LT,"createAPIRequestAsync");var rm=class extends FT.Transform{static{o(this,"ProgressStream")}bytesRead=0;_transform(e,r,n){this.bytesRead+=e.length,this.emit("progress",this.bytesRead),this.push(e),n()}};function LU(t,e){(0,tm.isBrowser)()||(t["x-goog-api-client"]=`gdcl/${BT.version} gl-node/${process.versions.node}`),e&&(t["x-goog-api-version"]=e)}o(LU,"populateAPIHeader")});var qT=k(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.AuthPlus=void 0;var cn=Oa(),om=class extends cn.GoogleAuth{static{o(this,"AuthPlus")}JWT=cn.JWT;Compute=cn.Compute;OAuth2=cn.OAuth2Client;GoogleAuth=cn.GoogleAuth;AwsClient=cn.AwsClient;IdentityPoolClient=cn.IdentityPoolClient;ExternalAccountClient=cn.ExternalAccountClient;_cachedAuth;async getClient(e){return this._cachedAuth=new cn.GoogleAuth(e),this._cachedAuth.getClient()}getProjectId(e){return e?this._cachedAuth?this._cachedAuth.getProjectId(e):super.getProjectId(e):this._cachedAuth?this._cachedAuth.getProjectId():super.getProjectId()}};Sc.AuthPlus=om});var am=k(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Endpoint=void 0;var VT=Pc(),im=class{static{o(this,"Endpoint")}_options;google;constructor(e){this._options=e||{}}applySchema(e,r,n,i){if(this.applyMethodsFromSchema(e,r,n,i),n.resources){for(let s in n.resources)if(Object.prototype.hasOwnProperty.call(n.resources,s)){let c=n.resources[s];e[s]||(e[s]={}),this.applySchema(e[s],r,c,i)}}}applyMethodsFromSchema(e,r,n,i){if(n.methods){for(let s in n.methods)if(Object.prototype.hasOwnProperty.call(n.methods,s)){let c=n.methods[s];e[s]=this.makeMethod(r,c,i)}}}makeMethod(e,r,n){return(i,s)=>{let c=typeof i=="function"?{}:i;s=typeof i=="function"?i:s;let d=HT(e.rootUrl+e.servicePath+r.path),l={options:{url:d.substring(1,d.length-1),method:r.httpMethod,apiVersion:r.apiVersion},params:c,requiredParams:r.parameterOrder||[],pathParams:this.getPathParams(r.parameters),context:n};if(r.mediaUpload&&r.mediaUpload.protocols&&r.mediaUpload.protocols.simple&&r.mediaUpload.protocols.simple.path){let p=HT(e.rootUrl+r.mediaUpload.protocols.simple.path);l.mediaUrl=p.substring(1,p.length-1)}if(!s)return(0,VT.createAPIRequest)(l);(0,VT.createAPIRequest)(l,s)}}getPathParams(e){let r=new Array;return typeof e!="object"&&(e={}),Object.keys(e).forEach(n=>{e[n].location==="path"&&r.push(n)}),r}};Ec.Endpoint=im;function HT(t){return t?`'${t}'`.replace(/([^:]\/)\/+/g,"$1"):""}o(HT,"buildurl")});var WT=k(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.Discovery=void 0;var FU=require("fs"),BU=at(),qU=require("url"),GT=require("util"),VU=Pc(),HU=am(),GU=GT.promisify(FU.readFile),sm=class{static{o(this,"Discovery")}transporter=new BU.Gaxios;options;constructor(e){this.options=e||{}}makeEndpoint(e){return r=>{let n=new HU.Endpoint(r);return n.applySchema(n,e,e,n),n}}log(...e){this.options&&this.options.debug&&console.log(...e)}async discoverAllAPIs(e){let r=new Headers(this.options.includePrivate?{}:{"X-User-Ip":"0.0.0.0"}),i=(await this.transporter.request({url:e,headers:r})).data.items,s=await Promise.all(i.map(async l=>{let p=await this.discoverAPI(l.discoveryRestUrl);return{api:l,endpointCreator:p}})),c={},d={};for(let l of s)d[l.api.name]||(c[l.api.name]={},d[l.api.name]=p=>{let f=typeof p,_;if(f==="string")_=p,p={};else if(f==="object")_=p.version,delete p.version;else throw new Error("Argument error: Accepts only string or object");try{let h=l.endpointCreator(p,this);return Object.freeze(h)}catch(h){throw new Error(GT.format('Unable to load endpoint %s("%s"): %s',l.api.name,_,h.message))}}),c[l.api.name][l.api.version]=l.endpointCreator;return d}async discoverAPI(e){if(typeof e=="string"){let r=qU.parse(e);if(e&&!r.protocol){this.log("Reading from file "+e);let n=await GU(e,{encoding:"utf8"});return this.makeEndpoint(JSON.parse(n))}else{this.log("Requesting "+e);let n=await this.transporter.request({url:e});return this.makeEndpoint(n.data)}}else{let r=e;this.log("Requesting "+r.url);let n=r.url;delete r.url;let i={options:{url:n,method:"GET"},requiredParams:[],pathParams:[],params:r,context:{google:{_options:{}},_options:{}}},s=await(0,VU.createAPIRequest)(i);return this.makeEndpoint(s.data)}}};Tc.Discovery=sm});var xc=k(we=>{"use strict";var WU=we&&we.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:o(function(){return e[r]},"get")}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZU=we&&we.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&WU(e,t,r)};Object.defineProperty(we,"__esModule",{value:!0});we.Endpoint=we.Discovery=we.AuthPlus=we.createAPIRequest=we.getAPI=we.GaxiosError=we.Gaxios=we.AwsClient=we.IdentityPoolClient=we.BaseExternalAccountClient=we.ExternalAccountClient=we.GoogleAuth=we.UserRefreshClient=we.Compute=we.JWT=we.OAuth2Client=we.gaxios=we.googleAuthLibrary=void 0;we.googleAuthLibrary=Oa();we.gaxios=at();var ln=Oa();Object.defineProperty(we,"OAuth2Client",{enumerable:!0,get:o(function(){return ln.OAuth2Client},"get")});Object.defineProperty(we,"JWT",{enumerable:!0,get:o(function(){return ln.JWT},"get")});Object.defineProperty(we,"Compute",{enumerable:!0,get:o(function(){return ln.Compute},"get")});Object.defineProperty(we,"UserRefreshClient",{enumerable:!0,get:o(function(){return ln.UserRefreshClient},"get")});Object.defineProperty(we,"GoogleAuth",{enumerable:!0,get:o(function(){return ln.GoogleAuth},"get")});Object.defineProperty(we,"ExternalAccountClient",{enumerable:!0,get:o(function(){return ln.ExternalAccountClient},"get")});Object.defineProperty(we,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return ln.BaseExternalAccountClient},"get")});Object.defineProperty(we,"IdentityPoolClient",{enumerable:!0,get:o(function(){return ln.IdentityPoolClient},"get")});Object.defineProperty(we,"AwsClient",{enumerable:!0,get:o(function(){return ln.AwsClient},"get")});var ZT=at();Object.defineProperty(we,"Gaxios",{enumerable:!0,get:o(function(){return ZT.Gaxios},"get")});Object.defineProperty(we,"GaxiosError",{enumerable:!0,get:o(function(){return ZT.GaxiosError},"get")});var KU=ME();Object.defineProperty(we,"getAPI",{enumerable:!0,get:o(function(){return KU.getAPI},"get")});var JU=Pc();Object.defineProperty(we,"createAPIRequest",{enumerable:!0,get:o(function(){return JU.createAPIRequest},"get")});var YU=qT();Object.defineProperty(we,"AuthPlus",{enumerable:!0,get:o(function(){return YU.AuthPlus},"get")});var XU=WT();Object.defineProperty(we,"Discovery",{enumerable:!0,get:o(function(){return XU.Discovery},"get")});var QU=am();Object.defineProperty(we,"Endpoint",{enumerable:!0,get:o(function(){return QU.Endpoint},"get")});ZU(bc(),we)});var JT=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.people_v1=void 0;var me=xc(),KT;(function(t){class e{static{o(this,"People")}context;contactGroups;otherContacts;people;constructor(l,p){this.context={_options:l||{},google:p},this.contactGroups=new r(this.context),this.otherContacts=new i(this.context),this.people=new s(this.context)}}t.People=e;class r{static{o(this,"Resource$Contactgroups")}context;members;constructor(l){this.context=l,this.members=new n(this.context)}batchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}create(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}delete(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/contactGroups").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}update(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"PUT",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups=r;class n{static{o(this,"Resource$Contactgroups$Members")}context;constructor(l){this.context=l}modify(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/members:modify").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Contactgroups$Members=n;class i{static{o(this,"Resource$Othercontacts")}context;constructor(l){this.context=l}copyOtherContactToMyContactsGroup(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:copyOtherContactToMyContactsGroup").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}search(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/otherContacts:search").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$Othercontacts=i;class s{static{o(this,"Resource$People")}context;connections;constructor(l){this.context=l,this.connections=new c(this.context)}batchCreateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchCreateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchDeleteContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchDeleteContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}batchUpdateContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchUpdateContacts").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}createContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:createContact").replace(/([^:]\/)\/+/g,"$1"),method:"POST",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContact").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}deleteContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:deleteContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"DELETE",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}get(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}getBatchGet(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:batchGet").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}listDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:listDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchContacts(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchContacts").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}searchDirectoryPeople(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/people:searchDirectoryPeople").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:[],pathParams:[],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContact(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContact").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}updateContactPhoto(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}:updateContactPhoto").replace(/([^:]\/)\/+/g,"$1"),method:"PATCH",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People=s;class c{static{o(this,"Resource$People$Connections")}context;constructor(l){this.context=l}list(l,p,f){let _=l||{},h=p||{};typeof l=="function"&&(f=l,_={},h={}),typeof p=="function"&&(f=p,h={});let g=h.rootUrl||"https://people.googleapis.com/",y={options:Object.assign({url:(g+"/v1/{+resourceName}/connections").replace(/([^:]\/)\/+/g,"$1"),method:"GET",apiVersion:""},h),params:_,requiredParams:["resourceName"],pathParams:["resourceName"],context:this.context};if(f)(0,me.createAPIRequest)(y,f);else return(0,me.createAPIRequest)(y)}}t.Resource$People$Connections=c})(KT||(wc.people_v1=KT={}))});var QT=k(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.AuthPlus=ur.people_v1=ur.auth=ur.VERSIONS=void 0;ur.people=e1;var YT=xc(),XT=JT();Object.defineProperty(ur,"people_v1",{enumerable:!0,get:o(function(){return XT.people_v1},"get")});ur.VERSIONS={v1:XT.people_v1.People};function e1(t){return(0,YT.getAPI)("people",t,ur.VERSIONS,this)}o(e1,"people");var t1=new YT.AuthPlus;ur.auth=t1;var r1=xc();Object.defineProperty(ur,"AuthPlus",{enumerable:!0,get:o(function(){return r1.AuthPlus},"get")})});var ex=k((um,cm)=>{(function(t,e){typeof um=="object"&&typeof cm<"u"?cm.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(um,function(){"use strict";var t=1e3,e=6e4,r=36e5,n="millisecond",i="second",s="minute",c="hour",d="day",l="week",p="month",f="quarter",_="year",h="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,P={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:o(function(te){var q=["th","st","nd","rd"],B=te%100;return"["+te+(q[(B-20)%10]||q[B]||q[0])+"]"},"ordinal")},x=o(function(te,q,B){var J=String(te);return!J||J.length>=q?te:""+Array(q+1-J.length).join(B)+te},"m"),N={s:x,z:o(function(te){var q=-te.utcOffset(),B=Math.abs(q),J=Math.floor(B/60),Z=B%60;return(q<=0?"+":"-")+x(J,2,"0")+":"+x(Z,2,"0")},"z"),m:o(function te(q,B){if(q.date()<B.date())return-te(B,q);var J=12*(B.year()-q.year())+(B.month()-q.month()),Z=q.clone().add(J,p),re=B-Z<0,oe=q.clone().add(J+(re?-1:1),p);return+(-(J+(B-Z)/(re?Z-oe:oe-Z))||0)},"t"),a:o(function(te){return te<0?Math.ceil(te)||0:Math.floor(te)},"a"),p:o(function(te){return{M:p,y:_,w:l,d,D:h,h:c,m:s,s:i,ms:n,Q:f}[te]||String(te||"").toLowerCase().replace(/s$/,"")},"p"),u:o(function(te){return te===void 0},"u")},L="en",X={};X[L]=P;var W=o(function(te){return te instanceof Y},"p"),G=o(function te(q,B,J){var Z;if(!q)return L;if(typeof q=="string"){var re=q.toLowerCase();X[re]&&(Z=re),B&&(X[re]=B,Z=re);var oe=q.split("-");if(!Z&&oe.length>1)return te(oe[0])}else{var Ae=q.name;X[Ae]=q,Z=Ae}return!J&&Z&&(L=Z),Z||!J&&L},"t"),K=o(function(te,q){if(W(te))return te.clone();var B=typeof q=="object"?q:{};return B.date=te,B.args=arguments,new Y(B)},"w"),ee=N;ee.l=G,ee.i=W,ee.w=function(te,q){return K(te,{locale:q.$L,utc:q.$u,x:q.$x,$offset:q.$offset})};var Y=function(){function te(B){this.$L=G(B.locale,null,!0),this.parse(B)}o(te,"M");var q=te.prototype;return q.parse=function(B){this.$d=function(J){var Z=J.date,re=J.utc;if(Z===null)return new Date(NaN);if(ee.u(Z))return new Date;if(Z instanceof Date)return new Date(Z);if(typeof Z=="string"&&!/Z$/i.test(Z)){var oe=Z.match(y);if(oe){var Ae=oe[2]-1||0,Oe=(oe[7]||"0").substring(0,3);return re?new Date(Date.UTC(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)):new Date(oe[1],Ae,oe[3]||1,oe[4]||0,oe[5]||0,oe[6]||0,Oe)}}return new Date(Z)}(B),this.$x=B.x||{},this.init()},q.init=function(){var B=this.$d;this.$y=B.getFullYear(),this.$M=B.getMonth(),this.$D=B.getDate(),this.$W=B.getDay(),this.$H=B.getHours(),this.$m=B.getMinutes(),this.$s=B.getSeconds(),this.$ms=B.getMilliseconds()},q.$utils=function(){return ee},q.isValid=function(){return this.$d.toString()!==g},q.isSame=function(B,J){var Z=K(B);return this.startOf(J)<=Z&&Z<=this.endOf(J)},q.isAfter=function(B,J){return K(B)<this.startOf(J)},q.isBefore=function(B,J){return this.endOf(J)<K(B)},q.$g=function(B,J,Z){return ee.u(B)?this[J]:this.set(Z,B)},q.unix=function(){return Math.floor(this.valueOf()/1e3)},q.valueOf=function(){return this.$d.getTime()},q.startOf=function(B,J){var Z=this,re=!!ee.u(J)||J,oe=ee.p(B),Ae=o(function(Nt,Le){var Be=ee.w(Z.$u?Date.UTC(Z.$y,Le,Nt):new Date(Z.$y,Le,Nt),Z);return re?Be:Be.endOf(d)},"l"),Oe=o(function(Nt,Le){return ee.w(Z.toDate()[Nt].apply(Z.toDate("s"),(re?[0,0,0,0]:[23,59,59,999]).slice(Le)),Z)},"$"),Fe=this.$W,Ge=this.$M,mt=this.$D,Q="set"+(this.$u?"UTC":"");switch(oe){case _:return re?Ae(1,0):Ae(31,11);case p:return re?Ae(1,Ge):Ae(0,Ge+1);case l:var et=this.$locale().weekStart||0,it=(Fe<et?Fe+7:Fe)-et;return Ae(re?mt-it:mt+(6-it),Ge);case d:case h:return Oe(Q+"Hours",0);case c:return Oe(Q+"Minutes",1);case s:return Oe(Q+"Seconds",2);case i:return Oe(Q+"Milliseconds",3);default:return this.clone()}},q.endOf=function(B){return this.startOf(B,!1)},q.$set=function(B,J){var Z,re=ee.p(B),oe="set"+(this.$u?"UTC":""),Ae=(Z={},Z[d]=oe+"Date",Z[h]=oe+"Date",Z[p]=oe+"Month",Z[_]=oe+"FullYear",Z[c]=oe+"Hours",Z[s]=oe+"Minutes",Z[i]=oe+"Seconds",Z[n]=oe+"Milliseconds",Z)[re],Oe=re===d?this.$D+(J-this.$W):J;if(re===p||re===_){var Fe=this.clone().set(h,1);Fe.$d[Ae](Oe),Fe.init(),this.$d=Fe.set(h,Math.min(this.$D,Fe.daysInMonth())).$d}else Ae&&this.$d[Ae](Oe);return this.init(),this},q.set=function(B,J){return this.clone().$set(B,J)},q.get=function(B){return this[ee.p(B)]()},q.add=function(B,J){var Z,re=this;B=Number(B);var oe=ee.p(J),Ae=o(function(Ge){var mt=K(re);return ee.w(mt.date(mt.date()+Math.round(Ge*B)),re)},"y");if(oe===p)return this.set(p,this.$M+B);if(oe===_)return this.set(_,this.$y+B);if(oe===d)return Ae(1);if(oe===l)return Ae(7);var Oe=(Z={},Z[s]=e,Z[c]=r,Z[i]=t,Z)[oe]||1,Fe=this.$d.getTime()+B*Oe;return ee.w(Fe,this)},q.subtract=function(B,J){return this.add(-1*B,J)},q.format=function(B){var J=this,Z=this.$locale();if(!this.isValid())return Z.invalidDate||g;var re=B||"YYYY-MM-DDTHH:mm:ssZ",oe=ee.z(this),Ae=this.$H,Oe=this.$m,Fe=this.$M,Ge=Z.weekdays,mt=Z.months,Q=Z.meridiem,et=o(function(Le,Be,v,E){return Le&&(Le[Be]||Le(J,re))||v[Be].slice(0,E)},"h"),it=o(function(Le){return ee.s(Ae%12||12,Le,"0")},"d"),Nt=Q||function(Le,Be,v){var E=Le<12?"AM":"PM";return v?E.toLowerCase():E};return re.replace(T,function(Le,Be){return Be||function(v){switch(v){case"YY":return String(J.$y).slice(-2);case"YYYY":return ee.s(J.$y,4,"0");case"M":return Fe+1;case"MM":return ee.s(Fe+1,2,"0");case"MMM":return et(Z.monthsShort,Fe,mt,3);case"MMMM":return et(mt,Fe);case"D":return J.$D;case"DD":return ee.s(J.$D,2,"0");case"d":return String(J.$W);case"dd":return et(Z.weekdaysMin,J.$W,Ge,2);case"ddd":return et(Z.weekdaysShort,J.$W,Ge,3);case"dddd":return Ge[J.$W];case"H":return String(Ae);case"HH":return ee.s(Ae,2,"0");case"h":return it(1);case"hh":return it(2);case"a":return Nt(Ae,Oe,!0);case"A":return Nt(Ae,Oe,!1);case"m":return String(Oe);case"mm":return ee.s(Oe,2,"0");case"s":return String(J.$s);case"ss":return ee.s(J.$s,2,"0");case"SSS":return ee.s(J.$ms,3,"0");case"Z":return oe}return null}(Le)||oe.replace(":","")})},q.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},q.diff=function(B,J,Z){var re,oe=this,Ae=ee.p(J),Oe=K(B),Fe=(Oe.utcOffset()-this.utcOffset())*e,Ge=this-Oe,mt=o(function(){return ee.m(oe,Oe)},"D");switch(Ae){case _:re=mt()/12;break;case p:re=mt();break;case f:re=mt()/3;break;case l:re=(Ge-Fe)/6048e5;break;case d:re=(Ge-Fe)/864e5;break;case c:re=Ge/r;break;case s:re=Ge/e;break;case i:re=Ge/t;break;default:re=Ge}return Z?re:ee.a(re)},q.daysInMonth=function(){return this.endOf(p).$D},q.$locale=function(){return X[this.$L]},q.locale=function(B,J){if(!B)return this.$L;var Z=this.clone(),re=G(B,J,!0);return re&&(Z.$L=re),Z},q.clone=function(){return ee.w(this.$d,this)},q.toDate=function(){return new Date(this.valueOf())},q.toJSON=function(){return this.isValid()?this.toISOString():null},q.toISOString=function(){return this.$d.toISOString()},q.toString=function(){return this.$d.toUTCString()},te}(),Se=Y.prototype;return K.prototype=Se,[["$ms",n],["$s",i],["$m",s],["$H",c],["$W",d],["$M",p],["$y",_],["$D",h]].forEach(function(te){Se[te[1]]=function(q){return this.$g(q,te[0],te[1])}}),K.extend=function(te,q){return te.$i||(te(q,Y,K),te.$i=!0),K},K.locale=G,K.isDayjs=W,K.unix=function(te){return K(1e3*te)},K.en=X[L],K.Ls=X,K.p={},K})});var o1={};ms(o1,{googleContacts:()=>n1});module.exports=Hw(o1);var Gw=Object.freeze({status:"aborted"});function ue(t,e,r){function n(d,l){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:l,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(t))return;d._zod.traits.add(t),e(d,l);let p=c.prototype,f=Object.keys(p);for(let _=0;_<f.length;_++){let h=f[_];h in d||(d[h]=p[h].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:t});function c(d){var l;let p=r?.Parent?new s:this;n(p,d),(l=p._zod).deferred??(l.deferred=[]);for(let f of p._zod.deferred)f();return p}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(ue,"$constructor");var Ww=Symbol("zod_brand"),xr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hs=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},tl={};function Kr(t){return t&&Object.assign(tl,t),tl}o(Kr,"config");function nl(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,i])=>e.indexOf(+n)===-1).map(([n,i])=>i)}o(nl,"getEnumValues");function mh(t,e){return typeof e=="bigint"?e.toString():e}o(mh,"jsonStringifyReplacer");function ys(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(ys,"cached");function hh(t){return t==null}o(hh,"nullish");function _s(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(_s,"cleanRegex");var fh=Symbol("evaluating");function st(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==fh)return n===void 0&&(n=fh,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(st,"defineLazy");var ol="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Ii(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(Ii,"isObject");var Zw=ys(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function gh(t){if(Ii(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Ii(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(gh,"isPlainObject");var yh=new Set(["string","number","symbol"]);function Io(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Io,"escapeRegex");function vs(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(vs,"clone");function tt(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:o(()=>e,"error")};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:o(()=>e.error,"error")}:e}o(tt,"normalizeParams");function _h(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(_h,"optionalKeys");var Kw={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ro(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}o(Ro,"aborted");function vn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(vn,"prefixIssues");function gs(t){return typeof t=="string"?t:t?.message}o(gs,"unwrapMessage");function bn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=gs(t.inst?._zod.def?.error?.(t))??gs(e?.error?.(t))??gs(r.customError?.(t))??gs(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(bn,"finalizeIssue");function vh(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(vh,"getLengthableOrigin");function il(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(il,"issue");var bh=o((t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,mh,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),Ph=ue("$ZodError",bh),Ri=ue("$ZodError",bh,{Parent:Error});var Yw=o(t=>(e,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new xr;if(c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>bn(l,s,Kr())));throw ol(d,i?.callee),d}return c.value},"_parse"),bs=Yw(Ri),Xw=o(t=>async(e,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??t)(c.issues.map(l=>bn(l,s,Kr())));throw ol(d,i?.callee),d}return c.value},"_parseAsync"),Ps=Xw(Ri),Qw=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new xr;return s.issues.length?{success:!1,error:new(t??Ph)(s.issues.map(c=>bn(c,i,Kr())))}:{success:!0,data:s.value}},"_safeParse"),Oi=Qw(Ri),eA=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=e._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(c=>bn(c,i,Kr())))}:{success:!0,data:s.value}},"_safeParseAsync"),Ci=eA(Ri);var tA="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rA=new RegExp(`^${tA}$`);var Sh=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),Eh=/^-?\d+n?$/;var al=/^-?\d+(?:\.\d+)?$/,Th=/^(?:true|false)$/i;var Oo=ue("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])});var xh=ue("$ZodCheckMinLength",(t,e)=>{var r;Oo.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!hh(i)&&i.length!==void 0}),t._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>i&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let i=n.value;if(i.length>=e.minimum)return;let c=vh(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var sl=ue("$ZodCheckStringFormat",(t,e)=>{var r,n;Oo.init(t,e),t._zod.onattach.push(i=>{let s=i._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:e.format,input:i.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),wh=ue("$ZodCheckRegex",(t,e)=>{sl.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}});var Ih={major:4,minor:3,patch:6};var rt=ue("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Ih;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let s of i._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let i=o((c,d,l)=>{let p=Ro(c),f;for(let _ of d){if(_._zod.def.when){if(!_._zod.def.when(c))continue}else if(p)continue;let h=c.issues.length,g=_._zod.check(c);if(g instanceof Promise&&l?.async===!1)throw new xr;if(f||g instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await g,c.issues.length!==h&&(p||(p=Ro(c,h)))});else{if(c.issues.length===h)continue;p||(p=Ro(c,h))}}return f?f.then(()=>c):c},"runChecks"),s=o((c,d,l)=>{if(Ro(c))return c.aborted=!0,c;let p=i(d,n,l);if(p instanceof Promise){if(l.async===!1)throw new xr;return p.then(f=>t._zod.parse(f,l))}return t._zod.parse(p,l)},"handleCanaryResult");t._zod.run=(c,d)=>{if(d.skipChecks)return t._zod.parse(c,d);if(d.direction==="backward"){let p=t._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return p instanceof Promise?p.then(f=>s(f,c,d)):s(p,c,d)}let l=t._zod.parse(c,d);if(l instanceof Promise){if(d.async===!1)throw new xr;return l.then(p=>i(p,n,d))}return i(l,n,d)}}st(t,"~standard",()=>({validate:o(i=>{try{let s=Oi(t,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Ci(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ts=ue("$ZodString",(t,e)=>{rt.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Sh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),ul=ue("$ZodStringFormat",(t,e)=>{sl.init(t,e),Ts.init(t,e)});var kh=ue("$ZodURL",(t,e)=>{ul.init(t,e),t._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}});var Nh=ue("$ZodNumber",(t,e)=>{rt.init(t,e),t._zod.pattern=t._zod.bag.pattern??al,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:t,...s?{received:s}:{}}),r}});var cl=ue("$ZodBoolean",(t,e)=>{rt.init(t,e),t._zod.pattern=Th,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:t}),r}}),zh=ue("$ZodBigInt",(t,e)=>{rt.init(t,e),t._zod.pattern=Eh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}});var Dh=ue("$ZodAny",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r}),Uh=ue("$ZodUnknown",(t,e)=>{rt.init(t,e),t._zod.parse=r=>r});var Mh=ue("$ZodVoid",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:t}),r}}),jh=ue("$ZodDate",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:t}),r}});function Rh(t,e,r){t.issues.length&&e.issues.push(...vn(r,t.issues)),e.value[r]=t.value}o(Rh,"handleArrayResult");var Lh=ue("$ZodArray",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:t}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],l=e.element._zod.run({value:d,issues:[]},n);l instanceof Promise?s.push(l.then(p=>Rh(p,r,c))):Rh(l,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Es(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...vn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Es,"handlePropertyResult");function nA(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=_h(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(nA,"normalizeDef");function oA(t,e,r,n,i,s){let c=[],d=i.keySet,l=i.catchall._zod,p=l.def.type,f=l.optout==="optional";for(let _ in e){if(d.has(_))continue;if(p==="never"){c.push(_);continue}let h=l.run({value:e[_],issues:[]},n);h instanceof Promise?t.push(h.then(g=>Es(g,r,_,e,f))):Es(h,r,_,e,f)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}o(oA,"handleCatchall");var Fh=ue("$ZodObject",(t,e)=>{if(rt.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let d=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let l={...d};return Object.defineProperty(e,"shape",{value:l}),l},"get")})}let n=ys(()=>nA(e));st(t._zod,"propValues",()=>{let d=e.shape,l={};for(let p in d){let f=d[p]._zod;if(f.values){l[p]??(l[p]=new Set);for(let _ of f.values)l[p].add(_)}}return l});let i=Ii,s=e.catchall,c;t._zod.parse=(d,l)=>{c??(c=n.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;d.value={};let f=[],_=c.shape;for(let h of c.keys){let g=_[h],y=g._zod.optout==="optional",T=g._zod.run({value:p[h],issues:[]},l);T instanceof Promise?f.push(T.then(P=>Es(P,d,h,p,y))):Es(T,d,h,p,y)}return s?oA(f,p,d,l,n.value,t):f.length?Promise.all(f).then(()=>d):d}});function Oh(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let i=t.filter(s=>!Ro(s));return i.length===1?(e.value=i[0].value,i[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(c=>bn(c,n,Kr())))}),e)}o(Oh,"handleUnionResults");var ll=ue("$ZodUnion",(t,e)=>{rt.init(t,e),st(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),st(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),st(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),st(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>_s(s.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let l of e.options){let p=l._zod.run({value:i.value,issues:[]},s);if(p instanceof Promise)d.push(p),c=!0;else{if(p.issues.length===0)return p;d.push(p)}}return c?Promise.all(d).then(l=>Oh(l,i,t,s)):Oh(d,i,t,s)}});var Bh=ue("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ll.init(t,e);let r=t._zod.parse;st(t._zod,"propValues",()=>{let i={};for(let s of e.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[d,l]of Object.entries(c)){i[d]||(i[d]=new Set);for(let p of l)i[d].add(p)}}return i});let n=ys(()=>{let i=e.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[e.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let l of d){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,c)}}return s});t._zod.parse=(i,s)=>{let c=i.value;if(!Ii(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let d=n.value.get(c?.[e.discriminator]);return d?d._zod.run(i,s):e.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var qh=ue("$ZodRecord",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!gh(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let s=[],c=e.keyType._zod.values;if(c){r.value={};let d=new Set;for(let p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){d.add(typeof p=="number"?p.toString():p);let f=e.valueType._zod.run({value:i[p],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...vn(p,_.issues)),r.value[p]=_.value})):(f.issues.length&&r.issues.push(...vn(p,f.issues)),r.value[p]=f.value)}let l;for(let p in i)d.has(p)||(l=l??[],l.push(p));l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:l})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let l=e.keyType._zod.run({value:d,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&al.test(d)&&l.issues.length){let _=e.keyType._zod.run({value:Number(d),issues:[]},n);if(_ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");_.issues.length===0&&(l=_)}if(l.issues.length){e.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(_=>bn(_,n,Kr())),input:d,path:[d],inst:t});continue}let f=e.valueType._zod.run({value:i[d],issues:[]},n);f instanceof Promise?s.push(f.then(_=>{_.issues.length&&r.issues.push(...vn(d,_.issues)),r.value[l.value]=_.value})):(f.issues.length&&r.issues.push(...vn(d,f.issues)),r.value[l.value]=f.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Vh=ue("$ZodEnum",(t,e)=>{rt.init(t,e);let r=nl(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>yh.has(typeof i)).map(i=>typeof i=="string"?Io(i):i.toString()).join("|")})$`),t._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Hh=ue("$ZodLiteral",(t,e)=>{if(rt.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Io(n):n?Io(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Gh=ue("$ZodTransform",(t,e)=>{rt.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hs(t.constructor.name);let i=e.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new xr;return r.value=i,r}});function Ch(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(Ch,"handleOptionalResult");var Wh=ue("$ZodOptional",(t,e)=>{rt.init(t,e),t._zod.optin="optional",t._zod.optout="optional",st(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),st(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_s(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let i=e.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Ch(s,r.value)):Ch(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Zh=ue("$ZodNullable",(t,e)=>{rt.init(t,e),st(t._zod,"optin",()=>e.innerType._zod.optin),st(t._zod,"optout",()=>e.innerType._zod.optout),st(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${_s(r.source)}|null)$`):void 0}),st(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)});var Kh=ue("$ZodPipe",(t,e)=>{rt.init(t,e),st(t._zod,"values",()=>e.in._zod.values),st(t._zod,"optin",()=>e.in._zod.optin),st(t._zod,"optout",()=>e.out._zod.optout),st(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Ss(c,e.in,n)):Ss(s,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Ss(s,e.out,n)):Ss(i,e.out,n)}});function Ss(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ss,"handlePipeResult");var Jh=ue("$ZodCustom",(t,e)=>{Oo.init(t,e),rt.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,i=e.fn(n);if(i instanceof Promise)return i.then(s=>$h(s,r,n,t));$h(i,r,n,t)}});function $h(t,e,r,n){if(!t){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),e.issues.push(il(i))}}o($h,"handleRefineResult");var Xh,uA=Symbol("ZodOutput"),cA=Symbol("ZodInput"),dl=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Qh(){return new dl}o(Qh,"registry");(Xh=globalThis).__zod_globalRegistry??(Xh.__zod_globalRegistry=Qh());var pl=globalThis.__zod_globalRegistry;function eg(t,e){return new t({type:"string",...tt(e)})}o(eg,"_string");function tg(t,e){return new t({type:"string",coerce:!0,...tt(e)})}o(tg,"_coercedString");function rg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...tt(e)})}o(rg,"_url");function ng(t,e){return new t({type:"number",checks:[],...tt(e)})}o(ng,"_number");function og(t,e){return new t({type:"number",coerce:!0,checks:[],...tt(e)})}o(og,"_coercedNumber");function ig(t,e){return new t({type:"boolean",...tt(e)})}o(ig,"_boolean");function ag(t,e){return new t({type:"boolean",coerce:!0,...tt(e)})}o(ag,"_coercedBoolean");function sg(t,e){return new t({type:"bigint",coerce:!0,...tt(e)})}o(sg,"_coercedBigint");function ug(t){return new t({type:"any"})}o(ug,"_any");function cg(t){return new t({type:"unknown"})}o(cg,"_unknown");function lg(t,e){return new t({type:"void",...tt(e)})}o(lg,"_void");function dg(t,e){return new t({type:"date",coerce:!0,...tt(e)})}o(dg,"_coercedDate");function pr(t,e){return new xh({check:"min_length",...tt(e),minimum:t})}o(pr,"_minLength");function Pn(t,e){return new wh({check:"string_format",format:"regex",...tt(e),pattern:t})}o(Pn,"_regex");function pg(t,e,r){let n=tt(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(pg,"_custom");var ut=ue("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");rt.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>bs(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Oi(t,r,n),t.parseAsync=async(r,n)=>Ps(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Ci(t,r,n),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),t.with=t.check,t.clone=(r,n)=>vs(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.apply=r=>r(t)}),ws=ue("ZodMiniString",(t,e)=>{Ts.init(t,e),ut.init(t,e)});function b(t){return eg(ws,t)}o(b,"string");var fg=ue("ZodMiniStringFormat",(t,e)=>{ul.init(t,e),ws.init(t,e)});var vA=ue("ZodMiniURL",(t,e)=>{kh.init(t,e),fg.init(t,e)});function mg(t){return rg(vA,t)}o(mg,"url");var fl=ue("ZodMiniNumber",(t,e)=>{Nh.init(t,e),ut.init(t,e)});function xt(t){return ng(fl,t)}o(xt,"number");var ml=ue("ZodMiniBoolean",(t,e)=>{cl.init(t,e),ut.init(t,e)});function Ve(t){return ig(ml,t)}o(Ve,"boolean");var hg=ue("ZodMiniBigInt",(t,e)=>{zh.init(t,e),ut.init(t,e)});var bA=ue("ZodMiniAny",(t,e)=>{Dh.init(t,e),ut.init(t,e)});function ki(){return ug(bA)}o(ki,"any");var PA=ue("ZodMiniUnknown",(t,e)=>{Uh.init(t,e),ut.init(t,e)});function ve(){return cg(PA)}o(ve,"unknown");var SA=ue("ZodMiniVoid",(t,e)=>{Mh.init(t,e),ut.init(t,e)});function gg(t){return lg(SA,t)}o(gg,"_void");var yg=ue("ZodMiniDate",(t,e)=>{jh.init(t,e),ut.init(t,e)});var EA=ue("ZodMiniArray",(t,e)=>{Lh.init(t,e),ut.init(t,e)});function Te(t,e){return new EA({type:"array",element:t,...tt(e)})}o(Te,"array");var TA=ue("ZodMiniObject",(t,e)=>{Fh.init(t,e),ut.init(t,e),st(t,"shape",()=>e.shape)});function C(t,e){let r={type:"object",shape:t??{},...tt(e)};return new TA(r)}o(C,"object");var xA=ue("ZodMiniUnion",(t,e)=>{ll.init(t,e),ut.init(t,e)});function Ie(t,e){return new xA({type:"union",options:t,...tt(e)})}o(Ie,"union");var wA=ue("ZodMiniDiscriminatedUnion",(t,e)=>{Bh.init(t,e),ut.init(t,e)});function Co(t,e,r){return new wA({type:"union",options:e,discriminator:t,...tt(r)})}o(Co,"discriminatedUnion");var AA=ue("ZodMiniRecord",(t,e)=>{qh.init(t,e),ut.init(t,e)});function be(t,e,r){return new AA({type:"record",keyType:t,valueType:e,...tt(r)})}o(be,"record");var IA=ue("ZodMiniEnum",(t,e)=>{Vh.init(t,e),ut.init(t,e),t.options=Object.values(e.entries)});function $e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new IA({type:"enum",entries:r,...tt(e)})}o($e,"_enum");var RA=ue("ZodMiniLiteral",(t,e)=>{Hh.init(t,e),ut.init(t,e)});function fe(t,e){return new RA({type:"literal",values:Array.isArray(t)?t:[t],...tt(e)})}o(fe,"literal");var OA=ue("ZodMiniTransform",(t,e)=>{Gh.init(t,e),ut.init(t,e)});function Sn(t){return new OA({type:"transform",transform:t})}o(Sn,"transform");var CA=ue("ZodMiniOptional",(t,e)=>{Wh.init(t,e),ut.init(t,e)});function H(t){return new CA({type:"optional",innerType:t})}o(H,"optional");var $A=ue("ZodMiniNullable",(t,e)=>{Zh.init(t,e),ut.init(t,e)});function Ni(t){return new $A({type:"nullable",innerType:t})}o(Ni,"nullable");var kA=ue("ZodMiniPipe",(t,e)=>{Kh.init(t,e),ut.init(t,e)});function En(t,e){return new kA({type:"pipe",in:t,out:e})}o(En,"pipe");var NA=ue("ZodMiniCustom",(t,e)=>{Jh.init(t,e),ut.init(t,e)});function As(t,e){return pg(NA,t??(()=>!0),e)}o(As,"custom");var zi={};ms(zi,{bigint:()=>FA,boolean:()=>LA,date:()=>BA,number:()=>jA,string:()=>MA});function MA(t){return tg(ws,t)}o(MA,"string");function jA(t){return og(fl,t)}o(jA,"number");function LA(t){return ag(ml,t)}o(LA,"boolean");function FA(t){return sg(hg,t)}o(FA,"bigint");function BA(t){return dg(yg,t)}o(BA,"date");var gl=C({retryOnFailure:C({defaultValue:H(Ve()),hide:H(Ve())}),continueOnFailure:C({defaultValue:H(Ve()),hide:H(Ve())})}),hl=class{constructor(e,r,n,i,s,c,d,l,p,f,_){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=l;this.outputSchema=p;this.audience=f;this.aiMetadata=_}static{o(this,"IAction")}},Tn=o(t=>new hl(t.name,t.displayName,t.description,t.props,t.run,t.test??t.run,t.requireAuth??!0,t.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},t.outputSchema,t.audience,t.aiMetadata),"createAction");var Me=C({displayName:b(),description:H(b())}),Re=o((t,e)=>C({type:fe(e),required:Ve(),defaultValue:H(ki())}),"TPropertyValue");var Ut=C({...Me.shape,...Re(b(),"SHORT_TEXT").shape}),Jr=C({...Me.shape,...Re(b(),"LONG_TEXT").shape});var vg=C({label:b(),value:ve()}),Is=C({disabled:H(Ve()),placeholder:H(b()),options:Te(vg)});var Mt=C({...Me.shape,options:Is,...Re(ve(),"STATIC_DROPDOWN").shape}),Yr=C({...Me.shape,options:Is,...Re(Te(ve()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var yl=C({...Me.shape,...Re(ve(),"DROPDOWN").shape,refreshers:Te(b())}),Di=C({...Me.shape,...Re(Te(ve()),"MULTI_SELECT_DROPDOWN").shape,refreshers:Te(b())});var Xr=C({...Me.shape,...Re(Ve(),"CHECKBOX").shape});var Qr=C({...Me.shape,...Re(xt(),"NUMBER").shape});var Ui=C({...Me.shape,...Re(ve(),"FILE").shape});var Mi=C({...Me.shape,...Re(b(),"DATE_TIME").shape});var bg=be(b(),Ie([Ut,Jr,Mt,Di,Yr,Xr,Qr,Ui,Mi])),ji=C({...Me.shape,properties:bg,...Re(Te(ve()),"ARRAY").shape});var Li=C({...Me.shape,...Re(Ie([be(b(),ve())]),"JSON").shape});var Pg=Ie([Ut,Mt,Li,ji,Yr]),VA=be(b(),Pg),_l=C({refreshers:Te(b()),...Me.shape,...Re(ve(),"DYNAMIC").shape});var Rs=C({...Me.shape,...Re(gg(),"MARKDOWN").shape});var Fi=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Fi||{}),$o=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))($o||{}),ko=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(ko||{});var Bi=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Bi||{}),vl="both_client_credentials_and_authorization_code";var xn=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(xn||{}),qi=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(qi||{}),HA=C({strategy:$e(qi),paramName:H(b())}),Vi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Vi||{});var Os=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Os||{}),Sg=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),Eg=C({type:fe("DELAY"),resumeDateTime:b(),requestIdToReply:H(b()),handlerId:H(b()),streamStepProgress:H($e(Os))}),Tg=C({type:fe("WEBHOOK"),requestId:b(),requestIdToReply:H(b()),response:Sg,handlerId:H(b()),streamStepProgress:H($e(Os))}),GA=Ie([Eg,Tg]);var WA=C({body:ve(),rawBody:H(ve()),headers:be(b(),b()),queryParams:be(b(),b())});function bt(t){return t==null}o(bt,"isNil");function Hi(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(Hi,"isEmpty");function Cs(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(Cs,"assertNotNullOrUndefined");var bl=pt(require("crypto"),1);var ZA=128,Kn,No,KA=o(t=>{!Kn||Kn.length<t?(Kn=Buffer.allocUnsafe(t*ZA),bl.default.randomFillSync(Kn),No=0):No+t>Kn.length&&(bl.default.randomFillSync(Kn),No=0),No+=t},"fillPool"),JA=o(t=>(KA(t|=0),Kn.subarray(No-t,No)),"random"),YA=o((t,e,r)=>{let n=(2<<31-Math.clz32(t.length-1|1))-1,i=Math.ceil(1.6*n*e/t.length);return(s=e)=>{let c="";for(;;){let d=r(i),l=i;for(;l--;)if(c+=t[d[l]&n]||"",c.length===s)return c}}},"customRandom"),wg=o((t,e=21)=>YA(t,e,JA),"customAlphabet");var XA="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ag=21,L2=b().check(Pn(new RegExp(`^[0-9a-zA-Z]{${Ag}}$`))),QA=wg(XA,Ag);var wn=En(Sn(t=>t instanceof Date?t.toISOString():t),b()),Qt={id:b(),created:wn,updated:wn},Xe=o(t=>H(Ni(t)),"Nullable");function Pl(t){return H(Ni($e(t)))}o(Pl,"NullableEnum");var q2=En(Sn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),H(Ve())),$s=o(t=>En(Sn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),H(Te(t))),"OptionalArrayFromQuery");var G2=be(b(),ve());var Gi=(f=>(f.OPENAI="openai",f.OPENROUTER="openrouter",f.ANTHROPIC="anthropic",f.AZURE="azure",f.GOOGLE="google",f.ACTIVEPIECES="activepieces",f.CLOUDFLARE_GATEWAY="cloudflare-gateway",f.CUSTOM="custom",f.BEDROCK="bedrock",f.MISTRAL="mistral",f))(Gi||{});var oV=b().check(Pn(/^#[0-9A-Fa-f]{6}$/));var aV=C({filename:b(),data:ve(),type:fe("file"),mimetype:H(b())});var eI=pt(Rg());var fV=C({...Qt,name:b(),permissions:Te(b()),platformId:Xe(b()),type:b(),userCount:H(xt())});var Og=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Og||{}),Sl=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sl||{}),El=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(El||{});var Tl=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Tl||{});var xl=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(xl||{});var tI=C({mode:$e(Og),value:ve()}),rI=C({auth:H(b()),fields:be(b(),tI)}),nI=C({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:H(rI)}),oI=C({type:fe("PIECE"),toolName:b().check(pr(1)),pieceMetadata:nI}),iI=C({type:fe("none")}),aI=C({type:fe("access_token"),accessToken:b()}),sI=C({type:fe("api_key"),apiKey:b(),apiKeyHeader:b()}),uI=C({type:fe("headers"),headers:be(b(),b())}),cI=Co("type",[iI,aI,sI,uI]),Cg=C({type:fe("FLOW"),toolName:b().check(pr(1)),externalFlowId:b(),flowDisplayName:H(b())}),$g=C({type:fe("MCP"),toolName:b().check(pr(1)),serverUrl:mg(),protocol:$e(El),auth:cI}),kg=C({type:fe("KNOWLEDGE_BASE"),toolName:b().check(pr(1)),sourceType:$e(Sl),sourceId:b(),sourceName:b()}),lI=Co("type",[oI,Cg,$g,kg]),dI=C({displayName:b(),description:H(b()),type:$e(Tl)}),Ng=C({type:fe("MARKDOWN"),markdown:b()}),zo={type:fe("TOOL_CALL"),input:Xe(be(b(),ve())),output:H(ve()),toolName:b(),status:$e(xl),toolCallId:b(),startTime:b(),endTime:H(b())},LV=C(zo),zg=Co("toolCallType",[C({...zo,toolCallType:fe("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),C({...zo,toolCallType:fe("FLOW"),displayName:b(),externalFlowId:b()}),C({...zo,toolCallType:fe("MCP"),displayName:b(),serverUrl:b()}),C({...zo,toolCallType:fe("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),C({...zo,toolCallType:fe("UNKNOWN"),displayName:b()})]),pI=Ie([Ng,zg]);var wl=(r=>(r.IMAGE="image",r.TEXT="text",r))(wl||{}),en=C({apiKey:b()}),fI=en,mI=C({apiKey:b(),apiKeyHash:b()}),hI=en,gI=en,yI=en,_I=en,vI=en,bI=en,PI=en,Dg=C({accessKeyId:b().check(pr(1)),secretAccessKey:b().check(pr(1))}),SI=C({}),EI=C({}),TI=C({}),xI=C({}),wI=C({}),AI=C({}),Ug=C({modelId:b(),modelName:b(),modelType:$e(wl)}),Mg=C({apiKeyHeader:b(),baseUrl:b(),models:Te(Ug),defaultHeaders:H(be(b(),b()))}),jg=C({accountId:b(),gatewayId:b(),models:Te(Ug),vertexProject:H(b()),vertexRegion:H(b())}),Lg=C({resourceName:b(),apiVersion:En(Sn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),H(b()))}),Fg=C({region:b().check(pr(1))}),II=Ie([fI,yI,_I,vI,bI,gI,hI,mI,Dg,PI]),Bg=Ie([Mg,jg,Lg,Fg,SI,TI,xI,wI,EI,AI]),RI=C({id:b(),name:b(),type:$e(wl)}),OI=C({id:b(),name:b(),provider:$e(Gi),config:Bg,enabledForChat:Ve()}),CI=C({provider:$e(Gi),config:Bg,auth:II,platformId:b()});var VV={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var $I=C({base64Url:b(),fileName:b(),extension:H(b())}),kI=C({mimeType:b(),url:b(),fileName:H(b())}),Al=Ie([$I,kI]);var NI=Ie([C({type:fe("file"),value:Al}),C({type:fe("markdown"),value:b(),files:H(Te(Al))})]),zI=C({sessionId:b(),message:b(),files:H(Te(b()))});var Vg=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Vg||{}),Hg=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Hg||{}),Il=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Il||{});var DI=Ie([C({...Qt,name:b(),externalId:b(),type:fe("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:C({options:Te(C({value:b()}))})}),C({...Qt,name:b(),externalId:b(),type:Ie([fe("TEXT"),fe("NUMBER"),fe("DATE")]),tableId:b(),projectId:b()})]),UI=C({...Qt,name:b(),folderId:Xe(b()),projectId:b(),externalId:b(),status:Pl(Hg),trigger:Pl(Vg)}),MI=C({...Qt,tableId:b(),projectId:b(),cells:be(b(),C({updated:b(),created:b(),value:ve(),fieldName:b()}))}),jI=C({events:Te($e(Il)),webhookUrl:b(),flowId:b()}),LI=C({fields:Te(C({id:b(),name:b()})),rows:Te(be(b(),b())),name:b()}),FI=C({projectId:b(),limit:H(zi.number()),cursor:H(b()),name:H(b()),externalIds:$s(b()),folderId:H(b()),folderIds:$s(b())}),BI=C({records:Te(Te(C({fieldId:b(),value:Wg()}))),tableId:b()}),qI=C({cells:H(Te(C({fieldId:b(),value:Wg()}))),tableId:b(),agentUpdate:H(Ve())}),Gg=Co("operator",[Jn("eq"),Jn("neq"),Jn("gt"),Jn("gte"),Jn("lt"),Jn("lte"),Jn("co"),qg("exists"),qg("not_exists")]),VI=C({tableId:b(),limit:H(zi.number()),cursor:H(b()),filters:$s(Gg)});function Wg(){return En(Sn(t=>t==null?t:String(t)),Ni(b()))}o(Wg,"coerceToString");function Jn(t){return C({fieldId:b(),operator:fe(t),value:b()})}o(Jn,"valueFilter");function qg(t){return C({fieldId:b(),operator:fe(t)})}o(qg,"existenceFilter");var HI=C({status:H(xt()),body:H(ve()),headers:H(be(b(),b()))}),GI=C({...Qt,deleted:Xe(wn),ownerId:b(),displayName:b(),platformId:b(),externalId:Xe(b())});var Zg=C({name:b(),description:H(b()),type:b(),required:Ve()}),WI=C({pieceName:b(),triggerName:b(),input:C({toolName:b(),toolDescription:b(),inputSchema:Te(Zg),returnsResponse:Ve()})});var Kg="^[0-9]+\\.[0-9]+\\.[0-9]+$",cH=new RegExp(Kg),KI="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",lH=b().check(Pn(new RegExp(Kg))),dH=b().check(Pn(new RegExp(KI))),JI=C({packageType:fe("ARCHIVE"),pieceType:$e($o),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),Jg=C({packageType:fe("REGISTRY"),pieceType:fe("OFFICIAL"),pieceName:b(),pieceVersion:b()}),Yg=C({packageType:fe("REGISTRY"),pieceType:fe("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),pH=Ie([Jg,Yg]),fH=Ie([JI,Jg,Yg]),Xg=(e=>(e.CRON_EXPRESSION="CRON_EXPRESSION",e))(Xg||{}),YI=C({type:$e(Xg),cronExpression:b(),timezone:b()}),mH=C({...Qt,type:$e(xn),projectId:b(),flowId:b(),triggerName:b(),schedule:Xe(YI),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:Xe(b()),simulate:Ve()}),Qg=(P=>(P.UNKNOWN="UNKNOWN",P.FLOW_RUN_LOG="FLOW_RUN_LOG",P.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",P.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",P.FLOW_STEP_FILE="FLOW_STEP_FILE",P.SAMPLE_DATA="SAMPLE_DATA",P.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",P.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",P.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",P.PROJECT_RELEASE="PROJECT_RELEASE",P.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",P.PLATFORM_ASSET="PLATFORM_ASSET",P.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",P.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",P.KNOWLEDGE_BASE="KNOWLEDGE_BASE",P.FLOW_BUNDLE="FLOW_BUNDLE",P))(Qg||{}),ey=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ey||{}),ty=(r=>(r.S3="S3",r.DB="DB",r))(ty||{}),hH=C({...Qt,projectId:Xe(b()),platformId:Xe(b()),type:$e(Qg),compression:$e(ey),data:H(ve()),location:$e(ty),size:Xe(xt()),fileName:Xe(b()),s3Key:Xe(b()),metadata:Xe(be(b(),b()))}),ry=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ry||{}),ny=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ny||{}),gH=C({id:b(),email:b(),firstName:b(),status:$e(ny),externalId:Xe(b()),platformId:Xe(b()),platformRole:$e(ry),lastName:b(),created:wn,updated:wn,lastActiveDate:Xe(wn),imageUrl:Xe(b())});var Rl=C({...Me.shape,...Re(be(b(),ve()),"OBJECT").shape});var sy=C({...Me.shape,...Re(b(),"COLOR").shape});var Ol=Ie([Ut,Jr,Rs,Xr,Mt,Yr,yl,Di,_l,Qr,ji,Rl,Li,Mi,Ui,sy]),xe={ShortText(t){return{...t,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(t){return{...t,valueSchema:void 0,type:"CHECKBOX"}},LongText(t){return{...t,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(t){return{displayName:"Markdown",required:!1,description:t.value,type:"MARKDOWN",valueSchema:void 0,variant:t.variant??"INFO"}},Number(t){return{...t,valueSchema:void 0,type:"NUMBER"}},Json(t){return{...t,valueSchema:void 0,type:"JSON"}},Array(t){return{...t,valueSchema:void 0,type:"ARRAY"}},Object(t){return{...t,valueSchema:void 0,type:"OBJECT"}},Dropdown(t){return{...t,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(t){return{...t,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(t){return{...t,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(t){return{...t,valueSchema:void 0,type:"DATE_TIME"}},File(t){return{...t,valueSchema:void 0,type:"FILE"}},Custom(t){let e=t.code.toString();return{...t,code:e,valueSchema:void 0,type:"CUSTOM"}},Color(t){return{...t,valueSchema:void 0,type:"COLOR"}}};var wr=C({displayName:b(),description:H(b())});var uy=C({username:b(),password:b()}),Cl=C({...wr.shape,username:C({displayName:b(),description:H(b())}),password:C({displayName:b(),description:H(b())}),...Re(uy,"BASIC_AUTH").shape});var tR=be(b(),Ie([Ut,Jr,Qr,Xr,Mt])),$l=C({...wr.shape,props:tR,...Re(ve(),"CUSTOM_AUTH").shape});var Yn=C({...wr.shape,...Re(C({auth:b()}),"SECRET_TEXT").shape});var rR=be(b(),Ie([Ut,Jr,Yn,Qr,Xr,Mt,Yr,Rs])),cy=C({...wr.shape,props:rR,...Re(ve(),"OIDC").shape});var kl=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(kl||{}),ly=Ie([Ut,Yn,Mt]),dy=be(b(),ly),nR=C({props:H(be(b(),ly)),authUrl:b(),tokenUrl:b(),scope:Te(b()),prompt:H(Ie([fe("none"),fe("consent"),fe("login"),fe("omit")])),pkce:H(Ve()),pkceMethod:H(Ie([fe("plain"),fe("S256")])),authorizationMethod:H($e(kl)),grantType:H(Ie([$e(Bi),fe(vl)])),extra:H(be(b(),b()))}),py=C({access_token:b(),props:H(dy),data:be(b(),ki())}),Nl=C({...wr.shape,...nR.shape,...Re(py,"OAUTH2").shape});var Do=Ie([Cl,$l,cy,Nl,Yn]),Wi="Connection",zl={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Wi}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Wi,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Wi}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Wi}},None(){}};var ZG={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var oR=C({...Me.shape,...Re(ve(),"CUSTOM").shape,code:b()});var iR=Ie([Ol,Do]),Dl=be(b(),iR),mW=be(b(),Ol);var fy=Ie([C({strategy:fe("CRON"),cronExpression:b()}),C({strategy:fe("NONE")})]),Uo=class{constructor(e,r,n,i,s,c,d,l,p,f,_,h,g,y,T,P,x,N,L){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=l;this.renewConfiguration=p;this.onRenew=f;this.onEnable=_;this.onDisable=h;this.onStart=g;this.run=y;this.test=T;this.sampleData=P;this.testStrategy=x;this.outputSchema=N;this.aiMetadata=L}static{o(this,"ITrigger")}},my=o(t=>{switch(t.type){case"WEBHOOK":return new Uo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,t.handshakeConfiguration??{strategy:"NONE"},t.onHandshake??(async()=>({status:200})),t.renewConfiguration??{strategy:"NONE"},t.onRenew??(async()=>Promise.resolve()),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,t.test?"TEST_FUNCTION":"SIMULATION",t.outputSchema,t.aiMetadata);case"POLLING":return new Uo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"MANUAL":return new Uo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,"TEST_FUNCTION",t.outputSchema,t.aiMetadata);case"APP_WEBHOOK":return new Uo(t.name,t.displayName,t.description,t.requireAuth??!0,t.props,t.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),t.onEnable,t.onDisable,t.onStart??(async()=>Promise.resolve()),t.run,t.test??(()=>Promise.resolve([t.sampleData])),t.sampleData,bt(t.sampleData)&&bt(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var hy="2",Ns="0.82.0";var Ul=class{constructor(e,r,n,i,s,c,d,l,p=Ns,f,_=""){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=l;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:hy}),"getContextInfo");(!aR(p)||sR(p,Ns))&&(this.minimumSupportedRelease=Ns),s.forEach(h=>this._actions[h.name]=h),c.forEach(h=>this._triggers[h.name]=h)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},gy=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Ul(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description)},"createPiece");function aR(t){return/^\d+\.\d+\.\d+$/.test(t)}o(aR,"isValidSimpleSemver");function sR(t,e){let[r,n,i]=t.split(".").map(Number),[s,c,d]=e.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(sR,"isSemverLessThan");var uR=H(be(b(),be(b(),b()))),yy=C({id:H(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:Te(b()),platformId:H(b()),directoryPath:H(b()),auth:H(Ie([Do,Te(Do)])),version:b(),categories:H(Te($e(ko))),minimumSupportedRelease:H(b()),maximumSupportedRelease:H(b()),i18n:uR}),cR=$e(["human","ai","both"]),_y=C({description:H(b()),idempotent:H(Ve())}),vy=C({name:b(),displayName:b(),description:b(),props:Dl,requireAuth:Ve(),errorHandlingOptions:H(gl),outputSchema:H(As()),audience:H(cR),aiMetadata:H(_y)}),by=C({name:b(),displayName:b(),description:b(),props:Dl,errorHandlingOptions:H(gl),type:$e(xn),sampleData:ve(),handshakeConfiguration:H(As()),renewConfiguration:H(fy),testStrategy:$e(Vi),outputSchema:H(As()),aiMetadata:H(_y)}),lR=C({...yy.shape,actions:be(b(),vy),triggers:be(b(),by)}),dR=C({...yy.shape,actions:xt(),triggers:xt(),suggestedActions:H(Te(by)),suggestedTriggers:H(Te(vy))}),Py=C({projectUsage:xt(),tags:H(Te(b())),pieceType:$e($o),packageType:$e(Fi),platformId:H(b()),archiveId:H(b())}),mZ=C({...lR.shape,...Py.shape}),hZ=C({...dR.shape,...Py.shape}),gZ=C({name:b(),version:b()});var pR=pt(require("path")),fR=pt(require("fs/promises"));var zs=class{constructor(e,r){this.baseUrl=e;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(e){let r=new URL(`${this.baseUrl}${e.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};if(e.authentication&&this.populateAuthentication(e.authentication,r),e.body)switch(e.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var Ds=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new Ml,r=new jl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},Ml=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},jl=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(e,r){let n=`${e.username}:${e.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Us=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Ms=class extends zs{static{o(this,"FetchHttpClient")}constructor(e="",r=new Ds){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),s=this.getHeaders(e),c=e.queryParams??{};for(let[L,X]of Object.entries(c))i.append(L,X);let d=i.toString(),l=d?`${n}?${d}`:n,p=e.responseType??"json",f=e.followRedirects??!0,_=e.retries??0,{body:h,extraHeaders:g,isStream:y}=mR(e.body,s),T=gR({...s,...g}),P=await hR(async()=>{let L=new AbortController,X=e.timeout&&e.timeout>0?setTimeout(()=>L.abort(),e.timeout):void 0;try{let W={method:e.method.toString(),headers:T,body:h,redirect:f?"follow":"manual",signal:L.signal};return y&&(W.duplex="half"),r?.dispatcher!==void 0&&(W.dispatcher=r.dispatcher),await fetch(l,W)}finally{X!==void 0&&clearTimeout(X)}},_),x=f?300:400;if(P.status<200||P.status>=x){let L=await Sy(P,p),X=new Us(e.body,{status:P.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",X),X}let N=await Sy(P,p);return{status:P.status,headers:yR(P.headers),body:N}}};function mR(t,e){return vR(t)?{body:void 0,extraHeaders:{},isStream:!1}:_R(t)?{body:t,extraHeaders:t.getHeaders(),isStream:!0}:typeof t=="string"||Buffer.isBuffer(t)||t instanceof URLSearchParams||t instanceof ArrayBuffer||typeof FormData<"u"&&t instanceof FormData||typeof Blob<"u"&&t instanceof Blob?{body:t,extraHeaders:{},isStream:!1}:(e["Content-Type"]??e["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(t).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(t),extraHeaders:{},isStream:!1}}o(mR,"serializeBody");async function Sy(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();case"json":default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Sy,"parseResponseBody");async function hR(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await Ey(n);continue}return i}catch(i){if(r=i,n<e){await Ey(n);continue}throw i}throw r}o(hR,"sendWithRetries");function Ey(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(Ey,"backoff");function gR(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r]=Array.isArray(n)?n.join(", "):n);return e}o(gR,"normalizeHeaders");function yR(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(yR,"toHttpHeaders");function _R(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"}o(_R,"isNodeFormData");function vR(t){return t==null}o(vR,"isNil");var An=new Ms;var Mo=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Mo||{});var a0=pt(require("fs")),Av=pt(wv());var s0={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function u0(t){let e=t.split(";")[0].trim().toLowerCase();return s0[e]??""}o(u0,"contentTypeToExtension");var c0=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),l0=o((t,e)=>{let r="https://api.example.com";try{let n=e?t(e):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Iv({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:l="headers"}){return Tn({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:t,requireAuth:!!t,props:{url:xe.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:p})=>({url:xe.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
69
+ i.e ${l0(e,p)}/resource or /resource`,required:!0,defaultValue:p?e(p):"",...c?.url??{}})}),"props")}),method:xe.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Mo).map(p=>({label:p,value:p}))},...c?.method??{}}),headers:xe.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:xe.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:xe.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:xe.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:p})=>{if(!p)return{};let f=p,_={};switch(f){case"none":break;case"json":_.data=xe.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=xe.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=xe.Array({displayName:"Form Data",required:!0,properties:{fieldName:xe.ShortText({displayName:"Field Name",required:!0}),fieldType:xe.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:xe.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:xe.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:xe.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:xe.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:xe.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:xe.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async p=>{let{method:f,url:_,headers:h,queryParams:g,body:y,body_type:T,failsafe:P,timeout:x,response_is_binary:N,followRedirects:L}=p.propsValue;Cs(f,"Method"),Cs(_,"URL");let X=bt(r)?{}:await r(p.auth,p.propsValue),W=_.url,G=W.startsWith("http://")||W.startsWith("https://")?W:c0({baseUrl:e(p.auth),relativePath:W}),K={method:f,url:G,headers:{...h??{},...l==="headers"||!bt(l)?X:{}},queryParams:{...l==="queryParams"?X:{},...g??{}},timeout:x?x*1e3:0,followRedirects:L};if(N&&(K.responseType="arraybuffer"),y)if(T&&T!=="none"){let ee=y.data;if(T==="form_data"){let Y=ee,Se=new Av.default;for(let{fieldName:te,fieldType:q,textFieldValue:B,fileFieldValue:J}of Y)q==="text"&&!Hi(B)?Se.append(te,B):q==="file"&&!Hi(J)&&Se.append(te,J.data,{filename:J?.filename});K.body=Se,K.headers={...K.headers,...Se.getHeaders()}}else K.body=ee}else T||(K.body=y);try{let ee=await An.sendRequest(K);return await d0(p.files,ee.body,ee.status,ee.headers,N)}catch(ee){if(P)return ee.errorMessage();throw ee}},"run")})}o(Iv,"createCustomApiCallAction");var d0=o(async(t,e,r,n,i)=>{let s;if(i&&p0(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=u0(c??"")||"txt",l;e instanceof ArrayBuffer?l=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?l=e:l=Buffer.from(e),s=await t.write({fileName:`output.${d}`,data:l})}else s=e;return{status:r,headers:n,body:s}},"handleBinaryResponse"),p0=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var Xi={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(t.strategy){case 0:{let d=await e.get("lastPoll");if(bt(d))throw new Error("lastPoll doesn't exist in the store.");let l=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:d,server:c}),p=l.reduce((f,_)=>Math.max(f,_.epochMilliSeconds),d);return await e.put("lastPoll",p),l.filter(f=>f.epochMilliSeconds>d).map(f=>f.data)}case 1:{let d=await e.get("lastItem"),l=await t.items({store:e,auth:r,propsValue:n,lastItemId:d,files:s,server:c}),p=l.findIndex(h=>h.id===d),f=[];bt(d)||p==-1?f=l??[]:f=l?.slice(0,p)??[],bt(i)||(f=f.slice(-i));let _=f?.[0]?.id;return bt(_)||await e.put("lastItem",_),f.map(h=>h.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i}){switch(t.strategy){case 0:{await e.put("lastPoll",Date.now());break}case 1:{let c=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;bt(c)?await e.delete("lastItem"):await e.put("lastItem",c);break}}},async onDisable(t,e){switch(t.strategy){case 0:case 1:return}},async test(t,{auth:e,propsValue:r,store:n,files:i,server:s}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:s});break}}return f0(c.map(d=>d.data))}};function f0(t){return t.length<=5?t:t.slice(0,5)}o(f0,"getFirstFiveOrAll");var On={baseUrl:"https://people.googleapis.com/v1/people"};var mr=zl.OAuth2({description:"",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:["https://www.googleapis.com/auth/contacts"]});var Ov=Tn({auth:mr,name:"add_contact",description:"Add a contact to a Google Contacts account",audience:"both",aiMetadata:{description:"Creates a new person in the authenticated Google Contacts account from name, email, phone, company, and job title fields. Use when an agent needs to add someone to address book contacts; first and last name are required. Not idempotent \u2014 each call creates a separate contact even with identical input, so guard against duplicates.",idempotent:!1},displayName:"Add Contact",props:{firstName:xe.ShortText({displayName:"First Name",description:"The first name of the contact",required:!0}),middleName:xe.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:xe.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!0}),jobTitle:xe.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:xe.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:xe.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:xe.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e={names:[{givenName:t.propsValue.firstName,middleName:t.propsValue.middleName,familyName:t.propsValue.lastName}]},r={};t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]),e={...e,...r};let n={method:"POST",url:`${On.baseUrl}:createContact`,body:e,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token}};return(await An.sendRequest(n)).body}});var Cv=Tn({auth:mr,name:"update_contact",description:"Update a contact in Google Contacts account.",audience:"both",aiMetadata:{description:"Updates fields (name, email, phone, company, job title) on an existing Google Contacts person identified by its resourceName (people/{id}). Use when an agent needs to modify a known contact; requires both the resourceName and the current etag, and a field mask listing which fields to update \u2014 the call is rejected if the contact changed since the etag was fetched. Repeating the same update with the same etag/values is safe and yields the same result.",idempotent:!0},displayName:"Update Contact",props:{resourceName:xe.ShortText({displayName:"Resource Name",description:"The resource name for the person, assigned by the server. An ASCII string in the form of people/{person_id}.",required:!0}),etag:xe.ShortText({displayName:"Etag",description:"The `etag` ensures contact updates only apply if the contact hasn't changed since last retrieved.",required:!0}),updatePersonFields:xe.StaticMultiSelectDropdown({displayName:"Update Field Mask",description:"A field mask to restrict which fields on the person are updated.",required:!0,options:{options:[{label:"Names",value:"names"},{label:"Email",value:"emailAddresses"},{label:"Phone Number",value:"phoneNumbers"},{label:"Job Title / Company",value:"organizations"}]},defaultValue:["names","emailAddresses"]}),firstName:xe.ShortText({displayName:"First Name",description:"The first name of the contact",required:!1}),middleName:xe.ShortText({displayName:"Middle Name",description:"The middle name of the contact",required:!1}),lastName:xe.ShortText({displayName:"Last Name",description:"The last name of the contact",required:!1}),jobTitle:xe.ShortText({displayName:"Job Title",description:"The job title of the contact",required:!1}),company:xe.ShortText({displayName:"Company",description:"The company of the contact",required:!1}),email:xe.ShortText({displayName:"Email",description:"The email address of the contact",required:!1}),phoneNumber:xe.ShortText({displayName:"Phone Number",description:"The phone number of the contact",required:!1})},async run(t){let e=t.propsValue.resourceName.substring(6),r={etag:t.propsValue.etag},n={updatePersonFields:t.propsValue.updatePersonFields.join(",")};(t.propsValue.firstName||t.propsValue.middleName||t.propsValue.lastName)&&(r.names=[{givenName:t.propsValue.firstName||void 0,middleName:t.propsValue.middleName||void 0,familyName:t.propsValue.lastName||void 0}]),t.propsValue.email&&(r.emailAddresses=[{value:t.propsValue.email}]),t.propsValue.phoneNumber&&(r.phoneNumbers=[{value:t.propsValue.phoneNumber}]),(t.propsValue.company||t.propsValue.jobTitle)&&(r.organizations=[{name:t.propsValue.company||void 0,title:t.propsValue.jobTitle||void 0}]);let i={method:"PATCH",url:`${On.baseUrl}${e}:updateContact`,body:r,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:n};return(await An.sendRequest(i)).body}});var $v=Tn({auth:mr,name:"search_contact",description:"Search contacts in Google Contacts account.",audience:"both",aiMetadata:{description:"Searches the authenticated Google Contacts account for people matching a plain-text query, which prefix-matches against contact fields. Use when an agent needs to find a contact or its resourceName before updating it; the query is required and a read mask selects which fields come back (max 30 results). Read-only and idempotent.",idempotent:!0},displayName:"Search Contacts",props:{query:xe.ShortText({displayName:"Query",description:'The plain-text query for the request.The query is used to match prefix phrases of the fields on a person. For example, a person with name "foo name" matches queries such as "f", "fo", "foo", "foo n", "nam", etc., but not "oo n".',required:!0}),readMask:xe.StaticMultiSelectDropdown({displayName:"Read Mask",description:"A field mask to restrict which fields on each person are returned.",required:!0,options:{options:[{label:"addresses",value:"addresses"},{label:"ageRanges",value:"ageRanges"},{label:"biographies",value:"biographies"},{label:"birthdays",value:"birthdays"},{label:"calendarUrls",value:"calendarUrls"},{label:"clientData",value:"clientData"},{label:"coverPhotos",value:"coverPhotos"},{label:"emailAddresses",value:"emailAddresses"},{label:"events",value:"events"},{label:"externalIds",value:"externalIds"},{label:"genders",value:"genders"},{label:"imClients",value:"imClients"},{label:"interests",value:"interests"},{label:"locales",value:"locales"},{label:"locations",value:"locations"},{label:"memberships",value:"memberships"},{label:"metadata",value:"metadata"},{label:"miscKeywords",value:"miscKeywords"},{label:"names",value:"names"},{label:"nicknames",value:"nicknames"},{label:"occupations",value:"occupations"},{label:"organizations",value:"organizations"},{label:"phoneNumbers",value:"phoneNumbers"},{label:"photos",value:"photos"},{label:"relations",value:"relations"},{label:"sipAddresses",value:"sipAddresses"},{label:"skills",value:"skills"},{label:"urls",value:"urls"},{label:"userDefined",value:"userDefined"}]},defaultValue:["names","emailAddresses"]}),pageSize:xe.Number({displayName:"Page Size",description:"The number of results to return. Maximum 30.",required:!1})},async run(t){let e={query:t.propsValue.query,readMask:t.propsValue.readMask.join(",")};t.propsValue.pageSize&&(e.pageSize=String(t.propsValue.pageSize));let r={method:"GET",url:`${On.baseUrl}:searchContacts`,authentication:{type:"BEARER_TOKEN",token:t.auth.access_token},queryParams:e};return(await An.sendRequest(r)).body}});var tx=pt(QT()),rx=pt(Oa()),nx=pt(ex());var Ac={strategy:0,items:o(async({store:t,auth:e})=>{let r=new rx.OAuth2Client;r.setCredentials(e);let n=(0,tx.people)({version:"v1",auth:r}),i,s=[];do{let c=await n.people.connections.list({resourceName:"people/me",pageToken:i,pageSize:100,sortOrder:"LAST_MODIFIED_DESCENDING",personFields:["addresses","ageRanges","biographies","birthdays","calendarUrls","clientData","coverPhotos","emailAddresses","events","externalIds","genders","imClients","interests","locales","locations","memberships","metadata","miscKeywords","names","nicknames","occupations","organizations","phoneNumbers","photos","relations","sipAddresses","skills","urls","userDefined"].join()});for(let d of c.data.connections||[])d.metadata?.deleted!==!0&&s.push({data:d,epochMilliSeconds:(0,nx.default)(d.metadata?.sources?.[0].updateTime).valueOf()});i=c.data.nextPageToken}while(i);return s},"items")},ox=my({auth:mr,name:"new_or_updated_contact",displayName:"New Or Updated Contact",description:"Triggers when there is a new or updated contact",aiMetadata:{description:"Fires when a contact in the authenticated Google Contacts account is newly created or has been modified since the last poll. Each event represents one person record with its current fields; deleted contacts are excluded."},props:{},sampleData:{resourceName:"people/c4278485694217203807",etag:"%EiMBAgMFBgcICQoLDA0ODxATFBUWGSEiIyQlJicuNDU3PT4/QBoEAQIFByIMZFVwNlJPNEVKUzg9",metadata:{sources:[{type:"CONTACT",id:"3b603c120c68305f",etag:"#dUp6RO4EJS8=",updateTime:"2023-01-30T14:35:18.142565Z"}],objectType:"PERSON"},names:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},displayName:"Shahed Mashni",familyName:"Mashni",givenName:"Shahed",displayNameLastFirst:"Mashni, Shahed",unstructuredName:"Shahed Mashni"}],photos:[{metadata:{primary:!0,source:{type:"CONTACT",id:"3b603c120c68305f"}},url:"https://lh3.googleusercontent.com/cm/AAkddurmZojs4vCcxrpkfSxH9tnqcH-hI82ESDnwv6eq86nZeLStcjYEIe_TCx8r8g5Y=s100",default:!0}],memberships:[{metadata:{source:{type:"CONTACT",id:"3b603c120c68305f"}},contactGroupMembership:{contactGroupId:"myContacts",contactGroupResourceName:"contactGroups/myContacts"}}]},type:"POLLING",async onEnable(t){return await Xi.onEnable(Ac,{store:t.store,auth:t.auth,propsValue:{}})},async onDisable(t){return await Xi.onEnable(Ac,{store:t.store,auth:t.auth,propsValue:{}})},async run(t){return await Xi.poll(Ac,{store:t.store,auth:t.auth,propsValue:{},files:t.files})},test:o(async t=>await Xi.test(Ac,{store:t.store,auth:t.auth,propsValue:{},files:t.files}),"test")});var n1=gy({minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/google-contacts.png",categories:["SALES_AND_CRM"],actions:[Ov,Cv,$v,Iv({baseUrl:o(()=>On.baseUrl,"baseUrl"),auth:mr,authMapping:o(async t=>({Authorization:`Bearer ${t.access_token}`}),"authMapping")})],displayName:"Google Contacts",description:"Stay connected and organized",authors:["Abdallah-Alwarawreh","Salem-Alaa","kishanprmr","MoShizzle","khaledmashaly","abuaboud","ikus060"],triggers:[ox],auth:mr});0&&(module.exports={googleContacts});
70
+ /*! Bundled license information:
71
+
72
+ mime-types/index.js:
73
+ (*!
74
+ * mime-types
75
+ * Copyright(c) 2014 Jonathan Ong
76
+ * Copyright(c) 2015 Douglas Christopher Wilson
77
+ * MIT Licensed
78
+ *)
79
+
80
+ web-streams-polyfill/dist/ponyfill.es2018.js:
81
+ (**
82
+ * @license
83
+ * web-streams-polyfill v3.3.3
84
+ * Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
85
+ * This code is released under the MIT license.
86
+ * SPDX-License-Identifier: MIT
87
+ *)
88
+
89
+ fetch-blob/index.js:
90
+ (*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
91
+
92
+ formdata-polyfill/esm.min.js:
93
+ (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
94
+
95
+ node-domexception/index.js:
96
+ (*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
97
+
98
+ safe-buffer/index.js:
99
+ (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
100
+
101
+ gtoken/build/cjs/src/index.cjs:
102
+ (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
103
+
104
+ @googleapis/people/build/index.js:
105
+ (*! THIS FILE IS AUTO-GENERATED *)
106
+ */