@activepieces/piece-twilio 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +3 -3
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Js=Object.create;var tt=Object.defineProperty;var Ys=Object.getOwnPropertyDescriptor;var Qs=Object.getOwnPropertyNames;var eu=Object.getPrototypeOf,tu=Object.prototype.hasOwnProperty;var i=(e,t)=>tt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},Pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qs(t))!tu.call(e,o)&&o!==r&&tt(e,o,{get:()=>t[o],enumerable:!(n=Ys(t,o))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?Js(eu(e)):{},Pn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),ru=e=>Pn(tt({},"__esModule",{value:!0}),e);var jo=E((Mo,Zt)=>{(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"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,_=(u.match(l.zoneIndex)||[])[0],P,j;for(_&&(_=_.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(j=d-y,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=function(){let ne=u.split(":"),ce=[];for(let et=0;et<ne.length;et++)ce.push(parseInt(ne[et],16));return ce}(),{parts:d,zoneId:_}}i(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[_]>>P!==d[_]>>P)return!1;f-=y,_+=1}return!0}i(g,"matchCIDR");function h(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}i(b,"padPart");let x={};x.IPv4=function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,j;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in f){if(j=f[P],y&&j!==0)return null;j!==8&&(y=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let j=0;j<_.length;j++)y=_[j],P.push(h(y));return P}();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(f>>P&255);return _}().reverse()}else return(d=u.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(f=h(_[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=u.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(f=h(_[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(h(_[1])),P.push(f>>8&255),P.push(f&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=function(){function u(d,y){let f,_;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(_=this.parts[f],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={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},_,P;for(let j=7;j>=0;j-=1)if(_=this.parts[j],_ in f){if(P=f[_],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let _=0;_<f.length;_++)d=f[_],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(b(this.parts[_].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(this.parts[_].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,_=-1,P;for(;P=d.exec(y);)P[0].length>_&&(f=P.index,_=P[0].length);return _<0?y:`${y.substring(0,f)}::${y.substring(f+_)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(u){let d=this.parser(u);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(u){let d,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,f,_,P,j;if(f=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(u))return m(u,8);if((f=u.match(l.transitional))&&(j=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+j,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(_=P[y],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,_,P,j;y==null&&(y="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(j=P[f],u.kind()===j[0].kind()&&u.match.apply(u,j))return _}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Mo)});var Di=E((nA,Ni)=>{var Ri=require("stream").Stream,kl=require("util");Ni.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(de,"DelayedStream");kl.inherits(de,Ri);de.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(de.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Ri.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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 ji=E((iA,Mi)=>{var Ol=require("util"),Ui=require("stream").Stream,Ci=Di();Mi.exports=q;function q(){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(q,"CombinedStream");Ol.inherits(q,Ui);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Ci)){var r=Ci.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};q.prototype.pipe=function(e,t){return Ui.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Fi=E((sA,Li)=>{"use strict";Li.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 Zi=E(re=>{"use strict";var Kt=Fi(),Rl=require("path").extname,Bi=/^\s*([^;\s]*)(?:;|\s|$)/,Nl=/^text\//i;re.charset=Vi;re.charsets={lookup:Vi};re.contentType=Dl;re.extension=Cl;re.extensions=Object.create(null);re.lookup=Ul;re.types=Object.create(null);Ml(re.extensions,re.types);function Vi(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Nl.test(t[1])?"UTF-8":!1}i(Vi,"charset");function Dl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Dl,"contentType");function Cl(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Cl,"extension");function Ul(e){if(!e||typeof e!="string")return!1;var t=Rl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}i(Ul,"lookup");function Ml(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(i(function(o){var s=Kt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var m=c[l];if(t[m]){var g=r.indexOf(Kt[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(Ml,"populateMaps")});var Wi=E((lA,Hi)=>{Hi.exports=jl;function jl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(jl,"defer")});var Xr=E((dA,qi)=>{var Gi=Wi();qi.exports=Ll;function Ll(e){var t=!1;return Gi(function(){t=!0}),i(function(n,o){t?e(n,o):Gi(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Ll,"async")});var Kr=E((fA,Xi)=>{Xi.exports=Fl;function Fl(e){Object.keys(e.jobs).forEach(Bl.bind(e)),e.jobs={}}i(Fl,"abort");function Bl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Bl,"clean")});var Jr=E((yA,Ji)=>{var Ki=Xr(),Vl=Kr();Ji.exports=Zl;function Zl(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Hl(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Vl(r):r.results[o]=c,n(s,r.results))})}i(Zl,"iterate");function Hl(e,t,r,n){var o;return e.length==2?o=e(r,Ki(n)):o=e(r,t,Ki(n)),o}i(Hl,"runJob")});var Yr=E((vA,Yi)=>{Yi.exports=Wl;function Wl(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,s){return t(e[o],e[s])}),n}i(Wl,"state")});var Qr=E((_A,Qi)=>{var Gl=Kr(),ql=Xr();Qi.exports=Xl;function Xl(e){Object.keys(this.jobs).length&&(this.index=this.size,Gl(this),ql(e)(null,this.results))}i(Xl,"terminator")});var ta=E((bA,ea)=>{var Kl=Jr(),Jl=Yr(),Yl=Qr();ea.exports=Ql;function Ql(e,t,r){for(var n=Jl(e);n.index<(n.keyedList||e).length;)Kl(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Yl.bind(n,r)}i(Ql,"parallel")});var en=E((IA,Jt)=>{var ra=Jr(),ep=Yr(),tp=Qr();Jt.exports=rp;Jt.exports.ascending=na;Jt.exports.descending=np;function rp(e,t,r,n){var o=ep(e,r);return ra(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ra(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),tp.bind(o,n)}i(rp,"serialOrdered");function na(e,t){return e<t?-1:e>t?1:0}i(na,"ascending");function np(e,t){return-1*na(e,t)}i(np,"descending")});var ia=E(($A,oa)=>{var op=en();oa.exports=ip;function ip(e,t,r){return op(e,t,null,r)}i(ip,"serial")});var sa=E((AA,aa)=>{aa.exports={parallel:ta(),serial:ia(),serialOrdered:en()}});var tn=E((zA,ua)=>{"use strict";ua.exports=Object});var la=E((wA,ca)=>{"use strict";ca.exports=Error});var da=E((kA,pa)=>{"use strict";pa.exports=EvalError});var fa=E((OA,ma)=>{"use strict";ma.exports=RangeError});var ya=E((RA,ga)=>{"use strict";ga.exports=ReferenceError});var va=E((NA,ha)=>{"use strict";ha.exports=SyntaxError});var Yt=E((DA,xa)=>{"use strict";xa.exports=TypeError});var Pa=E((CA,_a)=>{"use strict";_a.exports=URIError});var Ta=E((UA,ba)=>{"use strict";ba.exports=Math.abs});var Ea=E((MA,Ia)=>{"use strict";Ia.exports=Math.floor});var Sa=E((jA,$a)=>{"use strict";$a.exports=Math.max});var za=E((LA,Aa)=>{"use strict";Aa.exports=Math.min});var ka=E((FA,wa)=>{"use strict";wa.exports=Math.pow});var Ra=E((BA,Oa)=>{"use strict";Oa.exports=Math.round});var Da=E((VA,Na)=>{"use strict";Na.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ua=E((HA,Ca)=>{"use strict";var ap=Da();Ca.exports=i(function(t){return ap(t)||t===0?t:t<0?-1:1},"sign")});var ja=E((GA,Ma)=>{"use strict";Ma.exports=Object.getOwnPropertyDescriptor});var rn=E((qA,La)=>{"use strict";var Qt=ja();if(Qt)try{Qt([],"length")}catch{Qt=null}La.exports=Qt});var Ba=E((XA,Fa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}Fa.exports=er});var nn=E((KA,Va)=>{"use strict";Va.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 s 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[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 Wa=E((YA,Ha)=>{"use strict";var Za=typeof Symbol<"u"&&Symbol,sp=nn();Ha.exports=i(function(){return typeof Za!="function"||typeof Symbol!="function"||typeof Za("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sp()},"hasNativeSymbols")});var on=E((ez,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var an=E((tz,qa)=>{"use strict";var up=tn();qa.exports=up.getPrototypeOf||null});var Ja=E((rz,Ka)=>{"use strict";var cp="Function.prototype.bind called on incompatible ",lp=Object.prototype.toString,pp=Math.max,dp="[object Function]",Xa=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),mp=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),fp=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");Ka.exports=i(function(t){var r=this;if(typeof r!="function"||lp.apply(r)!==dp)throw new TypeError(cp+r);for(var n=mp(arguments,1),o,s=i(function(){if(this instanceof o){var h=r.apply(this,Xa(n,arguments));return Object(h)===h?h:this}return r.apply(t,Xa(n,arguments))},"binder"),c=pp(0,r.length-n.length),l=[],m=0;m<c;m++)l[m]="$"+m;if(o=Function("binder","return function ("+fp(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var qe=E((oz,Ya)=>{"use strict";var gp=Ja();Ya.exports=Function.prototype.bind||gp});var tr=E((iz,Qa)=>{"use strict";Qa.exports=Function.prototype.call});var sn=E((az,es)=>{"use strict";es.exports=Function.prototype.apply});var rs=E((sz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var os=E((uz,ns)=>{"use strict";var yp=qe(),hp=sn(),vp=tr(),xp=rs();ns.exports=xp||yp.call(vp,hp)});var as=E((cz,is)=>{"use strict";var _p=qe(),Pp=Yt(),bp=tr(),Tp=os();is.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Pp("a function is required");return Tp(_p,bp,t)},"callBindBasic")});var ds=E((pz,ps)=>{"use strict";var Ip=as(),ss=rn(),cs;try{cs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var un=!!cs&&ss&&ss(Object.prototype,"__proto__"),ls=Object,us=ls.getPrototypeOf;ps.exports=un&&typeof un.get=="function"?Ip([un.get]):typeof us=="function"?i(function(t){return us(t==null?t:ls(t))},"getDunder"):!1});var hs=E((mz,ys)=>{"use strict";var ms=on(),fs=an(),gs=ds();ys.exports=ms?i(function(t){return ms(t)},"getProto"):fs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return fs(t)},"getProto"):gs?i(function(t){return gs(t)},"getProto"):null});var cn=E((gz,vs)=>{"use strict";var Ep=Function.prototype.call,$p=Object.prototype.hasOwnProperty,Sp=qe();vs.exports=Sp.call(Ep,$p)});var Es=E((yz,Is)=>{"use strict";var M,Ap=tn(),zp=la(),wp=da(),kp=fa(),Op=ya(),Ye=va(),Je=Yt(),Rp=Pa(),Np=Ta(),Dp=Ea(),Cp=Sa(),Up=za(),Mp=ka(),jp=Ra(),Lp=Ua(),bs=Function,ln=i(function(e){try{return bs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=rn(),Fp=Ba(),pn=i(function(){throw new Je},"throwTypeError"),Bp=bt?function(){try{return arguments.callee,pn}catch{try{return bt(arguments,"callee").get}catch{return pn}}}():pn,Xe=Wa()(),Q=hs(),Vp=an(),Zp=on(),Ts=sn(),Tt=tr(),Ke={},Hp=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Xe&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":zp,"%eval%":eval,"%EvalError%":wp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":bs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ap,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":kp,"%ReferenceError%":Op,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Xe?Symbol:M,"%SyntaxError%":Ye,"%ThrowTypeError%":Bp,"%TypedArray%":Hp,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Rp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Ts,"%Object.defineProperty%":Fp,"%Object.getPrototypeOf%":Vp,"%Math.abs%":Np,"%Math.floor%":Dp,"%Math.max%":Cp,"%Math.min%":Up,"%Math.pow%":Mp,"%Math.round%":jp,"%Math.sign%":Lp,"%Reflect.getPrototypeOf%":Zp};if(Q)try{null.error}catch(e){xs=Q(Q(e)),De["%Error.prototype%"]=xs}var xs,Wp=i(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return De[t]=r,r},"doEval"),_s={__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"]},It=qe(),rr=cn(),Gp=It.call(Tt,Array.prototype.concat),qp=It.call(Ts,Array.prototype.splice),Ps=It.call(Tt,String.prototype.replace),nr=It.call(Tt,String.prototype.slice),Xp=It.call(Tt,RegExp.prototype.exec),Kp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Jp=/\\(\\)?/g,Yp=i(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var o=[];return Ps(t,Kp,function(s,c,l,m){o[o.length]=l?Ps(m,Jp,"$1"):c||s}),o},"stringToPath"),Qp=i(function(t,r){var n=t,o;if(rr(_s,n)&&(o=_s[n],n="%"+o[0]+"%"),rr(De,n)){var s=De[n];if(s===Ke&&(s=Wp(n)),typeof s>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Is.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(Xp(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Yp(t),o=n.length>0?n[0]:"",s=Qp("%"+o+"%",r),c=s.name,l=s.value,m=!1,g=s.alias;g&&(o=g[0],qp(n,Gp([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var x=n[h],u=nr(x,0,1),d=nr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ye("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(m=!0),o+="."+x,c="%"+o+"%",rr(De,c))l=De[c];else if(l!=null){if(!(x in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&h+1>=n.length){var y=bt(l,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else b=rr(l,x),l=l[x];b&&!m&&(De[c]=l)}}return l},"GetIntrinsic")});var Ss=E((vz,$s)=>{"use strict";var ed=nn();$s.exports=i(function(){return ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var ws=E((_z,zs)=>{"use strict";var td=Es(),As=td("%Object.defineProperty%",!0),rd=Ss()(),nd=cn(),od=Yt(),or=rd?Symbol.toStringTag:null;zs.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 od("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!nd(t,or))&&(As?As(t,or,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Os=E((bz,ks)=>{"use strict";var id=Function.prototype.call,ad=Object.prototype.hasOwnProperty,sd=qe();ks.exports=sd.call(id,ad)});var Ns=E((Tz,Rs)=>{"use strict";Rs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Us=E((Iz,Cs)=>{"use strict";var gn=ji(),ud=require("util"),dn=require("path"),cd=require("http"),ld=require("https"),pd=require("url").parse,dd=require("fs"),md=require("stream").Stream,fd=require("crypto"),mn=Zi(),gd=sa(),yd=ws(),we=Os(),fn=Ns();function Ds(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ds,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],gn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(L,"FormData");ud.inherits(L,gn);L.LINE_BREAK=`\r
|
|
2
|
-
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=gn.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),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};L.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)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof md))&&(r.knownLength||this._valuesToMeasure.push(t))};L.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)):dd.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")};L.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),s="",c={"Content-Disposition":["form-data",'name="'+Ds(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&fn(c,r.header);var l;for(var m in c)if(we(c,m)){if(l=c[m],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=m+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+s+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=dn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=dn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=dn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ds(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=mn.lookup(e.name)),!r&&e&&e.path&&(r=mn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=mn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.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};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.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(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+fd.randomBytes(12).toString("hex")};L.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};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.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}gd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=pd(e),n=fn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=fn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ld.request(n):r=cd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,m=i(function(g,h){return r.removeListener("error",m),r.removeListener("response",l),t.call(this,g,h)},"callback");l=m.bind(this,null),r.on("error",m),r.on("response",l)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};yd(L.prototype,"FormData");Cs.exports=L});var $d={};_n($d,{twilio:()=>Ed,twilioAuth:()=>V});module.exports=ru($d);var nu=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,m){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let x=h[b];x in l||(l[x]=g[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var m;let g=r?.Parent?new s:this;n(g,l),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(T,"$constructor");var ou=Symbol("zod_brand"),me=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},lr={};function he(e){return e&&Object.assign(lr,e),lr}i(he,"config");function dr(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(dr,"getEnumValues");function Tn(e,t){return typeof t=="bigint"?t.toString():t}i(Tn,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(At,"cached");function In(e){return e==null}i(In,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(zt,"cleanRegex");var bn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==bn)return n===void 0&&(n=bn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(X,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(rt,"isObject");var iu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function En(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(En,"isPlainObject");var $n=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Me,"escapeRegex");function wt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(wt,"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 Sn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Sn,"optionalKeys");var au={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 je(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(je,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Ie,"prefixIssues");function St(e){return typeof e=="string"?e:e?.message}i(St,"unwrapMessage");function Ee(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(r.customError?.(e))??St(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ee,"finalizeIssue");function An(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(An,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(fr,"issue");var zn=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,Tn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),wn=T("$ZodError",zn),nt=T("$ZodError",zn,{Parent:Error});var uu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parse"),kt=uu(nt),cu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ee(m,s,he())));throw mr(l,o?.callee),l}return c.value},"_parseAsync"),Ot=cu(nt),lu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new me;return s.issues.length?{success:!1,error:new(e??wn)(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParse"),ot=lu(nt),pu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ee(c,o,he())))}:{success:!0,data:s.value}},"_safeParseAsync"),it=pu(nt);var du="(?:(?:\\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])))",mu=new RegExp(`^${du}$`);var kn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),On=/^-?\d+n?$/;var gr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Le=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Nn=T("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!In(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 c=An(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Le.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.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=()=>{})}),Dn=T("$ZodCheckRegex",(e,t)=>{yr.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 Un={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(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((c,l,m)=>{let g=je(c),h;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new me;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(g||(g=je(c,x)))});else{if(c.issues.length===x)continue;g||(g=je(c,x))}}return h?h.then(()=>c):c},"runChecks"),s=i((c,l,m)=>{if(je(c))return c.aborted=!0,c;let g=o(l,n,m);if(g instanceof Promise){if(m.async===!1)throw new me;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,l)):s(g,c,l)}let m=e._zod.parse(c,l);if(m instanceof Promise){if(l.async===!1)throw new me;return m.then(g=>o(g,n,l))}return o(m,n,l)}}X(e,"~standard",()=>({validate:i(o=>{try{let s=ot(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return it(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kn(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}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Dt.init(e,t)});var Bn=T("$ZodURL",(e,t)=>{hr.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 Vn=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,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 s=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,...s?{received:s}:{}}),r}});var vr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Rn,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}}),Zn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=On,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 Hn=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Wn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Gn=T("$ZodVoid",(e,t)=>{W.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}}),qn=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}i(Mn,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{W.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 s=[];for(let c=0;c<o.length;c++){let l=o[c],m=t.element._zod.run({value:l,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Mn(g,r,c))):Mn(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Nt(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Nt,"handlePropertyResult");function fu(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=Sn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(fu,"normalizeDef");function gu(e,t,r,n,o,s){let c=[],l=o.keySet,m=o.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let x=m.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Nt(u,r,b,t,h))):Nt(x,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(gu,"handleCatchall");var Kn=T("$ZodObject",(e,t)=>{if(W.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=At(()=>fu(t));X(e._zod,"propValues",()=>{let l=t.shape,m={};for(let g in l){let h=l[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let o=rt,s=t.catchall,c;e._zod.parse=(l,m)=>{c??(c=n.value);let g=l.value;if(!o(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let h=[],b=c.shape;for(let x of c.keys){let u=b[x],d=u._zod.optout==="optional",y=u._zod.run({value:g[x],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Nt(f,l,x,g,d))):Nt(y,l,x,g,d)}return s?gu(h,g,l,m,n.value,e):h.length?Promise.all(h).then(()=>l):l}});function jn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!je(s));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(s=>s.issues.map(c=>Ee(c,n,he())))}),t)}i(jn,"handleUnionResults");var xr=T("$ZodUnion",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>zt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let m of t.options){let g=m._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(m=>jn(m,o,e,s)):jn(l,o,e,s)}});var Jn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,m]of Object.entries(c)){o[l]||(o[l]=new Set);for(let g of m)o[l].add(g)}}return o});let n=At(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of l){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!rt(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Yn=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!En(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:o[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Ie(g,h.issues)),r.value[g]=h.value)}let m;for(let g in o)l.has(g)||(m=m??[],m.push(g));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"&&gr.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=>Ee(b,n,he())),input:l,path:[l],inst:e});continue}let h=t.valueType._zod.run({value:o[l],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(l,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Ie(l,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Qn=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>$n.has(typeof o)).map(o=>typeof o=="string"?Me(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),eo=T("$ZodLiteral",(e,t)=>{if(W.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"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var to=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new me;return r.value=o,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Ln,"handleOptionalResult");var ro=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(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(s=>Ln(s,r.value)):Ln(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=T("$ZodNullable",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),X(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 oo=T("$ZodPipe",(e,t)=>{W.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Rt(s,t.out,n)):Rt(o,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Rt,"handlePipeResult");var io=T("$ZodCustom",(e,t)=>{Le.init(e,t),W.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(s=>Fn(s,r,n,e));Fn(o,r,n,e)}});function Fn(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(fr(o))}}i(Fn,"handleRefineResult");var so,xu=Symbol("ZodOutput"),_u=Symbol("ZodInput"),_r=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 uo(){return new _r}i(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var Pr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...H(t)})}i(co,"_string");function lo(e,t){return new e({type:"string",coerce:!0,...H(t)})}i(lo,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}i(po,"_url");function mo(e,t){return new e({type:"number",checks:[],...H(t)})}i(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}i(fo,"_coercedNumber");function go(e,t){return new e({type:"boolean",...H(t)})}i(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}i(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}i(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}i(vo,"_any");function xo(e){return new e({type:"unknown"})}i(xo,"_unknown");function _o(e,t){return new e({type:"void",...H(t)})}i(_o,"_void");function Po(e,t){return new e({type:"date",coerce:!0,...H(t)})}i(Po,"_coercedDate");function le(e,t){return new Nn({check:"min_length",...H(t),minimum:e})}i(le,"_minLength");function $e(e,t){return new Dn({check:"string_format",format:"regex",...H(t),pattern:e})}i($e,"_regex");function bo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(bo,"_custom");var K=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ot(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>it(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)=>wt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Dt.init(e,t),K.init(e,t)});function a(e){return co(Ut,e)}i(a,"string");var To=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Ut.init(e,t)});var wu=T("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Io(e){return po(wu,e)}i(Io,"url");var br=T("ZodMiniNumber",(e,t)=>{Vn.init(e,t),K.init(e,t)});function te(e){return mo(br,e)}i(te,"number");var Tr=T("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function B(e){return go(Tr,e)}i(B,"boolean");var Eo=T("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var ku=T("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function st(){return vo(ku)}i(st,"any");var Ou=T("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),K.init(e,t)});function w(){return xo(Ou)}i(w,"unknown");var Ru=T("ZodMiniVoid",(e,t)=>{Gn.init(e,t),K.init(e,t)});function $o(e){return _o(Ru,e)}i($o,"_void");var So=T("ZodMiniDate",(e,t)=>{qn.init(e,t),K.init(e,t)});var Nu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(e,t){return new Nu({type:"array",element:e,...H(t)})}i(R,"array");var Du=T("ZodMiniObject",(e,t)=>{Kn.init(e,t),K.init(e,t),X(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...H(t)};return new Du(r)}i(p,"object");var Cu=T("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Cu({type:"union",options:e,...H(t)})}i(N,"union");var Uu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),K.init(e,t)});function Fe(e,t,r){return new Uu({type:"union",options:t,discriminator:e,...H(r)})}i(Fe,"discriminatedUnion");var Mu=T("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function k(e,t,r){return new Mu({type:"record",keyType:e,valueType:t,...H(r)})}i(k,"record");var ju=T("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.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 ju({type:"enum",entries:r,...H(t)})}i(U,"_enum");var Lu=T("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function $(e,t){return new Lu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}i($,"literal");var Fu=T("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function Se(e){return new Fu({type:"transform",transform:e})}i(Se,"transform");var Bu=T("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function v(e){return new Bu({type:"optional",innerType:e})}i(v,"optional");var Vu=T("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function ut(e){return new Vu({type:"nullable",innerType:e})}i(ut,"nullable");var Zu=T("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function Ae(e,t){return new Zu({type:"pipe",in:e,out:t})}i(Ae,"pipe");var Hu=T("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Mt(e,t){return bo(Hu,e??(()=>!0),t)}i(Mt,"custom");var ct={};_n(ct,{bigint:()=>Yu,boolean:()=>Ju,date:()=>Qu,number:()=>Ku,string:()=>Xu});function Xu(e){return lo(Ut,e)}i(Xu,"string");function Ku(e){return fo(br,e)}i(Ku,"number");function Ju(e){return yo(Tr,e)}i(Ju,"boolean");function Yu(e){return ho(Eo,e)}i(Yu,"bigint");function Qu(e){return Po(So,e)}i(Qu,"date");var Er=p({retryOnFailure:p({defaultValue:v(B()),hide:v(B())}),continueOnFailure:p({defaultValue:v(B()),hide:v(B())})}),Ir=class{constructor(t,r,n,o,s,c,l,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{i(this,"IAction")}},ae=i(e=>new Ir(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 F=p({displayName:a(),description:v(a())}),D=i((e,t)=>p({type:$(t),required:B(),defaultValue:v(st())}),"TPropertyValue");var oe=p({...F.shape,...D(a(),"SHORT_TEXT").shape}),ve=p({...F.shape,...D(a(),"LONG_TEXT").shape});var zo=p({label:a(),value:w()}),jt=p({disabled:v(B()),placeholder:v(a()),options:R(zo)});var ie=p({...F.shape,options:jt,...D(w(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:jt,...D(R(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=p({...F.shape,...D(w(),"DROPDOWN").shape,refreshers:R(a())}),lt=p({...F.shape,...D(R(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var _e=p({...F.shape,...D(B(),"CHECKBOX").shape});var Pe=p({...F.shape,...D(te(),"NUMBER").shape});var pt=p({...F.shape,...D(w(),"FILE").shape});var dt=p({...F.shape,...D(a(),"DATE_TIME").shape});var wo=k(a(),N([oe,ve,ie,lt,xe,_e,Pe,pt,dt])),mt=p({...F.shape,properties:wo,...D(R(w()),"ARRAY").shape});var ft=p({...F.shape,...D(N([k(a(),w())]),"JSON").shape});var ko=N([oe,ie,ft,mt,xe]),tc=k(a(),ko),Sr=p({refreshers:R(a()),...F.shape,...D(w(),"DYNAMIC").shape});var Lt=p({...F.shape,...D($o(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(Ve||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),Ar="both_client_credentials_and_authorization_code";var se=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(se||{}),ht=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(ht||{}),rc=p({strategy:U(ht),paramName:v(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Oo=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),Ro=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Ft))}),No=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Oo,handlerId:v(a()),streamStepProgress:v(U(Ft))}),nc=N([Ro,No]);var oc=p({body:w(),rawBody:v(w()),headers:k(a(),a()),queryParams:k(a(),a())});function ee(e){return e==null}i(ee,"isNil");function xt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(xt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Bt,"assertNotNullOrUndefined");var zr=Ue(require("crypto"),1);var ic=128,Oe,Ze,ac=i(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*ic),zr.default.randomFillSync(Oe),Ze=0):Ze+e>Oe.length&&(zr.default.randomFillSync(Oe),Ze=0),Ze+=e},"fillPool"),sc=i(e=>(ac(e|=0),Oe.subarray(Ze-e,Ze)),"random"),uc=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(s=t)=>{let c="";for(;;){let l=r(o),m=o;for(;m--;)if(c+=e[l[m]&n]||"",c.length===s)return c}}},"customRandom"),Co=i((e,t=21)=>uc(e,t,sc),"customAlphabet");var cc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Uo=21,cb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Uo}}$`))),lc=Co(cc,Uo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:ze,updated:ze},Z=i(e=>v(ut(e)),"Nullable");function wr(e){return v(ut(U(e)))}i(wr,"NullableEnum");var db=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Vt=i(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(R(e))),"OptionalArrayFromQuery");var gb=k(a(),w());var _t=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(_t||{});var Sb=a().check($e(/^#[0-9A-Fa-f]{6}$/));var zb=p({filename:a(),data:w(),type:$("file"),mimetype:v(a())});var pc=Ue(jo());var Cb=p({...ue,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:v(te())});var Lo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Lo||{}),kr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(kr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var dc=p({mode:U(Lo),value:w()}),mc=p({auth:v(a()),fields:k(a(),dc)}),fc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(mc)}),gc=p({type:$("PIECE"),toolName:a().check(le(1)),pieceMetadata:fc}),yc=p({type:$("none")}),hc=p({type:$("access_token"),accessToken:a()}),vc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),xc=p({type:$("headers"),headers:k(a(),a())}),_c=Fe("type",[yc,hc,vc,xc]),Fo=p({type:$("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:v(a())}),Bo=p({type:$("MCP"),toolName:a().check(le(1)),serverUrl:Io(),protocol:U(Or),auth:_c}),Vo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:U(kr),sourceId:a(),sourceName:a()}),Pc=Fe("type",[gc,Fo,Bo,Vo]),bc=p({displayName:a(),description:v(a()),type:U(Rr)}),Zo=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:Z(k(a(),w())),output:v(w()),toolName:a(),status:U(Nr),toolCallId:a(),startTime:a(),endTime:v(a())},cT=p(He),Ho=Fe("toolCallType",[p({...He,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:$("UNKNOWN"),displayName:a()})]),Tc=N([Zo,Ho]);var Dr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Dr||{}),be=p({apiKey:a()}),Ic=be,Ec=p({apiKey:a(),apiKeyHash:a()}),$c=be,Sc=be,Ac=be,zc=be,wc=be,kc=be,Oc=be,Wo=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Rc=p({}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Go=p({modelId:a(),modelName:a(),modelType:U(Dr)}),qo=p({apiKeyHeader:a(),baseUrl:a(),models:R(Go),defaultHeaders:v(k(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:R(Go),vertexProject:v(a()),vertexRegion:v(a())}),Ko=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Jo=p({region:a().check(le(1))}),jc=N([Ic,Ac,zc,wc,kc,Sc,$c,Ec,Wo,Oc]),Yo=N([qo,Xo,Ko,Jo,Rc,Dc,Cc,Uc,Nc,Mc]),Lc=p({id:a(),name:a(),type:U(Dr)}),Fc=p({id:a(),name:a(),provider:U(_t),config:Yo,enabledForChat:B()}),Bc=p({provider:U(_t),config:Yo,auth:jc,platformId:a()});var mT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Vc=p({base64Url:a(),fileName:a(),extension:v(a())}),Zc=p({mimeType:a(),url:a(),fileName:v(a())}),Cr=N([Vc,Zc]);var Hc=N([p({type:$("file"),value:Cr}),p({type:$("markdown"),value:a(),files:v(R(Cr))})]),Wc=p({sessionId:a(),message:a(),files:v(R(a()))});var ei=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ei||{}),ti=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ti||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var Gc=N([p({...ue,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),qc=p({...ue,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:wr(ti),trigger:wr(ei)}),Xc=p({...ue,tableId:a(),projectId:a(),cells:k(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),Kc=p({events:R(U(Ur)),webhookUrl:a(),flowId:a()}),Jc=p({fields:R(p({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),Yc=p({projectId:a(),limit:v(ct.number()),cursor:v(a()),name:v(a()),externalIds:Vt(a()),folderId:v(a()),folderIds:Vt(a())}),Qc=p({records:R(R(p({fieldId:a(),value:ni()}))),tableId:a()}),el=p({cells:v(R(p({fieldId:a(),value:ni()}))),tableId:a(),agentUpdate:v(B())}),ri=Fe("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),Qo("exists"),Qo("not_exists")]),tl=p({tableId:a(),limit:v(ct.number()),cursor:v(a()),filters:Vt(ri)});function ni(){return Ae(Se(e=>e==null?e:String(e)),ut(a()))}i(ni,"coerceToString");function Re(e){return p({fieldId:a(),operator:$(e),value:a()})}i(Re,"valueFilter");function Qo(e){return p({fieldId:a(),operator:$(e)})}i(Qo,"existenceFilter");var rl=p({status:v(te()),body:v(w()),headers:v(k(a(),a()))}),nl=p({...ue,deleted:Z(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var oi=p({name:a(),description:v(a()),type:a(),required:B()}),ol=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(oi),returnsResponse:B()})});var ii="^[0-9]+\\.[0-9]+\\.[0-9]+$",OT=new RegExp(ii),al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RT=a().check($e(new RegExp(ii))),NT=a().check($e(new RegExp(al))),sl=p({packageType:$("ARCHIVE"),pieceType:U(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ai=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),si=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),DT=N([ai,si]),CT=N([sl,ai,si]),ui=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ui||{}),ul=p({type:U(ui),cronExpression:a(),timezone:a()}),UT=p({...ue,type:U(se),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(ul),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),ci=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(ci||{}),li=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(li||{}),pi=(r=>(r.S3="S3",r.DB="DB",r))(pi||{}),MT=p({...ue,projectId:Z(a()),platformId:Z(a()),type:U(ci),compression:U(li),data:v(w()),location:U(pi),size:Z(te()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),di=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(di||{}),mi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(mi||{}),jT=p({id:a(),email:a(),firstName:a(),status:U(mi),externalId:Z(a()),platformId:Z(a()),platformRole:U(di),lastName:a(),created:ze,updated:ze,lastActiveDate:Z(ze),imageUrl:Z(a())});var Mr=p({...F.shape,...D(k(a(),w()),"OBJECT").shape});var hi=p({...F.shape,...D(a(),"COLOR").shape});var jr=N([oe,ve,Lt,_e,ie,xe,$r,lt,Sr,Pe,mt,Mr,ft,dt,pt,hi]),C={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 fe=p({displayName:a(),description:v(a())});var vi=p({username:a(),password:a()}),Lr=p({...fe.shape,username:p({displayName:a(),description:v(a())}),password:p({displayName:a(),description:v(a())}),...D(vi,"BASIC_AUTH").shape});var dl=k(a(),N([oe,ve,Pe,_e,ie])),Fr=p({...fe.shape,props:dl,...D(w(),"CUSTOM_AUTH").shape});var Ne=p({...fe.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var ml=k(a(),N([oe,ve,Ne,Pe,_e,ie,xe,Lt])),xi=p({...fe.shape,props:ml,...D(w(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),_i=N([oe,Ne,ie]),Pi=k(a(),_i),fl=p({props:v(k(a(),_i)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:v(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:v(B()),pkceMethod:v(N([$("plain"),$("S256")])),authorizationMethod:v(U(Br)),grantType:v(N([U(yt),$(Ar)])),extra:v(k(a(),a()))}),bi=p({access_token:a(),props:v(Pi),data:k(a(),st())}),Vr=p({...fe.shape,...fl.shape,...D(bi,"OAUTH2").shape});var We=N([Lr,Fr,xi,Vr,Ne]),Pt="Connection",Zr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Pt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Pt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Pt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Pt}},None(){}};var hE={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 gl=p({...F.shape,...D(w(),"CUSTOM").shape,code:a()});var yl=N([jr,We]),Hr=k(a(),yl),UE=k(a(),jr);var Ti=N([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),Ge=class{constructor(t,r,n,o,s,c,l,m,g,h,b,x,u,d,y,f,_,P,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=x;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=j}static{i(this,"ITrigger")}},ge=i(e=>{switch(e.type){case"WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,ee(e.sampleData)&&ee(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ii="2",Ht="0.82.0";var Wr=class{constructor(t,r,n,o,s,c,l,m,g=Ht,h,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Ii}),"getContextInfo");(!hl(g)||vl(g,Ht))&&(this.minimumSupportedRelease=Ht),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ei=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function hl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(hl,"isValidSimpleSemver");function vl(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(vl,"isSemverLessThan");var xl=v(k(a(),k(a(),a()))),$i=p({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:v(a()),directoryPath:v(a()),auth:v(N([We,R(We)])),version:a(),categories:v(R(U(Ve))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:xl}),_l=U(["human","ai","both"]),Si=p({description:v(a()),idempotent:v(B())}),Ai=p({name:a(),displayName:a(),description:a(),props:Hr,requireAuth:B(),errorHandlingOptions:v(Er),outputSchema:v(Mt()),audience:v(_l),aiMetadata:v(Si)}),zi=p({name:a(),displayName:a(),description:a(),props:Hr,errorHandlingOptions:v(Er),type:U(se),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Ti),testStrategy:U(vt),outputSchema:v(Mt()),aiMetadata:v(Si)}),Pl=p({...$i.shape,actions:k(a(),Ai),triggers:k(a(),zi)}),bl=p({...$i.shape,actions:te(),triggers:te(),suggestedActions:v(R(zi)),suggestedTriggers:v(R(Ai))}),wi=p({projectUsage:te(),tags:v(R(a())),pieceType:U(Be),packageType:U(gt),platformId:v(a()),archiveId:v(a())}),U$=p({...Pl.shape,...wi.shape}),M$=p({...bl.shape,...wi.shape}),j$=p({name:a(),version:a()});var Tl=Ue(require("path")),Il=Ue(require("fs/promises"));var Wt=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((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Gr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Gr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=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 qt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Xt=class extends Wt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,ne]of Object.entries(c))o.append(j,ne);let l=o.toString(),m=l?`${n}?${l}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:u,isStream:d}=El(t.body,s),y=Sl({...s,...u}),f=await $l(async()=>{let j=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:x,redirect:h?"follow":"manual",signal:j.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(m,ce)}finally{ne!==void 0&&clearTimeout(ne)}},b),_=h?300:400;if(f.status<200||f.status>=_){let j=await ki(f,g),ne=new qt(t.body,{status:f.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await ki(f,g);return{status:f.status,headers:Al(f.headers),body:P}}};function El(e,t){return wl(e)?{body:void 0,extraHeaders:{},isStream:!1}:zl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(El,"serializeBody");async function ki(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(ki,"parseResponseBody");async function $l(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Oi(n);continue}return o}catch(o){if(r=o,n<t){await Oi(n);continue}throw o}throw r}i($l,"sendWithRetries");function Oi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Oi,"backoff");function Sl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Sl,"normalizeHeaders");function Al(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Al,"toHttpHeaders");function zl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(zl,"isNodeFormData");function wl(e){return e==null}i(wl,"isNil");var Y=new Xt;var pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(pe||{});var hd=Ue(require("fs")),Ms=Ue(Us());var vd={"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 xd(e){let t=e.split(";")[0].trim().toLowerCase();return vd[t]??""}i(xd,"contentTypeToExtension");var _d=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Pd=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 js({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:l,authLocation:m="headers"}){return ae({audience:"human",name:s||"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:C.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${Pd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(pe).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=C.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async g=>{let{method:h,url:b,headers:x,queryParams:u,body:d,body_type:y,failsafe:f,timeout:_,response_is_binary:P,followRedirects:j}=g.propsValue;Bt(h,"Method"),Bt(b,"URL");let ne=ee(r)?{}:await r(g.auth,g.propsValue),ce=b.url,et=ce.startsWith("http://")||ce.startsWith("https://")?ce:_d({baseUrl:t(g.auth),relativePath:ce}),ke={method:h,url:et,headers:{...x??{},...m==="headers"||!ee(m)?ne:{}},queryParams:{...m==="queryParams"?ne:{},...u??{}},timeout:_?_*1e3:0,followRedirects:j};if(P&&(ke.responseType="arraybuffer"),d)if(y&&y!=="none"){let ye=d.data;if(y==="form_data"){let Ks=ye,Et=new Ms.default;for(let{fieldName:hn,fieldType:vn,textFieldValue:xn,fileFieldValue:cr}of Ks)vn==="text"&&!xt(xn)?Et.append(hn,xn):vn==="file"&&!xt(cr)&&Et.append(hn,cr.data,{filename:cr?.filename});ke.body=Et,ke.headers={...ke.headers,...Et.getHeaders()}}else ke.body=ye}else y||(ke.body=d);try{let ye=await Y.sendRequest(ke);return await bd(g.files,ye.body,ye.status,ye.headers,P)}catch(ye){if(f)return ye.errorMessage();throw ye}},"run")})}i(js,"createCustomApiCallAction");var bd=i(async(e,t,r,n,o)=>{let s;if(o&&Td(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=xd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Td=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var J={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(ee(l))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),l);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>l).map(h=>h.data)}case 1:{let l=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:s,server:c}),g=m.findIndex(x=>x.id===l),h=[];ee(l)||g==-1?h=m??[]:h=m?.slice(0,g)??[],ee(o)||(h=h.slice(-o));let b=h?.[0]?.id;return ee(b)||await t.put("lastItem",b),h.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ee(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Id(c.map(l=>l.data))}};function Id(e){return e.length<=5?e:e.slice(0,5)}i(Id,"getFirstFiveOrAll");var Qe={phone_number:C.Dropdown({auth:V,description:"The phone number to send the message from",displayName:"From",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"connect your account first",options:[]};let t=e;return{disabled:!1,options:(await Te("GET","IncomingPhoneNumbers.json",{account_sid:t.username,auth_token:t.password})).body.incoming_phone_numbers.map(n=>({value:n.phone_number,label:n.friendly_name}))}},"options")})},Te=i(async(e,t,r,n)=>await Y.sendRequest({method:e,url:`https://api.twilio.com/2010-04-01/Accounts/${r.account_sid}/${t}`,authentication:{type:"BASIC",username:r.account_sid,password:r.auth_token},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n}),"callTwilioApi");var Ls=ae({auth:V,name:"send_sms",description:"Send a new SMS message",audience:"both",aiMetadata:{description:"Sends an SMS text message from a Twilio phone number to a recipient. Use to notify or message a person by text. Requires the destination number, message body, and a Twilio-owned sender number; sending costs money and delivers a separate message on every call, so it is not idempotent.",idempotent:!1},displayName:"Send SMS",props:{from:Qe.phone_number,body:C.ShortText({description:"The body of the message to send",displayName:"Message Body",required:!0}),to:C.ShortText({description:"The phone number to send the message to",displayName:"To",required:!0})},async run(e){let{body:t,to:r,from:n}=e.propsValue,o=e.auth.username,s=e.auth.password;return await Te("POST","Messages.json",{account_sid:o,auth_token:s},{From:n,Body:t,To:r})}});var Fs=ge({auth:V,name:"new_incoming_sms",displayName:"New Incoming SMS",description:"Triggers when a new SMS message is received",aiMetadata:{description:"Fires when an inbound SMS message is received on the specified Twilio phone number. Each event represents one incoming text message with its sender, body, and metadata."},props:{phone_number:Qe.phone_number},sampleData:{body:"Hello",num_segments:"1",direction:"inbound",from:"+12184191735",date_updated:"Wed, 08 Feb 2023 01:40:51 +0000",price:null,error_message:null,uri:"/2010-04-01/Accounts/ACc0ea1238d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63.json",account_sid:"ACc0ea716d61fe90d78a123a3de71d45619",num_media:"0",to:"+12184191735",date_created:"Wed, 08 Feb 2023 01:40:50 +0000",status:"failed",sid:"SM8c3920d3f2ac481ba83e639a69dadd63",date_sent:"Wed, 08 Feb 2023 01:40:51 +0000",messaging_service_sid:"MG88e323e6a88ce67ba3bf12e1bcb7e0b8",error_code:21211,price_unit:"USD",api_version:"2010-04-01",subresource_uris:{media:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Media.json",feedback:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Feedback.json"}},type:"POLLING",async onEnable(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=await Te("GET",`Messages.json?PageSize=20&To=${t}`,{account_sid:r,auth_token:n},{});await e.store.put("_new_incoming_sms_trigger",{lastMessageId:o.body.messages.length===0?null:o.body.messages[0].sid})},async onDisable(e){await e.store.put("_new_incoming_sms_trigger",null)},async run(e){let t=e.auth.username,r=e.auth.password,n=[],o=await e.store.get("_new_incoming_sms_trigger"),s=`2010-04-01/Accounts/${t}/Messages.json?PageSize=20&To=${e.propsValue.phone_number}`,c;for(;s!=null;){let l=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/${s}`,authentication:{type:"BASIC",username:t,password:r}}),m=l.body.messages;!c&&m.length>0&&(c=m[0].sid),s=l.body.next_page_uri;for(let g=0;g<m.length;g++){let h=m[g];if(h.sid===o?.lastMessageId){s=null;break}h.direction==="inbound"&&n.push(h)}}return await e.store.put("_new_incoming_sms_trigger",{lastMessageId:c??o.lastMessageId}),n}});var Bs=ae({auth:V,name:"phone_number_lookup",description:"Lookup information about a phone number.",audience:"both",aiMetadata:{description:"Looks up carrier and line-type intelligence for a single phone number via the Twilio Lookup API. Use to validate or enrich a number (e.g. detect mobile vs landline, carrier) before messaging or calling it. Read-only and idempotent.",idempotent:!0},displayName:"Phone Number Lookup",props:{phone_number:C.ShortText({displayName:"Phone Number",required:!0})},async run(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password;return(await Y.sendRequest({method:"GET",url:`https://lookups.twilio.com/v2/PhoneNumbers/${encodeURIComponent(t)}`,authentication:{type:"BASIC",username:r,password:n},queryParams:{Fields:"line_type_intelligence"}})).body}});var Vs=ae({auth:V,name:"make_call",description:"Call a number and say a message.",audience:"both",aiMetadata:{description:"Places an outbound voice call from a Twilio number that reads a text-to-speech message to the recipient. Use to deliver a spoken notification or alert by phone. Requires both numbers in E.164 format and the message text; each call places a real, billable phone call, so it is not idempotent.",idempotent:!1},displayName:"Call Phone",props:{from:Qe.phone_number,to:C.ShortText({displayName:"To",description:"The phone number to call. Must be in E.164 format (e.g., +15558675310).",required:!0}),message:C.LongText({displayName:"Message to Say",description:"The text message to be converted to speech and spoken to the recipient.",required:!0}),voice:C.StaticDropdown({displayName:"Voice",description:"The voice to use for the text-to-speech message.",required:!1,options:{options:[{label:"Alice (Default)",value:"alice"},{label:"Man",value:"man"},{label:"Woman",value:"woman"}]}}),language:C.StaticDropdown({displayName:"Language",description:"The language to use for the text-to-speech message.",required:!1,options:{options:[{label:"English (US)",value:"en-US"},{label:"English (UK)",value:"en-GB"},{label:"Spanish",value:"es-ES"},{label:"French",value:"fr-FR"},{label:"German",value:"de-DE"}]}}),sendDigits:C.ShortText({displayName:"Send DTMF Tones",description:"A string of keys to dial after the call is connected. Use 'w' for a half-second pause.",required:!1}),timeout:C.Number({displayName:"Timeout (seconds)",description:"The number of seconds to let the phone ring before assuming no answer. Default is 60.",required:!1})},async run(e){let{from:t,to:r,message:n,voice:o,language:s,sendDigits:c,timeout:l}=e.propsValue,m=e.auth.username,g=e.auth.password,h=o?` voice="${o}"`:"",b=s?` language="${s}"`:"",x=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),u=`<Response><Say${h}${b}>${x}</Say></Response>`,d={From:t,To:r,Twiml:u};return c&&(d.SendDigits=c),l&&(d.Timeout=l),(await Te("POST","Calls.json",{account_sid:m,auth_token:g},d)).body}});var Zs=ae({auth:V,name:"get_message",description:"Retrieves the details of a specific message.",audience:"both",aiMetadata:{description:'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.',idempotent:!0},displayName:"Get Message",props:{message_sid:C.ShortText({displayName:"Message SID",description:'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',required:!0})},async run(e){let{message_sid:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=`Messages/${t}.json`;return(await Te("GET",o,{account_sid:r,auth_token:n})).body}});var Hs=ae({auth:V,name:"download_recording_media",displayName:"Download Recording Media",description:"Download the media file for a specific recording.",audience:"both",aiMetadata:{description:'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.',idempotent:!0},props:{recording_sid:C.ShortText({displayName:"Recording SID",description:'The unique identifier (SID) of the recording to download. It starts with "RE".',required:!0}),format:C.StaticDropdown({displayName:"Format",description:"The desired audio format for the download file.",required:!1,defaultValue:"mp3",options:{options:[{label:"MP3",value:"mp3"},{label:"WAV",value:"wav"}]}}),channels:C.StaticDropdown({displayName:"Channels",description:"Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.",required:!1,options:{options:[{label:"Mono",value:1},{label:"Dual",value:2}]}})},async run(e){let{recording_sid:t,format:r,channels:n}=e.propsValue,o=e.auth.username,s=e.auth.password,c=r??"mp3",l=`Recordings/${t}.${c}`,m={};n&&(m.RequestedChannels=n.toString());let g=await Y.sendRequest({method:"GET",url:`https://api.twilio.com/2010-04-01/Accounts/${o}/${l}`,queryParams:m,authentication:{type:"BASIC",username:o,password:s},responseType:"arraybuffer"}),h=Buffer.from(g.body);return await e.files.write({fileName:`${t}.${c}`,data:h})}});var ir={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/IncomingPhoneNumbers.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.incoming_phone_numbers??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Ws=ge({auth:V,name:"new_phone_number",displayName:"New Phone Number",description:"Triggers when you add a new phone number to your account.",aiMetadata:{description:"Fires when a new phone number is provisioned on the Twilio account. Each event represents one newly added incoming phone number with its capabilities and configuration."},props:{},sampleData:{sid:"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",account_sid:"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",friendly_name:"(555) 123-4567",phone_number:"+15551234567",voice_url:"https://demo.twilio.com/welcome/voice/",voice_method:"POST",sms_url:"https://demo.twilio.com/welcome/sms/",sms_method:"POST",date_created:"2025-08-28T11:44:10+00:00",date_updated:"2025-08-28T11:44:10+00:00",capabilities:{voice:!0,sms:!0,mms:!0},uri:"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"},type:"POLLING",async onEnable(e){await J.onEnable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ir,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ir,e)},async run(e){return await J.poll(ir,e)}});var ar={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Recordings.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.recordings??[];for(let b of h){let x=new Date(b.date_created).getTime();if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Gs=ge({auth:V,name:"new_recording",displayName:"New Recording",description:"Triggers when a new call recording is completed and available.",aiMetadata:{description:"Fires when a new call recording becomes available on the Twilio account. Each event represents one completed recording, including its call SID, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2010-04-01",call_sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",conference_sid:"CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",channels:1,date_created:"Fri, 14 Oct 2016 21:56:34 +0000",date_updated:"Fri, 14 Oct 2016 21:56:38 +0000",start_time:"Fri, 14 Oct 2016 21:56:34 +0000",price:"0.04",price_unit:"USD",duration:"4",sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",source:"StartConferenceRecordingAPI",status:"completed",error_code:null,uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",subresource_uris:{add_on_results:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"},encryption_details:{encryption_public_key_sid:"CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",encryption_cek:"OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",encryption_iv:"8I2hhNIYNTrwxfHk"},media_url:"http://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},type:"POLLING",async onEnable(e){await J.onEnable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ar,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ar,e)},async run(e){return await J.poll(ar,e)}});var sr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Transcriptions.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.transcriptions??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},qs=ge({auth:V,name:"new_transcription",displayName:"New Transcription",description:"Triggers when a new call recording transcription is completed.",aiMetadata:{description:"Fires when a call recording transcription reaches completed status on the Twilio account. Each event represents one finished transcription tied to a recording, including its transcribed text."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2008-08-01",date_created:"Thu, 25 Aug 2011 20:59:45 +0000",date_updated:"Thu, 25 Aug 2011 20:59:45 +0000",duration:"10",price:"0.00000",price_unit:"USD",recording_sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",sid:"TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",status:"completed",transcription_text:null,type:"fast",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"},type:"POLLING",async onEnable(e){await J.onEnable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(sr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(sr,e)},async run(e){return await J.poll(sr,e)}});var ur={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Calls.json?PageSize=${r?1:1e3}`,c=[],l=!1;do{let g=(await Y.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.calls??[];for(let b of h){let x=new Date(b.date_created).getTime();if(b.status==="completed")if(r||x>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},Xs=ge({auth:V,name:"new_call",displayName:"New Call",description:"Triggers when a call completes (incoming or outgoing).",aiMetadata:{description:"Fires when a voice call reaches completed status on the Twilio account, for both inbound and outbound calls. Each event represents one finished call with its direction, participants, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",answered_by:"machine_start",api_version:"2010-04-01",caller_name:"callerid1",date_created:"Fri, 18 Oct 2019 17:00:00 +0000",date_updated:"Fri, 18 Oct 2019 17:01:00 +0000",direction:"outbound-api",duration:"4",end_time:"Fri, 18 Oct 2019 17:03:00 +0000",forwarded_from:"calledvia1",from:"+13051416799",from_formatted:"(305) 141-6799",group_sid:"GPdeadbeefdeadbeefdeadbeefdeadbeef",parent_call_sid:"CAdeadbeefdeadbeefdeadbeefdeadbeef",phone_number_sid:"PNdeadbeefdeadbeefdeadbeefdeadbeef",price:"-0.200",price_unit:"USD",sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",start_time:"Fri, 18 Oct 2019 17:02:00 +0000",status:"completed",subresource_uris:{notifications:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",recordings:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",payments:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",events:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",siprec:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",streams:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",user_defined_message_subscriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",user_defined_messages:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"},to:"+13051913581",to_formatted:"(305) 191-3581",trunk_sid:"TKdeadbeefdeadbeefdeadbeefdeadbeef",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",queue_time:"1000"},type:"POLLING",async onEnable(e){await J.onEnable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ur,e)},async run(e){return await J.poll(ur,e)}});var V=Zr.BasicAuth({description:"The authentication to use to connect to Twilio",required:!0,username:{displayName:"Account SID",description:"The account SID to use to connect to Twilio"},password:{displayName:"Auth token",description:"The auth token to use to connect to Twilio"}}),Ed=Ei({displayName:"Twilio",description:"Cloud communications platform for building SMS, Voice & Messaging applications",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/twilio.png",auth:V,categories:["COMMUNICATION"],actions:[Ls,Bs,Vs,Zs,Hs,js({baseUrl:i(()=>"https://api.twilio.com/2010-04-01","baseUrl"),auth:V,authMapping:i(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],authors:["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[Fs,Ws,Gs,qs,Xs]});0&&(module.exports={twilio,twilioAuth});
|
|
1
|
+
"use strict";var pu=Object.create;var rt=Object.defineProperty;var du=Object.getOwnPropertyDescriptor;var mu=Object.getOwnPropertyNames;var fu=Object.getPrototypeOf,gu=Object.prototype.hasOwnProperty;var i=(e,t)=>rt(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}},Tn=(e,t)=>{for(var r in t)rt(e,r,{get:t[r],enumerable:!0})},In=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of mu(t))!gu.call(e,o)&&o!==r&&rt(e,o,{get:()=>t[o],enumerable:!(n=du(t,o))||n.enumerable});return e};var je=(e,t,r)=>(r=e!=null?pu(fu(e)):{},In(t||!e||!e.__esModule?rt(r,"default",{value:e,enumerable:!0}):r,e)),yu=e=>In(rt({},"__esModule",{value:!0}),e);var qo=E((Wo,qt)=>{(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"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,x=(u.match(l.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let ne=u.split(":"),ce=[];for(let tt=0;tt<ne.length;tt++)ce.push(parseInt(ne[tt],16));return ce})(),{parts:d,zoneId:x}}i(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[x]>>P!==d[x]>>P)return!1;f-=y,x+=1}return!0}i(g,"matchCIDR");function h(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}i(b,"padPart");let _={};_.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),_.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(u){return this.parser(u)!==null},_.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(u){return!!(_.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(u)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(u){let d,y,f,x,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)y=x[L],P.push(h(y));return P})();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(f>>P&255);return x})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(f=h(x[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=u.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(f=h(x[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(h(x[1])),P.push(f>>8&255),P.push(f&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.IPv6=(function(){function u(d,y){let f,x;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(x=this.parts[f],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={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,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in f){if(P=f[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let x=0;x<f.length;x++)d=f[x],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(b(this.parts[x].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new _.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(this.parts[x].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(f=P.index,x=P[0].length);return x<0?y:`${y.substring(0,f)}::${y.substring(f+x)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),_.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(u){return this.parser(u)!==null},_.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(u){let d,y,f,x,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(u){let d=this.parser(u);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(u){let d,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:i(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(u){let d,y,f,x,P,L;if(f=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(l.native.test(u))return m(u,8);if((f=u.match(l.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},_.fromByteArray=function(u){let d=u.length;if(d===4)return new _.IPv4(u);if(d===16)return new _.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(u){return _.IPv6.isValid(u)||_.IPv4.isValid(u)},_.isValidCIDR=function(u){return _.IPv6.isValidCIDR(u)||_.IPv4.isValidCIDR(u)},_.parse=function(u){if(_.IPv6.isValid(u))return _.IPv6.parse(u);if(_.IPv4.isValid(u))return _.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(u){try{return _.IPv6.parseCIDR(u)}catch{try{return _.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(u,d,y){let f,x,P,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],u.kind()===L[0].kind()&&u.match.apply(u,L))return x}return y},typeof qt<"u"&&qt.exports?qt.exports=_:e.ipaddr=_})(Wo)});var Xi=E(($$,qi)=>{var Wi=require("stream").Stream,Yl=require("util");qi.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(de,"DelayedStream");Yl.inherits(de,Wi);de.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(de.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Wi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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 Qi=E((w$,Yi)=>{var Ql=require("util"),Ji=require("stream").Stream,Ki=Xi();Yi.exports=q;function q(){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(q,"CombinedStream");Ql.inherits(q,Ji);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Ki)){var r=Ki.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};q.prototype.pipe=function(e,t){return Ji.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ta=E((k$,ea)=>{"use strict";ea.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 oa=E(re=>{"use strict";var Qt=ta(),ep=require("path").extname,ra=/^\s*([^;\s]*)(?:;|\s|$)/,tp=/^text\//i;re.charset=na;re.charsets={lookup:na};re.contentType=rp;re.extension=np;re.extensions=Object.create(null);re.lookup=op;re.types=Object.create(null);ip(re.extensions,re.types);function na(e){if(!e||typeof e!="string")return!1;var t=ra.exec(e),r=t&&Qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&tp.test(t[1])?"UTF-8":!1}i(na,"charset");function rp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(rp,"contentType");function np(e){if(!e||typeof e!="string")return!1;var t=ra.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(np,"extension");function op(e){if(!e||typeof e!="string")return!1;var t=ep("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}i(op,"lookup");function ip(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Qt).forEach(i(function(o){var s=Qt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var m=c[l];if(t[m]){var g=r.indexOf(Qt[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=o}}},"forEachMimeType"))}i(ip,"populateMaps")});var aa=E((D$,ia)=>{ia.exports=ap;function ap(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(ap,"defer")});var Yr=E((U$,ua)=>{var sa=aa();ua.exports=sp;function sp(e){var t=!1;return sa(function(){t=!0}),i(function(n,o){t?e(n,o):sa(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(sp,"async")});var Qr=E((L$,ca)=>{ca.exports=up;function up(e){Object.keys(e.jobs).forEach(cp.bind(e)),e.jobs={}}i(up,"abort");function cp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(cp,"clean")});var en=E((F$,pa)=>{var la=Yr(),lp=Qr();pa.exports=pp;function pp(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=dp(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?lp(r):r.results[o]=c,n(s,r.results))})}i(pp,"iterate");function dp(e,t,r,n){var o;return e.length==2?o=e(r,la(n)):o=e(r,t,la(n)),o}i(dp,"runJob")});var tn=E((V$,da)=>{da.exports=mp;function mp(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,s){return t(e[o],e[s])}),n}i(mp,"state")});var rn=E((H$,ma)=>{var fp=Qr(),gp=Yr();ma.exports=yp;function yp(e){Object.keys(this.jobs).length&&(this.index=this.size,fp(this),gp(e)(null,this.results))}i(yp,"terminator")});var ga=E((W$,fa)=>{var hp=en(),vp=tn(),_p=rn();fa.exports=xp;function xp(e,t,r){for(var n=vp(e);n.index<(n.keyedList||e).length;)hp(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return _p.bind(n,r)}i(xp,"parallel")});var nn=E((X$,er)=>{var ya=en(),Pp=tn(),bp=rn();er.exports=Tp;er.exports.ascending=ha;er.exports.descending=Ip;function Tp(e,t,r,n){var o=Pp(e,r);return ya(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ya(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),bp.bind(o,n)}i(Tp,"serialOrdered");function ha(e,t){return e<t?-1:e>t?1:0}i(ha,"ascending");function Ip(e,t){return-1*ha(e,t)}i(Ip,"descending")});var _a=E((J$,va)=>{var Ep=nn();va.exports=Sp;function Sp(e,t,r){return Ep(e,t,null,r)}i(Sp,"serial")});var Pa=E((Q$,xa)=>{xa.exports={parallel:ga(),serial:_a(),serialOrdered:nn()}});var on=E((ez,ba)=>{"use strict";ba.exports=Object});var Ia=E((tz,Ta)=>{"use strict";Ta.exports=Error});var Sa=E((rz,Ea)=>{"use strict";Ea.exports=EvalError});var $a=E((nz,Aa)=>{"use strict";Aa.exports=RangeError});var wa=E((oz,za)=>{"use strict";za.exports=ReferenceError});var ka=E((iz,Oa)=>{"use strict";Oa.exports=SyntaxError});var tr=E((az,Ra)=>{"use strict";Ra.exports=TypeError});var Da=E((sz,Na)=>{"use strict";Na.exports=URIError});var Ua=E((uz,Ca)=>{"use strict";Ca.exports=Math.abs});var La=E((cz,Ma)=>{"use strict";Ma.exports=Math.floor});var Fa=E((lz,ja)=>{"use strict";ja.exports=Math.max});var Va=E((pz,Ba)=>{"use strict";Ba.exports=Math.min});var Ha=E((dz,Za)=>{"use strict";Za.exports=Math.pow});var Wa=E((mz,Ga)=>{"use strict";Ga.exports=Math.round});var Xa=E((fz,qa)=>{"use strict";qa.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ja=E((yz,Ka)=>{"use strict";var Ap=Xa();Ka.exports=i(function(t){return Ap(t)||t===0?t:t<0?-1:1},"sign")});var Qa=E((vz,Ya)=>{"use strict";Ya.exports=Object.getOwnPropertyDescriptor});var an=E((_z,es)=>{"use strict";var rr=Qa();if(rr)try{rr([],"length")}catch{rr=null}es.exports=rr});var rs=E((xz,ts)=>{"use strict";var nr=Object.defineProperty||!1;if(nr)try{nr({},"a",{value:1})}catch{nr=!1}ts.exports=nr});var sn=E((Pz,ns)=>{"use strict";ns.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 s 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 c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[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 as=E((Tz,is)=>{"use strict";var os=typeof Symbol<"u"&&Symbol,$p=sn();is.exports=i(function(){return typeof os!="function"||typeof Symbol!="function"||typeof os("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:$p()},"hasNativeSymbols")});var un=E((Ez,ss)=>{"use strict";ss.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var cn=E((Sz,us)=>{"use strict";var zp=on();us.exports=zp.getPrototypeOf||null});var ps=E((Az,ls)=>{"use strict";var wp="Function.prototype.bind called on incompatible ",Op=Object.prototype.toString,kp=Math.max,Rp="[object Function]",cs=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Np=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),Dp=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");ls.exports=i(function(t){var r=this;if(typeof r!="function"||Op.apply(r)!==Rp)throw new TypeError(wp+r);for(var n=Np(arguments,1),o,s=i(function(){if(this instanceof o){var h=r.apply(this,cs(n,arguments));return Object(h)===h?h:this}return r.apply(t,cs(n,arguments))},"binder"),c=kp(0,r.length-n.length),l=[],m=0;m<c;m++)l[m]="$"+m;if(o=Function("binder","return function ("+Dp(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var Xe=E((zz,ds)=>{"use strict";var Cp=ps();ds.exports=Function.prototype.bind||Cp});var or=E((wz,ms)=>{"use strict";ms.exports=Function.prototype.call});var ln=E((Oz,fs)=>{"use strict";fs.exports=Function.prototype.apply});var ys=E((kz,gs)=>{"use strict";gs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var vs=E((Rz,hs)=>{"use strict";var Up=Xe(),Mp=ln(),Lp=or(),jp=ys();hs.exports=jp||Up.call(Lp,Mp)});var xs=E((Nz,_s)=>{"use strict";var Fp=Xe(),Bp=tr(),Vp=or(),Zp=vs();_s.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Bp("a function is required");return Zp(Fp,Vp,t)},"callBindBasic")});var Ss=E((Cz,Es)=>{"use strict";var Hp=xs(),Ps=an(),Ts;try{Ts=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var pn=!!Ts&&Ps&&Ps(Object.prototype,"__proto__"),Is=Object,bs=Is.getPrototypeOf;Es.exports=pn&&typeof pn.get=="function"?Hp([pn.get]):typeof bs=="function"?i(function(t){return bs(t==null?t:Is(t))},"getDunder"):!1});var Os=E((Mz,ws)=>{"use strict";var As=un(),$s=cn(),zs=Ss();ws.exports=As?i(function(t){return As(t)},"getProto"):$s?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return $s(t)},"getProto"):zs?i(function(t){return zs(t)},"getProto"):null});var dn=E((jz,ks)=>{"use strict";var Gp=Function.prototype.call,Wp=Object.prototype.hasOwnProperty,qp=Xe();ks.exports=qp.call(Gp,Wp)});var Ls=E((Fz,Ms)=>{"use strict";var M,Xp=on(),Kp=Ia(),Jp=Sa(),Yp=$a(),Qp=wa(),Qe=ka(),Ye=tr(),ed=Da(),td=Ua(),rd=La(),nd=Fa(),od=Va(),id=Ha(),ad=Wa(),sd=Ja(),Cs=Function,mn=i(function(e){try{return Cs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),It=an(),ud=rs(),fn=i(function(){throw new Ye},"throwTypeError"),cd=It?(function(){try{return arguments.callee,fn}catch{try{return It(arguments,"callee").get}catch{return fn}}})():fn,Ke=as()(),ee=Os(),ld=cn(),pd=un(),Us=ln(),Et=or(),Je={},dd=typeof Uint8Array>"u"||!ee?M:ee(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&ee?ee([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Kp,"%eval%":eval,"%EvalError%":Jp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":Cs,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&ee?ee(ee([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!ee?M:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xp,"%Object.getOwnPropertyDescriptor%":It,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Yp,"%ReferenceError%":Qp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!ee?M:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&ee?ee(""[Symbol.iterator]()):M,"%Symbol%":Ke?Symbol:M,"%SyntaxError%":Qe,"%ThrowTypeError%":cd,"%TypedArray%":dd,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":ed,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":Us,"%Object.defineProperty%":ud,"%Object.getPrototypeOf%":ld,"%Math.abs%":td,"%Math.floor%":rd,"%Math.max%":nd,"%Math.min%":od,"%Math.pow%":id,"%Math.round%":ad,"%Math.sign%":sd,"%Reflect.getPrototypeOf%":pd};if(ee)try{null.error}catch(e){Rs=ee(ee(e)),Me["%Error.prototype%"]=Rs}var Rs,md=i(function e(t){var r;if(t==="%AsyncFunction%")r=mn("async function () {}");else if(t==="%GeneratorFunction%")r=mn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=mn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&ee&&(r=ee(o.prototype))}return Me[t]=r,r},"doEval"),Ns={__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"]},St=Xe(),ir=dn(),fd=St.call(Et,Array.prototype.concat),gd=St.call(Us,Array.prototype.splice),Ds=St.call(Et,String.prototype.replace),ar=St.call(Et,String.prototype.slice),yd=St.call(Et,RegExp.prototype.exec),hd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,vd=/\\(\\)?/g,_d=i(function(t){var r=ar(t,0,1),n=ar(t,-1);if(r==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var o=[];return Ds(t,hd,function(s,c,l,m){o[o.length]=l?Ds(m,vd,"$1"):c||s}),o},"stringToPath"),xd=i(function(t,r){var n=t,o;if(ir(Ns,n)&&(o=Ns[n],n="%"+o[0]+"%"),ir(Me,n)){var s=Me[n];if(s===Je&&(s=md(n)),typeof s>"u"&&!r)throw new Ye("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ms.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(yd(/^%?[^%]*%?$/,t)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_d(t),o=n.length>0?n[0]:"",s=xd("%"+o+"%",r),c=s.name,l=s.value,m=!1,g=s.alias;g&&(o=g[0],gd(n,fd([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var _=n[h],u=ar(_,0,1),d=ar(_,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Qe("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(m=!0),o+="."+_,c="%"+o+"%",ir(Me,c))l=Me[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Ye("base intrinsic for "+t+" exists, but the property is not available.");return}if(It&&h+1>=n.length){var y=It(l,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[_]}else b=ir(l,_),l=l[_];b&&!m&&(Me[c]=l)}}return l},"GetIntrinsic")});var Fs=E((Vz,js)=>{"use strict";var Pd=sn();js.exports=i(function(){return Pd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Zs=E((Hz,Vs)=>{"use strict";var bd=Ls(),Bs=bd("%Object.defineProperty%",!0),Td=Fs()(),Id=dn(),Ed=tr(),sr=Td?Symbol.toStringTag:null;Vs.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 Ed("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");sr&&(n||!Id(t,sr))&&(Bs?Bs(t,sr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[sr]=r)},"setToStringTag")});var Gs=E((Wz,Hs)=>{"use strict";var Sd=Function.prototype.call,Ad=Object.prototype.hasOwnProperty,$d=Xe();Hs.exports=$d.call(Sd,Ad)});var qs=E((qz,Ws)=>{"use strict";Ws.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Js=E((Xz,Ks)=>{"use strict";var vn=Qi(),zd=require("util"),gn=require("path"),wd=require("http"),Od=require("https"),kd=require("url").parse,Rd=require("fs"),Nd=require("stream").Stream,Dd=require("crypto"),yn=oa(),Cd=Pa(),Ud=Zs(),Ne=Gs(),hn=qs();function Xs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Xs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],vn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");zd.inherits(j,vn);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=vn.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),s=this._multiPartFooter();n(o),n(t),n(s),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&&Ne(t,"httpVersion"))&&!(t instanceof Nd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Ne(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Rd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Ne(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ne(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),s="",c={"Content-Disposition":["form-data",'name="'+Xs(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&hn(c,r.header);var l;for(var m in c)if(Ne(c,m)){if(l=c[m],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=m+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+s+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=gn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=gn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ne(e,"httpVersion")&&(r=gn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Xs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=yn.lookup(e.name)),!r&&e&&e.path&&(r=yn.lookup(e.path)),!r&&e&&e.readable&&Ne(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=yn.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)Ne(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="--------------------------"+Dd.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}Cd.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=kd(e),n=hn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=hn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Od.request(n):r=wd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,m=i(function(g,h){return r.removeListener("error",m),r.removeListener("response",l),t.call(this,g,h)},"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]"};Ud(j.prototype,"FormData");Ks.exports=j});var Wd={};Tn(Wd,{twilio:()=>Gd,twilioAuth:()=>V});module.exports=yu(Wd);var hu=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,m){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let _=h[b];_ in l||(l[_]=g[_].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var m;let g=r?.Parent?new s:this;n(g,l),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(T,"$constructor");var me=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},mr={};function ve(e){return e&&Object.assign(mr,e),mr}i(ve,"config");function gr(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(gr,"getEnumValues");function Sn(e,t){return typeof t=="bigint"?t.toString():t}i(Sn,"jsonStringifyReplacer");function wt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(wt,"cached");function An(e){return e==null}i(An,"nullish");function Ot(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Ot,"cleanRegex");var En=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==En)return n===void 0&&(n=En,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(X,"defineLazy");var yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(nt,"isObject");var vu=wt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function $n(e){if(nt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(nt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i($n,"isPlainObject");var zn=new Set(["string","number","symbol"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Fe,"escapeRegex");function kt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(kt,"clone");function Z(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(Z,"normalizeParams");function wn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(wn,"optionalKeys");var On={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 Be(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(Be,"aborted");function Se(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(Se,"prefixIssues");function zt(e){return typeof e=="string"?e:e?.message}i(zt,"unwrapMessage");function Ae(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=zt(e.inst?._zod.def?.error?.(e))??zt(t?.error?.(e))??zt(r.customError?.(e))??zt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ae,"finalizeIssue");function kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(kn,"getLengthableOrigin");function hr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(hr,"issue");var Rn=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,Sn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Nn=T("$ZodError",Rn),ot=T("$ZodError",Rn,{Parent:Error});var xu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ae(m,s,ve())));throw yr(l,o?.callee),l}return c.value},"_parse"),Rt=xu(ot),Pu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(m=>Ae(m,s,ve())));throw yr(l,o?.callee),l}return c.value},"_parseAsync"),Nt=Pu(ot),bu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new me;return s.issues.length?{success:!1,error:new(e??Nn)(s.issues.map(c=>Ae(c,o,ve())))}:{success:!0,data:s.value}},"_safeParse"),it=bu(ot),Tu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ae(c,o,ve())))}:{success:!0,data:s.value}},"_safeParseAsync"),at=Tu(ot);var Iu="(?:(?:\\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])))",Eu=new RegExp(`^${Iu}$`);var Dn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Cn=/^-?\d+n?$/,Un=/^-?\d+$/,vr=/^-?\d+(?:\.\d+)?$/,Mn=/^(?:true|false)$/i;var $e=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Su={number:"number",bigint:"bigint",object:"date"};var Ln=T("$ZodCheckGreaterThan",(e,t)=>{$e.init(e,t);let r=Su[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(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 jn=T("$ZodCheckNumberFormat",(e,t)=>{$e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=On[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=Un)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.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&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Fn=T("$ZodCheckMinLength",(e,t)=>{var r;$e.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!An(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 c=kn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var _r=T("$ZodCheckStringFormat",(e,t)=>{var r,n;$e.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.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=()=>{})}),Bn=T("$ZodCheckRegex",(e,t)=>{_r.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 Zn={major:4,minor:3,patch:6};var G=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(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((c,l,m)=>{let g=Be(c),h;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new me;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==_&&(g||(g=Be(c,_)))});else{if(c.issues.length===_)continue;g||(g=Be(c,_))}}return h?h.then(()=>c):c},"runChecks"),s=i((c,l,m)=>{if(Be(c))return c.aborted=!0,c;let g=o(l,n,m);if(g instanceof Promise){if(m.async===!1)throw new me;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,l)):s(g,c,l)}let m=e._zod.parse(c,l);if(m instanceof Promise){if(l.async===!1)throw new me;return m.then(g=>o(g,n,l))}return o(m,n,l)}}X(e,"~standard",()=>({validate:i(o=>{try{let s=it(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return at(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ut=T("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Dn(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}}),xr=T("$ZodStringFormat",(e,t)=>{_r.init(e,t),Ut.init(e,t)});var Xn=T("$ZodURL",(e,t)=>{xr.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 Pr=T("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??vr,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 s=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,...s?{received:s}:{}}),r}}),Kn=T("$ZodNumberFormat",(e,t)=>{jn.init(e,t),Pr.init(e,t)}),br=T("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Mn,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}}),Jn=T("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=Cn,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 Yn=T("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Qn=T("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var eo=T("$ZodVoid",(e,t)=>{G.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}}),to=T("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Hn(e,t,r){e.issues.length&&t.issues.push(...Se(r,e.issues)),t.value[r]=e.value}i(Hn,"handleArrayResult");var ro=T("$ZodArray",(e,t)=>{G.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 s=[];for(let c=0;c<o.length;c++){let l=o[c],m=t.element._zod.run({value:l,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Hn(g,r,c))):Hn(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ct(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...Se(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Ct,"handlePropertyResult");function Au(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=wn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(Au,"normalizeDef");function $u(e,t,r,n,o,s){let c=[],l=o.keySet,m=o.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let _=m.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(u=>Ct(u,r,b,t,h))):Ct(_,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i($u,"handleCatchall");var no=T("$ZodObject",(e,t)=>{if(G.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=wt(()=>Au(t));X(e._zod,"propValues",()=>{let l=t.shape,m={};for(let g in l){let h=l[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let o=nt,s=t.catchall,c;e._zod.parse=(l,m)=>{c??(c=n.value);let g=l.value;if(!o(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let h=[],b=c.shape;for(let _ of c.keys){let u=b[_],d=u._zod.optout==="optional",y=u._zod.run({value:g[_],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Ct(f,l,_,g,d))):Ct(y,l,_,g,d)}return s?$u(h,g,l,m,n.value,e):h.length?Promise.all(h).then(()=>l):l}});function Gn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Be(s));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(s=>s.issues.map(c=>Ae(c,n,ve())))}),t)}i(Gn,"handleUnionResults");var Tr=T("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ot(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let m of t.options){let g=m._zod.run({value:o.value,issues:[]},s);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(m=>Gn(m,o,e,s)):Gn(l,o,e,s)}});var oo=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Tr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,m]of Object.entries(c)){o[l]||(o[l]=new Set);for(let g of m)o[l].add(g)}}return o});let n=wt(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of l){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!nt(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var io=T("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!$n(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:o[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Se(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Se(g,h.issues)),r.value[g]=h.value)}let m;for(let g in o)l.has(g)||(m=m??[],m.push(g));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"&&vr.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=>Ae(b,n,ve())),input:l,path:[l],inst:e});continue}let h=t.valueType._zod.run({value:o[l],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Se(l,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Se(l,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ao=T("$ZodEnum",(e,t)=>{G.init(e,t);let r=gr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>zn.has(typeof o)).map(o=>typeof o=="string"?Fe(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),so=T("$ZodLiteral",(e,t)=>{if(G.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"?Fe(n):n?Fe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var uo=T("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new me;return r.value=o,r}});function Wn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Wn,"handleOptionalResult");var co=T("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ot(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(s=>Wn(s,r.value)):Wn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var lo=T("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ot(r.source)}|null)$`):void 0}),X(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 po=T("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Dt(c,t.in,n)):Dt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Dt(s,t.out,n)):Dt(o,t.out,n)}});function Dt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(Dt,"handlePipeResult");var mo=T("$ZodCustom",(e,t)=>{$e.init(e,t),G.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(s=>qn(s,r,n,e));qn(o,r,n,e)}});function qn(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(hr(o))}}i(qn,"handleRefineResult");var go;var Ir=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 yo(){return new Ir}i(yo,"registry");(go=globalThis).__zod_globalRegistry??(go.__zod_globalRegistry=yo());var Er=globalThis.__zod_globalRegistry;function ho(e,t){return new e({type:"string",...Z(t)})}i(ho,"_string");function vo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}i(vo,"_coercedString");function _o(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}i(_o,"_url");function xo(e,t){return new e({type:"number",checks:[],...Z(t)})}i(xo,"_number");function Po(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}i(Po,"_coercedNumber");function bo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}i(bo,"_int");function To(e,t){return new e({type:"boolean",...Z(t)})}i(To,"_boolean");function Io(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}i(Io,"_coercedBoolean");function Eo(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}i(Eo,"_coercedBigint");function So(e){return new e({type:"any"})}i(So,"_any");function Ao(e){return new e({type:"unknown"})}i(Ao,"_unknown");function $o(e,t){return new e({type:"void",...Z(t)})}i($o,"_void");function zo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}i(zo,"_coercedDate");function Mt(e,t){return new Ln({check:"greater_than",...Z(t),value:e,inclusive:!0})}i(Mt,"_gte");function le(e,t){return new Fn({check:"min_length",...Z(t),minimum:e})}i(le,"_minLength");function ze(e,t){return new Bn({check:"string_format",format:"regex",...Z(t),pattern:e})}i(ze,"_regex");function wo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(wo,"_custom");var K=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Rt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>it(e,r,n),e.parseAsync=async(r,n)=>Nt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>at(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)=>kt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),jt=T("ZodMiniString",(e,t)=>{Ut.init(e,t),K.init(e,t)});function a(e){return ho(jt,e)}i(a,"string");var Oo=T("ZodMiniStringFormat",(e,t)=>{xr.init(e,t),jt.init(e,t)});var Fu=T("ZodMiniURL",(e,t)=>{Xn.init(e,t),Oo.init(e,t)});function ko(e){return _o(Fu,e)}i(ko,"url");var Ft=T("ZodMiniNumber",(e,t)=>{Pr.init(e,t),K.init(e,t)});function te(e){return xo(Ft,e)}i(te,"number");var Bu=T("ZodMiniNumberFormat",(e,t)=>{Kn.init(e,t),Ft.init(e,t)});function Ro(e){return bo(Bu,e)}i(Ro,"int");var Sr=T("ZodMiniBoolean",(e,t)=>{br.init(e,t),K.init(e,t)});function B(e){return To(Sr,e)}i(B,"boolean");var No=T("ZodMiniBigInt",(e,t)=>{Jn.init(e,t),K.init(e,t)});var Vu=T("ZodMiniAny",(e,t)=>{Yn.init(e,t),K.init(e,t)});function ut(){return So(Vu)}i(ut,"any");var Zu=T("ZodMiniUnknown",(e,t)=>{Qn.init(e,t),K.init(e,t)});function w(){return Ao(Zu)}i(w,"unknown");var Hu=T("ZodMiniVoid",(e,t)=>{eo.init(e,t),K.init(e,t)});function Do(e){return $o(Hu,e)}i(Do,"_void");var Co=T("ZodMiniDate",(e,t)=>{to.init(e,t),K.init(e,t)});var Gu=T("ZodMiniArray",(e,t)=>{ro.init(e,t),K.init(e,t)});function R(e,t){return new Gu({type:"array",element:e,...Z(t)})}i(R,"array");var Wu=T("ZodMiniObject",(e,t)=>{no.init(e,t),K.init(e,t),X(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Wu(r)}i(p,"object");var qu=T("ZodMiniUnion",(e,t)=>{Tr.init(e,t),K.init(e,t)});function N(e,t){return new qu({type:"union",options:e,...Z(t)})}i(N,"union");var Xu=T("ZodMiniDiscriminatedUnion",(e,t)=>{oo.init(e,t),K.init(e,t)});function we(e,t,r){return new Xu({type:"union",options:t,discriminator:e,...Z(r)})}i(we,"discriminatedUnion");var Ku=T("ZodMiniRecord",(e,t)=>{io.init(e,t),K.init(e,t)});function O(e,t,r){return new Ku({type:"record",keyType:e,valueType:t,...Z(r)})}i(O,"record");var Ju=T("ZodMiniEnum",(e,t)=>{ao.init(e,t),K.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 Ju({type:"enum",entries:r,...Z(t)})}i(U,"_enum");var Yu=T("ZodMiniLiteral",(e,t)=>{so.init(e,t),K.init(e,t)});function S(e,t){return new Yu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}i(S,"literal");var Qu=T("ZodMiniTransform",(e,t)=>{uo.init(e,t),K.init(e,t)});function Oe(e){return new Qu({type:"transform",transform:e})}i(Oe,"transform");var ec=T("ZodMiniOptional",(e,t)=>{co.init(e,t),K.init(e,t)});function v(e){return new ec({type:"optional",innerType:e})}i(v,"optional");var tc=T("ZodMiniNullable",(e,t)=>{lo.init(e,t),K.init(e,t)});function ct(e){return new tc({type:"nullable",innerType:e})}i(ct,"nullable");var rc=T("ZodMiniPipe",(e,t)=>{po.init(e,t),K.init(e,t)});function ke(e,t){return new rc({type:"pipe",in:e,out:t})}i(ke,"pipe");var nc=T("ZodMiniCustom",(e,t)=>{mo.init(e,t),K.init(e,t)});function Bt(e,t){return wo(nc,e??(()=>!0),t)}i(Bt,"custom");var lt={};Tn(lt,{bigint:()=>cc,boolean:()=>uc,date:()=>lc,number:()=>sc,string:()=>ac});function ac(e){return vo(jt,e)}i(ac,"string");function sc(e){return Po(Ft,e)}i(sc,"number");function uc(e){return Io(Sr,e)}i(uc,"boolean");function cc(e){return Eo(No,e)}i(cc,"bigint");function lc(e){return zo(Co,e)}i(lc,"date");var $r=p({retryOnFailure:p({defaultValue:v(B()),hide:v(B())}),continueOnFailure:p({defaultValue:v(B()),hide:v(B())})}),Ar=class{constructor(t,r,n,o,s,c,l,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{i(this,"IAction")}},ae=i(e=>new Ar(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 F=p({displayName:a(),description:v(a())}),D=i((e,t)=>p({type:S(t),required:B(),defaultValue:v(ut())}),"TPropertyValue");var oe=p({...F.shape,...D(a(),"SHORT_TEXT").shape}),_e=p({...F.shape,...D(a(),"LONG_TEXT").shape});var Mo=p({label:a(),value:w()}),Vt=p({disabled:v(B()),placeholder:v(a()),options:R(Mo)});var ie=p({...F.shape,options:Vt,...D(w(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:Vt,...D(R(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var zr=p({...F.shape,...D(w(),"DROPDOWN").shape,refreshers:R(a())}),pt=p({...F.shape,...D(R(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var Pe=p({...F.shape,...D(B(),"CHECKBOX").shape});var be=p({...F.shape,...D(te(),"NUMBER").shape});var dt=p({...F.shape,streaming:v(B()),...D(w(),"FILE").shape});var mt=p({...F.shape,...D(a(),"DATE_TIME").shape});var Lo=O(a(),N([oe,_e,ie,pt,xe,Pe,be,dt,mt])),ft=p({...F.shape,properties:Lo,...D(R(w()),"ARRAY").shape});var gt=p({...F.shape,...D(N([O(a(),w())]),"JSON").shape});var jo=N([oe,ie,gt,ft,xe]),dc=O(a(),jo),wr=p({refreshers:R(a()),...F.shape,...D(w(),"DYNAMIC").shape});var Zt=p({...F.shape,...D(Do(),"MARKDOWN").shape});var yt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(yt||{}),Ve=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ve||{}),Ze=(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))(Ze||{});var ht=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ht||{}),Or="both_client_credentials_and_authorization_code";var se=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(se||{}),vt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(vt||{}),mc=p({strategy:U(vt),paramName:v(a())}),_t=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(_t||{});var Ht=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ht||{}),Fo=p({status:v(te()),body:v(w()),headers:v(O(a(),a()))}),Bo=p({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Ht))}),Vo=p({type:S("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Fo,handlerId:v(a()),streamStepProgress:v(U(Ht))}),fc=N([Bo,Vo]);var gc=p({body:w(),rawBody:v(w()),headers:O(a(),a()),queryParams:O(a(),a())});function Y(e){return e==null}i(Y,"isNil");function xt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(xt,"isEmpty");function Gt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Gt,"assertNotNullOrUndefined");var kr=je(require("crypto"),1);var yc=128,De,He,hc=i(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*yc),kr.default.randomFillSync(De),He=0):He+e>De.length&&(kr.default.randomFillSync(De),He=0),He+=e},"fillPool"),vc=i(e=>(hc(e|=0),De.subarray(He-e,He)),"random"),_c=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(s=t)=>{let c="";for(;;){let l=r(o),m=o;for(;m--;)if(c+=e[l[m]&n]||"",c.length===s)return c}}},"customRandom"),Ho=i((e,t=21)=>_c(e,t,vc),"customAlphabet");var xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,$b=a().check(ze(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),Pc=Ho(xc,Go);var Re=ke(Oe(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:Re,updated:Re},H=i(e=>v(ct(e)),"Nullable");function Rr(e){return v(ct(U(e)))}i(Rr,"NullableEnum");var Ob=ke(Oe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Wt=i(e=>ke(Oe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(R(e))),"OptionalArrayFromQuery");var Nb=O(a(),w());var Pt=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(Pt||{});var Gb=a().check(ze(/^#[0-9A-Fa-f]{6}$/));var qb=p({filename:a(),data:w(),type:S("file"),mimetype:v(a())});var bc=je(qo());var tT=p({...ue,name:a(),permissions:R(a()),platformId:H(a()),type:a(),userCount:v(te())});var Xo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Xo||{}),Nr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nr||{}),Dr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Dr||{});var Cr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Cr||{});var Ur=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ur||{});var Tc=p({mode:U(Xo),value:w()}),Ic=p({auth:v(a()),fields:O(a(),Tc)}),Ec=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(Ic)}),Sc=p({type:S("PIECE"),toolName:a().check(le(1)),pieceMetadata:Ec}),Ac=p({type:S("none")}),$c=p({type:S("access_token"),accessToken:a()}),zc=p({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),wc=p({type:S("headers"),headers:O(a(),a())}),Oc=we("type",[Ac,$c,zc,wc]),Ko=p({type:S("FLOW"),toolName:a().check(le(1)),externalFlowId:a(),flowDisplayName:v(a())}),Jo=p({type:S("MCP"),toolName:a().check(le(1)),serverUrl:ko(),protocol:U(Dr),auth:Oc}),Yo=p({type:S("KNOWLEDGE_BASE"),toolName:a().check(le(1)),sourceType:U(Nr),sourceId:a(),sourceName:a()}),kc=we("type",[Sc,Ko,Jo,Yo]),Rc=p({displayName:a(),description:v(a()),type:U(Cr)}),Qo=p({type:S("MARKDOWN"),markdown:a()}),Ge={type:S("TOOL_CALL"),input:H(O(a(),w())),output:v(w()),toolName:a(),status:U(Ur),toolCallId:a(),startTime:a(),endTime:v(a())},kT=p(Ge),ei=we("toolCallType",[p({...Ge,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ge,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ge,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),p({...Ge,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ge,toolCallType:S("UNKNOWN"),displayName:a()})]),Nc=N([Qo,ei]);var Mr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mr||{}),Te=p({apiKey:a()}),Dc=Te,Cc=p({apiKey:a(),apiKeyHash:a()}),Uc=Te,Mc=Te,Lc=Te,jc=Te,Fc=Te,Bc=Te,Vc=Te,ii=p({accessKeyId:a().check(le(1)),secretAccessKey:a().check(le(1))}),Zc=p({}),Hc=p({}),Gc=p({}),Wc=p({}),qc=p({}),Xc=p({}),ai=p({modelId:a(),modelName:a(),modelType:U(Mr)}),si=p({apiKeyHeader:a(),baseUrl:a(),models:R(ai),defaultHeaders:v(O(a(),a()))}),ui=p({accountId:a(),gatewayId:a(),models:R(ai),vertexProject:v(a()),vertexRegion:v(a())}),ci=p({resourceName:a(),apiVersion:ke(Oe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),li=p({region:a().check(le(1))}),Kc=N([Dc,Lc,jc,Fc,Bc,Mc,Uc,Cc,ii,Vc]),pi=N([si,ui,ci,li,Zc,Gc,Wc,qc,Hc,Xc]),Jc=p({id:a(),name:a(),type:U(Mr)}),Yc=p({id:a(),name:a(),provider:U(Pt),config:pi,enabledForChat:B()}),Qc=p({provider:U(Pt),config:pi,auth:Kc,platformId:a()});var CT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],el=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],tl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],rl=["grok-4.20","grok-4.1-fast"],nl={openai:ti,anthropic:el,google:ri,activepieces:[...tl.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...rl.map(e=>`x-ai/${e}`)]};var ni=128e3,ol={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function il({provider:e}){return e?ol[e]??ni:ni}i(il,"getMaxContextTokens");var oi={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"},al={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},sl=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:nl[e],maxContextTokens:il({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!sl.has(e),webSearch:al[e]}}i(fe,"buildProviderCapabilities");var ul={openai:fe("openai"),anthropic:fe("anthropic"),openrouter:fe("openrouter"),azure:fe("azure"),google:fe("google"),"cloudflare-gateway":fe("cloudflare-gateway"),custom:fe("custom"),bedrock:fe("bedrock"),mistral:fe("mistral"),activepieces:fe("activepieces")};var cl=p({base64Url:a(),fileName:a(),extension:v(a())}),ll=p({mimeType:a(),url:a(),fileName:v(a())}),Lr=N([cl,ll]);var pl=N([p({type:S("file"),value:Lr}),p({type:S("markdown"),value:a(),files:v(R(Lr))})]),dl=p({sessionId:a(),message:a(),files:v(R(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),jr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(jr||{});var ml=N([p({...ue,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),fl=p({...ue,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Rr(fi),trigger:Rr(mi)}),gl=p({...ue,tableId:a(),projectId:a(),cells:O(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),yl=p({events:R(U(jr)),webhookUrl:a(),flowId:a()}),hl=p({fields:R(p({id:a(),name:a()})),rows:R(O(a(),a())),name:a()}),vl=p({projectId:a(),limit:v(lt.number()),cursor:v(a()),name:v(a()),externalIds:Wt(a()),folderId:v(a()),folderIds:Wt(a())}),_l=p({records:R(R(p({fieldId:a(),value:yi()}))),tableId:a()}),xl=p({cells:v(R(p({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:v(B())}),gi=we("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),di("exists"),di("not_exists")]),Pl=p({tableId:a(),limit:v(lt.number()),cursor:v(a()),filters:Wt(gi)});function yi(){return ke(Oe(e=>e==null?e:String(e)),ct(a()))}i(yi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:S(e),value:a()})}i(Ce,"valueFilter");function di(e){return p({fieldId:a(),operator:S(e)})}i(di,"existenceFilter");var bl=p({status:v(te()),body:v(w()),headers:v(O(a(),a()))}),Tl=p({...ue,deleted:H(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var hi=p({name:a(),description:v(a()),type:a(),required:B()}),Il=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(hi),returnsResponse:B()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",tI=new RegExp(vi),Sl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",rI=a().check(ze(new RegExp(vi))),nI=a().check(ze(new RegExp(Sl))),Al=p({packageType:S("ARCHIVE"),pieceType:U(Ve),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),_i=p({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),xi=p({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),oI=N([_i,xi]),iI=N([Al,_i,xi]);var $l=we("type",[p({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:S("INTERVAL"),intervalMs:Ro().check(Mt(6e4))})]),aI=p({...ue,type:U(se),projectId:a(),flowId:a(),triggerName:a(),schedule:H($l),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:B()}),Pi=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),sI=p({...ue,projectId:H(a()),platformId:H(a()),type:U(Pi),compression:U(bi),data:v(w()),location:U(Ti),size:H(te()),fileName:H(a()),s3Key:H(a()),metadata:H(O(a(),a()))}),Ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ii||{}),Ei=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ei||{}),uI=p({id:a(),email:a(),firstName:a(),status:U(Ei),externalId:H(a()),platformId:H(a()),platformRole:U(Ii),lastName:a(),created:Re,updated:Re,lastActiveDate:H(Re),imageUrl:H(a())});var Fr=p({...F.shape,...D(O(a(),w()),"OBJECT").shape});var zi=p({...F.shape,...D(a(),"COLOR").shape});var Br=N([oe,_e,Zt,Pe,ie,xe,zr,pt,wr,be,ft,Fr,gt,mt,dt,zi]),C={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 ge=p({displayName:a(),description:v(a())});var wi=p({username:a(),password:a()}),Vr=p({...ge.shape,username:p({displayName:a(),description:v(a())}),password:p({displayName:a(),description:v(a())}),...D(wi,"BASIC_AUTH").shape});var kl=O(a(),N([oe,_e,be,Pe,ie])),Zr=p({...ge.shape,props:kl,...D(w(),"CUSTOM_AUTH").shape});var Ue=p({...ge.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var Rl=O(a(),N([oe,_e,Ue,be,Pe,ie,xe,Zt])),Oi=p({...ge.shape,props:Rl,...D(w(),"OIDC").shape});var Hr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Hr||{}),ki=N([oe,Ue,ie]),Ri=O(a(),ki),Nl=p({props:v(O(a(),ki)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:v(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:v(B()),pkceMethod:v(N([S("plain"),S("S256")])),authorizationMethod:v(U(Hr)),grantType:v(N([U(ht),S(Or)])),extra:v(O(a(),a()))}),Ni=p({access_token:a(),props:v(Ri),data:O(a(),ut())}),Gr=p({...ge.shape,...Nl.shape,...D(Ni,"OAUTH2").shape});var We=N([Vr,Zr,Oi,Gr,Ue]),bt="Connection",Wr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||bt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||bt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||bt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||bt}},None(){}};var jE={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 Dl=p({...F.shape,...D(w(),"CUSTOM").shape,code:a()});var Cl=N([Br,We]),qr=O(a(),Cl),aS=O(a(),Br);var Di=N([p({strategy:S("CRON"),cronExpression:a()}),p({strategy:S("NONE")})]),qe=class{constructor(t,r,n,o,s,c,l,m,g,h,b,_,u,d,y,f,x,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=_;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=L}static{i(this,"ITrigger")}},ye=i(e=>{switch(e.type){case"WEBHOOK":return new qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new qe(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Y(e.sampleData)&&Y(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Ci="2",Xt="0.82.0";var Xr=class{constructor(t,r,n,o,s,c,l,m,g=Xt,h,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Ci}),"getContextInfo");(!Ul(g)||Ml(g,Xt))&&(this.minimumSupportedRelease=Xt),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}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}},Ui=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Xr(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 Ul(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Ul,"isValidSimpleSemver");function Ml(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i(Ml,"isSemverLessThan");var Ll=v(O(a(),O(a(),a()))),Mi=p({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:v(a()),directoryPath:v(a()),auth:v(N([We,R(We)])),version:a(),categories:v(R(U(Ze))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),deprecated:v(B()),i18n:Ll}),jl=U(["human","ai","both"]),Li=p({description:v(a()),idempotent:v(B())}),ji=p({name:a(),displayName:a(),description:a(),props:qr,requireAuth:B(),errorHandlingOptions:v($r),outputSchema:v(Bt()),audience:v(jl),aiMetadata:v(Li)}),Fi=p({name:a(),displayName:a(),description:a(),props:qr,errorHandlingOptions:v($r),type:U(se),sampleData:w(),handshakeConfiguration:v(Bt()),renewConfiguration:v(Di),testStrategy:U(_t),outputSchema:v(Bt()),aiMetadata:v(Li)}),Fl=p({...Mi.shape,actions:O(a(),ji),triggers:O(a(),Fi)}),Bl=p({...Mi.shape,actions:te(),triggers:te(),suggestedActions:v(R(ji)),suggestedTriggers:v(R(Fi))}),Bi=p({projectUsage:te(),pieceType:U(Ve),packageType:U(yt),platformId:v(a()),archiveId:v(a())}),aA=p({...Fl.shape,...Bi.shape}),sA=p({...Bl.shape,...Bi.shape}),uA=p({name:a(),version:a()});var Vl=je(require("path")),Zl=je(require("fs/promises"));var Gi=require("node:stream");var Kt=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((s,c)=>{o.append(c,s)}),{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 Jt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Kr,r=new Jr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Kr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Jr=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 Tt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}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 Vi({error:e,requestBody:t}){return e instanceof Tt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(Vi,"toFailsafeOutput");var pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(pe||{});var Yt=class extends Kt{static{i(this,"FetchHttpClient")}constructor(t="",r=new Jt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,ne]of Object.entries(c))o.append(L,ne);let l=o.toString(),m=l?`${n}?${l}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:u,isStream:d}=Hl(t.method)?Gl(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=ql({...s,...u}),f=await Wl(async()=>{let L=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:y,body:_,redirect:h?"follow":"manual",signal:L.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(m,ce)}finally{ne!==void 0&&clearTimeout(ne)}},b),x=h?300:400;if(f.status<200||f.status>=x){let L=await Zi(f,g),ne=new Tt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await Zi(f,g);return{status:f.status,headers:Xl(f.headers),body:P}}};function Hl(e){return e!=="GET"&&e!=="HEAD"}i(Hl,"acceptsRequestBody");function Gl(e,t){if(Jl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Kl(e)){let n=new Gi.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(Gl,"serializeBody");async function Zi(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(Zi,"parseResponseBody");async function Wl(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Hi(n);continue}return o}catch(o){if(r=o,n<t){await Hi(n);continue}throw o}throw r}i(Wl,"sendWithRetries");function Hi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Hi,"backoff");function ql(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(ql,"normalizeHeaders");function Xl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Xl,"toHttpHeaders");function Kl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(Kl,"isNodeFormData");function Jl(e){return e==null}i(Jl,"isNil");var Q=new Yt;var Md=je(require("fs")),Ys=je(Js());var Ld={"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 jd(e){let t=e.split(";")[0].trim().toLowerCase();return Ld[t]??""}i(jd,"contentTypeToExtension");var Fd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Bd=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 Qs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:l,authLocation:m="headers"}){return ae({audience:"human",name:s||"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:C.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:C.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Bd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:C.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(pe).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:C.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:C.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:C.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:C.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=C.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=C.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=C.Array({displayName:"Form Data",required:!0,properties:{fieldName:C.ShortText({displayName:"Field Name",required:!0}),fieldType:C.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:C.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:C.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:C.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:C.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:C.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:C.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async g=>{let{method:h,url:b,headers:_,queryParams:u,body:d,body_type:y,failsafe:f,timeout:x,response_is_binary:P,followRedirects:L}=g.propsValue;Gt(h,"Method"),Gt(b,"URL");let ne=Y(r)?{}:await r(g.auth,g.propsValue),ce=b.url,tt=ce.startsWith("http://")||ce.startsWith("https://")?ce:Fd({baseUrl:t(g.auth),relativePath:ce}),Ee={method:h,url:tt,headers:{..._??{},...m==="headers"||!Y(m)?ne:{}},queryParams:{...m==="queryParams"?ne:{},...u??{}},timeout:x?x*1e3:0,followRedirects:L};if(P&&(Ee.responseType="arraybuffer"),d)if(y&&y!=="none"){let he=d.data;if(y==="form_data"){let lu=he,At=new Ys.default;for(let{fieldName:xn,fieldType:Pn,textFieldValue:bn,fileFieldValue:dr}of lu)Pn==="text"&&!xt(bn)?At.append(xn,bn):Pn==="file"&&!xt(dr)&&At.append(xn,dr.data,{filename:dr?.filename});Ee.body=At,Ee.headers={...Ee.headers,...At.getHeaders()}}else Ee.body=he}else y||(Ee.body=d);try{let he=await Q.sendRequest(Ee);return await Vd(g.files,he.body,he.status,he.headers,P)}catch(he){if(f)return Vi({error:he,requestBody:Ee.body});throw he}},"run")})}i(Qs,"createCustomApiCallAction");var Vd=i(async(e,t,r,n,o)=>{let s;if(o&&Zd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=jd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Zd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var J={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:s,server:c}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(Y(l))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:c}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),l);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>l).map(h=>h.data)}case 1:{let l=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:s,server:c}),g=m.findIndex(_=>_.id===l),h=[];Y(l)||g==-1?h=m??[]:h=m?.slice(0,g)??[],Y(o)||(h=h.slice(-o));let b=h?.[0]?.id;return Y(b)||await t.put("lastItem",b),h.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;Y(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:s});break}}return Hd(c.map(l=>l.data))}};function Hd(e){return e.length<=5?e:e.slice(0,5)}i(Hd,"getFirstFiveOrAll");var et={phone_number:C.Dropdown({auth:V,description:"The phone number to send the message from",displayName:"From",required:!0,refreshers:[],options:i(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"connect your account first",options:[]};let t=e;return{disabled:!1,options:(await Ie("GET","IncomingPhoneNumbers.json",{account_sid:t.username,auth_token:t.password})).body.incoming_phone_numbers.map(n=>({value:n.phone_number,label:n.friendly_name}))}},"options")})},Ie=i(async(e,t,r,n)=>await Q.sendRequest({method:e,url:`https://api.twilio.com/2010-04-01/Accounts/${r.account_sid}/${t}`,authentication:{type:"BASIC",username:r.account_sid,password:r.auth_token},headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n}),"callTwilioApi");var eu=ae({auth:V,name:"send_sms",description:"Send a new SMS message",audience:"both",aiMetadata:{description:"Sends an SMS text message from a Twilio phone number to a recipient. Use to notify or message a person by text. Requires the destination number, message body, and a Twilio-owned sender number; sending costs money and delivers a separate message on every call, so it is not idempotent.",idempotent:!1},displayName:"Send SMS",props:{from:et.phone_number,body:C.ShortText({description:"The body of the message to send",displayName:"Message Body",required:!0}),to:C.ShortText({description:"The phone number to send the message to",displayName:"To",required:!0})},async run(e){let{body:t,to:r,from:n}=e.propsValue,o=e.auth.username,s=e.auth.password;return await Ie("POST","Messages.json",{account_sid:o,auth_token:s},{From:n,Body:t,To:r})}});var tu=ye({auth:V,name:"new_incoming_sms",displayName:"New Incoming SMS",description:"Triggers when a new SMS message is received",aiMetadata:{description:"Fires when an inbound SMS message is received on the specified Twilio phone number. Each event represents one incoming text message with its sender, body, and metadata."},props:{phone_number:et.phone_number},sampleData:{body:"Hello",num_segments:"1",direction:"inbound",from:"+12184191735",date_updated:"Wed, 08 Feb 2023 01:40:51 +0000",price:null,error_message:null,uri:"/2010-04-01/Accounts/ACc0ea1238d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63.json",account_sid:"ACc0ea716d61fe90d78a123a3de71d45619",num_media:"0",to:"+12184191735",date_created:"Wed, 08 Feb 2023 01:40:50 +0000",status:"failed",sid:"SM8c3920d3f2ac481ba83e639a69dadd63",date_sent:"Wed, 08 Feb 2023 01:40:51 +0000",messaging_service_sid:"MG88e323e6a88ce67ba3bf12e1bcb7e0b8",error_code:21211,price_unit:"USD",api_version:"2010-04-01",subresource_uris:{media:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Media.json",feedback:"/2010-04-01/Accounts/ACc0ea716d61fe90d78a69a3de71d45619/Messages/SM8c3920d3f2ac481ba83e639a69dadd63/Feedback.json"}},type:"POLLING",async onEnable(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=await Ie("GET",`Messages.json?PageSize=20&To=${t}`,{account_sid:r,auth_token:n},{});await e.store.put("_new_incoming_sms_trigger",{lastMessageId:o.body.messages.length===0?null:o.body.messages[0].sid})},async onDisable(e){await e.store.put("_new_incoming_sms_trigger",null)},async run(e){let t=e.auth.username,r=e.auth.password,n=[],o=await e.store.get("_new_incoming_sms_trigger"),s=`2010-04-01/Accounts/${t}/Messages.json?PageSize=20&To=${e.propsValue.phone_number}`,c;for(;s!=null;){let l=await Q.sendRequest({method:"GET",url:`https://api.twilio.com/${s}`,authentication:{type:"BASIC",username:t,password:r}}),m=l.body.messages;!c&&m.length>0&&(c=m[0].sid),s=l.body.next_page_uri;for(let g=0;g<m.length;g++){let h=m[g];if(h.sid===o?.lastMessageId){s=null;break}h.direction==="inbound"&&n.push(h)}}return await e.store.put("_new_incoming_sms_trigger",{lastMessageId:c??o.lastMessageId}),n}});var ru=ae({auth:V,name:"phone_number_lookup",description:"Lookup information about a phone number.",audience:"both",aiMetadata:{description:"Looks up carrier and line-type intelligence for a single phone number via the Twilio Lookup API. Use to validate or enrich a number (e.g. detect mobile vs landline, carrier) before messaging or calling it. Read-only and idempotent.",idempotent:!0},displayName:"Phone Number Lookup",props:{phone_number:C.ShortText({displayName:"Phone Number",required:!0})},async run(e){let{phone_number:t}=e.propsValue,r=e.auth.username,n=e.auth.password;return(await Q.sendRequest({method:"GET",url:`https://lookups.twilio.com/v2/PhoneNumbers/${encodeURIComponent(t)}`,authentication:{type:"BASIC",username:r,password:n},queryParams:{Fields:"line_type_intelligence"}})).body}});var nu=ae({auth:V,name:"make_call",description:"Call a number and say a message.",audience:"both",aiMetadata:{description:"Places an outbound voice call from a Twilio number that reads a text-to-speech message to the recipient. Use to deliver a spoken notification or alert by phone. Requires both numbers in E.164 format and the message text; each call places a real, billable phone call, so it is not idempotent.",idempotent:!1},displayName:"Call Phone",props:{from:et.phone_number,to:C.ShortText({displayName:"To",description:"The phone number to call. Must be in E.164 format (e.g., +15558675310).",required:!0}),message:C.LongText({displayName:"Message to Say",description:"The text message to be converted to speech and spoken to the recipient.",required:!0}),voice:C.StaticDropdown({displayName:"Voice",description:"The voice to use for the text-to-speech message.",required:!1,options:{options:[{label:"Alice (Default)",value:"alice"},{label:"Man",value:"man"},{label:"Woman",value:"woman"}]}}),language:C.StaticDropdown({displayName:"Language",description:"The language to use for the text-to-speech message.",required:!1,options:{options:[{label:"English (US)",value:"en-US"},{label:"English (UK)",value:"en-GB"},{label:"Spanish",value:"es-ES"},{label:"French",value:"fr-FR"},{label:"German",value:"de-DE"}]}}),sendDigits:C.ShortText({displayName:"Send DTMF Tones",description:"A string of keys to dial after the call is connected. Use 'w' for a half-second pause.",required:!1}),timeout:C.Number({displayName:"Timeout (seconds)",description:"The number of seconds to let the phone ring before assuming no answer. Default is 60.",required:!1})},async run(e){let{from:t,to:r,message:n,voice:o,language:s,sendDigits:c,timeout:l}=e.propsValue,m=e.auth.username,g=e.auth.password,h=o?` voice="${o}"`:"",b=s?` language="${s}"`:"",_=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),u=`<Response><Say${h}${b}>${_}</Say></Response>`,d={From:t,To:r,Twiml:u};return c&&(d.SendDigits=c),l&&(d.Timeout=l),(await Ie("POST","Calls.json",{account_sid:m,auth_token:g},d)).body}});var ou=ae({auth:V,name:"get_message",description:"Retrieves the details of a specific message.",audience:"both",aiMetadata:{description:'Fetches the full details and status of a single Twilio message by its SID. Use to check delivery status or inspect a known message; requires the message SID (starting with "SM" or "MM"). Read-only and idempotent.',idempotent:!0},displayName:"Get Message",props:{message_sid:C.ShortText({displayName:"Message SID",description:'The unique identifier (SID) of the message to retrieve. It starts with "SM" or "MM".',required:!0})},async run(e){let{message_sid:t}=e.propsValue,r=e.auth.username,n=e.auth.password,o=`Messages/${t}.json`;return(await Ie("GET",o,{account_sid:r,auth_token:n})).body}});var iu=ae({auth:V,name:"download_recording_media",displayName:"Download Recording Media",description:"Download the media file for a specific recording.",audience:"both",aiMetadata:{description:'Downloads the audio file for a specific Twilio call recording by its SID, returning it as a file (MP3 or WAV). Use to retrieve recorded call audio for storage or further processing; requires the recording SID (starting with "RE"). Read-only and idempotent.',idempotent:!0},props:{recording_sid:C.ShortText({displayName:"Recording SID",description:'The unique identifier (SID) of the recording to download. It starts with "RE".',required:!0}),format:C.StaticDropdown({displayName:"Format",description:"The desired audio format for the download file.",required:!1,defaultValue:"mp3",options:{options:[{label:"MP3",value:"mp3"},{label:"WAV",value:"wav"}]}}),channels:C.StaticDropdown({displayName:"Channels",description:"Specify whether to download a mono or dual-channel file. Note: Dual-channel may not be available for all recordings.",required:!1,options:{options:[{label:"Mono",value:1},{label:"Dual",value:2}]}})},async run(e){let{recording_sid:t,format:r,channels:n}=e.propsValue,o=e.auth.username,s=e.auth.password,c=r??"mp3",l=`Recordings/${t}.${c}`,m={};n&&(m.RequestedChannels=n.toString());let g=await Q.sendRequest({method:"GET",url:`https://api.twilio.com/2010-04-01/Accounts/${o}/${l}`,queryParams:m,authentication:{type:"BASIC",username:o,password:s},responseType:"arraybuffer"}),h=Buffer.from(g.body);return await e.files.write({fileName:`${t}.${c}`,data:h})}});var ur={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/IncomingPhoneNumbers.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Q.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.incoming_phone_numbers??[];for(let b of h){let _=new Date(b.date_created).getTime();if(r||_>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},au=ye({auth:V,name:"new_phone_number",displayName:"New Phone Number",description:"Triggers when you add a new phone number to your account.",aiMetadata:{description:"Fires when a new phone number is provisioned on the Twilio account. Each event represents one newly added incoming phone number with its capabilities and configuration."},props:{},sampleData:{sid:"PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",account_sid:"ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",friendly_name:"(555) 123-4567",phone_number:"+15551234567",voice_url:"https://demo.twilio.com/welcome/voice/",voice_method:"POST",sms_url:"https://demo.twilio.com/welcome/sms/",sms_method:"POST",date_created:"2025-08-28T11:44:10+00:00",date_updated:"2025-08-28T11:44:10+00:00",capabilities:{voice:!0,sms:!0,mms:!0},uri:"/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/IncomingPhoneNumbers/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"},type:"POLLING",async onEnable(e){await J.onEnable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(ur,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(ur,e)},async run(e){return await J.poll(ur,e)}});var cr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Recordings.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Q.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.recordings??[];for(let b of h){let _=new Date(b.date_created).getTime();if(r||_>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},su=ye({auth:V,name:"new_recording",displayName:"New Recording",description:"Triggers when a new call recording is completed and available.",aiMetadata:{description:"Fires when a new call recording becomes available on the Twilio account. Each event represents one completed recording, including its call SID, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2010-04-01",call_sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",conference_sid:"CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",channels:1,date_created:"Fri, 14 Oct 2016 21:56:34 +0000",date_updated:"Fri, 14 Oct 2016 21:56:38 +0000",start_time:"Fri, 14 Oct 2016 21:56:34 +0000",price:"0.04",price_unit:"USD",duration:"4",sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",source:"StartConferenceRecordingAPI",status:"completed",error_code:null,uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",subresource_uris:{add_on_results:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"},encryption_details:{encryption_public_key_sid:"CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",encryption_cek:"OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==",encryption_iv:"8I2hhNIYNTrwxfHk"},media_url:"http://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"},type:"POLLING",async onEnable(e){await J.onEnable(cr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(cr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(cr,e)},async run(e){return await J.poll(cr,e)}});var lr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Transcriptions.json?PageSize=${r?10:1e3}`,c=[],l=!1;do{let g=(await Q.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.transcriptions??[];for(let b of h){let _=new Date(b.date_created).getTime();if(b.status==="completed")if(r||_>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},uu=ye({auth:V,name:"new_transcription",displayName:"New Transcription",description:"Triggers when a new call recording transcription is completed.",aiMetadata:{description:"Fires when a call recording transcription reaches completed status on the Twilio account. Each event represents one finished transcription tied to a recording, including its transcribed text."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",api_version:"2008-08-01",date_created:"Thu, 25 Aug 2011 20:59:45 +0000",date_updated:"Thu, 25 Aug 2011 20:59:45 +0000",duration:"10",price:"0.00000",price_unit:"USD",recording_sid:"REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",sid:"TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",status:"completed",transcription_text:null,type:"fast",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"},type:"POLLING",async onEnable(e){await J.onEnable(lr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(lr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(lr,e)},async run(e){return await J.poll(lr,e)}});var pr={strategy:0,async items({auth:e,lastFetchEpochMS:t}){let r=t===0,n=e.username,o=e.password,s=`/2010-04-01/Accounts/${n}/Calls.json?PageSize=${r?1:1e3}`,c=[],l=!1;do{let g=(await Q.sendRequest({method:"GET",url:`https://api.twilio.com${s}`,authentication:{type:"BASIC",username:n,password:o}})).body,h=g.calls??[];for(let b of h){let _=new Date(b.date_created).getTime();if(b.status==="completed")if(r||_>t)c.push(b);else{l=!0;break}}if(r)break;s=g?.next_page_uri??null}while(s&&!l);return c.map(m=>({epochMilliSeconds:new Date(m.date_created).getTime(),data:m}))}},cu=ye({auth:V,name:"new_call",displayName:"New Call",description:"Triggers when a call completes (incoming or outgoing).",aiMetadata:{description:"Fires when a voice call reaches completed status on the Twilio account, for both inbound and outbound calls. Each event represents one finished call with its direction, participants, duration, and status."},props:{},sampleData:{account_sid:"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",answered_by:"machine_start",api_version:"2010-04-01",caller_name:"callerid1",date_created:"Fri, 18 Oct 2019 17:00:00 +0000",date_updated:"Fri, 18 Oct 2019 17:01:00 +0000",direction:"outbound-api",duration:"4",end_time:"Fri, 18 Oct 2019 17:03:00 +0000",forwarded_from:"calledvia1",from:"+13051416799",from_formatted:"(305) 141-6799",group_sid:"GPdeadbeefdeadbeefdeadbeefdeadbeef",parent_call_sid:"CAdeadbeefdeadbeefdeadbeefdeadbeef",phone_number_sid:"PNdeadbeefdeadbeefdeadbeefdeadbeef",price:"-0.200",price_unit:"USD",sid:"CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",start_time:"Fri, 18 Oct 2019 17:02:00 +0000",status:"completed",subresource_uris:{notifications:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",recordings:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",payments:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments.json",events:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events.json",siprec:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Siprec.json",streams:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams.json",transcriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",user_defined_message_subscriptions:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessageSubscriptions.json",user_defined_messages:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UserDefinedMessages.json"},to:"+13051913581",to_formatted:"(305) 191-3581",trunk_sid:"TKdeadbeefdeadbeefdeadbeefdeadbeef",uri:"/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json",queue_time:"1000"},type:"POLLING",async onEnable(e){await J.onEnable(pr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async onDisable(e){await J.onDisable(pr,{auth:e.auth,store:e.store,propsValue:e.propsValue})},async test(e){return await J.test(pr,e)},async run(e){return await J.poll(pr,e)}});var V=Wr.BasicAuth({description:"The authentication to use to connect to Twilio",required:!0,username:{displayName:"Account SID",description:"The account SID to use to connect to Twilio"},password:{displayName:"Auth token",description:"The auth token to use to connect to Twilio"}}),Gd=Ui({displayName:"Twilio",description:"Cloud communications platform for building SMS, Voice & Messaging applications",minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/twilio.png",auth:V,categories:["COMMUNICATION"],actions:[eu,ru,nu,ou,iu,Qs({baseUrl:i(()=>"https://api.twilio.com/2010-04-01","baseUrl"),auth:V,authMapping:i(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],authors:["kishanprmr","MoShizzle","khaledmashaly","abuaboud"],triggers:[tu,au,su,uu,cu]});0&&(module.exports={twilio,twilioAuth});
|
|
4
4
|
/*! Bundled license information:
|
|
5
5
|
|
|
6
6
|
mime-types/index.js:
|