@activepieces/piece-assemblyai 1.1.8 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +10 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-assemblyai",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,14 +1,14 @@
1
- "use strict";var Ip=Object.create;var $t=Object.defineProperty;var Ap=Object.getOwnPropertyDescriptor;var $p=Object.getOwnPropertyNames;var wp=Object.getPrototypeOf,zp=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}},hi=(e,t)=>{for(var r in t)$t(e,r,{get:t[r],enumerable:!0})},gi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $p(t))!zp.call(e,o)&&o!==r&&$t(e,o,{get:()=>t[o],enumerable:!(n=Ap(t,o))||n.enumerable});return e};var ae=(e,t,r)=>(r=e!=null?Ip(wp(e)):{},gi(t||!e||!e.__esModule?$t(r,"default",{value:e,enumerable:!0}):r,e)),kp=e=>gi($t({},"__esModule",{value:!0}),e);var La=E((Ma,Ar)=>{(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 m(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 Ue=0;Ue<Y.length;Ue++)oe.push(parseInt(Y[Ue],16));return oe})(),{parts:p,zoneId:x}}i(m,"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 _={};_.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 _.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(),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")}},_.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,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")}},_.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 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")},_.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},_.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)},_.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 _.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 _.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})(),_.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})`)}},_.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,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})`)}},_.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,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")},_.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 m(c,8);if((h=c.match(l.transitional))&&(M=h[6]||"",p=h[1],h[1].endsWith("::")||(p=p.slice(0,-1)),p=m(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},_.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)},_.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 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 Ar<"u"&&Ar.exports?Ar.exports=_:e.ipaddr=_})(Ma)});var Ls=E((DR,Ms)=>{var Us=require("stream").Stream,mm=require("util");Ms.exports=_e;function _e(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(_e,"DelayedStream");mm.inherits(_e,Us);_e.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(_e.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});_e.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};_e.prototype.resume=function(){this._released||this.release(),this.source.resume()};_e.prototype.pause=function(){this.source.pause()};_e.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};_e.prototype.pipe=function(){var e=Us.prototype.pipe.apply(this,arguments);return this.resume(),e};_e.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)};_e.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 Vs=E((UR,Fs)=>{var hm=require("util"),Bs=require("stream").Stream,js=Ls();Fs.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");hm.inherits(X,Bs);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 js)){var r=js.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 Bs.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 qs=E((LR,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 Gs=E(se=>{"use strict";var Nr=qs(),gm=require("path").extname,Hs=/^\s*([^;\s]*)(?:;|\s|$)/,ym=/^text\//i;se.charset=Ws;se.charsets={lookup:Ws};se.contentType=vm;se.extension=_m;se.extensions=Object.create(null);se.lookup=xm;se.types=Object.create(null);bm(se.extensions,se.types);function Ws(e){if(!e||typeof e!="string")return!1;var t=Hs.exec(e),r=t&&Nr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ym.test(t[1])?"UTF-8":!1}i(Ws,"charset");function vm(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(vm,"contentType");function _m(e){if(!e||typeof e!="string")return!1;var t=Hs.exec(e),r=t&&se.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(_m,"extension");function xm(e){if(!e||typeof e!="string")return!1;var t=gm("x."+e).toLowerCase().substr(1);return t&&se.types[t]||!1}i(xm,"lookup");function bm(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Nr).forEach(i(function(o){var a=Nr[o],u=a.extensions;if(!(!u||!u.length)){e[o]=u;for(var l=0;l<u.length;l++){var m=u[l];if(t[m]){var d=r.indexOf(Nr[t[m]].source),y=r.indexOf(a.source);if(t[m]!=="application/octet-stream"&&(d>y||d===y&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(bm,"populateMaps")});var Js=E((FR,Ks)=>{Ks.exports=Pm;function Pm(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Pm,"defer")});var so=E((ZR,Ys)=>{var Xs=Js();Ys.exports=Tm;function Tm(e){var t=!1;return Xs(function(){t=!0}),i(function(n,o){t?e(n,o):Xs(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Tm,"async")});var uo=E((HR,Qs)=>{Qs.exports=Em;function Em(e){Object.keys(e.jobs).forEach(Sm.bind(e)),e.jobs={}}i(Em,"abort");function Sm(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Sm,"clean")});var co=E((GR,tu)=>{var eu=so(),Im=uo();tu.exports=Am;function Am(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=$m(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 $m(e,t,r,n){var o;return e.length==2?o=e(r,eu(n)):o=e(r,t,eu(n)),o}i($m,"runJob")});var lo=E((JR,ru)=>{ru.exports=wm;function wm(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(wm,"state")});var po=E((YR,nu)=>{var zm=uo(),km=so();nu.exports=Om;function Om(e){Object.keys(this.jobs).length&&(this.index=this.size,zm(this),km(e)(null,this.results))}i(Om,"terminator")});var iu=E((eN,ou)=>{var Rm=co(),Nm=lo(),Dm=po();ou.exports=Cm;function Cm(e,t,r){for(var n=Nm(e);n.index<(n.keyedList||e).length;)Rm(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 Dm.bind(n,r)}i(Cm,"parallel")});var fo=E((rN,Dr)=>{var au=co(),Um=lo(),Mm=po();Dr.exports=Lm;Dr.exports.ascending=su;Dr.exports.descending=jm;function Lm(e,t,r,n){var o=Um(e,r);return au(e,t,o,i(function a(u,l){if(u){n(u,l);return}if(o.index++,o.index<(o.keyedList||e).length){au(e,t,o,a);return}n(null,o.results)},"iteratorHandler")),Mm.bind(o,n)}i(Lm,"serialOrdered");function su(e,t){return e<t?-1:e>t?1:0}i(su,"ascending");function jm(e,t){return-1*su(e,t)}i(jm,"descending")});var cu=E((oN,uu)=>{var Bm=fo();uu.exports=Fm;function Fm(e,t,r){return Bm(e,t,null,r)}i(Fm,"serial")});var pu=E((aN,lu)=>{lu.exports={parallel:iu(),serial:cu(),serialOrdered:fo()}});var mo=E((sN,du)=>{"use strict";du.exports=Object});var mu=E((uN,fu)=>{"use strict";fu.exports=Error});var gu=E((cN,hu)=>{"use strict";hu.exports=EvalError});var vu=E((lN,yu)=>{"use strict";yu.exports=RangeError});var xu=E((pN,_u)=>{"use strict";_u.exports=ReferenceError});var Pu=E((dN,bu)=>{"use strict";bu.exports=SyntaxError});var Cr=E((fN,Tu)=>{"use strict";Tu.exports=TypeError});var Su=E((mN,Eu)=>{"use strict";Eu.exports=URIError});var Au=E((hN,Iu)=>{"use strict";Iu.exports=Math.abs});var wu=E((gN,$u)=>{"use strict";$u.exports=Math.floor});var ku=E((yN,zu)=>{"use strict";zu.exports=Math.max});var Ru=E((vN,Ou)=>{"use strict";Ou.exports=Math.min});var Du=E((_N,Nu)=>{"use strict";Nu.exports=Math.pow});var Uu=E((xN,Cu)=>{"use strict";Cu.exports=Math.round});var Lu=E((bN,Mu)=>{"use strict";Mu.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Bu=E((TN,ju)=>{"use strict";var Vm=Lu();ju.exports=i(function(t){return Vm(t)||t===0?t:t<0?-1:1},"sign")});var Vu=E((SN,Fu)=>{"use strict";Fu.exports=Object.getOwnPropertyDescriptor});var ho=E((IN,Zu)=>{"use strict";var Ur=Vu();if(Ur)try{Ur([],"length")}catch{Ur=null}Zu.exports=Ur});var Hu=E((AN,qu)=>{"use strict";var Mr=Object.defineProperty||!1;if(Mr)try{Mr({},"a",{value:1})}catch{Mr=!1}qu.exports=Mr});var go=E(($N,Wu)=>{"use strict";Wu.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 Ju=E((zN,Ku)=>{"use strict";var Gu=typeof Symbol<"u"&&Symbol,Zm=go();Ku.exports=i(function(){return typeof Gu!="function"||typeof Symbol!="function"||typeof Gu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Zm()},"hasNativeSymbols")});var yo=E((ON,Xu)=>{"use strict";Xu.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var vo=E((RN,Yu)=>{"use strict";var qm=mo();Yu.exports=qm.getPrototypeOf||null});var tc=E((NN,ec)=>{"use strict";var Hm="Function.prototype.bind called on incompatible ",Wm=Object.prototype.toString,Gm=Math.max,Km="[object Function]",Qu=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"),Jm=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"),Xm=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");ec.exports=i(function(t){var r=this;if(typeof r!="function"||Wm.apply(r)!==Km)throw new TypeError(Hm+r);for(var n=Jm(arguments,1),o,a=i(function(){if(this instanceof o){var y=r.apply(this,Qu(n,arguments));return Object(y)===y?y:this}return r.apply(t,Qu(n,arguments))},"binder"),u=Gm(0,r.length-n.length),l=[],m=0;m<u;m++)l[m]="$"+m;if(o=Function("binder","return function ("+Xm(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 ft=E((CN,rc)=>{"use strict";var Ym=tc();rc.exports=Function.prototype.bind||Ym});var Lr=E((UN,nc)=>{"use strict";nc.exports=Function.prototype.call});var _o=E((MN,oc)=>{"use strict";oc.exports=Function.prototype.apply});var ac=E((LN,ic)=>{"use strict";ic.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var uc=E((jN,sc)=>{"use strict";var Qm=ft(),eh=_o(),th=Lr(),rh=ac();sc.exports=rh||Qm.call(th,eh)});var lc=E((BN,cc)=>{"use strict";var nh=ft(),oh=Cr(),ih=Lr(),ah=uc();cc.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new oh("a function is required");return ah(nh,ih,t)},"callBindBasic")});var gc=E((VN,hc)=>{"use strict";var sh=lc(),pc=ho(),fc;try{fc=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var xo=!!fc&&pc&&pc(Object.prototype,"__proto__"),mc=Object,dc=mc.getPrototypeOf;hc.exports=xo&&typeof xo.get=="function"?sh([xo.get]):typeof dc=="function"?i(function(t){return dc(t==null?t:mc(t))},"getDunder"):!1});var bc=E((qN,xc)=>{"use strict";var yc=yo(),vc=vo(),_c=gc();xc.exports=yc?i(function(t){return yc(t)},"getProto"):vc?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return vc(t)},"getProto"):_c?i(function(t){return _c(t)},"getProto"):null});var bo=E((WN,Pc)=>{"use strict";var uh=Function.prototype.call,ch=Object.prototype.hasOwnProperty,lh=ft();Pc.exports=lh.call(uh,ch)});var wc=E((GN,$c)=>{"use strict";var L,ph=mo(),dh=mu(),fh=gu(),mh=vu(),hh=xu(),yt=Pu(),gt=Cr(),gh=Su(),yh=Au(),vh=wu(),_h=ku(),xh=Ru(),bh=Du(),Ph=Uu(),Th=Bu(),Ic=Function,Po=i(function(e){try{return Ic('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Jt=ho(),Eh=Hu(),To=i(function(){throw new gt},"throwTypeError"),Sh=Jt?(function(){try{return arguments.callee,To}catch{try{return Jt(arguments,"callee").get}catch{return To}}})():To,mt=Ju()(),re=bc(),Ih=vo(),Ah=yo(),Ac=_o(),Xt=Lr(),ht={},$h=typeof Uint8Array>"u"||!re?L:re(Uint8Array),Qe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":mt&&re?re([][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%":dh,"%eval%":eval,"%EvalError%":fh,"%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%":Ic,"%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&&re?re(re([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!mt||!re?L:re(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%":mh,"%ReferenceError%":hh,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!mt||!re?L:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":mt&&re?re(""[Symbol.iterator]()):L,"%Symbol%":mt?Symbol:L,"%SyntaxError%":yt,"%ThrowTypeError%":Sh,"%TypedArray%":$h,"%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%":gh,"%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%":Ac,"%Object.defineProperty%":Eh,"%Object.getPrototypeOf%":Ih,"%Math.abs%":yh,"%Math.floor%":vh,"%Math.max%":_h,"%Math.min%":xh,"%Math.pow%":bh,"%Math.round%":Ph,"%Math.sign%":Th,"%Reflect.getPrototypeOf%":Ah};if(re)try{null.error}catch(e){Tc=re(re(e)),Qe["%Error.prototype%"]=Tc}var Tc,wh=i(function e(t){var r;if(t==="%AsyncFunction%")r=Po("async function () {}");else if(t==="%GeneratorFunction%")r=Po("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Po("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 Qe[t]=r,r},"doEval"),Ec={__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(),jr=bo(),zh=Yt.call(Xt,Array.prototype.concat),kh=Yt.call(Ac,Array.prototype.splice),Sc=Yt.call(Xt,String.prototype.replace),Br=Yt.call(Xt,String.prototype.slice),Oh=Yt.call(Xt,RegExp.prototype.exec),Rh=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Nh=/\\(\\)?/g,Dh=i(function(t){var r=Br(t,0,1),n=Br(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 Sc(t,Rh,function(a,u,l,m){o[o.length]=l?Sc(m,Nh,"$1"):u||a}),o},"stringToPath"),Ch=i(function(t,r){var n=t,o;if(jr(Ec,n)&&(o=Ec[n],n="%"+o[0]+"%"),jr(Qe,n)){var a=Qe[n];if(a===ht&&(a=wh(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");$c.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(Oh(/^%?[^%]*%?$/,t)===null)throw new yt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Dh(t),o=n.length>0?n[0]:"",a=Ch("%"+o+"%",r),u=a.name,l=a.value,m=!1,d=a.alias;d&&(o=d[0],kh(n,zh([0,1],d)));for(var y=1,b=!0;y<n.length;y+=1){var _=n[y],c=Br(_,0,1),p=Br(_,-1);if((c==='"'||c==="'"||c==="`"||p==='"'||p==="'"||p==="`")&&c!==p)throw new yt("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(m=!0),o+="."+_,u="%"+o+"%",jr(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&&y+1>=n.length){var g=Jt(l,_);b=!!g,b&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else b=jr(l,_),l=l[_];b&&!m&&(Qe[u]=l)}}return l},"GetIntrinsic")});var kc=E((JN,zc)=>{"use strict";var Uh=go();zc.exports=i(function(){return Uh()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Nc=E((YN,Rc)=>{"use strict";var Mh=wc(),Oc=Mh("%Object.defineProperty%",!0),Lh=kc()(),jh=bo(),Bh=Cr(),Fr=Lh?Symbol.toStringTag:null;Rc.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 Bh("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Fr&&(n||!jh(t,Fr))&&(Oc?Oc(t,Fr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Fr]=r)},"setToStringTag")});var Cc=E((eD,Dc)=>{"use strict";var Fh=Function.prototype.call,Vh=Object.prototype.hasOwnProperty,Zh=ft();Dc.exports=Zh.call(Fh,Vh)});var Mc=E((tD,Uc)=>{"use strict";Uc.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Bc=E((rD,jc)=>{"use strict";var Ao=Vs(),qh=require("util"),Eo=require("path"),Hh=require("http"),Wh=require("https"),Gh=require("url").parse,Kh=require("fs"),Jh=require("stream").Stream,Xh=require("crypto"),So=Gs(),Yh=pu(),Qh=Nc(),He=Cc(),Io=Mc();function Lc(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Lc,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Ao.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");qh.inherits(j,Ao);j.LINE_BREAK=`\r
2
- `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Ao.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)};j.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)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&He(t,"httpVersion"))&&!(t instanceof Jh))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){He(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Kh.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):He(e,"httpVersion")?t(null,Number(e.headers["content-length"])):He(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.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="'+Lc(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Io(u,r.header);var l;for(var m in u)if(He(u,m)){if(l=u[m],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(a+=m+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+a+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Eo.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Eo.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&He(e,"httpVersion")&&(r=Eo.basename(e.client._httpMessage.path||"")),r)return'filename="'+Lc(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=So.lookup(e.name)),!r&&e&&e.path&&(r=So.lookup(e.path)),!r&&e&&e.readable&&He(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=So.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)He(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.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(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Xh.randomBytes(12).toString("hex")};j.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};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.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}Yh.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Gh(e),n=Io({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Io(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Wh.request(n):r=Hh.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,m=i(function(d,y){return r.removeListener("error",m),r.removeListener("response",l),t.call(this,d,y)},"callback");l=m.bind(this,null),r.on("error",m),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Qh(j.prototype,"FormData");jc.exports=j});var Oe=E((bD,Hc)=>{"use strict";var Zc=["nodebuffer","arraybuffer","fragments"],qc=typeof Blob<"u";qc&&Zc.push("blob");Hc.exports={BINARY_TYPES:Zc,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:qc,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:i(()=>{},"NOOP")}});var ul=E((TD,sl)=>{var Jc=require("fs"),Re=require("path"),Xc=require("os"),Yc=typeof __webpack_require__=="function"?__non_webpack_require__:require,sg=process.config&&process.config.variables||{},ug=!!process.env.PREBUILDS_ONLY,Wc=process.versions.modules,$o=pg()?"electron":lg()?"node-webkit":"node",wo=process.env.npm_config_arch||Xc.arch(),zo=process.env.npm_config_platform||Xc.platform(),Qc=process.env.LIBC||(dg(zo)?"musl":"glibc"),ko=process.env.ARM_VERSION||(wo==="arm64"?"8":sg.arm_version)||"",el=(process.versions.uv||"").split(".")[0];sl.exports=Ee;function Ee(e){return Yc(Ee.resolve(e))}i(Ee,"load");Ee.resolve=Ee.path=function(e){e=Re.resolve(e||".");try{var t=Yc(Re.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch{}if(!ug){var r=Gc(Re.join(e,"build/Release"),Kc);if(r)return r;var n=Gc(Re.join(e,"build/Debug"),Kc);if(n)return n}var o=l(e);if(o)return o;var a=l(Re.dirname(process.execPath));if(a)return a;var u=["platform="+zo,"arch="+wo,"runtime="+$o,"abi="+Wc,"uv="+el,ko?"armv="+ko:"","libc="+Qc,"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+`
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(m){var d=Oo(Re.join(m,"prebuilds")).map(tl),y=d.filter(rl(zo,wo)).sort(nl)[0];if(y){var b=Re.join(m,"prebuilds",y.name),_=Oo(b).map(ol),c=_.filter(il($o,Wc)),p=c.sort(al($o))[0];if(p)return Re.join(b,p.file)}}};function Oo(e){try{return Jc.readdirSync(e)}catch{return[]}}i(Oo,"readdirSync");function Gc(e,t){var r=Oo(e).filter(t);return r[0]&&Re.join(e,r[0])}i(Gc,"getFirst");function Kc(e){return/\.node$/.test(e)}i(Kc,"matchBuild");function tl(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(tl,"parseTuple");function rl(e,t){return function(r){return r==null||r.platform!==e?!1:r.architectures.includes(t)}}i(rl,"matchTuple");function nl(e,t){return e.architectures.length-t.architectures.length}i(nl,"compareTuples");function ol(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(ol,"parseTags");function il(e,t){return function(r){return!(r==null||r.runtime&&r.runtime!==e&&!cg(r)||r.abi&&r.abi!==t&&!r.napi||r.uv&&r.uv!==el||r.armv&&r.armv!==ko||r.libc&&r.libc!==Qc)}}i(il,"matchTags");function cg(e){return e.runtime==="node"&&e.napi}i(cg,"runtimeAgnostic");function al(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(al,"compareTags");function lg(){return!!(process.versions&&process.versions.nw)}i(lg,"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 dg(e){return e==="linux"&&Jc.existsSync("/etc/alpine-release")}i(dg,"isAlpine");Ee.parseTags=ol;Ee.matchTags=il;Ee.compareTags=al;Ee.parseTuple=tl;Ee.matchTuple=rl;Ee.compareTuples=nl});var cl=E((SD,No)=>{var Ro=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Ro.addon=="function"?No.exports=Ro.addon.bind(Ro):No.exports=ul()});var pl=E((ID,ll)=>{"use strict";var fg=i((e,t,r,n,o)=>{for(var a=0;a<o;a++)r[n+a]=e[a]^t[a&3]},"mask"),mg=i((e,t)=>{let r=e.length;for(var n=0;n<r;n++)e[n]^=t[n&3]},"unmask");ll.exports={mask:fg,unmask:mg}});var dl=E(($D,Do)=>{"use strict";try{Do.exports=cl()(__dirname)}catch{Do.exports=pl()}});var Qt=E((wD,Vr)=>{"use strict";var{EMPTY_BUFFER:hg}=Oe(),Co=Buffer[Symbol.species];function gg(e,t){if(e.length===0)return hg;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 Co(r.buffer,r.byteOffset,n):r}i(gg,"concat");function fl(e,t,r,n,o){for(let a=0;a<o;a++)r[n+a]=e[a]^t[a&3]}i(fl,"_mask");function ml(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}i(ml,"_unmask");function yg(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}i(yg,"toArrayBuffer");function Uo(e){if(Uo.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Co(e):ArrayBuffer.isView(e)?t=new Co(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Uo.readOnly=!1),t}i(Uo,"toBuffer");Vr.exports={concat:gg,mask:fl,toArrayBuffer:yg,toBuffer:Uo,unmask:ml};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=dl();Vr.exports.mask=function(t,r,n,o,a){a<48?fl(t,r,n,o,a):e.mask(t,r,n,o,a)},Vr.exports.unmask=function(t,r){t.length<32?ml(t,r):e.unmask(t,r)}}catch{}});var yl=E((kD,gl)=>{"use strict";var hl=Symbol("kDone"),Mo=Symbol("kRun"),Lo=class{static{i(this,"Limiter")}constructor(t){this[hl]=()=>{this.pending--,this[Mo]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Mo]()}[Mo](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[hl])}}};gl.exports=Lo});var xt=E((RD,bl)=>{"use strict";var er=require("zlib"),vl=Qt(),vg=yl(),{kStatusCode:_l}=Oe(),_g=Buffer[Symbol.species],xg=Buffer.from([0,0,255,255]),qr=Symbol("permessage-deflate"),Ne=Symbol("total-length"),vt=Symbol("callback"),We=Symbol("buffers"),_t=Symbol("error"),Zr,jo=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,!Zr){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Zr=new vg(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){Zr.add(o=>{this._decompress(t,r,(a,u)=>{o(),n(a,u)})})}compress(t,r,n){Zr.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[qr]=this,this._inflate[Ne]=0,this._inflate[We]=[],this._inflate.on("error",Pg),this._inflate.on("data",xl)}this._inflate[vt]=n,this._inflate.write(t),r&&this._inflate.write(xg),this._inflate.flush(()=>{let a=this._inflate[_t];if(a){this._inflate.close(),this._inflate=null,n(a);return}let u=vl.concat(this._inflate[We],this._inflate[Ne]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Ne]=0,this._inflate[We]=[],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[Ne]=0,this._deflate[We]=[],this._deflate.on("data",bg)}this._deflate[vt]=n,this._deflate.write(t),this._deflate.flush(er.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=vl.concat(this._deflate[We],this._deflate[Ne]);r&&(a=new _g(a.buffer,a.byteOffset,a.length-4)),this._deflate[vt]=null,this._deflate[Ne]=0,this._deflate[We]=[],r&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),n(null,a)})}};bl.exports=jo;function bg(e){this[We].push(e),this[Ne]+=e.length}i(bg,"deflateOnData");function xl(e){if(this[Ne]+=e.length,this[qr]._maxPayload<1||this[Ne]<=this[qr]._maxPayload){this[We].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",xl),this.reset()}i(xl,"inflateOnData");function Pg(e){if(this[qr]._inflate=null,this[_t]){this[vt](this[_t]);return}e[_l]=1007,this[vt](e)}i(Pg,"inflateOnError")});var bt=E((DD,Hr)=>{"use strict";var{isUtf8:Pl}=require("buffer"),{hasBlob:Tg}=Oe(),Eg=[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 Sg(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}i(Sg,"isValidStatusCode");function Bo(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(Bo,"_isValidUTF8");function Ig(e){return Tg&&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");Hr.exports={isBlob:Ig,isValidStatusCode:Sg,isValidUTF8:Bo,tokenChars:Eg};if(Pl)Hr.exports.isValidUTF8=function(e){return e.length<24?Bo(e):Pl(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=require("utf-8-validate");Hr.exports.isValidUTF8=function(t){return t.length<32?Bo(t):e(t)}}catch{}});var Ho=E((UD,wl)=>{"use strict";var{Writable:Ag}=require("stream"),Tl=xt(),{BINARY_TYPES:$g,EMPTY_BUFFER:El,kStatusCode:wg,kWebSocket:zg}=Oe(),{concat:Fo,toArrayBuffer:kg,unmask:Og}=Qt(),{isValidStatusCode:Rg,isValidUTF8:Sl}=bt(),Wr=Buffer[Symbol.species],me=0,Il=1,Al=2,$l=3,Vo=4,Zo=5,Gr=6,qo=class extends Ag{static{i(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||$g[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[zg]=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=me}_write(t,r,n){if(this._opcode===8&&this._state==me)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 Wr(n.buffer,n.byteOffset+t,n.length-t),new Wr(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 Wr(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 me:this.getInfo(t);break;case Il:this.getPayloadLength16(t);break;case Al:this.getPayloadLength64(t);break;case $l:this.getMask();break;case Vo:this.getData(t);break;case Zo:case Gr: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[Tl.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=Il:this._payloadLength===127?this._state=Al: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=$l:this._state=Vo}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Vo}getData(t){let r=El;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&&Og(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Zo,this.decompress(r,t);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}decompress(t,r){this._extensions[Tl.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===me&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=me;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=Fo(n,r):this._binaryType==="arraybuffer"?o=kg(Fo(n,r)):this._binaryType==="blob"?o=new Blob(n):o=n,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=me):(this._state=Gr,setImmediate(()=>{this.emit("message",o,!0),this._state=me,this.startLoop(t)}))}else{let o=Fo(n,r);if(!this._skipUTF8Validation&&!Sl(o)){let a=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(a);return}this._state===Zo||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=me):(this._state=Gr,setImmediate(()=>{this.emit("message",o,!1),this._state=me,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,El),this.end();else{let n=t.readUInt16BE(0);if(!Rg(n)){let a=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(a);return}let o=new Wr(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Sl(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=me;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=me):(this._state=Gr,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=me,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[wg]=o,u}};wl.exports=qo});var Ko=E((jD,Ol)=>{"use strict";var{Duplex:LD}=require("stream"),{randomFillSync:Ng}=require("crypto"),zl=xt(),{EMPTY_BUFFER:Dg,kWebSocket:Cg,NOOP:Ug}=Oe(),{isBlob:Pt,isValidStatusCode:Mg}=bt(),{mask:kl,toBuffer:et}=Qt(),he=Symbol("kByteLength"),Lg=Buffer.alloc(4),Kr=8*1024,tt,Tt=Kr,xe=0,jg=1,Bg=2,Wo=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=xe,this.onerror=Ug,this[Cg]=void 0}static frame(t,r){let n,o=!1,a=2,u=!1;r.mask&&(n=r.maskBuffer||Lg,r.generateMask?r.generateMask(n):(Tt===Kr&&(tt===void 0&&(tt=Buffer.alloc(Kr)),Ng(tt,0,Kr),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[he]!==void 0?l=r[he]:(t=Buffer.from(t),l=t.length):(l=t.length,o=r.mask&&r.readOnly&&!u);let m=l;l>=65536?(a+=8,m=127):l>125&&(a+=2,m=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]=m,m===126?d.writeUInt16BE(l,2):m===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?(kl(t,n,d,a,l),[d]):(kl(t,n,t,0,l),[d,t])):[d,t]}close(t,r,n,o){let a;if(t===void 0)a=Dg;else{if(typeof t!="number"||!Mg(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={[he]:a.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==xe?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={[he]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:a,rsv1:!1};Pt(t)?this._state!==xe?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==xe?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={[he]:o,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:a,rsv1:!1};Pt(t)?this._state!==xe?this.enqueue([this.getBlobData,t,!1,u,n]):this.getBlobData(t,!1,u,n):this._state!==xe?this.enqueue([this.dispatch,t,!1,u,n]):this.sendFrame(e.frame(t,u),n)}send(t,r,n){let o=this._extensions[zl.extensionName],a=r.binary?2:1,u=r.compress,l,m;typeof t=="string"?(l=Buffer.byteLength(t),m=!1):Pt(t)?(l=t.size,m=!1):(t=et(t),l=t.length,m=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 d={[he]:l,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:m,rsv1:u};Pt(t)?this._state!==xe?this.enqueue([this.getBlobData,t,this._compress,d,n]):this.getBlobData(t,this._compress,d,n):this._state!==xe?this.enqueue([this.dispatch,t,this._compress,d,n]):this.dispatch(t,this._compress,d,n)}getBlobData(t,r,n,o){this._bufferedBytes+=n[he],this._state=Bg,t.arrayBuffer().then(a=>{if(this._socket.destroyed){let l=new Error("The socket was closed while the blob was being read");process.nextTick(Go,this,l,o);return}this._bufferedBytes-=n[he];let u=et(a);r?this.dispatch(u,r,n,o):(this._state=xe,this.sendFrame(e.frame(u,n),o),this.dequeue())}).catch(a=>{process.nextTick(Fg,this,a,o)})}dispatch(t,r,n,o){if(!r){this.sendFrame(e.frame(t,n),o);return}let a=this._extensions[zl.extensionName];this._bufferedBytes+=n[he],this._state=jg,a.compress(t,n.fin,(u,l)=>{if(this._socket.destroyed){let m=new Error("The socket was closed while data was being compressed");Go(this,m,o);return}this._bufferedBytes-=n[he],this._state=xe,n.readOnly=!1,this.sendFrame(e.frame(l,n),o),this.dequeue()})}dequeue(){for(;this._state===xe&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][he],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][he],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)}};Ol.exports=Wo;function Go(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(Go,"callCallbacks");function Fg(e,t,r){Go(e,t,r),e.onerror(t)}i(Fg,"onError")});var Bl=E((FD,jl)=>{"use strict";var{kForOnEventAttribute:tr,kListener:Jo}=Oe(),Rl=Symbol("kCode"),Nl=Symbol("kData"),Dl=Symbol("kError"),Cl=Symbol("kMessage"),Ul=Symbol("kReason"),Et=Symbol("kTarget"),Ml=Symbol("kType"),Ll=Symbol("kWasClean"),De=class{static{i(this,"Event")}constructor(t){this[Et]=null,this[Ml]=t}get target(){return this[Et]}get type(){return this[Ml]}};Object.defineProperty(De.prototype,"target",{enumerable:!0});Object.defineProperty(De.prototype,"type",{enumerable:!0});var rt=class extends De{static{i(this,"CloseEvent")}constructor(t,r={}){super(t),this[Rl]=r.code===void 0?0:r.code,this[Ul]=r.reason===void 0?"":r.reason,this[Ll]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Rl]}get reason(){return this[Ul]}get wasClean(){return this[Ll]}};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 De{static{i(this,"ErrorEvent")}constructor(t,r={}){super(t),this[Dl]=r.error===void 0?null:r.error,this[Cl]=r.message===void 0?"":r.message}get error(){return this[Dl]}get message(){return this[Cl]}};Object.defineProperty(St.prototype,"error",{enumerable:!0});Object.defineProperty(St.prototype,"message",{enumerable:!0});var rr=class extends De{static{i(this,"MessageEvent")}constructor(t,r={}){super(t),this[Nl]=r.data===void 0?null:r.data}get data(){return this[Nl]}};Object.defineProperty(rr.prototype,"data",{enumerable:!0});var Vg={addEventListener(e,t,r={}){for(let o of this.listeners(e))if(!r[tr]&&o[Jo]===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,Jr(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,Jr(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,Jr(t,this,u)},"onError");else if(e==="open")n=i(function(){let a=new De("open");a[Et]=this,Jr(t,this,a)},"onOpen");else return;n[tr]=!!r[tr],n[Jo]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[Jo]===t&&!r[tr]){this.removeListener(e,r);break}}};jl.exports={CloseEvent:rt,ErrorEvent:St,Event:De,EventTarget:Vg,MessageEvent:rr};function Jr(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}i(Jr,"callListener")});var Xr=E((ZD,Fl)=>{"use strict";var{tokenChars:nr}=bt();function Se(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}i(Se,"push");function Zg(e){let t=Object.create(null),r=Object.create(null),n=!1,o=!1,a=!1,u,l,m=-1,d=-1,y=-1,b=0;for(;b<e.length;b++)if(d=e.charCodeAt(b),u===void 0)if(y===-1&&nr[d]===1)m===-1&&(m=b);else if(b!==0&&(d===32||d===9))y===-1&&m!==-1&&(y=b);else if(d===59||d===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b);let c=e.slice(m,y);d===44?(Se(t,c,r),r=Object.create(null)):u=c,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);else if(l===void 0)if(y===-1&&nr[d]===1)m===-1&&(m=b);else if(d===32||d===9)y===-1&&m!==-1&&(y=b);else if(d===59||d===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b),Se(r,e.slice(m,y),!0),d===44&&(Se(t,u,r),r=Object.create(null),u=void 0),m=y=-1}else if(d===61&&m!==-1&&y===-1)l=e.slice(m,b),m=y=-1;else throw new SyntaxError(`Unexpected character at index ${b}`);else if(o){if(nr[d]!==1)throw new SyntaxError(`Unexpected character at index ${b}`);m===-1?m=b:n||(n=!0),o=!1}else if(a)if(nr[d]===1)m===-1&&(m=b);else if(d===34&&m!==-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&&nr[d]===1)m===-1&&(m=b);else if(m!==-1&&(d===32||d===9))y===-1&&(y=b);else if(d===59||d===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${b}`);y===-1&&(y=b);let c=e.slice(m,y);n&&(c=c.replace(/\\/g,""),n=!1),Se(r,l,c),d===44&&(Se(t,u,r),r=Object.create(null),u=void 0),l=void 0,m=y=-1}else throw new SyntaxError(`Unexpected character at index ${b}`);if(m===-1||a||d===32||d===9)throw new SyntaxError("Unexpected end of input");y===-1&&(y=b);let _=e.slice(m,y);return u===void 0?Se(t,_,r):(l===void 0?Se(r,_,!0):n?Se(r,l,_.replace(/\\/g,"")):Se(r,l,_),Se(t,u,r)),t}i(Zg,"parse");function qg(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(qg,"format");Fl.exports={format:qg,parse:Zg}});var tn=E((GD,ep)=>{"use strict";var Hg=require("events"),Wg=require("https"),Gg=require("http"),ql=require("net"),Kg=require("tls"),{randomBytes:Jg,createHash:Xg}=require("crypto"),{Duplex:HD,Readable:WD}=require("stream"),{URL:Xo}=require("url"),Ge=xt(),Yg=Ho(),Qg=Ko(),{isBlob:ey}=bt(),{BINARY_TYPES:Vl,CLOSE_TIMEOUT:ty,EMPTY_BUFFER:Yr,GUID:ry,kForOnEventAttribute:Yo,kListener:ny,kStatusCode:oy,kWebSocket:ne,NOOP:Hl}=Oe(),{EventTarget:{addEventListener:iy,removeEventListener:ay}}=Bl(),{format:sy,parse:uy}=Xr(),{toBuffer:cy}=Qt(),Wl=Symbol("kAborted"),Qo=[8,13],Ce=["CONNECTING","OPEN","CLOSING","CLOSED"],ly=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,W=class e extends Hg{static{i(this,"WebSocket")}constructor(t,r,n){super(),this._binaryType=Vl[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Yr,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]),Gl(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){Vl.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 Yg({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),a=new Qg(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",fy),o.on("drain",my),o.on("error",hy),o.on("message",gy),o.on("ping",yy),o.on("pong",vy),a.onerror=_y,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",Xl),t.on("data",en),t.on("end",Yl),t.on("error",Ql),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[Ge.extensionName]&&this._extensions[Ge.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())}),Jl(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){ei(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Yr,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){ei(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Yr,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){ei(this,t,n);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[Ge.extensionName]||(o.compress=!1),this._sender.send(t||Yr,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:Ce.indexOf("CONNECTING")});Object.defineProperty(W.prototype,"CONNECTING",{enumerable:!0,value:Ce.indexOf("CONNECTING")});Object.defineProperty(W,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(W.prototype,"OPEN",{enumerable:!0,value:Ce.indexOf("OPEN")});Object.defineProperty(W,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(W.prototype,"CLOSING",{enumerable:!0,value:Ce.indexOf("CLOSING")});Object.defineProperty(W,"CLOSED",{enumerable:!0,value:Ce.indexOf("CLOSED")});Object.defineProperty(W.prototype,"CLOSED",{enumerable:!0,value:Ce.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[Yo])return t[ny];return null},set(t){for(let r of this.listeners(e))if(r[Yo]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[Yo]:!0})}})});W.prototype.addEventListener=iy;W.prototype.removeEventListener=ay;ep.exports=W;function Gl(e,t,r,n){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:ty,protocolVersion:Qo[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,!Qo.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${Qo.join(", ")})`);let a;if(t instanceof Xo)a=t;else try{a=new Xo(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:",m;if(a.protocol!=="ws:"&&!u&&!l?m=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:l&&!a.pathname?m="The URL's pathname is empty":a.hash&&(m="The URL contains a fragment identifier"),m){let g=new SyntaxError(m);if(e._redirects===0)throw g;Qr(e,g);return}let d=u?443:80,y=Jg(16).toString("base64"),b=u?Wg.request:Gg.request,_=new Set,c;if(o.createConnection=o.createConnection||(u?dy:py),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 Ge({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=sy({[Ge.extensionName]:c.offer()})),r.length){for(let g of r){if(typeof g!="string"||!ly.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[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[Wl]||(p=e._req=null,Qr(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 Xo(h,t)}catch{let Y=new SyntaxError(`Invalid URL: ${h}`);Qr(e,Y);return}Gl(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=Xg("sha1").update(y+ry).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?_.size?_.has(Y)||(oe="Server sent an invalid subprotocol"):oe="Server sent a subprotocol but none was requested":_.size&&(oe="Server sent no subprotocol"),oe){le(e,h,oe);return}Y&&(e._protocol=Y);let Ue=g.headers["sec-websocket-extensions"];if(Ue!==void 0){if(!c){le(e,h,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let pe;try{pe=uy(Ue)}catch{le(e,h,"Invalid Sec-WebSocket-Extensions header");return}let de=Object.keys(pe);if(de.length!==1||de[0]!==Ge.extensionName){le(e,h,"Server indicated an extension that was not requested");return}try{c.accept(pe[Ge.extensionName])}catch{le(e,h,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Ge.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(Gl,"initAsClient");function Qr(e,t){e._readyState=W.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}i(Qr,"emitErrorAndClose");function py(e){return e.path=e.socketPath,ql.connect(e)}i(py,"netConnect");function dy(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=ql.isIP(e.host)?"":e.host),Kg.connect(e)}i(dy,"tlsConnect");function le(e,t,r){e._readyState=W.CLOSING;let n=new Error(r);Error.captureStackTrace(n,le),t.setHeader?(t[Wl]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Qr,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}i(le,"abortHandshake");function ei(e,t,r){if(t){let n=ey(t)?t.size:cy(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Ce[e.readyState]})`);process.nextTick(r,n)}}i(ei,"sendAfterClose");function fy(e,t){let r=this[ne];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[ne]!==void 0&&(r._socket.removeListener("data",en),process.nextTick(Kl,r._socket),e===1005?r.close():r.close(e,t))}i(fy,"receiverOnConclude");function my(){let e=this[ne];e.isPaused||e._socket.resume()}i(my,"receiverOnDrain");function hy(e){let t=this[ne];t._socket[ne]!==void 0&&(t._socket.removeListener("data",en),process.nextTick(Kl,t._socket),t.close(e[oy])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}i(hy,"receiverOnError");function Zl(){this[ne].emitClose()}i(Zl,"receiverOnFinish");function gy(e,t){this[ne].emit("message",e,t)}i(gy,"receiverOnMessage");function yy(e){let t=this[ne];t._autoPong&&t.pong(e,!this._isServer,Hl),t.emit("ping",e)}i(yy,"receiverOnPing");function vy(e){this[ne].emit("pong",e)}i(vy,"receiverOnPong");function Kl(e){e.resume()}i(Kl,"resume");function _y(e){let t=this[ne];t.readyState!==W.CLOSED&&(t.readyState===W.OPEN&&(t._readyState=W.CLOSING,Jl(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}i(_y,"senderOnError");function Jl(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}i(Jl,"setCloseTimer");function Xl(){let e=this[ne];if(this.removeListener("close",Xl),this.removeListener("data",en),this.removeListener("end",Yl),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(Xl,"socketOnClose");function en(e){this[ne]._receiver.write(e)||this.pause()}i(en,"socketOnData");function Yl(){let e=this[ne];e._readyState=W.CLOSING,e._receiver.end(),this.end()}i(Yl,"socketOnEnd");function Ql(){let e=this[ne];this.removeListener("error",Ql),this.on("error",Hl),e&&(e._readyState=W.CLOSING,this.destroy())}i(Ql,"socketOnError")});var op=E((XD,np)=>{"use strict";var JD=tn(),{Duplex:xy}=require("stream");function tp(e){e.emit("close")}i(tp,"emitClose");function by(){!this.destroyed&&this._writableState.finished&&this.destroy()}i(by,"duplexOnEnd");function rp(e){this.removeListener("error",rp),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}i(rp,"duplexOnError");function Py(e,t){let r=!0,n=new xy({...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(tp,n);return}let u=!1;e.once("error",i(function(m){u=!0,a(m)},"error")),e.once("close",i(function(){u||a(o),process.nextTick(tp,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",by),n.on("error",rp),n}i(Py,"createWebSocketStream");np.exports=Py});var ti=E((QD,ip)=>{"use strict";var{tokenChars:Ty}=bt();function Ey(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&&Ty[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(Ey,"parse");ip.exports={parse:Ey}});var dp=E((rC,pp)=>{"use strict";var Sy=require("events"),rn=require("http"),{Duplex:tC}=require("stream"),{createHash:Iy}=require("crypto"),ap=Xr(),nt=xt(),Ay=ti(),$y=tn(),{CLOSE_TIMEOUT:wy,GUID:zy,kWebSocket:ky}=Oe(),Oy=/^[+/0-9A-Za-z]{22}==$/,sp=0,up=1,lp=2,ri=class extends Sy{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:wy,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:$y,...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=rn.createServer((n,o)=>{let a=rn.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=Ry(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=sp}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===lp){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!==up)if(this._state=up,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",cp);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||!Oy.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 m=t.headers["sec-websocket-protocol"],d=new Set;if(m!==void 0)try{d=Ay.parse(m)}catch{ot(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 _=new nt({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let c=ap.parse(y);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,h)=>{if(!c)return ir(r,p||401,g,h);this.completeUpgrade(b,a,d,t,r,n,o)});return}if(!this.options.verifyClient(_))return ir(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[ky])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>sp)return ir(a,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Iy("sha1").update(r+zy).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[nt.extensionName]){let b=t[nt.extensionName].params,_=ap.format({[nt.extensionName]:[b]});d.push(`Sec-WebSocket-Extensions: ${_}`),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",cp),y.setSocket(a,u,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(y),y.on("close",()=>{this.clients.delete(y),this._shouldEmitClose&&!this.clients.size&&process.nextTick(or,this)})),l(y,o)}};pp.exports=ri;function Ry(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(Ry,"addListeners");function or(e){e._state=lp,e.emit("close")}i(or,"emitClose");function cp(){this.destroy()}i(cp,"socketOnError");function ir(e,t,r,n){r=r||rn.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} ${rn.STATUS_CODES[t]}\r
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(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 tv={};hi(tv,{assemblyai:()=>ev});module.exports=kp(tv);var Op=Object.freeze({status:"aborted"});function S(e,t,r){function n(l,m){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,m);let d=u.prototype,y=Object.keys(d);for(let b=0;b<y.length;b++){let _=y[b];_ in l||(l[_]=d[_].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 m;let d=r?.Parent?new a:this;n(d,l),(m=d._zod).deferred??(m.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(S,"$constructor");var be=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},sr=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},bn={};function Ie(e){return e&&Object.assign(bn,e),bn}i(Ie,"config");function Tn(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(Tn,"getEnumValues");function vi(e,t){return typeof t=="bigint"?t.toString():t}i(vi,"jsonStringifyReplacer");function cr(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(cr,"cached");function _i(e){return e==null}i(_i,"nullish");function lr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(lr,"cleanRegex");var yi=Symbol("evaluating");function Q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==yi)return n===void 0&&(n=yi,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(Q,"defineLazy");var En="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function wt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(wt,"isObject");var Rp=cr(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function xi(e){if(wt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(wt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(xi,"isPlainObject");var bi=new Set(["string","number","symbol"]);function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(at,"escapeRegex");function pr(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(pr,"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 Pi(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Pi,"optionalKeys");var Ti={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 st(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(st,"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 ur(e){return typeof e=="string"?e:e?.message}i(ur,"unwrapMessage");function Le(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=ur(e.inst?._zod.def?.error?.(e))??ur(t?.error?.(e))??ur(r.customError?.(e))??ur(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 Ei(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Ei,"getLengthableOrigin");function Sn(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Sn,"issue");var Si=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,vi,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Ii=S("$ZodError",Si),zt=S("$ZodError",Si,{Parent:Error});var Dp=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 be;if(u.issues.length){let l=new(o?.Err??e)(u.issues.map(m=>Le(m,a,Ie())));throw En(l,o?.callee),l}return u.value},"_parse"),dr=Dp(zt),Cp=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(m=>Le(m,a,Ie())));throw En(l,o?.callee),l}return u.value},"_parseAsync"),fr=Cp(zt),Up=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 be;return a.issues.length?{success:!1,error:new(e??Ii)(a.issues.map(u=>Le(u,o,Ie())))}:{success:!0,data:a.value}},"_safeParse"),kt=Up(zt),Mp=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,Ie())))}:{success:!0,data:a.value}},"_safeParseAsync"),Ot=Mp(zt);var Lp="(?:(?:\\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])))",jp=new RegExp(`^${Lp}$`);var Ai=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),$i=/^-?\d+n?$/,wi=/^-?\d+$/,In=/^-?\d+(?:\.\d+)?$/,zi=/^(?: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=[])}),Bp={number:"number",bigint:"bigint",object:"date"};var ki=S("$ZodCheckGreaterThan",(e,t)=>{je.init(e,t);let r=Bp[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 Oi=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]=Ti[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=wi)}),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 Ri=S("$ZodCheckMinLength",(e,t)=>{var r;je.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!_i(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=Ei(o);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var An=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=()=>{})}),Ni=S("$ZodCheckRegex",(e,t)=>{An.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 Ci={major:4,minor:3,patch:6};var K=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ci;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,m)=>{let d=st(u),y;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(d)continue;let _=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&m?.async===!1)throw new be;if(y||c instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await c,u.issues.length!==_&&(d||(d=st(u,_)))});else{if(u.issues.length===_)continue;d||(d=st(u,_))}}return y?y.then(()=>u):u},"runChecks"),a=i((u,l,m)=>{if(st(u))return u.aborted=!0,u;let d=o(l,n,m);if(d instanceof Promise){if(m.async===!1)throw new be;return d.then(y=>e._zod.parse(y,m))}return e._zod.parse(d,m)},"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 m=e._zod.parse(u,l);if(m instanceof Promise){if(l.async===!1)throw new be;return m.then(d=>o(d,n,l))}return o(m,n,l)}}Q(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}))}),gr=S("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ai(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}}),$n=S("$ZodStringFormat",(e,t)=>{An.init(e,t),gr.init(e,t)});var Bi=S("$ZodURL",(e,t)=>{$n.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 wn=S("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??In,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}}),Fi=S("$ZodNumberFormat",(e,t)=>{Oi.init(e,t),wn.init(e,t)}),zn=S("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=zi,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}}),Vi=S("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=$i,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 Zi=S("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),qi=S("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var Hi=S("$ZodVoid",(e,t)=>{K.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}}),Wi=S("$ZodDate",(e,t)=>{K.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 Ui(e,t,r){e.issues.length&&t.issues.push(...Me(r,e.issues)),t.value[r]=e.value}i(Ui,"handleArrayResult");var Gi=S("$ZodArray",(e,t)=>{K.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],m=t.element._zod.run({value:l,issues:[]},n);m instanceof Promise?a.push(m.then(d=>Ui(d,r,u))):Ui(m,r,u)}return a.length?Promise.all(a).then(()=>r):r}});function hr(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(hr,"handlePropertyResult");function Fp(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=Pi(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Fp,"normalizeDef");function Vp(e,t,r,n,o,a){let u=[],l=o.keySet,m=o.catchall._zod,d=m.def.type,y=m.optout==="optional";for(let b in t){if(l.has(b))continue;if(d==="never"){u.push(b);continue}let _=m.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(c=>hr(c,r,b,t,y))):hr(_,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(Vp,"handleCatchall");var Ki=S("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let m={...l};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=cr(()=>Fp(t));Q(e._zod,"propValues",()=>{let l=t.shape,m={};for(let d in l){let y=l[d]._zod;if(y.values){m[d]??(m[d]=new Set);for(let b of y.values)m[d].add(b)}}return m});let o=wt,a=t.catchall,u;e._zod.parse=(l,m)=>{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 _ of u.keys){let c=b[_],p=c._zod.optout==="optional",g=c._zod.run({value:d[_],issues:[]},m);g instanceof Promise?y.push(g.then(h=>hr(h,l,_,d,p))):hr(g,l,_,d,p)}return a?Vp(y,d,l,m,n.value,e):y.length?Promise.all(y).then(()=>l):l}});function Mi(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=>!st(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,Ie())))}),t)}i(Mi,"handleUnionResults");var kn=S("$ZodUnion",(e,t)=>{K.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=>lr(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 m of t.options){let d=m._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(m=>Mi(m,o,e,a)):Mi(l,o,e,a)}});var Ji=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,kn.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,m]of Object.entries(u)){o[l]||(o[l]=new Set);for(let d of m)o[l].add(d)}}return o});let n=cr(()=>{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 m of l){if(a.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);a.set(m,u)}}return a});e._zod.parse=(o,a)=>{let u=o.value;if(!wt(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 Xi=S("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!xi(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(...Me(d,b.issues)),r.value[d]=b.value})):(y.issues.length&&r.issues.push(...Me(d,y.issues)),r.value[d]=y.value)}let m;for(let d in o)l.has(d)||(m=m??[],m.push(d));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:m})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let m=t.keyType._zod.run({value:l,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&In.test(l)&&m.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&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>Le(b,n,Ie())),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(...Me(l,b.issues)),r.value[m.value]=b.value})):(y.issues.length&&r.issues.push(...Me(l,y.issues)),r.value[m.value]=y.value)}}return a.length?Promise.all(a).then(()=>r):r}});var Yi=S("$ZodEnum",(e,t)=>{K.init(e,t);let r=Tn(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>bi.has(typeof o)).map(o=>typeof o=="string"?at(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}}),Qi=S("$ZodLiteral",(e,t)=>{if(K.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"?at(n):n?at(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 ea=S("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new sr(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 be;return r.value=o,r}});function Li(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Li,"handleOptionalResult");var ta=S("$ZodOptional",(e,t)=>{K.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(`^(${lr(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=>Li(a,r.value)):Li(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ra=S("$ZodNullable",(e,t)=>{K.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(`^(${lr(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 na=S("$ZodPipe",(e,t)=>{K.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=>mr(u,t.in,n)):mr(a,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(a=>mr(a,t.out,n)):mr(o,t.out,n)}});function mr(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(mr,"handlePipeResult");var oa=S("$ZodCustom",(e,t)=>{je.init(e,t),K.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=>ji(a,r,n,e));ji(o,r,n,e)}});function ji(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(Sn(o))}}i(ji,"handleRefineResult");var aa;var On=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 sa(){return new On}i(sa,"registry");(aa=globalThis).__zod_globalRegistry??(aa.__zod_globalRegistry=sa());var Rn=globalThis.__zod_globalRegistry;function ua(e,t){return new e({type:"string",...H(t)})}i(ua,"_string");function ca(e,t){return new e({type:"string",coerce:!0,...H(t)})}i(ca,"_coercedString");function la(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}i(la,"_url");function pa(e,t){return new e({type:"number",checks:[],...H(t)})}i(pa,"_number");function da(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}i(da,"_coercedNumber");function fa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}i(fa,"_int");function ma(e,t){return new e({type:"boolean",...H(t)})}i(ma,"_boolean");function ha(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}i(ha,"_coercedBoolean");function ga(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}i(ga,"_coercedBigint");function ya(e){return new e({type:"any"})}i(ya,"_any");function va(e){return new e({type:"unknown"})}i(va,"_unknown");function _a(e,t){return new e({type:"void",...H(t)})}i(_a,"_void");function xa(e,t){return new e({type:"date",coerce:!0,...H(t)})}i(xa,"_coercedDate");function yr(e,t){return new ki({check:"greater_than",...H(t),value:e,inclusive:!0})}i(yr,"_gte");function ye(e,t){return new Ri({check:"min_length",...H(t),minimum:e})}i(ye,"_minLength");function Be(e,t){return new Ni({check:"string_format",format:"regex",...H(t),pattern:e})}i(Be,"_regex");function ba(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(ba,"_custom");var ee=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>dr(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>kt(e,r,n),e.parseAsync=async(r,n)=>fr(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)=>pr(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),_r=S("ZodMiniString",(e,t)=>{gr.init(e,t),ee.init(e,t)});function s(e){return ua(_r,e)}i(s,"string");var Pa=S("ZodMiniStringFormat",(e,t)=>{$n.init(e,t),_r.init(e,t)});var rd=S("ZodMiniURL",(e,t)=>{Bi.init(e,t),Pa.init(e,t)});function Ta(e){return la(rd,e)}i(Ta,"url");var xr=S("ZodMiniNumber",(e,t)=>{wn.init(e,t),ee.init(e,t)});function ie(e){return pa(xr,e)}i(ie,"number");var nd=S("ZodMiniNumberFormat",(e,t)=>{Fi.init(e,t),xr.init(e,t)});function Ea(e){return fa(nd,e)}i(Ea,"int");var Nn=S("ZodMiniBoolean",(e,t)=>{zn.init(e,t),ee.init(e,t)});function F(e){return ma(Nn,e)}i(F,"boolean");var Sa=S("ZodMiniBigInt",(e,t)=>{Vi.init(e,t),ee.init(e,t)});var od=S("ZodMiniAny",(e,t)=>{Zi.init(e,t),ee.init(e,t)});function Nt(){return ya(od)}i(Nt,"any");var id=S("ZodMiniUnknown",(e,t)=>{qi.init(e,t),ee.init(e,t)});function k(){return va(id)}i(k,"unknown");var ad=S("ZodMiniVoid",(e,t)=>{Hi.init(e,t),ee.init(e,t)});function Ia(e){return _a(ad,e)}i(Ia,"_void");var Aa=S("ZodMiniDate",(e,t)=>{Wi.init(e,t),ee.init(e,t)});var sd=S("ZodMiniArray",(e,t)=>{Gi.init(e,t),ee.init(e,t)});function N(e,t){return new sd({type:"array",element:e,...H(t)})}i(N,"array");var ud=S("ZodMiniObject",(e,t)=>{Ki.init(e,t),ee.init(e,t),Q(e,"shape",()=>t.shape)});function f(e,t){let r={type:"object",shape:e??{},...H(t)};return new ud(r)}i(f,"object");var cd=S("ZodMiniUnion",(e,t)=>{kn.init(e,t),ee.init(e,t)});function D(e,t){return new cd({type:"union",options:e,...H(t)})}i(D,"union");var ld=S("ZodMiniDiscriminatedUnion",(e,t)=>{Ji.init(e,t),ee.init(e,t)});function Fe(e,t,r){return new ld({type:"union",options:t,discriminator:e,...H(r)})}i(Fe,"discriminatedUnion");var pd=S("ZodMiniRecord",(e,t)=>{Xi.init(e,t),ee.init(e,t)});function O(e,t,r){return new pd({type:"record",keyType:e,valueType:t,...H(r)})}i(O,"record");var dd=S("ZodMiniEnum",(e,t)=>{Yi.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 dd({type:"enum",entries:r,...H(t)})}i(U,"_enum");var fd=S("ZodMiniLiteral",(e,t)=>{Qi.init(e,t),ee.init(e,t)});function A(e,t){return new fd({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}i(A,"literal");var md=S("ZodMiniTransform",(e,t)=>{ea.init(e,t),ee.init(e,t)});function Ve(e){return new md({type:"transform",transform:e})}i(Ve,"transform");var hd=S("ZodMiniOptional",(e,t)=>{ta.init(e,t),ee.init(e,t)});function v(e){return new hd({type:"optional",innerType:e})}i(v,"optional");var gd=S("ZodMiniNullable",(e,t)=>{ra.init(e,t),ee.init(e,t)});function Dt(e){return new gd({type:"nullable",innerType:e})}i(Dt,"nullable");var yd=S("ZodMiniPipe",(e,t)=>{na.init(e,t),ee.init(e,t)});function Ze(e,t){return new yd({type:"pipe",in:e,out:t})}i(Ze,"pipe");var vd=S("ZodMiniCustom",(e,t)=>{oa.init(e,t),ee.init(e,t)});function br(e,t){return ba(vd,e??(()=>!0),t)}i(br,"custom");var Ct={};hi(Ct,{bigint:()=>Ed,boolean:()=>Td,date:()=>Sd,number:()=>Pd,string:()=>bd});function bd(e){return ca(_r,e)}i(bd,"string");function Pd(e){return da(xr,e)}i(Pd,"number");function Td(e){return ha(Nn,e)}i(Td,"boolean");function Ed(e){return ga(Sa,e)}i(Ed,"bigint");function Sd(e){return xa(Aa,e)}i(Sd,"date");var Cn=f({retryOnFailure:f({defaultValue:v(F()),hide:v(F())}),continueOnFailure:f({defaultValue:v(F()),hide:v(F())})}),Dn=class{constructor(t,r,n,o,a,u,l,m,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=m;this.outputSchema=d;this.audience=y;this.aiMetadata=b}static{i(this,"IAction")}},Z=i(e=>new Dn(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=f({displayName:s(),description:v(s())}),C=i((e,t)=>f({type:A(t),required:F(),defaultValue:v(Nt())}),"TPropertyValue");var ue=f({...B.shape,...C(s(),"SHORT_TEXT").shape}),Ae=f({...B.shape,...C(s(),"LONG_TEXT").shape});var wa=f({label:s(),value:k()}),Pr=f({disabled:v(F()),placeholder:v(s()),options:N(wa)});var ce=f({...B.shape,options:Pr,...C(k(),"STATIC_DROPDOWN").shape}),$e=f({...B.shape,options:Pr,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Un=f({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(s())}),Ut=f({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(s())});var we=f({...B.shape,...C(F(),"CHECKBOX").shape});var ze=f({...B.shape,...C(ie(),"NUMBER").shape});var Mt=f({...B.shape,streaming:v(F()),...C(k(),"FILE").shape});var Lt=f({...B.shape,...C(s(),"DATE_TIME").shape});var za=O(s(),D([ue,Ae,ce,Ut,$e,we,ze,Mt,Lt])),jt=f({...B.shape,properties:za,...C(N(k()),"ARRAY").shape});var Bt=f({...B.shape,...C(D([O(s(),k())]),"JSON").shape});var ka=D([ue,ce,Bt,jt,$e]),Ad=O(s(),ka),Mn=f({refreshers:N(s()),...B.shape,...C(k(),"DYNAMIC").shape});var Tr=f({...B.shape,...C(Ia(),"MARKDOWN").shape});var Ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ft||{}),ut=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(ut||{}),ct=(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))(ct||{});var Vt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Vt||{}),Ln="both_client_credentials_and_authorization_code";var Ke=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ke||{}),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||{}),$d=f({strategy:U(Zt),paramName:v(s())}),qt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(qt||{});var Er=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Er||{}),Oa=f({status:v(ie()),body:v(k()),headers:v(O(s(),s()))}),Ra=f({type:A("DELAY"),resumeDateTime:s(),requestIdToReply:v(s()),handlerId:v(s()),streamStepProgress:v(U(Er))}),Na=f({type:A("WEBHOOK"),requestId:s(),requestIdToReply:v(s()),response:Oa,handlerId:v(s()),streamStepProgress:v(U(Er))}),wd=D([Ra,Na]);var zd=f({body:k(),rawBody:v(k()),headers:O(s(),s()),queryParams:O(s(),s())});function ve(e){return e==null}i(ve,"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 Sr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Sr,"assertNotNullOrUndefined");var jn=ae(require("crypto"),1);var kd=128,Je,lt,Od=i(e=>{!Je||Je.length<e?(Je=Buffer.allocUnsafe(e*kd),jn.default.randomFillSync(Je),lt=0):lt+e>Je.length&&(jn.default.randomFillSync(Je),lt=0),lt+=e},"fillPool"),Rd=i(e=>(Od(e|=0),Je.subarray(lt-e,lt)),"random"),Nd=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),m=o;for(;m--;)if(u+=e[l[m]&n]||"",u.length===a)return u}}},"customRandom"),Ca=i((e,t=21)=>Nd(e,t,Rd),"customAlphabet");var Dd="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ua=21,DA=s().check(Be(new RegExp(`^[0-9a-zA-Z]{${Ua}}$`))),Cd=Ca(Dd,Ua);var qe=Ze(Ve(e=>e instanceof Date?e.toISOString():e),s()),fe={id:s(),created:qe,updated:qe},G=i(e=>v(Dt(e)),"Nullable");function Bn(e){return v(Dt(U(e)))}i(Bn,"NullableEnum");var MA=Ze(Ve(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(F())),Ir=i(e=>Ze(Ve(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var BA=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 QA=s().check(Be(/^#[0-9A-Fa-f]{6}$/));var t$=f({filename:s(),data:k(),type:A("file"),mimetype:v(s())});var Ud=ae(La());var u$=f({...fe,name:s(),permissions:N(s()),platformId:G(s()),type:s(),userCount:v(ie())});var ja=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ja||{}),Fn=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Fn||{}),Vn=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Vn||{});var Zn=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Zn||{});var qn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(qn||{});var Md=f({mode:U(ja),value:k()}),Ld=f({auth:v(s()),fields:O(s(),Md)}),jd=f({pieceName:s(),pieceVersion:s(),actionName:s(),predefinedInput:v(Ld)}),Bd=f({type:A("PIECE"),toolName:s().check(ye(1)),pieceMetadata:jd}),Fd=f({type:A("none")}),Vd=f({type:A("access_token"),accessToken:s()}),Zd=f({type:A("api_key"),apiKey:s(),apiKeyHeader:s()}),qd=f({type:A("headers"),headers:O(s(),s())}),Hd=Fe("type",[Fd,Vd,Zd,qd]),Ba=f({type:A("FLOW"),toolName:s().check(ye(1)),externalFlowId:s(),flowDisplayName:v(s())}),Fa=f({type:A("MCP"),toolName:s().check(ye(1)),serverUrl:Ta(),protocol:U(Vn),auth:Hd}),Va=f({type:A("KNOWLEDGE_BASE"),toolName:s().check(ye(1)),sourceType:U(Fn),sourceId:s(),sourceName:s()}),Wd=Fe("type",[Bd,Ba,Fa,Va]),Gd=f({displayName:s(),description:v(s()),type:U(Zn)}),Za=f({type:A("MARKDOWN"),markdown:s()}),pt={type:A("TOOL_CALL"),input:G(O(s(),k())),output:v(k()),toolName:s(),status:U(qn),toolCallId:s(),startTime:s(),endTime:v(s())},L$=f(pt),qa=Fe("toolCallType",[f({...pt,toolCallType:A("PIECE"),pieceName:s(),pieceVersion:s(),actionName:s()}),f({...pt,toolCallType:A("FLOW"),displayName:s(),externalFlowId:s()}),f({...pt,toolCallType:A("MCP"),displayName:s(),serverUrl:s()}),f({...pt,toolCallType:A("KNOWLEDGE_BASE"),displayName:s(),sourceType:s()}),f({...pt,toolCallType:A("UNKNOWN"),displayName:s()})]),Kd=D([Za,qa]);var Hn=(r=>(r.IMAGE="image",r.TEXT="text",r))(Hn||{}),ke=f({apiKey:s()}),Jd=ke,Xd=f({apiKey:s(),apiKeyHash:s()}),Yd=ke,Qd=ke,ef=ke,tf=ke,rf=ke,nf=ke,of=ke,Ja=f({accessKeyId:s().check(ye(1)),secretAccessKey:s().check(ye(1))}),af=f({}),sf=f({}),uf=f({}),cf=f({}),lf=f({}),pf=f({}),Xa=f({modelId:s(),modelName:s(),modelType:U(Hn)}),Ya=f({apiKeyHeader:s(),baseUrl:s(),models:N(Xa),defaultHeaders:v(O(s(),s()))}),Qa=f({accountId:s(),gatewayId:s(),models:N(Xa),vertexProject:v(s()),vertexRegion:v(s())}),es=f({resourceName:s(),apiVersion:Ze(Ve(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(s()))}),ts=f({region:s().check(ye(1))}),df=D([Jd,ef,tf,rf,nf,Qd,Yd,Xd,Ja,of]),rs=D([Ya,Qa,es,ts,af,uf,cf,lf,sf,pf]),ff=f({id:s(),name:s(),type:U(Hn)}),mf=f({id:s(),name:s(),provider:U(Wt),config:rs,enabledForChat:F()}),hf=f({provider:U(Wt),config:rs,auth:df,platformId:s()});var V$={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Ha=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],gf=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],yf=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Wa=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],vf=["grok-4.20","grok-4.1-fast"],_f={openai:Ha,anthropic:gf,google:Wa,activepieces:[...yf.map(e=>`anthropic/${e}`),...Ha.map(e=>`openai/${e}`),...Wa.map(e=>`google/${e}`),...vf.map(e=>`x-ai/${e}`)]};var Ga=128e3,xf={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function bf({provider:e}){return e?xf[e]??Ga:Ga}i(bf,"getMaxContextTokens");var Ka={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"},Pf={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Tf=new Set(["anthropic","mistral"]);function Pe(e){return{chatModels:_f[e],maxContextTokens:bf({provider:e}),defaultEmbeddingModel:Ka[e],supportsEmbedding:Ka[e]!==void 0,supportsImageGeneration:!Tf.has(e),webSearch:Pf[e]}}i(Pe,"buildProviderCapabilities");var Ef={openai:Pe("openai"),anthropic:Pe("anthropic"),openrouter:Pe("openrouter"),azure:Pe("azure"),google:Pe("google"),"cloudflare-gateway":Pe("cloudflare-gateway"),custom:Pe("custom"),bedrock:Pe("bedrock"),mistral:Pe("mistral"),activepieces:Pe("activepieces")};var Sf=f({base64Url:s(),fileName:s(),extension:v(s())}),If=f({mimeType:s(),url:s(),fileName:v(s())}),Wn=D([Sf,If]);var Af=D([f({type:A("file"),value:Wn}),f({type:A("markdown"),value:s(),files:v(N(Wn))})]),$f=f({sessionId:s(),message:s(),files:v(N(s()))});var os=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(os||{}),is=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(is||{}),Gn=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Gn||{});var wf=D([f({...fe,name:s(),externalId:s(),type:A("STATIC_DROPDOWN"),tableId:s(),projectId:s(),data:f({options:N(f({value:s()}))})}),f({...fe,name:s(),externalId:s(),type:D([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:s(),projectId:s()})]),zf=f({...fe,name:s(),folderId:G(s()),projectId:s(),externalId:s(),status:Bn(is),trigger:Bn(os)}),kf=f({...fe,tableId:s(),projectId:s(),cells:O(s(),f({updated:s(),created:s(),value:k(),fieldName:s()}))}),Of=f({events:N(U(Gn)),webhookUrl:s(),flowId:s()}),Rf=f({fields:N(f({id:s(),name:s()})),rows:N(O(s(),s())),name:s()}),Nf=f({projectId:s(),limit:v(Ct.number()),cursor:v(s()),name:v(s()),externalIds:Ir(s()),folderId:v(s()),folderIds:Ir(s())}),Df=f({records:N(N(f({fieldId:s(),value:ss()}))),tableId:s()}),Cf=f({cells:v(N(f({fieldId:s(),value:ss()}))),tableId:s(),agentUpdate:v(F())}),as=Fe("operator",[Xe("eq"),Xe("neq"),Xe("gt"),Xe("gte"),Xe("lt"),Xe("lte"),Xe("co"),ns("exists"),ns("not_exists")]),Uf=f({tableId:s(),limit:v(Ct.number()),cursor:v(s()),filters:Ir(as)});function ss(){return Ze(Ve(e=>e==null?e:String(e)),Dt(s()))}i(ss,"coerceToString");function Xe(e){return f({fieldId:s(),operator:A(e),value:s()})}i(Xe,"valueFilter");function ns(e){return f({fieldId:s(),operator:A(e)})}i(ns,"existenceFilter");var Mf=f({status:v(ie()),body:v(k()),headers:v(O(s(),s()))}),Lf=f({...fe,deleted:G(qe),ownerId:s(),displayName:s(),platformId:s(),externalId:G(s())});var us=f({name:s(),description:v(s()),type:s(),required:F()}),jf=f({pieceName:s(),triggerName:s(),input:f({toolName:s(),toolDescription:s(),inputSchema:N(us),returnsResponse:F()})});var cs="^[0-9]+\\.[0-9]+\\.[0-9]+$",uw=new RegExp(cs),Ff="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",cw=s().check(Be(new RegExp(cs))),lw=s().check(Be(new RegExp(Ff))),Vf=f({packageType:A("ARCHIVE"),pieceType:U(ut),pieceName:s(),pieceVersion:s(),archiveId:s(),platformId:s()}),ls=f({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:s(),pieceVersion:s()}),ps=f({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:s(),pieceVersion:s(),platformId:s()}),pw=D([ls,ps]),dw=D([Vf,ls,ps]);var Zf=Fe("type",[f({type:A("CRON_EXPRESSION"),cronExpression:s(),timezone:s()}),f({type:A("INTERVAL"),intervalMs:Ea().check(yr(6e4))})]),fw=f({...fe,type:U(Ke),projectId:s(),flowId:s(),triggerName:s(),schedule:G(Zf),flowVersionId:s(),pieceName:s(),pieceVersion:s(),deleted:G(s()),simulate:F()}),ds=(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))(ds||{}),fs=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(fs||{}),ms=(r=>(r.S3="S3",r.DB="DB",r))(ms||{}),mw=f({...fe,projectId:G(s()),platformId:G(s()),type:U(ds),compression:U(fs),data:v(k()),location:U(ms),size:G(ie()),fileName:G(s()),s3Key:G(s()),metadata:G(O(s(),s()))}),hs=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(hs||{}),gs=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(gs||{}),hw=f({id:s(),email:s(),firstName:s(),status:U(gs),externalId:G(s()),platformId:G(s()),platformRole:U(hs),lastName:s(),created:qe,updated:qe,lastActiveDate:G(qe),imageUrl:G(s())});var Jn=f({...B.shape,...C(O(s(),k()),"OBJECT").shape});var _s=f({...B.shape,...C(s(),"COLOR").shape});var Xn=D([ue,Ae,Tr,we,ce,$e,Un,Ut,Mn,ze,jt,Jn,Bt,Lt,Mt,_s]),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 Te=f({displayName:s(),description:v(s())});var xs=f({username:s(),password:s()}),Yn=f({...Te.shape,username:f({displayName:s(),description:v(s())}),password:f({displayName:s(),description:v(s())}),...C(xs,"BASIC_AUTH").shape});var Gf=O(s(),D([ue,Ae,ze,we,ce])),Qn=f({...Te.shape,props:Gf,...C(k(),"CUSTOM_AUTH").shape});var Ye=f({...Te.shape,...C(f({auth:s()}),"SECRET_TEXT").shape});var Kf=O(s(),D([ue,Ae,Ye,ze,we,ce,$e,Tr])),bs=f({...Te.shape,props:Kf,...C(k(),"OIDC").shape});var eo=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(eo||{}),Ps=D([ue,Ye,ce]),Ts=O(s(),Ps),Jf=f({props:v(O(s(),Ps)),authUrl:s(),tokenUrl:s(),scope:N(s()),prompt:v(D([A("none"),A("consent"),A("login"),A("omit")])),pkce:v(F()),pkceMethod:v(D([A("plain"),A("S256")])),authorizationMethod:v(U(eo)),grantType:v(D([U(Vt),A(Ln)])),extra:v(O(s(),s()))}),Es=f({access_token:s(),props:v(Ts),data:O(s(),Nt())}),to=f({...Te.shape,...Jf.shape,...C(Es,"OAUTH2").shape});var dt=D([Yn,Qn,bs,to,Ye]),Gt="Connection",ro={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 Wz={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 Xf=f({...B.shape,...C(k(),"CUSTOM").shape,code:s()});var Yf=D([Xn,dt]),no=O(s(),Yf),fk=O(s(),Xn);var Ss=D([f({strategy:A("CRON"),cronExpression:s()}),f({strategy:A("NONE")})]);var Is="2",$r="0.82.0";var oo=class{constructor(t,r,n,o,a,u,l,m,d=$r,y,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=m;this.minimumSupportedRelease=d;this.maximumSupportedRelease=y;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Is}),"getContextInfo");(!Qf(d)||em(d,$r))&&(this.minimumSupportedRelease=$r),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: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}},As=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 oo(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 Qf(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Qf,"isValidSimpleSemver");function em(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(em,"isSemverLessThan");var tm=v(O(s(),O(s(),s()))),$s=f({id:v(s()),name:s(),displayName:s(),logoUrl:s(),description:s(),authors:N(s()),platformId:v(s()),directoryPath:v(s()),auth:v(D([dt,N(dt)])),version:s(),categories:v(N(U(ct))),minimumSupportedRelease:v(s()),maximumSupportedRelease:v(s()),deprecated:v(F()),i18n:tm}),rm=U(["human","ai","both"]),ws=f({description:v(s()),idempotent:v(F())}),zs=f({name:s(),displayName:s(),description:s(),props:no,requireAuth:F(),errorHandlingOptions:v(Cn),outputSchema:v(br()),audience:v(rm),aiMetadata:v(ws)}),ks=f({name:s(),displayName:s(),description:s(),props:no,errorHandlingOptions:v(Cn),type:U(Ke),sampleData:k(),handshakeConfiguration:v(br()),renewConfiguration:v(Ss),testStrategy:U(qt),outputSchema:v(br()),aiMetadata:v(ws)}),nm=f({...$s.shape,actions:O(s(),zs),triggers:O(s(),ks)}),om=f({...$s.shape,actions:ie(),triggers:ie(),suggestedActions:v(N(zs)),suggestedTriggers:v(N(ks))}),Os=f({projectUsage:ie(),pieceType:U(ut),packageType:U(Ft),platformId:v(s()),archiveId:v(s())}),fO=f({...nm.shape,...Os.shape}),mO=f({...om.shape,...Os.shape}),hO=f({name:s(),version:s()});var im=ae(require("path")),am=ae(require("fs/promises"));var Cs=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 zr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new io,r=new ao){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},io=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},ao=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 Rs({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(Rs,"toFailsafeOutput");var kr=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(kr||{});var Or=class extends wr{static{i(this,"FetchHttpClient")}constructor(t="",r=new zr){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(),m=l?`${n}?${l}`:n,d=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:c,isStream:p}=sm(t.method)?um(t.body,a):{body:void 0,extraHeaders:{},isStream:!1},g=lm({...a,...c}),h=await cm(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:_,redirect:y?"follow":"manual",signal:M.signal};return p&&(oe.duplex="half"),r?.dispatcher!==void 0&&(oe.dispatcher=r.dispatcher),await fetch(m,oe)}finally{Y!==void 0&&clearTimeout(Y)}},b),x=y?300:400;if(h.status<200||h.status>=x){let M=await Ns(h,d),Y=new Kt(t.body,{status:h.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Y),Y}let T=await Ns(h,d);return{status:h.status,headers:pm(h.headers),body:T}}};function sm(e){return e!=="GET"&&e!=="HEAD"}i(sm,"acceptsRequestBody");function um(e,t){if(fm(e))return{body:void 0,extraHeaders:{},isStream:!1};if(dm(e)){let n=new Cs.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return 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(um,"serializeBody");async function Ns(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());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(Ns,"parseResponseBody");async function cm(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ds(n);continue}return o}catch(o){if(r=o,n<t){await Ds(n);continue}throw o}throw r}i(cm,"sendWithRetries");function Ds(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ds,"backoff");function lm(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(lm,"normalizeHeaders");function pm(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(pm,"toHttpHeaders");function dm(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(dm,"isNodeFormData");function fm(e){return e==null}i(fm,"isNil");var Rr=new Or;var eg=ae(require("fs")),Fc=ae(Bc());var tg={"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 rg(e){let t=e.split(";")[0].trim().toLowerCase();return tg[t]??""}i(rg,"contentTypeToExtension");var ng=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),og=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 Vc({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:a,props:u,extraProps:l,authLocation:m="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 ${og(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(kr).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:_,queryParams:c,body:p,body_type:g,failsafe:h,timeout:x,response_is_binary:T,followRedirects:M}=d.propsValue;Sr(y,"Method"),Sr(b,"URL");let Y=ve(r)?{}:await r(d.auth,d.propsValue),oe=b.url,Ue=oe.startsWith("http://")||oe.startsWith("https://")?oe:ng({baseUrl:t(d.auth),relativePath:oe}),pe={method:y,url:Ue,headers:{..._??{},...m==="headers"||!ve(m)?Y:{}},queryParams:{...m==="queryParams"?Y:{},...c??{}},timeout:x?x*1e3:0,followRedirects:M};if(T&&(pe.responseType="arraybuffer"),p)if(g&&g!=="none"){let de=p.data;if(g==="form_data"){let At=de,it=new Fc.default;for(let{fieldName:di,fieldType:fi,textFieldValue:mi,fileFieldValue:xn}of At)fi==="text"&&!Ht(mi)?it.append(di,mi):fi==="file"&&!Ht(xn)&&it.append(di,xn.data,{filename:xn?.filename});pe.body=it,pe.headers={...pe.headers,...it.getHeaders()}}else pe.body=de}else g||(pe.body=p);try{let de=await Rr.sendRequest(pe);return await ig(d.files,de.body,de.status,de.headers,T)}catch(de){if(h)return Rs({error:de,requestBody:pe.body});throw de}},"run")})}i(Vc,"createCustomApiCallAction");var ig=i(async(e,t,r,n,o)=>{let a;if(o&&ag(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=rg(u??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),a=await e.write({fileName:`output.${l}`,data:m})}else a=t;return{status:r,headers:n,body:a}},"handleBinaryResponse"),ag=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var _p=require("stream/web");var Ny=ae(op(),1),Dy=ae(Xr(),1),Cy=ae(xt(),1),Uy=ae(Ho(),1),My=ae(Ko(),1),Ly=ae(ti(),1),fp=ae(tn(),1),jy=ae(dp(),1);var mp=fp.default;var xp=require("fs"),bp=require("stream");var ni={cache:"no-store"},By=i(e=>ar+(e===!1?"":" AssemblyAI/1.0 ("+Object.entries({...nn,...e}).map(([t,r])=>r?`${t}=${r.name}/${r.version}`:"").join(" ")+")"),"buildUserAgent"),ar="";typeof navigator<"u"&&navigator.userAgent&&(ar+=navigator.userAgent);var nn={sdk:{name:"JavaScript",version:"4.7.0"}};typeof process<"u"&&(process.versions.node&&ar.indexOf("Node")===-1&&(nn.runtime_env={name:"Node",version:process.versions.node}),process.versions.bun&&ar.indexOf("Bun")===-1&&(nn.runtime_env={name:"Bun",version:process.versions.bun}));typeof Deno<"u"&&process.versions.bun&&ar.indexOf("Deno")===-1&&(nn.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=By(t.userAgent||{})}async fetch(t,r){r={...ni,...r};let n={Authorization:this.params.apiKey,"Content-Type":"application/json"};ni?.headers&&(n={...n,...ni.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()}},oi=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"})}},hp=i((e,t)=>new mp(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},gp={[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"},ii=class extends Error{static{i(this,"RealtimeError")}},Fy="wss://api.assemblyai.com/v2/realtime/ws",Vy='{"force_end_utterance":true}',yp='{"terminate_session":true}',ai=class{static{i(this,"RealtimeTranscriber")}constructor(t){if(this.listeners={},this.realtimeUrl=t.realtimeUrl??Fy,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=hp(r.toString()):this.socket=hp(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 gp&&(o=gp[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 ii(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(Vy)}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(yp),await r}else this.socket.send(yp);this.socket?.removeAllListeners&&this.socket.removeAllListeners(),this.socket.close()}this.listeners={},this.socket=void 0}};var si=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 ai(r)}async createTemporaryToken(t){return(await this.fetchJson("/v2/realtime/token",{method:"POST",body:JSON.stringify(t)})).token}};function vp(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(vp,"getPath");var ui=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=vp(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=vp(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}}},Zy=i(async e=>bp.Readable.toWeb((0,xp.createReadStream)(e)),"readFile"),ci=class extends It{static{i(this,"FileService")}async upload(t){let r;return typeof t=="string"?t.startsWith("data:")?r=qy(t):r=await Zy(t):r=t,(await this.fetchJson("/v2/upload",{method:"POST",body:r,headers:{"Content-Type":"application/octet-stream"},duplex:"half"})).upload_url}};function qy(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(qy,"dataUrlToBlob");var Hy="https://api.assemblyai.com",on=class{static{i(this,"AssemblyAI")}constructor(t){t.baseUrl=t.baseUrl||Hy,t.baseUrl&&t.baseUrl.endsWith("/")&&(t.baseUrl=t.baseUrl.slice(0,-1)),this.files=new ci(t),this.transcripts=new ui(t,this.files),this.lemur=new oi(t),this.realtime=new si(t)}};var Pp={name:"@activepieces/piece-assemblyai",version:"1.1.8",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 li="https://api.assemblyai.com",q=i(e=>{if(!e.auth)throw new Error("The AssemblyAI API key is required.");return new on({apiKey:e.auth.secret_text,userAgent:{integration:{name:"Activepieces",version:Pp.version}},baseUrl:li})},"getAssemblyAIClient");var V=ro.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 Rr.sendRequest({method:"GET",url:`${li}/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 an=Z({name:"uploadFile",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 Tp={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 Gy={...Tp,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})},sn=Z({name:"transcribe",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:Gy,async run(e){let t=q(e);if(e.executionType==="BEGIN"){let r=Ky(e),n=await Jy(e,r);Xy(e),Yy(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 Ky(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(Ky,"createTranscriptParams");async function Jy(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(Jy,"handleWebhookUrl");function Xy(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(Xy,"handlePiiAudio");function Yy(e){let t=e;for(let r in t){let n=t[r];Array.isArray(n)&&n.length===0&&delete t[r]}}i(Yy,"handleEmptyArrays");var ge=P.ShortText({displayName:"Transcript ID",required:!0});var un=Z({name:"getTranscript",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:ge},async run(e){return await q(e).transcripts.get(e.propsValue.id)}});var cn=Z({name:"getTranscriptSentences",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:ge},async run(e){return await q(e).transcripts.sentences(e.propsValue.id)}});var ln=Z({name:"getTranscriptParagraphs",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:ge},async run(e){return await q(e).transcripts.paragraphs(e.propsValue.id)}});var pn=Z({name:"getSubtitles",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 dn=Z({name:"getRedactedAudio",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:ge,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 fn=Z({name:"wordSearch",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:ge,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 Ep={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 mn=Z({name:"listTranscripts",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:Ep,async run(e){return await q(e).transcripts.list(e.propsValue)}});var hn=Z({name:"deleteTranscript",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:ge},async run(e){return await q(e).transcripts.delete(e.propsValue.id)}});var Sp={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.
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 gn=Z({name:"lemurTask",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:Sp,async run(e){return await q(e).lemur.task({transcript_ids:e.propsValue.transcript_ids,prompt:e.propsValue.prompt})}});var yn=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 vn=Z({name:"getLemurResponse",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:yn},async run(e){return await q(e).lemur.getResponse(e.propsValue.request_id)}});var _n=Z({name:"purgeLemurRequestData",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:yn},async run(e){return await q(e).lemur.purgeRequestData(e.propsValue.request_id)}});var pi=Vc({auth:V,baseUrl:i(()=>"https://api.assemblyai.com","baseUrl"),authMapping:i(async e=>({Authorization:`${e.secret_text}`}),"authMapping")});var ev=As({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:[an,sn,un,cn,ln,pn,dn,fn,mn,hn,gn,vn,_n,pi],triggers:[]});0&&(module.exports={assemblyai});
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: