@activepieces/piece-assemblyai 1.1.7 → 1.1.9
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 +10 -10
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";var dp=Object.create;var At=Object.defineProperty;var fp=Object.getOwnPropertyDescriptor;var mp=Object.getOwnPropertyNames;var hp=Object.getPrototypeOf,gp=Object.prototype.hasOwnProperty;var i=(e,t)=>At(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),di=(e,t)=>{for(var r in t)At(e,r,{get:t[r],enumerable:!0})},fi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mp(t))!gp.call(e,o)&&o!==r&&At(e,o,{get:()=>t[o],enumerable:!(n=fp(t,o))||n.enumerable});return e};var ae=(e,t,r)=>(r=e!=null?dp(hp(e)):{},fi(t||!e||!e.__esModule?At(r,"default",{value:e,enumerable:!0}):r,e)),yp=e=>fi(At({},"__esModule",{value:!0}),e);var za=S((wa,Tr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={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")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${a})?$`,"i")};function f(c,p){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let g=0,h=-1,x=(c.match(l.zoneIndex)||[])[0],T,M;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(h=c.indexOf(":",h+1))>=0;)g++;if(c.substr(0,2)==="::"&&g--,c.substr(-2,2)==="::"&&g--,g>p)return null;for(M=p-g,T=":";M--;)T+="0:";return c=c.replace("::",T),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),p=function(){let Y=c.split(":"),oe=[];for(let Ce=0;Ce<Y.length;Ce++)oe.push(parseInt(Y[Ce],16));return oe}(),{parts:p,zoneId:x}}i(f,"expandIPv6");function d(c,p,g,h){if(c.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,T;for(;h>0;){if(T=g-h,T<0&&(T=0),c[x]>>T!==p[x]>>T)return!1;h-=g,x+=1}return!0}i(d,"matchCIDR");function y(c){if(o.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}i(y,"parseIntAuto");function b(c,p){for(;c.length<p;)c=`0${c}`;return c}i(b,"padPart");let v={};v.IPv4=function(){function c(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,h;for(g=0;g<p.length;g++)if(h=p[g],!(0<=h&&h<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return i(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(p,g){let h;if(g===void 0&&(h=p,p=h[0],g=h[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return d(this.octets,p.octets,8,g)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,h={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,T,M;for(x=3;x>=0;x-=1)if(T=this.octets[x],T in h){if(M=h[T],g&&M!==0)return null;M!==8&&(g=!0),p+=M}else return null;return 32-p},c.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c}(),v.IPv4.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),g=p[0].toByteArray(),h=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],T=0;for(;T<4;)x.push(parseInt(g[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(c){return this.parser(c)!==null},v.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},v.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(c){return!!(v.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.isValidCIDRFourPartDecimal=function(c){let p=c.match(/^(.+)\/(\d+)$/);return!v.IPv4.isValidCIDR(c)||!p?!1:v.IPv4.isValidFourPartDecimal(p[1])},v.IPv4.networkAddressFromCIDR=function(c){let p,g,h,x,T;try{for(p=this.parseCIDR(c),h=p[0].toByteArray(),T=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],g=0;g<4;)x.push(parseInt(h[g],10)&parseInt(T[g],10)),g++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.parse=function(c){let p=this.parser(c);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},v.IPv4.parseCIDR=function(c){let p;if(p=c.match(/^(.+)\/(\d+)$/)){let g=parseInt(p[2]);if(g>=0&&g<=32){let h=[this.parse(p[1]),g];return Object.defineProperty(h,"toString",{value:i(function(){return this.join("/")},"value")}),h}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},v.IPv4.parser=function(c){let p,g,h;if(p=c.match(r.fourOctet))return function(){let x=p.slice(1,6),T=[];for(let M=0;M<x.length;M++)g=x[M],T.push(y(g));return T}();if(p=c.match(r.longValue)){if(h=y(p[1]),h>4294967295||h<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],T;for(T=0;T<=24;T+=8)x.push(h>>T&255);return x}().reverse()}else return(p=c.match(r.twoOctet))?function(){let x=p.slice(1,4),T=[];if(h=y(x[1]),h>16777215||h<0)throw new Error("ipaddr: address outside defined range");return T.push(y(x[0])),T.push(h>>16&255),T.push(h>>8&255),T.push(h&255),T}():(p=c.match(r.threeOctet))?function(){let x=p.slice(1,5),T=[];if(h=y(x[2]),h>65535||h<0)throw new Error("ipaddr: address outside defined range");return T.push(y(x[0])),T.push(y(x[1])),T.push(h>>8&255),T.push(h&255),T}():null},v.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],g=0,h=Math.floor(c/8);for(;g<h;)p[g]=255,g++;return h<4&&(p[h]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},v.IPv6=function(){function c(p,g){let h,x;if(p.length===16)for(this.parts=[],h=0;h<=14;h+=2)this.parts.push(p[h]<<8|p[h+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(h=0;h<this.parts.length;h++)if(x=this.parts[h],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return i(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(p,g){let h;if(g===void 0&&(h=p,p=h[0],g=h[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return d(this.parts,p.parts,16,g)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,h={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,T;for(let M=7;M>=0;M-=1)if(x=this.parts[M],x in h){if(T=h[x],g&&T!==0)return null;T!==16&&(g=!0),p+=T}else return null;return 128-p},c.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let p,g=[],h=this.parts;for(let x=0;x<h.length;x++)p=h[x],g.push(p>>8),g.push(p&255);return g},c.prototype.toFixedLengthString=function(){let p=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(b(this.parts[x].toString(16),4));return h}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),g=p[0],h=p[1];return new v.IPv4([g>>8,g&255,h>>8,h&255])},c.prototype.toNormalizedString=function(){let p=function(){let h=[];for(let x=0;x<this.parts.length;x++)h.push(this.parts[x].toString(16));return h}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},c.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),h=0,x=-1,T;for(;T=p.exec(g);)T[0].length>x&&(h=T.index,x=T[0].length);return x<0?g:`${g.substring(0,h)}::${g.substring(h+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c}(),v.IPv6.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),g=p[0].toByteArray(),h=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],T=0;for(;T<16;)x.push(parseInt(g[T],10)|parseInt(h[T],10)^255),T++;return new this(x)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},v.IPv6.isIPv6=function(c){return this.parser(c)!==null},v.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let p=this.parser(c);return new this(p.parts,p.zoneId),!0}catch{return!1}},v.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(c){let p,g,h,x,T;try{for(p=this.parseCIDR(c),h=p[0].toByteArray(),T=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],g=0;g<16;)x.push(parseInt(h[g],10)&parseInt(T[g],10)),g++;return new this(x)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},v.IPv6.parse=function(c){let p=this.parser(c);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},v.IPv6.parseCIDR=function(c){let p,g,h;if((g=c.match(/^(.+)\/(\d+)$/))&&(p=parseInt(g[2]),p>=0&&p<=128))return h=[this.parse(g[1]),p],Object.defineProperty(h,"toString",{value:i(function(){return this.join("/")},"value")}),h;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},v.IPv6.parser=function(c){let p,g,h,x,T,M;if(h=c.match(l.deprecatedTransitional))return this.parser(`::ffff:${h[1]}`);if(l.native.test(c))return f(c,8);if((h=c.match(l.transitional))&&(M=h[6]||"",p=h[1],h[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+M,6),p.parts)){for(T=[parseInt(h[2]),parseInt(h[3]),parseInt(h[4]),parseInt(h[5])],g=0;g<T.length;g++)if(x=T[g],!(0<=x&&x<=255))return null;return p.parts.push(T[0]<<8|T[1]),p.parts.push(T[2]<<8|T[3]),{parts:p.parts,zoneId:p.zoneId}}return null},v.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,h=Math.floor(c/8);for(;g<h;)p[g]=255,g++;return h<16&&(p[h]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},v.fromByteArray=function(c){let p=c.length;if(p===4)return new v.IPv4(c);if(p===16)return new v.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(c){return v.IPv6.isValid(c)||v.IPv4.isValid(c)},v.isValidCIDR=function(c){return v.IPv6.isValidCIDR(c)||v.IPv4.isValidCIDR(c)},v.parse=function(c){if(v.IPv6.isValid(c))return v.IPv6.parse(c);if(v.IPv4.isValid(c))return v.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(c){try{return v.IPv6.parseCIDR(c)}catch{try{return v.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(c){let p=this.parse(c);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},v.subnetMatch=function(c,p,g){let h,x,T,M;g==null&&(g="unicast");for(x in p)if(Object.prototype.hasOwnProperty.call(p,x)){for(T=p[x],T[0]&&!(T[0]instanceof Array)&&(T=[T]),h=0;h<T.length;h++)if(M=T[h],c.kind()===M[0].kind()&&c.match.apply(c,M))return x}return g},typeof Tr<"u"&&Tr.exports?Tr.exports=v:e.ipaddr=v})(wa)});var Es=S((lR,Ss)=>{var Ts=require("stream").Stream,Hf=require("util");Ss.exports=ve;function ve(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ve,"DelayedStream");Hf.inherits(ve,Ts);ve.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ve.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ve.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ve.prototype.resume=function(){this._released||this.release(),this.source.resume()};ve.prototype.pause=function(){this.source.pause()};ve.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ve.prototype.pipe=function(){var e=Ts.prototype.pipe.apply(this,arguments);return this.resume(),e};ve.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)};ve.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 ws=S((dR,$s)=>{var Gf=require("util"),As=require("stream").Stream,Is=Es();$s.exports=X;function X(){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}i(X,"CombinedStream");Gf.inherits(X,As);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Is)){var r=Is.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return As.prototype.pipe.call(this,e,t),this.resume(),e};X.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}};X.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(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.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")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.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)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ks=S((mR,zs)=>{"use strict";zs.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 Ns=S(se=>{"use strict";var kr=ks(),Jf=require("path").extname,Os=/^\s*([^;\s]*)(?:;|\s|$)/,Kf=/^text\//i;se.charset=Rs;se.charsets={lookup:Rs};se.contentType=Xf;se.extension=Yf;se.extensions=Object.create(null);se.lookup=Qf;se.types=Object.create(null);em(se.extensions,se.types);function Rs(e){if(!e||typeof e!="string")return!1;var t=Os.exec(e),r=t&&kr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Kf.test(t[1])?"UTF-8":!1}i(Rs,"charset");function Xf(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?se.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=se.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Xf,"contentType");function Yf(e){if(!e||typeof e!="string")return!1;var t=Os.exec(e),r=t&&se.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Yf,"extension");function Qf(e){if(!e||typeof e!="string")return!1;var t=Jf("x."+e).toLowerCase().substr(1);return t&&se.types[t]||!1}i(Qf,"lookup");function em(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(kr).forEach(i(function(o){var a=kr[o],u=a.extensions;if(!(!u||!u.length)){e[o]=u;for(var l=0;l<u.length;l++){var f=u[l];if(t[f]){var d=r.indexOf(kr[t[f]].source),y=r.indexOf(a.source);if(t[f]!=="application/octet-stream"&&(d>y||d===y&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(em,"populateMaps")});var Cs=S((yR,Ds)=>{Ds.exports=tm;function tm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(tm,"defer")});var oo=S((_R,Ms)=>{var Us=Cs();Ms.exports=rm;function rm(e){var t=!1;return Us(function(){t=!0}),i(function(n,o){t?e(n,o):Us(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(rm,"async")});var io=S((bR,Ls)=>{Ls.exports=nm;function nm(e){Object.keys(e.jobs).forEach(om.bind(e)),e.jobs={}}i(nm,"abort");function om(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(om,"clean")});var ao=S((TR,Bs)=>{var js=oo(),im=io();Bs.exports=am;function am(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=sm(t,o,e[o],function(a,u){o in r.jobs&&(delete r.jobs[o],a?im(r):r.results[o]=u,n(a,r.results))})}i(am,"iterate");function sm(e,t,r,n){var o;return e.length==2?o=e(r,js(n)):o=e(r,t,js(n)),o}i(sm,"runJob")});var so=S((ER,Fs)=>{Fs.exports=um;function um(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,a){return t(e[o],e[a])}),n}i(um,"state")});var uo=S((AR,Vs)=>{var cm=io(),lm=oo();Vs.exports=pm;function pm(e){Object.keys(this.jobs).length&&(this.index=this.size,cm(this),lm(e)(null,this.results))}i(pm,"terminator")});var qs=S((wR,Zs)=>{var dm=ao(),fm=so(),mm=uo();Zs.exports=hm;function hm(e,t,r){for(var n=fm(e);n.index<(n.keyedList||e).length;)dm(e,t,n,function(o,a){if(o){r(o,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return mm.bind(n,r)}i(hm,"parallel")});var co=S((kR,Or)=>{var Ws=ao(),gm=so(),ym=uo();Or.exports=vm;Or.exports.ascending=Hs;Or.exports.descending=_m;function vm(e,t,r,n){var o=gm(e,r);return Ws(e,t,o,i(function a(u,l){if(u){n(u,l);return}if(o.index++,o.index<(o.keyedList||e).length){Ws(e,t,o,a);return}n(null,o.results)},"iteratorHandler")),ym.bind(o,n)}i(vm,"serialOrdered");function Hs(e,t){return e<t?-1:e>t?1:0}i(Hs,"ascending");function _m(e,t){return-1*Hs(e,t)}i(_m,"descending")});var Js=S((RR,Gs)=>{var xm=co();Gs.exports=bm;function bm(e,t,r){return xm(e,t,null,r)}i(bm,"serial")});var Xs=S((DR,Ks)=>{Ks.exports={parallel:qs(),serial:Js(),serialOrdered:co()}});var lo=S((CR,Ys)=>{"use strict";Ys.exports=Object});var eu=S((UR,Qs)=>{"use strict";Qs.exports=Error});var ru=S((MR,tu)=>{"use strict";tu.exports=EvalError});var ou=S((LR,nu)=>{"use strict";nu.exports=RangeError});var au=S((jR,iu)=>{"use strict";iu.exports=ReferenceError});var uu=S((BR,su)=>{"use strict";su.exports=SyntaxError});var Rr=S((FR,cu)=>{"use strict";cu.exports=TypeError});var pu=S((VR,lu)=>{"use strict";lu.exports=URIError});var fu=S((ZR,du)=>{"use strict";du.exports=Math.abs});var hu=S((qR,mu)=>{"use strict";mu.exports=Math.floor});var yu=S((WR,gu)=>{"use strict";gu.exports=Math.max});var _u=S((HR,vu)=>{"use strict";vu.exports=Math.min});var bu=S((GR,xu)=>{"use strict";xu.exports=Math.pow});var Tu=S((JR,Pu)=>{"use strict";Pu.exports=Math.round});var Eu=S((KR,Su)=>{"use strict";Su.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Au=S((YR,Iu)=>{"use strict";var Pm=Eu();Iu.exports=i(function(t){return Pm(t)||t===0?t:t<0?-1:1},"sign")});var wu=S((eN,$u)=>{"use strict";$u.exports=Object.getOwnPropertyDescriptor});var po=S((tN,zu)=>{"use strict";var Nr=wu();if(Nr)try{Nr([],"length")}catch{Nr=null}zu.exports=Nr});var Ou=S((rN,ku)=>{"use strict";var Dr=Object.defineProperty||!1;if(Dr)try{Dr({},"a",{value:1})}catch{Dr=!1}ku.exports=Dr});var fo=S((nN,Ru)=>{"use strict";Ru.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Cu=S((iN,Du)=>{"use strict";var Nu=typeof Symbol<"u"&&Symbol,Tm=fo();Du.exports=i(function(){return typeof Nu!="function"||typeof Symbol!="function"||typeof Nu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Tm()},"hasNativeSymbols")});var mo=S((sN,Uu)=>{"use strict";Uu.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var ho=S((uN,Mu)=>{"use strict";var Sm=lo();Mu.exports=Sm.getPrototypeOf||null});var Bu=S((cN,ju)=>{"use strict";var Em="Function.prototype.bind called on incompatible ",Im=Object.prototype.toString,Am=Math.max,$m="[object Function]",Lu=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var a=0;a<r.length;a+=1)n[a+t.length]=r[a];return n},"concatty"),wm=i(function(t,r){for(var n=[],o=r||0,a=0;o<t.length;o+=1,a+=1)n[a]=t[o];return n},"slicy"),zm=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");ju.exports=i(function(t){var r=this;if(typeof r!="function"||Im.apply(r)!==$m)throw new TypeError(Em+r);for(var n=wm(arguments,1),o,a=i(function(){if(this instanceof o){var y=r.apply(this,Lu(n,arguments));return Object(y)===y?y:this}return r.apply(t,Lu(n,arguments))},"binder"),u=Am(0,r.length-n.length),l=[],f=0;f<u;f++)l[f]="$"+f;if(o=Function("binder","return function ("+zm(l,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var d=i(function(){},"Empty");d.prototype=r.prototype,o.prototype=new d,d.prototype=null}return o},"bind")});var dt=S((pN,Fu)=>{"use strict";var km=Bu();Fu.exports=Function.prototype.bind||km});var Cr=S((dN,Vu)=>{"use strict";Vu.exports=Function.prototype.call});var go=S((fN,Zu)=>{"use strict";Zu.exports=Function.prototype.apply});var Wu=S((mN,qu)=>{"use strict";qu.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Gu=S((hN,Hu)=>{"use strict";var Om=dt(),Rm=go(),Nm=Cr(),Dm=Wu();Hu.exports=Dm||Om.call(Nm,Rm)});var Ku=S((gN,Ju)=>{"use strict";var Cm=dt(),Um=Rr(),Mm=Cr(),Lm=Gu();Ju.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Um("a function is required");return Lm(Cm,Mm,t)},"callBindBasic")});var rc=S((vN,tc)=>{"use strict";var jm=Ku(),Xu=po(),Qu;try{Qu=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var yo=!!Qu&&Xu&&Xu(Object.prototype,"__proto__"),ec=Object,Yu=ec.getPrototypeOf;tc.exports=yo&&typeof yo.get=="function"?jm([yo.get]):typeof Yu=="function"?i(function(t){return Yu(t==null?t:ec(t))},"getDunder"):!1});var sc=S((xN,ac)=>{"use strict";var nc=mo(),oc=ho(),ic=rc();ac.exports=nc?i(function(t){return nc(t)},"getProto"):oc?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return oc(t)},"getProto"):ic?i(function(t){return ic(t)},"getProto"):null});var vo=S((PN,uc)=>{"use strict";var Bm=Function.prototype.call,Fm=Object.prototype.hasOwnProperty,Vm=dt();uc.exports=Vm.call(Bm,Fm)});var hc=S((TN,mc)=>{"use strict";var L,Zm=lo(),qm=eu(),Wm=ru(),Hm=ou(),Gm=au(),gt=uu(),ht=Rr(),Jm=pu(),Km=fu(),Xm=hu(),Ym=yu(),Qm=_u(),eh=bu(),th=Tu(),rh=Au(),dc=Function,_o=i(function(e){try{return dc('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Gt=po(),nh=Ou(),xo=i(function(){throw new ht},"throwTypeError"),oh=Gt?function(){try{return arguments.callee,xo}catch{try{return Gt(arguments,"callee").get}catch{return xo}}}():xo,ft=Cu()(),re=sc(),ih=ho(),ah=mo(),fc=go(),Jt=Cr(),mt={},sh=typeof Uint8Array>"u"||!re?L:re(Uint8Array),Ke={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":ft&&re?re([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":mt,"%AsyncGenerator%":mt,"%AsyncGeneratorFunction%":mt,"%AsyncIteratorPrototype%":mt,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":qm,"%eval%":eval,"%EvalError%":Wm,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":dc,"%GeneratorFunction%":mt,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ft&&re?re(re([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ft||!re?L:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Zm,"%Object.getOwnPropertyDescriptor%":Gt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Hm,"%ReferenceError%":Gm,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ft||!re?L:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ft&&re?re(""[Symbol.iterator]()):L,"%Symbol%":ft?Symbol:L,"%SyntaxError%":gt,"%ThrowTypeError%":oh,"%TypedArray%":sh,"%TypeError%":ht,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Jm,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Jt,"%Function.prototype.apply%":fc,"%Object.defineProperty%":nh,"%Object.getPrototypeOf%":ih,"%Math.abs%":Km,"%Math.floor%":Xm,"%Math.max%":Ym,"%Math.min%":Qm,"%Math.pow%":eh,"%Math.round%":th,"%Math.sign%":rh,"%Reflect.getPrototypeOf%":ah};if(re)try{null.error}catch(e){cc=re(re(e)),Ke["%Error.prototype%"]=cc}var cc,uh=i(function e(t){var r;if(t==="%AsyncFunction%")r=_o("async function () {}");else if(t==="%GeneratorFunction%")r=_o("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=_o("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&re&&(r=re(o.prototype))}return Ke[t]=r,r},"doEval"),lc={__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"]},Kt=dt(),Ur=vo(),ch=Kt.call(Jt,Array.prototype.concat),lh=Kt.call(fc,Array.prototype.splice),pc=Kt.call(Jt,String.prototype.replace),Mr=Kt.call(Jt,String.prototype.slice),ph=Kt.call(Jt,RegExp.prototype.exec),dh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fh=/\\(\\)?/g,mh=i(function(t){var r=Mr(t,0,1),n=Mr(t,-1);if(r==="%"&&n!=="%")throw new gt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new gt("invalid intrinsic syntax, expected opening `%`");var o=[];return pc(t,dh,function(a,u,l,f){o[o.length]=l?pc(f,fh,"$1"):u||a}),o},"stringToPath"),hh=i(function(t,r){var n=t,o;if(Ur(lc,n)&&(o=lc[n],n="%"+o[0]+"%"),Ur(Ke,n)){var a=Ke[n];if(a===mt&&(a=uh(n)),typeof a>"u"&&!r)throw new ht("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new gt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");mc.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new ht("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ht('"allowMissing" argument must be a boolean');if(ph(/^%?[^%]*%?$/,t)===null)throw new gt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=mh(t),o=n.length>0?n[0]:"",a=hh("%"+o+"%",r),u=a.name,l=a.value,f=!1,d=a.alias;d&&(o=d[0],lh(n,ch([0,1],d)));for(var y=1,b=!0;y<n.length;y+=1){var v=n[y],c=Mr(v,0,1),p=Mr(v,-1);if((c==='"'||c==="'"||c==="`"||p==='"'||p==="'"||p==="`")&&c!==p)throw new gt("property names with quotes must have matching quotes");if((v==="constructor"||!b)&&(f=!0),o+="."+v,u="%"+o+"%",Ur(Ke,u))l=Ke[u];else if(l!=null){if(!(v in l)){if(!r)throw new ht("base intrinsic for "+t+" exists, but the property is not available.");return}if(Gt&&y+1>=n.length){var g=Gt(l,v);b=!!g,b&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[v]}else b=Ur(l,v),l=l[v];b&&!f&&(Ke[u]=l)}}return l},"GetIntrinsic")});var yc=S((EN,gc)=>{"use strict";var gh=fo();gc.exports=i(function(){return gh()&&!!Symbol.toStringTag},"hasToStringTagShams")});var xc=S((AN,_c)=>{"use strict";var yh=hc(),vc=yh("%Object.defineProperty%",!0),vh=yc()(),_h=vo(),xh=Rr(),Lr=vh?Symbol.toStringTag:null;_c.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new xh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Lr&&(n||!_h(t,Lr))&&(vc?vc(t,Lr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Lr]=r)},"setToStringTag")});var Pc=S((wN,bc)=>{"use strict";var bh=Function.prototype.call,Ph=Object.prototype.hasOwnProperty,Th=dt();bc.exports=Th.call(bh,Ph)});var Sc=S((zN,Tc)=>{"use strict";Tc.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Ac=S((kN,Ic)=>{"use strict";var So=ws(),Sh=require("util"),bo=require("path"),Eh=require("http"),Ih=require("https"),Ah=require("url").parse,$h=require("fs"),wh=require("stream").Stream,zh=require("crypto"),Po=Ns(),kh=Xs(),Oh=xc(),Ve=Pc(),To=Sc();function Ec(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ec,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],So.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");Sh.inherits(j,So);j.LINE_BREAK=`\r
|
|
2
|
-
`;
|
|
1
|
+
"use strict";var Dp=Object.create;var $t=Object.defineProperty;var Cp=Object.getOwnPropertyDescriptor;var Up=Object.getOwnPropertyNames;var Mp=Object.getPrototypeOf,Lp=Object.prototype.hasOwnProperty;var i=(e,t)=>$t(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},_i=(e,t)=>{for(var r in t)$t(e,r,{get:t[r],enumerable:!0})},xi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Up(t))!Lp.call(e,o)&&o!==r&&$t(e,o,{get:()=>t[o],enumerable:!(n=Cp(t,o))||n.enumerable});return e};var ae=(e,t,r)=>(r=e!=null?Dp(Mp(e)):{},xi(t||!e||!e.__esModule?$t(r,"default",{value:e,enumerable:!0}):r,e)),jp=e=>xi($t({},"__esModule",{value:!0}),e);var qa=E((Za,$r)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={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")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${a})?$`,"i")};function f(c,p){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let g=0,m=-1,x=(c.match(l.zoneIndex)||[])[0],T,M;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(m=c.indexOf(":",m+1))>=0;)g++;if(c.substr(0,2)==="::"&&g--,c.substr(-2,2)==="::"&&g--,g>p)return null;for(M=p-g,T=":";M--;)T+="0:";return c=c.replace("::",T),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),p=(function(){let ee=c.split(":"),ie=[];for(let ge=0;ge<ee.length;ge++)ie.push(parseInt(ee[ge],16));return ie})(),{parts:p,zoneId:x}}i(f,"expandIPv6");function h(c,p,g,m){if(c.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,T;for(;m>0;){if(T=g-m,T<0&&(T=0),c[x]>>T!==p[x]>>T)return!1;m-=g,x+=1}return!0}i(h,"matchCIDR");function v(c){if(o.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}i(v,"parseIntAuto");function b(c,p){for(;c.length<p;)c=`0${c}`;return c}i(b,"padPart");let _={};_.IPv4=(function(){function c(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<p.length;g++)if(m=p[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return i(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,g)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,T,M;for(x=3;x>=0;x-=1)if(T=this.octets[x],T in m){if(M=m[T],g&&M!==0)return null;M!==8&&(g=!0),p+=M}else return null;return 32-p},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c})(),_.IPv4.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],T=0;for(;T<4;)x.push(parseInt(g[T],10)|parseInt(m[T],10)^255),T++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(c){return this.parser(c)!==null},_.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(c){return!!(_.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(c){let p=c.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(c)||!p?!1:_.IPv4.isValidFourPartDecimal(p[1])},_.IPv4.networkAddressFromCIDR=function(c){let p,g,m,x,T;try{for(p=this.parseCIDR(c),m=p[0].toByteArray(),T=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],g=0;g<4;)x.push(parseInt(m[g],10)&parseInt(T[g],10)),g++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(c){let p=this.parser(c);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},_.IPv4.parseCIDR=function(c){let p;if(p=c.match(/^(.+)\/(\d+)$/)){let g=parseInt(p[2]);if(g>=0&&g<=32){let m=[this.parse(p[1]),g];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(c){let p,g,m;if(p=c.match(r.fourOctet))return(function(){let x=p.slice(1,6),T=[];for(let M=0;M<x.length;M++)g=x[M],T.push(v(g));return T})();if(p=c.match(r.longValue)){if(m=v(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],T;for(T=0;T<=24;T+=8)x.push(m>>T&255);return x})().reverse()}else return(p=c.match(r.twoOctet))?(function(){let x=p.slice(1,4),T=[];if(m=v(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return T.push(v(x[0])),T.push(m>>16&255),T.push(m>>8&255),T.push(m&255),T})():(p=c.match(r.threeOctet))?(function(){let x=p.slice(1,5),T=[];if(m=v(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return T.push(v(x[0])),T.push(v(x[1])),T.push(m>>8&255),T.push(m&255),T})():null},_.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],g=0,m=Math.floor(c/8);for(;g<m;)p[g]=255,g++;return m<4&&(p[m]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},_.IPv6=(function(){function c(p,g){let m,x;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return i(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,g)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,T;for(let M=7;M>=0;M-=1)if(x=this.parts[M],x in m){if(T=m[x],g&&T!==0)return null;T!==16&&(g=!0),p+=T}else return null;return 128-p},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let p,g=[],m=this.parts;for(let x=0;x<m.length;x++)p=m[x],g.push(p>>8),g.push(p&255);return g},c.prototype.toFixedLengthString=function(){let p=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(b(this.parts[x].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),g=p[0],m=p[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},c.prototype.toNormalizedString=function(){let p=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},c.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,x=-1,T;for(;T=p.exec(g);)T[0].length>x&&(m=T.index,x=T[0].length);return x<0?g:`${g.substring(0,m)}::${g.substring(m+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c})(),_.IPv6.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],T=0;for(;T<16;)x.push(parseInt(g[T],10)|parseInt(m[T],10)^255),T++;return new this(x)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},_.IPv6.isIPv6=function(c){return this.parser(c)!==null},_.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let p=this.parser(c);return new this(p.parts,p.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(c){let p,g,m,x,T;try{for(p=this.parseCIDR(c),m=p[0].toByteArray(),T=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],g=0;g<16;)x.push(parseInt(m[g],10)&parseInt(T[g],10)),g++;return new this(x)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(c){let p=this.parser(c);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},_.IPv6.parseCIDR=function(c){let p,g,m;if((g=c.match(/^(.+)\/(\d+)$/))&&(p=parseInt(g[2]),p>=0&&p<=128))return m=[this.parse(g[1]),p],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(c){let p,g,m,x,T,M;if(m=c.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(c))return f(c,8);if((m=c.match(l.transitional))&&(M=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+M,6),p.parts)){for(T=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<T.length;g++)if(x=T[g],!(0<=x&&x<=255))return null;return p.parts.push(T[0]<<8|T[1]),p.parts.push(T[2]<<8|T[3]),{parts:p.parts,zoneId:p.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(c/8);for(;g<m;)p[g]=255,g++;return m<16&&(p[m]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},_.fromByteArray=function(c){let p=c.length;if(p===4)return new _.IPv4(c);if(p===16)return new _.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(c){return _.IPv6.isValid(c)||_.IPv4.isValid(c)},_.isValidCIDR=function(c){return _.IPv6.isValidCIDR(c)||_.IPv4.isValidCIDR(c)},_.parse=function(c){if(_.IPv6.isValid(c))return _.IPv6.parse(c);if(_.IPv4.isValid(c))return _.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(c){try{return _.IPv6.parseCIDR(c)}catch{try{return _.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(c){let p=this.parse(c);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},_.subnetMatch=function(c,p,g){let m,x,T,M;g==null&&(g="unicast");for(x in p)if(Object.prototype.hasOwnProperty.call(p,x)){for(T=p[x],T[0]&&!(T[0]instanceof Array)&&(T=[T]),m=0;m<T.length;m++)if(M=T[m],c.kind()===M[0].kind()&&c.match.apply(c,M))return x}return g},typeof $r<"u"&&$r.exports?$r.exports=_:e.ipaddr=_})(Za)});var Gs=E((sN,Ws)=>{var Hs=require("stream").Stream,Sm=require("util");Ws.exports=xe;function xe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(xe,"DelayedStream");Sm.inherits(xe,Hs);xe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(xe.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});xe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};xe.prototype.resume=function(){this._released||this.release(),this.source.resume()};xe.prototype.pause=function(){this.source.pause()};xe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};xe.prototype.pipe=function(){var e=Hs.prototype.pipe.apply(this,arguments);return this.resume(),e};xe.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)};xe.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 Ys=E((cN,Xs)=>{var Im=require("util"),Js=require("stream").Stream,Ks=Gs();Xs.exports=X;function X(){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}i(X,"CombinedStream");Im.inherits(X,Js);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Ks)){var r=Ks.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return Js.prototype.pipe.call(this,e,t),this.resume(),e};X.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}};X.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(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.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")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.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)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var eu=E((pN,Qs)=>{"use strict";Qs.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 nu=E(se=>{"use strict";var Dr=eu(),Am=require("path").extname,tu=/^\s*([^;\s]*)(?:;|\s|$)/,$m=/^text\//i;se.charset=ru;se.charsets={lookup:ru};se.contentType=zm;se.extension=wm;se.extensions=Object.create(null);se.lookup=km;se.types=Object.create(null);Om(se.extensions,se.types);function ru(e){if(!e||typeof e!="string")return!1;var t=tu.exec(e),r=t&&Dr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&$m.test(t[1])?"UTF-8":!1}i(ru,"charset");function zm(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?se.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=se.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(zm,"contentType");function wm(e){if(!e||typeof e!="string")return!1;var t=tu.exec(e),r=t&&se.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(wm,"extension");function km(e){if(!e||typeof e!="string")return!1;var t=Am("x."+e).toLowerCase().substr(1);return t&&se.types[t]||!1}i(km,"lookup");function Om(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Dr).forEach(i(function(o){var a=Dr[o],u=a.extensions;if(!(!u||!u.length)){e[o]=u;for(var l=0;l<u.length;l++){var f=u[l];if(t[f]){var h=r.indexOf(Dr[t[f]].source),v=r.indexOf(a.source);if(t[f]!=="application/octet-stream"&&(h>v||h===v&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(Om,"populateMaps")});var iu=E((mN,ou)=>{ou.exports=Rm;function Rm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Rm,"defer")});var po=E((gN,su)=>{var au=iu();su.exports=Nm;function Nm(e){var t=!1;return au(function(){t=!0}),i(function(n,o){t?e(n,o):au(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Nm,"async")});var fo=E((vN,uu)=>{uu.exports=Dm;function Dm(e){Object.keys(e.jobs).forEach(Cm.bind(e)),e.jobs={}}i(Dm,"abort");function Cm(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Cm,"clean")});var mo=E((xN,lu)=>{var cu=po(),Um=fo();lu.exports=Mm;function Mm(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Lm(t,o,e[o],function(a,u){o in r.jobs&&(delete r.jobs[o],a?Um(r):r.results[o]=u,n(a,r.results))})}i(Mm,"iterate");function Lm(e,t,r,n){var o;return e.length==2?o=e(r,cu(n)):o=e(r,t,cu(n)),o}i(Lm,"runJob")});var ho=E((PN,pu)=>{pu.exports=jm;function jm(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,a){return t(e[o],e[a])}),n}i(jm,"state")});var go=E((EN,du)=>{var Bm=fo(),Fm=po();du.exports=Vm;function Vm(e){Object.keys(this.jobs).length&&(this.index=this.size,Bm(this),Fm(e)(null,this.results))}i(Vm,"terminator")});var mu=E((IN,fu)=>{var Zm=mo(),qm=ho(),Hm=go();fu.exports=Wm;function Wm(e,t,r){for(var n=qm(e);n.index<(n.keyedList||e).length;)Zm(e,t,n,function(o,a){if(o){r(o,a);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Hm.bind(n,r)}i(Wm,"parallel")});var yo=E(($N,Cr)=>{var hu=mo(),Gm=ho(),Km=go();Cr.exports=Jm;Cr.exports.ascending=gu;Cr.exports.descending=Xm;function Jm(e,t,r,n){var o=Gm(e,r);return hu(e,t,o,i(function a(u,l){if(u){n(u,l);return}if(o.index++,o.index<(o.keyedList||e).length){hu(e,t,o,a);return}n(null,o.results)},"iteratorHandler")),Km.bind(o,n)}i(Jm,"serialOrdered");function gu(e,t){return e<t?-1:e>t?1:0}i(gu,"ascending");function Xm(e,t){return-1*gu(e,t)}i(Xm,"descending")});var vu=E((wN,yu)=>{var Ym=yo();yu.exports=Qm;function Qm(e,t,r){return Ym(e,t,null,r)}i(Qm,"serial")});var xu=E((ON,_u)=>{_u.exports={parallel:mu(),serial:vu(),serialOrdered:yo()}});var vo=E((RN,bu)=>{"use strict";bu.exports=Object});var Tu=E((NN,Pu)=>{"use strict";Pu.exports=Error});var Su=E((DN,Eu)=>{"use strict";Eu.exports=EvalError});var Au=E((CN,Iu)=>{"use strict";Iu.exports=RangeError});var zu=E((UN,$u)=>{"use strict";$u.exports=ReferenceError});var ku=E((MN,wu)=>{"use strict";wu.exports=SyntaxError});var Ur=E((LN,Ou)=>{"use strict";Ou.exports=TypeError});var Nu=E((jN,Ru)=>{"use strict";Ru.exports=URIError});var Cu=E((BN,Du)=>{"use strict";Du.exports=Math.abs});var Mu=E((FN,Uu)=>{"use strict";Uu.exports=Math.floor});var ju=E((VN,Lu)=>{"use strict";Lu.exports=Math.max});var Fu=E((ZN,Bu)=>{"use strict";Bu.exports=Math.min});var Zu=E((qN,Vu)=>{"use strict";Vu.exports=Math.pow});var Hu=E((HN,qu)=>{"use strict";qu.exports=Math.round});var Gu=E((WN,Wu)=>{"use strict";Wu.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ju=E((KN,Ku)=>{"use strict";var eh=Gu();Ku.exports=i(function(t){return eh(t)||t===0?t:t<0?-1:1},"sign")});var Yu=E((XN,Xu)=>{"use strict";Xu.exports=Object.getOwnPropertyDescriptor});var _o=E((YN,Qu)=>{"use strict";var Mr=Yu();if(Mr)try{Mr([],"length")}catch{Mr=null}Qu.exports=Mr});var tc=E((QN,ec)=>{"use strict";var Lr=Object.defineProperty||!1;if(Lr)try{Lr({},"a",{value:1})}catch{Lr=!1}ec.exports=Lr});var xo=E((eD,rc)=>{"use strict";rc.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var a in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ic=E((rD,oc)=>{"use strict";var nc=typeof Symbol<"u"&&Symbol,th=xo();oc.exports=i(function(){return typeof nc!="function"||typeof Symbol!="function"||typeof nc("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:th()},"hasNativeSymbols")});var bo=E((oD,ac)=>{"use strict";ac.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Po=E((iD,sc)=>{"use strict";var rh=vo();sc.exports=rh.getPrototypeOf||null});var lc=E((aD,cc)=>{"use strict";var nh="Function.prototype.bind called on incompatible ",oh=Object.prototype.toString,ih=Math.max,ah="[object Function]",uc=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var a=0;a<r.length;a+=1)n[a+t.length]=r[a];return n},"concatty"),sh=i(function(t,r){for(var n=[],o=r||0,a=0;o<t.length;o+=1,a+=1)n[a]=t[o];return n},"slicy"),uh=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");cc.exports=i(function(t){var r=this;if(typeof r!="function"||oh.apply(r)!==ah)throw new TypeError(nh+r);for(var n=sh(arguments,1),o,a=i(function(){if(this instanceof o){var v=r.apply(this,uc(n,arguments));return Object(v)===v?v:this}return r.apply(t,uc(n,arguments))},"binder"),u=ih(0,r.length-n.length),l=[],f=0;f<u;f++)l[f]="$"+f;if(o=Function("binder","return function ("+uh(l,",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var ft=E((uD,pc)=>{"use strict";var ch=lc();pc.exports=Function.prototype.bind||ch});var jr=E((cD,dc)=>{"use strict";dc.exports=Function.prototype.call});var To=E((lD,fc)=>{"use strict";fc.exports=Function.prototype.apply});var hc=E((pD,mc)=>{"use strict";mc.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var yc=E((dD,gc)=>{"use strict";var lh=ft(),ph=To(),dh=jr(),fh=hc();gc.exports=fh||lh.call(dh,ph)});var _c=E((fD,vc)=>{"use strict";var mh=ft(),hh=Ur(),gh=jr(),yh=yc();vc.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new hh("a function is required");return yh(mh,gh,t)},"callBindBasic")});var Sc=E((hD,Ec)=>{"use strict";var vh=_c(),xc=_o(),Pc;try{Pc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Eo=!!Pc&&xc&&xc(Object.prototype,"__proto__"),Tc=Object,bc=Tc.getPrototypeOf;Ec.exports=Eo&&typeof Eo.get=="function"?vh([Eo.get]):typeof bc=="function"?i(function(t){return bc(t==null?t:Tc(t))},"getDunder"):!1});var wc=E((yD,zc)=>{"use strict";var Ic=bo(),Ac=Po(),$c=Sc();zc.exports=Ic?i(function(t){return Ic(t)},"getProto"):Ac?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ac(t)},"getProto"):$c?i(function(t){return $c(t)},"getProto"):null});var So=E((_D,kc)=>{"use strict";var _h=Function.prototype.call,xh=Object.prototype.hasOwnProperty,bh=ft();kc.exports=bh.call(_h,xh)});var Mc=E((xD,Uc)=>{"use strict";var L,Ph=vo(),Th=Tu(),Eh=Su(),Sh=Au(),Ih=zu(),yt=ku(),gt=Ur(),Ah=Nu(),$h=Cu(),zh=Mu(),wh=ju(),kh=Fu(),Oh=Zu(),Rh=Hu(),Nh=Ju(),Dc=Function,Io=i(function(e){try{return Dc('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Jt=_o(),Dh=tc(),Ao=i(function(){throw new gt},"throwTypeError"),Ch=Jt?(function(){try{return arguments.callee,Ao}catch{try{return Jt(arguments,"callee").get}catch{return Ao}}})():Ao,mt=ic()(),ne=wc(),Uh=Po(),Mh=bo(),Cc=To(),Xt=jr(),ht={},Lh=typeof Uint8Array>"u"||!ne?L:ne(Uint8Array),Qe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":mt&&ne?ne([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":ht,"%AsyncGenerator%":ht,"%AsyncGeneratorFunction%":ht,"%AsyncIteratorPrototype%":ht,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Th,"%eval%":eval,"%EvalError%":Eh,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":Dc,"%GeneratorFunction%":ht,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":mt&&ne?ne(ne([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!mt||!ne?L:ne(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ph,"%Object.getOwnPropertyDescriptor%":Jt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Sh,"%ReferenceError%":Ih,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!mt||!ne?L:ne(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":mt&&ne?ne(""[Symbol.iterator]()):L,"%Symbol%":mt?Symbol:L,"%SyntaxError%":yt,"%ThrowTypeError%":Ch,"%TypedArray%":Lh,"%TypeError%":gt,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Ah,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Xt,"%Function.prototype.apply%":Cc,"%Object.defineProperty%":Dh,"%Object.getPrototypeOf%":Uh,"%Math.abs%":$h,"%Math.floor%":zh,"%Math.max%":wh,"%Math.min%":kh,"%Math.pow%":Oh,"%Math.round%":Rh,"%Math.sign%":Nh,"%Reflect.getPrototypeOf%":Mh};if(ne)try{null.error}catch(e){Oc=ne(ne(e)),Qe["%Error.prototype%"]=Oc}var Oc,jh=i(function e(t){var r;if(t==="%AsyncFunction%")r=Io("async function () {}");else if(t==="%GeneratorFunction%")r=Io("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Io("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ne&&(r=ne(o.prototype))}return Qe[t]=r,r},"doEval"),Rc={__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"]},Yt=ft(),Br=So(),Bh=Yt.call(Xt,Array.prototype.concat),Fh=Yt.call(Cc,Array.prototype.splice),Nc=Yt.call(Xt,String.prototype.replace),Fr=Yt.call(Xt,String.prototype.slice),Vh=Yt.call(Xt,RegExp.prototype.exec),Zh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qh=/\\(\\)?/g,Hh=i(function(t){var r=Fr(t,0,1),n=Fr(t,-1);if(r==="%"&&n!=="%")throw new yt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new yt("invalid intrinsic syntax, expected opening `%`");var o=[];return Nc(t,Zh,function(a,u,l,f){o[o.length]=l?Nc(f,qh,"$1"):u||a}),o},"stringToPath"),Wh=i(function(t,r){var n=t,o;if(Br(Rc,n)&&(o=Rc[n],n="%"+o[0]+"%"),Br(Qe,n)){var a=Qe[n];if(a===ht&&(a=jh(n)),typeof a>"u"&&!r)throw new gt("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:a}}throw new yt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Uc.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new gt("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new gt('"allowMissing" argument must be a boolean');if(Vh(/^%?[^%]*%?$/,t)===null)throw new yt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Hh(t),o=n.length>0?n[0]:"",a=Wh("%"+o+"%",r),u=a.name,l=a.value,f=!1,h=a.alias;h&&(o=h[0],Fh(n,Bh([0,1],h)));for(var v=1,b=!0;v<n.length;v+=1){var _=n[v],c=Fr(_,0,1),p=Fr(_,-1);if((c==='"'||c==="'"||c==="`"||p==='"'||p==="'"||p==="`")&&c!==p)throw new yt("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(f=!0),o+="."+_,u="%"+o+"%",Br(Qe,u))l=Qe[u];else if(l!=null){if(!(_ in l)){if(!r)throw new gt("base intrinsic for "+t+" exists, but the property is not available.");return}if(Jt&&v+1>=n.length){var g=Jt(l,_);b=!!g,b&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else b=Br(l,_),l=l[_];b&&!f&&(Qe[u]=l)}}return l},"GetIntrinsic")});var jc=E((PD,Lc)=>{"use strict";var Gh=xo();Lc.exports=i(function(){return Gh()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Vc=E((ED,Fc)=>{"use strict";var Kh=Mc(),Bc=Kh("%Object.defineProperty%",!0),Jh=jc()(),Xh=So(),Yh=Ur(),Vr=Jh?Symbol.toStringTag:null;Fc.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Yh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Vr&&(n||!Xh(t,Vr))&&(Bc?Bc(t,Vr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Vr]=r)},"setToStringTag")});var qc=E((ID,Zc)=>{"use strict";var Qh=Function.prototype.call,eg=Object.prototype.hasOwnProperty,tg=ft();Zc.exports=tg.call(Qh,eg)});var Wc=E((AD,Hc)=>{"use strict";Hc.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Jc=E(($D,Kc)=>{"use strict";var ko=Ys(),rg=require("util"),$o=require("path"),ng=require("http"),og=require("https"),ig=require("url").parse,ag=require("fs"),sg=require("stream").Stream,ug=require("crypto"),zo=nu(),cg=xu(),lg=Vc(),We=qc(),wo=Wc();function Gc(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Gc,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ko.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(F,"FormData");rg.inherits(F,ko);F.LINE_BREAK=`\r
|
|
2
|
+
`;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ko.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 o=this._multiPartHeader(e,t,r),a=this._multiPartFooter();n(o),n(t),n(a),this._trackLength(o,t,r)};F.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&We(t,"httpVersion"))&&!(t instanceof sg))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){We(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ag.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):We(e,"httpVersion")?t(null,Number(e.headers["content-length"])):We(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),a="",u={"Content-Disposition":["form-data",'name="'+Gc(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&wo(u,r.header);var l;for(var f in u)if(We(u,f)){if(l=u[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(a+=f+": "+l.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+a+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=$o.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=$o.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&We(e,"httpVersion")&&(r=$o.basename(e.client._httpMessage.path||"")),r)return'filename="'+Gc(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=zo.lookup(e.name)),!r&&e&&e.path&&(r=zo.lookup(e.path)),!r&&e&&e.readable&&We(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=zo.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)We(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+ug.randomBytes(12).toString("hex")};F.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};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.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}cg.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=ig(e),n=wo({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=wo(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=og.request(n):r=ng.request(n),this.getLength(function(a,u){if(a&&a!=="Unknown stream"){this._error(a);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var l,f=i(function(h,v){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,v)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};lg(F.prototype,"FormData");Kc.exports=F});var Re=E((GD,tl)=>{"use strict";var Qc=["nodebuffer","arraybuffer","fragments"],el=typeof Blob<"u";el&&Qc.push("blob");tl.exports={BINARY_TYPES:Qc,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:el,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:i(()=>{},"NOOP")}});var yl=E((JD,gl)=>{var il=require("fs"),Ne=require("path"),al=require("os"),sl=typeof __webpack_require__=="function"?__non_webpack_require__:require,vg=process.config&&process.config.variables||{},_g=!!process.env.PREBUILDS_ONLY,rl=process.versions.modules,Oo=Pg()?"electron":bg()?"node-webkit":"node",Ro=process.env.npm_config_arch||al.arch(),No=process.env.npm_config_platform||al.platform(),ul=process.env.LIBC||(Tg(No)?"musl":"glibc"),Do=process.env.ARM_VERSION||(Ro==="arm64"?"8":vg.arm_version)||"",cl=(process.versions.uv||"").split(".")[0];gl.exports=Se;function Se(e){return sl(Se.resolve(e))}i(Se,"load");Se.resolve=Se.path=function(e){e=Ne.resolve(e||".");try{var t=sl(Ne.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch{}if(!_g){var r=nl(Ne.join(e,"build/Release"),ol);if(r)return r;var n=nl(Ne.join(e,"build/Debug"),ol);if(n)return n}var o=l(e);if(o)return o;var a=l(Ne.dirname(process.execPath));if(a)return a;var u=["platform="+No,"arch="+Ro,"runtime="+Oo,"abi="+rl,"uv="+cl,Do?"armv="+Do:"","libc="+ul,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+u+`
|
|
3
3
|
loaded from: `+e+`
|
|
4
|
-
`);function l(f){var d=wo(Oe.join(f,"prebuilds")).map(Bc),y=d.filter(Fc(Ao,Io)).sort(Vc)[0];if(y){var b=Oe.join(f,"prebuilds",y.name),v=wo(b).map(Zc),c=v.filter(qc(Eo,Rc)),p=c.sort(Wc(Eo))[0];if(p)return Oe.join(b,p.file)}}};function wo(e){try{return Cc.readdirSync(e)}catch{return[]}}i(wo,"readdirSync");function Nc(e,t){var r=wo(e).filter(t);return r[0]&&Oe.join(e,r[0])}i(Nc,"getFirst");function Dc(e){return/\.node$/.test(e)}i(Dc,"matchBuild");function Bc(e){var t=e.split("-");if(t.length===2){var r=t[0],n=t[1].split("+");if(r&&n.length&&n.every(Boolean))return{name:e,platform:r,architectures:n}}}i(Bc,"parseTuple");function Fc(e,t){return function(r){return r==null||r.platform!==e?!1:r.architectures.includes(t)}}i(Fc,"matchTuple");function Vc(e,t){return e.architectures.length-t.architectures.length}i(Vc,"compareTuples");function Zc(e){var t=e.split("."),r=t.pop(),n={file:e,specificity:0};if(r==="node"){for(var o=0;o<t.length;o++){var a=t[o];if(a==="node"||a==="electron"||a==="node-webkit")n.runtime=a;else if(a==="napi")n.napi=!0;else if(a.slice(0,3)==="abi")n.abi=a.slice(3);else if(a.slice(0,2)==="uv")n.uv=a.slice(2);else if(a.slice(0,4)==="armv")n.armv=a.slice(4);else if(a==="glibc"||a==="musl")n.libc=a;else continue;n.specificity++}return n}}i(Zc,"parseTags");function qc(e,t){return function(r){return!(r==null||r.runtime&&r.runtime!==e&&!Fh(r)||r.abi&&r.abi!==t&&!r.napi||r.uv&&r.uv!==jc||r.armv&&r.armv!==$o||r.libc&&r.libc!==Lc)}}i(qc,"matchTags");function Fh(e){return e.runtime==="node"&&e.napi}i(Fh,"runtimeAgnostic");function Wc(e){return function(t,r){return t.runtime!==r.runtime?t.runtime===e?-1:1:t.abi!==r.abi?t.abi?-1:1:t.specificity!==r.specificity?t.specificity>r.specificity?-1:1:0}}i(Wc,"compareTags");function Vh(){return!!(process.versions&&process.versions.nw)}i(Vh,"isNwjs");function Zh(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}i(Zh,"isElectron");function qh(e){return e==="linux"&&Cc.existsSync("/etc/alpine-release")}i(qh,"isAlpine");Pe.parseTags=Zc;Pe.matchTags=qc;Pe.compareTags=Wc;Pe.parseTuple=Bc;Pe.matchTuple=Fc;Pe.compareTuples=Vc});var Jc=S((tD,ko)=>{var zo=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof zo.addon=="function"?ko.exports=zo.addon.bind(zo):ko.exports=Gc()});var Xc=S((rD,Kc)=>{"use strict";var Wh=i((e,t,r,n,o)=>{for(var a=0;a<o;a++)r[n+a]=e[a]^t[a&3]},"mask"),Hh=i((e,t)=>{let r=e.length;for(var n=0;n<r;n++)e[n]^=t[n&3]},"unmask");Kc.exports={mask:Wh,unmask:Hh}});var Yc=S((oD,Oo)=>{"use strict";try{Oo.exports=Jc()(__dirname)}catch{Oo.exports=Xc()}});var Xt=S((iD,jr)=>{"use strict";var{EMPTY_BUFFER:Gh}=ke(),Ro=Buffer[Symbol.species];function Jh(e,t){if(e.length===0)return Gh;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let o=0;o<e.length;o++){let a=e[o];r.set(a,n),n+=a.length}return n<t?new Ro(r.buffer,r.byteOffset,n):r}i(Jh,"concat");function Qc(e,t,r,n,o){for(let a=0;a<o;a++)r[n+a]=e[a]^t[a&3]}i(Qc,"_mask");function el(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}i(el,"_unmask");function Kh(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}i(Kh,"toArrayBuffer");function No(e){if(No.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Ro(e):ArrayBuffer.isView(e)?t=new Ro(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),No.readOnly=!1),t}i(No,"toBuffer");jr.exports={concat:Jh,mask:Qc,toArrayBuffer:Kh,toBuffer:No,unmask:el};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=Yc();jr.exports.mask=function(t,r,n,o,a){a<48?Qc(t,r,n,o,a):e.mask(t,r,n,o,a)},jr.exports.unmask=function(t,r){t.length<32?el(t,r):e.unmask(t,r)}}catch{}});var nl=S((sD,rl)=>{"use strict";var tl=Symbol("kDone"),Do=Symbol("kRun"),Co=class{static{i(this,"Limiter")}constructor(t){this[tl]=()=>{this.pending--,this[Do]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Do]()}[Do](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[tl])}}};rl.exports=Co});var _t=S((cD,sl)=>{"use strict";var Yt=require("zlib"),ol=Xt(),Xh=nl(),{kStatusCode:il}=ke(),Yh=Buffer[Symbol.species],Qh=Buffer.from([0,0,255,255]),Fr=Symbol("permessage-deflate"),Re=Symbol("total-length"),yt=Symbol("callback"),Ze=Symbol("buffers"),vt=Symbol("error"),Br,Uo=class{static{i(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Br){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Br=new Xh(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[yt];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(o=>!(r.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>o.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let o=r[n];if(o.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(o=o[0],n==="client_max_window_bits"){if(o!==!0){let a=+o;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${n}": ${o}`);o=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${o}`)}else if(n==="server_max_window_bits"){let a=+o;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${n}": ${o}`);o=a}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${o}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=o})}),t}decompress(t,r,n){Br.add(o=>{this._decompress(t,r,(a,u)=>{o(),n(a,u)})})}compress(t,r,n){Br.add(o=>{this._compress(t,r,(a,u)=>{o(),n(a,u)})})}_decompress(t,r,n){let o=this._isServer?"client":"server";if(!this._inflate){let a=`${o}_max_window_bits`,u=typeof this.params[a]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=Yt.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[Fr]=this,this._inflate[Re]=0,this._inflate[Ze]=[],this._inflate.on("error",tg),this._inflate.on("data",al)}this._inflate[yt]=n,this._inflate.write(t),r&&this._inflate.write(Qh),this._inflate.flush(()=>{let a=this._inflate[vt];if(a){this._inflate.close(),this._inflate=null,n(a);return}let u=ol.concat(this._inflate[Ze],this._inflate[Re]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Re]=0,this._inflate[Ze]=[],r&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),n(null,u)})}_compress(t,r,n){let o=this._isServer?"server":"client";if(!this._deflate){let a=`${o}_max_window_bits`,u=typeof this.params[a]!="number"?Yt.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=Yt.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[Re]=0,this._deflate[Ze]=[],this._deflate.on("data",eg)}this._deflate[yt]=n,this._deflate.write(t),this._deflate.flush(Yt.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=ol.concat(this._deflate[Ze],this._deflate[Re]);r&&(a=new Yh(a.buffer,a.byteOffset,a.length-4)),this._deflate[yt]=null,this._deflate[Re]=0,this._deflate[Ze]=[],r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),n(null,a)})}};sl.exports=Uo;function eg(e){this[Ze].push(e),this[Re]+=e.length}i(eg,"deflateOnData");function al(e){if(this[Re]+=e.length,this[Fr]._maxPayload<1||this[Re]<=this[Fr]._maxPayload){this[Ze].push(e);return}this[vt]=new RangeError("Max payload size exceeded"),this[vt].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[vt][il]=1009,this.removeListener("data",al),this.reset()}i(al,"inflateOnData");function tg(e){if(this[Fr]._inflate=null,this[vt]){this[yt](this[vt]);return}e[il]=1007,this[yt](e)}i(tg,"inflateOnError")});var xt=S((pD,Vr)=>{"use strict";var{isUtf8:ul}=require("buffer"),{hasBlob:rg}=ke(),ng=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function og(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}i(og,"isValidStatusCode");function Mo(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}i(Mo,"_isValidUTF8");function ig(e){return rg&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}i(ig,"isBlob");Vr.exports={isBlob:ig,isValidStatusCode:og,isValidUTF8:Mo,tokenChars:ng};if(ul)Vr.exports.isValidUTF8=function(e){return e.length<24?Mo(e):ul(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");Vr.exports.isValidUTF8=function(t){return t.length<32?Mo(t):e(t)}}catch{}});var Vo=S((fD,hl)=>{"use strict";var{Writable:ag}=require("stream"),cl=_t(),{BINARY_TYPES:sg,EMPTY_BUFFER:ll,kStatusCode:ug,kWebSocket:cg}=ke(),{concat:Lo,toArrayBuffer:lg,unmask:pg}=Xt(),{isValidStatusCode:dg,isValidUTF8:pl}=xt(),Zr=Buffer[Symbol.species],fe=0,dl=1,fl=2,ml=3,jo=4,Bo=5,qr=6,Fo=class extends ag{static{i(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||sg[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[cg]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=fe}_write(t,r,n){if(this._opcode===8&&this._state==fe)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Zr(n.buffer,n.byteOffset+t,n.length-t),new Zr(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],o=r.length-t;t>=n.length?r.set(this._buffers.shift(),o):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),o),this._buffers[0]=new Zr(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case fe:this.getInfo(t);break;case dl:this.getPayloadLength16(t);break;case fl:this.getPayloadLength64(t);break;case ml:this.getMask();break;case jo:this.getData(t);break;case Bo:case qr:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let n=(r[0]&64)===64;if(n&&!this._extensions[cl.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(n){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=dl:this._payloadLength===127?this._state=fl:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=ml:this._state=jo}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=jo}getData(t){let r=ll;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&pg(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Bo,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[cl.extensionName].decompress(t,this._fin,(o,a)=>{if(o)return r(o);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}this._fragments.push(a)}this.dataMessage(r),this._state===fe&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=fe;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Lo(n,r):this._binaryType==="arraybuffer"?o=lg(Lo(n,r)):this._binaryType==="blob"?o=new Blob(n):o=n,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=fe):(this._state=qr,setImmediate(()=>{this.emit("message",o,!0),this._state=fe,this.startLoop(t)}))}else{let o=Lo(n,r);if(!this._skipUTF8Validation&&!pl(o)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===Bo||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=fe):(this._state=qr,setImmediate(()=>{this.emit("message",o,!1),this._state=fe,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,ll),this.end();else{let n=t.readUInt16BE(0);if(!dg(n)){let a=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(a);return}let o=new Zr(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!pl(o)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(a);return}this._loop=!1,this.emit("conclude",n,o),this.end()}this._state=fe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=fe):(this._state=qr,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=fe,this.startLoop(r)}))}createError(t,r,n,o,a){this._loop=!1,this._errored=!0;let u=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=a,u[ug]=o,u}};hl.exports=Fo});var Wo=S((gD,vl)=>{"use strict";var{Duplex:hD}=require("stream"),{randomFillSync:fg}=require("crypto"),gl=_t(),{EMPTY_BUFFER:mg,kWebSocket:hg,NOOP:gg}=ke(),{isBlob:bt,isValidStatusCode:yg}=xt(),{mask:yl,toBuffer:Xe}=Xt(),me=Symbol("kByteLength"),vg=Buffer.alloc(4),Wr=8*1024,Ye,Pt=Wr,_e=0,_g=1,xg=2,Zo=class e{static{i(this,"Sender")}constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=_e,this.onerror=gg,this[hg]=void 0}static frame(t,r){let n,o=!1,a=2,u=!1;r.mask&&(n=r.maskBuffer||vg,r.generateMask?r.generateMask(n):(Pt===Wr&&(Ye===void 0&&(Ye=Buffer.alloc(Wr)),fg(Ye,0,Wr),Pt=0),n[0]=Ye[Pt++],n[1]=Ye[Pt++],n[2]=Ye[Pt++],n[3]=Ye[Pt++]),u=(n[0]|n[1]|n[2]|n[3])===0,a=6);let l;typeof t=="string"?(!r.mask||u)&&r[me]!==void 0?l=r[me]:(t=Buffer.from(t),l=t.length):(l=t.length,o=r.mask&&r.readOnly&&!u);let f=l;l>=65536?(a+=8,f=127):l>125&&(a+=2,f=126);let d=Buffer.allocUnsafe(o?l+a:a);return d[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(d[0]|=64),d[1]=f,f===126?d.writeUInt16BE(l,2):f===127&&(d[2]=d[3]=0,d.writeUIntBE(l,4,6)),r.mask?(d[1]|=128,d[a-4]=n[0],d[a-3]=n[1],d[a-2]=n[2],d[a-1]=n[3],u?[d,t]:o?(yl(t,n,d,a,l),[d]):(yl(t,n,t,0,l),[d,t])):[d,t]}close(t,r,n,o){let a;if(t===void 0)a=mg;else{if(typeof t!="number"||!yg(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");a=Buffer.allocUnsafe(2+l),a.writeUInt16BE(t,0),typeof r=="string"?a.write(r,2):a.set(r,2)}}let u={[me]:a.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==_e?this.enqueue([this.dispatch,a,!1,u,o]):this.sendFrame(e.frame(a,u),o)}ping(t,r,n){let o,a;if(typeof t=="string"?(o=Buffer.byteLength(t),a=!1):bt(t)?(o=t.size,a=!1):(t=Xe(t),o=t.length,a=Xe.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[me]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};bt(t)?this._state!==_e?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==_e?this.enqueue([this.dispatch,t,!1,u,n]):this.sendFrame(e.frame(t,u),n)}pong(t,r,n){let o,a;if(typeof t=="string"?(o=Buffer.byteLength(t),a=!1):bt(t)?(o=t.size,a=!1):(t=Xe(t),o=t.length,a=Xe.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[me]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};bt(t)?this._state!==_e?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==_e?this.enqueue([this.dispatch,t,!1,u,n]):this.sendFrame(e.frame(t,u),n)}send(t,r,n){let o=this._extensions[gl.extensionName],a=r.binary?2:1,u=r.compress,l,f;typeof t=="string"?(l=Buffer.byteLength(t),f=!1):bt(t)?(l=t.size,f=!1):(t=Xe(t),l=t.length,f=Xe.readOnly),this._firstFragment?(this._firstFragment=!1,u&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=l>=o._threshold),this._compress=u):(u=!1,a=0),r.fin&&(this._firstFragment=!0);let d={[me]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:f,rsv1:u};bt(t)?this._state!==_e?this.enqueue([this.getBlobData,t,this._compress,d,n]):this.getBlobData(t,this._compress,d,n):this._state!==_e?this.enqueue([this.dispatch,t,this._compress,d,n]):this.dispatch(t,this._compress,d,n)}getBlobData(t,r,n,o){this._bufferedBytes+=n[me],this._state=xg,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(qo,this,l,o);return}this._bufferedBytes-=n[me];let u=Xe(a);r?this.dispatch(u,r,n,o):(this._state=_e,this.sendFrame(e.frame(u,n),o),this.dequeue())}).catch(a=>{process.nextTick(bg,this,a,o)})}dispatch(t,r,n,o){if(!r){this.sendFrame(e.frame(t,n),o);return}let a=this._extensions[gl.extensionName];this._bufferedBytes+=n[me],this._state=_g,a.compress(t,n.fin,(u,l)=>{if(this._socket.destroyed){let f=new Error("The socket was closed while data was being compressed");qo(this,f,o);return}this._bufferedBytes-=n[me],this._state=_e,n.readOnly=!1,this.sendFrame(e.frame(l,n),o),this.dequeue()})}dequeue(){for(;this._state===_e&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][me],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][me],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};vl.exports=Zo;function qo(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let o=e._queue[n],a=o[o.length-1];typeof a=="function"&&a(t)}}i(qo,"callCallbacks");function bg(e,t,r){qo(e,t,r),e.onerror(t)}i(bg,"onError")});var Al=S((vD,Il)=>{"use strict";var{kForOnEventAttribute:Qt,kListener:Ho}=ke(),_l=Symbol("kCode"),xl=Symbol("kData"),bl=Symbol("kError"),Pl=Symbol("kMessage"),Tl=Symbol("kReason"),Tt=Symbol("kTarget"),Sl=Symbol("kType"),El=Symbol("kWasClean"),Ne=class{static{i(this,"Event")}constructor(t){this[Tt]=null,this[Sl]=t}get target(){return this[Tt]}get type(){return this[Sl]}};Object.defineProperty(Ne.prototype,"target",{enumerable:!0});Object.defineProperty(Ne.prototype,"type",{enumerable:!0});var Qe=class extends Ne{static{i(this,"CloseEvent")}constructor(t,r={}){super(t),this[_l]=r.code===void 0?0:r.code,this[Tl]=r.reason===void 0?"":r.reason,this[El]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[_l]}get reason(){return this[Tl]}get wasClean(){return this[El]}};Object.defineProperty(Qe.prototype,"code",{enumerable:!0});Object.defineProperty(Qe.prototype,"reason",{enumerable:!0});Object.defineProperty(Qe.prototype,"wasClean",{enumerable:!0});var St=class extends Ne{static{i(this,"ErrorEvent")}constructor(t,r={}){super(t),this[bl]=r.error===void 0?null:r.error,this[Pl]=r.message===void 0?"":r.message}get error(){return this[bl]}get message(){return this[Pl]}};Object.defineProperty(St.prototype,"error",{enumerable:!0});Object.defineProperty(St.prototype,"message",{enumerable:!0});var er=class extends Ne{static{i(this,"MessageEvent")}constructor(t,r={}){super(t),this[xl]=r.data===void 0?null:r.data}get data(){return this[xl]}};Object.defineProperty(er.prototype,"data",{enumerable:!0});var Pg={addEventListener(e,t,r={}){for(let o of this.listeners(e))if(!r[Qt]&&o[Ho]===t&&!o[Qt])return;let n;if(e==="message")n=i(function(a,u){let l=new er("message",{data:u?a:a.toString()});l[Tt]=this,Hr(t,this,l)},"onMessage");else if(e==="close")n=i(function(a,u){let l=new Qe("close",{code:a,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[Tt]=this,Hr(t,this,l)},"onClose");else if(e==="error")n=i(function(a){let u=new St("error",{error:a,message:a.message});u[Tt]=this,Hr(t,this,u)},"onError");else if(e==="open")n=i(function(){let a=new Ne("open");a[Tt]=this,Hr(t,this,a)},"onOpen");else return;n[Qt]=!!r[Qt],n[Ho]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Ho]===t&&!r[Qt]){this.removeListener(e,r);break}}};Il.exports={CloseEvent:Qe,ErrorEvent:St,Event:Ne,EventTarget:Pg,MessageEvent:er};function Hr(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}i(Hr,"callListener")});var Gr=S((xD,$l)=>{"use strict";var{tokenChars:tr}=xt();function Te(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Te,"push");function Tg(e){let t=Object.create(null),r=Object.create(null),n=!1,o=!1,a=!1,u,l,f=-1,d=-1,y=-1,b=0;for(;b<e.length;b++)if(d=e.charCodeAt(b),u===void 0)if(y===-1&&tr[d]===1)f===-1&&(f=b);else if(b!==0&&(d===32||d===9))y===-1&&f!==-1&&(y=b);else if(d===59||d===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b);let c=e.slice(f,y);d===44?(Te(t,c,r),r=Object.create(null)):u=c,f=y=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);else if(l===void 0)if(y===-1&&tr[d]===1)f===-1&&(f=b);else if(d===32||d===9)y===-1&&f!==-1&&(y=b);else if(d===59||d===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b),Te(r,e.slice(f,y),!0),d===44&&(Te(t,u,r),r=Object.create(null),u=void 0),f=y=-1}else if(d===61&&f!==-1&&y===-1)l=e.slice(f,b),f=y=-1;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(o){if(tr[d]!==1)throw new SyntaxError(`Unexpected character at index ${b}`);f===-1?f=b:n||(n=!0),o=!1}else if(a)if(tr[d]===1)f===-1&&(f=b);else if(d===34&&f!==-1)a=!1,y=b;else if(d===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(d===34&&e.charCodeAt(b-1)===61)a=!0;else if(y===-1&&tr[d]===1)f===-1&&(f=b);else if(f!==-1&&(d===32||d===9))y===-1&&(y=b);else if(d===59||d===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b);let c=e.slice(f,y);n&&(c=c.replace(/\\/g,""),n=!1),Te(r,l,c),d===44&&(Te(t,u,r),r=Object.create(null),u=void 0),l=void 0,f=y=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);if(f===-1||a||d===32||d===9)throw new SyntaxError("Unexpected end of input");y===-1&&(y=b);let v=e.slice(f,y);return u===void 0?Te(t,v,r):(l===void 0?Te(r,v,!0):n?Te(r,l,v.replace(/\\/g,"")):Te(r,l,v),Te(t,u,r)),t}i(Tg,"parse");function Sg(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(o=>{let a=n[o];return Array.isArray(a)||(a=[a]),a.map(u=>u===!0?o:`${o}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}i(Sg,"format");$l.exports={format:Sg,parse:Tg}});var Yr=S((SD,jl)=>{"use strict";var Eg=require("events"),Ig=require("https"),Ag=require("http"),kl=require("net"),$g=require("tls"),{randomBytes:wg,createHash:zg}=require("crypto"),{Duplex:PD,Readable:TD}=require("stream"),{URL:Go}=require("url"),qe=_t(),kg=Vo(),Og=Wo(),{isBlob:Rg}=xt(),{BINARY_TYPES:wl,CLOSE_TIMEOUT:Ng,EMPTY_BUFFER:Jr,GUID:Dg,kForOnEventAttribute:Jo,kListener:Cg,kStatusCode:Ug,kWebSocket:ne,NOOP:Ol}=ke(),{EventTarget:{addEventListener:Mg,removeEventListener:Lg}}=Al(),{format:jg,parse:Bg}=Gr(),{toBuffer:Fg}=Xt(),Rl=Symbol("kAborted"),Ko=[8,13],De=["CONNECTING","OPEN","CLOSING","CLOSED"],Vg=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,W=class e extends Eg{static{i(this,"WebSocket")}constructor(t,r,n){super(),this._binaryType=wl[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Jr,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),Nl(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){wl.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let o=new kg({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),a=new Og(t,this._extensions,n.generateMask);this._receiver=o,this._sender=a,this._socket=t,o[ne]=this,a[ne]=this,t[ne]=this,o.on("conclude",Wg),o.on("drain",Hg),o.on("error",Gg),o.on("message",Jg),o.on("ping",Kg),o.on("pong",Xg),a.onerror=Yg,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Ul),t.on("data",Xr),t.on("end",Ml),t.on("error",Ll),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[qe.extensionName]&&this._extensions[qe.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){le(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Cl(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xo(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Jr,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xo(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Jr,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Xo(this,t,n);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[qe.extensionName]||(o.compress=!1),this._sender.send(t||Jr,o,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){le(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(W,"CONNECTING",{enumerable:!0,value:De.indexOf("CONNECTING")});Object.defineProperty(W.prototype,"CONNECTING",{enumerable:!0,value:De.indexOf("CONNECTING")});Object.defineProperty(W,"OPEN",{enumerable:!0,value:De.indexOf("OPEN")});Object.defineProperty(W.prototype,"OPEN",{enumerable:!0,value:De.indexOf("OPEN")});Object.defineProperty(W,"CLOSING",{enumerable:!0,value:De.indexOf("CLOSING")});Object.defineProperty(W.prototype,"CLOSING",{enumerable:!0,value:De.indexOf("CLOSING")});Object.defineProperty(W,"CLOSED",{enumerable:!0,value:De.indexOf("CLOSED")});Object.defineProperty(W.prototype,"CLOSED",{enumerable:!0,value:De.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(W.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(W.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[Jo])return t[Cg];return null},set(t){for(let r of this.listeners(e))if(r[Jo]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[Jo]:!0})}})});W.prototype.addEventListener=Mg;W.prototype.removeEventListener=Lg;jl.exports=W;function Nl(e,t,r,n){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Ng,protocolVersion:Ko[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!Ko.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Ko.join(", ")})`);let a;if(t instanceof Go)a=t;else try{a=new Go(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),e._url=a.href;let u=a.protocol==="wss:",l=a.protocol==="ws+unix:",f;if(a.protocol!=="ws:"&&!u&&!l?f=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!a.pathname?f="The URL's pathname is empty":a.hash&&(f="The URL contains a fragment identifier"),f){let g=new SyntaxError(f);if(e._redirects===0)throw g;Kr(e,g);return}let d=u?443:80,y=wg(16).toString("base64"),b=u?Ig.request:Ag.request,v=new Set,c;if(o.createConnection=o.createConnection||(u?qg:Zg),o.defaultPort=o.defaultPort||d,o.port=a.port||d,o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":y,Connection:"Upgrade",Upgrade:"websocket"},o.path=a.pathname+a.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(c=new qe({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=jg({[qe.extensionName]:c.offer()})),r.length){for(let g of r){if(typeof g!="string"||!Vg.test(g)||v.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");v.add(g)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(a.username||a.password)&&(o.auth=`${a.username}:${a.password}`),l){let g=o.path.split(":");o.socketPath=g[0],o.path=g[1]}let p;if(o.followRedirects){if(e._redirects===0){e._originalIpc=l,e._originalSecure=u,e._originalHostOrSocketPath=l?o.socketPath:a.host;let g=n&&n.headers;if(n={...n,headers:{}},g)for(let[h,x]of Object.entries(g))n.headers[h.toLowerCase()]=x}else if(e.listenerCount("redirect")===0){let g=l?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:a.host===e._originalHostOrSocketPath;(!g||e._originalSecure&&!u)&&(delete o.headers.authorization,delete o.headers.cookie,g||delete o.headers.host,o.auth=void 0)}o.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),p=e._req=b(o),e._redirects&&e.emit("redirect",e.url,p)}else p=e._req=b(o);o.timeout&&p.on("timeout",()=>{le(e,p,"Opening handshake has timed out")}),p.on("error",g=>{p===null||p[Rl]||(p=e._req=null,Kr(e,g))}),p.on("response",g=>{let h=g.headers.location,x=g.statusCode;if(h&&o.followRedirects&&x>=300&&x<400){if(++e._redirects>o.maxRedirects){le(e,p,"Maximum redirects exceeded");return}p.abort();let T;try{T=new Go(h,t)}catch{let Y=new SyntaxError(`Invalid URL: ${h}`);Kr(e,Y);return}Nl(e,T,r,n)}else e.emit("unexpected-response",p,g)||le(e,p,`Unexpected server response: ${g.statusCode}`)}),p.on("upgrade",(g,h,x)=>{if(e.emit("upgrade",g),e.readyState!==W.CONNECTING)return;p=e._req=null;let T=g.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){le(e,h,"Invalid Upgrade header");return}let M=zg("sha1").update(y+Dg).digest("base64");if(g.headers["sec-websocket-accept"]!==M){le(e,h,"Invalid Sec-WebSocket-Accept header");return}let Y=g.headers["sec-websocket-protocol"],oe;if(Y!==void 0?v.size?v.has(Y)||(oe="Server sent an invalid subprotocol"):oe="Server sent a subprotocol but none was requested":v.size&&(oe="Server sent no subprotocol"),oe){le(e,h,oe);return}Y&&(e._protocol=Y);let Ce=g.headers["sec-websocket-extensions"];if(Ce!==void 0){if(!c){le(e,h,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let ge;try{ge=Bg(Ce)}catch{le(e,h,"Invalid Sec-WebSocket-Extensions header");return}let pe=Object.keys(ge);if(pe.length!==1||pe[0]!==qe.extensionName){le(e,h,"Server indicated an extension that was not requested");return}try{c.accept(ge[qe.extensionName])}catch{le(e,h,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[qe.extensionName]=c}e.setSocket(h,x,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(p,e):p.end()}i(Nl,"initAsClient");function Kr(e,t){e._readyState=W.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}i(Kr,"emitErrorAndClose");function Zg(e){return e.path=e.socketPath,kl.connect(e)}i(Zg,"netConnect");function qg(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=kl.isIP(e.host)?"":e.host),$g.connect(e)}i(qg,"tlsConnect");function le(e,t,r){e._readyState=W.CLOSING;let n=new Error(r);Error.captureStackTrace(n,le),t.setHeader?(t[Rl]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Kr,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}i(le,"abortHandshake");function Xo(e,t,r){if(t){let n=Rg(t)?t.size:Fg(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${De[e.readyState]})`);process.nextTick(r,n)}}i(Xo,"sendAfterClose");function Wg(e,t){let r=this[ne];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[ne]!==void 0&&(r._socket.removeListener("data",Xr),process.nextTick(Dl,r._socket),e===1005?r.close():r.close(e,t))}i(Wg,"receiverOnConclude");function Hg(){let e=this[ne];e.isPaused||e._socket.resume()}i(Hg,"receiverOnDrain");function Gg(e){let t=this[ne];t._socket[ne]!==void 0&&(t._socket.removeListener("data",Xr),process.nextTick(Dl,t._socket),t.close(e[Ug])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}i(Gg,"receiverOnError");function zl(){this[ne].emitClose()}i(zl,"receiverOnFinish");function Jg(e,t){this[ne].emit("message",e,t)}i(Jg,"receiverOnMessage");function Kg(e){let t=this[ne];t._autoPong&&t.pong(e,!this._isServer,Ol),t.emit("ping",e)}i(Kg,"receiverOnPing");function Xg(e){this[ne].emit("pong",e)}i(Xg,"receiverOnPong");function Dl(e){e.resume()}i(Dl,"resume");function Yg(e){let t=this[ne];t.readyState!==W.CLOSED&&(t.readyState===W.OPEN&&(t._readyState=W.CLOSING,Cl(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}i(Yg,"senderOnError");function Cl(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}i(Cl,"setCloseTimer");function Ul(){let e=this[ne];if(this.removeListener("close",Ul),this.removeListener("data",Xr),this.removeListener("end",Ml),e._readyState=W.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[ne]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",zl),e._receiver.on("finish",zl))}i(Ul,"socketOnClose");function Xr(e){this[ne]._receiver.write(e)||this.pause()}i(Xr,"socketOnData");function Ml(){let e=this[ne];e._readyState=W.CLOSING,e._receiver.end(),this.end()}i(Ml,"socketOnEnd");function Ll(){let e=this[ne];this.removeListener("error",Ll),this.on("error",Ol),e&&(e._readyState=W.CLOSING,this.destroy())}i(Ll,"socketOnError")});var Zl=S((AD,Vl)=>{"use strict";var ID=Yr(),{Duplex:Qg}=require("stream");function Bl(e){e.emit("close")}i(Bl,"emitClose");function ey(){!this.destroyed&&this._writableState.finished&&this.destroy()}i(ey,"duplexOnEnd");function Fl(e){this.removeListener("error",Fl),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}i(Fl,"duplexOnError");function ty(e,t){let r=!0,n=new Qg({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",i(function(a,u){let l=!u&&n._readableState.objectMode?a.toString():a;n.push(l)||e.pause()},"message")),e.once("error",i(function(a){n.destroyed||(r=!1,n.destroy(a))},"error")),e.once("close",i(function(){n.destroyed||n.push(null)},"close")),n._destroy=function(o,a){if(e.readyState===e.CLOSED){a(o),process.nextTick(Bl,n);return}let u=!1;e.once("error",i(function(f){u=!0,a(f)},"error")),e.once("close",i(function(){u||a(o),process.nextTick(Bl,n)},"close")),r&&e.terminate()},n._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",i(function(){n._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",i(function(){o()},"finish")),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(o,a,u){if(e.readyState===e.CONNECTING){e.once("open",i(function(){n._write(o,a,u)},"open"));return}e.send(o,u)},n.on("end",ey),n.on("error",Fl),n}i(ty,"createWebSocketStream");Vl.exports=ty});var Yo=S((wD,ql)=>{"use strict";var{tokenChars:ry}=xt();function ny(e){let t=new Set,r=-1,n=-1,o=0;for(o;o<e.length;o++){let u=e.charCodeAt(o);if(n===-1&&ry[u]===1)r===-1&&(r=o);else if(o!==0&&(u===32||u===9))n===-1&&r!==-1&&(n=o);else if(u===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${o}`);n===-1&&(n=o);let l=e.slice(r,n);if(t.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);t.add(l),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);return t.add(a),t}i(ny,"parse");ql.exports={parse:ny}});var Yl=S((OD,Xl)=>{"use strict";var oy=require("events"),Qr=require("http"),{Duplex:kD}=require("stream"),{createHash:iy}=require("crypto"),Wl=Gr(),et=_t(),ay=Yo(),sy=Yr(),{CLOSE_TIMEOUT:uy,GUID:cy,kWebSocket:ly}=ke(),py=/^[+/0-9A-Za-z]{22}==$/,Hl=0,Gl=1,Kl=2,Qo=class extends oy{static{i(this,"WebSocketServer")}constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:uy,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:sy,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Qr.createServer((n,o)=>{let a=Qr.STATUS_CODES[426];o.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),o.end(a)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=dy(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:i((o,a,u)=>{this.handleUpgrade(o,a,u,n)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=Hl}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===Kl){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(rr,this);return}if(t&&this.once("close",t),this._state!==Gl)if(this._state=Gl,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(rr,this):process.nextTick(rr,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{rr(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,o){r.on("error",Jl);let a=t.headers["sec-websocket-key"],u=t.headers.upgrade,l=+t.headers["sec-websocket-version"];if(t.method!=="GET"){tt(this,t,r,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){tt(this,t,r,400,"Invalid Upgrade header");return}if(a===void 0||!py.test(a)){tt(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==13&&l!==8){tt(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){nr(r,400);return}let f=t.headers["sec-websocket-protocol"],d=new Set;if(f!==void 0)try{d=ay.parse(f)}catch{tt(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let y=t.headers["sec-websocket-extensions"],b={};if(this.options.perMessageDeflate&&y!==void 0){let v=new et({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let c=Wl.parse(y);c[et.extensionName]&&(v.accept(c[et.extensionName]),b[et.extensionName]=v)}catch{tt(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let v={origin:t.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(v,(c,p,g,h)=>{if(!c)return nr(r,p||401,g,h);this.completeUpgrade(b,a,d,t,r,n,o)});return}if(!this.options.verifyClient(v))return nr(r,401)}this.completeUpgrade(b,a,d,t,r,n,o)}completeUpgrade(t,r,n,o,a,u,l){if(!a.readable||!a.writable)return a.destroy();if(a[ly])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Hl)return nr(a,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${iy("sha1").update(r+cy).digest("base64")}`],y=new this.options.WebSocket(null,void 0,this.options);if(n.size){let b=this.options.handleProtocols?this.options.handleProtocols(n,o):n.values().next().value;b&&(d.push(`Sec-WebSocket-Protocol: ${b}`),y._protocol=b)}if(t[et.extensionName]){let b=t[et.extensionName].params,v=Wl.format({[et.extensionName]:[b]});d.push(`Sec-WebSocket-Extensions: ${v}`),y._extensions=t}this.emit("headers",d,o),a.write(d.concat(`\r
|
|
4
|
+
`);function l(f){var h=Co(Ne.join(f,"prebuilds")).map(ll),v=h.filter(pl(No,Ro)).sort(dl)[0];if(v){var b=Ne.join(f,"prebuilds",v.name),_=Co(b).map(fl),c=_.filter(ml(Oo,rl)),p=c.sort(hl(Oo))[0];if(p)return Ne.join(b,p.file)}}};function Co(e){try{return il.readdirSync(e)}catch{return[]}}i(Co,"readdirSync");function nl(e,t){var r=Co(e).filter(t);return r[0]&&Ne.join(e,r[0])}i(nl,"getFirst");function ol(e){return/\.node$/.test(e)}i(ol,"matchBuild");function ll(e){var t=e.split("-");if(t.length===2){var r=t[0],n=t[1].split("+");if(r&&n.length&&n.every(Boolean))return{name:e,platform:r,architectures:n}}}i(ll,"parseTuple");function pl(e,t){return function(r){return r==null||r.platform!==e?!1:r.architectures.includes(t)}}i(pl,"matchTuple");function dl(e,t){return e.architectures.length-t.architectures.length}i(dl,"compareTuples");function fl(e){var t=e.split("."),r=t.pop(),n={file:e,specificity:0};if(r==="node"){for(var o=0;o<t.length;o++){var a=t[o];if(a==="node"||a==="electron"||a==="node-webkit")n.runtime=a;else if(a==="napi")n.napi=!0;else if(a.slice(0,3)==="abi")n.abi=a.slice(3);else if(a.slice(0,2)==="uv")n.uv=a.slice(2);else if(a.slice(0,4)==="armv")n.armv=a.slice(4);else if(a==="glibc"||a==="musl")n.libc=a;else continue;n.specificity++}return n}}i(fl,"parseTags");function ml(e,t){return function(r){return!(r==null||r.runtime&&r.runtime!==e&&!xg(r)||r.abi&&r.abi!==t&&!r.napi||r.uv&&r.uv!==cl||r.armv&&r.armv!==Do||r.libc&&r.libc!==ul)}}i(ml,"matchTags");function xg(e){return e.runtime==="node"&&e.napi}i(xg,"runtimeAgnostic");function hl(e){return function(t,r){return t.runtime!==r.runtime?t.runtime===e?-1:1:t.abi!==r.abi?t.abi?-1:1:t.specificity!==r.specificity?t.specificity>r.specificity?-1:1:0}}i(hl,"compareTags");function bg(){return!!(process.versions&&process.versions.nw)}i(bg,"isNwjs");function Pg(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}i(Pg,"isElectron");function Tg(e){return e==="linux"&&il.existsSync("/etc/alpine-release")}i(Tg,"isAlpine");Se.parseTags=fl;Se.matchTags=ml;Se.compareTags=hl;Se.parseTuple=ll;Se.matchTuple=pl;Se.compareTuples=dl});var vl=E((YD,Mo)=>{var Uo=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Uo.addon=="function"?Mo.exports=Uo.addon.bind(Uo):Mo.exports=yl()});var xl=E((QD,_l)=>{"use strict";var Eg=i((e,t,r,n,o)=>{for(var a=0;a<o;a++)r[n+a]=e[a]^t[a&3]},"mask"),Sg=i((e,t)=>{let r=e.length;for(var n=0;n<r;n++)e[n]^=t[n&3]},"unmask");_l.exports={mask:Eg,unmask:Sg}});var bl=E((tC,Lo)=>{"use strict";try{Lo.exports=vl()(__dirname)}catch{Lo.exports=xl()}});var Qt=E((rC,Zr)=>{"use strict";var{EMPTY_BUFFER:Ig}=Re(),jo=Buffer[Symbol.species];function Ag(e,t){if(e.length===0)return Ig;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let o=0;o<e.length;o++){let a=e[o];r.set(a,n),n+=a.length}return n<t?new jo(r.buffer,r.byteOffset,n):r}i(Ag,"concat");function Pl(e,t,r,n,o){for(let a=0;a<o;a++)r[n+a]=e[a]^t[a&3]}i(Pl,"_mask");function Tl(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}i(Tl,"_unmask");function $g(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}i($g,"toArrayBuffer");function Bo(e){if(Bo.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new jo(e):ArrayBuffer.isView(e)?t=new jo(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Bo.readOnly=!1),t}i(Bo,"toBuffer");Zr.exports={concat:Ag,mask:Pl,toArrayBuffer:$g,toBuffer:Bo,unmask:Tl};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=bl();Zr.exports.mask=function(t,r,n,o,a){a<48?Pl(t,r,n,o,a):e.mask(t,r,n,o,a)},Zr.exports.unmask=function(t,r){t.length<32?Tl(t,r):e.unmask(t,r)}}catch{}});var Il=E((oC,Sl)=>{"use strict";var El=Symbol("kDone"),Fo=Symbol("kRun"),Vo=class{static{i(this,"Limiter")}constructor(t){this[El]=()=>{this.pending--,this[Fo]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Fo]()}[Fo](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[El])}}};Sl.exports=Vo});var xt=E((aC,wl)=>{"use strict";var er=require("zlib"),Al=Qt(),zg=Il(),{kStatusCode:$l}=Re(),wg=Buffer[Symbol.species],kg=Buffer.from([0,0,255,255]),Hr=Symbol("permessage-deflate"),De=Symbol("total-length"),vt=Symbol("callback"),Ge=Symbol("buffers"),_t=Symbol("error"),qr,Zo=class{static{i(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!qr){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;qr=new zg(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[vt];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(o=>!(r.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>o.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let o=r[n];if(o.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(o=o[0],n==="client_max_window_bits"){if(o!==!0){let a=+o;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${n}": ${o}`);o=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${o}`)}else if(n==="server_max_window_bits"){let a=+o;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${n}": ${o}`);o=a}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${o}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=o})}),t}decompress(t,r,n){qr.add(o=>{this._decompress(t,r,(a,u)=>{o(),n(a,u)})})}compress(t,r,n){qr.add(o=>{this._compress(t,r,(a,u)=>{o(),n(a,u)})})}_decompress(t,r,n){let o=this._isServer?"client":"server";if(!this._inflate){let a=`${o}_max_window_bits`,u=typeof this.params[a]!="number"?er.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=er.createInflateRaw({...this._options.zlibInflateOptions,windowBits:u}),this._inflate[Hr]=this,this._inflate[De]=0,this._inflate[Ge]=[],this._inflate.on("error",Rg),this._inflate.on("data",zl)}this._inflate[vt]=n,this._inflate.write(t),r&&this._inflate.write(kg),this._inflate.flush(()=>{let a=this._inflate[_t];if(a){this._inflate.close(),this._inflate=null,n(a);return}let u=Al.concat(this._inflate[Ge],this._inflate[De]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[De]=0,this._inflate[Ge]=[],r&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),n(null,u)})}_compress(t,r,n){let o=this._isServer?"server":"client";if(!this._deflate){let a=`${o}_max_window_bits`,u=typeof this.params[a]!="number"?er.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=er.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[De]=0,this._deflate[Ge]=[],this._deflate.on("data",Og)}this._deflate[vt]=n,this._deflate.write(t),this._deflate.flush(er.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=Al.concat(this._deflate[Ge],this._deflate[De]);r&&(a=new wg(a.buffer,a.byteOffset,a.length-4)),this._deflate[vt]=null,this._deflate[De]=0,this._deflate[Ge]=[],r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),n(null,a)})}};wl.exports=Zo;function Og(e){this[Ge].push(e),this[De]+=e.length}i(Og,"deflateOnData");function zl(e){if(this[De]+=e.length,this[Hr]._maxPayload<1||this[De]<=this[Hr]._maxPayload){this[Ge].push(e);return}this[_t]=new RangeError("Max payload size exceeded"),this[_t].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[_t][$l]=1009,this.removeListener("data",zl),this.reset()}i(zl,"inflateOnData");function Rg(e){if(this[Hr]._inflate=null,this[_t]){this[vt](this[_t]);return}e[$l]=1007,this[vt](e)}i(Rg,"inflateOnError")});var bt=E((uC,Wr)=>{"use strict";var{isUtf8:kl}=require("buffer"),{hasBlob:Ng}=Re(),Dg=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Cg(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}i(Cg,"isValidStatusCode");function qo(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}i(qo,"_isValidUTF8");function Ug(e){return Ng&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}i(Ug,"isBlob");Wr.exports={isBlob:Ug,isValidStatusCode:Cg,isValidUTF8:qo,tokenChars:Dg};if(kl)Wr.exports.isValidUTF8=function(e){return e.length<24?qo(e):kl(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");Wr.exports.isValidUTF8=function(t){return t.length<32?qo(t):e(t)}}catch{}});var Jo=E((lC,Ml)=>{"use strict";var{Writable:Mg}=require("stream"),Ol=xt(),{BINARY_TYPES:Lg,EMPTY_BUFFER:Rl,kStatusCode:jg,kWebSocket:Bg}=Re(),{concat:Ho,toArrayBuffer:Fg,unmask:Vg}=Qt(),{isValidStatusCode:Zg,isValidUTF8:Nl}=bt(),Gr=Buffer[Symbol.species],fe=0,Dl=1,Cl=2,Ul=3,Wo=4,Go=5,Kr=6,Ko=class extends Mg{static{i(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||Lg[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[Bg]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=fe}_write(t,r,n){if(this._opcode===8&&this._state==fe)return n();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new Gr(n.buffer,n.byteOffset+t,n.length-t),new Gr(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],o=r.length-t;t>=n.length?r.set(this._buffers.shift(),o):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),o),this._buffers[0]=new Gr(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case fe:this.getInfo(t);break;case Dl:this.getPayloadLength16(t);break;case Cl:this.getPayloadLength64(t);break;case Ul:this.getMask();break;case Wo:this.getData(t);break;case Go:case Kr:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let n=(r[0]&64)===64;if(n&&!this._extensions[Ol.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(n){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=Dl:this._payloadLength===127?this._state=Cl:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=Ul:this._state=Wo}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Wo}getData(t){let r=Rl;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Vg(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Go,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Ol.extensionName].decompress(t,this._fin,(o,a)=>{if(o)return r(o);if(a.length){if(this._messageLength+=a.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let u=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(u);return}this._fragments.push(a)}this.dataMessage(r),this._state===fe&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=fe;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=Ho(n,r):this._binaryType==="arraybuffer"?o=Fg(Ho(n,r)):this._binaryType==="blob"?o=new Blob(n):o=n,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=fe):(this._state=Kr,setImmediate(()=>{this.emit("message",o,!0),this._state=fe,this.startLoop(t)}))}else{let o=Ho(n,r);if(!this._skipUTF8Validation&&!Nl(o)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===Go||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=fe):(this._state=Kr,setImmediate(()=>{this.emit("message",o,!1),this._state=fe,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,Rl),this.end();else{let n=t.readUInt16BE(0);if(!Zg(n)){let a=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(a);return}let o=new Gr(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Nl(o)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(a);return}this._loop=!1,this.emit("conclude",n,o),this.end()}this._state=fe;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=fe):(this._state=Kr,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=fe,this.startLoop(r)}))}createError(t,r,n,o,a){this._loop=!1,this._errored=!0;let u=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,this.createError),u.code=a,u[jg]=o,u}};Ml.exports=Ko});var Qo=E((fC,Bl)=>{"use strict";var{Duplex:dC}=require("stream"),{randomFillSync:qg}=require("crypto"),Ll=xt(),{EMPTY_BUFFER:Hg,kWebSocket:Wg,NOOP:Gg}=Re(),{isBlob:Pt,isValidStatusCode:Kg}=bt(),{mask:jl,toBuffer:et}=Qt(),me=Symbol("kByteLength"),Jg=Buffer.alloc(4),Jr=8*1024,tt,Tt=Jr,be=0,Xg=1,Yg=2,Xo=class e{static{i(this,"Sender")}constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=be,this.onerror=Gg,this[Wg]=void 0}static frame(t,r){let n,o=!1,a=2,u=!1;r.mask&&(n=r.maskBuffer||Jg,r.generateMask?r.generateMask(n):(Tt===Jr&&(tt===void 0&&(tt=Buffer.alloc(Jr)),qg(tt,0,Jr),Tt=0),n[0]=tt[Tt++],n[1]=tt[Tt++],n[2]=tt[Tt++],n[3]=tt[Tt++]),u=(n[0]|n[1]|n[2]|n[3])===0,a=6);let l;typeof t=="string"?(!r.mask||u)&&r[me]!==void 0?l=r[me]:(t=Buffer.from(t),l=t.length):(l=t.length,o=r.mask&&r.readOnly&&!u);let f=l;l>=65536?(a+=8,f=127):l>125&&(a+=2,f=126);let h=Buffer.allocUnsafe(o?l+a:a);return h[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(h[0]|=64),h[1]=f,f===126?h.writeUInt16BE(l,2):f===127&&(h[2]=h[3]=0,h.writeUIntBE(l,4,6)),r.mask?(h[1]|=128,h[a-4]=n[0],h[a-3]=n[1],h[a-2]=n[2],h[a-1]=n[3],u?[h,t]:o?(jl(t,n,h,a,l),[h]):(jl(t,n,t,0,l),[h,t])):[h,t]}close(t,r,n,o){let a;if(t===void 0)a=Hg;else{if(typeof t!="number"||!Kg(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)a=Buffer.allocUnsafe(2),a.writeUInt16BE(t,0);else{let l=Buffer.byteLength(r);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");a=Buffer.allocUnsafe(2+l),a.writeUInt16BE(t,0),typeof r=="string"?a.write(r,2):a.set(r,2)}}let u={[me]:a.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==be?this.enqueue([this.dispatch,a,!1,u,o]):this.sendFrame(e.frame(a,u),o)}ping(t,r,n){let o,a;if(typeof t=="string"?(o=Buffer.byteLength(t),a=!1):Pt(t)?(o=t.size,a=!1):(t=et(t),o=t.length,a=et.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[me]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};Pt(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==be?this.enqueue([this.dispatch,t,!1,u,n]):this.sendFrame(e.frame(t,u),n)}pong(t,r,n){let o,a;if(typeof t=="string"?(o=Buffer.byteLength(t),a=!1):Pt(t)?(o=t.size,a=!1):(t=et(t),o=t.length,a=et.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let u={[me]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};Pt(t)?this._state!==be?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==be?this.enqueue([this.dispatch,t,!1,u,n]):this.sendFrame(e.frame(t,u),n)}send(t,r,n){let o=this._extensions[Ll.extensionName],a=r.binary?2:1,u=r.compress,l,f;typeof t=="string"?(l=Buffer.byteLength(t),f=!1):Pt(t)?(l=t.size,f=!1):(t=et(t),l=t.length,f=et.readOnly),this._firstFragment?(this._firstFragment=!1,u&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=l>=o._threshold),this._compress=u):(u=!1,a=0),r.fin&&(this._firstFragment=!0);let h={[me]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:f,rsv1:u};Pt(t)?this._state!==be?this.enqueue([this.getBlobData,t,this._compress,h,n]):this.getBlobData(t,this._compress,h,n):this._state!==be?this.enqueue([this.dispatch,t,this._compress,h,n]):this.dispatch(t,this._compress,h,n)}getBlobData(t,r,n,o){this._bufferedBytes+=n[me],this._state=Yg,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Yo,this,l,o);return}this._bufferedBytes-=n[me];let u=et(a);r?this.dispatch(u,r,n,o):(this._state=be,this.sendFrame(e.frame(u,n),o),this.dequeue())}).catch(a=>{process.nextTick(Qg,this,a,o)})}dispatch(t,r,n,o){if(!r){this.sendFrame(e.frame(t,n),o);return}let a=this._extensions[Ll.extensionName];this._bufferedBytes+=n[me],this._state=Xg,a.compress(t,n.fin,(u,l)=>{if(this._socket.destroyed){let f=new Error("The socket was closed while data was being compressed");Yo(this,f,o);return}this._bufferedBytes-=n[me],this._state=be,n.readOnly=!1,this.sendFrame(e.frame(l,n),o),this.dequeue()})}dequeue(){for(;this._state===be&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][me],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][me],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};Bl.exports=Xo;function Yo(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let o=e._queue[n],a=o[o.length-1];typeof a=="function"&&a(t)}}i(Yo,"callCallbacks");function Qg(e,t,r){Yo(e,t,r),e.onerror(t)}i(Qg,"onError")});var Jl=E((hC,Kl)=>{"use strict";var{kForOnEventAttribute:tr,kListener:ei}=Re(),Fl=Symbol("kCode"),Vl=Symbol("kData"),Zl=Symbol("kError"),ql=Symbol("kMessage"),Hl=Symbol("kReason"),Et=Symbol("kTarget"),Wl=Symbol("kType"),Gl=Symbol("kWasClean"),Ce=class{static{i(this,"Event")}constructor(t){this[Et]=null,this[Wl]=t}get target(){return this[Et]}get type(){return this[Wl]}};Object.defineProperty(Ce.prototype,"target",{enumerable:!0});Object.defineProperty(Ce.prototype,"type",{enumerable:!0});var rt=class extends Ce{static{i(this,"CloseEvent")}constructor(t,r={}){super(t),this[Fl]=r.code===void 0?0:r.code,this[Hl]=r.reason===void 0?"":r.reason,this[Gl]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Fl]}get reason(){return this[Hl]}get wasClean(){return this[Gl]}};Object.defineProperty(rt.prototype,"code",{enumerable:!0});Object.defineProperty(rt.prototype,"reason",{enumerable:!0});Object.defineProperty(rt.prototype,"wasClean",{enumerable:!0});var St=class extends Ce{static{i(this,"ErrorEvent")}constructor(t,r={}){super(t),this[Zl]=r.error===void 0?null:r.error,this[ql]=r.message===void 0?"":r.message}get error(){return this[Zl]}get message(){return this[ql]}};Object.defineProperty(St.prototype,"error",{enumerable:!0});Object.defineProperty(St.prototype,"message",{enumerable:!0});var rr=class extends Ce{static{i(this,"MessageEvent")}constructor(t,r={}){super(t),this[Vl]=r.data===void 0?null:r.data}get data(){return this[Vl]}};Object.defineProperty(rr.prototype,"data",{enumerable:!0});var ey={addEventListener(e,t,r={}){for(let o of this.listeners(e))if(!r[tr]&&o[ei]===t&&!o[tr])return;let n;if(e==="message")n=i(function(a,u){let l=new rr("message",{data:u?a:a.toString()});l[Et]=this,Xr(t,this,l)},"onMessage");else if(e==="close")n=i(function(a,u){let l=new rt("close",{code:a,reason:u.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[Et]=this,Xr(t,this,l)},"onClose");else if(e==="error")n=i(function(a){let u=new St("error",{error:a,message:a.message});u[Et]=this,Xr(t,this,u)},"onError");else if(e==="open")n=i(function(){let a=new Ce("open");a[Et]=this,Xr(t,this,a)},"onOpen");else return;n[tr]=!!r[tr],n[ei]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[ei]===t&&!r[tr]){this.removeListener(e,r);break}}};Kl.exports={CloseEvent:rt,ErrorEvent:St,Event:Ce,EventTarget:ey,MessageEvent:rr};function Xr(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}i(Xr,"callListener")});var Yr=E((yC,Xl)=>{"use strict";var{tokenChars:nr}=bt();function Ie(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Ie,"push");function ty(e){let t=Object.create(null),r=Object.create(null),n=!1,o=!1,a=!1,u,l,f=-1,h=-1,v=-1,b=0;for(;b<e.length;b++)if(h=e.charCodeAt(b),u===void 0)if(v===-1&&nr[h]===1)f===-1&&(f=b);else if(b!==0&&(h===32||h===9))v===-1&&f!==-1&&(v=b);else if(h===59||h===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let c=e.slice(f,v);h===44?(Ie(t,c,r),r=Object.create(null)):u=c,f=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);else if(l===void 0)if(v===-1&&nr[h]===1)f===-1&&(f=b);else if(h===32||h===9)v===-1&&f!==-1&&(v=b);else if(h===59||h===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b),Ie(r,e.slice(f,v),!0),h===44&&(Ie(t,u,r),r=Object.create(null),u=void 0),f=v=-1}else if(h===61&&f!==-1&&v===-1)l=e.slice(f,b),f=v=-1;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(o){if(nr[h]!==1)throw new SyntaxError(`Unexpected character at index ${b}`);f===-1?f=b:n||(n=!0),o=!1}else if(a)if(nr[h]===1)f===-1&&(f=b);else if(h===34&&f!==-1)a=!1,v=b;else if(h===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(h===34&&e.charCodeAt(b-1)===61)a=!0;else if(v===-1&&nr[h]===1)f===-1&&(f=b);else if(f!==-1&&(h===32||h===9))v===-1&&(v=b);else if(h===59||h===44){if(f===-1)throw new SyntaxError(`Unexpected character at index ${b}`);v===-1&&(v=b);let c=e.slice(f,v);n&&(c=c.replace(/\\/g,""),n=!1),Ie(r,l,c),h===44&&(Ie(t,u,r),r=Object.create(null),u=void 0),l=void 0,f=v=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);if(f===-1||a||h===32||h===9)throw new SyntaxError("Unexpected end of input");v===-1&&(v=b);let _=e.slice(f,v);return u===void 0?Ie(t,_,r):(l===void 0?Ie(r,_,!0):n?Ie(r,l,_.replace(/\\/g,"")):Ie(r,l,_),Ie(t,u,r)),t}i(ty,"parse");function ry(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(o=>{let a=n[o];return Array.isArray(a)||(a=[a]),a.map(u=>u===!0?o:`${o}=${u}`).join("; ")})).join("; ")).join(", ")}).join(", ")}i(ry,"format");Xl.exports={format:ry,parse:ty}});var rn=E((bC,cp)=>{"use strict";var ny=require("events"),oy=require("https"),iy=require("http"),ep=require("net"),ay=require("tls"),{randomBytes:sy,createHash:uy}=require("crypto"),{Duplex:_C,Readable:xC}=require("stream"),{URL:ti}=require("url"),Ke=xt(),cy=Jo(),ly=Qo(),{isBlob:py}=bt(),{BINARY_TYPES:Yl,CLOSE_TIMEOUT:dy,EMPTY_BUFFER:Qr,GUID:fy,kForOnEventAttribute:ri,kListener:my,kStatusCode:hy,kWebSocket:oe,NOOP:tp}=Re(),{EventTarget:{addEventListener:gy,removeEventListener:yy}}=Jl(),{format:vy,parse:_y}=Yr(),{toBuffer:xy}=Qt(),rp=Symbol("kAborted"),ni=[8,13],Ue=["CONNECTING","OPEN","CLOSING","CLOSED"],by=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,G=class e extends ny{static{i(this,"WebSocket")}constructor(t,r,n){super(),this._binaryType=Yl[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Qr,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),np(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Yl.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let o=new cy({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),a=new ly(t,this._extensions,n.generateMask);this._receiver=o,this._sender=a,this._socket=t,o[oe]=this,a[oe]=this,t[oe]=this,o.on("conclude",Ey),o.on("drain",Sy),o.on("error",Iy),o.on("message",Ay),o.on("ping",$y),o.on("pong",zy),a.onerror=wy,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",ap),t.on("data",tn),t.on("end",sp),t.on("error",up),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ke.extensionName]&&this._extensions[Ke.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pe(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ip(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){oi(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Qr,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){oi(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Qr,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){oi(this,t,n);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ke.extensionName]||(o.compress=!1),this._sender.send(t||Qr,o,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pe(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(G,"CONNECTING",{enumerable:!0,value:Ue.indexOf("CONNECTING")});Object.defineProperty(G.prototype,"CONNECTING",{enumerable:!0,value:Ue.indexOf("CONNECTING")});Object.defineProperty(G,"OPEN",{enumerable:!0,value:Ue.indexOf("OPEN")});Object.defineProperty(G.prototype,"OPEN",{enumerable:!0,value:Ue.indexOf("OPEN")});Object.defineProperty(G,"CLOSING",{enumerable:!0,value:Ue.indexOf("CLOSING")});Object.defineProperty(G.prototype,"CLOSING",{enumerable:!0,value:Ue.indexOf("CLOSING")});Object.defineProperty(G,"CLOSED",{enumerable:!0,value:Ue.indexOf("CLOSED")});Object.defineProperty(G.prototype,"CLOSED",{enumerable:!0,value:Ue.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(G.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(G.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[ri])return t[my];return null},set(t){for(let r of this.listeners(e))if(r[ri]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[ri]:!0})}})});G.prototype.addEventListener=gy;G.prototype.removeEventListener=yy;cp.exports=G;function np(e,t,r,n){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:dy,protocolVersion:ni[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!ni.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${ni.join(", ")})`);let a;if(t instanceof ti)a=t;else try{a=new ti(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}a.protocol==="http:"?a.protocol="ws:":a.protocol==="https:"&&(a.protocol="wss:"),e._url=a.href;let u=a.protocol==="wss:",l=a.protocol==="ws+unix:",f;if(a.protocol!=="ws:"&&!u&&!l?f=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!a.pathname?f="The URL's pathname is empty":a.hash&&(f="The URL contains a fragment identifier"),f){let g=new SyntaxError(f);if(e._redirects===0)throw g;en(e,g);return}let h=u?443:80,v=sy(16).toString("base64"),b=u?oy.request:iy.request,_=new Set,c;if(o.createConnection=o.createConnection||(u?Ty:Py),o.defaultPort=o.defaultPort||h,o.port=a.port||h,o.host=a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"},o.path=a.pathname+a.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(c=new Ke({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=vy({[Ke.extensionName]:c.offer()})),r.length){for(let g of r){if(typeof g!="string"||!by.test(g)||_.has(g))throw new SyntaxError("An invalid or duplicated subprotocol was specified");_.add(g)}o.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(a.username||a.password)&&(o.auth=`${a.username}:${a.password}`),l){let g=o.path.split(":");o.socketPath=g[0],o.path=g[1]}let p;if(o.followRedirects){if(e._redirects===0){e._originalIpc=l,e._originalSecure=u,e._originalHostOrSocketPath=l?o.socketPath:a.host;let g=n&&n.headers;if(n={...n,headers:{}},g)for(let[m,x]of Object.entries(g))n.headers[m.toLowerCase()]=x}else if(e.listenerCount("redirect")===0){let g=l?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:a.host===e._originalHostOrSocketPath;(!g||e._originalSecure&&!u)&&(delete o.headers.authorization,delete o.headers.cookie,g||delete o.headers.host,o.auth=void 0)}o.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),p=e._req=b(o),e._redirects&&e.emit("redirect",e.url,p)}else p=e._req=b(o);o.timeout&&p.on("timeout",()=>{pe(e,p,"Opening handshake has timed out")}),p.on("error",g=>{p===null||p[rp]||(p=e._req=null,en(e,g))}),p.on("response",g=>{let m=g.headers.location,x=g.statusCode;if(m&&o.followRedirects&&x>=300&&x<400){if(++e._redirects>o.maxRedirects){pe(e,p,"Maximum redirects exceeded");return}p.abort();let T;try{T=new ti(m,t)}catch{let ee=new SyntaxError(`Invalid URL: ${m}`);en(e,ee);return}np(e,T,r,n)}else e.emit("unexpected-response",p,g)||pe(e,p,`Unexpected server response: ${g.statusCode}`)}),p.on("upgrade",(g,m,x)=>{if(e.emit("upgrade",g),e.readyState!==G.CONNECTING)return;p=e._req=null;let T=g.headers.upgrade;if(T===void 0||T.toLowerCase()!=="websocket"){pe(e,m,"Invalid Upgrade header");return}let M=uy("sha1").update(v+fy).digest("base64");if(g.headers["sec-websocket-accept"]!==M){pe(e,m,"Invalid Sec-WebSocket-Accept header");return}let ee=g.headers["sec-websocket-protocol"],ie;if(ee!==void 0?_.size?_.has(ee)||(ie="Server sent an invalid subprotocol"):ie="Server sent a subprotocol but none was requested":_.size&&(ie="Server sent no subprotocol"),ie){pe(e,m,ie);return}ee&&(e._protocol=ee);let ge=g.headers["sec-websocket-extensions"];if(ge!==void 0){if(!c){pe(e,m,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let At;try{At=_y(ge)}catch{pe(e,m,"Invalid Sec-WebSocket-Extensions header");return}let ye=Object.keys(At);if(ye.length!==1||ye[0]!==Ke.extensionName){pe(e,m,"Server indicated an extension that was not requested");return}try{c.accept(At[Ke.extensionName])}catch{pe(e,m,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ke.extensionName]=c}e.setSocket(m,x,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(p,e):p.end()}i(np,"initAsClient");function en(e,t){e._readyState=G.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}i(en,"emitErrorAndClose");function Py(e){return e.path=e.socketPath,ep.connect(e)}i(Py,"netConnect");function Ty(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=ep.isIP(e.host)?"":e.host),ay.connect(e)}i(Ty,"tlsConnect");function pe(e,t,r){e._readyState=G.CLOSING;let n=new Error(r);Error.captureStackTrace(n,pe),t.setHeader?(t[rp]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(en,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}i(pe,"abortHandshake");function oi(e,t,r){if(t){let n=py(t)?t.size:xy(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Ue[e.readyState]})`);process.nextTick(r,n)}}i(oi,"sendAfterClose");function Ey(e,t){let r=this[oe];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[oe]!==void 0&&(r._socket.removeListener("data",tn),process.nextTick(op,r._socket),e===1005?r.close():r.close(e,t))}i(Ey,"receiverOnConclude");function Sy(){let e=this[oe];e.isPaused||e._socket.resume()}i(Sy,"receiverOnDrain");function Iy(e){let t=this[oe];t._socket[oe]!==void 0&&(t._socket.removeListener("data",tn),process.nextTick(op,t._socket),t.close(e[hy])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}i(Iy,"receiverOnError");function Ql(){this[oe].emitClose()}i(Ql,"receiverOnFinish");function Ay(e,t){this[oe].emit("message",e,t)}i(Ay,"receiverOnMessage");function $y(e){let t=this[oe];t._autoPong&&t.pong(e,!this._isServer,tp),t.emit("ping",e)}i($y,"receiverOnPing");function zy(e){this[oe].emit("pong",e)}i(zy,"receiverOnPong");function op(e){e.resume()}i(op,"resume");function wy(e){let t=this[oe];t.readyState!==G.CLOSED&&(t.readyState===G.OPEN&&(t._readyState=G.CLOSING,ip(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}i(wy,"senderOnError");function ip(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}i(ip,"setCloseTimer");function ap(){let e=this[oe];if(this.removeListener("close",ap),this.removeListener("data",tn),this.removeListener("end",sp),e._readyState=G.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[oe]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",Ql),e._receiver.on("finish",Ql))}i(ap,"socketOnClose");function tn(e){this[oe]._receiver.write(e)||this.pause()}i(tn,"socketOnData");function sp(){let e=this[oe];e._readyState=G.CLOSING,e._receiver.end(),this.end()}i(sp,"socketOnEnd");function up(){let e=this[oe];this.removeListener("error",up),this.on("error",tp),e&&(e._readyState=G.CLOSING,this.destroy())}i(up,"socketOnError")});var fp=E((EC,dp)=>{"use strict";var TC=rn(),{Duplex:ky}=require("stream");function lp(e){e.emit("close")}i(lp,"emitClose");function Oy(){!this.destroyed&&this._writableState.finished&&this.destroy()}i(Oy,"duplexOnEnd");function pp(e){this.removeListener("error",pp),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}i(pp,"duplexOnError");function Ry(e,t){let r=!0,n=new ky({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",i(function(a,u){let l=!u&&n._readableState.objectMode?a.toString():a;n.push(l)||e.pause()},"message")),e.once("error",i(function(a){n.destroyed||(r=!1,n.destroy(a))},"error")),e.once("close",i(function(){n.destroyed||n.push(null)},"close")),n._destroy=function(o,a){if(e.readyState===e.CLOSED){a(o),process.nextTick(lp,n);return}let u=!1;e.once("error",i(function(f){u=!0,a(f)},"error")),e.once("close",i(function(){u||a(o),process.nextTick(lp,n)},"close")),r&&e.terminate()},n._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",i(function(){n._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",i(function(){o()},"finish")),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(o,a,u){if(e.readyState===e.CONNECTING){e.once("open",i(function(){n._write(o,a,u)},"open"));return}e.send(o,u)},n.on("end",Oy),n.on("error",pp),n}i(Ry,"createWebSocketStream");dp.exports=Ry});var ii=E((IC,mp)=>{"use strict";var{tokenChars:Ny}=bt();function Dy(e){let t=new Set,r=-1,n=-1,o=0;for(o;o<e.length;o++){let u=e.charCodeAt(o);if(n===-1&&Ny[u]===1)r===-1&&(r=o);else if(o!==0&&(u===32||u===9))n===-1&&r!==-1&&(n=o);else if(u===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${o}`);n===-1&&(n=o);let l=e.slice(r,n);if(t.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);t.add(l),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let a=e.slice(r,o);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);return t.add(a),t}i(Dy,"parse");mp.exports={parse:Dy}});var bp=E((zC,xp)=>{"use strict";var Cy=require("events"),nn=require("http"),{Duplex:$C}=require("stream"),{createHash:Uy}=require("crypto"),hp=Yr(),nt=xt(),My=ii(),Ly=rn(),{CLOSE_TIMEOUT:jy,GUID:By,kWebSocket:Fy}=Re(),Vy=/^[+/0-9A-Za-z]{22}==$/,gp=0,yp=1,_p=2,ai=class extends Cy{static{i(this,"WebSocketServer")}constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:jy,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Ly,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=nn.createServer((n,o)=>{let a=nn.STATUS_CODES[426];o.writeHead(426,{"Content-Length":a.length,"Content-Type":"text/plain"}),o.end(a)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=Zy(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:i((o,a,u)=>{this.handleUpgrade(o,a,u,n)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=gp}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===_p){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(or,this);return}if(t&&this.once("close",t),this._state!==yp)if(this._state=yp,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(or,this):process.nextTick(or,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{or(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,o){r.on("error",vp);let a=t.headers["sec-websocket-key"],u=t.headers.upgrade,l=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ot(this,t,r,405,"Invalid HTTP method");return}if(u===void 0||u.toLowerCase()!=="websocket"){ot(this,t,r,400,"Invalid Upgrade header");return}if(a===void 0||!Vy.test(a)){ot(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(l!==13&&l!==8){ot(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){ir(r,400);return}let f=t.headers["sec-websocket-protocol"],h=new Set;if(f!==void 0)try{h=My.parse(f)}catch{ot(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let v=t.headers["sec-websocket-extensions"],b={};if(this.options.perMessageDeflate&&v!==void 0){let _=new nt({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let c=hp.parse(v);c[nt.extensionName]&&(_.accept(c[nt.extensionName]),b[nt.extensionName]=_)}catch{ot(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let _={origin:t.headers[`${l===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(_,(c,p,g,m)=>{if(!c)return ir(r,p||401,g,m);this.completeUpgrade(b,a,h,t,r,n,o)});return}if(!this.options.verifyClient(_))return ir(r,401)}this.completeUpgrade(b,a,h,t,r,n,o)}completeUpgrade(t,r,n,o,a,u,l){if(!a.readable||!a.writable)return a.destroy();if(a[Fy])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>gp)return ir(a,503);let h=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Uy("sha1").update(r+By).digest("base64")}`],v=new this.options.WebSocket(null,void 0,this.options);if(n.size){let b=this.options.handleProtocols?this.options.handleProtocols(n,o):n.values().next().value;b&&(h.push(`Sec-WebSocket-Protocol: ${b}`),v._protocol=b)}if(t[nt.extensionName]){let b=t[nt.extensionName].params,_=hp.format({[nt.extensionName]:[b]});h.push(`Sec-WebSocket-Extensions: ${_}`),v._extensions=t}this.emit("headers",h,o),a.write(h.concat(`\r
|
|
5
5
|
`).join(`\r
|
|
6
|
-
`)),a.removeListener("error",
|
|
6
|
+
`)),a.removeListener("error",vp),v.setSocket(a,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(v),v.on("close",()=>{this.clients.delete(v),this._shouldEmitClose&&!this.clients.size&&process.nextTick(or,this)})),l(v,o)}};xp.exports=ai;function Zy(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return i(function(){for(let n of Object.keys(t))e.removeListener(n,t[n])},"removeListeners")}i(Zy,"addListeners");function or(e){e._state=_p,e.emit("close")}i(or,"emitClose");function vp(){this.destroy()}i(vp,"socketOnError");function ir(e,t,r,n){r=r||nn.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${nn.STATUS_CODES[t]}\r
|
|
7
7
|
`+Object.keys(n).map(o=>`${o}: ${n[o]}`).join(`\r
|
|
8
8
|
`)+`\r
|
|
9
9
|
\r
|
|
10
|
-
`+r)}i(nr,"abortHandshake");function tt(e,t,r,n,o,a){if(e.listenerCount("wsClientError")){let u=new Error(o);Error.captureStackTrace(u,tt),e.emit("wsClientError",u,r,t)}else nr(r,n,o,a)}i(tt,"abortHandshakeOrEmitwsClientError")});var Ny={};di(Ny,{assemblyai:()=>Ry});module.exports=yp(Ny);var vp=Object.freeze({status:"aborted"});function E(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:u,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let d=u.prototype,y=Object.keys(d);for(let b=0;b<y.length;b++){let v=y[b];v in l||(l[v]=d[v].bind(l))}}i(n,"init");let o=r?.Parent??Object;class a extends o{static{i(this,"Definition")}}Object.defineProperty(a,"name",{value:e});function u(l){var f;let d=r?.Parent?new a:this;n(d,l),(f=d._zod).deferred??(f.deferred=[]);for(let y of d._zod.deferred)y();return d}return i(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}i(E,"$constructor");var _p=Symbol("zod_brand"),xe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ir=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},vn={};function Se(e){return e&&Object.assign(vn,e),vn}i(Se,"config");function xn(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(xn,"getEnumValues");function hi(e,t){return typeof t=="bigint"?t.toString():t}i(hi,"jsonStringifyReplacer");function sr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(sr,"cached");function gi(e){return e==null}i(gi,"nullish");function ur(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(ur,"cleanRegex");var mi=Symbol("evaluating");function Q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==mi)return n===void 0&&(n=mi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(Q,"defineLazy");var bn="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function $t(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i($t,"isObject");var xp=sr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function yi(e){if($t(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!($t(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(yi,"isPlainObject");var vi=new Set(["string","number","symbol"]);function nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(nt,"escapeRegex");function cr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(cr,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(G,"normalizeParams");function _i(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(_i,"optionalKeys");var bp={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 ot(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(ot,"aborted");function Ue(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Ue,"prefixIssues");function ar(e){return typeof e=="string"?e:e?.message}i(ar,"unwrapMessage");function Me(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=ar(e.inst?._zod.def?.error?.(e))??ar(t?.error?.(e))??ar(r.customError?.(e))??ar(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Me,"finalizeIssue");function xi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(xi,"getLengthableOrigin");function Pn(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Pn,"issue");var bi=i((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,hi,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Pi=E("$ZodError",bi),wt=E("$ZodError",bi,{Parent:Error});var Tp=i(e=>(t,r,n,o)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise)throw new xe;if(u.issues.length){let l=new(o?.Err??e)(u.issues.map(f=>Me(f,a,Se())));throw bn(l,o?.callee),l}return u.value},"_parse"),lr=Tp(wt),Sp=i(e=>async(t,r,n,o)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise&&(u=await u),u.issues.length){let l=new(o?.Err??e)(u.issues.map(f=>Me(f,a,Se())));throw bn(l,o?.callee),l}return u.value},"_parseAsync"),pr=Sp(wt),Ep=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new xe;return a.issues.length?{success:!1,error:new(e??Pi)(a.issues.map(u=>Me(u,o,Se())))}:{success:!0,data:a.value}},"_safeParse"),zt=Ep(wt),Ip=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(u=>Me(u,o,Se())))}:{success:!0,data:a.value}},"_safeParseAsync"),kt=Ip(wt);var Ap="(?:(?:\\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])))",$p=new RegExp(`^${Ap}$`);var Ti=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Si=/^-?\d+n?$/;var Tn=/^-?\d+(?:\.\d+)?$/,Ei=/^(?:true|false)$/i;var it=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Ii=E("$ZodCheckMinLength",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!gi(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let u=xi(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Sn=E("$ZodCheckStringFormat",(e,t)=>{var r,n;it.init(e,t),e._zod.onattach.push(o=>{let a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Ai=E("$ZodCheckRegex",(e,t)=>{Sn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var wi={major:4,minor:3,patch:6};var J=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wi;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let a of o._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((u,l,f)=>{let d=ot(u),y;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(d)continue;let v=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&f?.async===!1)throw new xe;if(y||c instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await c,u.issues.length!==v&&(d||(d=ot(u,v)))});else{if(u.issues.length===v)continue;d||(d=ot(u,v))}}return y?y.then(()=>u):u},"runChecks"),a=i((u,l,f)=>{if(ot(u))return u.aborted=!0,u;let d=o(l,n,f);if(d instanceof Promise){if(f.async===!1)throw new xe;return d.then(y=>e._zod.parse(y,f))}return e._zod.parse(d,f)},"handleCanaryResult");e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){let d=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return d instanceof Promise?d.then(y=>a(y,u,l)):a(d,u,l)}let f=e._zod.parse(u,l);if(f instanceof Promise){if(l.async===!1)throw new xe;return f.then(d=>o(d,n,l))}return o(f,n,l)}}Q(e,"~standard",()=>({validate:i(o=>{try{let a=zt(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return kt(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),mr=E("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ti(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),En=E("$ZodStringFormat",(e,t)=>{Sn.init(e,t),mr.init(e,t)});var Ni=E("$ZodURL",(e,t)=>{En.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Di=E("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}});var In=E("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=Ei,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Ci=E("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=Si,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var Ui=E("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Mi=E("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Li=E("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),ji=E("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,a=o instanceof Date;return a&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...a?{received:"Invalid Date"}:{},inst:e}),r}});function zi(e,t,r){e.issues.length&&t.issues.push(...Ue(r,e.issues)),t.value[r]=e.value}i(zi,"handleArrayResult");var Bi=E("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let a=[];for(let u=0;u<o.length;u++){let l=o[u],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?a.push(f.then(d=>zi(d,r,u))):zi(f,r,u)}return a.length?Promise.all(a).then(()=>r):r}});function fr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ue(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(fr,"handlePropertyResult");function wp(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=_i(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(wp,"normalizeDef");function zp(e,t,r,n,o,a){let u=[],l=o.keySet,f=o.catchall._zod,d=f.def.type,y=f.optout==="optional";for(let b in t){if(l.has(b))continue;if(d==="never"){u.push(b);continue}let v=f.run({value:t[b],issues:[]},n);v instanceof Promise?e.push(v.then(c=>fr(c,r,b,t,y))):fr(v,r,b,t,y)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}i(zp,"handleCatchall");var Fi=E("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=sr(()=>wp(t));Q(e._zod,"propValues",()=>{let l=t.shape,f={};for(let d in l){let y=l[d]._zod;if(y.values){f[d]??(f[d]=new Set);for(let b of y.values)f[d].add(b)}}return f});let o=$t,a=t.catchall,u;e._zod.parse=(l,f)=>{u??(u=n.value);let d=l.value;if(!o(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value={};let y=[],b=u.shape;for(let v of u.keys){let c=b[v],p=c._zod.optout==="optional",g=c._zod.run({value:d[v],issues:[]},f);g instanceof Promise?y.push(g.then(h=>fr(h,l,v,d,p))):fr(g,l,v,d,p)}return a?zp(y,d,l,f,n.value,e):y.length?Promise.all(y).then(()=>l):l}});function ki(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let o=e.filter(a=>!ot(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(u=>Me(u,n,Se())))}),t)}i(ki,"handleUnionResults");var An=E("$ZodUnion",(e,t)=>{J.init(e,t),Q(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Q(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>ur(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let u=!1,l=[];for(let f of t.options){let d=f._zod.run({value:o.value,issues:[]},a);if(d instanceof Promise)l.push(d),u=!0;else{if(d.issues.length===0)return d;l.push(d)}}return u?Promise.all(l).then(f=>ki(f,o,e,a)):ki(l,o,e,a)}});var Vi=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,An.init(e,t);let r=e._zod.parse;Q(e._zod,"propValues",()=>{let o={};for(let a of t.options){let u=a._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[l,f]of Object.entries(u)){o[l]||(o[l]=new Set);for(let d of f)o[l].add(d)}}return o});let n=sr(()=>{let o=t.options,a=new Map;for(let u of o){let l=u._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let f of l){if(a.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);a.set(f,u)}}return a});e._zod.parse=(o,a)=>{let u=o.value;if(!$t(u))return o.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),o;let l=n.value.get(u?.[t.discriminator]);return l?l._zod.run(o,a):t.unionFallback?r(o,a):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),o)}});var Zi=E("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!yi(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],u=t.keyType._zod.values;if(u){r.value={};let l=new Set;for(let d of u)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);let y=t.valueType._zod.run({value:o[d],issues:[]},n);y instanceof Promise?a.push(y.then(b=>{b.issues.length&&r.issues.push(...Ue(d,b.issues)),r.value[d]=b.value})):(y.issues.length&&r.issues.push(...Ue(d,y.issues)),r.value[d]=y.value)}let f;for(let d in o)l.has(d)||(f=f??[],f.push(d));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Tn.test(l)&&f.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>Me(b,n,Se())),input:l,path:[l],inst:e});continue}let y=t.valueType._zod.run({value:o[l],issues:[]},n);y instanceof Promise?a.push(y.then(b=>{b.issues.length&&r.issues.push(...Ue(l,b.issues)),r.value[f.value]=b.value})):(y.issues.length&&r.issues.push(...Ue(l,y.issues)),r.value[f.value]=y.value)}}return a.length?Promise.all(a).then(()=>r):r}});var qi=E("$ZodEnum",(e,t)=>{J.init(e,t);let r=xn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>vi.has(typeof o)).map(o=>typeof o=="string"?nt(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{let u=o.value;return n.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),Wi=E("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?nt(n):n?nt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}});var Hi=E("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ir(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r));if(o instanceof Promise)throw new xe;return r.value=o,r}});function Oi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Oi,"handleOptionalResult");var Gi=E("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ur(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Oi(a,r.value)):Oi(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Ji=E("$ZodNullable",(e,t)=>{J.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${ur(r.source)}|null)$`):void 0}),Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Ki=E("$ZodPipe",(e,t)=>{J.init(e,t),Q(e._zod,"values",()=>t.in._zod.values),Q(e._zod,"optin",()=>t.in._zod.optin),Q(e._zod,"optout",()=>t.out._zod.optout),Q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(u=>dr(u,t.in,n)):dr(a,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>dr(a,t.out,n)):dr(o,t.out,n)}});function dr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(dr,"handlePipeResult");var Xi=E("$ZodCustom",(e,t)=>{it.init(e,t),J.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>Ri(a,r,n,e));Ri(o,r,n,e)}});function Ri(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Pn(o))}}i(Ri,"handleRefineResult");var Qi,Np=Symbol("ZodOutput"),Dp=Symbol("ZodInput"),$n=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ea(){return new $n}i(ea,"registry");(Qi=globalThis).__zod_globalRegistry??(Qi.__zod_globalRegistry=ea());var wn=globalThis.__zod_globalRegistry;function ta(e,t){return new e({type:"string",...G(t)})}i(ta,"_string");function ra(e,t){return new e({type:"string",coerce:!0,...G(t)})}i(ra,"_coercedString");function na(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}i(na,"_url");function oa(e,t){return new e({type:"number",checks:[],...G(t)})}i(oa,"_number");function ia(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}i(ia,"_coercedNumber");function aa(e,t){return new e({type:"boolean",...G(t)})}i(aa,"_boolean");function sa(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}i(sa,"_coercedBoolean");function ua(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}i(ua,"_coercedBigint");function ca(e){return new e({type:"any"})}i(ca,"_any");function la(e){return new e({type:"unknown"})}i(la,"_unknown");function pa(e,t){return new e({type:"void",...G(t)})}i(pa,"_void");function da(e,t){return new e({type:"date",coerce:!0,...G(t)})}i(da,"_coercedDate");function ye(e,t){return new Ii({check:"min_length",...G(t),minimum:e})}i(ye,"_minLength");function Le(e,t){return new Ai({check:"string_format",format:"regex",...G(t),pattern:e})}i(Le,"_regex");function fa(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(fa,"_custom");var ee=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>lr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>zt(e,r,n),e.parseAsync=async(r,n)=>pr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>kt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>cr(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),gr=E("ZodMiniString",(e,t)=>{mr.init(e,t),ee.init(e,t)});function s(e){return ta(gr,e)}i(s,"string");var ma=E("ZodMiniStringFormat",(e,t)=>{En.init(e,t),gr.init(e,t)});var qp=E("ZodMiniURL",(e,t)=>{Ni.init(e,t),ma.init(e,t)});function ha(e){return na(qp,e)}i(ha,"url");var zn=E("ZodMiniNumber",(e,t)=>{Di.init(e,t),ee.init(e,t)});function ie(e){return oa(zn,e)}i(ie,"number");var kn=E("ZodMiniBoolean",(e,t)=>{In.init(e,t),ee.init(e,t)});function V(e){return aa(kn,e)}i(V,"boolean");var ga=E("ZodMiniBigInt",(e,t)=>{Ci.init(e,t),ee.init(e,t)});var Wp=E("ZodMiniAny",(e,t)=>{Ui.init(e,t),ee.init(e,t)});function Rt(){return ca(Wp)}i(Rt,"any");var Hp=E("ZodMiniUnknown",(e,t)=>{Mi.init(e,t),ee.init(e,t)});function k(){return la(Hp)}i(k,"unknown");var Gp=E("ZodMiniVoid",(e,t)=>{Li.init(e,t),ee.init(e,t)});function ya(e){return pa(Gp,e)}i(ya,"_void");var va=E("ZodMiniDate",(e,t)=>{ji.init(e,t),ee.init(e,t)});var Jp=E("ZodMiniArray",(e,t)=>{Bi.init(e,t),ee.init(e,t)});function N(e,t){return new Jp({type:"array",element:e,...G(t)})}i(N,"array");var Kp=E("ZodMiniObject",(e,t)=>{Fi.init(e,t),ee.init(e,t),Q(e,"shape",()=>t.shape)});function m(e,t){let r={type:"object",shape:e??{},...G(t)};return new Kp(r)}i(m,"object");var Xp=E("ZodMiniUnion",(e,t)=>{An.init(e,t),ee.init(e,t)});function D(e,t){return new Xp({type:"union",options:e,...G(t)})}i(D,"union");var Yp=E("ZodMiniDiscriminatedUnion",(e,t)=>{Vi.init(e,t),ee.init(e,t)});function at(e,t,r){return new Yp({type:"union",options:t,discriminator:e,...G(r)})}i(at,"discriminatedUnion");var Qp=E("ZodMiniRecord",(e,t)=>{Zi.init(e,t),ee.init(e,t)});function O(e,t,r){return new Qp({type:"record",keyType:e,valueType:t,...G(r)})}i(O,"record");var ed=E("ZodMiniEnum",(e,t)=>{qi.init(e,t),ee.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new ed({type:"enum",entries:r,...G(t)})}i(U,"_enum");var td=E("ZodMiniLiteral",(e,t)=>{Wi.init(e,t),ee.init(e,t)});function A(e,t){return new td({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}i(A,"literal");var rd=E("ZodMiniTransform",(e,t)=>{Hi.init(e,t),ee.init(e,t)});function je(e){return new rd({type:"transform",transform:e})}i(je,"transform");var nd=E("ZodMiniOptional",(e,t)=>{Gi.init(e,t),ee.init(e,t)});function _(e){return new nd({type:"optional",innerType:e})}i(_,"optional");var od=E("ZodMiniNullable",(e,t)=>{Ji.init(e,t),ee.init(e,t)});function Nt(e){return new od({type:"nullable",innerType:e})}i(Nt,"nullable");var id=E("ZodMiniPipe",(e,t)=>{Ki.init(e,t),ee.init(e,t)});function Be(e,t){return new id({type:"pipe",in:e,out:t})}i(Be,"pipe");var ad=E("ZodMiniCustom",(e,t)=>{Xi.init(e,t),ee.init(e,t)});function yr(e,t){return fa(ad,e??(()=>!0),t)}i(yr,"custom");var Dt={};di(Dt,{bigint:()=>fd,boolean:()=>dd,date:()=>md,number:()=>pd,string:()=>ld});function ld(e){return ra(gr,e)}i(ld,"string");function pd(e){return ia(zn,e)}i(pd,"number");function dd(e){return sa(kn,e)}i(dd,"boolean");function fd(e){return ua(ga,e)}i(fd,"bigint");function md(e){return da(va,e)}i(md,"date");var Rn=m({retryOnFailure:m({defaultValue:_(V()),hide:_(V())}),continueOnFailure:m({defaultValue:_(V()),hide:_(V())})}),On=class{constructor(t,r,n,o,a,u,l,f,d,y,b){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=a;this.test=u;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=d;this.audience=y;this.aiMetadata=b}static{i(this,"IAction")}},Z=i(e=>new On(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=m({displayName:s(),description:_(s())}),C=i((e,t)=>m({type:A(t),required:V(),defaultValue:_(Rt())}),"TPropertyValue");var ue=m({...B.shape,...C(s(),"SHORT_TEXT").shape}),Ee=m({...B.shape,...C(s(),"LONG_TEXT").shape});var xa=m({label:s(),value:k()}),vr=m({disabled:_(V()),placeholder:_(s()),options:N(xa)});var ce=m({...B.shape,options:vr,...C(k(),"STATIC_DROPDOWN").shape}),Ie=m({...B.shape,options:vr,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Nn=m({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(s())}),Ct=m({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(s())});var Ae=m({...B.shape,...C(V(),"CHECKBOX").shape});var $e=m({...B.shape,...C(ie(),"NUMBER").shape});var Ut=m({...B.shape,...C(k(),"FILE").shape});var Mt=m({...B.shape,...C(s(),"DATE_TIME").shape});var ba=O(s(),D([ue,Ee,ce,Ct,Ie,Ae,$e,Ut,Mt])),Lt=m({...B.shape,properties:ba,...C(N(k()),"ARRAY").shape});var jt=m({...B.shape,...C(D([O(s(),k())]),"JSON").shape});var Pa=D([ue,ce,jt,Lt,Ie]),gd=O(s(),Pa),Dn=m({refreshers:N(s()),...B.shape,...C(k(),"DYNAMIC").shape});var _r=m({...B.shape,...C(ya(),"MARKDOWN").shape});var Bt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Bt||{}),st=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(st||{}),ut=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(ut||{});var Ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ft||{}),Cn="both_client_credentials_and_authorization_code";var We=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(We||{}),Vt=(a=>(a.NONE="NONE",a.HEADER_PRESENT="HEADER_PRESENT",a.QUERY_PRESENT="QUERY_PRESENT",a.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",a.HEAD_REQUEST="HEAD_REQUEST",a))(Vt||{}),yd=m({strategy:U(Vt),paramName:_(s())}),Zt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Zt||{});var xr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(xr||{}),Ta=m({status:_(ie()),body:_(k()),headers:_(O(s(),s()))}),Sa=m({type:A("DELAY"),resumeDateTime:s(),requestIdToReply:_(s()),handlerId:_(s()),streamStepProgress:_(U(xr))}),Ea=m({type:A("WEBHOOK"),requestId:s(),requestIdToReply:_(s()),response:Ta,handlerId:_(s()),streamStepProgress:_(U(xr))}),vd=D([Sa,Ea]);var _d=m({body:k(),rawBody:_(k()),headers:O(s(),s()),queryParams:O(s(),s())});function we(e){return e==null}i(we,"isNil");function qt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(qt,"isEmpty");function br(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(br,"assertNotNullOrUndefined");var Un=ae(require("crypto"),1);var xd=128,He,ct,bd=i(e=>{!He||He.length<e?(He=Buffer.allocUnsafe(e*xd),Un.default.randomFillSync(He),ct=0):ct+e>He.length&&(Un.default.randomFillSync(He),ct=0),ct+=e},"fillPool"),Pd=i(e=>(bd(e|=0),He.subarray(ct-e,ct)),"random"),Td=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(a=t)=>{let u="";for(;;){let l=r(o),f=o;for(;f--;)if(u+=e[l[f]&n]||"",u.length===a)return u}}},"customRandom"),Aa=i((e,t=21)=>Td(e,t,Pd),"customAlphabet");var Sd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",$a=21,gA=s().check(Le(new RegExp(`^[0-9a-zA-Z]{${$a}}$`))),Ed=Aa(Sd,$a);var Fe=Be(je(e=>e instanceof Date?e.toISOString():e),s()),de={id:s(),created:Fe,updated:Fe},H=i(e=>_(Nt(e)),"Nullable");function Mn(e){return _(Nt(U(e)))}i(Mn,"NullableEnum");var _A=Be(je(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),_(V())),Pr=i(e=>Be(je(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),_(N(e))),"OptionalArrayFromQuery");var PA=O(s(),k());var Wt=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(Wt||{});var NA=s().check(Le(/^#[0-9A-Fa-f]{6}$/));var CA=m({filename:s(),data:k(),type:A("file"),mimetype:_(s())});var Id=ae(za());var VA=m({...de,name:s(),permissions:N(s()),platformId:H(s()),type:s(),userCount:_(ie())});var ka=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ka||{}),Ln=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ln||{}),jn=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(jn||{});var Bn=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Bn||{});var Fn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Fn||{});var Ad=m({mode:U(ka),value:k()}),$d=m({auth:_(s()),fields:O(s(),Ad)}),wd=m({pieceName:s(),pieceVersion:s(),actionName:s(),predefinedInput:_($d)}),zd=m({type:A("PIECE"),toolName:s().check(ye(1)),pieceMetadata:wd}),kd=m({type:A("none")}),Od=m({type:A("access_token"),accessToken:s()}),Rd=m({type:A("api_key"),apiKey:s(),apiKeyHeader:s()}),Nd=m({type:A("headers"),headers:O(s(),s())}),Dd=at("type",[kd,Od,Rd,Nd]),Oa=m({type:A("FLOW"),toolName:s().check(ye(1)),externalFlowId:s(),flowDisplayName:_(s())}),Ra=m({type:A("MCP"),toolName:s().check(ye(1)),serverUrl:ha(),protocol:U(jn),auth:Dd}),Na=m({type:A("KNOWLEDGE_BASE"),toolName:s().check(ye(1)),sourceType:U(Ln),sourceId:s(),sourceName:s()}),Cd=at("type",[zd,Oa,Ra,Na]),Ud=m({displayName:s(),description:_(s()),type:U(Bn)}),Da=m({type:A("MARKDOWN"),markdown:s()}),lt={type:A("TOOL_CALL"),input:H(O(s(),k())),output:_(k()),toolName:s(),status:U(Fn),toolCallId:s(),startTime:s(),endTime:_(s())},g$=m(lt),Ca=at("toolCallType",[m({...lt,toolCallType:A("PIECE"),pieceName:s(),pieceVersion:s(),actionName:s()}),m({...lt,toolCallType:A("FLOW"),displayName:s(),externalFlowId:s()}),m({...lt,toolCallType:A("MCP"),displayName:s(),serverUrl:s()}),m({...lt,toolCallType:A("KNOWLEDGE_BASE"),displayName:s(),sourceType:s()}),m({...lt,toolCallType:A("UNKNOWN"),displayName:s()})]),Md=D([Da,Ca]);var Vn=(r=>(r.IMAGE="image",r.TEXT="text",r))(Vn||{}),ze=m({apiKey:s()}),Ld=ze,jd=m({apiKey:s(),apiKeyHash:s()}),Bd=ze,Fd=ze,Vd=ze,Zd=ze,qd=ze,Wd=ze,Hd=ze,Ua=m({accessKeyId:s().check(ye(1)),secretAccessKey:s().check(ye(1))}),Gd=m({}),Jd=m({}),Kd=m({}),Xd=m({}),Yd=m({}),Qd=m({}),Ma=m({modelId:s(),modelName:s(),modelType:U(Vn)}),La=m({apiKeyHeader:s(),baseUrl:s(),models:N(Ma),defaultHeaders:_(O(s(),s()))}),ja=m({accountId:s(),gatewayId:s(),models:N(Ma),vertexProject:_(s()),vertexRegion:_(s())}),Ba=m({resourceName:s(),apiVersion:Be(je(e=>typeof e=="string"&&e.trim().length===0?void 0:e),_(s()))}),Fa=m({region:s().check(ye(1))}),ef=D([Ld,Vd,Zd,qd,Wd,Fd,Bd,jd,Ua,Hd]),Va=D([La,ja,Ba,Fa,Gd,Kd,Xd,Yd,Jd,Qd]),tf=m({id:s(),name:s(),type:U(Vn)}),rf=m({id:s(),name:s(),provider:U(Wt),config:Va,enabledForChat:V()}),nf=m({provider:U(Wt),config:Va,auth:ef,platformId:s()});var x$={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var of=m({base64Url:s(),fileName:s(),extension:_(s())}),af=m({mimeType:s(),url:s(),fileName:_(s())}),Zn=D([of,af]);var sf=D([m({type:A("file"),value:Zn}),m({type:A("markdown"),value:s(),files:_(N(Zn))})]),uf=m({sessionId:s(),message:s(),files:_(N(s()))});var qa=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(qa||{}),Wa=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wa||{}),qn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(qn||{});var cf=D([m({...de,name:s(),externalId:s(),type:A("STATIC_DROPDOWN"),tableId:s(),projectId:s(),data:m({options:N(m({value:s()}))})}),m({...de,name:s(),externalId:s(),type:D([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:s(),projectId:s()})]),lf=m({...de,name:s(),folderId:H(s()),projectId:s(),externalId:s(),status:Mn(Wa),trigger:Mn(qa)}),pf=m({...de,tableId:s(),projectId:s(),cells:O(s(),m({updated:s(),created:s(),value:k(),fieldName:s()}))}),df=m({events:N(U(qn)),webhookUrl:s(),flowId:s()}),ff=m({fields:N(m({id:s(),name:s()})),rows:N(O(s(),s())),name:s()}),mf=m({projectId:s(),limit:_(Dt.number()),cursor:_(s()),name:_(s()),externalIds:Pr(s()),folderId:_(s()),folderIds:Pr(s())}),hf=m({records:N(N(m({fieldId:s(),value:Ga()}))),tableId:s()}),gf=m({cells:_(N(m({fieldId:s(),value:Ga()}))),tableId:s(),agentUpdate:_(V())}),Ha=at("operator",[Ge("eq"),Ge("neq"),Ge("gt"),Ge("gte"),Ge("lt"),Ge("lte"),Ge("co"),Za("exists"),Za("not_exists")]),yf=m({tableId:s(),limit:_(Dt.number()),cursor:_(s()),filters:Pr(Ha)});function Ga(){return Be(je(e=>e==null?e:String(e)),Nt(s()))}i(Ga,"coerceToString");function Ge(e){return m({fieldId:s(),operator:A(e),value:s()})}i(Ge,"valueFilter");function Za(e){return m({fieldId:s(),operator:A(e)})}i(Za,"existenceFilter");var vf=m({status:_(ie()),body:_(k()),headers:_(O(s(),s()))}),_f=m({...de,deleted:H(Fe),ownerId:s(),displayName:s(),platformId:s(),externalId:H(s())});var Ja=m({name:s(),description:_(s()),type:s(),required:V()}),xf=m({pieceName:s(),triggerName:s(),input:m({toolName:s(),toolDescription:s(),inputSchema:N(Ja),returnsResponse:V()})});var Ka="^[0-9]+\\.[0-9]+\\.[0-9]+$",L$=new RegExp(Ka),Pf="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",j$=s().check(Le(new RegExp(Ka))),B$=s().check(Le(new RegExp(Pf))),Tf=m({packageType:A("ARCHIVE"),pieceType:U(st),pieceName:s(),pieceVersion:s(),archiveId:s(),platformId:s()}),Xa=m({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:s(),pieceVersion:s()}),Ya=m({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:s(),pieceVersion:s(),platformId:s()}),F$=D([Xa,Ya]),V$=D([Tf,Xa,Ya]),Qa=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(Qa||{}),Sf=m({type:U(Qa),cronExpression:s(),timezone:s()}),Z$=m({...de,type:U(We),projectId:s(),flowId:s(),triggerName:s(),schedule:H(Sf),flowVersionId:s(),pieceName:s(),pieceVersion:s(),deleted:H(s()),simulate:V()}),es=(h=>(h.UNKNOWN="UNKNOWN",h.FLOW_RUN_LOG="FLOW_RUN_LOG",h.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",h.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",h.FLOW_STEP_FILE="FLOW_STEP_FILE",h.SAMPLE_DATA="SAMPLE_DATA",h.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",h.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",h.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",h.PROJECT_RELEASE="PROJECT_RELEASE",h.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",h.PLATFORM_ASSET="PLATFORM_ASSET",h.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",h.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",h.KNOWLEDGE_BASE="KNOWLEDGE_BASE",h.FLOW_BUNDLE="FLOW_BUNDLE",h))(es||{}),ts=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ts||{}),rs=(r=>(r.S3="S3",r.DB="DB",r))(rs||{}),q$=m({...de,projectId:H(s()),platformId:H(s()),type:U(es),compression:U(ts),data:_(k()),location:U(rs),size:H(ie()),fileName:H(s()),s3Key:H(s()),metadata:H(O(s(),s()))}),ns=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ns||{}),os=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(os||{}),W$=m({id:s(),email:s(),firstName:s(),status:U(os),externalId:H(s()),platformId:H(s()),platformRole:U(ns),lastName:s(),created:Fe,updated:Fe,lastActiveDate:H(Fe),imageUrl:H(s())});var Hn=m({...B.shape,...C(O(s(),k()),"OBJECT").shape});var ss=m({...B.shape,...C(s(),"COLOR").shape});var Gn=D([ue,Ee,_r,Ae,ce,Ie,Nn,Ct,Dn,$e,Lt,Hn,jt,Mt,Ut,ss]),P={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"}},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"}},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 be=m({displayName:s(),description:_(s())});var us=m({username:s(),password:s()}),Jn=m({...be.shape,username:m({displayName:s(),description:_(s())}),password:m({displayName:s(),description:_(s())}),...C(us,"BASIC_AUTH").shape});var $f=O(s(),D([ue,Ee,$e,Ae,ce])),Kn=m({...be.shape,props:$f,...C(k(),"CUSTOM_AUTH").shape});var Je=m({...be.shape,...C(m({auth:s()}),"SECRET_TEXT").shape});var wf=O(s(),D([ue,Ee,Je,$e,Ae,ce,Ie,_r])),cs=m({...be.shape,props:wf,...C(k(),"OIDC").shape});var Xn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Xn||{}),ls=D([ue,Je,ce]),ps=O(s(),ls),zf=m({props:_(O(s(),ls)),authUrl:s(),tokenUrl:s(),scope:N(s()),prompt:_(D([A("none"),A("consent"),A("login"),A("omit")])),pkce:_(V()),pkceMethod:_(D([A("plain"),A("S256")])),authorizationMethod:_(U(Xn)),grantType:_(D([U(Ft),A(Cn)])),extra:_(O(s(),s()))}),ds=m({access_token:s(),props:_(ps),data:O(s(),Rt())}),Yn=m({...be.shape,...zf.shape,...C(ds,"OAUTH2").shape});var pt=D([Jn,Kn,cs,Yn,Je]),Ht="Connection",Qn={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Ht}},None(){}};var Sz={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 kf=m({...B.shape,...C(k(),"CUSTOM").shape,code:s()});var Of=D([Gn,pt]),eo=O(s(),Of),Zz=O(s(),Gn);var fs=D([m({strategy:A("CRON"),cronExpression:s()}),m({strategy:A("NONE")})]);var ms="2",Sr="0.82.0";var to=class{constructor(t,r,n,o,a,u,l,f,d=Sr,y,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=d;this.maximumSupportedRelease=y;this.description=b;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:ms}),"getContextInfo");(!Rf(d)||Nf(d,Sr))&&(this.minimumSupportedRelease=Sr),a.forEach(v=>this._actions[v.name]=v),u.forEach(v=>this._triggers[v.name]=v)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},hs=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(a=>a.type===r.type)))throw new Error("Auth properties must be unique by type");return new to(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Rf(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Rf,"isValidSimpleSemver");function Nf(e,t){let[r,n,o]=e.split(".").map(Number),[a,u,l]=t.split(".").map(Number);return r!==a?r<a:n!==u?n<u:o<l}i(Nf,"isSemverLessThan");var Df=_(O(s(),O(s(),s()))),gs=m({id:_(s()),name:s(),displayName:s(),logoUrl:s(),description:s(),authors:N(s()),platformId:_(s()),directoryPath:_(s()),auth:_(D([pt,N(pt)])),version:s(),categories:_(N(U(ut))),minimumSupportedRelease:_(s()),maximumSupportedRelease:_(s()),i18n:Df}),Cf=U(["human","ai","both"]),ys=m({description:_(s()),idempotent:_(V())}),vs=m({name:s(),displayName:s(),description:s(),props:eo,requireAuth:V(),errorHandlingOptions:_(Rn),outputSchema:_(yr()),audience:_(Cf),aiMetadata:_(ys)}),_s=m({name:s(),displayName:s(),description:s(),props:eo,errorHandlingOptions:_(Rn),type:U(We),sampleData:k(),handshakeConfiguration:_(yr()),renewConfiguration:_(fs),testStrategy:U(Zt),outputSchema:_(yr()),aiMetadata:_(ys)}),Uf=m({...gs.shape,actions:O(s(),vs),triggers:O(s(),_s)}),Mf=m({...gs.shape,actions:ie(),triggers:ie(),suggestedActions:_(N(_s)),suggestedTriggers:_(N(vs))}),xs=m({projectUsage:ie(),tags:_(N(s())),pieceType:U(st),packageType:U(Bt),platformId:_(s()),archiveId:_(s())}),Zk=m({...Uf.shape,...xs.shape}),qk=m({...Mf.shape,...xs.shape}),Wk=m({name:s(),version:s()});var Lf=ae(require("path")),jf=ae(require("fs/promises"));var Er=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((a,u)=>{o.append(u,a)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ir=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new ro,r=new no){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},ro=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},no=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Ar=class extends Error{constructor(r,n){let o=n.status||500,a=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:a},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=a}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var $r=class extends Er{static{i(this,"FetchHttpClient")}constructor(t="",r=new Ir){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),a=this.getHeaders(t),u=t.queryParams??{};for(let[M,Y]of Object.entries(u))o.append(M,Y);let l=o.toString(),f=l?`${n}?${l}`:n,d=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:v,extraHeaders:c,isStream:p}=Bf(t.body,a),g=Vf({...a,...c}),h=await Ff(async()=>{let M=new AbortController,Y=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let oe={method:t.method.toString(),headers:g,body:v,redirect:y?"follow":"manual",signal:M.signal};return p&&(oe.duplex="half"),r?.dispatcher!==void 0&&(oe.dispatcher=r.dispatcher),await fetch(f,oe)}finally{Y!==void 0&&clearTimeout(Y)}},b),x=y?300:400;if(h.status<200||h.status>=x){let M=await bs(h,d),Y=new Ar(t.body,{status:h.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Y),Y}let T=await bs(h,d);return{status:h.status,headers:Zf(h.headers),body:T}}};function Bf(e,t){return Wf(e)?{body:void 0,extraHeaders:{},isStream:!1}:qf(e)?{body:e,extraHeaders:e.getHeaders(),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}}i(Bf,"serializeBody");async function bs(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(bs,"parseResponseBody");async function Ff(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ps(n);continue}return o}catch(o){if(r=o,n<t){await Ps(n);continue}throw o}throw r}i(Ff,"sendWithRetries");function Ps(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ps,"backoff");function Vf(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Vf,"normalizeHeaders");function Zf(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Zf,"toHttpHeaders");function qf(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(qf,"isNodeFormData");function Wf(e){return e==null}i(Wf,"isNil");var wr=new $r;var zr=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(zr||{});var Rh=ae(require("fs")),$c=ae(Ac());var Nh={"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 Dh(e){let t=e.split(";")[0].trim().toLowerCase();return Nh[t]??""}i(Dh,"contentTypeToExtension");var Ch=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Uh=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function wc({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:a,props:u,extraProps:l,authLocation:f="headers"}){return Z({audience:"human",name:a||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:P.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:d})=>({url:P.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
11
|
-
i.e ${Uh(t,d)}/resource or /resource`,required:!0,defaultValue:d?t(d):"",...u?.url??{}})}),"props")}),method:P.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(zr).map(d=>({label:d,value:d}))},...u?.method??{}}),headers:P.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:P.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:P.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:P.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:d})=>{if(!d)return{};let y=d,b={};switch(y){case"none":break;case"json":b.data=P.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":b.data=P.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=P.Array({displayName:"Form Data",required:!0,properties:{fieldName:P.ShortText({displayName:"Field Name",required:!0}),fieldType:P.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:P.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:P.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:P.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:P.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:P.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:P.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async d=>{let{method:y,url:b,headers:v,queryParams:c,body:p,body_type:g,failsafe:h,timeout:x,response_is_binary:T,followRedirects:M}=d.propsValue;br(y,"Method"),br(b,"URL");let Y=we(r)?{}:await r(d.auth,d.propsValue),oe=b.url,Ce=oe.startsWith("http://")||oe.startsWith("https://")?oe:Ch({baseUrl:t(d.auth),relativePath:oe}),ge={method:y,url:Ce,headers:{...v??{},...f==="headers"||!we(f)?Y:{}},queryParams:{...f==="queryParams"?Y:{},...c??{}},timeout:x?x*1e3:0,followRedirects:M};if(T&&(ge.responseType="arraybuffer"),p)if(g&&g!=="none"){let pe=p.data;if(g==="form_data"){let It=pe,rt=new $c.default;for(let{fieldName:ci,fieldType:li,textFieldValue:pi,fileFieldValue:yn}of It)li==="text"&&!qt(pi)?rt.append(ci,pi):li==="file"&&!qt(yn)&&rt.append(ci,yn.data,{filename:yn?.filename});ge.body=rt,ge.headers={...ge.headers,...rt.getHeaders()}}else ge.body=pe}else g||(ge.body=p);try{let pe=await wr.sendRequest(ge);return await Mh(d.files,pe.body,pe.status,pe.headers,T)}catch(pe){if(h)return pe.errorMessage();throw pe}},"run")})}i(wc,"createCustomApiCallAction");var Mh=i(async(e,t,r,n,o)=>{let a;if(o&&Lh(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Dh(u??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),a=await e.write({fileName:`output.${l}`,data:f})}else a=t;return{status:r,headers:n,body:a}},"handleBinaryResponse"),Lh=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ip=require("stream/web");var fy=ae(Zl(),1),my=ae(Gr(),1),hy=ae(_t(),1),gy=ae(Vo(),1),yy=ae(Wo(),1),vy=ae(Yo(),1),Ql=ae(Yr(),1),_y=ae(Yl(),1);var ep=Ql.default;var ap=require("fs"),sp=require("stream");var ei={cache:"no-store"},xy=i(e=>or+(e===!1?"":" AssemblyAI/1.0 ("+Object.entries({...en,...e}).map(([t,r])=>r?`${t}=${r.name}/${r.version}`:"").join(" ")+")"),"buildUserAgent"),or="";typeof navigator<"u"&&navigator.userAgent&&(or+=navigator.userAgent);var en={sdk:{name:"JavaScript",version:"4.7.0"}};typeof process<"u"&&(process.versions.node&&or.indexOf("Node")===-1&&(en.runtime_env={name:"Node",version:process.versions.node}),process.versions.bun&&or.indexOf("Bun")===-1&&(en.runtime_env={name:"Bun",version:process.versions.bun}));typeof Deno<"u"&&process.versions.bun&&or.indexOf("Deno")===-1&&(en.runtime_env={name:"Deno",version:Deno.version.deno});var Et=class{static{i(this,"BaseService")}constructor(t){this.params=t,t.userAgent===!1?this.userAgent=void 0:this.userAgent=xy(t.userAgent||{})}async fetch(t,r){r={...ei,...r};let n={Authorization:this.params.apiKey,"Content-Type":"application/json"};ei?.headers&&(n={...n,...ei.headers}),r?.headers&&(n={...n,...r.headers}),this.userAgent&&(n["User-Agent"]=this.userAgent,typeof window<"u"&&"chrome"in window&&(n["AssemblyAI-Agent"]=this.userAgent)),r.headers=n,t.startsWith("http")||(t=this.params.baseUrl+t);let o=await fetch(t,r);if(o.status>=400){let a,u=await o.text();if(u){try{a=JSON.parse(u)}catch{}throw a?.error?new Error(a.error):new Error(u)}throw new Error(`HTTP Error: ${o.status} ${o.statusText}`)}return o}async fetchJson(t,r){return(await this.fetch(t,r)).json()}},ti=class extends Et{static{i(this,"LemurService")}summary(t){return this.fetchJson("/lemur/v3/generate/summary",{method:"POST",body:JSON.stringify(t)})}questionAnswer(t){return this.fetchJson("/lemur/v3/generate/question-answer",{method:"POST",body:JSON.stringify(t)})}actionItems(t){return this.fetchJson("/lemur/v3/generate/action-items",{method:"POST",body:JSON.stringify(t)})}task(t){return this.fetchJson("/lemur/v3/generate/task",{method:"POST",body:JSON.stringify(t)})}getResponse(t){return this.fetchJson(`/lemur/v3/${t}`)}purgeRequestData(t){return this.fetchJson(`/lemur/v3/${t}`,{method:"DELETE"})}},tp=i((e,t)=>new ep(e,t),"factory"),te={BadSampleRate:4e3,AuthFailed:4001,InsufficientFundsOrFreeAccount:4002,InsufficientFunds:4002,FreeTierUser:4003,NonexistentSessionId:4004,SessionExpired:4008,ClosedSession:4010,RateLimited:4029,UniqueSessionViolation:4030,SessionTimeout:4031,AudioTooShort:4032,AudioTooLong:4033,AudioTooSmallToTranscode:4034,BadJson:4100,BadSchema:4101,TooManyStreams:4102,Reconnected:4103,ReconnectAttemptsExhausted:1013,WordBoostParameterParsingFailed:4104},rp={[te.BadSampleRate]:"Sample rate must be a positive integer",[te.AuthFailed]:"Not Authorized",[te.InsufficientFunds]:"Insufficient funds",[te.FreeTierUser]:"This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account.",[te.NonexistentSessionId]:"Session ID does not exist",[te.SessionExpired]:"Session has expired",[te.ClosedSession]:"Session is closed",[te.RateLimited]:"Rate limited",[te.UniqueSessionViolation]:"Unique session violation",[te.SessionTimeout]:"Session Timeout",[te.AudioTooShort]:"Audio too short",[te.AudioTooLong]:"Audio too long",[te.AudioTooSmallToTranscode]:"Audio too small to transcode",[te.BadJson]:"Bad JSON",[te.BadSchema]:"Bad schema",[te.TooManyStreams]:"Too many streams",[te.Reconnected]:"This session has been reconnected. This WebSocket is no longer valid.",[te.ReconnectAttemptsExhausted]:"Reconnect attempts exhausted",[te.WordBoostParameterParsingFailed]:"Could not parse word boost parameter"},ri=class extends Error{static{i(this,"RealtimeError")}},by="wss://api.assemblyai.com/v2/realtime/ws",Py='{"force_end_utterance":true}',np='{"terminate_session":true}',ni=class{static{i(this,"RealtimeTranscriber")}constructor(t){if(this.listeners={},this.realtimeUrl=t.realtimeUrl??by,this.sampleRate=t.sampleRate??16e3,this.wordBoost=t.wordBoost,this.encoding=t.encoding,this.endUtteranceSilenceThreshold=t.endUtteranceSilenceThreshold,this.disablePartialTranscripts=t.disablePartialTranscripts,"token"in t&&t.token&&(this.token=t.token),"apiKey"in t&&t.apiKey&&(this.apiKey=t.apiKey),!(this.token||this.apiKey))throw new Error("API key or temporary token is required.")}connectionUrl(){let t=new URL(this.realtimeUrl);if(t.protocol!=="wss:")throw new Error("Invalid protocol, must be wss");let r=new URLSearchParams;return this.token&&r.set("token",this.token),r.set("sample_rate",this.sampleRate.toString()),this.wordBoost&&this.wordBoost.length>0&&r.set("word_boost",JSON.stringify(this.wordBoost)),this.encoding&&r.set("encoding",this.encoding),r.set("enable_extra_session_information","true"),this.disablePartialTranscripts&&r.set("disable_partial_transcripts",this.disablePartialTranscripts.toString()),t.search=r.toString(),t}on(t,r){this.listeners[t]=r}connect(){return new Promise(t=>{if(this.socket)throw new Error("Already connected");let r=this.connectionUrl();this.token?this.socket=tp(r.toString()):this.socket=tp(r.toString(),{headers:{Authorization:this.apiKey}}),this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.endUtteranceSilenceThreshold===void 0||this.endUtteranceSilenceThreshold===null||this.configureEndUtteranceSilenceThreshold(this.endUtteranceSilenceThreshold)},this.socket.onclose=({code:n,reason:o})=>{o||n in rp&&(o=rp[n]),this.listeners.close?.(n,o)},this.socket.onerror=n=>{n.error?this.listeners.error?.(n.error):this.listeners.error?.(new Error(n.message))},this.socket.onmessage=({data:n})=>{let o=JSON.parse(n.toString());if("error"in o){this.listeners.error?.(new ri(o.error));return}switch(o.message_type){case"SessionBegins":{let a={sessionId:o.session_id,expiresAt:new Date(o.expires_at)};t(a),this.listeners.open?.(a);break}case"PartialTranscript":{o.created=new Date(o.created),this.listeners.transcript?.(o),this.listeners["transcript.partial"]?.(o);break}case"FinalTranscript":{o.created=new Date(o.created),this.listeners.transcript?.(o),this.listeners["transcript.final"]?.(o);break}case"SessionInformation":{this.listeners.session_information?.(o);break}case"SessionTerminated":{this.sessionTerminatedResolve?.();break}}}})}sendAudio(t){this.send(t)}stream(){return new ip.WritableStream({write:i(t=>{this.sendAudio(t)},"write")})}forceEndUtterance(){this.send(Py)}configureEndUtteranceSilenceThreshold(t){this.send(`{"end_utterance_silence_threshold":${t}}`)}send(t){if(!this.socket||this.socket.readyState!==this.socket.OPEN)throw new Error("Socket is not open for communication");this.socket.send(t)}async close(t=!0){if(this.socket){if(this.socket.readyState===this.socket.OPEN)if(t){let r=new Promise(n=>{this.sessionTerminatedResolve=n});this.socket.send(np),await r}else this.socket.send(np);this.socket?.removeAllListeners&&this.socket.removeAllListeners(),this.socket.close()}this.listeners={},this.socket=void 0}};var oi=class extends Et{static{i(this,"RealtimeTranscriberFactory")}constructor(t){super(t),this.rtFactoryParams=t}createService(t){return this.transcriber(t)}transcriber(t){let r={...t};return!r.token&&!r.apiKey&&(r.apiKey=this.rtFactoryParams.apiKey),new ni(r)}async createTemporaryToken(t){return(await this.fetchJson("/v2/realtime/token",{method:"POST",body:JSON.stringify(t)})).token}};function op(e){return e.startsWith("http")||e.startsWith("https")||e.startsWith("data:")?null:e.startsWith("file://")?e.substring(7):e.startsWith("file:")?e.substring(5):e}i(op,"getPath");var ii=class extends Et{static{i(this,"TranscriptService")}constructor(t,r){super(t),this.files=r}async transcribe(t,r){let n=await this.submit(t);return await this.waitUntilReady(n.id,r)}async submit(t){let r,n;if("audio"in t){let{audio:a,...u}=t;if(typeof a=="string"){let l=op(a);l!==null?r=await this.files.upload(l):a.startsWith("data:")?r=await this.files.upload(a):r=a}else r=await this.files.upload(a);n={...u,audio_url:r}}else n=t;return await this.fetchJson("/v2/transcript",{method:"POST",body:JSON.stringify(n)})}async create(t,r){let n=op(t.audio_url);if(n!==null){let a=await this.files.upload(n);t.audio_url=a}let o=await this.fetchJson("/v2/transcript",{method:"POST",body:JSON.stringify(t)});return r?.poll??!0?await this.waitUntilReady(o.id,r):o}async waitUntilReady(t,r){let n=r?.pollingInterval??3e3,o=r?.pollingTimeout??-1,a=Date.now();for(;;){let u=await this.get(t);if(u.status==="completed"||u.status==="error")return u;if(o>0&&Date.now()-a>o)throw new Error("Polling timeout");await new Promise(l=>setTimeout(l,n))}}get(t){return this.fetchJson(`/v2/transcript/${t}`)}async list(t){let r="/v2/transcript";typeof t=="string"?r=t:t&&(r=`${r}?${new URLSearchParams(Object.keys(t).map(o=>[o,t[o]?.toString()||""]))}`);let n=await this.fetchJson(r);for(let o of n.transcripts)o.created=new Date(o.created),o.completed&&(o.completed=new Date(o.completed));return n}delete(t){return this.fetchJson(`/v2/transcript/${t}`,{method:"DELETE"})}wordSearch(t,r){let n=new URLSearchParams({words:r.join(",")});return this.fetchJson(`/v2/transcript/${t}/word-search?${n.toString()}`)}sentences(t){return this.fetchJson(`/v2/transcript/${t}/sentences`)}paragraphs(t){return this.fetchJson(`/v2/transcript/${t}/paragraphs`)}async subtitles(t,r="srt",n){let o=`/v2/transcript/${t}/${r}`;if(n){let u=new URLSearchParams;u.set("chars_per_caption",n.toString()),o+=`?${u.toString()}`}return await(await this.fetch(o)).text()}redactions(t){return this.redactedAudio(t)}redactedAudio(t){return this.fetchJson(`/v2/transcript/${t}/redacted-audio`)}async redactedAudioFile(t){let{redacted_audio_url:r,status:n}=await this.redactedAudio(t);if(n!=="redacted_audio_ready")throw new Error(`Redacted audio status is ${n}`);let o=await fetch(r);if(!o.ok)throw new Error(`Failed to fetch redacted audio: ${o.statusText}`);return{arrayBuffer:o.arrayBuffer.bind(o),blob:o.blob.bind(o),body:o.body,bodyUsed:o.bodyUsed}}},Ty=i(async e=>sp.Readable.toWeb((0,ap.createReadStream)(e)),"readFile"),ai=class extends Et{static{i(this,"FileService")}async upload(t){let r;return typeof t=="string"?t.startsWith("data:")?r=Sy(t):r=await Ty(t):r=t,(await this.fetchJson("/v2/upload",{method:"POST",body:r,headers:{"Content-Type":"application/octet-stream"},duplex:"half"})).upload_url}};function Sy(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=atob(t[1]),o=n.length,a=new Uint8Array(o);for(;o--;)a[o]=n.charCodeAt(o);return new Blob([a],{type:r})}i(Sy,"dataUrlToBlob");var Ey="https://api.assemblyai.com",tn=class{static{i(this,"AssemblyAI")}constructor(t){t.baseUrl=t.baseUrl||Ey,t.baseUrl&&t.baseUrl.endsWith("/")&&(t.baseUrl=t.baseUrl.slice(0,-1)),this.files=new ai(t),this.transcripts=new ii(t,this.files),this.lemur=new ti(t),this.realtime=new oi(t)}};var up={name:"@activepieces/piece-assemblyai",version:"1.1.7",main:"./dist/src/index.js",types:"./dist/src/index.d.ts",scripts:{build:"tsc -p tsconfig.lib.json && cp package.json dist/",bundle:"node ../../../../dist/packages/cli/src/index.js pieces bundle",generate:"tsx ./scripts/generateFromSpec.ts",lint:"eslint 'src/**/*.ts'"},devDependencies:{"@readme/openapi-parser":"^2.6.0","@types/node":"^24",dotenv:"^16.4.5",mergician:"^2.0.2","title-case":"^4.3.1",tsx:"^4.19.0",typescript:"^5.6.2",tslib:"2.6.2"},dependencies:{"@activepieces/pieces-common":"workspace:*","@activepieces/pieces-framework":"workspace:*",assemblyai:"4.7.0","@activepieces/core-piece-types":"workspace:*","@activepieces/core-utils":"workspace:*"}};var si="https://api.assemblyai.com",q=i(e=>{if(!e.auth)throw new Error("The AssemblyAI API key is required.");return new tn({apiKey:e.auth.secret_text,userAgent:{integration:{name:"Activepieces",version:up.version}},baseUrl:si})},"getAssemblyAIClient");var F=Qn.SecretText({displayName:"API Key",required:!0,description:"You can retrieve your AssemblyAI API key within your AssemblyAI [Account Settings](https://www.assemblyai.com/app/account?utm_source=activepieces).",validate:i(async({auth:e})=>{if(!e)return{valid:!1,error:"The AssemblyAI API key is required."};try{return(await wr.sendRequest({method:"GET",url:`${si}/v2/account`,headers:{Authorization:e}})).status!==200?{valid:!1,error:"The AssemblyAI API key is invalid."}:{valid:!0}}catch{return{valid:!1,error:"The AssemblyAI API key is invalid."}}},"validate")});var rn=Z({name:"uploadFile",auth:F,requireAuth:!0,displayName:"Upload File",description:"Upload a media file to AssemblyAI's servers.",audience:"both",aiMetadata:{description:"Uploads a local audio or video file to AssemblyAI and returns an upload URL that can be passed to the Transcribe action. Use this when the media is a file (not already a publicly reachable URL) that AssemblyAI must access. Each call uploads a new copy, so it is not idempotent.",idempotent:!1},props:{file:P.File({displayName:"Audio File",description:"The File or URL of the audio or video file.",required:!0})},async run(e){return await q(e).files.upload(e.propsValue.file.data)}});var cp={audio_url:P.ShortText({displayName:"Audio URL",required:!0,description:"The URL of the audio or video file to transcribe."}),language_code:P.StaticDropdown({displayName:"Language Code",required:!1,description:`The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
|
10
|
+
`+r)}i(ir,"abortHandshake");function ot(e,t,r,n,o,a){if(e.listenerCount("wsClientError")){let u=new Error(o);Error.captureStackTrace(u,ot),e.emit("wsClientError",u,r,t)}else ir(r,n,o,a)}i(ot,"abortHandshakeOrEmitwsClientError")});var dv={};_i(dv,{assemblyai:()=>pv});module.exports=jp(dv);var Bp=Object.freeze({status:"aborted"});function S(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:u,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=u.prototype,v=Object.keys(h);for(let b=0;b<v.length;b++){let _=v[b];_ in l||(l[_]=h[_].bind(l))}}i(n,"init");let o=r?.Parent??Object;class a extends o{static{i(this,"Definition")}}Object.defineProperty(a,"name",{value:e});function u(l){var f;let h=r?.Parent?new a:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let v of h._zod.deferred)v();return h}return i(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}i(S,"$constructor");var Pe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ur=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Tn={};function Ae(e){return e&&Object.assign(Tn,e),Tn}i(Ae,"config");function Sn(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Sn,"getEnumValues");function Pi(e,t){return typeof t=="bigint"?t.toString():t}i(Pi,"jsonStringifyReplacer");function lr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(lr,"cached");function Ti(e){return e==null}i(Ti,"nullish");function pr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(pr,"cleanRegex");var bi=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bi)return n===void 0&&(n=bi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(Y,"defineLazy");var In="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(zt,"isObject");var Fp=lr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ei(e){if(zt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(zt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Ei,"isPlainObject");var Si=new Set(["string","number","symbol"]);function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(it,"escapeRegex");function dr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(dr,"clone");function H(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>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:i(()=>t.error,"error")}:t}i(H,"normalizeParams");function Ii(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Ii,"optionalKeys");var Ai={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 at(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(at,"aborted");function Me(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Me,"prefixIssues");function cr(e){return typeof e=="string"?e:e?.message}i(cr,"unwrapMessage");function Le(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=cr(e.inst?._zod.def?.error?.(e))??cr(t?.error?.(e))??cr(r.customError?.(e))??cr(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Le,"finalizeIssue");function $i(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i($i,"getLengthableOrigin");function An(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(An,"issue");var zi=i((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,Pi,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),wi=S("$ZodError",zi),wt=S("$ZodError",zi,{Parent:Error});var Zp=i(e=>(t,r,n,o)=>{let a=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise)throw new Pe;if(u.issues.length){let l=new(o?.Err??e)(u.issues.map(f=>Le(f,a,Ae())));throw In(l,o?.callee),l}return u.value},"_parse"),fr=Zp(wt),qp=i(e=>async(t,r,n,o)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},a);if(u instanceof Promise&&(u=await u),u.issues.length){let l=new(o?.Err??e)(u.issues.map(f=>Le(f,a,Ae())));throw In(l,o?.callee),l}return u.value},"_parseAsync"),mr=qp(wt),Hp=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Pe;return a.issues.length?{success:!1,error:new(e??wi)(a.issues.map(u=>Le(u,o,Ae())))}:{success:!0,data:a.value}},"_safeParse"),kt=Hp(wt),Wp=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:r,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(u=>Le(u,o,Ae())))}:{success:!0,data:a.value}},"_safeParseAsync"),Ot=Wp(wt);var Gp="(?:(?:\\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])))",Kp=new RegExp(`^${Gp}$`);var ki=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Oi=/^-?\d+n?$/,Ri=/^-?\d+$/,$n=/^-?\d+(?:\.\d+)?$/,Ni=/^(?:true|false)$/i;var je=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Jp={number:"number",bigint:"bigint",object:"date"};var Di=S("$ZodCheckGreaterThan",(e,t)=>{je.init(e,t);let r=Jp[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,a=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Ci=S("$ZodCheckNumberFormat",(e,t)=>{je.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,a]=Ai[t.format];e._zod.onattach.push(u=>{let l=u._zod.bag;l.format=t.format,l.minimum=o,l.maximum=a,r&&(l.pattern=Ri)}),e._zod.check=u=>{let l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&u.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>a&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}});var Ui=S("$ZodCheckMinLength",(e,t)=>{var r;je.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!Ti(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let u=$i(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var zn=S("$ZodCheckStringFormat",(e,t)=>{var r,n;je.init(e,t),e._zod.onattach.push(o=>{let a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Mi=S("$ZodCheckRegex",(e,t)=>{zn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var ji={major:4,minor:3,patch:6};var J=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ji;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let a of o._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((u,l,f)=>{let h=at(u),v;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(h)continue;let _=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&f?.async===!1)throw new Pe;if(v||c instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await c,u.issues.length!==_&&(h||(h=at(u,_)))});else{if(u.issues.length===_)continue;h||(h=at(u,_))}}return v?v.then(()=>u):u},"runChecks"),a=i((u,l,f)=>{if(at(u))return u.aborted=!0,u;let h=o(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new Pe;return h.then(v=>e._zod.parse(v,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){let h=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(v=>a(v,u,l)):a(h,u,l)}let f=e._zod.parse(u,l);if(f instanceof Promise){if(l.async===!1)throw new Pe;return f.then(h=>o(h,n,l))}return o(f,n,l)}}Y(e,"~standard",()=>({validate:i(o=>{try{let a=kt(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Ot(e,o).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),yr=S("$ZodString",(e,t)=>{J.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ki(e._zod.bag),e._zod.parse=(r,n)=>{if(t.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:e}),r}}),wn=S("$ZodStringFormat",(e,t)=>{zn.init(e,t),yr.init(e,t)});var qi=S("$ZodURL",(e,t)=>{wn.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var kn=S("$ZodNumber",(e,t)=>{J.init(e,t),e._zod.pattern=e._zod.bag.pattern??$n,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let a=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...a?{received:a}:{}}),r}}),Hi=S("$ZodNumberFormat",(e,t)=>{Ci.init(e,t),kn.init(e,t)}),On=S("$ZodBoolean",(e,t)=>{J.init(e,t),e._zod.pattern=Ni,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Wi=S("$ZodBigInt",(e,t)=>{J.init(e,t),e._zod.pattern=Oi,e._zod.parse=(r,n)=>{if(t.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:e}),r}});var Gi=S("$ZodAny",(e,t)=>{J.init(e,t),e._zod.parse=r=>r}),Ki=S("$ZodUnknown",(e,t)=>{J.init(e,t),e._zod.parse=r=>r});var Ji=S("$ZodVoid",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Xi=S("$ZodDate",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,a=o instanceof Date;return a&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...a?{received:"Invalid Date"}:{},inst:e}),r}});function Bi(e,t,r){e.issues.length&&t.issues.push(...Me(r,e.issues)),t.value[r]=e.value}i(Bi,"handleArrayResult");var Yi=S("$ZodArray",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let a=[];for(let u=0;u<o.length;u++){let l=o[u],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?a.push(f.then(h=>Bi(h,r,u))):Bi(f,r,u)}return a.length?Promise.all(a).then(()=>r):r}});function gr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Me(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(gr,"handlePropertyResult");function Xp(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Ii(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Xp,"normalizeDef");function Yp(e,t,r,n,o,a){let u=[],l=o.keySet,f=o.catchall._zod,h=f.def.type,v=f.optout==="optional";for(let b in t){if(l.has(b))continue;if(h==="never"){u.push(b);continue}let _=f.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(c=>gr(c,r,b,t,v))):gr(_,r,b,t,v)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}i(Yp,"handleCatchall");var Qi=S("$ZodObject",(e,t)=>{if(J.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=lr(()=>Xp(t));Y(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let v=l[h]._zod;if(v.values){f[h]??(f[h]=new Set);for(let b of v.values)f[h].add(b)}}return f});let o=zt,a=t.catchall,u;e._zod.parse=(l,f)=>{u??(u=n.value);let h=l.value;if(!o(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let v=[],b=u.shape;for(let _ of u.keys){let c=b[_],p=c._zod.optout==="optional",g=c._zod.run({value:h[_],issues:[]},f);g instanceof Promise?v.push(g.then(m=>gr(m,l,_,h,p))):gr(g,l,_,h,p)}return a?Yp(v,h,l,f,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function Fi(e,t,r,n){for(let a of e)if(a.issues.length===0)return t.value=a.value,t;let o=e.filter(a=>!at(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(a=>a.issues.map(u=>Le(u,n,Ae())))}),t)}i(Fi,"handleUnionResults");var Rn=S("$ZodUnion",(e,t)=>{J.init(e,t),Y(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>pr(a.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(r)return n(o,a);let u=!1,l=[];for(let f of t.options){let h=f._zod.run({value:o.value,issues:[]},a);if(h instanceof Promise)l.push(h),u=!0;else{if(h.issues.length===0)return h;l.push(h)}}return u?Promise.all(l).then(f=>Fi(f,o,e,a)):Fi(l,o,e,a)}});var ea=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Rn.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let o={};for(let a of t.options){let u=a._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let[l,f]of Object.entries(u)){o[l]||(o[l]=new Set);for(let h of f)o[l].add(h)}}return o});let n=lr(()=>{let o=t.options,a=new Map;for(let u of o){let l=u._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let f of l){if(a.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);a.set(f,u)}}return a});e._zod.parse=(o,a)=>{let u=o.value;if(!zt(u))return o.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),o;let l=n.value.get(u?.[t.discriminator]);return l?l._zod.run(o,a):t.unionFallback?r(o,a):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),o)}});var ta=S("$ZodRecord",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Ei(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let a=[],u=t.keyType._zod.values;if(u){r.value={};let l=new Set;for(let h of u)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let v=t.valueType._zod.run({value:o[h],issues:[]},n);v instanceof Promise?a.push(v.then(b=>{b.issues.length&&r.issues.push(...Me(h,b.issues)),r.value[h]=b.value})):(v.issues.length&&r.issues.push(...Me(h,v.issues)),r.value[h]=v.value)}let f;for(let h in o)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&$n.test(l)&&f.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>Le(b,n,Ae())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:o[l],issues:[]},n);v instanceof Promise?a.push(v.then(b=>{b.issues.length&&r.issues.push(...Me(l,b.issues)),r.value[f.value]=b.value})):(v.issues.length&&r.issues.push(...Me(l,v.issues)),r.value[f.value]=v.value)}}return a.length?Promise.all(a).then(()=>r):r}});var ra=S("$ZodEnum",(e,t)=>{J.init(e,t);let r=Sn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Si.has(typeof o)).map(o=>typeof o=="string"?it(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{let u=o.value;return n.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),na=S("$ZodLiteral",(e,t)=>{if(J.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?it(n):n?it(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let a=n.value;return r.has(a)||n.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),n}});var oa=S("$ZodTransform",(e,t)=>{J.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new ur(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(u=>(r.value=u,r));if(o instanceof Promise)throw new Pe;return r.value=o,r}});function Vi(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Vi,"handleOptionalResult");var ia=S("$ZodOptional",(e,t)=>{J.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${pr(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(a=>Vi(a,r.value)):Vi(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var aa=S("$ZodNullable",(e,t)=>{J.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${pr(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var sa=S("$ZodPipe",(e,t)=>{J.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let a=t.out._zod.run(r,n);return a instanceof Promise?a.then(u=>hr(u,t.in,n)):hr(a,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>hr(a,t.out,n)):hr(o,t.out,n)}});function hr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(hr,"handlePipeResult");var ua=S("$ZodCustom",(e,t)=>{je.init(e,t),J.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(a=>Zi(a,r,n,e));Zi(o,r,n,e)}});function Zi(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(An(o))}}i(Zi,"handleRefineResult");var la;var Nn=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function pa(){return new Nn}i(pa,"registry");(la=globalThis).__zod_globalRegistry??(la.__zod_globalRegistry=pa());var Dn=globalThis.__zod_globalRegistry;function da(e,t){return new e({type:"string",...H(t)})}i(da,"_string");function fa(e,t){return new e({type:"string",coerce:!0,...H(t)})}i(fa,"_coercedString");function ma(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}i(ma,"_url");function ha(e,t){return new e({type:"number",checks:[],...H(t)})}i(ha,"_number");function ga(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}i(ga,"_coercedNumber");function ya(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}i(ya,"_int");function va(e,t){return new e({type:"boolean",...H(t)})}i(va,"_boolean");function _a(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}i(_a,"_coercedBoolean");function xa(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}i(xa,"_coercedBigint");function ba(e){return new e({type:"any"})}i(ba,"_any");function Pa(e){return new e({type:"unknown"})}i(Pa,"_unknown");function Ta(e,t){return new e({type:"void",...H(t)})}i(Ta,"_void");function Ea(e,t){return new e({type:"date",coerce:!0,...H(t)})}i(Ea,"_coercedDate");function vr(e,t){return new Di({check:"greater_than",...H(t),value:e,inclusive:!0})}i(vr,"_gte");function ve(e,t){return new Ui({check:"min_length",...H(t),minimum:e})}i(ve,"_minLength");function Be(e,t){return new Mi({check:"string_format",format:"regex",...H(t),pattern:e})}i(Be,"_regex");function Sa(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(Sa,"_custom");var Q=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");J.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>fr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>kt(e,r,n),e.parseAsync=async(r,n)=>mr(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ot(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>dr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),xr=S("ZodMiniString",(e,t)=>{yr.init(e,t),Q.init(e,t)});function s(e){return da(xr,e)}i(s,"string");var Ia=S("ZodMiniStringFormat",(e,t)=>{wn.init(e,t),xr.init(e,t)});var pd=S("ZodMiniURL",(e,t)=>{qi.init(e,t),Ia.init(e,t)});function Aa(e){return ma(pd,e)}i(Aa,"url");var br=S("ZodMiniNumber",(e,t)=>{kn.init(e,t),Q.init(e,t)});function re(e){return ha(br,e)}i(re,"number");var dd=S("ZodMiniNumberFormat",(e,t)=>{Hi.init(e,t),br.init(e,t)});function $a(e){return ya(dd,e)}i($a,"int");var Cn=S("ZodMiniBoolean",(e,t)=>{On.init(e,t),Q.init(e,t)});function B(e){return va(Cn,e)}i(B,"boolean");var za=S("ZodMiniBigInt",(e,t)=>{Wi.init(e,t),Q.init(e,t)});var fd=S("ZodMiniAny",(e,t)=>{Gi.init(e,t),Q.init(e,t)});function Nt(){return ba(fd)}i(Nt,"any");var md=S("ZodMiniUnknown",(e,t)=>{Ki.init(e,t),Q.init(e,t)});function N(){return Pa(md)}i(N,"unknown");var hd=S("ZodMiniVoid",(e,t)=>{Ji.init(e,t),Q.init(e,t)});function wa(e){return Ta(hd,e)}i(wa,"_void");var ka=S("ZodMiniDate",(e,t)=>{Xi.init(e,t),Q.init(e,t)});var gd=S("ZodMiniArray",(e,t)=>{Yi.init(e,t),Q.init(e,t)});function w(e,t){return new gd({type:"array",element:e,...H(t)})}i(w,"array");var yd=S("ZodMiniObject",(e,t)=>{Qi.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function d(e,t){let r={type:"object",shape:e??{},...H(t)};return new yd(r)}i(d,"object");var vd=S("ZodMiniUnion",(e,t)=>{Rn.init(e,t),Q.init(e,t)});function U(e,t){return new vd({type:"union",options:e,...H(t)})}i(U,"union");var _d=S("ZodMiniDiscriminatedUnion",(e,t)=>{ea.init(e,t),Q.init(e,t)});function Fe(e,t,r){return new _d({type:"union",options:t,discriminator:e,...H(r)})}i(Fe,"discriminatedUnion");var xd=S("ZodMiniRecord",(e,t)=>{ta.init(e,t),Q.init(e,t)});function D(e,t,r){return new xd({type:"record",keyType:e,valueType:t,...H(r)})}i(D,"record");var bd=S("ZodMiniEnum",(e,t)=>{ra.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function $(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new bd({type:"enum",entries:r,...H(t)})}i($,"_enum");var Pd=S("ZodMiniLiteral",(e,t)=>{na.init(e,t),Q.init(e,t)});function A(e,t){return new Pd({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}i(A,"literal");var Td=S("ZodMiniTransform",(e,t)=>{oa.init(e,t),Q.init(e,t)});function Ve(e){return new Td({type:"transform",transform:e})}i(Ve,"transform");var Ed=S("ZodMiniOptional",(e,t)=>{ia.init(e,t),Q.init(e,t)});function y(e){return new Ed({type:"optional",innerType:e})}i(y,"optional");var Sd=S("ZodMiniNullable",(e,t)=>{aa.init(e,t),Q.init(e,t)});function Dt(e){return new Sd({type:"nullable",innerType:e})}i(Dt,"nullable");var Id=S("ZodMiniPipe",(e,t)=>{sa.init(e,t),Q.init(e,t)});function Ze(e,t){return new Id({type:"pipe",in:e,out:t})}i(Ze,"pipe");var Ad=S("ZodMiniCustom",(e,t)=>{ua.init(e,t),Q.init(e,t)});function Pr(e,t){return Sa(Ad,e??(()=>!0),t)}i(Pr,"custom");var Ct={};_i(Ct,{bigint:()=>Rd,boolean:()=>Od,date:()=>Nd,number:()=>kd,string:()=>wd});function wd(e){return fa(xr,e)}i(wd,"string");function kd(e){return ga(br,e)}i(kd,"number");function Od(e){return _a(Cn,e)}i(Od,"boolean");function Rd(e){return xa(za,e)}i(Rd,"bigint");function Nd(e){return Ea(ka,e)}i(Nd,"date");var Mn=d({retryOnFailure:d({defaultValue:y(B()),hide:y(B())}),continueOnFailure:d({defaultValue:y(B()),hide:y(B())})}),Un=class{constructor(t,r,n,o,a,u,l,f,h,v,b,_,c){this.name=t;this.displayName=r;this.description=n;this.props=o;this.propertyGroups=a;this.run=u;this.test=l;this.requireAuth=f;this.errorHandlingOptions=h;this.outputSchema=v;this.audience=b;this.aiMetadata=_;this.classification=c}static{i(this,"IAction")}},Z=i(e=>new Un(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 j=d({displayName:s(),description:y(s()),advanced:y(B()),width:y($(["half","full"])),icon:y(s()),placeholder:y(s())}),C=i((e,t)=>d({type:A(t),required:B(),defaultValue:y(Nt())}),"TPropertyValue");var ce=d({...j.shape,...C(s(),"SHORT_TEXT").shape}),$e=d({...j.shape,...C(s(),"LONG_TEXT").shape});var Ra=d({label:s(),value:N(),description:y(s()),icon:y(s())}),Tr=d({disabled:y(B()),placeholder:y(s()),options:w(Ra)});var Cd=$(["cards"]),le=d({...j.shape,options:Tr,display:y(Cd),...C(N(),"STATIC_DROPDOWN").shape}),ze=d({...j.shape,options:Tr,...C(w(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ln=d({...j.shape,...C(N(),"DROPDOWN").shape,refreshers:w(s())}),Ut=d({...j.shape,...C(w(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:w(s())});var we=d({...j.shape,reveals:y(w(s())),...C(B(),"CHECKBOX").shape});var ke=d({...j.shape,display:y($(["stepper"])),min:y(re()),max:y(re()),step:y(re()),...C(re(),"NUMBER").shape});var Mt=d({...j.shape,streaming:y(B()),...C(N(),"FILE").shape});var Lt=d({...j.shape,...C(s(),"DATE_TIME").shape});var Na=D(s(),U([ce,$e,le,Ut,ze,we,ke,Mt,Lt])),jt=d({...j.shape,properties:Na,...C(w(N()),"ARRAY").shape});var Da=$(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Ca=d({preset:y(Da),after:y(s()),before:y(s())}),jn=d({...j.shape,display:y($(["dropdown"])),...C(Ca,"DATE_RANGE").shape});var Bt=d({...j.shape,...C(U([D(s(),N())]),"JSON").shape});var Ua=U([ce,le,Bt,jt,ze]),Ud=D(s(),Ua),Bn=d({refreshers:w(s()),...j.shape,...C(N(),"DYNAMIC").shape});var Er=d({...j.shape,...C(wa(),"MARKDOWN").shape});var Ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ft||{}),st=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(st||{}),ut=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(ut||{});var Vt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Vt||{}),Fn="both_client_credentials_and_authorization_code";var Je=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Je||{}),Zt=(a=>(a.NONE="NONE",a.HEADER_PRESENT="HEADER_PRESENT",a.QUERY_PRESENT="QUERY_PRESENT",a.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",a.HEAD_REQUEST="HEAD_REQUEST",a))(Zt||{}),Md=d({strategy:$(Zt),paramName:y(s())}),qt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(qt||{});var Sr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Sr||{}),Ma=d({status:y(re()),body:y(N()),headers:y(D(s(),s()))}),La=d({type:A("DELAY"),resumeDateTime:s(),requestIdToReply:y(s()),handlerId:y(s()),streamStepProgress:y($(Sr))}),ja=d({type:A("WEBHOOK"),requestId:s(),requestIdToReply:y(s()),response:Ma,handlerId:y(s()),streamStepProgress:y($(Sr))}),Ld=U([La,ja]);var jd=d({body:N(),rawBody:y(N()),headers:D(s(),s()),queryParams:D(s(),s())});function _e(e){return e==null}i(_e,"isNil");function Ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(Ht,"isEmpty");function Ir(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Ir,"assertNotNullOrUndefined");var Vn=ae(require("crypto"),1);var Bd=128,qe,ct,Fd=i(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!qe||qe.length<e?(qe=Buffer.allocUnsafe(e*Bd),Vn.default.randomFillSync(qe),ct=0):ct+e>qe.length&&(Vn.default.randomFillSync(qe),ct=0)}catch(t){throw qe=void 0,t}ct+=e},"fillPool"),Vd=i(e=>(Fd(e|=0),qe.subarray(ct-e,ct)),"random"),Zd=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(a=t)=>{if(a<=0)return"";let u="";for(;;){let l=r(o),f=o;for(;f--;)if(u+=e[l[f]&n]||"",u.length===a)return u}}},"customRandom"),Fa=i((e,t=21)=>Zd(e,t,Vd),"customAlphabet");var qd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Va=21,JA=s().check(Be(new RegExp(`^[0-9a-zA-Z]{${Va}}$`))),Hd=Fa(qd,Va);var He=Ze(Ve(e=>e instanceof Date?e.toISOString():e),s()),de={id:s(),created:He,updated:He},K=i(e=>y(Dt(e)),"Nullable");function Zn(e){return y(Dt($(e)))}i(Zn,"NullableEnum");var QA=Ze(Ve(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Ar=i(e=>Ze(Ve(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(w(e))),"OptionalArrayFromQuery");var r$=D(s(),N());var Wt=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(Wt||{});var m$=s().check(Be(/^#[0-9A-Fa-f]{6}$/));var g$=d({filename:s(),data:N(),type:A("file"),mimetype:y(s())});var Wd=ae(qa());var T$=d({...de,name:s(),permissions:w(s()),platformId:K(s()),type:s(),userCount:y(re())});var Ha=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ha||{}),qn=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(qn||{}),Hn=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Hn||{});var Wn=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Wn||{});var Gn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Gn||{});var Gd=d({mode:$(Ha),value:N()}),Kd=d({auth:y(s()),fields:D(s(),Gd)}),Jd=d({pieceName:s(),pieceVersion:s(),actionName:s(),predefinedInput:y(Kd)}),Xd=d({type:A("PIECE"),toolName:s().check(ve(1)),pieceMetadata:Jd}),Yd=d({type:A("none")}),Qd=d({type:A("access_token"),accessToken:s()}),ef=d({type:A("api_key"),apiKey:s(),apiKeyHeader:s()}),tf=d({type:A("headers"),headers:D(s(),s())}),rf=Fe("type",[Yd,Qd,ef,tf]),Wa=d({type:A("FLOW"),toolName:s().check(ve(1)),externalFlowId:s(),flowDisplayName:y(s())}),Ga=d({type:A("MCP"),toolName:s().check(ve(1)),serverUrl:Aa(),protocol:$(Hn),auth:rf}),Ka=d({type:A("KNOWLEDGE_BASE"),toolName:s().check(ve(1)),sourceType:$(qn),sourceId:s(),sourceName:s()}),nf=Fe("type",[Xd,Wa,Ga,Ka]),of=d({displayName:s(),description:y(s()),type:$(Wn)}),Ja=d({type:A("MARKDOWN"),markdown:s()}),lt={type:A("TOOL_CALL"),input:K(D(s(),N())),output:y(N()),toolName:s(),status:$(Gn),toolCallId:s(),startTime:s(),endTime:y(s())},ez=d(lt),Xa=Fe("toolCallType",[d({...lt,toolCallType:A("PIECE"),pieceName:s(),pieceVersion:s(),actionName:s()}),d({...lt,toolCallType:A("FLOW"),displayName:s(),externalFlowId:s()}),d({...lt,toolCallType:A("MCP"),displayName:s(),serverUrl:s()}),d({...lt,toolCallType:A("KNOWLEDGE_BASE"),displayName:s(),sourceType:s()}),d({...lt,toolCallType:A("UNKNOWN"),displayName:s()})]),af=U([Ja,Xa]);var Kn=(r=>(r.IMAGE="image",r.TEXT="text",r))(Kn||{}),Oe=d({apiKey:s()}),sf=Oe,uf=d({apiKey:s(),apiKeyHash:s()}),cf=Oe,lf=Oe,pf=Oe,df=Oe,ff=Oe,mf=Oe,hf=Oe,rs=d({accessKeyId:s().check(ve(1)),secretAccessKey:s().check(ve(1))}),gf=d({}),yf=d({}),vf=d({}),_f=d({}),xf=d({}),bf=d({}),ns=d({modelId:s(),modelName:s(),modelType:$(Kn)}),os=d({apiKeyHeader:s(),baseUrl:s(),models:w(ns),defaultHeaders:y(D(s(),s()))}),is=d({accountId:s(),gatewayId:s(),models:w(ns),vertexProject:y(s()),vertexRegion:y(s())}),as=d({resourceName:s(),apiVersion:Ze(Ve(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(s()))}),ss=d({region:s().check(ve(1))}),Pf=U([sf,pf,df,ff,mf,lf,cf,uf,rs,hf]),us=U([os,is,as,ss,gf,vf,_f,xf,yf,bf]),Tf=d({id:s(),name:s(),type:$(Kn)}),Ef=d({id:s(),name:s(),provider:$(Wt),config:us,enabledForChat:B()}),Sf=d({provider:$(Wt),config:us,auth:Pf,platformId:s()});var oz={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ya=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],If=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Af=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Qa=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],$f=["grok-4.20","grok-4.1-fast"],zf={openai:Ya,anthropic:If,google:Qa,activepieces:[...Af.map(e=>`anthropic/${e}`),...Ya.map(e=>`openai/${e}`),...Qa.map(e=>`google/${e}`),...$f.map(e=>`x-ai/${e}`)]};var es=128e3,wf={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function kf({provider:e}){return e?wf[e]??es:es}i(kf,"getMaxContextTokens");var ts={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"},Of={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Rf=new Set(["anthropic","mistral"]);function Te(e){return{chatModels:zf[e],maxContextTokens:kf({provider:e}),defaultEmbeddingModel:ts[e],supportsEmbedding:ts[e]!==void 0,supportsImageGeneration:!Rf.has(e),webSearch:Of[e]}}i(Te,"buildProviderCapabilities");var Nf={openai:Te("openai"),anthropic:Te("anthropic"),openrouter:Te("openrouter"),azure:Te("azure"),google:Te("google"),"cloudflare-gateway":Te("cloudflare-gateway"),custom:Te("custom"),bedrock:Te("bedrock"),mistral:Te("mistral"),activepieces:Te("activepieces")};var Df=d({base64Url:s(),fileName:s(),extension:y(s())}),Cf=d({mimeType:s(),url:s(),fileName:y(s())}),Jn=U([Df,Cf]);var Uf=U([d({type:A("file"),value:Jn}),d({type:A("markdown"),value:s(),files:y(w(Jn))})]),Mf=d({sessionId:s(),message:s(),files:y(w(s()))});var ls=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ls||{}),ps=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ps||{}),Xn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Xn||{});var Lf=U([d({...de,name:s(),externalId:s(),type:A("STATIC_DROPDOWN"),tableId:s(),projectId:s(),data:d({options:w(d({value:s()}))})}),d({...de,name:s(),externalId:s(),type:U([A("TEXT"),A("NUMBER"),A("DATE"),A("DATETIME")]),tableId:s(),projectId:s()})]),jf=d({...de,name:s(),folderId:K(s()),projectId:s(),externalId:s(),status:Zn(ps),trigger:Zn(ls)}),Bf=d({...de,tableId:s(),projectId:s(),cells:D(s(),d({updated:s(),created:s(),value:N(),fieldName:s()}))}),Ff=d({events:w($(Xn)),webhookUrl:s(),flowId:s()}),Vf=d({fields:w(d({id:s(),name:s()})),rows:w(D(s(),s())),name:s()}),Zf=d({projectId:s(),limit:y(Ct.number()),cursor:y(s()),name:y(s()),externalIds:Ar(s()),folderId:y(s()),folderIds:Ar(s())}),qf=d({records:w(w(d({fieldId:s(),value:fs()}))),tableId:s()}),Hf=d({cells:y(w(d({fieldId:s(),value:fs()}))),tableId:s(),agentUpdate:y(B())}),ds=Fe("operator",[Xe("eq"),Xe("neq"),Xe("gt"),Xe("gte"),Xe("lt"),Xe("lte"),Xe("co"),cs("exists"),cs("not_exists")]),Wf=d({tableId:s(),limit:y(Ct.number()),cursor:y(s()),filters:Ar(ds)});function fs(){return Ze(Ve(e=>e==null?e:String(e)),Dt(s()))}i(fs,"coerceToString");function Xe(e){return d({fieldId:s(),operator:A(e),value:s()})}i(Xe,"valueFilter");function cs(e){return d({fieldId:s(),operator:A(e)})}i(cs,"existenceFilter");var Gf=d({status:y(re()),body:y(N()),headers:y(D(s(),s()))}),Kf=d({...de,deleted:K(He),ownerId:s(),displayName:s(),platformId:s(),externalId:K(s())});var ms=d({name:s(),description:y(s()),type:s(),required:B()}),Jf=d({pieceName:s(),triggerName:s(),input:d({toolName:s(),toolDescription:s(),inputSchema:w(ms),returnsResponse:B()})});var hs="^[0-9]+\\.[0-9]+\\.[0-9]+$",Tz=new RegExp(hs),Yf="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",Ez=s().check(Be(new RegExp(hs))),Sz=s().check(Be(new RegExp(Yf))),Qf=d({packageType:A("ARCHIVE"),pieceType:$(st),pieceName:s(),pieceVersion:s(),archiveId:s(),platformId:s()}),gs=d({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:s(),pieceVersion:s()}),ys=d({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:s(),pieceVersion:s(),platformId:s()}),Iz=U([gs,ys]),Az=U([Qf,gs,ys]);var em=Fe("type",[d({type:A("CRON_EXPRESSION"),cronExpression:s(),timezone:s()}),d({type:A("INTERVAL"),intervalMs:$a().check(vr(6e4))})]),$z=d({...de,type:$(Je),projectId:s(),flowId:s(),triggerName:s(),schedule:K(em),flowVersionId:s(),pieceName:s(),pieceVersion:s(),deleted:K(s()),simulate:B()}),vs=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(vs||{}),_s=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(_s||{}),xs=(r=>(r.S3="S3",r.DB="DB",r))(xs||{}),zz=d({...de,projectId:K(s()),platformId:K(s()),type:$(vs),compression:$(_s),data:y(N()),location:$(xs),size:K(re()),fileName:K(s()),s3Key:K(s()),metadata:K(D(s(),s()))}),bs=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(bs||{}),Ps=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ps||{}),wz=d({id:s(),email:s(),firstName:s(),status:$(Ps),externalId:K(s()),platformId:K(s()),platformRole:$(bs),lastName:s(),created:He,updated:He,lastActiveDate:K(He),imageUrl:K(s())});var Qn=d({...j.shape,...C(D(s(),N()),"OBJECT").shape});var eo=d({...j.shape,formatProperty:y(s()),...C(s(),"RICH_TEXT").shape});var Ss=d({...j.shape,...C(s(),"COLOR").shape});var to=U([ce,$e,eo,Er,we,le,ze,Ln,Ut,Bn,ke,jt,Qn,Bt,Lt,jn,Mt,Ss]),P={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 Ee=d({displayName:s(),description:y(s()),hasConnectionIdentifier:y(B())});var Is=d({username:s(),password:s()}),ro=d({...Ee.shape,username:d({displayName:s(),description:y(s())}),password:d({displayName:s(),description:y(s())}),...C(Is,"BASIC_AUTH").shape});var om=D(s(),U([ce,$e,ke,we,le])),no=d({...Ee.shape,props:om,...C(N(),"CUSTOM_AUTH").shape});var Ye=d({...Ee.shape,...C(d({auth:s()}),"SECRET_TEXT").shape});var im=D(s(),U([ce,$e,Ye,ke,we,le,ze,Er])),As=d({...Ee.shape,props:im,...C(N(),"OIDC").shape});var oo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(oo||{}),$s=U([ce,Ye,le]),zs=D(s(),$s),am=d({props:y(D(s(),$s)),authUrl:s(),tokenUrl:s(),scope:w(s()),prompt:y(U([A("none"),A("consent"),A("login"),A("omit")])),pkce:y(B()),pkceMethod:y(U([A("plain"),A("S256")])),authorizationMethod:y($(oo)),grantType:y(U([$(Vt),A(Fn)])),extra:y(D(s(),s()))}),ws=d({access_token:s(),props:y(zs),data:D(s(),Nt())}),io=d({...Ee.shape,...am.shape,...C(ws,"OAUTH2").shape});var pt=U([ro,no,As,io,Ye]),Gt="Connection",ao={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Gt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Gt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Gt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Gt}},None(){}};var fk={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 sm=d({...j.shape,...C(N(),"CUSTOM").shape,code:s()});var um=U([to,pt]),so=D(s(),um),Nk=D(s(),to);var ks=U([d({strategy:A("CRON"),cronExpression:s()}),d({strategy:A("NONE")})]);var Os="2",zr="0.82.0";var uo=class{constructor(t,r,n,o,a,u,l,f,h=zr,v,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=v;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Os}),"getContextInfo");(!lm(h)||pm(h,zr))&&(this.minimumSupportedRelease=zr),a.forEach(c=>this._actions[c.name]=c),u.forEach(c=>this._triggers[c.name]=c)}static{i(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:cm(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}},Ns=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(a=>a.type===r.type)))throw new Error("Auth properties must be unique by type");return new uo(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 cm(e){if(e!==void 0)return Array.isArray(e)?e.map(Rs):Rs(e)}i(cm,"withConnectionIdentifierFlag");function Rs(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}i(Rs,"flagConnectionIdentifier");function lm(e){return/^\d+\.\d+\.\d+$/.test(e)}i(lm,"isValidSimpleSemver");function pm(e,t){let[r,n,o]=e.split(".").map(Number),[a,u,l]=t.split(".").map(Number);return r!==a?r<a:n!==u?n<u:o<l}i(pm,"isSemverLessThan");var dm=y(D(s(),D(s(),s()))),Ds=d({id:y(s()),name:s(),displayName:s(),logoUrl:s(),description:s(),authors:w(s()),platformId:y(s()),directoryPath:y(s()),auth:y(U([pt,w(pt)])),version:s(),categories:y(w($(ut))),minimumSupportedRelease:y(s()),maximumSupportedRelease:y(s()),deprecated:y(B()),i18n:dm}),fm=$(["human","ai","both"]),Cs=d({description:y(s()),idempotent:y(B())}),Us=$(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var mm=$(["tabs","section","summary","builder","footer"]),Ms=d({key:s(),display:mm,label:y(s()),description:y(s()),icon:y(s()),props:w(s())}),Ls=d({name:s(),displayName:s(),description:s(),props:so,propertyGroups:y(w(Ms)),requireAuth:B(),errorHandlingOptions:y(Mn),outputSchema:y(Pr()),audience:y(fm),aiMetadata:y(Cs),classification:y(Us)}),js=d({name:s(),displayName:s(),description:s(),props:so,propertyGroups:y(w(Ms)),errorHandlingOptions:y(Mn),type:$(Je),sampleData:N(),handshakeConfiguration:y(Pr()),renewConfiguration:y(ks),testStrategy:$(qt),outputSchema:y(Pr()),aiMetadata:y(Cs),classification:y(Us)}),hm=d({...Ds.shape,actions:D(s(),Ls),triggers:D(s(),js)}),gm=d({...Ds.shape,actions:re(),triggers:re(),suggestedActions:y(w(Ls)),suggestedTriggers:y(w(js))}),Bs=d({projectUsage:re(),pieceType:$(st),packageType:$(Ft),platformId:y(s()),archiveId:y(s())}),CO=d({...hm.shape,...Bs.shape}),UO=d({...gm.shape,...Bs.shape}),MO=d({name:s(),version:s()});var ym=ae(require("path")),vm=ae(require("fs/promises"));var dt=require("node:stream");var wr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((a,u)=>{o.append(u,a)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var kr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new co,r=new lo){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},co=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},lo=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Kt=class extends Error{constructor(r,n){let o=n.status||500,a=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:a},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=a}static{i(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 Fs({error:e,requestBody:t}){return e instanceof Kt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(Fs,"toFailsafeOutput");var Or=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(Or||{});var Rr=class extends wr{static{i(this,"FetchHttpClient")}constructor(t="",r=new kr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),a=this.getHeaders(t),u=t.queryParams??{};for(let[M,ee]of Object.entries(u))o.append(M,ee);let l=o.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",v=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:c,isStream:p}=_m(t.method)?xm(t.body,a):{body:void 0,extraHeaders:{},isStream:!1},g=Pm({...a,...c}),m=await bm(async()=>{let M=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ie={method:t.method.toString(),headers:g,body:_,redirect:v?"follow":"manual",signal:M.signal};return p&&(ie.duplex="half"),r?.dispatcher!==void 0&&(ie.dispatcher=r.dispatcher),await fetch(f,ie)}finally{ee!==void 0&&clearTimeout(ee)}},p?0:b),x=v?300:400;if(m.status<200||m.status>=x){let M=await Vs(m,h==="stream"?"text":h),ee=new Kt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let T=await Vs(m,h);return{status:m.status,headers:Tm(m.headers),body:T}}};function _m(e){return e!=="GET"&&e!=="HEAD"}i(_m,"acceptsRequestBody");function xm(e,t){if(qs(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Em(e)){let n=new dt.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof dt.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}}i(xm,"serializeBody");async function Vs(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return qs(e.body)?dt.Readable.from([]):dt.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Vs,"parseResponseBody");async function bm(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Zs(n);continue}return o}catch(o){if(r=o,n<t){await Zs(n);continue}throw o}throw r}i(bm,"sendWithRetries");function Zs(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Zs,"backoff");function Pm(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}i(Pm,"normalizeHeaders");function Tm(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Tm,"toHttpHeaders");function Em(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(Em,"isNodeFormData");function qs(e){return e==null}i(qs,"isNil");var Nr=new Rr;var pg=ae(require("fs")),Xc=ae(Jc());var dg={"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 fg(e){let t=e.split(";")[0].trim().toLowerCase();return dg[t]??""}i(fg,"contentTypeToExtension");var mg=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),hg=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Yc({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:a,props:u,extraProps:l,authLocation:f="headers",classification:h="WRITE"}){return Z({audience:"human",name:a||"custom_api_call",classification:h,displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:P.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:v})=>({url:P.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
11
|
+
i.e ${hg(t,v)}/resource or /resource`,required:!0,defaultValue:v?t(v):"",...u?.url??{}})}),"props")}),method:P.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Or).map(v=>({label:v,value:v}))},...u?.method??{}}),headers:P.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:P.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:P.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:P.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:v})=>{if(!v)return{};let b=v,_={};switch(b){case"none":break;case"json":_.data=P.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":_.data=P.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=P.Array({displayName:"Form Data",required:!0,properties:{fieldName:P.ShortText({displayName:"Field Name",required:!0}),fieldType:P.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:P.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:P.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:P.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:P.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:P.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:P.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async v=>{let{method:b,url:_,headers:c,queryParams:p,body:g,body_type:m,failsafe:x,timeout:T,response_is_binary:M,followRedirects:ee}=v.propsValue;Ir(b,"Method"),Ir(_,"URL");let ie=_e(r)?{}:await r(v.auth,v.propsValue),ge=_.url,At=ge.startsWith("http://")||ge.startsWith("https://")?ge:mg({baseUrl:t(v.auth),relativePath:ge}),ye={method:b,url:At,headers:{...c??{},...f==="headers"||!_e(f)?ie:{}},queryParams:{...f==="queryParams"?ie:{},...p??{}},timeout:T?T*1e3:0,followRedirects:ee};if(M&&(ye.responseType="arraybuffer"),g)if(m&&m!=="none"){let ue=g.data;if(m==="form_data"){let bn=ue,sr=new Xc.default;for(let{fieldName:gi,fieldType:yi,textFieldValue:vi,fileFieldValue:Pn}of bn)yi==="text"&&!Ht(vi)?sr.append(gi,vi):yi==="file"&&!Ht(Pn)&&sr.append(gi,Pn.data,{filename:Pn?.filename});ye.body=sr,ye.headers={...ye.headers,...sr.getHeaders()}}else ye.body=ue}else m||(ye.body=g);try{let ue=await Nr.sendRequest(ye);return await gg(v.files,ue.body,ue.status,ue.headers,M)}catch(ue){if(x)return Fs({error:ue,requestBody:ye.body});throw ue}},"run")})}i(Yc,"createCustomApiCallAction");var gg=i(async(e,t,r,n,o)=>{let a;if(o&&yg(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=fg(u??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),a=await e.write({fileName:`output.${l}`,data:f})}else a=t;return{status:r,headers:n,body:a}},"handleBinaryResponse"),yg=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var $p=require("stream/web");var qy=ae(fp(),1),Hy=ae(Yr(),1),Wy=ae(xt(),1),Gy=ae(Jo(),1),Ky=ae(Qo(),1),Jy=ae(ii(),1),Pp=ae(rn(),1),Xy=ae(bp(),1);var Tp=Pp.default;var zp=require("fs"),wp=require("stream");var si={cache:"no-store"},Yy=i(e=>ar+(e===!1?"":" AssemblyAI/1.0 ("+Object.entries({...on,...e}).map(([t,r])=>r?`${t}=${r.name}/${r.version}`:"").join(" ")+")"),"buildUserAgent"),ar="";typeof navigator<"u"&&navigator.userAgent&&(ar+=navigator.userAgent);var on={sdk:{name:"JavaScript",version:"4.7.0"}};typeof process<"u"&&(process.versions.node&&ar.indexOf("Node")===-1&&(on.runtime_env={name:"Node",version:process.versions.node}),process.versions.bun&&ar.indexOf("Bun")===-1&&(on.runtime_env={name:"Bun",version:process.versions.bun}));typeof Deno<"u"&&process.versions.bun&&ar.indexOf("Deno")===-1&&(on.runtime_env={name:"Deno",version:Deno.version.deno});var It=class{static{i(this,"BaseService")}constructor(t){this.params=t,t.userAgent===!1?this.userAgent=void 0:this.userAgent=Yy(t.userAgent||{})}async fetch(t,r){r={...si,...r};let n={Authorization:this.params.apiKey,"Content-Type":"application/json"};si?.headers&&(n={...n,...si.headers}),r?.headers&&(n={...n,...r.headers}),this.userAgent&&(n["User-Agent"]=this.userAgent,typeof window<"u"&&"chrome"in window&&(n["AssemblyAI-Agent"]=this.userAgent)),r.headers=n,t.startsWith("http")||(t=this.params.baseUrl+t);let o=await fetch(t,r);if(o.status>=400){let a,u=await o.text();if(u){try{a=JSON.parse(u)}catch{}throw a?.error?new Error(a.error):new Error(u)}throw new Error(`HTTP Error: ${o.status} ${o.statusText}`)}return o}async fetchJson(t,r){return(await this.fetch(t,r)).json()}},ui=class extends It{static{i(this,"LemurService")}summary(t){return this.fetchJson("/lemur/v3/generate/summary",{method:"POST",body:JSON.stringify(t)})}questionAnswer(t){return this.fetchJson("/lemur/v3/generate/question-answer",{method:"POST",body:JSON.stringify(t)})}actionItems(t){return this.fetchJson("/lemur/v3/generate/action-items",{method:"POST",body:JSON.stringify(t)})}task(t){return this.fetchJson("/lemur/v3/generate/task",{method:"POST",body:JSON.stringify(t)})}getResponse(t){return this.fetchJson(`/lemur/v3/${t}`)}purgeRequestData(t){return this.fetchJson(`/lemur/v3/${t}`,{method:"DELETE"})}},Ep=i((e,t)=>new Tp(e,t),"factory"),te={BadSampleRate:4e3,AuthFailed:4001,InsufficientFundsOrFreeAccount:4002,InsufficientFunds:4002,FreeTierUser:4003,NonexistentSessionId:4004,SessionExpired:4008,ClosedSession:4010,RateLimited:4029,UniqueSessionViolation:4030,SessionTimeout:4031,AudioTooShort:4032,AudioTooLong:4033,AudioTooSmallToTranscode:4034,BadJson:4100,BadSchema:4101,TooManyStreams:4102,Reconnected:4103,ReconnectAttemptsExhausted:1013,WordBoostParameterParsingFailed:4104},Sp={[te.BadSampleRate]:"Sample rate must be a positive integer",[te.AuthFailed]:"Not Authorized",[te.InsufficientFunds]:"Insufficient funds",[te.FreeTierUser]:"This feature is paid-only and requires you to add a credit card. Please visit https://app.assemblyai.com/ to add a credit card to your account.",[te.NonexistentSessionId]:"Session ID does not exist",[te.SessionExpired]:"Session has expired",[te.ClosedSession]:"Session is closed",[te.RateLimited]:"Rate limited",[te.UniqueSessionViolation]:"Unique session violation",[te.SessionTimeout]:"Session Timeout",[te.AudioTooShort]:"Audio too short",[te.AudioTooLong]:"Audio too long",[te.AudioTooSmallToTranscode]:"Audio too small to transcode",[te.BadJson]:"Bad JSON",[te.BadSchema]:"Bad schema",[te.TooManyStreams]:"Too many streams",[te.Reconnected]:"This session has been reconnected. This WebSocket is no longer valid.",[te.ReconnectAttemptsExhausted]:"Reconnect attempts exhausted",[te.WordBoostParameterParsingFailed]:"Could not parse word boost parameter"},ci=class extends Error{static{i(this,"RealtimeError")}},Qy="wss://api.assemblyai.com/v2/realtime/ws",ev='{"force_end_utterance":true}',Ip='{"terminate_session":true}',li=class{static{i(this,"RealtimeTranscriber")}constructor(t){if(this.listeners={},this.realtimeUrl=t.realtimeUrl??Qy,this.sampleRate=t.sampleRate??16e3,this.wordBoost=t.wordBoost,this.encoding=t.encoding,this.endUtteranceSilenceThreshold=t.endUtteranceSilenceThreshold,this.disablePartialTranscripts=t.disablePartialTranscripts,"token"in t&&t.token&&(this.token=t.token),"apiKey"in t&&t.apiKey&&(this.apiKey=t.apiKey),!(this.token||this.apiKey))throw new Error("API key or temporary token is required.")}connectionUrl(){let t=new URL(this.realtimeUrl);if(t.protocol!=="wss:")throw new Error("Invalid protocol, must be wss");let r=new URLSearchParams;return this.token&&r.set("token",this.token),r.set("sample_rate",this.sampleRate.toString()),this.wordBoost&&this.wordBoost.length>0&&r.set("word_boost",JSON.stringify(this.wordBoost)),this.encoding&&r.set("encoding",this.encoding),r.set("enable_extra_session_information","true"),this.disablePartialTranscripts&&r.set("disable_partial_transcripts",this.disablePartialTranscripts.toString()),t.search=r.toString(),t}on(t,r){this.listeners[t]=r}connect(){return new Promise(t=>{if(this.socket)throw new Error("Already connected");let r=this.connectionUrl();this.token?this.socket=Ep(r.toString()):this.socket=Ep(r.toString(),{headers:{Authorization:this.apiKey}}),this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{this.endUtteranceSilenceThreshold===void 0||this.endUtteranceSilenceThreshold===null||this.configureEndUtteranceSilenceThreshold(this.endUtteranceSilenceThreshold)},this.socket.onclose=({code:n,reason:o})=>{o||n in Sp&&(o=Sp[n]),this.listeners.close?.(n,o)},this.socket.onerror=n=>{n.error?this.listeners.error?.(n.error):this.listeners.error?.(new Error(n.message))},this.socket.onmessage=({data:n})=>{let o=JSON.parse(n.toString());if("error"in o){this.listeners.error?.(new ci(o.error));return}switch(o.message_type){case"SessionBegins":{let a={sessionId:o.session_id,expiresAt:new Date(o.expires_at)};t(a),this.listeners.open?.(a);break}case"PartialTranscript":{o.created=new Date(o.created),this.listeners.transcript?.(o),this.listeners["transcript.partial"]?.(o);break}case"FinalTranscript":{o.created=new Date(o.created),this.listeners.transcript?.(o),this.listeners["transcript.final"]?.(o);break}case"SessionInformation":{this.listeners.session_information?.(o);break}case"SessionTerminated":{this.sessionTerminatedResolve?.();break}}}})}sendAudio(t){this.send(t)}stream(){return new $p.WritableStream({write:i(t=>{this.sendAudio(t)},"write")})}forceEndUtterance(){this.send(ev)}configureEndUtteranceSilenceThreshold(t){this.send(`{"end_utterance_silence_threshold":${t}}`)}send(t){if(!this.socket||this.socket.readyState!==this.socket.OPEN)throw new Error("Socket is not open for communication");this.socket.send(t)}async close(t=!0){if(this.socket){if(this.socket.readyState===this.socket.OPEN)if(t){let r=new Promise(n=>{this.sessionTerminatedResolve=n});this.socket.send(Ip),await r}else this.socket.send(Ip);this.socket?.removeAllListeners&&this.socket.removeAllListeners(),this.socket.close()}this.listeners={},this.socket=void 0}};var pi=class extends It{static{i(this,"RealtimeTranscriberFactory")}constructor(t){super(t),this.rtFactoryParams=t}createService(t){return this.transcriber(t)}transcriber(t){let r={...t};return!r.token&&!r.apiKey&&(r.apiKey=this.rtFactoryParams.apiKey),new li(r)}async createTemporaryToken(t){return(await this.fetchJson("/v2/realtime/token",{method:"POST",body:JSON.stringify(t)})).token}};function Ap(e){return e.startsWith("http")||e.startsWith("https")||e.startsWith("data:")?null:e.startsWith("file://")?e.substring(7):e.startsWith("file:")?e.substring(5):e}i(Ap,"getPath");var di=class extends It{static{i(this,"TranscriptService")}constructor(t,r){super(t),this.files=r}async transcribe(t,r){let n=await this.submit(t);return await this.waitUntilReady(n.id,r)}async submit(t){let r,n;if("audio"in t){let{audio:a,...u}=t;if(typeof a=="string"){let l=Ap(a);l!==null?r=await this.files.upload(l):a.startsWith("data:")?r=await this.files.upload(a):r=a}else r=await this.files.upload(a);n={...u,audio_url:r}}else n=t;return await this.fetchJson("/v2/transcript",{method:"POST",body:JSON.stringify(n)})}async create(t,r){let n=Ap(t.audio_url);if(n!==null){let a=await this.files.upload(n);t.audio_url=a}let o=await this.fetchJson("/v2/transcript",{method:"POST",body:JSON.stringify(t)});return r?.poll??!0?await this.waitUntilReady(o.id,r):o}async waitUntilReady(t,r){let n=r?.pollingInterval??3e3,o=r?.pollingTimeout??-1,a=Date.now();for(;;){let u=await this.get(t);if(u.status==="completed"||u.status==="error")return u;if(o>0&&Date.now()-a>o)throw new Error("Polling timeout");await new Promise(l=>setTimeout(l,n))}}get(t){return this.fetchJson(`/v2/transcript/${t}`)}async list(t){let r="/v2/transcript";typeof t=="string"?r=t:t&&(r=`${r}?${new URLSearchParams(Object.keys(t).map(o=>[o,t[o]?.toString()||""]))}`);let n=await this.fetchJson(r);for(let o of n.transcripts)o.created=new Date(o.created),o.completed&&(o.completed=new Date(o.completed));return n}delete(t){return this.fetchJson(`/v2/transcript/${t}`,{method:"DELETE"})}wordSearch(t,r){let n=new URLSearchParams({words:r.join(",")});return this.fetchJson(`/v2/transcript/${t}/word-search?${n.toString()}`)}sentences(t){return this.fetchJson(`/v2/transcript/${t}/sentences`)}paragraphs(t){return this.fetchJson(`/v2/transcript/${t}/paragraphs`)}async subtitles(t,r="srt",n){let o=`/v2/transcript/${t}/${r}`;if(n){let u=new URLSearchParams;u.set("chars_per_caption",n.toString()),o+=`?${u.toString()}`}return await(await this.fetch(o)).text()}redactions(t){return this.redactedAudio(t)}redactedAudio(t){return this.fetchJson(`/v2/transcript/${t}/redacted-audio`)}async redactedAudioFile(t){let{redacted_audio_url:r,status:n}=await this.redactedAudio(t);if(n!=="redacted_audio_ready")throw new Error(`Redacted audio status is ${n}`);let o=await fetch(r);if(!o.ok)throw new Error(`Failed to fetch redacted audio: ${o.statusText}`);return{arrayBuffer:o.arrayBuffer.bind(o),blob:o.blob.bind(o),body:o.body,bodyUsed:o.bodyUsed}}},tv=i(async e=>wp.Readable.toWeb((0,zp.createReadStream)(e)),"readFile"),fi=class extends It{static{i(this,"FileService")}async upload(t){let r;return typeof t=="string"?t.startsWith("data:")?r=rv(t):r=await tv(t):r=t,(await this.fetchJson("/v2/upload",{method:"POST",body:r,headers:{"Content-Type":"application/octet-stream"},duplex:"half"})).upload_url}};function rv(e){let t=e.split(","),r=t[0].match(/:(.*?);/)[1],n=atob(t[1]),o=n.length,a=new Uint8Array(o);for(;o--;)a[o]=n.charCodeAt(o);return new Blob([a],{type:r})}i(rv,"dataUrlToBlob");var nv="https://api.assemblyai.com",an=class{static{i(this,"AssemblyAI")}constructor(t){t.baseUrl=t.baseUrl||nv,t.baseUrl&&t.baseUrl.endsWith("/")&&(t.baseUrl=t.baseUrl.slice(0,-1)),this.files=new fi(t),this.transcripts=new di(t,this.files),this.lemur=new ui(t),this.realtime=new pi(t)}};var kp={name:"@activepieces/piece-assemblyai",version:"1.1.9",main:"./dist/src/index.js",types:"./dist/src/index.d.ts",scripts:{build:"tsc -p tsconfig.lib.json && cp package.json dist/",bundle:"node ../../../../dist/packages/cli/src/index.js pieces bundle",generate:"tsx ./scripts/generateFromSpec.ts",lint:"eslint 'src/**/*.ts'"},devDependencies:{"@readme/openapi-parser":"^2.6.0","@types/node":"^24",dotenv:"^16.4.5",mergician:"^2.0.2","title-case":"^4.3.1",tsx:"^4.19.0",typescript:"^5.6.2",tslib:"2.6.2"},dependencies:{"@activepieces/pieces-common":"workspace:*","@activepieces/pieces-framework":"workspace:*",assemblyai:"4.7.0","@activepieces/core-piece-types":"workspace:*","@activepieces/core-utils":"workspace:*"}};var mi="https://api.assemblyai.com",q=i(e=>{if(!e.auth)throw new Error("The AssemblyAI API key is required.");return new an({apiKey:e.auth.secret_text,userAgent:{integration:{name:"Activepieces",version:kp.version}},baseUrl:mi})},"getAssemblyAIClient");var V=ao.SecretText({displayName:"API Key",required:!0,description:"You can retrieve your AssemblyAI API key within your AssemblyAI [Account Settings](https://www.assemblyai.com/app/account?utm_source=activepieces).",validate:i(async({auth:e})=>{if(!e)return{valid:!1,error:"The AssemblyAI API key is required."};try{return(await Nr.sendRequest({method:"GET",url:`${mi}/v2/account`,headers:{Authorization:e}})).status!==200?{valid:!1,error:"The AssemblyAI API key is invalid."}:{valid:!0}}catch{return{valid:!1,error:"The AssemblyAI API key is invalid."}}},"validate")});var sn=Z({name:"uploadFile",classification:"WRITE",auth:V,requireAuth:!0,displayName:"Upload File",description:"Upload a media file to AssemblyAI's servers.",audience:"both",aiMetadata:{description:"Uploads a local audio or video file to AssemblyAI and returns an upload URL that can be passed to the Transcribe action. Use this when the media is a file (not already a publicly reachable URL) that AssemblyAI must access. Each call uploads a new copy, so it is not idempotent.",idempotent:!1},props:{file:P.File({displayName:"Audio File",description:"The File or URL of the audio or video file.",required:!0})},async run(e){return await q(e).files.upload(e.propsValue.file.data)}});var Op={audio_url:P.ShortText({displayName:"Audio URL",required:!0,description:"The URL of the audio or video file to transcribe."}),language_code:P.StaticDropdown({displayName:"Language Code",required:!1,description:`The language of your audio file. Possible values are found in [Supported Languages](https://www.assemblyai.com/docs/concepts/supported-languages).
|
|
12
12
|
The default value is 'en_us'.
|
|
13
13
|
`,options:{options:[{label:"English (Global)",value:"en"},{label:"English (Australian)",value:"en_au"},{label:"English (British)",value:"en_uk"},{label:"English (US)",value:"en_us"},{label:"Spanish",value:"es"},{label:"French",value:"fr"},{label:"German",value:"de"},{label:"Italian",value:"it"},{label:"Portuguese",value:"pt"},{label:"Dutch",value:"nl"},{label:"Afrikaans",value:"af"},{label:"Albanian",value:"sq"},{label:"Amharic",value:"am"},{label:"Arabic",value:"ar"},{label:"Armenian",value:"hy"},{label:"Assamese",value:"as"},{label:"Azerbaijani",value:"az"},{label:"Bashkir",value:"ba"},{label:"Basque",value:"eu"},{label:"Belarusian",value:"be"},{label:"Bengali",value:"bn"},{label:"Bosnian",value:"bs"},{label:"Breton",value:"br"},{label:"Bulgarian",value:"bg"},{label:"Burmese",value:"my"},{label:"Catalan",value:"ca"},{label:"Chinese",value:"zh"},{label:"Croatian",value:"hr"},{label:"Czech",value:"cs"},{label:"Danish",value:"da"},{label:"Estonian",value:"et"},{label:"Faroese",value:"fo"},{label:"Finnish",value:"fi"},{label:"Galician",value:"gl"},{label:"Georgian",value:"ka"},{label:"Greek",value:"el"},{label:"Gujarati",value:"gu"},{label:"Haitian",value:"ht"},{label:"Hausa",value:"ha"},{label:"Hawaiian",value:"haw"},{label:"Hebrew",value:"he"},{label:"Hindi",value:"hi"},{label:"Hungarian",value:"hu"},{label:"Icelandic",value:"is"},{label:"Indonesian",value:"id"},{label:"Japanese",value:"ja"},{label:"Javanese",value:"jw"},{label:"Kannada",value:"kn"},{label:"Kazakh",value:"kk"},{label:"Khmer",value:"km"},{label:"Korean",value:"ko"},{label:"Lao",value:"lo"},{label:"Latin",value:"la"},{label:"Latvian",value:"lv"},{label:"Lingala",value:"ln"},{label:"Lithuanian",value:"lt"},{label:"Luxembourgish",value:"lb"},{label:"Macedonian",value:"mk"},{label:"Malagasy",value:"mg"},{label:"Malay",value:"ms"},{label:"Malayalam",value:"ml"},{label:"Maltese",value:"mt"},{label:"Maori",value:"mi"},{label:"Marathi",value:"mr"},{label:"Mongolian",value:"mn"},{label:"Nepali",value:"ne"},{label:"Norwegian",value:"no"},{label:"Norwegian Nynorsk",value:"nn"},{label:"Occitan",value:"oc"},{label:"Panjabi",value:"pa"},{label:"Pashto",value:"ps"},{label:"Persian",value:"fa"},{label:"Polish",value:"pl"},{label:"Romanian",value:"ro"},{label:"Russian",value:"ru"},{label:"Sanskrit",value:"sa"},{label:"Serbian",value:"sr"},{label:"Shona",value:"sn"},{label:"Sindhi",value:"sd"},{label:"Sinhala",value:"si"},{label:"Slovak",value:"sk"},{label:"Slovenian",value:"sl"},{label:"Somali",value:"so"},{label:"Sundanese",value:"su"},{label:"Swahili",value:"sw"},{label:"Swedish",value:"sv"},{label:"Tagalog",value:"tl"},{label:"Tajik",value:"tg"},{label:"Tamil",value:"ta"},{label:"Tatar",value:"tt"},{label:"Telugu",value:"te"},{label:"Thai",value:"th"},{label:"Tibetan",value:"bo"},{label:"Turkish",value:"tr"},{label:"Turkmen",value:"tk"},{label:"Ukrainian",value:"uk"},{label:"Urdu",value:"ur"},{label:"Uzbek",value:"uz"},{label:"Vietnamese",value:"vi"},{label:"Welsh",value:"cy"},{label:"Yiddish",value:"yi"},{label:"Yoruba",value:"yo"}]}}),language_detection:P.Checkbox({displayName:"Language Detection",required:!1,description:"Enable [Automatic language detection](https://www.assemblyai.com/docs/models/speech-recognition#automatic-language-detection), either true or false.",defaultValue:!1}),language_confidence_threshold:P.Number({displayName:"Language Confidence Threshold",required:!1,description:`The confidence threshold for the automatically detected language.
|
|
14
14
|
An error will be returned if the language confidence is below this threshold.
|
|
@@ -28,8 +28,8 @@ Use a JSON array of objects of the following format:
|
|
|
28
28
|
\`\`\`
|
|
29
29
|
`}),sentiment_analysis:P.Checkbox({displayName:"Sentiment Analysis",required:!1,description:"Enable [Sentiment Analysis](https://www.assemblyai.com/docs/models/sentiment-analysis), can be true or false",defaultValue:!1}),auto_chapters:P.Checkbox({displayName:"Auto Chapters",required:!1,description:"Enable [Auto Chapters](https://www.assemblyai.com/docs/models/auto-chapters), can be true or false",defaultValue:!1}),entity_detection:P.Checkbox({displayName:"Entity Detection",required:!1,description:"Enable [Entity Detection](https://www.assemblyai.com/docs/models/entity-detection), can be true or false",defaultValue:!1}),speech_threshold:P.Number({displayName:"Speech Threshold",required:!1,description:`Reject audio files that contain less than this fraction of speech.
|
|
30
30
|
Valid values are in the range [0, 1] inclusive.
|
|
31
|
-
`}),summarization:P.Checkbox({displayName:"Enable Summarization",required:!1,description:"Enable [Summarization](https://www.assemblyai.com/docs/models/summarization), can be true or false",defaultValue:!1}),summary_model:P.StaticDropdown({displayName:"Summary Model",required:!1,description:"The model to summarize the transcript",options:{options:[{label:"Informative",value:"informative"},{label:"Conversational",value:"conversational"},{label:"Catchy",value:"catchy"}]}}),summary_type:P.StaticDropdown({displayName:"Summary Type",required:!1,description:"The type of summary",options:{options:[{label:"Bullets",value:"bullets"},{label:"Bullets Verbose",value:"bullets_verbose"},{label:"Gist",value:"gist"},{label:"Headline",value:"headline"},{label:"Paragraph",value:"paragraph"}]}}),custom_topics:P.Checkbox({displayName:"Enable Custom Topics",required:!1,description:"Enable custom topics, either true or false",defaultValue:!1}),topics:P.Array({displayName:"Custom Topics",required:!1,description:"The list of custom topics"})};var
|
|
32
|
-
Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.`,audience:"both",aiMetadata:{description:"Lists transcripts you have created, newest first, with paging support. Use this to discover transcript IDs or browse past transcription jobs when you do not already have a specific ID. Read-only and idempotent.",idempotent:!0},props:
|
|
31
|
+
`}),summarization:P.Checkbox({displayName:"Enable Summarization",required:!1,description:"Enable [Summarization](https://www.assemblyai.com/docs/models/summarization), can be true or false",defaultValue:!1}),summary_model:P.StaticDropdown({displayName:"Summary Model",required:!1,description:"The model to summarize the transcript",options:{options:[{label:"Informative",value:"informative"},{label:"Conversational",value:"conversational"},{label:"Catchy",value:"catchy"}]}}),summary_type:P.StaticDropdown({displayName:"Summary Type",required:!1,description:"The type of summary",options:{options:[{label:"Bullets",value:"bullets"},{label:"Bullets Verbose",value:"bullets_verbose"},{label:"Gist",value:"gist"},{label:"Headline",value:"headline"},{label:"Paragraph",value:"paragraph"}]}}),custom_topics:P.Checkbox({displayName:"Enable Custom Topics",required:!1,description:"Enable custom topics, either true or false",defaultValue:!1}),topics:P.Array({displayName:"Custom Topics",required:!1,description:"The list of custom topics"})};var iv={...Op,wait_until_ready:P.Checkbox({displayName:"Wait until transcript is ready",description:'Wait until the transcript status is "completed" or "error" before moving on to the next step.',required:!0,defaultValue:!0}),throw_on_error:P.Checkbox({displayName:"Throw if transcript status is error",description:'If the transcript status is "error", throw an error.',required:!0,defaultValue:!0})},un=Z({name:"transcribe",classification:"WRITE",auth:V,requireAuth:!0,displayName:"Transcribe",description:"Transcribe an audio or video file using AssemblyAI.",audience:"both",aiMetadata:{description:"Submits an audio or video file (by URL or prior upload) to AssemblyAI for speech-to-text transcription, optionally with extra speech models like speaker diarization, PII redaction, and sentiment. Can either wait synchronously until the transcript is ready or return immediately and continue via webhook (the wait-until-ready and webhook-URL modes are mutually exclusive). Use this to start a new transcription job; each call creates a new transcript, so it is not idempotent.",idempotent:!1},props:iv,async run(e){let t=q(e);if(e.executionType==="BEGIN"){let r=av(e),n=await sv(e,r);uv(e),cv(r);let o=await t.transcripts.submit(r);return n&&e.run.waitForWaitpoint(n.id),o}else if(e.executionType==="RESUME"){let r=e.resumePayload.body,n=await t.transcripts.get(r.transcript_id);if(e.propsValue.throw_on_error&&n.status==="error")throw new Error(n.error);return n}else throw new Error("Invalid Execution Type")}});function av(e){let t={...e.propsValue};return"wait_until_ready"in t&&delete t.wait_until_ready,"throw_on_error"in t&&delete t.throw_on_error,"auth"in t&&delete t.auth,t}i(av,"createTranscriptParams");async function sv(e,t){if(e.propsValue.wait_until_ready){if(t.webhook_url?.trim())throw new Error('The "Wait until transcript is ready" and "Webhook URL" fields are mutually exclusive. Please remove the "Webhook URL" field to use the "Wait until transcript is ready" field.');let n=await e.run.createWaitpoint({type:"WEBHOOK"});return t.webhook_url=n.buildResumeUrl({queryParams:{}}),n}}i(sv,"handleWebhookUrl");function uv(e){if(e.propsValue.wait_until_ready===!0&&e.propsValue.redact_pii_audio===!0)throw new Error('The "Wait until transcript is ready" and "Redact PII audio" fields are mutually exclusive. Set the "Wait until transcript is ready" or "Redact PII audio" to false.')}i(uv,"handlePiiAudio");function cv(e){let t=e;for(let r in t){let n=t[r];Array.isArray(n)&&n.length===0&&delete t[r]}}i(cv,"handleEmptyArrays");var he=P.ShortText({displayName:"Transcript ID",required:!0});var cn=Z({name:"getTranscript",classification:"READ",auth:V,requireAuth:!0,displayName:"Get Transcript",description:"Retrieves a transcript by its ID.",audience:"both",aiMetadata:{description:"Fetches a single existing transcript by its ID, including its status and transcribed text. Use this to poll or read back a transcript created by the Transcribe action. Requires a valid transcript ID; read-only and idempotent.",idempotent:!0},props:{id:he},async run(e){return await q(e).transcripts.get(e.propsValue.id)}});var ln=Z({name:"getTranscriptSentences",classification:"READ",auth:V,requireAuth:!0,displayName:"Get Transcript Sentences",description:"Retrieve the sentences of the transcript by its ID.",audience:"both",aiMetadata:{description:"Returns the sentence-level segmentation of an existing transcript, identified by its ID, with per-sentence text and timestamps. Use this when you need the transcript broken into sentences rather than the raw text. Requires a valid transcript ID; read-only and idempotent.",idempotent:!0},props:{id:he},async run(e){return await q(e).transcripts.sentences(e.propsValue.id)}});var pn=Z({name:"getTranscriptParagraphs",classification:"READ",auth:V,requireAuth:!0,displayName:"Get Transcript Paragraphs",description:"Retrieve the paragraphs of the transcript by its ID.",audience:"both",aiMetadata:{description:"Returns the paragraph-level segmentation of an existing transcript, identified by its ID, with per-paragraph text and timestamps. Use this when you need the transcript grouped into paragraphs rather than the raw text or individual sentences. Requires a valid transcript ID; read-only and idempotent.",idempotent:!0},props:{id:he},async run(e){return await q(e).transcripts.paragraphs(e.propsValue.id)}});var dn=Z({name:"getSubtitles",classification:"READ",auth:V,requireAuth:!0,displayName:"Get Transcript Subtitles",description:"Export the transcript as SRT or VTT subtitles.",audience:"both",aiMetadata:{description:"Exports an existing transcript, identified by its ID, as a subtitle file in either SRT or VTT format (selectable). Use this to produce captions from a completed transcript, optionally capping characters per caption. Requires a valid transcript ID; read-only and idempotent.",idempotent:!0},props:{id:P.ShortText({displayName:"Transcript ID",required:!0}),format:P.StaticDropdown({displayName:"Subtitles Format",required:!0,defaultValue:"srt",options:{options:[{label:"SRT",value:"srt"},{label:"VTT",value:"vtt"}]}}),chars_per_caption:P.Number({displayName:"Number of Characters per Caption",description:"The maximum number of characters per caption",required:!1})},async run(e){return await q(e).transcripts.subtitles(e.propsValue.id,e.propsValue.format,e.propsValue.chars_per_caption)}});var fn=Z({name:"getRedactedAudio",classification:"READ",auth:V,requireAuth:!0,displayName:"Get Transcript Redacted Audio",description:"Get the result of the redacted audio model.",audience:"both",aiMetadata:{description:"Retrieves the PII-redacted audio result for an existing transcript by its ID; if redaction is ready it returns the redacted audio URL and can optionally download the file into Activepieces storage. Use this only for transcripts created with PII audio redaction enabled. Requires a valid transcript ID; read-only and idempotent.",idempotent:!0},props:{id:he,download_file:P.Checkbox({displayName:"Download file?",required:!0,defaultValue:!1}),download_file_name:P.ShortText({displayName:"Download File Name",description:"The desired file name for storing in ActivePieces. Make sure the file extension is correct.",required:!0,defaultValue:"redacted-audio.mp3"})},async run(e){let t=q(e),r=await t.transcripts.redactedAudio(e.propsValue.id);if(r.status!=="redacted_audio_ready")return r;if(e.propsValue.download_file){let n=await t.transcripts.redactedAudioFile(e.propsValue.id),o=await e.files.write({fileName:e.propsValue.download_file_name,data:Buffer.from(await n.arrayBuffer())});return{...r,file:o}}return r}});var mn=Z({name:"wordSearch",classification:"SEARCH",auth:V,requireAuth:!0,displayName:"Search words in transcript",description:"Search through the transcript for keywords. You can search for individual words, numbers, or phrases containing up to five words or numbers.",audience:"both",aiMetadata:{description:"Searches an existing transcript, identified by its ID, for one or more keywords and returns where each match occurs (individual words, numbers, or short phrases of up to five tokens). Use this to locate specific terms within a completed transcript. Requires a valid transcript ID and a list of search terms; read-only and idempotent.",idempotent:!0},props:{id:he,words:P.Array({displayName:"Words",required:!0,description:"Keywords to search for"})},async run(e){return await q(e).transcripts.wordSearch(e.propsValue.id,e.propsValue.words)}});var Rp={limit:P.Number({displayName:"Limit",required:!1,description:"Maximum amount of transcripts to retrieve"}),status:P.StaticDropdown({displayName:"Status",required:!1,description:"Filter by transcript status",options:{options:[{label:"Queued",value:"queued"},{label:"Processing",value:"processing"},{label:"Completed",value:"completed"},{label:"Error",value:"error"}]}}),created_on:P.DateTime({displayName:"Created On",required:!1,description:"Only get transcripts created on this date"}),before_id:P.ShortText({displayName:"Before ID",required:!1,description:"Get transcripts that were created before this transcript ID"}),after_id:P.ShortText({displayName:"After ID",required:!1,description:"Get transcripts that were created after this transcript ID"}),throttled_only:P.Checkbox({displayName:"Throttled Only",required:!1,description:"Only get throttled transcripts, overrides the status filter",defaultValue:!1})};var hn=Z({name:"listTranscripts",classification:"SEARCH",auth:V,requireAuth:!0,displayName:"List transcripts",description:`Retrieve a list of transcripts you created.
|
|
32
|
+
Transcripts are sorted from newest to oldest. The previous URL always points to a page with older transcripts.`,audience:"both",aiMetadata:{description:"Lists transcripts you have created, newest first, with paging support. Use this to discover transcript IDs or browse past transcription jobs when you do not already have a specific ID. Read-only and idempotent.",idempotent:!0},props:Rp,async run(e){return await q(e).transcripts.list(e.propsValue)}});var gn=Z({name:"deleteTranscript",classification:"DESTRUCTIVE",auth:V,requireAuth:!0,displayName:"Delete transcript",description:"Remove the data from the transcript and mark it as deleted.",audience:"both",aiMetadata:{description:"Permanently removes the data of an existing transcript, identified by its ID, and marks it deleted. Use this to purge a transcript's contents; this is a destructive mutation. Requires a valid transcript ID. Repeating the call after deletion does not restore data, but it changes server state on the first successful call, so it is not idempotent.",idempotent:!1},props:{id:he},async run(e){return await q(e).transcripts.delete(e.propsValue.id)}});var Np={prompt:P.ShortText({displayName:"Prompt",required:!0,description:"Your text to prompt the model to produce a desired output, including any context you want to pass into the model."}),transcript_ids:P.Array({displayName:"Transcript IDs",required:!1,description:`A list of completed transcripts with text. Up to a maximum of 100 files or 100 hours, whichever is lower.
|
|
33
33
|
Use either transcript_ids or input_text as input into LeMUR.
|
|
34
34
|
`}),input_text:P.ShortText({displayName:"Input Text",required:!1,description:`Custom formatted transcript data. Maximum size is the context limit of the selected model, which defaults to 100000.
|
|
35
35
|
Use either transcript_ids or input_text as input into LeMUR.
|
|
@@ -37,8 +37,8 @@ Use either transcript_ids or input_text as input into LeMUR.
|
|
|
37
37
|
`,options:{options:[{label:"Claude 3.5 Sonnet (on Anthropic)",value:"anthropic/claude-3-5-sonnet"},{label:"Claude 3 Opus (on Anthropic)",value:"anthropic/claude-3-opus"},{label:"Claude 3 Haiku (on Anthropic)",value:"anthropic/claude-3-haiku"},{label:"Claude 3 Sonnet (on Anthropic)",value:"anthropic/claude-3-sonnet"},{label:"Claude 2.1 (on Anthropic)",value:"anthropic/claude-2-1"},{label:"Claude 2 (on Anthropic)",value:"anthropic/claude-2"},{label:"Default",value:"default"},{label:"Claude Instant 1.2 (on Anthropic)",value:"anthropic/claude-instant-1-2"},{label:"Basic",value:"basic"},{label:"Mistral 7B (Hosted by AssemblyAI)",value:"assemblyai/mistral-7b"}]}}),max_output_size:P.Number({displayName:"Maximum Output Size",required:!1,description:"Max output size in tokens, up to 4000"}),temperature:P.Number({displayName:"Temperature",required:!1,description:`The temperature to use for the model.
|
|
38
38
|
Higher values result in answers that are more creative, lower values are more conservative.
|
|
39
39
|
Can be any value between 0.0 and 1.0 inclusive.
|
|
40
|
-
`})};var
|
|
41
|
-
The LLM response data, as well as any context provided in the original request will be removed.`,audience:"both",aiMetadata:{description:"Permanently deletes the data of a previously submitted LeMUR request, identified by its request ID, including the LLM response and any context from the original request. Use this to purge LeMUR data for privacy or compliance; this is a destructive mutation. Requires a valid LeMUR request ID and is not idempotent.",idempotent:!1},props:{request_id:
|
|
40
|
+
`})};var yn=Z({name:"lemurTask",classification:"READ",auth:V,requireAuth:!0,displayName:"Run a Task using LeMUR",description:"Use the LeMUR task endpoint to input your own LLM prompt.",audience:"both",aiMetadata:{description:"Runs a custom LLM prompt over one or more existing transcripts using AssemblyAI LeMUR, returning the model-generated response. Use this to summarize, answer questions about, or otherwise reason over transcript content with your own prompt. Requires transcript IDs and a prompt; each call invokes the LLM and produces a new request, so it is not idempotent.",idempotent:!1},props:Np,async run(e){return await q(e).lemur.task({transcript_ids:e.propsValue.transcript_ids,prompt:e.propsValue.prompt})}});var vn=P.ShortText({displayName:"LeMUR request ID",description:"The ID of the LeMUR request whose data you want to delete. This would be found in the response of the original request.",required:!0});var _n=Z({name:"getLemurResponse",classification:"READ",auth:V,requireAuth:!0,displayName:"Retrieve LeMUR response",description:"Retrieve a LeMUR response that was previously generated.",audience:"both",aiMetadata:{description:"Fetches a previously generated LeMUR response by its request ID. Use this to read back the result of an earlier LeMUR task without re-running the LLM. Requires a valid LeMUR request ID; read-only and idempotent.",idempotent:!0},props:{request_id:vn},async run(e){return await q(e).lemur.getResponse(e.propsValue.request_id)}});var xn=Z({name:"purgeLemurRequestData",classification:"DESTRUCTIVE",auth:V,requireAuth:!0,displayName:"Purge LeMUR request data",description:`Delete the data for a previously submitted LeMUR request.
|
|
41
|
+
The LLM response data, as well as any context provided in the original request will be removed.`,audience:"both",aiMetadata:{description:"Permanently deletes the data of a previously submitted LeMUR request, identified by its request ID, including the LLM response and any context from the original request. Use this to purge LeMUR data for privacy or compliance; this is a destructive mutation. Requires a valid LeMUR request ID and is not idempotent.",idempotent:!1},props:{request_id:vn},async run(e){return await q(e).lemur.purgeRequestData(e.propsValue.request_id)}});var hi=Yc({auth:V,baseUrl:i(()=>"https://api.assemblyai.com","baseUrl"),authMapping:i(async e=>({Authorization:`${e.secret_text}`}),"authMapping")});var pv=Ns({displayName:"AssemblyAI",auth:V,categories:["ARTIFICIAL_INTELLIGENCE"],description:"Transcribe and extract data from audio using AssemblyAI's Speech AI.",minimumSupportedRelease:"0.82.0",logoUrl:"https://cdn.activepieces.com/pieces/assemblyai.png",authors:["AssemblyAI"],actions:[sn,un,cn,ln,pn,dn,fn,mn,hn,gn,yn,_n,xn,hi],triggers:[]});0&&(module.exports={assemblyai});
|
|
42
42
|
/*! Bundled license information:
|
|
43
43
|
|
|
44
44
|
mime-types/index.js:
|