@activepieces/piece-google-bigquery 0.0.6 → 0.1.0
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/package.json +1 -1
- package/src/index.js +82 -44
package/src/index.js
CHANGED
|
@@ -1,59 +1,97 @@
|
|
|
1
|
-
"use strict";var wT=Object.create;var mi=Object.defineProperty;var xT=Object.getOwnPropertyDescriptor;var AT=Object.getOwnPropertyNames;var IT=Object.getPrototypeOf,RT=Object.prototype.hasOwnProperty;var o=(t,e)=>mi(t,"name",{value:e,configurable:!0});var ct=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(n){throw r=[n],n}};var M=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Ba=(t,e)=>{for(var r in e)mi(t,r,{get:e[r],enumerable:!0})},Zf=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of AT(e))!RT.call(t,i)&&i!==r&&mi(t,i,{get:()=>e[i],enumerable:!(n=xT(e,i))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?wT(IT(t)):{},Zf(e||!t||!t.__esModule?mi(r,"default",{value:t,enumerable:!0}):r,t)),CT=t=>Zf(mi({},"__esModule",{value:!0}),t);var yh=M((gh,cs)=>{(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"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${e}\\.${e}\\.${e}\\.${e}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${e}\\.${e}\\.${e}\\.${e}(${u})?$`,"i")};function p(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let T=0,E=-1,w=(h.match(l.zoneIndex)||[])[0],k,q;for(w&&(w=w.substring(1),h=h.replace(/%.+$/,""));(E=h.indexOf(":",E+1))>=0;)T++;if(h.substr(0,2)==="::"&&T--,h.substr(-2,2)==="::"&&T--,T>_)return null;for(q=_-T,k=":";q--;)k+="0:";return h=h.replace("::",k),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let G=h.split(":"),V=[];for(let H=0;H<G.length;H++)V.push(parseInt(G[H],16));return V})(),{parts:_,zoneId:w}}o(p,"expandIPv6");function f(h,_,T,E){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let w=0,k;for(;E>0;){if(k=T-E,k<0&&(k=0),h[w]>>k!==_[w]>>k)return!1;E-=T,w+=1}return!0}o(f,"matchCIDR");function m(h){if(i.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(n.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}o(m,"parseIntAuto");function g(h,_){for(;h.length<_;)h=`0${h}`;return h}o(g,"padPart");let S={};S.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let T,E;for(T=0;T<_.length;T++)if(E=_[T],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return o(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,T){let E;if(T===void 0&&(E=_,_=E[0],T=E[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return f(this.octets,_.octets,8,T)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,T=!1,E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},w,k,q;for(w=3;w>=0;w-=1)if(k=this.octets[w],k in E){if(q=E[k],T&&q!==0)return null;q!==8&&(T=!0),_+=q}else return null;return 32-_},h.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return S.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),S.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),T=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),w=[],k=0;for(;k<4;)w.push(parseInt(T[k],10)|parseInt(E[k],10)^255),k++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.isIPv4=function(h){return this.parser(h)!==null},S.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},S.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},S.IPv4.isValidFourPartDecimal=function(h){return!!(S.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},S.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!S.IPv4.isValidCIDR(h)||!_?!1:S.IPv4.isValidFourPartDecimal(_[1])},S.IPv4.networkAddressFromCIDR=function(h){let _,T,E,w,k;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),k=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),w=[],T=0;T<4;)w.push(parseInt(E[T],10)&parseInt(k[T],10)),T++;return new this(w)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},S.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},S.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let T=parseInt(_[2]);if(T>=0&&T<=32){let E=[this.parse(_[1]),T];return Object.defineProperty(E,"toString",{value:o(function(){return this.join("/")},"value")}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},S.IPv4.parser=function(h){let _,T,E;if(_=h.match(r.fourOctet))return(function(){let w=_.slice(1,6),k=[];for(let q=0;q<w.length;q++)T=w[q],k.push(m(T));return k})();if(_=h.match(r.longValue)){if(E=m(_[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return(function(){let w=[],k;for(k=0;k<=24;k+=8)w.push(E>>k&255);return w})().reverse()}else return(_=h.match(r.twoOctet))?(function(){let w=_.slice(1,4),k=[];if(E=m(w[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return k.push(m(w[0])),k.push(E>>16&255),k.push(E>>8&255),k.push(E&255),k})():(_=h.match(r.threeOctet))?(function(){let w=_.slice(1,5),k=[];if(E=m(w[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return k.push(m(w[0])),k.push(m(w[1])),k.push(E>>8&255),k.push(E&255),k})():null},S.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],T=0,E=Math.floor(h/8);for(;T<E;)_[T]=255,T++;return E<4&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},S.IPv6=(function(){function h(_,T){let E,w;if(_.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(_[E]<<8|_[E+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(E=0;E<this.parts.length;E++)if(w=this.parts[E],!(0<=w&&w<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");T&&(this.zoneId=T)}return o(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,T){let E;if(T===void 0&&(E=_,_=E[0],T=E[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return f(this.parts,_.parts,16,T)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,T=!1,E={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},w,k;for(let q=7;q>=0;q-=1)if(w=this.parts[q],w in E){if(k=E[w],T&&k!==0)return null;k!==16&&(T=!0),_+=k}else return null;return 128-_},h.prototype.range=function(){return S.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,T=[],E=this.parts;for(let w=0;w<E.length;w++)_=E[w],T.push(_>>8),T.push(_&255);return T},h.prototype.toFixedLengthString=function(){let _=(function(){let E=[];for(let w=0;w<this.parts.length;w++)E.push(g(this.parts[w].toString(16),4));return E}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),_+T},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),T=_[0],E=_[1];return new S.IPv4([T>>8,T&255,E>>8,E&255])},h.prototype.toNormalizedString=function(){let _=(function(){let E=[];for(let w=0;w<this.parts.length;w++)E.push(this.parts[w].toString(16));return E}).call(this).join(":"),T="";return this.zoneId&&(T=`%${this.zoneId}`),_+T},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,T=this.toNormalizedString(),E=0,w=-1,k;for(;k=_.exec(T);)k[0].length>w&&(E=k.index,w=k[0].length);return w<0?T:`${T.substring(0,E)}::${T.substring(E+w)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),S.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),T=_[0].toByteArray(),E=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),w=[],k=0;for(;k<16;)w.push(parseInt(T[k],10)|parseInt(E[k],10)^255),k++;return new this(w)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},S.IPv6.isIPv6=function(h){return this.parser(h)!==null},S.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},S.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},S.IPv6.networkAddressFromCIDR=function(h){let _,T,E,w,k;try{for(_=this.parseCIDR(h),E=_[0].toByteArray(),k=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),w=[],T=0;T<16;)w.push(parseInt(E[T],10)&parseInt(k[T],10)),T++;return new this(w)}catch(q){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${q})`)}},S.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},S.IPv6.parseCIDR=function(h){let _,T,E;if((T=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(T[2]),_>=0&&_<=128))return E=[this.parse(T[1]),_],Object.defineProperty(E,"toString",{value:o(function(){return this.join("/")},"value")}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},S.IPv6.parser=function(h){let _,T,E,w,k,q;if(E=h.match(l.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(l.native.test(h))return p(h,8);if((E=h.match(l.transitional))&&(q=E[6]||"",_=E[1],E[1].endsWith("::")||(_=_.slice(0,-1)),_=p(_+q,6),_.parts)){for(k=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],T=0;T<k.length;T++)if(w=k[T],!(0<=w&&w<=255))return null;return _.parts.push(k[0]<<8|k[1]),_.parts.push(k[2]<<8|k[3]),{parts:_.parts,zoneId:_.zoneId}}return null},S.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],T=0,E=Math.floor(h/8);for(;T<E;)_[T]=255,T++;return E<16&&(_[E]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},S.fromByteArray=function(h){let _=h.length;if(_===4)return new S.IPv4(h);if(_===16)return new S.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},S.isValid=function(h){return S.IPv6.isValid(h)||S.IPv4.isValid(h)},S.isValidCIDR=function(h){return S.IPv6.isValidCIDR(h)||S.IPv4.isValidCIDR(h)},S.parse=function(h){if(S.IPv6.isValid(h))return S.IPv6.parse(h);if(S.IPv4.isValid(h))return S.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},S.parseCIDR=function(h){try{return S.IPv6.parseCIDR(h)}catch{try{return S.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},S.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},S.subnetMatch=function(h,_,T){let E,w,k,q;T==null&&(T="unicast");for(w in _)if(Object.prototype.hasOwnProperty.call(_,w)){for(k=_[w],k[0]&&!(k[0]instanceof Array)&&(k=[k]),E=0;E<k.length;E++)if(q=k[E],h.kind()===q[0].kind()&&h.match.apply(h,q))return w}return T},typeof cs<"u"&&cs.exports?cs.exports=S:t.ipaddr=S})(gh)});var _g=M((bH,yg)=>{var gg=require("stream").Stream,fA=require("util");yg.exports=hr;function hr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(hr,"DelayedStream");fA.inherits(hr,gg);hr.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(hr.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});hr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};hr.prototype.resume=function(){this._released||this.release(),this.source.resume()};hr.prototype.pause=function(){this.source.pause()};hr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(t){this.emit.apply(this,t)}.bind(this)),this._bufferedEvents=[]};hr.prototype.pipe=function(){var t=gg.prototype.pipe.apply(this,arguments);return this.resume(),t};hr.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)};hr.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 Sg=M((EH,Eg)=>{var mA=require("util"),vg=require("stream").Stream,bg=_g();Eg.exports=Xe;function Xe(){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(Xe,"CombinedStream");mA.inherits(Xe,vg);Xe.create=function(t){var e=new this;t=t||{};for(var r in t)e[r]=t[r];return e};Xe.isStreamLike=function(t){return typeof t!="function"&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"&&!Buffer.isBuffer(t)};Xe.prototype.append=function(t){var e=Xe.isStreamLike(t);if(e){if(!(t instanceof bg)){var r=bg.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};Xe.prototype.pipe=function(t,e){return vg.prototype.pipe.call(this,t,e),this.resume(),t};Xe.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}};Xe.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=Xe.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};Xe.prototype._pipeNext=function(t){this._currentStream=t;var e=Xe.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()};Xe.prototype._handleErrors=function(t){var e=this;t.on("error",function(r){e._emitError(r)})};Xe.prototype.write=function(t){this.emit("data",t)};Xe.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};Xe.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")};Xe.prototype.end=function(){this._reset(),this.emit("end")};Xe.prototype.destroy=function(){this._reset(),this.emit("close")};Xe.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};Xe.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var t="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(t))}};Xe.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)};Xe.prototype._emitError=function(t){this._reset(),this.emit("error",t)}});var Tg=M((PH,Pg)=>{"use strict";Pg.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 Ag=M(Ot=>{"use strict";var hs=Tg(),hA=require("path").extname,wg=/^\s*([^;\s]*)(?:;|\s|$)/,gA=/^text\//i;Ot.charset=xg;Ot.charsets={lookup:xg};Ot.contentType=yA;Ot.extension=_A;Ot.extensions=Object.create(null);Ot.lookup=bA;Ot.types=Object.create(null);vA(Ot.extensions,Ot.types);function xg(t){if(!t||typeof t!="string")return!1;var e=wg.exec(t),r=e&&hs[e[1].toLowerCase()];return r&&r.charset?r.charset:e&&gA.test(e[1])?"UTF-8":!1}o(xg,"charset");function yA(t){if(!t||typeof t!="string")return!1;var e=t.indexOf("/")===-1?Ot.lookup(t):t;if(!e)return!1;if(e.indexOf("charset")===-1){var r=Ot.charset(e);r&&(e+="; charset="+r.toLowerCase())}return e}o(yA,"contentType");function _A(t){if(!t||typeof t!="string")return!1;var e=wg.exec(t),r=e&&Ot.extensions[e[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(_A,"extension");function bA(t){if(!t||typeof t!="string")return!1;var e=hA("x."+t).toLowerCase().substr(1);return e&&Ot.types[e]||!1}o(bA,"lookup");function vA(t,e){var r=["nginx","apache",void 0,"iana"];Object.keys(hs).forEach(o(function(i){var u=hs[i],c=u.extensions;if(!(!c||!c.length)){t[i]=c;for(var l=0;l<c.length;l++){var p=c[l];if(e[p]){var f=r.indexOf(hs[e[p]].source),m=r.indexOf(u.source);if(e[p]!=="application/octet-stream"&&(f>m||f===m&&e[p].substr(0,12)==="application/"))continue}e[p]=i}}},"forEachMimeType"))}o(vA,"populateMaps")});var Rg=M((xH,Ig)=>{Ig.exports=EA;function EA(t){var e=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;e?e(t):setTimeout(t,0)}o(EA,"defer")});var nl=M((IH,Og)=>{var Cg=Rg();Og.exports=SA;function SA(t){var e=!1;return Cg(function(){e=!0}),o(function(n,i){e?t(n,i):Cg(o(function(){t(n,i)},"nextTick_callback"))},"async_callback")}o(SA,"async")});var ol=M((CH,kg)=>{kg.exports=PA;function PA(t){Object.keys(t.jobs).forEach(TA.bind(t)),t.jobs={}}o(PA,"abort");function TA(t){typeof this.jobs[t]=="function"&&this.jobs[t]()}o(TA,"clean")});var il=M((kH,Ng)=>{var $g=nl(),wA=ol();Ng.exports=xA;function xA(t,e,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=AA(e,i,t[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?wA(r):r.results[i]=c,n(u,r.results))})}o(xA,"iterate");function AA(t,e,r,n){var i;return t.length==2?i=t(r,$g(n)):i=t(r,e,$g(n)),i}o(AA,"runJob")});var al=M((NH,zg)=>{zg.exports=IA;function IA(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,u){return e(t[i],t[u])}),n}o(IA,"state")});var sl=M((DH,Dg)=>{var RA=ol(),CA=nl();Dg.exports=OA;function OA(t){Object.keys(this.jobs).length&&(this.index=this.size,RA(this),CA(t)(null,this.results))}o(OA,"terminator")});var jg=M((jH,Ug)=>{var kA=il(),$A=al(),NA=sl();Ug.exports=zA;function zA(t,e,r){for(var n=$A(t);n.index<(n.keyedList||t).length;)kA(t,e,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return NA.bind(n,r)}o(zA,"parallel")});var ul=M((LH,gs)=>{var Mg=il(),DA=al(),UA=sl();gs.exports=jA;gs.exports.ascending=Lg;gs.exports.descending=MA;function jA(t,e,r,n){var i=DA(t,r);return Mg(t,e,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||t).length){Mg(t,e,i,u);return}n(null,i.results)},"iteratorHandler")),UA.bind(i,n)}o(jA,"serialOrdered");function Lg(t,e){return t<e?-1:t>e?1:0}o(Lg,"ascending");function MA(t,e){return-1*Lg(t,e)}o(MA,"descending")});var Bg=M((BH,Fg)=>{var LA=ul();Fg.exports=FA;function FA(t,e,r){return LA(t,e,null,r)}o(FA,"serial")});var Vg=M((VH,qg)=>{qg.exports={parallel:jg(),serial:Bg(),serialOrdered:ul()}});var cl=M((HH,Hg)=>{"use strict";Hg.exports=Object});var Wg=M((GH,Gg)=>{"use strict";Gg.exports=Error});var Jg=M((WH,Zg)=>{"use strict";Zg.exports=EvalError});var Qg=M((ZH,Kg)=>{"use strict";Kg.exports=RangeError});var Xg=M((JH,Yg)=>{"use strict";Yg.exports=ReferenceError});var ty=M((KH,ey)=>{"use strict";ey.exports=SyntaxError});var ys=M((QH,ry)=>{"use strict";ry.exports=TypeError});var oy=M((YH,ny)=>{"use strict";ny.exports=URIError});var ay=M((XH,iy)=>{"use strict";iy.exports=Math.abs});var uy=M((eG,sy)=>{"use strict";sy.exports=Math.floor});var ly=M((tG,cy)=>{"use strict";cy.exports=Math.max});var py=M((rG,dy)=>{"use strict";dy.exports=Math.min});var my=M((nG,fy)=>{"use strict";fy.exports=Math.pow});var gy=M((oG,hy)=>{"use strict";hy.exports=Math.round});var _y=M((iG,yy)=>{"use strict";yy.exports=Number.isNaN||o(function(e){return e!==e},"isNaN")});var vy=M((sG,by)=>{"use strict";var BA=_y();by.exports=o(function(e){return BA(e)||e===0?e:e<0?-1:1},"sign")});var Sy=M((cG,Ey)=>{"use strict";Ey.exports=Object.getOwnPropertyDescriptor});var ll=M((lG,Py)=>{"use strict";var _s=Sy();if(_s)try{_s([],"length")}catch{_s=null}Py.exports=_s});var wy=M((dG,Ty)=>{"use strict";var bs=Object.defineProperty||!1;if(bs)try{bs({},"a",{value:1})}catch{bs=!1}Ty.exports=bs});var dl=M((pG,xy)=>{"use strict";xy.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 u 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 l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ry=M((mG,Iy)=>{"use strict";var Ay=typeof Symbol<"u"&&Symbol,qA=dl();Iy.exports=o(function(){return typeof Ay!="function"||typeof Symbol!="function"||typeof Ay("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qA()},"hasNativeSymbols")});var pl=M((gG,Cy)=>{"use strict";Cy.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var fl=M((yG,Oy)=>{"use strict";var VA=cl();Oy.exports=VA.getPrototypeOf||null});var Ny=M((_G,$y)=>{"use strict";var HA="Function.prototype.bind called on incompatible ",GA=Object.prototype.toString,WA=Math.max,ZA="[object Function]",ky=o(function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var u=0;u<r.length;u+=1)n[u+e.length]=r[u];return n},"concatty"),JA=o(function(e,r){for(var n=[],i=r||0,u=0;i<e.length;i+=1,u+=1)n[u]=e[i];return n},"slicy"),KA=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");$y.exports=o(function(e){var r=this;if(typeof r!="function"||GA.apply(r)!==ZA)throw new TypeError(HA+r);for(var n=JA(arguments,1),i,u=o(function(){if(this instanceof i){var m=r.apply(this,ky(n,arguments));return Object(m)===m?m:this}return r.apply(e,ky(n,arguments))},"binder"),c=WA(0,r.length-n.length),l=[],p=0;p<c;p++)l[p]="$"+p;if(i=Function("binder","return function ("+KA(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var f=o(function(){},"Empty");f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i},"bind")});var xo=M((vG,zy)=>{"use strict";var QA=Ny();zy.exports=Function.prototype.bind||QA});var vs=M((EG,Dy)=>{"use strict";Dy.exports=Function.prototype.call});var ml=M((SG,Uy)=>{"use strict";Uy.exports=Function.prototype.apply});var My=M((PG,jy)=>{"use strict";jy.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Fy=M((TG,Ly)=>{"use strict";var YA=xo(),XA=ml(),eI=vs(),tI=My();Ly.exports=tI||YA.call(eI,XA)});var qy=M((wG,By)=>{"use strict";var rI=xo(),nI=ys(),oI=vs(),iI=Fy();By.exports=o(function(e){if(e.length<1||typeof e[0]!="function")throw new nI("a function is required");return iI(rI,oI,e)},"callBindBasic")});var Jy=M((AG,Zy)=>{"use strict";var aI=qy(),Vy=ll(),Gy;try{Gy=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var hl=!!Gy&&Vy&&Vy(Object.prototype,"__proto__"),Wy=Object,Hy=Wy.getPrototypeOf;Zy.exports=hl&&typeof hl.get=="function"?aI([hl.get]):typeof Hy=="function"?o(function(e){return Hy(e==null?e:Wy(e))},"getDunder"):!1});var e_=M((RG,Xy)=>{"use strict";var Ky=pl(),Qy=fl(),Yy=Jy();Xy.exports=Ky?o(function(e){return Ky(e)},"getProto"):Qy?o(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return Qy(e)},"getProto"):Yy?o(function(e){return Yy(e)},"getProto"):null});var gl=M((OG,t_)=>{"use strict";var sI=Function.prototype.call,uI=Object.prototype.hasOwnProperty,cI=xo();t_.exports=cI.call(sI,uI)});var u_=M((kG,s_)=>{"use strict";var Te,lI=cl(),dI=Wg(),pI=Jg(),fI=Qg(),mI=Xg(),Co=ty(),Ro=ys(),hI=oy(),gI=ay(),yI=uy(),_I=ly(),bI=py(),vI=my(),EI=gy(),SI=vy(),i_=Function,yl=o(function(t){try{return i_('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),Di=ll(),PI=wy(),_l=o(function(){throw new Ro},"throwTypeError"),TI=Di?(function(){try{return arguments.callee,_l}catch{try{return Di(arguments,"callee").get}catch{return _l}}})():_l,Ao=Ry()(),lt=e_(),wI=fl(),xI=pl(),a_=ml(),Ui=vs(),Io={},AI=typeof Uint8Array>"u"||!lt?Te:lt(Uint8Array),Vn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Te:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Te:ArrayBuffer,"%ArrayIteratorPrototype%":Ao&<?lt([][Symbol.iterator]()):Te,"%AsyncFromSyncIteratorPrototype%":Te,"%AsyncFunction%":Io,"%AsyncGenerator%":Io,"%AsyncGeneratorFunction%":Io,"%AsyncIteratorPrototype%":Io,"%Atomics%":typeof Atomics>"u"?Te:Atomics,"%BigInt%":typeof BigInt>"u"?Te:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Te:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Te:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Te:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":dI,"%eval%":eval,"%EvalError%":pI,"%Float16Array%":typeof Float16Array>"u"?Te:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Te:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Te:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Te:FinalizationRegistry,"%Function%":i_,"%GeneratorFunction%":Io,"%Int8Array%":typeof Int8Array>"u"?Te:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Te:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Te:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ao&<?lt(lt([][Symbol.iterator]())):Te,"%JSON%":typeof JSON=="object"?JSON:Te,"%Map%":typeof Map>"u"?Te:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ao||!lt?Te:lt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":lI,"%Object.getOwnPropertyDescriptor%":Di,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Te:Promise,"%Proxy%":typeof Proxy>"u"?Te:Proxy,"%RangeError%":fI,"%ReferenceError%":mI,"%Reflect%":typeof Reflect>"u"?Te:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Te:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ao||!lt?Te:lt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Te:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ao&<?lt(""[Symbol.iterator]()):Te,"%Symbol%":Ao?Symbol:Te,"%SyntaxError%":Co,"%ThrowTypeError%":TI,"%TypedArray%":AI,"%TypeError%":Ro,"%Uint8Array%":typeof Uint8Array>"u"?Te:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Te:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Te:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Te:Uint32Array,"%URIError%":hI,"%WeakMap%":typeof WeakMap>"u"?Te:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Te:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Te:WeakSet,"%Function.prototype.call%":Ui,"%Function.prototype.apply%":a_,"%Object.defineProperty%":PI,"%Object.getPrototypeOf%":wI,"%Math.abs%":gI,"%Math.floor%":yI,"%Math.max%":_I,"%Math.min%":bI,"%Math.pow%":vI,"%Math.round%":EI,"%Math.sign%":SI,"%Reflect.getPrototypeOf%":xI};if(lt)try{null.error}catch(t){r_=lt(lt(t)),Vn["%Error.prototype%"]=r_}var r_,II=o(function t(e){var r;if(e==="%AsyncFunction%")r=yl("async function () {}");else if(e==="%GeneratorFunction%")r=yl("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=yl("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&<&&(r=lt(i.prototype))}return Vn[e]=r,r},"doEval"),n_={__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=xo(),Es=gl(),RI=ji.call(Ui,Array.prototype.concat),CI=ji.call(a_,Array.prototype.splice),o_=ji.call(Ui,String.prototype.replace),Ss=ji.call(Ui,String.prototype.slice),OI=ji.call(Ui,RegExp.prototype.exec),kI=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$I=/\\(\\)?/g,NI=o(function(e){var r=Ss(e,0,1),n=Ss(e,-1);if(r==="%"&&n!=="%")throw new Co("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Co("invalid intrinsic syntax, expected opening `%`");var i=[];return o_(e,kI,function(u,c,l,p){i[i.length]=l?o_(p,$I,"$1"):c||u}),i},"stringToPath"),zI=o(function(e,r){var n=e,i;if(Es(n_,n)&&(i=n_[n],n="%"+i[0]+"%"),Es(Vn,n)){var u=Vn[n];if(u===Io&&(u=II(n)),typeof u>"u"&&!r)throw new Ro("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Co("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");s_.exports=o(function(e,r){if(typeof e!="string"||e.length===0)throw new Ro("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ro('"allowMissing" argument must be a boolean');if(OI(/^%?[^%]*%?$/,e)===null)throw new Co("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=NI(e),i=n.length>0?n[0]:"",u=zI("%"+i+"%",r),c=u.name,l=u.value,p=!1,f=u.alias;f&&(i=f[0],CI(n,RI([0,1],f)));for(var m=1,g=!0;m<n.length;m+=1){var S=n[m],h=Ss(S,0,1),_=Ss(S,-1);if((h==='"'||h==="'"||h==="`"||_==='"'||_==="'"||_==="`")&&h!==_)throw new Co("property names with quotes must have matching quotes");if((S==="constructor"||!g)&&(p=!0),i+="."+S,c="%"+i+"%",Es(Vn,c))l=Vn[c];else if(l!=null){if(!(S in l)){if(!r)throw new Ro("base intrinsic for "+e+" exists, but the property is not available.");return}if(Di&&m+1>=n.length){var T=Di(l,S);g=!!T,g&&"get"in T&&!("originalValue"in T.get)?l=T.get:l=l[S]}else g=Es(l,S),l=l[S];g&&!p&&(Vn[c]=l)}}return l},"GetIntrinsic")});var l_=M((NG,c_)=>{"use strict";var DI=dl();c_.exports=o(function(){return DI()&&!!Symbol.toStringTag},"hasToStringTagShams")});var f_=M((DG,p_)=>{"use strict";var UI=u_(),d_=UI("%Object.defineProperty%",!0),jI=l_()(),MI=gl(),LI=ys(),Ps=jI?Symbol.toStringTag:null;p_.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 LI("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ps&&(n||!MI(e,Ps))&&(d_?d_(e,Ps,{configurable:!i,enumerable:!1,value:r,writable:!1}):e[Ps]=r)},"setToStringTag")});var h_=M((jG,m_)=>{"use strict";var FI=Function.prototype.call,BI=Object.prototype.hasOwnProperty,qI=xo();m_.exports=qI.call(FI,BI)});var y_=M((MG,g_)=>{"use strict";g_.exports=function(t,e){return Object.keys(e).forEach(function(r){t[r]=t[r]||e[r]}),t}});var v_=M((LG,b_)=>{"use strict";var Sl=Sg(),VI=require("util"),bl=require("path"),HI=require("http"),GI=require("https"),WI=require("url").parse,ZI=require("fs"),JI=require("stream").Stream,KI=require("crypto"),vl=Ag(),QI=Vg(),YI=f_(),Tn=h_(),El=y_();function __(t){return String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(__,"escapeHeaderParam");function Ce(t){if(!(this instanceof Ce))return new Ce(t);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Sl.call(this),t=t||{};for(var e in t)this[e]=t[e]}o(Ce,"FormData");VI.inherits(Ce,Sl);Ce.LINE_BREAK=`\r
|
|
2
|
-
`;Ce.DEFAULT_CONTENT_TYPE="application/octet-stream";Ce.prototype.append=function(t,e,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Sl.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),u=this._multiPartFooter();n(i),n(e),n(u),this._trackLength(i,e,r)};Ce.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)+Ce.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&Tn(e,"httpVersion"))&&!(e instanceof JI))&&(r.knownLength||this._valuesToMeasure.push(e))};Ce.prototype._lengthRetriever=function(t,e){Tn(t,"fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):ZI.stat(t.path,function(r,n){if(r){e(r);return}var i=n.size-(t.start?t.start:0);e(null,i)}):Tn(t,"httpVersion")?e(null,Number(t.headers["content-length"])):Tn(t,"httpModule")?(t.on("response",function(r){t.pause(),e(null,Number(r.headers["content-length"]))}),t.resume()):e("Unknown stream")};Ce.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),u="",c={"Content-Disposition":["form-data",'name="'+__(t)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&El(c,r.header);var l;for(var p in c)if(Tn(c,p)){if(l=c[p],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=p+": "+l.join("; ")+Ce.LINE_BREAK)}return"--"+this.getBoundary()+Ce.LINE_BREAK+u+Ce.LINE_BREAK};Ce.prototype._getContentDisposition=function(t,e){var r;if(typeof e.filepath=="string"?r=bl.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t&&(t.name||t.path)?r=bl.basename(e.filename||t&&(t.name||t.path)):t&&t.readable&&Tn(t,"httpVersion")&&(r=bl.basename(t.client._httpMessage.path||"")),r)return'filename="'+__(r)+'"'};Ce.prototype._getContentType=function(t,e){var r=e.contentType;return!r&&t&&t.name&&(r=vl.lookup(t.name)),!r&&t&&t.path&&(r=vl.lookup(t.path)),!r&&t&&t.readable&&Tn(t,"httpVersion")&&(r=t.headers["content-type"]),!r&&(e.filepath||e.filename)&&(r=vl.lookup(e.filepath||e.filename)),!r&&t&&typeof t=="object"&&(r=Ce.DEFAULT_CONTENT_TYPE),r};Ce.prototype._multiPartFooter=function(){return function(t){var e=Ce.LINE_BREAK,r=this._streams.length===0;r&&(e+=this._lastBoundary()),t(e)}.bind(this)};Ce.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Ce.LINE_BREAK};Ce.prototype.getHeaders=function(t){var e,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)Tn(t,e)&&(r[e.toLowerCase()]=t[e]);return r};Ce.prototype.setBoundary=function(t){if(typeof t!="string")throw new TypeError("FormData boundary must be a string");this._boundary=t};Ce.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Ce.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(Ce.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Ce.prototype._generateBoundary=function(){this._boundary="--------------------------"+KI.randomBytes(12).toString("hex")};Ce.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};Ce.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Ce.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}QI.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){t(r);return}n.forEach(function(i){e+=i}),t(null,e)})};Ce.prototype.submit=function(t,e){var r,n,i={method:"post"};return typeof t=="string"?(t=WI(t),n=El({port:t.port,path:t.pathname,host:t.hostname,protocol:t.protocol},i)):(n=El(t,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(t.headers),n.protocol==="https:"?r=GI.request(n):r=HI.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),e){var l,p=o(function(f,m){return r.removeListener("error",p),r.removeListener("response",l),e.call(this,f,m)},"callback");l=p.bind(this,null),r.on("error",p),r.on("response",l)}}.bind(this)),r};Ce.prototype._error=function(t){this.error||(this.error=t,this.pause(),this.emit("error",t))};Ce.prototype.toString=function(){return"[object FormData]"};YI(Ce.prototype,"FormData");b_.exports=Ce});var Pl=M((uW,C_)=>{"use strict";var Ts=Object.prototype.hasOwnProperty,R_=Object.prototype.toString,P_=Object.defineProperty,T_=Object.getOwnPropertyDescriptor,w_=o(function(e){return typeof Array.isArray=="function"?Array.isArray(e):R_.call(e)==="[object Array]"},"isArray"),x_=o(function(e){if(!e||R_.call(e)!=="[object Object]")return!1;var r=Ts.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Ts.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||Ts.call(e,i)},"isPlainObject"),A_=o(function(e,r){P_&&r.name==="__proto__"?P_(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},"setProperty"),I_=o(function(e,r){if(r==="__proto__")if(Ts.call(e,r)){if(T_)return T_(e,r).value}else return;return e[r]},"getProperty");C_.exports=o(function t(){var e,r,n,i,u,c,l=arguments[0],p=1,f=arguments.length,m=!1;for(typeof l=="boolean"&&(m=l,l=arguments[1]||{},p=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});p<f;++p)if(e=arguments[p],e!=null)for(r in e)n=I_(l,r),i=I_(e,r),l!==i&&(m&&i&&(x_(i)||(u=w_(i)))?(u?(u=!1,c=n&&w_(n)?n:[]):c=n&&x_(n)?n:{},A_(l,{name:r,newValue:t(m,c,i)})):typeof i<"u"&&A_(l,{name:r,newValue:i}));return l},"extend")});var O_=M((lW,sR)=>{sR.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 $_=M((dW,k_)=>{"use strict";var uR=O_();k_.exports={pkg:uR}});var xl=M(rr=>{"use strict";var z_=rr&&rr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.GaxiosError=rr.GAXIOS_ERROR_SYMBOL=void 0;rr.defaultErrorRedactor=D_;var N_=z_(Pl()),cR=z_($_()),Tl=cR.default.pkg;rr.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Tl.name}-gaxios-error`);var wl=class t extends Error{static{o(this,"GaxiosError")}config;response;code;status;error;[rr.GAXIOS_ERROR_SYMBOL]=Tl.version;static[Symbol.hasInstance](e){return e&&typeof e=="object"&&rr.GAXIOS_ERROR_SYMBOL in e&&e[rr.GAXIOS_ERROR_SYMBOL]===Tl.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,N_.default)(!0,{},r),this.response&&(this.response.config=(0,N_.default)(!0,{},this.response.config)),this.response){try{this.response.data=lR(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,u="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 l of e.data.error.errors)typeof l=="object"&&"message"in l&&typeof l.message=="string"&&c.push(l.message);return Object.assign({message:c.join(`
|
|
3
|
-
`)||n,code:u,status:i},e.data.error)}return Object.assign({message:n,code:u,status:i},e.data.error)}}return{message:n,code:e.status,status:e.statusText}}};rr.GaxiosError=wl;function lR(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(lR,"translateData");function D_(t){let e="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function r(u){u&&u.forEach((c,l)=>{(/^authentication$/i.test(l)||/^authorization$/i.test(l)||/secret/i.test(l))&&u.set(l,e)})}o(r,"redactHeaders");function n(u,c){if(typeof u=="object"&&u!==null&&typeof u[c]=="string"){let l=u[c];(/grant_type=/i.test(l)||/assertion=/i.test(l)||/secret/i.test(l))&&(u[c]=e)}}o(n,"redactString");function i(u){!u||typeof u!="object"||(u instanceof FormData||u instanceof URLSearchParams||"forEach"in u&&"set"in u?u.forEach((c,l)=>{(["grant_type","assertion"].includes(l)||/secret/.test(l))&&u.set(l,e)}):("grant_type"in u&&(u.grant_type=e),"assertion"in u&&(u.assertion=e),"client_secret"in u&&(u.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&&(D_({config:t.response.config}),r(t.response.headers),t.response.bodyUsed&&(n(t.response,"data"),i(t.response.data))),t}o(D_,"defaultErrorRedactor")});var j_=M(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.getRetryConfig=dR;async function dR(t){let e=U_(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||pR)(t))return{shouldRetry:!1,config:t.config};let i=fR(e);t.config.retryConfig.currentRetryAttempt+=1;let u=e.retryBackoff?e.retryBackoff(t,i):new Promise(c=>{setTimeout(c,i)});return e.onRetryAttempt&&await e.onRetryAttempt(t),await u,{shouldRetry:!0,config:t.config}}o(dR,"getRetryConfig");function pR(t){let e=U_(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 u=t.response.status;if(u>=n&&u<=i){r=!0;break}}if(!r)return!1}return e.currentRetryAttempt=e.currentRetryAttempt||0,!(e.currentRetryAttempt>=e.retry)}o(pR,"shouldRetryRequest");function U_(t){if(t&&t.config&&t.config.retryConfig)return t.config.retryConfig}o(U_,"getConfig");function fR(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(fR,"getNextRetryDelay")});var Rl=M(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});ws.GaxiosInterceptorManager=void 0;var Il=class extends Set{static{o(this,"GaxiosInterceptorManager")}};ws.GaxiosInterceptorManager=Il});var L_=M((_W,M_)=>{var Oo=1e3,ko=Oo*60,$o=ko*60,Hn=$o*24,mR=Hn*7,hR=Hn*365.25;M_.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return gR(t);if(r==="number"&&isFinite(t))return e.long?_R(t):yR(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function gR(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*hR;case"weeks":case"week":case"w":return r*mR;case"days":case"day":case"d":return r*Hn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*$o;case"minutes":case"minute":case"mins":case"min":case"m":return r*ko;case"seconds":case"second":case"secs":case"sec":case"s":return r*Oo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}o(gR,"parse");function yR(t){var e=Math.abs(t);return e>=Hn?Math.round(t/Hn)+"d":e>=$o?Math.round(t/$o)+"h":e>=ko?Math.round(t/ko)+"m":e>=Oo?Math.round(t/Oo)+"s":t+"ms"}o(yR,"fmtShort");function _R(t){var e=Math.abs(t);return e>=Hn?xs(t,e,Hn,"day"):e>=$o?xs(t,e,$o,"hour"):e>=ko?xs(t,e,ko,"minute"):e>=Oo?xs(t,e,Oo,"second"):t+" ms"}o(_R,"fmtLong");function xs(t,e,r,n){var i=e>=r*1.5;return Math.round(t/r)+" "+n+(i?"s":"")}o(xs,"plural")});var Cl=M((vW,F_)=>{function bR(t){r.debug=r,r.default=r,r.coerce=p,r.disable=c,r.enable=i,r.enabled=l,r.humanize=L_(),r.destroy=f,Object.keys(t).forEach(m=>{r[m]=t[m]}),r.names=[],r.skips=[],r.formatters={};function e(m){let g=0;for(let S=0;S<m.length;S++)g=(g<<5)-g+m.charCodeAt(S),g|=0;return r.colors[Math.abs(g)%r.colors.length]}o(e,"selectColor"),r.selectColor=e;function r(m){let g,S=null,h,_;function T(...E){if(!T.enabled)return;let w=T,k=Number(new Date),q=k-(g||k);w.diff=q,w.prev=g,w.curr=k,g=k,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let G=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(H,J)=>{if(H==="%%")return"%";G++;let re=r.formatters[J];if(typeof re=="function"){let Z=E[G];H=re.call(w,Z),E.splice(G,1),G--}return H}),r.formatArgs.call(w,E),(w.log||r.log).apply(w,E)}return o(T,"debug"),T.namespace=m,T.useColors=r.useColors(),T.color=r.selectColor(m),T.extend=n,T.destroy=r.destroy,Object.defineProperty(T,"enabled",{enumerable:!0,configurable:!1,get:o(()=>S!==null?S:(h!==r.namespaces&&(h=r.namespaces,_=r.enabled(m)),_),"get"),set:o(E=>{S=E},"set")}),typeof r.init=="function"&&r.init(T),T}o(r,"createDebug");function n(m,g){let S=r(this.namespace+(typeof g>"u"?":":g)+m);return S.log=this.log,S}o(n,"extend");function i(m){r.save(m),r.namespaces=m,r.names=[],r.skips=[];let g=(typeof m=="string"?m:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of g)S[0]==="-"?r.skips.push(S.slice(1)):r.names.push(S)}o(i,"enable");function u(m,g){let S=0,h=0,_=-1,T=0;for(;S<m.length;)if(h<g.length&&(g[h]===m[S]||g[h]==="*"))g[h]==="*"?(_=h,T=S,h++):(S++,h++);else if(_!==-1)h=_+1,T++,S=T;else return!1;for(;h<g.length&&g[h]==="*";)h++;return h===g.length}o(u,"matchesTemplate");function c(){let m=[...r.names,...r.skips.map(g=>"-"+g)].join(",");return r.enable(""),m}o(c,"disable");function l(m){for(let g of r.skips)if(u(m,g))return!1;for(let g of r.names)if(u(m,g))return!0;return!1}o(l,"enabled");function p(m){return m instanceof Error?m.stack||m.message:m}o(p,"coerce");function f(){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(f,"destroy"),r.enable(r.load()),r}o(bR,"setup");F_.exports=bR});var B_=M((kt,As)=>{kt.formatArgs=ER;kt.save=SR;kt.load=PR;kt.useColors=vR;kt.storage=TR();kt.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`."))}})();kt.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 vR(){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(vR,"useColors");function ER(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+As.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(ER,"formatArgs");kt.log=console.debug||console.log||(()=>{});function SR(t){try{t?kt.storage.setItem("debug",t):kt.storage.removeItem("debug")}catch{}}o(SR,"save");function PR(){let t;try{t=kt.storage.getItem("debug")||kt.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}o(PR,"load");function TR(){try{return localStorage}catch{}}o(TR,"localstorage");As.exports=Cl()(kt);var{formatters:wR}=As.exports;wR.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var V_=M((PW,q_)=>{"use strict";q_.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 W_=M((TW,G_)=>{"use strict";var xR=require("os"),H_=require("tty"),nr=V_(),{env:dt}=process,wn;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?wn=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&(wn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?wn=1:dt.FORCE_COLOR==="false"?wn=0:wn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function Ol(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}o(Ol,"translateLevel");function kl(t,e){if(wn===0)return 0;if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2;if(t&&!e&&wn===void 0)return 0;let r=wn||0;if(dt.TERM==="dumb")return r;if(process.platform==="win32"){let n=xR.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:r}o(kl,"supportsColor");function AR(t){let e=kl(t,t&&t.isTTY);return Ol(e)}o(AR,"getSupportLevel");G_.exports={supportsColor:AR,stdout:Ol(kl(!0,H_.isatty(1))),stderr:Ol(kl(!0,H_.isatty(2)))}});var J_=M((pt,Rs)=>{var IR=require("tty"),Is=require("util");pt.init=zR;pt.log=kR;pt.formatArgs=CR;pt.save=$R;pt.load=NR;pt.useColors=RR;pt.destroy=Is.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");pt.colors=[6,2,3,4,5,1];try{let t=W_();t&&(t.stderr||t).level>=2&&(pt.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{}pt.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,u)=>u.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 RR(){return"colors"in pt.inspectOpts?!!pt.inspectOpts.colors:IR.isatty(process.stderr.fd)}o(RR,"useColors");function CR(t){let{namespace:e,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),u=` ${i};1m${e} \x1B[0m`;t[0]=u+t[0].split(`
|
|
1
|
+
"use strict";var D$=Object.create;var Za=Object.defineProperty;var U$=Object.getOwnPropertyDescriptor;var j$=Object.getOwnPropertyNames;var M$=Object.getPrototypeOf,L$=Object.prototype.hasOwnProperty;var a=(e,t)=>Za(e,"name",{value:t,configurable:!0});var _t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var B=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},ar=(e,t)=>{for(var n in t)Za(e,n,{get:t[n],enumerable:!0})},WS=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of j$(t))!L$.call(e,r)&&r!==n&&Za(e,r,{get:()=>t[r],enumerable:!(o=U$(t,r))||o.enumerable});return e};var It=(e,t,n)=>(n=e!=null?D$(M$(e)):{},WS(t||!e||!e.__esModule?Za(n,"default",{value:e,enumerable:!0}):n,e)),F$=e=>WS(Za({},"__esModule",{value:!0}),e);var sx=B((ax,Zd)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",n={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},o=new RegExp("^0[0-7]+$","i"),r=new RegExp("^0x[a-f0-9]+$","i"),i="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",u={zoneIndex:new RegExp(i,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${i})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${i})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${i})?$`,"i")};function d(h,_){if(h.indexOf("::")!==h.lastIndexOf("::"))return null;let P=0,x=-1,S=(h.match(u.zoneIndex)||[])[0],$,V;for(S&&(S=S.substring(1),h=h.replace(/%.+$/,""));(x=h.indexOf(":",x+1))>=0;)P++;if(h.substr(0,2)==="::"&&P--,h.substr(-2,2)==="::"&&P--,P>_)return null;for(V=_-P,$=":";V--;)$+="0:";return h=h.replace("::",$),h[0]===":"&&(h=h.slice(1)),h[h.length-1]===":"&&(h=h.slice(0,-1)),_=(function(){let W=h.split(":"),Z=[];for(let G=0;G<W.length;G++)Z.push(parseInt(W[G],16));return Z})(),{parts:_,zoneId:S}}a(d,"expandIPv6");function p(h,_,P,x){if(h.length!==_.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let S=0,$;for(;x>0;){if($=P-x,$<0&&($=0),h[S]>>$!==_[S]>>$)return!1;x-=P,S+=1}return!0}a(p,"matchCIDR");function f(h){if(r.test(h))return parseInt(h,16);if(h[0]==="0"&&!isNaN(parseInt(h[1],10))){if(o.test(h))return parseInt(h,8);throw new Error(`ipaddr: cannot parse ${h} as octal`)}return parseInt(h,10)}a(f,"parseIntAuto");function g(h,_){for(;h.length<_;)h=`0${h}`;return h}a(g,"padPart");let y={};y.IPv4=(function(){function h(_){if(_.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let P,x;for(P=0;P<_.length;P++)if(x=_[P],!(0<=x&&x<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=_}return a(h,"IPv4"),h.prototype.SpecialRanges={unspecified:[[new h([0,0,0,0]),8]],broadcast:[[new h([255,255,255,255]),32]],multicast:[[new h([224,0,0,0]),4]],linkLocal:[[new h([169,254,0,0]),16]],loopback:[[new h([127,0,0,0]),8]],carrierGradeNat:[[new h([100,64,0,0]),10]],private:[[new h([10,0,0,0]),8],[new h([172,16,0,0]),12],[new h([192,168,0,0]),16]],reserved:[[new h([192,0,0,0]),24],[new h([192,0,2,0]),24],[new h([192,88,99,0]),24],[new h([198,18,0,0]),15],[new h([198,51,100,0]),24],[new h([203,0,113,0]),24],[new h([240,0,0,0]),4]],as112:[[new h([192,175,48,0]),24],[new h([192,31,196,0]),24]],amt:[[new h([192,52,193,0]),24]]},h.prototype.kind=function(){return"ipv4"},h.prototype.match=function(_,P){let x;if(P===void 0&&(x=_,_=x[0],P=x[1]),_.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return p(this.octets,_.octets,8,P)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,P=!1,x={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},S,$,V;for(S=3;S>=0;S-=1)if($=this.octets[S],$ in x){if(V=x[$],P&&V!==0)return null;V!==8&&(P=!0),_+=V}else return null;return 32-_},h.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){return this.octets.slice(0)},h.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},h.prototype.toNormalizedString=function(){return this.toString()},h.prototype.toString=function(){return this.octets.join(".")},h})(),y.IPv4.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),P=_[0].toByteArray(),x=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],$=0;for(;$<4;)S.push(parseInt(P[$],10)|parseInt(x[$],10)^255),$++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(h){return this.parser(h)!==null},y.IPv4.isValid=function(h){try{return new this(this.parser(h)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(h){try{return this.parseCIDR(h),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(h){return!!(y.IPv4.isValid(h)&&h.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(h){let _=h.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(h)||!_?!1:y.IPv4.isValidFourPartDecimal(_[1])},y.IPv4.networkAddressFromCIDR=function(h){let _,P,x,S,$;try{for(_=this.parseCIDR(h),x=_[0].toByteArray(),$=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],P=0;P<4;)S.push(parseInt(x[P],10)&parseInt($[P],10)),P++;return new this(S)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(h){let _=this.parser(h);if(_===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(_)},y.IPv4.parseCIDR=function(h){let _;if(_=h.match(/^(.+)\/(\d+)$/)){let P=parseInt(_[2]);if(P>=0&&P<=32){let x=[this.parse(_[1]),P];return Object.defineProperty(x,"toString",{value:a(function(){return this.join("/")},"value")}),x}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(h){let _,P,x;if(_=h.match(n.fourOctet))return(function(){let S=_.slice(1,6),$=[];for(let V=0;V<S.length;V++)P=S[V],$.push(f(P));return $})();if(_=h.match(n.longValue)){if(x=f(_[1]),x>4294967295||x<0)throw new Error("ipaddr: address outside defined range");return(function(){let S=[],$;for($=0;$<=24;$+=8)S.push(x>>$&255);return S})().reverse()}else return(_=h.match(n.twoOctet))?(function(){let S=_.slice(1,4),$=[];if(x=f(S[1]),x>16777215||x<0)throw new Error("ipaddr: address outside defined range");return $.push(f(S[0])),$.push(x>>16&255),$.push(x>>8&255),$.push(x&255),$})():(_=h.match(n.threeOctet))?(function(){let S=_.slice(1,5),$=[];if(x=f(S[2]),x>65535||x<0)throw new Error("ipaddr: address outside defined range");return $.push(f(S[0])),$.push(f(S[1])),$.push(x>>8&255),$.push(x&255),$})():null},y.IPv4.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>32)throw new Error("ipaddr: invalid IPv4 prefix length");let _=[0,0,0,0],P=0,x=Math.floor(h/8);for(;P<x;)_[P]=255,P++;return x<4&&(_[x]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},y.IPv6=(function(){function h(_,P){let x,S;if(_.length===16)for(this.parts=[],x=0;x<=14;x+=2)this.parts.push(_[x]<<8|_[x+1]);else if(_.length===8)this.parts=_;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(x=0;x<this.parts.length;x++)if(S=this.parts[x],!(0<=S&&S<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");P&&(this.zoneId=P)}return a(h,"IPv6"),h.prototype.SpecialRanges={unspecified:[new h([0,0,0,0,0,0,0,0]),128],linkLocal:[new h([65152,0,0,0,0,0,0,0]),10],multicast:[new h([65280,0,0,0,0,0,0,0]),8],loopback:[new h([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new h([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new h([0,0,0,0,0,65535,0,0]),96],discard:[new h([256,0,0,0,0,0,0,0]),64],rfc6145:[new h([0,0,0,0,65535,0,0,0]),96],rfc6052:[new h([100,65435,0,0,0,0,0,0]),96],"6to4":[new h([8194,0,0,0,0,0,0,0]),16],teredo:[new h([8193,0,0,0,0,0,0,0]),32],benchmarking:[new h([8193,2,0,0,0,0,0,0]),48],amt:[new h([8193,3,0,0,0,0,0,0]),32],as112v6:[[new h([8193,4,274,0,0,0,0,0]),48],[new h([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new h([8193,16,0,0,0,0,0,0]),28],orchid2:[new h([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new h([8193,48,0,0,0,0,0,0]),28],reserved:[[new h([8193,0,0,0,0,0,0,0]),23],[new h([8193,3512,0,0,0,0,0,0]),32]]},h.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},h.prototype.kind=function(){return"ipv6"},h.prototype.match=function(_,P){let x;if(P===void 0&&(x=_,_=x[0],P=x[1]),_.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return p(this.parts,_.parts,16,P)},h.prototype.prefixLengthFromSubnetMask=function(){let _=0,P=!1,x={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},S,$;for(let V=7;V>=0;V-=1)if(S=this.parts[V],S in x){if($=x[S],P&&$!==0)return null;$!==16&&(P=!0),_+=$}else return null;return 128-_},h.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},h.prototype.toByteArray=function(){let _,P=[],x=this.parts;for(let S=0;S<x.length;S++)_=x[S],P.push(_>>8),P.push(_&255);return P},h.prototype.toFixedLengthString=function(){let _=(function(){let x=[];for(let S=0;S<this.parts.length;S++)x.push(g(this.parts[S].toString(16),4));return x}).call(this).join(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),_+P},h.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let _=this.parts.slice(-2),P=_[0],x=_[1];return new y.IPv4([P>>8,P&255,x>>8,x&255])},h.prototype.toNormalizedString=function(){let _=(function(){let x=[];for(let S=0;S<this.parts.length;S++)x.push(this.parts[S].toString(16));return x}).call(this).join(":"),P="";return this.zoneId&&(P=`%${this.zoneId}`),_+P},h.prototype.toRFC5952String=function(){let _=/((^|:)(0(:|$)){2,})/g,P=this.toNormalizedString(),x=0,S=-1,$;for(;$=_.exec(P);)$[0].length>S&&(x=$.index,S=$[0].length);return S<0?P:`${P.substring(0,x)}::${P.substring(x+S)}`},h.prototype.toString=function(){return this.toRFC5952String()},h})(),y.IPv6.broadcastAddressFromCIDR=function(h){try{let _=this.parseCIDR(h),P=_[0].toByteArray(),x=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],$=0;for(;$<16;)S.push(parseInt(P[$],10)|parseInt(x[$],10)^255),$++;return new this(S)}catch(_){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${_})`)}},y.IPv6.isIPv6=function(h){return this.parser(h)!==null},y.IPv6.isValid=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{let _=this.parser(h);return new this(_.parts,_.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(h){if(typeof h=="string"&&h.indexOf(":")===-1)return!1;try{return this.parseCIDR(h),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(h){let _,P,x,S,$;try{for(_=this.parseCIDR(h),x=_[0].toByteArray(),$=this.subnetMaskFromPrefixLength(_[1]).toByteArray(),S=[],P=0;P<16;)S.push(parseInt(x[P],10)&parseInt($[P],10)),P++;return new this(S)}catch(V){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${V})`)}},y.IPv6.parse=function(h){let _=this.parser(h);if(_.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(_.parts,_.zoneId)},y.IPv6.parseCIDR=function(h){let _,P,x;if((P=h.match(/^(.+)\/(\d+)$/))&&(_=parseInt(P[2]),_>=0&&_<=128))return x=[this.parse(P[1]),_],Object.defineProperty(x,"toString",{value:a(function(){return this.join("/")},"value")}),x;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(h){let _,P,x,S,$,V;if(x=h.match(u.deprecatedTransitional))return this.parser(`::ffff:${x[1]}`);if(u.native.test(h))return d(h,8);if((x=h.match(u.transitional))&&(V=x[6]||"",_=x[1],x[1].endsWith("::")||(_=_.slice(0,-1)),_=d(_+V,6),_.parts)){for($=[parseInt(x[2]),parseInt(x[3]),parseInt(x[4]),parseInt(x[5])],P=0;P<$.length;P++)if(S=$[P],!(0<=S&&S<=255))return null;return _.parts.push($[0]<<8|$[1]),_.parts.push($[2]<<8|$[3]),{parts:_.parts,zoneId:_.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(h){if(h=parseInt(h),h<0||h>128)throw new Error("ipaddr: invalid IPv6 prefix length");let _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],P=0,x=Math.floor(h/8);for(;P<x;)_[P]=255,P++;return x<16&&(_[x]=Math.pow(2,h%8)-1<<8-h%8),new this(_)},y.fromByteArray=function(h){let _=h.length;if(_===4)return new y.IPv4(h);if(_===16)return new y.IPv6(h);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(h){return y.IPv6.isValid(h)||y.IPv4.isValid(h)},y.isValidCIDR=function(h){return y.IPv6.isValidCIDR(h)||y.IPv4.isValidCIDR(h)},y.parse=function(h){if(y.IPv6.isValid(h))return y.IPv6.parse(h);if(y.IPv4.isValid(h))return y.IPv4.parse(h);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(h){try{return y.IPv6.parseCIDR(h)}catch{try{return y.IPv4.parseCIDR(h)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(h){let _=this.parse(h);return _.kind()==="ipv6"&&_.isIPv4MappedAddress()?_.toIPv4Address():_},y.subnetMatch=function(h,_,P){let x,S,$,V;P==null&&(P="unicast");for(S in _)if(Object.prototype.hasOwnProperty.call(_,S)){for($=_[S],$[0]&&!($[0]instanceof Array)&&($=[$]),x=0;x<$.length;x++)if(V=$[x],h.kind()===V[0].kind()&&h.match.apply(h,V))return S}return P},typeof Zd<"u"&&Zd.exports?Zd.exports=y:e.ipaddr=y})(ax)});var Rw=B((y8,Iw)=>{var Aw=require("stream").Stream,Cj=require("util");Iw.exports=qr;function qr(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}a(qr,"DelayedStream");Cj.inherits(qr,Aw);qr.create=function(e,t){var n=new this;t=t||{};for(var o in t)n[o]=t[o];n.source=e;var r=e.emit;return e.emit=function(){return n._handleEmit(arguments),r.apply(e,arguments)},e.on("error",function(){}),n.pauseStream&&e.pause(),n};Object.defineProperty(qr.prototype,"readable",{configurable:!0,enumerable:!0,get:a(function(){return this.source.readable},"get")});qr.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};qr.prototype.resume=function(){this._released||this.release(),this.source.resume()};qr.prototype.pause=function(){this.source.pause()};qr.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};qr.prototype.pipe=function(){var e=Aw.prototype.pipe.apply(this,arguments);return this.resume(),e};qr.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};qr.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var $w=B((b8,Cw)=>{var $j=require("util"),kw=require("stream").Stream,Ow=Rw();Cw.exports=st;function st(){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}a(st,"CombinedStream");$j.inherits(st,kw);st.create=function(e){var t=new this;e=e||{};for(var n in e)t[n]=e[n];return t};st.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};st.prototype.append=function(e){var t=st.isStreamLike(e);if(t){if(!(e instanceof Ow)){var n=Ow.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=n}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};st.prototype.pipe=function(e,t){return kw.prototype.pipe.call(this,e,t),this.resume(),e};st.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}};st.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(n){var o=st.isStreamLike(n);o&&(n.on("data",this._checkDataSize.bind(this)),this._handleErrors(n)),this._pipeNext(n)}.bind(this))};st.prototype._pipeNext=function(e){this._currentStream=e;var t=st.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var n=e;this.write(n),this._getNext()};st.prototype._handleErrors=function(e){var t=this;e.on("error",function(n){t._emitError(n)})};st.prototype.write=function(e){this.emit("data",e)};st.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};st.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")};st.prototype.end=function(){this._reset(),this.emit("end")};st.prototype.destroy=function(){this._reset(),this.emit("close")};st.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};st.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};st.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};st.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Nw=B((E8,zw)=>{"use strict";zw.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 jw=B(Xt=>{"use strict";var Cp=Nw(),zj=require("path").extname,Dw=/^\s*([^;\s]*)(?:;|\s|$)/,Nj=/^text\//i;Xt.charset=Uw;Xt.charsets={lookup:Uw};Xt.contentType=Dj;Xt.extension=Uj;Xt.extensions=Object.create(null);Xt.lookup=jj;Xt.types=Object.create(null);Mj(Xt.extensions,Xt.types);function Uw(e){if(!e||typeof e!="string")return!1;var t=Dw.exec(e),n=t&&Cp[t[1].toLowerCase()];return n&&n.charset?n.charset:t&&Nj.test(t[1])?"UTF-8":!1}a(Uw,"charset");function Dj(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Xt.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var n=Xt.charset(t);n&&(t+="; charset="+n.toLowerCase())}return t}a(Dj,"contentType");function Uj(e){if(!e||typeof e!="string")return!1;var t=Dw.exec(e),n=t&&Xt.extensions[t[1].toLowerCase()];return!n||!n.length?!1:n[0]}a(Uj,"extension");function jj(e){if(!e||typeof e!="string")return!1;var t=zj("x."+e).toLowerCase().substr(1);return t&&Xt.types[t]||!1}a(jj,"lookup");function Mj(e,t){var n=["nginx","apache",void 0,"iana"];Object.keys(Cp).forEach(a(function(r){var i=Cp[r],s=i.extensions;if(!(!s||!s.length)){e[r]=s;for(var u=0;u<s.length;u++){var d=s[u];if(t[d]){var p=n.indexOf(Cp[t[d]].source),f=n.indexOf(i.source);if(t[d]!=="application/octet-stream"&&(p>f||p===f&&t[d].substr(0,12)==="application/"))continue}t[d]=r}}},"forEachMimeType"))}a(Mj,"populateMaps")});var Lw=B((x8,Mw)=>{Mw.exports=Lj;function Lj(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}a(Lj,"defer")});var ob=B((w8,Bw)=>{var Fw=Lw();Bw.exports=Fj;function Fj(e){var t=!1;return Fw(function(){t=!0}),a(function(o,r){t?e(o,r):Fw(a(function(){e(o,r)},"nextTick_callback"))},"async_callback")}a(Fj,"async")});var ib=B((I8,qw)=>{qw.exports=Bj;function Bj(e){Object.keys(e.jobs).forEach(qj.bind(e)),e.jobs={}}a(Bj,"abort");function qj(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}a(qj,"clean")});var ab=B((O8,Zw)=>{var Vw=ob(),Vj=ib();Zw.exports=Zj;function Zj(e,t,n,o){var r=n.keyedList?n.keyedList[n.index]:n.index;n.jobs[r]=Hj(t,r,e[r],function(i,s){r in n.jobs&&(delete n.jobs[r],i?Vj(n):n.results[r]=s,o(i,n.results))})}a(Zj,"iterate");function Hj(e,t,n,o){var r;return e.length==2?r=e(n,Vw(o)):r=e(n,t,Vw(o)),r}a(Hj,"runJob")});var sb=B((C8,Hw)=>{Hw.exports=Gj;function Gj(e,t){var n=!Array.isArray(e),o={index:0,keyedList:n||t?Object.keys(e):null,jobs:{},results:n?{}:[],size:n?Object.keys(e).length:e.length};return t&&o.keyedList.sort(n?t:function(r,i){return t(e[r],e[i])}),o}a(Gj,"state")});var cb=B((z8,Gw)=>{var Wj=ib(),Jj=ob();Gw.exports=Kj;function Kj(e){Object.keys(this.jobs).length&&(this.index=this.size,Wj(this),Jj(e)(null,this.results))}a(Kj,"terminator")});var Jw=B((D8,Ww)=>{var Xj=ab(),Qj=sb(),Yj=cb();Ww.exports=eM;function eM(e,t,n){for(var o=Qj(e);o.index<(o.keyedList||e).length;)Xj(e,t,o,function(r,i){if(r){n(r,i);return}if(Object.keys(o.jobs).length===0){n(null,o.results);return}}),o.index++;return Yj.bind(o,n)}a(eM,"parallel")});var ub=B((j8,$p)=>{var Kw=ab(),tM=sb(),rM=cb();$p.exports=nM;$p.exports.ascending=Xw;$p.exports.descending=oM;function nM(e,t,n,o){var r=tM(e,n);return Kw(e,t,r,a(function i(s,u){if(s){o(s,u);return}if(r.index++,r.index<(r.keyedList||e).length){Kw(e,t,r,i);return}o(null,r.results)},"iteratorHandler")),rM.bind(r,o)}a(nM,"serialOrdered");function Xw(e,t){return e<t?-1:e>t?1:0}a(Xw,"ascending");function oM(e,t){return-1*Xw(e,t)}a(oM,"descending")});var Yw=B((L8,Qw)=>{var iM=ub();Qw.exports=aM;function aM(e,t,n){return iM(e,t,null,n)}a(aM,"serial")});var tA=B((B8,eA)=>{eA.exports={parallel:Jw(),serial:Yw(),serialOrdered:ub()}});var lb=B((q8,rA)=>{"use strict";rA.exports=Object});var oA=B((V8,nA)=>{"use strict";nA.exports=Error});var aA=B((Z8,iA)=>{"use strict";iA.exports=EvalError});var cA=B((H8,sA)=>{"use strict";sA.exports=RangeError});var lA=B((G8,uA)=>{"use strict";uA.exports=ReferenceError});var pA=B((W8,dA)=>{"use strict";dA.exports=SyntaxError});var zp=B((J8,fA)=>{"use strict";fA.exports=TypeError});var hA=B((K8,mA)=>{"use strict";mA.exports=URIError});var yA=B((X8,gA)=>{"use strict";gA.exports=Math.abs});var bA=B((Q8,_A)=>{"use strict";_A.exports=Math.floor});var EA=B((Y8,vA)=>{"use strict";vA.exports=Math.max});var PA=B((e9,SA)=>{"use strict";SA.exports=Math.min});var TA=B((t9,xA)=>{"use strict";xA.exports=Math.pow});var AA=B((r9,wA)=>{"use strict";wA.exports=Math.round});var RA=B((n9,IA)=>{"use strict";IA.exports=Number.isNaN||a(function(t){return t!==t},"isNaN")});var kA=B((i9,OA)=>{"use strict";var sM=RA();OA.exports=a(function(t){return sM(t)||t===0?t:t<0?-1:1},"sign")});var $A=B((s9,CA)=>{"use strict";CA.exports=Object.getOwnPropertyDescriptor});var db=B((c9,zA)=>{"use strict";var Np=$A();if(Np)try{Np([],"length")}catch{Np=null}zA.exports=Np});var DA=B((u9,NA)=>{"use strict";var Dp=Object.defineProperty||!1;if(Dp)try{Dp({},"a",{value:1})}catch{Dp=!1}NA.exports=Dp});var pb=B((l9,UA)=>{"use strict";UA.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),o=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var r=42;t[n]=r;for(var i in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(t,n);if(u.value!==r||u.enumerable!==!0)return!1}return!0},"hasSymbols")});var LA=B((p9,MA)=>{"use strict";var jA=typeof Symbol<"u"&&Symbol,cM=pb();MA.exports=a(function(){return typeof jA!="function"||typeof Symbol!="function"||typeof jA("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:cM()},"hasNativeSymbols")});var fb=B((m9,FA)=>{"use strict";FA.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var mb=B((h9,BA)=>{"use strict";var uM=lb();BA.exports=uM.getPrototypeOf||null});var ZA=B((g9,VA)=>{"use strict";var lM="Function.prototype.bind called on incompatible ",dM=Object.prototype.toString,pM=Math.max,fM="[object Function]",qA=a(function(t,n){for(var o=[],r=0;r<t.length;r+=1)o[r]=t[r];for(var i=0;i<n.length;i+=1)o[i+t.length]=n[i];return o},"concatty"),mM=a(function(t,n){for(var o=[],r=n||0,i=0;r<t.length;r+=1,i+=1)o[i]=t[r];return o},"slicy"),hM=a(function(e,t){for(var n="",o=0;o<e.length;o+=1)n+=e[o],o+1<e.length&&(n+=t);return n},"joiny");VA.exports=a(function(t){var n=this;if(typeof n!="function"||dM.apply(n)!==fM)throw new TypeError(lM+n);for(var o=mM(arguments,1),r,i=a(function(){if(this instanceof r){var f=n.apply(this,qA(o,arguments));return Object(f)===f?f:this}return n.apply(t,qA(o,arguments))},"binder"),s=pM(0,n.length-o.length),u=[],d=0;d<s;d++)u[d]="$"+d;if(r=Function("binder","return function ("+hM(u,",")+"){ return binder.apply(this,arguments); }")(i),n.prototype){var p=a(function(){},"Empty");p.prototype=n.prototype,r.prototype=new p,p.prototype=null}return r},"bind")});var na=B((_9,HA)=>{"use strict";var gM=ZA();HA.exports=Function.prototype.bind||gM});var Up=B((b9,GA)=>{"use strict";GA.exports=Function.prototype.call});var hb=B((v9,WA)=>{"use strict";WA.exports=Function.prototype.apply});var KA=B((E9,JA)=>{"use strict";JA.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var QA=B((S9,XA)=>{"use strict";var yM=na(),_M=hb(),bM=Up(),vM=KA();XA.exports=vM||yM.call(bM,_M)});var eI=B((P9,YA)=>{"use strict";var EM=na(),SM=zp(),PM=Up(),xM=QA();YA.exports=a(function(t){if(t.length<1||typeof t[0]!="function")throw new SM("a function is required");return xM(EM,PM,t)},"callBindBasic")});var aI=B((T9,iI)=>{"use strict";var TM=eI(),tI=db(),nI;try{nI=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var gb=!!nI&&tI&&tI(Object.prototype,"__proto__"),oI=Object,rI=oI.getPrototypeOf;iI.exports=gb&&typeof gb.get=="function"?TM([gb.get]):typeof rI=="function"?a(function(t){return rI(t==null?t:oI(t))},"getDunder"):!1});var dI=B((A9,lI)=>{"use strict";var sI=fb(),cI=mb(),uI=aI();lI.exports=sI?a(function(t){return sI(t)},"getProto"):cI?a(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return cI(t)},"getProto"):uI?a(function(t){return uI(t)},"getProto"):null});var yb=B((R9,pI)=>{"use strict";var wM=Function.prototype.call,AM=Object.prototype.hasOwnProperty,IM=na();pI.exports=IM.call(wM,AM)});var bI=B((O9,_I)=>{"use strict";var Re,RM=lb(),OM=oA(),kM=aA(),CM=cA(),$M=lA(),sa=pA(),aa=zp(),zM=hA(),NM=yA(),DM=bA(),UM=EA(),jM=PA(),MM=TA(),LM=AA(),FM=kA(),gI=Function,_b=a(function(e){try{return gI('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Uc=db(),BM=DA(),bb=a(function(){throw new aa},"throwTypeError"),qM=Uc?(function(){try{return arguments.callee,bb}catch{try{return Uc(arguments,"callee").get}catch{return bb}}})():bb,oa=LA()(),St=dI(),VM=mb(),ZM=fb(),yI=hb(),jc=Up(),ia={},HM=typeof Uint8Array>"u"||!St?Re:St(Uint8Array),Wo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Re:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Re:ArrayBuffer,"%ArrayIteratorPrototype%":oa&&St?St([][Symbol.iterator]()):Re,"%AsyncFromSyncIteratorPrototype%":Re,"%AsyncFunction%":ia,"%AsyncGenerator%":ia,"%AsyncGeneratorFunction%":ia,"%AsyncIteratorPrototype%":ia,"%Atomics%":typeof Atomics>"u"?Re:Atomics,"%BigInt%":typeof BigInt>"u"?Re:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Re:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Re:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Re:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":OM,"%eval%":eval,"%EvalError%":kM,"%Float16Array%":typeof Float16Array>"u"?Re:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Re:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Re:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Re:FinalizationRegistry,"%Function%":gI,"%GeneratorFunction%":ia,"%Int8Array%":typeof Int8Array>"u"?Re:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Re:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Re:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":oa&&St?St(St([][Symbol.iterator]())):Re,"%JSON%":typeof JSON=="object"?JSON:Re,"%Map%":typeof Map>"u"?Re:Map,"%MapIteratorPrototype%":typeof Map>"u"||!oa||!St?Re:St(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":RM,"%Object.getOwnPropertyDescriptor%":Uc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Re:Promise,"%Proxy%":typeof Proxy>"u"?Re:Proxy,"%RangeError%":CM,"%ReferenceError%":$M,"%Reflect%":typeof Reflect>"u"?Re:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Re:Set,"%SetIteratorPrototype%":typeof Set>"u"||!oa||!St?Re:St(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Re:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":oa&&St?St(""[Symbol.iterator]()):Re,"%Symbol%":oa?Symbol:Re,"%SyntaxError%":sa,"%ThrowTypeError%":qM,"%TypedArray%":HM,"%TypeError%":aa,"%Uint8Array%":typeof Uint8Array>"u"?Re:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Re:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Re:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Re:Uint32Array,"%URIError%":zM,"%WeakMap%":typeof WeakMap>"u"?Re:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Re:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Re:WeakSet,"%Function.prototype.call%":jc,"%Function.prototype.apply%":yI,"%Object.defineProperty%":BM,"%Object.getPrototypeOf%":VM,"%Math.abs%":NM,"%Math.floor%":DM,"%Math.max%":UM,"%Math.min%":jM,"%Math.pow%":MM,"%Math.round%":LM,"%Math.sign%":FM,"%Reflect.getPrototypeOf%":ZM};if(St)try{null.error}catch(e){fI=St(St(e)),Wo["%Error.prototype%"]=fI}var fI,GM=a(function e(t){var n;if(t==="%AsyncFunction%")n=_b("async function () {}");else if(t==="%GeneratorFunction%")n=_b("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=_b("async function* () {}");else if(t==="%AsyncGenerator%"){var o=e("%AsyncGeneratorFunction%");o&&(n=o.prototype)}else if(t==="%AsyncIteratorPrototype%"){var r=e("%AsyncGenerator%");r&&St&&(n=St(r.prototype))}return Wo[t]=n,n},"doEval"),mI={__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"]},Mc=na(),jp=yb(),WM=Mc.call(jc,Array.prototype.concat),JM=Mc.call(yI,Array.prototype.splice),hI=Mc.call(jc,String.prototype.replace),Mp=Mc.call(jc,String.prototype.slice),KM=Mc.call(jc,RegExp.prototype.exec),XM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,QM=/\\(\\)?/g,YM=a(function(t){var n=Mp(t,0,1),o=Mp(t,-1);if(n==="%"&&o!=="%")throw new sa("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&n!=="%")throw new sa("invalid intrinsic syntax, expected opening `%`");var r=[];return hI(t,XM,function(i,s,u,d){r[r.length]=u?hI(d,QM,"$1"):s||i}),r},"stringToPath"),eL=a(function(t,n){var o=t,r;if(jp(mI,o)&&(r=mI[o],o="%"+r[0]+"%"),jp(Wo,o)){var i=Wo[o];if(i===ia&&(i=GM(o)),typeof i>"u"&&!n)throw new aa("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:o,value:i}}throw new sa("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_I.exports=a(function(t,n){if(typeof t!="string"||t.length===0)throw new aa("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new aa('"allowMissing" argument must be a boolean');if(KM(/^%?[^%]*%?$/,t)===null)throw new sa("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=YM(t),r=o.length>0?o[0]:"",i=eL("%"+r+"%",n),s=i.name,u=i.value,d=!1,p=i.alias;p&&(r=p[0],JM(o,WM([0,1],p)));for(var f=1,g=!0;f<o.length;f+=1){var y=o[f],h=Mp(y,0,1),_=Mp(y,-1);if((h==='"'||h==="'"||h==="`"||_==='"'||_==="'"||_==="`")&&h!==_)throw new sa("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(d=!0),r+="."+y,s="%"+r+"%",jp(Wo,s))u=Wo[s];else if(u!=null){if(!(y in u)){if(!n)throw new aa("base intrinsic for "+t+" exists, but the property is not available.");return}if(Uc&&f+1>=o.length){var P=Uc(u,y);g=!!P,g&&"get"in P&&!("originalValue"in P.get)?u=P.get:u=u[y]}else g=jp(u,y),u=u[y];g&&!d&&(Wo[s]=u)}}return u},"GetIntrinsic")});var EI=B((C9,vI)=>{"use strict";var tL=pb();vI.exports=a(function(){return tL()&&!!Symbol.toStringTag},"hasToStringTagShams")});var xI=B((z9,PI)=>{"use strict";var rL=bI(),SI=rL("%Object.defineProperty%",!0),nL=EI()(),oL=yb(),iL=zp(),Lp=nL?Symbol.toStringTag:null;PI.exports=a(function(t,n){var o=arguments.length>2&&!!arguments[2]&&arguments[2].force,r=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof o<"u"&&typeof o!="boolean"||typeof r<"u"&&typeof r!="boolean")throw new iL("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Lp&&(o||!oL(t,Lp))&&(SI?SI(t,Lp,{configurable:!r,enumerable:!1,value:n,writable:!1}):t[Lp]=n)},"setToStringTag")});var wI=B((D9,TI)=>{"use strict";var aL=Function.prototype.call,sL=Object.prototype.hasOwnProperty,cL=na();TI.exports=cL.call(aL,sL)});var II=B((U9,AI)=>{"use strict";AI.exports=function(e,t){return Object.keys(t).forEach(function(n){e[n]=e[n]||t[n]}),e}});var kI=B((j9,OI)=>{"use strict";var Pb=$w(),uL=require("util"),vb=require("path"),lL=require("http"),dL=require("https"),pL=require("url").parse,fL=require("fs"),mL=require("stream").Stream,hL=require("crypto"),Eb=jw(),gL=tA(),yL=xI(),co=wI(),Sb=II();function RI(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}a(RI,"escapeHeaderParam");function De(e){if(!(this instanceof De))return new De(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Pb.call(this),e=e||{};for(var t in e)this[t]=e[t]}a(De,"FormData");uL.inherits(De,Pb);De.LINE_BREAK=`\r
|
|
2
|
+
`;De.DEFAULT_CONTENT_TYPE="application/octet-stream";De.prototype.append=function(e,t,n){n=n||{},typeof n=="string"&&(n={filename:n});var o=Pb.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(e,t,n),i=this._multiPartFooter();o(r),o(t),o(i),this._trackLength(r,t,n)};De.prototype._trackLength=function(e,t,n){var o=0;n.knownLength!=null?o+=Number(n.knownLength):Buffer.isBuffer(t)?o=t.length:typeof t=="string"&&(o=Buffer.byteLength(t)),this._valueLength+=o,this._overheadLength+=Buffer.byteLength(e)+De.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&co(t,"httpVersion"))&&!(t instanceof mL))&&(n.knownLength||this._valuesToMeasure.push(t))};De.prototype._lengthRetriever=function(e,t){co(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):fL.stat(e.path,function(n,o){if(n){t(n);return}var r=o.size-(e.start?e.start:0);t(null,r)}):co(e,"httpVersion")?t(null,Number(e.headers["content-length"])):co(e,"httpModule")?(e.on("response",function(n){e.pause(),t(null,Number(n.headers["content-length"]))}),e.resume()):t("Unknown stream")};De.prototype._multiPartHeader=function(e,t,n){if(typeof n.header=="string")return n.header;var o=this._getContentDisposition(t,n),r=this._getContentType(t,n),i="",s={"Content-Disposition":["form-data",'name="'+RI(e)+'"'].concat(o||[]),"Content-Type":[].concat(r||[])};typeof n.header=="object"&&Sb(s,n.header);var u;for(var d in s)if(co(s,d)){if(u=s[d],u==null)continue;Array.isArray(u)||(u=[u]),u.length&&(i+=d+": "+u.join("; ")+De.LINE_BREAK)}return"--"+this.getBoundary()+De.LINE_BREAK+i+De.LINE_BREAK};De.prototype._getContentDisposition=function(e,t){var n;if(typeof t.filepath=="string"?n=vb.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?n=vb.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&co(e,"httpVersion")&&(n=vb.basename(e.client._httpMessage.path||"")),n)return'filename="'+RI(n)+'"'};De.prototype._getContentType=function(e,t){var n=t.contentType;return!n&&e&&e.name&&(n=Eb.lookup(e.name)),!n&&e&&e.path&&(n=Eb.lookup(e.path)),!n&&e&&e.readable&&co(e,"httpVersion")&&(n=e.headers["content-type"]),!n&&(t.filepath||t.filename)&&(n=Eb.lookup(t.filepath||t.filename)),!n&&e&&typeof e=="object"&&(n=De.DEFAULT_CONTENT_TYPE),n};De.prototype._multiPartFooter=function(){return function(e){var t=De.LINE_BREAK,n=this._streams.length===0;n&&(t+=this._lastBoundary()),e(t)}.bind(this)};De.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+De.LINE_BREAK};De.prototype.getHeaders=function(e){var t,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)co(e,t)&&(n[t.toLowerCase()]=e[t]);return n};De.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};De.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};De.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),n=0,o=this._streams.length;n<o;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?e=Buffer.concat([e,this._streams[n]]):e=Buffer.concat([e,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(De.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};De.prototype._generateBoundary=function(){this._boundary="--------------------------"+hL.randomBytes(12).toString("hex")};De.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};De.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};De.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}gL.parallel(this._valuesToMeasure,this._lengthRetriever,function(n,o){if(n){e(n);return}o.forEach(function(r){t+=r}),e(null,t)})};De.prototype.submit=function(e,t){var n,o,r={method:"post"};return typeof e=="string"?(e=pL(e),o=Sb({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},r)):(o=Sb(e,r),o.port||(o.port=o.protocol==="https:"?443:80)),o.headers=this.getHeaders(e.headers),o.protocol==="https:"?n=dL.request(o):n=lL.request(o),this.getLength(function(i,s){if(i&&i!=="Unknown stream"){this._error(i);return}if(s&&n.setHeader("Content-Length",s),this.pipe(n),t){var u,d=a(function(p,f){return n.removeListener("error",d),n.removeListener("response",u),t.call(this,p,f)},"callback");u=d.bind(this,null),n.on("error",d),n.on("response",u)}}.bind(this)),n};De.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};De.prototype.toString=function(){return"[object FormData]"};yL(De.prototype,"FormData");OI.exports=De});var xb=B((sQ,FI)=>{"use strict";var Fp=Object.prototype.hasOwnProperty,LI=Object.prototype.toString,zI=Object.defineProperty,NI=Object.getOwnPropertyDescriptor,DI=a(function(t){return typeof Array.isArray=="function"?Array.isArray(t):LI.call(t)==="[object Array]"},"isArray"),UI=a(function(t){if(!t||LI.call(t)!=="[object Object]")return!1;var n=Fp.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&Fp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;var r;for(r in t);return typeof r>"u"||Fp.call(t,r)},"isPlainObject"),jI=a(function(t,n){zI&&n.name==="__proto__"?zI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},"setProperty"),MI=a(function(t,n){if(n==="__proto__")if(Fp.call(t,n)){if(NI)return NI(t,n).value}else return;return t[n]},"getProperty");FI.exports=a(function e(){var t,n,o,r,i,s,u=arguments[0],d=1,p=arguments.length,f=!1;for(typeof u=="boolean"&&(f=u,u=arguments[1]||{},d=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});d<p;++d)if(t=arguments[d],t!=null)for(n in t)o=MI(u,n),r=MI(t,n),u!==r&&(f&&r&&(UI(r)||(i=DI(r)))?(i?(i=!1,s=o&&DI(o)?o:[]):s=o&&UI(o)?o:{},jI(u,{name:n,newValue:e(f,s,r)})):typeof r<"u"&&jI(u,{name:n,newValue:r}));return u},"extend")});var BI=B((uQ,wL)=>{wL.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 VI=B((lQ,qI)=>{"use strict";var AL=BI();qI.exports={pkg:AL}});var Ab=B(Ar=>{"use strict";var HI=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.GaxiosError=Ar.GAXIOS_ERROR_SYMBOL=void 0;Ar.defaultErrorRedactor=GI;var ZI=HI(xb()),IL=HI(VI()),Tb=IL.default.pkg;Ar.GAXIOS_ERROR_SYMBOL=Symbol.for(`${Tb.name}-gaxios-error`);var wb=class e extends Error{static{a(this,"GaxiosError")}config;response;code;status;error;[Ar.GAXIOS_ERROR_SYMBOL]=Tb.version;static[Symbol.hasInstance](t){return t&&typeof t=="object"&&Ar.GAXIOS_ERROR_SYMBOL in t&&t[Ar.GAXIOS_ERROR_SYMBOL]===Tb.version?!0:Function.prototype[Symbol.hasInstance].call(e,t)}constructor(t,n,o,r){if(super(t,{cause:r}),this.config=n,this.response=o,this.error=r instanceof Error?r:void 0,this.config=(0,ZI.default)(!0,{},n),this.response&&(this.response.config=(0,ZI.default)(!0,{},this.response.config)),this.response){try{this.response.data=RL(this.config.responseType,this.response?.bodyUsed?this.response?.data:void 0)}catch{}this.status=this.response.status}r instanceof DOMException?this.code=r.name:r&&typeof r=="object"&&"code"in r&&(typeof r.code=="string"||typeof r.code=="number")&&(this.code=r.code)}static extractAPIErrorFromResponse(t,n="The request failed"){let o=n;if(typeof t.data=="string"&&(o=t.data),t.data&&typeof t.data=="object"&&"error"in t.data&&t.data.error&&!t.ok){if(typeof t.data.error=="string")return{message:t.data.error,code:t.status,status:t.statusText};if(typeof t.data.error=="object"){o="message"in t.data.error&&typeof t.data.error.message=="string"?t.data.error.message:o;let r="status"in t.data.error&&typeof t.data.error.status=="string"?t.data.error.status:t.statusText,i="code"in t.data.error&&typeof t.data.error.code=="number"?t.data.error.code:t.status;if("errors"in t.data.error&&Array.isArray(t.data.error.errors)){let s=[];for(let u of t.data.error.errors)typeof u=="object"&&"message"in u&&typeof u.message=="string"&&s.push(u.message);return Object.assign({message:s.join(`
|
|
3
|
+
`)||o,code:i,status:r},t.data.error)}return Object.assign({message:o,code:i,status:r},t.data.error)}}return{message:o,code:t.status,status:t.statusText}}};Ar.GaxiosError=wb;function RL(e,t){switch(e){case"stream":return t;case"json":return JSON.parse(JSON.stringify(t));case"arraybuffer":return JSON.parse(Buffer.from(t).toString("utf8"));case"blob":return JSON.parse(t.text());default:return t}}a(RL,"translateData");function GI(e){let t="<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.";function n(i){i&&i.forEach((s,u)=>{(/^authentication$/i.test(u)||/^authorization$/i.test(u)||/secret/i.test(u))&&i.set(u,t)})}a(n,"redactHeaders");function o(i,s){if(typeof i=="object"&&i!==null&&typeof i[s]=="string"){let u=i[s];(/grant_type=/i.test(u)||/assertion=/i.test(u)||/secret/i.test(u))&&(i[s]=t)}}a(o,"redactString");function r(i){!i||typeof i!="object"||(i instanceof FormData||i instanceof URLSearchParams||"forEach"in i&&"set"in i?i.forEach((s,u)=>{(["grant_type","assertion"].includes(u)||/secret/.test(u))&&i.set(u,t)}):("grant_type"in i&&(i.grant_type=t),"assertion"in i&&(i.assertion=t),"client_secret"in i&&(i.client_secret=t)))}return a(r,"redactObject"),e.config&&(n(e.config.headers),o(e.config,"data"),r(e.config.data),o(e.config,"body"),r(e.config.body),e.config.url.searchParams.has("token")&&e.config.url.searchParams.set("token",t),e.config.url.searchParams.has("client_secret")&&e.config.url.searchParams.set("client_secret",t)),e.response&&(GI({config:e.response.config}),n(e.response.headers),e.response.bodyUsed&&(o(e.response,"data"),r(e.response.data))),e}a(GI,"defaultErrorRedactor")});var JI=B(Ib=>{"use strict";Object.defineProperty(Ib,"__esModule",{value:!0});Ib.getRetryConfig=OL;async function OL(e){let t=WI(e);if(!e||!e.config||!t&&!e.config.retry)return{shouldRetry:!1};t=t||{},t.currentRetryAttempt=t.currentRetryAttempt||0,t.retry=t.retry===void 0||t.retry===null?3:t.retry,t.httpMethodsToRetry=t.httpMethodsToRetry||["GET","HEAD","PUT","OPTIONS","DELETE"],t.noResponseRetries=t.noResponseRetries===void 0||t.noResponseRetries===null?2:t.noResponseRetries,t.retryDelayMultiplier=t.retryDelayMultiplier?t.retryDelayMultiplier:2,t.timeOfFirstRequest=t.timeOfFirstRequest?t.timeOfFirstRequest:Date.now(),t.totalTimeout=t.totalTimeout?t.totalTimeout:Number.MAX_SAFE_INTEGER,t.maxRetryDelay=t.maxRetryDelay?t.maxRetryDelay:Number.MAX_SAFE_INTEGER;let n=[[100,199],[408,408],[429,429],[500,599]];if(t.statusCodesToRetry=t.statusCodesToRetry||n,e.config.retryConfig=t,!await(t.shouldRetry||kL)(e))return{shouldRetry:!1,config:e.config};let r=CL(t);e.config.retryConfig.currentRetryAttempt+=1;let i=t.retryBackoff?t.retryBackoff(e,r):new Promise(s=>{setTimeout(s,r)});return t.onRetryAttempt&&await t.onRetryAttempt(e),await i,{shouldRetry:!0,config:e.config}}a(OL,"getRetryConfig");function kL(e){let t=WI(e);if(e.config.signal?.aborted&&e.code!=="TimeoutError"||e.code==="AbortError"||!t||t.retry===0||!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries||!t.httpMethodsToRetry||!t.httpMethodsToRetry.includes(e.config.method?.toUpperCase()||"GET"))return!1;if(e.response&&e.response.status){let n=!1;for(let[o,r]of t.statusCodesToRetry){let i=e.response.status;if(i>=o&&i<=r){n=!0;break}}if(!n)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)}a(kL,"shouldRetryRequest");function WI(e){if(e&&e.config&&e.config.retryConfig)return e.config.retryConfig}a(WI,"getConfig");function CL(e){let n=(e.currentRetryAttempt?0:e.retryDelay??100)+(Math.pow(e.retryDelayMultiplier,e.currentRetryAttempt)-1)/2*1e3,o=e.totalTimeout-(Date.now()-e.timeOfFirstRequest);return Math.min(n,o,e.maxRetryDelay)}a(CL,"getNextRetryDelay")});var Ob=B(Bp=>{"use strict";Object.defineProperty(Bp,"__esModule",{value:!0});Bp.GaxiosInterceptorManager=void 0;var Rb=class extends Set{static{a(this,"GaxiosInterceptorManager")}};Bp.GaxiosInterceptorManager=Rb});var XI=B((yQ,KI)=>{var ca=1e3,ua=ca*60,la=ua*60,Jo=la*24,$L=Jo*7,zL=Jo*365.25;KI.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return NL(e);if(n==="number"&&isFinite(e))return t.long?UL(e):DL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function NL(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*zL;case"weeks":case"week":case"w":return n*$L;case"days":case"day":case"d":return n*Jo;case"hours":case"hour":case"hrs":case"hr":case"h":return n*la;case"minutes":case"minute":case"mins":case"min":case"m":return n*ua;case"seconds":case"second":case"secs":case"sec":case"s":return n*ca;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}a(NL,"parse");function DL(e){var t=Math.abs(e);return t>=Jo?Math.round(e/Jo)+"d":t>=la?Math.round(e/la)+"h":t>=ua?Math.round(e/ua)+"m":t>=ca?Math.round(e/ca)+"s":e+"ms"}a(DL,"fmtShort");function UL(e){var t=Math.abs(e);return t>=Jo?qp(e,t,Jo,"day"):t>=la?qp(e,t,la,"hour"):t>=ua?qp(e,t,ua,"minute"):t>=ca?qp(e,t,ca,"second"):e+" ms"}a(UL,"fmtLong");function qp(e,t,n,o){var r=t>=n*1.5;return Math.round(e/n)+" "+o+(r?"s":"")}a(qp,"plural")});var kb=B((bQ,QI)=>{function jL(e){n.debug=n,n.default=n,n.coerce=d,n.disable=s,n.enable=r,n.enabled=u,n.humanize=XI(),n.destroy=p,Object.keys(e).forEach(f=>{n[f]=e[f]}),n.names=[],n.skips=[],n.formatters={};function t(f){let g=0;for(let y=0;y<f.length;y++)g=(g<<5)-g+f.charCodeAt(y),g|=0;return n.colors[Math.abs(g)%n.colors.length]}a(t,"selectColor"),n.selectColor=t;function n(f){let g,y=null,h,_;function P(...x){if(!P.enabled)return;let S=P,$=Number(new Date),V=$-(g||$);S.diff=V,S.prev=g,S.curr=$,g=$,x[0]=n.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");let W=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,(G,te)=>{if(G==="%%")return"%";W++;let ce=n.formatters[te];if(typeof ce=="function"){let Y=x[W];G=ce.call(S,Y),x.splice(W,1),W--}return G}),n.formatArgs.call(S,x),(S.log||n.log).apply(S,x)}return a(P,"debug"),P.namespace=f,P.useColors=n.useColors(),P.color=n.selectColor(f),P.extend=o,P.destroy=n.destroy,Object.defineProperty(P,"enabled",{enumerable:!0,configurable:!1,get:a(()=>y!==null?y:(h!==n.namespaces&&(h=n.namespaces,_=n.enabled(f)),_),"get"),set:a(x=>{y=x},"set")}),typeof n.init=="function"&&n.init(P),P}a(n,"createDebug");function o(f,g){let y=n(this.namespace+(typeof g>"u"?":":g)+f);return y.log=this.log,y}a(o,"extend");function r(f){n.save(f),n.namespaces=f,n.names=[],n.skips=[];let g=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of g)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}a(r,"enable");function i(f,g){let y=0,h=0,_=-1,P=0;for(;y<f.length;)if(h<g.length&&(g[h]===f[y]||g[h]==="*"))g[h]==="*"?(_=h,P=y,h++):(y++,h++);else if(_!==-1)h=_+1,P++,y=P;else return!1;for(;h<g.length&&g[h]==="*";)h++;return h===g.length}a(i,"matchesTemplate");function s(){let f=[...n.names,...n.skips.map(g=>"-"+g)].join(",");return n.enable(""),f}a(s,"disable");function u(f){for(let g of n.skips)if(i(f,g))return!1;for(let g of n.names)if(i(f,g))return!0;return!1}a(u,"enabled");function d(f){return f instanceof Error?f.stack||f.message:f}a(d,"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 a(p,"destroy"),n.enable(n.load()),n}a(jL,"setup");QI.exports=jL});var YI=B((Qt,Vp)=>{Qt.formatArgs=LL;Qt.save=FL;Qt.load=BL;Qt.useColors=ML;Qt.storage=qL();Qt.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();Qt.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 ML(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(ML,"useColors");function LL(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Vp.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(n++,r==="%c"&&(o=n))}),e.splice(o,0,t)}a(LL,"formatArgs");Qt.log=console.debug||console.log||(()=>{});function FL(e){try{e?Qt.storage.setItem("debug",e):Qt.storage.removeItem("debug")}catch{}}a(FL,"save");function BL(){let e;try{e=Qt.storage.getItem("debug")||Qt.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}a(BL,"load");function qL(){try{return localStorage}catch{}}a(qL,"localstorage");Vp.exports=kb()(Qt);var{formatters:VL}=Vp.exports;VL.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var tR=B((SQ,eR)=>{"use strict";eR.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",o=t.indexOf(n+e),r=t.indexOf("--");return o!==-1&&(r===-1||o<r)}});var oR=B((PQ,nR)=>{"use strict";var ZL=require("os"),rR=require("tty"),Ir=tR(),{env:Pt}=process,uo;Ir("no-color")||Ir("no-colors")||Ir("color=false")||Ir("color=never")?uo=0:(Ir("color")||Ir("colors")||Ir("color=true")||Ir("color=always"))&&(uo=1);"FORCE_COLOR"in Pt&&(Pt.FORCE_COLOR==="true"?uo=1:Pt.FORCE_COLOR==="false"?uo=0:uo=Pt.FORCE_COLOR.length===0?1:Math.min(parseInt(Pt.FORCE_COLOR,10),3));function Cb(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}a(Cb,"translateLevel");function $b(e,t){if(uo===0)return 0;if(Ir("color=16m")||Ir("color=full")||Ir("color=truecolor"))return 3;if(Ir("color=256"))return 2;if(e&&!t&&uo===void 0)return 0;let n=uo||0;if(Pt.TERM==="dumb")return n;if(process.platform==="win32"){let o=ZL.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in Pt)||Pt.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pt.TEAMCITY_VERSION)?1:0;if(Pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pt){let o=parseInt((Pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pt.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pt.TERM)||"COLORTERM"in Pt?1:n}a($b,"supportsColor");function HL(e){let t=$b(e,e&&e.isTTY);return Cb(t)}a(HL,"getSupportLevel");nR.exports={supportsColor:HL,stdout:Cb($b(!0,rR.isatty(1))),stderr:Cb($b(!0,rR.isatty(2)))}});var aR=B((xt,Hp)=>{var GL=require("tty"),Zp=require("util");xt.init=e1;xt.log=XL;xt.formatArgs=JL;xt.save=QL;xt.load=YL;xt.useColors=WL;xt.destroy=Zp.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");xt.colors=[6,2,3,4,5,1];try{let e=oR();e&&(e.stderr||e).level>=2&&(xt.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{}xt.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(r,i)=>i.toUpperCase()),o=process.env[t];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),e[n]=o,e},{});function WL(){return"colors"in xt.inspectOpts?!!xt.inspectOpts.colors:GL.isatty(process.stderr.fd)}a(WL,"useColors");function JL(e){let{namespace:t,useColors:n}=this;if(n){let o=this.color,r="\x1B[3"+(o<8?o:"8;5;"+o),i=` ${r};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
|
|
4
4
|
`).join(`
|
|
5
|
-
`+
|
|
6
|
-
`)}
|
|
7
|
-
`).map(
|
|
8
|
-
`).some(
|
|
5
|
+
`+i),e.push(r+"m+"+Hp.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=KL()+t+" "+e[0]}a(JL,"formatArgs");function KL(){return xt.inspectOpts.hideDate?"":new Date().toISOString()+" "}a(KL,"getDate");function XL(...e){return process.stderr.write(Zp.formatWithOptions(xt.inspectOpts,...e)+`
|
|
6
|
+
`)}a(XL,"log");function QL(e){e?process.env.DEBUG=e:delete process.env.DEBUG}a(QL,"save");function YL(){return process.env.DEBUG}a(YL,"load");function e1(e){e.inspectOpts={};let t=Object.keys(xt.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=xt.inspectOpts[t[n]]}a(e1,"init");Hp.exports=kb()(xt);var{formatters:iR}=Hp.exports;iR.o=function(e){return this.inspectOpts.colors=this.useColors,Zp.inspect(e,this.inspectOpts).split(`
|
|
7
|
+
`).map(t=>t.trim()).join(" ")};iR.O=function(e){return this.inspectOpts.colors=this.useColors,Zp.inspect(e,this.inspectOpts)}});var Nb=B((wQ,zb)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?zb.exports=YI():zb.exports=aR()});var uR=B(Yt=>{"use strict";var t1=Yt&&Yt.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),r1=Yt&&Yt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),sR=Yt&&Yt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&t1(t,e,n);return r1(t,e),t};Object.defineProperty(Yt,"__esModule",{value:!0});Yt.req=Yt.json=Yt.toBuffer=void 0;var n1=sR(require("http")),o1=sR(require("https"));async function cR(e){let t=0,n=[];for await(let o of e)t+=o.length,n.push(o);return Buffer.concat(n,t)}a(cR,"toBuffer");Yt.toBuffer=cR;async function i1(e){let n=(await cR(e)).toString("utf8");try{return JSON.parse(n)}catch(o){let r=o;throw r.message+=` (input: ${n})`,r}}a(i1,"json");Yt.json=i1;function a1(e,t={}){let o=((typeof e=="string"?e:e.href).startsWith("https:")?o1:n1).request(e,t),r=new Promise((i,s)=>{o.once("response",i).once("error",s).end()});return o.then=r.then.bind(r),o}a(a1,"req");Yt.req=a1});var fR=B(dr=>{"use strict";var dR=dr&&dr.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),s1=dr&&dr.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),pR=dr&&dr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&dR(t,e,n);return s1(t,e),t},c1=dr&&dr.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&dR(t,e,n)};Object.defineProperty(dr,"__esModule",{value:!0});dr.Agent=void 0;var u1=pR(require("net")),lR=pR(require("http")),l1=require("https");c1(uR(),dr);var nn=Symbol("AgentBaseInternalState"),Db=class extends lR.Agent{static{a(this,"Agent")}constructor(t){super(t),this[nn]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
8
|
+
`).some(o=>o.indexOf("(https.js:")!==-1||o.indexOf("node:https:")!==-1)}incrementSockets(t){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[t]||(this.sockets[t]=[]);let n=new u1.Socket({writable:!1});return this.sockets[t].push(n),this.totalSocketCount++,n}decrementSockets(t,n){if(!this.sockets[t]||n===null)return;let o=this.sockets[t],r=o.indexOf(n);r!==-1&&(o.splice(r,1),this.totalSocketCount--,o.length===0&&delete this.sockets[t])}getName(t){return this.isSecureEndpoint(t)?l1.Agent.prototype.getName.call(this,t):super.getName(t)}createSocket(t,n,o){let r={...n,secureEndpoint:this.isSecureEndpoint(n)},i=this.getName(r),s=this.incrementSockets(i);Promise.resolve().then(()=>this.connect(t,r)).then(u=>{if(this.decrementSockets(i,s),u instanceof lR.Agent)try{return u.addRequest(t,r)}catch(d){return o(d)}this[nn].currentSocket=u,super.createSocket(t,n,o)},u=>{this.decrementSockets(i,s),o(u)})}createConnection(){let t=this[nn].currentSocket;if(this[nn].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[nn].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[nn]&&(this[nn].defaultPort=t)}get protocol(){return this[nn].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[nn]&&(this[nn].protocol=t)}};dr.Agent=Db});var mR=B(da=>{"use strict";var d1=da&&da.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(da,"__esModule",{value:!0});da.parseProxyResponse=void 0;var p1=d1(Nb()),Gp=(0,p1.default)("https-proxy-agent:parse-proxy-response");function f1(e){return new Promise((t,n)=>{let o=0,r=[];function i(){let f=e.read();f?p(f):e.once("readable",i)}a(i,"read");function s(){e.removeListener("end",u),e.removeListener("error",d),e.removeListener("readable",i)}a(s,"cleanup");function u(){s(),Gp("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}a(u,"onend");function d(f){s(),Gp("onerror %o",f),n(f)}a(d,"onerror");function p(f){r.push(f),o+=f.length;let g=Buffer.concat(r,o),y=g.indexOf(`\r
|
|
9
9
|
\r
|
|
10
|
-
`);if(
|
|
11
|
-
`),_=h.shift();if(!_)return
|
|
12
|
-
`;if(
|
|
13
|
-
`;let
|
|
14
|
-
`);let{connect:f,buffered:m}=await p;if(e.emit("proxyConnect",f),this.emit("proxyConnect",f,e),f.statusCode===200)return e.once("socket",rC),r.secureEndpoint?(Mi("Upgrading socket connection to TLS"),ob.connect({...ab(ib(r),"host","path","port"),socket:i})):i;i.destroy();let g=new Os.Socket({writable:!1});return g.readable=!0,e.once("socket",S=>{Mi("Replaying proxy buffer for failed request"),(0,QR.default)(S.listenerCount("data")>0),S.push(m),S.push(null)}),g}};ks.protocols=["http","https"];or.HttpsProxyAgent=ks;function rC(t){t.resume()}o(rC,"resume");function ab(t,...e){let r={},n;for(n in t)e.includes(n)||(r[n]=t[n]);return r}o(ab,"omit")});function nC(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,u=r[0]||"text/plain",c=u;for(let m=1;m<r.length;m++)r[m]==="base64"?i=!0:r[m]&&(c+=`;${r[m]}`,r[m].indexOf("charset=")===0&&(n=r[m].substring(8)));!r[0]&&!n.length&&(c+=";charset=US-ASCII",n="US-ASCII");let l=i?"base64":"ascii",p=unescape(t.substring(e+1)),f=Buffer.from(p,l);return f.type=u,f.typeFull=c,f.charset=n,f}var lb,db=ct(()=>{o(nC,"dataUriToBuffer");lb=nC});var fb=M(($s,pb)=>{(function(t,e){typeof $s=="object"&&typeof pb<"u"?e($s):typeof define=="function"&&define.amd?define(["exports"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t.WebStreamsPolyfill={}))})($s,(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,s){try{Object.defineProperty(a,"name",{value:s,configurable:!0})}catch{}}o(i,"setFunctionName");let u=Promise,c=Promise.prototype.then,l=Promise.reject.bind(u);function p(a){return new u(a)}o(p,"newPromise");function f(a){return p(s=>s(a))}o(f,"promiseResolvedWith");function m(a){return l(a)}o(m,"promiseRejectedWith");function g(a,s,d){return c.call(a,s,d)}o(g,"PerformPromiseThen");function S(a,s,d){g(g(a,s,d),void 0,n)}o(S,"uponPromise");function h(a,s){S(a,s)}o(h,"uponFulfillment");function _(a,s){S(a,void 0,s)}o(_,"uponRejection");function T(a,s,d){return g(a,s,d)}o(T,"transformPromiseWith");function E(a){g(a,void 0,n)}o(E,"setPromiseIsHandledToTrue");let w=o(a=>{if(typeof queueMicrotask=="function")w=queueMicrotask;else{let s=f(void 0);w=o(d=>g(s,d),"_queueMicrotask")}return w(a)},"_queueMicrotask");function k(a,s,d){if(typeof a!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(a,s,d)}o(k,"reflectCall");function q(a,s,d){try{return f(k(a,s,d))}catch(v){return m(v)}}o(q,"promiseCall");let G=16384;class V{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(s){let d=this._back,v=d;d._elements.length===G-1&&(v={_elements:[],_next:void 0}),d._elements.push(s),v!==d&&(this._back=v,d._next=v),++this._size}shift(){let s=this._front,d=s,v=this._cursor,A=v+1,U=s._elements,L=U[v];return A===G&&(d=s._next,A=0),--this._size,this._cursor=A,s!==d&&(this._front=d),U[v]=void 0,L}forEach(s){let d=this._cursor,v=this._front,A=v._elements;for(;(d!==A.length||v._next!==void 0)&&!(d===A.length&&(v=v._next,A=v._elements,d=0,A.length===0));)s(A[d]),++d}peek(){let s=this._front,d=this._cursor;return s._elements[d]}}let H=Symbol("[[AbortSteps]]"),J=Symbol("[[ErrorSteps]]"),re=Symbol("[[CancelSteps]]"),Z=Symbol("[[PullSteps]]"),De=Symbol("[[ReleaseSteps]]");function Se(a,s){a._ownerReadableStream=s,s._reader=a,s._state==="readable"?Ve(a):s._state==="closed"?Je(a):He(a,s._storedError)}o(Se,"ReadableStreamReaderGenericInitialize");function be(a,s){let d=a._ownerReadableStream;return dr(d,s)}o(be,"ReadableStreamReaderGenericCancel");function $e(a){let s=a._ownerReadableStream;s._state==="readable"?Ut(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Et(a,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),s._readableStreamController[De](),s._reader=void 0,a._ownerReadableStream=void 0}o($e,"ReadableStreamReaderGenericRelease");function Ie(a){return new TypeError("Cannot "+a+" a stream using a released reader")}o(Ie,"readerLockException");function Ve(a){a._closedPromise=p((s,d)=>{a._closedPromise_resolve=s,a._closedPromise_reject=d})}o(Ve,"defaultReaderClosedPromiseInitialize");function He(a,s){Ve(a),Ut(a,s)}o(He,"defaultReaderClosedPromiseInitializeAsRejected");function Je(a){Ve(a),ro(a)}o(Je,"defaultReaderClosedPromiseInitializeAsResolved");function Ut(a,s){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(s),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(Ut,"defaultReaderClosedPromiseReject");function Et(a,s){He(a,s)}o(Et,"defaultReaderClosedPromiseResetToRejected");function ro(a){a._closedPromise_resolve!==void 0&&(a._closedPromise_resolve(void 0),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0)}o(ro,"defaultReaderClosedPromiseResolve");let wr=Number.isFinite||function(a){return typeof a=="number"&&isFinite(a)},oi=Math.trunc||function(a){return a<0?Math.ceil(a):Math.floor(a)};function W(a){return typeof a=="object"||typeof a=="function"}o(W,"isDictionary");function Rt(a,s){if(a!==void 0&&!W(a))throw new TypeError(`${s} is not an object.`)}o(Rt,"assertDictionary");function St(a,s){if(typeof a!="function")throw new TypeError(`${s} is not a function.`)}o(St,"assertFunction");function ii(a){return typeof a=="object"&&a!==null||typeof a=="function"}o(ii,"isObject");function Pt(a,s){if(!ii(a))throw new TypeError(`${s} is not an object.`)}o(Pt,"assertObject");function at(a,s,d){if(a===void 0)throw new TypeError(`Parameter ${s} is required in '${d}'.`)}o(at,"assertRequiredArgument");function y(a,s,d){if(a===void 0)throw new TypeError(`${s} is required in '${d}'.`)}o(y,"assertRequiredField");function P(a){return Number(a)}o(P,"convertUnrestrictedDouble");function x(a){return a===0?0:a}o(x,"censorNegativeZero");function z(a){return x(oi(a))}o(z,"integerPart");function R(a,s){let v=Number.MAX_SAFE_INTEGER,A=Number(a);if(A=x(A),!wr(A))throw new TypeError(`${s} is not a finite number`);if(A=z(A),A<0||A>v)throw new TypeError(`${s} is outside the accepted range of 0 to ${v}, inclusive`);return!wr(A)||A===0?0:A}o(R,"convertUnsignedLongLongWithEnforceRange");function $(a,s){if(!dn(a))throw new TypeError(`${s} is not a ReadableStream.`)}o($,"assertReadableStream");function j(a){return new F(a)}o(j,"AcquireReadableStreamDefaultReader");function I(a,s){a._reader._readRequests.push(s)}o(I,"ReadableStreamAddReadRequest");function C(a,s,d){let A=a._reader._readRequests.shift();d?A._closeSteps():A._chunkSteps(s)}o(C,"ReadableStreamFulfillReadRequest");function D(a){return a._reader._readRequests.length}o(D,"ReadableStreamGetNumReadRequests");function N(a){let s=a._reader;return!(s===void 0||!Y(s))}o(N,"ReadableStreamHasDefaultReader");class F{static{o(this,"ReadableStreamDefaultReader")}constructor(s){if(at(s,1,"ReadableStreamDefaultReader"),$(s,"First parameter"),pn(s))throw new TypeError("This stream has already been locked for exclusive reading by another reader");Se(this,s),this._readRequests=new V}get closed(){return Y(this)?this._closedPromise:m(We("closed"))}cancel(s=void 0){return Y(this)?this._ownerReadableStream===void 0?m(Ie("cancel")):be(this,s):m(We("cancel"))}read(){if(!Y(this))return m(We("read"));if(this._ownerReadableStream===void 0)return m(Ie("read from"));let s,d,v=p((U,L)=>{s=U,d=L});return te(this,{_chunkSteps:o(U=>s({value:U,done:!1}),"_chunkSteps"),_closeSteps:o(()=>s({value:void 0,done:!0}),"_closeSteps"),_errorSteps:o(U=>d(U),"_errorSteps")}),v}releaseLock(){if(!Y(this))throw We("releaseLock");this._ownerReadableStream!==void 0&&Re(this)}}Object.defineProperties(F.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(F.prototype.cancel,"cancel"),i(F.prototype.read,"read"),i(F.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(F.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function Y(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readRequests")?!1:a instanceof F}o(Y,"IsReadableStreamDefaultReader");function te(a,s){let d=a._ownerReadableStream;d._disturbed=!0,d._state==="closed"?s._closeSteps():d._state==="errored"?s._errorSteps(d._storedError):d._readableStreamController[Z](s)}o(te,"ReadableStreamDefaultReaderRead");function Re(a){$e(a);let s=new TypeError("Reader was released");Ge(a,s)}o(Re,"ReadableStreamDefaultReaderRelease");function Ge(a,s){let d=a._readRequests;a._readRequests=new V,d.forEach(v=>{v._errorSteps(s)})}o(Ge,"ReadableStreamDefaultReaderErrorReadRequests");function We(a){return new TypeError(`ReadableStreamDefaultReader.prototype.${a} can only be used on a ReadableStreamDefaultReader`)}o(We,"defaultReaderBrandCheckException");let Ae=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Ue{static{o(this,"ReadableStreamAsyncIteratorImpl")}constructor(s,d){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=s,this._preventCancel=d}next(){let s=o(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?T(this._ongoingPromise,s,s):s(),this._ongoingPromise}return(s){let d=o(()=>this._returnSteps(s),"returnSteps");return this._ongoingPromise?T(this._ongoingPromise,d,d):d()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let s=this._reader,d,v,A=p((L,Q)=>{d=L,v=Q});return te(s,{_chunkSteps:o(L=>{this._ongoingPromise=void 0,w(()=>d({value:L,done:!1}))},"_chunkSteps"),_closeSteps:o(()=>{this._ongoingPromise=void 0,this._isFinished=!0,$e(s),d({value:void 0,done:!0})},"_closeSteps"),_errorSteps:o(L=>{this._ongoingPromise=void 0,this._isFinished=!0,$e(s),v(L)},"_errorSteps")}),A}_returnSteps(s){if(this._isFinished)return Promise.resolve({value:s,done:!0});this._isFinished=!0;let d=this._reader;if(!this._preventCancel){let v=be(d,s);return $e(d),T(v,()=>({value:s,done:!0}))}return $e(d),f({value:s,done:!0})}}let st={next(){return oo(this)?this._asyncIteratorImpl.next():m(io("next"))},return(a){return oo(this)?this._asyncIteratorImpl.return(a):m(io("return"))}};Object.setPrototypeOf(st,Ae);function no(a,s){let d=j(a),v=new Ue(d,s),A=Object.create(st);return A._asyncIteratorImpl=v,A}o(no,"AcquireReadableStreamAsyncIterator");function oo(a){if(!r(a)||!Object.prototype.hasOwnProperty.call(a,"_asyncIteratorImpl"))return!1;try{return a._asyncIteratorImpl instanceof Ue}catch{return!1}}o(oo,"IsReadableStreamAsyncIterator");function io(a){return new TypeError(`ReadableStreamAsyncIterator.${a} can only be used on a ReadableSteamAsyncIterator`)}o(io,"streamAsyncIteratorBrandCheckException");let jt=Number.isNaN||function(a){return a!==a};var Fr,_t,ut;function je(a){return a.slice()}o(je,"CreateArrayFromList");function Hp(a,s,d,v,A){new Uint8Array(a).set(new Uint8Array(d,v,A),s)}o(Hp,"CopyDataBlockBytes");let Br=o(a=>(typeof a.transfer=="function"?Br=o(s=>s.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?Br=o(s=>structuredClone(s,{transfer:[s]}),"TransferArrayBuffer"):Br=o(s=>s,"TransferArrayBuffer"),Br(a)),"TransferArrayBuffer"),sn=o(a=>(typeof a.detached=="boolean"?sn=o(s=>s.detached,"IsDetachedBuffer"):sn=o(s=>s.byteLength===0,"IsDetachedBuffer"),sn(a)),"IsDetachedBuffer");function Gp(a,s,d){if(a.slice)return a.slice(s,d);let v=d-s,A=new ArrayBuffer(v);return Hp(A,0,a,s,v),A}o(Gp,"ArrayBufferSlice");function ha(a,s){let d=a[s];if(d!=null){if(typeof d!="function")throw new TypeError(`${String(s)} is not a function`);return d}}o(ha,"GetMethod");function VS(a){let s={[Symbol.iterator]:()=>a.iterator},d=(async function*(){return yield*s})(),v=d.next;return{iterator:d,nextMethod:v,done:!1}}o(VS,"CreateAsyncFromSyncIterator");let Hu=(ut=(Fr=Symbol.asyncIterator)!==null&&Fr!==void 0?Fr:(_t=Symbol.for)===null||_t===void 0?void 0:_t.call(Symbol,"Symbol.asyncIterator"))!==null&&ut!==void 0?ut:"@@asyncIterator";function Wp(a,s="sync",d){if(d===void 0)if(s==="async"){if(d=ha(a,Hu),d===void 0){let U=ha(a,Symbol.iterator),L=Wp(a,"sync",U);return VS(L)}}else d=ha(a,Symbol.iterator);if(d===void 0)throw new TypeError("The object is not iterable");let v=k(d,a,[]);if(!r(v))throw new TypeError("The iterator method must return an object");let A=v.next;return{iterator:v,nextMethod:A,done:!1}}o(Wp,"GetIterator");function HS(a){let s=k(a.nextMethod,a.iterator,[]);if(!r(s))throw new TypeError("The iterator.next() method must return an object");return s}o(HS,"IteratorNext");function GS(a){return!!a.done}o(GS,"IteratorComplete");function WS(a){return a.value}o(WS,"IteratorValue");function ZS(a){return!(typeof a!="number"||jt(a)||a<0)}o(ZS,"IsNonNegativeNumber");function Zp(a){let s=Gp(a.buffer,a.byteOffset,a.byteOffset+a.byteLength);return new Uint8Array(s)}o(Zp,"CloneAsUint8Array");function Gu(a){let s=a._queue.shift();return a._queueTotalSize-=s.size,a._queueTotalSize<0&&(a._queueTotalSize=0),s.value}o(Gu,"DequeueValue");function Wu(a,s,d){if(!ZS(d)||d===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");a._queue.push({value:s,size:d}),a._queueTotalSize+=d}o(Wu,"EnqueueValueWithSize");function JS(a){return a._queue.peek().value}o(JS,"PeekQueueValue");function un(a){a._queue=new V,a._queueTotalSize=0}o(un,"ResetQueue");function Jp(a){return a===DataView}o(Jp,"isDataViewConstructor");function KS(a){return Jp(a.constructor)}o(KS,"isDataView");function QS(a){return Jp(a)?1:a.BYTES_PER_ELEMENT}o(QS,"arrayBufferViewElementSize");class $n{static{o(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!Zu(this))throw Xu("view");return this._view}respond(s){if(!Zu(this))throw Xu("respond");if(at(s,1,"respond"),s=R(s,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(sn(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");ba(this._associatedReadableByteStreamController,s)}respondWithNewView(s){if(!Zu(this))throw Xu("respondWithNewView");if(at(s,1,"respondWithNewView"),!ArrayBuffer.isView(s))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(sn(s.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");va(this._associatedReadableByteStreamController,s)}}Object.defineProperties($n.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),i($n.prototype.respond,"respond"),i($n.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($n.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class qr{static{o(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!Nn(this))throw si("byobRequest");return Yu(this)}get desiredSize(){if(!Nn(this))throw si("desiredSize");return af(this)}close(){if(!Nn(this))throw si("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let s=this._controlledReadableByteStream._state;if(s!=="readable")throw new TypeError(`The stream (in ${s} state) is not in the readable state and cannot be closed`);ai(this)}enqueue(s){if(!Nn(this))throw si("enqueue");if(at(s,1,"enqueue"),!ArrayBuffer.isView(s))throw new TypeError("chunk must be an array buffer view");if(s.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(s.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 d=this._controlledReadableByteStream._state;if(d!=="readable")throw new TypeError(`The stream (in ${d} state) is not in the readable state and cannot be enqueued to`);_a(this,s)}error(s=void 0){if(!Nn(this))throw si("error");Xt(this,s)}[re](s){Kp(this),un(this);let d=this._cancelAlgorithm(s);return ya(this),d}[Z](s){let d=this._controlledReadableByteStream;if(this._queueTotalSize>0){of(this,s);return}let v=this._autoAllocateChunkSize;if(v!==void 0){let A;try{A=new ArrayBuffer(v)}catch(L){s._errorSteps(L);return}let U={buffer:A,bufferByteLength:v,byteOffset:0,byteLength:v,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(U)}I(d,s),zn(this)}[De](){if(this._pendingPullIntos.length>0){let s=this._pendingPullIntos.peek();s.readerType="none",this._pendingPullIntos=new V,this._pendingPullIntos.push(s)}}}Object.defineProperties(qr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),i(qr.prototype.close,"close"),i(qr.prototype.enqueue,"enqueue"),i(qr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(qr.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function Nn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableByteStream")?!1:a instanceof qr}o(Nn,"IsReadableByteStreamController");function Zu(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_associatedReadableByteStreamController")?!1:a instanceof $n}o(Zu,"IsReadableStreamBYOBRequest");function zn(a){if(!rP(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let d=a._pullAlgorithm();S(d,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,zn(a)),null),v=>(Xt(a,v),null))}o(zn,"ReadableByteStreamControllerCallPullIfNeeded");function Kp(a){Ku(a),a._pendingPullIntos=new V}o(Kp,"ReadableByteStreamControllerClearPendingPullIntos");function Ju(a,s){let d=!1;a._state==="closed"&&(d=!0);let v=Qp(s);s.readerType==="default"?C(a,v,d):uP(a,v,d)}o(Ju,"ReadableByteStreamControllerCommitPullIntoDescriptor");function Qp(a){let s=a.bytesFilled,d=a.elementSize;return new a.viewConstructor(a.buffer,a.byteOffset,s/d)}o(Qp,"ReadableByteStreamControllerConvertPullIntoDescriptor");function ga(a,s,d,v){a._queue.push({buffer:s,byteOffset:d,byteLength:v}),a._queueTotalSize+=v}o(ga,"ReadableByteStreamControllerEnqueueChunkToQueue");function Yp(a,s,d,v){let A;try{A=Gp(s,d,d+v)}catch(U){throw Xt(a,U),U}ga(a,A,0,v)}o(Yp,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function Xp(a,s){s.bytesFilled>0&&Yp(a,s.buffer,s.byteOffset,s.bytesFilled),ao(a)}o(Xp,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function ef(a,s){let d=Math.min(a._queueTotalSize,s.byteLength-s.bytesFilled),v=s.bytesFilled+d,A=d,U=!1,L=v%s.elementSize,Q=v-L;Q>=s.minimumFill&&(A=Q-s.bytesFilled,U=!0);let ue=a._queue;for(;A>0;){let oe=ue.peek(),he=Math.min(A,oe.byteLength),ve=s.byteOffset+s.bytesFilled;Hp(s.buffer,ve,oe.buffer,oe.byteOffset,he),oe.byteLength===he?ue.shift():(oe.byteOffset+=he,oe.byteLength-=he),a._queueTotalSize-=he,tf(a,he,s),A-=he}return U}o(ef,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function tf(a,s,d){d.bytesFilled+=s}o(tf,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function rf(a){a._queueTotalSize===0&&a._closeRequested?(ya(a),fi(a._controlledReadableByteStream)):zn(a)}o(rf,"ReadableByteStreamControllerHandleQueueDrain");function Ku(a){a._byobRequest!==null&&(a._byobRequest._associatedReadableByteStreamController=void 0,a._byobRequest._view=null,a._byobRequest=null)}o(Ku,"ReadableByteStreamControllerInvalidateBYOBRequest");function Qu(a){for(;a._pendingPullIntos.length>0;){if(a._queueTotalSize===0)return;let s=a._pendingPullIntos.peek();ef(a,s)&&(ao(a),Ju(a._controlledReadableByteStream,s))}}o(Qu,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function YS(a){let s=a._controlledReadableByteStream._reader;for(;s._readRequests.length>0;){if(a._queueTotalSize===0)return;let d=s._readRequests.shift();of(a,d)}}o(YS,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function XS(a,s,d,v){let A=a._controlledReadableByteStream,U=s.constructor,L=QS(U),{byteOffset:Q,byteLength:ue}=s,oe=d*L,he;try{he=Br(s.buffer)}catch(Le){v._errorSteps(Le);return}let ve={buffer:he,bufferByteLength:he.byteLength,byteOffset:Q,byteLength:ue,bytesFilled:0,minimumFill:oe,elementSize:L,viewConstructor:U,readerType:"byob"};if(a._pendingPullIntos.length>0){a._pendingPullIntos.push(ve),cf(A,v);return}if(A._state==="closed"){let Le=new U(ve.buffer,ve.byteOffset,0);v._closeSteps(Le);return}if(a._queueTotalSize>0){if(ef(a,ve)){let Le=Qp(ve);rf(a),v._chunkSteps(Le);return}if(a._closeRequested){let Le=new TypeError("Insufficient bytes to fill elements in the given buffer");Xt(a,Le),v._errorSteps(Le);return}}a._pendingPullIntos.push(ve),cf(A,v),zn(a)}o(XS,"ReadableByteStreamControllerPullInto");function eP(a,s){s.readerType==="none"&&ao(a);let d=a._controlledReadableByteStream;if(ec(d))for(;lf(d)>0;){let v=ao(a);Ju(d,v)}}o(eP,"ReadableByteStreamControllerRespondInClosedState");function tP(a,s,d){if(tf(a,s,d),d.readerType==="none"){Xp(a,d),Qu(a);return}if(d.bytesFilled<d.minimumFill)return;ao(a);let v=d.bytesFilled%d.elementSize;if(v>0){let A=d.byteOffset+d.bytesFilled;Yp(a,d.buffer,A-v,v)}d.bytesFilled-=v,Ju(a._controlledReadableByteStream,d),Qu(a)}o(tP,"ReadableByteStreamControllerRespondInReadableState");function nf(a,s){let d=a._pendingPullIntos.peek();Ku(a),a._controlledReadableByteStream._state==="closed"?eP(a,d):tP(a,s,d),zn(a)}o(nf,"ReadableByteStreamControllerRespondInternal");function ao(a){return a._pendingPullIntos.shift()}o(ao,"ReadableByteStreamControllerShiftPendingPullInto");function rP(a){let s=a._controlledReadableByteStream;return s._state!=="readable"||a._closeRequested||!a._started?!1:!!(N(s)&&D(s)>0||ec(s)&&lf(s)>0||af(a)>0)}o(rP,"ReadableByteStreamControllerShouldCallPull");function ya(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0}o(ya,"ReadableByteStreamControllerClearAlgorithms");function ai(a){let s=a._controlledReadableByteStream;if(!(a._closeRequested||s._state!=="readable")){if(a._queueTotalSize>0){a._closeRequested=!0;return}if(a._pendingPullIntos.length>0){let d=a._pendingPullIntos.peek();if(d.bytesFilled%d.elementSize!==0){let v=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Xt(a,v),v}}ya(a),fi(s)}}o(ai,"ReadableByteStreamControllerClose");function _a(a,s){let d=a._controlledReadableByteStream;if(a._closeRequested||d._state!=="readable")return;let{buffer:v,byteOffset:A,byteLength:U}=s;if(sn(v))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let L=Br(v);if(a._pendingPullIntos.length>0){let Q=a._pendingPullIntos.peek();if(sn(Q.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");Ku(a),Q.buffer=Br(Q.buffer),Q.readerType==="none"&&Xp(a,Q)}if(N(d))if(YS(a),D(d)===0)ga(a,L,A,U);else{a._pendingPullIntos.length>0&&ao(a);let Q=new Uint8Array(L,A,U);C(d,Q,!1)}else ec(d)?(ga(a,L,A,U),Qu(a)):ga(a,L,A,U);zn(a)}o(_a,"ReadableByteStreamControllerEnqueue");function Xt(a,s){let d=a._controlledReadableByteStream;d._state==="readable"&&(Kp(a),un(a),ya(a),Nf(d,s))}o(Xt,"ReadableByteStreamControllerError");function of(a,s){let d=a._queue.shift();a._queueTotalSize-=d.byteLength,rf(a);let v=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);s._chunkSteps(v)}o(of,"ReadableByteStreamControllerFillReadRequestFromQueue");function Yu(a){if(a._byobRequest===null&&a._pendingPullIntos.length>0){let s=a._pendingPullIntos.peek(),d=new Uint8Array(s.buffer,s.byteOffset+s.bytesFilled,s.byteLength-s.bytesFilled),v=Object.create($n.prototype);oP(v,a,d),a._byobRequest=v}return a._byobRequest}o(Yu,"ReadableByteStreamControllerGetBYOBRequest");function af(a){let s=a._controlledReadableByteStream._state;return s==="errored"?null:s==="closed"?0:a._strategyHWM-a._queueTotalSize}o(af,"ReadableByteStreamControllerGetDesiredSize");function ba(a,s){let d=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(s!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(s===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(d.bytesFilled+s>d.byteLength)throw new RangeError("bytesWritten out of range")}d.buffer=Br(d.buffer),nf(a,s)}o(ba,"ReadableByteStreamControllerRespond");function va(a,s){let d=a._pendingPullIntos.peek();if(a._controlledReadableByteStream._state==="closed"){if(s.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(s.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(d.byteOffset+d.bytesFilled!==s.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(d.bufferByteLength!==s.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(d.bytesFilled+s.byteLength>d.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let A=s.byteLength;d.buffer=Br(s.buffer),nf(a,A)}o(va,"ReadableByteStreamControllerRespondWithNewView");function sf(a,s,d,v,A,U,L){s._controlledReadableByteStream=a,s._pullAgain=!1,s._pulling=!1,s._byobRequest=null,s._queue=s._queueTotalSize=void 0,un(s),s._closeRequested=!1,s._started=!1,s._strategyHWM=U,s._pullAlgorithm=v,s._cancelAlgorithm=A,s._autoAllocateChunkSize=L,s._pendingPullIntos=new V,a._readableStreamController=s;let Q=d();S(f(Q),()=>(s._started=!0,zn(s),null),ue=>(Xt(s,ue),null))}o(sf,"SetUpReadableByteStreamController");function nP(a,s,d){let v=Object.create(qr.prototype),A,U,L;s.start!==void 0?A=o(()=>s.start(v),"startAlgorithm"):A=o(()=>{},"startAlgorithm"),s.pull!==void 0?U=o(()=>s.pull(v),"pullAlgorithm"):U=o(()=>f(void 0),"pullAlgorithm"),s.cancel!==void 0?L=o(ue=>s.cancel(ue),"cancelAlgorithm"):L=o(()=>f(void 0),"cancelAlgorithm");let Q=s.autoAllocateChunkSize;if(Q===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");sf(a,v,A,U,L,d,Q)}o(nP,"SetUpReadableByteStreamControllerFromUnderlyingSource");function oP(a,s,d){a._associatedReadableByteStreamController=s,a._view=d}o(oP,"SetUpReadableStreamBYOBRequest");function Xu(a){return new TypeError(`ReadableStreamBYOBRequest.prototype.${a} can only be used on a ReadableStreamBYOBRequest`)}o(Xu,"byobRequestBrandCheckException");function si(a){return new TypeError(`ReadableByteStreamController.prototype.${a} can only be used on a ReadableByteStreamController`)}o(si,"byteStreamControllerBrandCheckException");function iP(a,s){Rt(a,s);let d=a?.mode;return{mode:d===void 0?void 0:aP(d,`${s} has member 'mode' that`)}}o(iP,"convertReaderOptions");function aP(a,s){if(a=`${a}`,a!=="byob")throw new TypeError(`${s} '${a}' is not a valid enumeration value for ReadableStreamReaderMode`);return a}o(aP,"convertReadableStreamReaderMode");function sP(a,s){var d;Rt(a,s);let v=(d=a?.min)!==null&&d!==void 0?d:1;return{min:R(v,`${s} has member 'min' that`)}}o(sP,"convertByobReadOptions");function uf(a){return new cn(a)}o(uf,"AcquireReadableStreamBYOBReader");function cf(a,s){a._reader._readIntoRequests.push(s)}o(cf,"ReadableStreamAddReadIntoRequest");function uP(a,s,d){let A=a._reader._readIntoRequests.shift();d?A._closeSteps(s):A._chunkSteps(s)}o(uP,"ReadableStreamFulfillReadIntoRequest");function lf(a){return a._reader._readIntoRequests.length}o(lf,"ReadableStreamGetNumReadIntoRequests");function ec(a){let s=a._reader;return!(s===void 0||!Dn(s))}o(ec,"ReadableStreamHasBYOBReader");class cn{static{o(this,"ReadableStreamBYOBReader")}constructor(s){if(at(s,1,"ReadableStreamBYOBReader"),$(s,"First parameter"),pn(s))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!Nn(s._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");Se(this,s),this._readIntoRequests=new V}get closed(){return Dn(this)?this._closedPromise:m(Ea("closed"))}cancel(s=void 0){return Dn(this)?this._ownerReadableStream===void 0?m(Ie("cancel")):be(this,s):m(Ea("cancel"))}read(s,d={}){if(!Dn(this))return m(Ea("read"));if(!ArrayBuffer.isView(s))return m(new TypeError("view must be an array buffer view"));if(s.byteLength===0)return m(new TypeError("view must have non-zero byteLength"));if(s.buffer.byteLength===0)return m(new TypeError("view's buffer must have non-zero byteLength"));if(sn(s.buffer))return m(new TypeError("view's buffer has been detached"));let v;try{v=sP(d,"options")}catch(oe){return m(oe)}let A=v.min;if(A===0)return m(new TypeError("options.min must be greater than 0"));if(KS(s)){if(A>s.byteLength)return m(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(A>s.length)return m(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return m(Ie("read from"));let U,L,Q=p((oe,he)=>{U=oe,L=he});return df(this,s,A,{_chunkSteps:o(oe=>U({value:oe,done:!1}),"_chunkSteps"),_closeSteps:o(oe=>U({value:oe,done:!0}),"_closeSteps"),_errorSteps:o(oe=>L(oe),"_errorSteps")}),Q}releaseLock(){if(!Dn(this))throw Ea("releaseLock");this._ownerReadableStream!==void 0&&cP(this)}}Object.defineProperties(cn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),i(cn.prototype.cancel,"cancel"),i(cn.prototype.read,"read"),i(cn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(cn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Dn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readIntoRequests")?!1:a instanceof cn}o(Dn,"IsReadableStreamBYOBReader");function df(a,s,d,v){let A=a._ownerReadableStream;A._disturbed=!0,A._state==="errored"?v._errorSteps(A._storedError):XS(A._readableStreamController,s,d,v)}o(df,"ReadableStreamBYOBReaderRead");function cP(a){$e(a);let s=new TypeError("Reader was released");pf(a,s)}o(cP,"ReadableStreamBYOBReaderRelease");function pf(a,s){let d=a._readIntoRequests;a._readIntoRequests=new V,d.forEach(v=>{v._errorSteps(s)})}o(pf,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Ea(a){return new TypeError(`ReadableStreamBYOBReader.prototype.${a} can only be used on a ReadableStreamBYOBReader`)}o(Ea,"byobReaderBrandCheckException");function ui(a,s){let{highWaterMark:d}=a;if(d===void 0)return s;if(jt(d)||d<0)throw new RangeError("Invalid highWaterMark");return d}o(ui,"ExtractHighWaterMark");function Sa(a){let{size:s}=a;return s||(()=>1)}o(Sa,"ExtractSizeAlgorithm");function Pa(a,s){Rt(a,s);let d=a?.highWaterMark,v=a?.size;return{highWaterMark:d===void 0?void 0:P(d),size:v===void 0?void 0:lP(v,`${s} has member 'size' that`)}}o(Pa,"convertQueuingStrategy");function lP(a,s){return St(a,s),d=>P(a(d))}o(lP,"convertQueuingStrategySize");function dP(a,s){Rt(a,s);let d=a?.abort,v=a?.close,A=a?.start,U=a?.type,L=a?.write;return{abort:d===void 0?void 0:pP(d,a,`${s} has member 'abort' that`),close:v===void 0?void 0:fP(v,a,`${s} has member 'close' that`),start:A===void 0?void 0:mP(A,a,`${s} has member 'start' that`),write:L===void 0?void 0:hP(L,a,`${s} has member 'write' that`),type:U}}o(dP,"convertUnderlyingSink");function pP(a,s,d){return St(a,d),v=>q(a,s,[v])}o(pP,"convertUnderlyingSinkAbortCallback");function fP(a,s,d){return St(a,d),()=>q(a,s,[])}o(fP,"convertUnderlyingSinkCloseCallback");function mP(a,s,d){return St(a,d),v=>k(a,s,[v])}o(mP,"convertUnderlyingSinkStartCallback");function hP(a,s,d){return St(a,d),(v,A)=>q(a,s,[v,A])}o(hP,"convertUnderlyingSinkWriteCallback");function ff(a,s){if(!so(a))throw new TypeError(`${s} is not a WritableStream.`)}o(ff,"assertWritableStream");function gP(a){if(typeof a!="object"||a===null)return!1;try{return typeof a.aborted=="boolean"}catch{return!1}}o(gP,"isAbortSignal");let yP=typeof AbortController=="function";function _P(){if(yP)return new AbortController}o(_P,"createAbortController");class ln{static{o(this,"WritableStream")}constructor(s={},d={}){s===void 0?s=null:Pt(s,"First parameter");let v=Pa(d,"Second parameter"),A=dP(s,"First parameter");if(hf(this),A.type!==void 0)throw new RangeError("Invalid type is specified");let L=Sa(v),Q=ui(v,1);kP(this,A,Q,L)}get locked(){if(!so(this))throw Ia("locked");return uo(this)}abort(s=void 0){return so(this)?uo(this)?m(new TypeError("Cannot abort a stream that already has a writer")):Ta(this,s):m(Ia("abort"))}close(){return so(this)?uo(this)?m(new TypeError("Cannot close a stream that already has a writer")):xr(this)?m(new TypeError("Cannot close an already-closing stream")):gf(this):m(Ia("close"))}getWriter(){if(!so(this))throw Ia("getWriter");return mf(this)}}Object.defineProperties(ln.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),i(ln.prototype.abort,"abort"),i(ln.prototype.close,"close"),i(ln.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(ln.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function mf(a){return new Vr(a)}o(mf,"AcquireWritableStreamDefaultWriter");function bP(a,s,d,v,A=1,U=()=>1){let L=Object.create(ln.prototype);hf(L);let Q=Object.create(co.prototype);return Sf(L,Q,a,s,d,v,A,U),L}o(bP,"CreateWritableStream");function hf(a){a._state="writable",a._storedError=void 0,a._writer=void 0,a._writableStreamController=void 0,a._writeRequests=new V,a._inFlightWriteRequest=void 0,a._closeRequest=void 0,a._inFlightCloseRequest=void 0,a._pendingAbortRequest=void 0,a._backpressure=!1}o(hf,"InitializeWritableStream");function so(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_writableStreamController")?!1:a instanceof ln}o(so,"IsWritableStream");function uo(a){return a._writer!==void 0}o(uo,"IsWritableStreamLocked");function Ta(a,s){var d;if(a._state==="closed"||a._state==="errored")return f(void 0);a._writableStreamController._abortReason=s,(d=a._writableStreamController._abortController)===null||d===void 0||d.abort(s);let v=a._state;if(v==="closed"||v==="errored")return f(void 0);if(a._pendingAbortRequest!==void 0)return a._pendingAbortRequest._promise;let A=!1;v==="erroring"&&(A=!0,s=void 0);let U=p((L,Q)=>{a._pendingAbortRequest={_promise:void 0,_resolve:L,_reject:Q,_reason:s,_wasAlreadyErroring:A}});return a._pendingAbortRequest._promise=U,A||rc(a,s),U}o(Ta,"WritableStreamAbort");function gf(a){let s=a._state;if(s==="closed"||s==="errored")return m(new TypeError(`The stream (in ${s} state) is not in the writable state and cannot be closed`));let d=p((A,U)=>{let L={_resolve:A,_reject:U};a._closeRequest=L}),v=a._writer;return v!==void 0&&a._backpressure&&s==="writable"&&lc(v),$P(a._writableStreamController),d}o(gf,"WritableStreamClose");function vP(a){return p((d,v)=>{let A={_resolve:d,_reject:v};a._writeRequests.push(A)})}o(vP,"WritableStreamAddWriteRequest");function tc(a,s){if(a._state==="writable"){rc(a,s);return}nc(a)}o(tc,"WritableStreamDealWithRejection");function rc(a,s){let d=a._writableStreamController;a._state="erroring",a._storedError=s;let v=a._writer;v!==void 0&&_f(v,s),!wP(a)&&d._started&&nc(a)}o(rc,"WritableStreamStartErroring");function nc(a){a._state="errored",a._writableStreamController[J]();let s=a._storedError;if(a._writeRequests.forEach(A=>{A._reject(s)}),a._writeRequests=new V,a._pendingAbortRequest===void 0){wa(a);return}let d=a._pendingAbortRequest;if(a._pendingAbortRequest=void 0,d._wasAlreadyErroring){d._reject(s),wa(a);return}let v=a._writableStreamController[H](d._reason);S(v,()=>(d._resolve(),wa(a),null),A=>(d._reject(A),wa(a),null))}o(nc,"WritableStreamFinishErroring");function EP(a){a._inFlightWriteRequest._resolve(void 0),a._inFlightWriteRequest=void 0}o(EP,"WritableStreamFinishInFlightWrite");function SP(a,s){a._inFlightWriteRequest._reject(s),a._inFlightWriteRequest=void 0,tc(a,s)}o(SP,"WritableStreamFinishInFlightWriteWithError");function PP(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 d=a._writer;d!==void 0&&xf(d)}o(PP,"WritableStreamFinishInFlightClose");function TP(a,s){a._inFlightCloseRequest._reject(s),a._inFlightCloseRequest=void 0,a._pendingAbortRequest!==void 0&&(a._pendingAbortRequest._reject(s),a._pendingAbortRequest=void 0),tc(a,s)}o(TP,"WritableStreamFinishInFlightCloseWithError");function xr(a){return!(a._closeRequest===void 0&&a._inFlightCloseRequest===void 0)}o(xr,"WritableStreamCloseQueuedOrInFlight");function wP(a){return!(a._inFlightWriteRequest===void 0&&a._inFlightCloseRequest===void 0)}o(wP,"WritableStreamHasOperationMarkedInFlight");function xP(a){a._inFlightCloseRequest=a._closeRequest,a._closeRequest=void 0}o(xP,"WritableStreamMarkCloseRequestInFlight");function AP(a){a._inFlightWriteRequest=a._writeRequests.shift()}o(AP,"WritableStreamMarkFirstWriteRequestInFlight");function wa(a){a._closeRequest!==void 0&&(a._closeRequest._reject(a._storedError),a._closeRequest=void 0);let s=a._writer;s!==void 0&&uc(s,a._storedError)}o(wa,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function oc(a,s){let d=a._writer;d!==void 0&&s!==a._backpressure&&(s?LP(d):lc(d)),a._backpressure=s}o(oc,"WritableStreamUpdateBackpressure");class Vr{static{o(this,"WritableStreamDefaultWriter")}constructor(s){if(at(s,1,"WritableStreamDefaultWriter"),ff(s,"First parameter"),uo(s))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=s,s._writer=this;let d=s._state;if(d==="writable")!xr(s)&&s._backpressure?Ca(this):Af(this),Ra(this);else if(d==="erroring")cc(this,s._storedError),Ra(this);else if(d==="closed")Af(this),jP(this);else{let v=s._storedError;cc(this,v),wf(this,v)}}get closed(){return Un(this)?this._closedPromise:m(jn("closed"))}get desiredSize(){if(!Un(this))throw jn("desiredSize");if(this._ownerWritableStream===void 0)throw li("desiredSize");return OP(this)}get ready(){return Un(this)?this._readyPromise:m(jn("ready"))}abort(s=void 0){return Un(this)?this._ownerWritableStream===void 0?m(li("abort")):IP(this,s):m(jn("abort"))}close(){if(!Un(this))return m(jn("close"));let s=this._ownerWritableStream;return s===void 0?m(li("close")):xr(s)?m(new TypeError("Cannot close an already-closing stream")):yf(this)}releaseLock(){if(!Un(this))throw jn("releaseLock");this._ownerWritableStream!==void 0&&bf(this)}write(s=void 0){return Un(this)?this._ownerWritableStream===void 0?m(li("write to")):vf(this,s):m(jn("write"))}}Object.defineProperties(Vr.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),i(Vr.prototype.abort,"abort"),i(Vr.prototype.close,"close"),i(Vr.prototype.releaseLock,"releaseLock"),i(Vr.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Vr.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Un(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_ownerWritableStream")?!1:a instanceof Vr}o(Un,"IsWritableStreamDefaultWriter");function IP(a,s){let d=a._ownerWritableStream;return Ta(d,s)}o(IP,"WritableStreamDefaultWriterAbort");function yf(a){let s=a._ownerWritableStream;return gf(s)}o(yf,"WritableStreamDefaultWriterClose");function RP(a){let s=a._ownerWritableStream,d=s._state;return xr(s)||d==="closed"?f(void 0):d==="errored"?m(s._storedError):yf(a)}o(RP,"WritableStreamDefaultWriterCloseWithErrorPropagation");function CP(a,s){a._closedPromiseState==="pending"?uc(a,s):MP(a,s)}o(CP,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function _f(a,s){a._readyPromiseState==="pending"?If(a,s):FP(a,s)}o(_f,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function OP(a){let s=a._ownerWritableStream,d=s._state;return d==="errored"||d==="erroring"?null:d==="closed"?0:Pf(s._writableStreamController)}o(OP,"WritableStreamDefaultWriterGetDesiredSize");function bf(a){let s=a._ownerWritableStream,d=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");_f(a,d),CP(a,d),s._writer=void 0,a._ownerWritableStream=void 0}o(bf,"WritableStreamDefaultWriterRelease");function vf(a,s){let d=a._ownerWritableStream,v=d._writableStreamController,A=NP(v,s);if(d!==a._ownerWritableStream)return m(li("write to"));let U=d._state;if(U==="errored")return m(d._storedError);if(xr(d)||U==="closed")return m(new TypeError("The stream is closing or closed and cannot be written to"));if(U==="erroring")return m(d._storedError);let L=vP(d);return zP(v,s,A),L}o(vf,"WritableStreamDefaultWriterWrite");let Ef={};class co{static{o(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!ic(this))throw sc("abortReason");return this._abortReason}get signal(){if(!ic(this))throw sc("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(s=void 0){if(!ic(this))throw sc("error");this._controlledWritableStream._state==="writable"&&Tf(this,s)}[H](s){let d=this._abortAlgorithm(s);return xa(this),d}[J](){un(this)}}Object.defineProperties(co.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(co.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function ic(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledWritableStream")?!1:a instanceof co}o(ic,"IsWritableStreamDefaultController");function Sf(a,s,d,v,A,U,L,Q){s._controlledWritableStream=a,a._writableStreamController=s,s._queue=void 0,s._queueTotalSize=void 0,un(s),s._abortReason=void 0,s._abortController=_P(),s._started=!1,s._strategySizeAlgorithm=Q,s._strategyHWM=L,s._writeAlgorithm=v,s._closeAlgorithm=A,s._abortAlgorithm=U;let ue=ac(s);oc(a,ue);let oe=d(),he=f(oe);S(he,()=>(s._started=!0,Aa(s),null),ve=>(s._started=!0,tc(a,ve),null))}o(Sf,"SetUpWritableStreamDefaultController");function kP(a,s,d,v){let A=Object.create(co.prototype),U,L,Q,ue;s.start!==void 0?U=o(()=>s.start(A),"startAlgorithm"):U=o(()=>{},"startAlgorithm"),s.write!==void 0?L=o(oe=>s.write(oe,A),"writeAlgorithm"):L=o(()=>f(void 0),"writeAlgorithm"),s.close!==void 0?Q=o(()=>s.close(),"closeAlgorithm"):Q=o(()=>f(void 0),"closeAlgorithm"),s.abort!==void 0?ue=o(oe=>s.abort(oe),"abortAlgorithm"):ue=o(()=>f(void 0),"abortAlgorithm"),Sf(a,A,U,L,Q,ue,d,v)}o(kP,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function xa(a){a._writeAlgorithm=void 0,a._closeAlgorithm=void 0,a._abortAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(xa,"WritableStreamDefaultControllerClearAlgorithms");function $P(a){Wu(a,Ef,0),Aa(a)}o($P,"WritableStreamDefaultControllerClose");function NP(a,s){try{return a._strategySizeAlgorithm(s)}catch(d){return ci(a,d),1}}o(NP,"WritableStreamDefaultControllerGetChunkSize");function Pf(a){return a._strategyHWM-a._queueTotalSize}o(Pf,"WritableStreamDefaultControllerGetDesiredSize");function zP(a,s,d){try{Wu(a,s,d)}catch(A){ci(a,A);return}let v=a._controlledWritableStream;if(!xr(v)&&v._state==="writable"){let A=ac(a);oc(v,A)}Aa(a)}o(zP,"WritableStreamDefaultControllerWrite");function Aa(a){let s=a._controlledWritableStream;if(!a._started||s._inFlightWriteRequest!==void 0)return;if(s._state==="erroring"){nc(s);return}if(a._queue.length===0)return;let v=JS(a);v===Ef?DP(a):UP(a,v)}o(Aa,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function ci(a,s){a._controlledWritableStream._state==="writable"&&Tf(a,s)}o(ci,"WritableStreamDefaultControllerErrorIfNeeded");function DP(a){let s=a._controlledWritableStream;xP(s),Gu(a);let d=a._closeAlgorithm();xa(a),S(d,()=>(PP(s),null),v=>(TP(s,v),null))}o(DP,"WritableStreamDefaultControllerProcessClose");function UP(a,s){let d=a._controlledWritableStream;AP(d);let v=a._writeAlgorithm(s);S(v,()=>{EP(d);let A=d._state;if(Gu(a),!xr(d)&&A==="writable"){let U=ac(a);oc(d,U)}return Aa(a),null},A=>(d._state==="writable"&&xa(a),SP(d,A),null))}o(UP,"WritableStreamDefaultControllerProcessWrite");function ac(a){return Pf(a)<=0}o(ac,"WritableStreamDefaultControllerGetBackpressure");function Tf(a,s){let d=a._controlledWritableStream;xa(a),rc(d,s)}o(Tf,"WritableStreamDefaultControllerError");function Ia(a){return new TypeError(`WritableStream.prototype.${a} can only be used on a WritableStream`)}o(Ia,"streamBrandCheckException$2");function sc(a){return new TypeError(`WritableStreamDefaultController.prototype.${a} can only be used on a WritableStreamDefaultController`)}o(sc,"defaultControllerBrandCheckException$2");function jn(a){return new TypeError(`WritableStreamDefaultWriter.prototype.${a} can only be used on a WritableStreamDefaultWriter`)}o(jn,"defaultWriterBrandCheckException");function li(a){return new TypeError("Cannot "+a+" a stream using a released writer")}o(li,"defaultWriterLockException");function Ra(a){a._closedPromise=p((s,d)=>{a._closedPromise_resolve=s,a._closedPromise_reject=d,a._closedPromiseState="pending"})}o(Ra,"defaultWriterClosedPromiseInitialize");function wf(a,s){Ra(a),uc(a,s)}o(wf,"defaultWriterClosedPromiseInitializeAsRejected");function jP(a){Ra(a),xf(a)}o(jP,"defaultWriterClosedPromiseInitializeAsResolved");function uc(a,s){a._closedPromise_reject!==void 0&&(E(a._closedPromise),a._closedPromise_reject(s),a._closedPromise_resolve=void 0,a._closedPromise_reject=void 0,a._closedPromiseState="rejected")}o(uc,"defaultWriterClosedPromiseReject");function MP(a,s){wf(a,s)}o(MP,"defaultWriterClosedPromiseResetToRejected");function xf(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(xf,"defaultWriterClosedPromiseResolve");function Ca(a){a._readyPromise=p((s,d)=>{a._readyPromise_resolve=s,a._readyPromise_reject=d}),a._readyPromiseState="pending"}o(Ca,"defaultWriterReadyPromiseInitialize");function cc(a,s){Ca(a),If(a,s)}o(cc,"defaultWriterReadyPromiseInitializeAsRejected");function Af(a){Ca(a),lc(a)}o(Af,"defaultWriterReadyPromiseInitializeAsResolved");function If(a,s){a._readyPromise_reject!==void 0&&(E(a._readyPromise),a._readyPromise_reject(s),a._readyPromise_resolve=void 0,a._readyPromise_reject=void 0,a._readyPromiseState="rejected")}o(If,"defaultWriterReadyPromiseReject");function LP(a){Ca(a)}o(LP,"defaultWriterReadyPromiseReset");function FP(a,s){cc(a,s)}o(FP,"defaultWriterReadyPromiseResetToRejected");function lc(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(lc,"defaultWriterReadyPromiseResolve");function BP(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}o(BP,"getGlobals");let dc=BP();function qP(a){if(!(typeof a=="function"||typeof a=="object")||a.name!=="DOMException")return!1;try{return new a,!0}catch{return!1}}o(qP,"isDOMExceptionConstructor");function VP(){let a=dc?.DOMException;return qP(a)?a:void 0}o(VP,"getFromGlobal");function HP(){let a=o(function(d,v){this.message=d||"",this.name=v||"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(HP,"createPolyfill");let GP=VP()||HP();function Rf(a,s,d,v,A,U){let L=j(a),Q=mf(s);a._disturbed=!0;let ue=!1,oe=f(void 0);return p((he,ve)=>{let Le;if(U!==void 0){if(Le=o(()=>{let ie=U.reason!==void 0?U.reason:new GP("Aborted","AbortError"),we=[];v||we.push(()=>s._state==="writable"?Ta(s,ie):f(void 0)),A||we.push(()=>a._state==="readable"?dr(a,ie):f(void 0)),Ct(()=>Promise.all(we.map(Fe=>Fe())),!0,ie)},"abortAlgorithm"),U.aborted){Le();return}U.addEventListener("abort",Le)}function pr(){return p((ie,we)=>{function Fe(Mt){Mt?ie():g(mo(),Fe,we)}o(Fe,"next"),Fe(!1)})}o(pr,"pipeLoop");function mo(){return ue?f(!0):g(Q._readyPromise,()=>p((ie,we)=>{te(L,{_chunkSteps:o(Fe=>{oe=g(vf(Q,Fe),void 0,e),ie(!1)},"_chunkSteps"),_closeSteps:o(()=>ie(!0),"_closeSteps"),_errorSteps:we})}))}if(o(mo,"pipeStep"),Gr(a,L._closedPromise,ie=>(v?er(!0,ie):Ct(()=>Ta(s,ie),!0,ie),null)),Gr(s,Q._closedPromise,ie=>(A?er(!0,ie):Ct(()=>dr(a,ie),!0,ie),null)),Tt(a,L._closedPromise,()=>(d?er():Ct(()=>RP(Q)),null)),xr(s)||s._state==="closed"){let ie=new TypeError("the destination writable stream closed before all data could be piped to it");A?er(!0,ie):Ct(()=>dr(a,ie),!0,ie)}E(pr());function mn(){let ie=oe;return g(oe,()=>ie!==oe?mn():void 0)}o(mn,"waitForWritesToFinish");function Gr(ie,we,Fe){ie._state==="errored"?Fe(ie._storedError):_(we,Fe)}o(Gr,"isOrBecomesErrored");function Tt(ie,we,Fe){ie._state==="closed"?Fe():h(we,Fe)}o(Tt,"isOrBecomesClosed");function Ct(ie,we,Fe){if(ue)return;ue=!0,s._state==="writable"&&!xr(s)?h(mn(),Mt):Mt();function Mt(){return S(ie(),()=>Wr(we,Fe),ho=>Wr(!0,ho)),null}o(Mt,"doTheRest")}o(Ct,"shutdownWithAction");function er(ie,we){ue||(ue=!0,s._state==="writable"&&!xr(s)?h(mn(),()=>Wr(ie,we)):Wr(ie,we))}o(er,"shutdown");function Wr(ie,we){return bf(Q),$e(L),U!==void 0&&U.removeEventListener("abort",Le),ie?ve(we):he(void 0),null}o(Wr,"finalize")})}o(Rf,"ReadableStreamPipeTo");class Hr{static{o(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Oa(this))throw $a("desiredSize");return pc(this)}close(){if(!Oa(this))throw $a("close");if(!po(this))throw new TypeError("The stream is not in a state that permits close");Mn(this)}enqueue(s=void 0){if(!Oa(this))throw $a("enqueue");if(!po(this))throw new TypeError("The stream is not in a state that permits enqueue");return lo(this,s)}error(s=void 0){if(!Oa(this))throw $a("error");lr(this,s)}[re](s){un(this);let d=this._cancelAlgorithm(s);return ka(this),d}[Z](s){let d=this._controlledReadableStream;if(this._queue.length>0){let v=Gu(this);this._closeRequested&&this._queue.length===0?(ka(this),fi(d)):di(this),s._chunkSteps(v)}else I(d,s),di(this)}[De](){}}Object.defineProperties(Hr.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),i(Hr.prototype.close,"close"),i(Hr.prototype.enqueue,"enqueue"),i(Hr.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Oa(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledReadableStream")?!1:a instanceof Hr}o(Oa,"IsReadableStreamDefaultController");function di(a){if(!Cf(a))return;if(a._pulling){a._pullAgain=!0;return}a._pulling=!0;let d=a._pullAlgorithm();S(d,()=>(a._pulling=!1,a._pullAgain&&(a._pullAgain=!1,di(a)),null),v=>(lr(a,v),null))}o(di,"ReadableStreamDefaultControllerCallPullIfNeeded");function Cf(a){let s=a._controlledReadableStream;return!po(a)||!a._started?!1:!!(pn(s)&&D(s)>0||pc(a)>0)}o(Cf,"ReadableStreamDefaultControllerShouldCallPull");function ka(a){a._pullAlgorithm=void 0,a._cancelAlgorithm=void 0,a._strategySizeAlgorithm=void 0}o(ka,"ReadableStreamDefaultControllerClearAlgorithms");function Mn(a){if(!po(a))return;let s=a._controlledReadableStream;a._closeRequested=!0,a._queue.length===0&&(ka(a),fi(s))}o(Mn,"ReadableStreamDefaultControllerClose");function lo(a,s){if(!po(a))return;let d=a._controlledReadableStream;if(pn(d)&&D(d)>0)C(d,s,!1);else{let v;try{v=a._strategySizeAlgorithm(s)}catch(A){throw lr(a,A),A}try{Wu(a,s,v)}catch(A){throw lr(a,A),A}}di(a)}o(lo,"ReadableStreamDefaultControllerEnqueue");function lr(a,s){let d=a._controlledReadableStream;d._state==="readable"&&(un(a),ka(a),Nf(d,s))}o(lr,"ReadableStreamDefaultControllerError");function pc(a){let s=a._controlledReadableStream._state;return s==="errored"?null:s==="closed"?0:a._strategyHWM-a._queueTotalSize}o(pc,"ReadableStreamDefaultControllerGetDesiredSize");function WP(a){return!Cf(a)}o(WP,"ReadableStreamDefaultControllerHasBackpressure");function po(a){let s=a._controlledReadableStream._state;return!a._closeRequested&&s==="readable"}o(po,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function Of(a,s,d,v,A,U,L){s._controlledReadableStream=a,s._queue=void 0,s._queueTotalSize=void 0,un(s),s._started=!1,s._closeRequested=!1,s._pullAgain=!1,s._pulling=!1,s._strategySizeAlgorithm=L,s._strategyHWM=U,s._pullAlgorithm=v,s._cancelAlgorithm=A,a._readableStreamController=s;let Q=d();S(f(Q),()=>(s._started=!0,di(s),null),ue=>(lr(s,ue),null))}o(Of,"SetUpReadableStreamDefaultController");function ZP(a,s,d,v){let A=Object.create(Hr.prototype),U,L,Q;s.start!==void 0?U=o(()=>s.start(A),"startAlgorithm"):U=o(()=>{},"startAlgorithm"),s.pull!==void 0?L=o(()=>s.pull(A),"pullAlgorithm"):L=o(()=>f(void 0),"pullAlgorithm"),s.cancel!==void 0?Q=o(ue=>s.cancel(ue),"cancelAlgorithm"):Q=o(()=>f(void 0),"cancelAlgorithm"),Of(a,A,U,L,Q,d,v)}o(ZP,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function $a(a){return new TypeError(`ReadableStreamDefaultController.prototype.${a} can only be used on a ReadableStreamDefaultController`)}o($a,"defaultControllerBrandCheckException$1");function JP(a,s){return Nn(a._readableStreamController)?QP(a):KP(a)}o(JP,"ReadableStreamTee");function KP(a,s){let d=j(a),v=!1,A=!1,U=!1,L=!1,Q,ue,oe,he,ve,Le=p(Tt=>{ve=Tt});function pr(){return v?(A=!0,f(void 0)):(v=!0,te(d,{_chunkSteps:o(Ct=>{w(()=>{A=!1;let er=Ct,Wr=Ct;U||lo(oe._readableStreamController,er),L||lo(he._readableStreamController,Wr),v=!1,A&&pr()})},"_chunkSteps"),_closeSteps:o(()=>{v=!1,U||Mn(oe._readableStreamController),L||Mn(he._readableStreamController),(!U||!L)&&ve(void 0)},"_closeSteps"),_errorSteps:o(()=>{v=!1},"_errorSteps")}),f(void 0))}o(pr,"pullAlgorithm");function mo(Tt){if(U=!0,Q=Tt,L){let Ct=je([Q,ue]),er=dr(a,Ct);ve(er)}return Le}o(mo,"cancel1Algorithm");function mn(Tt){if(L=!0,ue=Tt,U){let Ct=je([Q,ue]),er=dr(a,Ct);ve(er)}return Le}o(mn,"cancel2Algorithm");function Gr(){}return o(Gr,"startAlgorithm"),oe=pi(Gr,pr,mo),he=pi(Gr,pr,mn),_(d._closedPromise,Tt=>(lr(oe._readableStreamController,Tt),lr(he._readableStreamController,Tt),(!U||!L)&&ve(void 0),null)),[oe,he]}o(KP,"ReadableStreamDefaultTee");function QP(a){let s=j(a),d=!1,v=!1,A=!1,U=!1,L=!1,Q,ue,oe,he,ve,Le=p(ie=>{ve=ie});function pr(ie){_(ie._closedPromise,we=>(ie!==s||(Xt(oe._readableStreamController,we),Xt(he._readableStreamController,we),(!U||!L)&&ve(void 0)),null))}o(pr,"forwardReaderError");function mo(){Dn(s)&&($e(s),s=j(a),pr(s)),te(s,{_chunkSteps:o(we=>{w(()=>{v=!1,A=!1;let Fe=we,Mt=we;if(!U&&!L)try{Mt=Zp(we)}catch(ho){Xt(oe._readableStreamController,ho),Xt(he._readableStreamController,ho),ve(dr(a,ho));return}U||_a(oe._readableStreamController,Fe),L||_a(he._readableStreamController,Mt),d=!1,v?Gr():A&&Tt()})},"_chunkSteps"),_closeSteps:o(()=>{d=!1,U||ai(oe._readableStreamController),L||ai(he._readableStreamController),oe._readableStreamController._pendingPullIntos.length>0&&ba(oe._readableStreamController,0),he._readableStreamController._pendingPullIntos.length>0&&ba(he._readableStreamController,0),(!U||!L)&&ve(void 0)},"_closeSteps"),_errorSteps:o(()=>{d=!1},"_errorSteps")})}o(mo,"pullWithDefaultReader");function mn(ie,we){Y(s)&&($e(s),s=uf(a),pr(s));let Fe=we?he:oe,Mt=we?oe:he;df(s,ie,1,{_chunkSteps:o(go=>{w(()=>{v=!1,A=!1;let yo=we?L:U;if(we?U:L)yo||va(Fe._readableStreamController,go);else{let Wf;try{Wf=Zp(go)}catch(yc){Xt(Fe._readableStreamController,yc),Xt(Mt._readableStreamController,yc),ve(dr(a,yc));return}yo||va(Fe._readableStreamController,go),_a(Mt._readableStreamController,Wf)}d=!1,v?Gr():A&&Tt()})},"_chunkSteps"),_closeSteps:o(go=>{d=!1;let yo=we?L:U,Fa=we?U:L;yo||ai(Fe._readableStreamController),Fa||ai(Mt._readableStreamController),go!==void 0&&(yo||va(Fe._readableStreamController,go),!Fa&&Mt._readableStreamController._pendingPullIntos.length>0&&ba(Mt._readableStreamController,0)),(!yo||!Fa)&&ve(void 0)},"_closeSteps"),_errorSteps:o(()=>{d=!1},"_errorSteps")})}o(mn,"pullWithBYOBReader");function Gr(){if(d)return v=!0,f(void 0);d=!0;let ie=Yu(oe._readableStreamController);return ie===null?mo():mn(ie._view,!1),f(void 0)}o(Gr,"pull1Algorithm");function Tt(){if(d)return A=!0,f(void 0);d=!0;let ie=Yu(he._readableStreamController);return ie===null?mo():mn(ie._view,!0),f(void 0)}o(Tt,"pull2Algorithm");function Ct(ie){if(U=!0,Q=ie,L){let we=je([Q,ue]),Fe=dr(a,we);ve(Fe)}return Le}o(Ct,"cancel1Algorithm");function er(ie){if(L=!0,ue=ie,U){let we=je([Q,ue]),Fe=dr(a,we);ve(Fe)}return Le}o(er,"cancel2Algorithm");function Wr(){}return o(Wr,"startAlgorithm"),oe=$f(Wr,Gr,Ct),he=$f(Wr,Tt,er),pr(s),[oe,he]}o(QP,"ReadableByteStreamTee");function YP(a){return r(a)&&typeof a.getReader<"u"}o(YP,"isReadableStreamLike");function XP(a){return YP(a)?tT(a.getReader()):eT(a)}o(XP,"ReadableStreamFrom");function eT(a){let s,d=Wp(a,"async"),v=e;function A(){let L;try{L=HS(d)}catch(ue){return m(ue)}let Q=f(L);return T(Q,ue=>{if(!r(ue))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(GS(ue))Mn(s._readableStreamController);else{let he=WS(ue);lo(s._readableStreamController,he)}})}o(A,"pullAlgorithm");function U(L){let Q=d.iterator,ue;try{ue=ha(Q,"return")}catch(ve){return m(ve)}if(ue===void 0)return f(void 0);let oe;try{oe=k(ue,Q,[L])}catch(ve){return m(ve)}let he=f(oe);return T(he,ve=>{if(!r(ve))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return o(U,"cancelAlgorithm"),s=pi(v,A,U,0),s}o(eT,"ReadableStreamFromIterable");function tT(a){let s,d=e;function v(){let U;try{U=a.read()}catch(L){return m(L)}return T(U,L=>{if(!r(L))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(L.done)Mn(s._readableStreamController);else{let Q=L.value;lo(s._readableStreamController,Q)}})}o(v,"pullAlgorithm");function A(U){try{return f(a.cancel(U))}catch(L){return m(L)}}return o(A,"cancelAlgorithm"),s=pi(d,v,A,0),s}o(tT,"ReadableStreamFromDefaultReader");function rT(a,s){Rt(a,s);let d=a,v=d?.autoAllocateChunkSize,A=d?.cancel,U=d?.pull,L=d?.start,Q=d?.type;return{autoAllocateChunkSize:v===void 0?void 0:R(v,`${s} has member 'autoAllocateChunkSize' that`),cancel:A===void 0?void 0:nT(A,d,`${s} has member 'cancel' that`),pull:U===void 0?void 0:oT(U,d,`${s} has member 'pull' that`),start:L===void 0?void 0:iT(L,d,`${s} has member 'start' that`),type:Q===void 0?void 0:aT(Q,`${s} has member 'type' that`)}}o(rT,"convertUnderlyingDefaultOrByteSource");function nT(a,s,d){return St(a,d),v=>q(a,s,[v])}o(nT,"convertUnderlyingSourceCancelCallback");function oT(a,s,d){return St(a,d),v=>q(a,s,[v])}o(oT,"convertUnderlyingSourcePullCallback");function iT(a,s,d){return St(a,d),v=>k(a,s,[v])}o(iT,"convertUnderlyingSourceStartCallback");function aT(a,s){if(a=`${a}`,a!=="bytes")throw new TypeError(`${s} '${a}' is not a valid enumeration value for ReadableStreamType`);return a}o(aT,"convertReadableStreamType");function sT(a,s){return Rt(a,s),{preventCancel:!!a?.preventCancel}}o(sT,"convertIteratorOptions");function kf(a,s){Rt(a,s);let d=a?.preventAbort,v=a?.preventCancel,A=a?.preventClose,U=a?.signal;return U!==void 0&&uT(U,`${s} has member 'signal' that`),{preventAbort:!!d,preventCancel:!!v,preventClose:!!A,signal:U}}o(kf,"convertPipeOptions");function uT(a,s){if(!gP(a))throw new TypeError(`${s} is not an AbortSignal.`)}o(uT,"assertAbortSignal");function cT(a,s){Rt(a,s);let d=a?.readable;y(d,"readable","ReadableWritablePair"),$(d,`${s} has member 'readable' that`);let v=a?.writable;return y(v,"writable","ReadableWritablePair"),ff(v,`${s} has member 'writable' that`),{readable:d,writable:v}}o(cT,"convertReadableWritablePair");class bt{static{o(this,"ReadableStream")}constructor(s={},d={}){s===void 0?s=null:Pt(s,"First parameter");let v=Pa(d,"Second parameter"),A=rT(s,"First parameter");if(fc(this),A.type==="bytes"){if(v.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let U=ui(v,0);nP(this,A,U)}else{let U=Sa(v),L=ui(v,1);ZP(this,A,L,U)}}get locked(){if(!dn(this))throw Ln("locked");return pn(this)}cancel(s=void 0){return dn(this)?pn(this)?m(new TypeError("Cannot cancel a stream that already has a reader")):dr(this,s):m(Ln("cancel"))}getReader(s=void 0){if(!dn(this))throw Ln("getReader");return iP(s,"First parameter").mode===void 0?j(this):uf(this)}pipeThrough(s,d={}){if(!dn(this))throw Ln("pipeThrough");at(s,1,"pipeThrough");let v=cT(s,"First parameter"),A=kf(d,"Second parameter");if(pn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(uo(v.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let U=Rf(this,v.writable,A.preventClose,A.preventAbort,A.preventCancel,A.signal);return E(U),v.readable}pipeTo(s,d={}){if(!dn(this))return m(Ln("pipeTo"));if(s===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!so(s))return m(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let v;try{v=kf(d,"Second parameter")}catch(A){return m(A)}return pn(this)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):uo(s)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):Rf(this,s,v.preventClose,v.preventAbort,v.preventCancel,v.signal)}tee(){if(!dn(this))throw Ln("tee");let s=JP(this);return je(s)}values(s=void 0){if(!dn(this))throw Ln("values");let d=sT(s,"First parameter");return no(this,d.preventCancel)}[Hu](s){return this.values(s)}static from(s){return XP(s)}}Object.defineProperties(bt,{from:{enumerable:!0}}),Object.defineProperties(bt.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),i(bt.from,"from"),i(bt.prototype.cancel,"cancel"),i(bt.prototype.getReader,"getReader"),i(bt.prototype.pipeThrough,"pipeThrough"),i(bt.prototype.pipeTo,"pipeTo"),i(bt.prototype.tee,"tee"),i(bt.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bt.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty(bt.prototype,Hu,{value:bt.prototype.values,writable:!0,configurable:!0});function pi(a,s,d,v=1,A=()=>1){let U=Object.create(bt.prototype);fc(U);let L=Object.create(Hr.prototype);return Of(U,L,a,s,d,v,A),U}o(pi,"CreateReadableStream");function $f(a,s,d){let v=Object.create(bt.prototype);fc(v);let A=Object.create(qr.prototype);return sf(v,A,a,s,d,0,void 0),v}o($f,"CreateReadableByteStream");function fc(a){a._state="readable",a._reader=void 0,a._storedError=void 0,a._disturbed=!1}o(fc,"InitializeReadableStream");function dn(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_readableStreamController")?!1:a instanceof bt}o(dn,"IsReadableStream");function pn(a){return a._reader!==void 0}o(pn,"IsReadableStreamLocked");function dr(a,s){if(a._disturbed=!0,a._state==="closed")return f(void 0);if(a._state==="errored")return m(a._storedError);fi(a);let d=a._reader;if(d!==void 0&&Dn(d)){let A=d._readIntoRequests;d._readIntoRequests=new V,A.forEach(U=>{U._closeSteps(void 0)})}let v=a._readableStreamController[re](s);return T(v,e)}o(dr,"ReadableStreamCancel");function fi(a){a._state="closed";let s=a._reader;if(s!==void 0&&(ro(s),Y(s))){let d=s._readRequests;s._readRequests=new V,d.forEach(v=>{v._closeSteps()})}}o(fi,"ReadableStreamClose");function Nf(a,s){a._state="errored",a._storedError=s;let d=a._reader;d!==void 0&&(Ut(d,s),Y(d)?Ge(d,s):pf(d,s))}o(Nf,"ReadableStreamError");function Ln(a){return new TypeError(`ReadableStream.prototype.${a} can only be used on a ReadableStream`)}o(Ln,"streamBrandCheckException$1");function zf(a,s){Rt(a,s);let d=a?.highWaterMark;return y(d,"highWaterMark","QueuingStrategyInit"),{highWaterMark:P(d)}}o(zf,"convertQueuingStrategyInit");let Df=o(a=>a.byteLength,"byteLengthSizeFunction");i(Df,"size");class Na{static{o(this,"ByteLengthQueuingStrategy")}constructor(s){at(s,1,"ByteLengthQueuingStrategy"),s=zf(s,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=s.highWaterMark}get highWaterMark(){if(!jf(this))throw Uf("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!jf(this))throw Uf("size");return Df}}Object.defineProperties(Na.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Na.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function Uf(a){return new TypeError(`ByteLengthQueuingStrategy.prototype.${a} can only be used on a ByteLengthQueuingStrategy`)}o(Uf,"byteLengthBrandCheckException");function jf(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_byteLengthQueuingStrategyHighWaterMark")?!1:a instanceof Na}o(jf,"IsByteLengthQueuingStrategy");let Mf=o(()=>1,"countSizeFunction");i(Mf,"size");class za{static{o(this,"CountQueuingStrategy")}constructor(s){at(s,1,"CountQueuingStrategy"),s=zf(s,"First parameter"),this._countQueuingStrategyHighWaterMark=s.highWaterMark}get highWaterMark(){if(!Ff(this))throw Lf("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!Ff(this))throw Lf("size");return Mf}}Object.defineProperties(za.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(za.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function Lf(a){return new TypeError(`CountQueuingStrategy.prototype.${a} can only be used on a CountQueuingStrategy`)}o(Lf,"countBrandCheckException");function Ff(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_countQueuingStrategyHighWaterMark")?!1:a instanceof za}o(Ff,"IsCountQueuingStrategy");function lT(a,s){Rt(a,s);let d=a?.cancel,v=a?.flush,A=a?.readableType,U=a?.start,L=a?.transform,Q=a?.writableType;return{cancel:d===void 0?void 0:mT(d,a,`${s} has member 'cancel' that`),flush:v===void 0?void 0:dT(v,a,`${s} has member 'flush' that`),readableType:A,start:U===void 0?void 0:pT(U,a,`${s} has member 'start' that`),transform:L===void 0?void 0:fT(L,a,`${s} has member 'transform' that`),writableType:Q}}o(lT,"convertTransformer");function dT(a,s,d){return St(a,d),v=>q(a,s,[v])}o(dT,"convertTransformerFlushCallback");function pT(a,s,d){return St(a,d),v=>k(a,s,[v])}o(pT,"convertTransformerStartCallback");function fT(a,s,d){return St(a,d),(v,A)=>q(a,s,[v,A])}o(fT,"convertTransformerTransformCallback");function mT(a,s,d){return St(a,d),v=>q(a,s,[v])}o(mT,"convertTransformerCancelCallback");class Da{static{o(this,"TransformStream")}constructor(s={},d={},v={}){s===void 0&&(s=null);let A=Pa(d,"Second parameter"),U=Pa(v,"Third parameter"),L=lT(s,"First parameter");if(L.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(L.writableType!==void 0)throw new RangeError("Invalid writableType specified");let Q=ui(U,0),ue=Sa(U),oe=ui(A,1),he=Sa(A),ve,Le=p(pr=>{ve=pr});hT(this,Le,oe,he,Q,ue),yT(this,L),L.start!==void 0?ve(L.start(this._transformStreamController)):ve(void 0)}get readable(){if(!Bf(this))throw Gf("readable");return this._readable}get writable(){if(!Bf(this))throw Gf("writable");return this._writable}}Object.defineProperties(Da.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Da.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function hT(a,s,d,v,A,U){function L(){return s}o(L,"startAlgorithm");function Q(Le){return vT(a,Le)}o(Q,"writeAlgorithm");function ue(Le){return ET(a,Le)}o(ue,"abortAlgorithm");function oe(){return ST(a)}o(oe,"closeAlgorithm"),a._writable=bP(L,Q,oe,ue,d,v);function he(){return PT(a)}o(he,"pullAlgorithm");function ve(Le){return TT(a,Le)}o(ve,"cancelAlgorithm"),a._readable=pi(L,he,ve,A,U),a._backpressure=void 0,a._backpressureChangePromise=void 0,a._backpressureChangePromise_resolve=void 0,Ua(a,!0),a._transformStreamController=void 0}o(hT,"InitializeTransformStream");function Bf(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_transformStreamController")?!1:a instanceof Da}o(Bf,"IsTransformStream");function qf(a,s){lr(a._readable._readableStreamController,s),mc(a,s)}o(qf,"TransformStreamError");function mc(a,s){Ma(a._transformStreamController),ci(a._writable._writableStreamController,s),hc(a)}o(mc,"TransformStreamErrorWritableAndUnblockWrite");function hc(a){a._backpressure&&Ua(a,!1)}o(hc,"TransformStreamUnblockWrite");function Ua(a,s){a._backpressureChangePromise!==void 0&&a._backpressureChangePromise_resolve(),a._backpressureChangePromise=p(d=>{a._backpressureChangePromise_resolve=d}),a._backpressure=s}o(Ua,"TransformStreamSetBackpressure");class fn{static{o(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!ja(this))throw La("desiredSize");let s=this._controlledTransformStream._readable._readableStreamController;return pc(s)}enqueue(s=void 0){if(!ja(this))throw La("enqueue");Vf(this,s)}error(s=void 0){if(!ja(this))throw La("error");_T(this,s)}terminate(){if(!ja(this))throw La("terminate");bT(this)}}Object.defineProperties(fn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),i(fn.prototype.enqueue,"enqueue"),i(fn.prototype.error,"error"),i(fn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function ja(a){return!r(a)||!Object.prototype.hasOwnProperty.call(a,"_controlledTransformStream")?!1:a instanceof fn}o(ja,"IsTransformStreamDefaultController");function gT(a,s,d,v,A){s._controlledTransformStream=a,a._transformStreamController=s,s._transformAlgorithm=d,s._flushAlgorithm=v,s._cancelAlgorithm=A,s._finishPromise=void 0,s._finishPromise_resolve=void 0,s._finishPromise_reject=void 0}o(gT,"SetUpTransformStreamDefaultController");function yT(a,s){let d=Object.create(fn.prototype),v,A,U;s.transform!==void 0?v=o(L=>s.transform(L,d),"transformAlgorithm"):v=o(L=>{try{return Vf(d,L),f(void 0)}catch(Q){return m(Q)}},"transformAlgorithm"),s.flush!==void 0?A=o(()=>s.flush(d),"flushAlgorithm"):A=o(()=>f(void 0),"flushAlgorithm"),s.cancel!==void 0?U=o(L=>s.cancel(L),"cancelAlgorithm"):U=o(()=>f(void 0),"cancelAlgorithm"),gT(a,d,v,A,U)}o(yT,"SetUpTransformStreamDefaultControllerFromTransformer");function Ma(a){a._transformAlgorithm=void 0,a._flushAlgorithm=void 0,a._cancelAlgorithm=void 0}o(Ma,"TransformStreamDefaultControllerClearAlgorithms");function Vf(a,s){let d=a._controlledTransformStream,v=d._readable._readableStreamController;if(!po(v))throw new TypeError("Readable side is not in a state that permits enqueue");try{lo(v,s)}catch(U){throw mc(d,U),d._readable._storedError}WP(v)!==d._backpressure&&Ua(d,!0)}o(Vf,"TransformStreamDefaultControllerEnqueue");function _T(a,s){qf(a._controlledTransformStream,s)}o(_T,"TransformStreamDefaultControllerError");function Hf(a,s){let d=a._transformAlgorithm(s);return T(d,void 0,v=>{throw qf(a._controlledTransformStream,v),v})}o(Hf,"TransformStreamDefaultControllerPerformTransform");function bT(a){let s=a._controlledTransformStream,d=s._readable._readableStreamController;Mn(d);let v=new TypeError("TransformStream terminated");mc(s,v)}o(bT,"TransformStreamDefaultControllerTerminate");function vT(a,s){let d=a._transformStreamController;if(a._backpressure){let v=a._backpressureChangePromise;return T(v,()=>{let A=a._writable;if(A._state==="erroring")throw A._storedError;return Hf(d,s)})}return Hf(d,s)}o(vT,"TransformStreamDefaultSinkWriteAlgorithm");function ET(a,s){let d=a._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let v=a._readable;d._finishPromise=p((U,L)=>{d._finishPromise_resolve=U,d._finishPromise_reject=L});let A=d._cancelAlgorithm(s);return Ma(d),S(A,()=>(v._state==="errored"?fo(d,v._storedError):(lr(v._readableStreamController,s),gc(d)),null),U=>(lr(v._readableStreamController,U),fo(d,U),null)),d._finishPromise}o(ET,"TransformStreamDefaultSinkAbortAlgorithm");function ST(a){let s=a._transformStreamController;if(s._finishPromise!==void 0)return s._finishPromise;let d=a._readable;s._finishPromise=p((A,U)=>{s._finishPromise_resolve=A,s._finishPromise_reject=U});let v=s._flushAlgorithm();return Ma(s),S(v,()=>(d._state==="errored"?fo(s,d._storedError):(Mn(d._readableStreamController),gc(s)),null),A=>(lr(d._readableStreamController,A),fo(s,A),null)),s._finishPromise}o(ST,"TransformStreamDefaultSinkCloseAlgorithm");function PT(a){return Ua(a,!1),a._backpressureChangePromise}o(PT,"TransformStreamDefaultSourcePullAlgorithm");function TT(a,s){let d=a._transformStreamController;if(d._finishPromise!==void 0)return d._finishPromise;let v=a._writable;d._finishPromise=p((U,L)=>{d._finishPromise_resolve=U,d._finishPromise_reject=L});let A=d._cancelAlgorithm(s);return Ma(d),S(A,()=>(v._state==="errored"?fo(d,v._storedError):(ci(v._writableStreamController,s),hc(a),gc(d)),null),U=>(ci(v._writableStreamController,U),hc(a),fo(d,U),null)),d._finishPromise}o(TT,"TransformStreamDefaultSourceCancelAlgorithm");function La(a){return new TypeError(`TransformStreamDefaultController.prototype.${a} can only be used on a TransformStreamDefaultController`)}o(La,"defaultControllerBrandCheckException");function gc(a){a._finishPromise_resolve!==void 0&&(a._finishPromise_resolve(),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(gc,"defaultControllerFinishPromiseResolve");function fo(a,s){a._finishPromise_reject!==void 0&&(E(a._finishPromise),a._finishPromise_reject(s),a._finishPromise_resolve=void 0,a._finishPromise_reject=void 0)}o(fo,"defaultControllerFinishPromiseReject");function Gf(a){return new TypeError(`TransformStream.prototype.${a} can only be used on a TransformStream`)}o(Gf,"streamBrandCheckException"),t.ByteLengthQueuingStrategy=Na,t.CountQueuingStrategy=za,t.ReadableByteStreamController=qr,t.ReadableStream=bt,t.ReadableStreamBYOBReader=cn,t.ReadableStreamBYOBRequest=$n,t.ReadableStreamDefaultController=Hr,t.ReadableStreamDefaultReader=F,t.TransformStream=Da,t.TransformStreamDefaultController=fn,t.WritableStream=ln,t.WritableStreamDefaultController=co,t.WritableStreamDefaultWriter=Vr}))});var mb=M(()=>{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,fb())}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(u){let l=await i.slice(n,Math.min(i.size,n+65536)).arrayBuffer();n+=l.byteLength,u.enqueue(new Uint8Array(l)),n===i.size&&u.close()}})},"name"))}catch{}});async function*Dl(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 u=Math.min(i-n,hb),c=r.buffer.slice(n,n+u);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+hb)).arrayBuffer();n+=c.byteLength,yield new Uint8Array(c)}}}var BW,hb,gb,oC,gr,Li=ct(()=>{BW=gt(mb(),1);hb=65536;o(Dl,"toIterator");gb=class Ul{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 u of e){let c;ArrayBuffer.isView(u)?c=new Uint8Array(u.buffer.slice(u.byteOffset,u.byteOffset+u.byteLength)):u instanceof ArrayBuffer?c=new Uint8Array(u.slice(0)):u instanceof Ul?c=u:c=n.encode(`${u}`),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 Dl(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 Dl(this.#e,!1))e.set(n,r),r+=n.length;return e.buffer}stream(){let e=Dl(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,u=e<0?Math.max(i+e,0):Math.min(e,i),c=r<0?Math.max(i+r,0):Math.min(r,i),l=Math.max(c-u,0),p=this.#e,f=[],m=0;for(let S of p){if(m>=l)break;let h=ArrayBuffer.isView(S)?S.byteLength:S.size;if(u&&h<=u)u-=h,c-=h;else{let _;ArrayBuffer.isView(S)?(_=S.subarray(u,Math.min(h,c)),m+=_.byteLength):(_=S.slice(u,Math.min(h,c)),m+=_.size),c-=h,f.push(_),u=0}}let g=new Ul([],{type:String(n).toLowerCase()});return g.#r=l,g.#e=f,g}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(gb.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});oC=gb,gr=oC});var iC,aC,xn,jl=ct(()=>{Li();iC=class extends gr{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 gr&&/^(File)$/.test(e[Symbol.toStringTag])}},aC=iC,xn=aC});function bb(t,e=gr){var r=`${yb()}${yb()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),n=[],i=`--${r}\r
|
|
15
|
-
Content-Disposition: form-data; name="`;return
|
|
10
|
+
`);if(y===-1){Gp("have not received end of HTTP headers yet..."),i();return}let h=g.slice(0,y).toString("ascii").split(`\r
|
|
11
|
+
`),_=h.shift();if(!_)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let P=_.split(" "),x=+P[1],S=P.slice(2).join(" "),$={};for(let V of h){if(!V)continue;let W=V.indexOf(":");if(W===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${V}"`));let Z=V.slice(0,W).toLowerCase(),G=V.slice(W+1).trimStart(),te=$[Z];typeof te=="string"?$[Z]=[te,G]:Array.isArray(te)?te.push(G):$[Z]=G}Gp("got proxy server response: %o %o",_,$),s(),t({connect:{statusCode:x,statusText:S,headers:$},buffered:g})}a(p,"ondata"),e.on("error",d),e.on("end",u),i()})}a(f1,"parseProxyResponse");da.parseProxyResponse=f1});var vR=B(Rr=>{"use strict";var m1=Rr&&Rr.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),h1=Rr&&Rr.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),_R=Rr&&Rr.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&m1(t,e,n);return h1(t,e),t},bR=Rr&&Rr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.HttpsProxyAgent=void 0;var Wp=_R(require("net")),hR=_R(require("tls")),g1=bR(require("assert")),y1=bR(Nb()),_1=fR(),b1=require("url"),v1=mR(),Lc=(0,y1.default)("https-proxy-agent"),gR=a(e=>e.servername===void 0&&e.host&&!Wp.isIP(e.host)?{...e,servername:e.host}:e,"setServernameFromNonIpHost"),Jp=class extends _1.Agent{static{a(this,"HttpsProxyAgent")}constructor(t,n){super(n),this.options={path:void 0},this.proxy=typeof t=="string"?new b1.URL(t):t,this.proxyHeaders=n?.headers??{},Lc("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?yR(n,"headers"):null,host:o,port:r}}async connect(t,n){let{proxy:o}=this;if(!n.host)throw new TypeError('No "host" provided');let r;o.protocol==="https:"?(Lc("Creating `tls.Socket`: %o",this.connectOpts),r=hR.connect(gR(this.connectOpts))):(Lc("Creating `net.Socket`: %o",this.connectOpts),r=Wp.connect(this.connectOpts));let i=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},s=Wp.isIPv6(n.host)?`[${n.host}]`:n.host,u=`CONNECT ${s}:${n.port} HTTP/1.1\r
|
|
12
|
+
`;if(o.username||o.password){let y=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;i["Proxy-Authorization"]=`Basic ${Buffer.from(y).toString("base64")}`}i.Host=`${s}:${n.port}`,i["Proxy-Connection"]||(i["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let y of Object.keys(i))u+=`${y}: ${i[y]}\r
|
|
13
|
+
`;let d=(0,v1.parseProxyResponse)(r);r.write(`${u}\r
|
|
14
|
+
`);let{connect:p,buffered:f}=await d;if(t.emit("proxyConnect",p),this.emit("proxyConnect",p,t),p.statusCode===200)return t.once("socket",E1),n.secureEndpoint?(Lc("Upgrading socket connection to TLS"),hR.connect({...yR(gR(n),"host","path","port"),socket:r})):r;r.destroy();let g=new Wp.Socket({writable:!1});return g.readable=!0,t.once("socket",y=>{Lc("Replaying proxy buffer for failed request"),(0,g1.default)(y.listenerCount("data")>0),y.push(f),y.push(null)}),g}};Jp.protocols=["http","https"];Rr.HttpsProxyAgent=Jp;function E1(e){e.resume()}a(E1,"resume");function yR(e,...t){let n={},o;for(o in e)t.includes(o)||(n[o]=e[o]);return n}a(yR,"omit")});function S1(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");let t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let n=e.substring(5,t).split(";"),o="",r=!1,i=n[0]||"text/plain",s=i;for(let f=1;f<n.length;f++)n[f]==="base64"?r=!0:n[f]&&(s+=`;${n[f]}`,n[f].indexOf("charset=")===0&&(o=n[f].substring(8)));!n[0]&&!o.length&&(s+=";charset=US-ASCII",o="US-ASCII");let u=r?"base64":"ascii",d=unescape(e.substring(t+1)),p=Buffer.from(d,u);return p.type=i,p.typeFull=s,p.charset=o,p}var ER,SR=_t(()=>{a(S1,"dataUriToBuffer");ER=S1});var xR=B((Kp,PR)=>{(function(e,t){typeof Kp=="object"&&typeof PR<"u"?t(Kp):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.WebStreamsPolyfill={}))})(Kp,(function(e){"use strict";function t(){}a(t,"noop");function n(c){return typeof c=="object"&&c!==null||typeof c=="function"}a(n,"typeIsObject");let o=t;function r(c,l){try{Object.defineProperty(c,"name",{value:l,configurable:!0})}catch{}}a(r,"setFunctionName");let i=Promise,s=Promise.prototype.then,u=Promise.reject.bind(i);function d(c){return new i(c)}a(d,"newPromise");function p(c){return d(l=>l(c))}a(p,"promiseResolvedWith");function f(c){return u(c)}a(f,"promiseRejectedWith");function g(c,l,m){return s.call(c,l,m)}a(g,"PerformPromiseThen");function y(c,l,m){g(g(c,l,m),void 0,o)}a(y,"uponPromise");function h(c,l){y(c,l)}a(h,"uponFulfillment");function _(c,l){y(c,void 0,l)}a(_,"uponRejection");function P(c,l,m){return g(c,l,m)}a(P,"transformPromiseWith");function x(c){g(c,void 0,o)}a(x,"setPromiseIsHandledToTrue");let S=a(c=>{if(typeof queueMicrotask=="function")S=queueMicrotask;else{let l=p(void 0);S=a(m=>g(l,m),"_queueMicrotask")}return S(c)},"_queueMicrotask");function $(c,l,m){if(typeof c!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(c,l,m)}a($,"reflectCall");function V(c,l,m){try{return p($(c,l,m))}catch(E){return f(E)}}a(V,"promiseCall");let W=16384;class Z{static{a(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(l){let m=this._back,E=m;m._elements.length===W-1&&(E={_elements:[],_next:void 0}),m._elements.push(l),E!==m&&(this._back=E,m._next=E),++this._size}shift(){let l=this._front,m=l,E=this._cursor,I=E+1,j=l._elements,q=j[E];return I===W&&(m=l._next,I=0),--this._size,this._cursor=I,l!==m&&(this._front=m),j[E]=void 0,q}forEach(l){let m=this._cursor,E=this._front,I=E._elements;for(;(m!==I.length||E._next!==void 0)&&!(m===I.length&&(E=E._next,I=E._elements,m=0,I.length===0));)l(I[m]),++m}peek(){let l=this._front,m=this._cursor;return l._elements[m]}}let G=Symbol("[[AbortSteps]]"),te=Symbol("[[ErrorSteps]]"),ce=Symbol("[[CancelSteps]]"),Y=Symbol("[[PullSteps]]"),Ze=Symbol("[[ReleaseSteps]]");function we(c,l){c._ownerReadableStream=l,l._reader=c,l._state==="readable"?Ve(c):l._state==="closed"?ot(c):et(c,l._storedError)}a(we,"ReadableStreamReaderGenericInitialize");function Te(c,l){let m=c._ownerReadableStream;return Dr(m,l)}a(Te,"ReadableStreamReaderGenericCancel");function Me(c){let l=c._ownerReadableStream;l._state==="readable"?nr(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):Dt(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),l._readableStreamController[Ze](),l._reader=void 0,c._ownerReadableStream=void 0}a(Me,"ReadableStreamReaderGenericRelease");function je(c){return new TypeError("Cannot "+c+" a stream using a released reader")}a(je,"readerLockException");function Ve(c){c._closedPromise=d((l,m)=>{c._closedPromise_resolve=l,c._closedPromise_reject=m})}a(Ve,"defaultReaderClosedPromiseInitialize");function et(c,l){Ve(c),nr(c,l)}a(et,"defaultReaderClosedPromiseInitializeAsRejected");function ot(c){Ve(c),ai(c)}a(ot,"defaultReaderClosedPromiseInitializeAsResolved");function nr(c,l){c._closedPromise_reject!==void 0&&(x(c._closedPromise),c._closedPromise_reject(l),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}a(nr,"defaultReaderClosedPromiseReject");function Dt(c,l){et(c,l)}a(Dt,"defaultReaderClosedPromiseResetToRejected");function ai(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}a(ai,"defaultReaderClosedPromiseResolve");let Yr=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)},Na=Math.trunc||function(c){return c<0?Math.ceil(c):Math.floor(c)};function ee(c){return typeof c=="object"||typeof c=="function"}a(ee,"isDictionary");function Zt(c,l){if(c!==void 0&&!ee(c))throw new TypeError(`${l} is not an object.`)}a(Zt,"assertDictionary");function Ut(c,l){if(typeof c!="function")throw new TypeError(`${l} is not a function.`)}a(Ut,"assertFunction");function Da(c){return typeof c=="object"&&c!==null||typeof c=="function"}a(Da,"isObject");function jt(c,l){if(!Da(c))throw new TypeError(`${l} is not an object.`)}a(jt,"assertObject");function mt(c,l,m){if(c===void 0)throw new TypeError(`Parameter ${l} is required in '${m}'.`)}a(mt,"assertRequiredArgument");function v(c,l,m){if(c===void 0)throw new TypeError(`${l} is required in '${m}'.`)}a(v,"assertRequiredField");function T(c){return Number(c)}a(T,"convertUnrestrictedDouble");function w(c){return c===0?0:c}a(w,"censorNegativeZero");function D(c){return w(Na(c))}a(D,"integerPart");function O(c,l){let E=Number.MAX_SAFE_INTEGER,I=Number(c);if(I=w(I),!Yr(I))throw new TypeError(`${l} is not a finite number`);if(I=D(I),I<0||I>E)throw new TypeError(`${l} is outside the accepted range of 0 to ${E}, inclusive`);return!Yr(I)||I===0?0:I}a(O,"convertUnsignedLongLongWithEnforceRange");function z(c,l){if(!Fn(c))throw new TypeError(`${l} is not a ReadableStream.`)}a(z,"assertReadableStream");function M(c){return new H(c)}a(M,"AcquireReadableStreamDefaultReader");function R(c,l){c._reader._readRequests.push(l)}a(R,"ReadableStreamAddReadRequest");function C(c,l,m){let I=c._reader._readRequests.shift();m?I._closeSteps():I._chunkSteps(l)}a(C,"ReadableStreamFulfillReadRequest");function U(c){return c._reader._readRequests.length}a(U,"ReadableStreamGetNumReadRequests");function N(c){let l=c._reader;return!(l===void 0||!ie(l))}a(N,"ReadableStreamHasDefaultReader");class H{static{a(this,"ReadableStreamDefaultReader")}constructor(l){if(mt(l,1,"ReadableStreamDefaultReader"),z(l,"First parameter"),Bn(l))throw new TypeError("This stream has already been locked for exclusive reading by another reader");we(this,l),this._readRequests=new Z}get closed(){return ie(this)?this._closedPromise:f(rt("closed"))}cancel(l=void 0){return ie(this)?this._ownerReadableStream===void 0?f(je("cancel")):Te(this,l):f(rt("cancel"))}read(){if(!ie(this))return f(rt("read"));if(this._ownerReadableStream===void 0)return f(je("read from"));let l,m,E=d((j,q)=>{l=j,m=q});return se(this,{_chunkSteps:a(j=>l({value:j,done:!1}),"_chunkSteps"),_closeSteps:a(()=>l({value:void 0,done:!0}),"_closeSteps"),_errorSteps:a(j=>m(j),"_errorSteps")}),E}releaseLock(){if(!ie(this))throw rt("releaseLock");this._ownerReadableStream!==void 0&&Ne(this)}}Object.defineProperties(H.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),r(H.prototype.cancel,"cancel"),r(H.prototype.read,"read"),r(H.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(H.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function ie(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readRequests")?!1:c instanceof H}a(ie,"IsReadableStreamDefaultReader");function se(c,l){let m=c._ownerReadableStream;m._disturbed=!0,m._state==="closed"?l._closeSteps():m._state==="errored"?l._errorSteps(m._storedError):m._readableStreamController[Y](l)}a(se,"ReadableStreamDefaultReaderRead");function Ne(c){Me(c);let l=new TypeError("Reader was released");tt(c,l)}a(Ne,"ReadableStreamDefaultReaderRelease");function tt(c,l){let m=c._readRequests;c._readRequests=new Z,m.forEach(E=>{E._errorSteps(l)})}a(tt,"ReadableStreamDefaultReaderErrorReadRequests");function rt(c){return new TypeError(`ReadableStreamDefaultReader.prototype.${c} can only be used on a ReadableStreamDefaultReader`)}a(rt,"defaultReaderBrandCheckException");let $e=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class Fe{static{a(this,"ReadableStreamAsyncIteratorImpl")}constructor(l,m){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=l,this._preventCancel=m}next(){let l=a(()=>this._nextSteps(),"nextSteps");return this._ongoingPromise=this._ongoingPromise?P(this._ongoingPromise,l,l):l(),this._ongoingPromise}return(l){let m=a(()=>this._returnSteps(l),"returnSteps");return this._ongoingPromise?P(this._ongoingPromise,m,m):m()}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let l=this._reader,m,E,I=d((q,oe)=>{m=q,E=oe});return se(l,{_chunkSteps:a(q=>{this._ongoingPromise=void 0,S(()=>m({value:q,done:!1}))},"_chunkSteps"),_closeSteps:a(()=>{this._ongoingPromise=void 0,this._isFinished=!0,Me(l),m({value:void 0,done:!0})},"_closeSteps"),_errorSteps:a(q=>{this._ongoingPromise=void 0,this._isFinished=!0,Me(l),E(q)},"_errorSteps")}),I}_returnSteps(l){if(this._isFinished)return Promise.resolve({value:l,done:!0});this._isFinished=!0;let m=this._reader;if(!this._preventCancel){let E=Te(m,l);return Me(m),P(E,()=>({value:l,done:!0}))}return Me(m),p({value:l,done:!0})}}let ht={next(){return ci(this)?this._asyncIteratorImpl.next():f(ui("next"))},return(c){return ci(this)?this._asyncIteratorImpl.return(c):f(ui("return"))}};Object.setPrototypeOf(ht,$e);function si(c,l){let m=M(c),E=new Fe(m,l),I=Object.create(ht);return I._asyncIteratorImpl=E,I}a(si,"AcquireReadableStreamAsyncIterator");function ci(c){if(!n(c)||!Object.prototype.hasOwnProperty.call(c,"_asyncIteratorImpl"))return!1;try{return c._asyncIteratorImpl instanceof Fe}catch{return!1}}a(ci,"IsReadableStreamAsyncIterator");function ui(c){return new TypeError(`ReadableStreamAsyncIterator.${c} can only be used on a ReadableSteamAsyncIterator`)}a(ui,"streamAsyncIteratorBrandCheckException");let or=Number.isNaN||function(c){return c!==c};var hn,Ct,gt;function He(c){return c.slice()}a(He,"CreateArrayFromList");function HE(c,l,m,E,I){new Uint8Array(c).set(new Uint8Array(m,E,I),l)}a(HE,"CopyDataBlockBytes");let gn=a(c=>(typeof c.transfer=="function"?gn=a(l=>l.transfer(),"TransferArrayBuffer"):typeof structuredClone=="function"?gn=a(l=>structuredClone(l,{transfer:[l]}),"TransferArrayBuffer"):gn=a(l=>l,"TransferArrayBuffer"),gn(c)),"TransferArrayBuffer"),Un=a(c=>(typeof c.detached=="boolean"?Un=a(l=>l.detached,"IsDetachedBuffer"):Un=a(l=>l.byteLength===0,"IsDetachedBuffer"),Un(c)),"IsDetachedBuffer");function GE(c,l,m){if(c.slice)return c.slice(l,m);let E=m-l,I=new ArrayBuffer(E);return HE(I,0,c,l,E),I}a(GE,"ArrayBufferSlice");function gu(c,l){let m=c[l];if(m!=null){if(typeof m!="function")throw new TypeError(`${String(l)} is not a function`);return m}}a(gu,"GetMethod");function t0(c){let l={[Symbol.iterator]:()=>c.iterator},m=(async function*(){return yield*l})(),E=m.next;return{iterator:m,nextMethod:E,done:!1}}a(t0,"CreateAsyncFromSyncIterator");let um=(gt=(hn=Symbol.asyncIterator)!==null&&hn!==void 0?hn:(Ct=Symbol.for)===null||Ct===void 0?void 0:Ct.call(Symbol,"Symbol.asyncIterator"))!==null&>!==void 0?gt:"@@asyncIterator";function WE(c,l="sync",m){if(m===void 0)if(l==="async"){if(m=gu(c,um),m===void 0){let j=gu(c,Symbol.iterator),q=WE(c,"sync",j);return t0(q)}}else m=gu(c,Symbol.iterator);if(m===void 0)throw new TypeError("The object is not iterable");let E=$(m,c,[]);if(!n(E))throw new TypeError("The iterator method must return an object");let I=E.next;return{iterator:E,nextMethod:I,done:!1}}a(WE,"GetIterator");function r0(c){let l=$(c.nextMethod,c.iterator,[]);if(!n(l))throw new TypeError("The iterator.next() method must return an object");return l}a(r0,"IteratorNext");function n0(c){return!!c.done}a(n0,"IteratorComplete");function o0(c){return c.value}a(o0,"IteratorValue");function i0(c){return!(typeof c!="number"||or(c)||c<0)}a(i0,"IsNonNegativeNumber");function JE(c){let l=GE(c.buffer,c.byteOffset,c.byteOffset+c.byteLength);return new Uint8Array(l)}a(JE,"CloneAsUint8Array");function lm(c){let l=c._queue.shift();return c._queueTotalSize-=l.size,c._queueTotalSize<0&&(c._queueTotalSize=0),l.value}a(lm,"DequeueValue");function dm(c,l,m){if(!i0(m)||m===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");c._queue.push({value:l,size:m}),c._queueTotalSize+=m}a(dm,"EnqueueValueWithSize");function a0(c){return c._queue.peek().value}a(a0,"PeekQueueValue");function jn(c){c._queue=new Z,c._queueTotalSize=0}a(jn,"ResetQueue");function KE(c){return c===DataView}a(KE,"isDataViewConstructor");function s0(c){return KE(c.constructor)}a(s0,"isDataView");function c0(c){return KE(c)?1:c.BYTES_PER_ELEMENT}a(c0,"arrayBufferViewElementSize");class _o{static{a(this,"ReadableStreamBYOBRequest")}constructor(){throw new TypeError("Illegal constructor")}get view(){if(!pm(this))throw ym("view");return this._view}respond(l){if(!pm(this))throw ym("respond");if(mt(l,1,"respond"),l=O(l,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");if(Un(this._view.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be used as a response");vu(this._associatedReadableByteStreamController,l)}respondWithNewView(l){if(!pm(this))throw ym("respondWithNewView");if(mt(l,1,"respondWithNewView"),!ArrayBuffer.isView(l))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(Un(l.buffer))throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");Eu(this._associatedReadableByteStreamController,l)}}Object.defineProperties(_o.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),r(_o.prototype.respond,"respond"),r(_o.prototype.respondWithNewView,"respondWithNewView"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_o.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});class yn{static{a(this,"ReadableByteStreamController")}constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!bo(this))throw ja("byobRequest");return gm(this)}get desiredSize(){if(!bo(this))throw ja("desiredSize");return aS(this)}close(){if(!bo(this))throw ja("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");let l=this._controlledReadableByteStream._state;if(l!=="readable")throw new TypeError(`The stream (in ${l} state) is not in the readable state and cannot be closed`);Ua(this)}enqueue(l){if(!bo(this))throw ja("enqueue");if(mt(l,1,"enqueue"),!ArrayBuffer.isView(l))throw new TypeError("chunk must be an array buffer view");if(l.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(l.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`);bu(this,l)}error(l=void 0){if(!bo(this))throw ja("error");Sr(this,l)}[ce](l){XE(this),jn(this);let m=this._cancelAlgorithm(l);return _u(this),m}[Y](l){let m=this._controlledReadableByteStream;if(this._queueTotalSize>0){iS(this,l);return}let E=this._autoAllocateChunkSize;if(E!==void 0){let I;try{I=new ArrayBuffer(E)}catch(q){l._errorSteps(q);return}let j={buffer:I,bufferByteLength:E,byteOffset:0,byteLength:E,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(j)}R(m,l),vo(this)}[Ze](){if(this._pendingPullIntos.length>0){let l=this._pendingPullIntos.peek();l.readerType="none",this._pendingPullIntos=new Z,this._pendingPullIntos.push(l)}}}Object.defineProperties(yn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),r(yn.prototype.close,"close"),r(yn.prototype.enqueue,"enqueue"),r(yn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(yn.prototype,Symbol.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function bo(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableByteStream")?!1:c instanceof yn}a(bo,"IsReadableByteStreamController");function pm(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_associatedReadableByteStreamController")?!1:c instanceof _o}a(pm,"IsReadableStreamBYOBRequest");function vo(c){if(!f0(c))return;if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;let m=c._pullAlgorithm();y(m,()=>(c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,vo(c)),null),E=>(Sr(c,E),null))}a(vo,"ReadableByteStreamControllerCallPullIfNeeded");function XE(c){mm(c),c._pendingPullIntos=new Z}a(XE,"ReadableByteStreamControllerClearPendingPullIntos");function fm(c,l){let m=!1;c._state==="closed"&&(m=!0);let E=QE(l);l.readerType==="default"?C(c,E,m):b0(c,E,m)}a(fm,"ReadableByteStreamControllerCommitPullIntoDescriptor");function QE(c){let l=c.bytesFilled,m=c.elementSize;return new c.viewConstructor(c.buffer,c.byteOffset,l/m)}a(QE,"ReadableByteStreamControllerConvertPullIntoDescriptor");function yu(c,l,m,E){c._queue.push({buffer:l,byteOffset:m,byteLength:E}),c._queueTotalSize+=E}a(yu,"ReadableByteStreamControllerEnqueueChunkToQueue");function YE(c,l,m,E){let I;try{I=GE(l,m,m+E)}catch(j){throw Sr(c,j),j}yu(c,I,0,E)}a(YE,"ReadableByteStreamControllerEnqueueClonedChunkToQueue");function eS(c,l){l.bytesFilled>0&&YE(c,l.buffer,l.byteOffset,l.bytesFilled),li(c)}a(eS,"ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue");function tS(c,l){let m=Math.min(c._queueTotalSize,l.byteLength-l.bytesFilled),E=l.bytesFilled+m,I=m,j=!1,q=E%l.elementSize,oe=E-q;oe>=l.minimumFill&&(I=oe-l.bytesFilled,j=!0);let ye=c._queue;for(;I>0;){let ue=ye.peek(),Ee=Math.min(I,ue.byteLength),Ae=l.byteOffset+l.bytesFilled;HE(l.buffer,Ae,ue.buffer,ue.byteOffset,Ee),ue.byteLength===Ee?ye.shift():(ue.byteOffset+=Ee,ue.byteLength-=Ee),c._queueTotalSize-=Ee,rS(c,Ee,l),I-=Ee}return j}a(tS,"ReadableByteStreamControllerFillPullIntoDescriptorFromQueue");function rS(c,l,m){m.bytesFilled+=l}a(rS,"ReadableByteStreamControllerFillHeadPullIntoDescriptor");function nS(c){c._queueTotalSize===0&&c._closeRequested?(_u(c),Va(c._controlledReadableByteStream)):vo(c)}a(nS,"ReadableByteStreamControllerHandleQueueDrain");function mm(c){c._byobRequest!==null&&(c._byobRequest._associatedReadableByteStreamController=void 0,c._byobRequest._view=null,c._byobRequest=null)}a(mm,"ReadableByteStreamControllerInvalidateBYOBRequest");function hm(c){for(;c._pendingPullIntos.length>0;){if(c._queueTotalSize===0)return;let l=c._pendingPullIntos.peek();tS(c,l)&&(li(c),fm(c._controlledReadableByteStream,l))}}a(hm,"ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue");function u0(c){let l=c._controlledReadableByteStream._reader;for(;l._readRequests.length>0;){if(c._queueTotalSize===0)return;let m=l._readRequests.shift();iS(c,m)}}a(u0,"ReadableByteStreamControllerProcessReadRequestsUsingQueue");function l0(c,l,m,E){let I=c._controlledReadableByteStream,j=l.constructor,q=c0(j),{byteOffset:oe,byteLength:ye}=l,ue=m*q,Ee;try{Ee=gn(l.buffer)}catch(Ke){E._errorSteps(Ke);return}let Ae={buffer:Ee,bufferByteLength:Ee.byteLength,byteOffset:oe,byteLength:ye,bytesFilled:0,minimumFill:ue,elementSize:q,viewConstructor:j,readerType:"byob"};if(c._pendingPullIntos.length>0){c._pendingPullIntos.push(Ae),uS(I,E);return}if(I._state==="closed"){let Ke=new j(Ae.buffer,Ae.byteOffset,0);E._closeSteps(Ke);return}if(c._queueTotalSize>0){if(tS(c,Ae)){let Ke=QE(Ae);nS(c),E._chunkSteps(Ke);return}if(c._closeRequested){let Ke=new TypeError("Insufficient bytes to fill elements in the given buffer");Sr(c,Ke),E._errorSteps(Ke);return}}c._pendingPullIntos.push(Ae),uS(I,E),vo(c)}a(l0,"ReadableByteStreamControllerPullInto");function d0(c,l){l.readerType==="none"&&li(c);let m=c._controlledReadableByteStream;if(_m(m))for(;lS(m)>0;){let E=li(c);fm(m,E)}}a(d0,"ReadableByteStreamControllerRespondInClosedState");function p0(c,l,m){if(rS(c,l,m),m.readerType==="none"){eS(c,m),hm(c);return}if(m.bytesFilled<m.minimumFill)return;li(c);let E=m.bytesFilled%m.elementSize;if(E>0){let I=m.byteOffset+m.bytesFilled;YE(c,m.buffer,I-E,E)}m.bytesFilled-=E,fm(c._controlledReadableByteStream,m),hm(c)}a(p0,"ReadableByteStreamControllerRespondInReadableState");function oS(c,l){let m=c._pendingPullIntos.peek();mm(c),c._controlledReadableByteStream._state==="closed"?d0(c,m):p0(c,l,m),vo(c)}a(oS,"ReadableByteStreamControllerRespondInternal");function li(c){return c._pendingPullIntos.shift()}a(li,"ReadableByteStreamControllerShiftPendingPullInto");function f0(c){let l=c._controlledReadableByteStream;return l._state!=="readable"||c._closeRequested||!c._started?!1:!!(N(l)&&U(l)>0||_m(l)&&lS(l)>0||aS(c)>0)}a(f0,"ReadableByteStreamControllerShouldCallPull");function _u(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0}a(_u,"ReadableByteStreamControllerClearAlgorithms");function Ua(c){let l=c._controlledReadableByteStream;if(!(c._closeRequested||l._state!=="readable")){if(c._queueTotalSize>0){c._closeRequested=!0;return}if(c._pendingPullIntos.length>0){let m=c._pendingPullIntos.peek();if(m.bytesFilled%m.elementSize!==0){let E=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Sr(c,E),E}}_u(c),Va(l)}}a(Ua,"ReadableByteStreamControllerClose");function bu(c,l){let m=c._controlledReadableByteStream;if(c._closeRequested||m._state!=="readable")return;let{buffer:E,byteOffset:I,byteLength:j}=l;if(Un(E))throw new TypeError("chunk's buffer is detached and so cannot be enqueued");let q=gn(E);if(c._pendingPullIntos.length>0){let oe=c._pendingPullIntos.peek();if(Un(oe.buffer))throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");mm(c),oe.buffer=gn(oe.buffer),oe.readerType==="none"&&eS(c,oe)}if(N(m))if(u0(c),U(m)===0)yu(c,q,I,j);else{c._pendingPullIntos.length>0&&li(c);let oe=new Uint8Array(q,I,j);C(m,oe,!1)}else _m(m)?(yu(c,q,I,j),hm(c)):yu(c,q,I,j);vo(c)}a(bu,"ReadableByteStreamControllerEnqueue");function Sr(c,l){let m=c._controlledReadableByteStream;m._state==="readable"&&(XE(c),jn(c),_u(c),zS(m,l))}a(Sr,"ReadableByteStreamControllerError");function iS(c,l){let m=c._queue.shift();c._queueTotalSize-=m.byteLength,nS(c);let E=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);l._chunkSteps(E)}a(iS,"ReadableByteStreamControllerFillReadRequestFromQueue");function gm(c){if(c._byobRequest===null&&c._pendingPullIntos.length>0){let l=c._pendingPullIntos.peek(),m=new Uint8Array(l.buffer,l.byteOffset+l.bytesFilled,l.byteLength-l.bytesFilled),E=Object.create(_o.prototype);h0(E,c,m),c._byobRequest=E}return c._byobRequest}a(gm,"ReadableByteStreamControllerGetBYOBRequest");function aS(c){let l=c._controlledReadableByteStream._state;return l==="errored"?null:l==="closed"?0:c._strategyHWM-c._queueTotalSize}a(aS,"ReadableByteStreamControllerGetDesiredSize");function vu(c,l){let m=c._pendingPullIntos.peek();if(c._controlledReadableByteStream._state==="closed"){if(l!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(l===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(m.bytesFilled+l>m.byteLength)throw new RangeError("bytesWritten out of range")}m.buffer=gn(m.buffer),oS(c,l)}a(vu,"ReadableByteStreamControllerRespond");function Eu(c,l){let m=c._pendingPullIntos.peek();if(c._controlledReadableByteStream._state==="closed"){if(l.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(l.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!==l.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(m.bufferByteLength!==l.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(m.bytesFilled+l.byteLength>m.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");let I=l.byteLength;m.buffer=gn(l.buffer),oS(c,I)}a(Eu,"ReadableByteStreamControllerRespondWithNewView");function sS(c,l,m,E,I,j,q){l._controlledReadableByteStream=c,l._pullAgain=!1,l._pulling=!1,l._byobRequest=null,l._queue=l._queueTotalSize=void 0,jn(l),l._closeRequested=!1,l._started=!1,l._strategyHWM=j,l._pullAlgorithm=E,l._cancelAlgorithm=I,l._autoAllocateChunkSize=q,l._pendingPullIntos=new Z,c._readableStreamController=l;let oe=m();y(p(oe),()=>(l._started=!0,vo(l),null),ye=>(Sr(l,ye),null))}a(sS,"SetUpReadableByteStreamController");function m0(c,l,m){let E=Object.create(yn.prototype),I,j,q;l.start!==void 0?I=a(()=>l.start(E),"startAlgorithm"):I=a(()=>{},"startAlgorithm"),l.pull!==void 0?j=a(()=>l.pull(E),"pullAlgorithm"):j=a(()=>p(void 0),"pullAlgorithm"),l.cancel!==void 0?q=a(ye=>l.cancel(ye),"cancelAlgorithm"):q=a(()=>p(void 0),"cancelAlgorithm");let oe=l.autoAllocateChunkSize;if(oe===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");sS(c,E,I,j,q,m,oe)}a(m0,"SetUpReadableByteStreamControllerFromUnderlyingSource");function h0(c,l,m){c._associatedReadableByteStreamController=l,c._view=m}a(h0,"SetUpReadableStreamBYOBRequest");function ym(c){return new TypeError(`ReadableStreamBYOBRequest.prototype.${c} can only be used on a ReadableStreamBYOBRequest`)}a(ym,"byobRequestBrandCheckException");function ja(c){return new TypeError(`ReadableByteStreamController.prototype.${c} can only be used on a ReadableByteStreamController`)}a(ja,"byteStreamControllerBrandCheckException");function g0(c,l){Zt(c,l);let m=c?.mode;return{mode:m===void 0?void 0:y0(m,`${l} has member 'mode' that`)}}a(g0,"convertReaderOptions");function y0(c,l){if(c=`${c}`,c!=="byob")throw new TypeError(`${l} '${c}' is not a valid enumeration value for ReadableStreamReaderMode`);return c}a(y0,"convertReadableStreamReaderMode");function _0(c,l){var m;Zt(c,l);let E=(m=c?.min)!==null&&m!==void 0?m:1;return{min:O(E,`${l} has member 'min' that`)}}a(_0,"convertByobReadOptions");function cS(c){return new Mn(c)}a(cS,"AcquireReadableStreamBYOBReader");function uS(c,l){c._reader._readIntoRequests.push(l)}a(uS,"ReadableStreamAddReadIntoRequest");function b0(c,l,m){let I=c._reader._readIntoRequests.shift();m?I._closeSteps(l):I._chunkSteps(l)}a(b0,"ReadableStreamFulfillReadIntoRequest");function lS(c){return c._reader._readIntoRequests.length}a(lS,"ReadableStreamGetNumReadIntoRequests");function _m(c){let l=c._reader;return!(l===void 0||!Eo(l))}a(_m,"ReadableStreamHasBYOBReader");class Mn{static{a(this,"ReadableStreamBYOBReader")}constructor(l){if(mt(l,1,"ReadableStreamBYOBReader"),z(l,"First parameter"),Bn(l))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!bo(l._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");we(this,l),this._readIntoRequests=new Z}get closed(){return Eo(this)?this._closedPromise:f(Su("closed"))}cancel(l=void 0){return Eo(this)?this._ownerReadableStream===void 0?f(je("cancel")):Te(this,l):f(Su("cancel"))}read(l,m={}){if(!Eo(this))return f(Su("read"));if(!ArrayBuffer.isView(l))return f(new TypeError("view must be an array buffer view"));if(l.byteLength===0)return f(new TypeError("view must have non-zero byteLength"));if(l.buffer.byteLength===0)return f(new TypeError("view's buffer must have non-zero byteLength"));if(Un(l.buffer))return f(new TypeError("view's buffer has been detached"));let E;try{E=_0(m,"options")}catch(ue){return f(ue)}let I=E.min;if(I===0)return f(new TypeError("options.min must be greater than 0"));if(s0(l)){if(I>l.byteLength)return f(new RangeError("options.min must be less than or equal to view's byteLength"))}else if(I>l.length)return f(new RangeError("options.min must be less than or equal to view's length"));if(this._ownerReadableStream===void 0)return f(je("read from"));let j,q,oe=d((ue,Ee)=>{j=ue,q=Ee});return dS(this,l,I,{_chunkSteps:a(ue=>j({value:ue,done:!1}),"_chunkSteps"),_closeSteps:a(ue=>j({value:ue,done:!0}),"_closeSteps"),_errorSteps:a(ue=>q(ue),"_errorSteps")}),oe}releaseLock(){if(!Eo(this))throw Su("releaseLock");this._ownerReadableStream!==void 0&&v0(this)}}Object.defineProperties(Mn.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),r(Mn.prototype.cancel,"cancel"),r(Mn.prototype.read,"read"),r(Mn.prototype.releaseLock,"releaseLock"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Mn.prototype,Symbol.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function Eo(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readIntoRequests")?!1:c instanceof Mn}a(Eo,"IsReadableStreamBYOBReader");function dS(c,l,m,E){let I=c._ownerReadableStream;I._disturbed=!0,I._state==="errored"?E._errorSteps(I._storedError):l0(I._readableStreamController,l,m,E)}a(dS,"ReadableStreamBYOBReaderRead");function v0(c){Me(c);let l=new TypeError("Reader was released");pS(c,l)}a(v0,"ReadableStreamBYOBReaderRelease");function pS(c,l){let m=c._readIntoRequests;c._readIntoRequests=new Z,m.forEach(E=>{E._errorSteps(l)})}a(pS,"ReadableStreamBYOBReaderErrorReadIntoRequests");function Su(c){return new TypeError(`ReadableStreamBYOBReader.prototype.${c} can only be used on a ReadableStreamBYOBReader`)}a(Su,"byobReaderBrandCheckException");function Ma(c,l){let{highWaterMark:m}=c;if(m===void 0)return l;if(or(m)||m<0)throw new RangeError("Invalid highWaterMark");return m}a(Ma,"ExtractHighWaterMark");function Pu(c){let{size:l}=c;return l||(()=>1)}a(Pu,"ExtractSizeAlgorithm");function xu(c,l){Zt(c,l);let m=c?.highWaterMark,E=c?.size;return{highWaterMark:m===void 0?void 0:T(m),size:E===void 0?void 0:E0(E,`${l} has member 'size' that`)}}a(xu,"convertQueuingStrategy");function E0(c,l){return Ut(c,l),m=>T(c(m))}a(E0,"convertQueuingStrategySize");function S0(c,l){Zt(c,l);let m=c?.abort,E=c?.close,I=c?.start,j=c?.type,q=c?.write;return{abort:m===void 0?void 0:P0(m,c,`${l} has member 'abort' that`),close:E===void 0?void 0:x0(E,c,`${l} has member 'close' that`),start:I===void 0?void 0:T0(I,c,`${l} has member 'start' that`),write:q===void 0?void 0:w0(q,c,`${l} has member 'write' that`),type:j}}a(S0,"convertUnderlyingSink");function P0(c,l,m){return Ut(c,m),E=>V(c,l,[E])}a(P0,"convertUnderlyingSinkAbortCallback");function x0(c,l,m){return Ut(c,m),()=>V(c,l,[])}a(x0,"convertUnderlyingSinkCloseCallback");function T0(c,l,m){return Ut(c,m),E=>$(c,l,[E])}a(T0,"convertUnderlyingSinkStartCallback");function w0(c,l,m){return Ut(c,m),(E,I)=>V(c,l,[E,I])}a(w0,"convertUnderlyingSinkWriteCallback");function fS(c,l){if(!di(c))throw new TypeError(`${l} is not a WritableStream.`)}a(fS,"assertWritableStream");function A0(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}a(A0,"isAbortSignal");let I0=typeof AbortController=="function";function R0(){if(I0)return new AbortController}a(R0,"createAbortController");class Ln{static{a(this,"WritableStream")}constructor(l={},m={}){l===void 0?l=null:jt(l,"First parameter");let E=xu(m,"Second parameter"),I=S0(l,"First parameter");if(hS(this),I.type!==void 0)throw new RangeError("Invalid type is specified");let q=Pu(E),oe=Ma(E,1);q0(this,I,oe,q)}get locked(){if(!di(this))throw Ru("locked");return pi(this)}abort(l=void 0){return di(this)?pi(this)?f(new TypeError("Cannot abort a stream that already has a writer")):Tu(this,l):f(Ru("abort"))}close(){return di(this)?pi(this)?f(new TypeError("Cannot close a stream that already has a writer")):en(this)?f(new TypeError("Cannot close an already-closing stream")):gS(this):f(Ru("close"))}getWriter(){if(!di(this))throw Ru("getWriter");return mS(this)}}Object.defineProperties(Ln.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),r(Ln.prototype.abort,"abort"),r(Ln.prototype.close,"close"),r(Ln.prototype.getWriter,"getWriter"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Ln.prototype,Symbol.toStringTag,{value:"WritableStream",configurable:!0});function mS(c){return new _n(c)}a(mS,"AcquireWritableStreamDefaultWriter");function O0(c,l,m,E,I=1,j=()=>1){let q=Object.create(Ln.prototype);hS(q);let oe=Object.create(fi.prototype);return SS(q,oe,c,l,m,E,I,j),q}a(O0,"CreateWritableStream");function hS(c){c._state="writable",c._storedError=void 0,c._writer=void 0,c._writableStreamController=void 0,c._writeRequests=new Z,c._inFlightWriteRequest=void 0,c._closeRequest=void 0,c._inFlightCloseRequest=void 0,c._pendingAbortRequest=void 0,c._backpressure=!1}a(hS,"InitializeWritableStream");function di(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_writableStreamController")?!1:c instanceof Ln}a(di,"IsWritableStream");function pi(c){return c._writer!==void 0}a(pi,"IsWritableStreamLocked");function Tu(c,l){var m;if(c._state==="closed"||c._state==="errored")return p(void 0);c._writableStreamController._abortReason=l,(m=c._writableStreamController._abortController)===null||m===void 0||m.abort(l);let E=c._state;if(E==="closed"||E==="errored")return p(void 0);if(c._pendingAbortRequest!==void 0)return c._pendingAbortRequest._promise;let I=!1;E==="erroring"&&(I=!0,l=void 0);let j=d((q,oe)=>{c._pendingAbortRequest={_promise:void 0,_resolve:q,_reject:oe,_reason:l,_wasAlreadyErroring:I}});return c._pendingAbortRequest._promise=j,I||vm(c,l),j}a(Tu,"WritableStreamAbort");function gS(c){let l=c._state;if(l==="closed"||l==="errored")return f(new TypeError(`The stream (in ${l} state) is not in the writable state and cannot be closed`));let m=d((I,j)=>{let q={_resolve:I,_reject:j};c._closeRequest=q}),E=c._writer;return E!==void 0&&c._backpressure&&l==="writable"&&Im(E),V0(c._writableStreamController),m}a(gS,"WritableStreamClose");function k0(c){return d((m,E)=>{let I={_resolve:m,_reject:E};c._writeRequests.push(I)})}a(k0,"WritableStreamAddWriteRequest");function bm(c,l){if(c._state==="writable"){vm(c,l);return}Em(c)}a(bm,"WritableStreamDealWithRejection");function vm(c,l){let m=c._writableStreamController;c._state="erroring",c._storedError=l;let E=c._writer;E!==void 0&&_S(E,l),!D0(c)&&m._started&&Em(c)}a(vm,"WritableStreamStartErroring");function Em(c){c._state="errored",c._writableStreamController[te]();let l=c._storedError;if(c._writeRequests.forEach(I=>{I._reject(l)}),c._writeRequests=new Z,c._pendingAbortRequest===void 0){wu(c);return}let m=c._pendingAbortRequest;if(c._pendingAbortRequest=void 0,m._wasAlreadyErroring){m._reject(l),wu(c);return}let E=c._writableStreamController[G](m._reason);y(E,()=>(m._resolve(),wu(c),null),I=>(m._reject(I),wu(c),null))}a(Em,"WritableStreamFinishErroring");function C0(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0}a(C0,"WritableStreamFinishInFlightWrite");function $0(c,l){c._inFlightWriteRequest._reject(l),c._inFlightWriteRequest=void 0,bm(c,l)}a($0,"WritableStreamFinishInFlightWriteWithError");function z0(c){c._inFlightCloseRequest._resolve(void 0),c._inFlightCloseRequest=void 0,c._state==="erroring"&&(c._storedError=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._resolve(),c._pendingAbortRequest=void 0)),c._state="closed";let m=c._writer;m!==void 0&&wS(m)}a(z0,"WritableStreamFinishInFlightClose");function N0(c,l){c._inFlightCloseRequest._reject(l),c._inFlightCloseRequest=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._reject(l),c._pendingAbortRequest=void 0),bm(c,l)}a(N0,"WritableStreamFinishInFlightCloseWithError");function en(c){return!(c._closeRequest===void 0&&c._inFlightCloseRequest===void 0)}a(en,"WritableStreamCloseQueuedOrInFlight");function D0(c){return!(c._inFlightWriteRequest===void 0&&c._inFlightCloseRequest===void 0)}a(D0,"WritableStreamHasOperationMarkedInFlight");function U0(c){c._inFlightCloseRequest=c._closeRequest,c._closeRequest=void 0}a(U0,"WritableStreamMarkCloseRequestInFlight");function j0(c){c._inFlightWriteRequest=c._writeRequests.shift()}a(j0,"WritableStreamMarkFirstWriteRequestInFlight");function wu(c){c._closeRequest!==void 0&&(c._closeRequest._reject(c._storedError),c._closeRequest=void 0);let l=c._writer;l!==void 0&&wm(l,c._storedError)}a(wu,"WritableStreamRejectCloseAndClosedPromiseIfNeeded");function Sm(c,l){let m=c._writer;m!==void 0&&l!==c._backpressure&&(l?X0(m):Im(m)),c._backpressure=l}a(Sm,"WritableStreamUpdateBackpressure");class _n{static{a(this,"WritableStreamDefaultWriter")}constructor(l){if(mt(l,1,"WritableStreamDefaultWriter"),fS(l,"First parameter"),pi(l))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=l,l._writer=this;let m=l._state;if(m==="writable")!en(l)&&l._backpressure?ku(this):AS(this),Ou(this);else if(m==="erroring")Am(this,l._storedError),Ou(this);else if(m==="closed")AS(this),J0(this);else{let E=l._storedError;Am(this,E),TS(this,E)}}get closed(){return So(this)?this._closedPromise:f(Po("closed"))}get desiredSize(){if(!So(this))throw Po("desiredSize");if(this._ownerWritableStream===void 0)throw Fa("desiredSize");return B0(this)}get ready(){return So(this)?this._readyPromise:f(Po("ready"))}abort(l=void 0){return So(this)?this._ownerWritableStream===void 0?f(Fa("abort")):M0(this,l):f(Po("abort"))}close(){if(!So(this))return f(Po("close"));let l=this._ownerWritableStream;return l===void 0?f(Fa("close")):en(l)?f(new TypeError("Cannot close an already-closing stream")):yS(this)}releaseLock(){if(!So(this))throw Po("releaseLock");this._ownerWritableStream!==void 0&&bS(this)}write(l=void 0){return So(this)?this._ownerWritableStream===void 0?f(Fa("write to")):vS(this,l):f(Po("write"))}}Object.defineProperties(_n.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),r(_n.prototype.abort,"abort"),r(_n.prototype.close,"close"),r(_n.prototype.releaseLock,"releaseLock"),r(_n.prototype.write,"write"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function So(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_ownerWritableStream")?!1:c instanceof _n}a(So,"IsWritableStreamDefaultWriter");function M0(c,l){let m=c._ownerWritableStream;return Tu(m,l)}a(M0,"WritableStreamDefaultWriterAbort");function yS(c){let l=c._ownerWritableStream;return gS(l)}a(yS,"WritableStreamDefaultWriterClose");function L0(c){let l=c._ownerWritableStream,m=l._state;return en(l)||m==="closed"?p(void 0):m==="errored"?f(l._storedError):yS(c)}a(L0,"WritableStreamDefaultWriterCloseWithErrorPropagation");function F0(c,l){c._closedPromiseState==="pending"?wm(c,l):K0(c,l)}a(F0,"WritableStreamDefaultWriterEnsureClosedPromiseRejected");function _S(c,l){c._readyPromiseState==="pending"?IS(c,l):Q0(c,l)}a(_S,"WritableStreamDefaultWriterEnsureReadyPromiseRejected");function B0(c){let l=c._ownerWritableStream,m=l._state;return m==="errored"||m==="erroring"?null:m==="closed"?0:PS(l._writableStreamController)}a(B0,"WritableStreamDefaultWriterGetDesiredSize");function bS(c){let l=c._ownerWritableStream,m=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");_S(c,m),F0(c,m),l._writer=void 0,c._ownerWritableStream=void 0}a(bS,"WritableStreamDefaultWriterRelease");function vS(c,l){let m=c._ownerWritableStream,E=m._writableStreamController,I=Z0(E,l);if(m!==c._ownerWritableStream)return f(Fa("write to"));let j=m._state;if(j==="errored")return f(m._storedError);if(en(m)||j==="closed")return f(new TypeError("The stream is closing or closed and cannot be written to"));if(j==="erroring")return f(m._storedError);let q=k0(m);return H0(E,l,I),q}a(vS,"WritableStreamDefaultWriterWrite");let ES={};class fi{static{a(this,"WritableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!Pm(this))throw Tm("abortReason");return this._abortReason}get signal(){if(!Pm(this))throw Tm("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal}error(l=void 0){if(!Pm(this))throw Tm("error");this._controlledWritableStream._state==="writable"&&xS(this,l)}[G](l){let m=this._abortAlgorithm(l);return Au(this),m}[te](){jn(this)}}Object.defineProperties(fi.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(fi.prototype,Symbol.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function Pm(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledWritableStream")?!1:c instanceof fi}a(Pm,"IsWritableStreamDefaultController");function SS(c,l,m,E,I,j,q,oe){l._controlledWritableStream=c,c._writableStreamController=l,l._queue=void 0,l._queueTotalSize=void 0,jn(l),l._abortReason=void 0,l._abortController=R0(),l._started=!1,l._strategySizeAlgorithm=oe,l._strategyHWM=q,l._writeAlgorithm=E,l._closeAlgorithm=I,l._abortAlgorithm=j;let ye=xm(l);Sm(c,ye);let ue=m(),Ee=p(ue);y(Ee,()=>(l._started=!0,Iu(l),null),Ae=>(l._started=!0,bm(c,Ae),null))}a(SS,"SetUpWritableStreamDefaultController");function q0(c,l,m,E){let I=Object.create(fi.prototype),j,q,oe,ye;l.start!==void 0?j=a(()=>l.start(I),"startAlgorithm"):j=a(()=>{},"startAlgorithm"),l.write!==void 0?q=a(ue=>l.write(ue,I),"writeAlgorithm"):q=a(()=>p(void 0),"writeAlgorithm"),l.close!==void 0?oe=a(()=>l.close(),"closeAlgorithm"):oe=a(()=>p(void 0),"closeAlgorithm"),l.abort!==void 0?ye=a(ue=>l.abort(ue),"abortAlgorithm"):ye=a(()=>p(void 0),"abortAlgorithm"),SS(c,I,j,q,oe,ye,m,E)}a(q0,"SetUpWritableStreamDefaultControllerFromUnderlyingSink");function Au(c){c._writeAlgorithm=void 0,c._closeAlgorithm=void 0,c._abortAlgorithm=void 0,c._strategySizeAlgorithm=void 0}a(Au,"WritableStreamDefaultControllerClearAlgorithms");function V0(c){dm(c,ES,0),Iu(c)}a(V0,"WritableStreamDefaultControllerClose");function Z0(c,l){try{return c._strategySizeAlgorithm(l)}catch(m){return La(c,m),1}}a(Z0,"WritableStreamDefaultControllerGetChunkSize");function PS(c){return c._strategyHWM-c._queueTotalSize}a(PS,"WritableStreamDefaultControllerGetDesiredSize");function H0(c,l,m){try{dm(c,l,m)}catch(I){La(c,I);return}let E=c._controlledWritableStream;if(!en(E)&&E._state==="writable"){let I=xm(c);Sm(E,I)}Iu(c)}a(H0,"WritableStreamDefaultControllerWrite");function Iu(c){let l=c._controlledWritableStream;if(!c._started||l._inFlightWriteRequest!==void 0)return;if(l._state==="erroring"){Em(l);return}if(c._queue.length===0)return;let E=a0(c);E===ES?G0(c):W0(c,E)}a(Iu,"WritableStreamDefaultControllerAdvanceQueueIfNeeded");function La(c,l){c._controlledWritableStream._state==="writable"&&xS(c,l)}a(La,"WritableStreamDefaultControllerErrorIfNeeded");function G0(c){let l=c._controlledWritableStream;U0(l),lm(c);let m=c._closeAlgorithm();Au(c),y(m,()=>(z0(l),null),E=>(N0(l,E),null))}a(G0,"WritableStreamDefaultControllerProcessClose");function W0(c,l){let m=c._controlledWritableStream;j0(m);let E=c._writeAlgorithm(l);y(E,()=>{C0(m);let I=m._state;if(lm(c),!en(m)&&I==="writable"){let j=xm(c);Sm(m,j)}return Iu(c),null},I=>(m._state==="writable"&&Au(c),$0(m,I),null))}a(W0,"WritableStreamDefaultControllerProcessWrite");function xm(c){return PS(c)<=0}a(xm,"WritableStreamDefaultControllerGetBackpressure");function xS(c,l){let m=c._controlledWritableStream;Au(c),vm(m,l)}a(xS,"WritableStreamDefaultControllerError");function Ru(c){return new TypeError(`WritableStream.prototype.${c} can only be used on a WritableStream`)}a(Ru,"streamBrandCheckException$2");function Tm(c){return new TypeError(`WritableStreamDefaultController.prototype.${c} can only be used on a WritableStreamDefaultController`)}a(Tm,"defaultControllerBrandCheckException$2");function Po(c){return new TypeError(`WritableStreamDefaultWriter.prototype.${c} can only be used on a WritableStreamDefaultWriter`)}a(Po,"defaultWriterBrandCheckException");function Fa(c){return new TypeError("Cannot "+c+" a stream using a released writer")}a(Fa,"defaultWriterLockException");function Ou(c){c._closedPromise=d((l,m)=>{c._closedPromise_resolve=l,c._closedPromise_reject=m,c._closedPromiseState="pending"})}a(Ou,"defaultWriterClosedPromiseInitialize");function TS(c,l){Ou(c),wm(c,l)}a(TS,"defaultWriterClosedPromiseInitializeAsRejected");function J0(c){Ou(c),wS(c)}a(J0,"defaultWriterClosedPromiseInitializeAsResolved");function wm(c,l){c._closedPromise_reject!==void 0&&(x(c._closedPromise),c._closedPromise_reject(l),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="rejected")}a(wm,"defaultWriterClosedPromiseReject");function K0(c,l){TS(c,l)}a(K0,"defaultWriterClosedPromiseResetToRejected");function wS(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="resolved")}a(wS,"defaultWriterClosedPromiseResolve");function ku(c){c._readyPromise=d((l,m)=>{c._readyPromise_resolve=l,c._readyPromise_reject=m}),c._readyPromiseState="pending"}a(ku,"defaultWriterReadyPromiseInitialize");function Am(c,l){ku(c),IS(c,l)}a(Am,"defaultWriterReadyPromiseInitializeAsRejected");function AS(c){ku(c),Im(c)}a(AS,"defaultWriterReadyPromiseInitializeAsResolved");function IS(c,l){c._readyPromise_reject!==void 0&&(x(c._readyPromise),c._readyPromise_reject(l),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="rejected")}a(IS,"defaultWriterReadyPromiseReject");function X0(c){ku(c)}a(X0,"defaultWriterReadyPromiseReset");function Q0(c,l){Am(c,l)}a(Q0,"defaultWriterReadyPromiseResetToRejected");function Im(c){c._readyPromise_resolve!==void 0&&(c._readyPromise_resolve(void 0),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="fulfilled")}a(Im,"defaultWriterReadyPromiseResolve");function Y0(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof global<"u")return global}a(Y0,"getGlobals");let Rm=Y0();function e$(c){if(!(typeof c=="function"||typeof c=="object")||c.name!=="DOMException")return!1;try{return new c,!0}catch{return!1}}a(e$,"isDOMExceptionConstructor");function t$(){let c=Rm?.DOMException;return e$(c)?c:void 0}a(t$,"getFromGlobal");function r$(){let c=a(function(m,E){this.message=m||"",this.name=E||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)},"DOMException");return r(c,"DOMException"),c.prototype=Object.create(Error.prototype),Object.defineProperty(c.prototype,"constructor",{value:c,writable:!0,configurable:!0}),c}a(r$,"createPolyfill");let n$=t$()||r$();function RS(c,l,m,E,I,j){let q=M(c),oe=mS(l);c._disturbed=!0;let ye=!1,ue=p(void 0);return d((Ee,Ae)=>{let Ke;if(j!==void 0){if(Ke=a(()=>{let de=j.reason!==void 0?j.reason:new n$("Aborted","AbortError"),Oe=[];E||Oe.push(()=>l._state==="writable"?Tu(l,de):p(void 0)),I||Oe.push(()=>c._state==="readable"?Dr(c,de):p(void 0)),Ht(()=>Promise.all(Oe.map(Xe=>Xe())),!0,de)},"abortAlgorithm"),j.aborted){Ke();return}j.addEventListener("abort",Ke)}function Ur(){return d((de,Oe)=>{function Xe(ir){ir?de():g(yi(),Xe,Oe)}a(Xe,"next"),Xe(!1)})}a(Ur,"pipeLoop");function yi(){return ye?p(!0):g(oe._readyPromise,()=>d((de,Oe)=>{se(q,{_chunkSteps:a(Xe=>{ue=g(vS(oe,Xe),void 0,t),de(!1)},"_chunkSteps"),_closeSteps:a(()=>de(!0),"_closeSteps"),_errorSteps:Oe})}))}if(a(yi,"pipeStep"),vn(c,q._closedPromise,de=>(E?Pr(!0,de):Ht(()=>Tu(l,de),!0,de),null)),vn(l,oe._closedPromise,de=>(I?Pr(!0,de):Ht(()=>Dr(c,de),!0,de),null)),Mt(c,q._closedPromise,()=>(m?Pr():Ht(()=>L0(oe)),null)),en(l)||l._state==="closed"){let de=new TypeError("the destination writable stream closed before all data could be piped to it");I?Pr(!0,de):Ht(()=>Dr(c,de),!0,de)}x(Ur());function Vn(){let de=ue;return g(ue,()=>de!==ue?Vn():void 0)}a(Vn,"waitForWritesToFinish");function vn(de,Oe,Xe){de._state==="errored"?Xe(de._storedError):_(Oe,Xe)}a(vn,"isOrBecomesErrored");function Mt(de,Oe,Xe){de._state==="closed"?Xe():h(Oe,Xe)}a(Mt,"isOrBecomesClosed");function Ht(de,Oe,Xe){if(ye)return;ye=!0,l._state==="writable"&&!en(l)?h(Vn(),ir):ir();function ir(){return y(de(),()=>En(Oe,Xe),_i=>En(!0,_i)),null}a(ir,"doTheRest")}a(Ht,"shutdownWithAction");function Pr(de,Oe){ye||(ye=!0,l._state==="writable"&&!en(l)?h(Vn(),()=>En(de,Oe)):En(de,Oe))}a(Pr,"shutdown");function En(de,Oe){return bS(oe),Me(q),j!==void 0&&j.removeEventListener("abort",Ke),de?Ae(Oe):Ee(void 0),null}a(En,"finalize")})}a(RS,"ReadableStreamPipeTo");class bn{static{a(this,"ReadableStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Cu(this))throw zu("desiredSize");return Om(this)}close(){if(!Cu(this))throw zu("close");if(!hi(this))throw new TypeError("The stream is not in a state that permits close");xo(this)}enqueue(l=void 0){if(!Cu(this))throw zu("enqueue");if(!hi(this))throw new TypeError("The stream is not in a state that permits enqueue");return mi(this,l)}error(l=void 0){if(!Cu(this))throw zu("error");Nr(this,l)}[ce](l){jn(this);let m=this._cancelAlgorithm(l);return $u(this),m}[Y](l){let m=this._controlledReadableStream;if(this._queue.length>0){let E=lm(this);this._closeRequested&&this._queue.length===0?($u(this),Va(m)):Ba(this),l._chunkSteps(E)}else R(m,l),Ba(this)}[Ze](){}}Object.defineProperties(bn.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),r(bn.prototype.close,"close"),r(bn.prototype.enqueue,"enqueue"),r(bn.prototype.error,"error"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(bn.prototype,Symbol.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function Cu(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableStream")?!1:c instanceof bn}a(Cu,"IsReadableStreamDefaultController");function Ba(c){if(!OS(c))return;if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;let m=c._pullAlgorithm();y(m,()=>(c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,Ba(c)),null),E=>(Nr(c,E),null))}a(Ba,"ReadableStreamDefaultControllerCallPullIfNeeded");function OS(c){let l=c._controlledReadableStream;return!hi(c)||!c._started?!1:!!(Bn(l)&&U(l)>0||Om(c)>0)}a(OS,"ReadableStreamDefaultControllerShouldCallPull");function $u(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0,c._strategySizeAlgorithm=void 0}a($u,"ReadableStreamDefaultControllerClearAlgorithms");function xo(c){if(!hi(c))return;let l=c._controlledReadableStream;c._closeRequested=!0,c._queue.length===0&&($u(c),Va(l))}a(xo,"ReadableStreamDefaultControllerClose");function mi(c,l){if(!hi(c))return;let m=c._controlledReadableStream;if(Bn(m)&&U(m)>0)C(m,l,!1);else{let E;try{E=c._strategySizeAlgorithm(l)}catch(I){throw Nr(c,I),I}try{dm(c,l,E)}catch(I){throw Nr(c,I),I}}Ba(c)}a(mi,"ReadableStreamDefaultControllerEnqueue");function Nr(c,l){let m=c._controlledReadableStream;m._state==="readable"&&(jn(c),$u(c),zS(m,l))}a(Nr,"ReadableStreamDefaultControllerError");function Om(c){let l=c._controlledReadableStream._state;return l==="errored"?null:l==="closed"?0:c._strategyHWM-c._queueTotalSize}a(Om,"ReadableStreamDefaultControllerGetDesiredSize");function o$(c){return!OS(c)}a(o$,"ReadableStreamDefaultControllerHasBackpressure");function hi(c){let l=c._controlledReadableStream._state;return!c._closeRequested&&l==="readable"}a(hi,"ReadableStreamDefaultControllerCanCloseOrEnqueue");function kS(c,l,m,E,I,j,q){l._controlledReadableStream=c,l._queue=void 0,l._queueTotalSize=void 0,jn(l),l._started=!1,l._closeRequested=!1,l._pullAgain=!1,l._pulling=!1,l._strategySizeAlgorithm=q,l._strategyHWM=j,l._pullAlgorithm=E,l._cancelAlgorithm=I,c._readableStreamController=l;let oe=m();y(p(oe),()=>(l._started=!0,Ba(l),null),ye=>(Nr(l,ye),null))}a(kS,"SetUpReadableStreamDefaultController");function i$(c,l,m,E){let I=Object.create(bn.prototype),j,q,oe;l.start!==void 0?j=a(()=>l.start(I),"startAlgorithm"):j=a(()=>{},"startAlgorithm"),l.pull!==void 0?q=a(()=>l.pull(I),"pullAlgorithm"):q=a(()=>p(void 0),"pullAlgorithm"),l.cancel!==void 0?oe=a(ye=>l.cancel(ye),"cancelAlgorithm"):oe=a(()=>p(void 0),"cancelAlgorithm"),kS(c,I,j,q,oe,m,E)}a(i$,"SetUpReadableStreamDefaultControllerFromUnderlyingSource");function zu(c){return new TypeError(`ReadableStreamDefaultController.prototype.${c} can only be used on a ReadableStreamDefaultController`)}a(zu,"defaultControllerBrandCheckException$1");function a$(c,l){return bo(c._readableStreamController)?c$(c):s$(c)}a(a$,"ReadableStreamTee");function s$(c,l){let m=M(c),E=!1,I=!1,j=!1,q=!1,oe,ye,ue,Ee,Ae,Ke=d(Mt=>{Ae=Mt});function Ur(){return E?(I=!0,p(void 0)):(E=!0,se(m,{_chunkSteps:a(Ht=>{S(()=>{I=!1;let Pr=Ht,En=Ht;j||mi(ue._readableStreamController,Pr),q||mi(Ee._readableStreamController,En),E=!1,I&&Ur()})},"_chunkSteps"),_closeSteps:a(()=>{E=!1,j||xo(ue._readableStreamController),q||xo(Ee._readableStreamController),(!j||!q)&&Ae(void 0)},"_closeSteps"),_errorSteps:a(()=>{E=!1},"_errorSteps")}),p(void 0))}a(Ur,"pullAlgorithm");function yi(Mt){if(j=!0,oe=Mt,q){let Ht=He([oe,ye]),Pr=Dr(c,Ht);Ae(Pr)}return Ke}a(yi,"cancel1Algorithm");function Vn(Mt){if(q=!0,ye=Mt,j){let Ht=He([oe,ye]),Pr=Dr(c,Ht);Ae(Pr)}return Ke}a(Vn,"cancel2Algorithm");function vn(){}return a(vn,"startAlgorithm"),ue=qa(vn,Ur,yi),Ee=qa(vn,Ur,Vn),_(m._closedPromise,Mt=>(Nr(ue._readableStreamController,Mt),Nr(Ee._readableStreamController,Mt),(!j||!q)&&Ae(void 0),null)),[ue,Ee]}a(s$,"ReadableStreamDefaultTee");function c$(c){let l=M(c),m=!1,E=!1,I=!1,j=!1,q=!1,oe,ye,ue,Ee,Ae,Ke=d(de=>{Ae=de});function Ur(de){_(de._closedPromise,Oe=>(de!==l||(Sr(ue._readableStreamController,Oe),Sr(Ee._readableStreamController,Oe),(!j||!q)&&Ae(void 0)),null))}a(Ur,"forwardReaderError");function yi(){Eo(l)&&(Me(l),l=M(c),Ur(l)),se(l,{_chunkSteps:a(Oe=>{S(()=>{E=!1,I=!1;let Xe=Oe,ir=Oe;if(!j&&!q)try{ir=JE(Oe)}catch(_i){Sr(ue._readableStreamController,_i),Sr(Ee._readableStreamController,_i),Ae(Dr(c,_i));return}j||bu(ue._readableStreamController,Xe),q||bu(Ee._readableStreamController,ir),m=!1,E?vn():I&&Mt()})},"_chunkSteps"),_closeSteps:a(()=>{m=!1,j||Ua(ue._readableStreamController),q||Ua(Ee._readableStreamController),ue._readableStreamController._pendingPullIntos.length>0&&vu(ue._readableStreamController,0),Ee._readableStreamController._pendingPullIntos.length>0&&vu(Ee._readableStreamController,0),(!j||!q)&&Ae(void 0)},"_closeSteps"),_errorSteps:a(()=>{m=!1},"_errorSteps")})}a(yi,"pullWithDefaultReader");function Vn(de,Oe){ie(l)&&(Me(l),l=cS(c),Ur(l));let Xe=Oe?Ee:ue,ir=Oe?ue:Ee;dS(l,de,1,{_chunkSteps:a(bi=>{S(()=>{E=!1,I=!1;let vi=Oe?q:j;if(Oe?j:q)vi||Eu(Xe._readableStreamController,bi);else{let GS;try{GS=JE(bi)}catch(Nm){Sr(Xe._readableStreamController,Nm),Sr(ir._readableStreamController,Nm),Ae(Dr(c,Nm));return}vi||Eu(Xe._readableStreamController,bi),bu(ir._readableStreamController,GS)}m=!1,E?vn():I&&Mt()})},"_chunkSteps"),_closeSteps:a(bi=>{m=!1;let vi=Oe?q:j,Bu=Oe?j:q;vi||Ua(Xe._readableStreamController),Bu||Ua(ir._readableStreamController),bi!==void 0&&(vi||Eu(Xe._readableStreamController,bi),!Bu&&ir._readableStreamController._pendingPullIntos.length>0&&vu(ir._readableStreamController,0)),(!vi||!Bu)&&Ae(void 0)},"_closeSteps"),_errorSteps:a(()=>{m=!1},"_errorSteps")})}a(Vn,"pullWithBYOBReader");function vn(){if(m)return E=!0,p(void 0);m=!0;let de=gm(ue._readableStreamController);return de===null?yi():Vn(de._view,!1),p(void 0)}a(vn,"pull1Algorithm");function Mt(){if(m)return I=!0,p(void 0);m=!0;let de=gm(Ee._readableStreamController);return de===null?yi():Vn(de._view,!0),p(void 0)}a(Mt,"pull2Algorithm");function Ht(de){if(j=!0,oe=de,q){let Oe=He([oe,ye]),Xe=Dr(c,Oe);Ae(Xe)}return Ke}a(Ht,"cancel1Algorithm");function Pr(de){if(q=!0,ye=de,j){let Oe=He([oe,ye]),Xe=Dr(c,Oe);Ae(Xe)}return Ke}a(Pr,"cancel2Algorithm");function En(){}return a(En,"startAlgorithm"),ue=$S(En,vn,Ht),Ee=$S(En,Mt,Pr),Ur(l),[ue,Ee]}a(c$,"ReadableByteStreamTee");function u$(c){return n(c)&&typeof c.getReader<"u"}a(u$,"isReadableStreamLike");function l$(c){return u$(c)?p$(c.getReader()):d$(c)}a(l$,"ReadableStreamFrom");function d$(c){let l,m=WE(c,"async"),E=t;function I(){let q;try{q=r0(m)}catch(ye){return f(ye)}let oe=p(q);return P(oe,ye=>{if(!n(ye))throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");if(n0(ye))xo(l._readableStreamController);else{let Ee=o0(ye);mi(l._readableStreamController,Ee)}})}a(I,"pullAlgorithm");function j(q){let oe=m.iterator,ye;try{ye=gu(oe,"return")}catch(Ae){return f(Ae)}if(ye===void 0)return p(void 0);let ue;try{ue=$(ye,oe,[q])}catch(Ae){return f(Ae)}let Ee=p(ue);return P(Ee,Ae=>{if(!n(Ae))throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object")})}return a(j,"cancelAlgorithm"),l=qa(E,I,j,0),l}a(d$,"ReadableStreamFromIterable");function p$(c){let l,m=t;function E(){let j;try{j=c.read()}catch(q){return f(q)}return P(j,q=>{if(!n(q))throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");if(q.done)xo(l._readableStreamController);else{let oe=q.value;mi(l._readableStreamController,oe)}})}a(E,"pullAlgorithm");function I(j){try{return p(c.cancel(j))}catch(q){return f(q)}}return a(I,"cancelAlgorithm"),l=qa(m,E,I,0),l}a(p$,"ReadableStreamFromDefaultReader");function f$(c,l){Zt(c,l);let m=c,E=m?.autoAllocateChunkSize,I=m?.cancel,j=m?.pull,q=m?.start,oe=m?.type;return{autoAllocateChunkSize:E===void 0?void 0:O(E,`${l} has member 'autoAllocateChunkSize' that`),cancel:I===void 0?void 0:m$(I,m,`${l} has member 'cancel' that`),pull:j===void 0?void 0:h$(j,m,`${l} has member 'pull' that`),start:q===void 0?void 0:g$(q,m,`${l} has member 'start' that`),type:oe===void 0?void 0:y$(oe,`${l} has member 'type' that`)}}a(f$,"convertUnderlyingDefaultOrByteSource");function m$(c,l,m){return Ut(c,m),E=>V(c,l,[E])}a(m$,"convertUnderlyingSourceCancelCallback");function h$(c,l,m){return Ut(c,m),E=>V(c,l,[E])}a(h$,"convertUnderlyingSourcePullCallback");function g$(c,l,m){return Ut(c,m),E=>$(c,l,[E])}a(g$,"convertUnderlyingSourceStartCallback");function y$(c,l){if(c=`${c}`,c!=="bytes")throw new TypeError(`${l} '${c}' is not a valid enumeration value for ReadableStreamType`);return c}a(y$,"convertReadableStreamType");function _$(c,l){return Zt(c,l),{preventCancel:!!c?.preventCancel}}a(_$,"convertIteratorOptions");function CS(c,l){Zt(c,l);let m=c?.preventAbort,E=c?.preventCancel,I=c?.preventClose,j=c?.signal;return j!==void 0&&b$(j,`${l} has member 'signal' that`),{preventAbort:!!m,preventCancel:!!E,preventClose:!!I,signal:j}}a(CS,"convertPipeOptions");function b$(c,l){if(!A0(c))throw new TypeError(`${l} is not an AbortSignal.`)}a(b$,"assertAbortSignal");function v$(c,l){Zt(c,l);let m=c?.readable;v(m,"readable","ReadableWritablePair"),z(m,`${l} has member 'readable' that`);let E=c?.writable;return v(E,"writable","ReadableWritablePair"),fS(E,`${l} has member 'writable' that`),{readable:m,writable:E}}a(v$,"convertReadableWritablePair");class $t{static{a(this,"ReadableStream")}constructor(l={},m={}){l===void 0?l=null:jt(l,"First parameter");let E=xu(m,"Second parameter"),I=f$(l,"First parameter");if(km(this),I.type==="bytes"){if(E.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");let j=Ma(E,0);m0(this,I,j)}else{let j=Pu(E),q=Ma(E,1);i$(this,I,q,j)}}get locked(){if(!Fn(this))throw To("locked");return Bn(this)}cancel(l=void 0){return Fn(this)?Bn(this)?f(new TypeError("Cannot cancel a stream that already has a reader")):Dr(this,l):f(To("cancel"))}getReader(l=void 0){if(!Fn(this))throw To("getReader");return g0(l,"First parameter").mode===void 0?M(this):cS(this)}pipeThrough(l,m={}){if(!Fn(this))throw To("pipeThrough");mt(l,1,"pipeThrough");let E=v$(l,"First parameter"),I=CS(m,"Second parameter");if(Bn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(pi(E.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");let j=RS(this,E.writable,I.preventClose,I.preventAbort,I.preventCancel,I.signal);return x(j),E.readable}pipeTo(l,m={}){if(!Fn(this))return f(To("pipeTo"));if(l===void 0)return f("Parameter 1 is required in 'pipeTo'.");if(!di(l))return f(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));let E;try{E=CS(m,"Second parameter")}catch(I){return f(I)}return Bn(this)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):pi(l)?f(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):RS(this,l,E.preventClose,E.preventAbort,E.preventCancel,E.signal)}tee(){if(!Fn(this))throw To("tee");let l=a$(this);return He(l)}values(l=void 0){if(!Fn(this))throw To("values");let m=_$(l,"First parameter");return si(this,m.preventCancel)}[um](l){return this.values(l)}static from(l){return l$(l)}}Object.defineProperties($t,{from:{enumerable:!0}}),Object.defineProperties($t.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),r($t.from,"from"),r($t.prototype.cancel,"cancel"),r($t.prototype.getReader,"getReader"),r($t.prototype.pipeThrough,"pipeThrough"),r($t.prototype.pipeTo,"pipeTo"),r($t.prototype.tee,"tee"),r($t.prototype.values,"values"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty($t.prototype,Symbol.toStringTag,{value:"ReadableStream",configurable:!0}),Object.defineProperty($t.prototype,um,{value:$t.prototype.values,writable:!0,configurable:!0});function qa(c,l,m,E=1,I=()=>1){let j=Object.create($t.prototype);km(j);let q=Object.create(bn.prototype);return kS(j,q,c,l,m,E,I),j}a(qa,"CreateReadableStream");function $S(c,l,m){let E=Object.create($t.prototype);km(E);let I=Object.create(yn.prototype);return sS(E,I,c,l,m,0,void 0),E}a($S,"CreateReadableByteStream");function km(c){c._state="readable",c._reader=void 0,c._storedError=void 0,c._disturbed=!1}a(km,"InitializeReadableStream");function Fn(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readableStreamController")?!1:c instanceof $t}a(Fn,"IsReadableStream");function Bn(c){return c._reader!==void 0}a(Bn,"IsReadableStreamLocked");function Dr(c,l){if(c._disturbed=!0,c._state==="closed")return p(void 0);if(c._state==="errored")return f(c._storedError);Va(c);let m=c._reader;if(m!==void 0&&Eo(m)){let I=m._readIntoRequests;m._readIntoRequests=new Z,I.forEach(j=>{j._closeSteps(void 0)})}let E=c._readableStreamController[ce](l);return P(E,t)}a(Dr,"ReadableStreamCancel");function Va(c){c._state="closed";let l=c._reader;if(l!==void 0&&(ai(l),ie(l))){let m=l._readRequests;l._readRequests=new Z,m.forEach(E=>{E._closeSteps()})}}a(Va,"ReadableStreamClose");function zS(c,l){c._state="errored",c._storedError=l;let m=c._reader;m!==void 0&&(nr(m,l),ie(m)?tt(m,l):pS(m,l))}a(zS,"ReadableStreamError");function To(c){return new TypeError(`ReadableStream.prototype.${c} can only be used on a ReadableStream`)}a(To,"streamBrandCheckException$1");function NS(c,l){Zt(c,l);let m=c?.highWaterMark;return v(m,"highWaterMark","QueuingStrategyInit"),{highWaterMark:T(m)}}a(NS,"convertQueuingStrategyInit");let DS=a(c=>c.byteLength,"byteLengthSizeFunction");r(DS,"size");class Nu{static{a(this,"ByteLengthQueuingStrategy")}constructor(l){mt(l,1,"ByteLengthQueuingStrategy"),l=NS(l,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=l.highWaterMark}get highWaterMark(){if(!jS(this))throw US("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!jS(this))throw US("size");return DS}}Object.defineProperties(Nu.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Nu.prototype,Symbol.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function US(c){return new TypeError(`ByteLengthQueuingStrategy.prototype.${c} can only be used on a ByteLengthQueuingStrategy`)}a(US,"byteLengthBrandCheckException");function jS(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_byteLengthQueuingStrategyHighWaterMark")?!1:c instanceof Nu}a(jS,"IsByteLengthQueuingStrategy");let MS=a(()=>1,"countSizeFunction");r(MS,"size");class Du{static{a(this,"CountQueuingStrategy")}constructor(l){mt(l,1,"CountQueuingStrategy"),l=NS(l,"First parameter"),this._countQueuingStrategyHighWaterMark=l.highWaterMark}get highWaterMark(){if(!FS(this))throw LS("highWaterMark");return this._countQueuingStrategyHighWaterMark}get size(){if(!FS(this))throw LS("size");return MS}}Object.defineProperties(Du.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Du.prototype,Symbol.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function LS(c){return new TypeError(`CountQueuingStrategy.prototype.${c} can only be used on a CountQueuingStrategy`)}a(LS,"countBrandCheckException");function FS(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_countQueuingStrategyHighWaterMark")?!1:c instanceof Du}a(FS,"IsCountQueuingStrategy");function E$(c,l){Zt(c,l);let m=c?.cancel,E=c?.flush,I=c?.readableType,j=c?.start,q=c?.transform,oe=c?.writableType;return{cancel:m===void 0?void 0:T$(m,c,`${l} has member 'cancel' that`),flush:E===void 0?void 0:S$(E,c,`${l} has member 'flush' that`),readableType:I,start:j===void 0?void 0:P$(j,c,`${l} has member 'start' that`),transform:q===void 0?void 0:x$(q,c,`${l} has member 'transform' that`),writableType:oe}}a(E$,"convertTransformer");function S$(c,l,m){return Ut(c,m),E=>V(c,l,[E])}a(S$,"convertTransformerFlushCallback");function P$(c,l,m){return Ut(c,m),E=>$(c,l,[E])}a(P$,"convertTransformerStartCallback");function x$(c,l,m){return Ut(c,m),(E,I)=>V(c,l,[E,I])}a(x$,"convertTransformerTransformCallback");function T$(c,l,m){return Ut(c,m),E=>V(c,l,[E])}a(T$,"convertTransformerCancelCallback");class Uu{static{a(this,"TransformStream")}constructor(l={},m={},E={}){l===void 0&&(l=null);let I=xu(m,"Second parameter"),j=xu(E,"Third parameter"),q=E$(l,"First parameter");if(q.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(q.writableType!==void 0)throw new RangeError("Invalid writableType specified");let oe=Ma(j,0),ye=Pu(j),ue=Ma(I,1),Ee=Pu(I),Ae,Ke=d(Ur=>{Ae=Ur});w$(this,Ke,ue,Ee,oe,ye),I$(this,q),q.start!==void 0?Ae(q.start(this._transformStreamController)):Ae(void 0)}get readable(){if(!BS(this))throw HS("readable");return this._readable}get writable(){if(!BS(this))throw HS("writable");return this._writable}}Object.defineProperties(Uu.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(Uu.prototype,Symbol.toStringTag,{value:"TransformStream",configurable:!0});function w$(c,l,m,E,I,j){function q(){return l}a(q,"startAlgorithm");function oe(Ke){return k$(c,Ke)}a(oe,"writeAlgorithm");function ye(Ke){return C$(c,Ke)}a(ye,"abortAlgorithm");function ue(){return $$(c)}a(ue,"closeAlgorithm"),c._writable=O0(q,oe,ue,ye,m,E);function Ee(){return z$(c)}a(Ee,"pullAlgorithm");function Ae(Ke){return N$(c,Ke)}a(Ae,"cancelAlgorithm"),c._readable=qa(q,Ee,Ae,I,j),c._backpressure=void 0,c._backpressureChangePromise=void 0,c._backpressureChangePromise_resolve=void 0,ju(c,!0),c._transformStreamController=void 0}a(w$,"InitializeTransformStream");function BS(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_transformStreamController")?!1:c instanceof Uu}a(BS,"IsTransformStream");function qS(c,l){Nr(c._readable._readableStreamController,l),Cm(c,l)}a(qS,"TransformStreamError");function Cm(c,l){Lu(c._transformStreamController),La(c._writable._writableStreamController,l),$m(c)}a(Cm,"TransformStreamErrorWritableAndUnblockWrite");function $m(c){c._backpressure&&ju(c,!1)}a($m,"TransformStreamUnblockWrite");function ju(c,l){c._backpressureChangePromise!==void 0&&c._backpressureChangePromise_resolve(),c._backpressureChangePromise=d(m=>{c._backpressureChangePromise_resolve=m}),c._backpressure=l}a(ju,"TransformStreamSetBackpressure");class qn{static{a(this,"TransformStreamDefaultController")}constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!Mu(this))throw Fu("desiredSize");let l=this._controlledTransformStream._readable._readableStreamController;return Om(l)}enqueue(l=void 0){if(!Mu(this))throw Fu("enqueue");VS(this,l)}error(l=void 0){if(!Mu(this))throw Fu("error");R$(this,l)}terminate(){if(!Mu(this))throw Fu("terminate");O$(this)}}Object.defineProperties(qn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),r(qn.prototype.enqueue,"enqueue"),r(qn.prototype.error,"error"),r(qn.prototype.terminate,"terminate"),typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(qn.prototype,Symbol.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function Mu(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledTransformStream")?!1:c instanceof qn}a(Mu,"IsTransformStreamDefaultController");function A$(c,l,m,E,I){l._controlledTransformStream=c,c._transformStreamController=l,l._transformAlgorithm=m,l._flushAlgorithm=E,l._cancelAlgorithm=I,l._finishPromise=void 0,l._finishPromise_resolve=void 0,l._finishPromise_reject=void 0}a(A$,"SetUpTransformStreamDefaultController");function I$(c,l){let m=Object.create(qn.prototype),E,I,j;l.transform!==void 0?E=a(q=>l.transform(q,m),"transformAlgorithm"):E=a(q=>{try{return VS(m,q),p(void 0)}catch(oe){return f(oe)}},"transformAlgorithm"),l.flush!==void 0?I=a(()=>l.flush(m),"flushAlgorithm"):I=a(()=>p(void 0),"flushAlgorithm"),l.cancel!==void 0?j=a(q=>l.cancel(q),"cancelAlgorithm"):j=a(()=>p(void 0),"cancelAlgorithm"),A$(c,m,E,I,j)}a(I$,"SetUpTransformStreamDefaultControllerFromTransformer");function Lu(c){c._transformAlgorithm=void 0,c._flushAlgorithm=void 0,c._cancelAlgorithm=void 0}a(Lu,"TransformStreamDefaultControllerClearAlgorithms");function VS(c,l){let m=c._controlledTransformStream,E=m._readable._readableStreamController;if(!hi(E))throw new TypeError("Readable side is not in a state that permits enqueue");try{mi(E,l)}catch(j){throw Cm(m,j),m._readable._storedError}o$(E)!==m._backpressure&&ju(m,!0)}a(VS,"TransformStreamDefaultControllerEnqueue");function R$(c,l){qS(c._controlledTransformStream,l)}a(R$,"TransformStreamDefaultControllerError");function ZS(c,l){let m=c._transformAlgorithm(l);return P(m,void 0,E=>{throw qS(c._controlledTransformStream,E),E})}a(ZS,"TransformStreamDefaultControllerPerformTransform");function O$(c){let l=c._controlledTransformStream,m=l._readable._readableStreamController;xo(m);let E=new TypeError("TransformStream terminated");Cm(l,E)}a(O$,"TransformStreamDefaultControllerTerminate");function k$(c,l){let m=c._transformStreamController;if(c._backpressure){let E=c._backpressureChangePromise;return P(E,()=>{let I=c._writable;if(I._state==="erroring")throw I._storedError;return ZS(m,l)})}return ZS(m,l)}a(k$,"TransformStreamDefaultSinkWriteAlgorithm");function C$(c,l){let m=c._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let E=c._readable;m._finishPromise=d((j,q)=>{m._finishPromise_resolve=j,m._finishPromise_reject=q});let I=m._cancelAlgorithm(l);return Lu(m),y(I,()=>(E._state==="errored"?gi(m,E._storedError):(Nr(E._readableStreamController,l),zm(m)),null),j=>(Nr(E._readableStreamController,j),gi(m,j),null)),m._finishPromise}a(C$,"TransformStreamDefaultSinkAbortAlgorithm");function $$(c){let l=c._transformStreamController;if(l._finishPromise!==void 0)return l._finishPromise;let m=c._readable;l._finishPromise=d((I,j)=>{l._finishPromise_resolve=I,l._finishPromise_reject=j});let E=l._flushAlgorithm();return Lu(l),y(E,()=>(m._state==="errored"?gi(l,m._storedError):(xo(m._readableStreamController),zm(l)),null),I=>(Nr(m._readableStreamController,I),gi(l,I),null)),l._finishPromise}a($$,"TransformStreamDefaultSinkCloseAlgorithm");function z$(c){return ju(c,!1),c._backpressureChangePromise}a(z$,"TransformStreamDefaultSourcePullAlgorithm");function N$(c,l){let m=c._transformStreamController;if(m._finishPromise!==void 0)return m._finishPromise;let E=c._writable;m._finishPromise=d((j,q)=>{m._finishPromise_resolve=j,m._finishPromise_reject=q});let I=m._cancelAlgorithm(l);return Lu(m),y(I,()=>(E._state==="errored"?gi(m,E._storedError):(La(E._writableStreamController,l),$m(c),zm(m)),null),j=>(La(E._writableStreamController,j),$m(c),gi(m,j),null)),m._finishPromise}a(N$,"TransformStreamDefaultSourceCancelAlgorithm");function Fu(c){return new TypeError(`TransformStreamDefaultController.prototype.${c} can only be used on a TransformStreamDefaultController`)}a(Fu,"defaultControllerBrandCheckException");function zm(c){c._finishPromise_resolve!==void 0&&(c._finishPromise_resolve(),c._finishPromise_resolve=void 0,c._finishPromise_reject=void 0)}a(zm,"defaultControllerFinishPromiseResolve");function gi(c,l){c._finishPromise_reject!==void 0&&(x(c._finishPromise),c._finishPromise_reject(l),c._finishPromise_resolve=void 0,c._finishPromise_reject=void 0)}a(gi,"defaultControllerFinishPromiseReject");function HS(c){return new TypeError(`TransformStream.prototype.${c} can only be used on a TransformStream`)}a(HS,"streamBrandCheckException"),e.ByteLengthQueuingStrategy=Nu,e.CountQueuingStrategy=Du,e.ReadableByteStreamController=yn,e.ReadableStream=$t,e.ReadableStreamBYOBReader=Mn,e.ReadableStreamBYOBRequest=_o,e.ReadableStreamDefaultController=bn,e.ReadableStreamDefaultReader=H,e.TransformStream=Uu,e.TransformStreamDefaultController=qn,e.WritableStream=Ln,e.WritableStreamDefaultController=fi,e.WritableStreamDefaultWriter=_n}))});var TR=B(()=>{if(!globalThis.ReadableStream)try{let e=require("node:process"),{emitWarning:t}=e;try{e.emitWarning=()=>{},Object.assign(globalThis,require("node:stream/web")),e.emitWarning=t}catch(n){throw e.emitWarning=t,n}}catch{Object.assign(globalThis,xR())}try{let{Blob:e}=require("buffer");e&&!e.prototype.stream&&(e.prototype.stream=a(function(n){let o=0,r=this;return new ReadableStream({type:"bytes",async pull(i){let u=await r.slice(o,Math.min(r.size,o+65536)).arrayBuffer();o+=u.byteLength,i.enqueue(new Uint8Array(u)),o===r.size&&i.close()}})},"name"))}catch{}});async function*Ub(e,t=!0){for(let n of e)if("stream"in n)yield*n.stream();else if(ArrayBuffer.isView(n))if(t){let o=n.byteOffset,r=n.byteOffset+n.byteLength;for(;o!==r;){let i=Math.min(r-o,wR),s=n.buffer.slice(o,o+i);o+=s.byteLength,yield new Uint8Array(s)}}else yield n;else{let o=0,r=n;for(;o!==r.size;){let s=await r.slice(o,Math.min(r.size,o+wR)).arrayBuffer();o+=s.byteLength,yield new Uint8Array(s)}}}var FQ,wR,AR,P1,Vr,Fc=_t(()=>{FQ=It(TR(),1);wR=65536;a(Ub,"toIterator");AR=class jb{static{a(this,"Blob")}#e=[];#t="";#r=0;#n="transparent";constructor(t=[],n={}){if(typeof t!="object"||t===null)throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.");if(typeof t[Symbol.iterator]!="function")throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.");if(typeof n!="object"&&typeof n!="function")throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.");n===null&&(n={});let o=new TextEncoder;for(let i of t){let s;ArrayBuffer.isView(i)?s=new Uint8Array(i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)):i instanceof ArrayBuffer?s=new Uint8Array(i.slice(0)):i instanceof jb?s=i:s=o.encode(`${i}`),this.#r+=ArrayBuffer.isView(s)?s.byteLength:s.size,this.#e.push(s)}this.#n=`${n.endings===void 0?"transparent":n.endings}`;let r=n.type===void 0?"":String(n.type);this.#t=/^[\x20-\x7E]*$/.test(r)?r:""}get size(){return this.#r}get type(){return this.#t}async text(){let t=new TextDecoder,n="";for await(let o of Ub(this.#e,!1))n+=t.decode(o,{stream:!0});return n+=t.decode(),n}async arrayBuffer(){let t=new Uint8Array(this.size),n=0;for await(let o of Ub(this.#e,!1))t.set(o,n),n+=o.length;return t.buffer}stream(){let t=Ub(this.#e,!0);return new globalThis.ReadableStream({type:"bytes",async pull(n){let o=await t.next();o.done?n.close():n.enqueue(o.value)},async cancel(){await t.return()}})}slice(t=0,n=this.size,o=""){let{size:r}=this,i=t<0?Math.max(r+t,0):Math.min(t,r),s=n<0?Math.max(r+n,0):Math.min(n,r),u=Math.max(s-i,0),d=this.#e,p=[],f=0;for(let y of d){if(f>=u)break;let h=ArrayBuffer.isView(y)?y.byteLength:y.size;if(i&&h<=i)i-=h,s-=h;else{let _;ArrayBuffer.isView(y)?(_=y.subarray(i,Math.min(h,s)),f+=_.byteLength):(_=y.slice(i,Math.min(h,s)),f+=_.size),s-=h,p.push(_),i=0}}let g=new jb([],{type:String(o).toLowerCase()});return g.#r=u,g.#e=p,g}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t=="object"&&typeof t.constructor=="function"&&(typeof t.stream=="function"||typeof t.arrayBuffer=="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(AR.prototype,{size:{enumerable:!0},type:{enumerable:!0},slice:{enumerable:!0}});P1=AR,Vr=P1});var x1,T1,lo,Mb=_t(()=>{Fc();x1=class extends Vr{static{a(this,"File")}#e=0;#t="";constructor(t,n,o={}){if(arguments.length<2)throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`);super(t,o),o===null&&(o={});let r=o.lastModified===void 0?Date.now():Number(o.lastModified);Number.isNaN(r)||(this.#e=r),this.#t=String(n)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](t){return!!t&&t instanceof Vr&&/^(File)$/.test(t[Symbol.toStringTag])}},T1=x1,lo=T1});function OR(e,t=Vr){var n=`${IR()}${IR()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),o=[],r=`--${n}\r
|
|
15
|
+
Content-Disposition: form-data; name="`;return e.forEach((i,s)=>typeof i=="string"?o.push(r+Lb(s)+`"\r
|
|
16
16
|
\r
|
|
17
|
-
${
|
|
17
|
+
${i.replace(/\r(?!\n)|(?<!\r)\n/g,`\r
|
|
18
18
|
`)}\r
|
|
19
|
-
`):
|
|
20
|
-
Content-Type: ${
|
|
19
|
+
`):o.push(r+Lb(s)+`"; filename="${Lb(i.name,1)}"\r
|
|
20
|
+
Content-Type: ${i.type||"application/octet-stream"}\r
|
|
21
21
|
\r
|
|
22
|
-
`,
|
|
23
|
-
`)),
|
|
24
|
-
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),
|
|
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=Be.START_BOUNDARY}write(e){let r=0,n=e.length,i=this.index,{lookbehind:u,boundary:c,boundaryChars:l,index:p,state:f,flags:m}=this,g=this.boundary.length,S=g-1,h=e.length,_,T,E=o(G=>{this[G+"Mark"]=r},"mark"),w=o(G=>{delete this[G+"Mark"]},"clear"),k=o((G,V,H,J)=>{(V===void 0||V!==H)&&this[G](J&&J.subarray(V,H))},"callback"),q=o((G,V)=>{let H=G+"Mark";H in this&&(V?(k(G,this[H],r,e),delete this[H]):(k(G,this[H],e.length,e),this[H]=0))},"dataCallback");for(r=0;r<n;r++)switch(_=e[r],f){case Be.START_BOUNDARY:if(p===c.length-2){if(_===qi)m|=In.LAST_BOUNDARY;else if(_!==Ls)return;p++;break}else if(p-1===c.length-2){if(m&In.LAST_BOUNDARY&&_===qi)f=Be.END,m=0;else if(!(m&In.LAST_BOUNDARY)&&_===Ms)p=0,k("onPartBegin"),f=Be.HEADER_FIELD_START;else return;break}_!==c[p+2]&&(p=-2),_===c[p+2]&&p++;break;case Be.HEADER_FIELD_START:f=Be.HEADER_FIELD,E("onHeaderField"),p=0;case Be.HEADER_FIELD:if(_===Ls){w("onHeaderField"),f=Be.HEADERS_ALMOST_DONE;break}if(p++,_===qi)break;if(_===dC){if(p===1)return;q("onHeaderField",!0),f=Be.HEADER_VALUE_START;break}if(T=mC(_),T<pC||T>fC)return;break;case Be.HEADER_VALUE_START:if(_===lC)break;E("onHeaderValue"),f=Be.HEADER_VALUE;case Be.HEADER_VALUE:_===Ls&&(q("onHeaderValue",!0),k("onHeaderEnd"),f=Be.HEADER_VALUE_ALMOST_DONE);break;case Be.HEADER_VALUE_ALMOST_DONE:if(_!==Ms)return;f=Be.HEADER_FIELD_START;break;case Be.HEADERS_ALMOST_DONE:if(_!==Ms)return;k("onHeadersEnd"),f=Be.PART_DATA_START;break;case Be.PART_DATA_START:f=Be.PART_DATA,E("onPartData");case Be.PART_DATA:if(i=p,p===0){for(r+=S;r<h&&!(e[r]in l);)r+=g;r-=S,_=e[r]}if(p<c.length)c[p]===_?(p===0&&q("onPartData",!0),p++):p=0;else if(p===c.length)p++,_===Ls?m|=In.PART_BOUNDARY:_===qi?m|=In.LAST_BOUNDARY:p=0;else if(p-1===c.length)if(m&In.PART_BOUNDARY){if(p=0,_===Ms){m&=~In.PART_BOUNDARY,k("onPartEnd"),k("onPartBegin"),f=Be.HEADER_FIELD_START;break}}else m&In.LAST_BOUNDARY&&_===qi?(k("onPartEnd"),f=Be.END,m=0):p=0;if(p>0)u[p-1]=_;else if(i>0){let G=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);k("onPartData",0,i,G),i=0,E("onPartData"),r--}break;case Be.END:break;default:throw new Error(`Unexpected state entered: ${f}`)}q("onHeaderField"),q("onHeaderValue"),q("onPartData"),this.index=p,this.state=f,this.flags=m}end(){if(this.state===Be.HEADER_FIELD_START&&this.index===0||this.state===Be.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Be.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};o(hC,"_fileName");o(gC,"toFormData")});async function Hl(t){if(t[Nt].disturbed)throw new TypeError(`body used already for: ${t.url}`);if(t[Nt].disturbed=!0,t[Nt].error)throw t[Nt].error;let{body:e}=t;if(e===null)return qt.Buffer.alloc(0);if(!(e instanceof ir.default))return qt.Buffer.alloc(0);let r=[],n=0;try{for await(let i of e){if(t.size>0&&n+i.length>t.size){let u=new At(`content size at ${t.url} over limit: ${t.size}`,"max-size");throw e.destroy(u),u}n+=i.length,r.push(i)}}catch(i){throw i instanceof en?i:new At(`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")?qt.Buffer.from(r.join("")):qt.Buffer.concat(r,n)}catch(i){throw new At(`Could not create Buffer from response body for ${t.url}: ${i.message}`,"system",i)}else throw new At(`Premature close of server response while trying to fetch ${t.url}`)}var ir,tn,qt,yC,Nt,kr,zo,_C,Fs,Db,Ub,Bs=ct(()=>{ir=gt(require("node:stream"),1),tn=require("node:util"),qt=require("node:buffer");Li();Ns();Ll();zs();Us();yC=(0,tn.promisify)(ir.default.pipeline),Nt=Symbol("Body internals"),kr=class{static{o(this,"Body")}constructor(e,{size:r=0}={}){let n=null;e===null?e=null:Fl(e)?e=qt.Buffer.from(e.toString()):Bi(e)||qt.Buffer.isBuffer(e)||(tn.types.isAnyArrayBuffer(e)?e=qt.Buffer.from(e):ArrayBuffer.isView(e)?e=qt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ir.default||(e instanceof An?(e=bb(e),n=e.type.split("=")[1]):e=qt.Buffer.from(String(e))));let i=e;qt.Buffer.isBuffer(e)?i=ir.default.Readable.from(e):Bi(e)&&(i=ir.default.Readable.from(e.stream())),this[Nt]={body:e,stream:i,boundary:n,disturbed:!1,error:null},this.size=r,e instanceof ir.default&&e.on("error",u=>{let c=u instanceof en?u:new At(`Invalid response body while trying to fetch ${this.url}: ${u.message}`,"system",u);this[Nt].error=c})}get body(){return this[Nt].stream}get bodyUsed(){return this[Nt].disturbed}async arrayBuffer(){let{buffer:e,byteOffset:r,byteLength:n}=await Hl(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 An,i=new URLSearchParams(await this.text());for(let[u,c]of i)n.append(u,c);return n}let{toFormData:r}=await Promise.resolve().then(()=>(zb(),Nb));return r(this.body,e)}async blob(){let e=this.headers&&this.headers.get("content-type")||this[Nt].body&&this[Nt].body.type||"",r=await this.arrayBuffer();return new gr([r],{type:e})}async json(){let e=await this.text();return JSON.parse(e)}async text(){let e=await Hl(this);return new TextDecoder().decode(e)}buffer(){return Hl(this)}};kr.prototype.buffer=(0,tn.deprecate)(kr.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(kr.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,tn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});o(Hl,"consumeBody");zo=o((t,e)=>{let r,n,{body:i}=t[Nt];if(t.bodyUsed)throw new Error("cannot clone body after it is used");return i instanceof ir.default&&typeof i.getBoundary!="function"&&(r=new ir.PassThrough({highWaterMark:e}),n=new ir.PassThrough({highWaterMark:e}),i.pipe(r),i.pipe(n),t[Nt].stream=r,i=n),i},"clone"),_C=(0,tn.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"),Fs=o((t,e)=>t===null?null:typeof t=="string"?"text/plain;charset=UTF-8":Fl(t)?"application/x-www-form-urlencoded;charset=UTF-8":Bi(t)?t.type||null:qt.Buffer.isBuffer(t)||tn.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)?null:t instanceof An?`multipart/form-data; boundary=${e[Nt].boundary}`:t&&typeof t.getBoundary=="function"?`multipart/form-data;boundary=${_C(t)}`:t instanceof ir.default?null:"text/plain;charset=UTF-8","extractContentType"),Db=o(t=>{let{body:e}=t[Nt];return e===null?0:Bi(e)?e.size:qt.Buffer.isBuffer(e)?e.length:e&&typeof e.getLengthSync=="function"&&e.hasKnownLength&&e.hasKnownLength()?e.getLengthSync():null},"getTotalBytes"),Ub=o(async(t,{body:e})=>{e===null?t.end():await yC(e,t)},"writeToStream")});function jb(t=[]){return new zt(t.reduce((e,r,n,i)=>(n%2===0&&e.push(i.slice(n,n+2)),e),[]).filter(([e,r])=>{try{return qs(e),Wl(e,String(r)),!0}catch{return!1}}))}var Gl,Vi,qs,Wl,zt,Vs=ct(()=>{Gl=require("node:util"),Vi=gt(require("node:http"),1),qs=typeof Vi.default.validateHeaderName=="function"?Vi.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}},Wl=typeof Vi.default.validateHeaderValue=="function"?Vi.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}},zt=class t extends URLSearchParams{static{o(this,"Headers")}constructor(e){let r=[];if(e instanceof t){let n=e.raw();for(let[i,u]of Object.entries(n))r.push(...u.map(c=>[i,c]))}else if(e!=null)if(typeof e=="object"&&!Gl.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"||Gl.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])=>(qs(n),Wl(n,String(i)),[String(n).toLowerCase(),String(i)])):void 0,super(r),new Proxy(this,{get(n,i,u){switch(i){case"append":case"set":return(c,l)=>(qs(c),Wl(c,String(l)),URLSearchParams.prototype[i].call(n,String(c).toLowerCase(),String(l)));case"delete":case"has":case"getAll":return c=>(qs(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,u)}}})}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(zt.prototype,["get","entries","forEach","values"].reduce((t,e)=>(t[e]={enumerable:!0},t),{}));o(jb,"fromRawHeaders")});var bC,Hi,Zl=ct(()=>{bC=new Set([301,302,303,307,308]),Hi=o(t=>bC.has(t),"isRedirect")});var yr,Vt,Mb=ct(()=>{Vs();Bs();Zl();yr=Symbol("Response internals"),Vt=class t extends kr{static{o(this,"Response")}constructor(e=null,r={}){super(e,r);let n=r.status!=null?r.status:200,i=new zt(r.headers);if(e!==null&&!i.has("Content-Type")){let u=Fs(e,this);u&&i.append("Content-Type",u)}this[yr]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:i,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[yr].type}get url(){return this[yr].url||""}get status(){return this[yr].status}get ok(){return this[yr].status>=200&&this[yr].status<300}get redirected(){return this[yr].counter>0}get statusText(){return this[yr].statusText}get headers(){return this[yr].headers}get highWaterMark(){return this[yr].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(!Hi(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[yr].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 zt(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(Vt.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 Lb,Fb=ct(()=>{Lb=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 Bb(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 Gb(t){if(!Vb.has(t))throw new TypeError(`Invalid referrerPolicy: ${t}`);return t}function vC(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 Do(t){return/^about:(blank|srcdoc)$/.test(t)||t.protocol==="data:"||/^(blob|filesystem):$/.test(t.protocol)?!0:vC(t)}function Wb(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,u=Bb(i),c=Bb(i,!0);u.toString().length>4096&&(u=c),e&&(u=e(u)),r&&(c=r(c));let l=new URL(t.url);switch(n){case"no-referrer":return"no-referrer";case"origin":return c;case"unsafe-url":return u;case"strict-origin":return Do(u)&&!Do(l)?"no-referrer":c.toString();case"strict-origin-when-cross-origin":return u.origin===l.origin?u:Do(u)&&!Do(l)?"no-referrer":c;case"same-origin":return u.origin===l.origin?u:"no-referrer";case"origin-when-cross-origin":return u.origin===l.origin?u:c;case"no-referrer-when-downgrade":return Do(u)&&!Do(l)?"no-referrer":u;default:throw new TypeError(`Invalid referrerPolicy: ${n}`)}}function Zb(t){let e=(t.get("referrer-policy")||"").split(/[,\s]+/),r="";for(let n of e)n&&Vb.has(n)&&(r=n);return r}var qb,Vb,Hb,Jl=ct(()=>{qb=require("node:net");o(Bb,"stripURLForUseAsAReferrer");Vb=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),Hb="strict-origin-when-cross-origin";o(Gb,"validateReferrerPolicy");o(vC,"isOriginPotentiallyTrustworthy");o(Do,"isUrlPotentiallyTrustworthy");o(Wb,"determineRequestsReferrer");o(Zb,"parseReferrerPolicyFromHeader")});var Jb,Kb,ft,Gi,EC,Rn,Qb,Yb=ct(()=>{Jb=require("node:url"),Kb=require("node:util");Vs();Bs();Us();Fb();Jl();ft=Symbol("Request internals"),Gi=o(t=>typeof t=="object"&&typeof t[ft]=="object","isRequest"),EC=(0,Kb.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Rn=class t extends kr{static{o(this,"Request")}constructor(e,r={}){let n;if(Gi(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()),!Gi(r)&&"data"in r&&EC(),(r.body!=null||Gi(e)&&e.body!==null)&&(i==="GET"||i==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let u=r.body?r.body:Gi(e)&&e.body!==null?zo(e):null;super(u,{size:r.size||e.size||0});let c=new zt(r.headers||e.headers||{});if(u!==null&&!c.has("Content-Type")){let f=Fs(u,this);f&&c.set("Content-Type",f)}let l=Gi(e)?e.signal:null;if("signal"in r&&(l=r.signal),l!=null&&!vb(l))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let p=r.referrer==null?e.referrer:r.referrer;if(p==="")p="no-referrer";else if(p){let f=new URL(p);p=/^about:(\/\/)?client$/.test(f)?"client":f}else p=void 0;this[ft]={method:i,redirect:r.redirect||e.redirect||"follow",headers:c,parsedURL:n,signal:l,referrer:p},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[ft].method}get url(){return(0,Jb.format)(this[ft].parsedURL)}get headers(){return this[ft].headers}get redirect(){return this[ft].redirect}get signal(){return this[ft].signal}get referrer(){if(this[ft].referrer==="no-referrer")return"";if(this[ft].referrer==="client")return"about:client";if(this[ft].referrer)return this[ft].referrer.toString()}get referrerPolicy(){return this[ft].referrerPolicy}set referrerPolicy(e){this[ft].referrerPolicy=Gb(e)}clone(){return new t(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Rn.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}});Qb=o(t=>{let{parsedURL:e}=t[ft],r=new zt(t[ft].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 l=Db(t);typeof l=="number"&&!Number.isNaN(l)&&(n=String(l))}n&&r.set("Content-Length",n),t.referrerPolicy===""&&(t.referrerPolicy=Hb),t.referrer&&t.referrer!=="no-referrer"?t[ft].referrer=Wb(t):t[ft].referrer="no-referrer",t[ft].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 u=Lb(e),c={path:e.pathname+u,method:t.method,headers:r[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:e,options:c}},"getNodeRequestOptions")});var Wi,Xb=ct(()=>{zs();Wi=class extends en{static{o(this,"AbortError")}constructor(e,r="aborted"){super(e,r)}}});var rv={};Ba(rv,{AbortError:()=>Wi,Blob:()=>gr,FetchError:()=>At,File:()=>xn,FormData:()=>An,Headers:()=>zt,Request:()=>Rn,Response:()=>Vt,blobFrom:()=>Ib,blobFromSync:()=>Ab,default:()=>Kl,fileFrom:()=>Rb,fileFromSync:()=>Cb,isRedirect:()=>Hi});async function Kl(t,e){return new Promise((r,n)=>{let i=new Rn(t,e),{parsedURL:u,options:c}=Qb(i);if(!SC.has(u.protocol))throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${u.protocol.replace(/:$/,"")}" is not supported.`);if(u.protocol==="data:"){let _=lb(i.url),T=new Vt(_,{headers:{"Content-Type":_.typeFull}});r(T);return}let l=(u.protocol==="https:"?tv.default:ev.default).request,{signal:p}=i,f=null,m=o(()=>{let _=new Wi("The operation was aborted.");n(_),i.body&&i.body instanceof Ht.default.Readable&&i.body.destroy(_),!(!f||!f.body)&&f.body.emit("error",_)},"abort");if(p&&p.aborted){m();return}let g=o(()=>{m(),h()},"abortAndFinalize"),S=l(u.toString(),c);p&&p.addEventListener("abort",g);let h=o(()=>{S.abort(),p&&p.removeEventListener("abort",g)},"finalize");S.on("error",_=>{n(new At(`request to ${i.url} failed, reason: ${_.message}`,"system",_)),h()}),PC(S,_=>{f&&f.body&&f.body.destroy(_)}),process.version<"v14"&&S.on("socket",_=>{let T;_.prependListener("end",()=>{T=_._eventsCount}),_.prependListener("close",E=>{if(f&&T<_._eventsCount&&!E){let w=new Error("Premature close");w.code="ERR_STREAM_PREMATURE_CLOSE",f.body.emit("error",w)}})}),S.on("response",_=>{S.setTimeout(0);let T=jb(_.rawHeaders);if(Hi(_.statusCode)){let G=T.get("Location"),V=null;try{V=G===null?null:new URL(G,i.url)}catch{if(i.redirect!=="manual"){n(new At(`uri requested responds with an invalid redirect URL: ${G}`,"invalid-redirect")),h();return}}switch(i.redirect){case"error":n(new At(`uri requested responds with a redirect, redirect mode is set to error: ${i.url}`,"no-redirect")),h();return;case"manual":break;case"follow":{if(V===null)break;if(i.counter>=i.follow){n(new At(`maximum redirect reached at: ${i.url}`,"max-redirect")),h();return}let H={headers:new zt(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(!Eb(i.url,V)||!Sb(i.url,V))for(let re of["authorization","www-authenticate","cookie","cookie2"])H.headers.delete(re);if(_.statusCode!==303&&i.body&&e.body instanceof Ht.default.Readable){n(new At("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}(_.statusCode===303||(_.statusCode===301||_.statusCode===302)&&i.method==="POST")&&(H.method="GET",H.body=void 0,H.headers.delete("content-length"));let J=Zb(T);J&&(H.referrerPolicy=J),r(Kl(new Rn(V,H))),h();return}default:return n(new TypeError(`Redirect option '${i.redirect}' is not a valid value of RequestRedirect`))}}p&&_.once("end",()=>{p.removeEventListener("abort",g)});let E=(0,Ht.pipeline)(_,new Ht.PassThrough,G=>{G&&n(G)});process.version<"v12.10"&&_.on("aborted",g);let w={url:i.url,status:_.statusCode,statusText:_.statusMessage,headers:T,size:i.size,counter:i.counter,highWaterMark:i.highWaterMark},k=T.get("Content-Encoding");if(!i.compress||i.method==="HEAD"||k===null||_.statusCode===204||_.statusCode===304){f=new Vt(E,w),r(f);return}let q={flush:Jn.default.Z_SYNC_FLUSH,finishFlush:Jn.default.Z_SYNC_FLUSH};if(k==="gzip"||k==="x-gzip"){E=(0,Ht.pipeline)(E,Jn.default.createGunzip(q),G=>{G&&n(G)}),f=new Vt(E,w),r(f);return}if(k==="deflate"||k==="x-deflate"){let G=(0,Ht.pipeline)(_,new Ht.PassThrough,V=>{V&&n(V)});G.once("data",V=>{(V[0]&15)===8?E=(0,Ht.pipeline)(E,Jn.default.createInflate(),H=>{H&&n(H)}):E=(0,Ht.pipeline)(E,Jn.default.createInflateRaw(),H=>{H&&n(H)}),f=new Vt(E,w),r(f)}),G.once("end",()=>{f||(f=new Vt(E,w),r(f))});return}if(k==="br"){E=(0,Ht.pipeline)(E,Jn.default.createBrotliDecompress(),G=>{G&&n(G)}),f=new Vt(E,w),r(f);return}f=new Vt(E,w),r(f)}),Ub(S,i).catch(n)})}function PC(t,e){let r=Zi.Buffer.from(`0\r
|
|
22
|
+
`,i,`\r
|
|
23
|
+
`)),o.push(`--${n}--`),new t(o,{type:"multipart/form-data; boundary="+n})}var Bc,w1,A1,IR,I1,RR,Lb,Ko,po,Xp=_t(()=>{Fc();Mb();({toStringTag:Bc,iterator:w1,hasInstance:A1}=Symbol),IR=Math.random,I1="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),RR=a((e,t,n)=>(e+="",/^(Blob|File)$/.test(t&&t[Bc])?[(n=n!==void 0?n+"":t[Bc]=="File"?t.name:"blob",e),t.name!==n||t[Bc]=="blob"?new lo([t],n,t):t]:[e,t+""]),"f"),Lb=a((e,t)=>(t?e:e.replace(/\r?\n|\r/g,`\r
|
|
24
|
+
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),"e"),Ko=a((e,t,n)=>{if(t.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${t.length} present.`)},"x"),po=class{static{a(this,"FormData")}#e=[];constructor(...t){if(t.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Bc](){return"FormData"}[w1](){return this.entries()}static[A1](t){return t&&typeof t=="object"&&t[Bc]==="FormData"&&!I1.some(n=>typeof t[n]!="function")}append(...t){Ko("append",arguments,2),this.#e.push(RR(...t))}delete(t){Ko("delete",arguments,1),t+="",this.#e=this.#e.filter(([n])=>n!==t)}get(t){Ko("get",arguments,1),t+="";for(var n=this.#e,o=n.length,r=0;r<o;r++)if(n[r][0]===t)return n[r][1];return null}getAll(t,n){return Ko("getAll",arguments,1),n=[],t+="",this.#e.forEach(o=>o[0]===t&&n.push(o[1])),n}has(t){return Ko("has",arguments,1),t+="",this.#e.some(n=>n[0]===t)}forEach(t,n){Ko("forEach",arguments,1);for(var[o,r]of this)t.call(n,r,o,this)}set(...t){Ko("set",arguments,2);var n=[],o=!0;t=RR(...t),this.#e.forEach(r=>{r[0]===t[0]?o&&(o=!n.push(t)):n.push(r)}),o&&n.push(t),this.#e=n}*entries(){yield*this.#e}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}};a(OR,"formDataToBlob")});var kn,Qp=_t(()=>{kn=class extends Error{static{a(this,"FetchBaseError")}constructor(t,n){super(t),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}}});var qt,Fb=_t(()=>{Qp();qt=class extends kn{static{a(this,"FetchError")}constructor(t,n,o){super(t,n),o&&(this.code=this.errno=o.code,this.erroredSysCall=o.syscall)}}});var Yp,Bb,qc,kR,CR,$R,ef=_t(()=>{Yp=Symbol.toStringTag,Bb=a(e=>typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&typeof e.sort=="function"&&e[Yp]==="URLSearchParams","isURLSearchParameters"),qc=a(e=>e&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&/^(Blob|File)$/.test(e[Yp]),"isBlob"),kR=a(e=>typeof e=="object"&&(e[Yp]==="AbortSignal"||e[Yp]==="EventTarget"),"isAbortSignal"),CR=a((e,t)=>{let n=new URL(t).hostname,o=new URL(e).hostname;return n===o||n.endsWith(`.${o}`)},"isDomainOrSubdomain"),$R=a((e,t)=>{let n=new URL(t).protocol,o=new URL(e).protocol;return n===o},"isSameProtocol")});var NR=B((aY,zR)=>{if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=new e().port1,n=new ArrayBuffer;t.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}zR.exports=globalThis.DOMException});var Xo,DR,UR,qb,jR,MR,LR,FR,BR,qR,tf,Vb=_t(()=>{Xo=require("node:fs"),DR=require("node:path"),UR=It(NR(),1);Mb();Fc();({stat:qb}=Xo.promises),jR=a((e,t)=>BR((0,Xo.statSync)(e),e,t),"blobFromSync"),MR=a((e,t)=>qb(e).then(n=>BR(n,e,t)),"blobFrom"),LR=a((e,t)=>qb(e).then(n=>qR(n,e,t)),"fileFrom"),FR=a((e,t)=>qR((0,Xo.statSync)(e),e,t),"fileFromSync"),BR=a((e,t,n="")=>new Vr([new tf({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],{type:n}),"fromBlob"),qR=a((e,t,n="")=>new lo([new tf({path:t,size:e.size,lastModified:e.mtimeMs,start:0})],(0,DR.basename)(t),{type:n,lastModified:e.mtimeMs}),"fromFile"),tf=class e{static{a(this,"BlobDataItem")}#e;#t;constructor(t){this.#e=t.path,this.#t=t.start,this.size=t.size,this.lastModified=t.lastModified}slice(t,n){return new e({path:this.#e,lastModified:this.lastModified,size:n-t,start:this.#t+t})}async*stream(){let{mtimeMs:t}=await qb(this.#e);if(t>this.lastModified)throw new UR.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,Xo.createReadStream)(this.#e,{start:this.#t,end:this.#t+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}});var ZR={};ar(ZR,{toFormData:()=>N1});function z1(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let n=t[2]||t[3]||"",o=n.slice(n.lastIndexOf("\\")+1);return o=o.replace(/%22/g,'"'),o=o.replace(/&#(\d{4});/g,(r,i)=>String.fromCharCode(i)),o}async function N1(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let o=new Zb(n[1]||n[2]),r,i,s,u,d,p,f=[],g=new po,y=a(S=>{s+=x.decode(S,{stream:!0})},"onPartData"),h=a(S=>{f.push(S)},"appendToFile"),_=a(()=>{let S=new lo(f,p,{type:d});g.append(u,S)},"appendFileToFormData"),P=a(()=>{g.append(u,s)},"appendEntryToFormData"),x=new TextDecoder("utf-8");x.decode(),o.onPartBegin=function(){o.onPartData=y,o.onPartEnd=P,r="",i="",s="",u="",d="",p=null,f.length=0},o.onHeaderField=function(S){r+=x.decode(S,{stream:!0})},o.onHeaderValue=function(S){i+=x.decode(S,{stream:!0})},o.onHeaderEnd=function(){if(i+=x.decode(),r=r.toLowerCase(),r==="content-disposition"){let S=i.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);S&&(u=S[2]||S[3]||""),p=z1(i),p&&(o.onPartData=h,o.onPartEnd=_)}else r==="content-type"&&(d=i);i="",r=""};for await(let S of e)o.write(S);return o.end(),g}var on,Qe,VR,fo,rf,nf,R1,Vc,O1,k1,C1,$1,Qo,Zb,HR=_t(()=>{Vb();Xp();on=0,Qe={START_BOUNDARY:on++,HEADER_FIELD_START:on++,HEADER_FIELD:on++,HEADER_VALUE_START:on++,HEADER_VALUE:on++,HEADER_VALUE_ALMOST_DONE:on++,HEADERS_ALMOST_DONE:on++,PART_DATA_START:on++,PART_DATA:on++,END:on++},VR=1,fo={PART_BOUNDARY:VR,LAST_BOUNDARY:VR*=2},rf=10,nf=13,R1=32,Vc=45,O1=58,k1=97,C1=122,$1=a(e=>e|32,"lower"),Qo=a(()=>{},"noop"),Zb=class{static{a(this,"MultipartParser")}constructor(t){this.index=0,this.flags=0,this.onHeaderEnd=Qo,this.onHeaderField=Qo,this.onHeadersEnd=Qo,this.onHeaderValue=Qo,this.onPartBegin=Qo,this.onPartData=Qo,this.onPartEnd=Qo,this.boundaryChars={},t=`\r
|
|
25
|
+
--`+t;let n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o),this.boundaryChars[n[o]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=Qe.START_BOUNDARY}write(t){let n=0,o=t.length,r=this.index,{lookbehind:i,boundary:s,boundaryChars:u,index:d,state:p,flags:f}=this,g=this.boundary.length,y=g-1,h=t.length,_,P,x=a(W=>{this[W+"Mark"]=n},"mark"),S=a(W=>{delete this[W+"Mark"]},"clear"),$=a((W,Z,G,te)=>{(Z===void 0||Z!==G)&&this[W](te&&te.subarray(Z,G))},"callback"),V=a((W,Z)=>{let G=W+"Mark";G in this&&(Z?($(W,this[G],n,t),delete this[G]):($(W,this[G],t.length,t),this[G]=0))},"dataCallback");for(n=0;n<o;n++)switch(_=t[n],p){case Qe.START_BOUNDARY:if(d===s.length-2){if(_===Vc)f|=fo.LAST_BOUNDARY;else if(_!==nf)return;d++;break}else if(d-1===s.length-2){if(f&fo.LAST_BOUNDARY&&_===Vc)p=Qe.END,f=0;else if(!(f&fo.LAST_BOUNDARY)&&_===rf)d=0,$("onPartBegin"),p=Qe.HEADER_FIELD_START;else return;break}_!==s[d+2]&&(d=-2),_===s[d+2]&&d++;break;case Qe.HEADER_FIELD_START:p=Qe.HEADER_FIELD,x("onHeaderField"),d=0;case Qe.HEADER_FIELD:if(_===nf){S("onHeaderField"),p=Qe.HEADERS_ALMOST_DONE;break}if(d++,_===Vc)break;if(_===O1){if(d===1)return;V("onHeaderField",!0),p=Qe.HEADER_VALUE_START;break}if(P=$1(_),P<k1||P>C1)return;break;case Qe.HEADER_VALUE_START:if(_===R1)break;x("onHeaderValue"),p=Qe.HEADER_VALUE;case Qe.HEADER_VALUE:_===nf&&(V("onHeaderValue",!0),$("onHeaderEnd"),p=Qe.HEADER_VALUE_ALMOST_DONE);break;case Qe.HEADER_VALUE_ALMOST_DONE:if(_!==rf)return;p=Qe.HEADER_FIELD_START;break;case Qe.HEADERS_ALMOST_DONE:if(_!==rf)return;$("onHeadersEnd"),p=Qe.PART_DATA_START;break;case Qe.PART_DATA_START:p=Qe.PART_DATA,x("onPartData");case Qe.PART_DATA:if(r=d,d===0){for(n+=y;n<h&&!(t[n]in u);)n+=g;n-=y,_=t[n]}if(d<s.length)s[d]===_?(d===0&&V("onPartData",!0),d++):d=0;else if(d===s.length)d++,_===nf?f|=fo.PART_BOUNDARY:_===Vc?f|=fo.LAST_BOUNDARY:d=0;else if(d-1===s.length)if(f&fo.PART_BOUNDARY){if(d=0,_===rf){f&=~fo.PART_BOUNDARY,$("onPartEnd"),$("onPartBegin"),p=Qe.HEADER_FIELD_START;break}}else f&fo.LAST_BOUNDARY&&_===Vc?($("onPartEnd"),p=Qe.END,f=0):d=0;if(d>0)i[d-1]=_;else if(r>0){let W=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);$("onPartData",0,r,W),r=0,x("onPartData"),n--}break;case Qe.END:break;default:throw new Error(`Unexpected state entered: ${p}`)}V("onHeaderField"),V("onHeaderValue"),V("onPartData"),this.index=d,this.state=p,this.flags=f}end(){if(this.state===Qe.HEADER_FIELD_START&&this.index===0||this.state===Qe.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==Qe.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}};a(z1,"_fileName");a(N1,"toFormData")});async function Hb(e){if(e[er].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[er].disturbed=!0,e[er].error)throw e[er].error;let{body:t}=e;if(t===null)return pr.Buffer.alloc(0);if(!(t instanceof Or.default))return pr.Buffer.alloc(0);let n=[],o=0;try{for await(let r of t){if(e.size>0&&o+r.length>e.size){let i=new qt(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(i),i}o+=r.length,n.push(r)}}catch(r){throw r instanceof kn?r:new qt(`Invalid response body while trying to fetch ${e.url}: ${r.message}`,"system",r)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return n.every(r=>typeof r=="string")?pr.Buffer.from(n.join("")):pr.Buffer.concat(n,o)}catch(r){throw new qt(`Could not create Buffer from response body for ${e.url}: ${r.message}`,"system",r)}else throw new qt(`Premature close of server response while trying to fetch ${e.url}`)}var Or,Cn,pr,D1,er,an,pa,U1,of,GR,WR,af=_t(()=>{Or=It(require("node:stream"),1),Cn=require("node:util"),pr=require("node:buffer");Fc();Xp();Fb();Qp();ef();D1=(0,Cn.promisify)(Or.default.pipeline),er=Symbol("Body internals"),an=class{static{a(this,"Body")}constructor(t,{size:n=0}={}){let o=null;t===null?t=null:Bb(t)?t=pr.Buffer.from(t.toString()):qc(t)||pr.Buffer.isBuffer(t)||(Cn.types.isAnyArrayBuffer(t)?t=pr.Buffer.from(t):ArrayBuffer.isView(t)?t=pr.Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof Or.default||(t instanceof po?(t=OR(t),o=t.type.split("=")[1]):t=pr.Buffer.from(String(t))));let r=t;pr.Buffer.isBuffer(t)?r=Or.default.Readable.from(t):qc(t)&&(r=Or.default.Readable.from(t.stream())),this[er]={body:t,stream:r,boundary:o,disturbed:!1,error:null},this.size=n,t instanceof Or.default&&t.on("error",i=>{let s=i instanceof kn?i:new qt(`Invalid response body while trying to fetch ${this.url}: ${i.message}`,"system",i);this[er].error=s})}get body(){return this[er].stream}get bodyUsed(){return this[er].disturbed}async arrayBuffer(){let{buffer:t,byteOffset:n,byteLength:o}=await Hb(this);return t.slice(n,n+o)}async formData(){let t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){let o=new po,r=new URLSearchParams(await this.text());for(let[i,s]of r)o.append(i,s);return o}let{toFormData:n}=await Promise.resolve().then(()=>(HR(),ZR));return n(this.body,t)}async blob(){let t=this.headers&&this.headers.get("content-type")||this[er].body&&this[er].body.type||"",n=await this.arrayBuffer();return new Vr([n],{type:t})}async json(){let t=await this.text();return JSON.parse(t)}async text(){let t=await Hb(this);return new TextDecoder().decode(t)}buffer(){return Hb(this)}};an.prototype.buffer=(0,Cn.deprecate)(an.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(an.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,Cn.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});a(Hb,"consumeBody");pa=a((e,t)=>{let n,o,{body:r}=e[er];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return r instanceof Or.default&&typeof r.getBoundary!="function"&&(n=new Or.PassThrough({highWaterMark:t}),o=new Or.PassThrough({highWaterMark:t}),r.pipe(n),r.pipe(o),e[er].stream=n,r=o),r},"clone"),U1=(0,Cn.deprecate)(e=>e.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),of=a((e,t)=>e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":Bb(e)?"application/x-www-form-urlencoded;charset=UTF-8":qc(e)?e.type||null:pr.Buffer.isBuffer(e)||Cn.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof po?`multipart/form-data; boundary=${t[er].boundary}`:e&&typeof e.getBoundary=="function"?`multipart/form-data;boundary=${U1(e)}`:e instanceof Or.default?null:"text/plain;charset=UTF-8","extractContentType"),GR=a(e=>{let{body:t}=e[er];return t===null?0:qc(t)?t.size:pr.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},"getTotalBytes"),WR=a(async(e,{body:t})=>{t===null?e.end():await D1(t,e)},"writeToStream")});function JR(e=[]){return new tr(e.reduce((t,n,o,r)=>(o%2===0&&t.push(r.slice(o,o+2)),t),[]).filter(([t,n])=>{try{return sf(t),Wb(t,String(n)),!0}catch{return!1}}))}var Gb,Zc,sf,Wb,tr,cf=_t(()=>{Gb=require("node:util"),Zc=It(require("node:http"),1),sf=typeof Zc.default.validateHeaderName=="function"?Zc.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},Wb=typeof Zc.default.validateHeaderValue=="function"?Zc.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},tr=class e extends URLSearchParams{static{a(this,"Headers")}constructor(t){let n=[];if(t instanceof e){let o=t.raw();for(let[r,i]of Object.entries(o))n.push(...i.map(s=>[r,s]))}else if(t!=null)if(typeof t=="object"&&!Gb.types.isBoxedPrimitive(t)){let o=t[Symbol.iterator];if(o==null)n.push(...Object.entries(t));else{if(typeof o!="function")throw new TypeError("Header pairs must be iterable");n=[...t].map(r=>{if(typeof r!="object"||Gb.types.isBoxedPrimitive(r))throw new TypeError("Each header pair must be an iterable object");return[...r]}).map(r=>{if(r.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...r]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return n=n.length>0?n.map(([o,r])=>(sf(o),Wb(o,String(r)),[String(o).toLowerCase(),String(r)])):void 0,super(n),new Proxy(this,{get(o,r,i){switch(r){case"append":case"set":return(s,u)=>(sf(s),Wb(s,String(u)),URLSearchParams.prototype[r].call(o,String(s).toLowerCase(),String(u)));case"delete":case"has":case"getAll":return s=>(sf(s),URLSearchParams.prototype[r].call(o,String(s).toLowerCase()));case"keys":return()=>(o.sort(),new Set(URLSearchParams.prototype.keys.call(o)).keys());default:return Reflect.get(o,r,i)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){let n=this.getAll(t);if(n.length===0)return null;let o=n.join(", ");return/^content-encoding$/i.test(t)&&(o=o.toLowerCase()),o}forEach(t,n=void 0){for(let o of this.keys())Reflect.apply(t,n,[this.get(o),o,this])}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((t,n)=>(t[n]=this.getAll(n),t),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((t,n)=>{let o=this.getAll(n);return n==="host"?t[n]=o[0]:t[n]=o.length>1?o:o[0],t},{})}};Object.defineProperties(tr.prototype,["get","entries","forEach","values"].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));a(JR,"fromRawHeaders")});var j1,Hc,Jb=_t(()=>{j1=new Set([301,302,303,307,308]),Hc=a(e=>j1.has(e),"isRedirect")});var Zr,fr,KR=_t(()=>{cf();af();Jb();Zr=Symbol("Response internals"),fr=class e extends an{static{a(this,"Response")}constructor(t=null,n={}){super(t,n);let o=n.status!=null?n.status:200,r=new tr(n.headers);if(t!==null&&!r.has("Content-Type")){let i=of(t,this);i&&r.append("Content-Type",i)}this[Zr]={type:"default",url:n.url,status:o,statusText:n.statusText||"",headers:r,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[Zr].type}get url(){return this[Zr].url||""}get status(){return this[Zr].status}get ok(){return this[Zr].status>=200&&this[Zr].status<300}get redirected(){return this[Zr].counter>0}get statusText(){return this[Zr].statusText}get headers(){return this[Zr].headers}get highWaterMark(){return this[Zr].highWaterMark}clone(){return new e(pa(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(t,n=302){if(!Hc(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new e(null,{headers:{location:new URL(t).toString()},status:n})}static error(){let t=new e(null,{status:0,statusText:""});return t[Zr].type="error",t}static json(t=void 0,n={}){let o=JSON.stringify(t);if(o===void 0)throw new TypeError("data is not JSON serializable");let r=new tr(n&&n.headers);return r.has("content-type")||r.set("content-type","application/json"),new e(o,{...n,headers:r})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(fr.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 XR,QR=_t(()=>{XR=a(e=>{if(e.search)return e.search;let t=e.href.length-1,n=e.hash||(e.href[t]==="#"?"#":"");return e.href[t-n.length]==="?"?"?":""},"getSearch")});function YR(e,t=!1){return e==null||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}function nO(e){if(!tO.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function M1(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),n=(0,eO.isIP)(t);return n===4&&/^127\./.test(t)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host==="localhost"||e.host.endsWith(".localhost")?!1:e.protocol==="file:"}function fa(e){return/^about:(blank|srcdoc)$/.test(e)||e.protocol==="data:"||/^(blob|filesystem):$/.test(e.protocol)?!0:M1(e)}function oO(e,{referrerURLCallback:t,referrerOriginCallback:n}={}){if(e.referrer==="no-referrer"||e.referrerPolicy==="")return null;let o=e.referrerPolicy;if(e.referrer==="about:client")return"no-referrer";let r=e.referrer,i=YR(r),s=YR(r,!0);i.toString().length>4096&&(i=s),t&&(i=t(i)),n&&(s=n(s));let u=new URL(e.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return s;case"unsafe-url":return i;case"strict-origin":return fa(i)&&!fa(u)?"no-referrer":s.toString();case"strict-origin-when-cross-origin":return i.origin===u.origin?i:fa(i)&&!fa(u)?"no-referrer":s;case"same-origin":return i.origin===u.origin?i:"no-referrer";case"origin-when-cross-origin":return i.origin===u.origin?i:s;case"no-referrer-when-downgrade":return fa(i)&&!fa(u)?"no-referrer":i;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function iO(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let o of t)o&&tO.has(o)&&(n=o);return n}var eO,tO,rO,Kb=_t(()=>{eO=require("node:net");a(YR,"stripURLForUseAsAReferrer");tO=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),rO="strict-origin-when-cross-origin";a(nO,"validateReferrerPolicy");a(M1,"isOriginPotentiallyTrustworthy");a(fa,"isUrlPotentiallyTrustworthy");a(oO,"determineRequestsReferrer");a(iO,"parseReferrerPolicyFromHeader")});var aO,sO,Tt,Gc,L1,mo,cO,uO=_t(()=>{aO=require("node:url"),sO=require("node:util");cf();af();ef();QR();Kb();Tt=Symbol("Request internals"),Gc=a(e=>typeof e=="object"&&typeof e[Tt]=="object","isRequest"),L1=(0,sO.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),mo=class e extends an{static{a(this,"Request")}constructor(t,n={}){let o;if(Gc(t)?o=new URL(t.url):(o=new URL(t),t={}),o.username!==""||o.password!=="")throw new TypeError(`${o} is an url with embedded credentials.`);let r=n.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(r)&&(r=r.toUpperCase()),!Gc(n)&&"data"in n&&L1(),(n.body!=null||Gc(t)&&t.body!==null)&&(r==="GET"||r==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let i=n.body?n.body:Gc(t)&&t.body!==null?pa(t):null;super(i,{size:n.size||t.size||0});let s=new tr(n.headers||t.headers||{});if(i!==null&&!s.has("Content-Type")){let p=of(i,this);p&&s.set("Content-Type",p)}let u=Gc(t)?t.signal:null;if("signal"in n&&(u=n.signal),u!=null&&!kR(u))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let d=n.referrer==null?t.referrer:n.referrer;if(d==="")d="no-referrer";else if(d){let p=new URL(d);d=/^about:(\/\/)?client$/.test(p)?"client":p}else d=void 0;this[Tt]={method:r,redirect:n.redirect||t.redirect||"follow",headers:s,parsedURL:o,signal:u,referrer:d},this.follow=n.follow===void 0?t.follow===void 0?20:t.follow:n.follow,this.compress=n.compress===void 0?t.compress===void 0?!0:t.compress:n.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent,this.highWaterMark=n.highWaterMark||t.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||t.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||t.referrerPolicy||""}get method(){return this[Tt].method}get url(){return(0,aO.format)(this[Tt].parsedURL)}get headers(){return this[Tt].headers}get redirect(){return this[Tt].redirect}get signal(){return this[Tt].signal}get referrer(){if(this[Tt].referrer==="no-referrer")return"";if(this[Tt].referrer==="client")return"about:client";if(this[Tt].referrer)return this[Tt].referrer.toString()}get referrerPolicy(){return this[Tt].referrerPolicy}set referrerPolicy(t){this[Tt].referrerPolicy=nO(t)}clone(){return new e(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(mo.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}});cO=a(e=>{let{parsedURL:t}=e[Tt],n=new tr(e[Tt].headers);n.has("Accept")||n.set("Accept","*/*");let o=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(o="0"),e.body!==null){let u=GR(e);typeof u=="number"&&!Number.isNaN(u)&&(o=String(u))}o&&n.set("Content-Length",o),e.referrerPolicy===""&&(e.referrerPolicy=rO),e.referrer&&e.referrer!=="no-referrer"?e[Tt].referrer=oO(e):e[Tt].referrer="no-referrer",e[Tt].referrer instanceof URL&&n.set("Referer",e.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:r}=e;typeof r=="function"&&(r=r(t));let i=XR(t),s={path:t.pathname+i,method:e.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:r};return{parsedURL:t,options:s}},"getNodeRequestOptions")});var Wc,lO=_t(()=>{Qp();Wc=class extends kn{static{a(this,"AbortError")}constructor(t,n="aborted"){super(t,n)}}});var fO={};ar(fO,{AbortError:()=>Wc,Blob:()=>Vr,FetchError:()=>qt,File:()=>lo,FormData:()=>po,Headers:()=>tr,Request:()=>mo,Response:()=>fr,blobFrom:()=>MR,blobFromSync:()=>jR,default:()=>Xb,fileFrom:()=>LR,fileFromSync:()=>FR,isRedirect:()=>Hc});async function Xb(e,t){return new Promise((n,o)=>{let r=new mo(e,t),{parsedURL:i,options:s}=cO(r);if(!F1.has(i.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${i.protocol.replace(/:$/,"")}" is not supported.`);if(i.protocol==="data:"){let _=ER(r.url),P=new fr(_,{headers:{"Content-Type":_.typeFull}});n(P);return}let u=(i.protocol==="https:"?pO.default:dO.default).request,{signal:d}=r,p=null,f=a(()=>{let _=new Wc("The operation was aborted.");o(_),r.body&&r.body instanceof mr.default.Readable&&r.body.destroy(_),!(!p||!p.body)&&p.body.emit("error",_)},"abort");if(d&&d.aborted){f();return}let g=a(()=>{f(),h()},"abortAndFinalize"),y=u(i.toString(),s);d&&d.addEventListener("abort",g);let h=a(()=>{y.abort(),d&&d.removeEventListener("abort",g)},"finalize");y.on("error",_=>{o(new qt(`request to ${r.url} failed, reason: ${_.message}`,"system",_)),h()}),B1(y,_=>{p&&p.body&&p.body.destroy(_)}),process.version<"v14"&&y.on("socket",_=>{let P;_.prependListener("end",()=>{P=_._eventsCount}),_.prependListener("close",x=>{if(p&&P<_._eventsCount&&!x){let S=new Error("Premature close");S.code="ERR_STREAM_PREMATURE_CLOSE",p.body.emit("error",S)}})}),y.on("response",_=>{y.setTimeout(0);let P=JR(_.rawHeaders);if(Hc(_.statusCode)){let W=P.get("Location"),Z=null;try{Z=W===null?null:new URL(W,r.url)}catch{if(r.redirect!=="manual"){o(new qt(`uri requested responds with an invalid redirect URL: ${W}`,"invalid-redirect")),h();return}}switch(r.redirect){case"error":o(new qt(`uri requested responds with a redirect, redirect mode is set to error: ${r.url}`,"no-redirect")),h();return;case"manual":break;case"follow":{if(Z===null)break;if(r.counter>=r.follow){o(new qt(`maximum redirect reached at: ${r.url}`,"max-redirect")),h();return}let G={headers:new tr(r.headers),follow:r.follow,counter:r.counter+1,agent:r.agent,compress:r.compress,method:r.method,body:pa(r),signal:r.signal,size:r.size,referrer:r.referrer,referrerPolicy:r.referrerPolicy};if(!CR(r.url,Z)||!$R(r.url,Z))for(let ce of["authorization","www-authenticate","cookie","cookie2"])G.headers.delete(ce);if(_.statusCode!==303&&r.body&&t.body instanceof mr.default.Readable){o(new qt("Cannot follow redirect with body being a readable stream","unsupported-redirect")),h();return}(_.statusCode===303||(_.statusCode===301||_.statusCode===302)&&r.method==="POST")&&(G.method="GET",G.body=void 0,G.headers.delete("content-length"));let te=iO(P);te&&(G.referrerPolicy=te),n(Xb(new mo(Z,G))),h();return}default:return o(new TypeError(`Redirect option '${r.redirect}' is not a valid value of RequestRedirect`))}}d&&_.once("end",()=>{d.removeEventListener("abort",g)});let x=(0,mr.pipeline)(_,new mr.PassThrough,W=>{W&&o(W)});process.version<"v12.10"&&_.on("aborted",g);let S={url:r.url,status:_.statusCode,statusText:_.statusMessage,headers:P,size:r.size,counter:r.counter,highWaterMark:r.highWaterMark},$=P.get("Content-Encoding");if(!r.compress||r.method==="HEAD"||$===null||_.statusCode===204||_.statusCode===304){p=new fr(x,S),n(p);return}let V={flush:Yo.default.Z_SYNC_FLUSH,finishFlush:Yo.default.Z_SYNC_FLUSH};if($==="gzip"||$==="x-gzip"){x=(0,mr.pipeline)(x,Yo.default.createGunzip(V),W=>{W&&o(W)}),p=new fr(x,S),n(p);return}if($==="deflate"||$==="x-deflate"){let W=(0,mr.pipeline)(_,new mr.PassThrough,Z=>{Z&&o(Z)});W.once("data",Z=>{(Z[0]&15)===8?x=(0,mr.pipeline)(x,Yo.default.createInflate(),G=>{G&&o(G)}):x=(0,mr.pipeline)(x,Yo.default.createInflateRaw(),G=>{G&&o(G)}),p=new fr(x,S),n(p)}),W.once("end",()=>{p||(p=new fr(x,S),n(p))});return}if($==="br"){x=(0,mr.pipeline)(x,Yo.default.createBrotliDecompress(),W=>{W&&o(W)}),p=new fr(x,S),n(p);return}p=new fr(x,S),n(p)}),WR(y,r).catch(o)})}function B1(e,t){let n=Jc.Buffer.from(`0\r
|
|
26
26
|
\r
|
|
27
|
-
`),
|
|
28
|
-
Content-Type: ${
|
|
27
|
+
`),o=!1,r=!1,i;e.on("response",s=>{let{headers:u}=s;o=u["transfer-encoding"]==="chunked"&&!u["content-length"]}),e.on("socket",s=>{let u=a(()=>{if(o&&!r){let p=new Error("Premature close");p.code="ERR_STREAM_PREMATURE_CLOSE",t(p)}},"onSocketClose"),d=a(p=>{r=Jc.Buffer.compare(p.slice(-5),n)===0,!r&&i&&(r=Jc.Buffer.compare(i.slice(-3),n.slice(0,3))===0&&Jc.Buffer.compare(p.slice(-2),n.slice(3))===0),i=p},"onData");s.prependListener("close",u),s.on("data",d),e.on("close",()=>{s.removeListener("close",u),s.removeListener("data",d)})})}var dO,pO,Yo,mr,Jc,F1,mO=_t(()=>{dO=It(require("node:http"),1),pO=It(require("node:https"),1),Yo=It(require("node:zlib"),1),mr=It(require("node:stream"),1),Jc=require("node:buffer");SR();af();KR();cf();uO();Fb();lO();Jb();Xp();ef();Kb();Vb();F1=new Set(["data:","http:","https:"]);a(Xb,"fetch");a(B1,"fixResponseChunkedTransferBadEnding")});var yO=B(ha=>{"use strict";var q1=ha&&ha.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ma;Object.defineProperty(ha,"__esModule",{value:!0});ha.Gaxios=void 0;var V1=q1(xb()),Z1=require("https"),ei=Ab(),H1=JI(),hO=require("stream"),gO=Ob(),G1=a(async()=>globalThis.crypto?.randomUUID()||(await import("crypto")).randomUUID(),"randomUUID"),W1=204,uf=class{static{a(this,"Gaxios")}agentCache=new Map;defaults;interceptors;constructor(t){this.defaults=t||{},this.interceptors={request:new gO.GaxiosInterceptorManager,response:new gO.GaxiosInterceptorManager}}fetch(...t){let n=t[0],o=t[1],r,i=new Headers;return typeof n=="string"?r=new URL(n):n instanceof URL?r=n:n&&n.url&&(r=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&ma.mergeHeaders(i,n.headers),o&&ma.mergeHeaders(i,new Headers(o.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...o,...n,headers:i,url:r}):this.request({...o,headers:i,url:r})}async request(t={}){let n=await this.#n(t);return n=await this.#t(n),this.#r(this._request(n))}async _defaultAdapter(t){let n=t.fetchImplementation||this.defaults.fetchImplementation||await ma.#c(),o={...t};delete o.data;let r=await n(t.url,o),i=await this.getResponseData(t,r);return Object.getOwnPropertyDescriptor(r,"data")?.configurable||Object.defineProperties(r,{data:{configurable:!0,writable:!0,enumerable:!0,value:i}}),Object.assign(r,{config:t,data:i})}async _request(t){try{let n;if(t.adapter?n=await t.adapter(t,this._defaultAdapter.bind(this)):n=await this._defaultAdapter(t),!t.validateStatus(n.status)){if(t.responseType==="stream"){let r=[];for await(let i of n.data)r.push(i);n.data=r.toString()}let o=ei.GaxiosError.extractAPIErrorFromResponse(n,`Request failed with status code ${n.status}`);throw new ei.GaxiosError(o?.message,t,n,o)}return n}catch(n){let o;n instanceof ei.GaxiosError?o=n:n instanceof Error?o=new ei.GaxiosError(n.message,t,void 0,n):o=new ei.GaxiosError("Unexpected Gaxios Error",t,void 0,n);let{shouldRetry:r,config:i}=await(0,H1.getRetryConfig)(o);if(r&&i)return o.config.retryConfig.currentRetryAttempt=i.retryConfig.currentRetryAttempt,t.retryConfig=o.config?.retryConfig,this.#o(t),this._request(t);throw t.errorRedactor&&t.errorRedactor(o),o}}async getResponseData(t,n){if(n.status===W1)return"";if(t.maxContentLength&&n.headers.has("content-length")&&t.maxContentLength<Number.parseInt(n.headers?.get("content-length")||""))throw new ei.GaxiosError("Response's `Content-Length` is over the limit.",t,Object.assign(n,{config:t}));switch(t.responseType){case"stream":return n.body;case"json":{let o=await n.text();try{return JSON.parse(o)}catch{return o}}case"arraybuffer":return n.arrayBuffer();case"blob":return n.blob();case"text":return n.text();default:return this.getResponseDataFromContentType(n)}}#e(t,n=[]){let o=new URL(t),r=[...n],i=(process.env.NO_PROXY??process.env.no_proxy)?.split(",")||[];for(let s of i)r.push(s.trim());for(let s of r)if(s instanceof RegExp){if(s.test(o.toString()))return!1}else if(s instanceof URL){if(s.origin===o.origin)return!1}else if(s.startsWith("*.")||s.startsWith(".")){let u=s.replace(/^\*\./,".");if(o.hostname.endsWith(u))return!1}else if(s===o.origin||s===o.hostname||s===o.href)return!1;return!0}async#t(t){let n=Promise.resolve(t);for(let o of this.interceptors.request.values())o&&(n=n.then(o.resolved,o.rejected));return n}async#r(t){let n=Promise.resolve(t);for(let o of this.interceptors.response.values())o&&(n=n.then(o.resolved,o.rejected));return n}async#n(t){let n=new Headers(this.defaults.headers);ma.mergeHeaders(n,t.headers);let o=(0,V1.default)(!0,{},this.defaults,t);if(!o.url)throw new Error("URL is required.");if(o.baseURL&&(o.url=new URL(o.url,o.baseURL)),o.url=new URL(o.url),o.params)if(o.paramsSerializer){let s=o.paramsSerializer(o.params);s.startsWith("?")&&(s=s.slice(1));let u=o.url.toString().includes("?")?"&":"?";o.url=o.url+u+s}else{let s=o.url instanceof URL?o.url:new URL(o.url);for(let[u,d]of new URLSearchParams(o.params))s.searchParams.append(u,d);o.url=s}typeof t.maxContentLength=="number"&&(o.size=t.maxContentLength),typeof t.maxRedirects=="number"&&(o.follow=t.maxRedirects);let r=typeof o.data=="string"||o.data instanceof ArrayBuffer||o.data instanceof Blob||globalThis.File&&o.data instanceof File||o.data instanceof FormData||o.data instanceof hO.Readable||o.data instanceof ReadableStream||o.data instanceof String||o.data instanceof URLSearchParams||ArrayBuffer.isView(o.data)||["Blob","File","FormData"].includes(o.data?.constructor?.name||"");if(o.multipart?.length){let s=await G1();n.set("content-type",`multipart/related; boundary=${s}`),o.body=hO.Readable.from(this.getMultipartRequest(o.multipart,s))}else r?o.body=o.data:typeof o.data=="object"?n.get("Content-Type")==="application/x-www-form-urlencoded"?o.body=o.paramsSerializer?o.paramsSerializer(o.data):new URLSearchParams(o.data):(n.has("content-type")||n.set("content-type","application/json"),o.body=JSON.stringify(o.data)):o.data&&(o.body=o.data);o.validateStatus=o.validateStatus||this.validateStatus,o.responseType=o.responseType||"unknown",!n.has("accept")&&o.responseType==="json"&&n.set("accept","application/json");let i=o.proxy||process?.env?.HTTPS_PROXY||process?.env?.https_proxy||process?.env?.HTTP_PROXY||process?.env?.http_proxy;if(!o.agent)if(i&&this.#e(o.url,o.noProxy)){let s=await ma.#s();this.agentCache.has(i)?o.agent=this.agentCache.get(i):(o.agent=new s(i,{cert:o.cert,key:o.key}),this.agentCache.set(i,o.agent))}else o.cert&&o.key&&(this.agentCache.has(o.key)?o.agent=this.agentCache.get(o.key):(o.agent=new Z1.Agent({cert:o.cert,key:o.key}),this.agentCache.set(o.key,o.agent)));return typeof o.errorRedactor!="function"&&o.errorRedactor!==!1&&(o.errorRedactor=ei.defaultErrorRedactor),o.body&&!("duplex"in o)&&(o.duplex="half"),this.#o(o),Object.assign(o,{headers:n,url:o.url instanceof URL?o.url:new URL(o.url)})}#o(t){if(t.timeout){let n=AbortSignal.timeout(t.timeout);t.signal&&!t.signal.aborted?t.signal=AbortSignal.any([t.signal,n]):t.signal=n}}validateStatus(t){return t>=200&&t<300}async getResponseDataFromContentType(t){let n=t.headers.get("Content-Type");if(n===null)return t.text();if(n=n.toLowerCase(),n.includes("application/json")){let o=await t.text();try{o=JSON.parse(o)}catch{}return o}else return n.match(/^text\//)?t.text():t.blob()}async*getMultipartRequest(t,n){let o=`--${n}--`;for(let r of t){let i=r.headers.get("Content-Type")||"application/octet-stream";yield`--${n}\r
|
|
28
|
+
Content-Type: ${i}\r
|
|
29
29
|
\r
|
|
30
|
-
`,typeof
|
|
31
|
-
`}yield n}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>gt(cb()))).HttpsProxyAgent,this.#i}static async#u(){let e=typeof window<"u"&&!!window;return this.#a||=e?window.fetch:(await Promise.resolve().then(()=>(nv(),rv))).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((u,c)=>{c==="set-cookie"?e.append(c,u):e.set(c,u)});return e}};jo.Gaxios=Hs;Uo=Hs});var yt=M(It=>{"use strict";var CC=It&&It.__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]})),OC=It&&It.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&CC(e,t,r)};Object.defineProperty(It,"__esModule",{value:!0});It.instance=It.Gaxios=It.GaxiosError=void 0;It.request=$C;var sv=av();Object.defineProperty(It,"Gaxios",{enumerable:!0,get:o(function(){return sv.Gaxios},"get")});var kC=xl();Object.defineProperty(It,"GaxiosError",{enumerable:!0,get:o(function(){return kC.GaxiosError},"get")});OC(Rl(),It);It.instance=new sv.Gaxios;async function $C(t){return It.instance.request(t)}o($C,"request")});var Ql=M((uv,Gs)=>{(function(t){"use strict";var e,r=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,n=Math.ceil,i=Math.floor,u="[BigNumber Error] ",c=u+"Number primitive has more than 15 significant digits: ",l=1e14,p=14,f=9007199254740991,m=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,S=1e9;function h(V){var H,J,re,Z=W.prototype={constructor:W,toString:null,valueOf:null},De=new W(1),Se=20,be=4,$e=-7,Ie=21,Ve=-1e7,He=1e7,Je=!1,Ut=1,Et=0,ro={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},wr="0123456789abcdefghijklmnopqrstuvwxyz",oi=!0;function W(y,P){var x,z,R,$,j,I,C,D,N=this;if(!(N instanceof W))return new W(y,P);if(P==null){if(y&&y._isBigNumber===!0){N.s=y.s,!y.c||y.e>He?N.c=N.e=null:y.e<Ve?N.c=[N.e=0]:(N.e=y.e,N.c=y.c.slice());return}if((I=typeof y=="number")&&y*0==0){if(N.s=1/y<0?(y=-y,-1):1,y===~~y){for($=0,j=y;j>=10;j/=10,$++);$>He?N.c=N.e=null:(N.e=$,N.c=[y]);return}D=String(y)}else{if(!r.test(D=String(y)))return re(N,D,I);N.s=D.charCodeAt(0)==45?(D=D.slice(1),-1):1}($=D.indexOf("."))>-1&&(D=D.replace(".","")),(j=D.search(/e/i))>0?($<0&&($=j),$+=+D.slice(j+1),D=D.substring(0,j)):$<0&&($=D.length)}else{if(w(P,2,wr.length,"Base"),P==10&&oi)return N=new W(y),Pt(N,Se+N.e+1,be);if(D=String(y),I=typeof y=="number"){if(y*0!=0)return re(N,D,I,P);if(N.s=1/y<0?(D=D.slice(1),-1):1,W.DEBUG&&D.replace(/^0\.0*|\./,"").length>15)throw Error(c+y)}else N.s=D.charCodeAt(0)===45?(D=D.slice(1),-1):1;for(x=wr.slice(0,P),$=j=0,C=D.length;j<C;j++)if(x.indexOf(z=D.charAt(j))<0){if(z=="."){if(j>$){$=C;continue}}else if(!R&&(D==D.toUpperCase()&&(D=D.toLowerCase())||D==D.toLowerCase()&&(D=D.toUpperCase()))){R=!0,j=-1,$=0;continue}return re(N,String(y),I,P)}I=!1,D=J(D,P,10,N.s),($=D.indexOf("."))>-1?D=D.replace(".",""):$=D.length}for(j=0;D.charCodeAt(j)===48;j++);for(C=D.length;D.charCodeAt(--C)===48;);if(D=D.slice(j,++C)){if(C-=j,I&&W.DEBUG&&C>15&&(y>f||y!==i(y)))throw Error(c+N.s*y);if(($=$-j-1)>He)N.c=N.e=null;else if($<Ve)N.c=[N.e=0];else{if(N.e=$,N.c=[],j=($+1)%p,$<0&&(j+=p),j<C){for(j&&N.c.push(+D.slice(0,j)),C-=p;j<C;)N.c.push(+D.slice(j,j+=p));j=p-(D=D.slice(j)).length}else j-=C;for(;j--;D+="0");N.c.push(+D)}}else N.c=[N.e=0]}o(W,"BigNumber"),W.clone=h,W.ROUND_UP=0,W.ROUND_DOWN=1,W.ROUND_CEIL=2,W.ROUND_FLOOR=3,W.ROUND_HALF_UP=4,W.ROUND_HALF_DOWN=5,W.ROUND_HALF_EVEN=6,W.ROUND_HALF_CEIL=7,W.ROUND_HALF_FLOOR=8,W.EUCLID=9,W.config=W.set=function(y){var P,x;if(y!=null)if(typeof y=="object"){if(y.hasOwnProperty(P="DECIMAL_PLACES")&&(x=y[P],w(x,0,S,P),Se=x),y.hasOwnProperty(P="ROUNDING_MODE")&&(x=y[P],w(x,0,8,P),be=x),y.hasOwnProperty(P="EXPONENTIAL_AT")&&(x=y[P],x&&x.pop?(w(x[0],-S,0,P),w(x[1],0,S,P),$e=x[0],Ie=x[1]):(w(x,-S,S,P),$e=-(Ie=x<0?-x:x))),y.hasOwnProperty(P="RANGE"))if(x=y[P],x&&x.pop)w(x[0],-S,-1,P),w(x[1],1,S,P),Ve=x[0],He=x[1];else if(w(x,-S,S,P),x)Ve=-(He=x<0?-x:x);else throw Error(u+P+" cannot be zero: "+x);if(y.hasOwnProperty(P="CRYPTO"))if(x=y[P],x===!!x)if(x)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Je=x;else throw Je=!x,Error(u+"crypto unavailable");else Je=x;else throw Error(u+P+" not true or false: "+x);if(y.hasOwnProperty(P="MODULO_MODE")&&(x=y[P],w(x,0,9,P),Ut=x),y.hasOwnProperty(P="POW_PRECISION")&&(x=y[P],w(x,0,S,P),Et=x),y.hasOwnProperty(P="FORMAT"))if(x=y[P],typeof x=="object")ro=x;else throw Error(u+P+" not an object: "+x);if(y.hasOwnProperty(P="ALPHABET"))if(x=y[P],typeof x=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(x))oi=x.slice(0,10)=="0123456789",wr=x;else throw Error(u+P+" invalid: "+x)}else throw Error(u+"Object expected: "+y);return{DECIMAL_PLACES:Se,ROUNDING_MODE:be,EXPONENTIAL_AT:[$e,Ie],RANGE:[Ve,He],CRYPTO:Je,MODULO_MODE:Ut,POW_PRECISION:Et,FORMAT:ro,ALPHABET:wr}},W.isBigNumber=function(y){if(!y||y._isBigNumber!==!0)return!1;if(!W.DEBUG)return!0;var P,x,z=y.c,R=y.e,$=y.s;e:if({}.toString.call(z)=="[object Array]"){if(($===1||$===-1)&&R>=-S&&R<=S&&R===i(R)){if(z[0]===0){if(R===0&&z.length===1)return!0;break e}if(P=(R+1)%p,P<1&&(P+=p),String(z[0]).length==P){for(P=0;P<z.length;P++)if(x=z[P],x<0||x>=l||x!==i(x))break e;if(x!==0)return!0}}}else if(z===null&&R===null&&($===null||$===1||$===-1))return!0;throw Error(u+"Invalid BigNumber: "+y)},W.maximum=W.max=function(){return St(arguments,-1)},W.minimum=W.min=function(){return St(arguments,1)},W.random=(function(){var y=9007199254740992,P=Math.random()*y&2097151?function(){return i(Math.random()*y)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(x){var z,R,$,j,I,C=0,D=[],N=new W(De);if(x==null?x=Se:w(x,0,S),j=n(x/p),Je)if(crypto.getRandomValues){for(z=crypto.getRandomValues(new Uint32Array(j*=2));C<j;)I=z[C]*131072+(z[C+1]>>>11),I>=9e15?(R=crypto.getRandomValues(new Uint32Array(2)),z[C]=R[0],z[C+1]=R[1]):(D.push(I%1e14),C+=2);C=j/2}else if(crypto.randomBytes){for(z=crypto.randomBytes(j*=7);C<j;)I=(z[C]&31)*281474976710656+z[C+1]*1099511627776+z[C+2]*4294967296+z[C+3]*16777216+(z[C+4]<<16)+(z[C+5]<<8)+z[C+6],I>=9e15?crypto.randomBytes(7).copy(z,C):(D.push(I%1e14),C+=7);C=j/7}else throw Je=!1,Error(u+"crypto unavailable");if(!Je)for(;C<j;)I=P(),I<9e15&&(D[C++]=I%1e14);for(j=D[--C],x%=p,j&&x&&(I=m[p-x],D[C]=i(j/I)*I);D[C]===0;D.pop(),C--);if(C<0)D=[$=0];else{for($=-1;D[0]===0;D.splice(0,1),$-=p);for(C=1,I=D[0];I>=10;I/=10,C++);C<p&&($-=p-C)}return N.e=$,N.c=D,N}})(),W.sum=function(){for(var y=1,P=arguments,x=new W(P[0]);y<P.length;)x=x.plus(P[y++]);return x},J=(function(){var y="0123456789";function P(x,z,R,$){for(var j,I=[0],C,D=0,N=x.length;D<N;){for(C=I.length;C--;I[C]*=z);for(I[0]+=$.indexOf(x.charAt(D++)),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(P,"toBaseOut"),function(x,z,R,$,j){var I,C,D,N,F,Y,te,Re,Ge=x.indexOf("."),We=Se,Ae=be;for(Ge>=0&&(N=Et,Et=0,x=x.replace(".",""),Re=new W(z),Y=Re.pow(x.length-Ge),Et=N,Re.c=P(G(T(Y.c),Y.e,"0"),10,R,y),Re.e=Re.c.length),te=P(x,z,R,j?(I=wr,y):(I=y,wr)),D=N=te.length;te[--N]==0;te.pop());if(!te[0])return I.charAt(0);if(Ge<0?--D:(Y.c=te,Y.e=D,Y.s=$,Y=H(Y,Re,We,Ae,R),te=Y.c,F=Y.r,D=Y.e),C=D+We+1,Ge=te[C],N=R/2,F=F||C<0||te[C+1]!=null,F=Ae<4?(Ge!=null||F)&&(Ae==0||Ae==(Y.s<0?3:2)):Ge>N||Ge==N&&(Ae==4||F||Ae==6&&te[C-1]&1||Ae==(Y.s<0?8:7)),C<1||!te[0])x=F?G(I.charAt(1),-We,I.charAt(0)):I.charAt(0);else{if(te.length=C,F)for(--R;++te[--C]>R;)te[C]=0,C||(++D,te=[1].concat(te));for(N=te.length;!te[--N];);for(Ge=0,x="";Ge<=N;x+=I.charAt(te[Ge++]));x=G(x,D,I.charAt(0))}return x}})(),H=(function(){function y(z,R,$){var j,I,C,D,N=0,F=z.length,Y=R%g,te=R/g|0;for(z=z.slice();F--;)C=z[F]%g,D=z[F]/g|0,j=te*C+D*Y,I=Y*C+j%g*g+N,N=(I/$|0)+(j/g|0)+te*D,z[F]=I%$;return N&&(z=[N].concat(z)),z}o(y,"multiply");function P(z,R,$,j){var I,C;if($!=j)C=$>j?1:-1;else for(I=C=0;I<$;I++)if(z[I]!=R[I]){C=z[I]>R[I]?1:-1;break}return C}o(P,"compare");function x(z,R,$,j){for(var I=0;$--;)z[$]-=I,I=z[$]<R[$]?1:0,z[$]=I*j+z[$]-R[$];for(;!z[0]&&z.length>1;z.splice(0,1));}return o(x,"subtract"),function(z,R,$,j,I){var C,D,N,F,Y,te,Re,Ge,We,Ae,Ue,st,no,oo,io,jt,Fr,_t=z.s==R.s?1:-1,ut=z.c,je=R.c;if(!ut||!ut[0]||!je||!je[0])return new W(!z.s||!R.s||(ut?je&&ut[0]==je[0]:!je)?NaN:ut&&ut[0]==0||!je?_t*0:_t/0);for(Ge=new W(_t),We=Ge.c=[],D=z.e-R.e,_t=$+D+1,I||(I=l,D=_(z.e/p)-_(R.e/p),_t=_t/p|0),N=0;je[N]==(ut[N]||0);N++);if(je[N]>(ut[N]||0)&&D--,_t<0)We.push(1),F=!0;else{for(oo=ut.length,jt=je.length,N=0,_t+=2,Y=i(I/(je[0]+1)),Y>1&&(je=y(je,Y,I),ut=y(ut,Y,I),jt=je.length,oo=ut.length),no=jt,Ae=ut.slice(0,jt),Ue=Ae.length;Ue<jt;Ae[Ue++]=0);Fr=je.slice(),Fr=[0].concat(Fr),io=je[0],je[1]>=I/2&&io++;do{if(Y=0,C=P(je,Ae,jt,Ue),C<0){if(st=Ae[0],jt!=Ue&&(st=st*I+(Ae[1]||0)),Y=i(st/io),Y>1)for(Y>=I&&(Y=I-1),te=y(je,Y,I),Re=te.length,Ue=Ae.length;P(te,Ae,Re,Ue)==1;)Y--,x(te,jt<Re?Fr:je,Re,I),Re=te.length,C=1;else Y==0&&(C=Y=1),te=je.slice(),Re=te.length;if(Re<Ue&&(te=[0].concat(te)),x(Ae,te,Ue,I),Ue=Ae.length,C==-1)for(;P(je,Ae,jt,Ue)<1;)Y++,x(Ae,jt<Ue?Fr:je,Ue,I),Ue=Ae.length}else C===0&&(Y++,Ae=[0]);We[N++]=Y,Ae[0]?Ae[Ue++]=ut[no]||0:(Ae=[ut[no]],Ue=1)}while((no++<oo||Ae[0]!=null)&&_t--);F=Ae[0]!=null,We[0]||We.splice(0,1)}if(I==l){for(N=1,_t=We[0];_t>=10;_t/=10,N++);Pt(Ge,$+(Ge.e=N+D*p-1)+1,j,F)}else Ge.e=D,Ge.r=+F;return Ge}})();function Rt(y,P,x,z){var R,$,j,I,C;if(x==null?x=be:w(x,0,8),!y.c)return y.toString();if(R=y.c[0],j=y.e,P==null)C=T(y.c),C=z==1||z==2&&(j<=$e||j>=Ie)?q(C,j):G(C,j,"0");else if(y=Pt(new W(y),P,x),$=y.e,C=T(y.c),I=C.length,z==1||z==2&&(P<=$||$<=$e)){for(;I<P;C+="0",I++);C=q(C,$)}else if(P-=j+(z===2&&$>j),C=G(C,$,"0"),$+1>I){if(--P>0)for(C+=".";P--;C+="0");}else if(P+=$-I,P>0)for($+1==I&&(C+=".");P--;C+="0");return y.s<0&&R?"-"+C:C}o(Rt,"format");function St(y,P){for(var x,z,R=1,$=new W(y[0]);R<y.length;R++)z=new W(y[R]),(!z.s||(x=E($,z))===P||x===0&&$.s===P)&&($=z);return $}o(St,"maxOrMin");function ii(y,P,x){for(var z=1,R=P.length;!P[--R];P.pop());for(R=P[0];R>=10;R/=10,z++);return(x=z+x*p-1)>He?y.c=y.e=null:x<Ve?y.c=[y.e=0]:(y.e=x,y.c=P),y}o(ii,"normalise"),re=(function(){var y=/^(-?)0([xbo])(?=\w[\w.]*$)/i,P=/^([^.]+)\.$/,x=/^\.([^.]+)$/,z=/^-?(Infinity|NaN)$/,R=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function($,j,I,C){var D,N=I?j:j.replace(R,"");if(z.test(N))$.s=isNaN(N)?null:N<0?-1:1;else{if(!I&&(N=N.replace(y,function(F,Y,te){return D=(te=te.toLowerCase())=="x"?16:te=="b"?2:8,!C||C==D?Y:F}),C&&(D=C,N=N.replace(P,"$1").replace(x,"0.$1")),j!=N))return new W(N,D);if(W.DEBUG)throw Error(u+"Not a"+(C?" base "+C:"")+" number: "+j);$.s=null}$.c=$.e=null}})();function Pt(y,P,x,z){var R,$,j,I,C,D,N,F=y.c,Y=m;if(F){e:{for(R=1,I=F[0];I>=10;I/=10,R++);if($=P-R,$<0)$+=p,j=P,C=F[D=0],N=i(C/Y[R-j-1]%10);else if(D=n(($+1)/p),D>=F.length)if(z){for(;F.length<=D;F.push(0));C=N=0,R=1,$%=p,j=$-p+1}else break e;else{for(C=I=F[D],R=1;I>=10;I/=10,R++);$%=p,j=$-p+R,N=j<0?0:i(C/Y[R-j-1]%10)}if(z=z||P<0||F[D+1]!=null||(j<0?C:C%Y[R-j-1]),z=x<4?(N||z)&&(x==0||x==(y.s<0?3:2)):N>5||N==5&&(x==4||z||x==6&&($>0?j>0?C/Y[R-j]:0:F[D-1])%10&1||x==(y.s<0?8:7)),P<1||!F[0])return F.length=0,z?(P-=y.e+1,F[0]=Y[(p-P%p)%p],y.e=-P||0):F[0]=y.e=0,y;if($==0?(F.length=D,I=1,D--):(F.length=D+1,I=Y[p-$],F[D]=j>0?i(C/Y[R-j]%Y[j])*I:0),z)for(;;)if(D==0){for($=1,j=F[0];j>=10;j/=10,$++);for(j=F[0]+=I,I=1;j>=10;j/=10,I++);$!=I&&(y.e++,F[0]==l&&(F[0]=1));break}else{if(F[D]+=I,F[D]!=l)break;F[D--]=0,I=1}for($=F.length;F[--$]===0;F.pop());}y.e>He?y.c=y.e=null:y.e<Ve&&(y.c=[y.e=0])}return y}o(Pt,"round");function at(y){var P,x=y.e;return x===null?y.toString():(P=T(y.c),P=x<=$e||x>=Ie?q(P,x):G(P,x,"0"),y.s<0?"-"+P:P)}return o(at,"valueOf"),Z.absoluteValue=Z.abs=function(){var y=new W(this);return y.s<0&&(y.s=1),y},Z.comparedTo=function(y,P){return E(this,new W(y,P))},Z.decimalPlaces=Z.dp=function(y,P){var x,z,R,$=this;if(y!=null)return w(y,0,S),P==null?P=be:w(P,0,8),Pt(new W($),y+$.e+1,P);if(!(x=$.c))return null;if(z=((R=x.length-1)-_(this.e/p))*p,R=x[R])for(;R%10==0;R/=10,z--);return z<0&&(z=0),z},Z.dividedBy=Z.div=function(y,P){return H(this,new W(y,P),Se,be)},Z.dividedToIntegerBy=Z.idiv=function(y,P){return H(this,new W(y,P),0,1)},Z.exponentiatedBy=Z.pow=function(y,P){var x,z,R,$,j,I,C,D,N,F=this;if(y=new W(y),y.c&&!y.isInteger())throw Error(u+"Exponent not an integer: "+at(y));if(P!=null&&(P=new W(P)),I=y.e>14,!F.c||!F.c[0]||F.c[0]==1&&!F.e&&F.c.length==1||!y.c||!y.c[0])return N=new W(Math.pow(+at(F),I?y.s*(2-k(y)):+at(y))),P?N.mod(P):N;if(C=y.s<0,P){if(P.c?!P.c[0]:!P.s)return new W(NaN);z=!C&&F.isInteger()&&P.isInteger(),z&&(F=F.mod(P))}else{if(y.e>9&&(F.e>0||F.e<-1||(F.e==0?F.c[0]>1||I&&F.c[1]>=24e7:F.c[0]<8e13||I&&F.c[0]<=9999975e7)))return $=F.s<0&&k(y)?-0:0,F.e>-1&&($=1/$),new W(C?1/$:$);Et&&($=n(Et/p+2))}for(I?(x=new W(.5),C&&(y.s=1),D=k(y)):(R=Math.abs(+at(y)),D=R%2),N=new W(De);;){if(D){if(N=N.times(F),!N.c)break;$?N.c.length>$&&(N.c.length=$):z&&(N=N.mod(P))}if(R){if(R=i(R/2),R===0)break;D=R%2}else if(y=y.times(x),Pt(y,y.e+1,1),y.e>14)D=k(y);else{if(R=+at(y),R===0)break;D=R%2}F=F.times(F),$?F.c&&F.c.length>$&&(F.c.length=$):z&&(F=F.mod(P))}return z?N:(C&&(N=De.div(N)),P?N.mod(P):$?Pt(N,Et,be,j):N)},Z.integerValue=function(y){var P=new W(this);return y==null?y=be:w(y,0,8),Pt(P,P.e+1,y)},Z.isEqualTo=Z.eq=function(y,P){return E(this,new W(y,P))===0},Z.isFinite=function(){return!!this.c},Z.isGreaterThan=Z.gt=function(y,P){return E(this,new W(y,P))>0},Z.isGreaterThanOrEqualTo=Z.gte=function(y,P){return(P=E(this,new W(y,P)))===1||P===0},Z.isInteger=function(){return!!this.c&&_(this.e/p)>this.c.length-2},Z.isLessThan=Z.lt=function(y,P){return E(this,new W(y,P))<0},Z.isLessThanOrEqualTo=Z.lte=function(y,P){return(P=E(this,new W(y,P)))===-1||P===0},Z.isNaN=function(){return!this.s},Z.isNegative=function(){return this.s<0},Z.isPositive=function(){return this.s>0},Z.isZero=function(){return!!this.c&&this.c[0]==0},Z.minus=function(y,P){var x,z,R,$,j=this,I=j.s;if(y=new W(y,P),P=y.s,!I||!P)return new W(NaN);if(I!=P)return y.s=-P,j.plus(y);var C=j.e/p,D=y.e/p,N=j.c,F=y.c;if(!C||!D){if(!N||!F)return N?(y.s=-P,y):new W(F?j:NaN);if(!N[0]||!F[0])return F[0]?(y.s=-P,y):new W(N[0]?j:be==3?-0:0)}if(C=_(C),D=_(D),N=N.slice(),I=C-D){for(($=I<0)?(I=-I,R=N):(D=C,R=F),R.reverse(),P=I;P--;R.push(0));R.reverse()}else for(z=($=(I=N.length)<(P=F.length))?I:P,I=P=0;P<z;P++)if(N[P]!=F[P]){$=N[P]<F[P];break}if($&&(R=N,N=F,F=R,y.s=-y.s),P=(z=F.length)-(x=N.length),P>0)for(;P--;N[x++]=0);for(P=l-1;z>I;){if(N[--z]<F[z]){for(x=z;x&&!N[--x];N[x]=P);--N[x],N[z]+=l}N[z]-=F[z]}for(;N[0]==0;N.splice(0,1),--D);return N[0]?ii(y,N,D):(y.s=be==3?-1:1,y.c=[y.e=0],y)},Z.modulo=Z.mod=function(y,P){var x,z,R=this;return y=new W(y,P),!R.c||!y.s||y.c&&!y.c[0]?new W(NaN):!y.c||R.c&&!R.c[0]?new W(R):(Ut==9?(z=y.s,y.s=1,x=H(R,y,0,3),y.s=z,x.s*=z):x=H(R,y,0,Ut),y=R.minus(x.times(y)),!y.c[0]&&Ut==1&&(y.s=R.s),y)},Z.multipliedBy=Z.times=function(y,P){var x,z,R,$,j,I,C,D,N,F,Y,te,Re,Ge,We,Ae=this,Ue=Ae.c,st=(y=new W(y,P)).c;if(!Ue||!st||!Ue[0]||!st[0])return!Ae.s||!y.s||Ue&&!Ue[0]&&!st||st&&!st[0]&&!Ue?y.c=y.e=y.s=null:(y.s*=Ae.s,!Ue||!st?y.c=y.e=null:(y.c=[0],y.e=0)),y;for(z=_(Ae.e/p)+_(y.e/p),y.s*=Ae.s,C=Ue.length,F=st.length,C<F&&(Re=Ue,Ue=st,st=Re,R=C,C=F,F=R),R=C+F,Re=[];R--;Re.push(0));for(Ge=l,We=g,R=F;--R>=0;){for(x=0,Y=st[R]%We,te=st[R]/We|0,j=C,$=R+j;$>R;)D=Ue[--j]%We,N=Ue[j]/We|0,I=te*D+N*Y,D=Y*D+I%We*We+Re[$]+x,x=(D/Ge|0)+(I/We|0)+te*N,Re[$--]=D%Ge;Re[$]=x}return x?++z:Re.splice(0,1),ii(y,Re,z)},Z.negated=function(){var y=new W(this);return y.s=-y.s||null,y},Z.plus=function(y,P){var x,z=this,R=z.s;if(y=new W(y,P),P=y.s,!R||!P)return new W(NaN);if(R!=P)return y.s=-P,z.minus(y);var $=z.e/p,j=y.e/p,I=z.c,C=y.c;if(!$||!j){if(!I||!C)return new W(R/0);if(!I[0]||!C[0])return C[0]?y:new W(I[0]?z:R*0)}if($=_($),j=_(j),I=I.slice(),R=$-j){for(R>0?(j=$,x=C):(R=-R,x=I),x.reverse();R--;x.push(0));x.reverse()}for(R=I.length,P=C.length,R-P<0&&(x=C,C=I,I=x,P=R),R=0;P;)R=(I[--P]=I[P]+C[P]+R)/l|0,I[P]=l===I[P]?0:I[P]%l;return R&&(I=[R].concat(I),++j),ii(y,I,j)},Z.precision=Z.sd=function(y,P){var x,z,R,$=this;if(y!=null&&y!==!!y)return w(y,1,S),P==null?P=be:w(P,0,8),Pt(new W($),y,P);if(!(x=$.c))return null;if(R=x.length-1,z=R*p+1,R=x[R]){for(;R%10==0;R/=10,z--);for(R=x[0];R>=10;R/=10,z++);}return y&&$.e+1>z&&(z=$.e+1),z},Z.shiftedBy=function(y){return w(y,-f,f),this.times("1e"+y)},Z.squareRoot=Z.sqrt=function(){var y,P,x,z,R,$=this,j=$.c,I=$.s,C=$.e,D=Se+4,N=new W("0.5");if(I!==1||!j||!j[0])return new W(!I||I<0&&(!j||j[0])?NaN:j?$:1/0);if(I=Math.sqrt(+at($)),I==0||I==1/0?(P=T(j),(P.length+C)%2==0&&(P+="0"),I=Math.sqrt(+P),C=_((C+1)/2)-(C<0||C%2),I==1/0?P="5e"+C:(P=I.toExponential(),P=P.slice(0,P.indexOf("e")+1)+C),x=new W(P)):x=new W(I+""),x.c[0]){for(C=x.e,I=C+D,I<3&&(I=0);;)if(R=x,x=N.times(R.plus(H($,R,D,1))),T(R.c).slice(0,I)===(P=T(x.c)).slice(0,I))if(x.e<C&&--I,P=P.slice(I-3,I+1),P=="9999"||!z&&P=="4999"){if(!z&&(Pt(R,R.e+Se+2,0),R.times(R).eq($))){x=R;break}D+=4,I+=4,z=1}else{(!+P||!+P.slice(1)&&P.charAt(0)=="5")&&(Pt(x,x.e+Se+2,1),y=!x.times(x).eq($));break}}return Pt(x,x.e+Se+1,be,y)},Z.toExponential=function(y,P){return y!=null&&(w(y,0,S),y++),Rt(this,y,P,1)},Z.toFixed=function(y,P){return y!=null&&(w(y,0,S),y=y+this.e+1),Rt(this,y,P)},Z.toFormat=function(y,P,x){var z,R=this;if(x==null)y!=null&&P&&typeof P=="object"?(x=P,P=null):y&&typeof y=="object"?(x=y,y=P=null):x=ro;else if(typeof x!="object")throw Error(u+"Argument not an object: "+x);if(z=R.toFixed(y,P),R.c){var $,j=z.split("."),I=+x.groupSize,C=+x.secondaryGroupSize,D=x.groupSeparator||"",N=j[0],F=j[1],Y=R.s<0,te=Y?N.slice(1):N,Re=te.length;if(C&&($=I,I=C,C=$,Re-=$),I>0&&Re>0){for($=Re%I||I,N=te.substr(0,$);$<Re;$+=I)N+=D+te.substr($,I);C>0&&(N+=D+te.slice($)),Y&&(N="-"+N)}z=F?N+(x.decimalSeparator||"")+((C=+x.fractionGroupSize)?F.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(x.fractionGroupSeparator||"")):F):N}return(x.prefix||"")+z+(x.suffix||"")},Z.toFraction=function(y){var P,x,z,R,$,j,I,C,D,N,F,Y,te=this,Re=te.c;if(y!=null&&(I=new W(y),!I.isInteger()&&(I.c||I.s!==1)||I.lt(De)))throw Error(u+"Argument "+(I.isInteger()?"out of range: ":"not an integer: ")+at(I));if(!Re)return new W(te);for(P=new W(De),D=x=new W(De),z=C=new W(De),Y=T(Re),$=P.e=Y.length-te.e-1,P.c[0]=m[(j=$%p)<0?p+j:j],y=!y||I.comparedTo(P)>0?$>0?P:D:I,j=He,He=1/0,I=new W(Y),C.c[0]=0;N=H(I,P,0,1),R=x.plus(N.times(z)),R.comparedTo(y)!=1;)x=z,z=R,D=C.plus(N.times(R=D)),C=R,P=I.minus(N.times(R=P)),I=R;return R=H(y.minus(x),z,0,1),C=C.plus(R.times(D)),x=x.plus(R.times(z)),C.s=D.s=te.s,$=$*2,F=H(D,z,$,be).minus(te).abs().comparedTo(H(C,x,$,be).minus(te).abs())<1?[D,z]:[C,x],He=j,F},Z.toNumber=function(){return+at(this)},Z.toPrecision=function(y,P){return y!=null&&w(y,1,S),Rt(this,y,P,2)},Z.toString=function(y){var P,x=this,z=x.s,R=x.e;return R===null?z?(P="Infinity",z<0&&(P="-"+P)):P="NaN":(y==null?P=R<=$e||R>=Ie?q(T(x.c),R):G(T(x.c),R,"0"):y===10&&oi?(x=Pt(new W(x),Se+R+1,be),P=G(T(x.c),x.e,"0")):(w(y,2,wr.length,"Base"),P=J(G(T(x.c),R,"0"),10,y,z,!0)),z<0&&x.c[0]&&(P="-"+P)),P},Z.valueOf=Z.toJSON=function(){return at(this)},Z._isBigNumber=!0,V!=null&&W.set(V),W}o(h,"clone");function _(V){var H=V|0;return V>0||V===H?H:H-1}o(_,"bitFloor");function T(V){for(var H,J,re=1,Z=V.length,De=V[0]+"";re<Z;){for(H=V[re++]+"",J=p-H.length;J--;H="0"+H);De+=H}for(Z=De.length;De.charCodeAt(--Z)===48;);return De.slice(0,Z+1||1)}o(T,"coeffToString");function E(V,H){var J,re,Z=V.c,De=H.c,Se=V.s,be=H.s,$e=V.e,Ie=H.e;if(!Se||!be)return null;if(J=Z&&!Z[0],re=De&&!De[0],J||re)return J?re?0:-be:Se;if(Se!=be)return Se;if(J=Se<0,re=$e==Ie,!Z||!De)return re?0:!Z^J?1:-1;if(!re)return $e>Ie^J?1:-1;for(be=($e=Z.length)<(Ie=De.length)?$e:Ie,Se=0;Se<be;Se++)if(Z[Se]!=De[Se])return Z[Se]>De[Se]^J?1:-1;return $e==Ie?0:$e>Ie^J?1:-1}o(E,"compare");function w(V,H,J,re){if(V<H||V>J||V!==i(V))throw Error(u+(re||"Argument")+(typeof V=="number"?V<H||V>J?" out of range: ":" not an integer: ":" not a primitive number: ")+String(V))}o(w,"intCheck");function k(V){var H=V.c.length-1;return _(V.e/p)==H&&V.c[H]%2!=0}o(k,"isOdd");function q(V,H){return(V.length>1?V.charAt(0)+"."+V.slice(1):V)+(H<0?"e":"e+")+H}o(q,"toExponential");function G(V,H,J){var re,Z;if(H<0){for(Z=J+".";++H;Z+=J);V=Z+V}else if(re=V.length,++H>re){for(Z=J,H-=re;--H;Z+=J);V+=Z}else H<re&&(V=V.slice(0,H)+"."+V.slice(H));return V}o(G,"toFixedPoint"),e=h(),e.default=e.BigNumber=e,typeof define=="function"&&define.amd?define(function(){return e}):typeof Gs<"u"&&Gs.exports?Gs.exports=e:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=e)})(uv)});var pv=M((cJ,dv)=>{var cv=Ql(),lv=dv.exports;(function(){"use strict";function t(f){return f<10?"0"+f:f}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,u={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c;function l(f){return r.lastIndex=0,r.test(f)?'"'+f.replace(r,function(m){var g=u[m];return typeof g=="string"?g:"\\u"+("0000"+m.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+f+'"'}o(l,"quote");function p(f,m){var g,S,h,_,T=n,E,w=m[f],k=w!=null&&(w instanceof cv||cv.isBigNumber(w));switch(w&&typeof w=="object"&&typeof w.toJSON=="function"&&(w=w.toJSON(f)),typeof c=="function"&&(w=c.call(m,f,w)),typeof w){case"string":return k?w:l(w);case"number":return isFinite(w)?String(w):"null";case"boolean":case"null":case"bigint":return String(w);case"object":if(!w)return"null";if(n+=i,E=[],Object.prototype.toString.apply(w)==="[object Array]"){for(_=w.length,g=0;g<_;g+=1)E[g]=p(g,w)||"null";return h=E.length===0?"[]":n?`[
|
|
32
|
-
`+
|
|
33
|
-
`+
|
|
34
|
-
`+
|
|
35
|
-
`+
|
|
36
|
-
`+
|
|
37
|
-
`+
|
|
38
|
-
`,r:"\r",t:" "},u,c=o(function(T){throw{name:"SyntaxError",message:T,at:r,text:u}},"error"),l=o(function(T){return T&&T!==n&&c("Expected '"+T+"' instead of '"+n+"'"),n=u.charAt(r),r+=1,n},"next"),p=o(function(){var T,E="";for(n==="-"&&(E="-",l("-"));n>="0"&&n<="9";)E+=n,l();if(n===".")for(E+=".";l()&&n>="0"&&n<="9";)E+=n;if(n==="e"||n==="E")for(E+=n,l(),(n==="-"||n==="+")&&(E+=n,l());n>="0"&&n<="9";)E+=n,l();if(T=+E,!isFinite(T))c("Bad number");else return Ws==null&&(Ws=Ql()),E.length>15?e.storeAsString?E:e.useNativeBigInt?BigInt(E):new Ws(E):e.alwaysParseAsBig?e.useNativeBigInt?BigInt(T):new Ws(T):T},"number"),f=o(function(){var T,E,w="",k;if(n==='"')for(var q=r;l();){if(n==='"')return r-1>q&&(w+=u.substring(q,r-1)),l(),w;if(n==="\\"){if(r-1>q&&(w+=u.substring(q,r-1)),l(),n==="u"){for(k=0,E=0;E<4&&(T=parseInt(l(),16),!!isFinite(T));E+=1)k=k*16+T;w+=String.fromCharCode(k)}else if(typeof i[n]=="string")w+=i[n];else break;q=r}}c("Bad string")},"string"),m=o(function(){for(;n&&n<=" ";)l()},"white"),g=o(function(){switch(n){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}c("Unexpected '"+n+"'")},"word"),S,h=o(function(){var T=[];if(n==="["){if(l("["),m(),n==="]")return l("]"),T;for(;n;){if(T.push(S()),m(),n==="]")return l("]"),T;l(","),m()}}c("Bad array")},"array"),_=o(function(){var T,E=Object.create(null);if(n==="{"){if(l("{"),m(),n==="}")return l("}"),E;for(;n;){if(T=f(),m(),l(":"),e.strict===!0&&Object.hasOwnProperty.call(E,T)&&c('Duplicate key "'+T+'"'),NC.test(T)===!0?e.protoAction==="error"?c("Object contains forbidden prototype property"):e.protoAction==="ignore"?S():E[T]=S():zC.test(T)===!0?e.constructorAction==="error"?c("Object contains forbidden constructor property"):e.constructorAction==="ignore"?S():E[T]=S():E[T]=S(),m(),n==="}")return l("}"),E;l(","),m()}}c("Bad object")},"object");return S=o(function(){switch(m(),n){case"{":return _();case"[":return h();case'"':return f();case"-":return p();default:return n>="0"&&n<="9"?p():g()}},"value"),function(T,E){var w;return u=T+"",r=0,n=" ",w=S(),m(),n&&c("Syntax error"),typeof E=="function"?o((function k(q,G){var V,H,J=q[G];return J&&typeof J=="object"&&Object.keys(J).forEach(function(re){H=k(J,re),H!==void 0?J[re]=H:delete J[re]}),E.call(q,G,J)}),"walk")({"":w},""):w}},"json_parse");fv.exports=DC});var yv=M((fJ,Zs)=>{var hv=pv().stringify,gv=mv();Zs.exports=function(t){return{parse:gv(t),stringify:hv}};Zs.exports.parse=gv();Zs.exports.stringify=hv});var Yl=M(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.GCE_LINUX_BIOS_PATHS=void 0;_r.isGoogleCloudServerless=vv;_r.isGoogleComputeEngineLinux=Ev;_r.isGoogleComputeEngineMACAddress=Sv;_r.isGoogleComputeEngine=Pv;_r.detectGCPResidency=jC;var _v=require("fs"),bv=require("os");_r.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var UC=/^42:01/;function vv(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}o(vv,"isGoogleCloudServerless");function Ev(){if((0,bv.platform)()!=="linux")return!1;try{(0,_v.statSync)(_r.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let t=(0,_v.readFileSync)(_r.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(t)}catch{return!1}}o(Ev,"isGoogleComputeEngineLinux");function Sv(){let t=(0,bv.networkInterfaces)();for(let e of Object.values(t))if(e){for(let{mac:r}of e)if(UC.test(r))return!0}return!1}o(Sv,"isGoogleComputeEngineMACAddress");function Pv(){return Ev()||Sv()}o(Pv,"isGoogleComputeEngine");function jC(){return vv()||Pv()}o(jC,"detectGCPResidency")});var Tv=M(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});Js.Colours=void 0;var vt=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="")}};Js.Colours=vt;vt.enabled=!1;vt.reset="";vt.bright="";vt.dim="";vt.red="";vt.green="";vt.yellow="";vt.blue="";vt.magenta="";vt.cyan="";vt.white="";vt.grey="";vt.refresh()});var Iv=M(Me=>{"use strict";var MC=Me&&Me.__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]})),LC=Me&&Me.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),wv=Me&&Me.__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"&&MC(r,e,n[i]);return LC(r,e),r}})();Object.defineProperty(Me,"__esModule",{value:!0});Me.env=Me.DebugLogBackendBase=Me.placeholder=Me.AdhocDebugLogger=Me.LogSeverity=void 0;Me.getNodeBackend=ed;Me.getDebugBackend=BC;Me.getStructuredBackend=qC;Me.setBackend=VC;Me.log=Av;var FC=require("events"),Ji=wv(require("process")),xv=wv(require("util")),Gt=Tv(),br;(function(t){t.DEFAULT="DEFAULT",t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR"})(br||(Me.LogSeverity=br={}));var Ki=class extends FC.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(br.DEBUG,...n),this.func.info=(...n)=>this.invokeSeverity(br.INFO,...n),this.func.warn=(...n)=>this.invokeSeverity(br.WARNING,...n),this.func.error=(...n)=>this.invokeSeverity(br.ERROR,...n),this.func.sublog=n=>Av(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)}};Me.AdhocDebugLogger=Ki;Me.placeholder=new Ki("",()=>{}).func;var Mo=class{static{o(this,"DebugLogBackendBase")}constructor(){var e;this.cached=new Map,this.filters=[],this.filtersSet=!1;let r=(e=Ji.env[Me.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)}}};Me.DebugLogBackendBase=Mo;var Xl=class extends Mo{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 u=`${Gt.Colours.green}${e}${Gt.Colours.reset}`,c=`${Gt.Colours.yellow}${Ji.pid}${Gt.Colours.reset}`,l;switch(r.severity){case br.ERROR:l=`${Gt.Colours.red}${r.severity}${Gt.Colours.reset}`;break;case br.INFO:l=`${Gt.Colours.magenta}${r.severity}${Gt.Colours.reset}`;break;case br.WARNING:l=`${Gt.Colours.yellow}${r.severity}${Gt.Colours.reset}`;break;default:l=(i=r.severity)!==null&&i!==void 0?i:br.DEFAULT;break}let p=xv.formatWithOptions({colors:Gt.Colours.enabled},...n),f=Object.assign({},r);delete f.severity;let m=Object.getOwnPropertyNames(f).length?JSON.stringify(f):"",g=m?`${Gt.Colours.grey}${m}${Gt.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",c,u,l,p,m?` ${g}`:"")}:()=>{}}setFilters(){let r=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${r}$`,"i")}};function ed(){return new Xl}o(ed,"getNodeBackend");var td=class extends Mo{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=Ji.env.NODE_DEBUG)!==null&&e!==void 0?e:"";Ji.env.NODE_DEBUG=`${r}${r?",":""}${this.filters.join(",")}`}};function BC(t){return new td(t)}o(BC,"getDebugBackend");var rd=class extends Mo{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,...u)=>{var c;let l=(c=i.severity)!==null&&c!==void 0?c:br.INFO,p=Object.assign({severity:l,message:xv.format(...u)},i),f=JSON.stringify(p);n?n(i,f):console.log("%s",f)}}setFilters(){var e;(e=this.upstream)===null||e===void 0||e.setFilters()}};function qC(t){return new rd(t)}o(qC,"getStructuredBackend");Me.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var nd=new Map,Wt;function VC(t){Wt=t,nd.clear()}o(VC,"setBackend");function Av(t,e){if(!Wt&&!Ji.env[Me.env.nodeEnables]||!t)return Me.placeholder;e&&(t=`${e.instance.namespace}:${t}`);let r=nd.get(t);if(r)return r.func;if(Wt===null)return Me.placeholder;Wt===void 0&&(Wt=ed());let n=(()=>{let i;return new Ki(t,(c,...l)=>{if(i!==Wt){if(Wt===null)return;Wt===void 0&&(Wt=ed()),i=Wt}Wt?.log(t,c,...l)})})();return nd.set(t,n),n.func}o(Av,"log")});var od=M(Qn=>{"use strict";var HC=Qn&&Qn.__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]})),GC=Qn&&Qn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&HC(e,t,r)};Object.defineProperty(Qn,"__esModule",{value:!0});GC(Iv(),Qn)});var Yi=M(se=>{"use strict";var Cv=se&&se.__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=se&&se.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),ZC=se&&se.__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"&&Cv(r,e,n[i]);return WC(r,e),r}})(),JC=se&&se.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cv(e,t,r)};Object.defineProperty(se,"__esModule",{value:!0});se.gcpResidencyCache=se.METADATA_SERVER_DETECTION=se.HEADERS=se.HEADER_VALUE=se.HEADER_NAME=se.SECONDARY_HOST_ADDRESS=se.HOST_ADDRESS=se.BASE_PATH=void 0;se.instance=tO;se.project=rO;se.universe=nO;se.bulk=oO;se.isAvailable=aO;se.resetIsAvailableCache=sO;se.getGCPResidency=sd;se.setGCPResidency=Ov;se.requestTimeout=kv;var id=yt(),KC=yv(),QC=Yl(),YC=ZC(od());se.BASE_PATH="/computeMetadata/v1";se.HOST_ADDRESS="http://169.254.169.254";se.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";se.HEADER_NAME="Metadata-Flavor";se.HEADER_VALUE="Google";se.HEADERS=Object.freeze({[se.HEADER_NAME]:se.HEADER_VALUE});var Rv=YC.log("gcp-metadata");se.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 ad(t){return t||(t=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||se.HOST_ADDRESS),/^https?:\/\//.test(t)||(t=`http://${t}`),new URL(se.BASE_PATH,t).href}o(ad,"getBaseUrl");function XC(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(XC,"validate");async function Qi(t,e={},r=3,n=!1){let i=new Headers(se.HEADERS),u="",c={};if(typeof t=="object"){let g=t;new Headers(g.headers).forEach((S,h)=>i.set(h,S)),u=g.metadataKey,c=g.params||c,r=g.noResponseRetries||r,n=g.fastFail||n}else u=t;typeof e=="string"?u+=`/${e}`:(XC(e),e.property&&(u+=`/${e.property}`),new Headers(e.headers).forEach((g,S)=>i.set(S,g)),c=e.params||c);let l=n?eO:id.request,p={url:`${ad()}/${u}`,headers:i,retryConfig:{noResponseRetries:r},params:c,responseType:"text",timeout:kv()};Rv.info("instance request %j",p);let f=await l(p);Rv.info("instance metadata is %s",f.data);let m=f.headers.get(se.HEADER_NAME);if(m!==se.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${se.HEADER_NAME} header. Expected '${se.HEADER_VALUE}', got ${m?`'${m}'`:"no header"}`);if(typeof f.data=="string")try{return KC.parse(f.data)}catch{}return f.data}o(Qi,"metadataAccessor");async function eO(t){let e={...t,url:t.url?.toString().replace(ad(),ad(se.SECONDARY_HOST_ADDRESS))},r=(0,id.request)(t),n=(0,id.request)(e);return Promise.any([r,n])}o(eO,"fastFailMetadataRequest");function tO(t){return Qi("instance",t)}o(tO,"instance");function rO(t){return Qi("project",t)}o(rO,"project");function nO(t){return Qi("universe",t)}o(nO,"universe");async function oO(t){let e={};return await Promise.all(t.map(r=>(async()=>{let n=await Qi(r),i=r.metadataKey;e[i]=n})())),e}o(oO,"bulk");function iO(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}o(iO,"detectGCPAvailableRetries");var Ks;async function aO(){if(process.env.METADATA_SERVER_DETECTION){let t=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(t in se.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${t}\`, but it should be \`${Object.keys(se.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(t){case"assume-present":return!0;case"none":return!1;case"bios-only":return sd();case"ping-only":}}try{return Ks===void 0&&(Ks=Qi("instance",void 0,iO(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await Ks,!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(aO,"isAvailable");function sO(){Ks=void 0}o(sO,"resetIsAvailableCache");se.gcpResidencyCache=null;function sd(){return se.gcpResidencyCache===null&&Ov(),se.gcpResidencyCache}o(sd,"getGCPResidency");function Ov(t=null){se.gcpResidencyCache=t!==null?t:(0,QC.detectGCPResidency)()}o(Ov,"setGCPResidency");function kv(){return sd()?0:3e3}o(kv,"requestTimeout");JC(Yl(),se)});var zv=M(Qs=>{"use strict";Qs.byteLength=cO;Qs.toByteArray=dO;Qs.fromByteArray=mO;var $r=[],ar=[],uO=typeof Uint8Array<"u"?Uint8Array:Array,ud="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Yn=0,$v=ud.length;Yn<$v;++Yn)$r[Yn]=ud[Yn],ar[ud.charCodeAt(Yn)]=Yn;var Yn,$v;ar[45]=62;ar[95]=63;function Nv(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(Nv,"getLens");function cO(t){var e=Nv(t),r=e[0],n=e[1];return(r+n)*3/4-n}o(cO,"byteLength");function lO(t,e,r){return(e+r)*3/4-r}o(lO,"_byteLength");function dO(t){var e,r=Nv(t),n=r[0],i=r[1],u=new uO(lO(t,n,i)),c=0,l=i>0?n-4:n,p;for(p=0;p<l;p+=4)e=ar[t.charCodeAt(p)]<<18|ar[t.charCodeAt(p+1)]<<12|ar[t.charCodeAt(p+2)]<<6|ar[t.charCodeAt(p+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=e&255;return i===2&&(e=ar[t.charCodeAt(p)]<<2|ar[t.charCodeAt(p+1)]>>4,u[c++]=e&255),i===1&&(e=ar[t.charCodeAt(p)]<<10|ar[t.charCodeAt(p+1)]<<4|ar[t.charCodeAt(p+2)]>>2,u[c++]=e>>8&255,u[c++]=e&255),u}o(dO,"toByteArray");function pO(t){return $r[t>>18&63]+$r[t>>12&63]+$r[t>>6&63]+$r[t&63]}o(pO,"tripletToBase64");function fO(t,e,r){for(var n,i=[],u=e;u<r;u+=3)n=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(t[u+2]&255),i.push(pO(n));return i.join("")}o(fO,"encodeChunk");function mO(t){for(var e,r=t.length,n=r%3,i=[],u=16383,c=0,l=r-n;c<l;c+=u)i.push(fO(t,c,c+u>l?l:c+u));return n===1?(e=t[r-1],i.push($r[e>>2]+$r[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push($r[e>>10]+$r[e>>4&63]+$r[e<<2&63]+"=")),i.join("")}o(mO,"fromByteArray")});var ld=M(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});cd.fromArrayBufferToHex=hO;function hO(t){return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}o(hO,"fromArrayBufferToHex")});var Dv=M(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.BrowserCrypto=void 0;var Lo=zv(),gO=ld(),dd=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 Lo.fromByteArray(new Uint8Array(n))}randomBytesBase64(e){let r=new Uint8Array(e);return window.crypto.getRandomValues(r),Lo.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"}},u=new TextEncoder().encode(r),c=Lo.toByteArray(t.padBase64(n)),l=await window.crypto.subtle.importKey("jwk",e,i,!0,["verify"]);return await window.crypto.subtle.verify(i,l,c,u)}async sign(e,r){let n={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(r),u=await window.crypto.subtle.importKey("jwk",e,n,!0,["sign"]),c=await window.crypto.subtle.sign(n,u,i);return Lo.fromByteArray(new Uint8Array(c))}decodeBase64StringUtf8(e){let r=Lo.toByteArray(t.padBase64(e));return new TextDecoder().decode(r)}encodeBase64StringUtf8(e){let r=new TextEncoder().encode(e);return Lo.fromByteArray(r)}async sha256DigestHex(e){let r=new TextEncoder().encode(e),n=await window.crypto.subtle.digest("SHA-256",r);return(0,gO.fromArrayBufferToHex)(n)}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:String.fromCharCode(...new Uint16Array(e)),i=new TextEncoder,u=await window.crypto.subtle.importKey("raw",i.encode(n),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",u,i.encode(r))}};Ys.BrowserCrypto=dd});var Uv=M(Xs=>{"use strict";Object.defineProperty(Xs,"__esModule",{value:!0});Xs.NodeCrypto=void 0;var Fo=require("crypto"),pd=class{static{o(this,"NodeCrypto")}async sha256DigestBase64(e){return Fo.createHash("sha256").update(e).digest("base64")}randomBytesBase64(e){return Fo.randomBytes(e).toString("base64")}async verify(e,r,n){let i=Fo.createVerify("RSA-SHA256");return i.update(r),i.end(),i.verify(e,n,"base64")}async sign(e,r){let n=Fo.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 Fo.createHash("sha256").update(e).digest("hex")}async signWithHmacSha256(e,r){let n=typeof e=="string"?e:_O(e);return yO(Fo.createHmac("sha256",n).update(r).digest())}};Xs.NodeCrypto=pd;function yO(t){return t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}o(yO,"toArrayBuffer");function _O(t){return Buffer.from(t)}o(_O,"toBuffer")});var Xi=M(rn=>{"use strict";var bO=rn&&rn.__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]})),vO=rn&&rn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&bO(e,t,r)};Object.defineProperty(rn,"__esModule",{value:!0});rn.createCrypto=PO;rn.hasBrowserCrypto=jv;var EO=Dv(),SO=Uv();vO(ld(),rn);function PO(){return jv()?new EO.BrowserCrypto:new SO.NodeCrypto}o(PO,"createCrypto");function jv(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}o(jv,"hasBrowserCrypto")});var Bo=M((fd,Lv)=>{var eu=require("buffer"),Nr=eu.Buffer;function Mv(t,e){for(var r in t)e[r]=t[r]}o(Mv,"copyProps");Nr.from&&Nr.alloc&&Nr.allocUnsafe&&Nr.allocUnsafeSlow?Lv.exports=eu:(Mv(eu,fd),fd.Buffer=Xn);function Xn(t,e,r){return Nr(t,e,r)}o(Xn,"SafeBuffer");Xn.prototype=Object.create(Nr.prototype);Mv(Nr,Xn);Xn.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Nr(t,e,r)};Xn.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=Nr(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Xn.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Nr(t)};Xn.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return eu.SlowBuffer(t)}});var Bv=M((zJ,Fv)=>{"use strict";function md(t){var e=(t/8|0)+(t%8===0?0:1);return e}o(md,"getParamSize");var TO={ES256:md(256),ES384:md(384),ES512:md(521)};function wO(t){var e=TO[t];if(e)return e;throw new Error('Unknown algorithm "'+t+'"')}o(wO,"getParamBytesForAlg");Fv.exports=wO});var hd=M((UJ,Zv)=>{"use strict";var tu=Bo().Buffer,Vv=Bv(),ru=128,Hv=0,xO=32,AO=16,IO=2,Gv=AO|xO|Hv<<6,nu=IO|Hv<<6;function RO(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(RO,"base64Url");function Wv(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(Wv,"signatureAsBuffer");function CO(t,e){t=Wv(t);var r=Vv(e),n=r+1,i=t.length,u=0;if(t[u++]!==Gv)throw new Error('Could not find expected "seq"');var c=t[u++];if(c===(ru|1)&&(c=t[u++]),i-u<c)throw new Error('"seq" specified length of "'+c+'", only "'+(i-u)+'" remaining');if(t[u++]!==nu)throw new Error('Could not find expected "int" for "r"');var l=t[u++];if(i-u-2<l)throw new Error('"r" specified length of "'+l+'", only "'+(i-u-2)+'" available');if(n<l)throw new Error('"r" specified length of "'+l+'", max of "'+n+'" is acceptable');var p=u;if(u+=l,t[u++]!==nu)throw new Error('Could not find expected "int" for "s"');var f=t[u++];if(i-u!==f)throw new Error('"s" specified length of "'+f+'", expected "'+(i-u)+'"');if(n<f)throw new Error('"s" specified length of "'+f+'", max of "'+n+'" is acceptable');var m=u;if(u+=f,u!==i)throw new Error('Expected to consume entire buffer, but "'+(i-u)+'" bytes remain');var g=r-l,S=r-f,h=tu.allocUnsafe(g+l+S+f);for(u=0;u<g;++u)h[u]=0;t.copy(h,u,p+Math.max(-g,0),p+l),u=r;for(var _=u;u<_+S;++u)h[u]=0;return t.copy(h,u,m+Math.max(-S,0),m+f),h=h.toString("base64"),h=RO(h),h}o(CO,"derToJose");function qv(t,e,r){for(var n=0;e+n<r&&t[e+n]===0;)++n;var i=t[e+n]>=ru;return i&&--n,n}o(qv,"countPadding");function OO(t,e){t=Wv(t);var r=Vv(e),n=t.length;if(n!==r*2)throw new TypeError('"'+e+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=qv(t,0,r),u=qv(t,r,t.length),c=r-i,l=r-u,p=2+c+1+1+l,f=p<ru,m=tu.allocUnsafe((f?2:3)+p),g=0;return m[g++]=Gv,f?m[g++]=p:(m[g++]=ru|1,m[g++]=p&255),m[g++]=nu,m[g++]=c,i<0?(m[g++]=0,g+=t.copy(m,g,0,r)):g+=t.copy(m,g,i,r),m[g++]=nu,m[g++]=l,u<0?(m[g++]=0,t.copy(m,g,r)):t.copy(m,g,r+u),m}o(OO,"joseToDer");Zv.exports={derToJose:CO,joseToDer:OO}});var vr=M(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.LRUCache=void 0;nn.snakeToCamel=Kv;nn.originalOrCamelOptions=zO;nn.removeUndefinedValuesInObject=DO;nn.isValidFile=UO;nn.getWellKnownCertificateConfigFileLocation=jO;var kO=require("fs"),$O=require("os"),gd=require("path"),NO="certificate_config.json",Jv="gcloud";function Kv(t){return t.replace(/([_][^_])/g,e=>e.slice(1).toUpperCase())}o(Kv,"snakeToCamel");function zO(t){function e(r){let n=t||{};return n[r]??n[Kv(r)]}return o(e,"get"),{get:e}}o(zO,"originalOrCamelOptions");var yd=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()}};nn.LRUCache=yd;function DO(t){return Object.entries(t).forEach(([e,r])=>{(r===void 0||r==="undefined")&&delete t[e]}),t}o(DO,"removeUndefinedValuesInObject");async function UO(t){try{return(await kO.promises.lstat(t)).isFile()}catch{return!1}}o(UO,"isValidFile");function jO(){let t=process.env.CLOUDSDK_CONFIG||(MO()?gd.join(process.env.APPDATA||"",Jv):gd.join(process.env.HOME||"",".config",Jv));return gd.join(t,NO)}o(jO,"getWellKnownCertificateConfigFileLocation");function MO(){return $O.platform().startsWith("win")}o(MO,"_isWindows")});var Qv=M((FJ,LO)=>{LO.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 _d=M(Cn=>{"use strict";Object.defineProperty(Cn,"__esModule",{value:!0});Cn.USER_AGENT=Cn.PRODUCT_NAME=Cn.pkg=void 0;var Yv=Qv();Cn.pkg=Yv;var Xv="google-api-nodejs-client";Cn.PRODUCT_NAME=Xv;var FO=`${Xv}/${Yv.version}`;Cn.USER_AGENT=FO});var Zt=M(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.AuthClient=Er.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Er.DEFAULT_UNIVERSE=void 0;var BO=require("events"),bd=yt(),qO=vr(),VO=od(),vd=_d();Er.DEFAULT_UNIVERSE="googleapis.com";Er.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Ed=class t extends BO.EventEmitter{static{o(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Er.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Er.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(e={}){super();let r=(0,qO.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")??Er.DEFAULT_UNIVERSE,this.transporter=e.transporter??new bd.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,u=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&&bd.Gaxios.mergeHeaders(u,r.headers),n&&bd.Gaxios.mergeHeaders(u,new Headers(n.headers)),typeof r=="object"&&!(r instanceof URL)?this.request({...n,...r,headers:u,url:i}):this.request({...n,headers:u,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,VO.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(`${vd.PRODUCT_NAME}/`)||e.headers.set("User-Agent",`${r} ${vd.USER_AGENT}`):e.headers.set("User-Agent",vd.USER_AGENT);try{let n=e,i=n[t.RequestMethodNameSymbol],u=`${Math.floor(Math.random()*1e3)}`;n[t.RequestLogIdSymbol]=u;let c={url:e.url,headers:e.headers};i?t.log.info("%s [%s] request %j",i,u,c):t.log.info("[%s] request %j",u,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"]}}}};Er.AuthClient=Ed});var Pd=M(ou=>{"use strict";Object.defineProperty(ou,"__esModule",{value:!0});ou.LoginTicket=void 0;var Sd=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()}}};ou.LoginTicket=Sd});var eo=M(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.OAuth2Client=zr.ClientAuthentication=zr.CertificateFormat=zr.CodeChallengeMethod=void 0;var eE=yt(),HO=require("querystring"),GO=require("stream"),WO=hd(),tE=vr(),Td=Xi(),qo=Zt(),ZO=Pd(),rE;(function(t){t.Plain="plain",t.S256="S256"})(rE||(zr.CodeChallengeMethod=rE={}));var on;(function(t){t.PEM="PEM",t.JWK="JWK"})(on||(zr.CertificateFormat=on={}));var ea;(function(t){t.ClientSecretPost="ClientSecretPost",t.ClientSecretBasic="ClientSecretBasic",t.None="None"})(ea||(zr.ClientAuthentication=ea={}));var wd=class t extends qo.AuthClient{static{o(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=on.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||ea.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()+"?"+HO.stringify(e)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let e=(0,Td.createCrypto)(),n=e.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),u=(await e.sha256DigestBase64(n)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:n,codeChallenge:u}}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===ea.ClientSecretBasic){let p=Buffer.from(`${this._clientId}:${this._clientSecret}`);n.set("authorization",`Basic ${p.toString("base64")}`)}this.clientAuthentication===ea.ClientSecretPost&&(i.client_secret=this._clientSecret);let u={...t.RETRY_CONFIG,method:"POST",url:r,data:new URLSearchParams((0,tE.removeUndefinedValuesInObject)(i)),headers:n};qo.AuthClient.setMethodName(u,"getTokenAsync");let c=await this.transporter.request(u),l=c.data;return c.data&&c.data.expires_in&&(l.expiry_date=new Date().getTime()+c.data.expires_in*1e3,delete l.expires_in),this.emit("tokens",l),{tokens:l,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,tE.removeUndefinedValuesInObject)(n))};qo.AuthClient.setMethodName(c,"refreshTokenNoCache"),i=await this.transporter.request(c)}catch(c){throw c instanceof eE.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 u=i.data;return i.data&&i.data.expires_in&&(u.expiry_date=new Date().getTime()+i.data.expires_in*1e3,delete u.expires_in),this.emit("tokens",u),{tokens:u,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 l=new Headers({authorization:r.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(l)}}if(this.refreshHandler){let l=await this.processAndValidateRefreshHandler();if(l?.access_token){this.setCredentials(l);let p=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(p)}}}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(l){let p=l;throw p.response&&(p.response.status===403||p.response.status===404)&&(p.message=`Could not refresh access token: ${p.message}`),p}let u=this.credentials;u.token_type=u.token_type||"Bearer",i.refresh_token=u.refresh_token,this.credentials=i;let c=new Headers({authorization:u.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(qo.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=eE.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 u=i.status,c=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),l=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,p=i.config.data instanceof GO.Readable,f=u===401||u===403;if(!r&&f&&!p&&c)return await this.refreshAccessTokenAsync(),this.requestAsync(e,!0);if(!r&&f&&!p&&l){let m=await this.processAndValidateRefreshHandler();return m?.access_token&&this.setCredentials(m),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,Td.hasBrowserCrypto)()?on.JWK:on.PEM;if(this.certificateExpiry&&e<this.certificateExpiry.getTime()&&this.certificateCacheFormat===r)return{certs:this.certificateCache,format:r};let n,i;switch(r){case on.PEM:i=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case on.JWK:i=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${r}`)}try{let f={...t.RETRY_CONFIG,url:i};qo.AuthClient.setMethodName(f,"getFederatedSignonCertsAsync"),n=await this.transporter.request(f)}catch(f){throw f instanceof Error&&(f.message=`Failed to retrieve verification certificates: ${f.message}`),f}let u=n?.headers.get("cache-control"),c=-1;if(u){let f=/max-age=(?<maxAge>[0-9]+)/.exec(u)?.groups?.maxAge;f&&(c=Number(f)*1e3)}let l={};switch(r){case on.PEM:l=n.data;break;case on.JWK:for(let f of n.data.keys)l[f.kid]=f;break;default:throw new Error(`Unsupported certificate format ${r}`)}let p=new Date;return this.certificateExpiry=c===-1?null:new Date(p.getTime()+c),this.certificateCache=l,this.certificateCacheFormat=r,{certs:l,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};qo.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,u){let c=(0,Td.createCrypto)();u||(u=t.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let l=e.split(".");if(l.length!==3)throw new Error("Wrong number of segments in token: "+e);let p=l[0]+"."+l[1],f=l[2],m,g;try{m=JSON.parse(c.decodeBase64StringUtf8(l[0]))}catch(q){throw q instanceof Error&&(q.message=`Can't parse token envelope: ${l[0]}': ${q.message}`),q}if(!m)throw new Error("Can't parse token envelope: "+l[0]);try{g=JSON.parse(c.decodeBase64StringUtf8(l[1]))}catch(q){throw q instanceof Error&&(q.message=`Can't parse token payload '${l[0]}`),q}if(!g)throw new Error("Can't parse token payload: "+l[1]);if(!Object.prototype.hasOwnProperty.call(r,m.kid))throw new Error("No pem found for envelope: "+JSON.stringify(m));let S=r[m.kid];if(m.alg==="ES256"&&(f=WO.joseToDer(f,"ES256").toString("base64")),!await c.verify(S,p,f))throw new Error("Invalid token signature: "+e);if(!g.iat)throw new Error("No issue time in token: "+JSON.stringify(g));if(!g.exp)throw new Error("No expiration time in token: "+JSON.stringify(g));let _=Number(g.iat);if(isNaN(_))throw new Error("iat field using invalid format");let T=Number(g.exp);if(isNaN(T))throw new Error("exp field using invalid format");let E=new Date().getTime()/1e3;if(T>=E+u)throw new Error("Expiration time too far in future: "+JSON.stringify(g));let w=_-t.CLOCK_SKEW_SECS_,k=T+t.CLOCK_SKEW_SECS_;if(E<w)throw new Error("Token used too early, "+E+" < "+w+": "+JSON.stringify(g));if(E>k)throw new Error("Token used too late, "+E+" > "+k+": "+JSON.stringify(g));if(i&&i.indexOf(g.iss)<0)throw new Error("Invalid issuer, expected one of ["+i+"], but got "+g.iss);if(typeof n<"u"&&n!==null){let q=g.aud,G=!1;if(n.constructor===Array?G=n.indexOf(q)>-1:G=q===n,!G)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new ZO.LoginTicket(m,g)}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}};zr.OAuth2Client=wd});var Ad=M(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.Compute=void 0;var JO=yt(),nE=Yi(),KO=eo(),xd=class extends KO.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 nE.instance(i)}catch(i){throw i instanceof JO.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 nE.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=xd});var Rd=M(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.IdTokenClient=void 0;var QO=eo(),Id=class extends QO.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}};au.IdTokenClient=Id});var Cd=M(Vo=>{"use strict";Object.defineProperty(Vo,"__esModule",{value:!0});Vo.GCPEnv=void 0;Vo.clear=YO;Vo.getEnv=XO;var oE=Yi(),Dr;(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"})(Dr||(Vo.GCPEnv=Dr={}));var ta;function YO(){ta=void 0}o(YO,"clear");async function XO(){return ta||(ta=ek(),ta)}o(XO,"getEnv");async function ek(){let t=Dr.NONE;return tk()?t=Dr.APP_ENGINE:rk()?t=Dr.CLOUD_FUNCTIONS:await ak()?await ik()?t=Dr.KUBERNETES_ENGINE:nk()?t=Dr.CLOUD_RUN:ok()?t=Dr.CLOUD_RUN_JOBS:t=Dr.COMPUTE_ENGINE:t=Dr.NONE,t}o(ek,"getEnvMemoized");function tk(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}o(tk,"isAppEngine");function rk(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}o(rk,"isCloudFunction");function nk(){return!!process.env.K_CONFIGURATION}o(nk,"isCloudRun");function ok(){return!!process.env.CLOUD_RUN_JOB}o(ok,"isCloudRunJob");async function ik(){try{return await oE.instance("attributes/cluster-name"),!0}catch{return!1}}o(ik,"isKubernetesEngine");async function ak(){return oE.isAvailable()}o(ak,"isComputeEngine")});var Od=M((t3,iE)=>{var su=Bo().Buffer,sk=require("stream"),uk=require("util");function uu(t){if(this.buffer=null,this.writable=!0,this.readable=!0,!t)return this.buffer=su.alloc(0),this;if(typeof t.pipe=="function")return this.buffer=su.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(uu,"DataStream");uk.inherits(uu,sk);uu.prototype.write=o(function(e){this.buffer=su.concat([this.buffer,su.from(e)]),this.emit("data",e)},"write");uu.prototype.end=o(function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1},"end");iE.exports=uu});var sE=M((n3,aE)=>{"use strict";var ra=require("buffer").Buffer,kd=require("buffer").SlowBuffer;aE.exports=cu;function cu(t,e){if(!ra.isBuffer(t)||!ra.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(cu,"bufferEq");cu.install=function(){ra.prototype.equal=kd.prototype.equal=o(function(e){return cu(this,e)},"equal")};var ck=ra.prototype.equal,lk=kd.prototype.equal;cu.restore=function(){ra.prototype.equal=ck,kd.prototype.equal=lk}});var Dd=M((i3,gE)=>{var Go=Bo().Buffer,sr=require("crypto"),cE=hd(),uE=require("util"),dk=`"%s" is not a valid algorithm.
|
|
30
|
+
`,typeof r.content=="string"?yield r.content:yield*r.content,yield`\r
|
|
31
|
+
`}yield o}static#i;static#a;static async#s(){return this.#i||=(await Promise.resolve().then(()=>It(vR()))).HttpsProxyAgent,this.#i}static async#c(){let t=typeof window<"u"&&!!window;return this.#a||=t?window.fetch:(await Promise.resolve().then(()=>(mO(),fO))).default,this.#a}static mergeHeaders(t,...n){t=t instanceof Headers?t:new Headers(t);for(let o of n)(o instanceof Headers?o:new Headers(o)).forEach((i,s)=>{s==="set-cookie"?t.append(s,i):t.set(s,i)});return t}};ha.Gaxios=uf;ma=uf});var kt=B(Vt=>{"use strict";var J1=Vt&&Vt.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),K1=Vt&&Vt.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&J1(t,e,n)};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.instance=Vt.Gaxios=Vt.GaxiosError=void 0;Vt.request=Q1;var _O=yO();Object.defineProperty(Vt,"Gaxios",{enumerable:!0,get:a(function(){return _O.Gaxios},"get")});var X1=Ab();Object.defineProperty(Vt,"GaxiosError",{enumerable:!0,get:a(function(){return X1.GaxiosError},"get")});K1(Ob(),Vt);Vt.instance=new _O.Gaxios;async function Q1(e){return Vt.instance.request(e)}a(Q1,"request")});var Qb=B((bO,lf)=>{(function(e){"use strict";var t,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,r=Math.floor,i="[BigNumber Error] ",s=i+"Number primitive has more than 15 significant digits: ",u=1e14,d=14,p=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function h(Z){var G,te,ce,Y=ee.prototype={constructor:ee,toString:null,valueOf:null},Ze=new ee(1),we=20,Te=4,Me=-7,je=21,Ve=-1e7,et=1e7,ot=!1,nr=1,Dt=0,ai={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},Yr="0123456789abcdefghijklmnopqrstuvwxyz",Na=!0;function ee(v,T){var w,D,O,z,M,R,C,U,N=this;if(!(N instanceof ee))return new ee(v,T);if(T==null){if(v&&v._isBigNumber===!0){N.s=v.s,!v.c||v.e>et?N.c=N.e=null:v.e<Ve?N.c=[N.e=0]:(N.e=v.e,N.c=v.c.slice());return}if((R=typeof v=="number")&&v*0==0){if(N.s=1/v<0?(v=-v,-1):1,v===~~v){for(z=0,M=v;M>=10;M/=10,z++);z>et?N.c=N.e=null:(N.e=z,N.c=[v]);return}U=String(v)}else{if(!n.test(U=String(v)))return ce(N,U,R);N.s=U.charCodeAt(0)==45?(U=U.slice(1),-1):1}(z=U.indexOf("."))>-1&&(U=U.replace(".","")),(M=U.search(/e/i))>0?(z<0&&(z=M),z+=+U.slice(M+1),U=U.substring(0,M)):z<0&&(z=U.length)}else{if(S(T,2,Yr.length,"Base"),T==10&&Na)return N=new ee(v),jt(N,we+N.e+1,Te);if(U=String(v),R=typeof v=="number"){if(v*0!=0)return ce(N,U,R,T);if(N.s=1/v<0?(U=U.slice(1),-1):1,ee.DEBUG&&U.replace(/^0\.0*|\./,"").length>15)throw Error(s+v)}else N.s=U.charCodeAt(0)===45?(U=U.slice(1),-1):1;for(w=Yr.slice(0,T),z=M=0,C=U.length;M<C;M++)if(w.indexOf(D=U.charAt(M))<0){if(D=="."){if(M>z){z=C;continue}}else if(!O&&(U==U.toUpperCase()&&(U=U.toLowerCase())||U==U.toLowerCase()&&(U=U.toUpperCase()))){O=!0,M=-1,z=0;continue}return ce(N,String(v),R,T)}R=!1,U=te(U,T,10,N.s),(z=U.indexOf("."))>-1?U=U.replace(".",""):z=U.length}for(M=0;U.charCodeAt(M)===48;M++);for(C=U.length;U.charCodeAt(--C)===48;);if(U=U.slice(M,++C)){if(C-=M,R&&ee.DEBUG&&C>15&&(v>p||v!==r(v)))throw Error(s+N.s*v);if((z=z-M-1)>et)N.c=N.e=null;else if(z<Ve)N.c=[N.e=0];else{if(N.e=z,N.c=[],M=(z+1)%d,z<0&&(M+=d),M<C){for(M&&N.c.push(+U.slice(0,M)),C-=d;M<C;)N.c.push(+U.slice(M,M+=d));M=d-(U=U.slice(M)).length}else M-=C;for(;M--;U+="0");N.c.push(+U)}}else N.c=[N.e=0]}a(ee,"BigNumber"),ee.clone=h,ee.ROUND_UP=0,ee.ROUND_DOWN=1,ee.ROUND_CEIL=2,ee.ROUND_FLOOR=3,ee.ROUND_HALF_UP=4,ee.ROUND_HALF_DOWN=5,ee.ROUND_HALF_EVEN=6,ee.ROUND_HALF_CEIL=7,ee.ROUND_HALF_FLOOR=8,ee.EUCLID=9,ee.config=ee.set=function(v){var T,w;if(v!=null)if(typeof v=="object"){if(v.hasOwnProperty(T="DECIMAL_PLACES")&&(w=v[T],S(w,0,y,T),we=w),v.hasOwnProperty(T="ROUNDING_MODE")&&(w=v[T],S(w,0,8,T),Te=w),v.hasOwnProperty(T="EXPONENTIAL_AT")&&(w=v[T],w&&w.pop?(S(w[0],-y,0,T),S(w[1],0,y,T),Me=w[0],je=w[1]):(S(w,-y,y,T),Me=-(je=w<0?-w:w))),v.hasOwnProperty(T="RANGE"))if(w=v[T],w&&w.pop)S(w[0],-y,-1,T),S(w[1],1,y,T),Ve=w[0],et=w[1];else if(S(w,-y,y,T),w)Ve=-(et=w<0?-w:w);else throw Error(i+T+" cannot be zero: "+w);if(v.hasOwnProperty(T="CRYPTO"))if(w=v[T],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))ot=w;else throw ot=!w,Error(i+"crypto unavailable");else ot=w;else throw Error(i+T+" not true or false: "+w);if(v.hasOwnProperty(T="MODULO_MODE")&&(w=v[T],S(w,0,9,T),nr=w),v.hasOwnProperty(T="POW_PRECISION")&&(w=v[T],S(w,0,y,T),Dt=w),v.hasOwnProperty(T="FORMAT"))if(w=v[T],typeof w=="object")ai=w;else throw Error(i+T+" not an object: "+w);if(v.hasOwnProperty(T="ALPHABET"))if(w=v[T],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))Na=w.slice(0,10)=="0123456789",Yr=w;else throw Error(i+T+" invalid: "+w)}else throw Error(i+"Object expected: "+v);return{DECIMAL_PLACES:we,ROUNDING_MODE:Te,EXPONENTIAL_AT:[Me,je],RANGE:[Ve,et],CRYPTO:ot,MODULO_MODE:nr,POW_PRECISION:Dt,FORMAT:ai,ALPHABET:Yr}},ee.isBigNumber=function(v){if(!v||v._isBigNumber!==!0)return!1;if(!ee.DEBUG)return!0;var T,w,D=v.c,O=v.e,z=v.s;e:if({}.toString.call(D)=="[object Array]"){if((z===1||z===-1)&&O>=-y&&O<=y&&O===r(O)){if(D[0]===0){if(O===0&&D.length===1)return!0;break e}if(T=(O+1)%d,T<1&&(T+=d),String(D[0]).length==T){for(T=0;T<D.length;T++)if(w=D[T],w<0||w>=u||w!==r(w))break e;if(w!==0)return!0}}}else if(D===null&&O===null&&(z===null||z===1||z===-1))return!0;throw Error(i+"Invalid BigNumber: "+v)},ee.maximum=ee.max=function(){return Ut(arguments,-1)},ee.minimum=ee.min=function(){return Ut(arguments,1)},ee.random=(function(){var v=9007199254740992,T=Math.random()*v&2097151?function(){return r(Math.random()*v)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var D,O,z,M,R,C=0,U=[],N=new ee(Ze);if(w==null?w=we:S(w,0,y),M=o(w/d),ot)if(crypto.getRandomValues){for(D=crypto.getRandomValues(new Uint32Array(M*=2));C<M;)R=D[C]*131072+(D[C+1]>>>11),R>=9e15?(O=crypto.getRandomValues(new Uint32Array(2)),D[C]=O[0],D[C+1]=O[1]):(U.push(R%1e14),C+=2);C=M/2}else if(crypto.randomBytes){for(D=crypto.randomBytes(M*=7);C<M;)R=(D[C]&31)*281474976710656+D[C+1]*1099511627776+D[C+2]*4294967296+D[C+3]*16777216+(D[C+4]<<16)+(D[C+5]<<8)+D[C+6],R>=9e15?crypto.randomBytes(7).copy(D,C):(U.push(R%1e14),C+=7);C=M/7}else throw ot=!1,Error(i+"crypto unavailable");if(!ot)for(;C<M;)R=T(),R<9e15&&(U[C++]=R%1e14);for(M=U[--C],w%=d,M&&w&&(R=f[d-w],U[C]=r(M/R)*R);U[C]===0;U.pop(),C--);if(C<0)U=[z=0];else{for(z=-1;U[0]===0;U.splice(0,1),z-=d);for(C=1,R=U[0];R>=10;R/=10,C++);C<d&&(z-=d-C)}return N.e=z,N.c=U,N}})(),ee.sum=function(){for(var v=1,T=arguments,w=new ee(T[0]);v<T.length;)w=w.plus(T[v++]);return w},te=(function(){var v="0123456789";function T(w,D,O,z){for(var M,R=[0],C,U=0,N=w.length;U<N;){for(C=R.length;C--;R[C]*=D);for(R[0]+=z.indexOf(w.charAt(U++)),M=0;M<R.length;M++)R[M]>O-1&&(R[M+1]==null&&(R[M+1]=0),R[M+1]+=R[M]/O|0,R[M]%=O)}return R.reverse()}return a(T,"toBaseOut"),function(w,D,O,z,M){var R,C,U,N,H,ie,se,Ne,tt=w.indexOf("."),rt=we,$e=Te;for(tt>=0&&(N=Dt,Dt=0,w=w.replace(".",""),Ne=new ee(D),ie=Ne.pow(w.length-tt),Dt=N,Ne.c=T(W(P(ie.c),ie.e,"0"),10,O,v),Ne.e=Ne.c.length),se=T(w,D,O,M?(R=Yr,v):(R=v,Yr)),U=N=se.length;se[--N]==0;se.pop());if(!se[0])return R.charAt(0);if(tt<0?--U:(ie.c=se,ie.e=U,ie.s=z,ie=G(ie,Ne,rt,$e,O),se=ie.c,H=ie.r,U=ie.e),C=U+rt+1,tt=se[C],N=O/2,H=H||C<0||se[C+1]!=null,H=$e<4?(tt!=null||H)&&($e==0||$e==(ie.s<0?3:2)):tt>N||tt==N&&($e==4||H||$e==6&&se[C-1]&1||$e==(ie.s<0?8:7)),C<1||!se[0])w=H?W(R.charAt(1),-rt,R.charAt(0)):R.charAt(0);else{if(se.length=C,H)for(--O;++se[--C]>O;)se[C]=0,C||(++U,se=[1].concat(se));for(N=se.length;!se[--N];);for(tt=0,w="";tt<=N;w+=R.charAt(se[tt++]));w=W(w,U,R.charAt(0))}return w}})(),G=(function(){function v(D,O,z){var M,R,C,U,N=0,H=D.length,ie=O%g,se=O/g|0;for(D=D.slice();H--;)C=D[H]%g,U=D[H]/g|0,M=se*C+U*ie,R=ie*C+M%g*g+N,N=(R/z|0)+(M/g|0)+se*U,D[H]=R%z;return N&&(D=[N].concat(D)),D}a(v,"multiply");function T(D,O,z,M){var R,C;if(z!=M)C=z>M?1:-1;else for(R=C=0;R<z;R++)if(D[R]!=O[R]){C=D[R]>O[R]?1:-1;break}return C}a(T,"compare");function w(D,O,z,M){for(var R=0;z--;)D[z]-=R,R=D[z]<O[z]?1:0,D[z]=R*M+D[z]-O[z];for(;!D[0]&&D.length>1;D.splice(0,1));}return a(w,"subtract"),function(D,O,z,M,R){var C,U,N,H,ie,se,Ne,tt,rt,$e,Fe,ht,si,ci,ui,or,hn,Ct=D.s==O.s?1:-1,gt=D.c,He=O.c;if(!gt||!gt[0]||!He||!He[0])return new ee(!D.s||!O.s||(gt?He&>[0]==He[0]:!He)?NaN:gt&>[0]==0||!He?Ct*0:Ct/0);for(tt=new ee(Ct),rt=tt.c=[],U=D.e-O.e,Ct=z+U+1,R||(R=u,U=_(D.e/d)-_(O.e/d),Ct=Ct/d|0),N=0;He[N]==(gt[N]||0);N++);if(He[N]>(gt[N]||0)&&U--,Ct<0)rt.push(1),H=!0;else{for(ci=gt.length,or=He.length,N=0,Ct+=2,ie=r(R/(He[0]+1)),ie>1&&(He=v(He,ie,R),gt=v(gt,ie,R),or=He.length,ci=gt.length),si=or,$e=gt.slice(0,or),Fe=$e.length;Fe<or;$e[Fe++]=0);hn=He.slice(),hn=[0].concat(hn),ui=He[0],He[1]>=R/2&&ui++;do{if(ie=0,C=T(He,$e,or,Fe),C<0){if(ht=$e[0],or!=Fe&&(ht=ht*R+($e[1]||0)),ie=r(ht/ui),ie>1)for(ie>=R&&(ie=R-1),se=v(He,ie,R),Ne=se.length,Fe=$e.length;T(se,$e,Ne,Fe)==1;)ie--,w(se,or<Ne?hn:He,Ne,R),Ne=se.length,C=1;else ie==0&&(C=ie=1),se=He.slice(),Ne=se.length;if(Ne<Fe&&(se=[0].concat(se)),w($e,se,Fe,R),Fe=$e.length,C==-1)for(;T(He,$e,or,Fe)<1;)ie++,w($e,or<Fe?hn:He,Fe,R),Fe=$e.length}else C===0&&(ie++,$e=[0]);rt[N++]=ie,$e[0]?$e[Fe++]=gt[si]||0:($e=[gt[si]],Fe=1)}while((si++<ci||$e[0]!=null)&&Ct--);H=$e[0]!=null,rt[0]||rt.splice(0,1)}if(R==u){for(N=1,Ct=rt[0];Ct>=10;Ct/=10,N++);jt(tt,z+(tt.e=N+U*d-1)+1,M,H)}else tt.e=U,tt.r=+H;return tt}})();function Zt(v,T,w,D){var O,z,M,R,C;if(w==null?w=Te:S(w,0,8),!v.c)return v.toString();if(O=v.c[0],M=v.e,T==null)C=P(v.c),C=D==1||D==2&&(M<=Me||M>=je)?V(C,M):W(C,M,"0");else if(v=jt(new ee(v),T,w),z=v.e,C=P(v.c),R=C.length,D==1||D==2&&(T<=z||z<=Me)){for(;R<T;C+="0",R++);C=V(C,z)}else if(T-=M+(D===2&&z>M),C=W(C,z,"0"),z+1>R){if(--T>0)for(C+=".";T--;C+="0");}else if(T+=z-R,T>0)for(z+1==R&&(C+=".");T--;C+="0");return v.s<0&&O?"-"+C:C}a(Zt,"format");function Ut(v,T){for(var w,D,O=1,z=new ee(v[0]);O<v.length;O++)D=new ee(v[O]),(!D.s||(w=x(z,D))===T||w===0&&z.s===T)&&(z=D);return z}a(Ut,"maxOrMin");function Da(v,T,w){for(var D=1,O=T.length;!T[--O];T.pop());for(O=T[0];O>=10;O/=10,D++);return(w=D+w*d-1)>et?v.c=v.e=null:w<Ve?v.c=[v.e=0]:(v.e=w,v.c=T),v}a(Da,"normalise"),ce=(function(){var v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,T=/^([^.]+)\.$/,w=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(z,M,R,C){var U,N=R?M:M.replace(O,"");if(D.test(N))z.s=isNaN(N)?null:N<0?-1:1;else{if(!R&&(N=N.replace(v,function(H,ie,se){return U=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!C||C==U?ie:H}),C&&(U=C,N=N.replace(T,"$1").replace(w,"0.$1")),M!=N))return new ee(N,U);if(ee.DEBUG)throw Error(i+"Not a"+(C?" base "+C:"")+" number: "+M);z.s=null}z.c=z.e=null}})();function jt(v,T,w,D){var O,z,M,R,C,U,N,H=v.c,ie=f;if(H){e:{for(O=1,R=H[0];R>=10;R/=10,O++);if(z=T-O,z<0)z+=d,M=T,C=H[U=0],N=r(C/ie[O-M-1]%10);else if(U=o((z+1)/d),U>=H.length)if(D){for(;H.length<=U;H.push(0));C=N=0,O=1,z%=d,M=z-d+1}else break e;else{for(C=R=H[U],O=1;R>=10;R/=10,O++);z%=d,M=z-d+O,N=M<0?0:r(C/ie[O-M-1]%10)}if(D=D||T<0||H[U+1]!=null||(M<0?C:C%ie[O-M-1]),D=w<4?(N||D)&&(w==0||w==(v.s<0?3:2)):N>5||N==5&&(w==4||D||w==6&&(z>0?M>0?C/ie[O-M]:0:H[U-1])%10&1||w==(v.s<0?8:7)),T<1||!H[0])return H.length=0,D?(T-=v.e+1,H[0]=ie[(d-T%d)%d],v.e=-T||0):H[0]=v.e=0,v;if(z==0?(H.length=U,R=1,U--):(H.length=U+1,R=ie[d-z],H[U]=M>0?r(C/ie[O-M]%ie[M])*R:0),D)for(;;)if(U==0){for(z=1,M=H[0];M>=10;M/=10,z++);for(M=H[0]+=R,R=1;M>=10;M/=10,R++);z!=R&&(v.e++,H[0]==u&&(H[0]=1));break}else{if(H[U]+=R,H[U]!=u)break;H[U--]=0,R=1}for(z=H.length;H[--z]===0;H.pop());}v.e>et?v.c=v.e=null:v.e<Ve&&(v.c=[v.e=0])}return v}a(jt,"round");function mt(v){var T,w=v.e;return w===null?v.toString():(T=P(v.c),T=w<=Me||w>=je?V(T,w):W(T,w,"0"),v.s<0?"-"+T:T)}return a(mt,"valueOf"),Y.absoluteValue=Y.abs=function(){var v=new ee(this);return v.s<0&&(v.s=1),v},Y.comparedTo=function(v,T){return x(this,new ee(v,T))},Y.decimalPlaces=Y.dp=function(v,T){var w,D,O,z=this;if(v!=null)return S(v,0,y),T==null?T=Te:S(T,0,8),jt(new ee(z),v+z.e+1,T);if(!(w=z.c))return null;if(D=((O=w.length-1)-_(this.e/d))*d,O=w[O])for(;O%10==0;O/=10,D--);return D<0&&(D=0),D},Y.dividedBy=Y.div=function(v,T){return G(this,new ee(v,T),we,Te)},Y.dividedToIntegerBy=Y.idiv=function(v,T){return G(this,new ee(v,T),0,1)},Y.exponentiatedBy=Y.pow=function(v,T){var w,D,O,z,M,R,C,U,N,H=this;if(v=new ee(v),v.c&&!v.isInteger())throw Error(i+"Exponent not an integer: "+mt(v));if(T!=null&&(T=new ee(T)),R=v.e>14,!H.c||!H.c[0]||H.c[0]==1&&!H.e&&H.c.length==1||!v.c||!v.c[0])return N=new ee(Math.pow(+mt(H),R?v.s*(2-$(v)):+mt(v))),T?N.mod(T):N;if(C=v.s<0,T){if(T.c?!T.c[0]:!T.s)return new ee(NaN);D=!C&&H.isInteger()&&T.isInteger(),D&&(H=H.mod(T))}else{if(v.e>9&&(H.e>0||H.e<-1||(H.e==0?H.c[0]>1||R&&H.c[1]>=24e7:H.c[0]<8e13||R&&H.c[0]<=9999975e7)))return z=H.s<0&&$(v)?-0:0,H.e>-1&&(z=1/z),new ee(C?1/z:z);Dt&&(z=o(Dt/d+2))}for(R?(w=new ee(.5),C&&(v.s=1),U=$(v)):(O=Math.abs(+mt(v)),U=O%2),N=new ee(Ze);;){if(U){if(N=N.times(H),!N.c)break;z?N.c.length>z&&(N.c.length=z):D&&(N=N.mod(T))}if(O){if(O=r(O/2),O===0)break;U=O%2}else if(v=v.times(w),jt(v,v.e+1,1),v.e>14)U=$(v);else{if(O=+mt(v),O===0)break;U=O%2}H=H.times(H),z?H.c&&H.c.length>z&&(H.c.length=z):D&&(H=H.mod(T))}return D?N:(C&&(N=Ze.div(N)),T?N.mod(T):z?jt(N,Dt,Te,M):N)},Y.integerValue=function(v){var T=new ee(this);return v==null?v=Te:S(v,0,8),jt(T,T.e+1,v)},Y.isEqualTo=Y.eq=function(v,T){return x(this,new ee(v,T))===0},Y.isFinite=function(){return!!this.c},Y.isGreaterThan=Y.gt=function(v,T){return x(this,new ee(v,T))>0},Y.isGreaterThanOrEqualTo=Y.gte=function(v,T){return(T=x(this,new ee(v,T)))===1||T===0},Y.isInteger=function(){return!!this.c&&_(this.e/d)>this.c.length-2},Y.isLessThan=Y.lt=function(v,T){return x(this,new ee(v,T))<0},Y.isLessThanOrEqualTo=Y.lte=function(v,T){return(T=x(this,new ee(v,T)))===-1||T===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,T){var w,D,O,z,M=this,R=M.s;if(v=new ee(v,T),T=v.s,!R||!T)return new ee(NaN);if(R!=T)return v.s=-T,M.plus(v);var C=M.e/d,U=v.e/d,N=M.c,H=v.c;if(!C||!U){if(!N||!H)return N?(v.s=-T,v):new ee(H?M:NaN);if(!N[0]||!H[0])return H[0]?(v.s=-T,v):new ee(N[0]?M:Te==3?-0:0)}if(C=_(C),U=_(U),N=N.slice(),R=C-U){for((z=R<0)?(R=-R,O=N):(U=C,O=H),O.reverse(),T=R;T--;O.push(0));O.reverse()}else for(D=(z=(R=N.length)<(T=H.length))?R:T,R=T=0;T<D;T++)if(N[T]!=H[T]){z=N[T]<H[T];break}if(z&&(O=N,N=H,H=O,v.s=-v.s),T=(D=H.length)-(w=N.length),T>0)for(;T--;N[w++]=0);for(T=u-1;D>R;){if(N[--D]<H[D]){for(w=D;w&&!N[--w];N[w]=T);--N[w],N[D]+=u}N[D]-=H[D]}for(;N[0]==0;N.splice(0,1),--U);return N[0]?Da(v,N,U):(v.s=Te==3?-1:1,v.c=[v.e=0],v)},Y.modulo=Y.mod=function(v,T){var w,D,O=this;return v=new ee(v,T),!O.c||!v.s||v.c&&!v.c[0]?new ee(NaN):!v.c||O.c&&!O.c[0]?new ee(O):(nr==9?(D=v.s,v.s=1,w=G(O,v,0,3),v.s=D,w.s*=D):w=G(O,v,0,nr),v=O.minus(w.times(v)),!v.c[0]&&nr==1&&(v.s=O.s),v)},Y.multipliedBy=Y.times=function(v,T){var w,D,O,z,M,R,C,U,N,H,ie,se,Ne,tt,rt,$e=this,Fe=$e.c,ht=(v=new ee(v,T)).c;if(!Fe||!ht||!Fe[0]||!ht[0])return!$e.s||!v.s||Fe&&!Fe[0]&&!ht||ht&&!ht[0]&&!Fe?v.c=v.e=v.s=null:(v.s*=$e.s,!Fe||!ht?v.c=v.e=null:(v.c=[0],v.e=0)),v;for(D=_($e.e/d)+_(v.e/d),v.s*=$e.s,C=Fe.length,H=ht.length,C<H&&(Ne=Fe,Fe=ht,ht=Ne,O=C,C=H,H=O),O=C+H,Ne=[];O--;Ne.push(0));for(tt=u,rt=g,O=H;--O>=0;){for(w=0,ie=ht[O]%rt,se=ht[O]/rt|0,M=C,z=O+M;z>O;)U=Fe[--M]%rt,N=Fe[M]/rt|0,R=se*U+N*ie,U=ie*U+R%rt*rt+Ne[z]+w,w=(U/tt|0)+(R/rt|0)+se*N,Ne[z--]=U%tt;Ne[z]=w}return w?++D:Ne.splice(0,1),Da(v,Ne,D)},Y.negated=function(){var v=new ee(this);return v.s=-v.s||null,v},Y.plus=function(v,T){var w,D=this,O=D.s;if(v=new ee(v,T),T=v.s,!O||!T)return new ee(NaN);if(O!=T)return v.s=-T,D.minus(v);var z=D.e/d,M=v.e/d,R=D.c,C=v.c;if(!z||!M){if(!R||!C)return new ee(O/0);if(!R[0]||!C[0])return C[0]?v:new ee(R[0]?D:O*0)}if(z=_(z),M=_(M),R=R.slice(),O=z-M){for(O>0?(M=z,w=C):(O=-O,w=R),w.reverse();O--;w.push(0));w.reverse()}for(O=R.length,T=C.length,O-T<0&&(w=C,C=R,R=w,T=O),O=0;T;)O=(R[--T]=R[T]+C[T]+O)/u|0,R[T]=u===R[T]?0:R[T]%u;return O&&(R=[O].concat(R),++M),Da(v,R,M)},Y.precision=Y.sd=function(v,T){var w,D,O,z=this;if(v!=null&&v!==!!v)return S(v,1,y),T==null?T=Te:S(T,0,8),jt(new ee(z),v,T);if(!(w=z.c))return null;if(O=w.length-1,D=O*d+1,O=w[O]){for(;O%10==0;O/=10,D--);for(O=w[0];O>=10;O/=10,D++);}return v&&z.e+1>D&&(D=z.e+1),D},Y.shiftedBy=function(v){return S(v,-p,p),this.times("1e"+v)},Y.squareRoot=Y.sqrt=function(){var v,T,w,D,O,z=this,M=z.c,R=z.s,C=z.e,U=we+4,N=new ee("0.5");if(R!==1||!M||!M[0])return new ee(!R||R<0&&(!M||M[0])?NaN:M?z:1/0);if(R=Math.sqrt(+mt(z)),R==0||R==1/0?(T=P(M),(T.length+C)%2==0&&(T+="0"),R=Math.sqrt(+T),C=_((C+1)/2)-(C<0||C%2),R==1/0?T="5e"+C:(T=R.toExponential(),T=T.slice(0,T.indexOf("e")+1)+C),w=new ee(T)):w=new ee(R+""),w.c[0]){for(C=w.e,R=C+U,R<3&&(R=0);;)if(O=w,w=N.times(O.plus(G(z,O,U,1))),P(O.c).slice(0,R)===(T=P(w.c)).slice(0,R))if(w.e<C&&--R,T=T.slice(R-3,R+1),T=="9999"||!D&&T=="4999"){if(!D&&(jt(O,O.e+we+2,0),O.times(O).eq(z))){w=O;break}U+=4,R+=4,D=1}else{(!+T||!+T.slice(1)&&T.charAt(0)=="5")&&(jt(w,w.e+we+2,1),v=!w.times(w).eq(z));break}}return jt(w,w.e+we+1,Te,v)},Y.toExponential=function(v,T){return v!=null&&(S(v,0,y),v++),Zt(this,v,T,1)},Y.toFixed=function(v,T){return v!=null&&(S(v,0,y),v=v+this.e+1),Zt(this,v,T)},Y.toFormat=function(v,T,w){var D,O=this;if(w==null)v!=null&&T&&typeof T=="object"?(w=T,T=null):v&&typeof v=="object"?(w=v,v=T=null):w=ai;else if(typeof w!="object")throw Error(i+"Argument not an object: "+w);if(D=O.toFixed(v,T),O.c){var z,M=D.split("."),R=+w.groupSize,C=+w.secondaryGroupSize,U=w.groupSeparator||"",N=M[0],H=M[1],ie=O.s<0,se=ie?N.slice(1):N,Ne=se.length;if(C&&(z=R,R=C,C=z,Ne-=z),R>0&&Ne>0){for(z=Ne%R||R,N=se.substr(0,z);z<Ne;z+=R)N+=U+se.substr(z,R);C>0&&(N+=U+se.slice(z)),ie&&(N="-"+N)}D=H?N+(w.decimalSeparator||"")+((C=+w.fractionGroupSize)?H.replace(new RegExp("\\d{"+C+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):H):N}return(w.prefix||"")+D+(w.suffix||"")},Y.toFraction=function(v){var T,w,D,O,z,M,R,C,U,N,H,ie,se=this,Ne=se.c;if(v!=null&&(R=new ee(v),!R.isInteger()&&(R.c||R.s!==1)||R.lt(Ze)))throw Error(i+"Argument "+(R.isInteger()?"out of range: ":"not an integer: ")+mt(R));if(!Ne)return new ee(se);for(T=new ee(Ze),U=w=new ee(Ze),D=C=new ee(Ze),ie=P(Ne),z=T.e=ie.length-se.e-1,T.c[0]=f[(M=z%d)<0?d+M:M],v=!v||R.comparedTo(T)>0?z>0?T:U:R,M=et,et=1/0,R=new ee(ie),C.c[0]=0;N=G(R,T,0,1),O=w.plus(N.times(D)),O.comparedTo(v)!=1;)w=D,D=O,U=C.plus(N.times(O=U)),C=O,T=R.minus(N.times(O=T)),R=O;return O=G(v.minus(w),D,0,1),C=C.plus(O.times(U)),w=w.plus(O.times(D)),C.s=U.s=se.s,z=z*2,H=G(U,D,z,Te).minus(se).abs().comparedTo(G(C,w,z,Te).minus(se).abs())<1?[U,D]:[C,w],et=M,H},Y.toNumber=function(){return+mt(this)},Y.toPrecision=function(v,T){return v!=null&&S(v,1,y),Zt(this,v,T,2)},Y.toString=function(v){var T,w=this,D=w.s,O=w.e;return O===null?D?(T="Infinity",D<0&&(T="-"+T)):T="NaN":(v==null?T=O<=Me||O>=je?V(P(w.c),O):W(P(w.c),O,"0"):v===10&&Na?(w=jt(new ee(w),we+O+1,Te),T=W(P(w.c),w.e,"0")):(S(v,2,Yr.length,"Base"),T=te(W(P(w.c),O,"0"),10,v,D,!0)),D<0&&w.c[0]&&(T="-"+T)),T},Y.valueOf=Y.toJSON=function(){return mt(this)},Y._isBigNumber=!0,Z!=null&&ee.set(Z),ee}a(h,"clone");function _(Z){var G=Z|0;return Z>0||Z===G?G:G-1}a(_,"bitFloor");function P(Z){for(var G,te,ce=1,Y=Z.length,Ze=Z[0]+"";ce<Y;){for(G=Z[ce++]+"",te=d-G.length;te--;G="0"+G);Ze+=G}for(Y=Ze.length;Ze.charCodeAt(--Y)===48;);return Ze.slice(0,Y+1||1)}a(P,"coeffToString");function x(Z,G){var te,ce,Y=Z.c,Ze=G.c,we=Z.s,Te=G.s,Me=Z.e,je=G.e;if(!we||!Te)return null;if(te=Y&&!Y[0],ce=Ze&&!Ze[0],te||ce)return te?ce?0:-Te:we;if(we!=Te)return we;if(te=we<0,ce=Me==je,!Y||!Ze)return ce?0:!Y^te?1:-1;if(!ce)return Me>je^te?1:-1;for(Te=(Me=Y.length)<(je=Ze.length)?Me:je,we=0;we<Te;we++)if(Y[we]!=Ze[we])return Y[we]>Ze[we]^te?1:-1;return Me==je?0:Me>je^te?1:-1}a(x,"compare");function S(Z,G,te,ce){if(Z<G||Z>te||Z!==r(Z))throw Error(i+(ce||"Argument")+(typeof Z=="number"?Z<G||Z>te?" out of range: ":" not an integer: ":" not a primitive number: ")+String(Z))}a(S,"intCheck");function $(Z){var G=Z.c.length-1;return _(Z.e/d)==G&&Z.c[G]%2!=0}a($,"isOdd");function V(Z,G){return(Z.length>1?Z.charAt(0)+"."+Z.slice(1):Z)+(G<0?"e":"e+")+G}a(V,"toExponential");function W(Z,G,te){var ce,Y;if(G<0){for(Y=te+".";++G;Y+=te);Z=Y+Z}else if(ce=Z.length,++G>ce){for(Y=te,G-=ce;--G;Y+=te);Z+=Y}else G<ce&&(Z=Z.slice(0,G)+"."+Z.slice(G));return Z}a(W,"toFixedPoint"),t=h(),t.default=t.BigNumber=t,typeof define=="function"&&define.amd?define(function(){return t}):typeof lf<"u"&&lf.exports?lf.exports=t:(e||(e=typeof self<"u"&&self?self:window),e.BigNumber=t)})(bO)});var PO=B((c7,SO)=>{var vO=Qb(),EO=SO.exports;(function(){"use strict";function e(p){return p<10?"0"+p:p}a(e,"f");var t=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o,r,i={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},s;function u(p){return n.lastIndex=0,n.test(p)?'"'+p.replace(n,function(f){var g=i[f];return typeof g=="string"?g:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+p+'"'}a(u,"quote");function d(p,f){var g,y,h,_,P=o,x,S=f[p],$=S!=null&&(S instanceof vO||vO.isBigNumber(S));switch(S&&typeof S=="object"&&typeof S.toJSON=="function"&&(S=S.toJSON(p)),typeof s=="function"&&(S=s.call(f,p,S)),typeof S){case"string":return $?S:u(S);case"number":return isFinite(S)?String(S):"null";case"boolean":case"null":case"bigint":return String(S);case"object":if(!S)return"null";if(o+=r,x=[],Object.prototype.toString.apply(S)==="[object Array]"){for(_=S.length,g=0;g<_;g+=1)x[g]=d(g,S)||"null";return h=x.length===0?"[]":o?`[
|
|
32
|
+
`+o+x.join(`,
|
|
33
|
+
`+o)+`
|
|
34
|
+
`+P+"]":"["+x.join(",")+"]",o=P,h}if(s&&typeof s=="object")for(_=s.length,g=0;g<_;g+=1)typeof s[g]=="string"&&(y=s[g],h=d(y,S),h&&x.push(u(y)+(o?": ":":")+h));else Object.keys(S).forEach(function(V){var W=d(V,S);W&&x.push(u(V)+(o?": ":":")+W)});return h=x.length===0?"{}":o?`{
|
|
35
|
+
`+o+x.join(`,
|
|
36
|
+
`+o)+`
|
|
37
|
+
`+P+"}":"{"+x.join(",")+"}",o=P,h}}a(d,"str"),typeof EO.stringify!="function"&&(EO.stringify=function(p,f,g){var y;if(o="",r="",typeof g=="number")for(y=0;y<g;y+=1)r+=" ";else typeof g=="string"&&(r=g);if(s=f,f&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw new Error("JSON.stringify");return d("",{"":p})})})()});var TO=B((l7,xO)=>{var df=null,Y1=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,eF=/(?: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)/,tF=a(function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(e!=null){if(e.strict===!0&&(t.strict=!0),e.storeAsString===!0&&(t.storeAsString=!0),t.alwaysParseAsBig=e.alwaysParseAsBig===!0?e.alwaysParseAsBig:!1,t.useNativeBigInt=e.useNativeBigInt===!0?e.useNativeBigInt:!1,typeof e.constructorAction<"u")if(e.constructorAction==="error"||e.constructorAction==="ignore"||e.constructorAction==="preserve")t.constructorAction=e.constructorAction;else throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);if(typeof e.protoAction<"u")if(e.protoAction==="error"||e.protoAction==="ignore"||e.protoAction==="preserve")t.protoAction=e.protoAction;else throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`)}var n,o,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
38
|
+
`,r:"\r",t:" "},i,s=a(function(P){throw{name:"SyntaxError",message:P,at:n,text:i}},"error"),u=a(function(P){return P&&P!==o&&s("Expected '"+P+"' instead of '"+o+"'"),o=i.charAt(n),n+=1,o},"next"),d=a(function(){var P,x="";for(o==="-"&&(x="-",u("-"));o>="0"&&o<="9";)x+=o,u();if(o===".")for(x+=".";u()&&o>="0"&&o<="9";)x+=o;if(o==="e"||o==="E")for(x+=o,u(),(o==="-"||o==="+")&&(x+=o,u());o>="0"&&o<="9";)x+=o,u();if(P=+x,!isFinite(P))s("Bad number");else return df==null&&(df=Qb()),x.length>15?t.storeAsString?x:t.useNativeBigInt?BigInt(x):new df(x):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(P):new df(P):P},"number"),p=a(function(){var P,x,S="",$;if(o==='"')for(var V=n;u();){if(o==='"')return n-1>V&&(S+=i.substring(V,n-1)),u(),S;if(o==="\\"){if(n-1>V&&(S+=i.substring(V,n-1)),u(),o==="u"){for($=0,x=0;x<4&&(P=parseInt(u(),16),!!isFinite(P));x+=1)$=$*16+P;S+=String.fromCharCode($)}else if(typeof r[o]=="string")S+=r[o];else break;V=n}}s("Bad string")},"string"),f=a(function(){for(;o&&o<=" ";)u()},"white"),g=a(function(){switch(o){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}s("Unexpected '"+o+"'")},"word"),y,h=a(function(){var P=[];if(o==="["){if(u("["),f(),o==="]")return u("]"),P;for(;o;){if(P.push(y()),f(),o==="]")return u("]"),P;u(","),f()}}s("Bad array")},"array"),_=a(function(){var P,x=Object.create(null);if(o==="{"){if(u("{"),f(),o==="}")return u("}"),x;for(;o;){if(P=p(),f(),u(":"),t.strict===!0&&Object.hasOwnProperty.call(x,P)&&s('Duplicate key "'+P+'"'),Y1.test(P)===!0?t.protoAction==="error"?s("Object contains forbidden prototype property"):t.protoAction==="ignore"?y():x[P]=y():eF.test(P)===!0?t.constructorAction==="error"?s("Object contains forbidden constructor property"):t.constructorAction==="ignore"?y():x[P]=y():x[P]=y(),f(),o==="}")return u("}"),x;u(","),f()}}s("Bad object")},"object");return y=a(function(){switch(f(),o){case"{":return _();case"[":return h();case'"':return p();case"-":return d();default:return o>="0"&&o<="9"?d():g()}},"value"),function(P,x){var S;return i=P+"",n=0,o=" ",S=y(),f(),o&&s("Syntax error"),typeof x=="function"?a((function $(V,W){var Z,G,te=V[W];return te&&typeof te=="object"&&Object.keys(te).forEach(function(ce){G=$(te,ce),G!==void 0?te[ce]=G:delete te[ce]}),x.call(V,W,te)}),"walk")({"":S},""):S}},"json_parse");xO.exports=tF});var IO=B((p7,pf)=>{var wO=PO().stringify,AO=TO();pf.exports=function(e){return{parse:AO(e),stringify:wO}};pf.exports.parse=AO();pf.exports.stringify=wO});var Yb=B(Hr=>{"use strict";Object.defineProperty(Hr,"__esModule",{value:!0});Hr.GCE_LINUX_BIOS_PATHS=void 0;Hr.isGoogleCloudServerless=kO;Hr.isGoogleComputeEngineLinux=CO;Hr.isGoogleComputeEngineMACAddress=$O;Hr.isGoogleComputeEngine=zO;Hr.detectGCPResidency=nF;var RO=require("fs"),OO=require("os");Hr.GCE_LINUX_BIOS_PATHS={BIOS_DATE:"/sys/class/dmi/id/bios_date",BIOS_VENDOR:"/sys/class/dmi/id/bios_vendor"};var rF=/^42:01/;function kO(){return!!(process.env.CLOUD_RUN_JOB||process.env.FUNCTION_NAME||process.env.K_SERVICE)}a(kO,"isGoogleCloudServerless");function CO(){if((0,OO.platform)()!=="linux")return!1;try{(0,RO.statSync)(Hr.GCE_LINUX_BIOS_PATHS.BIOS_DATE);let e=(0,RO.readFileSync)(Hr.GCE_LINUX_BIOS_PATHS.BIOS_VENDOR,"utf8");return/Google/.test(e)}catch{return!1}}a(CO,"isGoogleComputeEngineLinux");function $O(){let e=(0,OO.networkInterfaces)();for(let t of Object.values(e))if(t){for(let{mac:n}of t)if(rF.test(n))return!0}return!1}a($O,"isGoogleComputeEngineMACAddress");function zO(){return CO()||$O()}a(zO,"isGoogleComputeEngine");function nF(){return kO()||zO()}a(nF,"detectGCPResidency")});var NO=B(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.Colours=void 0;var Nt=class e{static{a(this,"Colours")}static isEnabled(t){return t&&t.isTTY&&(typeof t.getColorDepth=="function"?t.getColorDepth()>2:!0)}static refresh(){e.enabled=e.isEnabled(process==null?void 0:process.stderr),this.enabled?(e.reset="\x1B[0m",e.bright="\x1B[1m",e.dim="\x1B[2m",e.red="\x1B[31m",e.green="\x1B[32m",e.yellow="\x1B[33m",e.blue="\x1B[34m",e.magenta="\x1B[35m",e.cyan="\x1B[36m",e.white="\x1B[37m",e.grey="\x1B[90m"):(e.reset="",e.bright="",e.dim="",e.red="",e.green="",e.yellow="",e.blue="",e.magenta="",e.cyan="",e.white="",e.grey="")}};ff.Colours=Nt;Nt.enabled=!1;Nt.reset="";Nt.bright="";Nt.dim="";Nt.red="";Nt.green="";Nt.yellow="";Nt.blue="";Nt.magenta="";Nt.cyan="";Nt.white="";Nt.grey="";Nt.refresh()});var MO=B(Je=>{"use strict";var oF=Je&&Je.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),iF=Je&&Je.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),DO=Je&&Je.__importStar||(function(){var e=a(function(t){return e=Object.getOwnPropertyNames||function(n){var o=[];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[o.length]=r);return o},e(t)},"ownKeys");return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=e(t),r=0;r<o.length;r++)o[r]!=="default"&&oF(n,t,o[r]);return iF(n,t),n}})();Object.defineProperty(Je,"__esModule",{value:!0});Je.env=Je.DebugLogBackendBase=Je.placeholder=Je.AdhocDebugLogger=Je.LogSeverity=void 0;Je.getNodeBackend=tv;Je.getDebugBackend=sF;Je.getStructuredBackend=cF;Je.setBackend=uF;Je.log=jO;var aF=require("events"),Kc=DO(require("process")),UO=DO(require("util")),hr=NO(),Gr;(function(e){e.DEFAULT="DEFAULT",e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR"})(Gr||(Je.LogSeverity=Gr={}));var Xc=class extends aF.EventEmitter{static{a(this,"AdhocDebugLogger")}constructor(t,n){super(),this.namespace=t,this.upstream=n,this.func=Object.assign(this.invoke.bind(this),{instance:this,on:a((o,r)=>this.on(o,r),"on")}),this.func.debug=(...o)=>this.invokeSeverity(Gr.DEBUG,...o),this.func.info=(...o)=>this.invokeSeverity(Gr.INFO,...o),this.func.warn=(...o)=>this.invokeSeverity(Gr.WARNING,...o),this.func.error=(...o)=>this.invokeSeverity(Gr.ERROR,...o),this.func.sublog=o=>jO(o,this.func)}invoke(t,...n){if(this.upstream)try{this.upstream(t,...n)}catch{}try{this.emit("log",t,n)}catch{}}invokeSeverity(t,...n){this.invoke({severity:t},...n)}};Je.AdhocDebugLogger=Xc;Je.placeholder=new Xc("",()=>{}).func;var ga=class{static{a(this,"DebugLogBackendBase")}constructor(){var t;this.cached=new Map,this.filters=[],this.filtersSet=!1;let n=(t=Kc.env[Je.env.nodeEnables])!==null&&t!==void 0?t:"*";n==="all"&&(n="*"),this.filters=n.split(",")}log(t,n,...o){try{this.filtersSet||(this.setFilters(),this.filtersSet=!0);let r=this.cached.get(t);r||(r=this.makeLogger(t),this.cached.set(t,r)),r(n,...o)}catch(r){console.error(r)}}};Je.DebugLogBackendBase=ga;var ev=class extends ga{static{a(this,"NodeBackend")}constructor(){super(...arguments),this.enabledRegexp=/.*/g}isEnabled(t){return this.enabledRegexp.test(t)}makeLogger(t){return this.enabledRegexp.test(t)?(n,...o)=>{var r;let i=`${hr.Colours.green}${t}${hr.Colours.reset}`,s=`${hr.Colours.yellow}${Kc.pid}${hr.Colours.reset}`,u;switch(n.severity){case Gr.ERROR:u=`${hr.Colours.red}${n.severity}${hr.Colours.reset}`;break;case Gr.INFO:u=`${hr.Colours.magenta}${n.severity}${hr.Colours.reset}`;break;case Gr.WARNING:u=`${hr.Colours.yellow}${n.severity}${hr.Colours.reset}`;break;default:u=(r=n.severity)!==null&&r!==void 0?r:Gr.DEFAULT;break}let d=UO.formatWithOptions({colors:hr.Colours.enabled},...o),p=Object.assign({},n);delete p.severity;let f=Object.getOwnPropertyNames(p).length?JSON.stringify(p):"",g=f?`${hr.Colours.grey}${f}${hr.Colours.reset}`:"";console.error("%s [%s|%s] %s%s",s,i,u,d,f?` ${g}`:"")}:()=>{}}setFilters(){let n=this.filters.join(",").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^");this.enabledRegexp=new RegExp(`^${n}$`,"i")}};function tv(){return new ev}a(tv,"getNodeBackend");var rv=class extends ga{static{a(this,"DebugBackend")}constructor(t){super(),this.debugPkg=t}makeLogger(t){let n=this.debugPkg(t);return(o,...r)=>{n(r[0],...r.slice(1))}}setFilters(){var t;let n=(t=Kc.env.NODE_DEBUG)!==null&&t!==void 0?t:"";Kc.env.NODE_DEBUG=`${n}${n?",":""}${this.filters.join(",")}`}};function sF(e){return new rv(e)}a(sF,"getDebugBackend");var nv=class extends ga{static{a(this,"StructuredBackend")}constructor(t){var n;super(),this.upstream=(n=t)!==null&&n!==void 0?n:void 0}makeLogger(t){var n;let o=(n=this.upstream)===null||n===void 0?void 0:n.makeLogger(t);return(r,...i)=>{var s;let u=(s=r.severity)!==null&&s!==void 0?s:Gr.INFO,d=Object.assign({severity:u,message:UO.format(...i)},r),p=JSON.stringify(d);o?o(r,p):console.log("%s",p)}}setFilters(){var t;(t=this.upstream)===null||t===void 0||t.setFilters()}};function cF(e){return new nv(e)}a(cF,"getStructuredBackend");Je.env={nodeEnables:"GOOGLE_SDK_NODE_LOGGING"};var ov=new Map,gr;function uF(e){gr=e,ov.clear()}a(uF,"setBackend");function jO(e,t){if(!gr&&!Kc.env[Je.env.nodeEnables]||!e)return Je.placeholder;t&&(e=`${t.instance.namespace}:${e}`);let n=ov.get(e);if(n)return n.func;if(gr===null)return Je.placeholder;gr===void 0&&(gr=tv());let o=(()=>{let r;return new Xc(e,(s,...u)=>{if(r!==gr){if(gr===null)return;gr===void 0&&(gr=tv()),r=gr}gr?.log(e,s,...u)})})();return ov.set(e,o),o.func}a(jO,"log")});var iv=B(ti=>{"use strict";var lF=ti&&ti.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),dF=ti&&ti.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&lF(t,e,n)};Object.defineProperty(ti,"__esModule",{value:!0});dF(MO(),ti)});var Yc=B(fe=>{"use strict";var FO=fe&&fe.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),pF=fe&&fe.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fF=fe&&fe.__importStar||(function(){var e=a(function(t){return e=Object.getOwnPropertyNames||function(n){var o=[];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(o[o.length]=r);return o},e(t)},"ownKeys");return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var o=e(t),r=0;r<o.length;r++)o[r]!=="default"&&FO(n,t,o[r]);return pF(n,t),n}})(),mF=fe&&fe.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&FO(t,e,n)};Object.defineProperty(fe,"__esModule",{value:!0});fe.gcpResidencyCache=fe.METADATA_SERVER_DETECTION=fe.HEADERS=fe.HEADER_VALUE=fe.HEADER_NAME=fe.SECONDARY_HOST_ADDRESS=fe.HOST_ADDRESS=fe.BASE_PATH=void 0;fe.instance=vF;fe.project=EF;fe.universe=SF;fe.bulk=PF;fe.isAvailable=TF;fe.resetIsAvailableCache=wF;fe.getGCPResidency=cv;fe.setGCPResidency=BO;fe.requestTimeout=qO;var av=kt(),hF=IO(),gF=Yb(),yF=fF(iv());fe.BASE_PATH="/computeMetadata/v1";fe.HOST_ADDRESS="http://169.254.169.254";fe.SECONDARY_HOST_ADDRESS="http://metadata.google.internal.";fe.HEADER_NAME="Metadata-Flavor";fe.HEADER_VALUE="Google";fe.HEADERS=Object.freeze({[fe.HEADER_NAME]:fe.HEADER_VALUE});var LO=yF.log("gcp-metadata");fe.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 sv(e){return e||(e=process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST||fe.HOST_ADDRESS),/^https?:\/\//.test(e)||(e=`http://${e}`),new URL(fe.BASE_PATH,e).href}a(sv,"getBaseUrl");function _F(e){Object.keys(e).forEach(t=>{switch(t){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(`'${t}' is not a valid configuration option.`)}})}a(_F,"validate");async function Qc(e,t={},n=3,o=!1){let r=new Headers(fe.HEADERS),i="",s={};if(typeof e=="object"){let g=e;new Headers(g.headers).forEach((y,h)=>r.set(h,y)),i=g.metadataKey,s=g.params||s,n=g.noResponseRetries||n,o=g.fastFail||o}else i=e;typeof t=="string"?i+=`/${t}`:(_F(t),t.property&&(i+=`/${t.property}`),new Headers(t.headers).forEach((g,y)=>r.set(y,g)),s=t.params||s);let u=o?bF:av.request,d={url:`${sv()}/${i}`,headers:r,retryConfig:{noResponseRetries:n},params:s,responseType:"text",timeout:qO()};LO.info("instance request %j",d);let p=await u(d);LO.info("instance metadata is %s",p.data);let f=p.headers.get(fe.HEADER_NAME);if(f!==fe.HEADER_VALUE)throw new RangeError(`Invalid response from metadata service: incorrect ${fe.HEADER_NAME} header. Expected '${fe.HEADER_VALUE}', got ${f?`'${f}'`:"no header"}`);if(typeof p.data=="string")try{return hF.parse(p.data)}catch{}return p.data}a(Qc,"metadataAccessor");async function bF(e){let t={...e,url:e.url?.toString().replace(sv(),sv(fe.SECONDARY_HOST_ADDRESS))},n=(0,av.request)(e),o=(0,av.request)(t);return Promise.any([n,o])}a(bF,"fastFailMetadataRequest");function vF(e){return Qc("instance",e)}a(vF,"instance");function EF(e){return Qc("project",e)}a(EF,"project");function SF(e){return Qc("universe",e)}a(SF,"universe");async function PF(e){let t={};return await Promise.all(e.map(n=>(async()=>{let o=await Qc(n),r=n.metadataKey;t[r]=o})())),t}a(PF,"bulk");function xF(){return process.env.DETECT_GCP_RETRIES?Number(process.env.DETECT_GCP_RETRIES):0}a(xF,"detectGCPAvailableRetries");var mf;async function TF(){if(process.env.METADATA_SERVER_DETECTION){let e=process.env.METADATA_SERVER_DETECTION.trim().toLocaleLowerCase();if(!(e in fe.METADATA_SERVER_DETECTION))throw new RangeError(`Unknown \`METADATA_SERVER_DETECTION\` env variable. Got \`${e}\`, but it should be \`${Object.keys(fe.METADATA_SERVER_DETECTION).join("`, `")}\`, or unset`);switch(e){case"assume-present":return!0;case"none":return!1;case"bios-only":return cv();case"ping-only":}}try{return mf===void 0&&(mf=Qc("instance",void 0,xF(),!(process.env.GCE_METADATA_IP||process.env.GCE_METADATA_HOST))),await mf,!0}catch(e){let t=e;if(process.env.DEBUG_AUTH&&console.info(t),t.type==="request-timeout"||t.response&&t.response.status===404)return!1;if(!(t.response&&t.response.status===404)&&(!t.code||!["EHOSTDOWN","EHOSTUNREACH","ENETUNREACH","ENOENT","ENOTFOUND","ECONNREFUSED"].includes(t.code.toString()))){let n="UNKNOWN";t.code&&(n=t.code.toString()),process.emitWarning(`received unexpected error = ${t.message} code = ${n}`,"MetadataLookupWarning")}return!1}}a(TF,"isAvailable");function wF(){mf=void 0}a(wF,"resetIsAvailableCache");fe.gcpResidencyCache=null;function cv(){return fe.gcpResidencyCache===null&&BO(),fe.gcpResidencyCache}a(cv,"getGCPResidency");function BO(e=null){fe.gcpResidencyCache=e!==null?e:(0,gF.detectGCPResidency)()}a(BO,"setGCPResidency");function qO(){return cv()?0:3e3}a(qO,"requestTimeout");mF(Yb(),fe)});var HO=B(hf=>{"use strict";hf.byteLength=IF;hf.toByteArray=OF;hf.fromByteArray=$F;var sn=[],kr=[],AF=typeof Uint8Array<"u"?Uint8Array:Array,uv="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ri=0,VO=uv.length;ri<VO;++ri)sn[ri]=uv[ri],kr[uv.charCodeAt(ri)]=ri;var ri,VO;kr[45]=62;kr[95]=63;function ZO(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var o=n===t?0:4-n%4;return[n,o]}a(ZO,"getLens");function IF(e){var t=ZO(e),n=t[0],o=t[1];return(n+o)*3/4-o}a(IF,"byteLength");function RF(e,t,n){return(t+n)*3/4-n}a(RF,"_byteLength");function OF(e){var t,n=ZO(e),o=n[0],r=n[1],i=new AF(RF(e,o,r)),s=0,u=r>0?o-4:o,d;for(d=0;d<u;d+=4)t=kr[e.charCodeAt(d)]<<18|kr[e.charCodeAt(d+1)]<<12|kr[e.charCodeAt(d+2)]<<6|kr[e.charCodeAt(d+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=t&255;return r===2&&(t=kr[e.charCodeAt(d)]<<2|kr[e.charCodeAt(d+1)]>>4,i[s++]=t&255),r===1&&(t=kr[e.charCodeAt(d)]<<10|kr[e.charCodeAt(d+1)]<<4|kr[e.charCodeAt(d+2)]>>2,i[s++]=t>>8&255,i[s++]=t&255),i}a(OF,"toByteArray");function kF(e){return sn[e>>18&63]+sn[e>>12&63]+sn[e>>6&63]+sn[e&63]}a(kF,"tripletToBase64");function CF(e,t,n){for(var o,r=[],i=t;i<n;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(e[i+2]&255),r.push(kF(o));return r.join("")}a(CF,"encodeChunk");function $F(e){for(var t,n=e.length,o=n%3,r=[],i=16383,s=0,u=n-o;s<u;s+=i)r.push(CF(e,s,s+i>u?u:s+i));return o===1?(t=e[n-1],r.push(sn[t>>2]+sn[t<<4&63]+"==")):o===2&&(t=(e[n-2]<<8)+e[n-1],r.push(sn[t>>10]+sn[t>>4&63]+sn[t<<2&63]+"=")),r.join("")}a($F,"fromByteArray")});var dv=B(lv=>{"use strict";Object.defineProperty(lv,"__esModule",{value:!0});lv.fromArrayBufferToHex=zF;function zF(e){return Array.from(new Uint8Array(e)).map(n=>n.toString(16).padStart(2,"0")).join("")}a(zF,"fromArrayBufferToHex")});var GO=B(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.BrowserCrypto=void 0;var ya=HO(),NF=dv(),pv=class e{static{a(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(t){let n=new TextEncoder().encode(t),o=await window.crypto.subtle.digest("SHA-256",n);return ya.fromByteArray(new Uint8Array(o))}randomBytesBase64(t){let n=new Uint8Array(t);return window.crypto.getRandomValues(n),ya.fromByteArray(n)}static padBase64(t){for(;t.length%4!==0;)t+="=";return t}async verify(t,n,o){let r={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},i=new TextEncoder().encode(n),s=ya.toByteArray(e.padBase64(o)),u=await window.crypto.subtle.importKey("jwk",t,r,!0,["verify"]);return await window.crypto.subtle.verify(r,u,s,i)}async sign(t,n){let o={name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},r=new TextEncoder().encode(n),i=await window.crypto.subtle.importKey("jwk",t,o,!0,["sign"]),s=await window.crypto.subtle.sign(o,i,r);return ya.fromByteArray(new Uint8Array(s))}decodeBase64StringUtf8(t){let n=ya.toByteArray(e.padBase64(t));return new TextDecoder().decode(n)}encodeBase64StringUtf8(t){let n=new TextEncoder().encode(t);return ya.fromByteArray(n)}async sha256DigestHex(t){let n=new TextEncoder().encode(t),o=await window.crypto.subtle.digest("SHA-256",n);return(0,NF.fromArrayBufferToHex)(o)}async signWithHmacSha256(t,n){let o=typeof t=="string"?t:String.fromCharCode(...new Uint16Array(t)),r=new TextEncoder,i=await window.crypto.subtle.importKey("raw",r.encode(o),{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return window.crypto.subtle.sign("HMAC",i,r.encode(n))}};gf.BrowserCrypto=pv});var WO=B(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.NodeCrypto=void 0;var _a=require("crypto"),fv=class{static{a(this,"NodeCrypto")}async sha256DigestBase64(t){return _a.createHash("sha256").update(t).digest("base64")}randomBytesBase64(t){return _a.randomBytes(t).toString("base64")}async verify(t,n,o){let r=_a.createVerify("RSA-SHA256");return r.update(n),r.end(),r.verify(t,o,"base64")}async sign(t,n){let o=_a.createSign("RSA-SHA256");return o.update(n),o.end(),o.sign(t,"base64")}decodeBase64StringUtf8(t){return Buffer.from(t,"base64").toString("utf-8")}encodeBase64StringUtf8(t){return Buffer.from(t,"utf-8").toString("base64")}async sha256DigestHex(t){return _a.createHash("sha256").update(t).digest("hex")}async signWithHmacSha256(t,n){let o=typeof t=="string"?t:UF(t);return DF(_a.createHmac("sha256",o).update(n).digest())}};yf.NodeCrypto=fv;function DF(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}a(DF,"toArrayBuffer");function UF(e){return Buffer.from(e)}a(UF,"toBuffer")});var eu=B($n=>{"use strict";var jF=$n&&$n.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:a(function(){return t[n]},"get")}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),MF=$n&&$n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&jF(t,e,n)};Object.defineProperty($n,"__esModule",{value:!0});$n.createCrypto=BF;$n.hasBrowserCrypto=JO;var LF=GO(),FF=WO();MF(dv(),$n);function BF(){return JO()?new LF.BrowserCrypto:new FF.NodeCrypto}a(BF,"createCrypto");function JO(){return typeof window<"u"&&typeof window.crypto<"u"&&typeof window.crypto.subtle<"u"}a(JO,"hasBrowserCrypto")});var ba=B((mv,XO)=>{var _f=require("buffer"),cn=_f.Buffer;function KO(e,t){for(var n in e)t[n]=e[n]}a(KO,"copyProps");cn.from&&cn.alloc&&cn.allocUnsafe&&cn.allocUnsafeSlow?XO.exports=_f:(KO(_f,mv),mv.Buffer=ni);function ni(e,t,n){return cn(e,t,n)}a(ni,"SafeBuffer");ni.prototype=Object.create(cn.prototype);KO(cn,ni);ni.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return cn(e,t,n)};ni.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var o=cn(e);return t!==void 0?typeof n=="string"?o.fill(t,n):o.fill(t):o.fill(0),o};ni.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return cn(e)};ni.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return _f.SlowBuffer(e)}});var YO=B((z7,QO)=>{"use strict";function hv(e){var t=(e/8|0)+(e%8===0?0:1);return t}a(hv,"getParamSize");var qF={ES256:hv(256),ES384:hv(384),ES512:hv(521)};function VF(e){var t=qF[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}a(VF,"getParamBytesForAlg");QO.exports=VF});var gv=B((D7,ik)=>{"use strict";var bf=ba().Buffer,tk=YO(),vf=128,rk=0,ZF=32,HF=16,GF=2,nk=HF|ZF|rk<<6,Ef=GF|rk<<6;function WF(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(WF,"base64Url");function ok(e){if(bf.isBuffer(e))return e;if(typeof e=="string")return bf.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}a(ok,"signatureAsBuffer");function JF(e,t){e=ok(e);var n=tk(t),o=n+1,r=e.length,i=0;if(e[i++]!==nk)throw new Error('Could not find expected "seq"');var s=e[i++];if(s===(vf|1)&&(s=e[i++]),r-i<s)throw new Error('"seq" specified length of "'+s+'", only "'+(r-i)+'" remaining');if(e[i++]!==Ef)throw new Error('Could not find expected "int" for "r"');var u=e[i++];if(r-i-2<u)throw new Error('"r" specified length of "'+u+'", only "'+(r-i-2)+'" available');if(o<u)throw new Error('"r" specified length of "'+u+'", max of "'+o+'" is acceptable');var d=i;if(i+=u,e[i++]!==Ef)throw new Error('Could not find expected "int" for "s"');var p=e[i++];if(r-i!==p)throw new Error('"s" specified length of "'+p+'", expected "'+(r-i)+'"');if(o<p)throw new Error('"s" specified length of "'+p+'", max of "'+o+'" is acceptable');var f=i;if(i+=p,i!==r)throw new Error('Expected to consume entire buffer, but "'+(r-i)+'" bytes remain');var g=n-u,y=n-p,h=bf.allocUnsafe(g+u+y+p);for(i=0;i<g;++i)h[i]=0;e.copy(h,i,d+Math.max(-g,0),d+u),i=n;for(var _=i;i<_+y;++i)h[i]=0;return e.copy(h,i,f+Math.max(-y,0),f+p),h=h.toString("base64"),h=WF(h),h}a(JF,"derToJose");function ek(e,t,n){for(var o=0;t+o<n&&e[t+o]===0;)++o;var r=e[t+o]>=vf;return r&&--o,o}a(ek,"countPadding");function KF(e,t){e=ok(e);var n=tk(t),o=e.length;if(o!==n*2)throw new TypeError('"'+t+'" signatures must be "'+n*2+'" bytes, saw "'+o+'"');var r=ek(e,0,n),i=ek(e,n,e.length),s=n-r,u=n-i,d=2+s+1+1+u,p=d<vf,f=bf.allocUnsafe((p?2:3)+d),g=0;return f[g++]=nk,p?f[g++]=d:(f[g++]=vf|1,f[g++]=d&255),f[g++]=Ef,f[g++]=s,r<0?(f[g++]=0,g+=e.copy(f,g,0,n)):g+=e.copy(f,g,r,n),f[g++]=Ef,f[g++]=u,i<0?(f[g++]=0,e.copy(f,g,n)):e.copy(f,g,n+i),f}a(KF,"joseToDer");ik.exports={derToJose:JF,joseToDer:KF}});var Wr=B(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.LRUCache=void 0;zn.snakeToCamel=sk;zn.originalOrCamelOptions=eB;zn.removeUndefinedValuesInObject=tB;zn.isValidFile=rB;zn.getWellKnownCertificateConfigFileLocation=nB;var XF=require("fs"),QF=require("os"),yv=require("path"),YF="certificate_config.json",ak="gcloud";function sk(e){return e.replace(/([_][^_])/g,t=>t.slice(1).toUpperCase())}a(sk,"snakeToCamel");function eB(e){function t(n){let o=e||{};return o[n]??o[sk(n)]}return a(t,"get"),{get:t}}a(eB,"originalOrCamelOptions");var _v=class{static{a(this,"LRUCache")}capacity;#e=new Map;maxAge;constructor(t){this.capacity=t.capacity,this.maxAge=t.maxAge}#t(t,n){this.#e.delete(t),this.#e.set(t,{value:n,lastAccessed:Date.now()})}set(t,n){this.#t(t,n),this.#r()}get(t){let n=this.#e.get(t);if(n)return this.#t(t,n.value),this.#r(),n.value}#r(){let t=this.maxAge?Date.now()-this.maxAge:0,n=this.#e.entries().next();for(;!n.done&&(this.#e.size>this.capacity||n.value[1].lastAccessed<t);)this.#e.delete(n.value[0]),n=this.#e.entries().next()}};zn.LRUCache=_v;function tB(e){return Object.entries(e).forEach(([t,n])=>{(n===void 0||n==="undefined")&&delete e[t]}),e}a(tB,"removeUndefinedValuesInObject");async function rB(e){try{return(await XF.promises.lstat(e)).isFile()}catch{return!1}}a(rB,"isValidFile");function nB(){let e=process.env.CLOUDSDK_CONFIG||(oB()?yv.join(process.env.APPDATA||"",ak):yv.join(process.env.HOME||"",".config",ak));return yv.join(e,YF)}a(nB,"getWellKnownCertificateConfigFileLocation");function oB(){return QF.platform().startsWith("win")}a(oB,"_isWindows")});var ck=B((L7,iB)=>{iB.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 bv=B(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.USER_AGENT=ho.PRODUCT_NAME=ho.pkg=void 0;var uk=ck();ho.pkg=uk;var lk="google-api-nodejs-client";ho.PRODUCT_NAME=lk;var aB=`${lk}/${uk.version}`;ho.USER_AGENT=aB});var yr=B(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.AuthClient=Jr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=Jr.DEFAULT_UNIVERSE=void 0;var sB=require("events"),vv=kt(),cB=Wr(),uB=iv(),Ev=bv();Jr.DEFAULT_UNIVERSE="googleapis.com";Jr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS=300*1e3;var Sv=class e extends sB.EventEmitter{static{a(this,"AuthClient")}apiKey;projectId;quotaProjectId;transporter;credentials={};eagerRefreshThresholdMillis=Jr.DEFAULT_EAGER_REFRESH_THRESHOLD_MILLIS;forceRefreshOnFailure=!1;universeDomain=Jr.DEFAULT_UNIVERSE;static RequestMethodNameSymbol=Symbol("request method name");static RequestLogIdSymbol=Symbol("request log id");constructor(t={}){super();let n=(0,cB.originalOrCamelOptions)(t);this.apiKey=t.apiKey,this.projectId=n.get("project_id")??null,this.quotaProjectId=n.get("quota_project_id"),this.credentials=n.get("credentials")??{},this.universeDomain=n.get("universe_domain")??Jr.DEFAULT_UNIVERSE,this.transporter=t.transporter??new vv.Gaxios(t.transporterOptions),n.get("useAuthRequestParameters")!==!1&&(this.transporter.interceptors.request.add(e.DEFAULT_REQUEST_INTERCEPTOR),this.transporter.interceptors.response.add(e.DEFAULT_RESPONSE_INTERCEPTOR)),t.eagerRefreshThresholdMillis&&(this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis),this.forceRefreshOnFailure=t.forceRefreshOnFailure??!1}fetch(...t){let n=t[0],o=t[1],r,i=new Headers;return typeof n=="string"?r=new URL(n):n instanceof URL?r=n:n&&n.url&&(r=new URL(n.url)),n&&typeof n=="object"&&"headers"in n&&vv.Gaxios.mergeHeaders(i,n.headers),o&&vv.Gaxios.mergeHeaders(i,new Headers(o.headers)),typeof n=="object"&&!(n instanceof URL)?this.request({...o,...n,headers:i,url:r}):this.request({...o,headers:i,url:r})}setCredentials(t){this.credentials=t}addSharedMetadataHeaders(t){return!t.has("x-goog-user-project")&&this.quotaProjectId&&t.set("x-goog-user-project",this.quotaProjectId),t}addUserProjectAndAuthHeaders(t,n){let o=n.get("x-goog-user-project"),r=n.get("authorization");return o&&t.set("x-goog-user-project",o),r&&t.set("authorization",r),t}static log=(0,uB.log)("auth");static DEFAULT_REQUEST_INTERCEPTOR={resolved:a(async t=>{if(!t.headers.has("x-goog-api-client")){let o=process.version.replace(/^v/,"");t.headers.set("x-goog-api-client",`gl-node/${o}`)}let n=t.headers.get("User-Agent");n?n.includes(`${Ev.PRODUCT_NAME}/`)||t.headers.set("User-Agent",`${n} ${Ev.USER_AGENT}`):t.headers.set("User-Agent",Ev.USER_AGENT);try{let o=t,r=o[e.RequestMethodNameSymbol],i=`${Math.floor(Math.random()*1e3)}`;o[e.RequestLogIdSymbol]=i;let s={url:t.url,headers:t.headers};r?e.log.info("%s [%s] request %j",r,i,s):e.log.info("[%s] request %j",i,s)}catch{}return t},"resolved")};static DEFAULT_RESPONSE_INTERCEPTOR={resolved:a(async t=>{try{let n=t.config,o=n[e.RequestMethodNameSymbol],r=n[e.RequestLogIdSymbol];o?e.log.info("%s [%s] response %j",o,r,t.data):e.log.info("[%s] response %j",r,t.data)}catch{}return t},"resolved"),rejected:a(async t=>{try{let n=t.config,o=n[e.RequestMethodNameSymbol],r=n[e.RequestLogIdSymbol];o?e.log.info("%s [%s] error %j",o,r,t.response?.data):e.log.error("[%s] error %j",r,t.response?.data)}catch{}throw t},"rejected")};static setMethodName(t,n){try{let o=t;o[e.RequestMethodNameSymbol]=n}catch{}}static get RETRY_CONFIG(){return{retry:!0,retryConfig:{httpMethodsToRetry:["GET","PUT","POST","HEAD","OPTIONS","DELETE"]}}}};Jr.AuthClient=Sv});var xv=B(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.LoginTicket=void 0;var Pv=class{static{a(this,"LoginTicket")}envelope;payload;constructor(t,n){this.envelope=t,this.payload=n}getEnvelope(){return this.envelope}getPayload(){return this.payload}getUserId(){let t=this.getPayload();return t&&t.sub?t.sub:null}getAttributes(){return{envelope:this.getEnvelope(),payload:this.getPayload()}}};Sf.LoginTicket=Pv});var oi=B(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.OAuth2Client=un.ClientAuthentication=un.CertificateFormat=un.CodeChallengeMethod=void 0;var dk=kt(),lB=require("querystring"),dB=require("stream"),pB=gv(),pk=Wr(),Tv=eu(),va=yr(),fB=xv(),fk;(function(e){e.Plain="plain",e.S256="S256"})(fk||(un.CodeChallengeMethod=fk={}));var Nn;(function(e){e.PEM="PEM",e.JWK="JWK"})(Nn||(un.CertificateFormat=Nn={}));var tu;(function(e){e.ClientSecretPost="ClientSecretPost",e.ClientSecretBasic="ClientSecretBasic",e.None="None"})(tu||(un.ClientAuthentication=tu={}));var wv=class e extends va.AuthClient{static{a(this,"OAuth2Client")}redirectUri;certificateCache={};certificateExpiry=null;certificateCacheFormat=Nn.PEM;refreshTokenPromises=new Map;endpoints;issuers;clientAuthentication;_clientId;_clientSecret;refreshHandler;constructor(t={},n,o){super(typeof t=="object"?t:{}),typeof t!="object"&&(t={clientId:t,clientSecret:n,redirectUri:o}),this._clientId=t.clientId||t.client_id,this._clientSecret=t.clientSecret||t.client_secret,this.redirectUri=t.redirectUri||t.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",...t.endpoints},this.clientAuthentication=t.clientAuthentication||tu.ClientSecretPost,this.issuers=t.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(t={}){if(t.code_challenge_method&&!t.code_challenge)throw new Error("If a code_challenge_method is provided, code_challenge must be included.");return t.response_type=t.response_type||"code",t.client_id=t.client_id||this._clientId,t.redirect_uri=t.redirect_uri||this.redirectUri,Array.isArray(t.scope)&&(t.scope=t.scope.join(" ")),this.endpoints.oauth2AuthBaseUrl.toString()+"?"+lB.stringify(t)}generateCodeVerifier(){throw new Error("generateCodeVerifier is removed, please use generateCodeVerifierAsync instead.")}async generateCodeVerifierAsync(){let t=(0,Tv.createCrypto)(),o=t.randomBytesBase64(96).replace(/\+/g,"~").replace(/=/g,"_").replace(/\//g,"-"),i=(await t.sha256DigestBase64(o)).split("=")[0].replace(/\+/g,"-").replace(/\//g,"_");return{codeVerifier:o,codeChallenge:i}}getToken(t,n){let o=typeof t=="string"?{code:t}:t;if(n)this.getTokenAsync(o).then(r=>n(null,r.tokens,r.res),r=>n(r,null,r.response));else return this.getTokenAsync(o)}async getTokenAsync(t){let n=this.endpoints.oauth2TokenUrl.toString(),o=new Headers,r={client_id:t.client_id||this._clientId,code_verifier:t.codeVerifier,code:t.code,grant_type:"authorization_code",redirect_uri:t.redirect_uri||this.redirectUri};if(this.clientAuthentication===tu.ClientSecretBasic){let d=Buffer.from(`${this._clientId}:${this._clientSecret}`);o.set("authorization",`Basic ${d.toString("base64")}`)}this.clientAuthentication===tu.ClientSecretPost&&(r.client_secret=this._clientSecret);let i={...e.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,pk.removeUndefinedValuesInObject)(r)),headers:o};va.AuthClient.setMethodName(i,"getTokenAsync");let s=await this.transporter.request(i),u=s.data;return s.data&&s.data.expires_in&&(u.expiry_date=new Date().getTime()+s.data.expires_in*1e3,delete u.expires_in),this.emit("tokens",u),{tokens:u,res:s}}async refreshToken(t){if(!t)return this.refreshTokenNoCache(t);if(this.refreshTokenPromises.has(t))return this.refreshTokenPromises.get(t);let n=this.refreshTokenNoCache(t).then(o=>(this.refreshTokenPromises.delete(t),o),o=>{throw this.refreshTokenPromises.delete(t),o});return this.refreshTokenPromises.set(t,n),n}async refreshTokenNoCache(t){if(!t)throw new Error("No refresh token is set.");let n=this.endpoints.oauth2TokenUrl.toString(),o={refresh_token:t,client_id:this._clientId,client_secret:this._clientSecret,grant_type:"refresh_token"},r;try{let s={...e.RETRY_CONFIG,method:"POST",url:n,data:new URLSearchParams((0,pk.removeUndefinedValuesInObject)(o))};va.AuthClient.setMethodName(s,"refreshTokenNoCache"),r=await this.transporter.request(s)}catch(s){throw s instanceof dk.GaxiosError&&s.message==="invalid_grant"&&s.response?.data&&/ReAuth/i.test(s.response.data.error_description)&&(s.message=JSON.stringify(s.response.data)),s}let i=r.data;return r.data&&r.data.expires_in&&(i.expiry_date=new Date().getTime()+r.data.expires_in*1e3,delete i.expires_in),this.emit("tokens",i),{tokens:i,res:r}}refreshAccessToken(t){if(t)this.refreshAccessTokenAsync().then(n=>t(null,n.credentials,n.res),t);else return this.refreshAccessTokenAsync()}async refreshAccessTokenAsync(){let t=await this.refreshToken(this.credentials.refresh_token),n=t.tokens;return n.refresh_token=this.credentials.refresh_token,this.credentials=n,{credentials:this.credentials,res:t.res}}getAccessToken(t){if(t)this.getAccessTokenAsync().then(n=>t(null,n.token,n.res),t);else return this.getAccessTokenAsync()}async getAccessTokenAsync(){if(!this.credentials.access_token||this.isTokenExpiring()){if(!this.credentials.refresh_token)if(this.refreshHandler){let o=await this.processAndValidateRefreshHandler();if(o?.access_token)return this.setCredentials(o),{token:this.credentials.access_token}}else throw new Error("No refresh token or refresh handler callback is set.");let n=await this.refreshAccessTokenAsync();if(!n.credentials||n.credentials&&!n.credentials.access_token)throw new Error("Could not refresh access token.");return{token:n.credentials.access_token,res:n.res}}else return{token:this.credentials.access_token}}async getRequestHeaders(t){return(await this.getRequestMetadataAsync(t)).headers}async getRequestMetadataAsync(t){let n=this.credentials;if(!n.access_token&&!n.refresh_token&&!this.apiKey&&!this.refreshHandler)throw new Error("No access, refresh token, API key or refresh handler callback is set.");if(n.access_token&&!this.isTokenExpiring()){n.token_type=n.token_type||"Bearer";let u=new Headers({authorization:n.token_type+" "+n.access_token});return{headers:this.addSharedMetadataHeaders(u)}}if(this.refreshHandler){let u=await this.processAndValidateRefreshHandler();if(u?.access_token){this.setCredentials(u);let d=new Headers({authorization:"Bearer "+this.credentials.access_token});return{headers:this.addSharedMetadataHeaders(d)}}}if(this.apiKey)return{headers:new Headers({"X-Goog-Api-Key":this.apiKey})};let o=null,r=null;try{o=await this.refreshToken(n.refresh_token),r=o.tokens}catch(u){let d=u;throw d.response&&(d.response.status===403||d.response.status===404)&&(d.message=`Could not refresh access token: ${d.message}`),d}let i=this.credentials;i.token_type=i.token_type||"Bearer",r.refresh_token=i.refresh_token,this.credentials=r;let s=new Headers({authorization:i.token_type+" "+r.access_token});return{headers:this.addSharedMetadataHeaders(s),res:o.res}}static getRevokeTokenUrl(t){return new e().getRevokeTokenURL(t).toString()}getRevokeTokenURL(t){let n=new URL(this.endpoints.oauth2RevokeUrl);return n.searchParams.append("token",t),n}revokeToken(t,n){let o={...e.RETRY_CONFIG,url:this.getRevokeTokenURL(t).toString(),method:"POST"};if(va.AuthClient.setMethodName(o,"revokeToken"),n)this.transporter.request(o).then(r=>n(null,r),n);else return this.transporter.request(o)}revokeCredentials(t){if(t)this.revokeCredentialsAsync().then(n=>t(null,n),t);else return this.revokeCredentialsAsync()}async revokeCredentialsAsync(){let t=this.credentials.access_token;if(this.credentials={},t)return this.revokeToken(t);throw new Error("No access token to revoke.")}request(t,n){if(n)this.requestAsync(t).then(o=>n(null,o),o=>n(o,o.response));else return this.requestAsync(t)}async requestAsync(t,n=!1){try{let o=await this.getRequestMetadataAsync();return t.headers=dk.Gaxios.mergeHeaders(t.headers),this.addUserProjectAndAuthHeaders(t.headers,o.headers),this.apiKey&&t.headers.set("X-Goog-Api-Key",this.apiKey),await this.transporter.request(t)}catch(o){let r=o.response;if(r){let i=r.status,s=this.credentials&&this.credentials.access_token&&this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure),u=this.credentials&&this.credentials.access_token&&!this.credentials.refresh_token&&(!this.credentials.expiry_date||this.forceRefreshOnFailure)&&this.refreshHandler,d=r.config.data instanceof dB.Readable,p=i===401||i===403;if(!n&&p&&!d&&s)return await this.refreshAccessTokenAsync(),this.requestAsync(t,!0);if(!n&&p&&!d&&u){let f=await this.processAndValidateRefreshHandler();return f?.access_token&&this.setCredentials(f),this.requestAsync(t,!0)}}throw o}}verifyIdToken(t,n){if(n&&typeof n!="function")throw new Error("This method accepts an options object as the first parameter, which includes the idToken, audience, and maxExpiry.");if(n)this.verifyIdTokenAsync(t).then(o=>n(null,o),n);else return this.verifyIdTokenAsync(t)}async verifyIdTokenAsync(t){if(!t.idToken)throw new Error("The verifyIdToken method requires an ID Token");let n=await this.getFederatedSignonCertsAsync();return await this.verifySignedJwtWithCertsAsync(t.idToken,n.certs,t.audience,this.issuers,t.maxExpiry)}async getTokenInfo(t){let{data:n}=await this.transporter.request({...e.RETRY_CONFIG,method:"POST",headers:{"content-type":"application/x-www-form-urlencoded;charset=UTF-8",authorization:`Bearer ${t}`},url:this.endpoints.tokenInfoUrl.toString()}),o=Object.assign({expiry_date:new Date().getTime()+n.expires_in*1e3,scopes:n.scope.split(" ")},n);return delete o.expires_in,delete o.scope,o}getFederatedSignonCerts(t){if(t)this.getFederatedSignonCertsAsync().then(n=>t(null,n.certs,n.res),t);else return this.getFederatedSignonCertsAsync()}async getFederatedSignonCertsAsync(){let t=new Date().getTime(),n=(0,Tv.hasBrowserCrypto)()?Nn.JWK:Nn.PEM;if(this.certificateExpiry&&t<this.certificateExpiry.getTime()&&this.certificateCacheFormat===n)return{certs:this.certificateCache,format:n};let o,r;switch(n){case Nn.PEM:r=this.endpoints.oauth2FederatedSignonPemCertsUrl.toString();break;case Nn.JWK:r=this.endpoints.oauth2FederatedSignonJwkCertsUrl.toString();break;default:throw new Error(`Unsupported certificate format ${n}`)}try{let p={...e.RETRY_CONFIG,url:r};va.AuthClient.setMethodName(p,"getFederatedSignonCertsAsync"),o=await this.transporter.request(p)}catch(p){throw p instanceof Error&&(p.message=`Failed to retrieve verification certificates: ${p.message}`),p}let i=o?.headers.get("cache-control"),s=-1;if(i){let p=/max-age=(?<maxAge>[0-9]+)/.exec(i)?.groups?.maxAge;p&&(s=Number(p)*1e3)}let u={};switch(n){case Nn.PEM:u=o.data;break;case Nn.JWK:for(let p of o.data.keys)u[p.kid]=p;break;default:throw new Error(`Unsupported certificate format ${n}`)}let d=new Date;return this.certificateExpiry=s===-1?null:new Date(d.getTime()+s),this.certificateCache=u,this.certificateCacheFormat=n,{certs:u,format:n,res:o}}getIapPublicKeys(t){if(t)this.getIapPublicKeysAsync().then(n=>t(null,n.pubkeys,n.res),t);else return this.getIapPublicKeysAsync()}async getIapPublicKeysAsync(){let t,n=this.endpoints.oauth2IapPublicKeyUrl.toString();try{let o={...e.RETRY_CONFIG,url:n};va.AuthClient.setMethodName(o,"getIapPublicKeysAsync"),t=await this.transporter.request(o)}catch(o){throw o instanceof Error&&(o.message=`Failed to retrieve verification certificates: ${o.message}`),o}return{pubkeys:t.data,res:t}}verifySignedJwtWithCerts(){throw new Error("verifySignedJwtWithCerts is removed, please use verifySignedJwtWithCertsAsync instead.")}async verifySignedJwtWithCertsAsync(t,n,o,r,i){let s=(0,Tv.createCrypto)();i||(i=e.DEFAULT_MAX_TOKEN_LIFETIME_SECS_);let u=t.split(".");if(u.length!==3)throw new Error("Wrong number of segments in token: "+t);let d=u[0]+"."+u[1],p=u[2],f,g;try{f=JSON.parse(s.decodeBase64StringUtf8(u[0]))}catch(V){throw V instanceof Error&&(V.message=`Can't parse token envelope: ${u[0]}': ${V.message}`),V}if(!f)throw new Error("Can't parse token envelope: "+u[0]);try{g=JSON.parse(s.decodeBase64StringUtf8(u[1]))}catch(V){throw V instanceof Error&&(V.message=`Can't parse token payload '${u[0]}`),V}if(!g)throw new Error("Can't parse token payload: "+u[1]);if(!Object.prototype.hasOwnProperty.call(n,f.kid))throw new Error("No pem found for envelope: "+JSON.stringify(f));let y=n[f.kid];if(f.alg==="ES256"&&(p=pB.joseToDer(p,"ES256").toString("base64")),!await s.verify(y,d,p))throw new Error("Invalid token signature: "+t);if(!g.iat)throw new Error("No issue time in token: "+JSON.stringify(g));if(!g.exp)throw new Error("No expiration time in token: "+JSON.stringify(g));let _=Number(g.iat);if(isNaN(_))throw new Error("iat field using invalid format");let P=Number(g.exp);if(isNaN(P))throw new Error("exp field using invalid format");let x=new Date().getTime()/1e3;if(P>=x+i)throw new Error("Expiration time too far in future: "+JSON.stringify(g));let S=_-e.CLOCK_SKEW_SECS_,$=P+e.CLOCK_SKEW_SECS_;if(x<S)throw new Error("Token used too early, "+x+" < "+S+": "+JSON.stringify(g));if(x>$)throw new Error("Token used too late, "+x+" > "+$+": "+JSON.stringify(g));if(r&&r.indexOf(g.iss)<0)throw new Error("Invalid issuer, expected one of ["+r+"], but got "+g.iss);if(typeof o<"u"&&o!==null){let V=g.aud,W=!1;if(o.constructor===Array?W=o.indexOf(V)>-1:W=V===o,!W)throw new Error("Wrong recipient, payload audience != requiredAudience")}return new fB.LoginTicket(f,g)}async processAndValidateRefreshHandler(){if(this.refreshHandler){let t=await this.refreshHandler();if(!t.access_token)throw new Error("No access token is returned by the refreshHandler callback.");return t}}isTokenExpiring(){let t=this.credentials.expiry_date;return t?t<=new Date().getTime()+this.eagerRefreshThresholdMillis:!1}};un.OAuth2Client=wv});var Iv=B(Pf=>{"use strict";Object.defineProperty(Pf,"__esModule",{value:!0});Pf.Compute=void 0;var mB=kt(),mk=Yc(),hB=oi(),Av=class extends hB.OAuth2Client{static{a(this,"Compute")}serviceAccountEmail;scopes;constructor(t={}){super(t),this.credentials={expiry_date:1,refresh_token:"compute-placeholder"},this.serviceAccountEmail=t.serviceAccountEmail||"default",this.scopes=Array.isArray(t.scopes)?t.scopes:t.scopes?[t.scopes]:[]}async refreshTokenNoCache(){let t=`service-accounts/${this.serviceAccountEmail}/token`,n;try{let r={property:t};this.scopes.length>0&&(r.params={scopes:this.scopes.join(",")}),n=await mk.instance(r)}catch(r){throw r instanceof mB.GaxiosError&&(r.message=`Could not refresh access token: ${r.message}`,this.wrapError(r)),r}let o=n;return n&&n.expires_in&&(o.expiry_date=new Date().getTime()+n.expires_in*1e3,delete o.expires_in),this.emit("tokens",o),{tokens:o,res:null}}async fetchIdToken(t){let n=`service-accounts/${this.serviceAccountEmail}/identity?format=full&audience=${t}`,o;try{let r={property:n};o=await mk.instance(r)}catch(r){throw r instanceof Error&&(r.message=`Could not fetch ID token: ${r.message}`),r}return o}wrapError(t){let n=t.response;n&&n.status&&(t.status=n.status,n.status===403?t.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: "+t.message:n.status===404&&(t.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: "+t.message))}};Pf.Compute=Av});var Ov=B(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.IdTokenClient=void 0;var gB=oi(),Rv=class extends gB.OAuth2Client{static{a(this,"IdTokenClient")}targetAudience;idTokenProvider;constructor(t){super(t),this.targetAudience=t.targetAudience,this.idTokenProvider=t.idTokenProvider}async getRequestMetadataAsync(){if(!this.credentials.id_token||!this.credentials.expiry_date||this.isTokenExpiring()){let n=await this.idTokenProvider.fetchIdToken(this.targetAudience);this.credentials={id_token:n,expiry_date:this.getIdTokenExpiryDate(n)}}return{headers:new Headers({authorization:"Bearer "+this.credentials.id_token})}}getIdTokenExpiryDate(t){let n=t.split(".")[1];if(n)return JSON.parse(Buffer.from(n,"base64").toString("ascii")).exp*1e3}};xf.IdTokenClient=Rv});var kv=B(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.GCPEnv=void 0;Ea.clear=yB;Ea.getEnv=_B;var hk=Yc(),ln;(function(e){e.APP_ENGINE="APP_ENGINE",e.KUBERNETES_ENGINE="KUBERNETES_ENGINE",e.CLOUD_FUNCTIONS="CLOUD_FUNCTIONS",e.COMPUTE_ENGINE="COMPUTE_ENGINE",e.CLOUD_RUN="CLOUD_RUN",e.CLOUD_RUN_JOBS="CLOUD_RUN_JOBS",e.NONE="NONE"})(ln||(Ea.GCPEnv=ln={}));var ru;function yB(){ru=void 0}a(yB,"clear");async function _B(){return ru||(ru=bB(),ru)}a(_B,"getEnv");async function bB(){let e=ln.NONE;return vB()?e=ln.APP_ENGINE:EB()?e=ln.CLOUD_FUNCTIONS:await TB()?await xB()?e=ln.KUBERNETES_ENGINE:SB()?e=ln.CLOUD_RUN:PB()?e=ln.CLOUD_RUN_JOBS:e=ln.COMPUTE_ENGINE:e=ln.NONE,e}a(bB,"getEnvMemoized");function vB(){return!!(process.env.GAE_SERVICE||process.env.GAE_MODULE_NAME)}a(vB,"isAppEngine");function EB(){return!!(process.env.FUNCTION_NAME||process.env.FUNCTION_TARGET)}a(EB,"isCloudFunction");function SB(){return!!process.env.K_CONFIGURATION}a(SB,"isCloudRun");function PB(){return!!process.env.CLOUD_RUN_JOB}a(PB,"isCloudRunJob");async function xB(){try{return await hk.instance("attributes/cluster-name"),!0}catch{return!1}}a(xB,"isKubernetesEngine");async function TB(){return hk.isAvailable()}a(TB,"isComputeEngine")});var Cv=B((eee,gk)=>{var Tf=ba().Buffer,wB=require("stream"),AB=require("util");function wf(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=Tf.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=Tf.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}a(wf,"DataStream");AB.inherits(wf,wB);wf.prototype.write=a(function(t){this.buffer=Tf.concat([this.buffer,Tf.from(t)]),this.emit("data",t)},"write");wf.prototype.end=a(function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1},"end");gk.exports=wf});var _k=B((ree,yk)=>{"use strict";var nu=require("buffer").Buffer,$v=require("buffer").SlowBuffer;yk.exports=Af;function Af(e,t){if(!nu.isBuffer(e)||!nu.isBuffer(t)||e.length!==t.length)return!1;for(var n=0,o=0;o<e.length;o++)n|=e[o]^t[o];return n===0}a(Af,"bufferEq");Af.install=function(){nu.prototype.equal=$v.prototype.equal=a(function(t){return Af(this,t)},"equal")};var IB=nu.prototype.equal,RB=$v.prototype.equal;Af.restore=function(){nu.prototype.equal=IB,$v.prototype.equal=RB}});var Uv=B((oee,Ak)=>{var Pa=ba().Buffer,Cr=require("crypto"),vk=gv(),bk=require("util"),OB=`"%s" is not a valid algorithm.
|
|
39
39
|
Supported algorithms are:
|
|
40
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,na="secret must be a string or buffer",Ho="key must be a string or a buffer",pk="key must be a string, a buffer or an object",Nd=typeof sr.createPublicKey=="function";Nd&&(Ho+=" or a KeyObject",na+="or a KeyObject");function lE(t){if(!Go.isBuffer(t)&&typeof t!="string"&&(!Nd||typeof t!="object"||typeof t.type!="string"||typeof t.asymmetricKeyType!="string"||typeof t.export!="function"))throw Sr(Ho)}o(lE,"checkIsPublicKey");function dE(t){if(!Go.isBuffer(t)&&typeof t!="string"&&typeof t!="object")throw Sr(pk)}o(dE,"checkIsPrivateKey");function fk(t){if(!Go.isBuffer(t)){if(typeof t=="string")return t;if(!Nd||typeof t!="object"||t.type!=="secret"||typeof t.export!="function")throw Sr(na)}}o(fk,"checkIsSecretKey");function zd(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(zd,"fromBase64");function pE(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(pE,"toBase64");function Sr(t){var e=[].slice.call(arguments,1),r=uE.format.bind(uE,t).apply(null,e);return new TypeError(r)}o(Sr,"typeError");function mk(t){return Go.isBuffer(t)||typeof t=="string"}o(mk,"bufferOrString");function oa(t){return mk(t)||(t=JSON.stringify(t)),t}o(oa,"normalizeInput");function fE(t){return o(function(r,n){fk(n),r=oa(r);var i=sr.createHmac("sha"+t,n),u=(i.update(r),i.digest("base64"));return zd(u)},"sign")}o(fE,"createHmacSigner");var $d,hk="timingSafeEqual"in sr?o(function(e,r){return e.byteLength!==r.byteLength?!1:sr.timingSafeEqual(e,r)},"timingSafeEqual"):o(function(e,r){return $d||($d=sE()),$d(e,r)},"timingSafeEqual");function gk(t){return o(function(r,n,i){var u=fE(t)(r,i);return hk(Go.from(n),Go.from(u))},"verify")}o(gk,"createHmacVerifier");function mE(t){return o(function(r,n){dE(n),r=oa(r);var i=sr.createSign("RSA-SHA"+t),u=(i.update(r),i.sign(n,"base64"));return zd(u)},"sign")}o(mE,"createKeySigner");function hE(t){return o(function(r,n,i){lE(i),r=oa(r),n=pE(n);var u=sr.createVerify("RSA-SHA"+t);return u.update(r),u.verify(i,n,"base64")},"verify")}o(hE,"createKeyVerifier");function yk(t){return o(function(r,n){dE(n),r=oa(r);var i=sr.createSign("RSA-SHA"+t),u=(i.update(r),i.sign({key:n,padding:sr.constants.RSA_PKCS1_PSS_PADDING,saltLength:sr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return zd(u)},"sign")}o(yk,"createPSSKeySigner");function _k(t){return o(function(r,n,i){lE(i),r=oa(r),n=pE(n);var u=sr.createVerify("RSA-SHA"+t);return u.update(r),u.verify({key:i,padding:sr.constants.RSA_PKCS1_PSS_PADDING,saltLength:sr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")},"verify")}o(_k,"createPSSKeyVerifier");function bk(t){var e=mE(t);return o(function(){var n=e.apply(null,arguments);return n=cE.derToJose(n,"ES"+t),n},"sign")}o(bk,"createECDSASigner");function vk(t){var e=hE(t);return o(function(n,i,u){i=cE.joseToDer(i,"ES"+t).toString("base64");var c=e(n,i,u);return c},"verify")}o(vk,"createECDSAVerifer");function Ek(){return o(function(){return""},"sign")}o(Ek,"createNoneSigner");function Sk(){return o(function(e,r){return r===""},"verify")}o(Sk,"createNoneVerifier");gE.exports=o(function(e){var r={hs:fE,rs:mE,ps:yk,es:bk,none:Ek},n={hs:gk,rs:hE,ps:_k,es:vk,none:Sk},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Sr(dk,e);var u=(i[1]||i[3]).toLowerCase(),c=i[2];return{sign:r[u](c),verify:n[u](c)}},"jwa")});var Ud=M((s3,yE)=>{var Pk=require("buffer").Buffer;yE.exports=o(function(e){return typeof e=="string"?e:typeof e=="number"||Pk.isBuffer(e)?e.toString():JSON.stringify(e)},"toString")});var PE=M((c3,SE)=>{var Tk=Bo().Buffer,_E=Od(),wk=Dd(),xk=require("stream"),bE=Ud(),jd=require("util");function vE(t,e){return Tk.from(t,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}o(vE,"base64url");function Ak(t,e,r){r=r||"utf8";var n=vE(bE(t),"binary"),i=vE(bE(e),r);return jd.format("%s.%s",n,i)}o(Ak,"jwsSecuredInput");function EE(t){var e=t.header,r=t.payload,n=t.secret||t.privateKey,i=t.encoding,u=wk(e.alg),c=Ak(e,r,i),l=u.sign(c,n);return jd.format("%s.%s",c,l)}o(EE,"jwsSign");function lu(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 _E(e);this.readable=!0,this.header=t.header,this.encoding=t.encoding,this.secret=this.privateKey=this.key=r,this.payload=new _E(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(lu,"SignStream");jd.inherits(lu,xk);lu.prototype.sign=o(function(){try{var e=EE({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");lu.sign=EE;SE.exports=lu});var $E=M((d3,kE)=>{var wE=Bo().Buffer,TE=Od(),Ik=Dd(),Rk=require("stream"),xE=Ud(),Ck=require("util"),Ok=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function kk(t){return Object.prototype.toString.call(t)==="[object Object]"}o(kk,"isObject");function $k(t){if(kk(t))return t;try{return JSON.parse(t)}catch{return}}o($k,"safeJsonParse");function AE(t){var e=t.split(".",1)[0];return $k(wE.from(e,"base64").toString("binary"))}o(AE,"headerFromJWS");function Nk(t){return t.split(".",2).join(".")}o(Nk,"securedInputFromJWS");function IE(t){return t.split(".")[2]}o(IE,"signatureFromJWS");function zk(t,e){e=e||"utf8";var r=t.split(".")[1];return wE.from(r,"base64").toString(e)}o(zk,"payloadFromJWS");function RE(t){return Ok.test(t)&&!!AE(t)}o(RE,"isValidJws");function CE(t,e,r){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}t=xE(t);var i=IE(t),u=Nk(t),c=Ik(e);return c.verify(u,i,r)}o(CE,"jwsVerify");function OE(t,e){if(e=e||{},t=xE(t),!RE(t))return null;var r=AE(t);if(!r)return null;var n=zk(t);return(r.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:r,payload:n,signature:IE(t)}}o(OE,"jwsDecode");function Wo(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 TE(e);this.readable=!0,this.algorithm=t.algorithm,this.encoding=t.encoding,this.secret=this.publicKey=this.key=r,this.signature=new TE(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(Wo,"VerifyStream");Ck.inherits(Wo,Rk);Wo.prototype.verify=o(function(){try{var e=CE(this.signature.buffer,this.algorithm,this.key.buffer),r=OE(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");Wo.decode=OE;Wo.isValid=RE;Wo.verify=CE;kE.exports=Wo});var Md=M(On=>{var NE=PE(),du=$E(),Dk=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];On.ALGORITHMS=Dk;On.sign=NE.sign;On.verify=du.verify;On.decode=du.decode;On.isValid=du.isValid;On.createSign=o(function(e){return new NE(e)},"createSign");On.createVerify=o(function(e){return new du(e)},"createVerify")});var JE=M(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.GoogleToken=void 0;var zE=pu(require("fs")),Uk=yt(),jk=pu(Md()),Mk=pu(require("path")),Lk=require("util");function pu(t,e){if(typeof WeakMap=="function")var r=new WeakMap,n=new WeakMap;return(pu=o(function(u,c){if(!c&&u&&u.__esModule)return u;var l,p,f={__proto__:null,default:u};if(u===null||an(u)!="object"&&typeof u!="function")return f;if(l=c?n:r){if(l.has(u))return l.get(u);l.set(u,f)}for(var m in u)m!=="default"&&{}.hasOwnProperty.call(u,m)&&((p=(l=Object.defineProperty)&&Object.getOwnPropertyDescriptor(u,m))&&(p.get||p.set)?l(f,m,p):f[m]=u[m]);return f},"_interopRequireWildcard"))(t,e)}o(pu,"_interopRequireWildcard");function an(t){"@babel/helpers - typeof";return an=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},an(t)}o(an,"_typeof");function Fk(t,e){VE(t,e),e.add(t)}o(Fk,"_classPrivateMethodInitSpec");function Bk(t,e,r){VE(t,e),e.set(t,r)}o(Bk,"_classPrivateFieldInitSpec");function VE(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}o(VE,"_checkPrivateRedeclaration");function DE(t,e,r){return t.set(Pr(t,e),r),r}o(DE,"_classPrivateFieldSet");function UE(t,e){return t.get(Pr(t,e))}o(UE,"_classPrivateFieldGet");function Pr(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(Pr,"_assertClassBrand");function jE(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,WE(n.key),n)}}o(jE,"_defineProperties");function HE(t,e,r){return e&&jE(t.prototype,e),r&&jE(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}o(HE,"_createClass");function GE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}o(GE,"_classCallCheck");function qk(t,e,r){return e=ua(e),Vk(t,Hd()?Reflect.construct(e,r||[],ua(t).constructor):e.apply(t,r))}o(qk,"_callSuper");function Vk(t,e){if(e&&(an(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Hk(t)}o(Vk,"_possibleConstructorReturn");function Hk(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}o(Hk,"_assertThisInitialized");function Gk(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(Gk,"_inherits");function Ld(t){var e=typeof Map=="function"?new Map:void 0;return Ld=o(function(n){if(n===null||!Zk(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 Wk(n,arguments,ua(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"),Ld(t)}o(Ld,"_wrapNativeSuper");function Wk(t,e,r){if(Hd())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(Wk,"_construct");function Hd(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hd=o(function(){return!!t},"_isNativeReflectConstruct"))()}o(Hd,"_isNativeReflectConstruct");function Zk(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}o(Zk,"_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 ua(t){return ua=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ua(t)}o(ua,"_getPrototypeOf");function Jt(t,e,r){return(e=WE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}o(Jt,"_defineProperty");function WE(t){var e=Jk(t,"string");return an(e)=="symbol"?e:e+""}o(WE,"_toPropertyKey");function Jk(t,e){if(an(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(an(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}o(Jk,"_toPrimitive");function Qt(){var t,e,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function u(h,_,T,E){var w=_&&_.prototype instanceof l?_:l,k=Object.create(w.prototype);return Kt(k,"_invoke",(function(q,G,V){var H,J,re,Z=0,De=V||[],Se=!1,be={p:0,n:0,v:t,a:$e,f:$e.bind(t,4),d:o(function(Ve,He){return H=Ve,J=0,re=t,be.n=He,c},"d")};function $e(Ie,Ve){for(J=Ie,re=Ve,e=0;!Se&&Z&&!He&&e<De.length;e++){var He,Je=De[e],Ut=be.p,Et=Je[2];Ie>3?(He=Et===Ve)&&(re=Je[(J=Je[4])?5:(J=3,3)],Je[4]=Je[5]=t):Je[0]<=Ut&&((He=Ie<2&&Ut<Je[1])?(J=0,be.v=Ve,be.n=Je[1]):Ut<Et&&(He=Ie<3||Je[0]>Ve||Ve>Et)&&(Je[4]=Ie,Je[5]=Ve,be.n=Et,J=0))}if(He||Ie>1)return c;throw Se=!0,Ve}return o($e,"d"),function(Ie,Ve,He){if(Z>1)throw TypeError("Generator is already running");for(Se&&Ve===1&&$e(Ve,He),J=Ve,re=He;(e=J<2?t:re)||!Se;){H||(J?J<3?(J>1&&(be.n=-1),$e(J,re)):be.n=re:be.v=re);try{if(Z=2,H){if(J||(Ie="next"),e=H[Ie]){if(!(e=e.call(H,re)))throw TypeError("iterator result is not an object");if(!e.done)return e;re=e.value,J<2&&(J=0)}else J===1&&(e=H.return)&&e.call(H),J<2&&(re=TypeError("The iterator does not provide a '"+Ie+"' method"),J=1);H=t}else if((e=(Se=be.n<0)?re:q.call(G,be))!==c)break}catch(Je){H=t,J=1,re=Je}finally{Z=1}}return{value:e,done:Se}}})(h,T,E),!0),k}o(u,"i");var c={};function l(){}o(l,"Generator");function p(){}o(p,"GeneratorFunction");function f(){}o(f,"GeneratorFunctionPrototype"),e=Object.getPrototypeOf;var m=[][n]?e(e([][n]())):(Kt(e={},n,function(){return this}),e),g=f.prototype=l.prototype=Object.create(m);function S(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,f):(h.__proto__=f,Kt(h,i,"GeneratorFunction")),h.prototype=Object.create(g),h}return o(S,"f"),p.prototype=f,Kt(g,"constructor",f),Kt(f,"constructor",p),p.displayName="GeneratorFunction",Kt(f,i,"GeneratorFunction"),Kt(g),Kt(g,i,"Generator"),Kt(g,n,function(){return this}),Kt(g,"toString",function(){return"[object Generator]"}),(Qt=o(function(){return{w:u,m:S}},"_regenerator"))()}o(Qt,"_regenerator");function Kt(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Kt=o(function(c,l,p,f){if(l)i?i(c,l,{value:p,enumerable:!f,configurable:!f,writable:!f}):c[l]=p;else{var m=o(function(S,h){Kt(c,S,function(_){return this._invoke(S,h,_)})},"o");m("next",0),m("throw",1),m("return",2)}},"_regeneratorDefine"),Kt(t,e,r,n)}o(Kt,"_regeneratorDefine2");function ME(t,e,r,n,i,u,c){try{var l=t[u](c),p=l.value}catch(f){return void r(f)}l.done?e(p):Promise.resolve(p).then(n,i)}o(ME,"asyncGeneratorStep");function Zo(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var u=t.apply(e,r);function c(p){ME(u,n,i,c,l,"next",p)}o(c,"_next");function l(p){ME(u,n,i,c,l,"throw",p)}o(l,"_throw"),c(void 0)})}}o(Zo,"_asyncToGenerator");var LE=zE.readFile?(0,Lk.promisify)(zE.readFile):Zo(Qt().m(o(function t(){return Qt().w(function(e){for(;;)switch(e.n){case 0:throw new aa("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return e.a(2)}},t)},"_callee"))),FE="https://oauth2.googleapis.com/token",Kk="https://oauth2.googleapis.com/revoke?token=",aa=(function(t){function e(r,n){var i;return GE(this,e),i=qk(this,e,[r]),Jt(i,"code",void 0),i.code=n,i}return o(e,"ErrorWithCode"),Gk(e,t),HE(e)})(Ld(Error)),ia=new WeakMap,Ur=new WeakSet,h3=fu.GoogleToken=(function(){function t(e){GE(this,t),Fk(this,Ur),Jt(this,"expiresAt",void 0),Jt(this,"key",void 0),Jt(this,"keyFile",void 0),Jt(this,"iss",void 0),Jt(this,"sub",void 0),Jt(this,"scope",void 0),Jt(this,"rawToken",void 0),Jt(this,"tokenExpires",void 0),Jt(this,"email",void 0),Jt(this,"additionalClaims",void 0),Jt(this,"eagerRefreshThresholdMillis",void 0),Jt(this,"transporter",{request:o(function(n){return(0,Uk.request)(n)},"request")}),Bk(this,ia,void 0),Pr(Ur,this,ZE).call(this,e)}return o(t,"GoogleToken"),HE(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(an(r)==="object"&&(n=r,r=void 0),n=Object.assign({forceRefresh:!1},n),r){var i=r;Pr(Ur,this,BE).call(this,n).then(function(u){return i(null,u)},r);return}return Pr(Ur,this,BE).call(this,n)},"getToken")},{key:"getCredentials",value:(function(){var e=Zo(Qt().m(o(function n(i){var u,c,l,p,f,m,g;return Qt().w(function(S){for(;;)switch(S.n){case 0:u=Mk.extname(i),g=u,S.n=g===".json"?1:g===".der"||g===".crt"||g===".pem"?4:g===".p12"||g===".pfx"?6:7;break;case 1:return S.n=2,LE(i,"utf8");case 2:if(c=S.v,l=JSON.parse(c),p=l.private_key,f=l.client_email,!(!p||!f)){S.n=3;break}throw new aa("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return S.a(2,{privateKey:p,clientEmail:f});case 4:return S.n=5,LE(i,"utf8");case 5:return m=S.v,S.a(2,{privateKey:m});case 6:throw new aa("*.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 aa("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return S.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){Pr(Ur,this,qE).call(this).then(function(){return r()},r);return}return Pr(Ur,this,qE).call(this)},"revokeToken")}])})();function BE(t){return Fd.apply(this,arguments)}o(BE,"_getTokenAsync");function Fd(){return Fd=Zo(Qt().m(o(function t(e){return Qt().w(function(r){for(;;)switch(r.n){case 0:if(!(UE(ia,this)&&!e.forceRefresh)){r.n=1;break}return r.a(2,UE(ia,this));case 1:return r.p=1,r.n=2,DE(ia,this,Pr(Ur,this,Qk).call(this,e));case 2:return r.a(2,r.v);case 3:return r.p=3,DE(ia,this,void 0),r.f(3);case 4:return r.a(2)}},t,this,[[1,,3,4]])},"_callee3"))),Fd.apply(this,arguments)}o(Fd,"_getTokenAsync2");function Qk(t){return Bd.apply(this,arguments)}o(Qk,"_getTokenAsyncInner");function Bd(){return Bd=Zo(Qt().m(o(function t(e){var r;return Qt().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||Pr(Ur,this,Yk).call(this);case 4:return n.a(2,Pr(Ur,this,Xk).call(this))}},t,this)},"_callee4"))),Bd.apply(this,arguments)}o(Bd,"_getTokenAsyncInner2");function Yk(){if(!this.iss)throw new aa("email is required.","MISSING_CREDENTIALS")}o(Yk,"_ensureEmail");function qE(){return qd.apply(this,arguments)}o(qE,"_revokeTokenAsync");function qd(){return qd=Zo(Qt().m(o(function t(){var e;return Qt().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=Kk+this.accessToken,r.n=2,this.transporter.request({url:e,retry:!0});case 2:Pr(Ur,this,ZE).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"))),qd.apply(this,arguments)}o(qd,"_revokeTokenAsync2");function ZE(){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,an(t.scope)==="object"?this.scope=t.scope.join(" "):this.scope=t.scope,this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,t.transporter&&(this.transporter=t.transporter)}o(ZE,"_configure");function Xk(){return Vd.apply(this,arguments)}o(Xk,"_requestToken");function Vd(){return Vd=Zo(Qt().m(o(function t(){var e,r,n,i,u,c,l,p,f,m;return Qt().w(function(g){for(;;)switch(g.n){case 0:return e=Math.floor(new Date().getTime()/1e3),r=this.additionalClaims||{},n=Object.assign({iss:this.iss,scope:this.scope,aud:FE,exp:e+3600,iat:e,sub:this.sub},r),i=jk.sign({header:{alg:"RS256"},payload:n,secret:this.key}),g.p=1,g.n=2,this.transporter.request({method:"POST",url:FE,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:i}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return u=g.v,this.rawToken=u.data,this.expiresAt=u.data.expires_in===null||u.data.expires_in===void 0?void 0:(e+u.data.expires_in)*1e3,g.a(2,this.rawToken);case 3:throw g.p=3,m=g.v,this.rawToken=void 0,this.tokenExpires=void 0,p=m.response&&(c=m.response)!==null&&c!==void 0&&c.data?(l=m.response)===null||l===void 0?void 0:l.data:{},p.error&&(f=p.error_description?": ".concat(p.error_description):"",m.message="".concat(p.error).concat(f)),m;case 4:return g.a(2)}},t,this,[[1,3]])},"_callee6"))),Vd.apply(this,arguments)}o(Vd,"_requestToken2")});var Wd=M(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.JWTAccess=void 0;var e0=Md(),t0=vr(),KE={alg:"RS256",typ:"JWT"},Gd=class t{static{o(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new t0.LRUCache({capacity:500,maxAge:3600*1e3});constructor(e,r,n,i){this.email=e,this.key=r,this.keyId=n,this.eagerRefreshThresholdMillis=i??300*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),u=this.cache.get(i),c=Date.now();if(u&&u.expiration-c>this.eagerRefreshThresholdMillis)return new Headers(u.headers);let l=Math.floor(Date.now()/1e3),p=t.getExpirationTime(l),f;if(Array.isArray(n)&&(n=n.join(" ")),n?f={iss:this.email,sub:this.email,scope:n,exp:p,iat:l}:f={iss:this.email,sub:this.email,aud:e,exp:p,iat:l},r){for(let _ in f)if(r[_])throw new Error(`The '${_}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let m=this.keyId?{...KE,kid:this.keyId}:KE,g=Object.assign(f,r),S=e0.sign({header:m,payload:g,secret:this.key}),h=new Headers({authorization:`Bearer ${S}`});return this.cache.set(i,{expiration:p*1e3,headers:h}),h}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",u=>i+=u).on("error",n).on("end",()=>{try{let u=JSON.parse(i);this.fromJSON(u),r()}catch(u){n(u)}})})}};mu.JWTAccess=Gd});var Jd=M(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.JWT=void 0;var QE=JE(),r0=Wd(),n0=eo(),hu=Zt(),Zd=class t extends n0.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!==hu.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==hu.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${hu.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 r0.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!==hu.DEFAULT_UNIVERSE,u=await this.access.getRequestHeaders(e??void 0,this.additionalClaims,i?n:void 0);return{headers:this.addSharedMetadataHeaders(u)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(e):{headers:new Headers}}async fetchIdToken(e){let r=new QE.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 QE.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",u=>i+=u).on("end",()=>{try{let u=JSON.parse(i);this.fromJSON(u),r()}catch(u){n(u)}})})}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.")}};gu.JWT=Zd});var Qd=M(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.UserRefreshClient=Jo.USER_REFRESH_ACCOUNT_TYPE=void 0;var o0=eo(),i0=Zt();Jo.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Kd=class t extends o0.OAuth2Client{static{o(this,"UserRefreshClient")}_refreshToken;constructor(e,r,n,i,u){let c=e&&typeof e=="object"?e:{clientId:e,clientSecret:r,refreshToken:n,eagerRefreshThresholdMillis:i,forceRefreshOnFailure:u};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 i0.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",u=>i+=u).on("end",()=>{try{let u=JSON.parse(i);return this.fromJSON(u),r()}catch(u){return n(u)}})})}static fromJSON(e){let r=new t;return r.fromJSON(e),r}};Jo.UserRefreshClient=Kd});var Xd=M(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.Impersonated=Ko.IMPERSONATED_ACCOUNT_TYPE=void 0;var YE=eo(),a0=yt(),s0=vr();Ko.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Yd=class t extends YE.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 YE.OAuth2Client,this.targetPrincipal=e.targetPrincipal??"",this.delegates=e.delegates??[],this.targetScopes=e.targetScopes??[],this.lifetime=e.lifetime??3600,!!!(0,s0.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"}),u=i.data;return this.credentials.access_token=u.accessToken,this.credentials.expiry_date=Date.parse(u.expireTime),{tokens:this.credentials,res:i}}catch(e){if(!(e instanceof Error))throw e;let r=0,n="";throw e instanceof a0.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`,u={delegates:this.delegates,audience:e,includeEmail:r?.includeEmail??!0,useEmailAzp:r?.includeEmail??!0};return(await this.sourceClient.request({...t.RETRY_CONFIG,url:i,data:u,method:"POST"})).data.token}};Ko.Impersonated=Yd});var tp=M(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.OAuthClientAuthHandler=void 0;ca.getErrorFromOAuthErrorResponse=l0;var Qo=yt(),u0=Xi(),c0=["PUT","POST","PATCH"],ep=class{static{o(this,"OAuthClientAuthHandler")}#e=(0,u0.createCrypto)();#t;transporter;constructor(e){e&&"clientId"in e?(this.#t=e,this.transporter=new Qo.Gaxios):(this.#t=e?.clientAuthentication,this.transporter=e?.transporter||new Qo.Gaxios)}applyClientAuthenticationOptions(e,r){e.headers=Qo.Gaxios.mergeHeaders(e.headers),this.injectAuthenticatedHeaders(e,r),r||this.injectAuthenticatedRequestBody(e)}injectAuthenticatedHeaders(e,r){if(r)e.headers=Qo.Gaxios.mergeHeaders(e.headers,{authorization:`Bearer ${r}`});else if(this.#t?.confidentialClientType==="basic"){e.headers=Qo.Gaxios.mergeHeaders(e.headers);let n=this.#t.clientId,i=this.#t.clientSecret||"",u=this.#e.encodeBase64StringUtf8(`${n}:${i}`);Qo.Gaxios.mergeHeaders(e.headers,{authorization:`Basic ${u}`})}}injectAuthenticatedRequestBody(e){if(this.#t?.confidentialClientType==="request-body"){let r=(e.method||"GET").toUpperCase();if(!c0.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 u=new URLSearchParams(e.data??"");u.append("client_id",this.#t.clientId),u.append("client_secret",this.#t.clientSecret||""),e.data=u}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"]}}}};ca.OAuthClientAuthHandler=ep;function l0(t,e){let r=t.error,n=t.error_description,i=t.error_uri,u=`Error code ${r}`;typeof n<"u"&&(u+=`: ${n}`),typeof i<"u"&&(u+=` - ${i}`);let c=new Error(u);if(e){let l=Object.keys(e);e.stack&&l.push("stack"),l.forEach(p=>{p!=="message"&&Object.defineProperty(c,p,{value:e[p],writable:!1,enumerable:!0})})}return c}o(l0,"getErrorFromOAuthErrorResponse")});var _u=M(yu=>{"use strict";Object.defineProperty(yu,"__esModule",{value:!0});yu.StsCredentials=void 0;var d0=yt(),p0=Zt(),XE=tp(),f0=vr(),rp=class t extends XE.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)},u={...t.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:r,data:new URLSearchParams((0,f0.removeUndefinedValuesInObject)(i))};p0.AuthClient.setMethodName(u,"exchangeToken"),this.applyClientAuthenticationOptions(u);try{let c=await this.transporter.request(u),l=c.data;return l.res=c,l}catch(c){throw c instanceof d0.GaxiosError&&c.response?(0,XE.getErrorFromOAuthErrorResponse)(c.response.data,c):c}}};yu.StsCredentials=rp});var kn=M(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.BaseExternalAccountClient=ur.CLOUD_RESOURCE_MANAGER=ur.EXTERNAL_ACCOUNT_TYPE=ur.EXPIRATION_TIME_OFFSET=void 0;var m0=yt(),h0=require("stream"),np=Zt(),g0=_u(),eS=vr(),y0=_d(),_0="urn:ietf:params:oauth:grant-type:token-exchange",b0="urn:ietf:params:oauth:token-type:access_token",op="https://www.googleapis.com/auth/cloud-platform",v0=3600;ur.EXPIRATION_TIME_OFFSET=300*1e3;ur.EXTERNAL_ACCOUNT_TYPE="external_account";ur.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var E0="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",S0="https://sts.{universeDomain}/v1/token",ip=class t extends np.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,eS.originalOrCamelOptions)(e),n=r.get("type");if(n&&n!==ur.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${ur.EXTERNAL_ACCOUNT_TYPE}" type but received "${e.type}"`);let i=r.get("client_id"),u=r.get("client_secret");this.tokenUrl=r.get("token_url")??S0.replace("{universeDomain}",this.universeDomain);let c=r.get("subject_token_type"),l=r.get("workforce_pool_user_project"),p=r.get("service_account_impersonation_url"),f=r.get("service_account_impersonation"),m=(0,eS.originalOrCamelOptions)(f).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:u}),this.stsCredential=new g0.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=r.get("scopes")||[op],this.cachedAccessToken=null,this.audience=r.get("audience"),this.subjectTokenType=c,this.workforcePoolUserProject=l;let g=new RegExp(E0);if(this.workforcePoolUserProject&&!this.audience.match(g))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=p,this.serviceAccountImpersonationLifetime=m,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=v0),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}`};np.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=m0.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let u=i.response;if(u){let c=u.status,l=u.config.data instanceof h0.Readable;if(!r&&(c===401||c===403)&&!l&&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:_0,audience:this.audience,requestedTokenType:b0,subjectToken:e,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[op]:this.getScopesArray()},n=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,i=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),u=await this.stsCredential.exchangeToken(r,i,n);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(u.access_token):u.expires_in?this.cachedAccessToken={access_token:u.access_token,expiry_date:new Date().getTime()+u.expires_in*1e3,res:u.res}:this.cachedAccessToken={access_token:u.access_token,res:u.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"}};np.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||[op]}getMetricsHeaderValue(){let e=process.version.replace(/^v/,""),r=this.serviceAccountImpersonationUrl!==void 0,n=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${e} auth/${y0.pkg.version} google-byoid-sdk source/${n} sa-impersonation/${r} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};ur.BaseExternalAccountClient=ip});var tS=M(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.FileSubjectTokenSupplier=void 0;var sp=require("util"),up=require("fs"),P0=(0,sp.promisify)(up.readFile??(()=>{})),T0=(0,sp.promisify)(up.realpath??(()=>{})),w0=(0,sp.promisify)(up.lstat??(()=>{})),ap=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 T0(e),!(await w0(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 P0(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=ap});var rS=M(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.UrlSubjectTokenSupplier=void 0;var x0=Zt(),cp=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};x0.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}};vu.UrlSubjectTokenSupplier=cp});var nS=M(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.CertificateSubjectTokenSupplier=Yt.InvalidConfigurationError=Yt.CertificateSourceUnavailableError=Yt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Eu=vr(),Su=require("fs"),Pu=require("crypto"),A0=require("https");Yt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var jr=class extends Error{static{o(this,"CertificateSourceUnavailableError")}constructor(e){super(e),this.name="CertificateSourceUnavailableError"}};Yt.CertificateSourceUnavailableError=jr;var cr=class extends Error{static{o(this,"InvalidConfigurationError")}constructor(e){super(e),this.name="InvalidConfigurationError"}};Yt.InvalidConfigurationError=cr;var lp=class{static{o(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(e){if(!e.useDefaultCertificateConfig&&!e.certificateConfigLocation)throw new cr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(e.useDefaultCertificateConfig&&e.certificateConfigLocation)throw new cr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=e.trustChainPath,this.certificateConfigPath=e.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new cr("Cannot create mTLS Agent with missing certificate or key");return new A0.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,Eu.isValidFile)(e))return e;throw new jr(`Provided certificate config path is invalid: ${e}`)}let r=process.env[Yt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(r){if(await(0,Eu.isValidFile)(r))return r;throw new jr(`Path from environment variable "${Yt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${r}`)}let n=(0,Eu.getWellKnownCertificateConfigFileLocation)();if(await(0,Eu.isValidFile)(n))return n;throw new jr(`Could not find certificate configuration file. Searched override path, the "${Yt.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${n}).`)}async#t(){let e=this.certificateConfigPath,r;try{r=await Su.promises.readFile(e,"utf8")}catch{throw new jr(`Failed to read certificate config file at: ${e}`)}try{let n=JSON.parse(r),i=n?.cert_configs?.workload?.cert_path,u=n?.cert_configs?.workload?.key_path;if(!i||!u)throw new cr(`Certificate config file (${e}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:i,keyPath:u}}catch(n){throw n instanceof cr?n:new cr(`Failed to parse certificate config from ${e}: ${n.message}`)}}async#r(e,r){let n,i;try{n=await Su.promises.readFile(e),new Pu.X509Certificate(n)}catch(u){let c=u instanceof Error?u.message:String(u);throw new jr(`Failed to read certificate file at ${e}: ${c}`)}try{i=await Su.promises.readFile(r),(0,Pu.createPrivateKey)(i)}catch(u){let c=u instanceof Error?u.message:String(u);throw new jr(`Failed to read private key file at ${r}: ${c}`)}return{cert:n,key:i}}async#n(e){let r=new Pu.X509Certificate(e);if(!this.trustChainPath)return JSON.stringify([r.raw.toString("base64")]);try{let u=((await Su.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((p,f)=>{try{return new Pu.X509Certificate(p)}catch(m){let g=m instanceof Error?m.message:String(m);throw new cr(`Failed to parse certificate at index ${f} in trust chain file ${this.trustChainPath}: ${g}`)}}),c=u.findIndex(p=>r.raw.equals(p.raw)),l;if(c===-1)l=[r,...u];else if(c===0)l=u;else throw new cr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${c}).`);return JSON.stringify(l.map(p=>p.raw.toString("base64")))}catch(n){if(n instanceof cr)throw n;let i=n instanceof Error?n.message:String(n);throw new jr(`Failed to process certificate chain from ${this.trustChainPath}: ${i}`)}}};Yt.CertificateSubjectTokenSupplier=lp});var fp=M(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.IdentityPoolClient=void 0;var I0=kn(),dp=vr(),R0=tS(),C0=rS(),oS=nS(),O0=_u(),iS=yt(),pp=class t extends I0.BaseExternalAccountClient{static{o(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(e){super(e);let r=(0,dp.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 u=(0,dp.originalOrCamelOptions)(n),c=(0,dp.originalOrCamelOptions)(u.get("format")),l=c.get("type")||"text",p=c.get("subject_token_field_name");if(l!=="json"&&l!=="text")throw new Error(`Invalid credential_source format "${l}"`);if(l==="json"&&!p)throw new Error("Missing subject_token_field_name for JSON credential_source format");let f=u.get("file"),m=u.get("url"),g=u.get("certificate"),S=u.get("headers");if(f&&m||m&&g||f&&g)throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.');if(f)this.credentialSourceType="file",this.subjectTokenSupplier=new R0.FileSubjectTokenSupplier({filePath:f,formatType:l,subjectTokenFieldName:p});else if(m)this.credentialSourceType="url",this.subjectTokenSupplier=new C0.UrlSubjectTokenSupplier({url:m,formatType:l,subjectTokenFieldName:p,headers:S,additionalGaxiosOptions:t.RETRY_CONFIG});else if(g){this.credentialSourceType="certificate";let h=new oS.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:g.use_default_certificate_config,certificateConfigLocation:g.certificate_config_location,trustChainPath:g.trust_chain_path});this.subjectTokenSupplier=h}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 oS.CertificateSubjectTokenSupplier){let r=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new O0.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new iS.Gaxios({agent:r})}),this.transporter=new iS.Gaxios({...this.transporter.defaults||{},agent:r})}return e}};Tu.IdentityPoolClient=pp});var hp=M(xu=>{"use strict";Object.defineProperty(xu,"__esModule",{value:!0});xu.AwsRequestSigner=void 0;var wu=yt(),sS=Xi(),aS="AWS4-HMAC-SHA256",k0="aws4_request",mp=class{static{o(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(e,r){this.getCredentials=e,this.region=r,this.crypto=(0,sS.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",u=e.body||r,c=e.headers,l=await this.getCredentials(),p=new URL(n);if(typeof u!="string"&&u!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${u}`);let f=await N0({crypto:this.crypto,host:p.host,canonicalUri:p.pathname,canonicalQuerystring:p.search.slice(1),method:i,region:this.region,securityCredentials:l,requestPayload:u,additionalAmzHeaders:c}),m=wu.Gaxios.mergeHeaders(f.amzDate?{"x-amz-date":f.amzDate}:{},{authorization:f.authorizationHeader,host:p.host},c||{});l.token&&wu.Gaxios.mergeHeaders(m,{"x-amz-security-token":l.token});let g={url:n,method:i,headers:m};return u!==void 0&&(g.body=u),g}};xu.AwsRequestSigner=mp;async function la(t,e,r){return await t.signWithHmacSha256(e,r)}o(la,"sign");async function $0(t,e,r,n,i){let u=await la(t,`AWS4${e}`,r),c=await la(t,u,n),l=await la(t,c,i);return await la(t,l,"aws4_request")}o($0,"getSigningKey");async function N0(t){let e=wu.Gaxios.mergeHeaders(t.additionalAmzHeaders),r=t.requestPayload||"",n=t.host.split(".")[0],i=new Date,u=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 l=wu.Gaxios.mergeHeaders({host:t.host},e.has("date")?{}:{"x-amz-date":u},e),p="",f=[...l.keys()].sort();f.forEach(k=>{p+=`${k}:${l.get(k)}
|
|
41
|
-
`});let
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
${g}`,h=`${
|
|
47
|
-
${
|
|
40
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ou="secret must be a string or buffer",Sa="key must be a string or a buffer",kB="key must be a string, a buffer or an object",Nv=typeof Cr.createPublicKey=="function";Nv&&(Sa+=" or a KeyObject",ou+="or a KeyObject");function Ek(e){if(!Pa.isBuffer(e)&&typeof e!="string"&&(!Nv||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Kr(Sa)}a(Ek,"checkIsPublicKey");function Sk(e){if(!Pa.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Kr(kB)}a(Sk,"checkIsPrivateKey");function CB(e){if(!Pa.isBuffer(e)){if(typeof e=="string")return e;if(!Nv||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Kr(ou)}}a(CB,"checkIsSecretKey");function Dv(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(Dv,"fromBase64");function Pk(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var n=0;n<t;++n)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}a(Pk,"toBase64");function Kr(e){var t=[].slice.call(arguments,1),n=bk.format.bind(bk,e).apply(null,t);return new TypeError(n)}a(Kr,"typeError");function $B(e){return Pa.isBuffer(e)||typeof e=="string"}a($B,"bufferOrString");function iu(e){return $B(e)||(e=JSON.stringify(e)),e}a(iu,"normalizeInput");function xk(e){return a(function(n,o){CB(o),n=iu(n);var r=Cr.createHmac("sha"+e,o),i=(r.update(n),r.digest("base64"));return Dv(i)},"sign")}a(xk,"createHmacSigner");var zv,zB="timingSafeEqual"in Cr?a(function(t,n){return t.byteLength!==n.byteLength?!1:Cr.timingSafeEqual(t,n)},"timingSafeEqual"):a(function(t,n){return zv||(zv=_k()),zv(t,n)},"timingSafeEqual");function NB(e){return a(function(n,o,r){var i=xk(e)(n,r);return zB(Pa.from(o),Pa.from(i))},"verify")}a(NB,"createHmacVerifier");function Tk(e){return a(function(n,o){Sk(o),n=iu(n);var r=Cr.createSign("RSA-SHA"+e),i=(r.update(n),r.sign(o,"base64"));return Dv(i)},"sign")}a(Tk,"createKeySigner");function wk(e){return a(function(n,o,r){Ek(r),n=iu(n),o=Pk(o);var i=Cr.createVerify("RSA-SHA"+e);return i.update(n),i.verify(r,o,"base64")},"verify")}a(wk,"createKeyVerifier");function DB(e){return a(function(n,o){Sk(o),n=iu(n);var r=Cr.createSign("RSA-SHA"+e),i=(r.update(n),r.sign({key:o,padding:Cr.constants.RSA_PKCS1_PSS_PADDING,saltLength:Cr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Dv(i)},"sign")}a(DB,"createPSSKeySigner");function UB(e){return a(function(n,o,r){Ek(r),n=iu(n),o=Pk(o);var i=Cr.createVerify("RSA-SHA"+e);return i.update(n),i.verify({key:r,padding:Cr.constants.RSA_PKCS1_PSS_PADDING,saltLength:Cr.constants.RSA_PSS_SALTLEN_DIGEST},o,"base64")},"verify")}a(UB,"createPSSKeyVerifier");function jB(e){var t=Tk(e);return a(function(){var o=t.apply(null,arguments);return o=vk.derToJose(o,"ES"+e),o},"sign")}a(jB,"createECDSASigner");function MB(e){var t=wk(e);return a(function(o,r,i){r=vk.joseToDer(r,"ES"+e).toString("base64");var s=t(o,r,i);return s},"verify")}a(MB,"createECDSAVerifer");function LB(){return a(function(){return""},"sign")}a(LB,"createNoneSigner");function FB(){return a(function(t,n){return n===""},"verify")}a(FB,"createNoneVerifier");Ak.exports=a(function(t){var n={hs:xk,rs:Tk,ps:DB,es:jB,none:LB},o={hs:NB,rs:wk,ps:UB,es:MB,none:FB},r=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!r)throw Kr(OB,t);var i=(r[1]||r[3]).toLowerCase(),s=r[2];return{sign:n[i](s),verify:o[i](s)}},"jwa")});var jv=B((aee,Ik)=>{var BB=require("buffer").Buffer;Ik.exports=a(function(t){return typeof t=="string"?t:typeof t=="number"||BB.isBuffer(t)?t.toString():JSON.stringify(t)},"toString")});var zk=B((cee,$k)=>{var qB=ba().Buffer,Rk=Cv(),VB=Uv(),ZB=require("stream"),Ok=jv(),Mv=require("util");function kk(e,t){return qB.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}a(kk,"base64url");function HB(e,t,n){n=n||"utf8";var o=kk(Ok(e),"binary"),r=kk(Ok(t),n);return Mv.format("%s.%s",o,r)}a(HB,"jwsSecuredInput");function Ck(e){var t=e.header,n=e.payload,o=e.secret||e.privateKey,r=e.encoding,i=VB(t.alg),s=HB(t,n,r),u=i.sign(s,o);return Mv.format("%s.%s",s,u)}a(Ck,"jwsSign");function If(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new Rk(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=n,this.payload=new Rk(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}a(If,"SignStream");Mv.inherits(If,ZB);If.prototype.sign=a(function(){try{var t=Ck({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}},"sign");If.sign=Ck;$k.exports=If});var Vk=B((lee,qk)=>{var Dk=ba().Buffer,Nk=Cv(),GB=Uv(),WB=require("stream"),Uk=jv(),JB=require("util"),KB=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function XB(e){return Object.prototype.toString.call(e)==="[object Object]"}a(XB,"isObject");function QB(e){if(XB(e))return e;try{return JSON.parse(e)}catch{return}}a(QB,"safeJsonParse");function jk(e){var t=e.split(".",1)[0];return QB(Dk.from(t,"base64").toString("binary"))}a(jk,"headerFromJWS");function YB(e){return e.split(".",2).join(".")}a(YB,"securedInputFromJWS");function Mk(e){return e.split(".")[2]}a(Mk,"signatureFromJWS");function e4(e,t){t=t||"utf8";var n=e.split(".")[1];return Dk.from(n,"base64").toString(t)}a(e4,"payloadFromJWS");function Lk(e){return KB.test(e)&&!!jk(e)}a(Lk,"isValidJws");function Fk(e,t,n){if(!t){var o=new Error("Missing algorithm parameter for jws.verify");throw o.code="MISSING_ALGORITHM",o}e=Uk(e);var r=Mk(e),i=YB(e),s=GB(t);return s.verify(i,r,n)}a(Fk,"jwsVerify");function Bk(e,t){if(t=t||{},e=Uk(e),!Lk(e))return null;var n=jk(e);if(!n)return null;var o=e4(e);return(n.typ==="JWT"||t.json)&&(o=JSON.parse(o,t.encoding)),{header:n,payload:o,signature:Mk(e)}}a(Bk,"jwsDecode");function xa(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var n=new Nk(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=n,this.signature=new Nk(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}a(xa,"VerifyStream");JB.inherits(xa,WB);xa.prototype.verify=a(function(){try{var t=Fk(this.signature.buffer,this.algorithm,this.key.buffer),n=Bk(this.signature.buffer,this.encoding);return this.emit("done",t,n),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(o){this.readable=!1,this.emit("error",o),this.emit("close")}},"verify");xa.decode=Bk;xa.isValid=Lk;xa.verify=Fk;qk.exports=xa});var Lv=B(go=>{var Zk=zk(),Rf=Vk(),t4=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];go.ALGORITHMS=t4;go.sign=Zk.sign;go.verify=Rf.verify;go.decode=Rf.decode;go.isValid=Rf.isValid;go.createSign=a(function(t){return new Zk(t)},"createSign");go.createVerify=a(function(t){return new Rf(t)},"createVerify")});var aC=B(kf=>{"use strict";Object.defineProperty(kf,"__esModule",{value:!0});kf.GoogleToken=void 0;var Hk=Of(require("fs")),r4=kt(),n4=Of(Lv()),o4=Of(require("path")),i4=require("util");function Of(e,t){if(typeof WeakMap=="function")var n=new WeakMap,o=new WeakMap;return(Of=a(function(i,s){if(!s&&i&&i.__esModule)return i;var u,d,p={__proto__:null,default:i};if(i===null||Dn(i)!="object"&&typeof i!="function")return p;if(u=s?o:n){if(u.has(i))return u.get(i);u.set(i,p)}for(var f in i)f!=="default"&&{}.hasOwnProperty.call(i,f)&&((d=(u=Object.defineProperty)&&Object.getOwnPropertyDescriptor(i,f))&&(d.get||d.set)?u(p,f,d):p[f]=i[f]);return p},"_interopRequireWildcard"))(e,t)}a(Of,"_interopRequireWildcard");function Dn(e){"@babel/helpers - typeof";return Dn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dn(e)}a(Dn,"_typeof");function a4(e,t){tC(e,t),t.add(e)}a(a4,"_classPrivateMethodInitSpec");function s4(e,t,n){tC(e,t),t.set(e,n)}a(s4,"_classPrivateFieldInitSpec");function tC(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}a(tC,"_checkPrivateRedeclaration");function Gk(e,t,n){return e.set(Xr(e,t),n),n}a(Gk,"_classPrivateFieldSet");function Wk(e,t){return e.get(Xr(e,t))}a(Wk,"_classPrivateFieldGet");function Xr(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}a(Xr,"_assertClassBrand");function Jk(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,oC(o.key),o)}}a(Jk,"_defineProperties");function rC(e,t,n){return t&&Jk(e.prototype,t),n&&Jk(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}a(rC,"_createClass");function nC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}a(nC,"_classCallCheck");function c4(e,t,n){return t=uu(t),u4(e,Hv()?Reflect.construct(t,n||[],uu(e).constructor):t.apply(e,n))}a(c4,"_callSuper");function u4(e,t){if(t&&(Dn(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return l4(e)}a(u4,"_possibleConstructorReturn");function l4(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}a(l4,"_assertThisInitialized");function d4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cu(e,t)}a(d4,"_inherits");function Fv(e){var t=typeof Map=="function"?new Map:void 0;return Fv=a(function(o){if(o===null||!f4(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(o))return t.get(o);t.set(o,r)}function r(){return p4(o,arguments,uu(this).constructor)}return a(r,"Wrapper"),r.prototype=Object.create(o.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),cu(r,o)},"_wrapNativeSuper"),Fv(e)}a(Fv,"_wrapNativeSuper");function p4(e,t,n){if(Hv())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var r=new(e.bind.apply(e,o));return n&&cu(r,n.prototype),r}a(p4,"_construct");function Hv(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Hv=a(function(){return!!e},"_isNativeReflectConstruct"))()}a(Hv,"_isNativeReflectConstruct");function f4(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}a(f4,"_isNativeFunction");function cu(e,t){return cu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},cu(e,t)}a(cu,"_setPrototypeOf");function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},uu(e)}a(uu,"_getPrototypeOf");function _r(e,t,n){return(t=oC(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}a(_r,"_defineProperty");function oC(e){var t=m4(e,"string");return Dn(t)=="symbol"?t:t+""}a(oC,"_toPropertyKey");function m4(e,t){if(Dn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(Dn(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}a(m4,"_toPrimitive");function vr(){var e,t,n=typeof Symbol=="function"?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function i(h,_,P,x){var S=_&&_.prototype instanceof u?_:u,$=Object.create(S.prototype);return br($,"_invoke",(function(V,W,Z){var G,te,ce,Y=0,Ze=Z||[],we=!1,Te={p:0,n:0,v:e,a:Me,f:Me.bind(e,4),d:a(function(Ve,et){return G=Ve,te=0,ce=e,Te.n=et,s},"d")};function Me(je,Ve){for(te=je,ce=Ve,t=0;!we&&Y&&!et&&t<Ze.length;t++){var et,ot=Ze[t],nr=Te.p,Dt=ot[2];je>3?(et=Dt===Ve)&&(ce=ot[(te=ot[4])?5:(te=3,3)],ot[4]=ot[5]=e):ot[0]<=nr&&((et=je<2&&nr<ot[1])?(te=0,Te.v=Ve,Te.n=ot[1]):nr<Dt&&(et=je<3||ot[0]>Ve||Ve>Dt)&&(ot[4]=je,ot[5]=Ve,Te.n=Dt,te=0))}if(et||je>1)return s;throw we=!0,Ve}return a(Me,"d"),function(je,Ve,et){if(Y>1)throw TypeError("Generator is already running");for(we&&Ve===1&&Me(Ve,et),te=Ve,ce=et;(t=te<2?e:ce)||!we;){G||(te?te<3?(te>1&&(Te.n=-1),Me(te,ce)):Te.n=ce:Te.v=ce);try{if(Y=2,G){if(te||(je="next"),t=G[je]){if(!(t=t.call(G,ce)))throw TypeError("iterator result is not an object");if(!t.done)return t;ce=t.value,te<2&&(te=0)}else te===1&&(t=G.return)&&t.call(G),te<2&&(ce=TypeError("The iterator does not provide a '"+je+"' method"),te=1);G=e}else if((t=(we=Te.n<0)?ce:V.call(W,Te))!==s)break}catch(ot){G=e,te=1,ce=ot}finally{Y=1}}return{value:t,done:we}}})(h,P,x),!0),$}a(i,"i");var s={};function u(){}a(u,"Generator");function d(){}a(d,"GeneratorFunction");function p(){}a(p,"GeneratorFunctionPrototype"),t=Object.getPrototypeOf;var f=[][o]?t(t([][o]())):(br(t={},o,function(){return this}),t),g=p.prototype=u.prototype=Object.create(f);function y(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,p):(h.__proto__=p,br(h,r,"GeneratorFunction")),h.prototype=Object.create(g),h}return a(y,"f"),d.prototype=p,br(g,"constructor",p),br(p,"constructor",d),d.displayName="GeneratorFunction",br(p,r,"GeneratorFunction"),br(g),br(g,r,"Generator"),br(g,o,function(){return this}),br(g,"toString",function(){return"[object Generator]"}),(vr=a(function(){return{w:i,m:y}},"_regenerator"))()}a(vr,"_regenerator");function br(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch{r=0}br=a(function(s,u,d,p){if(u)r?r(s,u,{value:d,enumerable:!p,configurable:!p,writable:!p}):s[u]=d;else{var f=a(function(y,h){br(s,y,function(_){return this._invoke(y,h,_)})},"o");f("next",0),f("throw",1),f("return",2)}},"_regeneratorDefine"),br(e,t,n,o)}a(br,"_regeneratorDefine2");function Kk(e,t,n,o,r,i,s){try{var u=e[i](s),d=u.value}catch(p){return void n(p)}u.done?t(d):Promise.resolve(d).then(o,r)}a(Kk,"asyncGeneratorStep");function Ta(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var i=e.apply(t,n);function s(d){Kk(i,o,r,s,u,"next",d)}a(s,"_next");function u(d){Kk(i,o,r,s,u,"throw",d)}a(u,"_throw"),s(void 0)})}}a(Ta,"_asyncToGenerator");var Xk=Hk.readFile?(0,i4.promisify)(Hk.readFile):Ta(vr().m(a(function e(){return vr().w(function(t){for(;;)switch(t.n){case 0:throw new su("use key rather than keyFile.","MISSING_CREDENTIALS");case 1:return t.a(2)}},e)},"_callee"))),Qk="https://oauth2.googleapis.com/token",h4="https://oauth2.googleapis.com/revoke?token=",su=(function(e){function t(n,o){var r;return nC(this,t),r=c4(this,t,[n]),_r(r,"code",void 0),r.code=o,r}return a(t,"ErrorWithCode"),d4(t,e),rC(t)})(Fv(Error)),au=new WeakMap,dn=new WeakSet,mee=kf.GoogleToken=(function(){function e(t){nC(this,e),a4(this,dn),_r(this,"expiresAt",void 0),_r(this,"key",void 0),_r(this,"keyFile",void 0),_r(this,"iss",void 0),_r(this,"sub",void 0),_r(this,"scope",void 0),_r(this,"rawToken",void 0),_r(this,"tokenExpires",void 0),_r(this,"email",void 0),_r(this,"additionalClaims",void 0),_r(this,"eagerRefreshThresholdMillis",void 0),_r(this,"transporter",{request:a(function(o){return(0,r4.request)(o)},"request")}),s4(this,au,void 0),Xr(dn,this,iC).call(this,t)}return a(e,"GoogleToken"),rC(e,[{key:"accessToken",get:a(function(){return this.rawToken?this.rawToken.access_token:void 0},"get")},{key:"idToken",get:a(function(){return this.rawToken?this.rawToken.id_token:void 0},"get")},{key:"tokenType",get:a(function(){return this.rawToken?this.rawToken.token_type:void 0},"get")},{key:"refreshToken",get:a(function(){return this.rawToken?this.rawToken.refresh_token:void 0},"get")},{key:"hasExpired",value:a(function(){var n=new Date().getTime();return this.rawToken&&this.expiresAt?n>=this.expiresAt:!0},"hasExpired")},{key:"isTokenExpiring",value:a(function(){var n,o=new Date().getTime(),r=(n=this.eagerRefreshThresholdMillis)!==null&&n!==void 0?n:0;return this.rawToken&&this.expiresAt?this.expiresAt<=o+r:!0},"isTokenExpiring")},{key:"getToken",value:a(function(n){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Dn(n)==="object"&&(o=n,n=void 0),o=Object.assign({forceRefresh:!1},o),n){var r=n;Xr(dn,this,Yk).call(this,o).then(function(i){return r(null,i)},n);return}return Xr(dn,this,Yk).call(this,o)},"getToken")},{key:"getCredentials",value:(function(){var t=Ta(vr().m(a(function o(r){var i,s,u,d,p,f,g;return vr().w(function(y){for(;;)switch(y.n){case 0:i=o4.extname(r),g=i,y.n=g===".json"?1:g===".der"||g===".crt"||g===".pem"?4:g===".p12"||g===".pfx"?6:7;break;case 1:return y.n=2,Xk(r,"utf8");case 2:if(s=y.v,u=JSON.parse(s),d=u.private_key,p=u.client_email,!(!d||!p)){y.n=3;break}throw new su("private_key and client_email are required.","MISSING_CREDENTIALS");case 3:return y.a(2,{privateKey:d,clientEmail:p});case 4:return y.n=5,Xk(r,"utf8");case 5:return f=y.v,y.a(2,{privateKey:f});case 6:throw new su("*.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 su("Unknown certificate type. Type is determined based on file extension. Current supported extensions are *.json, and *.pem.","UNKNOWN_CERTIFICATE_TYPE");case 8:return y.a(2)}},o)},"_callee2")));function n(o){return t.apply(this,arguments)}return a(n,"getCredentials"),n})()},{key:"revokeToken",value:a(function(n){if(n){Xr(dn,this,eC).call(this).then(function(){return n()},n);return}return Xr(dn,this,eC).call(this)},"revokeToken")}])})();function Yk(e){return Bv.apply(this,arguments)}a(Yk,"_getTokenAsync");function Bv(){return Bv=Ta(vr().m(a(function e(t){return vr().w(function(n){for(;;)switch(n.n){case 0:if(!(Wk(au,this)&&!t.forceRefresh)){n.n=1;break}return n.a(2,Wk(au,this));case 1:return n.p=1,n.n=2,Gk(au,this,Xr(dn,this,g4).call(this,t));case 2:return n.a(2,n.v);case 3:return n.p=3,Gk(au,this,void 0),n.f(3);case 4:return n.a(2)}},e,this,[[1,,3,4]])},"_callee3"))),Bv.apply(this,arguments)}a(Bv,"_getTokenAsync2");function g4(e){return qv.apply(this,arguments)}a(g4,"_getTokenAsyncInner");function qv(){return qv=Ta(vr().m(a(function e(t){var n;return vr().w(function(o){for(;;)switch(o.n){case 0:if(!(this.isTokenExpiring()===!1&&t.forceRefresh===!1)){o.n=1;break}return o.a(2,Promise.resolve(this.rawToken));case 1:if(!(!this.key&&!this.keyFile)){o.n=2;break}throw new Error("No key or keyFile set.");case 2:if(!(!this.key&&this.keyFile)){o.n=4;break}return o.n=3,this.getCredentials(this.keyFile);case 3:n=o.v,this.key=n.privateKey,this.iss=n.clientEmail||this.iss,n.clientEmail||Xr(dn,this,y4).call(this);case 4:return o.a(2,Xr(dn,this,_4).call(this))}},e,this)},"_callee4"))),qv.apply(this,arguments)}a(qv,"_getTokenAsyncInner2");function y4(){if(!this.iss)throw new su("email is required.","MISSING_CREDENTIALS")}a(y4,"_ensureEmail");function eC(){return Vv.apply(this,arguments)}a(eC,"_revokeTokenAsync");function Vv(){return Vv=Ta(vr().m(a(function e(){var t;return vr().w(function(n){for(;;)switch(n.n){case 0:if(this.accessToken){n.n=1;break}throw new Error("No token to revoke.");case 1:return t=h4+this.accessToken,n.n=2,this.transporter.request({url:t,retry:!0});case 2:Xr(dn,this,iC).call(this,{email:this.iss,sub:this.sub,key:this.key,keyFile:this.keyFile,scope:this.scope,additionalClaims:this.additionalClaims});case 3:return n.a(2)}},e,this)},"_callee5"))),Vv.apply(this,arguments)}a(Vv,"_revokeTokenAsync2");function iC(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.keyFile=e.keyFile,this.key=e.key,this.rawToken=void 0,this.iss=e.email||e.iss,this.sub=e.sub,this.additionalClaims=e.additionalClaims,Dn(e.scope)==="object"?this.scope=e.scope.join(" "):this.scope=e.scope,this.eagerRefreshThresholdMillis=e.eagerRefreshThresholdMillis,e.transporter&&(this.transporter=e.transporter)}a(iC,"_configure");function _4(){return Zv.apply(this,arguments)}a(_4,"_requestToken");function Zv(){return Zv=Ta(vr().m(a(function e(){var t,n,o,r,i,s,u,d,p,f;return vr().w(function(g){for(;;)switch(g.n){case 0:return t=Math.floor(new Date().getTime()/1e3),n=this.additionalClaims||{},o=Object.assign({iss:this.iss,scope:this.scope,aud:Qk,exp:t+3600,iat:t,sub:this.sub},n),r=n4.sign({header:{alg:"RS256"},payload:o,secret:this.key}),g.p=1,g.n=2,this.transporter.request({method:"POST",url:Qk,data:new URLSearchParams({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:r}),responseType:"json",retryConfig:{httpMethodsToRetry:["POST"]}});case 2:return i=g.v,this.rawToken=i.data,this.expiresAt=i.data.expires_in===null||i.data.expires_in===void 0?void 0:(t+i.data.expires_in)*1e3,g.a(2,this.rawToken);case 3:throw g.p=3,f=g.v,this.rawToken=void 0,this.tokenExpires=void 0,d=f.response&&(s=f.response)!==null&&s!==void 0&&s.data?(u=f.response)===null||u===void 0?void 0:u.data:{},d.error&&(p=d.error_description?": ".concat(d.error_description):"",f.message="".concat(d.error).concat(p)),f;case 4:return g.a(2)}},e,this,[[1,3]])},"_callee6"))),Zv.apply(this,arguments)}a(Zv,"_requestToken2")});var Wv=B(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});Cf.JWTAccess=void 0;var b4=Lv(),v4=Wr(),sC={alg:"RS256",typ:"JWT"},Gv=class e{static{a(this,"JWTAccess")}email;key;keyId;projectId;eagerRefreshThresholdMillis;cache=new v4.LRUCache({capacity:500,maxAge:3600*1e3});constructor(t,n,o,r){this.email=t,this.key=n,this.keyId=o,this.eagerRefreshThresholdMillis=r??300*1e3}getCachedKey(t,n){let o=t;if(n&&Array.isArray(n)&&n.length?o=t?`${t}_${n.join("_")}`:`${n.join("_")}`:typeof n=="string"&&(o=t?`${t}_${n}`:n),!o)throw Error("Scopes or url must be provided");return o}getRequestHeaders(t,n,o){let r=this.getCachedKey(t,o),i=this.cache.get(r),s=Date.now();if(i&&i.expiration-s>this.eagerRefreshThresholdMillis)return new Headers(i.headers);let u=Math.floor(Date.now()/1e3),d=e.getExpirationTime(u),p;if(Array.isArray(o)&&(o=o.join(" ")),o?p={iss:this.email,sub:this.email,scope:o,exp:d,iat:u}:p={iss:this.email,sub:this.email,aud:t,exp:d,iat:u},n){for(let _ in p)if(n[_])throw new Error(`The '${_}' property is not allowed when passing additionalClaims. This claim is included in the JWT by default.`)}let f=this.keyId?{...sC,kid:this.keyId}:sC,g=Object.assign(p,n),y=b4.sign({header:f,payload:g,secret:this.key}),h=new Headers({authorization:`Bearer ${y}`});return this.cache.set(r,{expiration:d*1e3,headers:h}),h}static getExpirationTime(t){return t+3600}fromJSON(t){if(!t)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!t.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!t.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=t.client_email,this.key=t.private_key,this.keyId=t.private_key_id,this.projectId=t.project_id}fromStream(t,n){if(n)this.fromStreamAsync(t).then(()=>n(),n);else return this.fromStreamAsync(t)}fromStreamAsync(t){return new Promise((n,o)=>{t||o(new Error("Must pass in a stream containing the service account auth settings."));let r="";t.setEncoding("utf8").on("data",i=>r+=i).on("error",o).on("end",()=>{try{let i=JSON.parse(r);this.fromJSON(i),n()}catch(i){o(i)}})})}};Cf.JWTAccess=Gv});var Kv=B(zf=>{"use strict";Object.defineProperty(zf,"__esModule",{value:!0});zf.JWT=void 0;var cC=aC(),E4=Wv(),S4=oi(),$f=yr(),Jv=class e extends S4.OAuth2Client{static{a(this,"JWT")}email;keyFile;key;keyId;defaultScopes;scopes;scope;subject;gtoken;additionalClaims;useJWTAccessWithScope;defaultServicePath;access;constructor(t={}){super(t),this.email=t.email,this.keyFile=t.keyFile,this.key=t.key,this.keyId=t.keyId,this.scopes=t.scopes,this.subject=t.subject,this.additionalClaims=t.additionalClaims,this.credentials={refresh_token:"jwt-placeholder",expiry_date:1}}createScoped(t){let n=new e(this);return n.scopes=t,n}async getRequestMetadataAsync(t){t=this.defaultServicePath?`https://${this.defaultServicePath}/`:t;let n=!this.hasUserScopes()&&t||this.useJWTAccessWithScope&&this.hasAnyScopes()||this.universeDomain!==$f.DEFAULT_UNIVERSE;if(this.subject&&this.universeDomain!==$f.DEFAULT_UNIVERSE)throw new RangeError(`Service Account user is configured for the credential. Domain-wide delegation is not supported in universes other than ${$f.DEFAULT_UNIVERSE}`);if(!this.apiKey&&n)if(this.additionalClaims&&this.additionalClaims.target_audience){let{tokens:o}=await this.refreshToken();return{headers:this.addSharedMetadataHeaders(new Headers({authorization:`Bearer ${o.id_token}`}))}}else{this.access||(this.access=new E4.JWTAccess(this.email,this.key,this.keyId,this.eagerRefreshThresholdMillis));let o;this.hasUserScopes()?o=this.scopes:t||(o=this.defaultScopes);let r=this.useJWTAccessWithScope||this.universeDomain!==$f.DEFAULT_UNIVERSE,i=await this.access.getRequestHeaders(t??void 0,this.additionalClaims,r?o:void 0);return{headers:this.addSharedMetadataHeaders(i)}}else return this.hasAnyScopes()||this.apiKey?super.getRequestMetadataAsync(t):{headers:new Headers}}async fetchIdToken(t){let n=new cC.GoogleToken({iss:this.email,sub:this.subject,scope:this.scopes||this.defaultScopes,keyFile:this.keyFile,key:this.key,additionalClaims:{target_audience:t},transporter:this.transporter});if(await n.getToken({forceRefresh:!0}),!n.idToken)throw new Error("Unknown error: Failed to fetch ID token");return n.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(t){if(t)this.authorizeAsync().then(n=>t(null,n),t);else return this.authorizeAsync()}async authorizeAsync(){let t=await this.refreshToken();if(!t)throw new Error("No result returned");return this.credentials=t.tokens,this.credentials.refresh_token="jwt-placeholder",this.key=this.gtoken.key,this.email=this.gtoken.iss,t.tokens}async refreshTokenNoCache(){let t=this.createGToken(),o={access_token:(await t.getToken({forceRefresh:this.isTokenExpiring()})).access_token,token_type:"Bearer",expiry_date:t.expiresAt,id_token:t.idToken};return this.emit("tokens",o),{res:null,tokens:o}}createGToken(){return this.gtoken||(this.gtoken=new cC.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(t){if(!t)throw new Error("Must pass in a JSON object containing the service account auth settings.");if(!t.client_email)throw new Error("The incoming JSON object does not contain a client_email field");if(!t.private_key)throw new Error("The incoming JSON object does not contain a private_key field");this.email=t.client_email,this.key=t.private_key,this.keyId=t.private_key_id,this.projectId=t.project_id,this.quotaProjectId=t.quota_project_id,this.universeDomain=t.universe_domain||this.universeDomain}fromStream(t,n){if(n)this.fromStreamAsync(t).then(()=>n(),n);else return this.fromStreamAsync(t)}fromStreamAsync(t){return new Promise((n,o)=>{if(!t)throw new Error("Must pass in a stream containing the service account auth settings.");let r="";t.setEncoding("utf8").on("error",o).on("data",i=>r+=i).on("end",()=>{try{let i=JSON.parse(r);this.fromJSON(i),n()}catch(i){o(i)}})})}fromAPIKey(t){if(typeof t!="string")throw new Error("Must provide an API Key string.");this.apiKey=t}async getCredentials(){if(this.key)return{private_key:this.key,client_email:this.email};if(this.keyFile){let n=await this.createGToken().getCredentials(this.keyFile);return{private_key:n.privateKey,client_email:n.clientEmail}}throw new Error("A key or a keyFile must be provided to getCredentials.")}};zf.JWT=Jv});var Qv=B(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.UserRefreshClient=wa.USER_REFRESH_ACCOUNT_TYPE=void 0;var P4=oi(),x4=yr();wa.USER_REFRESH_ACCOUNT_TYPE="authorized_user";var Xv=class e extends P4.OAuth2Client{static{a(this,"UserRefreshClient")}_refreshToken;constructor(t,n,o,r,i){let s=t&&typeof t=="object"?t:{clientId:t,clientSecret:n,refreshToken:o,eagerRefreshThresholdMillis:r,forceRefreshOnFailure:i};super(s),this._refreshToken=s.refreshToken,this.credentials.refresh_token=s.refreshToken}async refreshTokenNoCache(){return super.refreshTokenNoCache(this._refreshToken)}async fetchIdToken(t){let n={...e.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:t})};return x4.AuthClient.setMethodName(n,"fetchIdToken"),(await this.transporter.request(n)).data.id_token}fromJSON(t){if(!t)throw new Error("Must pass in a JSON object containing the user refresh token");if(t.type!=="authorized_user")throw new Error('The incoming JSON object does not have the "authorized_user" type');if(!t.client_id)throw new Error("The incoming JSON object does not contain a client_id field");if(!t.client_secret)throw new Error("The incoming JSON object does not contain a client_secret field");if(!t.refresh_token)throw new Error("The incoming JSON object does not contain a refresh_token field");this._clientId=t.client_id,this._clientSecret=t.client_secret,this._refreshToken=t.refresh_token,this.credentials.refresh_token=t.refresh_token,this.quotaProjectId=t.quota_project_id,this.universeDomain=t.universe_domain||this.universeDomain}fromStream(t,n){if(n)this.fromStreamAsync(t).then(()=>n(),n);else return this.fromStreamAsync(t)}async fromStreamAsync(t){return new Promise((n,o)=>{if(!t)return o(new Error("Must pass in a stream containing the user refresh token."));let r="";t.setEncoding("utf8").on("error",o).on("data",i=>r+=i).on("end",()=>{try{let i=JSON.parse(r);return this.fromJSON(i),n()}catch(i){return o(i)}})})}static fromJSON(t){let n=new e;return n.fromJSON(t),n}};wa.UserRefreshClient=Xv});var eE=B(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.Impersonated=Aa.IMPERSONATED_ACCOUNT_TYPE=void 0;var uC=oi(),T4=kt(),w4=Wr();Aa.IMPERSONATED_ACCOUNT_TYPE="impersonated_service_account";var Yv=class e extends uC.OAuth2Client{static{a(this,"Impersonated")}sourceClient;targetPrincipal;targetScopes;delegates;lifetime;endpoint;constructor(t={}){if(super(t),this.credentials={expiry_date:1,refresh_token:"impersonated-placeholder"},this.sourceClient=t.sourceClient??new uC.OAuth2Client,this.targetPrincipal=t.targetPrincipal??"",this.delegates=t.delegates??[],this.targetScopes=t.targetScopes??[],this.lifetime=t.lifetime??3600,!!!(0,w4.originalOrCamelOptions)(t).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=t.endpoint??`https://iamcredentials.${this.universeDomain}`}async sign(t){await this.sourceClient.getAccessToken();let n=`projects/-/serviceAccounts/${this.targetPrincipal}`,o=`${this.endpoint}/v1/${n}:signBlob`,r={delegates:this.delegates,payload:Buffer.from(t).toString("base64")};return(await this.sourceClient.request({...e.RETRY_CONFIG,url:o,data:r,method:"POST"})).data}getTargetPrincipal(){return this.targetPrincipal}async refreshToken(){try{await this.sourceClient.getAccessToken();let t="projects/-/serviceAccounts/"+this.targetPrincipal,n=`${this.endpoint}/v1/${t}:generateAccessToken`,o={delegates:this.delegates,scope:this.targetScopes,lifetime:this.lifetime+"s"},r=await this.sourceClient.request({...e.RETRY_CONFIG,url:n,data:o,method:"POST"}),i=r.data;return this.credentials.access_token=i.accessToken,this.credentials.expiry_date=Date.parse(i.expireTime),{tokens:this.credentials,res:r}}catch(t){if(!(t instanceof Error))throw t;let n=0,o="";throw t instanceof T4.GaxiosError&&(n=t?.response?.data?.error?.status,o=t?.response?.data?.error?.message),n&&o?(t.message=`${n}: unable to impersonate: ${o}`,t):(t.message=`unable to impersonate: ${t}`,t)}}async fetchIdToken(t,n){await this.sourceClient.getAccessToken();let o=`projects/-/serviceAccounts/${this.targetPrincipal}`,r=`${this.endpoint}/v1/${o}:generateIdToken`,i={delegates:this.delegates,audience:t,includeEmail:n?.includeEmail??!0,useEmailAzp:n?.includeEmail??!0};return(await this.sourceClient.request({...e.RETRY_CONFIG,url:r,data:i,method:"POST"})).data.token}};Aa.Impersonated=Yv});var rE=B(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.OAuthClientAuthHandler=void 0;lu.getErrorFromOAuthErrorResponse=R4;var Ia=kt(),A4=eu(),I4=["PUT","POST","PATCH"],tE=class{static{a(this,"OAuthClientAuthHandler")}#e=(0,A4.createCrypto)();#t;transporter;constructor(t){t&&"clientId"in t?(this.#t=t,this.transporter=new Ia.Gaxios):(this.#t=t?.clientAuthentication,this.transporter=t?.transporter||new Ia.Gaxios)}applyClientAuthenticationOptions(t,n){t.headers=Ia.Gaxios.mergeHeaders(t.headers),this.injectAuthenticatedHeaders(t,n),n||this.injectAuthenticatedRequestBody(t)}injectAuthenticatedHeaders(t,n){if(n)t.headers=Ia.Gaxios.mergeHeaders(t.headers,{authorization:`Bearer ${n}`});else if(this.#t?.confidentialClientType==="basic"){t.headers=Ia.Gaxios.mergeHeaders(t.headers);let o=this.#t.clientId,r=this.#t.clientSecret||"",i=this.#e.encodeBase64StringUtf8(`${o}:${r}`);Ia.Gaxios.mergeHeaders(t.headers,{authorization:`Basic ${i}`})}}injectAuthenticatedRequestBody(t){if(this.#t?.confidentialClientType==="request-body"){let n=(t.method||"GET").toUpperCase();if(!I4.includes(n))throw new Error(`${n} HTTP method does not support ${this.#t.confidentialClientType} client authentication`);let r=new Headers(t.headers).get("content-type");if(r?.startsWith("application/x-www-form-urlencoded")||t.data instanceof URLSearchParams){let i=new URLSearchParams(t.data??"");i.append("client_id",this.#t.clientId),i.append("client_secret",this.#t.clientSecret||""),t.data=i}else if(r?.startsWith("application/json"))t.data=t.data||{},Object.assign(t.data,{client_id:this.#t.clientId,client_secret:this.#t.clientSecret||""});else throw new Error(`${r} 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"]}}}};lu.OAuthClientAuthHandler=tE;function R4(e,t){let n=e.error,o=e.error_description,r=e.error_uri,i=`Error code ${n}`;typeof o<"u"&&(i+=`: ${o}`),typeof r<"u"&&(i+=` - ${r}`);let s=new Error(i);if(t){let u=Object.keys(t);t.stack&&u.push("stack"),u.forEach(d=>{d!=="message"&&Object.defineProperty(s,d,{value:t[d],writable:!1,enumerable:!0})})}return s}a(R4,"getErrorFromOAuthErrorResponse")});var Df=B(Nf=>{"use strict";Object.defineProperty(Nf,"__esModule",{value:!0});Nf.StsCredentials=void 0;var O4=kt(),k4=yr(),lC=rE(),C4=Wr(),nE=class e extends lC.OAuthClientAuthHandler{static{a(this,"StsCredentials")}#e;constructor(t={tokenExchangeEndpoint:""},n){(typeof t!="object"||t instanceof URL)&&(t={tokenExchangeEndpoint:t,clientAuthentication:n}),super(t),this.#e=t.tokenExchangeEndpoint}async exchangeToken(t,n,o){let r={grant_type:t.grantType,resource:t.resource,audience:t.audience,scope:t.scope?.join(" "),requested_token_type:t.requestedTokenType,subject_token:t.subjectToken,subject_token_type:t.subjectTokenType,actor_token:t.actingParty?.actorToken,actor_token_type:t.actingParty?.actorTokenType,options:o&&JSON.stringify(o)},i={...e.RETRY_CONFIG,url:this.#e.toString(),method:"POST",headers:n,data:new URLSearchParams((0,C4.removeUndefinedValuesInObject)(r))};k4.AuthClient.setMethodName(i,"exchangeToken"),this.applyClientAuthenticationOptions(i);try{let s=await this.transporter.request(i),u=s.data;return u.res=s,u}catch(s){throw s instanceof O4.GaxiosError&&s.response?(0,lC.getErrorFromOAuthErrorResponse)(s.response.data,s):s}}};Nf.StsCredentials=nE});var yo=B($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.BaseExternalAccountClient=$r.CLOUD_RESOURCE_MANAGER=$r.EXTERNAL_ACCOUNT_TYPE=$r.EXPIRATION_TIME_OFFSET=void 0;var $4=kt(),z4=require("stream"),oE=yr(),N4=Df(),dC=Wr(),D4=bv(),U4="urn:ietf:params:oauth:grant-type:token-exchange",j4="urn:ietf:params:oauth:token-type:access_token",iE="https://www.googleapis.com/auth/cloud-platform",M4=3600;$r.EXPIRATION_TIME_OFFSET=300*1e3;$r.EXTERNAL_ACCOUNT_TYPE="external_account";$r.CLOUD_RESOURCE_MANAGER="https://cloudresourcemanager.googleapis.com/v1/projects/";var L4="//iam\\.googleapis\\.com/locations/[^/]+/workforcePools/[^/]+/providers/.+",F4="https://sts.{universeDomain}/v1/token",aE=class e extends oE.AuthClient{static{a(this,"BaseExternalAccountClient")}scopes;projectNumber;audience;subjectTokenType;stsCredential;clientAuth;credentialSourceType;cachedAccessToken;serviceAccountImpersonationUrl;serviceAccountImpersonationLifetime;workforcePoolUserProject;configLifetimeRequested;tokenUrl;cloudResourceManagerURL;supplierContext;#e=null;constructor(t){super(t);let n=(0,dC.originalOrCamelOptions)(t),o=n.get("type");if(o&&o!==$r.EXTERNAL_ACCOUNT_TYPE)throw new Error(`Expected "${$r.EXTERNAL_ACCOUNT_TYPE}" type but received "${t.type}"`);let r=n.get("client_id"),i=n.get("client_secret");this.tokenUrl=n.get("token_url")??F4.replace("{universeDomain}",this.universeDomain);let s=n.get("subject_token_type"),u=n.get("workforce_pool_user_project"),d=n.get("service_account_impersonation_url"),p=n.get("service_account_impersonation"),f=(0,dC.originalOrCamelOptions)(p).get("token_lifetime_seconds");this.cloudResourceManagerURL=new URL(n.get("cloud_resource_manager_url")||`https://cloudresourcemanager.${this.universeDomain}/v1/projects/`),r&&(this.clientAuth={confidentialClientType:"basic",clientId:r,clientSecret:i}),this.stsCredential=new N4.StsCredentials({tokenExchangeEndpoint:this.tokenUrl,clientAuthentication:this.clientAuth}),this.scopes=n.get("scopes")||[iE],this.cachedAccessToken=null,this.audience=n.get("audience"),this.subjectTokenType=s,this.workforcePoolUserProject=u;let g=new RegExp(L4);if(this.workforcePoolUserProject&&!this.audience.match(g))throw new Error("workforcePoolUserProject should not be set for non-workforce pool credentials.");this.serviceAccountImpersonationUrl=d,this.serviceAccountImpersonationLifetime=f,this.serviceAccountImpersonationLifetime?this.configLifetimeRequested=!0:(this.configLifetimeRequested=!1,this.serviceAccountImpersonationLifetime=M4),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(t){super.setCredentials(t),this.cachedAccessToken=t}async getAccessToken(){return(!this.cachedAccessToken||this.isExpired(this.cachedAccessToken))&&await this.refreshAccessTokenAsync(),{token:this.cachedAccessToken.access_token,res:this.cachedAccessToken.res}}async getRequestHeaders(){let t=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${t.token}`});return this.addSharedMetadataHeaders(n)}request(t,n){if(n)this.requestAsync(t).then(o=>n(null,o),o=>n(o,o.response));else return this.requestAsync(t)}async getProjectId(){let t=this.projectNumber||this.workforcePoolUserProject;if(this.projectId)return this.projectId;if(t){let n=await this.getRequestHeaders(),o={...e.RETRY_CONFIG,headers:n,url:`${this.cloudResourceManagerURL.toString()}${t}`};oE.AuthClient.setMethodName(o,"getProjectId");let r=await this.transporter.request(o);return this.projectId=r.data.projectId,this.projectId}return null}async requestAsync(t,n=!1){let o;try{let r=await this.getRequestHeaders();t.headers=$4.Gaxios.mergeHeaders(t.headers),this.addUserProjectAndAuthHeaders(t.headers,r),o=await this.transporter.request(t)}catch(r){let i=r.response;if(i){let s=i.status,u=i.config.data instanceof z4.Readable;if(!n&&(s===401||s===403)&&!u&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(t,!0)}throw r}return o}async refreshAccessTokenAsync(){this.#e=this.#e||this.#t();try{return await this.#e}finally{this.#e=null}}async#t(){let t=await this.retrieveSubjectToken(),n={grantType:U4,audience:this.audience,requestedTokenType:j4,subjectToken:t,subjectTokenType:this.subjectTokenType,scope:this.serviceAccountImpersonationUrl?[iE]:this.getScopesArray()},o=!this.clientAuth&&this.workforcePoolUserProject?{userProject:this.workforcePoolUserProject}:void 0,r=new Headers({"x-goog-api-client":this.getMetricsHeaderValue()}),i=await this.stsCredential.exchangeToken(n,r,o);return this.serviceAccountImpersonationUrl?this.cachedAccessToken=await this.getImpersonatedAccessToken(i.access_token):i.expires_in?this.cachedAccessToken={access_token:i.access_token,expiry_date:new Date().getTime()+i.expires_in*1e3,res:i.res}:this.cachedAccessToken={access_token:i.access_token,res:i.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(t){let n=t.match(/\/projects\/([^/]+)/);return n?n[1]:null}async getImpersonatedAccessToken(t){let n={...e.RETRY_CONFIG,url:this.serviceAccountImpersonationUrl,method:"POST",headers:{"content-type":"application/json",authorization:`Bearer ${t}`},data:{scope:this.getScopesArray(),lifetime:this.serviceAccountImpersonationLifetime+"s"}};oE.AuthClient.setMethodName(n,"getImpersonatedAccessToken");let o=await this.transporter.request(n),r=o.data;return{access_token:r.accessToken,expiry_date:new Date(r.expireTime).getTime(),res:o}}isExpired(t){let n=new Date().getTime();return t.expiry_date?n>=t.expiry_date-this.eagerRefreshThresholdMillis:!1}getScopesArray(){return typeof this.scopes=="string"?[this.scopes]:this.scopes||[iE]}getMetricsHeaderValue(){let t=process.version.replace(/^v/,""),n=this.serviceAccountImpersonationUrl!==void 0,o=this.credentialSourceType?this.credentialSourceType:"unknown";return`gl-node/${t} auth/${D4.pkg.version} google-byoid-sdk source/${o} sa-impersonation/${n} config-lifetime/${this.configLifetimeRequested}`}getTokenUrl(){return this.tokenUrl}};$r.BaseExternalAccountClient=aE});var pC=B(Uf=>{"use strict";Object.defineProperty(Uf,"__esModule",{value:!0});Uf.FileSubjectTokenSupplier=void 0;var cE=require("util"),uE=require("fs"),B4=(0,cE.promisify)(uE.readFile??(()=>{})),q4=(0,cE.promisify)(uE.realpath??(()=>{})),V4=(0,cE.promisify)(uE.lstat??(()=>{})),sE=class{static{a(this,"FileSubjectTokenSupplier")}filePath;formatType;subjectTokenFieldName;constructor(t){this.filePath=t.filePath,this.formatType=t.formatType,this.subjectTokenFieldName=t.subjectTokenFieldName}async getSubjectToken(){let t=this.filePath;try{if(t=await q4(t),!(await V4(t)).isFile())throw new Error}catch(r){throw r instanceof Error&&(r.message=`The file at ${t} does not exist, or it is not a file. ${r.message}`),r}let n,o=await B4(t,{encoding:"utf8"});if(this.formatType==="text"?n=o:this.formatType==="json"&&this.subjectTokenFieldName&&(n=JSON.parse(o)[this.subjectTokenFieldName]),!n)throw new Error("Unable to parse the subject_token from the credential_source file");return n}};Uf.FileSubjectTokenSupplier=sE});var fC=B(jf=>{"use strict";Object.defineProperty(jf,"__esModule",{value:!0});jf.UrlSubjectTokenSupplier=void 0;var Z4=yr(),lE=class{static{a(this,"UrlSubjectTokenSupplier")}url;headers;formatType;subjectTokenFieldName;additionalGaxiosOptions;constructor(t){this.url=t.url,this.formatType=t.formatType,this.subjectTokenFieldName=t.subjectTokenFieldName,this.headers=t.headers,this.additionalGaxiosOptions=t.additionalGaxiosOptions}async getSubjectToken(t){let n={...this.additionalGaxiosOptions,url:this.url,method:"GET",headers:this.headers};Z4.AuthClient.setMethodName(n,"getSubjectToken");let o;if(this.formatType==="text"?o=(await t.transporter.request(n)).data:this.formatType==="json"&&this.subjectTokenFieldName&&(o=(await t.transporter.request(n)).data[this.subjectTokenFieldName]),!o)throw new Error("Unable to parse the subject_token from the credential_source URL");return o}};jf.UrlSubjectTokenSupplier=lE});var mC=B(Er=>{"use strict";Object.defineProperty(Er,"__esModule",{value:!0});Er.CertificateSubjectTokenSupplier=Er.InvalidConfigurationError=Er.CertificateSourceUnavailableError=Er.CERTIFICATE_CONFIGURATION_ENV_VARIABLE=void 0;var Mf=Wr(),Lf=require("fs"),Ff=require("crypto"),H4=require("https");Er.CERTIFICATE_CONFIGURATION_ENV_VARIABLE="GOOGLE_API_CERTIFICATE_CONFIG";var pn=class extends Error{static{a(this,"CertificateSourceUnavailableError")}constructor(t){super(t),this.name="CertificateSourceUnavailableError"}};Er.CertificateSourceUnavailableError=pn;var zr=class extends Error{static{a(this,"InvalidConfigurationError")}constructor(t){super(t),this.name="InvalidConfigurationError"}};Er.InvalidConfigurationError=zr;var dE=class{static{a(this,"CertificateSubjectTokenSupplier")}certificateConfigPath;trustChainPath;cert;key;constructor(t){if(!t.useDefaultCertificateConfig&&!t.certificateConfigLocation)throw new zr("Either `useDefaultCertificateConfig` must be true or a `certificateConfigLocation` must be provided.");if(t.useDefaultCertificateConfig&&t.certificateConfigLocation)throw new zr("Both `useDefaultCertificateConfig` and `certificateConfigLocation` cannot be provided.");this.trustChainPath=t.trustChainPath,this.certificateConfigPath=t.certificateConfigLocation??""}async createMtlsHttpsAgent(){if(!this.key||!this.cert)throw new zr("Cannot create mTLS Agent with missing certificate or key");return new H4.Agent({key:this.key,cert:this.cert})}async getSubjectToken(){this.certificateConfigPath=await this.#e();let{certPath:t,keyPath:n}=await this.#t();return{cert:this.cert,key:this.key}=await this.#r(t,n),await this.#n(this.cert)}async#e(){let t=this.certificateConfigPath;if(t){if(await(0,Mf.isValidFile)(t))return t;throw new pn(`Provided certificate config path is invalid: ${t}`)}let n=process.env[Er.CERTIFICATE_CONFIGURATION_ENV_VARIABLE];if(n){if(await(0,Mf.isValidFile)(n))return n;throw new pn(`Path from environment variable "${Er.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" is invalid: ${n}`)}let o=(0,Mf.getWellKnownCertificateConfigFileLocation)();if(await(0,Mf.isValidFile)(o))return o;throw new pn(`Could not find certificate configuration file. Searched override path, the "${Er.CERTIFICATE_CONFIGURATION_ENV_VARIABLE}" env var, and the gcloud path (${o}).`)}async#t(){let t=this.certificateConfigPath,n;try{n=await Lf.promises.readFile(t,"utf8")}catch{throw new pn(`Failed to read certificate config file at: ${t}`)}try{let o=JSON.parse(n),r=o?.cert_configs?.workload?.cert_path,i=o?.cert_configs?.workload?.key_path;if(!r||!i)throw new zr(`Certificate config file (${t}) is missing required "cert_path" or "key_path" in the workload config.`);return{certPath:r,keyPath:i}}catch(o){throw o instanceof zr?o:new zr(`Failed to parse certificate config from ${t}: ${o.message}`)}}async#r(t,n){let o,r;try{o=await Lf.promises.readFile(t),new Ff.X509Certificate(o)}catch(i){let s=i instanceof Error?i.message:String(i);throw new pn(`Failed to read certificate file at ${t}: ${s}`)}try{r=await Lf.promises.readFile(n),(0,Ff.createPrivateKey)(r)}catch(i){let s=i instanceof Error?i.message:String(i);throw new pn(`Failed to read private key file at ${n}: ${s}`)}return{cert:o,key:r}}async#n(t){let n=new Ff.X509Certificate(t);if(!this.trustChainPath)return JSON.stringify([n.raw.toString("base64")]);try{let i=((await Lf.promises.readFile(this.trustChainPath,"utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g)??[]).map((d,p)=>{try{return new Ff.X509Certificate(d)}catch(f){let g=f instanceof Error?f.message:String(f);throw new zr(`Failed to parse certificate at index ${p} in trust chain file ${this.trustChainPath}: ${g}`)}}),s=i.findIndex(d=>n.raw.equals(d.raw)),u;if(s===-1)u=[n,...i];else if(s===0)u=i;else throw new zr(`Leaf certificate exists in the trust chain but is not the first entry (found at index ${s}).`);return JSON.stringify(u.map(d=>d.raw.toString("base64")))}catch(o){if(o instanceof zr)throw o;let r=o instanceof Error?o.message:String(o);throw new pn(`Failed to process certificate chain from ${this.trustChainPath}: ${r}`)}}};Er.CertificateSubjectTokenSupplier=dE});var mE=B(Bf=>{"use strict";Object.defineProperty(Bf,"__esModule",{value:!0});Bf.IdentityPoolClient=void 0;var G4=yo(),pE=Wr(),W4=pC(),J4=fC(),hC=mC(),K4=Df(),gC=kt(),fE=class e extends G4.BaseExternalAccountClient{static{a(this,"IdentityPoolClient")}subjectTokenSupplier;constructor(t){super(t);let n=(0,pE.originalOrCamelOptions)(t),o=n.get("credential_source"),r=n.get("subject_token_supplier");if(!o&&!r)throw new Error("A credential source or subject token supplier must be specified.");if(o&&r)throw new Error("Only one of credential source or subject token supplier can be specified.");if(r)this.subjectTokenSupplier=r,this.credentialSourceType="programmatic";else{let i=(0,pE.originalOrCamelOptions)(o),s=(0,pE.originalOrCamelOptions)(i.get("format")),u=s.get("type")||"text",d=s.get("subject_token_field_name");if(u!=="json"&&u!=="text")throw new Error(`Invalid credential_source format "${u}"`);if(u==="json"&&!d)throw new Error("Missing subject_token_field_name for JSON credential_source format");let p=i.get("file"),f=i.get("url"),g=i.get("certificate"),y=i.get("headers");if(p&&f||f&&g||p&&g)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 W4.FileSubjectTokenSupplier({filePath:p,formatType:u,subjectTokenFieldName:d});else if(f)this.credentialSourceType="url",this.subjectTokenSupplier=new J4.UrlSubjectTokenSupplier({url:f,formatType:u,subjectTokenFieldName:d,headers:y,additionalGaxiosOptions:e.RETRY_CONFIG});else if(g){this.credentialSourceType="certificate";let h=new hC.CertificateSubjectTokenSupplier({useDefaultCertificateConfig:g.use_default_certificate_config,certificateConfigLocation:g.certificate_config_location,trustChainPath:g.trust_chain_path});this.subjectTokenSupplier=h}else throw new Error('No valid Identity Pool "credential_source" provided, must be either file, url, or certificate.')}}async retrieveSubjectToken(){let t=await this.subjectTokenSupplier.getSubjectToken(this.supplierContext);if(this.subjectTokenSupplier instanceof hC.CertificateSubjectTokenSupplier){let n=await this.subjectTokenSupplier.createMtlsHttpsAgent();this.stsCredential=new K4.StsCredentials({tokenExchangeEndpoint:this.getTokenUrl(),clientAuthentication:this.clientAuth,transporter:new gC.Gaxios({agent:n})}),this.transporter=new gC.Gaxios({...this.transporter.defaults||{},agent:n})}return t}};Bf.IdentityPoolClient=fE});var gE=B(Vf=>{"use strict";Object.defineProperty(Vf,"__esModule",{value:!0});Vf.AwsRequestSigner=void 0;var qf=kt(),_C=eu(),yC="AWS4-HMAC-SHA256",X4="aws4_request",hE=class{static{a(this,"AwsRequestSigner")}getCredentials;region;crypto;constructor(t,n){this.getCredentials=t,this.region=n,this.crypto=(0,_C.createCrypto)()}async getRequestOptions(t){if(!t.url)throw new RangeError('"url" is required in "amzOptions"');let n=typeof t.data=="object"?JSON.stringify(t.data):t.data,o=t.url,r=t.method||"GET",i=t.body||n,s=t.headers,u=await this.getCredentials(),d=new URL(o);if(typeof i!="string"&&i!==void 0)throw new TypeError(`'requestPayload' is expected to be a string if provided. Got: ${i}`);let p=await Y4({crypto:this.crypto,host:d.host,canonicalUri:d.pathname,canonicalQuerystring:d.search.slice(1),method:r,region:this.region,securityCredentials:u,requestPayload:i,additionalAmzHeaders:s}),f=qf.Gaxios.mergeHeaders(p.amzDate?{"x-amz-date":p.amzDate}:{},{authorization:p.authorizationHeader,host:d.host},s||{});u.token&&qf.Gaxios.mergeHeaders(f,{"x-amz-security-token":u.token});let g={url:o,method:r,headers:f};return i!==void 0&&(g.body=i),g}};Vf.AwsRequestSigner=hE;async function du(e,t,n){return await e.signWithHmacSha256(t,n)}a(du,"sign");async function Q4(e,t,n,o,r){let i=await du(e,`AWS4${t}`,n),s=await du(e,i,o),u=await du(e,s,r);return await du(e,u,"aws4_request")}a(Q4,"getSigningKey");async function Y4(e){let t=qf.Gaxios.mergeHeaders(e.additionalAmzHeaders),n=e.requestPayload||"",o=e.host.split(".")[0],r=new Date,i=r.toISOString().replace(/[-:]/g,"").replace(/\.[0-9]+/,""),s=r.toISOString().replace(/[-]/g,"").replace(/T.*/,"");e.securityCredentials.token&&t.set("x-amz-security-token",e.securityCredentials.token);let u=qf.Gaxios.mergeHeaders({host:e.host},t.has("date")?{}:{"x-amz-date":i},t),d="",p=[...u.keys()].sort();p.forEach($=>{d+=`${$}:${u.get($)}
|
|
41
|
+
`});let f=p.join(";"),g=await e.crypto.sha256DigestHex(n),y=`${e.method.toUpperCase()}
|
|
42
|
+
${e.canonicalUri}
|
|
43
|
+
${e.canonicalQuerystring}
|
|
44
|
+
${d}
|
|
45
|
+
${f}
|
|
46
|
+
${g}`,h=`${s}/${e.region}/${o}/${X4}`,_=`${yC}
|
|
47
|
+
${i}
|
|
48
48
|
${h}
|
|
49
|
-
`+await t.crypto.sha256DigestHex(S),T=await $0(t.crypto,t.securityCredentials.secretAccessKey,c,t.region,n),E=await la(t.crypto,T,_),w=`${aS} Credential=${t.securityCredentials.accessKeyId}/${h}, SignedHeaders=${m}, Signature=${(0,sS.fromArrayBufferToHex)(E)}`;return{amzDate:e.has("date")?void 0:u,authorizationHeader:w,canonicalQuerystring:t.canonicalQuerystring}}o(N0,"generateAuthenticationHeaderMap")});var uS=M(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.DefaultAwsSecurityCredentialsSupplier=void 0;var Au=Zt(),gp=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};Au.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 Au.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 Au.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 Au.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}};Iu.DefaultAwsSecurityCredentialsSupplier=gp});var _p=M(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.AwsClient=void 0;var z0=hp(),D0=kn(),U0=uS(),cS=vr(),j0=yt(),yp=class t extends D0.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,cS.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 u=(0,cS.originalOrCamelOptions)(n);this.environmentId=u.get("environment_id");let c=u.get("region_url"),l=u.get("url"),p=u.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new U0.DefaultAwsSecurityCredentialsSupplier({regionUrl:c,securityCredentialsUrl:l,imdsV2SessionTokenUrl:p}),this.regionalCredVerificationUrl=u.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 z0.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 j0.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},e.headers).forEach((i,u)=>r.push({key:u,value:i})),encodeURIComponent(JSON.stringify({url:e.url,method:e.method,headers:r}))}};Ru.AwsClient=yp});var Pp=M(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.InvalidSubjectTokenError=it.InvalidMessageFieldError=it.InvalidCodeFieldError=it.InvalidTokenTypeFieldError=it.InvalidExpirationTimeFieldError=it.InvalidSuccessFieldError=it.InvalidVersionFieldError=it.ExecutableResponseError=it.ExecutableResponse=void 0;var Cu="urn:ietf:params:oauth:token-type:saml2",bp="urn:ietf:params:oauth:token-type:id_token",vp="urn:ietf:params:oauth:token-type:jwt",Ep=class{static{o(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(e){if(!e.version)throw new Ou("Executable response must contain a 'version' field.");if(e.success===void 0)throw new ku("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!==Cu&&this.tokenType!==bp&&this.tokenType!==vp)throw new $u(`Executable response must contain a 'token_type' field when successful and it must be one of ${bp}, ${vp}, or ${Cu}.`);if(this.tokenType===Cu){if(!e.saml_response)throw new da(`Executable response must contain a 'saml_response' field when token_type=${Cu}.`);this.subjectToken=e.saml_response}else{if(!e.id_token)throw new da(`Executable response must contain a 'id_token' field when token_type=${bp} or ${vp}.`);this.subjectToken=e.id_token}}else{if(!e.code)throw new Nu("Executable response must contain a 'code' field when unsuccessful.");if(!e.message)throw new zu("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)}};it.ExecutableResponse=Ep;var Mr=class extends Error{static{o(this,"ExecutableResponseError")}constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype)}};it.ExecutableResponseError=Mr;var Ou=class extends Mr{static{o(this,"InvalidVersionFieldError")}};it.InvalidVersionFieldError=Ou;var ku=class extends Mr{static{o(this,"InvalidSuccessFieldError")}};it.InvalidSuccessFieldError=ku;var Sp=class extends Mr{static{o(this,"InvalidExpirationTimeFieldError")}};it.InvalidExpirationTimeFieldError=Sp;var $u=class extends Mr{static{o(this,"InvalidTokenTypeFieldError")}};it.InvalidTokenTypeFieldError=$u;var Nu=class extends Mr{static{o(this,"InvalidCodeFieldError")}};it.InvalidCodeFieldError=Nu;var zu=class extends Mr{static{o(this,"InvalidMessageFieldError")}};it.InvalidMessageFieldError=zu;var da=class extends Mr{static{o(this,"InvalidSubjectTokenError")}};it.InvalidSubjectTokenError=da});var xp=M(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.PluggableAuthHandler=Yo.ExecutableError=void 0;var to=Pp(),M0=require("child_process"),Tp=require("fs"),Du=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)}};Yo.ExecutableError=Du;var wp=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=M0.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(e)}}),u="";i.stdout.on("data",l=>{u+=l}),i.stderr.on("data",l=>{u+=l});let c=setTimeout(()=>(i.removeAllListeners(),i.kill(),n(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);i.on("close",l=>{if(clearTimeout(c),l===0)try{let p=JSON.parse(u),f=new to.ExecutableResponse(p);return r(f)}catch(p){return p instanceof to.ExecutableResponseError?n(p):n(new to.ExecutableResponseError(`The executable returned an invalid response: ${u}`))}else return n(new Du(u,l.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let e;try{e=await Tp.promises.realpath(this.outputFile)}catch{return}if(!(await Tp.promises.lstat(e)).isFile())return;let r=await Tp.promises.readFile(e,{encoding:"utf8"});if(r!=="")try{let n=JSON.parse(r);return new to.ExecutableResponse(n).isValid()?new to.ExecutableResponse(n):void 0}catch(n){throw n instanceof to.ExecutableResponseError?n:new to.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}};Yo.PluggableAuthHandler=wp});var Ip=M(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.PluggableAuthClient=Xo.ExecutableError=void 0;var L0=kn(),F0=Pp(),lS=xp(),B0=xp();Object.defineProperty(Xo,"ExecutableError",{enumerable:!0,get:o(function(){return B0.ExecutableError},"get")});var q0=30*1e3,dS=5*1e3,pS=120*1e3,V0="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",fS=1,Ap=class extends L0.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=q0;else if(this.timeoutMillis=e.credential_source.executable.timeout_millis,this.timeoutMillis<dS||this.timeoutMillis>pS)throw new Error(`Timeout must be between ${dS} and ${pS} milliseconds.`);this.outputFile=e.credential_source.executable.output_file,this.handler=new lS.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[V0]!=="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>fS)throw new Error(`Version of executable is not currently supported, maximum supported version is ${fS}.`);if(!e.success)throw new lS.ExecutableError(e.errorMessage,e.errorCode);if(this.outputFile&&!e.expirationTime)throw new F0.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}};Xo.PluggableAuthClient=Ap});var Cp=M(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.ExternalAccountClient=void 0;var H0=kn(),G0=fp(),W0=_p(),Z0=Ip(),Rp=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===H0.EXTERNAL_ACCOUNT_TYPE?e.credential_source?.environment_id?new W0.AwsClient(e):e.credential_source?.executable?new Z0.PluggableAuthClient(e):new G0.IdentityPoolClient(e):null}};Uu.ExternalAccountClient=Rp});var $p=M(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.ExternalAccountAuthorizedUserClient=ei.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var hS=Zt(),mS=tp(),gS=yt(),J0=require("stream"),K0=kn();ei.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var Q0="https://sts.{universeDomain}/v1/oauthtoken",Op=class t extends mS.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})};hS.AuthClient.setMethodName(n,"refreshToken"),this.applyClientAuthenticationOptions(n);try{let i=await this.transporter.request(n),u=i.data;return u.res=i,u}catch(i){throw i instanceof gS.GaxiosError&&i.response?(0,mS.getErrorFromOAuthErrorResponse)(i.response.data,i):i}}},kp=class extends hS.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 Op({tokenRefreshEndpoint:e.token_url??Q0.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:r}),this.cachedAccessToken=null,this.quotaProjectId=e.quota_project_id,typeof e?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=K0.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=gS.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let u=i.response;if(u){let c=u.status,l=u.config.data instanceof J0.Readable;if(!r&&(c===401||c===403)&&!l&&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}};ei.ExternalAccountAuthorizedUserClient=kp});var vS=M(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.GoogleAuth=Tr.GoogleAuthExceptionMessages=void 0;var Y0=require("child_process"),pa=require("fs"),X0=yt(),fa=Yi(),e$=require("os"),Np=require("path"),t$=Xi(),r$=Ad(),n$=Rd(),o$=Cd(),ti=Jd(),yS=Qd(),ri=Xd(),i$=Cp(),ma=kn(),zp=Zt(),_S=$p(),bS=vr();Tr.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.
|
|
49
|
+
`+await e.crypto.sha256DigestHex(y),P=await Q4(e.crypto,e.securityCredentials.secretAccessKey,s,e.region,o),x=await du(e.crypto,P,_),S=`${yC} Credential=${e.securityCredentials.accessKeyId}/${h}, SignedHeaders=${f}, Signature=${(0,_C.fromArrayBufferToHex)(x)}`;return{amzDate:t.has("date")?void 0:i,authorizationHeader:S,canonicalQuerystring:e.canonicalQuerystring}}a(Y4,"generateAuthenticationHeaderMap")});var bC=B(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});Hf.DefaultAwsSecurityCredentialsSupplier=void 0;var Zf=yr(),yE=class{static{a(this,"DefaultAwsSecurityCredentialsSupplier")}regionUrl;securityCredentialsUrl;imdsV2SessionTokenUrl;additionalGaxiosOptions;constructor(t){this.regionUrl=t.regionUrl,this.securityCredentialsUrl=t.securityCredentialsUrl,this.imdsV2SessionTokenUrl=t.imdsV2SessionTokenUrl,this.additionalGaxiosOptions=t.additionalGaxiosOptions}async getAwsRegion(t){if(this.#n)return this.#n;let n=new Headers;if(!this.#n&&this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(t.transporter)),!this.regionUrl)throw new RangeError('Unable to determine AWS region due to missing "options.credential_source.region_url"');let o={...this.additionalGaxiosOptions,url:this.regionUrl,method:"GET",headers:n};Zf.AuthClient.setMethodName(o,"getAwsRegion");let r=await t.transporter.request(o);return r.data.substr(0,r.data.length-1)}async getAwsSecurityCredentials(t){if(this.#o)return this.#o;let n=new Headers;this.imdsV2SessionTokenUrl&&n.set("x-aws-ec2-metadata-token",await this.#e(t.transporter));let o=await this.#t(n,t.transporter),r=await this.#r(o,n,t.transporter);return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,token:r.Token}}async#e(t){let n={...this.additionalGaxiosOptions,url:this.imdsV2SessionTokenUrl,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"300"}};return Zf.AuthClient.setMethodName(n,"#getImdsV2SessionToken"),(await t.request(n)).data}async#t(t,n){if(!this.securityCredentialsUrl)throw new Error('Unable to determine AWS role name due to missing "options.credential_source.url"');let o={...this.additionalGaxiosOptions,url:this.securityCredentialsUrl,method:"GET",headers:t};return Zf.AuthClient.setMethodName(o,"#getAwsRoleName"),(await n.request(o)).data}async#r(t,n,o){let r={...this.additionalGaxiosOptions,url:`${this.securityCredentialsUrl}/${t}`,headers:n};return Zf.AuthClient.setMethodName(r,"#retrieveAwsSecurityCredentials"),(await o.request(r)).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}};Hf.DefaultAwsSecurityCredentialsSupplier=yE});var bE=B(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.AwsClient=void 0;var e6=gE(),t6=yo(),r6=bC(),vC=Wr(),n6=kt(),_E=class e extends t6.BaseExternalAccountClient{static{a(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(t){super(t);let n=(0,vC.originalOrCamelOptions)(t),o=n.get("credential_source"),r=n.get("aws_security_credentials_supplier");if(!o&&!r)throw new Error("A credential source or AWS security credentials supplier must be specified.");if(o&&r)throw new Error("Only one of credential source or AWS security credentials supplier can be specified.");if(r)this.awsSecurityCredentialsSupplier=r,this.regionalCredVerificationUrl=e.#e,this.credentialSourceType="programmatic";else{let i=(0,vC.originalOrCamelOptions)(o);this.environmentId=i.get("environment_id");let s=i.get("region_url"),u=i.get("url"),d=i.get("imdsv2_session_token_url");this.awsSecurityCredentialsSupplier=new r6.DefaultAwsSecurityCredentialsSupplier({regionUrl:s,securityCredentialsUrl:u,imdsV2SessionTokenUrl:d}),this.regionalCredVerificationUrl=i.get("regional_cred_verification_url"),this.credentialSourceType="aws",this.validateEnvironmentId()}this.awsRequestSigner=null,this.region=""}validateEnvironmentId(){let t=this.environmentId?.match(/^(aws)(\d+)$/);if(!t||!this.regionalCredVerificationUrl)throw new Error('No valid AWS "credential_source" provided');if(parseInt(t[2],10)!==1)throw new Error(`aws version "${t[2]}" is not supported in the current build.`)}async retrieveSubjectToken(){this.awsRequestSigner||(this.region=await this.awsSecurityCredentialsSupplier.getAwsRegion(this.supplierContext),this.awsRequestSigner=new e6.AwsRequestSigner(async()=>this.awsSecurityCredentialsSupplier.getAwsSecurityCredentials(this.supplierContext),this.region));let t=await this.awsRequestSigner.getRequestOptions({...e.RETRY_CONFIG,url:this.regionalCredVerificationUrl.replace("{region}",this.region),method:"POST"}),n=[];return n6.Gaxios.mergeHeaders({"x-goog-cloud-target-resource":this.audience},t.headers).forEach((r,i)=>n.push({key:i,value:r})),encodeURIComponent(JSON.stringify({url:t.url,method:t.method,headers:n}))}};Gf.AwsClient=_E});var xE=B(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.InvalidSubjectTokenError=ft.InvalidMessageFieldError=ft.InvalidCodeFieldError=ft.InvalidTokenTypeFieldError=ft.InvalidExpirationTimeFieldError=ft.InvalidSuccessFieldError=ft.InvalidVersionFieldError=ft.ExecutableResponseError=ft.ExecutableResponse=void 0;var Wf="urn:ietf:params:oauth:token-type:saml2",vE="urn:ietf:params:oauth:token-type:id_token",EE="urn:ietf:params:oauth:token-type:jwt",SE=class{static{a(this,"ExecutableResponse")}version;success;expirationTime;tokenType;errorCode;errorMessage;subjectToken;constructor(t){if(!t.version)throw new Jf("Executable response must contain a 'version' field.");if(t.success===void 0)throw new Kf("Executable response must contain a 'success' field.");if(this.version=t.version,this.success=t.success,this.success){if(this.expirationTime=t.expiration_time,this.tokenType=t.token_type,this.tokenType!==Wf&&this.tokenType!==vE&&this.tokenType!==EE)throw new Xf(`Executable response must contain a 'token_type' field when successful and it must be one of ${vE}, ${EE}, or ${Wf}.`);if(this.tokenType===Wf){if(!t.saml_response)throw new pu(`Executable response must contain a 'saml_response' field when token_type=${Wf}.`);this.subjectToken=t.saml_response}else{if(!t.id_token)throw new pu(`Executable response must contain a 'id_token' field when token_type=${vE} or ${EE}.`);this.subjectToken=t.id_token}}else{if(!t.code)throw new Qf("Executable response must contain a 'code' field when unsuccessful.");if(!t.message)throw new Yf("Executable response must contain a 'message' field when unsuccessful.");this.errorCode=t.code,this.errorMessage=t.message}}isValid(){return!this.isExpired()&&this.success}isExpired(){return this.expirationTime!==void 0&&this.expirationTime<Math.round(Date.now()/1e3)}};ft.ExecutableResponse=SE;var fn=class extends Error{static{a(this,"ExecutableResponseError")}constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}};ft.ExecutableResponseError=fn;var Jf=class extends fn{static{a(this,"InvalidVersionFieldError")}};ft.InvalidVersionFieldError=Jf;var Kf=class extends fn{static{a(this,"InvalidSuccessFieldError")}};ft.InvalidSuccessFieldError=Kf;var PE=class extends fn{static{a(this,"InvalidExpirationTimeFieldError")}};ft.InvalidExpirationTimeFieldError=PE;var Xf=class extends fn{static{a(this,"InvalidTokenTypeFieldError")}};ft.InvalidTokenTypeFieldError=Xf;var Qf=class extends fn{static{a(this,"InvalidCodeFieldError")}};ft.InvalidCodeFieldError=Qf;var Yf=class extends fn{static{a(this,"InvalidMessageFieldError")}};ft.InvalidMessageFieldError=Yf;var pu=class extends fn{static{a(this,"InvalidSubjectTokenError")}};ft.InvalidSubjectTokenError=pu});var AE=B(Ra=>{"use strict";Object.defineProperty(Ra,"__esModule",{value:!0});Ra.PluggableAuthHandler=Ra.ExecutableError=void 0;var ii=xE(),o6=require("child_process"),TE=require("fs"),em=class extends Error{static{a(this,"ExecutableError")}code;constructor(t,n){super(`The executable failed with exit code: ${n} and error message: ${t}.`),this.code=n,Object.setPrototypeOf(this,new.target.prototype)}};Ra.ExecutableError=em;var wE=class e{static{a(this,"PluggableAuthHandler")}commandComponents;timeoutMillis;outputFile;constructor(t){if(!t.command)throw new Error("No command provided.");if(this.commandComponents=e.parseCommand(t.command),this.timeoutMillis=t.timeoutMillis,!this.timeoutMillis)throw new Error("No timeoutMillis provided.");this.outputFile=t.outputFile}retrieveResponseFromExecutable(t){return new Promise((n,o)=>{let r=o6.spawn(this.commandComponents[0],this.commandComponents.slice(1),{env:{...process.env,...Object.fromEntries(t)}}),i="";r.stdout.on("data",u=>{i+=u}),r.stderr.on("data",u=>{i+=u});let s=setTimeout(()=>(r.removeAllListeners(),r.kill(),o(new Error("The executable failed to finish within the timeout specified."))),this.timeoutMillis);r.on("close",u=>{if(clearTimeout(s),u===0)try{let d=JSON.parse(i),p=new ii.ExecutableResponse(d);return n(p)}catch(d){return d instanceof ii.ExecutableResponseError?o(d):o(new ii.ExecutableResponseError(`The executable returned an invalid response: ${i}`))}else return o(new em(i,u.toString()))})})}async retrieveCachedResponse(){if(!this.outputFile||this.outputFile.length===0)return;let t;try{t=await TE.promises.realpath(this.outputFile)}catch{return}if(!(await TE.promises.lstat(t)).isFile())return;let n=await TE.promises.readFile(t,{encoding:"utf8"});if(n!=="")try{let o=JSON.parse(n);return new ii.ExecutableResponse(o).isValid()?new ii.ExecutableResponse(o):void 0}catch(o){throw o instanceof ii.ExecutableResponseError?o:new ii.ExecutableResponseError(`The output file contained an invalid response: ${n}`)}}static parseCommand(t){let n=t.match(/(?:[^\s"]+|"[^"]*")+/g);if(!n)throw new Error(`Provided command: "${t}" could not be parsed.`);for(let o=0;o<n.length;o++)n[o][0]==='"'&&n[o].slice(-1)==='"'&&(n[o]=n[o].slice(1,-1));return n}};Ra.PluggableAuthHandler=wE});var RE=B(Oa=>{"use strict";Object.defineProperty(Oa,"__esModule",{value:!0});Oa.PluggableAuthClient=Oa.ExecutableError=void 0;var i6=yo(),a6=xE(),EC=AE(),s6=AE();Object.defineProperty(Oa,"ExecutableError",{enumerable:!0,get:a(function(){return s6.ExecutableError},"get")});var c6=30*1e3,SC=5*1e3,PC=120*1e3,u6="GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES",xC=1,IE=class extends i6.BaseExternalAccountClient{static{a(this,"PluggableAuthClient")}command;timeoutMillis;outputFile;handler;constructor(t){if(super(t),!t.credential_source.executable)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(this.command=t.credential_source.executable.command,!this.command)throw new Error('No valid Pluggable Auth "credential_source" provided.');if(t.credential_source.executable.timeout_millis===void 0)this.timeoutMillis=c6;else if(this.timeoutMillis=t.credential_source.executable.timeout_millis,this.timeoutMillis<SC||this.timeoutMillis>PC)throw new Error(`Timeout must be between ${SC} and ${PC} milliseconds.`);this.outputFile=t.credential_source.executable.output_file,this.handler=new EC.PluggableAuthHandler({command:this.command,timeoutMillis:this.timeoutMillis,outputFile:this.outputFile}),this.credentialSourceType="executable"}async retrieveSubjectToken(){if(process.env[u6]!=="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 t;if(this.outputFile&&(t=await this.handler.retrieveCachedResponse()),!t){let n=new Map;n.set("GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE",this.audience),n.set("GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE",this.subjectTokenType),n.set("GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE","0"),this.outputFile&&n.set("GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE",this.outputFile);let o=this.getServiceAccountEmail();o&&n.set("GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL",o),t=await this.handler.retrieveResponseFromExecutable(n)}if(t.version>xC)throw new Error(`Version of executable is not currently supported, maximum supported version is ${xC}.`);if(!t.success)throw new EC.ExecutableError(t.errorMessage,t.errorCode);if(this.outputFile&&!t.expirationTime)throw new a6.InvalidExpirationTimeFieldError("The executable response must contain the `expiration_time` field for successful responses when an output_file has been specified in the configuration.");if(t.isExpired())throw new Error("Executable response is expired.");return t.subjectToken}};Oa.PluggableAuthClient=IE});var kE=B(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});tm.ExternalAccountClient=void 0;var l6=yo(),d6=mE(),p6=bE(),f6=RE(),OE=class{static{a(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(t){return t&&t.type===l6.EXTERNAL_ACCOUNT_TYPE?t.credential_source?.environment_id?new p6.AwsClient(t):t.credential_source?.executable?new f6.PluggableAuthClient(t):new d6.IdentityPoolClient(t):null}};tm.ExternalAccountClient=OE});var zE=B(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.ExternalAccountAuthorizedUserClient=ka.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=void 0;var wC=yr(),TC=rE(),AC=kt(),m6=require("stream"),h6=yo();ka.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE="external_account_authorized_user";var g6="https://sts.{universeDomain}/v1/oauthtoken",CE=class e extends TC.OAuthClientAuthHandler{static{a(this,"ExternalAccountAuthorizedUserHandler")}#e;constructor(t){super(t),this.#e=t.tokenRefreshEndpoint}async refreshToken(t,n){let o={...e.RETRY_CONFIG,url:this.#e,method:"POST",headers:n,data:new URLSearchParams({grant_type:"refresh_token",refresh_token:t})};wC.AuthClient.setMethodName(o,"refreshToken"),this.applyClientAuthenticationOptions(o);try{let r=await this.transporter.request(o),i=r.data;return i.res=r,i}catch(r){throw r instanceof AC.GaxiosError&&r.response?(0,TC.getErrorFromOAuthErrorResponse)(r.response.data,r):r}}},$E=class extends wC.AuthClient{static{a(this,"ExternalAccountAuthorizedUserClient")}cachedAccessToken;externalAccountAuthorizedUserHandler;refreshToken;constructor(t){super(t),t.universe_domain&&(this.universeDomain=t.universe_domain),this.refreshToken=t.refresh_token;let n={confidentialClientType:"basic",clientId:t.client_id,clientSecret:t.client_secret};this.externalAccountAuthorizedUserHandler=new CE({tokenRefreshEndpoint:t.token_url??g6.replace("{universeDomain}",this.universeDomain),transporter:this.transporter,clientAuthentication:n}),this.cachedAccessToken=null,this.quotaProjectId=t.quota_project_id,typeof t?.eagerRefreshThresholdMillis!="number"?this.eagerRefreshThresholdMillis=h6.EXPIRATION_TIME_OFFSET:this.eagerRefreshThresholdMillis=t.eagerRefreshThresholdMillis,this.forceRefreshOnFailure=!!t?.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 t=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${t.token}`});return this.addSharedMetadataHeaders(n)}request(t,n){if(n)this.requestAsync(t).then(o=>n(null,o),o=>n(o,o.response));else return this.requestAsync(t)}async requestAsync(t,n=!1){let o;try{let r=await this.getRequestHeaders();t.headers=AC.Gaxios.mergeHeaders(t.headers),this.addUserProjectAndAuthHeaders(t.headers,r),o=await this.transporter.request(t)}catch(r){let i=r.response;if(i){let s=i.status,u=i.config.data instanceof m6.Readable;if(!n&&(s===401||s===403)&&!u&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(t,!0)}throw r}return o}async refreshAccessTokenAsync(){let t=await this.externalAccountAuthorizedUserHandler.refreshToken(this.refreshToken);return this.cachedAccessToken={access_token:t.access_token,expiry_date:new Date().getTime()+t.expires_in*1e3,res:t.res},t.refresh_token!==void 0&&(this.refreshToken=t.refresh_token),this.cachedAccessToken}isExpired(t){let n=new Date().getTime();return t.expiry_date?n>=t.expiry_date-this.eagerRefreshThresholdMillis:!1}};ka.ExternalAccountAuthorizedUserClient=$E});var kC=B(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.GoogleAuth=Qr.GoogleAuthExceptionMessages=void 0;var y6=require("child_process"),fu=require("fs"),_6=kt(),mu=Yc(),b6=require("os"),NE=require("path"),v6=eu(),E6=Iv(),S6=Ov(),P6=kv(),Ca=Kv(),IC=Qv(),$a=eE(),x6=kE(),hu=yo(),DE=yr(),RC=zE(),OC=Wr();Qr.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
50
|
To learn more about authentication and Google APIs, visit:
|
|
51
51
|
https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
|
|
52
52
|
To learn more about authentication and Google APIs, visit:
|
|
53
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
54
|
To learn more about Universe Domain retrieval, visit:
|
|
55
|
-
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var Dp=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(Tr.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===Tr.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(Tr.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 fa.universe("universe-domain"),e||=zp.DEFAULT_UNIVERSE}catch(r){if(r&&r?.response?.status===404)e=zp.DEFAULT_UNIVERSE;else throw r}return e}async getUniverseDomain(){let e=(0,bS.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{e??=(await this.getClient()).universeDomain}catch{e??=zp.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 ti.JWT?r.scopes=this.scopes:r instanceof ma.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(r=await this._tryGetApplicationCredentialsFromWellKnownFile(e),r)return r instanceof ti.JWT?r.scopes=this.scopes:r instanceof ma.BaseExternalAccountClient&&(r.scopes=this.getAnyScopes()),await this.#t(r);if(await this._checkIsGCE())return e.scopes=this.getAnyScopes(),await this.#t(new r$.Compute(e));throw new Error(Tr.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=fa.getGCPResidency()||await fa.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=Np.join(i,".config"))}return r&&(r=Np.join(r,"gcloud","application_default_credentials.json"),pa.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=pa.realpathSync(e),!pa.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=pa.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!==ri.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${ri.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 ri.Impersonated({...e,sourceClient:r,targetPrincipal:n,targetScopes:Array.isArray(i)?i:[i]})}fromJSON(e,r={}){let n,i=(0,bS.originalOrCamelOptions)(r).get("universe_domain");return e.type===yS.USER_REFRESH_ACCOUNT_TYPE?(n=new yS.UserRefreshClient(r),n.fromJSON(e)):e.type===ri.IMPERSONATED_ACCOUNT_TYPE?n=this.fromImpersonatedJSON(e):e.type===ma.EXTERNAL_ACCOUNT_TYPE?(n=i$.ExternalAccountClient.fromJSON({...e,...r}),n.scopes=this.getAnyScopes()):e.type===_S.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?n=new _S.ExternalAccountAuthorizedUserClient({...e,...r}):(r.scopes=this.scopes,n=new ti.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(u=>n(null,u),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 u=[];e.setEncoding("utf8").on("error",i).on("data",c=>u.push(c)).on("end",()=>{try{try{let c=JSON.parse(u.join("")),l=this._cacheClientFromJSON(c,r);return n(l)}catch(c){if(!this.keyFilename)throw c;let l=new ti.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=l,this.setGapicJWTValues(l),n(l)}}catch(c){return i(c)}})})}fromAPIKey(e,r={}){return new ti.JWT({...r,apiKey:e})}_isWindows(){let e=e$.platform();return!!(e&&e.length>=3&&e.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(e=>{(0,Y0.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!==ma.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await fa.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 ri.Impersonated)return{client_email:e.getTargetPrincipal()};if(e instanceof ma.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([fa.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:r,universe_domain:n}}throw new Error(Tr.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=Np.resolve(this.keyFilename),r=pa.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 n$.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=X0.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,o$.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 ri.Impersonated)return(await n.sign(e)).signedBlob;let u=(0,t$.createCrypto)();if(n instanceof ti.JWT&&n.key)return await u.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(u,c.client_email,e,r)}async signBlob(e,r,n,i){let u=new URL(i+`${r}:signBlob`);return(await this.request({method:"POST",url:u.href,data:{payload:e.encodeBase64StringUtf8(n)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Tr.GoogleAuth=Dp});var ES=M(ju=>{"use strict";Object.defineProperty(ju,"__esModule",{value:!0});ju.IAMAuth=void 0;var Up=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}}};ju.IAMAuth=Up});var SS=M(Lr=>{"use strict";Object.defineProperty(Lr,"__esModule",{value:!0});Lr.DownscopedClient=Lr.EXPIRATION_TIME_OFFSET=Lr.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var a$=yt(),s$=require("stream"),jp=Zt(),u$=_u(),c$="urn:ietf:params:oauth:grant-type:token-exchange",l$="urn:ietf:params:oauth:token-type:access_token",d$="urn:ietf:params:oauth:token-type:access_token";Lr.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;Lr.EXPIRATION_TIME_OFFSET=300*1e3;var Mp=class extends jp.AuthClient{static{o(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(e,r={accessBoundary:{accessBoundaryRules:[]}}){if(super(e instanceof jp.AuthClient?{}:e),e instanceof jp.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>Lr.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${Lr.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 u$.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=a$.Gaxios.mergeHeaders(e.headers),this.addUserProjectAndAuthHeaders(e.headers,i),n=await this.transporter.request(e)}catch(i){let u=i.response;if(u){let c=u.status,l=u.config.data instanceof s$.Readable;if(!r&&(c===401||c===403)&&!l&&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:c$,requestedTokenType:l$,subjectToken:e,subjectTokenType:d$},n=await this.stsCredential.exchangeToken(r,void 0,this.credentialAccessBoundary),i=this.authClient.credentials?.expiry_date||null,u=n.expires_in?new Date().getTime()+n.expires_in*1e3:i;return this.cachedDownscopedAccessToken={access_token:n.access_token,expiry_date:u,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}};Lr.DownscopedClient=Mp});var PS=M(Mu=>{"use strict";Object.defineProperty(Mu,"__esModule",{value:!0});Mu.PassThroughClient=void 0;var p$=Zt(),Lp=class extends p$.AuthClient{static{o(this,"PassThroughClient")}async request(e){return this.transporter.request(e)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};Mu.PassThroughClient=Lp});var IS=M(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.GoogleAuth=ee.auth=ee.PassThroughClient=ee.ExternalAccountAuthorizedUserClient=ee.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE=ee.ExecutableError=ee.PluggableAuthClient=ee.DownscopedClient=ee.BaseExternalAccountClient=ee.ExternalAccountClient=ee.IdentityPoolClient=ee.AwsRequestSigner=ee.AwsClient=ee.UserRefreshClient=ee.LoginTicket=ee.ClientAuthentication=ee.OAuth2Client=ee.CodeChallengeMethod=ee.Impersonated=ee.JWT=ee.JWTAccess=ee.IdTokenClient=ee.IAMAuth=ee.GCPEnv=ee.Compute=ee.DEFAULT_UNIVERSE=ee.AuthClient=ee.gaxios=ee.gcpMetadata=void 0;var TS=vS();Object.defineProperty(ee,"GoogleAuth",{enumerable:!0,get:o(function(){return TS.GoogleAuth},"get")});ee.gcpMetadata=Yi();ee.gaxios=yt();var wS=Zt();Object.defineProperty(ee,"AuthClient",{enumerable:!0,get:o(function(){return wS.AuthClient},"get")});Object.defineProperty(ee,"DEFAULT_UNIVERSE",{enumerable:!0,get:o(function(){return wS.DEFAULT_UNIVERSE},"get")});var f$=Ad();Object.defineProperty(ee,"Compute",{enumerable:!0,get:o(function(){return f$.Compute},"get")});var m$=Cd();Object.defineProperty(ee,"GCPEnv",{enumerable:!0,get:o(function(){return m$.GCPEnv},"get")});var h$=ES();Object.defineProperty(ee,"IAMAuth",{enumerable:!0,get:o(function(){return h$.IAMAuth},"get")});var g$=Rd();Object.defineProperty(ee,"IdTokenClient",{enumerable:!0,get:o(function(){return g$.IdTokenClient},"get")});var y$=Wd();Object.defineProperty(ee,"JWTAccess",{enumerable:!0,get:o(function(){return y$.JWTAccess},"get")});var _$=Jd();Object.defineProperty(ee,"JWT",{enumerable:!0,get:o(function(){return _$.JWT},"get")});var b$=Xd();Object.defineProperty(ee,"Impersonated",{enumerable:!0,get:o(function(){return b$.Impersonated},"get")});var Fp=eo();Object.defineProperty(ee,"CodeChallengeMethod",{enumerable:!0,get:o(function(){return Fp.CodeChallengeMethod},"get")});Object.defineProperty(ee,"OAuth2Client",{enumerable:!0,get:o(function(){return Fp.OAuth2Client},"get")});Object.defineProperty(ee,"ClientAuthentication",{enumerable:!0,get:o(function(){return Fp.ClientAuthentication},"get")});var v$=Pd();Object.defineProperty(ee,"LoginTicket",{enumerable:!0,get:o(function(){return v$.LoginTicket},"get")});var E$=Qd();Object.defineProperty(ee,"UserRefreshClient",{enumerable:!0,get:o(function(){return E$.UserRefreshClient},"get")});var S$=_p();Object.defineProperty(ee,"AwsClient",{enumerable:!0,get:o(function(){return S$.AwsClient},"get")});var P$=hp();Object.defineProperty(ee,"AwsRequestSigner",{enumerable:!0,get:o(function(){return P$.AwsRequestSigner},"get")});var T$=fp();Object.defineProperty(ee,"IdentityPoolClient",{enumerable:!0,get:o(function(){return T$.IdentityPoolClient},"get")});var w$=Cp();Object.defineProperty(ee,"ExternalAccountClient",{enumerable:!0,get:o(function(){return w$.ExternalAccountClient},"get")});var x$=kn();Object.defineProperty(ee,"BaseExternalAccountClient",{enumerable:!0,get:o(function(){return x$.BaseExternalAccountClient},"get")});var A$=SS();Object.defineProperty(ee,"DownscopedClient",{enumerable:!0,get:o(function(){return A$.DownscopedClient},"get")});var xS=Ip();Object.defineProperty(ee,"PluggableAuthClient",{enumerable:!0,get:o(function(){return xS.PluggableAuthClient},"get")});Object.defineProperty(ee,"ExecutableError",{enumerable:!0,get:o(function(){return xS.ExecutableError},"get")});var AS=$p();Object.defineProperty(ee,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:o(function(){return AS.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ee,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:o(function(){return AS.ExternalAccountAuthorizedUserClient},"get")});var I$=PS();Object.defineProperty(ee,"PassThroughClient",{enumerable:!0,get:o(function(){return I$.PassThroughClient},"get")});var R$=new TS.GoogleAuth;ee.auth=R$});var U$={};Ba(U$,{bigQueryAuth:()=>Oe,googleBigQuery:()=>D$});module.exports=CT(U$);var OT=Object.freeze({status:"aborted"});function X(t,e,r){function n(l,p){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:p,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(t))return;l._zod.traits.add(t),e(l,p);let f=c.prototype,m=Object.keys(f);for(let g=0;g<m.length;g++){let S=m[g];S in l||(l[S]=f[S].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:t});function c(l){var p;let f=r?.Parent?new u:this;n(f,l),(p=f._zod).deferred??(p.deferred=[]);for(let m of f._zod.deferred)m();return f}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(t),"value")}),Object.defineProperty(c,"name",{value:t}),c}o(X,"$constructor");var Ar=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},qa=class extends Error{static{o(this,"$ZodEncodeError")}constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}},_c={};function Zr(t){return t&&Object.assign(_c,t),_c}o(Zr,"config");function vc(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(vc,"getEnumValues");function Kf(t,e){return typeof e=="bigint"?e.toString():e}o(Kf,"jsonStringifyReplacer");function Ha(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Ha,"cached");function Qf(t){return t==null}o(Qf,"nullish");function Ga(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}o(Ga,"cleanRegex");var Jf=Symbol("evaluating");function tt(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==Jf)return n===void 0&&(n=Jf,n=r()),n},set(i){Object.defineProperty(t,e,{value:i})},configurable:!0})}o(tt,"defineLazy");var Ec="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function hi(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}o(hi,"isObject");var kT=Ha(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function Yf(t){if(hi(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(hi(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Yf,"isPlainObject");var Xf=new Set(["string","number","symbol"]);function _o(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(_o,"escapeRegex");function Wa(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}o(Wa,"clone");function Ze(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(Ze,"normalizeParams");function em(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}o(em,"optionalKeys");var tm={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 bo(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(bo,"aborted");function hn(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}o(hn,"prefixIssues");function Va(t){return typeof t=="string"?t:t?.message}o(Va,"unwrapMessage");function gn(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let i=Va(t.inst?._zod.def?.error?.(t))??Va(e?.error?.(t))??Va(r.customError?.(t))??Va(r.localeError?.(t))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}o(gn,"finalizeIssue");function rm(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}o(rm,"getLengthableOrigin");function Sc(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}o(Sc,"issue");var nm=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,Kf,2),Object.defineProperty(t,"toString",{value:o(()=>t.message,"value"),enumerable:!1})},"initializer"),om=X("$ZodError",nm),gi=X("$ZodError",nm,{Parent:Error});var NT=o(t=>(e,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=e._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new Ar;if(c.issues.length){let l=new(i?.Err??t)(c.issues.map(p=>gn(p,u,Zr())));throw Ec(l,i?.callee),l}return c.value},"_parse"),Za=NT(gi),zT=o(t=>async(e,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=e._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??t)(c.issues.map(p=>gn(p,u,Zr())));throw Ec(l,i?.callee),l}return c.value},"_parseAsync"),Ja=zT(gi),DT=o(t=>(e,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=e._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new Ar;return u.issues.length?{success:!1,error:new(t??om)(u.issues.map(c=>gn(c,i,Zr())))}:{success:!0,data:u.value}},"_safeParse"),yi=DT(gi),UT=o(t=>async(e,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=e._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new t(u.issues.map(c=>gn(c,i,Zr())))}:{success:!0,data:u.value}},"_safeParseAsync"),_i=UT(gi);var jT="(?:(?:\\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])))",MT=new RegExp(`^${jT}$`);var im=o(t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},"string"),am=/^-?\d+n?$/,sm=/^-?\d+$/,Pc=/^-?\d+(?:\.\d+)?$/,um=/^(?:true|false)$/i;var yn=X("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),LT={number:"number",bigint:"bigint",object:"date"};var cm=X("$ZodCheckGreaterThan",(t,e)=>{yn.init(t,e);let r=LT[typeof e.value];t._zod.onattach.push(n=>{let i=n._zod.bag,u=(e.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>u&&(e.inclusive?i.minimum=e.value:i.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}});var lm=X("$ZodCheckNumberFormat",(t,e)=>{yn.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[i,u]=tm[e.format];t._zod.onattach.push(c=>{let l=c._zod.bag;l.format=e.format,l.minimum=i,l.maximum=u,r&&(l.pattern=sm)}),t._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:l,inst:t});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:t,continue:!e.abort})}});var dm=X("$ZodCheckMinLength",(t,e)=>{var r;yn.init(t,e),(r=t._zod.def).when??(r.when=n=>{let i=n.value;return!Qf(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=rm(i);n.issues.push({origin:c,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:t,continue:!e.abort})}});var Tc=X("$ZodCheckStringFormat",(t,e)=>{var r,n;yn.init(t,e),t._zod.onattach.push(i=>{let u=i._zod.bag;u.format=e.format,e.pattern&&(u.patterns??(u.patterns=new Set),u.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=()=>{})}),pm=X("$ZodCheckRegex",(t,e)=>{Tc.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 mm={major:4,minor:3,patch:6};var Qe=X("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=mm;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let i of n)for(let u of i._zod.onattach)u(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,l,p)=>{let f=bo(c),m;for(let g of l){if(g._zod.def.when){if(!g._zod.def.when(c))continue}else if(f)continue;let S=c.issues.length,h=g._zod.check(c);if(h instanceof Promise&&p?.async===!1)throw new Ar;if(m||h instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await h,c.issues.length!==S&&(f||(f=bo(c,S)))});else{if(c.issues.length===S)continue;f||(f=bo(c,S))}}return m?m.then(()=>c):c},"runChecks"),u=o((c,l,p)=>{if(bo(c))return c.aborted=!0,c;let f=i(l,n,p);if(f instanceof Promise){if(p.async===!1)throw new Ar;return f.then(m=>t._zod.parse(m,p))}return t._zod.parse(f,p)},"handleCanaryResult");t._zod.run=(c,l)=>{if(l.skipChecks)return t._zod.parse(c,l);if(l.direction==="backward"){let f=t._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return f instanceof Promise?f.then(m=>u(m,c,l)):u(f,c,l)}let p=t._zod.parse(c,l);if(p instanceof Promise){if(l.async===!1)throw new Ar;return p.then(f=>i(f,n,l))}return i(p,n,l)}}tt(t,"~standard",()=>({validate:o(i=>{try{let u=yi(t,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return _i(t,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ya=X("$ZodString",(t,e)=>{Qe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??im(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}}),wc=X("$ZodStringFormat",(t,e)=>{Tc.init(t,e),Ya.init(t,e)});var bm=X("$ZodURL",(t,e)=>{wc.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 xc=X("$ZodNumber",(t,e)=>{Qe.init(t,e),t._zod.pattern=t._zod.bag.pattern??Pc,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 u=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,...u?{received:u}:{}}),r}}),vm=X("$ZodNumberFormat",(t,e)=>{lm.init(t,e),xc.init(t,e)}),Ac=X("$ZodBoolean",(t,e)=>{Qe.init(t,e),t._zod.pattern=um,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}}),Em=X("$ZodBigInt",(t,e)=>{Qe.init(t,e),t._zod.pattern=am,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 Sm=X("$ZodAny",(t,e)=>{Qe.init(t,e),t._zod.parse=r=>r}),Pm=X("$ZodUnknown",(t,e)=>{Qe.init(t,e),t._zod.parse=r=>r});var Tm=X("$ZodVoid",(t,e)=>{Qe.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}}),wm=X("$ZodDate",(t,e)=>{Qe.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:t}),r}});function hm(t,e,r){t.issues.length&&e.issues.push(...hn(r,t.issues)),e.value[r]=t.value}o(hm,"handleArrayResult");var xm=X("$ZodArray",(t,e)=>{Qe.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 u=[];for(let c=0;c<i.length;c++){let l=i[c],p=e.element._zod.run({value:l,issues:[]},n);p instanceof Promise?u.push(p.then(f=>hm(f,r,c))):hm(p,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Qa(t,e,r,n,i){if(t.issues.length){if(i&&!(r in n))return;e.issues.push(...hn(r,t.issues))}t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}o(Qa,"handlePropertyResult");function FT(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=em(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}o(FT,"normalizeDef");function BT(t,e,r,n,i,u){let c=[],l=i.keySet,p=i.catchall._zod,f=p.def.type,m=p.optout==="optional";for(let g in e){if(l.has(g))continue;if(f==="never"){c.push(g);continue}let S=p.run({value:e[g],issues:[]},n);S instanceof Promise?t.push(S.then(h=>Qa(h,r,g,e,m))):Qa(S,r,g,e,m)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:e,inst:u}),t.length?Promise.all(t).then(()=>r):r}o(BT,"handleCatchall");var Am=X("$ZodObject",(t,e)=>{if(Qe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let l=e.shape;Object.defineProperty(e,"shape",{get:o(()=>{let p={...l};return Object.defineProperty(e,"shape",{value:p}),p},"get")})}let n=Ha(()=>FT(e));tt(t._zod,"propValues",()=>{let l=e.shape,p={};for(let f in l){let m=l[f]._zod;if(m.values){p[f]??(p[f]=new Set);for(let g of m.values)p[f].add(g)}}return p});let i=hi,u=e.catchall,c;t._zod.parse=(l,p)=>{c??(c=n.value);let f=l.value;if(!i(f))return l.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),l;l.value={};let m=[],g=c.shape;for(let S of c.keys){let h=g[S],_=h._zod.optout==="optional",T=h._zod.run({value:f[S],issues:[]},p);T instanceof Promise?m.push(T.then(E=>Qa(E,l,S,f,_))):Qa(T,l,S,f,_)}return u?BT(m,f,l,p,n.value,t):m.length?Promise.all(m).then(()=>l):l}});function gm(t,e,r,n){for(let u of t)if(u.issues.length===0)return e.value=u.value,e;let i=t.filter(u=>!bo(u));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(u=>u.issues.map(c=>gn(c,n,Zr())))}),e)}o(gm,"handleUnionResults");var Ic=X("$ZodUnion",(t,e)=>{Qe.init(t,e),tt(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),tt(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),tt(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),tt(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Ga(u.source)).join("|")})$`)}});let r=e.options.length===1,n=e.options[0]._zod.run;t._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let p of e.options){let f=p._zod.run({value:i.value,issues:[]},u);if(f instanceof Promise)l.push(f),c=!0;else{if(f.issues.length===0)return f;l.push(f)}}return c?Promise.all(l).then(p=>gm(p,i,t,u)):gm(l,i,t,u)}});var Im=X("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,Ic.init(t,e);let r=t._zod.parse;tt(t._zod,"propValues",()=>{let i={};for(let u of e.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(u)}"`);for(let[l,p]of Object.entries(c)){i[l]||(i[l]=new Set);for(let f of p)i[l].add(f)}}return i});let n=Ha(()=>{let i=e.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[e.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(c)}"`);for(let p of l){if(u.has(p))throw new Error(`Duplicate discriminator value "${String(p)}"`);u.set(p,c)}}return u});t._zod.parse=(i,u)=>{let c=i.value;if(!hi(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:t}),i;let l=n.value.get(c?.[e.discriminator]);return l?l._zod.run(i,u):e.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:c,path:[e.discriminator],inst:t}),i)}});var Rm=X("$ZodRecord",(t,e)=>{Qe.init(t,e),t._zod.parse=(r,n)=>{let i=r.value;if(!Yf(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:t}),r;let u=[],c=e.keyType._zod.values;if(c){r.value={};let l=new Set;for(let f of c)if(typeof f=="string"||typeof f=="number"||typeof f=="symbol"){l.add(typeof f=="number"?f.toString():f);let m=e.valueType._zod.run({value:i[f],issues:[]},n);m instanceof Promise?u.push(m.then(g=>{g.issues.length&&r.issues.push(...hn(f,g.issues)),r.value[f]=g.value})):(m.issues.length&&r.issues.push(...hn(f,m.issues)),r.value[f]=m.value)}let p;for(let f in i)l.has(f)||(p=p??[],p.push(f));p&&p.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:t,keys:p})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let p=e.keyType._zod.run({value:l,issues:[]},n);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Pc.test(l)&&p.issues.length){let g=e.keyType._zod.run({value:Number(l),issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(p=g)}if(p.issues.length){e.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:p.issues.map(g=>gn(g,n,Zr())),input:l,path:[l],inst:t});continue}let m=e.valueType._zod.run({value:i[l],issues:[]},n);m instanceof Promise?u.push(m.then(g=>{g.issues.length&&r.issues.push(...hn(l,g.issues)),r.value[p.value]=g.value})):(m.issues.length&&r.issues.push(...hn(l,m.issues)),r.value[p.value]=m.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Cm=X("$ZodEnum",(t,e)=>{Qe.init(t,e);let r=vc(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(i=>Xf.has(typeof i)).map(i=>typeof i=="string"?_o(i):i.toString()).join("|")})$`),t._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:t}),i}}),Om=X("$ZodLiteral",(t,e)=>{if(Qe.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"?_o(n):n?_o(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:e.values,input:u,inst:t}),n}});var km=X("$ZodTransform",(t,e)=>{Qe.init(t,e),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new qa(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 Ar;return r.value=i,r}});function ym(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}o(ym,"handleOptionalResult");var $m=X("$ZodOptional",(t,e)=>{Qe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",tt(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),tt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ga(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(u=>ym(u,r.value)):ym(i,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,n)}});var Nm=X("$ZodNullable",(t,e)=>{Qe.init(t,e),tt(t._zod,"optin",()=>e.innerType._zod.optin),tt(t._zod,"optout",()=>e.innerType._zod.optout),tt(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${Ga(r.source)}|null)$`):void 0}),tt(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 zm=X("$ZodPipe",(t,e)=>{Qe.init(t,e),tt(t._zod,"values",()=>e.in._zod.values),tt(t._zod,"optin",()=>e.in._zod.optin),tt(t._zod,"optout",()=>e.out._zod.optout),tt(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=e.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Ka(c,e.in,n)):Ka(u,e.in,n)}let i=e.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ka(u,e.out,n)):Ka(i,e.out,n)}});function Ka(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},r)}o(Ka,"handlePipeResult");var Dm=X("$ZodCustom",(t,e)=>{yn.init(t,e),Qe.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(u=>_m(u,r,n,t));_m(i,r,n,t)}});function _m(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(Sc(i))}}o(_m,"handleRefineResult");var jm;var Rc=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 Mm(){return new Rc}o(Mm,"registry");(jm=globalThis).__zod_globalRegistry??(jm.__zod_globalRegistry=Mm());var Cc=globalThis.__zod_globalRegistry;function Lm(t,e){return new t({type:"string",...Ze(e)})}o(Lm,"_string");function Fm(t,e){return new t({type:"string",coerce:!0,...Ze(e)})}o(Fm,"_coercedString");function Bm(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ze(e)})}o(Bm,"_url");function qm(t,e){return new t({type:"number",checks:[],...Ze(e)})}o(qm,"_number");function Vm(t,e){return new t({type:"number",coerce:!0,checks:[],...Ze(e)})}o(Vm,"_coercedNumber");function Hm(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ze(e)})}o(Hm,"_int");function Gm(t,e){return new t({type:"boolean",...Ze(e)})}o(Gm,"_boolean");function Wm(t,e){return new t({type:"boolean",coerce:!0,...Ze(e)})}o(Wm,"_coercedBoolean");function Zm(t,e){return new t({type:"bigint",coerce:!0,...Ze(e)})}o(Zm,"_coercedBigint");function Jm(t){return new t({type:"any"})}o(Jm,"_any");function Km(t){return new t({type:"unknown"})}o(Km,"_unknown");function Qm(t,e){return new t({type:"void",...Ze(e)})}o(Qm,"_void");function Ym(t,e){return new t({type:"date",coerce:!0,...Ze(e)})}o(Ym,"_coercedDate");function Xa(t,e){return new cm({check:"greater_than",...Ze(e),value:t,inclusive:!0})}o(Xa,"_gte");function fr(t,e){return new dm({check:"min_length",...Ze(e),minimum:t})}o(fr,"_minLength");function _n(t,e){return new pm({check:"string_format",format:"regex",...Ze(e),pattern:t})}o(_n,"_regex");function Xm(t,e,r){let n=Ze(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}o(Xm,"_custom");var rt=X("ZodMiniType",(t,e)=>{if(!t._zod)throw new Error("Uninitialized schema in ZodMiniType.");Qe.init(t,e),t.def=e,t.type=e.type,t.parse=(r,n)=>Za(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>yi(t,r,n),t.parseAsync=async(r,n)=>Ja(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>_i(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)=>Wa(t,r,n),t.brand=()=>t,t.register=((r,n)=>(r.add(t,n),t)),t.apply=r=>r(t)}),ts=X("ZodMiniString",(t,e)=>{Ya.init(t,e),rt.init(t,e)});function b(t){return Lm(ts,t)}o(b,"string");var eh=X("ZodMiniStringFormat",(t,e)=>{wc.init(t,e),ts.init(t,e)});var tw=X("ZodMiniURL",(t,e)=>{bm.init(t,e),eh.init(t,e)});function th(t){return Bm(tw,t)}o(th,"url");var rs=X("ZodMiniNumber",(t,e)=>{xc.init(t,e),rt.init(t,e)});function wt(t){return qm(rs,t)}o(wt,"number");var rw=X("ZodMiniNumberFormat",(t,e)=>{vm.init(t,e),rs.init(t,e)});function rh(t){return Hm(rw,t)}o(rh,"int");var Oc=X("ZodMiniBoolean",(t,e)=>{Ac.init(t,e),rt.init(t,e)});function ke(t){return Gm(Oc,t)}o(ke,"boolean");var nh=X("ZodMiniBigInt",(t,e)=>{Em.init(t,e),rt.init(t,e)});var nw=X("ZodMiniAny",(t,e)=>{Sm.init(t,e),rt.init(t,e)});function vi(){return Jm(nw)}o(vi,"any");var ow=X("ZodMiniUnknown",(t,e)=>{Pm.init(t,e),rt.init(t,e)});function pe(){return Km(ow)}o(pe,"unknown");var iw=X("ZodMiniVoid",(t,e)=>{Tm.init(t,e),rt.init(t,e)});function oh(t){return Qm(iw,t)}o(oh,"_void");var ih=X("ZodMiniDate",(t,e)=>{wm.init(t,e),rt.init(t,e)});var aw=X("ZodMiniArray",(t,e)=>{xm.init(t,e),rt.init(t,e)});function ge(t,e){return new aw({type:"array",element:t,...Ze(e)})}o(ge,"array");var sw=X("ZodMiniObject",(t,e)=>{Am.init(t,e),rt.init(t,e),tt(t,"shape",()=>e.shape)});function O(t,e){let r={type:"object",shape:t??{},...Ze(e)};return new sw(r)}o(O,"object");var uw=X("ZodMiniUnion",(t,e)=>{Ic.init(t,e),rt.init(t,e)});function ye(t,e){return new uw({type:"union",options:t,...Ze(e)})}o(ye,"union");var cw=X("ZodMiniDiscriminatedUnion",(t,e)=>{Im.init(t,e),rt.init(t,e)});function bn(t,e,r){return new cw({type:"union",options:e,discriminator:t,...Ze(r)})}o(bn,"discriminatedUnion");var lw=X("ZodMiniRecord",(t,e)=>{Rm.init(t,e),rt.init(t,e)});function fe(t,e,r){return new lw({type:"record",keyType:t,valueType:e,...Ze(r)})}o(fe,"record");var dw=X("ZodMiniEnum",(t,e)=>{Cm.init(t,e),rt.init(t,e),t.options=Object.values(e.entries)});function Ee(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new dw({type:"enum",entries:r,...Ze(e)})}o(Ee,"_enum");var pw=X("ZodMiniLiteral",(t,e)=>{Om.init(t,e),rt.init(t,e)});function ae(t,e){return new pw({type:"literal",values:Array.isArray(t)?t:[t],...Ze(e)})}o(ae,"literal");var fw=X("ZodMiniTransform",(t,e)=>{km.init(t,e),rt.init(t,e)});function vn(t){return new fw({type:"transform",transform:t})}o(vn,"transform");var mw=X("ZodMiniOptional",(t,e)=>{$m.init(t,e),rt.init(t,e)});function B(t){return new mw({type:"optional",innerType:t})}o(B,"optional");var hw=X("ZodMiniNullable",(t,e)=>{Nm.init(t,e),rt.init(t,e)});function Ei(t){return new hw({type:"nullable",innerType:t})}o(Ei,"nullable");var gw=X("ZodMiniPipe",(t,e)=>{zm.init(t,e),rt.init(t,e)});function En(t,e){return new gw({type:"pipe",in:t,out:e})}o(En,"pipe");var yw=X("ZodMiniCustom",(t,e)=>{Dm.init(t,e),rt.init(t,e)});function ns(t,e){return Xm(yw,t??(()=>!0),e)}o(ns,"custom");var Si={};Ba(Si,{bigint:()=>Pw,boolean:()=>Sw,date:()=>Tw,number:()=>Ew,string:()=>vw});function vw(t){return Fm(ts,t)}o(vw,"string");function Ew(t){return Vm(rs,t)}o(Ew,"number");function Sw(t){return Wm(Oc,t)}o(Sw,"boolean");function Pw(t){return Zm(nh,t)}o(Pw,"bigint");function Tw(t){return Ym(ih,t)}o(Tw,"date");var $c=O({retryOnFailure:O({defaultValue:B(ke()),hide:B(ke())}),continueOnFailure:O({defaultValue:B(ke()),hide:B(ke())})}),kc=class{constructor(e,r,n,i,u,c,l,p,f,m,g){this.name=e;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=p;this.outputSchema=f;this.audience=m;this.aiMetadata=g}static{o(this,"IAction")}},nt=o(t=>new kc(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 Ne=O({displayName:b(),description:B(b())}),_e=o((t,e)=>O({type:ae(e),required:ke(),defaultValue:B(vi())}),"TPropertyValue");var Lt=O({...Ne.shape,..._e(b(),"SHORT_TEXT").shape}),Jr=O({...Ne.shape,..._e(b(),"LONG_TEXT").shape});var sh=O({label:b(),value:pe()}),os=O({disabled:B(ke()),placeholder:B(b()),options:ge(sh)});var Ft=O({...Ne.shape,options:os,..._e(pe(),"STATIC_DROPDOWN").shape}),Kr=O({...Ne.shape,options:os,..._e(ge(pe()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Nc=O({...Ne.shape,..._e(pe(),"DROPDOWN").shape,refreshers:ge(b())}),Pi=O({...Ne.shape,..._e(ge(pe()),"MULTI_SELECT_DROPDOWN").shape,refreshers:ge(b())});var Qr=O({...Ne.shape,..._e(ke(),"CHECKBOX").shape});var Yr=O({...Ne.shape,..._e(wt(),"NUMBER").shape});var Ti=O({...Ne.shape,streaming:B(ke()),..._e(pe(),"FILE").shape});var wi=O({...Ne.shape,..._e(b(),"DATE_TIME").shape});var uh=fe(b(),ye([Lt,Jr,Ft,Pi,Kr,Qr,Yr,Ti,wi])),xi=O({...Ne.shape,properties:uh,..._e(ge(pe()),"ARRAY").shape});var Ai=O({...Ne.shape,..._e(ye([fe(b(),pe())]),"JSON").shape});var ch=ye([Lt,Ft,Ai,xi,Kr]),xw=fe(b(),ch),zc=O({refreshers:ge(b()),...Ne.shape,..._e(pe(),"DYNAMIC").shape});var is=O({...Ne.shape,..._e(oh(),"MARKDOWN").shape});var Ii=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ii||{}),vo=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(vo||{}),Eo=(w=>(w.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",w.COMMUNICATION="COMMUNICATION",w.COMMERCE="COMMERCE",w.CORE="CORE",w.UNIVERSAL_AI="UNIVERSAL_AI",w.FLOW_CONTROL="FLOW_CONTROL",w.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",w.ACCOUNTING="ACCOUNTING",w.PRODUCTIVITY="PRODUCTIVITY",w.CONTENT_AND_FILES="CONTENT_AND_FILES",w.DEVELOPER_TOOLS="DEVELOPER_TOOLS",w.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",w.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",w.HUMAN_RESOURCES="HUMAN_RESOURCES",w.PAYMENT_PROCESSING="PAYMENT_PROCESSING",w.MARKETING="MARKETING",w.SALES_AND_CRM="SALES_AND_CRM",w))(Eo||{});var Ri=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ri||{}),Dc="both_client_credentials_and_authorization_code";var mr=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(mr||{}),Ci=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(Ci||{}),Aw=O({strategy:Ee(Ci),paramName:B(b())}),Oi=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Oi||{});var as=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(as||{}),lh=O({status:B(wt()),body:B(pe()),headers:B(fe(b(),b()))}),dh=O({type:ae("DELAY"),resumeDateTime:b(),requestIdToReply:B(b()),handlerId:B(b()),streamStepProgress:B(Ee(as))}),ph=O({type:ae("WEBHOOK"),requestId:b(),requestIdToReply:B(b()),response:lh,handlerId:B(b()),streamStepProgress:B(Ee(as))}),Iw=ye([dh,ph]);var Rw=O({body:pe(),rawBody:B(pe()),headers:fe(b(),b()),queryParams:fe(b(),b())});function et(t){return t==null}o(et,"isNil");function ki(t){return t==null?!0:typeof t=="string"||Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1}o(ki,"isEmpty");function ss(t,e){if(t==null)throw new Error(`${e} is null or undefined`)}o(ss,"assertNotNullOrUndefined");var Uc=gt(require("crypto"),1);var Cw=128,Fn,So,Ow=o(t=>{!Fn||Fn.length<t?(Fn=Buffer.allocUnsafe(t*Cw),Uc.default.randomFillSync(Fn),So=0):So+t>Fn.length&&(Uc.default.randomFillSync(Fn),So=0),So+=t},"fillPool"),kw=o(t=>(Ow(t|=0),Fn.subarray(So-t,So)),"random"),$w=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(u=e)=>{let c="";for(;;){let l=r(i),p=i;for(;p--;)if(c+=t[l[p]&n]||"",c.length===u)return c}}},"customRandom"),mh=o((t,e=21)=>$w(t,e,kw),"customAlphabet");var Nw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",hh=21,yB=b().check(_n(new RegExp(`^[0-9a-zA-Z]{${hh}}$`))),zw=mh(Nw,hh);var Sn=En(vn(t=>t instanceof Date?t.toISOString():t),b()),tr={id:b(),created:Sn,updated:Sn},Ke=o(t=>B(Ei(t)),"Nullable");function jc(t){return B(Ei(Ee(t)))}o(jc,"NullableEnum");var vB=En(vn(t=>t==="true"||t===!0?!0:t==="false"||t===!1?!1:void 0),B(ke())),us=o(t=>En(vn(e=>Array.isArray(e)?e:e!==void 0?[e]:void 0),B(ge(t))),"OptionalArrayFromQuery");var PB=fe(b(),pe());var $i=(m=>(m.OPENAI="openai",m.OPENROUTER="openrouter",m.ANTHROPIC="anthropic",m.AZURE="azure",m.GOOGLE="google",m.ACTIVEPIECES="activepieces",m.CLOUDFLARE_GATEWAY="cloudflare-gateway",m.CUSTOM="custom",m.BEDROCK="bedrock",m.MISTRAL="mistral",m))($i||{});var zB=b().check(_n(/^#[0-9A-Fa-f]{6}$/));var UB=O({filename:b(),data:pe(),type:ae("file"),mimetype:B(b())});var Dw=gt(yh());var VB=O({...tr,name:b(),permissions:ge(b()),platformId:Ke(b()),type:b(),userCount:B(wt())});var _h=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(_h||{}),Mc=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Mc||{}),Lc=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Lc||{});var Fc=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Fc||{});var Bc=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Bc||{});var Uw=O({mode:Ee(_h),value:pe()}),jw=O({auth:B(b()),fields:fe(b(),Uw)}),Mw=O({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:B(jw)}),Lw=O({type:ae("PIECE"),toolName:b().check(fr(1)),pieceMetadata:Mw}),Fw=O({type:ae("none")}),Bw=O({type:ae("access_token"),accessToken:b()}),qw=O({type:ae("api_key"),apiKey:b(),apiKeyHeader:b()}),Vw=O({type:ae("headers"),headers:fe(b(),b())}),Hw=bn("type",[Fw,Bw,qw,Vw]),bh=O({type:ae("FLOW"),toolName:b().check(fr(1)),externalFlowId:b(),flowDisplayName:B(b())}),vh=O({type:ae("MCP"),toolName:b().check(fr(1)),serverUrl:th(),protocol:Ee(Lc),auth:Hw}),Eh=O({type:ae("KNOWLEDGE_BASE"),toolName:b().check(fr(1)),sourceType:Ee(Mc),sourceId:b(),sourceName:b()}),Gw=bn("type",[Lw,bh,vh,Eh]),Ww=O({displayName:b(),description:B(b()),type:Ee(Fc)}),Sh=O({type:ae("MARKDOWN"),markdown:b()}),Po={type:ae("TOOL_CALL"),input:Ke(fe(b(),pe())),output:B(pe()),toolName:b(),status:Ee(Bc),toolCallId:b(),startTime:b(),endTime:B(b())},E4=O(Po),Ph=bn("toolCallType",[O({...Po,toolCallType:ae("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),O({...Po,toolCallType:ae("FLOW"),displayName:b(),externalFlowId:b()}),O({...Po,toolCallType:ae("MCP"),displayName:b(),serverUrl:b()}),O({...Po,toolCallType:ae("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),O({...Po,toolCallType:ae("UNKNOWN"),displayName:b()})]),Zw=ye([Sh,Ph]);var qc=(r=>(r.IMAGE="image",r.TEXT="text",r))(qc||{}),Xr=O({apiKey:b()}),Jw=Xr,Kw=O({apiKey:b(),apiKeyHash:b()}),Qw=Xr,Yw=Xr,Xw=Xr,ex=Xr,tx=Xr,rx=Xr,nx=Xr,Ih=O({accessKeyId:b().check(fr(1)),secretAccessKey:b().check(fr(1))}),ox=O({}),ix=O({}),ax=O({}),sx=O({}),ux=O({}),cx=O({}),Rh=O({modelId:b(),modelName:b(),modelType:Ee(qc)}),Ch=O({apiKeyHeader:b(),baseUrl:b(),models:ge(Rh),defaultHeaders:B(fe(b(),b()))}),Oh=O({accountId:b(),gatewayId:b(),models:ge(Rh),vertexProject:B(b()),vertexRegion:B(b())}),kh=O({resourceName:b(),apiVersion:En(vn(t=>typeof t=="string"&&t.trim().length===0?void 0:t),B(b()))}),$h=O({region:b().check(fr(1))}),lx=ye([Jw,Xw,ex,tx,rx,Yw,Qw,Kw,Ih,nx]),Nh=ye([Ch,Oh,kh,$h,ox,ax,sx,ux,ix,cx]),dx=O({id:b(),name:b(),type:Ee(qc)}),px=O({id:b(),name:b(),provider:Ee($i),config:Nh,enabledForChat:ke()}),fx=O({provider:Ee($i),config:Nh,auth:lx,platformId:b()});var w4={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Th=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],mx=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],hx=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],wh=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],gx=["grok-4.20","grok-4.1-fast"],yx={openai:Th,anthropic:mx,google:wh,activepieces:[...hx.map(t=>`anthropic/${t}`),...Th.map(t=>`openai/${t}`),...wh.map(t=>`google/${t}`),...gx.map(t=>`x-ai/${t}`)]};var xh=128e3,_x={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function bx({provider:t}){return t?_x[t]??xh:xh}o(bx,"getMaxContextTokens");var Ah={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},vx={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Ex=new Set(["anthropic","mistral"]);function Ir(t){return{chatModels:yx[t],maxContextTokens:bx({provider:t}),defaultEmbeddingModel:Ah[t],supportsEmbedding:Ah[t]!==void 0,supportsImageGeneration:!Ex.has(t),webSearch:vx[t]}}o(Ir,"buildProviderCapabilities");var Sx={openai:Ir("openai"),anthropic:Ir("anthropic"),openrouter:Ir("openrouter"),azure:Ir("azure"),google:Ir("google"),"cloudflare-gateway":Ir("cloudflare-gateway"),custom:Ir("custom"),bedrock:Ir("bedrock"),mistral:Ir("mistral"),activepieces:Ir("activepieces")};var Px=O({base64Url:b(),fileName:b(),extension:B(b())}),Tx=O({mimeType:b(),url:b(),fileName:B(b())}),Vc=ye([Px,Tx]);var wx=ye([O({type:ae("file"),value:Vc}),O({type:ae("markdown"),value:b(),files:B(ge(Vc))})]),xx=O({sessionId:b(),message:b(),files:B(ge(b()))});var Dh=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Dh||{}),Uh=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Uh||{}),Hc=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Hc||{});var Ax=ye([O({...tr,name:b(),externalId:b(),type:ae("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:O({options:ge(O({value:b()}))})}),O({...tr,name:b(),externalId:b(),type:ye([ae("TEXT"),ae("NUMBER"),ae("DATE")]),tableId:b(),projectId:b()})]),Ix=O({...tr,name:b(),folderId:Ke(b()),projectId:b(),externalId:b(),status:jc(Uh),trigger:jc(Dh)}),Rx=O({...tr,tableId:b(),projectId:b(),cells:fe(b(),O({updated:b(),created:b(),value:pe(),fieldName:b()}))}),Cx=O({events:ge(Ee(Hc)),webhookUrl:b(),flowId:b()}),Ox=O({fields:ge(O({id:b(),name:b()})),rows:ge(fe(b(),b())),name:b()}),kx=O({projectId:b(),limit:B(Si.number()),cursor:B(b()),name:B(b()),externalIds:us(b()),folderId:B(b()),folderIds:us(b())}),$x=O({records:ge(ge(O({fieldId:b(),value:Mh()}))),tableId:b()}),Nx=O({cells:B(ge(O({fieldId:b(),value:Mh()}))),tableId:b(),agentUpdate:B(ke())}),jh=bn("operator",[Bn("eq"),Bn("neq"),Bn("gt"),Bn("gte"),Bn("lt"),Bn("lte"),Bn("co"),zh("exists"),zh("not_exists")]),zx=O({tableId:b(),limit:B(Si.number()),cursor:B(b()),filters:us(jh)});function Mh(){return En(vn(t=>t==null?t:String(t)),Ei(b()))}o(Mh,"coerceToString");function Bn(t){return O({fieldId:b(),operator:ae(t),value:b()})}o(Bn,"valueFilter");function zh(t){return O({fieldId:b(),operator:ae(t)})}o(zh,"existenceFilter");var Dx=O({status:B(wt()),body:B(pe()),headers:B(fe(b(),b()))}),Ux=O({...tr,deleted:Ke(Sn),ownerId:b(),displayName:b(),platformId:b(),externalId:Ke(b())});var Lh=O({name:b(),description:B(b()),type:b(),required:ke()}),jx=O({pieceName:b(),triggerName:b(),input:O({toolName:b(),toolDescription:b(),inputSchema:ge(Lh),returnsResponse:ke()})});var Fh="^[0-9]+\\.[0-9]+\\.[0-9]+$",V4=new RegExp(Fh),Lx="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",H4=b().check(_n(new RegExp(Fh))),G4=b().check(_n(new RegExp(Lx))),Fx=O({packageType:ae("ARCHIVE"),pieceType:Ee(vo),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),Bh=O({packageType:ae("REGISTRY"),pieceType:ae("OFFICIAL"),pieceName:b(),pieceVersion:b()}),qh=O({packageType:ae("REGISTRY"),pieceType:ae("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),W4=ye([Bh,qh]),Z4=ye([Fx,Bh,qh]);var Bx=bn("type",[O({type:ae("CRON_EXPRESSION"),cronExpression:b(),timezone:b()}),O({type:ae("INTERVAL"),intervalMs:rh().check(Xa(6e4))})]),J4=O({...tr,type:Ee(mr),projectId:b(),flowId:b(),triggerName:b(),schedule:Ke(Bx),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:Ke(b()),simulate:ke()}),Vh=(E=>(E.UNKNOWN="UNKNOWN",E.FLOW_RUN_LOG="FLOW_RUN_LOG",E.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",E.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",E.FLOW_STEP_FILE="FLOW_STEP_FILE",E.SAMPLE_DATA="SAMPLE_DATA",E.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",E.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",E.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",E.PROJECT_RELEASE="PROJECT_RELEASE",E.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",E.PLATFORM_ASSET="PLATFORM_ASSET",E.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",E.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",E.KNOWLEDGE_BASE="KNOWLEDGE_BASE",E.FLOW_BUNDLE="FLOW_BUNDLE",E))(Vh||{}),Hh=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Hh||{}),Gh=(r=>(r.S3="S3",r.DB="DB",r))(Gh||{}),K4=O({...tr,projectId:Ke(b()),platformId:Ke(b()),type:Ee(Vh),compression:Ee(Hh),data:B(pe()),location:Ee(Gh),size:Ke(wt()),fileName:Ke(b()),s3Key:Ke(b()),metadata:Ke(fe(b(),b()))}),Wh=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Wh||{}),Zh=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Zh||{}),Q4=O({id:b(),email:b(),firstName:b(),status:Ee(Zh),externalId:Ke(b()),platformId:Ke(b()),platformRole:Ee(Wh),lastName:b(),created:Sn,updated:Sn,lastActiveDate:Ke(Sn),imageUrl:Ke(b())});var Wc=O({...Ne.shape,..._e(fe(b(),pe()),"OBJECT").shape});var Qh=O({...Ne.shape,..._e(b(),"COLOR").shape});var Zc=ye([Lt,Jr,is,Qr,Ft,Kr,Nc,Pi,zc,Yr,xi,Wc,Ai,wi,Ti,Qh]),K={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 Rr=O({displayName:b(),description:B(b()),hasConnectionIdentifier:B(ke())});var Yh=O({username:b(),password:b()}),Jc=O({...Rr.shape,username:O({displayName:b(),description:B(b())}),password:O({displayName:b(),description:B(b())}),..._e(Yh,"BASIC_AUTH").shape});var Gx=fe(b(),ye([Lt,Jr,Yr,Qr,Ft])),Kc=O({...Rr.shape,props:Gx,..._e(pe(),"CUSTOM_AUTH").shape});var qn=O({...Rr.shape,..._e(O({auth:b()}),"SECRET_TEXT").shape});var Wx=fe(b(),ye([Lt,Jr,qn,Yr,Qr,Ft,Kr,is])),Xh=O({...Rr.shape,props:Wx,..._e(pe(),"OIDC").shape});var Qc=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Qc||{}),eg=ye([Lt,qn,Ft]),tg=fe(b(),eg),Zx=O({props:B(fe(b(),eg)),authUrl:b(),tokenUrl:b(),scope:ge(b()),prompt:B(ye([ae("none"),ae("consent"),ae("login"),ae("omit")])),pkce:B(ke()),pkceMethod:B(ye([ae("plain"),ae("S256")])),authorizationMethod:B(Ee(Qc)),grantType:B(ye([Ee(Ri),ae(Dc)])),extra:B(fe(b(),b()))}),rg=O({access_token:b(),props:B(tg),data:fe(b(),vi())}),Yc=O({...Rr.shape,...Zx.shape,..._e(rg,"OAUTH2").shape});var To=ye([Jc,Kc,Xh,Yc,qn]),Ni="Connection",ls={SecretText(t){return{...t,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(t){return{...t,valueSchema:void 0,type:"OAUTH2",displayName:t.displayName||Ni}},BasicAuth(t){return{...t,valueSchema:void 0,type:"BASIC_AUTH",displayName:t.displayName||Ni,required:!0}},CustomAuth(t){return{...t,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:t.displayName||Ni}},OIDC(t){return{...t,valueSchema:void 0,type:"OIDC",displayName:t.displayName||Ni}},None(){}};var R6={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 Jx=O({...Ne.shape,..._e(pe(),"CUSTOM").shape,code:b()});var Kx=ye([Zc,To]),Xc=fe(b(),Kx),J6=fe(b(),Zc);var ng=ye([O({strategy:ae("CRON"),cronExpression:b()}),O({strategy:ae("NONE")})]),wo=class{constructor(e,r,n,i,u,c,l,p,f,m,g,S,h,_,T,E,w,k,q){this.name=e;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=p;this.renewConfiguration=f;this.onRenew=m;this.onEnable=g;this.onDisable=S;this.onStart=h;this.run=_;this.test=T;this.sampleData=E;this.testStrategy=w;this.outputSchema=k;this.aiMetadata=q}static{o(this,"ITrigger")}},Pn=o(t=>{switch(t.type){case"WEBHOOK":return new wo(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 wo(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 wo(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 wo(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,et(t.sampleData)&&et(t.test)?"SIMULATION":"TEST_FUNCTION",t.outputSchema,t.aiMetadata)}},"createTrigger");var og="2",ds="0.82.0";var el=class{constructor(e,r,n,i,u,c,l,p,f=ds,m,g="",S){this.displayName=e;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=p;this.minimumSupportedRelease=f;this.maximumSupportedRelease=m;this.description=g;this.deprecated=S;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:og}),"getContextInfo");(!Yx(f)||Xx(f,ds))&&(this.minimumSupportedRelease=ds),u.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:Qx(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(e){return this._actions[e]}getTrigger(e){return this._triggers[e]}actions(){return this._actions}triggers(){return this._triggers}},ag=o(t=>{if(t.auth&&Array.isArray(t.auth)&&!t.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new el(t.displayName,t.logoUrl,t.authors??[],t.events,t.actions,t.triggers,t.categories??[],t.auth,t.minimumSupportedRelease,t.maximumSupportedRelease,t.description,t.deprecated)},"createPiece");function Qx(t){if(t!==void 0)return Array.isArray(t)?t.map(ig):ig(t)}o(Qx,"withConnectionIdentifierFlag");function ig(t){return{...t,hasConnectionIdentifier:t.getConnectionIdentifier!==void 0}}o(ig,"flagConnectionIdentifier");function Yx(t){return/^\d+\.\d+\.\d+$/.test(t)}o(Yx,"isValidSimpleSemver");function Xx(t,e){let[r,n,i]=t.split(".").map(Number),[u,c,l]=e.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Xx,"isSemverLessThan");var eA=B(fe(b(),fe(b(),b()))),sg=O({id:B(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:ge(b()),platformId:B(b()),directoryPath:B(b()),auth:B(ye([To,ge(To)])),version:b(),categories:B(ge(Ee(Eo))),minimumSupportedRelease:B(b()),maximumSupportedRelease:B(b()),deprecated:B(ke()),i18n:eA}),tA=Ee(["human","ai","both"]),ug=O({description:B(b()),idempotent:B(ke())}),cg=O({name:b(),displayName:b(),description:b(),props:Xc,requireAuth:ke(),errorHandlingOptions:B($c),outputSchema:B(ns()),audience:B(tA),aiMetadata:B(ug)}),lg=O({name:b(),displayName:b(),description:b(),props:Xc,errorHandlingOptions:B($c),type:Ee(mr),sampleData:pe(),handshakeConfiguration:B(ns()),renewConfiguration:B(ng),testStrategy:Ee(Oi),outputSchema:B(ns()),aiMetadata:B(ug)}),rA=O({...sg.shape,actions:fe(b(),cg),triggers:fe(b(),lg)}),nA=O({...sg.shape,actions:wt(),triggers:wt(),suggestedActions:B(ge(cg)),suggestedTriggers:B(ge(lg))}),dg=O({projectUsage:wt(),pieceType:Ee(vo),packageType:Ee(Ii),platformId:B(b()),archiveId:B(b())}),JV=O({...rA.shape,...dg.shape}),KV=O({...nA.shape,...dg.shape}),QV=O({name:b(),version:b()});var oA=gt(require("path")),iA=gt(require("fs/promises"));var hg=require("node:stream");var ps=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((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(e){let r={Accept:"application/json"};return e.authentication&&this.populateAuthentication(e.authentication,r),e.body&&(e.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),e.headers&&(r={...r,...e.headers}),r}populateAuthentication(e,r){this.authenticationConverter.convert(e,r)}};var fs=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(e=new tl,r=new rl){this.converters={BEARER_TOKEN:e,BASIC:r}}convert(e,r){return this.converters[e.type].convert(e,r)}},tl=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(e,r){return r.Authorization=`Bearer ${e.token}`,r}},rl=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 zi=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}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}}};function pg({error:t,requestBody:e}){return t instanceof zi?t.errorMessage():{response:{status:0,body:t instanceof Error?t.message:String(t)},request:{body:e}}}o(pg,"toFailsafeOutput");var xt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(xt||{});var ms=class extends ps{static{o(this,"FetchHttpClient")}constructor(e="",r=new fs){super(e,r)}async sendRequest(e,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(e),u=this.getHeaders(e),c=e.queryParams??{};for(let[q,G]of Object.entries(c))i.append(q,G);let l=i.toString(),p=l?`${n}?${l}`:n,f=e.responseType??"json",m=e.followRedirects??!0,g=e.retries??0,{body:S,extraHeaders:h,isStream:_}=aA(e.method)?sA(e.body,u):{body:void 0,extraHeaders:{},isStream:!1},T=cA({...u,...h}),E=await uA(async()=>{let q=new AbortController,G=e.timeout&&e.timeout>0?setTimeout(()=>q.abort(),e.timeout):void 0;try{let V={method:e.method.toString(),headers:T,body:S,redirect:m?"follow":"manual",signal:q.signal};return _&&(V.duplex="half"),r?.dispatcher!==void 0&&(V.dispatcher=r.dispatcher),await fetch(p,V)}finally{G!==void 0&&clearTimeout(G)}},g),w=m?300:400;if(E.status<200||E.status>=w){let q=await fg(E,f),G=new zi(e.body,{status:E.status,responseBody:q});throw console.error("[HttpClient#(sanitized error message)] Request failed:",G),G}let k=await fg(E,f);return{status:E.status,headers:lA(E.headers),body:k}}};function aA(t){return t!=="GET"&&t!=="HEAD"}o(aA,"acceptsRequestBody");function sA(t,e){if(pA(t))return{body:void 0,extraHeaders:{},isStream:!1};if(dA(t)){let n=new hg.PassThrough;return t.on("error",i=>n.destroy(i)),t.pipe(n),{body:n,extraHeaders:t.getHeaders(),isStream:!0}}return 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(sA,"serializeBody");async function fg(t,e){switch(e){case"arraybuffer":return Buffer.from(await t.arrayBuffer());case"blob":return await t.blob();case"text":return await t.text();default:{let r=await t.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(fg,"parseResponseBody");async function uA(t,e){let r;for(let n=0;n<=e;n++)try{let i=await t();if(i.status>=500&&n<e){await mg(n);continue}return i}catch(i){if(r=i,n<e){await mg(n);continue}throw i}throw r}o(uA,"sendWithRetries");function mg(t){let e=Math.min(1e3*2**t,3e4);return new Promise(r=>setTimeout(r,e))}o(mg,"backoff");function cA(t){let e={};for(let[r,n]of Object.entries(t))n!==void 0&&(e[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return e}o(cA,"normalizeHeaders");function lA(t){let e={};return t.forEach((r,n)=>{e[n]=r}),e}o(lA,"toHttpHeaders");function dA(t){return typeof t=="object"&&t!==null&&typeof t.getHeaders=="function"&&typeof t.pipe=="function"&&typeof t.on=="function"}o(dA,"isNodeFormData");function pA(t){return t==null}o(pA,"isNil");var Pe=new ms;var XI=gt(require("fs")),E_=gt(v_());var eR={"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 tR(t){let e=t.split(";")[0].trim().toLowerCase();return eR[e]??""}o(tR,"contentTypeToExtension");var rR=o(({baseUrl:t,relativePath:e})=>{let r=t.endsWith("/")?t:`${t}/`,n=e.startsWith("/")?e.slice(1):e;return`${r}${n}`},"joinBaseUrlWithRelativePath"),nR=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 S_({auth:t,baseUrl:e,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:p="headers"}){return nt({audience:"human",name:u||"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:K.DynamicProperties({auth:t,displayName:"",required:!0,refreshers:[],props:o(async({auth:f})=>({url:K.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
56
|
-
i.e ${nR(e,f)}/resource or /resource`,required:!0,defaultValue:f?e(f):"",...c?.url??{}})}),"props")}),method:K.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(xt).map(f=>({label:f,value:f}))},...c?.method??{}}),headers:K.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:K.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:K.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:K.DynamicProperties({auth:t,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:f})=>{if(!f)return{};let m=f,g={};switch(m){case"none":break;case"json":g.data=K.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":g.data=K.LongText({displayName:"Raw Body",required:!0});break;case"form_data":g.data=K.Array({displayName:"Form Data",required:!0,properties:{fieldName:K.ShortText({displayName:"Field Name",required:!0}),fieldType:K.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:K.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:K.File({displayName:"File Field Value",required:!1})}});break}return g},"props")}),response_is_binary:K.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:K.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:K.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:K.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async f=>{let{method:m,url:g,headers:S,queryParams:h,body:_,body_type:T,failsafe:E,timeout:w,response_is_binary:k,followRedirects:q}=f.propsValue;ss(m,"Method"),ss(g,"URL");let G=et(r)?{}:await r(f.auth,f.propsValue),V=g.url,H=V.startsWith("http://")||V.startsWith("https://")?V:rR({baseUrl:e(f.auth),relativePath:V}),J={method:m,url:H,headers:{...S??{},...p==="headers"||!et(p)?G:{}},queryParams:{...p==="queryParams"?G:{},...h??{}},timeout:w?w*1e3:0,followRedirects:q};if(k&&(J.responseType="arraybuffer"),_)if(T&&T!=="none"){let re=_.data;if(T==="form_data"){let Z=re,De=new E_.default;for(let{fieldName:Se,fieldType:be,textFieldValue:$e,fileFieldValue:Ie}of Z)be==="text"&&!ki($e)?De.append(Se,$e):be==="file"&&!ki(Ie)&&De.append(Se,Ie.data,{filename:Ie?.filename});J.body=De,J.headers={...J.headers,...De.getHeaders()}}else J.body=re}else T||(J.body=_);try{let re=await Pe.sendRequest(J);return await oR(f.files,re.body,re.status,re.headers,k)}catch(re){if(E)return pg({error:re,requestBody:J.body});throw re}},"run")})}o(S_,"createCustomApiCallAction");var oR=o(async(t,e,r,n,i)=>{let u;if(i&&iR(e)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=tR(c??"")||"txt",p;e instanceof ArrayBuffer?p=Buffer.from(new Uint8Array(e)):Buffer.isBuffer(e)?p=e:p=Buffer.from(e),u=await t.write({fileName:`output.${l}`,data:p})}else u=e;return{status:r,headers:n,body:u}},"handleBinaryResponse"),iR=o(t=>t instanceof ArrayBuffer||Buffer.isBuffer(t),"isBinaryBody");var ot={async poll(t,{store:e,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(t.strategy){case 0:{let l=await e.get("lastPoll");if(et(l))throw new Error("lastPoll doesn't exist in the store.");let p=await t.items({store:e,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),f=p.reduce((m,g)=>Math.max(m,g.epochMilliSeconds),l);return await e.put("lastPoll",f),p.filter(m=>m.epochMilliSeconds>l).map(m=>m.data)}case 1:{let l=await e.get("lastItem"),p=await t.items({store:e,auth:r,propsValue:n,lastItemId:l,files:u,server:c}),f=p.findIndex(S=>S.id===l),m=[];et(l)||f==-1?m=p??[]:m=p?.slice(0,f)??[],et(i)||(m=m.slice(-i));let g=m?.[0]?.id;return et(g)||await e.put("lastItem",g),m.map(S=>S.data)}}},async onEnable(t,{store:e,auth:r,propsValue:n,server:i,isRepublish:u}){switch(t.strategy){case 0:{if(u&&!et(await e.get("lastPoll")))break;await e.put("lastPoll",Date.now());break}case 1:{if(u&&!et(await e.get("lastItem")))break;let l=(await t.items({store:e,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;et(l)?await e.delete("lastItem"):await e.put("lastItem",l);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:u}){let c=[];switch(t.strategy){case 0:{c=await t.items({store:n,auth:e,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await t.items({store:n,auth:e,propsValue:r,lastItemId:null,files:i,server:u});break}}return aR(c.map(l=>l.data))}};function aR(t){return t.length<=5?t:t.slice(0,5)}o(aR,"getFirstFiveOrAll");var qp=gt(IS());var xe="https://bigquery.googleapis.com/bigquery/v2",Bp=["https://www.googleapis.com/auth/bigquery","email"],Oe=[ls.OAuth2({description:"Sign in with your Google account. If you are using your own OAuth2 credentials, make sure to include the following scope: `https://www.googleapis.com/auth/bigquery`",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:Bp}),ls.CustomAuth({displayName:"Service Account",description:"Use a GCP service account for automated, server-to-server access \u2014 no user sign-in required. Recommended for production workflows.",required:!0,props:{instructions:K.MarkDown({value:`**How to create a service account key:**
|
|
55
|
+
https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};var UE=class{static{a(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(t={}){if(this._cachedProjectId=t.projectId||null,this.cachedCredential=t.authClient||null,this.keyFilename=t.keyFilename||t.keyFile,this.scopes=t.scopes,this.clientOptions=t.clientOptions||{},this.jsonContent=t.credentials||null,this.apiKey=t.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(Qr.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);t.universeDomain&&(this.clientOptions.universeDomain=t.universeDomain)}setGapicJWTValues(t){t.defaultServicePath=this.defaultServicePath,t.useJWTAccessWithScope=this.useJWTAccessWithScope,t.defaultScopes=this.defaultScopes}getProjectId(t){if(t)this.getProjectIdAsync().then(n=>t(null,n),t);else return this.getProjectIdAsync()}async getProjectIdOptional(){try{return await this.getProjectId()}catch(t){if(t instanceof Error&&t.message===Qr.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)return null;throw t}}async findAndCacheProjectId(){let t=null;if(t||=await this.getProductionProjectId(),t||=await this.getFileProjectId(),t||=await this.getDefaultServiceProjectId(),t||=await this.getGCEProjectId(),t||=await this.getExternalAccountClientProjectId(),t)return this._cachedProjectId=t,t;throw new Error(Qr.GoogleAuthExceptionMessages.NO_PROJECT_ID_FOUND)}async getProjectIdAsync(){return this._cachedProjectId?this._cachedProjectId:(this._findProjectIdPromise||(this._findProjectIdPromise=this.findAndCacheProjectId()),this._findProjectIdPromise)}async getUniverseDomainFromMetadataServer(){let t;try{t=await mu.universe("universe-domain"),t||=DE.DEFAULT_UNIVERSE}catch(n){if(n&&n?.response?.status===404)t=DE.DEFAULT_UNIVERSE;else throw n}return t}async getUniverseDomain(){let t=(0,OC.originalOrCamelOptions)(this.clientOptions).get("universe_domain");try{t??=(await this.getClient()).universeDomain}catch{t??=DE.DEFAULT_UNIVERSE}return t}getAnyScopes(){return this.scopes||this.defaultScopes}getApplicationDefault(t={},n){let o;if(typeof t=="function"?n=t:o=t,n)this.getApplicationDefaultAsync(o).then(r=>n(null,r.credential,r.projectId),n);else return this.getApplicationDefaultAsync(o)}async getApplicationDefaultAsync(t={}){if(this.cachedCredential)return await this.#t(this.cachedCredential,null);let n;if(n=await this._tryGetApplicationCredentialsFromEnvironmentVariable(t),n)return n instanceof Ca.JWT?n.scopes=this.scopes:n instanceof hu.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(n=await this._tryGetApplicationCredentialsFromWellKnownFile(t),n)return n instanceof Ca.JWT?n.scopes=this.scopes:n instanceof hu.BaseExternalAccountClient&&(n.scopes=this.getAnyScopes()),await this.#t(n);if(await this._checkIsGCE())return t.scopes=this.getAnyScopes(),await this.#t(new E6.Compute(t));throw new Error(Qr.GoogleAuthExceptionMessages.NO_ADC_FOUND)}async#t(t,n=process.env.GOOGLE_CLOUD_QUOTA_PROJECT||null){let o=await this.getProjectIdOptional();return n&&(t.quotaProjectId=n),this.cachedCredential=t,{credential:t,projectId:o}}async _checkIsGCE(){return this.checkIsGCE===void 0&&(this.checkIsGCE=mu.getGCPResidency()||await mu.isAvailable()),this.checkIsGCE}async _tryGetApplicationCredentialsFromEnvironmentVariable(t){let n=process.env.GOOGLE_APPLICATION_CREDENTIALS||process.env.google_application_credentials;if(!n||n.length===0)return null;try{return this._getApplicationCredentialsFromFilePath(n,t)}catch(o){throw o instanceof Error&&(o.message=`Unable to read the credential file specified by the GOOGLE_APPLICATION_CREDENTIALS environment variable: ${o.message}`),o}}async _tryGetApplicationCredentialsFromWellKnownFile(t){let n=null;if(this._isWindows())n=process.env.APPDATA;else{let r=process.env.HOME;r&&(n=NE.join(r,".config"))}return n&&(n=NE.join(n,"gcloud","application_default_credentials.json"),fu.existsSync(n)||(n=null)),n?await this._getApplicationCredentialsFromFilePath(n,t):null}async _getApplicationCredentialsFromFilePath(t,n={}){if(!t||t.length===0)throw new Error("The file path is invalid.");try{if(t=fu.realpathSync(t),!fu.lstatSync(t).isFile())throw new Error}catch(r){throw r instanceof Error&&(r.message=`The file at ${t} does not exist, or it is not a file. ${r.message}`),r}let o=fu.createReadStream(t);return this.fromStream(o,n)}fromImpersonatedJSON(t){if(!t)throw new Error("Must pass in a JSON object containing an impersonated refresh token");if(t.type!==$a.IMPERSONATED_ACCOUNT_TYPE)throw new Error(`The incoming JSON object does not have the "${$a.IMPERSONATED_ACCOUNT_TYPE}" type`);if(!t.source_credentials)throw new Error("The incoming JSON object does not contain a source_credentials field");if(!t.service_account_impersonation_url)throw new Error("The incoming JSON object does not contain a service_account_impersonation_url field");let n=this.fromJSON(t.source_credentials);if(t.service_account_impersonation_url?.length>256)throw new RangeError(`Target principal is too long: ${t.service_account_impersonation_url}`);let o=/(?<target>[^/]+):(generateAccessToken|generateIdToken)$/.exec(t.service_account_impersonation_url)?.groups?.target;if(!o)throw new RangeError(`Cannot extract target principal from ${t.service_account_impersonation_url}`);let r=(this.scopes||t.scopes||this.defaultScopes)??[];return new $a.Impersonated({...t,sourceClient:n,targetPrincipal:o,targetScopes:Array.isArray(r)?r:[r]})}fromJSON(t,n={}){let o,r=(0,OC.originalOrCamelOptions)(n).get("universe_domain");return t.type===IC.USER_REFRESH_ACCOUNT_TYPE?(o=new IC.UserRefreshClient(n),o.fromJSON(t)):t.type===$a.IMPERSONATED_ACCOUNT_TYPE?o=this.fromImpersonatedJSON(t):t.type===hu.EXTERNAL_ACCOUNT_TYPE?(o=x6.ExternalAccountClient.fromJSON({...t,...n}),o.scopes=this.getAnyScopes()):t.type===RC.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE?o=new RC.ExternalAccountAuthorizedUserClient({...t,...n}):(n.scopes=this.scopes,o=new Ca.JWT(n),this.setGapicJWTValues(o),o.fromJSON(t)),r&&(o.universeDomain=r),o}_cacheClientFromJSON(t,n){let o=this.fromJSON(t,n);return this.jsonContent=t,this.cachedCredential=o,o}fromStream(t,n={},o){let r={};if(typeof n=="function"?o=n:r=n,o)this.fromStreamAsync(t,r).then(i=>o(null,i),o);else return this.fromStreamAsync(t,r)}fromStreamAsync(t,n){return new Promise((o,r)=>{if(!t)throw new Error("Must pass in a stream containing the Google auth settings.");let i=[];t.setEncoding("utf8").on("error",r).on("data",s=>i.push(s)).on("end",()=>{try{try{let s=JSON.parse(i.join("")),u=this._cacheClientFromJSON(s,n);return o(u)}catch(s){if(!this.keyFilename)throw s;let u=new Ca.JWT({...this.clientOptions,keyFile:this.keyFilename});return this.cachedCredential=u,this.setGapicJWTValues(u),o(u)}}catch(s){return r(s)}})})}fromAPIKey(t,n={}){return new Ca.JWT({...n,apiKey:t})}_isWindows(){let t=b6.platform();return!!(t&&t.length>=3&&t.substring(0,3).toLowerCase()==="win")}async getDefaultServiceProjectId(){return new Promise(t=>{(0,y6.exec)("gcloud config config-helper --format json",(n,o)=>{if(!n&&o)try{let r=JSON.parse(o).configuration.properties.core.project;t(r);return}catch{}t(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 n=await this.getClient();if(n&&n.projectId)return n.projectId}let t=await this._tryGetApplicationCredentialsFromEnvironmentVariable();return t?t.projectId:null}async getExternalAccountClientProjectId(){return!this.jsonContent||this.jsonContent.type!==hu.EXTERNAL_ACCOUNT_TYPE?null:await(await this.getClient()).getProjectId()}async getGCEProjectId(){try{return await mu.project("project-id")}catch{return null}}getCredentials(t){if(t)this.getCredentialsAsync().then(n=>t(null,n),t);else return this.getCredentialsAsync()}async getCredentialsAsync(){let t=await this.getClient();if(t instanceof $a.Impersonated)return{client_email:t.getTargetPrincipal()};if(t instanceof hu.BaseExternalAccountClient){let n=t.getServiceAccountEmail();if(n)return{client_email:n,universe_domain:t.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[n,o]=await Promise.all([mu.instance("service-accounts/default/email"),this.getUniverseDomain()]);return{client_email:n,universe_domain:o}}throw new Error(Qr.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 t=NE.resolve(this.keyFilename),n=fu.createReadStream(t);return await this.fromStreamAsync(n,this.clientOptions)}else if(this.apiKey){let t=await this.fromAPIKey(this.apiKey,this.clientOptions);t.scopes=this.scopes;let{credential:n}=await this.#t(t);return n}else{let{credential:t}=await this.getApplicationDefaultAsync(this.clientOptions);return t}}async getIdTokenClient(t){let n=await this.getClient();if(!("fetchIdToken"in n))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 S6.IdTokenClient({targetAudience:t,idTokenProvider:n})}async getAccessToken(){return(await(await this.getClient()).getAccessToken()).token}async getRequestHeaders(t){return(await this.getClient()).getRequestHeaders(t)}async authorizeRequest(t={}){let n=t.url,r=await(await this.getClient()).getRequestHeaders(n);return t.headers=_6.Gaxios.mergeHeaders(t.headers,r),t}async fetch(...t){return(await this.getClient()).fetch(...t)}async request(t){return(await this.getClient()).request(t)}getEnv(){return(0,P6.getEnv)()}async sign(t,n){let o=await this.getClient(),r=await this.getUniverseDomain();if(n=n||`https://iamcredentials.${r}/v1/projects/-/serviceAccounts/`,o instanceof $a.Impersonated)return(await o.sign(t)).signedBlob;let i=(0,v6.createCrypto)();if(o instanceof Ca.JWT&&o.key)return await i.sign(o.key,t);let s=await this.getCredentials();if(!s.client_email)throw new Error("Cannot sign data without `client_email`.");return this.signBlob(i,s.client_email,t,n)}async signBlob(t,n,o,r){let i=new URL(r+`${n}:signBlob`);return(await this.request({method:"POST",url:i.href,data:{payload:t.encodeBase64StringUtf8(o)},retry:!0,retryConfig:{httpMethodsToRetry:["POST"]}})).data.signedBlob}};Qr.GoogleAuth=UE});var CC=B(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.IAMAuth=void 0;var jE=class{static{a(this,"IAMAuth")}selector;token;constructor(t,n){this.selector=t,this.token=n,this.selector=t,this.token=n}getRequestHeaders(){return{"x-goog-iam-authority-selector":this.selector,"x-goog-iam-authorization-token":this.token}}};rm.IAMAuth=jE});var $C=B(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.DownscopedClient=mn.EXPIRATION_TIME_OFFSET=mn.MAX_ACCESS_BOUNDARY_RULES_COUNT=void 0;var T6=kt(),w6=require("stream"),ME=yr(),A6=Df(),I6="urn:ietf:params:oauth:grant-type:token-exchange",R6="urn:ietf:params:oauth:token-type:access_token",O6="urn:ietf:params:oauth:token-type:access_token";mn.MAX_ACCESS_BOUNDARY_RULES_COUNT=10;mn.EXPIRATION_TIME_OFFSET=300*1e3;var LE=class extends ME.AuthClient{static{a(this,"DownscopedClient")}authClient;credentialAccessBoundary;cachedDownscopedAccessToken;stsCredential;constructor(t,n={accessBoundary:{accessBoundaryRules:[]}}){if(super(t instanceof ME.AuthClient?{}:t),t instanceof ME.AuthClient?(this.authClient=t,this.credentialAccessBoundary=n):(this.authClient=t.authClient,this.credentialAccessBoundary=t.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>mn.MAX_ACCESS_BOUNDARY_RULES_COUNT)throw new Error(`The provided access boundary has more than ${mn.MAX_ACCESS_BOUNDARY_RULES_COUNT} access boundary rules.`);for(let o of this.credentialAccessBoundary.accessBoundary.accessBoundaryRules)if(o.availablePermissions.length===0)throw new Error("At least one permission should be defined in access boundary rules.");this.stsCredential=new A6.StsCredentials({tokenExchangeEndpoint:`https://sts.${this.universeDomain}/v1/token`}),this.cachedDownscopedAccessToken=null}setCredentials(t){if(!t.expiry_date)throw new Error("The access token expiry_date field is missing in the provided credentials.");super.setCredentials(t),this.cachedDownscopedAccessToken=t}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 t=await this.getAccessToken(),n=new Headers({authorization:`Bearer ${t.token}`});return this.addSharedMetadataHeaders(n)}request(t,n){if(n)this.requestAsync(t).then(o=>n(null,o),o=>n(o,o.response));else return this.requestAsync(t)}async requestAsync(t,n=!1){let o;try{let r=await this.getRequestHeaders();t.headers=T6.Gaxios.mergeHeaders(t.headers),this.addUserProjectAndAuthHeaders(t.headers,r),o=await this.transporter.request(t)}catch(r){let i=r.response;if(i){let s=i.status,u=i.config.data instanceof w6.Readable;if(!n&&(s===401||s===403)&&!u&&this.forceRefreshOnFailure)return await this.refreshAccessTokenAsync(),await this.requestAsync(t,!0)}throw r}return o}async refreshAccessTokenAsync(){let t=(await this.authClient.getAccessToken()).token,n={grantType:I6,requestedTokenType:R6,subjectToken:t,subjectTokenType:O6},o=await this.stsCredential.exchangeToken(n,void 0,this.credentialAccessBoundary),r=this.authClient.credentials?.expiry_date||null,i=o.expires_in?new Date().getTime()+o.expires_in*1e3:r;return this.cachedDownscopedAccessToken={access_token:o.access_token,expiry_date:i,res:o.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(t){let n=new Date().getTime();return t.expiry_date?n>=t.expiry_date-this.eagerRefreshThresholdMillis:!1}};mn.DownscopedClient=LE});var zC=B(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});nm.PassThroughClient=void 0;var k6=yr(),FE=class extends k6.AuthClient{static{a(this,"PassThroughClient")}async request(t){return this.transporter.request(t)}async getAccessToken(){return{}}async getRequestHeaders(){return new Headers}};nm.PassThroughClient=FE});var MC=B(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 NC=kC();Object.defineProperty(ae,"GoogleAuth",{enumerable:!0,get:a(function(){return NC.GoogleAuth},"get")});ae.gcpMetadata=Yc();ae.gaxios=kt();var DC=yr();Object.defineProperty(ae,"AuthClient",{enumerable:!0,get:a(function(){return DC.AuthClient},"get")});Object.defineProperty(ae,"DEFAULT_UNIVERSE",{enumerable:!0,get:a(function(){return DC.DEFAULT_UNIVERSE},"get")});var C6=Iv();Object.defineProperty(ae,"Compute",{enumerable:!0,get:a(function(){return C6.Compute},"get")});var $6=kv();Object.defineProperty(ae,"GCPEnv",{enumerable:!0,get:a(function(){return $6.GCPEnv},"get")});var z6=CC();Object.defineProperty(ae,"IAMAuth",{enumerable:!0,get:a(function(){return z6.IAMAuth},"get")});var N6=Ov();Object.defineProperty(ae,"IdTokenClient",{enumerable:!0,get:a(function(){return N6.IdTokenClient},"get")});var D6=Wv();Object.defineProperty(ae,"JWTAccess",{enumerable:!0,get:a(function(){return D6.JWTAccess},"get")});var U6=Kv();Object.defineProperty(ae,"JWT",{enumerable:!0,get:a(function(){return U6.JWT},"get")});var j6=eE();Object.defineProperty(ae,"Impersonated",{enumerable:!0,get:a(function(){return j6.Impersonated},"get")});var BE=oi();Object.defineProperty(ae,"CodeChallengeMethod",{enumerable:!0,get:a(function(){return BE.CodeChallengeMethod},"get")});Object.defineProperty(ae,"OAuth2Client",{enumerable:!0,get:a(function(){return BE.OAuth2Client},"get")});Object.defineProperty(ae,"ClientAuthentication",{enumerable:!0,get:a(function(){return BE.ClientAuthentication},"get")});var M6=xv();Object.defineProperty(ae,"LoginTicket",{enumerable:!0,get:a(function(){return M6.LoginTicket},"get")});var L6=Qv();Object.defineProperty(ae,"UserRefreshClient",{enumerable:!0,get:a(function(){return L6.UserRefreshClient},"get")});var F6=bE();Object.defineProperty(ae,"AwsClient",{enumerable:!0,get:a(function(){return F6.AwsClient},"get")});var B6=gE();Object.defineProperty(ae,"AwsRequestSigner",{enumerable:!0,get:a(function(){return B6.AwsRequestSigner},"get")});var q6=mE();Object.defineProperty(ae,"IdentityPoolClient",{enumerable:!0,get:a(function(){return q6.IdentityPoolClient},"get")});var V6=kE();Object.defineProperty(ae,"ExternalAccountClient",{enumerable:!0,get:a(function(){return V6.ExternalAccountClient},"get")});var Z6=yo();Object.defineProperty(ae,"BaseExternalAccountClient",{enumerable:!0,get:a(function(){return Z6.BaseExternalAccountClient},"get")});var H6=$C();Object.defineProperty(ae,"DownscopedClient",{enumerable:!0,get:a(function(){return H6.DownscopedClient},"get")});var UC=RE();Object.defineProperty(ae,"PluggableAuthClient",{enumerable:!0,get:a(function(){return UC.PluggableAuthClient},"get")});Object.defineProperty(ae,"ExecutableError",{enumerable:!0,get:a(function(){return UC.ExecutableError},"get")});var jC=zE();Object.defineProperty(ae,"EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE",{enumerable:!0,get:a(function(){return jC.EXTERNAL_ACCOUNT_AUTHORIZED_USER_TYPE},"get")});Object.defineProperty(ae,"ExternalAccountAuthorizedUserClient",{enumerable:!0,get:a(function(){return jC.ExternalAccountAuthorizedUserClient},"get")});var G6=zC();Object.defineProperty(ae,"PassThroughClient",{enumerable:!0,get:a(function(){return G6.PassThroughClient},"get")});var W6=new NC.GoogleAuth;ae.auth=W6});var rq={};ar(rq,{bigQueryAuth:()=>Ue,googleBigQuery:()=>tq});module.exports=F$(rq);var cr={};ar(cr,{$ZodAny:()=>as,$ZodArray:()=>ls,$ZodAsyncError:()=>jr,$ZodBase64:()=>kl,$ZodBase64URL:()=>Cl,$ZodBigInt:()=>zi,$ZodBigIntFormat:()=>Dl,$ZodBoolean:()=>Oo,$ZodCIDRv4:()=>Rl,$ZodCIDRv6:()=>Ol,$ZodCUID:()=>yl,$ZodCUID2:()=>_l,$ZodCatch:()=>Ql,$ZodCheck:()=>Ge,$ZodCheckBigIntFormat:()=>Eh,$ZodCheckEndsWith:()=>$h,$ZodCheckGreaterThan:()=>al,$ZodCheckIncludes:()=>kh,$ZodCheckLengthEquals:()=>Ah,$ZodCheckLessThan:()=>il,$ZodCheckLowerCase:()=>Rh,$ZodCheckMaxLength:()=>Th,$ZodCheckMaxSize:()=>Sh,$ZodCheckMimeType:()=>Nh,$ZodCheckMinLength:()=>wh,$ZodCheckMinSize:()=>Ph,$ZodCheckMultipleOf:()=>bh,$ZodCheckNumberFormat:()=>vh,$ZodCheckOverwrite:()=>Dh,$ZodCheckProperty:()=>zh,$ZodCheckRegex:()=>Ih,$ZodCheckSizeEquals:()=>xh,$ZodCheckStartsWith:()=>Ch,$ZodCheckStringFormat:()=>Ci,$ZodCheckUpperCase:()=>Oh,$ZodCodec:()=>Di,$ZodCustom:()=>bs,$ZodCustomStringFormat:()=>Nl,$ZodDate:()=>us,$ZodDefault:()=>Wl,$ZodDiscriminatedUnion:()=>ds,$ZodE164:()=>$l,$ZodEmail:()=>ml,$ZodEmoji:()=>hl,$ZodEncodeError:()=>Zn,$ZodEnum:()=>ms,$ZodError:()=>es,$ZodExactOptional:()=>Gl,$ZodFile:()=>Hl,$ZodFunction:()=>rd,$ZodGUID:()=>pl,$ZodIPv4:()=>wl,$ZodIPv6:()=>Al,$ZodISODate:()=>Pl,$ZodISODateTime:()=>Sl,$ZodISODuration:()=>Tl,$ZodISOTime:()=>xl,$ZodIntersection:()=>ql,$ZodJWT:()=>zl,$ZodKSUID:()=>El,$ZodLazy:()=>od,$ZodLiteral:()=>hs,$ZodMAC:()=>Il,$ZodMap:()=>Vl,$ZodNaN:()=>Yl,$ZodNanoID:()=>gl,$ZodNever:()=>Ll,$ZodNonOptional:()=>Kl,$ZodNull:()=>Ml,$ZodNullable:()=>ys,$ZodNumber:()=>$i,$ZodNumberFormat:()=>is,$ZodObject:()=>Fl,$ZodObjectJIT:()=>Lh,$ZodOptional:()=>Ni,$ZodPipe:()=>_s,$ZodPrefault:()=>Jl,$ZodPromise:()=>nd,$ZodReadonly:()=>ed,$ZodRealError:()=>Wt,$ZodRecord:()=>fs,$ZodRegistry:()=>id,$ZodSet:()=>Zl,$ZodString:()=>Pn,$ZodStringFormat:()=>Be,$ZodSuccess:()=>Xl,$ZodSymbol:()=>Ul,$ZodTemplateLiteral:()=>td,$ZodTransform:()=>gs,$ZodTuple:()=>ps,$ZodType:()=>he,$ZodULID:()=>bl,$ZodURL:()=>os,$ZodUUID:()=>fl,$ZodUndefined:()=>jl,$ZodUnion:()=>ko,$ZodUnknown:()=>ss,$ZodVoid:()=>cs,$ZodXID:()=>vl,$ZodXor:()=>Bl,$brand:()=>Ga,$constructor:()=>A,$input:()=>sd,$output:()=>ad,Doc:()=>ns,JSONSchema:()=>FP,JSONSchemaGenerator:()=>Dd,NEVER:()=>qu,TimePrecision:()=>ud,_any:()=>Ys,_array:()=>$g,_base64:()=>qs,_base64url:()=>Vs,_bigint:()=>_d,_boolean:()=>Ks,_catch:()=>GN,_check:()=>LP,_cidrv4:()=>Fs,_cidrv6:()=>Bs,_coercedBigint:()=>Qs,_coercedBoolean:()=>Xs,_coercedDate:()=>rc,_coercedNumber:()=>Ws,_coercedString:()=>ws,_cuid:()=>zs,_cuid2:()=>Ns,_custom:()=>cc,_date:()=>Td,_decode:()=>Ku,_decodeAsync:()=>Qu,_default:()=>VN,_discriminatedUnion:()=>CN,_e164:()=>Zs,_email:()=>As,_emoji:()=>Cs,_encode:()=>Ju,_encodeAsync:()=>Xu,_endsWith:()=>Uo,_enum:()=>jN,_file:()=>Ad,_float32:()=>md,_float64:()=>hd,_gt:()=>Lr,_gte:()=>yt,_guid:()=>Mi,_includes:()=>No,_int:()=>Js,_int32:()=>gd,_int64:()=>bd,_intersection:()=>$N,_ipv4:()=>Ms,_ipv6:()=>Ls,_isoDate:()=>dd,_isoDateTime:()=>ld,_isoDuration:()=>fd,_isoTime:()=>pd,_jwt:()=>Hs,_ksuid:()=>js,_lazy:()=>XN,_length:()=>Qn,_literal:()=>LN,_lowercase:()=>$o,_lt:()=>Mr,_lte:()=>Lt,_mac:()=>cd,_map:()=>DN,_max:()=>Lt,_maxLength:()=>Xn,_maxSize:()=>Tn,_mime:()=>jo,_min:()=>yt,_minLength:()=>ct,_minSize:()=>Fr,_multipleOf:()=>xn,_nan:()=>wd,_nanoid:()=>$s,_nativeEnum:()=>MN,_negative:()=>oc,_never:()=>xd,_nonnegative:()=>ac,_nonoptional:()=>ZN,_nonpositive:()=>ic,_normalize:()=>Mo,_null:()=>Pd,_nullable:()=>qN,_number:()=>Gs,_optional:()=>BN,_overwrite:()=>Tr,_parse:()=>wi,_parseAsync:()=>Ai,_pipe:()=>WN,_positive:()=>nc,_promise:()=>QN,_property:()=>sc,_readonly:()=>JN,_record:()=>NN,_refine:()=>Id,_regex:()=>Rt,_safeDecode:()=>el,_safeDecodeAsync:()=>rl,_safeEncode:()=>Yu,_safeEncodeAsync:()=>tl,_safeParse:()=>Ii,_safeParseAsync:()=>Oi,_set:()=>UN,_size:()=>Kn,_slugify:()=>Li,_startsWith:()=>Do,_string:()=>Ts,_stringFormat:()=>qo,_stringbool:()=>Cd,_success:()=>HN,_superRefine:()=>Rd,_symbol:()=>Ed,_templateLiteral:()=>KN,_toLowerCase:()=>Fo,_toUpperCase:()=>Bo,_transform:()=>FN,_trim:()=>Lo,_tuple:()=>zN,_uint32:()=>yd,_uint64:()=>vd,_ulid:()=>Ds,_undefined:()=>Sd,_union:()=>ON,_unknown:()=>ec,_uppercase:()=>zo,_url:()=>Co,_uuid:()=>Is,_uuidv4:()=>Rs,_uuidv6:()=>Os,_uuidv7:()=>ks,_void:()=>tc,_xid:()=>Us,_xor:()=>kN,clone:()=>bt,config:()=>it,createStandardJSONSchemaMethod:()=>Fi,createToJSONSchemaMethod:()=>zg,decode:()=>sP,decodeAsync:()=>uP,describe:()=>Od,encode:()=>aP,encodeAsync:()=>cP,extractDefs:()=>eo,finalize:()=>to,flattenError:()=>xi,formatError:()=>Ti,globalConfig:()=>Ha,globalRegistry:()=>vt,initializeContext:()=>Yn,isValidBase64:()=>Mh,isValidBase64URL:()=>kP,isValidJWT:()=>CP,locales:()=>ji,meta:()=>kd,parse:()=>Ao,parseAsync:()=>Io,prettifyError:()=>Wu,process:()=>qe,regexes:()=>Jt,registry:()=>xs,safeDecode:()=>dP,safeDecodeAsync:()=>fP,safeEncode:()=>lP,safeEncodeAsync:()=>pP,safeParse:()=>Ri,safeParseAsync:()=>ki,toDotPath:()=>iP,toJSONSchema:()=>uc,treeifyError:()=>Gu,util:()=>X,version:()=>Uh});var qu=Object.freeze({status:"aborted"});function A(e,t,n){function o(u,d){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:d,constr:s,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,d);let p=s.prototype,f=Object.keys(p);for(let g=0;g<f.length;g++){let y=f[g];y in u||(u[y]=p[y].bind(u))}}a(o,"init");let r=n?.Parent??Object;class i extends r{static{a(this,"Definition")}}Object.defineProperty(i,"name",{value:e});function s(u){var d;let p=n?.Parent?new i:this;o(p,u),(d=p._zod).deferred??(d.deferred=[]);for(let f of p._zod.deferred)f();return p}return a(s,"_"),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a(u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}a(A,"$constructor");var Ga=Symbol("zod_brand"),jr=class extends Error{static{a(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Zn=class extends Error{static{a(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Ha={};function it(e){return e&&Object.assign(Ha,e),Ha}a(it,"config");var X={};ar(X,{BIGINT_FORMAT_RANGES:()=>Vm,Class:()=>Um,NUMBER_FORMAT_RANGES:()=>qm,aborted:()=>Jn,allowsEval:()=>Lm,assert:()=>H$,assertEqual:()=>B$,assertIs:()=>V$,assertNever:()=>Z$,assertNotEqual:()=>q$,assignProp:()=>Gn,base64ToUint8Array:()=>rP,base64urlToUint8Array:()=>nz,cached:()=>Si,captureStackTrace:()=>Zu,cleanEnum:()=>rz,cleanRegex:()=>Ka,clone:()=>bt,cloneDef:()=>W$,createTransparentProxy:()=>ez,defineLazy:()=>Se,esc:()=>Vu,escapeRegex:()=>xr,extend:()=>QS,finalizeIssue:()=>Gt,floatSafeRemainder:()=>jm,getElementAtPath:()=>J$,getEnumValues:()=>Ja,getLengthableOrigin:()=>Ya,getParsedType:()=>Y$,getSizableOrigin:()=>Qa,hexToUint8Array:()=>iz,isObject:()=>wo,isPlainObject:()=>Wn,issue:()=>Pi,joinValues:()=>L,jsonStringifyReplacer:()=>Ei,merge:()=>tz,mergeDefs:()=>Sn,normalizeParams:()=>J,nullish:()=>Hn,numKeys:()=>Q$,objectClone:()=>G$,omit:()=>XS,optionalKeys:()=>Bm,parsedType:()=>Q,partial:()=>eP,pick:()=>KS,prefixIssues:()=>sr,primitiveTypes:()=>Fm,promiseAllObject:()=>K$,propertyKeyTypes:()=>Xa,randomString:()=>X$,required:()=>tP,safeExtend:()=>YS,shallowClone:()=>Hu,slugify:()=>Mm,stringifyPrimitive:()=>K,uint8ArrayToBase64:()=>nP,uint8ArrayToBase64url:()=>oz,uint8ArrayToHex:()=>az,unwrapMessage:()=>Wa});function B$(e){return e}a(B$,"assertEqual");function q$(e){return e}a(q$,"assertNotEqual");function V$(e){}a(V$,"assertIs");function Z$(e){throw new Error("Unexpected value in exhaustive check")}a(Z$,"assertNever");function H$(e){}a(H$,"assert");function Ja(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}a(Ja,"getEnumValues");function L(e,t="|"){return e.map(n=>K(n)).join(t)}a(L,"joinValues");function Ei(e,t){return typeof t=="bigint"?t.toString():t}a(Ei,"jsonStringifyReplacer");function Si(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}a(Si,"cached");function Hn(e){return e==null}a(Hn,"nullish");function Ka(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}a(Ka,"cleanRegex");function jm(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let d=o.match(/\d?e-(\d?)/);d?.[1]&&(r=Number.parseInt(d[1]))}let i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return s%u/10**i}a(jm,"floatSafeRemainder");var JS=Symbol("evaluating");function Se(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==JS)return o===void 0&&(o=JS,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}a(Se,"defineLazy");function G$(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}a(G$,"objectClone");function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}a(Gn,"assignProp");function Sn(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}a(Sn,"mergeDefs");function W$(e){return Sn(e._zod.def)}a(W$,"cloneDef");function J$(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}a(J$,"getElementAtPath");function K$(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}a(K$,"promiseAllObject");function X$(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}a(X$,"randomString");function Vu(e){return JSON.stringify(e)}a(Vu,"esc");function Mm(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}a(Mm,"slugify");var Zu="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}a(wo,"isObject");var Lm=Si(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Wn(e){if(wo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(wo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}a(Wn,"isPlainObject");function Hu(e){return Wn(e)?{...e}:Array.isArray(e)?[...e]:e}a(Hu,"shallowClone");function Q$(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}a(Q$,"numKeys");var Y$=a(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Xa=new Set(["string","number","symbol"]),Fm=new Set(["string","number","bigint","boolean","symbol","undefined"]);function xr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(xr,"escapeRegex");function bt(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}a(bt,"clone");function J(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:a(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:a(()=>t.error,"error")}:t}a(J,"normalizeParams");function ez(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}a(ez,"createTransparentProxy");function K(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}a(K,"stringifyPrimitive");function Bm(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}a(Bm,"optionalKeys");var qm={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]},Vm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function KS(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Sn(e._zod.def,{get shape(){let s={};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(s[u]=n.shape[u])}return Gn(this,"shape",s),s},checks:[]});return bt(e,i)}a(KS,"pick");function XS(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Sn(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let u in t){if(!(u in n.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete s[u]}return Gn(this,"shape",s),s},checks:[]});return bt(e,i)}a(XS,"omit");function QS(e,t){if(!Wn(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Sn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Gn(this,"shape",i),i}});return bt(e,r)}a(QS,"extend");function YS(e,t){if(!Wn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Sn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Gn(this,"shape",o),o}});return bt(e,n)}a(YS,"safeExtend");function tz(e,t){let n=Sn(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Gn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return bt(e,n)}a(tz,"merge");function eP(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Sn(t._zod.def,{get shape(){let u=t._zod.def.shape,d={...u};if(n)for(let p in n){if(!(p in u))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:u[p]}):u[p])}else for(let p in u)d[p]=e?new e({type:"optional",innerType:u[p]}):u[p];return Gn(this,"shape",d),d},checks:[]});return bt(t,s)}a(eP,"partial");function tP(e,t,n){let o=Sn(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:r[s]}))}else for(let s in r)i[s]=new e({type:"nonoptional",innerType:r[s]});return Gn(this,"shape",i),i}});return bt(t,o)}a(tP,"required");function Jn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}a(Jn,"aborted");function sr(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}a(sr,"prefixIssues");function Wa(e){return typeof e=="string"?e:e?.message}a(Wa,"unwrapMessage");function Gt(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Wa(e.inst?._zod.def?.error?.(e))??Wa(t?.error?.(e))??Wa(n.customError?.(e))??Wa(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}a(Gt,"finalizeIssue");function Qa(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}a(Qa,"getSizableOrigin");function Ya(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}a(Ya,"getLengthableOrigin");function Q(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}a(Q,"parsedType");function Pi(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}a(Pi,"issue");function rz(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}a(rz,"cleanEnum");function rP(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}a(rP,"base64ToUint8Array");function nP(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}a(nP,"uint8ArrayToBase64");function nz(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return rP(t+n)}a(nz,"base64urlToUint8Array");function oz(e){return nP(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}a(oz,"uint8ArrayToBase64url");function iz(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}a(iz,"hexToUint8Array");function az(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}a(az,"uint8ArrayToHex");var Um=class{static{a(this,"Class")}constructor(...t){}};var oP=a((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ei,2),Object.defineProperty(e,"toString",{value:a(()=>e.message,"value"),enumerable:!1})},"initializer"),es=A("$ZodError",oP),Wt=A("$ZodError",oP,{Parent:Error});function xi(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}a(xi,"flattenError");function Ti(e,t=n=>n.message){let n={_errors:[]},o=a(r=>{for(let i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let s=n,u=0;for(;u<i.path.length;){let d=i.path[u];u===i.path.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(t(i))):s[d]=s[d]||{_errors:[]},s=s[d],u++}}},"processError");return o(e),n}a(Ti,"formatError");function Gu(e,t=n=>n.message){let n={errors:[]},o=a((r,i=[])=>{var s,u;for(let d of r.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(p=>o({issues:p},d.path));else if(d.code==="invalid_key")o({issues:d.issues},d.path);else if(d.code==="invalid_element")o({issues:d.issues},d.path);else{let p=[...i,...d.path];if(p.length===0){n.errors.push(t(d));continue}let f=n,g=0;for(;g<p.length;){let y=p[g],h=g===p.length-1;typeof y=="string"?(f.properties??(f.properties={}),(s=f.properties)[y]??(s[y]={errors:[]}),f=f.properties[y]):(f.items??(f.items=[]),(u=f.items)[y]??(u[y]={errors:[]}),f=f.items[y]),h&&f.errors.push(t(d)),g++}}},"processError");return o(e),n}a(Gu,"treeifyError");function iP(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}a(iP,"toDotPath");function Wu(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${iP(o.path)}`);return t.join(`
|
|
56
|
+
`)}a(Wu,"prettifyError");var wi=a(e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new jr;if(s.issues.length){let u=new(r?.Err??e)(s.issues.map(d=>Gt(d,i,it())));throw Zu(u,r?.callee),u}return s.value},"_parse"),Ao=wi(Wt),Ai=a(e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let u=new(r?.Err??e)(s.issues.map(d=>Gt(d,i,it())));throw Zu(u,r?.callee),u}return s.value},"_parseAsync"),Io=Ai(Wt),Ii=a(e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new jr;return i.issues.length?{success:!1,error:new(e??es)(i.issues.map(s=>Gt(s,r,it())))}:{success:!0,data:i.value}},"_safeParse"),Ri=Ii(Wt),Oi=a(e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Gt(s,r,it())))}:{success:!0,data:i.value}},"_safeParseAsync"),ki=Oi(Wt),Ju=a(e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return wi(e)(t,n,r)},"_encode"),aP=Ju(Wt),Ku=a(e=>(t,n,o)=>wi(e)(t,n,o),"_decode"),sP=Ku(Wt),Xu=a(e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ai(e)(t,n,r)},"_encodeAsync"),cP=Xu(Wt),Qu=a(e=>async(t,n,o)=>Ai(e)(t,n,o),"_decodeAsync"),uP=Qu(Wt),Yu=a(e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Ii(e)(t,n,r)},"_safeEncode"),lP=Yu(Wt),el=a(e=>(t,n,o)=>Ii(e)(t,n,o),"_safeDecode"),dP=el(Wt),tl=a(e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Oi(e)(t,n,r)},"_safeEncodeAsync"),pP=tl(Wt),rl=a(e=>async(t,n,o)=>Oi(e)(t,n,o),"_safeDecodeAsync"),fP=rl(Wt);var Jt={};ar(Jt,{base64:()=>ah,base64url:()=>nl,bigint:()=>ph,boolean:()=>mh,browserEmail:()=>hz,cidrv4:()=>oh,cidrv6:()=>ih,cuid:()=>Zm,cuid2:()=>Hm,date:()=>ch,datetime:()=>lh,domain:()=>_z,duration:()=>Xm,e164:()=>sh,email:()=>Ym,emoji:()=>eh,extendedDuration:()=>cz,guid:()=>Qm,hex:()=>bz,hostname:()=>yz,html5Email:()=>pz,idnEmail:()=>mz,integer:()=>fh,ipv4:()=>th,ipv6:()=>rh,ksuid:()=>Jm,lowercase:()=>yh,mac:()=>nh,md5_base64:()=>Ez,md5_base64url:()=>Sz,md5_hex:()=>vz,nanoid:()=>Km,null:()=>hh,number:()=>ol,rfc5322Email:()=>fz,sha1_base64:()=>xz,sha1_base64url:()=>Tz,sha1_hex:()=>Pz,sha256_base64:()=>Az,sha256_base64url:()=>Iz,sha256_hex:()=>wz,sha384_base64:()=>Oz,sha384_base64url:()=>kz,sha384_hex:()=>Rz,sha512_base64:()=>$z,sha512_base64url:()=>zz,sha512_hex:()=>Cz,string:()=>dh,time:()=>uh,ulid:()=>Gm,undefined:()=>gh,unicodeEmail:()=>mP,uppercase:()=>_h,uuid:()=>Ro,uuid4:()=>uz,uuid6:()=>lz,uuid7:()=>dz,xid:()=>Wm});var Zm=/^[cC][^\s-]{8,}$/,Hm=/^[0-9a-z]+$/,Gm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Wm=/^[0-9a-vA-V]{20}$/,Jm=/^[A-Za-z0-9]{27}$/,Km=/^[a-zA-Z0-9_-]{21}$/,Xm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,cz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Qm=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ro=a(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),uz=Ro(4),lz=Ro(6),dz=Ro(7),Ym=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,pz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,fz=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,mP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mz=mP,hz=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function eh(){return new RegExp(gz,"u")}a(eh,"emoji");var th=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,nh=a(e=>{let t=xr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),oh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ih=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ah=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nl=/^[A-Za-z0-9_-]*$/,yz=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,_z=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,sh=/^\+[1-9]\d{6,14}$/,hP="(?:(?:\\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])))",ch=new RegExp(`^${hP}$`);function gP(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}a(gP,"timeSource");function uh(e){return new RegExp(`^${gP(e)}$`)}a(uh,"time");function lh(e){let t=gP({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${hP}T(?:${o})$`)}a(lh,"datetime");var dh=a(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ph=/^-?\d+n?$/,fh=/^-?\d+$/,ol=/^-?\d+(?:\.\d+)?$/,mh=/^(?:true|false)$/i,hh=/^null$/i;var gh=/^undefined$/i;var yh=/^[^A-Z]*$/,_h=/^[^a-z]*$/,bz=/^[0-9a-fA-F]*$/;function ts(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}a(ts,"fixedBase64");function rs(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}a(rs,"fixedBase64url");var vz=/^[0-9a-fA-F]{32}$/,Ez=ts(22,"=="),Sz=rs(22),Pz=/^[0-9a-fA-F]{40}$/,xz=ts(27,"="),Tz=rs(27),wz=/^[0-9a-fA-F]{64}$/,Az=ts(43,"="),Iz=rs(43),Rz=/^[0-9a-fA-F]{96}$/,Oz=ts(64,""),kz=rs(64),Cz=/^[0-9a-fA-F]{128}$/,$z=ts(86,"=="),zz=rs(86);var Ge=A("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_P={number:"number",bigint:"bigint",object:"date"},il=A("$ZodCheckLessThan",(e,t)=>{Ge.init(e,t);let n=_P[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),al=A("$ZodCheckGreaterThan",(e,t)=>{Ge.init(e,t);let n=_P[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bh=A("$ZodCheckMultipleOf",(e,t)=>{Ge.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):jm(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),vh=A("$ZodCheckNumberFormat",(e,t)=>{Ge.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=qm[t.format];e._zod.onattach.push(s=>{let u=s._zod.bag;u.format=t.format,u.minimum=r,u.maximum=i,n&&(u.pattern=fh)}),e._zod.check=s=>{let u=s.value;if(n){if(!Number.isInteger(u)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?s.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}u<r&&s.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>i&&s.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Eh=A("$ZodCheckBigIntFormat",(e,t)=>{Ge.init(e,t);let[n,o]=Vm[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Sh=A("$ZodCheckMaxSize",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:Qa(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ph=A("$ZodCheckMinSize",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:Qa(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xh=A("$ZodCheckSizeEquals",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:Qa(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Th=A("$ZodCheckMaxLength",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let s=Ya(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wh=A("$ZodCheckMinLength",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let s=Ya(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ah=A("$ZodCheckLengthEquals",(e,t)=>{var n;Ge.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!Hn(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let s=Ya(r),u=i>t.length;o.issues.push({origin:s,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ci=A("$ZodCheckStringFormat",(e,t)=>{var n,o;Ge.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ih=A("$ZodCheckRegex",(e,t)=>{Ci.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Rh=A("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yh),Ci.init(e,t)}),Oh=A("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_h),Ci.init(e,t)}),kh=A("$ZodCheckIncludes",(e,t)=>{Ge.init(e,t);let n=xr(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Ch=A("$ZodCheckStartsWith",(e,t)=>{Ge.init(e,t);let n=new RegExp(`^${xr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),$h=A("$ZodCheckEndsWith",(e,t)=>{Ge.init(e,t);let n=new RegExp(`.*${xr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function yP(e,t,n){e.issues.length&&t.issues.push(...sr(n,e.issues))}a(yP,"handleCheckPropertyResult");var zh=A("$ZodCheckProperty",(e,t)=>{Ge.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>yP(r,n,t.property));yP(o,n,t.property)}}),Nh=A("$ZodCheckMimeType",(e,t)=>{Ge.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Dh=A("$ZodCheckOverwrite",(e,t)=>{Ge.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ns=class{static{a(this,"Doc")}constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
57
|
+
`).filter(s=>s),r=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
|
|
58
|
+
`))}};var Uh={major:4,minor:3,patch:6};var he=A("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Uh;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=a((s,u,d)=>{let p=Jn(s),f;for(let g of u){if(g._zod.def.when){if(!g._zod.def.when(s))continue}else if(p)continue;let y=s.issues.length,h=g._zod.check(s);if(h instanceof Promise&&d?.async===!1)throw new jr;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==y&&(p||(p=Jn(s,y)))});else{if(s.issues.length===y)continue;p||(p=Jn(s,y))}}return f?f.then(()=>s):s},"runChecks"),i=a((s,u,d)=>{if(Jn(s))return s.aborted=!0,s;let p=r(u,o,d);if(p instanceof Promise){if(d.async===!1)throw new jr;return p.then(f=>e._zod.parse(f,d))}return e._zod.parse(p,d)},"handleCanaryResult");e._zod.run=(s,u)=>{if(u.skipChecks)return e._zod.parse(s,u);if(u.direction==="backward"){let p=e._zod.parse({value:s.value,issues:[]},{...u,skipChecks:!0});return p instanceof Promise?p.then(f=>i(f,s,u)):i(p,s,u)}let d=e._zod.parse(s,u);if(d instanceof Promise){if(u.async===!1)throw new jr;return d.then(p=>r(p,o,u))}return r(d,o,u)}}Se(e,"~standard",()=>({validate:a(r=>{try{let i=Ri(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ki(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Pn=A("$ZodString",(e,t)=>{he.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??dh(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Be=A("$ZodStringFormat",(e,t)=>{Ci.init(e,t),Pn.init(e,t)}),pl=A("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qm),Be.init(e,t)}),fl=A("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ro(o))}else t.pattern??(t.pattern=Ro());Be.init(e,t)}),ml=A("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ym),Be.init(e,t)}),os=A("$ZodURL",(e,t)=>{Be.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),hl=A("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=eh()),Be.init(e,t)}),gl=A("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Km),Be.init(e,t)}),yl=A("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zm),Be.init(e,t)}),_l=A("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Hm),Be.init(e,t)}),bl=A("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gm),Be.init(e,t)}),vl=A("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Wm),Be.init(e,t)}),El=A("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jm),Be.init(e,t)}),Sl=A("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=lh(t)),Be.init(e,t)}),Pl=A("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ch),Be.init(e,t)}),xl=A("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=uh(t)),Be.init(e,t)}),Tl=A("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Xm),Be.init(e,t)}),wl=A("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=th),Be.init(e,t),e._zod.bag.format="ipv4"}),Al=A("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rh),Be.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Il=A("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=nh(t.delimiter)),Be.init(e,t),e._zod.bag.format="mac"}),Rl=A("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=oh),Be.init(e,t)}),Ol=A("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ih),Be.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Mh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}a(Mh,"isValidBase64");var kl=A("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ah),Be.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Mh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function kP(e){if(!nl.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Mh(n)}a(kP,"isValidBase64URL");var Cl=A("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nl),Be.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{kP(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$l=A("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sh),Be.init(e,t)});function CP(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}a(CP,"isValidJWT");var zl=A("$ZodJWT",(e,t)=>{Be.init(e,t),e._zod.check=n=>{CP(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Nl=A("$ZodCustomStringFormat",(e,t)=>{Be.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),$i=A("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??ol,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),is=A("$ZodNumberFormat",(e,t)=>{vh.init(e,t),$i.init(e,t)}),Oo=A("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=mh,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),zi=A("$ZodBigInt",(e,t)=>{he.init(e,t),e._zod.pattern=ph,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Dl=A("$ZodBigIntFormat",(e,t)=>{Eh.init(e,t),zi.init(e,t)}),Ul=A("$ZodSymbol",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),jl=A("$ZodUndefined",(e,t)=>{he.init(e,t),e._zod.pattern=gh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Ml=A("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=hh,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),as=A("$ZodAny",(e,t)=>{he.init(e,t),e._zod.parse=n=>n}),ss=A("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=n=>n}),Ll=A("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),cs=A("$ZodVoid",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),us=A("$ZodDate",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function vP(e,t,n){e.issues.length&&t.issues.push(...sr(n,e.issues)),t.value[n]=e.value}a(vP,"handleArrayResult");var ls=A("$ZodArray",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let u=r[s],d=t.element._zod.run({value:u,issues:[]},o);d instanceof Promise?i.push(d.then(p=>vP(p,n,s))):vP(d,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function dl(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...sr(n,e.issues))}e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}a(dl,"handlePropertyResult");function $P(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Bm(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}a($P,"normalizeDef");function zP(e,t,n,o,r,i){let s=[],u=r.keySet,d=r.catchall._zod,p=d.def.type,f=d.optout==="optional";for(let g in t){if(u.has(g))continue;if(p==="never"){s.push(g);continue}let y=d.run({value:t[g],issues:[]},o);y instanceof Promise?e.push(y.then(h=>dl(h,n,g,t,f))):dl(y,n,g,t,f)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}a(zP,"handleCatchall");var Fl=A("$ZodObject",(e,t)=>{if(he.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let u=t.shape;Object.defineProperty(t,"shape",{get:a(()=>{let d={...u};return Object.defineProperty(t,"shape",{value:d}),d},"get")})}let o=Si(()=>$P(t));Se(e._zod,"propValues",()=>{let u=t.shape,d={};for(let p in u){let f=u[p]._zod;if(f.values){d[p]??(d[p]=new Set);for(let g of f.values)d[p].add(g)}}return d});let r=wo,i=t.catchall,s;e._zod.parse=(u,d)=>{s??(s=o.value);let p=u.value;if(!r(p))return u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u;u.value={};let f=[],g=s.shape;for(let y of s.keys){let h=g[y],_=h._zod.optout==="optional",P=h._zod.run({value:p[y],issues:[]},d);P instanceof Promise?f.push(P.then(x=>dl(x,u,y,p,_))):dl(P,u,y,p,_)}return i?zP(f,p,u,d,o.value,e):f.length?Promise.all(f).then(()=>u):u}}),Lh=A("$ZodObjectJIT",(e,t)=>{Fl.init(e,t);let n=e._zod.parse,o=Si(()=>$P(t)),r=a(y=>{let h=new ns(["shape","payload","ctx"]),_=o.value,P=a(V=>{let W=Vu(V);return`shape[${W}]._zod.run({ value: input[${W}], issues: [] }, ctx)`},"parseStr");h.write("const input = payload.value;");let x=Object.create(null),S=0;for(let V of _.keys)x[V]=`key_${S++}`;h.write("const newResult = {};");for(let V of _.keys){let W=x[V],Z=Vu(V),te=y[V]?._zod?.optout==="optional";h.write(`const ${W} = ${P(V)};`),te?h.write(`
|
|
59
|
+
if (${W}.issues.length) {
|
|
60
|
+
if (${Z} in input) {
|
|
61
|
+
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
|
|
62
|
+
...iss,
|
|
63
|
+
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
64
|
+
})));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (${W}.value === undefined) {
|
|
69
|
+
if (${Z} in input) {
|
|
70
|
+
newResult[${Z}] = undefined;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
newResult[${Z}] = ${W}.value;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
`):h.write(`
|
|
77
|
+
if (${W}.issues.length) {
|
|
78
|
+
payload.issues = payload.issues.concat(${W}.issues.map(iss => ({
|
|
79
|
+
...iss,
|
|
80
|
+
path: iss.path ? [${Z}, ...iss.path] : [${Z}]
|
|
81
|
+
})));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (${W}.value === undefined) {
|
|
85
|
+
if (${Z} in input) {
|
|
86
|
+
newResult[${Z}] = undefined;
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
newResult[${Z}] = ${W}.value;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let $=h.compile();return(V,W)=>$(y,V,W)},"generateFastpass"),i,s=wo,u=!Ha.jitless,p=u&&Lm.value,f=t.catchall,g;e._zod.parse=(y,h)=>{g??(g=o.value);let _=y.value;return s(_)?u&&p&&h?.async===!1&&h.jitless!==!0?(i||(i=r(t.shape)),y=i(y,h),f?zP([],_,y,h,g,e):y):n(y,h):(y.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),y)}});function EP(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter(i=>!Jn(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Gt(s,o,it())))}),t)}a(EP,"handleUnionResults");var ko=A("$ZodUnion",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Se(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Se(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Se(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>Ka(i.source)).join("|")})$`)}});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,u=[];for(let d of t.options){let p=d._zod.run({value:r.value,issues:[]},i);if(p instanceof Promise)u.push(p),s=!0;else{if(p.issues.length===0)return p;u.push(p)}}return s?Promise.all(u).then(d=>EP(d,r,e,i)):EP(u,r,e,i)}});function SP(e,t,n,o){let r=e.filter(i=>i.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Gt(s,o,it())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}a(SP,"handleExclusiveUnionResults");var Bl=A("$ZodXor",(e,t)=>{ko.init(e,t),t.inclusive=!1;let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,u=[];for(let d of t.options){let p=d._zod.run({value:r.value,issues:[]},i);p instanceof Promise?(u.push(p),s=!0):u.push(p)}return s?Promise.all(u).then(d=>SP(d,r,e,i)):SP(u,r,e,i)}}),ds=A("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ko.init(e,t);let n=e._zod.parse;Se(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,d]of Object.entries(s)){r[u]||(r[u]=new Set);for(let p of d)r[u].add(p)}}return r});let o=Si(()=>{let r=t.options,i=new Map;for(let s of r){let u=s._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let d of u){if(i.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);i.set(d,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!wo(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let u=o.value.get(s?.[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r)}}),ql=A("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([d,p])=>PP(n,d,p)):PP(n,i,s)}});function jh(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Wn(e)&&Wn(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=jh(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=jh(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}a(jh,"mergeValues");function PP(e,t,n){let o=new Map,r;for(let u of t.issues)if(u.code==="unrecognized_keys"){r??(r=u);for(let d of u.keys)o.has(d)||o.set(d,{}),o.get(d).l=!0}else e.issues.push(u);for(let u of n.issues)if(u.code==="unrecognized_keys")for(let d of u.keys)o.has(d)||o.set(d,{}),o.get(d).r=!0;else e.issues.push(u);let i=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(i.length&&r&&e.issues.push({...r,keys:i}),Jn(e))return e;let s=jh(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}a(PP,"handleIntersectionResults");var ps=A("$ZodTuple",(e,t)=>{he.init(e,t);let n=t.items;e._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],u=[...n].reverse().findIndex(f=>f._zod.optin!=="optional"),d=u===-1?0:n.length-u;if(!t.rest){let f=i.length>n.length,g=i.length<d-1;if(f||g)return o.issues.push({...f?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),o}let p=-1;for(let f of n){if(p++,p>=i.length&&p>=d)continue;let g=f._zod.run({value:i[p],issues:[]},r);g instanceof Promise?s.push(g.then(y=>sl(y,o,p))):sl(g,o,p)}if(t.rest){let f=i.slice(n.length);for(let g of f){p++;let y=t.rest._zod.run({value:g,issues:[]},r);y instanceof Promise?s.push(y.then(h=>sl(h,o,p))):sl(y,o,p)}}return s.length?Promise.all(s).then(()=>o):o}});function sl(e,t,n){e.issues.length&&t.issues.push(...sr(n,e.issues)),t.value[n]=e.value}a(sl,"handleTupleResult");var fs=A("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Wn(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[],s=t.keyType._zod.values;if(s){n.value={};let u=new Set;for(let p of s)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){u.add(typeof p=="number"?p.toString():p);let f=t.valueType._zod.run({value:r[p],issues:[]},o);f instanceof Promise?i.push(f.then(g=>{g.issues.length&&n.issues.push(...sr(p,g.issues)),n.value[p]=g.value})):(f.issues.length&&n.issues.push(...sr(p,f.issues)),n.value[p]=f.value)}let d;for(let p in r)u.has(p)||(d=d??[],d.push(p));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:d})}else{n.value={};for(let u of Reflect.ownKeys(r)){if(u==="__proto__")continue;let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof u=="string"&&ol.test(u)&&d.issues.length){let g=t.keyType._zod.run({value:Number(u),issues:[]},o);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");g.issues.length===0&&(d=g)}if(d.issues.length){t.mode==="loose"?n.value[u]=r[u]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(g=>Gt(g,o,it())),input:u,path:[u],inst:e});continue}let f=t.valueType._zod.run({value:r[u],issues:[]},o);f instanceof Promise?i.push(f.then(g=>{g.issues.length&&n.issues.push(...sr(u,g.issues)),n.value[d.value]=g.value})):(f.issues.length&&n.issues.push(...sr(u,f.issues)),n.value[d.value]=f.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Vl=A("$ZodMap",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,u]of r){let d=t.keyType._zod.run({value:s,issues:[]},o),p=t.valueType._zod.run({value:u,issues:[]},o);d instanceof Promise||p instanceof Promise?i.push(Promise.all([d,p]).then(([f,g])=>{xP(f,g,n,s,r,e,o)})):xP(d,p,n,s,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function xP(e,t,n,o,r,i,s){e.issues.length&&(Xa.has(typeof o)?n.issues.push(...sr(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(u=>Gt(u,s,it()))})),t.issues.length&&(Xa.has(typeof o)?n.issues.push(...sr(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(u=>Gt(u,s,it()))})),n.value.set(e.value,t.value)}a(xP,"handleMapResult");var Zl=A("$ZodSet",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let u=t.valueType._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(d=>TP(d,n))):TP(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function TP(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}a(TP,"handleSetResult");var ms=A("$ZodEnum",(e,t)=>{he.init(e,t);let n=Ja(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>Xa.has(typeof r)).map(r=>typeof r=="string"?xr(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),hs=A("$ZodLiteral",(e,t)=>{if(he.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?xr(o):o?xr(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Hl=A("$ZodFile",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),gs=A("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Zn(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new jr;return n.value=r,n}});function wP(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}a(wP,"handleOptionalResult");var Ni=A("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Se(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ka(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>wP(i,n.value)):wP(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Gl=A("$ZodExactOptional",(e,t)=>{Ni.init(e,t),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),ys=A("$ZodNullable",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ka(n.source)}|null)$`):void 0}),Se(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Wl=A("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>AP(i,t)):AP(r,t)}});function AP(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}a(AP,"handleDefaultResult");var Jl=A("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),Kl=A("$ZodNonOptional",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>IP(i,e)):IP(r,e)}});function IP(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}a(IP,"handleNonOptionalResult");var Xl=A("$ZodSuccess",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Zn("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Ql=A("$ZodCatch",(e,t)=>{he.init(e,t),Se(e._zod,"optin",()=>t.innerType._zod.optin),Se(e._zod,"optout",()=>t.innerType._zod.optout),Se(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Gt(s,o,it()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Gt(i,o,it()))},input:n.value}),n.issues=[]),n)}}),Yl=A("$ZodNaN",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),_s=A("$ZodPipe",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),Se(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(s=>cl(s,t.in,o)):cl(i,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>cl(i,t.out,o)):cl(r,t.out,o)}});function cl(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}a(cl,"handlePipeResult");var Di=A("$ZodCodec",(e,t)=>{he.init(e,t),Se(e._zod,"values",()=>t.in._zod.values),Se(e._zod,"optin",()=>t.in._zod.optin),Se(e._zod,"optout",()=>t.out._zod.optout),Se(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);return i instanceof Promise?i.then(s=>ul(s,t,o)):ul(i,t,o)}else{let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(s=>ul(s,t,o)):ul(i,t,o)}}});function ul(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>ll(e,i,t.out,n)):ll(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>ll(e,i,t.in,n)):ll(e,r,t.in,n)}}a(ul,"handleCodecAResult");function ll(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}a(ll,"handleCodecTxResult");var ed=A("$ZodReadonly",(e,t)=>{he.init(e,t),Se(e._zod,"propValues",()=>t.innerType._zod.propValues),Se(e._zod,"values",()=>t.innerType._zod.values),Se(e._zod,"optin",()=>t.innerType?._zod?.optin),Se(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(RP):RP(r)}});function RP(e){return e.value=Object.freeze(e.value),e}a(RP,"handleReadonlyResult");var td=A("$ZodTemplateLiteral",(e,t)=>{he.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||Fm.has(typeof o))n.push(xr(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),rd=A("$ZodFunction",(e,t)=>(he.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?Ao(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Ao(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Io(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await Io(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new ps({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),nd=A("$ZodPromise",(e,t)=>{he.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),od=A("$ZodLazy",(e,t)=>{he.init(e,t),Se(e._zod,"innerType",()=>t.getter()),Se(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Se(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Se(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Se(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),bs=A("$ZodCustom",(e,t)=>{Ge.init(e,t),he.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>OP(i,n,o,e));OP(r,n,o,e)}});function OP(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(Pi(r))}}a(OP,"handleRefineResult");var ji={};ar(ji,{ar:()=>Fh,az:()=>Bh,be:()=>qh,bg:()=>Vh,ca:()=>Zh,cs:()=>Hh,da:()=>Gh,de:()=>Wh,en:()=>vs,eo:()=>Jh,es:()=>Kh,fa:()=>Xh,fi:()=>Qh,fr:()=>Yh,frCA:()=>eg,he:()=>tg,hu:()=>rg,hy:()=>ng,id:()=>og,is:()=>ig,it:()=>ag,ja:()=>sg,ka:()=>cg,kh:()=>ug,km:()=>Es,ko:()=>lg,lt:()=>dg,mk:()=>pg,ms:()=>fg,nl:()=>mg,no:()=>hg,ota:()=>gg,pl:()=>_g,ps:()=>yg,pt:()=>bg,ru:()=>vg,sl:()=>Eg,sv:()=>Sg,ta:()=>Pg,th:()=>xg,tr:()=>Tg,ua:()=>wg,uk:()=>Ps,ur:()=>Ag,uz:()=>Ig,vi:()=>Rg,yo:()=>Cg,zhCN:()=>Og,zhTW:()=>kg});var Dz=a(()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${u}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${u}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${K(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${n[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${L(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}},"error");function Fh(){return{localeError:Dz()}}a(Fh,"default");var Uz=a(()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${u}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${u}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${K(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}},"error");function Bh(){return{localeError:Uz()}}a(Bh,"default");function NP(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}a(NP,"getBelarusianPlural");var jz=a(()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${u}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${u}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${K(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let u=Number(r.maximum),d=NP(u,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.maximum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let u=Number(r.minimum),d=NP(u,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.minimum.toString()} ${d}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}},"error");function qh(){return{localeError:jz()}}a(qh,"default");var Mz=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${u}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${u}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${K(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}},"error");function Vh(){return{localeError:Mz()}}a(Vh,"default");var Lz=a(()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${u}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${u}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${K(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${L(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}},"error");function Zh(){return{localeError:Lz()}}a(Zh,"default");var Fz=a(()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${u}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${u}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${K(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${n[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${L(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}},"error");function Hh(){return{localeError:Fz()}}a(Hh,"default");var Bz=a(()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${u}`:`Ugyldigt input: forventede ${i}, fik ${u}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${K(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),u=o[r.origin]??r.origin;return s?`For stor: forventede ${u??"value"} ${s.verb} ${i} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),u=o[r.origin]??r.origin;return s?`For lille: forventede ${u} ${s.verb} ${i} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${u} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}},"error");function Gh(){return{localeError:Bz()}}a(Gh,"default");var qz=a(()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${u}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${u}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${K(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}},"error");function Wh(){return{localeError:qz()}}a(Wh,"default");var Vz=a(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return`Invalid input: expected ${i}, received ${u}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${K(r.values[0])}`:`Invalid option: expected one of ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}},"error");function vs(){return{localeError:Vz()}}a(vs,"default");var Zz=a(()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${u}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${u}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${K(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${i}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}},"error");function Jh(){return{localeError:Zz()}}a(Jh,"default");var Hz=a(()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${u}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${u}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${K(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),u=o[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${u??"valor"} tuviera ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${u??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),u=o[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${u} tuviera ${i}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${u} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}},"error");function Kh(){return{localeError:Hz()}}a(Kh,"default");var Gz=a(()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${u} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${u} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${K(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${L(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${L(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}},"error");function Xh(){return{localeError:Gz()}}a(Xh,"default");var Wz=a(()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${u}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${u}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${K(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${n[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}},"error");function Qh(){return{localeError:Wz()}}a(Qh,"default");var Jz=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${u} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${u} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${K(r.values[0])} attendu`:`Option invalide : une valeur parmi ${L(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${L(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function Yh(){return{localeError:Jz()}}a(Yh,"default");var Kz=a(()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${u}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${u}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${K(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${L(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}},"error");function eg(){return{localeError:Kz()}}a(eg,"default");var Xz=a(()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=a(p=>p?e[p]:void 0,"typeEntry"),o=a(p=>{let f=n(p);return f?f.label:p??e.unknown.label},"typeLabel"),r=a(p=>`\u05D4${o(p)}`,"withDefinite"),i=a(p=>(n(p)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA","verbFor"),s=a(p=>p?t[p]??null:null,"getSizing"),u={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},d={nan:"NaN"};return p=>{switch(p.code){case"invalid_type":{let f=p.expected,g=d[f??""]??o(f),y=Q(p.input),h=d[y]??e[y]?.label??y;return/^[A-Z]/.test(p.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${p.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(p.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${K(p.values[0])}`;let f=p.values.map(h=>K(h));if(p.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f[0]} \u05D0\u05D5 ${f[1]}`;let g=f[f.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${f.slice(0,-1).join(", ")} \u05D0\u05D5 ${g}`}case"too_big":{let f=s(p.origin),g=r(p.origin??"value");if(p.origin==="string")return`${f?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${p.maximum.toString()} ${f?.unit??""} ${p.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(p.origin==="number"){let _=p.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${p.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${p.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(p.origin==="array"||p.origin==="set"){let _=p.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",P=p.inclusive?`${p.maximum} ${f?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${p.maximum} ${f?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${g} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let y=p.inclusive?"<=":"<",h=i(p.origin??"value");return f?.unit?`${f.longLabel} \u05DE\u05D3\u05D9: ${g} ${h} ${y}${p.maximum.toString()} ${f.unit}`:`${f?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${g} ${h} ${y}${p.maximum.toString()}`}case"too_small":{let f=s(p.origin),g=r(p.origin??"value");if(p.origin==="string")return`${f?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${p.minimum.toString()} ${f?.unit??""} ${p.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(p.origin==="number"){let _=p.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${p.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${p.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(p.origin==="array"||p.origin==="set"){let _=p.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(p.minimum===1&&p.inclusive){let x=(p.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${x}`}let P=p.inclusive?`${p.minimum} ${f?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${p.minimum} ${f?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${g} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${P}`.trim()}let y=p.inclusive?">=":">",h=i(p.origin??"value");return f?.unit?`${f.shortLabel} \u05DE\u05D3\u05D9: ${g} ${h} ${y}${p.minimum.toString()} ${f.unit}`:`${f?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${g} ${h} ${y}${p.minimum.toString()}`}case"invalid_format":{let f=p;if(f.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${f.prefix}"`;if(f.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${f.suffix}"`;if(f.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${f.includes}"`;if(f.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${f.pattern}`;let g=u[f.format],y=g?.label??f.format,_=(g?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${y} \u05DC\u05D0 ${_}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${p.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${p.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${p.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${L(p.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(p.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}},"error");function tg(){return{localeError:Xz()}}a(tg,"default");var Qz=a(()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${u}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${u}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${K(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}},"error");function rg(){return{localeError:Qz()}}a(rg,"default");function DP(e,t,n){return Math.abs(e)===1?t:n}a(DP,"getArmenianPlural");function Ui(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}a(Ui,"withDefiniteArticle");var Yz=a(()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${u}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${u}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${K(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let u=Number(r.maximum),d=DP(u,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.maximum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let u=Number(r.minimum),d=DP(u,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.minimum.toString()} ${d}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ui(r.origin)} \u056C\u056B\u0576\u056B ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[i.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${L(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ui(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ui(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}},"error");function ng(){return{localeError:Yz()}}a(ng,"default");var eN=a(()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${u}`:`Input tidak valid: diharapkan ${i}, diterima ${u}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${K(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${n[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}},"error");function og(){return{localeError:eN()}}a(og,"default");var tN=a(()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${u} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${u} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${K(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${i}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${L(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}},"error");function ig(){return{localeError:tN()}}a(ig,"default");var rN=a(()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${u}`:`Input non valido: atteso ${i}, ricevuto ${u}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${K(r.values[0])}`:`Opzione non valida: atteso uno tra ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${L(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}},"error");function ag(){return{localeError:rN()}}a(ag,"default");var nN=a(()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${u}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${u}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${K(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${L(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${L(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}},"error");function sg(){return{localeError:nN()}}a(sg,"default");var oN=a(()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${u}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${u}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${K(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${L(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}},"error");function cg(){return{localeError:oN()}}a(cg,"default");var iN=a(()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${u}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${u}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${K(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${L(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}},"error");function Es(){return{localeError:iN()}}a(Es,"default");function ug(){return Es()}a(ug,"default");var aN=a(()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${u}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${u}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${K(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${L(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),d=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${d} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),d=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${d} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${L(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}},"error");function lg(){return{localeError:aN()}}a(lg,"default");var Ss=a(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalizeFirstCharacter");function UP(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}a(UP,"getUnitTypeFromNumber");var sN=a(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(r,i,s,u){let d=e[r]??null;return d===null?d:{unit:d.unit[i],verb:d.verb[u][s?"inclusive":"notInclusive"]}}a(t,"getSizing");let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${u}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${u}, o tik\u0117tasi - ${i}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${K(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${L(r.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[r.origin]??r.origin,s=t(r.origin,UP(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Ss(i??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let u=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Ss(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${u} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[r.origin]??r.origin,s=t(r.origin,UP(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Ss(i??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let u=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Ss(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${u} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${L(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[r.origin]??r.origin;return`${Ss(i??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}},"error");function dg(){return{localeError:sN()}}a(dg,"default");var cN=a(()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${u}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${u}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${K(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}},"error");function pg(){return{localeError:cN()}}a(pg,"default");var uN=a(()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${u}`:`Input tidak sah: dijangka ${i}, diterima ${u}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${K(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${n[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}},"error");function fg(){return{localeError:uN()}}a(fg,"default");var lN=a(()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${u}`:`Ongeldige invoer: verwacht ${i}, ontving ${u}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${K(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),u=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${u}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${u}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),u=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${u}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${u}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}},"error");function mg(){return{localeError:lN()}}a(mg,"default");var dN=a(()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${u}`:`Ugyldig input: forventet ${i}, fikk ${u}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${K(r.values[0])}`:`Ugyldig valg: forventet en av ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}},"error");function hg(){return{localeError:dN()}}a(hg,"default");var pN=a(()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${u}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${u}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${K(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}},"error");function gg(){return{localeError:pN()}}a(gg,"default");var fN=a(()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${u} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${u} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${K(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${L(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}},"error");function yg(){return{localeError:fN()}}a(yg,"default");var mN=a(()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${u}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${u}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${K(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}},"error");function _g(){return{localeError:mN()}}a(_g,"default");var hN=a(()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${u}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${u}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${K(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${n[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}},"error");function bg(){return{localeError:hN()}}a(bg,"default");function jP(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}a(jP,"getRussianPlural");var gN=a(()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${u}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${u}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${K(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let u=Number(r.maximum),d=jP(u,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let u=Number(r.minimum),d=jP(u,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${d}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}},"error");function vg(){return{localeError:gN()}}a(vg,"default");var yN=a(()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${u}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${u}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${K(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${n[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${L(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}},"error");function Eg(){return{localeError:yN()}}a(Eg,"default");var _N=a(()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${u}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${u}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${K(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${n[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}},"error");function Sg(){return{localeError:_N()}}a(Sg,"default");var bN=a(()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${u}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${K(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${L(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}},"error");function Pg(){return{localeError:bN()}}a(Pg,"default");var vN=a(()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${u}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${u}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${K(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${L(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}},"error");function xg(){return{localeError:vN()}}a(xg,"default");var EN=a(()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${u}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${u}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${K(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}},"error");function Tg(){return{localeError:EN()}}a(Tg,"default");var SN=a(()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${u}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${u}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${K(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}},"error");function Ps(){return{localeError:SN()}}a(Ps,"default");function wg(){return Ps()}a(wg,"default");var PN=a(()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${u} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${u} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${K(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${L(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${L(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}},"error");function Ag(){return{localeError:PN()}}a(Ag,"default");var xN=a(()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${u}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${u}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${K(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[i.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}},"error");function Ig(){return{localeError:xN()}}a(Ig,"default");var TN=a(()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${u}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${u}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${K(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${n[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${L(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}},"error");function Rg(){return{localeError:TN()}}a(Rg,"default");var wN=a(()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${u}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${u}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${K(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${n[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}},"error");function Og(){return{localeError:wN()}}a(Og,"default");var AN=a(()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${u}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${u}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${K(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${L(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}},"error");function kg(){return{localeError:AN()}}a(kg,"default");var IN=a(()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}a(t,"getSizing");let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=Q(r.input),u=o[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${u}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${u}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${K(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${i}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${i}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${n[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${L(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}},"error");function Cg(){return{localeError:IN()}}a(Cg,"default");var MP,ad=Symbol("ZodOutput"),sd=Symbol("ZodInput"),id=class{static{a(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function xs(){return new id}a(xs,"registry");(MP=globalThis).__zod_globalRegistry??(MP.__zod_globalRegistry=xs());var vt=globalThis.__zod_globalRegistry;function Ts(e,t){return new e({type:"string",...J(t)})}a(Ts,"_string");function ws(e,t){return new e({type:"string",coerce:!0,...J(t)})}a(ws,"_coercedString");function As(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...J(t)})}a(As,"_email");function Mi(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...J(t)})}a(Mi,"_guid");function Is(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...J(t)})}a(Is,"_uuid");function Rs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(t)})}a(Rs,"_uuidv4");function Os(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(t)})}a(Os,"_uuidv6");function ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(t)})}a(ks,"_uuidv7");function Co(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...J(t)})}a(Co,"_url");function Cs(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...J(t)})}a(Cs,"_emoji");function $s(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(t)})}a($s,"_nanoid");function zs(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...J(t)})}a(zs,"_cuid");function Ns(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(t)})}a(Ns,"_cuid2");function Ds(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...J(t)})}a(Ds,"_ulid");function Us(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...J(t)})}a(Us,"_xid");function js(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(t)})}a(js,"_ksuid");function Ms(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(t)})}a(Ms,"_ipv4");function Ls(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(t)})}a(Ls,"_ipv6");function cd(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...J(t)})}a(cd,"_mac");function Fs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(t)})}a(Fs,"_cidrv4");function Bs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(t)})}a(Bs,"_cidrv6");function qs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...J(t)})}a(qs,"_base64");function Vs(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...J(t)})}a(Vs,"_base64url");function Zs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...J(t)})}a(Zs,"_e164");function Hs(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...J(t)})}a(Hs,"_jwt");var ud={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ld(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(t)})}a(ld,"_isoDateTime");function dd(e,t){return new e({type:"string",format:"date",check:"string_format",...J(t)})}a(dd,"_isoDate");function pd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...J(t)})}a(pd,"_isoTime");function fd(e,t){return new e({type:"string",format:"duration",check:"string_format",...J(t)})}a(fd,"_isoDuration");function Gs(e,t){return new e({type:"number",checks:[],...J(t)})}a(Gs,"_number");function Ws(e,t){return new e({type:"number",coerce:!0,checks:[],...J(t)})}a(Ws,"_coercedNumber");function Js(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...J(t)})}a(Js,"_int");function md(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...J(t)})}a(md,"_float32");function hd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...J(t)})}a(hd,"_float64");function gd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...J(t)})}a(gd,"_int32");function yd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...J(t)})}a(yd,"_uint32");function Ks(e,t){return new e({type:"boolean",...J(t)})}a(Ks,"_boolean");function Xs(e,t){return new e({type:"boolean",coerce:!0,...J(t)})}a(Xs,"_coercedBoolean");function _d(e,t){return new e({type:"bigint",...J(t)})}a(_d,"_bigint");function Qs(e,t){return new e({type:"bigint",coerce:!0,...J(t)})}a(Qs,"_coercedBigint");function bd(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...J(t)})}a(bd,"_int64");function vd(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...J(t)})}a(vd,"_uint64");function Ed(e,t){return new e({type:"symbol",...J(t)})}a(Ed,"_symbol");function Sd(e,t){return new e({type:"undefined",...J(t)})}a(Sd,"_undefined");function Pd(e,t){return new e({type:"null",...J(t)})}a(Pd,"_null");function Ys(e){return new e({type:"any"})}a(Ys,"_any");function ec(e){return new e({type:"unknown"})}a(ec,"_unknown");function xd(e,t){return new e({type:"never",...J(t)})}a(xd,"_never");function tc(e,t){return new e({type:"void",...J(t)})}a(tc,"_void");function Td(e,t){return new e({type:"date",...J(t)})}a(Td,"_date");function rc(e,t){return new e({type:"date",coerce:!0,...J(t)})}a(rc,"_coercedDate");function wd(e,t){return new e({type:"nan",...J(t)})}a(wd,"_nan");function Mr(e,t){return new il({check:"less_than",...J(t),value:e,inclusive:!1})}a(Mr,"_lt");function Lt(e,t){return new il({check:"less_than",...J(t),value:e,inclusive:!0})}a(Lt,"_lte");function Lr(e,t){return new al({check:"greater_than",...J(t),value:e,inclusive:!1})}a(Lr,"_gt");function yt(e,t){return new al({check:"greater_than",...J(t),value:e,inclusive:!0})}a(yt,"_gte");function nc(e){return Lr(0,e)}a(nc,"_positive");function oc(e){return Mr(0,e)}a(oc,"_negative");function ic(e){return Lt(0,e)}a(ic,"_nonpositive");function ac(e){return yt(0,e)}a(ac,"_nonnegative");function xn(e,t){return new bh({check:"multiple_of",...J(t),value:e})}a(xn,"_multipleOf");function Tn(e,t){return new Sh({check:"max_size",...J(t),maximum:e})}a(Tn,"_maxSize");function Fr(e,t){return new Ph({check:"min_size",...J(t),minimum:e})}a(Fr,"_minSize");function Kn(e,t){return new xh({check:"size_equals",...J(t),size:e})}a(Kn,"_size");function Xn(e,t){return new Th({check:"max_length",...J(t),maximum:e})}a(Xn,"_maxLength");function ct(e,t){return new wh({check:"min_length",...J(t),minimum:e})}a(ct,"_minLength");function Qn(e,t){return new Ah({check:"length_equals",...J(t),length:e})}a(Qn,"_length");function Rt(e,t){return new Ih({check:"string_format",format:"regex",...J(t),pattern:e})}a(Rt,"_regex");function $o(e){return new Rh({check:"string_format",format:"lowercase",...J(e)})}a($o,"_lowercase");function zo(e){return new Oh({check:"string_format",format:"uppercase",...J(e)})}a(zo,"_uppercase");function No(e,t){return new kh({check:"string_format",format:"includes",...J(t),includes:e})}a(No,"_includes");function Do(e,t){return new Ch({check:"string_format",format:"starts_with",...J(t),prefix:e})}a(Do,"_startsWith");function Uo(e,t){return new $h({check:"string_format",format:"ends_with",...J(t),suffix:e})}a(Uo,"_endsWith");function sc(e,t,n){return new zh({check:"property",property:e,schema:t,...J(n)})}a(sc,"_property");function jo(e,t){return new Nh({check:"mime_type",mime:e,...J(t)})}a(jo,"_mime");function Tr(e){return new Dh({check:"overwrite",tx:e})}a(Tr,"_overwrite");function Mo(e){return Tr(t=>t.normalize(e))}a(Mo,"_normalize");function Lo(){return Tr(e=>e.trim())}a(Lo,"_trim");function Fo(){return Tr(e=>e.toLowerCase())}a(Fo,"_toLowerCase");function Bo(){return Tr(e=>e.toUpperCase())}a(Bo,"_toUpperCase");function Li(){return Tr(e=>Mm(e))}a(Li,"_slugify");function $g(e,t,n){return new e({type:"array",element:t,...J(n)})}a($g,"_array");function ON(e,t,n){return new e({type:"union",options:t,...J(n)})}a(ON,"_union");function kN(e,t,n){return new e({type:"union",options:t,inclusive:!1,...J(n)})}a(kN,"_xor");function CN(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...J(o)})}a(CN,"_discriminatedUnion");function $N(e,t,n){return new e({type:"intersection",left:t,right:n})}a($N,"_intersection");function zN(e,t,n,o){let r=n instanceof he,i=r?o:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...J(i)})}a(zN,"_tuple");function NN(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...J(o)})}a(NN,"_record");function DN(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...J(o)})}a(DN,"_map");function UN(e,t,n){return new e({type:"set",valueType:t,...J(n)})}a(UN,"_set");function jN(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...J(n)})}a(jN,"_enum");function MN(e,t,n){return new e({type:"enum",entries:t,...J(n)})}a(MN,"_nativeEnum");function LN(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...J(n)})}a(LN,"_literal");function Ad(e,t){return new e({type:"file",...J(t)})}a(Ad,"_file");function FN(e,t){return new e({type:"transform",transform:t})}a(FN,"_transform");function BN(e,t){return new e({type:"optional",innerType:t})}a(BN,"_optional");function qN(e,t){return new e({type:"nullable",innerType:t})}a(qN,"_nullable");function VN(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Hu(n)}})}a(VN,"_default");function ZN(e,t,n){return new e({type:"nonoptional",innerType:t,...J(n)})}a(ZN,"_nonoptional");function HN(e,t){return new e({type:"success",innerType:t})}a(HN,"_success");function GN(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}a(GN,"_catch");function WN(e,t,n){return new e({type:"pipe",in:t,out:n})}a(WN,"_pipe");function JN(e,t){return new e({type:"readonly",innerType:t})}a(JN,"_readonly");function KN(e,t,n){return new e({type:"template_literal",parts:t,...J(n)})}a(KN,"_templateLiteral");function XN(e,t){return new e({type:"lazy",getter:t})}a(XN,"_lazy");function QN(e,t){return new e({type:"promise",innerType:t})}a(QN,"_promise");function cc(e,t,n){let o=J(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}a(cc,"_custom");function Id(e,t,n){return new e({type:"custom",check:"custom",fn:t,...J(n)})}a(Id,"_refine");function Rd(e){let t=LP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(Pi(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(Pi(r))}},e(n.value,n)));return t}a(Rd,"_superRefine");function LP(e,t){let n=new Ge({check:"custom",...J(t)});return n._zod.check=e,n}a(LP,"_check");function Od(e){let t=new Ge({check:"describe"});return t._zod.onattach=[n=>{let o=vt.get(n)??{};vt.add(n,{...o,description:e})}],t._zod.check=()=>{},t}a(Od,"describe");function kd(e){let t=new Ge({check:"meta"});return t._zod.onattach=[n=>{let o=vt.get(n)??{};vt.add(n,{...o,...e})}],t._zod.check=()=>{},t}a(kd,"meta");function Cd(e,t){let n=J(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(h=>typeof h=="string"?h.toLowerCase():h),r=r.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(o),s=new Set(r),u=e.Codec??Di,d=e.Boolean??Oo,p=e.String??Pn,f=new p({type:"string",error:n.error}),g=new d({type:"boolean",error:n.error}),y=new u({type:"pipe",in:f,out:g,transform:a(((h,_)=>{let P=h;return n.case!=="sensitive"&&(P=P.toLowerCase()),i.has(P)?!0:s.has(P)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:_.value,inst:y,continue:!1}),{})}),"transform"),reverseTransform:a(((h,_)=>h===!0?o[0]||"true":r[0]||"false"),"reverseTransform"),error:n.error});return y}a(Cd,"_stringbool");function qo(e,t,n,o={}){let r=J(o),i={...J(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}a(qo,"_stringFormat");function Yn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??vt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}a(Yn,"initializeContext");function qe(e,t,n={path:[],schemaPath:[]}){var o;let r=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let u=e._zod.toJSONSchema?.();if(u)s.schema=u;else{let f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{let y=s.schema,h=t.processors[r.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);h(e,t,y,f)}let g=e._zod.parent;g&&(s.ref||(s.ref=g),qe(g,t,f),t.seen.get(g).isParent=!0)}let d=t.metadataRegistry.get(e);return d&&Object.assign(s.schema,d),t.io==="input"&&Ft(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}a(qe,"process");function eo(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let u=e.metadataRegistry.get(s[0])?.id;if(u){let d=o.get(u);if(d&&d!==s[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(u,s[0])}}let r=a(s=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let g=e.external.registry.get(s[0])?.id,y=e.external.uri??(_=>_);if(g)return{ref:y(g)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${y("__shared")}#/${u}/${h}`}}if(s[1]===n)return{ref:"#"};let p=`#/${u}/`,f=s[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:p+f}},"makeURI"),i=a(s=>{if(s[1].schema.$ref)return;let u=s[1],{ref:d,defId:p}=r(s);u.def={...u.schema},p&&(u.defId=p);let f=u.schema;for(let g in f)delete f[g];f.$ref=d},"extractToDef");if(e.cycles==="throw")for(let s of e.seen.entries()){let u=s[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
|
|
93
|
+
|
|
94
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let u=s[1];if(t===s[0]){i(s);continue}if(e.external){let p=e.external.registry.get(s[0])?.id;if(t!==s[0]&&p){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(u.cycle){i(s);continue}if(u.count>1&&e.reused==="ref"){i(s);continue}}}a(eo,"extractDefs");function to(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=a(s=>{let u=e.seen.get(s);if(u.ref===null)return;let d=u.def??u.schema,p={...d},f=u.ref;if(u.ref=null,f){o(f);let y=e.seen.get(f),h=y.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(h)):Object.assign(d,h),Object.assign(d,p),s._zod.parent===f)for(let P in d)P==="$ref"||P==="allOf"||P in p||delete d[P];if(h.$ref&&y.def)for(let P in d)P==="$ref"||P==="allOf"||P in y.def&&JSON.stringify(d[P])===JSON.stringify(y.def[P])&&delete d[P]}let g=s._zod.parent;if(g&&g!==f){o(g);let y=e.seen.get(g);if(y?.schema.$ref&&(d.$ref=y.schema.$ref,y.def))for(let h in d)h==="$ref"||h==="allOf"||h in y.def&&JSON.stringify(d[h])===JSON.stringify(y.def[h])&&delete d[h]}e.override({zodSchema:s,jsonSchema:d,path:u.path??[]})},"flattenRef");for(let s of[...e.seen.entries()].reverse())o(s[0]);let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let u=s[1];u.def&&u.defId&&(i[u.defId]=u.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?r.$defs=i:r.definitions=i);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Fi(t,"input",e.processors),output:Fi(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}a(to,"finalize");function Ft(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Ft(o.element,n);if(o.type==="set")return Ft(o.valueType,n);if(o.type==="lazy")return Ft(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Ft(o.innerType,n);if(o.type==="intersection")return Ft(o.left,n)||Ft(o.right,n);if(o.type==="record"||o.type==="map")return Ft(o.keyType,n)||Ft(o.valueType,n);if(o.type==="pipe")return Ft(o.in,n)||Ft(o.out,n);if(o.type==="object"){for(let r in o.shape)if(Ft(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(Ft(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(Ft(r,n))return!0;return!!(o.rest&&Ft(o.rest,n))}return!1}a(Ft,"isTransforming");var zg=a((e,t={})=>n=>{let o=Yn({...n,processors:t});return qe(e,o),eo(o,e),to(o,e)},"createToJSONSchemaMethod"),Fi=a((e,t,n={})=>o=>{let{libraryOptions:r,target:i}=o??{},s=Yn({...r??{},target:i,io:t,processors:n});return qe(e,s),eo(s,e),to(s,e)},"createStandardJSONSchemaMethod");var YN={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ng=a((e,t,n,o)=>{let r=n;r.type="string";let{minimum:i,maximum:s,format:u,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof s=="number"&&(r.maxLength=s),u&&(r.format=YN[u]??u,r.format===""&&delete r.format,u==="time"&&delete r.format),p&&(r.contentEncoding=p),d&&d.size>0){let f=[...d];f.length===1?r.pattern=f[0].source:f.length>1&&(r.allOf=[...f.map(g=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:g.source}))])}},"stringProcessor"),Dg=a((e,t,n,o)=>{let r=n,{minimum:i,maximum:s,format:u,multipleOf:d,exclusiveMaximum:p,exclusiveMinimum:f}=e._zod.bag;typeof u=="string"&&u.includes("int")?r.type="integer":r.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=f,r.exclusiveMinimum=!0):r.exclusiveMinimum=f),typeof i=="number"&&(r.minimum=i,typeof f=="number"&&t.target!=="draft-04"&&(f>=i?delete r.minimum:delete r.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=p,r.exclusiveMaximum=!0):r.exclusiveMaximum=p),typeof s=="number"&&(r.maximum=s,typeof p=="number"&&t.target!=="draft-04"&&(p<=s?delete r.maximum:delete r.exclusiveMaximum)),typeof d=="number"&&(r.multipleOf=d)},"numberProcessor"),Ug=a((e,t,n,o)=>{n.type="boolean"},"booleanProcessor"),jg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},"bigintProcessor"),Mg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},"symbolProcessor"),Lg=a((e,t,n,o)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},"nullProcessor"),Fg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},"undefinedProcessor"),Bg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},"voidProcessor"),qg=a((e,t,n,o)=>{n.not={}},"neverProcessor"),Vg=a((e,t,n,o)=>{},"anyProcessor"),Zg=a((e,t,n,o)=>{},"unknownProcessor"),Hg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},"dateProcessor"),Gg=a((e,t,n,o)=>{let r=e._zod.def,i=Ja(r.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},"enumProcessor"),Wg=a((e,t,n,o)=>{let r=e._zod.def,i=[];for(let s of r.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},"literalProcessor"),Jg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},"nanProcessor"),Kg=a((e,t,n,o)=>{let r=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},"templateLiteralProcessor"),Xg=a((e,t,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:u,mime:d}=e._zod.bag;s!==void 0&&(i.minLength=s),u!==void 0&&(i.maxLength=u),d?d.length===1?(i.contentMediaType=d[0],Object.assign(r,i)):(Object.assign(r,i),r.anyOf=d.map(p=>({contentMediaType:p}))):Object.assign(r,i)},"fileProcessor"),Qg=a((e,t,n,o)=>{n.type="boolean"},"successProcessor"),Yg=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},"customProcessor"),ey=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},"functionProcessor"),ty=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},"transformProcessor"),ry=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},"mapProcessor"),ny=a((e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},"setProcessor"),oy=a((e,t,n,o)=>{let r=n,i=e._zod.def,{minimum:s,maximum:u}=e._zod.bag;typeof s=="number"&&(r.minItems=s),typeof u=="number"&&(r.maxItems=u),r.type="array",r.items=qe(i.element,t,{...o,path:[...o.path,"items"]})},"arrayProcessor"),iy=a((e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object",r.properties={};let s=i.shape;for(let p in s)r.properties[p]=qe(s[p],t,{...o,path:[...o.path,"properties",p]});let u=new Set(Object.keys(s)),d=new Set([...u].filter(p=>{let f=i.shape[p]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));d.size>0&&(r.required=Array.from(d)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=qe(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},"objectProcessor"),zd=a((e,t,n,o)=>{let r=e._zod.def,i=r.inclusive===!1,s=r.options.map((u,d)=>qe(u,t,{...o,path:[...o.path,i?"oneOf":"anyOf",d]}));i?n.oneOf=s:n.anyOf=s},"unionProcessor"),ay=a((e,t,n,o)=>{let r=e._zod.def,i=qe(r.left,t,{...o,path:[...o.path,"allOf",0]}),s=qe(r.right,t,{...o,path:[...o.path,"allOf",1]}),u=a(p=>"allOf"in p&&Object.keys(p).length===1,"isSimpleIntersection"),d=[...u(i)?i.allOf:[i],...u(s)?s.allOf:[s]];n.allOf=d},"intersectionProcessor"),sy=a((e,t,n,o)=>{let r=n,i=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",u=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",d=i.items.map((y,h)=>qe(y,t,{...o,path:[...o.path,s,h]})),p=i.rest?qe(i.rest,t,{...o,path:[...o.path,u,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(r.prefixItems=d,p&&(r.items=p)):t.target==="openapi-3.0"?(r.items={anyOf:d},p&&r.items.anyOf.push(p),r.minItems=d.length,p||(r.maxItems=d.length)):(r.items=d,p&&(r.additionalItems=p));let{minimum:f,maximum:g}=e._zod.bag;typeof f=="number"&&(r.minItems=f),typeof g=="number"&&(r.maxItems=g)},"tupleProcessor"),cy=a((e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object";let s=i.keyType,d=s._zod.bag?.patterns;if(i.mode==="loose"&&d&&d.size>0){let f=qe(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let g of d)r.patternProperties[g.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=qe(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=qe(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let p=s._zod.values;if(p){let f=[...p].filter(g=>typeof g=="string"||typeof g=="number");f.length>0&&(r.required=f)}},"recordProcessor"),uy=a((e,t,n,o)=>{let r=e._zod.def,i=qe(r.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},"nullableProcessor"),ly=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},"nonoptionalProcessor"),dy=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},"defaultProcessor"),py=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},"prefaultProcessor"),fy=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},"catchProcessor"),my=a((e,t,n,o)=>{let r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;qe(i,t,o);let s=t.seen.get(e);s.ref=i},"pipeProcessor"),hy=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.readOnly=!0},"readonlyProcessor"),gy=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},"promiseProcessor"),Nd=a((e,t,n,o)=>{let r=e._zod.def;qe(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},"optionalProcessor"),yy=a((e,t,n,o)=>{let r=e._zod.innerType;qe(r,t,o);let i=t.seen.get(e);i.ref=r},"lazyProcessor"),$d={string:Ng,number:Dg,boolean:Ug,bigint:jg,symbol:Mg,null:Lg,undefined:Fg,void:Bg,never:qg,any:Vg,unknown:Zg,date:Hg,enum:Gg,literal:Wg,nan:Jg,template_literal:Kg,file:Xg,success:Qg,custom:Yg,function:ey,transform:ty,map:ry,set:ny,array:oy,object:iy,union:zd,intersection:ay,tuple:sy,record:cy,nullable:uy,nonoptional:ly,default:dy,prefault:py,catch:fy,pipe:my,readonly:hy,promise:gy,optional:Nd,lazy:yy};function uc(e,t){if("_idmap"in e){let o=e,r=Yn({...t,processors:$d}),i={};for(let d of o._idmap.entries()){let[p,f]=d;qe(f,r)}let s={},u={registry:o,uri:t?.uri,defs:i};r.external=u;for(let d of o._idmap.entries()){let[p,f]=d;eo(r,f),s[p]=to(r,f)}if(Object.keys(i).length>0){let d=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[d]:i}}return{schemas:s}}let n=Yn({...t,processors:$d});return qe(e,n),eo(n,e),to(n,e)}a(uc,"toJSONSchema");var Dd=class{static{a(this,"JSONSchemaGenerator")}get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=Yn({processors:$d,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return qe(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),eo(this.ctx,t);let o=to(this.ctx,t),{"~standard":r,...i}=o;return i}};var FP={};var lt=A("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");he.init(e,t),e.def=t,e.type=t.type,e.parse=(n,o)=>Ao(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>Ri(e,n,o),e.parseAsync=async(n,o)=>Io(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>ki(e,n,o),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]},{parent:!0}),e.with=e.check,e.clone=(n,o)=>bt(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.apply=n=>n(e)}),Ud=A("ZodMiniString",(e,t)=>{Pn.init(e,t),lt.init(e,t)});function b(e){return Ts(Ud,e)}a(b,"string");var BP=A("ZodMiniStringFormat",(e,t)=>{Be.init(e,t),Ud.init(e,t)});var rD=A("ZodMiniURL",(e,t)=>{os.init(e,t),BP.init(e,t)});function qP(e){return Co(rD,e)}a(qP,"url");var jd=A("ZodMiniNumber",(e,t)=>{$i.init(e,t),lt.init(e,t)});function Et(e){return Gs(jd,e)}a(Et,"number");var nD=A("ZodMiniNumberFormat",(e,t)=>{is.init(e,t),jd.init(e,t)});function VP(e){return Js(nD,e)}a(VP,"int");var _y=A("ZodMiniBoolean",(e,t)=>{Oo.init(e,t),lt.init(e,t)});function ze(e){return Ks(_y,e)}a(ze,"boolean");var ZP=A("ZodMiniBigInt",(e,t)=>{zi.init(e,t),lt.init(e,t)});var oD=A("ZodMiniAny",(e,t)=>{as.init(e,t),lt.init(e,t)});function lc(){return Ys(oD)}a(lc,"any");var iD=A("ZodMiniUnknown",(e,t)=>{ss.init(e,t),lt.init(e,t)});function _e(){return ec(iD)}a(_e,"unknown");var aD=A("ZodMiniVoid",(e,t)=>{cs.init(e,t),lt.init(e,t)});function HP(e){return tc(aD,e)}a(HP,"_void");var GP=A("ZodMiniDate",(e,t)=>{us.init(e,t),lt.init(e,t)});var sD=A("ZodMiniArray",(e,t)=>{ls.init(e,t),lt.init(e,t)});function me(e,t){return new sD({type:"array",element:e,...J(t)})}a(me,"array");var cD=A("ZodMiniObject",(e,t)=>{Fl.init(e,t),lt.init(e,t),Se(e,"shape",()=>t.shape)});function k(e,t){let n={type:"object",shape:e??{},...J(t)};return new cD(n)}a(k,"object");var uD=A("ZodMiniUnion",(e,t)=>{ko.init(e,t),lt.init(e,t)});function Pe(e,t){return new uD({type:"union",options:e,...J(t)})}a(Pe,"union");var lD=A("ZodMiniDiscriminatedUnion",(e,t)=>{ds.init(e,t),lt.init(e,t)});function ro(e,t,n){return new lD({type:"union",options:t,discriminator:e,...J(n)})}a(ro,"discriminatedUnion");var dD=A("ZodMiniRecord",(e,t)=>{fs.init(e,t),lt.init(e,t)});function be(e,t,n){return new dD({type:"record",keyType:e,valueType:t,...J(n)})}a(be,"record");var pD=A("ZodMiniEnum",(e,t)=>{ms.init(e,t),lt.init(e,t),e.options=Object.values(t.entries)});function pe(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new pD({type:"enum",entries:n,...J(t)})}a(pe,"_enum");var fD=A("ZodMiniLiteral",(e,t)=>{hs.init(e,t),lt.init(e,t)});function le(e,t){return new fD({type:"literal",values:Array.isArray(e)?e:[e],...J(t)})}a(le,"literal");var mD=A("ZodMiniTransform",(e,t)=>{gs.init(e,t),lt.init(e,t)});function no(e){return new mD({type:"transform",transform:e})}a(no,"transform");var hD=A("ZodMiniOptional",(e,t)=>{Ni.init(e,t),lt.init(e,t)});function F(e){return new hD({type:"optional",innerType:e})}a(F,"optional");var gD=A("ZodMiniNullable",(e,t)=>{ys.init(e,t),lt.init(e,t)});function dc(e){return new gD({type:"nullable",innerType:e})}a(dc,"nullable");var yD=A("ZodMiniPipe",(e,t)=>{_s.init(e,t),lt.init(e,t)});function oo(e,t){return new yD({type:"pipe",in:e,out:t})}a(oo,"pipe");var _D=A("ZodMiniCustom",(e,t)=>{bs.init(e,t),lt.init(e,t)});function Md(e,t){return cc(_D,e??(()=>!0),t)}a(Md,"custom");var pc={};ar(pc,{bigint:()=>PD,boolean:()=>SD,date:()=>xD,number:()=>ED,string:()=>vD});function vD(e){return ws(Ud,e)}a(vD,"string");function ED(e){return Ws(jd,e)}a(ED,"number");function SD(e){return Xs(_y,e)}a(SD,"boolean");function PD(e){return Qs(ZP,e)}a(PD,"bigint");function xD(e){return rc(GP,e)}a(xD,"date");var vy=k({retryOnFailure:k({defaultValue:F(ze()),hide:F(ze())}),continueOnFailure:k({defaultValue:F(ze()),hide:F(ze())})}),by=class{constructor(t,n,o,r,i,s,u,d,p,f,g,y,h){this.name=t;this.displayName=n;this.description=o;this.props=r;this.propertyGroups=i;this.run=s;this.test=u;this.requireAuth=d;this.errorHandlingOptions=p;this.outputSchema=f;this.audience=g;this.aiMetadata=y;this.classification=h}static{a(this,"IAction")}},dt=a(e=>new by(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var ke=k({displayName:b(),description:F(b()),advanced:F(ze()),width:F(pe(["half","full"])),icon:F(b()),placeholder:F(b())}),ve=a((e,t)=>k({type:le(t),required:ze(),defaultValue:F(lc())}),"TPropertyValue");var ur=k({...ke.shape,...ve(b(),"SHORT_TEXT").shape}),wn=k({...ke.shape,...ve(b(),"LONG_TEXT").shape});var JP=k({label:b(),value:_e(),description:F(b()),icon:F(b())}),Ld=k({disabled:F(ze()),placeholder:F(b()),options:me(JP)});var wD=pe(["cards"]),lr=k({...ke.shape,options:Ld,display:F(wD),...ve(_e(),"STATIC_DROPDOWN").shape}),An=k({...ke.shape,options:Ld,...ve(me(_e()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ey=k({...ke.shape,...ve(_e(),"DROPDOWN").shape,refreshers:me(b())}),fc=k({...ke.shape,...ve(me(_e()),"MULTI_SELECT_DROPDOWN").shape,refreshers:me(b())});var In=k({...ke.shape,reveals:F(me(b())),...ve(ze(),"CHECKBOX").shape});var Rn=k({...ke.shape,display:F(pe(["stepper"])),min:F(Et()),max:F(Et()),step:F(Et()),...ve(Et(),"NUMBER").shape});var mc=k({...ke.shape,streaming:F(ze()),...ve(_e(),"FILE").shape});var hc=k({...ke.shape,...ve(b(),"DATE_TIME").shape});var KP=be(b(),Pe([ur,wn,lr,fc,An,In,Rn,mc,hc])),gc=k({...ke.shape,properties:KP,...ve(me(_e()),"ARRAY").shape});var XP=pe(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),QP=k({preset:F(XP),after:F(b()),before:F(b())}),Sy=k({...ke.shape,display:F(pe(["dropdown"])),...ve(QP,"DATE_RANGE").shape});var yc=k({...ke.shape,...ve(Pe([be(b(),_e())]),"JSON").shape});var YP=Pe([ur,lr,yc,gc,An]),AD=be(b(),YP),Py=k({refreshers:me(b()),...ke.shape,...ve(_e(),"DYNAMIC").shape});var Fd=k({...ke.shape,...ve(HP(),"MARKDOWN").shape});var _c=(n=>(n.ARCHIVE="ARCHIVE",n.REGISTRY="REGISTRY",n))(_c||{}),Bi=(n=>(n.CUSTOM="CUSTOM",n.OFFICIAL="OFFICIAL",n))(Bi||{}),qi=(S=>(S.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",S.COMMUNICATION="COMMUNICATION",S.COMMERCE="COMMERCE",S.CORE="CORE",S.UNIVERSAL_AI="UNIVERSAL_AI",S.FLOW_CONTROL="FLOW_CONTROL",S.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",S.ACCOUNTING="ACCOUNTING",S.PRODUCTIVITY="PRODUCTIVITY",S.CONTENT_AND_FILES="CONTENT_AND_FILES",S.DEVELOPER_TOOLS="DEVELOPER_TOOLS",S.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",S.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",S.HUMAN_RESOURCES="HUMAN_RESOURCES",S.PAYMENT_PROCESSING="PAYMENT_PROCESSING",S.MARKETING="MARKETING",S.SALES_AND_CRM="SALES_AND_CRM",S))(qi||{});var bc=(n=>(n.AUTHORIZATION_CODE="authorization_code",n.CLIENT_CREDENTIALS="client_credentials",n))(bc||{}),xy="both_client_credentials_and_authorization_code";var Br=(r=>(r.POLLING="POLLING",r.WEBHOOK="WEBHOOK",r.APP_WEBHOOK="APP_WEBHOOK",r.MANUAL="MANUAL",r))(Br||{}),vc=(i=>(i.NONE="NONE",i.HEADER_PRESENT="HEADER_PRESENT",i.QUERY_PRESENT="QUERY_PRESENT",i.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",i.HEAD_REQUEST="HEAD_REQUEST",i))(vc||{}),ID=k({strategy:pe(vc),paramName:F(b())}),Ec=(n=>(n.SIMULATION="SIMULATION",n.TEST_FUNCTION="TEST_FUNCTION",n))(Ec||{});var Bd=(n=>(n.WEBSOCKET="WEBSOCKET",n.NONE="NONE",n))(Bd||{}),ex=k({status:F(Et()),body:F(_e()),headers:F(be(b(),b()))}),tx=k({type:le("DELAY"),resumeDateTime:b(),requestIdToReply:F(b()),handlerId:F(b()),streamStepProgress:F(pe(Bd))}),rx=k({type:le("WEBHOOK"),requestId:b(),requestIdToReply:F(b()),response:ex,handlerId:F(b()),streamStepProgress:F(pe(Bd))}),RD=Pe([tx,rx]);var OD=k({body:_e(),rawBody:F(_e()),headers:be(b(),b()),queryParams:be(b(),b())});function ut(e){return e==null}a(ut,"isNil");function Sc(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}a(Sc,"isEmpty");function qd(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}a(qd,"assertNotNullOrUndefined");function Ty(e){try{return{data:e(),error:null}}catch(t){return{data:null,error:t}}}a(Ty,"tryCatchSync");var wy=It(require("crypto"),1);var kD=128,io,Vi,CD=a(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!io||io.length<e?(io=Buffer.allocUnsafe(e*kD),wy.default.randomFillSync(io),Vi=0):Vi+e>io.length&&(wy.default.randomFillSync(io),Vi=0)}catch(t){throw io=void 0,t}Vi+=e},"fillPool"),$D=a(e=>(CD(e|=0),io.subarray(Vi-e,Vi)),"random"),zD=a((e,t,n)=>{let o=(2<<31-Math.clz32(e.length-1|1))-1,r=Math.ceil(1.6*o*t/e.length);return(i=t)=>{if(i<=0)return"";let s="";for(;;){let u=n(r),d=r;for(;d--;)if(s+=e[u[d]&o]||"",s.length===i)return s}}},"customRandom"),ox=a((e,t=21)=>zD(e,t,$D),"customAlphabet");var ND="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ix=21,vG=b().check(Rt(new RegExp(`^[0-9a-zA-Z]{${ix}}$`))),DD=ox(ND,ix);var ao=oo(no(e=>e instanceof Date?e.toISOString():e),b()),wr={id:b(),created:ao,updated:ao},at=a(e=>F(dc(e)),"Nullable");function Ay(e){return F(dc(pe(e)))}a(Ay,"NullableEnum");var PG=oo(no(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),F(ze())),Vd=a(e=>oo(no(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),F(me(e))),"OptionalArrayFromQuery");var wG=be(b(),_e());var Zi=(S=>(S.OPENAI="openai",S.OPENROUTER="openrouter",S.ANTHROPIC="anthropic",S.AZURE="azure",S.GOOGLE="google",S.ACTIVEPIECES="activepieces",S.CLOUDFLARE_GATEWAY="cloudflare-gateway",S.CUSTOM="custom",S.BEDROCK="bedrock",S.VERTEX="vertex",S.MISTRAL="mistral",S.XAI="xai",S.DEEPSEEK="deepseek",S.ZAI="zai",S.QWEN="qwen",S.MINIMAX="minimax",S.MOONSHOT="moonshot",S))(Zi||{});var MG=b().check(Rt(/^#[0-9A-Fa-f]{6}$/));var FG=k({filename:b(),data:_e(),type:le("file"),mimetype:F(b())});var UD=It(sx());var WG=k({...wr,name:b(),permissions:me(b()),platformId:at(b()),type:b(),userCount:F(Et())});var Tp={};ar(Tp,{$brand:()=>Ga,$input:()=>sd,$output:()=>ad,NEVER:()=>qu,TimePrecision:()=>ud,ZodAny:()=>Xy,ZodArray:()=>t_,ZodBase64:()=>pp,ZodBase64URL:()=>fp,ZodBigInt:()=>Qi,ZodBigIntFormat:()=>gp,ZodBoolean:()=>Xi,ZodCIDRv4:()=>lp,ZodCIDRv6:()=>dp,ZodCUID:()=>np,ZodCUID2:()=>op,ZodCatch:()=>P_,ZodCodec:()=>xp,ZodCustom:()=>zc,ZodCustomStringFormat:()=>Ji,ZodDate:()=>Rc,ZodDefault:()=>y_,ZodDiscriminatedUnion:()=>n_,ZodE164:()=>mp,ZodEmail:()=>ep,ZodEmoji:()=>tp,ZodEnum:()=>Gi,ZodError:()=>jD,ZodExactOptional:()=>m_,ZodFile:()=>p_,ZodFirstPartyTypeKind:()=>N_,ZodFunction:()=>C_,ZodGUID:()=>xc,ZodIPv4:()=>cp,ZodIPv6:()=>up,ZodISODate:()=>Wd,ZodISODateTime:()=>Gd,ZodISODuration:()=>Kd,ZodISOTime:()=>Jd,ZodIntersection:()=>o_,ZodIssueCode:()=>LD,ZodJWT:()=>hp,ZodKSUID:()=>sp,ZodLazy:()=>R_,ZodLiteral:()=>d_,ZodMAC:()=>Vy,ZodMap:()=>u_,ZodNaN:()=>T_,ZodNanoID:()=>rp,ZodNever:()=>Yy,ZodNonOptional:()=>Sp,ZodNull:()=>Jy,ZodNullable:()=>g_,ZodNumber:()=>Ki,ZodNumberFormat:()=>Zo,ZodObject:()=>kc,ZodOptional:()=>Ep,ZodPipe:()=>Pp,ZodPrefault:()=>b_,ZodPromise:()=>k_,ZodReadonly:()=>w_,ZodRealError:()=>Kt,ZodRecord:()=>$c,ZodSet:()=>l_,ZodString:()=>Wi,ZodStringFormat:()=>We,ZodSuccess:()=>S_,ZodSymbol:()=>Gy,ZodTemplateLiteral:()=>I_,ZodTransform:()=>f_,ZodTuple:()=>a_,ZodType:()=>xe,ZodULID:()=>ip,ZodURL:()=>Ic,ZodUUID:()=>tn,ZodUndefined:()=>Wy,ZodUnion:()=>Cc,ZodUnknown:()=>Qy,ZodVoid:()=>e_,ZodXID:()=>ap,ZodXor:()=>r_,_ZodString:()=>Yd,_default:()=>__,_function:()=>mT,any:()=>Hx,array:()=>Oc,base64:()=>Rx,base64url:()=>Ox,bigint:()=>Fx,boolean:()=>Hy,catch:()=>x_,check:()=>hT,cidrv4:()=>Ax,cidrv6:()=>Ix,clone:()=>bt,codec:()=>dT,coerce:()=>D_,config:()=>it,core:()=>cr,cuid:()=>bx,cuid2:()=>vx,custom:()=>gT,date:()=>Wx,decode:()=>Uy,decodeAsync:()=>My,describe:()=>yT,discriminatedUnion:()=>eT,e164:()=>kx,email:()=>ux,emoji:()=>yx,encode:()=>Dy,encodeAsync:()=>jy,endsWith:()=>Uo,enum:()=>bp,exactOptional:()=>h_,file:()=>sT,flattenError:()=>xi,float32:()=>Ux,float64:()=>jx,formatError:()=>Ti,fromJSONSchema:()=>xT,function:()=>mT,getErrorMap:()=>BD,globalRegistry:()=>vt,gt:()=>Lr,gte:()=>yt,guid:()=>lx,hash:()=>Dx,hex:()=>Nx,hostname:()=>zx,httpUrl:()=>gx,includes:()=>No,instanceof:()=>bT,int:()=>Qd,int32:()=>Mx,int64:()=>Bx,intersection:()=>i_,ipv4:()=>xx,ipv6:()=>wx,iso:()=>Hi,json:()=>ET,jwt:()=>Cx,keyof:()=>Jx,ksuid:()=>Px,lazy:()=>O_,length:()=>Qn,literal:()=>aT,locales:()=>ji,looseObject:()=>Qx,looseRecord:()=>rT,lowercase:()=>$o,lt:()=>Mr,lte:()=>Lt,mac:()=>Tx,map:()=>nT,maxLength:()=>Xn,maxSize:()=>Tn,meta:()=>_T,mime:()=>jo,minLength:()=>ct,minSize:()=>Fr,multipleOf:()=>xn,nan:()=>lT,nanoid:()=>_x,nativeEnum:()=>iT,negative:()=>oc,never:()=>yp,nonnegative:()=>ac,nonoptional:()=>E_,nonpositive:()=>ic,normalize:()=>Mo,null:()=>Ky,nullable:()=>wc,nullish:()=>cT,number:()=>Zy,object:()=>Kx,optional:()=>Tc,overwrite:()=>Tr,parse:()=>Cy,parseAsync:()=>$y,partialRecord:()=>tT,pipe:()=>Ac,positive:()=>nc,prefault:()=>v_,preprocess:()=>ST,prettifyError:()=>Wu,promise:()=>fT,property:()=>sc,readonly:()=>A_,record:()=>c_,refine:()=>$_,regex:()=>Rt,regexes:()=>Jt,registry:()=>xs,safeDecode:()=>Fy,safeDecodeAsync:()=>qy,safeEncode:()=>Ly,safeEncodeAsync:()=>By,safeParse:()=>zy,safeParseAsync:()=>Ny,set:()=>oT,setErrorMap:()=>FD,size:()=>Kn,slugify:()=>Li,startsWith:()=>Do,strictObject:()=>Xx,string:()=>Xd,stringFormat:()=>$x,stringbool:()=>vT,success:()=>uT,superRefine:()=>z_,symbol:()=>Vx,templateLiteral:()=>pT,toJSONSchema:()=>uc,toLowerCase:()=>Fo,toUpperCase:()=>Bo,transform:()=>vp,treeifyError:()=>Gu,trim:()=>Lo,tuple:()=>s_,uint32:()=>Lx,uint64:()=>qx,ulid:()=>Ex,undefined:()=>Zx,union:()=>_p,unknown:()=>Vo,uppercase:()=>zo,url:()=>hx,util:()=>X,uuid:()=>dx,uuidv4:()=>px,uuidv6:()=>fx,uuidv7:()=>mx,void:()=>Gx,xid:()=>Sx,xor:()=>Yx});var Pc={};ar(Pc,{ZodAny:()=>Xy,ZodArray:()=>t_,ZodBase64:()=>pp,ZodBase64URL:()=>fp,ZodBigInt:()=>Qi,ZodBigIntFormat:()=>gp,ZodBoolean:()=>Xi,ZodCIDRv4:()=>lp,ZodCIDRv6:()=>dp,ZodCUID:()=>np,ZodCUID2:()=>op,ZodCatch:()=>P_,ZodCodec:()=>xp,ZodCustom:()=>zc,ZodCustomStringFormat:()=>Ji,ZodDate:()=>Rc,ZodDefault:()=>y_,ZodDiscriminatedUnion:()=>n_,ZodE164:()=>mp,ZodEmail:()=>ep,ZodEmoji:()=>tp,ZodEnum:()=>Gi,ZodExactOptional:()=>m_,ZodFile:()=>p_,ZodFunction:()=>C_,ZodGUID:()=>xc,ZodIPv4:()=>cp,ZodIPv6:()=>up,ZodIntersection:()=>o_,ZodJWT:()=>hp,ZodKSUID:()=>sp,ZodLazy:()=>R_,ZodLiteral:()=>d_,ZodMAC:()=>Vy,ZodMap:()=>u_,ZodNaN:()=>T_,ZodNanoID:()=>rp,ZodNever:()=>Yy,ZodNonOptional:()=>Sp,ZodNull:()=>Jy,ZodNullable:()=>g_,ZodNumber:()=>Ki,ZodNumberFormat:()=>Zo,ZodObject:()=>kc,ZodOptional:()=>Ep,ZodPipe:()=>Pp,ZodPrefault:()=>b_,ZodPromise:()=>k_,ZodReadonly:()=>w_,ZodRecord:()=>$c,ZodSet:()=>l_,ZodString:()=>Wi,ZodStringFormat:()=>We,ZodSuccess:()=>S_,ZodSymbol:()=>Gy,ZodTemplateLiteral:()=>I_,ZodTransform:()=>f_,ZodTuple:()=>a_,ZodType:()=>xe,ZodULID:()=>ip,ZodURL:()=>Ic,ZodUUID:()=>tn,ZodUndefined:()=>Wy,ZodUnion:()=>Cc,ZodUnknown:()=>Qy,ZodVoid:()=>e_,ZodXID:()=>ap,ZodXor:()=>r_,_ZodString:()=>Yd,_default:()=>__,_function:()=>mT,any:()=>Hx,array:()=>Oc,base64:()=>Rx,base64url:()=>Ox,bigint:()=>Fx,boolean:()=>Hy,catch:()=>x_,check:()=>hT,cidrv4:()=>Ax,cidrv6:()=>Ix,codec:()=>dT,cuid:()=>bx,cuid2:()=>vx,custom:()=>gT,date:()=>Wx,describe:()=>yT,discriminatedUnion:()=>eT,e164:()=>kx,email:()=>ux,emoji:()=>yx,enum:()=>bp,exactOptional:()=>h_,file:()=>sT,float32:()=>Ux,float64:()=>jx,function:()=>mT,guid:()=>lx,hash:()=>Dx,hex:()=>Nx,hostname:()=>zx,httpUrl:()=>gx,instanceof:()=>bT,int:()=>Qd,int32:()=>Mx,int64:()=>Bx,intersection:()=>i_,ipv4:()=>xx,ipv6:()=>wx,json:()=>ET,jwt:()=>Cx,keyof:()=>Jx,ksuid:()=>Px,lazy:()=>O_,literal:()=>aT,looseObject:()=>Qx,looseRecord:()=>rT,mac:()=>Tx,map:()=>nT,meta:()=>_T,nan:()=>lT,nanoid:()=>_x,nativeEnum:()=>iT,never:()=>yp,nonoptional:()=>E_,null:()=>Ky,nullable:()=>wc,nullish:()=>cT,number:()=>Zy,object:()=>Kx,optional:()=>Tc,partialRecord:()=>tT,pipe:()=>Ac,prefault:()=>v_,preprocess:()=>ST,promise:()=>fT,readonly:()=>A_,record:()=>c_,refine:()=>$_,set:()=>oT,strictObject:()=>Xx,string:()=>Xd,stringFormat:()=>$x,stringbool:()=>vT,success:()=>uT,superRefine:()=>z_,symbol:()=>Vx,templateLiteral:()=>pT,transform:()=>vp,tuple:()=>s_,uint32:()=>Lx,uint64:()=>qx,ulid:()=>Ex,undefined:()=>Zx,union:()=>_p,unknown:()=>Vo,url:()=>hx,uuid:()=>dx,uuidv4:()=>px,uuidv6:()=>fx,uuidv7:()=>mx,void:()=>Gx,xid:()=>Sx,xor:()=>Yx});var Hd={};ar(Hd,{endsWith:()=>Uo,gt:()=>Lr,gte:()=>yt,includes:()=>No,length:()=>Qn,lowercase:()=>$o,lt:()=>Mr,lte:()=>Lt,maxLength:()=>Xn,maxSize:()=>Tn,mime:()=>jo,minLength:()=>ct,minSize:()=>Fr,multipleOf:()=>xn,negative:()=>oc,nonnegative:()=>ac,nonpositive:()=>ic,normalize:()=>Mo,overwrite:()=>Tr,positive:()=>nc,property:()=>sc,regex:()=>Rt,size:()=>Kn,slugify:()=>Li,startsWith:()=>Do,toLowerCase:()=>Fo,toUpperCase:()=>Bo,trim:()=>Lo,uppercase:()=>zo});var Hi={};ar(Hi,{ZodISODate:()=>Wd,ZodISODateTime:()=>Gd,ZodISODuration:()=>Kd,ZodISOTime:()=>Jd,date:()=>Ry,datetime:()=>Iy,duration:()=>ky,time:()=>Oy});var Gd=A("ZodISODateTime",(e,t)=>{Sl.init(e,t),We.init(e,t)});function Iy(e){return ld(Gd,e)}a(Iy,"datetime");var Wd=A("ZodISODate",(e,t)=>{Pl.init(e,t),We.init(e,t)});function Ry(e){return dd(Wd,e)}a(Ry,"date");var Jd=A("ZodISOTime",(e,t)=>{xl.init(e,t),We.init(e,t)});function Oy(e){return pd(Jd,e)}a(Oy,"time");var Kd=A("ZodISODuration",(e,t)=>{Tl.init(e,t),We.init(e,t)});function ky(e){return fd(Kd,e)}a(ky,"duration");var cx=a((e,t)=>{es.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:a(n=>Ti(e,n),"value")},flatten:{value:a(n=>xi(e,n),"value")},addIssue:{value:a(n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ei,2)},"value")},addIssues:{value:a(n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ei,2)},"value")},isEmpty:{get(){return e.issues.length===0}}})},"initializer"),jD=A("ZodError",cx),Kt=A("ZodError",cx,{Parent:Error});var Cy=wi(Kt),$y=Ai(Kt),zy=Ii(Kt),Ny=Oi(Kt),Dy=Ju(Kt),Uy=Ku(Kt),jy=Xu(Kt),My=Qu(Kt),Ly=Yu(Kt),Fy=el(Kt),By=tl(Kt),qy=rl(Kt);var xe=A("ZodType",(e,t)=>(he.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Fi(e,"input"),output:Fi(e,"output")}}),e.toJSONSchema=zg(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(X.mergeDefs(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>bt(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Cy(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>zy(e,n,o),e.parseAsync=async(n,o)=>$y(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Ny(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>Dy(e,n,o),e.decode=(n,o)=>Uy(e,n,o),e.encodeAsync=async(n,o)=>jy(e,n,o),e.decodeAsync=async(n,o)=>My(e,n,o),e.safeEncode=(n,o)=>Ly(e,n,o),e.safeDecode=(n,o)=>Fy(e,n,o),e.safeEncodeAsync=async(n,o)=>By(e,n,o),e.safeDecodeAsync=async(n,o)=>qy(e,n,o),e.refine=(n,o)=>e.check($_(n,o)),e.superRefine=n=>e.check(z_(n)),e.overwrite=n=>e.check(Tr(n)),e.optional=()=>Tc(e),e.exactOptional=()=>h_(e),e.nullable=()=>wc(e),e.nullish=()=>Tc(wc(e)),e.nonoptional=n=>E_(e,n),e.array=()=>Oc(e),e.or=n=>_p([e,n]),e.and=n=>i_(e,n),e.transform=n=>Ac(e,vp(n)),e.default=n=>__(e,n),e.prefault=n=>v_(e,n),e.catch=n=>x_(e,n),e.pipe=n=>Ac(e,n),e.readonly=()=>A_(e),e.describe=n=>{let o=e.clone();return vt.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return vt.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return vt.get(e);let o=e.clone();return vt.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Yd=A("_ZodString",(e,t)=>{Pn.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Ng(e,o,r,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Rt(...o)),e.includes=(...o)=>e.check(No(...o)),e.startsWith=(...o)=>e.check(Do(...o)),e.endsWith=(...o)=>e.check(Uo(...o)),e.min=(...o)=>e.check(ct(...o)),e.max=(...o)=>e.check(Xn(...o)),e.length=(...o)=>e.check(Qn(...o)),e.nonempty=(...o)=>e.check(ct(1,...o)),e.lowercase=o=>e.check($o(o)),e.uppercase=o=>e.check(zo(o)),e.trim=()=>e.check(Lo()),e.normalize=(...o)=>e.check(Mo(...o)),e.toLowerCase=()=>e.check(Fo()),e.toUpperCase=()=>e.check(Bo()),e.slugify=()=>e.check(Li())}),Wi=A("ZodString",(e,t)=>{Pn.init(e,t),Yd.init(e,t),e.email=n=>e.check(As(ep,n)),e.url=n=>e.check(Co(Ic,n)),e.jwt=n=>e.check(Hs(hp,n)),e.emoji=n=>e.check(Cs(tp,n)),e.guid=n=>e.check(Mi(xc,n)),e.uuid=n=>e.check(Is(tn,n)),e.uuidv4=n=>e.check(Rs(tn,n)),e.uuidv6=n=>e.check(Os(tn,n)),e.uuidv7=n=>e.check(ks(tn,n)),e.nanoid=n=>e.check($s(rp,n)),e.guid=n=>e.check(Mi(xc,n)),e.cuid=n=>e.check(zs(np,n)),e.cuid2=n=>e.check(Ns(op,n)),e.ulid=n=>e.check(Ds(ip,n)),e.base64=n=>e.check(qs(pp,n)),e.base64url=n=>e.check(Vs(fp,n)),e.xid=n=>e.check(Us(ap,n)),e.ksuid=n=>e.check(js(sp,n)),e.ipv4=n=>e.check(Ms(cp,n)),e.ipv6=n=>e.check(Ls(up,n)),e.cidrv4=n=>e.check(Fs(lp,n)),e.cidrv6=n=>e.check(Bs(dp,n)),e.e164=n=>e.check(Zs(mp,n)),e.datetime=n=>e.check(Iy(n)),e.date=n=>e.check(Ry(n)),e.time=n=>e.check(Oy(n)),e.duration=n=>e.check(ky(n))});function Xd(e){return Ts(Wi,e)}a(Xd,"string");var We=A("ZodStringFormat",(e,t)=>{Be.init(e,t),Yd.init(e,t)}),ep=A("ZodEmail",(e,t)=>{ml.init(e,t),We.init(e,t)});function ux(e){return As(ep,e)}a(ux,"email");var xc=A("ZodGUID",(e,t)=>{pl.init(e,t),We.init(e,t)});function lx(e){return Mi(xc,e)}a(lx,"guid");var tn=A("ZodUUID",(e,t)=>{fl.init(e,t),We.init(e,t)});function dx(e){return Is(tn,e)}a(dx,"uuid");function px(e){return Rs(tn,e)}a(px,"uuidv4");function fx(e){return Os(tn,e)}a(fx,"uuidv6");function mx(e){return ks(tn,e)}a(mx,"uuidv7");var Ic=A("ZodURL",(e,t)=>{os.init(e,t),We.init(e,t)});function hx(e){return Co(Ic,e)}a(hx,"url");function gx(e){return Co(Ic,{protocol:/^https?$/,hostname:Jt.domain,...X.normalizeParams(e)})}a(gx,"httpUrl");var tp=A("ZodEmoji",(e,t)=>{hl.init(e,t),We.init(e,t)});function yx(e){return Cs(tp,e)}a(yx,"emoji");var rp=A("ZodNanoID",(e,t)=>{gl.init(e,t),We.init(e,t)});function _x(e){return $s(rp,e)}a(_x,"nanoid");var np=A("ZodCUID",(e,t)=>{yl.init(e,t),We.init(e,t)});function bx(e){return zs(np,e)}a(bx,"cuid");var op=A("ZodCUID2",(e,t)=>{_l.init(e,t),We.init(e,t)});function vx(e){return Ns(op,e)}a(vx,"cuid2");var ip=A("ZodULID",(e,t)=>{bl.init(e,t),We.init(e,t)});function Ex(e){return Ds(ip,e)}a(Ex,"ulid");var ap=A("ZodXID",(e,t)=>{vl.init(e,t),We.init(e,t)});function Sx(e){return Us(ap,e)}a(Sx,"xid");var sp=A("ZodKSUID",(e,t)=>{El.init(e,t),We.init(e,t)});function Px(e){return js(sp,e)}a(Px,"ksuid");var cp=A("ZodIPv4",(e,t)=>{wl.init(e,t),We.init(e,t)});function xx(e){return Ms(cp,e)}a(xx,"ipv4");var Vy=A("ZodMAC",(e,t)=>{Il.init(e,t),We.init(e,t)});function Tx(e){return cd(Vy,e)}a(Tx,"mac");var up=A("ZodIPv6",(e,t)=>{Al.init(e,t),We.init(e,t)});function wx(e){return Ls(up,e)}a(wx,"ipv6");var lp=A("ZodCIDRv4",(e,t)=>{Rl.init(e,t),We.init(e,t)});function Ax(e){return Fs(lp,e)}a(Ax,"cidrv4");var dp=A("ZodCIDRv6",(e,t)=>{Ol.init(e,t),We.init(e,t)});function Ix(e){return Bs(dp,e)}a(Ix,"cidrv6");var pp=A("ZodBase64",(e,t)=>{kl.init(e,t),We.init(e,t)});function Rx(e){return qs(pp,e)}a(Rx,"base64");var fp=A("ZodBase64URL",(e,t)=>{Cl.init(e,t),We.init(e,t)});function Ox(e){return Vs(fp,e)}a(Ox,"base64url");var mp=A("ZodE164",(e,t)=>{$l.init(e,t),We.init(e,t)});function kx(e){return Zs(mp,e)}a(kx,"e164");var hp=A("ZodJWT",(e,t)=>{zl.init(e,t),We.init(e,t)});function Cx(e){return Hs(hp,e)}a(Cx,"jwt");var Ji=A("ZodCustomStringFormat",(e,t)=>{Nl.init(e,t),We.init(e,t)});function $x(e,t,n={}){return qo(Ji,e,t,n)}a($x,"stringFormat");function zx(e){return qo(Ji,"hostname",Jt.hostname,e)}a(zx,"hostname");function Nx(e){return qo(Ji,"hex",Jt.hex,e)}a(Nx,"hex");function Dx(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=Jt[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return qo(Ji,o,r,t)}a(Dx,"hash");var Ki=A("ZodNumber",(e,t)=>{$i.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Dg(e,o,r,i),e.gt=(o,r)=>e.check(Lr(o,r)),e.gte=(o,r)=>e.check(yt(o,r)),e.min=(o,r)=>e.check(yt(o,r)),e.lt=(o,r)=>e.check(Mr(o,r)),e.lte=(o,r)=>e.check(Lt(o,r)),e.max=(o,r)=>e.check(Lt(o,r)),e.int=o=>e.check(Qd(o)),e.safe=o=>e.check(Qd(o)),e.positive=o=>e.check(Lr(0,o)),e.nonnegative=o=>e.check(yt(0,o)),e.negative=o=>e.check(Mr(0,o)),e.nonpositive=o=>e.check(Lt(0,o)),e.multipleOf=(o,r)=>e.check(xn(o,r)),e.step=(o,r)=>e.check(xn(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Zy(e){return Gs(Ki,e)}a(Zy,"number");var Zo=A("ZodNumberFormat",(e,t)=>{is.init(e,t),Ki.init(e,t)});function Qd(e){return Js(Zo,e)}a(Qd,"int");function Ux(e){return md(Zo,e)}a(Ux,"float32");function jx(e){return hd(Zo,e)}a(jx,"float64");function Mx(e){return gd(Zo,e)}a(Mx,"int32");function Lx(e){return yd(Zo,e)}a(Lx,"uint32");var Xi=A("ZodBoolean",(e,t)=>{Oo.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Ug(e,n,o,r)});function Hy(e){return Ks(Xi,e)}a(Hy,"boolean");var Qi=A("ZodBigInt",(e,t)=>{zi.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,r,i)=>jg(e,o,r,i),e.gte=(o,r)=>e.check(yt(o,r)),e.min=(o,r)=>e.check(yt(o,r)),e.gt=(o,r)=>e.check(Lr(o,r)),e.gte=(o,r)=>e.check(yt(o,r)),e.min=(o,r)=>e.check(yt(o,r)),e.lt=(o,r)=>e.check(Mr(o,r)),e.lte=(o,r)=>e.check(Lt(o,r)),e.max=(o,r)=>e.check(Lt(o,r)),e.positive=o=>e.check(Lr(BigInt(0),o)),e.negative=o=>e.check(Mr(BigInt(0),o)),e.nonpositive=o=>e.check(Lt(BigInt(0),o)),e.nonnegative=o=>e.check(yt(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(xn(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Fx(e){return _d(Qi,e)}a(Fx,"bigint");var gp=A("ZodBigIntFormat",(e,t)=>{Dl.init(e,t),Qi.init(e,t)});function Bx(e){return bd(gp,e)}a(Bx,"int64");function qx(e){return vd(gp,e)}a(qx,"uint64");var Gy=A("ZodSymbol",(e,t)=>{Ul.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Mg(e,n,o,r)});function Vx(e){return Ed(Gy,e)}a(Vx,"symbol");var Wy=A("ZodUndefined",(e,t)=>{jl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Fg(e,n,o,r)});function Zx(e){return Sd(Wy,e)}a(Zx,"_undefined");var Jy=A("ZodNull",(e,t)=>{Ml.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Lg(e,n,o,r)});function Ky(e){return Pd(Jy,e)}a(Ky,"_null");var Xy=A("ZodAny",(e,t)=>{as.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Vg(e,n,o,r)});function Hx(){return Ys(Xy)}a(Hx,"any");var Qy=A("ZodUnknown",(e,t)=>{ss.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Zg(e,n,o,r)});function Vo(){return ec(Qy)}a(Vo,"unknown");var Yy=A("ZodNever",(e,t)=>{Ll.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>qg(e,n,o,r)});function yp(e){return xd(Yy,e)}a(yp,"never");var e_=A("ZodVoid",(e,t)=>{cs.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Bg(e,n,o,r)});function Gx(e){return tc(e_,e)}a(Gx,"_void");var Rc=A("ZodDate",(e,t)=>{us.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Hg(e,o,r,i),e.min=(o,r)=>e.check(yt(o,r)),e.max=(o,r)=>e.check(Lt(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Wx(e){return Td(Rc,e)}a(Wx,"date");var t_=A("ZodArray",(e,t)=>{ls.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>oy(e,n,o,r),e.element=t.element,e.min=(n,o)=>e.check(ct(n,o)),e.nonempty=n=>e.check(ct(1,n)),e.max=(n,o)=>e.check(Xn(n,o)),e.length=(n,o)=>e.check(Qn(n,o)),e.unwrap=()=>e.element});function Oc(e,t){return $g(t_,e,t)}a(Oc,"array");function Jx(e){let t=e._zod.def.shape;return bp(Object.keys(t))}a(Jx,"keyof");var kc=A("ZodObject",(e,t)=>{Lh.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>iy(e,n,o,r),X.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>bp(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vo()}),e.strict=()=>e.clone({...e._zod.def,catchall:yp()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>X.extend(e,n),e.safeExtend=n=>X.safeExtend(e,n),e.merge=n=>X.merge(e,n),e.pick=n=>X.pick(e,n),e.omit=n=>X.omit(e,n),e.partial=(...n)=>X.partial(Ep,e,n[0]),e.required=(...n)=>X.required(Sp,e,n[0])});function Kx(e,t){let n={type:"object",shape:e??{},...X.normalizeParams(t)};return new kc(n)}a(Kx,"object");function Xx(e,t){return new kc({type:"object",shape:e,catchall:yp(),...X.normalizeParams(t)})}a(Xx,"strictObject");function Qx(e,t){return new kc({type:"object",shape:e,catchall:Vo(),...X.normalizeParams(t)})}a(Qx,"looseObject");var Cc=A("ZodUnion",(e,t)=>{ko.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zd(e,n,o,r),e.options=t.options});function _p(e,t){return new Cc({type:"union",options:e,...X.normalizeParams(t)})}a(_p,"union");var r_=A("ZodXor",(e,t)=>{Cc.init(e,t),Bl.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zd(e,n,o,r),e.options=t.options});function Yx(e,t){return new r_({type:"union",options:e,inclusive:!1,...X.normalizeParams(t)})}a(Yx,"xor");var n_=A("ZodDiscriminatedUnion",(e,t)=>{Cc.init(e,t),ds.init(e,t)});function eT(e,t,n){return new n_({type:"union",options:t,discriminator:e,...X.normalizeParams(n)})}a(eT,"discriminatedUnion");var o_=A("ZodIntersection",(e,t)=>{ql.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ay(e,n,o,r)});function i_(e,t){return new o_({type:"intersection",left:e,right:t})}a(i_,"intersection");var a_=A("ZodTuple",(e,t)=>{ps.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>sy(e,n,o,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});function s_(e,t,n){let o=t instanceof he,r=o?n:t,i=o?t:null;return new a_({type:"tuple",items:e,rest:i,...X.normalizeParams(r)})}a(s_,"tuple");var $c=A("ZodRecord",(e,t)=>{fs.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>cy(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});function c_(e,t,n){return new $c({type:"record",keyType:e,valueType:t,...X.normalizeParams(n)})}a(c_,"record");function tT(e,t,n){let o=bt(e);return o._zod.values=void 0,new $c({type:"record",keyType:o,valueType:t,...X.normalizeParams(n)})}a(tT,"partialRecord");function rT(e,t,n){return new $c({type:"record",keyType:e,valueType:t,mode:"loose",...X.normalizeParams(n)})}a(rT,"looseRecord");var u_=A("ZodMap",(e,t)=>{Vl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ry(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Fr(...n)),e.nonempty=n=>e.check(Fr(1,n)),e.max=(...n)=>e.check(Tn(...n)),e.size=(...n)=>e.check(Kn(...n))});function nT(e,t,n){return new u_({type:"map",keyType:e,valueType:t,...X.normalizeParams(n)})}a(nT,"map");var l_=A("ZodSet",(e,t)=>{Zl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ny(e,n,o,r),e.min=(...n)=>e.check(Fr(...n)),e.nonempty=n=>e.check(Fr(1,n)),e.max=(...n)=>e.check(Tn(...n)),e.size=(...n)=>e.check(Kn(...n))});function oT(e,t){return new l_({type:"set",valueType:e,...X.normalizeParams(t)})}a(oT,"set");var Gi=A("ZodEnum",(e,t)=>{ms.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(o,r,i)=>Gg(e,o,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Gi({...t,checks:[],...X.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Gi({...t,checks:[],...X.normalizeParams(r),entries:i})}});function bp(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Gi({type:"enum",entries:n,...X.normalizeParams(t)})}a(bp,"_enum");function iT(e,t){return new Gi({type:"enum",entries:e,...X.normalizeParams(t)})}a(iT,"nativeEnum");var d_=A("ZodLiteral",(e,t)=>{hs.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Wg(e,n,o,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function aT(e,t){return new d_({type:"literal",values:Array.isArray(e)?e:[e],...X.normalizeParams(t)})}a(aT,"literal");var p_=A("ZodFile",(e,t)=>{Hl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Xg(e,n,o,r),e.min=(n,o)=>e.check(Fr(n,o)),e.max=(n,o)=>e.check(Tn(n,o)),e.mime=(n,o)=>e.check(jo(Array.isArray(n)?n:[n],o))});function sT(e){return Ad(p_,e)}a(sT,"file");var f_=A("ZodTransform",(e,t)=>{gs.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ty(e,n,o,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Zn(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(X.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(X.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function vp(e){return new f_({type:"transform",transform:e})}a(vp,"transform");var Ep=A("ZodOptional",(e,t)=>{Ni.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Nd(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function Tc(e){return new Ep({type:"optional",innerType:e})}a(Tc,"optional");var m_=A("ZodExactOptional",(e,t)=>{Gl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Nd(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function h_(e){return new m_({type:"optional",innerType:e})}a(h_,"exactOptional");var g_=A("ZodNullable",(e,t)=>{ys.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>uy(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function wc(e){return new g_({type:"nullable",innerType:e})}a(wc,"nullable");function cT(e){return Tc(wc(e))}a(cT,"nullish");var y_=A("ZodDefault",(e,t)=>{Wl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>dy(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function __(e,t){return new y_({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():X.shallowClone(t)}})}a(__,"_default");var b_=A("ZodPrefault",(e,t)=>{Jl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>py(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function v_(e,t){return new b_({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():X.shallowClone(t)}})}a(v_,"prefault");var Sp=A("ZodNonOptional",(e,t)=>{Kl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ly(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function E_(e,t){return new Sp({type:"nonoptional",innerType:e,...X.normalizeParams(t)})}a(E_,"nonoptional");var S_=A("ZodSuccess",(e,t)=>{Xl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Qg(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function uT(e){return new S_({type:"success",innerType:e})}a(uT,"success");var P_=A("ZodCatch",(e,t)=>{Ql.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>fy(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function x_(e,t){return new P_({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}a(x_,"_catch");var T_=A("ZodNaN",(e,t)=>{Yl.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Jg(e,n,o,r)});function lT(e){return wd(T_,e)}a(lT,"nan");var Pp=A("ZodPipe",(e,t)=>{_s.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>my(e,n,o,r),e.in=t.in,e.out=t.out});function Ac(e,t){return new Pp({type:"pipe",in:e,out:t})}a(Ac,"pipe");var xp=A("ZodCodec",(e,t)=>{Pp.init(e,t),Di.init(e,t)});function dT(e,t,n){return new xp({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}a(dT,"codec");var w_=A("ZodReadonly",(e,t)=>{ed.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>hy(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function A_(e){return new w_({type:"readonly",innerType:e})}a(A_,"readonly");var I_=A("ZodTemplateLiteral",(e,t)=>{td.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Kg(e,n,o,r)});function pT(e,t){return new I_({type:"template_literal",parts:e,...X.normalizeParams(t)})}a(pT,"templateLiteral");var R_=A("ZodLazy",(e,t)=>{od.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>yy(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});function O_(e){return new R_({type:"lazy",getter:e})}a(O_,"lazy");var k_=A("ZodPromise",(e,t)=>{nd.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>gy(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});function fT(e){return new k_({type:"promise",innerType:e})}a(fT,"promise");var C_=A("ZodFunction",(e,t)=>{rd.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ey(e,n,o,r)});function mT(e){return new C_({type:"function",input:Array.isArray(e?.input)?s_(e?.input):e?.input??Oc(Vo()),output:e?.output??Vo()})}a(mT,"_function");var zc=A("ZodCustom",(e,t)=>{bs.init(e,t),xe.init(e,t),e._zod.processJSONSchema=(n,o,r)=>Yg(e,n,o,r)});function hT(e){let t=new Ge({check:"custom"});return t._zod.check=e,t}a(hT,"check");function gT(e,t){return cc(zc,e??(()=>!0),t)}a(gT,"custom");function $_(e,t={}){return Id(zc,e,t)}a($_,"refine");function z_(e){return Rd(e)}a(z_,"superRefine");var yT=Od,_T=kd;function bT(e,t={}){let n=new zc({type:"custom",check:"custom",fn:a(o=>o instanceof e,"fn"),abort:!0,...X.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}a(bT,"_instanceof");var vT=a((...e)=>Cd({Codec:xp,Boolean:Xi,String:Wi},...e),"stringbool");function ET(e){let t=O_(()=>_p([Xd(e),Zy(),Hy(),Ky(),Oc(t),c_(Xd(),t)]));return t}a(ET,"json");function ST(e,t){return Ac(vp(e),t)}a(ST,"preprocess");var LD={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function FD(e){it({customError:e})}a(FD,"setErrorMap");function BD(){return it().customError}a(BD,"getErrorMap");var N_;N_||(N_={});var re={...Pc,...Hd,iso:Hi},qD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function VD(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}a(VD,"detectVersion");function ZD(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}a(ZD,"resolveRef");function PT(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return re.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return re.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=ZD(r,t),s=zt(i,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return re.null();if(r.length===0)return re.never();if(r.length===1)return re.literal(r[0]);if(r.every(s=>typeof s=="string"))return re.enum(r);let i=r.map(s=>re.literal(s));return i.length<2?i[0]:re.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return re.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(i=>{let s={...e,type:i};return PT(s,t)});return r.length===0?re.never():r.length===1?r[0]:re.union(r)}if(!n)return re.any();let o;switch(n){case"string":{let r=re.string();if(e.format){let i=e.format;i==="email"?r=r.check(re.email()):i==="uri"||i==="uri-reference"?r=r.check(re.url()):i==="uuid"||i==="guid"?r=r.check(re.uuid()):i==="date-time"?r=r.check(re.iso.datetime()):i==="date"?r=r.check(re.iso.date()):i==="time"?r=r.check(re.iso.time()):i==="duration"?r=r.check(re.iso.duration()):i==="ipv4"?r=r.check(re.ipv4()):i==="ipv6"?r=r.check(re.ipv6()):i==="mac"?r=r.check(re.mac()):i==="cidr"?r=r.check(re.cidrv4()):i==="cidr-v6"?r=r.check(re.cidrv6()):i==="base64"?r=r.check(re.base64()):i==="base64url"?r=r.check(re.base64url()):i==="e164"?r=r.check(re.e164()):i==="jwt"?r=r.check(re.jwt()):i==="emoji"?r=r.check(re.emoji()):i==="nanoid"?r=r.check(re.nanoid()):i==="cuid"?r=r.check(re.cuid()):i==="cuid2"?r=r.check(re.cuid2()):i==="ulid"?r=r.check(re.ulid()):i==="xid"?r=r.check(re.xid()):i==="ksuid"&&(r=r.check(re.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),o=r;break}case"number":case"integer":{let r=n==="integer"?re.number().int():re.number();typeof e.minimum=="number"&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),o=r;break}case"boolean":{o=re.boolean();break}case"null":{o=re.null();break}case"object":{let r={},i=e.properties||{},s=new Set(e.required||[]);for(let[d,p]of Object.entries(i)){let f=zt(p,t);r[d]=s.has(d)?f:f.optional()}if(e.propertyNames){let d=zt(e.propertyNames,t),p=e.additionalProperties&&typeof e.additionalProperties=="object"?zt(e.additionalProperties,t):re.any();if(Object.keys(r).length===0){o=re.record(d,p);break}let f=re.object(r).passthrough(),g=re.looseRecord(d,p);o=re.intersection(f,g);break}if(e.patternProperties){let d=e.patternProperties,p=Object.keys(d),f=[];for(let y of p){let h=zt(d[y],t),_=re.string().regex(new RegExp(y));f.push(re.looseRecord(_,h))}let g=[];if(Object.keys(r).length>0&&g.push(re.object(r).passthrough()),g.push(...f),g.length===0)o=re.object({}).passthrough();else if(g.length===1)o=g[0];else{let y=re.intersection(g[0],g[1]);for(let h=2;h<g.length;h++)y=re.intersection(y,g[h]);o=y}break}let u=re.object(r);e.additionalProperties===!1?o=u.strict():typeof e.additionalProperties=="object"?o=u.catchall(zt(e.additionalProperties,t)):o=u.passthrough();break}case"array":{let r=e.prefixItems,i=e.items;if(r&&Array.isArray(r)){let s=r.map(d=>zt(d,t)),u=i&&typeof i=="object"&&!Array.isArray(i)?zt(i,t):void 0;u?o=re.tuple(s).rest(u):o=re.tuple(s),typeof e.minItems=="number"&&(o=o.check(re.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(re.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(d=>zt(d,t)),u=e.additionalItems&&typeof e.additionalItems=="object"?zt(e.additionalItems,t):void 0;u?o=re.tuple(s).rest(u):o=re.tuple(s),typeof e.minItems=="number"&&(o=o.check(re.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(re.maxLength(e.maxItems)))}else if(i!==void 0){let s=zt(i,t),u=re.array(s);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=re.array(re.any());break}default:throw new Error(`Unsupported type: ${n}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}a(PT,"convertBaseSchema");function zt(e,t){if(typeof e=="boolean")return e?re.any():re.never();let n=PT(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(p=>zt(p,t)),d=re.union(u);n=o?re.intersection(n,d):d}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(p=>zt(p,t)),d=re.xor(u);n=o?re.intersection(n,d):d}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=o?n:re.any();else{let u=o?n:zt(e.allOf[0],t),d=o?0:1;for(let p=d;p<e.allOf.length;p++)u=re.intersection(u,zt(e.allOf[p],t));n=u}e.nullable===!0&&t.version==="openapi-3.0"&&(n=re.nullable(n)),e.readOnly===!0&&(n=re.readonly(n));let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of i)u in e&&(r[u]=e[u]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let u of s)u in e&&(r[u]=e[u]);for(let u of Object.keys(e))qD.has(u)||(r[u]=e[u]);return Object.keys(r).length>0&&t.registry.add(n,r),n}a(zt,"convertSchema");function xT(e,t){if(typeof e=="boolean")return e?re.any():re.never();let n=VD(e,t?.defaultTarget),o=e.$defs||e.definitions||{},r={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??vt};return zt(e,r)}a(xT,"fromJSONSchema");var D_={};ar(D_,{bigint:()=>JD,boolean:()=>WD,date:()=>KD,number:()=>GD,string:()=>HD});function HD(e){return ws(Wi,e)}a(HD,"string");function GD(e){return Ws(Ki,e)}a(GD,"number");function WD(e){return Xs(Xi,e)}a(WD,"boolean");function JD(e){return Qs(Qi,e)}a(JD,"bigint");function KD(e){return rc(Rc,e)}a(KD,"date");it(vs());var zW=Tp.enum(["active","out_of_credits","rejected","unreachable"]);var TT=(o=>(o.AGENT_DECIDE="agent-decide",o.CHOOSE_YOURSELF="choose-yourself",o.LEAVE_EMPTY="leave-empty",o))(TT||{}),U_=(n=>(n.FILE="FILE",n.TABLE="TABLE",n))(U_||{}),j_=(o=>(o.SSE="sse",o.STREAMABLE_HTTP="streamable-http",o.SIMPLE_HTTP="http",o))(j_||{});var M_=(o=>(o.TEXT="text",o.NUMBER="number",o.BOOLEAN="boolean",o))(M_||{});var L_=(n=>(n.IN_PROGRESS="in-progress",n.COMPLETED="completed",n))(L_||{});var XD=k({mode:pe(TT),value:_e()}),QD=k({auth:F(b()),fields:be(b(),XD)}),YD=k({pieceName:b(),pieceVersion:b(),actionName:b(),predefinedInput:F(QD)}),eU=k({type:le("PIECE"),toolName:b().check(ct(1)),pieceMetadata:YD}),tU=k({type:le("none")}),rU=k({type:le("access_token"),accessToken:b()}),nU=k({type:le("api_key"),apiKey:b(),apiKeyHeader:b()}),oU=k({type:le("headers"),headers:be(b(),b())}),iU=ro("type",[tU,rU,nU,oU]),wT=k({type:le("FLOW"),toolName:b().check(ct(1)),externalFlowId:b(),flowDisplayName:F(b())}),AT=k({type:le("MCP"),toolName:b().check(ct(1)),serverUrl:qP(),protocol:pe(j_),auth:iU}),IT=k({type:le("KNOWLEDGE_BASE"),toolName:b().check(ct(1)),sourceType:pe(U_),sourceId:b(),sourceName:b()}),aU=ro("type",[eU,wT,AT,IT]),sU=k({displayName:b(),description:F(b()),type:pe(M_)}),RT=k({type:le("MARKDOWN"),markdown:b()}),Yi={type:le("TOOL_CALL"),input:at(be(b(),_e())),output:F(_e()),toolName:b(),status:pe(L_),toolCallId:b(),startTime:b(),endTime:F(b())},cJ=k(Yi),OT=ro("toolCallType",[k({...Yi,toolCallType:le("PIECE"),pieceName:b(),pieceVersion:b(),actionName:b()}),k({...Yi,toolCallType:le("FLOW"),displayName:b(),externalFlowId:b()}),k({...Yi,toolCallType:le("MCP"),displayName:b(),serverUrl:b()}),k({...Yi,toolCallType:le("KNOWLEDGE_BASE"),displayName:b(),sourceType:b()}),k({...Yi,toolCallType:le("UNKNOWN"),displayName:b()})]),cU=Pe([RT,OT]);var uU=10800*1e3,lU=900*1e3;var B_=(n=>(n.IMAGE="image",n.TEXT="text",n))(B_||{}),On=k({apiKey:b()}),pU=On,fU=k({apiKey:b(),apiKeyHash:b()}),mU=On,hU=On,gU=On,yU=On,_U=On,bU=On,vU=On,zT=k({serviceAccountJson:b().check(ct(1))}),NT=k({accessKeyId:b().check(ct(1)),secretAccessKey:b().check(ct(1))}),EU=k({}),SU=k({}),PU=k({}),xU=k({}),TU=k({}),wU=k({}),q_=k({modelId:b(),modelName:b(),modelType:pe(B_)}),DT=k({apiKeyHeader:b(),baseUrl:b(),models:me(q_),defaultHeaders:F(be(b(),b())),apiStyle:F(pe(["chat","responses"]))}),UT=k({accountId:b(),gatewayId:b(),models:me(q_),vertexProject:F(b()),vertexRegion:F(b())}),jT=k({resourceName:b(),apiVersion:oo(no(e=>typeof e=="string"&&e.trim().length===0?void 0:e),F(b()))}),MT=k({region:b().check(ct(1))}),LT=k({project:b().check(Rt(/^[a-z0-9][a-z0-9-]{0,62}$/)),region:b().check(Rt(/^[a-z0-9][a-z0-9-]{0,62}$/)),models:me(q_)}),FT=k({}),AU=Pe([pU,gU,yU,_U,bU,hU,mU,fU,NT,zT,vU]),BT=Pe([DT,UT,jT,LT,MT,EU,PU,xU,TU,SU,wU,FT]),IU=k({id:b(),name:b(),type:pe(B_)}),RU=k({id:b(),name:b(),provider:pe(Zi),config:BT,enabledForChat:ze()}),OU=k({provider:pe(Zi),name:b(),enabledForChat:ze(),keys:me(k({id:b(),name:b()}))}),kU=k({provider:pe(Zi),configId:b(),config:BT,auth:AU,platformId:b()});var pJ={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},kT=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],CU=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],qT=["claude-sonnet-4.6","claude-opus-4.7","claude-opus-4.8","claude-haiku-4.5"],F_=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.7-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],$U=["grok-4.20"],fJ=qT.map(e=>`anthropic/${e}`),zU={openai:kT,anthropic:CU,google:F_,vertex:F_,activepieces:[...qT.map(e=>`anthropic/${e}`),...kT.map(e=>`openai/${e}`),...F_.map(e=>`google/${e}`),...$U.map(e=>`x-ai/${e}`)]};var CT=128e3,NU={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,vertex:1048576,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function DU({provider:e}){return e?NU[e]??CT:CT}a(DU,"getMaxContextTokens");var $T={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},UU={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},jU=new Set(["anthropic","mistral","xai","deepseek","zai","qwen","minimax","moonshot"]),MU={xai:"https://api.x.ai/v1",deepseek:"https://api.deepseek.com/v1",zai:"https://api.z.ai/api/paas/v4",qwen:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",minimax:"https://api.minimax.io/v1",moonshot:"https://api.moonshot.ai/v1"};function Ot(e){return{chatModels:zU[e],maxContextTokens:DU({provider:e}),defaultEmbeddingModel:$T[e],supportsEmbedding:$T[e]!==void 0,supportsImageGeneration:!jU.has(e),webSearch:UU[e]}}a(Ot,"buildProviderCapabilities");var LU={openai:Ot("openai"),anthropic:Ot("anthropic"),openrouter:Ot("openrouter"),azure:Ot("azure"),google:Ot("google"),"cloudflare-gateway":Ot("cloudflare-gateway"),custom:Ot("custom"),bedrock:Ot("bedrock"),vertex:Ot("vertex"),mistral:Ot("mistral"),activepieces:Ot("activepieces"),xai:Ot("xai"),deepseek:Ot("deepseek"),zai:Ot("zai"),qwen:Ot("qwen"),minimax:Ot("minimax"),moonshot:Ot("moonshot")};var FU=k({base64Url:b(),fileName:b(),extension:F(b())}),BU=k({mimeType:b(),url:b(),fileName:F(b())}),V_=Pe([FU,BU]);var qU=Pe([k({type:le("file"),value:V_}),k({type:le("markdown"),value:b(),files:F(me(V_))})]),VU=k({sessionId:b(),message:b(),files:F(me(b()))});var ZT=(n=>(n.ON_NEW_RECORD="ON_NEW_RECORD",n.ON_UPDATE_RECORD="ON_UPDATE_RECORD",n))(ZT||{}),HT=(n=>(n.ENABLED="ENABLED",n.DISABLED="DISABLED",n))(HT||{}),Z_=(o=>(o.RECORD_CREATED="RECORD_CREATED",o.RECORD_UPDATED="RECORD_UPDATED",o.RECORD_DELETED="RECORD_DELETED",o))(Z_||{});var ZU=Pe([k({...wr,name:b(),externalId:b(),type:le("STATIC_DROPDOWN"),tableId:b(),projectId:b(),data:k({options:me(k({value:b()}))})}),k({...wr,name:b(),externalId:b(),type:Pe([le("TEXT"),le("NUMBER"),le("DATE"),le("DATETIME")]),tableId:b(),projectId:b()})]),HU=k({...wr,name:b(),folderId:at(b()),projectId:b(),externalId:b(),status:Ay(HT),trigger:Ay(ZT)}),GU=k({...wr,tableId:b(),projectId:b(),cells:be(b(),k({updated:b(),created:b(),value:_e(),fieldName:b()}))}),WU=k({events:me(pe(Z_)),webhookUrl:b(),flowId:b()}),JU=k({fields:me(k({id:b(),name:b()})),rows:me(be(b(),b())),name:b()}),KU=k({projectId:b(),limit:F(pc.number()),cursor:F(b()),name:F(b()),externalIds:Vd(b()),folderId:F(b()),folderIds:Vd(b())}),XU=k({records:me(me(k({fieldId:b(),value:WT()}))),tableId:b()}),QU=k({cells:F(me(k({fieldId:b(),value:WT()}))),tableId:b(),agentUpdate:F(ze())}),GT=ro("operator",[Ho("eq"),Ho("neq"),Ho("gt"),Ho("gte"),Ho("lt"),Ho("lte"),Ho("co"),VT("exists"),VT("not_exists")]),YU=k({tableId:b(),limit:F(pc.number()),cursor:F(b()),filters:Vd(GT)});function WT(){return oo(no(e=>e==null?e:String(e)),dc(b()))}a(WT,"coerceToString");function Ho(e){return k({fieldId:b(),operator:le(e),value:b()})}a(Ho,"valueFilter");function VT(e){return k({fieldId:b(),operator:le(e)})}a(VT,"existenceFilter");var ej=k({status:F(Et()),body:F(_e()),headers:F(be(b(),b()))}),tj=k({...wr,deleted:at(ao),ownerId:b(),displayName:b(),platformId:b(),externalId:at(b())});var JT=k({name:b(),description:F(b()),type:b(),required:ze()}),rj=k({pieceName:b(),triggerName:b(),input:k({toolName:b(),toolDescription:b(),inputSchema:me(JT),returnsResponse:ze()})});var KT="^[0-9]+\\.[0-9]+\\.[0-9]+$",CJ=new RegExp(KT),oj="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",$J=b().check(Rt(new RegExp(KT))),zJ=b().check(Rt(new RegExp(oj))),ij=k({packageType:le("ARCHIVE"),pieceType:pe(Bi),pieceName:b(),pieceVersion:b(),archiveId:b(),platformId:b()}),XT=k({packageType:le("REGISTRY"),pieceType:le("OFFICIAL"),pieceName:b(),pieceVersion:b()}),QT=k({packageType:le("REGISTRY"),pieceType:le("CUSTOM"),pieceName:b(),pieceVersion:b(),platformId:b()}),NJ=Pe([XT,QT]),DJ=Pe([ij,XT,QT]);var aj=ro("type",[k({type:le("CRON_EXPRESSION"),cronExpression:b(),timezone:b()}),k({type:le("INTERVAL"),intervalMs:VP().check(yt(6e4))})]),UJ=k({...wr,type:pe(Br),projectId:b(),flowId:b(),triggerName:b(),schedule:at(aj),flowVersionId:b(),pieceName:b(),pieceVersion:b(),deleted:at(b()),simulate:ze()}),YT=(S=>(S.UNKNOWN="UNKNOWN",S.FLOW_RUN_LOG="FLOW_RUN_LOG",S.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",S.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",S.FLOW_STEP_FILE="FLOW_STEP_FILE",S.SAMPLE_DATA="SAMPLE_DATA",S.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",S.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",S.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",S.PROJECT_RELEASE="PROJECT_RELEASE",S.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",S.PLATFORM_ASSET="PLATFORM_ASSET",S.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",S.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",S.KNOWLEDGE_BASE="KNOWLEDGE_BASE",S.FLOW_BUNDLE="FLOW_BUNDLE",S.PREWARM_SCOPE="PREWARM_SCOPE",S))(YT||{}),ew=(n=>(n.NONE="NONE",n.ZSTD="ZSTD",n))(ew||{}),tw=(n=>(n.S3="S3",n.DB="DB",n))(tw||{}),jJ=k({...wr,projectId:at(b()),platformId:at(b()),type:pe(YT),compression:pe(ew),data:F(_e()),location:pe(tw),size:at(Et()),fileName:at(b()),s3Key:at(b()),metadata:at(be(b(),b()))}),rw=(o=>(o.ADMIN="ADMIN",o.MEMBER="MEMBER",o.OPERATOR="OPERATOR",o))(rw||{}),nw=(n=>(n.ACTIVE="ACTIVE",n.INACTIVE="INACTIVE",n))(nw||{}),MJ=k({id:b(),email:b(),firstName:b(),status:pe(nw),externalId:at(b()),platformId:at(b()),platformRole:pe(rw),lastName:b(),created:ao,updated:ao,lastActiveDate:at(ao),imageUrl:at(b())});var G_=k({...ke.shape,...ve(be(b(),_e()),"OBJECT").shape});var W_=k({...ke.shape,formatProperty:F(b()),...ve(b(),"RICH_TEXT").shape});var aw=k({...ke.shape,...ve(b(),"COLOR").shape});var J_=Pe([ur,wn,W_,Fd,In,lr,An,Ey,fc,Py,Rn,gc,G_,yc,hc,Sy,mc,aw]),ne={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var rn=k({displayName:b(),description:F(b()),hasConnectionIdentifier:F(ze())});var sw=k({username:b(),password:b()}),K_=k({...rn.shape,username:k({displayName:b(),description:F(b())}),password:k({displayName:b(),description:F(b())}),...ve(sw,"BASIC_AUTH").shape});var lj=be(b(),Pe([ur,wn,Rn,In,lr])),X_=k({...rn.shape,props:lj,...ve(_e(),"CUSTOM_AUTH").shape});var Go=k({...rn.shape,...ve(k({auth:b()}),"SECRET_TEXT").shape});var dj=be(b(),Pe([ur,wn,Go,Rn,In,lr,An,Fd])),cw=k({...rn.shape,props:dj,...ve(_e(),"OIDC").shape});var Q_=(n=>(n.HEADER="HEADER",n.BODY="BODY",n))(Q_||{}),uw=Pe([ur,Go,lr]),lw=be(b(),uw),pj=k({props:F(be(b(),uw)),authUrl:b(),tokenUrl:b(),scope:me(b()),prompt:F(Pe([le("none"),le("consent"),le("login"),le("omit")])),pkce:F(ze()),pkceMethod:F(Pe([le("plain"),le("S256")])),authorizationMethod:F(pe(Q_)),grantType:F(Pe([pe(bc),le(xy)])),extra:F(be(b(),b()))}),dw=k({access_token:b(),props:F(lw),data:be(b(),lc())}),Y_=k({...rn.shape,...pj.shape,...ve(dw,"OAUTH2").shape});var ea=Pe([K_,X_,cw,Y_,Go]),Nc="Connection",wp={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Nc}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Nc,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Nc}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Nc}},None(){}};var SK={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 fj=k({...ke.shape,...ve(_e(),"CUSTOM").shape,code:b()});var mj=Pe([J_,ea]),eb=be(b(),mj),qK=be(b(),J_);var pw=Pe([k({strategy:le("CRON"),cronExpression:b()}),k({strategy:le("NONE")})]),ta=class{constructor(t,n,o,r,i,s,u,d,p,f,g,y,h,_,P,x,S,$,V,W,Z){this.name=t;this.displayName=n;this.description=o;this.requireAuth=r;this.props=i;this.type=s;this.handshakeConfiguration=u;this.onHandshake=d;this.renewConfiguration=p;this.onRenew=f;this.onEnable=g;this.onDisable=y;this.onStart=h;this.run=_;this.test=P;this.sampleData=x;this.testStrategy=S;this.outputSchema=$;this.aiMetadata=V;this.classification=W;this.propertyGroups=Z}static{a(this,"ITrigger")}},so=a(e=>{switch(e.type){case"WEBHOOK":return new ta(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new ta(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new ta(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new ta(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ut(e.sampleData)&&ut(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var fw="2",Ap="0.82.0";var tb=class{constructor(t,n,o,r,i,s,u,d,p=Ap,f,g="",y){this.displayName=t;this.logoUrl=n;this.authors=o;this.events=r;this.categories=u;this.auth=d;this.minimumSupportedRelease=p;this.maximumSupportedRelease=f;this.description=g;this.deprecated=y;this._actions={};this._triggers={};this.getContextInfo=a(()=>({version:fw}),"getContextInfo");(!gj(p)||yj(p,Ap))&&(this.minimumSupportedRelease=Ap),i.forEach(h=>this._actions[h.name]=h),s.forEach(h=>this._triggers[h.name]=h)}static{a(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:hj(this.auth),minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},hw=a(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((n,o,r)=>o===r.findIndex(i=>i.type===n.type)))throw new Error("Auth properties must be unique by type");return new tb(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function hj(e){if(e!==void 0)return Array.isArray(e)?e.map(mw):mw(e)}a(hj,"withConnectionIdentifierFlag");function mw(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}a(mw,"flagConnectionIdentifier");function gj(e){return/^\d+\.\d+\.\d+$/.test(e)}a(gj,"isValidSimpleSemver");function yj(e,t){let[n,o,r]=e.split(".").map(Number),[i,s,u]=t.split(".").map(Number);return n!==i?n<i:o!==s?o<s:r<u}a(yj,"isSemverLessThan");var _j=F(be(b(),be(b(),b()))),gw=k({id:F(b()),name:b(),displayName:b(),logoUrl:b(),description:b(),authors:me(b()),platformId:F(b()),directoryPath:F(b()),auth:F(Pe([ea,me(ea)])),version:b(),categories:F(me(pe(qi))),minimumSupportedRelease:F(b()),maximumSupportedRelease:F(b()),deprecated:F(ze()),i18n:_j}),bj=pe(["human","ai","both"]),yw=k({description:F(b()),idempotent:F(ze())}),_w=pe(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var vj=pe(["tabs","section","summary","builder","footer"]),bw=k({key:b(),display:vj,label:F(b()),description:F(b()),icon:F(b()),props:me(b())}),vw=k({name:b(),displayName:b(),description:b(),props:eb,propertyGroups:F(me(bw)),requireAuth:ze(),errorHandlingOptions:F(vy),outputSchema:F(Md()),audience:F(bj),aiMetadata:F(yw),classification:F(_w)}),Ew=k({name:b(),displayName:b(),description:b(),props:eb,propertyGroups:F(me(bw)),errorHandlingOptions:F(vy),type:pe(Br),sampleData:_e(),handshakeConfiguration:F(Md()),renewConfiguration:F(pw),testStrategy:pe(Ec),outputSchema:F(Md()),aiMetadata:F(yw),classification:F(_w)}),Ej=k({...gw.shape,actions:be(b(),vw),triggers:be(b(),Ew)}),Sj=k({...gw.shape,actions:Et(),triggers:Et(),suggestedActions:F(me(vw)),suggestedTriggers:F(me(Ew))}),Sw=k({projectUsage:Et(),pieceType:pe(Bi),packageType:pe(_c),platformId:F(b()),archiveId:F(b())}),H5=k({...Ej.shape,...Sw.shape}),G5=k({...Sj.shape,...Sw.shape}),W5=k({name:b(),version:b()});var Pj=It(require("path")),xj=It(require("fs/promises"));var ra=require("node:stream");var Ip=class{constructor(t,n){this.baseUrl=t;this.authenticationConverter=n}static{a(this,"BaseHttpClient")}getUrl(t){let n=new URL(`${this.baseUrl}${t.url}`),o=`${n.origin}${n.pathname}`,r=new URLSearchParams;return n.searchParams.forEach((i,s)=>{r.append(s,i)}),{urlWithoutQueryParams:o,queryParams:r}}getHeaders(t){let n={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,n),t.body&&(t.headers?.["Content-Type"]==="text/csv"?n["Content-Type"]="text/csv":n["Content-Type"]="application/json"),t.headers&&(n={...n,...t.headers}),n}populateAuthentication(t,n){this.authenticationConverter.convert(t,n)}};var Rp=class{static{a(this,"DelegatingAuthenticationConverter")}constructor(t=new rb,n=new nb){this.converters={BEARER_TOKEN:t,BASIC:n}}convert(t,n){return this.converters[t.type].convert(t,n)}},rb=class{static{a(this,"BearerTokenAuthenticationConverter")}convert(t,n){return n.Authorization=`Bearer ${t.token}`,n}},nb=class{static{a(this,"BasicTokenAuthenticationConverter")}convert(t,n){let o=`${t.username}:${t.password}`,r=Buffer.from(o).toString("base64");return n.Authorization=`Basic ${r}`,n}};var Dc=class extends Error{constructor(n,o){let r=o.status||500,i=Buffer.isBuffer(o.responseBody)?o.responseBody.toString():o.responseBody;super(JSON.stringify({response:{status:r,body:i},request:{body:n}}));this.requestBody=n;this.status=r,this.responseBody=i}static{a(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}}};function Pw({error:e,requestBody:t}){return e instanceof Dc?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}a(Pw,"toFailsafeOutput");var Bt=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(Bt||{});var Op=class extends Ip{static{a(this,"FetchHttpClient")}constructor(t="",n=new Rp){super(t,n)}async sendRequest(t,n){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:o,queryParams:r}=this.getUrl(t),i=this.getHeaders(t),s=t.queryParams??{};for(let[V,W]of Object.entries(s))r.append(V,W);let u=r.toString(),d=u?`${o}?${u}`:o,p=t.responseType??"json",f=t.followRedirects??!0,g=t.retries??0,{body:y,extraHeaders:h,isStream:_}=kp(t.method)?Tj(t.body,i):{body:void 0,extraHeaders:{},isStream:!1},P=Aj({...i,...h}),x=await wj(async()=>{let V=new AbortController,W=t.timeout&&t.timeout>0?setTimeout(()=>V.abort(),t.timeout):void 0;try{let Z={method:t.method.toString(),headers:P,body:y,redirect:f?"follow":"manual",signal:V.signal};return _&&(Z.duplex="half"),n?.dispatcher!==void 0&&(Z.dispatcher=n.dispatcher),await fetch(d,Z)}finally{W!==void 0&&clearTimeout(W)}},_?0:g),S=f?300:400;if(x.status<200||x.status>=S){let V=await xw(x,p==="stream"?"text":p),W=new Dc(t.body,{status:x.status,responseBody:V});throw console.error("[HttpClient#(sanitized error message)] Request failed:",W),W}let $=await xw(x,p);return{status:x.status,headers:Ij(x.headers),body:$}}};function kp(e){return e!=="GET"&&e!=="HEAD"}a(kp,"acceptsRequestBody");function Tj(e,t){if(ww(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Oj(e)){let o=Rj(e);if(o!==null)return{body:o,extraHeaders:e.getHeaders(),isStream:!1};let r=new ra.PassThrough;return e.on("error",i=>r.destroy(i)),e.pipe(r),{body:r,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof ra.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}a(Tj,"serializeBody");async function xw(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return ww(e.body)?ra.Readable.from([]):ra.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let n=await e.text();if(n.length===0)return;try{return JSON.parse(n)}catch{return n}}}}a(xw,"parseResponseBody");async function wj(e,t){let n;for(let o=0;o<=t;o++)try{let r=await e();if(r.status>=500&&o<t){await Tw(o);continue}return r}catch(r){if(n=r,o<t){await Tw(o);continue}throw r}throw n}a(wj,"sendWithRetries");function Tw(e){let t=Math.min(1e3*2**e,3e4);return new Promise(n=>setTimeout(n,t))}a(Tw,"backoff");function Aj(e){let t=new Map;for(let[n,o]of Object.entries(e))o!==void 0&&t.set(n.toLowerCase(),[n,Array.isArray(o)?o.join(", "):o]);return Object.fromEntries(t.values())}a(Aj,"normalizeHeaders");function Ij(e){let t={};return e.forEach((n,o)=>{t[o]=n}),t}a(Ij,"toHttpHeaders");function Rj(e){if(!e.hasKnownLength()||e.getLengthSync()>kj)return null;let{data:t}=Ty(()=>e.getBuffer());return t}a(Rj,"bufferFormDataIfSafe");function Oj(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}a(Oj,"isNodeFormData");function ww(e){return e==null}a(ww,"isNil");var kj=100*1024*1024;var Ie=new Op;var _L=It(require("fs")),CI=It(kI());var bL={"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 vL(e){let t=e.split(";")[0].trim().toLowerCase();return bL[t]??""}a(vL,"contentTypeToExtension");var EL=a(({baseUrl:e,relativePath:t})=>{let n=e.endsWith("/")?e:`${e}/`,o=t.startsWith("/")?t.slice(1):t;return`${n}${o}`},"joinBaseUrlWithRelativePath"),SL=a((e,t)=>{let n="https://api.example.com";try{let o=t?e(t):void 0;return(o?.endsWith("/")?o.slice(0,-1):o)??n}catch{return n}},"getBaseUrlForDescription");function $I({auth:e,baseUrl:t,authMapping:n,description:o,displayName:r,name:i,props:s,extraProps:u,authLocation:d="headers",classification:p="WRITE"}){return dt({audience:"human",name:i||"custom_api_call",classification:p,displayName:r||"Custom API Call",description:o||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:ne.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:a(async({auth:f})=>({url:ne.ShortText({displayName:"URL",description:`Full URL, or a path relative to ${SL(t,f)}`,required:!0,placeholder:"/resource",defaultValue:f?t(f):"",...s?.url??{}})}),"props")}),method:ne.StaticDropdown({displayName:"Method",required:!0,defaultValue:"GET",options:{options:Object.values(Bt).map(f=>({label:f,value:f}))},...s?.method??{}}),headers:ne.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!1,...s?.headers??{}}),queryParams:ne.Object({displayName:"Query Parameters",description:"Appended to the URL as ?key=value.",required:!1,...s?.queryParams??{}}),body_type:ne.Dropdown({auth:e,displayName:"Body Type",required:!1,defaultValue:"none",refreshers:["method"],options:a(async({method:f})=>kp(f)?{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}:{disabled:!0,placeholder:"Not available for GET or HEAD requests",options:[]},"options")}),body:ne.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type","method"],required:!1,props:a(async({body_type:f,method:g})=>{if(!f||!kp(g))return{};let y=f,h={};switch(y){case"none":break;case"json":h.data=ne.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":h.data=ne.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=ne.Array({displayName:"Form Data",required:!0,properties:{fieldName:ne.ShortText({displayName:"Field Name",required:!0}),fieldType:ne.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:ne.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:ne.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:ne.Checkbox({displayName:"Response is Binary",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1,advanced:!0,...s?.response_is_binary??{}}),failsafe:ne.Checkbox({displayName:"Return Error as Output",description:"On a failed request, output the error instead of failing the step.",required:!1,advanced:!0,...s?.failsafe??{}}),timeout:ne.Number({displayName:"Timeout",description:"Seconds to wait for a response. Empty: up to the flow limit (10 min).",required:!1,advanced:!0,...s?.timeout??{}}),followRedirects:ne.Checkbox({displayName:"Follow redirects",description:"Follow 3xx redirects instead of returning them as the response.",required:!1,defaultValue:!1,advanced:!0,...s?.followRedirects??{}}),...u},run:a(async f=>{let{method:g,url:y,headers:h,queryParams:_,body:P,body_type:x,failsafe:S,timeout:$,response_is_binary:V,followRedirects:W}=f.propsValue;qd(g,"Method"),qd(y,"URL");let Z=ut(n)?{}:await n(f.auth,f.propsValue),G=y.url,te=G.startsWith("http://")||G.startsWith("https://")?G:EL({baseUrl:t(f.auth),relativePath:G}),ce={method:g,url:te,headers:{...h??{},...d==="headers"||!ut(d)?Z:{}},queryParams:{...d==="queryParams"?Z:{},..._??{}},timeout:$?$*1e3:0,followRedirects:W};if(V&&(ce.responseType="arraybuffer"),P)if(x&&x!=="none"){let Y=P.data;if(x==="form_data"){let Ze=Y,we=new CI.default;for(let{fieldName:Te,fieldType:Me,textFieldValue:je,fileFieldValue:Ve}of Ze)Me==="text"&&!Sc(je)?we.append(Te,je):Me==="file"&&!Sc(Ve)&&we.append(Te,Ve.data,{filename:Ve?.filename});ce.body=we,ce.headers={...ce.headers,...we.getHeaders()}}else ce.body=Y}else x||(ce.body=P);try{let Y=await Ie.sendRequest(ce);return await PL(f.files,Y.body,Y.status,Y.headers,V)}catch(Y){if(S)return Pw({error:Y,requestBody:ce.body});throw Y}},"run")})}a($I,"createCustomApiCallAction");var PL=a(async(e,t,n,o,r)=>{let i;if(r&&xL(t)){let s=Array.isArray(o?.["content-type"])?o["content-type"][0]:o?.["content-type"],u=vL(s??"")||"txt",d;t instanceof ArrayBuffer?d=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?d=t:d=Buffer.from(t),i=await e.write({fileName:`output.${u}`,data:d})}else i=t;return{status:n,headers:o,body:i}},"handleBinaryResponse"),xL=a(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var pt={async poll(e,{store:t,auth:n,propsValue:o,maxItemsToPoll:r,files:i,server:s}){switch(e.strategy){case 0:{let u=await t.get("lastPoll");if(ut(u))throw new Error("lastPoll doesn't exist in the store.");let d=await e.items({store:t,auth:n,propsValue:o,lastFetchEpochMS:u,server:s}),p=d.reduce((f,g)=>Math.max(f,g.epochMilliSeconds),u);return await t.put("lastPoll",p),d.filter(f=>f.epochMilliSeconds>u).map(f=>f.data)}case 1:{let u=await t.get("lastItem"),d=await e.items({store:t,auth:n,propsValue:o,lastItemId:u,files:i,server:s}),p=d.findIndex(y=>y.id===u),f=[];ut(u)||p==-1?f=d??[]:f=d?.slice(0,p)??[],ut(r)||(f=f.slice(-r));let g=f?.[0]?.id;return ut(g)||await t.put("lastItem",g),f.map(y=>y.data)}}},async onEnable(e,{store:t,auth:n,propsValue:o,server:r,isRepublish:i}){switch(e.strategy){case 0:{if(i&&!ut(await t.get("lastPoll")))break;await t.put("lastPoll",Date.now());break}case 1:{if(i&&!ut(await t.get("lastItem")))break;let u=(await e.items({store:t,auth:n,propsValue:o,lastItemId:null,server:r}))?.[0]?.id;ut(u)?await t.delete("lastItem"):await t.put("lastItem",u);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:n,store:o,files:r,server:i}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:o,auth:t,propsValue:n,lastFetchEpochMS:0,server:i});break}case 1:{s=await e.items({store:o,auth:t,propsValue:n,lastItemId:null,files:r,server:i});break}}return TL(s.map(u=>u.data))}};function TL(e){return e.length<=5?e:e.slice(0,5)}a(TL,"getFirstFiveOrAll");var VE=It(MC());var Ce="https://bigquery.googleapis.com/bigquery/v2",qE=["https://www.googleapis.com/auth/bigquery","email"],Ue=[wp.OAuth2({description:"Sign in with your Google account. If you are using your own OAuth2 credentials, make sure to include the following scope: `https://www.googleapis.com/auth/bigquery`",authUrl:"https://accounts.google.com/o/oauth2/auth",tokenUrl:"https://oauth2.googleapis.com/token",required:!0,scope:qE}),wp.CustomAuth({displayName:"Service Account",description:"Use a GCP service account for automated, server-to-server access \u2014 no user sign-in required. Recommended for production workflows.",required:!0,props:{instructions:ne.MarkDown({value:`**How to create a service account key:**
|
|
57
95
|
|
|
58
96
|
1. Open [Google Cloud Console](https://console.cloud.google.com/) and select your project from the top dropdown.
|
|
59
97
|
2. Go to **IAM & Admin** \u2192 **Service Accounts** in the left sidebar.
|
|
@@ -62,8 +100,8 @@ i.e ${nR(e,f)}/resource or /resource`,required:!0,defaultValue:f?e(f):"",...c?.u
|
|
|
62
100
|
5. Under **Grant this service account access**, add the **BigQuery User** role (or **BigQuery Admin** for full access). Click **Done**.
|
|
63
101
|
6. Click on the service account you just created, then open the **Keys** tab.
|
|
64
102
|
7. Click **Add Key** \u2192 **Create new key** \u2192 select **JSON** \u2192 click **Create**.
|
|
65
|
-
8. A \`.json\` file will download \u2014 open it in a text editor and paste the entire contents into the field below.`}),serviceAccountJson:K.ShortText({displayName:"Service Account JSON",description:"Paste the full contents of the downloaded .json key file here",required:!0})},validate:o(async({auth:t})=>{try{let e=JSON.parse(t.serviceAccountJson);if(!e.client_email||!e.private_key)return{valid:!1,error:'Service account JSON must contain "client_email" and "private_key" fields'};if(!(await new qp.JWT({email:e.client_email,key:e.private_key,scopes:Bp}).getAccessToken()).token)throw new Error("Empty token returned");return{valid:!0}}catch(e){return{valid:!1,error:`Service account authentication failed: ${e.message}`}}},"validate")})];async function ze(t){if(t.type==="CUSTOM_AUTH"){let e=JSON.parse(t.props.serviceAccountJson),n=await new qp.JWT({email:e.client_email,key:e.private_key,scopes:Bp}).getAccessToken();if(n.token)return n.token;throw new Error("Could not retrieve access token from service account JSON")}return t.access_token}o(ze,"getAccessToken");var qe=K.Dropdown({auth:Oe,displayName:"Project",description:"Select your Google Cloud project",refreshers:[],required:!0,options:o(async({auth:t})=>{if(!t)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{let e=await ze(t);return{disabled:!1,options:((await Pe.sendRequest({method:"GET",url:`${xe}/projects`,headers:{Authorization:`Bearer ${e}`},queryParams:{maxResults:"200"}})).body.projects??[]).map(i=>({label:i.friendlyName?`${i.friendlyName} (${i.projectReference.projectId})`:i.projectReference.projectId,value:i.projectReference.projectId}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),mt=K.Dropdown({auth:Oe,displayName:"Dataset",description:"Select the BigQuery dataset",refreshers:["project_id"],required:!0,options:o(async({auth:t,project_id:e})=>{if(!t||!e)return{disabled:!0,options:[],placeholder:"Please select a project first"};try{let r=await ze(t),n=[],i;do{let u=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/datasets`,headers:{Authorization:`Bearer ${r}`},queryParams:{maxResults:"200",...i?{pageToken:i}:{}}});for(let c of u.body.datasets??[])n.push({label:c.friendlyName??c.datasetReference.datasetId,value:c.datasetReference.datasetId});i=u.body.nextPageToken}while(i);return{disabled:!1,options:n}}catch{return{disabled:!0,options:[],placeholder:"Failed to load datasets. Check your project selection."}}},"options")}),ht=K.Dropdown({auth:Oe,displayName:"Table",description:"Select the BigQuery table",refreshers:["project_id","dataset_id"],required:!0,options:o(async({auth:t,project_id:e,dataset_id:r})=>{if(!t||!e||!r)return{disabled:!0,options:[],placeholder:"Please select a project and dataset first"};try{let n=await ze(t),i=[],u;do{let c=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/datasets/${r}/tables`,headers:{Authorization:`Bearer ${n}`},queryParams:{maxResults:"200",...u?{pageToken:u}:{}}});for(let l of c.body.tables??[]){let p=l.friendlyName?`${l.friendlyName} (${l.tableReference.tableId})`:l.tableReference.tableId;i.push({label:p,value:l.tableReference.tableId})}u=c.body.nextPageToken}while(u);return{disabled:!1,options:i}}catch{return{disabled:!0,options:[],placeholder:"Failed to load tables. Check your dataset selection."}}},"options")});function Dt(t,e){return e.map(r=>{let n={};return t.forEach((i,u)=>{let c=r.f[u]?.v;c==null?n[i.name]=null:Array.isArray(c)?n[i.name]=c.map(l=>typeof l.v=="object"?JSON.stringify(l.v):String(l.v??"")).join(", "):typeof c=="object"?n[i.name]=JSON.stringify(c):n[i.name]=c}),n})}o(Dt,"bigQueryRowsToFlat");async function RS(t,e,r,n){return(await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/datasets/${r}/tables/${n}`,headers:{Authorization:`Bearer ${t}`},queryParams:{fields:"schema"}})).body.schema?.fields??[]}o(RS,"getTableSchema");async function Lu(t,e,r,n){let u=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/queries`,headers:{Authorization:`Bearer ${t}`},body:{query:r,useLegacySql:!1,timeoutMs:1e4,...n?{location:n}:{}}})).body.jobReference.jobId;for(let c=0;c<60;c++){let l=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/jobs/${u}`,headers:{Authorization:`Bearer ${t}`},queryParams:{...n?{location:n}:{}}});if(l.body.status.state==="DONE"){if(l.body.status.errorResult)throw new Error(`Query failed: ${l.body.status.errorResult.message}`);let p=l.body.statistics?.query?.dmlStats??{},f=parseInt(p.deletedRowCount??"0",10),m=parseInt(p.updatedRowCount??"0",10),g=parseInt(p.insertedRowCount??"0",10);return{jobId:u,affectedRowCount:f+m+g,deletedRowCount:f,updatedRowCount:m,insertedRowCount:g}}await new Promise(p=>setTimeout(p,2e3))}throw new Error("DML query timed out after 2 minutes.")}o(Lu,"runDmlQuery");async function ni(t,e,r,n){for(let i=0;i<60;i++){let u=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/queries/${r}`,headers:{Authorization:`Bearer ${t}`},queryParams:{timeoutMs:"10000",maxResults:"1000",...n?{location:n}:{}}});if(u.body.jobComplete)return u.body}throw new Error("Query did not complete within 10 minutes. Try simplifying your query or using a smaller dataset.")}o(ni,"waitForJobResults");var CS=nt({auth:Oe,name:"run_query",displayName:"Run a Query",description:"Execute a SQL query on BigQuery and return the results as flat rows",audience:"both",aiMetadata:{description:"Runs an arbitrary standard-SQL (or legacy-SQL) statement against BigQuery in a given project and returns the result rows, paginating up to the max-rows cap. Use it for any ad-hoc read or aggregation when no purpose-built action fits, or when you need full SQL control. Note that BigQuery SQL is not limited to reads \u2014 a DML/DDL statement passed here will mutate data \u2014 so idempotency depends on the query you supply; a plain SELECT is safe to repeat.",idempotent:!1},props:{project_id:qe,query:K.LongText({displayName:"SQL Query",description:"The SQL query to run. Uses standard SQL syntax. Example: `SELECT * FROM \\`my_dataset.my_table\\` LIMIT 100`",required:!0}),max_results:K.Number({displayName:"Max Rows",description:"Maximum number of rows to return (up to 10,000)",required:!1,defaultValue:1e3}),location:K.ShortText({displayName:"Location",description:"Geographic location of your dataset (e.g. US, EU, us-central1). Leave blank for US.",required:!1}),use_legacy_sql:K.Checkbox({displayName:"Use Legacy SQL",description:"Enable only if your query uses BigQuery Legacy SQL syntax (not recommended)",required:!1,defaultValue:!1})},async run(t){let{project_id:e,query:r,max_results:n,location:i,use_legacy_sql:u}=t.propsValue,c=Math.min(n??1e3,1e4),l=await ze(t.auth),f=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/queries`,headers:{Authorization:`Bearer ${l}`},body:{query:r,useLegacySql:u??!1,maxResults:Math.min(c,1e3),timeoutMs:1e4,...i?{location:i}:{}}})).body,m=f.schema?.fields??[];if(!f.jobComplete){let _=f.jobReference.jobId,T=await ni(l,e,_,i??void 0);f={...T,jobReference:{projectId:e,jobId:_}},m=T.schema?.fields??m}let g=[...f.rows??[]],S=f.pageToken;for(;S&&g.length<c;){let _=c-g.length,T=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/queries/${f.jobReference.jobId}`,headers:{Authorization:`Bearer ${l}`},queryParams:{pageToken:S,maxResults:String(Math.min(_,1e3)),...i?{location:i}:{}}});g.push(...T.body.rows??[]),S=T.body.pageToken}let h=Dt(m,g.slice(0,c));return{rows:h,row_count:h.length,total_rows:parseInt(f.totalRows??"0",10),bytes_processed:f.totalBytesProcessed??"0",job_id:f.jobReference?.jobId??null,cache_hit:f.cacheHit??!1}}});function C$(t){let e=`Type: ${t.type}${t.mode?` \xB7 Mode: ${t.mode}`:""}`;return K.ShortText({displayName:t.name,description:e,required:t.mode==="REQUIRED"})}o(C$,"fieldToProperty");var OS=nt({auth:Oe,name:"create_row",displayName:"Create Row",description:"Creates a single new row in a BigQuery table. Column fields are loaded from the table schema.",audience:"both",aiMetadata:{description:"Streams one new row into a BigQuery table via the streaming insert API, with each column supplied as a separate value (loaded from the live table schema; empty values are dropped rather than written as nulls). Choose this when an agent has a single record to append and knows the target project, dataset, and table. Not idempotent: each call appends another row, so repeating it duplicates the record.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,values:K.DynamicProperties({displayName:"Row Values",description:"Enter a value for each column. Fields are loaded from the table schema.",required:!0,auth:Oe,refreshers:["project_id","dataset_id","table_id"],props:o(async({auth:t,project_id:e,dataset_id:r,table_id:n})=>{if(!t||!e||!r||!n)return{};try{let i=await ze(t),u=await RS(i,e,r,n);return Object.fromEntries(u.filter(c=>c.type!=="RECORD").map(c=>[c.name,C$(c)]))}catch{return{}}},"props")})},async run(t){let{project_id:e,dataset_id:r,table_id:n,values:i}=t.propsValue,u=await ze(t.auth),l=Object.fromEntries(Object.entries(i).filter(([,g])=>g!==""&&g!==null&&g!==void 0)),p=`${Date.now()}-${Math.random().toString(36).slice(2,9)}`,m=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/datasets/${r}/tables/${n}/insertAll`,headers:{Authorization:`Bearer ${u}`},body:{kind:"bigquery#tableDataInsertAllRequest",rows:[{insertId:p,json:l}]}})).body.insertErrors??[];if(m.length>0){let g=m[0]?.errors[0];throw new Error(`Row insert failed: ${g?.message??"Unknown error"} (reason: ${g?.reason??"unknown"}, field: ${g?.location??"unknown"})`)}return{success:!0,insert_id:p,...l}}});var kS=nt({auth:Oe,name:"create_rows",displayName:"Create Rows",description:"Creates new rows of data in a BigQuery table (accepts an array of row objects). Rows are available to query within seconds.",audience:"both",aiMetadata:{description:"Streams a batch of rows into a BigQuery table in one streaming-insert call, taking a JSON array of objects whose keys match the column names. Choose this over Create Row when appending multiple records at once. Optional flags control whether the whole batch fails on a bad row or skips invalid rows / unknown fields. Not idempotent: every call appends the rows again, so repeating it duplicates them.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,rows:K.Json({displayName:"Rows",description:'An array of row objects to insert. Keys must match the table column names. Example: `[{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]`',required:!0}),skip_invalid_rows:K.Checkbox({displayName:"Skip Invalid Rows",description:"If enabled, valid rows are inserted even when some rows in the batch are invalid. If disabled (default), the entire batch fails if any row is invalid.",required:!1,defaultValue:!1}),ignore_unknown_values:K.Checkbox({displayName:"Ignore Unknown Fields",description:"If enabled, fields not in the table schema are silently discarded. If disabled (default), unknown fields cause the row to fail.",required:!1,defaultValue:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,rows:i,skip_invalid_rows:u,ignore_unknown_values:c}=t.propsValue;if(!Array.isArray(i)||i.length===0)throw new Error('Rows must be a non-empty JSON array of objects, e.g. [{"column": "value"}]');let l=await ze(t.auth),p=Date.now(),f=i.map((h,_)=>({insertId:`${p}-${_}-${Math.random().toString(36).slice(2,9)}`,json:h})),g=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/datasets/${r}/tables/${n}/insertAll`,headers:{Authorization:`Bearer ${l}`},body:{kind:"bigquery#tableDataInsertAllRequest",skipInvalidRows:u??!1,ignoreUnknownValues:c??!1,rows:f}})).body.insertErrors??[];if(g.length>0&&!(u??!1)){let h=g[0]?.errors[0];throw new Error(`Insert failed on row ${g[0]?.index}: ${h?.message??"Unknown error"} (reason: ${h?.reason??"unknown"})`)}let S=g.map(h=>({row_index:h.index,error_count:h.errors.length,first_error_reason:h.errors[0]?.reason??null,first_error_location:h.errors[0]?.location??null,first_error_message:h.errors[0]?.message??null}));return{success:g.length===0,rows_attempted:i.length,rows_inserted:i.length-g.length,error_count:g.length,errors:S}}});var $S=nt({auth:Oe,name:"delete_rows",displayName:"Delete Rows",description:"Deletes one or more rows from a BigQuery table using a SQL WHERE condition.",audience:"both",aiMetadata:{description:"Deletes every row matching a SQL WHERE condition from a BigQuery table by running a DELETE DML statement (supply only the condition body, without the WHERE keyword). Use it to remove records that meet a filter. Effectively idempotent on the same data \u2014 a repeat matches no remaining rows \u2014 but it is a destructive mutation, so an overly broad condition can remove far more than intended.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,where_clause:K.LongText({displayName:"WHERE Clause",description:'SQL condition to match the rows to delete. Do not include the WHERE keyword. Example: `status = "inactive" AND created_at < "2023-01-01"`',required:!0}),location:K.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,where_clause:i,location:u}=t.propsValue,c=await ze(t.auth),p=`DELETE FROM ${`\`${e}.${r}.${n}\``} WHERE ${i}`,f=await Lu(c,e,p,u??void 0);return{success:!0,rows_deleted:f.deletedRowCount,job_id:f.jobId}}});var NS=nt({auth:Oe,name:"update_rows",displayName:"Update Row(s)",description:"Updates one or more existing rows in a BigQuery table using SQL SET and WHERE expressions.",audience:"both",aiMetadata:{description:"Updates rows in a BigQuery table by running an UPDATE DML statement, applying a comma-separated SET assignment to every row matching a WHERE condition (supply both as raw SQL fragments without the SET/WHERE keywords). Use it to change column values on existing records. Mutates state on each run, so it is not safe to assume idempotency \u2014 assignments to fixed literal values repeat harmlessly, but relative expressions (e.g. incrementing a counter) compound on every call.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,set_expression:K.LongText({displayName:"SET Expression",description:'Comma-separated column assignments. Do not include the SET keyword. Example: `status = "active", updated_at = CURRENT_TIMESTAMP()`',required:!0}),where_clause:K.LongText({displayName:"WHERE Clause",description:'SQL condition to match the rows to update. Do not include the WHERE keyword. Example: `id = "abc123"`',required:!0}),location:K.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,set_expression:i,where_clause:u,location:c}=t.propsValue,l=await ze(t.auth),f=`UPDATE ${`\`${e}.${r}.${n}\``} SET ${i} WHERE ${u}`,m=await Lu(l,e,f,c??void 0);return{success:!0,rows_updated:m.updatedRowCount,job_id:m.jobId}}});var zS=nt({auth:Oe,name:"find_one_row",displayName:"Find One Row",description:"Find a single row by specifying a WHERE clause and an optional ORDER BY. Returns the first matching row, or empty if none found.",audience:"both",aiMetadata:{description:'Looks up a single row in a BigQuery table that matches a SQL WHERE condition, with an optional ORDER BY to control which row is picked when several match. Choose this for a simple keyed lookup or "does this record exist" check rather than writing a full query. Read-only and idempotent; returns the first match (or a not-found flag) without altering data.',idempotent:!0},props:{project_id:qe,dataset_id:mt,table_id:ht,where_clause:K.LongText({displayName:"WHERE Clause",description:'SQL condition to filter rows. Do not include the WHERE keyword. Example: `email = "user@example.com"`',required:!0}),order_by:K.ShortText({displayName:"ORDER BY",description:"Optional column(s) to sort results before picking the first row. Example: `created_at DESC`",required:!1}),location:K.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,where_clause:i,order_by:u,location:c}=t.propsValue,l=await ze(t.auth),p=`\`${e}.${r}.${n}\``,f=u?` ORDER BY ${u}`:"",m=`SELECT * FROM ${p} WHERE ${i}${f} LIMIT 1`,S=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/queries`,headers:{Authorization:`Bearer ${l}`},body:{query:m,useLegacySql:!1,maxResults:1,timeoutMs:1e4,...c?{location:c}:{}}})).body,h=S.schema?.fields??[];if(!S.jobComplete){let E=await ni(l,e,S.jobReference.jobId,c??void 0);S={...E,jobReference:S.jobReference},h=E.schema?.fields??h}let _=Dt(h,S.rows??[]),T=_.length>0;return{found:T,...T?_[0]:{}}}});var DS=nt({auth:Oe,name:"find_or_create_row",displayName:"Find or Create Record",description:"Searches for a row matching a WHERE clause. If found, returns it. If not found, inserts the provided row data and returns that.",audience:"both",aiMetadata:{description:"Finds the first row matching a SQL WHERE condition in a BigQuery table and returns it; if none matches, streams the supplied JSON row in and returns that instead, flagging whether it was found or created. Use it as a get-or-insert to avoid duplicates when ensuring a record exists. Conditionally idempotent: it only inserts when nothing matches, but because the WHERE condition and the inserted data are independent, a poorly aligned condition can let repeated calls insert duplicate rows.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,where_clause:K.LongText({displayName:"WHERE Clause",description:'SQL condition to search for an existing row. Do not include WHERE. Example: `email = "user@example.com"`',required:!0}),create_data:K.Json({displayName:"Row to Create (if not found)",description:'A JSON object of column/value pairs to insert if no matching row exists. Example: `{"email": "user@example.com", "name": "Alice"}`',required:!0}),location:K.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,where_clause:i,create_data:u,location:c}=t.propsValue,l=await ze(t.auth),f=`SELECT * FROM ${`\`${e}.${r}.${n}\``} WHERE ${i} LIMIT 1`,g=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/queries`,headers:{Authorization:`Bearer ${l}`},body:{query:f,useLegacySql:!1,maxResults:1,timeoutMs:1e4,...c?{location:c}:{}}})).body,S=g.schema?.fields??[];if(!g.jobComplete){let k=await ni(l,e,g.jobReference.jobId,c??void 0);g={...k,jobReference:g.jobReference},S=k.schema?.fields??S}let h=Dt(S,g.rows??[]);if(h.length>0)return{found:!0,created:!1,...h[0]};let _=u,T=`${Date.now()}-${Math.random().toString(36).slice(2,9)}`,w=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/datasets/${r}/tables/${n}/insertAll`,headers:{Authorization:`Bearer ${l}`},body:{kind:"bigquery#tableDataInsertAllRequest",rows:[{insertId:T,json:_}]}})).body.insertErrors??[];if(w.length>0){let k=w[0]?.errors[0];throw new Error(`Row creation failed: ${k?.message??"Unknown error"} (reason: ${k?.reason??"unknown"})`)}return{found:!1,created:!0,insert_id:T,..._}}});var US=nt({auth:Oe,name:"get_rows_for_job",displayName:"Get Rows for Job Completed",description:'Retrieves the result rows from a completed BigQuery query job by Job ID. Use this after a "Query Job Completed" trigger to fetch the full result set.',audience:"both",aiMetadata:{description:'Fetches the cached result rows of an already-completed BigQuery query job by its job ID, paginating up to the max-rows cap. Use it to retrieve the full result set after a "Query Job Completed" trigger or a "Run a Query" action hands you a job ID. The job must already be finished \u2014 it errors if the job is still running. Read-only and idempotent.',idempotent:!0},props:{project_id:qe,job_id:K.ShortText({displayName:"Job ID",description:'The BigQuery job ID to fetch results for. This is returned by the "Query Job Completed" trigger or a "Run a Query" action.',required:!0}),max_results:K.Number({displayName:"Max Rows",description:"Maximum number of rows to return (up to 10,000). Default: 1,000.",required:!1,defaultValue:1e3}),location:K.ShortText({displayName:"Location",description:"Dataset location where the job ran (e.g. US, EU). Leave blank for US.",required:!1})},async run(t){let{project_id:e,job_id:r,max_results:n,location:i}=t.propsValue,u=Math.min(n??1e3,1e4),c=await ze(t.auth),l=[],p=[],f,m="0",g="0",S=!1;do{let _=u-l.length,E=(await Pe.sendRequest({method:"GET",url:`${xe}/projects/${e}/queries/${r}`,headers:{Authorization:`Bearer ${c}`},queryParams:{maxResults:String(Math.min(_,1e3)),timeoutMs:"10000",...f?{pageToken:f}:{},...i?{location:i}:{}}})).body;if(!E.jobComplete)throw new Error(`Job ${r} has not completed yet. Wait for the job to finish before fetching results.`);E.schema?.fields&&(p=E.schema.fields),l.push(...E.rows??[]),f=E.pageToken,m=E.totalRows??m,g=E.totalBytesProcessed??g,S=E.cacheHit??S}while(f&&l.length<u);let h=Dt(p,l.slice(0,u));return{rows:h,row_count:h.length,total_rows:parseInt(m,10),bytes_processed:g,cache_hit:S,job_id:r}}});var jS=500;function O$(t){if(Array.isArray(t))return t;if(typeof t=="string"){let e=t.trim();return e.startsWith("[")?JSON.parse(e):e.split(`
|
|
66
|
-
`).map(r=>r.trim()).filter(r=>r.length>0).map(r=>JSON.parse(r))}throw new Error("Data must be a JSON array or a newline-delimited JSON (NDJSON) string.")}o(O$,"parseInputData");var MS=nt({auth:Oe,name:"import_data",displayName:"Import Data",description:"Imports a batch of rows into a BigQuery table. Accepts a JSON array or newline-delimited JSON (NDJSON). Large datasets are automatically split into chunks.",audience:"both",aiMetadata:{description:"Bulk-imports rows into a BigQuery table via streaming inserts, accepting either a JSON array of objects or a newline-delimited JSON (NDJSON) string and automatically splitting large datasets into chunks. Choose this for ingesting a large or variably-formatted dataset in one step; optional flags control whether the batch fails on bad rows or skips invalid rows / unknown fields. Not idempotent: each call appends the rows again, duplicating data if re-run.",idempotent:!1},props:{project_id:qe,dataset_id:mt,table_id:ht,data:K.Json({displayName:"Data",description:"The data to import. Provide a JSON array of objects (`[{...}, {...}]`) or a newline-delimited JSON string where each line is one row object.",required:!0}),skip_invalid_rows:K.Checkbox({displayName:"Skip Invalid Rows",description:"Continue importing valid rows even if some rows fail validation. Default: off (fail entire batch).",required:!1,defaultValue:!1}),ignore_unknown_values:K.Checkbox({displayName:"Ignore Unknown Fields",description:"Silently drop fields not present in the table schema. Default: off (fail on unknown fields).",required:!1,defaultValue:!1})},async run(t){let{project_id:e,dataset_id:r,table_id:n,data:i,skip_invalid_rows:u,ignore_unknown_values:c}=t.propsValue,l=O$(i);if(l.length===0)throw new Error("Data contains no rows to import.");let p=await ze(t.auth),f=Date.now(),m=0,g=0,S=[];for(let h=0;h<l.length;h+=jS){let _=l.slice(h,h+jS),T=_.map((k,q)=>({insertId:`${f}-${h+q}-${Math.random().toString(36).slice(2,9)}`,json:k})),w=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${e}/datasets/${r}/tables/${n}/insertAll`,headers:{Authorization:`Bearer ${p}`},body:{kind:"bigquery#tableDataInsertAllRequest",skipInvalidRows:u??!1,ignoreUnknownValues:c??!1,rows:T}})).body.insertErrors??[];if(w.length>0&&!(u??!1)){let k=w[0]?.errors[0];throw new Error(`Import failed on row ${h+(w[0]?.index??0)}: ${k?.message??"Unknown error"}`)}m+=_.length-w.length,g+=w.length,S.push(...w.map(k=>({row_index:h+k.index,first_error:k.errors[0]?.message??"Unknown",reason:k.errors[0]?.reason??null})))}return{success:g===0,rows_attempted:l.length,rows_imported:m,error_count:g,errors:S}}});var k$={project_id:qe,dataset_id:mt,table_id:ht,sort_column:K.ShortText({displayName:"Sort Column",description:"Name of the column used to detect new rows. The table is ordered by this column (DESC) and any row newer than the last check is returned. Use a TIMESTAMP or DATETIME column, e.g. `created_at`.",required:!0}),max_results:K.Number({displayName:"Max Rows per Check",description:"Maximum number of new rows to return per poll (default: 500).",required:!1,defaultValue:500})},Fu={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{project_id:n,dataset_id:i,table_id:u,sort_column:c,max_results:l}=e,p=l??500,f=await ze(t),m=r??Date.now()-10080*60*1e3,g=`\`${n}.${i}.${u}\``,S=c,h=`SELECT * FROM ${g} WHERE \`${S}\` > TIMESTAMP_MILLIS(${m}) ORDER BY \`${S}\` ASC LIMIT ${p}`,T=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${n}/queries`,headers:{Authorization:`Bearer ${f}`},body:{query:h,useLegacySql:!1,maxResults:p,timeoutMs:3e4}})).body;if(!T.jobComplete)for(let k=0;k<30&&!T.jobComplete;k++)T=(await Pe.sendRequest({method:"GET",url:`${xe}/projects/${n}/queries/${T.jobReference.jobId}`,headers:{Authorization:`Bearer ${f}`},queryParams:{timeoutMs:"10000",maxResults:String(p)}})).body;let E=T.schema?.fields??[];return Dt(E,T.rows??[]).map(k=>{let q=k[S],G;if(typeof q=="string"){let V=parseFloat(q);G=!isNaN(V)&&V>1e9?V*1e3:new Date(q).getTime()}else typeof q=="number"?G=q>1e12?q:q*1e3:G=Date.now();return{epochMilliSeconds:G,data:k}})},"items")},LS=Pn({auth:Oe,name:"new_row",displayName:"New Row",description:"Triggers when a new row is added to a BigQuery table. Polls every 5 minutes by comparing the latest value in a sort column against the previous check.",aiMetadata:{description:"Fires for each new row appended to a BigQuery table, detected by polling a TIMESTAMP/DATETIME sort column for values newer than the previous check. Each event represents one newly inserted row. Detection depends entirely on the chosen sort column advancing for new rows."},props:k$,sampleData:{id:"1",created_at:"2024-01-15T10:30:00Z",name:"Example row"},type:"POLLING",async test(t){return await ot.test(Fu,t)},async onEnable(t){await ot.onEnable(Fu,t)},async onDisable(t){await ot.onDisable(Fu,t)},async run(t){return await ot.poll(Fu,t)}});var $$={project_id:qe,dataset_id:mt,table_id:ht,updated_at_column:K.ShortText({displayName:"Updated At Column",description:"Name of the TIMESTAMP column that records when a row was last updated, e.g. `updated_at`. Rows where this column is newer than the last check are returned.",required:!0}),created_at_column:K.ShortText({displayName:"Created At Column (optional)",description:"If provided, only rows where the updated timestamp is newer than the created timestamp are returned, excluding brand-new rows from the results.",required:!1}),max_results:K.Number({displayName:"Max Rows per Check",description:"Maximum number of updated rows to return per poll (default: 500).",required:!1,defaultValue:500})},Bu={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{project_id:n,dataset_id:i,table_id:u,updated_at_column:c,created_at_column:l,max_results:p}=e,f=p??500,m=await ze(t),g=r??Date.now()-10080*60*1e3,S=`\`${n}.${i}.${u}\``,h=c,_=l?` AND \`${l}\` < TIMESTAMP_MILLIS(${g})`:"",T=[`SELECT * FROM ${S}`,`WHERE \`${h}\` > TIMESTAMP_MILLIS(${g})${_}`,`ORDER BY \`${h}\` ASC`,`LIMIT ${f}`].join(" "),w=(await Pe.sendRequest({method:"POST",url:`${xe}/projects/${n}/queries`,headers:{Authorization:`Bearer ${m}`},body:{query:T,useLegacySql:!1,maxResults:f,timeoutMs:3e4}})).body;if(!w.jobComplete)for(let G=0;G<30&&!w.jobComplete;G++)w=(await Pe.sendRequest({method:"GET",url:`${xe}/projects/${n}/queries/${w.jobReference.jobId}`,headers:{Authorization:`Bearer ${m}`},queryParams:{timeoutMs:"10000",maxResults:String(f)}})).body;let k=w.schema?.fields??[];return Dt(k,w.rows??[]).map(G=>{let V=G[h],H;if(typeof V=="string"){let J=parseFloat(V);H=!isNaN(J)&&J>1e9?J*1e3:new Date(V).getTime()}else typeof V=="number"?H=V>1e12?V:V*1e3:H=Date.now();return{epochMilliSeconds:H,data:G}})},"items")},FS=Pn({auth:Oe,name:"updated_row",displayName:"Updated Row",description:"Triggers when an existing row is updated in a BigQuery table. Requires an `updated_at` TIMESTAMP column that is set whenever a row changes.",aiMetadata:{description:"Fires for each row whose updated-at TIMESTAMP column advances past the previous check, representing a modified row in a BigQuery table. Requires that column to be set whenever a row changes; supplying an optional created-at column excludes brand-new rows so only genuine updates fire."},props:$$,sampleData:{id:"1",updated_at:"2024-01-15T10:30:00Z",status:"active"},type:"POLLING",async test(t){return await ot.test(Bu,t)},async onEnable(t){await ot.onEnable(Bu,t)},async onDisable(t){await ot.onDisable(Bu,t)},async run(t){return await ot.poll(Bu,t)}});var N$={project_id:qe,max_rows_per_job:K.Number({displayName:"Max Rows per Job",description:"Maximum number of result rows to fetch per completed job (default: 500).",required:!1,defaultValue:500})},qu={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{project_id:n,max_rows_per_job:i}=e,u=i??500,c=await ze(t),l=(r??Date.now()-1440*60*1e3)-3600*1e3,f=((await Pe.sendRequest({method:"GET",url:`${xe}/projects/${n}/jobs`,headers:{Authorization:`Bearer ${c}`},queryParams:{stateFilter:"done",projection:"full",minCreationTime:String(l),maxResults:"50"}})).body.jobs??[]).filter(g=>g.configuration.jobType==="QUERY"&&!g.status.errorResult&&parseInt(g.statistics.endTime??"0",10)>(r??0)),m=[];for(let g of f){let S=g.jobReference.jobId,h=g.jobReference.location,_=parseInt(g.statistics.endTime??"0",10),T=[],E=[],w;do{let q=await Pe.sendRequest({method:"GET",url:`${xe}/projects/${n}/queries/${S}`,headers:{Authorization:`Bearer ${c}`},queryParams:{maxResults:String(Math.min(u-T.length,1e3)),timeoutMs:"5000",...w?{pageToken:w}:{},...h?{location:h}:{}}});q.body.schema?.fields&&(E=q.body.schema.fields),T.push(...q.body.rows??[]),w=q.body.pageToken}while(w&&T.length<u);let k=Dt(E,T.slice(0,u));m.push({epochMilliSeconds:_,data:{job_id:S,project_id:g.jobReference.projectId,location:h??null,query:g.configuration.query?.query??null,completed_at:g.statistics.endTime?new Date(_).toISOString():null,bytes_processed:g.statistics.query?.totalBytesProcessed??null,cache_hit:g.statistics.query?.cacheHit??null,user_email:g.user_email??null,row_count:k.length,rows:k}})}return m},"items")},BS=Pn({auth:Oe,name:"query_job_completed",displayName:"Query Job Completed (With Row Data)",description:"Triggers when a BigQuery query job finishes successfully. Each flow run receives the job metadata and the result rows from that query.",aiMetadata:{description:"Fires when a successful (non-errored) QUERY-type job completes in the BigQuery project, detected by polling the project job history. Each event represents one finished query job and carries its metadata plus the fetched result rows. Only query jobs are surfaced; load, copy, and extract jobs are ignored."},props:N$,sampleData:{job_id:"job_abc123",project_id:"my-project",query:"SELECT * FROM my_dataset.my_table LIMIT 10",completed_at:"2024-01-15T10:30:00Z",bytes_processed:"1024",cache_hit:!1,row_count:2,rows:[{id:"1",name:"Alice"},{id:"2",name:"Bob"}]},type:"POLLING",async test(t){return await ot.test(qu,t)},async onEnable(t){await ot.onEnable(qu,t)},async onDisable(t){await ot.onDisable(qu,t)},async run(t){return await ot.poll(qu,t)}});var z$={project_id:qe,include_failed:K.Checkbox({displayName:"Include Failed Jobs",description:"If enabled, jobs that completed with an error are also returned. Default: off (only successful jobs).",required:!1,defaultValue:!1})},Vu={strategy:0,items:o(async({auth:t,propsValue:e,lastFetchEpochMS:r})=>{let{project_id:n,include_failed:i}=e,u=await ze(t),c=(r??Date.now()-1440*60*1e3)-3600*1e3;return((await Pe.sendRequest({method:"GET",url:`${xe}/projects/${n}/jobs`,headers:{Authorization:`Bearer ${u}`},queryParams:{stateFilter:"done",projection:"full",minCreationTime:String(c),maxResults:"100"}})).body.jobs??[]).filter(f=>!(parseInt(f.statistics.endTime??"0",10)<=(r??0)||!(i??!1)&&f.status.errorResult)).map(f=>{let m=parseInt(f.statistics.endTime??"0",10),g=f.statistics.query?.dmlStats;return{epochMilliSeconds:m,data:{job_id:f.jobReference.jobId,project_id:f.jobReference.projectId,location:f.jobReference.location??null,job_type:f.configuration.jobType,status:f.status.errorResult?"FAILED":"SUCCESS",error_message:f.status.errorResult?.message??null,error_reason:f.status.errorResult?.reason??null,query:f.configuration.query?.query??null,created_at:f.statistics.creationTime?new Date(parseInt(f.statistics.creationTime,10)).toISOString():null,started_at:f.statistics.startTime?new Date(parseInt(f.statistics.startTime,10)).toISOString():null,completed_at:m?new Date(m).toISOString():null,bytes_processed:f.statistics.query?.totalBytesProcessed??f.statistics.totalBytesProcessed??null,cache_hit:f.statistics.query?.cacheHit??null,dml_inserted_rows:g?.insertedRowCount??null,dml_deleted_rows:g?.deletedRowCount??null,dml_updated_rows:g?.updatedRowCount??null,user_email:f.user_email??null}}})},"items")},qS=Pn({auth:Oe,name:"new_job_completed",displayName:"New Job Completed",description:"Triggers when any BigQuery job (query, load, copy, or extract) finishes. Returns the job metadata including status, type, and timing.",aiMetadata:{description:"Fires when any BigQuery job of any type (query, load, copy, or extract) finishes in the project, detected by polling the job history. Each event represents one completed job and carries its metadata \u2014 type, status, timing, bytes processed, and DML row counts. By default only successful jobs fire; enabling the include-failed option also surfaces jobs that ended with an error."},props:z$,sampleData:{job_id:"job_xyz789",project_id:"my-project",job_type:"QUERY",status:"SUCCESS",error_message:null,query:"SELECT COUNT(*) FROM my_dataset.events",completed_at:"2024-01-15T10:30:00Z",bytes_processed:"2048",cache_hit:!1,user_email:"user@example.com"},type:"POLLING",async test(t){return await ot.test(Vu,t)},async onEnable(t){await ot.onEnable(Vu,t)},async onDisable(t){await ot.onDisable(Vu,t)},async run(t){return await ot.poll(Vu,t)}});var D$=ag({displayName:"Google BigQuery",description:"Query, analyze, and stream data into Google BigQuery \u2014 the fully managed, serverless data warehouse",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/google-bigquery.png",categories:["BUSINESS_INTELLIGENCE"],authors:["AhmadTash"],auth:Oe,actions:[CS,OS,kS,$S,NS,zS,DS,US,MS,S_({baseUrl:o(()=>xe,"baseUrl"),auth:Oe,authMapping:o(async t=>({Authorization:`Bearer ${await ze(t)}`}),"authMapping")})],triggers:[LS,FS,BS,qS]});0&&(module.exports={bigQueryAuth,googleBigQuery});
|
|
103
|
+
8. A \`.json\` file will download \u2014 open it in a text editor and paste the entire contents into the field below.`}),serviceAccountJson:ne.ShortText({displayName:"Service Account JSON",description:"Paste the full contents of the downloaded .json key file here",required:!0})},validate:a(async({auth:e})=>{try{let t=JSON.parse(e.serviceAccountJson);if(!t.client_email||!t.private_key)return{valid:!1,error:'Service account JSON must contain "client_email" and "private_key" fields'};if(!(await new VE.JWT({email:t.client_email,key:t.private_key,scopes:qE}).getAccessToken()).token)throw new Error("Empty token returned");return{valid:!0}}catch(t){return{valid:!1,error:`Service account authentication failed: ${t.message}`}}},"validate")})];async function Le(e){if(e.type==="CUSTOM_AUTH"){let t=JSON.parse(e.props.serviceAccountJson),o=await new VE.JWT({email:t.client_email,key:t.private_key,scopes:qE}).getAccessToken();if(o.token)return o.token;throw new Error("Could not retrieve access token from service account JSON")}return e.access_token}a(Le,"getAccessToken");var Ye=ne.Dropdown({auth:Ue,displayName:"Project",description:"Select your Google Cloud project",refreshers:[],required:!0,options:a(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{let t=await Le(e);return{disabled:!1,options:((await Ie.sendRequest({method:"GET",url:`${Ce}/projects`,headers:{Authorization:`Bearer ${t}`},queryParams:{maxResults:"200"}})).body.projects??[]).map(r=>({label:r.friendlyName?`${r.friendlyName} (${r.projectReference.projectId})`:r.projectReference.projectId,value:r.projectReference.projectId}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),wt=ne.Dropdown({auth:Ue,displayName:"Dataset",description:"Select the BigQuery dataset",refreshers:["project_id"],required:!0,options:a(async({auth:e,project_id:t})=>{if(!e||!t)return{disabled:!0,options:[],placeholder:"Please select a project first"};try{let n=await Le(e),o=[],r;do{let i=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/datasets`,headers:{Authorization:`Bearer ${n}`},queryParams:{maxResults:"200",...r?{pageToken:r}:{}}});for(let s of i.body.datasets??[])o.push({label:s.friendlyName??s.datasetReference.datasetId,value:s.datasetReference.datasetId});r=i.body.nextPageToken}while(r);return{disabled:!1,options:o}}catch{return{disabled:!0,options:[],placeholder:"Failed to load datasets. Check your project selection."}}},"options")}),At=ne.Dropdown({auth:Ue,displayName:"Table",description:"Select the BigQuery table",refreshers:["project_id","dataset_id"],required:!0,options:a(async({auth:e,project_id:t,dataset_id:n})=>{if(!e||!t||!n)return{disabled:!0,options:[],placeholder:"Please select a project and dataset first"};try{let o=await Le(e),r=[],i;do{let s=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/datasets/${n}/tables`,headers:{Authorization:`Bearer ${o}`},queryParams:{maxResults:"200",...i?{pageToken:i}:{}}});for(let u of s.body.tables??[]){let d=u.friendlyName?`${u.friendlyName} (${u.tableReference.tableId})`:u.tableReference.tableId;r.push({label:d,value:u.tableReference.tableId})}i=s.body.nextPageToken}while(i);return{disabled:!1,options:r}}catch{return{disabled:!0,options:[],placeholder:"Failed to load tables. Check your dataset selection."}}},"options")});function rr(e,t){return t.map(n=>{let o={};return e.forEach((r,i)=>{let s=n.f[i]?.v;s==null?o[r.name]=null:Array.isArray(s)?o[r.name]=s.map(u=>typeof u.v=="object"?JSON.stringify(u.v):String(u.v??"")).join(", "):typeof s=="object"?o[r.name]=JSON.stringify(s):o[r.name]=s}),o})}a(rr,"bigQueryRowsToFlat");async function LC(e,t,n,o){return(await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/datasets/${n}/tables/${o}`,headers:{Authorization:`Bearer ${e}`},queryParams:{fields:"schema"}})).body.schema?.fields??[]}a(LC,"getTableSchema");async function om(e,t,n,o){let i=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/queries`,headers:{Authorization:`Bearer ${e}`},body:{query:n,useLegacySql:!1,timeoutMs:1e4,...o?{location:o}:{}}})).body.jobReference.jobId;for(let s=0;s<60;s++){let u=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/jobs/${i}`,headers:{Authorization:`Bearer ${e}`},queryParams:{...o?{location:o}:{}}});if(u.body.status.state==="DONE"){if(u.body.status.errorResult)throw new Error(`Query failed: ${u.body.status.errorResult.message}`);let d=u.body.statistics?.query?.dmlStats??{},p=parseInt(d.deletedRowCount??"0",10),f=parseInt(d.updatedRowCount??"0",10),g=parseInt(d.insertedRowCount??"0",10);return{jobId:i,affectedRowCount:p+f+g,deletedRowCount:p,updatedRowCount:f,insertedRowCount:g}}await new Promise(d=>setTimeout(d,2e3))}throw new Error("DML query timed out after 2 minutes.")}a(om,"runDmlQuery");async function za(e,t,n,o){for(let r=0;r<60;r++){let i=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/queries/${n}`,headers:{Authorization:`Bearer ${e}`},queryParams:{timeoutMs:"10000",maxResults:"1000",...o?{location:o}:{}}});if(i.body.jobComplete)return i.body}throw new Error("Query did not complete within 10 minutes. Try simplifying your query or using a smaller dataset.")}a(za,"waitForJobResults");var FC=dt({auth:Ue,name:"run_query",classification:"WRITE",displayName:"Run a Query",description:"Execute a SQL query on BigQuery and return the results as flat rows",audience:"both",aiMetadata:{description:"Runs an arbitrary standard-SQL (or legacy-SQL) statement against BigQuery in a given project and returns the result rows, paginating up to the max-rows cap. Use it for any ad-hoc read or aggregation when no purpose-built action fits, or when you need full SQL control. Note that BigQuery SQL is not limited to reads \u2014 a DML/DDL statement passed here will mutate data \u2014 so idempotency depends on the query you supply; a plain SELECT is safe to repeat.",idempotent:!1},props:{project_id:Ye,query:ne.LongText({displayName:"SQL Query",description:"The SQL query to run. Uses standard SQL syntax. Example: `SELECT * FROM \\`my_dataset.my_table\\` LIMIT 100`",required:!0}),max_results:ne.Number({displayName:"Max Rows",description:"Maximum number of rows to return (up to 10,000)",required:!1,defaultValue:1e3}),location:ne.ShortText({displayName:"Location",description:"Geographic location of your dataset (e.g. US, EU, us-central1). Leave blank for US.",required:!1}),use_legacy_sql:ne.Checkbox({displayName:"Use Legacy SQL",description:"Enable only if your query uses BigQuery Legacy SQL syntax (not recommended)",required:!1,defaultValue:!1})},async run(e){let{project_id:t,query:n,max_results:o,location:r,use_legacy_sql:i}=e.propsValue,s=Math.min(o??1e3,1e4),u=await Le(e.auth),p=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/queries`,headers:{Authorization:`Bearer ${u}`},body:{query:n,useLegacySql:i??!1,maxResults:Math.min(s,1e3),timeoutMs:1e4,...r?{location:r}:{}}})).body,f=p.schema?.fields??[];if(!p.jobComplete){let _=p.jobReference.jobId,P=await za(u,t,_,r??void 0);p={...P,jobReference:{projectId:t,jobId:_}},f=P.schema?.fields??f}let g=[...p.rows??[]],y=p.pageToken;for(;y&&g.length<s;){let _=s-g.length,P=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/queries/${p.jobReference.jobId}`,headers:{Authorization:`Bearer ${u}`},queryParams:{pageToken:y,maxResults:String(Math.min(_,1e3)),...r?{location:r}:{}}});g.push(...P.body.rows??[]),y=P.body.pageToken}let h=rr(f,g.slice(0,s));return{rows:h,row_count:h.length,total_rows:parseInt(p.totalRows??"0",10),bytes_processed:p.totalBytesProcessed??"0",job_id:p.jobReference?.jobId??null,cache_hit:p.cacheHit??!1}}});function J6(e){let t=`Type: ${e.type}${e.mode?` \xB7 Mode: ${e.mode}`:""}`;return ne.ShortText({displayName:e.name,description:t,required:e.mode==="REQUIRED"})}a(J6,"fieldToProperty");var BC=dt({auth:Ue,name:"create_row",classification:"WRITE",displayName:"Create Row",description:"Creates a single new row in a BigQuery table. Column fields are loaded from the table schema.",audience:"both",aiMetadata:{description:"Streams one new row into a BigQuery table via the streaming insert API, with each column supplied as a separate value (loaded from the live table schema; empty values are dropped rather than written as nulls). Choose this when an agent has a single record to append and knows the target project, dataset, and table. Not idempotent: each call appends another row, so repeating it duplicates the record.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,values:ne.DynamicProperties({displayName:"Row Values",description:"Enter a value for each column. Fields are loaded from the table schema.",required:!0,auth:Ue,refreshers:["project_id","dataset_id","table_id"],props:a(async({auth:e,project_id:t,dataset_id:n,table_id:o})=>{if(!e||!t||!n||!o)return{};try{let r=await Le(e),i=await LC(r,t,n,o);return Object.fromEntries(i.filter(s=>s.type!=="RECORD").map(s=>[s.name,J6(s)]))}catch{return{}}},"props")})},async run(e){let{project_id:t,dataset_id:n,table_id:o,values:r}=e.propsValue,i=await Le(e.auth),u=Object.fromEntries(Object.entries(r).filter(([,g])=>g!==""&&g!==null&&g!==void 0)),d=`${Date.now()}-${Math.random().toString(36).slice(2,9)}`,f=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/datasets/${n}/tables/${o}/insertAll`,headers:{Authorization:`Bearer ${i}`},body:{kind:"bigquery#tableDataInsertAllRequest",rows:[{insertId:d,json:u}]}})).body.insertErrors??[];if(f.length>0){let g=f[0]?.errors[0];throw new Error(`Row insert failed: ${g?.message??"Unknown error"} (reason: ${g?.reason??"unknown"}, field: ${g?.location??"unknown"})`)}return{success:!0,insert_id:d,...u}}});var qC=dt({auth:Ue,name:"create_rows",classification:"WRITE",displayName:"Create Rows",description:"Creates new rows of data in a BigQuery table (accepts an array of row objects). Rows are available to query within seconds.",audience:"both",aiMetadata:{description:"Streams a batch of rows into a BigQuery table in one streaming-insert call, taking a JSON array of objects whose keys match the column names. Choose this over Create Row when appending multiple records at once. Optional flags control whether the whole batch fails on a bad row or skips invalid rows / unknown fields. Not idempotent: every call appends the rows again, so repeating it duplicates them.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,rows:ne.Json({displayName:"Rows",description:'An array of row objects to insert. Keys must match the table column names. Example: `[{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]`',required:!0}),skip_invalid_rows:ne.Checkbox({displayName:"Skip Invalid Rows",description:"If enabled, valid rows are inserted even when some rows in the batch are invalid. If disabled (default), the entire batch fails if any row is invalid.",required:!1,defaultValue:!1}),ignore_unknown_values:ne.Checkbox({displayName:"Ignore Unknown Fields",description:"If enabled, fields not in the table schema are silently discarded. If disabled (default), unknown fields cause the row to fail.",required:!1,defaultValue:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,rows:r,skip_invalid_rows:i,ignore_unknown_values:s}=e.propsValue;if(!Array.isArray(r)||r.length===0)throw new Error('Rows must be a non-empty JSON array of objects, e.g. [{"column": "value"}]');let u=await Le(e.auth),d=Date.now(),p=r.map((h,_)=>({insertId:`${d}-${_}-${Math.random().toString(36).slice(2,9)}`,json:h})),g=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/datasets/${n}/tables/${o}/insertAll`,headers:{Authorization:`Bearer ${u}`},body:{kind:"bigquery#tableDataInsertAllRequest",skipInvalidRows:i??!1,ignoreUnknownValues:s??!1,rows:p}})).body.insertErrors??[];if(g.length>0&&!(i??!1)){let h=g[0]?.errors[0];throw new Error(`Insert failed on row ${g[0]?.index}: ${h?.message??"Unknown error"} (reason: ${h?.reason??"unknown"})`)}let y=g.map(h=>({row_index:h.index,error_count:h.errors.length,first_error_reason:h.errors[0]?.reason??null,first_error_location:h.errors[0]?.location??null,first_error_message:h.errors[0]?.message??null}));return{success:g.length===0,rows_attempted:r.length,rows_inserted:r.length-g.length,error_count:g.length,errors:y}}});var VC=dt({auth:Ue,name:"delete_rows",classification:"DESTRUCTIVE",displayName:"Delete Rows",description:"Deletes one or more rows from a BigQuery table using a SQL WHERE condition.",audience:"both",aiMetadata:{description:"Deletes every row matching a SQL WHERE condition from a BigQuery table by running a DELETE DML statement (supply only the condition body, without the WHERE keyword). Use it to remove records that meet a filter. Effectively idempotent on the same data \u2014 a repeat matches no remaining rows \u2014 but it is a destructive mutation, so an overly broad condition can remove far more than intended.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,where_clause:ne.LongText({displayName:"WHERE Clause",description:'SQL condition to match the rows to delete. Do not include the WHERE keyword. Example: `status = "inactive" AND created_at < "2023-01-01"`',required:!0}),location:ne.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,where_clause:r,location:i}=e.propsValue,s=await Le(e.auth),d=`DELETE FROM ${`\`${t}.${n}.${o}\``} WHERE ${r}`,p=await om(s,t,d,i??void 0);return{success:!0,rows_deleted:p.deletedRowCount,job_id:p.jobId}}});var ZC=dt({auth:Ue,name:"update_rows",classification:"WRITE",displayName:"Update Row(s)",description:"Updates one or more existing rows in a BigQuery table using SQL SET and WHERE expressions.",audience:"both",aiMetadata:{description:"Updates rows in a BigQuery table by running an UPDATE DML statement, applying a comma-separated SET assignment to every row matching a WHERE condition (supply both as raw SQL fragments without the SET/WHERE keywords). Use it to change column values on existing records. Mutates state on each run, so it is not safe to assume idempotency \u2014 assignments to fixed literal values repeat harmlessly, but relative expressions (e.g. incrementing a counter) compound on every call.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,set_expression:ne.LongText({displayName:"SET Expression",description:'Comma-separated column assignments. Do not include the SET keyword. Example: `status = "active", updated_at = CURRENT_TIMESTAMP()`',required:!0}),where_clause:ne.LongText({displayName:"WHERE Clause",description:'SQL condition to match the rows to update. Do not include the WHERE keyword. Example: `id = "abc123"`',required:!0}),location:ne.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,set_expression:r,where_clause:i,location:s}=e.propsValue,u=await Le(e.auth),p=`UPDATE ${`\`${t}.${n}.${o}\``} SET ${r} WHERE ${i}`,f=await om(u,t,p,s??void 0);return{success:!0,rows_updated:f.updatedRowCount,job_id:f.jobId}}});var HC=dt({auth:Ue,name:"find_one_row",classification:"SEARCH",displayName:"Find One Row",description:"Find a single row by specifying a WHERE clause and an optional ORDER BY. Returns the first matching row, or empty if none found.",audience:"both",aiMetadata:{description:'Looks up a single row in a BigQuery table that matches a SQL WHERE condition, with an optional ORDER BY to control which row is picked when several match. Choose this for a simple keyed lookup or "does this record exist" check rather than writing a full query. Read-only and idempotent; returns the first match (or a not-found flag) without altering data.',idempotent:!0},props:{project_id:Ye,dataset_id:wt,table_id:At,where_clause:ne.LongText({displayName:"WHERE Clause",description:'SQL condition to filter rows. Do not include the WHERE keyword. Example: `email = "user@example.com"`',required:!0}),order_by:ne.ShortText({displayName:"ORDER BY",description:"Optional column(s) to sort results before picking the first row. Example: `created_at DESC`",required:!1}),location:ne.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,where_clause:r,order_by:i,location:s}=e.propsValue,u=await Le(e.auth),d=`\`${t}.${n}.${o}\``,p=i?` ORDER BY ${i}`:"",f=`SELECT * FROM ${d} WHERE ${r}${p} LIMIT 1`,y=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/queries`,headers:{Authorization:`Bearer ${u}`},body:{query:f,useLegacySql:!1,maxResults:1,timeoutMs:1e4,...s?{location:s}:{}}})).body,h=y.schema?.fields??[];if(!y.jobComplete){let x=await za(u,t,y.jobReference.jobId,s??void 0);y={...x,jobReference:y.jobReference},h=x.schema?.fields??h}let _=rr(h,y.rows??[]),P=_.length>0;return{found:P,...P?_[0]:{}}}});var GC=dt({auth:Ue,name:"find_or_create_row",classification:"WRITE",displayName:"Find or Create Record",description:"Searches for a row matching a WHERE clause. If found, returns it. If not found, inserts the provided row data and returns that.",audience:"both",aiMetadata:{description:"Finds the first row matching a SQL WHERE condition in a BigQuery table and returns it; if none matches, streams the supplied JSON row in and returns that instead, flagging whether it was found or created. Use it as a get-or-insert to avoid duplicates when ensuring a record exists. Conditionally idempotent: it only inserts when nothing matches, but because the WHERE condition and the inserted data are independent, a poorly aligned condition can let repeated calls insert duplicate rows.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,where_clause:ne.LongText({displayName:"WHERE Clause",description:'SQL condition to search for an existing row. Do not include WHERE. Example: `email = "user@example.com"`',required:!0}),create_data:ne.Json({displayName:"Row to Create (if not found)",description:'A JSON object of column/value pairs to insert if no matching row exists. Example: `{"email": "user@example.com", "name": "Alice"}`',required:!0}),location:ne.ShortText({displayName:"Location",description:"Dataset location (e.g. US, EU). Leave blank to use the default.",required:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,where_clause:r,create_data:i,location:s}=e.propsValue,u=await Le(e.auth),p=`SELECT * FROM ${`\`${t}.${n}.${o}\``} WHERE ${r} LIMIT 1`,g=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/queries`,headers:{Authorization:`Bearer ${u}`},body:{query:p,useLegacySql:!1,maxResults:1,timeoutMs:1e4,...s?{location:s}:{}}})).body,y=g.schema?.fields??[];if(!g.jobComplete){let $=await za(u,t,g.jobReference.jobId,s??void 0);g={...$,jobReference:g.jobReference},y=$.schema?.fields??y}let h=rr(y,g.rows??[]);if(h.length>0)return{found:!0,created:!1,...h[0]};let _=i,P=`${Date.now()}-${Math.random().toString(36).slice(2,9)}`,S=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/datasets/${n}/tables/${o}/insertAll`,headers:{Authorization:`Bearer ${u}`},body:{kind:"bigquery#tableDataInsertAllRequest",rows:[{insertId:P,json:_}]}})).body.insertErrors??[];if(S.length>0){let $=S[0]?.errors[0];throw new Error(`Row creation failed: ${$?.message??"Unknown error"} (reason: ${$?.reason??"unknown"})`)}return{found:!1,created:!0,insert_id:P,..._}}});var WC=dt({auth:Ue,name:"get_rows_for_job",classification:"READ",displayName:"Get Rows for Job Completed",description:'Retrieves the result rows from a completed BigQuery query job by Job ID. Use this after a "Query Job Completed" trigger to fetch the full result set.',audience:"both",aiMetadata:{description:'Fetches the cached result rows of an already-completed BigQuery query job by its job ID, paginating up to the max-rows cap. Use it to retrieve the full result set after a "Query Job Completed" trigger or a "Run a Query" action hands you a job ID. The job must already be finished \u2014 it errors if the job is still running. Read-only and idempotent.',idempotent:!0},props:{project_id:Ye,job_id:ne.ShortText({displayName:"Job ID",description:'The BigQuery job ID to fetch results for. This is returned by the "Query Job Completed" trigger or a "Run a Query" action.',required:!0}),max_results:ne.Number({displayName:"Max Rows",description:"Maximum number of rows to return (up to 10,000). Default: 1,000.",required:!1,defaultValue:1e3}),location:ne.ShortText({displayName:"Location",description:"Dataset location where the job ran (e.g. US, EU). Leave blank for US.",required:!1})},async run(e){let{project_id:t,job_id:n,max_results:o,location:r}=e.propsValue,i=Math.min(o??1e3,1e4),s=await Le(e.auth),u=[],d=[],p,f="0",g="0",y=!1;do{let _=i-u.length,x=(await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${t}/queries/${n}`,headers:{Authorization:`Bearer ${s}`},queryParams:{maxResults:String(Math.min(_,1e3)),timeoutMs:"10000",...p?{pageToken:p}:{},...r?{location:r}:{}}})).body;if(!x.jobComplete)throw new Error(`Job ${n} has not completed yet. Wait for the job to finish before fetching results.`);x.schema?.fields&&(d=x.schema.fields),u.push(...x.rows??[]),p=x.pageToken,f=x.totalRows??f,g=x.totalBytesProcessed??g,y=x.cacheHit??y}while(p&&u.length<i);let h=rr(d,u.slice(0,i));return{rows:h,row_count:h.length,total_rows:parseInt(f,10),bytes_processed:g,cache_hit:y,job_id:n}}});var JC=500;function K6(e){if(Array.isArray(e))return e;if(typeof e=="string"){let t=e.trim();return t.startsWith("[")?JSON.parse(t):t.split(`
|
|
104
|
+
`).map(n=>n.trim()).filter(n=>n.length>0).map(n=>JSON.parse(n))}throw new Error("Data must be a JSON array or a newline-delimited JSON (NDJSON) string.")}a(K6,"parseInputData");var KC=dt({auth:Ue,name:"import_data",classification:"WRITE",displayName:"Import Data",description:"Imports a batch of rows into a BigQuery table. Accepts a JSON array or newline-delimited JSON (NDJSON). Large datasets are automatically split into chunks.",audience:"both",aiMetadata:{description:"Bulk-imports rows into a BigQuery table via streaming inserts, accepting either a JSON array of objects or a newline-delimited JSON (NDJSON) string and automatically splitting large datasets into chunks. Choose this for ingesting a large or variably-formatted dataset in one step; optional flags control whether the batch fails on bad rows or skips invalid rows / unknown fields. Not idempotent: each call appends the rows again, duplicating data if re-run.",idempotent:!1},props:{project_id:Ye,dataset_id:wt,table_id:At,data:ne.Json({displayName:"Data",description:"The data to import. Provide a JSON array of objects (`[{...}, {...}]`) or a newline-delimited JSON string where each line is one row object.",required:!0}),skip_invalid_rows:ne.Checkbox({displayName:"Skip Invalid Rows",description:"Continue importing valid rows even if some rows fail validation. Default: off (fail entire batch).",required:!1,defaultValue:!1}),ignore_unknown_values:ne.Checkbox({displayName:"Ignore Unknown Fields",description:"Silently drop fields not present in the table schema. Default: off (fail on unknown fields).",required:!1,defaultValue:!1})},async run(e){let{project_id:t,dataset_id:n,table_id:o,data:r,skip_invalid_rows:i,ignore_unknown_values:s}=e.propsValue,u=K6(r);if(u.length===0)throw new Error("Data contains no rows to import.");let d=await Le(e.auth),p=Date.now(),f=0,g=0,y=[];for(let h=0;h<u.length;h+=JC){let _=u.slice(h,h+JC),P=_.map(($,V)=>({insertId:`${p}-${h+V}-${Math.random().toString(36).slice(2,9)}`,json:$})),S=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${t}/datasets/${n}/tables/${o}/insertAll`,headers:{Authorization:`Bearer ${d}`},body:{kind:"bigquery#tableDataInsertAllRequest",skipInvalidRows:i??!1,ignoreUnknownValues:s??!1,rows:P}})).body.insertErrors??[];if(S.length>0&&!(i??!1)){let $=S[0]?.errors[0];throw new Error(`Import failed on row ${h+(S[0]?.index??0)}: ${$?.message??"Unknown error"}`)}f+=_.length-S.length,g+=S.length,y.push(...S.map($=>({row_index:h+$.index,first_error:$.errors[0]?.message??"Unknown",reason:$.errors[0]?.reason??null})))}return{success:g===0,rows_attempted:u.length,rows_imported:f,error_count:g,errors:y}}});var X6={project_id:Ye,dataset_id:wt,table_id:At,sort_column:ne.ShortText({displayName:"Sort Column",description:"Name of the column used to detect new rows. The table is ordered by this column (DESC) and any row newer than the last check is returned. Use a TIMESTAMP or DATETIME column, e.g. `created_at`.",required:!0}),max_results:ne.Number({displayName:"Max Rows per Check",description:"Maximum number of new rows to return per poll (default: 500).",required:!1,defaultValue:500})},im={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:n})=>{let{project_id:o,dataset_id:r,table_id:i,sort_column:s,max_results:u}=t,d=u??500,p=await Le(e),f=n??Date.now()-10080*60*1e3,g=`\`${o}.${r}.${i}\``,y=s,h=`SELECT * FROM ${g} WHERE \`${y}\` > TIMESTAMP_MILLIS(${f}) ORDER BY \`${y}\` ASC LIMIT ${d}`,P=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${o}/queries`,headers:{Authorization:`Bearer ${p}`},body:{query:h,useLegacySql:!1,maxResults:d,timeoutMs:3e4}})).body;if(!P.jobComplete)for(let $=0;$<30&&!P.jobComplete;$++)P=(await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${o}/queries/${P.jobReference.jobId}`,headers:{Authorization:`Bearer ${p}`},queryParams:{timeoutMs:"10000",maxResults:String(d)}})).body;let x=P.schema?.fields??[];return rr(x,P.rows??[]).map($=>{let V=$[y],W;if(typeof V=="string"){let Z=parseFloat(V);W=!isNaN(Z)&&Z>1e9?Z*1e3:new Date(V).getTime()}else typeof V=="number"?W=V>1e12?V:V*1e3:W=Date.now();return{epochMilliSeconds:W,data:$}})},"items")},XC=so({auth:Ue,name:"new_row",classification:"READ",displayName:"New Row",description:"Triggers when a new row is added to a BigQuery table. Polls every 5 minutes by comparing the latest value in a sort column against the previous check.",aiMetadata:{description:"Fires for each new row appended to a BigQuery table, detected by polling a TIMESTAMP/DATETIME sort column for values newer than the previous check. Each event represents one newly inserted row. Detection depends entirely on the chosen sort column advancing for new rows."},props:X6,sampleData:{id:"1",created_at:"2024-01-15T10:30:00Z",name:"Example row"},type:"POLLING",async test(e){return await pt.test(im,e)},async onEnable(e){await pt.onEnable(im,e)},async onDisable(e){await pt.onDisable(im,e)},async run(e){return await pt.poll(im,e)}});var Q6={project_id:Ye,dataset_id:wt,table_id:At,updated_at_column:ne.ShortText({displayName:"Updated At Column",description:"Name of the TIMESTAMP column that records when a row was last updated, e.g. `updated_at`. Rows where this column is newer than the last check are returned.",required:!0}),created_at_column:ne.ShortText({displayName:"Created At Column (optional)",description:"If provided, only rows where the updated timestamp is newer than the created timestamp are returned, excluding brand-new rows from the results.",required:!1}),max_results:ne.Number({displayName:"Max Rows per Check",description:"Maximum number of updated rows to return per poll (default: 500).",required:!1,defaultValue:500})},am={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:n})=>{let{project_id:o,dataset_id:r,table_id:i,updated_at_column:s,created_at_column:u,max_results:d}=t,p=d??500,f=await Le(e),g=n??Date.now()-10080*60*1e3,y=`\`${o}.${r}.${i}\``,h=s,_=u?` AND \`${u}\` < TIMESTAMP_MILLIS(${g})`:"",P=[`SELECT * FROM ${y}`,`WHERE \`${h}\` > TIMESTAMP_MILLIS(${g})${_}`,`ORDER BY \`${h}\` ASC`,`LIMIT ${p}`].join(" "),S=(await Ie.sendRequest({method:"POST",url:`${Ce}/projects/${o}/queries`,headers:{Authorization:`Bearer ${f}`},body:{query:P,useLegacySql:!1,maxResults:p,timeoutMs:3e4}})).body;if(!S.jobComplete)for(let W=0;W<30&&!S.jobComplete;W++)S=(await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${o}/queries/${S.jobReference.jobId}`,headers:{Authorization:`Bearer ${f}`},queryParams:{timeoutMs:"10000",maxResults:String(p)}})).body;let $=S.schema?.fields??[];return rr($,S.rows??[]).map(W=>{let Z=W[h],G;if(typeof Z=="string"){let te=parseFloat(Z);G=!isNaN(te)&&te>1e9?te*1e3:new Date(Z).getTime()}else typeof Z=="number"?G=Z>1e12?Z:Z*1e3:G=Date.now();return{epochMilliSeconds:G,data:W}})},"items")},QC=so({auth:Ue,name:"updated_row",classification:"READ",displayName:"Updated Row",description:"Triggers when an existing row is updated in a BigQuery table. Requires an `updated_at` TIMESTAMP column that is set whenever a row changes.",aiMetadata:{description:"Fires for each row whose updated-at TIMESTAMP column advances past the previous check, representing a modified row in a BigQuery table. Requires that column to be set whenever a row changes; supplying an optional created-at column excludes brand-new rows so only genuine updates fire."},props:Q6,sampleData:{id:"1",updated_at:"2024-01-15T10:30:00Z",status:"active"},type:"POLLING",async test(e){return await pt.test(am,e)},async onEnable(e){await pt.onEnable(am,e)},async onDisable(e){await pt.onDisable(am,e)},async run(e){return await pt.poll(am,e)}});var Y6={project_id:Ye,max_rows_per_job:ne.Number({displayName:"Max Rows per Job",description:"Maximum number of result rows to fetch per completed job (default: 500).",required:!1,defaultValue:500})},sm={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:n})=>{let{project_id:o,max_rows_per_job:r}=t,i=r??500,s=await Le(e),u=(n??Date.now()-1440*60*1e3)-3600*1e3,p=((await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${o}/jobs`,headers:{Authorization:`Bearer ${s}`},queryParams:{stateFilter:"done",projection:"full",minCreationTime:String(u),maxResults:"50"}})).body.jobs??[]).filter(g=>g.configuration.jobType==="QUERY"&&!g.status.errorResult&&parseInt(g.statistics.endTime??"0",10)>(n??0)),f=[];for(let g of p){let y=g.jobReference.jobId,h=g.jobReference.location,_=parseInt(g.statistics.endTime??"0",10),P=[],x=[],S;do{let V=await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${o}/queries/${y}`,headers:{Authorization:`Bearer ${s}`},queryParams:{maxResults:String(Math.min(i-P.length,1e3)),timeoutMs:"5000",...S?{pageToken:S}:{},...h?{location:h}:{}}});V.body.schema?.fields&&(x=V.body.schema.fields),P.push(...V.body.rows??[]),S=V.body.pageToken}while(S&&P.length<i);let $=rr(x,P.slice(0,i));f.push({epochMilliSeconds:_,data:{job_id:y,project_id:g.jobReference.projectId,location:h??null,query:g.configuration.query?.query??null,completed_at:g.statistics.endTime?new Date(_).toISOString():null,bytes_processed:g.statistics.query?.totalBytesProcessed??null,cache_hit:g.statistics.query?.cacheHit??null,user_email:g.user_email??null,row_count:$.length,rows:$}})}return f},"items")},YC=so({auth:Ue,name:"query_job_completed",classification:"READ",displayName:"Query Job Completed (With Row Data)",description:"Triggers when a BigQuery query job finishes successfully. Each flow run receives the job metadata and the result rows from that query.",aiMetadata:{description:"Fires when a successful (non-errored) QUERY-type job completes in the BigQuery project, detected by polling the project job history. Each event represents one finished query job and carries its metadata plus the fetched result rows. Only query jobs are surfaced; load, copy, and extract jobs are ignored."},props:Y6,sampleData:{job_id:"job_abc123",project_id:"my-project",query:"SELECT * FROM my_dataset.my_table LIMIT 10",completed_at:"2024-01-15T10:30:00Z",bytes_processed:"1024",cache_hit:!1,row_count:2,rows:[{id:"1",name:"Alice"},{id:"2",name:"Bob"}]},type:"POLLING",async test(e){return await pt.test(sm,e)},async onEnable(e){await pt.onEnable(sm,e)},async onDisable(e){await pt.onDisable(sm,e)},async run(e){return await pt.poll(sm,e)}});var eq={project_id:Ye,include_failed:ne.Checkbox({displayName:"Include Failed Jobs",description:"If enabled, jobs that completed with an error are also returned. Default: off (only successful jobs).",required:!1,defaultValue:!1})},cm={strategy:0,items:a(async({auth:e,propsValue:t,lastFetchEpochMS:n})=>{let{project_id:o,include_failed:r}=t,i=await Le(e),s=(n??Date.now()-1440*60*1e3)-3600*1e3;return((await Ie.sendRequest({method:"GET",url:`${Ce}/projects/${o}/jobs`,headers:{Authorization:`Bearer ${i}`},queryParams:{stateFilter:"done",projection:"full",minCreationTime:String(s),maxResults:"100"}})).body.jobs??[]).filter(p=>!(parseInt(p.statistics.endTime??"0",10)<=(n??0)||!(r??!1)&&p.status.errorResult)).map(p=>{let f=parseInt(p.statistics.endTime??"0",10),g=p.statistics.query?.dmlStats;return{epochMilliSeconds:f,data:{job_id:p.jobReference.jobId,project_id:p.jobReference.projectId,location:p.jobReference.location??null,job_type:p.configuration.jobType,status:p.status.errorResult?"FAILED":"SUCCESS",error_message:p.status.errorResult?.message??null,error_reason:p.status.errorResult?.reason??null,query:p.configuration.query?.query??null,created_at:p.statistics.creationTime?new Date(parseInt(p.statistics.creationTime,10)).toISOString():null,started_at:p.statistics.startTime?new Date(parseInt(p.statistics.startTime,10)).toISOString():null,completed_at:f?new Date(f).toISOString():null,bytes_processed:p.statistics.query?.totalBytesProcessed??p.statistics.totalBytesProcessed??null,cache_hit:p.statistics.query?.cacheHit??null,dml_inserted_rows:g?.insertedRowCount??null,dml_deleted_rows:g?.deletedRowCount??null,dml_updated_rows:g?.updatedRowCount??null,user_email:p.user_email??null}}})},"items")},e0=so({auth:Ue,name:"new_job_completed",classification:"READ",displayName:"New Job Completed",description:"Triggers when any BigQuery job (query, load, copy, or extract) finishes. Returns the job metadata including status, type, and timing.",aiMetadata:{description:"Fires when any BigQuery job of any type (query, load, copy, or extract) finishes in the project, detected by polling the job history. Each event represents one completed job and carries its metadata \u2014 type, status, timing, bytes processed, and DML row counts. By default only successful jobs fire; enabling the include-failed option also surfaces jobs that ended with an error."},props:eq,sampleData:{job_id:"job_xyz789",project_id:"my-project",job_type:"QUERY",status:"SUCCESS",error_message:null,query:"SELECT COUNT(*) FROM my_dataset.events",completed_at:"2024-01-15T10:30:00Z",bytes_processed:"2048",cache_hit:!1,user_email:"user@example.com"},type:"POLLING",async test(e){return await pt.test(cm,e)},async onEnable(e){await pt.onEnable(cm,e)},async onDisable(e){await pt.onDisable(cm,e)},async run(e){return await pt.poll(cm,e)}});var tq=hw({displayName:"Google BigQuery",description:"Query, analyze, and stream data into Google BigQuery \u2014 the fully managed, serverless data warehouse",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/google-bigquery.png",categories:["BUSINESS_INTELLIGENCE"],authors:["AhmadTash"],auth:Ue,actions:[FC,BC,qC,VC,ZC,HC,GC,WC,KC,$I({baseUrl:a(()=>Ce,"baseUrl"),auth:Ue,authMapping:a(async e=>({Authorization:`Bearer ${await Le(e)}`}),"authMapping")})],triggers:[XC,QC,YC,e0]});0&&(module.exports={bigQueryAuth,googleBigQuery});
|
|
67
105
|
/*! Bundled license information:
|
|
68
106
|
|
|
69
107
|
mime-types/index.js:
|