@activepieces/piece-reachinbox 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +10 -10
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Qs=Object.create;var Qe=Object.defineProperty;var eu=Object.getOwnPropertyDescriptor;var tu=Object.getOwnPropertyNames;var ru=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},fn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of tu(t))!nu.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=eu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?Qs(ru(e)):{},fn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),ou=e=>fn(Qe({},"__esModule",{value:!0}),e);var Oo=$((ko,Bt)=>{(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"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,p){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let g=0,m=-1,v=(u.match(d.zoneIndex)||[])[0],b,j;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)g++;if(u.substr(0,2)==="::"&&g--,u.substr(-2,2)==="::"&&g--,g>p)return null;for(j=p-g,b=":";j--;)b+="0:";return u=u.replace("::",b),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),p=function(){let se=u.split(":"),pe=[];for(let Ye=0;Ye<se.length;Ye++)pe.push(parseInt(se[Ye],16));return pe}(),{parts:p,zoneId:v}}o(f,"expandIPv6");function h(u,p,g,m){if(u.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=g-m,b<0&&(b=0),u[v]>>b!==p[v]>>b)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(u){if(i.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)}o(x,"parseIntAuto");function T(u,p){for(;u.length<p;)u=`0${u}`;return u}o(T,"padPart");let _={};_.IPv4=function(){function u(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<p.length;g++)if(m=p[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return o(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(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,g)},u.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,j;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(j=m[b],g&&j!==0)return null;j!==8&&(g=!0),p+=j}else return null;return 32-p},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 p=this.parseCIDR(u),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}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 p=u.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(u)||!p?!1:_.IPv4.isValidFourPartDecimal(p[1])},_.IPv4.networkAddressFromCIDR=function(u){let p,g,m,v,b;try{for(p=this.parseCIDR(u),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(u){let p=this.parser(u);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},_.IPv4.parseCIDR=function(u){let p;if(p=u.match(/^(.+)\/(\d+)$/)){let g=parseInt(p[2]);if(g>=0&&g<=32){let m=[this.parse(p[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(u){let p,g,m;if(p=u.match(r.fourOctet))return function(){let v=p.slice(1,6),b=[];for(let j=0;j<v.length;j++)g=v[j],b.push(x(g));return b}();if(p=u.match(r.longValue)){if(m=x(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v}().reverse()}else return(p=u.match(r.twoOctet))?function(){let v=p.slice(1,4),b=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b}():(p=u.match(r.threeOctet))?function(){let v=p.slice(1,5),b=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(x(v[1])),b.push(m>>8&255),b.push(m&255),b}():null},_.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)p[g]=255,g++;return m<4&&(p[m]=Math.pow(2,u%8)-1<<8-u%8),new this(p)},_.IPv6=function(){function u(p,g){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(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(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,g)},u.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(b=m[v],g&&b!==0)return null;b!==16&&(g=!0),p+=b}else return null;return 128-p},u.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let p,g=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],g.push(p>>8),g.push(p&255);return g},u.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),g=p[0],m=p[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},u.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,b;for(;b=p.exec(g);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),_.IPv6.broadcastAddressFromCIDR=function(u){try{let p=this.parseCIDR(u),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},_.IPv6.isIPv6=function(u){return this.parser(u)!==null},_.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let p=this.parser(u);return new this(p.parts,p.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 p,g,m,v,b;try{for(p=this.parseCIDR(u),m=p[0].toByteArray(),b=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},_.IPv6.parse=function(u){let p=this.parser(u);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},_.IPv6.parseCIDR=function(u){let p,g,m;if((g=u.match(/^(.+)\/(\d+)$/))&&(p=parseInt(g[2]),p>=0&&p<=128))return m=[this.parse(g[1]),p],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(u){let p,g,m,v,b,j;if(m=u.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(u))return f(u,8);if((m=u.match(d.transitional))&&(j=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+j,6),p.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<b.length;g++)if(v=b[g],!(0<=v&&v<=255))return null;return p.parts.push(b[0]<<8|b[1]),p.parts.push(b[2]<<8|b[3]),{parts:p.parts,zoneId:p.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)p[g]=255,g++;return m<16&&(p[m]=Math.pow(2,u%8)-1<<8-u%8),new this(p)},_.fromByteArray=function(u){let p=u.length;if(p===4)return new _.IPv4(u);if(p===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 p=this.parse(u);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},_.subnetMatch=function(u,p,g){let m,v,b,j;g==null&&(g="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(b=p[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(j=b[m],u.kind()===j[0].kind()&&u.match.apply(u,j))return v}return g},typeof Bt<"u"&&Bt.exports?Bt.exports=_:e.ipaddr=_})(ko)});var Ai=$((pA,Si)=>{var $i=require("stream").Stream,Rl=require("util");Si.exports=fe;function fe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fe,"DelayedStream");Rl.inherits(fe,$i);fe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(fe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fe.prototype.resume=function(){this._released||this.release(),this.source.resume()};fe.prototype.pause=function(){this.source.pause()};fe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};fe.prototype.pipe=function(){var e=$i.prototype.pipe.apply(this,arguments);return this.resume(),e};fe.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)};fe.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 Oi=$((mA,ki)=>{var Nl=require("util"),wi=require("stream").Stream,zi=Ai();ki.exports=X;function X(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(X,"CombinedStream");Nl.inherits(X,wi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof zi)){var r=zi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return wi.prototype.pipe.call(this,e,t),this.resume(),e};X.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};X.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ni=$((gA,Ri)=>{"use strict";Ri.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 Ui=$(ie=>{"use strict";var Gt=Ni(),Dl=require("path").extname,Di=/^\s*([^;\s]*)(?:;|\s|$)/,Cl=/^text\//i;ie.charset=Ci;ie.charsets={lookup:Ci};ie.contentType=Ul;ie.extension=Ml;ie.extensions=Object.create(null);ie.lookup=Ll;ie.types=Object.create(null);jl(ie.extensions,ie.types);function Ci(e){if(!e||typeof e!="string")return!1;var t=Di.exec(e),r=t&&Gt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Cl.test(t[1])?"UTF-8":!1}o(Ci,"charset");function Ul(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ie.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ie.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Ul,"contentType");function Ml(e){if(!e||typeof e!="string")return!1;var t=Di.exec(e),r=t&&ie.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ml,"extension");function Ll(e){if(!e||typeof e!="string")return!1;var t=Dl("x."+e).toLowerCase().substr(1);return t&&ie.types[t]||!1}o(Ll,"lookup");function jl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Gt).forEach(o(function(i){var s=Gt[i],c=s.extensions;if(!(!c||!c.length)){e[i]=c;for(var d=0;d<c.length;d++){var f=c[d];if(t[f]){var h=r.indexOf(Gt[t[f]].source),x=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(jl,"populateMaps")});var Li=$((vA,Mi)=>{Mi.exports=Fl;function Fl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Fl,"defer")});var Zr=$((_A,Fi)=>{var ji=Li();Fi.exports=Bl;function Bl(e){var t=!1;return ji(function(){t=!0}),o(function(n,i){t?e(n,i):ji(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Bl,"async")});var Vr=$((bA,Bi)=>{Bi.exports=Zl;function Zl(e){Object.keys(e.jobs).forEach(Vl.bind(e)),e.jobs={}}o(Zl,"abort");function Vl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Vl,"clean")});var Hr=$((EA,Vi)=>{var Zi=Zr(),Hl=Vr();Vi.exports=ql;function ql(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Wl(t,i,e[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?Hl(r):r.results[i]=c,n(s,r.results))})}o(ql,"iterate");function Wl(e,t,r,n){var i;return e.length==2?i=e(r,Zi(n)):i=e(r,t,Zi(n)),i}o(Wl,"runJob")});var qr=$(($A,Hi)=>{Hi.exports=Gl;function Gl(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(i,s){return t(e[i],e[s])}),n}o(Gl,"state")});var Wr=$((AA,qi)=>{var Kl=Vr(),Jl=Zr();qi.exports=Xl;function Xl(e){Object.keys(this.jobs).length&&(this.index=this.size,Kl(this),Jl(e)(null,this.results))}o(Xl,"terminator")});var Gi=$((wA,Wi)=>{var Yl=Hr(),Ql=qr(),ep=Wr();Wi.exports=tp;function tp(e,t,r){for(var n=Ql(e);n.index<(n.keyedList||e).length;)Yl(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return ep.bind(n,r)}o(tp,"parallel")});var Gr=$((OA,Kt)=>{var Ki=Hr(),rp=qr(),np=Wr();Kt.exports=op;Kt.exports.ascending=Ji;Kt.exports.descending=ip;function op(e,t,r,n){var i=rp(e,r);return Ki(e,t,i,o(function s(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||e).length){Ki(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),np.bind(i,n)}o(op,"serialOrdered");function Ji(e,t){return e<t?-1:e>t?1:0}o(Ji,"ascending");function ip(e,t){return-1*Ji(e,t)}o(ip,"descending")});var Yi=$((NA,Xi)=>{var ap=Gr();Xi.exports=sp;function sp(e,t,r){return ap(e,t,null,r)}o(sp,"serial")});var ea=$((CA,Qi)=>{Qi.exports={parallel:Gi(),serial:Yi(),serialOrdered:Gr()}});var Kr=$((UA,ta)=>{"use strict";ta.exports=Object});var na=$((MA,ra)=>{"use strict";ra.exports=Error});var ia=$((LA,oa)=>{"use strict";oa.exports=EvalError});var sa=$((jA,aa)=>{"use strict";aa.exports=RangeError});var ca=$((FA,ua)=>{"use strict";ua.exports=ReferenceError});var pa=$((BA,la)=>{"use strict";la.exports=SyntaxError});var Jt=$((ZA,da)=>{"use strict";da.exports=TypeError});var fa=$((VA,ma)=>{"use strict";ma.exports=URIError});var ya=$((HA,ga)=>{"use strict";ga.exports=Math.abs});var va=$((qA,ha)=>{"use strict";ha.exports=Math.floor});var _a=$((WA,xa)=>{"use strict";xa.exports=Math.max});var ba=$((GA,Pa)=>{"use strict";Pa.exports=Math.min});var Ea=$((KA,Ia)=>{"use strict";Ia.exports=Math.pow});var $a=$((JA,Ta)=>{"use strict";Ta.exports=Math.round});var Aa=$((XA,Sa)=>{"use strict";Sa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var wa=$((QA,za)=>{"use strict";var up=Aa();za.exports=o(function(t){return up(t)||t===0?t:t<0?-1:1},"sign")});var Oa=$((tz,ka)=>{"use strict";ka.exports=Object.getOwnPropertyDescriptor});var Jr=$((rz,Ra)=>{"use strict";var Xt=Oa();if(Xt)try{Xt([],"length")}catch{Xt=null}Ra.exports=Xt});var Da=$((nz,Na)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Na.exports=Yt});var Xr=$((oz,Ca)=>{"use strict";Ca.exports=o(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 i=42;t[r]=i;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 d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var La=$((az,Ma)=>{"use strict";var Ua=typeof Symbol<"u"&&Symbol,cp=Xr();Ma.exports=o(function(){return typeof Ua!="function"||typeof Symbol!="function"||typeof Ua("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:cp()},"hasNativeSymbols")});var Yr=$((uz,ja)=>{"use strict";ja.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((cz,Fa)=>{"use strict";var lp=Kr();Fa.exports=lp.getPrototypeOf||null});var Va=$((lz,Za)=>{"use strict";var pp="Function.prototype.bind called on incompatible ",dp=Object.prototype.toString,mp=Math.max,fp="[object Function]",Ba=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),gp=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),yp=o(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");Za.exports=o(function(t){var r=this;if(typeof r!="function"||dp.apply(r)!==fp)throw new TypeError(pp+r);for(var n=gp(arguments,1),i,s=o(function(){if(this instanceof i){var x=r.apply(this,Ba(n,arguments));return Object(x)===x?x:this}return r.apply(t,Ba(n,arguments))},"binder"),c=mp(0,r.length-n.length),d=[],f=0;f<c;f++)d[f]="$"+f;if(i=Function("binder","return function ("+yp(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var We=$((dz,Ha)=>{"use strict";var hp=Va();Ha.exports=Function.prototype.bind||hp});var Qt=$((mz,qa)=>{"use strict";qa.exports=Function.prototype.call});var en=$((fz,Wa)=>{"use strict";Wa.exports=Function.prototype.apply});var Ka=$((gz,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Xa=$((yz,Ja)=>{"use strict";var vp=We(),xp=en(),_p=Qt(),Pp=Ka();Ja.exports=Pp||vp.call(_p,xp)});var Qa=$((hz,Ya)=>{"use strict";var bp=We(),Ip=Jt(),Ep=Qt(),Tp=Xa();Ya.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Ip("a function is required");return Tp(bp,Ep,t)},"callBindBasic")});var is=$((xz,os)=>{"use strict";var $p=Qa(),es=Jr(),rs;try{rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!rs&&es&&es(Object.prototype,"__proto__"),ns=Object,ts=ns.getPrototypeOf;os.exports=tn&&typeof tn.get=="function"?$p([tn.get]):typeof ts=="function"?o(function(t){return ts(t==null?t:ns(t))},"getDunder"):!1});var ls=$((Pz,cs)=>{"use strict";var as=Yr(),ss=Qr(),us=is();cs.exports=as?o(function(t){return as(t)},"getProto"):ss?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ss(t)},"getProto"):us?o(function(t){return us(t)},"getProto"):null});var rn=$((Iz,ps)=>{"use strict";var Sp=Function.prototype.call,Ap=Object.prototype.hasOwnProperty,zp=We();ps.exports=zp.call(Sp,Ap)});var vs=$((Ez,hs)=>{"use strict";var L,wp=Kr(),kp=na(),Op=ia(),Rp=sa(),Np=ca(),Xe=pa(),Je=Jt(),Dp=fa(),Cp=ya(),Up=va(),Mp=_a(),Lp=ba(),jp=Ea(),Fp=$a(),Bp=wa(),gs=Function,nn=o(function(e){try{return gs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=Jr(),Zp=Da(),on=o(function(){throw new Je},"throwTypeError"),Vp=_t?function(){try{return arguments.callee,on}catch{try{return _t(arguments,"callee").get}catch{return on}}}():on,Ge=La()(),ee=ls(),Hp=Qr(),qp=Yr(),ys=en(),Pt=Qt(),Ke={},Wp=typeof Uint8Array>"u"||!ee?L:ee(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&ee?ee([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":kp,"%eval%":eval,"%EvalError%":Op,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":gs,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&ee?ee(ee([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!ee?L:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":wp,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Rp,"%ReferenceError%":Np,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!ee?L:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&ee?ee(""[Symbol.iterator]()):L,"%Symbol%":Ge?Symbol:L,"%SyntaxError%":Xe,"%ThrowTypeError%":Vp,"%TypedArray%":Wp,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Dp,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":ys,"%Object.defineProperty%":Zp,"%Object.getPrototypeOf%":Hp,"%Math.abs%":Cp,"%Math.floor%":Up,"%Math.max%":Mp,"%Math.min%":Lp,"%Math.pow%":jp,"%Math.round%":Fp,"%Math.sign%":Bp,"%Reflect.getPrototypeOf%":qp};if(ee)try{null.error}catch(e){ds=ee(ee(e)),De["%Error.prototype%"]=ds}var ds,Gp=o(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return De[t]=r,r},"doEval"),ms={__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"]},bt=We(),er=rn(),Kp=bt.call(Pt,Array.prototype.concat),Jp=bt.call(ys,Array.prototype.splice),fs=bt.call(Pt,String.prototype.replace),tr=bt.call(Pt,String.prototype.slice),Xp=bt.call(Pt,RegExp.prototype.exec),Yp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Qp=/\\(\\)?/g,ed=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return fs(t,Yp,function(s,c,d,f){i[i.length]=d?fs(f,Qp,"$1"):c||s}),i},"stringToPath"),td=o(function(t,r){var n=t,i;if(er(ms,n)&&(i=ms[n],n="%"+i[0]+"%"),er(De,n)){var s=De[n];if(s===Ke&&(s=Gp(n)),typeof s>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");hs.exports=o(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 Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ed(t),i=n.length>0?n[0]:"",s=td("%"+i+"%",r),c=s.name,d=s.value,f=!1,h=s.alias;h&&(i=h[0],Jp(n,Kp([0,1],h)));for(var x=1,T=!0;x<n.length;x+=1){var _=n[x],u=tr(_,0,1),p=tr(_,-1);if((u==='"'||u==="'"||u==="`"||p==='"'||p==="'"||p==="`")&&u!==p)throw new Xe("property names with quotes must have matching quotes");if((_==="constructor"||!T)&&(f=!0),i+="."+_,c="%"+i+"%",er(De,c))d=De[c];else if(d!=null){if(!(_ in d)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&x+1>=n.length){var g=_t(d,_);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?d=g.get:d=d[_]}else T=er(d,_),d=d[_];T&&!f&&(De[c]=d)}}return d},"GetIntrinsic")});var _s=$(($z,xs)=>{"use strict";var rd=Xr();xs.exports=o(function(){return rd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Is=$((Az,bs)=>{"use strict";var nd=vs(),Ps=nd("%Object.defineProperty%",!0),od=_s()(),id=rn(),ad=Jt(),rr=od?Symbol.toStringTag:null;bs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new ad("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!id(t,rr))&&(Ps?Ps(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ts=$((wz,Es)=>{"use strict";var sd=Function.prototype.call,ud=Object.prototype.hasOwnProperty,cd=We();Es.exports=cd.call(sd,ud)});var Ss=$((kz,$s)=>{"use strict";$s.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ws=$((Oz,zs)=>{"use strict";var cn=Oi(),ld=require("util"),an=require("path"),pd=require("http"),dd=require("https"),md=require("url").parse,fd=require("fs"),gd=require("stream").Stream,yd=require("crypto"),sn=Ui(),hd=ea(),vd=Is(),we=Ts(),un=Ss();function As(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(As,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");ld.inherits(F,cn);F.LINE_BREAK=`\r
|
|
2
|
-
`;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.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 i=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof gd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):fd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+As(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var d;for(var f in c)if(we(c,f)){if(d=c[f],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=f+": "+d.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+As(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+yd.randomBytes(12).toString("hex")};F.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}hd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=md(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=un(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=dd.request(n):r=pd.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 d,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",d),t.call(this,h,x)},"callback");d=f.bind(this,null),r.on("error",f),r.on("response",d)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};vd(F.prototype,"FormData");zs.exports=F});var Nd={};mn(Nd,{ReachinboxAuth:()=>M,reachinbox:()=>Rd});module.exports=ou(Nd);var iu=Object.freeze({status:"aborted"});function I(e,t,r){function n(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);let h=c.prototype,x=Object.keys(h);for(let T=0;T<x.length;T++){let _=x[T];_ in d||(d[_]=h[_].bind(d))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(d){var f;let h=r?.Parent?new s:this;n(h,d),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var au=Symbol("zod_brand"),ge=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ve(e){return e&&Object.assign(or,e),or}o(ve,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function yn(e,t){return typeof t=="bigint"?t.toString():t}o(yn,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function hn(e){return e==null}o(hn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var gn=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==gn)return n===void 0&&(n=gn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var su=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function vn(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(vn,"isPlainObject");var xn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function At(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(At,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(G,"normalizeParams");function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(_n,"optionalKeys");var uu={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 Me(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}o(Me,"aborted");function Ee(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ee,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function Pn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Pn,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var bn=o((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,yn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),In=I("$ZodError",bn),tt=I("$ZodError",bn,{Parent:Error});var lu=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new ge;if(c.issues.length){let d=new(i?.Err??e)(c.issues.map(f=>Te(f,s,ve())));throw sr(d,i?.callee),d}return c.value},"_parse"),zt=lu(tt),pu=o(e=>async(t,r,n,i)=>{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 d=new(i?.Err??e)(c.issues.map(f=>Te(f,s,ve())));throw sr(d,i?.callee),d}return c.value},"_parseAsync"),wt=pu(tt),du=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ge;return s.issues.length?{success:!1,error:new(e??In)(s.issues.map(c=>Te(c,i,ve())))}:{success:!0,data:s.value}},"_safeParse"),rt=du(tt),mu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Te(c,i,ve())))}:{success:!0,data:s.value}},"_safeParseAsync"),nt=mu(tt);var fu="(?:(?:\\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])))",gu=new RegExp(`^${fu}$`);var En=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Tn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,$n=/^(?:true|false)$/i;var Le=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Sn=I("$ZodCheckMinLength",(e,t)=>{var r;Le.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!hn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Pn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Le.init(e,t),e._zod.onattach.push(i=>{let s=i._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=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),An=I("$ZodCheckRegex",(e,t)=>{lr.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 wn={major:4,minor:3,patch:6};var K=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._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 i=o((c,d,f)=>{let h=Me(c),x;for(let T of d){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,u=T._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new ge;if(x||u instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await u,c.issues.length!==_&&(h||(h=Me(c,_)))});else{if(c.issues.length===_)continue;h||(h=Me(c,_))}}return x?x.then(()=>c):c},"runChecks"),s=o((c,d,f)=>{if(Me(c))return c.aborted=!0,c;let h=i(d,n,f);if(h instanceof Promise){if(f.async===!1)throw new ge;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(x=>s(x,c,d)):s(h,c,d)}let f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new ge;return f.then(h=>i(h,n,d))}return i(f,n,d)}}Y(e,"~standard",()=>({validate:o(i=>{try{let s=rt(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=I("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??En(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}}),pr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),Rt.init(e,t)});var Dn=I("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Cn=I("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}});var dr=I("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=$n,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Un=I("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=Tn,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 Mn=I("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Ln=I("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var jn=I("$ZodVoid",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Fn=I("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function kn(e,t,r){e.issues.length&&t.issues.push(...Ee(r,e.issues)),t.value[r]=e.value}o(kn,"handleArrayResult");var Bn=I("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let d=i[c],f=t.element._zod.run({value:d,issues:[]},n);f instanceof Promise?s.push(f.then(h=>kn(h,r,c))):kn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ee(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function yu(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=_n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(yu,"normalizeDef");function hu(e,t,r,n,i,s){let c=[],d=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let T in t){if(d.has(T))continue;if(h==="never"){c.push(T);continue}let _=f.run({value:t[T],issues:[]},n);_ instanceof Promise?e.push(_.then(u=>Ot(u,r,T,t,x))):Ot(_,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(hu,"handleCatchall");var Zn=I("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...d};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=$t(()=>yu(t));Y(e._zod,"propValues",()=>{let d=t.shape,f={};for(let h in d){let x=d[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let T of x.values)f[h].add(T)}}return f});let i=et,s=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let x=[],T=c.shape;for(let _ of c.keys){let u=T[_],p=u._zod.optout==="optional",g=u._zod.run({value:h[_],issues:[]},f);g instanceof Promise?x.push(g.then(m=>Ot(m,d,_,h,p))):Ot(g,d,_,h,p)}return s?hu(x,h,d,f,n.value,e):x.length?Promise.all(x).then(()=>d):d}});function On(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Me(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Te(c,n,ve())))}),t)}o(On,"handleUnionResults");var mr=I("$ZodUnion",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>St(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,d=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(f=>On(f,i,e,s)):On(d,i,e,s)}});var Vn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let i={};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[d,f]of Object.entries(c)){i[d]||(i[d]=new Set);for(let h of f)i[d].add(h)}}return i});let n=$t(()=>{let i=t.options,s=new Map;for(let c of i){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of d){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(i,s)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Hn=I("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!vn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?s.push(x.then(T=>{T.issues.length&&r.issues.push(...Ee(h,T.issues)),r.value[h]=T.value})):(x.issues.length&&r.issues.push(...Ee(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)d.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let f=t.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cr.test(d)&&f.issues.length){let T=t.keyType._zod.run({value:Number(d),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>Te(T,n,ve())),input:d,path:[d],inst:e});continue}let x=t.valueType._zod.run({value:i[d],issues:[]},n);x instanceof Promise?s.push(x.then(T=>{T.issues.length&&r.issues.push(...Ee(d,T.issues)),r.value[f.value]=T.value})):(x.issues.length&&r.issues.push(...Ee(d,x.issues)),r.value[f.value]=x.value)}}return s.length?Promise.all(s).then(()=>r):r}});var qn=I("$ZodEnum",(e,t)=>{K.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>xn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Wn=I("$ZodLiteral",(e,t)=>{if(K.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Gn=I("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ge;return r.value=i,r}});function Rn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Rn,"handleOptionalResult");var Kn=I("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Rn(s,r.value)):Rn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Jn=I("$ZodNullable",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Xn=I("$ZodPipe",(e,t)=>{K.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>kt(c,t.in,n)):kt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>kt(s,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var Yn=I("$ZodCustom",(e,t)=>{Le.init(e,t),K.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>Nn(s,r,n,e));Nn(i,r,n,e)}});function Nn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Nn,"handleRefineResult");var eo,Pu=Symbol("ZodOutput"),bu=Symbol("ZodInput"),fr=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function to(){return new fr}o(to,"registry");(eo=globalThis).__zod_globalRegistry??(eo.__zod_globalRegistry=to());var gr=globalThis.__zod_globalRegistry;function ro(e,t){return new e({type:"string",...G(t)})}o(ro,"_string");function no(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(no,"_coercedString");function oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(oo,"_url");function io(e,t){return new e({type:"number",checks:[],...G(t)})}o(io,"_number");function ao(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(ao,"_coercedNumber");function so(e,t){return new e({type:"boolean",...G(t)})}o(so,"_boolean");function uo(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(uo,"_coercedBoolean");function co(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(co,"_coercedBigint");function lo(e){return new e({type:"any"})}o(lo,"_any");function po(e){return new e({type:"unknown"})}o(po,"_unknown");function mo(e,t){return new e({type:"void",...G(t)})}o(mo,"_void");function fo(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(fo,"_coercedDate");function de(e,t){return new Sn({check:"min_length",...G(t),minimum:e})}o(de,"_minLength");function $e(e,t){return new An({check:"string_format",format:"regex",...G(t),pattern:e})}o($e,"_regex");function go(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(go,"_custom");var Q=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>wt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(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)=>At(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Dt=I("ZodMiniString",(e,t)=>{Rt.init(e,t),Q.init(e,t)});function a(e){return ro(Dt,e)}o(a,"string");var yo=I("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Dt.init(e,t)});var Ou=I("ZodMiniURL",(e,t)=>{Dn.init(e,t),yo.init(e,t)});function ho(e){return oo(Ou,e)}o(ho,"url");var yr=I("ZodMiniNumber",(e,t)=>{Cn.init(e,t),Q.init(e,t)});function re(e){return io(yr,e)}o(re,"number");var hr=I("ZodMiniBoolean",(e,t)=>{dr.init(e,t),Q.init(e,t)});function V(e){return so(hr,e)}o(V,"boolean");var vo=I("ZodMiniBigInt",(e,t)=>{Un.init(e,t),Q.init(e,t)});var Ru=I("ZodMiniAny",(e,t)=>{Mn.init(e,t),Q.init(e,t)});function it(){return lo(Ru)}o(it,"any");var Nu=I("ZodMiniUnknown",(e,t)=>{Ln.init(e,t),Q.init(e,t)});function k(){return po(Nu)}o(k,"unknown");var Du=I("ZodMiniVoid",(e,t)=>{jn.init(e,t),Q.init(e,t)});function xo(e){return mo(Du,e)}o(xo,"_void");var _o=I("ZodMiniDate",(e,t)=>{Fn.init(e,t),Q.init(e,t)});var Cu=I("ZodMiniArray",(e,t)=>{Bn.init(e,t),Q.init(e,t)});function N(e,t){return new Cu({type:"array",element:e,...G(t)})}o(N,"array");var Uu=I("ZodMiniObject",(e,t)=>{Zn.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...G(t)};return new Uu(r)}o(l,"object");var Mu=I("ZodMiniUnion",(e,t)=>{mr.init(e,t),Q.init(e,t)});function D(e,t){return new Mu({type:"union",options:e,...G(t)})}o(D,"union");var Lu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Vn.init(e,t),Q.init(e,t)});function je(e,t,r){return new Lu({type:"union",options:t,discriminator:e,...G(r)})}o(je,"discriminatedUnion");var ju=I("ZodMiniRecord",(e,t)=>{Hn.init(e,t),Q.init(e,t)});function O(e,t,r){return new ju({type:"record",keyType:e,valueType:t,...G(r)})}o(O,"record");var Fu=I("ZodMiniEnum",(e,t)=>{qn.init(e,t),Q.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 Fu({type:"enum",entries:r,...G(t)})}o(U,"_enum");var Bu=I("ZodMiniLiteral",(e,t)=>{Wn.init(e,t),Q.init(e,t)});function S(e,t){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o(S,"literal");var Zu=I("ZodMiniTransform",(e,t)=>{Gn.init(e,t),Q.init(e,t)});function Se(e){return new Zu({type:"transform",transform:e})}o(Se,"transform");var Vu=I("ZodMiniOptional",(e,t)=>{Kn.init(e,t),Q.init(e,t)});function y(e){return new Vu({type:"optional",innerType:e})}o(y,"optional");var Hu=I("ZodMiniNullable",(e,t)=>{Jn.init(e,t),Q.init(e,t)});function at(e){return new Hu({type:"nullable",innerType:e})}o(at,"nullable");var qu=I("ZodMiniPipe",(e,t)=>{Xn.init(e,t),Q.init(e,t)});function Ae(e,t){return new qu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Wu=I("ZodMiniCustom",(e,t)=>{Yn.init(e,t),Q.init(e,t)});function Ct(e,t){return go(Wu,e??(()=>!0),t)}o(Ct,"custom");var st={};mn(st,{bigint:()=>ec,boolean:()=>Qu,date:()=>tc,number:()=>Yu,string:()=>Xu});function Xu(e){return no(Dt,e)}o(Xu,"string");function Yu(e){return ao(yr,e)}o(Yu,"number");function Qu(e){return uo(hr,e)}o(Qu,"boolean");function ec(e){return co(vo,e)}o(ec,"bigint");function tc(e){return fo(_o,e)}o(tc,"date");var xr=l({retryOnFailure:l({defaultValue:y(V()),hide:y(V())}),continueOnFailure:l({defaultValue:y(V()),hide:y(V())})}),vr=class{constructor(t,r,n,i,s,c,d,f,h,x,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=T}static{o(this,"IAction")}},H=o(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=l({displayName:a(),description:y(a())}),C=o((e,t)=>l({type:S(t),required:V(),defaultValue:y(it())}),"TPropertyValue");var ue=l({...B.shape,...C(a(),"SHORT_TEXT").shape}),xe=l({...B.shape,...C(a(),"LONG_TEXT").shape});var bo=l({label:a(),value:k()}),Ut=l({disabled:y(V()),placeholder:y(a()),options:N(bo)});var ce=l({...B.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),_e=l({...B.shape,options:Ut,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),ut=l({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var Pe=l({...B.shape,...C(V(),"CHECKBOX").shape});var be=l({...B.shape,...C(re(),"NUMBER").shape});var ct=l({...B.shape,...C(k(),"FILE").shape});var lt=l({...B.shape,...C(a(),"DATE_TIME").shape});var Io=O(a(),D([ue,xe,ce,ut,_e,Pe,be,ct,lt])),pt=l({...B.shape,properties:Io,...C(N(k()),"ARRAY").shape});var dt=l({...B.shape,...C(D([O(a(),k())]),"JSON").shape});var Eo=D([ue,ce,dt,pt,_e]),nc=O(a(),Eo),Pr=l({refreshers:N(a()),...B.shape,...C(k(),"DYNAMIC").shape});var Mt=l({...B.shape,...C(xo(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Be=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Be||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),br="both_client_credentials_and_authorization_code";var ne=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ne||{}),gt=(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))(gt||{}),oc=l({strategy:U(gt),paramName:y(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),To=l({status:y(re()),body:y(k()),headers:y(O(a(),a()))}),$o=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Lt))}),So=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:To,handlerId:y(a()),streamStepProgress:y(U(Lt))}),ic=D([$o,So]);var ac=l({body:k(),rawBody:y(k()),headers:O(a(),a()),queryParams:O(a(),a())});function me(e){return e==null}o(me,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Ir=Ce(require("crypto"),1);var sc=128,Oe,Ze,uc=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*sc),Ir.default.randomFillSync(Oe),Ze=0):Ze+e>Oe.length&&(Ir.default.randomFillSync(Oe),Ze=0),Ze+=e},"fillPool"),cc=o(e=>(uc(e|=0),Oe.subarray(Ze-e,Ze)),"random"),lc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let d=r(i),f=i;for(;f--;)if(c+=e[d[f]&n]||"",c.length===s)return c}}},"customRandom"),zo=o((e,t=21)=>lc(e,t,cc),"customAlphabet");var pc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,hb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),dc=zo(pc,wo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),le={id:a(),created:ze,updated:ze},W=o(e=>y(at(e)),"Nullable");function Er(e){return y(at(U(e)))}o(Er,"NullableEnum");var _b=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(V())),Ft=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var Ib=O(a(),k());var vt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(vt||{});var Db=a().check($e(/^#[0-9A-Fa-f]{6}$/));var Ub=l({filename:a(),data:k(),type:S("file"),mimetype:y(a())});var mc=Ce(Oo());var Vb=l({...le,name:a(),permissions:N(a()),platformId:W(a()),type:a(),userCount:y(re())});var Ro=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ro||{}),Tr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Tr||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var fc=l({mode:U(Ro),value:k()}),gc=l({auth:y(a()),fields:O(a(),fc)}),yc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(gc)}),hc=l({type:S("PIECE"),toolName:a().check(de(1)),pieceMetadata:yc}),vc=l({type:S("none")}),xc=l({type:S("access_token"),accessToken:a()}),_c=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Pc=l({type:S("headers"),headers:O(a(),a())}),bc=je("type",[vc,xc,_c,Pc]),No=l({type:S("FLOW"),toolName:a().check(de(1)),externalFlowId:a(),flowDisplayName:y(a())}),Do=l({type:S("MCP"),toolName:a().check(de(1)),serverUrl:ho(),protocol:U($r),auth:bc}),Co=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(de(1)),sourceType:U(Tr),sourceId:a(),sourceName:a()}),Ic=je("type",[hc,No,Do,Co]),Ec=l({displayName:a(),description:y(a()),type:U(Sr)}),Uo=l({type:S("MARKDOWN"),markdown:a()}),Ve={type:S("TOOL_CALL"),input:W(O(a(),k())),output:y(k()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},hI=l(Ve),Mo=je("toolCallType",[l({...Ve,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ve,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ve,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Ve,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ve,toolCallType:S("UNKNOWN"),displayName:a()})]),Tc=D([Uo,Mo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),Ie=l({apiKey:a()}),$c=Ie,Sc=l({apiKey:a(),apiKeyHash:a()}),Ac=Ie,zc=Ie,wc=Ie,kc=Ie,Oc=Ie,Rc=Ie,Nc=Ie,Lo=l({accessKeyId:a().check(de(1)),secretAccessKey:a().check(de(1))}),Dc=l({}),Cc=l({}),Uc=l({}),Mc=l({}),Lc=l({}),jc=l({}),jo=l({modelId:a(),modelName:a(),modelType:U(zr)}),Fo=l({apiKeyHeader:a(),baseUrl:a(),models:N(jo),defaultHeaders:y(O(a(),a()))}),Bo=l({accountId:a(),gatewayId:a(),models:N(jo),vertexProject:y(a()),vertexRegion:y(a())}),Zo=l({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),Vo=l({region:a().check(de(1))}),Fc=D([$c,wc,kc,Oc,Rc,zc,Ac,Sc,Lo,Nc]),Ho=D([Fo,Bo,Zo,Vo,Dc,Uc,Mc,Lc,Cc,jc]),Bc=l({id:a(),name:a(),type:U(zr)}),Zc=l({id:a(),name:a(),provider:U(vt),config:Ho,enabledForChat:V()}),Vc=l({provider:U(vt),config:Ho,auth:Fc,platformId:a()});var PI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Hc=l({base64Url:a(),fileName:a(),extension:y(a())}),qc=l({mimeType:a(),url:a(),fileName:y(a())}),wr=D([Hc,qc]);var Wc=D([l({type:S("file"),value:wr}),l({type:S("markdown"),value:a(),files:y(N(wr))})]),Gc=l({sessionId:a(),message:a(),files:y(N(a()))});var Wo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Wo||{}),Go=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Go||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var Kc=D([l({...le,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...le,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Jc=l({...le,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:Er(Go),trigger:Er(Wo)}),Xc=l({...le,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Yc=l({events:N(U(kr)),webhookUrl:a(),flowId:a()}),Qc=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),el=l({projectId:a(),limit:y(st.number()),cursor:y(a()),name:y(a()),externalIds:Ft(a()),folderId:y(a()),folderIds:Ft(a())}),tl=l({records:N(N(l({fieldId:a(),value:Jo()}))),tableId:a()}),rl=l({cells:y(N(l({fieldId:a(),value:Jo()}))),tableId:a(),agentUpdate:y(V())}),Ko=je("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),qo("exists"),qo("not_exists")]),nl=l({tableId:a(),limit:y(st.number()),cursor:y(a()),filters:Ft(Ko)});function Jo(){return Ae(Se(e=>e==null?e:String(e)),at(a()))}o(Jo,"coerceToString");function Re(e){return l({fieldId:a(),operator:S(e),value:a()})}o(Re,"valueFilter");function qo(e){return l({fieldId:a(),operator:S(e)})}o(qo,"existenceFilter");var ol=l({status:y(re()),body:y(k()),headers:y(O(a(),a()))}),il=l({...le,deleted:W(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var Xo=l({name:a(),description:y(a()),type:a(),required:V()}),al=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(Xo),returnsResponse:V()})});var Yo="^[0-9]+\\.[0-9]+\\.[0-9]+$",jI=new RegExp(Yo),ul="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",FI=a().check($e(new RegExp(Yo))),BI=a().check($e(new RegExp(ul))),cl=l({packageType:S("ARCHIVE"),pieceType:U(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Qo=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ei=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),ZI=D([Qo,ei]),VI=D([cl,Qo,ei]),ti=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ti||{}),ll=l({type:U(ti),cronExpression:a(),timezone:a()}),HI=l({...le,type:U(ne),projectId:a(),flowId:a(),triggerName:a(),schedule:W(ll),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:V()}),ri=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(ri||{}),ni=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ni||{}),oi=(r=>(r.S3="S3",r.DB="DB",r))(oi||{}),qI=l({...le,projectId:W(a()),platformId:W(a()),type:U(ri),compression:U(ni),data:y(k()),location:U(oi),size:W(re()),fileName:W(a()),s3Key:W(a()),metadata:W(O(a(),a()))}),ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ii||{}),ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ai||{}),WI=l({id:a(),email:a(),firstName:a(),status:U(ai),externalId:W(a()),platformId:W(a()),platformRole:U(ii),lastName:a(),created:ze,updated:ze,lastActiveDate:W(ze),imageUrl:W(a())});var Or=l({...B.shape,...C(O(a(),k()),"OBJECT").shape});var li=l({...B.shape,...C(a(),"COLOR").shape});var Rr=D([ue,xe,Mt,Pe,ce,_e,_r,ut,Pr,be,pt,Or,dt,lt,ct,li]),P={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var ye=l({displayName:a(),description:y(a())});var pi=l({username:a(),password:a()}),Nr=l({...ye.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(pi,"BASIC_AUTH").shape});var fl=O(a(),D([ue,xe,be,Pe,ce])),Dr=l({...ye.shape,props:fl,...C(k(),"CUSTOM_AUTH").shape});var Ne=l({...ye.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var gl=O(a(),D([ue,xe,Ne,be,Pe,ce,_e,Mt])),di=l({...ye.shape,props:gl,...C(k(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),mi=D([ue,Ne,ce]),fi=O(a(),mi),yl=l({props:y(O(a(),mi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(V()),pkceMethod:y(D([S("plain"),S("S256")])),authorizationMethod:y(U(Cr)),grantType:y(D([U(ft),S(br)])),extra:y(O(a(),a()))}),gi=l({access_token:a(),props:y(fi),data:O(a(),it())}),Ur=l({...ye.shape,...yl.shape,...C(gi,"OAUTH2").shape});var He=D([Nr,Dr,di,Ur,Ne]),xt="Connection",Mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var TT={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 hl=l({...B.shape,...C(k(),"CUSTOM").shape,code:a()});var vl=D([Rr,He]),Lr=O(a(),vl),HT=O(a(),Rr);var yi=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]),qe=class{constructor(t,r,n,i,s,c,d,f,h,x,T,_,u,p,g,m,v,b,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=d;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=T;this.onDisable=_;this.onStart=u;this.run=p;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=j}static{o(this,"ITrigger")}},oe=o(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,me(e.sampleData)&&me(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var hi="2",Zt="0.82.0";var jr=class{constructor(t,r,n,i,s,c,d,f,h=Zt,x,T=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=T;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:hi}),"getContextInfo");(!xl(h)||_l(h,Zt))&&(this.minimumSupportedRelease=Zt),s.forEach(_=>this._actions[_.name]=_),c.forEach(_=>this._triggers[_.name]=_)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},vi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new jr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function xl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(xl,"isValidSimpleSemver");function _l(e,t){let[r,n,i]=e.split(".").map(Number),[s,c,d]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<d}o(_l,"isSemverLessThan");var Pl=y(O(a(),O(a(),a()))),xi=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([He,N(He)])),version:a(),categories:y(N(U(Be))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:Pl}),bl=U(["human","ai","both"]),_i=l({description:y(a()),idempotent:y(V())}),Pi=l({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:V(),errorHandlingOptions:y(xr),outputSchema:y(Ct()),audience:y(bl),aiMetadata:y(_i)}),bi=l({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:y(xr),type:U(ne),sampleData:k(),handshakeConfiguration:y(Ct()),renewConfiguration:y(yi),testStrategy:U(yt),outputSchema:y(Ct()),aiMetadata:y(_i)}),Il=l({...xi.shape,actions:O(a(),Pi),triggers:O(a(),bi)}),El=l({...xi.shape,actions:re(),triggers:re(),suggestedActions:y(N(bi)),suggestedTriggers:y(N(Pi))}),Ii=l({projectUsage:re(),tags:y(N(a())),pieceType:U(Fe),packageType:U(mt),platformId:y(a()),archiveId:y(a())}),H$=l({...Il.shape,...Ii.shape}),q$=l({...El.shape,...Ii.shape}),W$=l({name:a(),version:a()});var Tl=Ce(require("path")),$l=Ce(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}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 Ht=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var qt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Wt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ht){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,se]of Object.entries(c))i.append(j,se);let d=i.toString(),f=d?`${n}?${d}`:n,h=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:_,extraHeaders:u,isStream:p}=Sl(t.body,s),g=zl({...s,...u}),m=await Al(async()=>{let j=new AbortController,se=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let pe={method:t.method.toString(),headers:g,body:_,redirect:x?"follow":"manual",signal:j.signal};return p&&(pe.duplex="half"),r?.dispatcher!==void 0&&(pe.dispatcher=r.dispatcher),await fetch(f,pe)}finally{se!==void 0&&clearTimeout(se)}},T),v=x?300:400;if(m.status<200||m.status>=v){let j=await Ei(m,h),se=new qt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",se),se}let b=await Ei(m,h);return{status:m.status,headers:wl(m.headers),body:b}}};function Sl(e,t){return Ol(e)?{body:void 0,extraHeaders:{},isStream:!1}:kl(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}}o(Sl,"serializeBody");async function Ei(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}}}}o(Ei,"parseResponseBody");async function Al(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ti(n);continue}return i}catch(i){if(r=i,n<t){await Ti(n);continue}throw i}throw r}o(Al,"sendWithRetries");function Ti(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ti,"backoff");function zl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(zl,"normalizeHeaders");function wl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(wl,"toHttpHeaders");function kl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(kl,"isNodeFormData");function Ol(e){return e==null}o(Ol,"isNil");var Z=new Wt;var te=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(te||{});var xd=Ce(require("fs")),ks=Ce(ws());var _d={"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 Pd(e){let t=e.split(";")[0].trim().toLowerCase();return _d[t]??""}o(Pd,"contentTypeToExtension");var bd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Id=o((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 Os({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:d,authLocation:f="headers"}){return H({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:P.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:P.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
1
|
+
"use strict";var mu=Object.create;var et=Object.defineProperty;var fu=Object.getOwnPropertyDescriptor;var gu=Object.getOwnPropertyNames;var yu=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty;var o=(e,t)=>et(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},yn=(e,t)=>{for(var r in t)et(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gu(t))!hu.call(e,i)&&i!==r&&et(e,i,{get:()=>t[i],enumerable:!(n=fu(t,i))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?mu(yu(e)):{},hn(t||!e||!e.__esModule?et(r,"default",{value:e,enumerable:!0}):r,e)),vu=e=>hn(et({},"__esModule",{value:!0}),e);var Fo=S((jo,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"),i=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 f(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let g=0,m=-1,v=(u.match(l.zoneIndex)||[])[0],b,j;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)g++;if(u.substr(0,2)==="::"&&g--,u.substr(-2,2)==="::"&&g--,g>d)return null;for(j=d-g,b=":";j--;)b+="0:";return u=u.replace("::",b),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let se=u.split(":"),de=[];for(let Qe=0;Qe<se.length;Qe++)de.push(parseInt(se[Qe],16));return de})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(u,d,g,m){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=g-m,b<0&&(b=0),u[v]>>b!==d[v]>>b)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function x(u){if(i.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)}o(x,"parseIntAuto");function T(u,d){for(;u.length<d;)u=`0${u}`;return u}o(T,"padPart");let P={};P.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(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,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,j;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(j=m[b],g&&j!==0)return null;j!==8&&(g=!0),d+=j}else return null;return 32-d},u.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),P.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(u){return this.parser(u)!==null},P.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(u){return!!(P.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(u)||!d?!1:P.IPv4.isValidFourPartDecimal(d[1])},P.IPv4.networkAddressFromCIDR=function(u){let d,g,m,v,b;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.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)},P.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(u){let d,g,m;if(d=u.match(r.fourOctet))return(function(){let v=d.slice(1,6),b=[];for(let j=0;j<v.length;j++)g=v[j],b.push(x(g));return b})();if(d=u.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let v=d.slice(1,4),b=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=u.match(r.threeOctet))?(function(){let v=d.slice(1,5),b=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(v[0])),b.push(x(v[1])),b.push(m>>8&255),b.push(m&255),b})():null},P.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],g=0,m=Math.floor(u/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},P.IPv6=(function(){function u(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(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,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(b=m[v],g&&b!==0)return null;b!==16&&(g=!0),d+=b}else return null;return 128-d},u.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},u.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},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),g=d[0],m=d[1];return new P.IPv4([g>>8,g&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,b;for(;b=d.exec(g);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),P.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},P.IPv6.isIPv6=function(u){return this.parser(u)!==null},P.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}},P.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(u){let d,g,m,v,b;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},P.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)},P.IPv6.parseCIDR=function(u){let d,g,m;if((g=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(u){let d,g,m,v,b,j;if(m=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(u))return f(u,8);if((m=u.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<b.length;g++)if(v=b[g],!(0<=v&&v<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},P.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],g=0,m=Math.floor(u/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},P.fromByteArray=function(u){let d=u.length;if(d===4)return new P.IPv4(u);if(d===16)return new P.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(u){return P.IPv6.isValid(u)||P.IPv4.isValid(u)},P.isValidCIDR=function(u){return P.IPv6.isValidCIDR(u)||P.IPv4.isValidCIDR(u)},P.parse=function(u){if(P.IPv6.isValid(u))return P.IPv6.parse(u);if(P.IPv4.isValid(u))return P.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(u){try{return P.IPv6.parseCIDR(u)}catch{try{return P.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},P.subnetMatch=function(u,d,g){let m,v,b,j;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(b=d[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(j=b[m],u.kind()===j[0].kind()&&u.match.apply(u,j))return v}return g},typeof qt<"u"&&qt.exports?qt.exports=P:e.ipaddr=P})(jo)});var Bi=S((CA,Fi)=>{var ji=require("stream").Stream,ep=require("util");Fi.exports=fe;function fe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(fe,"DelayedStream");ep.inherits(fe,ji);fe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(fe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});fe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};fe.prototype.resume=function(){this._released||this.release(),this.source.resume()};fe.prototype.pause=function(){this.source.pause()};fe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};fe.prototype.pipe=function(){var e=ji.prototype.pipe.apply(this,arguments);return this.resume(),e};fe.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)};fe.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=S((MA,Hi)=>{var tp=require("util"),Zi=require("stream").Stream,Vi=Bi();Hi.exports=X;function X(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(X,"CombinedStream");tp.inherits(X,Zi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Vi)){var r=Vi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return Zi.prototype.pipe.call(this,e,t),this.resume(),e};X.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};X.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Gi=S((jA,Wi)=>{"use strict";Wi.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 Xi=S(ie=>{"use strict";var Xt=Gi(),rp=require("path").extname,Ki=/^\s*([^;\s]*)(?:;|\s|$)/,np=/^text\//i;ie.charset=Ji;ie.charsets={lookup:Ji};ie.contentType=op;ie.extension=ip;ie.extensions=Object.create(null);ie.lookup=ap;ie.types=Object.create(null);sp(ie.extensions,ie.types);function Ji(e){if(!e||typeof e!="string")return!1;var t=Ki.exec(e),r=t&&Xt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&np.test(t[1])?"UTF-8":!1}o(Ji,"charset");function op(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ie.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ie.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(op,"contentType");function ip(e){if(!e||typeof e!="string")return!1;var t=Ki.exec(e),r=t&&ie.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ip,"extension");function ap(e){if(!e||typeof e!="string")return!1;var t=rp("x."+e).toLowerCase().substr(1);return t&&ie.types[t]||!1}o(ap,"lookup");function sp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Xt).forEach(o(function(i){var s=Xt[i],c=s.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(Xt[t[f]].source),x=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>x||h===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(sp,"populateMaps")});var Qi=S((VA,Yi)=>{Yi.exports=up;function up(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(up,"defer")});var qr=S((HA,ta)=>{var ea=Qi();ta.exports=cp;function cp(e){var t=!1;return ea(function(){t=!0}),o(function(n,i){t?e(n,i):ea(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(cp,"async")});var Wr=S((WA,ra)=>{ra.exports=lp;function lp(e){Object.keys(e.jobs).forEach(pp.bind(e)),e.jobs={}}o(lp,"abort");function pp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(pp,"clean")});var Gr=S((KA,oa)=>{var na=qr(),dp=Wr();oa.exports=mp;function mp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=fp(t,i,e[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?dp(r):r.results[i]=c,n(s,r.results))})}o(mp,"iterate");function fp(e,t,r,n){var i;return e.length==2?i=e(r,na(n)):i=e(r,t,na(n)),i}o(fp,"runJob")});var Kr=S((XA,ia)=>{ia.exports=gp;function gp(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(i,s){return t(e[i],e[s])}),n}o(gp,"state")});var Jr=S((QA,aa)=>{var yp=Wr(),hp=qr();aa.exports=vp;function vp(e){Object.keys(this.jobs).length&&(this.index=this.size,yp(this),hp(e)(null,this.results))}o(vp,"terminator")});var ua=S((tz,sa)=>{var xp=Gr(),_p=Kr(),Pp=Jr();sa.exports=bp;function bp(e,t,r){for(var n=_p(e);n.index<(n.keyedList||e).length;)xp(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Pp.bind(n,r)}o(bp,"parallel")});var Xr=S((nz,Yt)=>{var ca=Gr(),Ep=Kr(),Ip=Jr();Yt.exports=Tp;Yt.exports.ascending=la;Yt.exports.descending=Sp;function Tp(e,t,r,n){var i=Ep(e,r);return ca(e,t,i,o(function s(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){ca(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),Ip.bind(i,n)}o(Tp,"serialOrdered");function la(e,t){return e<t?-1:e>t?1:0}o(la,"ascending");function Sp(e,t){return-1*la(e,t)}o(Sp,"descending")});var da=S((iz,pa)=>{var $p=Xr();pa.exports=Ap;function Ap(e,t,r){return $p(e,t,null,r)}o(Ap,"serial")});var fa=S((sz,ma)=>{ma.exports={parallel:ua(),serial:da(),serialOrdered:Xr()}});var Yr=S((uz,ga)=>{"use strict";ga.exports=Object});var ha=S((cz,ya)=>{"use strict";ya.exports=Error});var xa=S((lz,va)=>{"use strict";va.exports=EvalError});var Pa=S((pz,_a)=>{"use strict";_a.exports=RangeError});var Ea=S((dz,ba)=>{"use strict";ba.exports=ReferenceError});var Ta=S((mz,Ia)=>{"use strict";Ia.exports=SyntaxError});var Qt=S((fz,Sa)=>{"use strict";Sa.exports=TypeError});var Aa=S((gz,$a)=>{"use strict";$a.exports=URIError});var wa=S((yz,za)=>{"use strict";za.exports=Math.abs});var Oa=S((hz,ka)=>{"use strict";ka.exports=Math.floor});var Na=S((vz,Ra)=>{"use strict";Ra.exports=Math.max});var Ca=S((xz,Da)=>{"use strict";Da.exports=Math.min});var Ma=S((_z,Ua)=>{"use strict";Ua.exports=Math.pow});var ja=S((Pz,La)=>{"use strict";La.exports=Math.round});var Ba=S((bz,Fa)=>{"use strict";Fa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Za=S((Iz,Va)=>{"use strict";var zp=Ba();Va.exports=o(function(t){return zp(t)||t===0?t:t<0?-1:1},"sign")});var qa=S((Sz,Ha)=>{"use strict";Ha.exports=Object.getOwnPropertyDescriptor});var Qr=S(($z,Wa)=>{"use strict";var er=qa();if(er)try{er([],"length")}catch{er=null}Wa.exports=er});var Ka=S((Az,Ga)=>{"use strict";var tr=Object.defineProperty||!1;if(tr)try{tr({},"a",{value:1})}catch{tr=!1}Ga.exports=tr});var en=S((zz,Ja)=>{"use strict";Ja.exports=o(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 i=42;t[r]=i;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!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Qa=S((kz,Ya)=>{"use strict";var Xa=typeof Symbol<"u"&&Symbol,wp=en();Ya.exports=o(function(){return typeof Xa!="function"||typeof Symbol!="function"||typeof Xa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:wp()},"hasNativeSymbols")});var tn=S((Rz,es)=>{"use strict";es.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var rn=S((Nz,ts)=>{"use strict";var kp=Yr();ts.exports=kp.getPrototypeOf||null});var os=S((Dz,ns)=>{"use strict";var Op="Function.prototype.bind called on incompatible ",Rp=Object.prototype.toString,Np=Math.max,Dp="[object Function]",rs=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Cp=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Up=o(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");ns.exports=o(function(t){var r=this;if(typeof r!="function"||Rp.apply(r)!==Dp)throw new TypeError(Op+r);for(var n=Cp(arguments,1),i,s=o(function(){if(this instanceof i){var x=r.apply(this,rs(n,arguments));return Object(x)===x?x:this}return r.apply(t,rs(n,arguments))},"binder"),c=Np(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Up(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ge=S((Uz,is)=>{"use strict";var Mp=os();is.exports=Function.prototype.bind||Mp});var rr=S((Mz,as)=>{"use strict";as.exports=Function.prototype.call});var nn=S((Lz,ss)=>{"use strict";ss.exports=Function.prototype.apply});var cs=S((jz,us)=>{"use strict";us.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ps=S((Fz,ls)=>{"use strict";var Lp=Ge(),jp=nn(),Fp=rr(),Bp=cs();ls.exports=Bp||Lp.call(Fp,jp)});var ms=S((Bz,ds)=>{"use strict";var Vp=Ge(),Zp=Qt(),Hp=rr(),qp=ps();ds.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Zp("a function is required");return qp(Vp,Hp,t)},"callBindBasic")});var xs=S((Zz,vs)=>{"use strict";var Wp=ms(),fs=Qr(),ys;try{ys=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var on=!!ys&&fs&&fs(Object.prototype,"__proto__"),hs=Object,gs=hs.getPrototypeOf;vs.exports=on&&typeof on.get=="function"?Wp([on.get]):typeof gs=="function"?o(function(t){return gs(t==null?t:hs(t))},"getDunder"):!1});var Is=S((qz,Es)=>{"use strict";var _s=tn(),Ps=rn(),bs=xs();Es.exports=_s?o(function(t){return _s(t)},"getProto"):Ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ps(t)},"getProto"):bs?o(function(t){return bs(t)},"getProto"):null});var an=S((Gz,Ts)=>{"use strict";var Gp=Function.prototype.call,Kp=Object.prototype.hasOwnProperty,Jp=Ge();Ts.exports=Jp.call(Gp,Kp)});var Os=S((Kz,ks)=>{"use strict";var L,Xp=Yr(),Yp=ha(),Qp=xa(),ed=Pa(),td=Ea(),Ye=Ta(),Xe=Qt(),rd=Aa(),nd=wa(),od=Oa(),id=Na(),ad=Ca(),sd=Ma(),ud=ja(),cd=Za(),zs=Function,sn=o(function(e){try{return zs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=Qr(),ld=Ka(),un=o(function(){throw new Xe},"throwTypeError"),pd=bt?(function(){try{return arguments.callee,un}catch{try{return bt(arguments,"callee").get}catch{return un}}})():un,Ke=Qa()(),ee=Is(),dd=rn(),md=tn(),ws=nn(),Et=rr(),Je={},fd=typeof Uint8Array>"u"||!ee?L:ee(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&ee?ee([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Yp,"%eval%":eval,"%EvalError%":Qp,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":zs,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&ee?ee(ee([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!ee?L:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Xp,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":ed,"%ReferenceError%":td,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!ee?L:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&ee?ee(""[Symbol.iterator]()):L,"%Symbol%":Ke?Symbol:L,"%SyntaxError%":Ye,"%ThrowTypeError%":pd,"%TypedArray%":fd,"%TypeError%":Xe,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":rd,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":Et,"%Function.prototype.apply%":ws,"%Object.defineProperty%":ld,"%Object.getPrototypeOf%":dd,"%Math.abs%":nd,"%Math.floor%":od,"%Math.max%":id,"%Math.min%":ad,"%Math.pow%":sd,"%Math.round%":ud,"%Math.sign%":cd,"%Reflect.getPrototypeOf%":md};if(ee)try{null.error}catch(e){Ss=ee(ee(e)),Me["%Error.prototype%"]=Ss}var Ss,gd=o(function e(t){var r;if(t==="%AsyncFunction%")r=sn("async function () {}");else if(t==="%GeneratorFunction%")r=sn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=sn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return Me[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=Ge(),nr=an(),yd=It.call(Et,Array.prototype.concat),hd=It.call(ws,Array.prototype.splice),As=It.call(Et,String.prototype.replace),or=It.call(Et,String.prototype.slice),vd=It.call(Et,RegExp.prototype.exec),xd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_d=/\\(\\)?/g,Pd=o(function(t){var r=or(t,0,1),n=or(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 i=[];return As(t,xd,function(s,c,l,f){i[i.length]=l?As(f,_d,"$1"):c||s}),i},"stringToPath"),bd=o(function(t,r){var n=t,i;if(nr($s,n)&&(i=$s[n],n="%"+i[0]+"%"),nr(Me,n)){var s=Me[n];if(s===Je&&(s=gd(n)),typeof s>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ks.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(vd(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Pd(t),i=n.length>0?n[0]:"",s=bd("%"+i+"%",r),c=s.name,l=s.value,f=!1,h=s.alias;h&&(i=h[0],hd(n,yd([0,1],h)));for(var x=1,T=!0;x<n.length;x+=1){var P=n[x],u=or(P,0,1),d=or(P,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ye("property names with quotes must have matching quotes");if((P==="constructor"||!T)&&(f=!0),i+="."+P,c="%"+i+"%",nr(Me,c))l=Me[c];else if(l!=null){if(!(P in l)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&x+1>=n.length){var g=bt(l,P);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[P]}else T=nr(l,P),l=l[P];T&&!f&&(Me[c]=l)}}return l},"GetIntrinsic")});var Ns=S((Xz,Rs)=>{"use strict";var Ed=en();Rs.exports=o(function(){return Ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Us=S((Qz,Cs)=>{"use strict";var Id=Os(),Ds=Id("%Object.defineProperty%",!0),Td=Ns()(),Sd=an(),$d=Qt(),ir=Td?Symbol.toStringTag:null;Cs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new $d("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ir&&(n||!Sd(t,ir))&&(Ds?Ds(t,ir,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ir]=r)},"setToStringTag")});var Ls=S((tw,Ms)=>{"use strict";var Ad=Function.prototype.call,zd=Object.prototype.hasOwnProperty,wd=Ge();Ms.exports=wd.call(Ad,zd)});var Fs=S((rw,js)=>{"use strict";js.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Zs=S((nw,Vs)=>{"use strict";var dn=qi(),kd=require("util"),cn=require("path"),Od=require("http"),Rd=require("https"),Nd=require("url").parse,Dd=require("fs"),Cd=require("stream").Stream,Ud=require("crypto"),ln=Xi(),Md=fa(),Ld=Us(),Ne=Ls(),pn=Fs();function Bs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Bs,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],dn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");kd.inherits(F,dn);F.LINE_BREAK=`\r
|
|
2
|
+
`;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=dn.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 i=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ne(t,"httpVersion"))&&!(t instanceof Cd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.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)):Dd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):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")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Bs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(c,r.header);var l;for(var f in c)if(Ne(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=f+": "+l.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=cn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=cn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ne(e,"httpVersion")&&(r=cn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Bs(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&Ne(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ne(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ud.randomBytes(12).toString("hex")};F.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Md.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Nd(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Rd.request(n):r=Od.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,f=o(function(h,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,x)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};Ld(F.prototype,"FormData");Vs.exports=F});var tm={};yn(tm,{ReachinboxAuth:()=>M,reachinbox:()=>em});module.exports=vu(tm);var xu=Object.freeze({status:"aborted"});function E(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,x=Object.keys(h);for(let T=0;T<x.length;T++){let P=x[T];P in l||(l[P]=h[P].bind(l))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var f;let h=r?.Parent?new s:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(E,"$constructor");var ge=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},sr={};function xe(e){return e&&Object.assign(sr,e),sr}o(xe,"config");function cr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(cr,"getEnumValues");function xn(e,t){return typeof t=="bigint"?t.toString():t}o(xn,"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")}}}o(At,"cached");function _n(e){return e==null}o(_n,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var vn=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function tt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(tt,"isObject");var _u=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pn(e){if(tt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(tt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pn,"isPlainObject");var bn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"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}o(wt,"clone");function W(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>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:o(()=>t.error,"error")}:t}o(W,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var In={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 Fe(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}o(Fe,"aborted");function Se(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Se,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function $e(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o($e,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function pr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(pr,"issue");var Sn=o((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,xn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$n=E("$ZodError",Sn),rt=E("$ZodError",Sn,{Parent:Error});var bu=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new ge;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>$e(f,s,xe())));throw lr(l,i?.callee),l}return c.value},"_parse"),kt=bu(rt),Eu=o(e=>async(t,r,n,i)=>{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(i?.Err??e)(c.issues.map(f=>$e(f,s,xe())));throw lr(l,i?.callee),l}return c.value},"_parseAsync"),Ot=Eu(rt),Iu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new ge;return s.issues.length?{success:!1,error:new(e??$n)(s.issues.map(c=>$e(c,i,xe())))}:{success:!0,data:s.value}},"_safeParse"),nt=Iu(rt),Tu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>$e(c,i,xe())))}:{success:!0,data:s.value}},"_safeParseAsync"),ot=Tu(rt);var Su="(?:(?:\\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])))",$u=new RegExp(`^${Su}$`);var An=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zn=/^-?\d+n?$/,wn=/^-?\d+$/,dr=/^-?\d+(?:\.\d+)?$/,kn=/^(?:true|false)$/i;var Ae=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Au={number:"number",bigint:"bigint",object:"date"};var On=E("$ZodCheckGreaterThan",(e,t)=>{Ae.init(e,t);let r=Au[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.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 Rn=E("$ZodCheckNumberFormat",(e,t)=>{Ae.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=In[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=s,r&&(l.pattern=wn)}),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<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,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 Nn=E("$ZodCheckMinLength",(e,t)=>{var r;Ae.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!_n(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var mr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Ae.init(e,t),e._zod.onattach.push(i=>{let s=i._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=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Dn=E("$ZodCheckRegex",(e,t)=>{mr.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 K=E("$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 i of n)for(let s of i._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 i=o((c,l,f)=>{let h=Fe(c),x;for(let T of l){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(h)continue;let P=c.issues.length,u=T._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new ge;if(x||u instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await u,c.issues.length!==P&&(h||(h=Fe(c,P)))});else{if(c.issues.length===P)continue;h||(h=Fe(c,P))}}return x?x.then(()=>c):c},"runChecks"),s=o((c,l,f)=>{if(Fe(c))return c.aborted=!0,c;let h=i(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new ge;return h.then(x=>e._zod.parse(x,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>s(x,c,l)):s(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ge;return f.then(h=>i(h,n,l))}return i(f,n,l)}}Y(e,"~standard",()=>({validate:o(i=>{try{let s=nt(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ot(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Dt=E("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??An(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}}),fr=E("$ZodStringFormat",(e,t)=>{mr.init(e,t),Dt.init(e,t)});var Bn=E("$ZodURL",(e,t)=>{fr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var gr=E("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??dr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}}),Vn=E("$ZodNumberFormat",(e,t)=>{Rn.init(e,t),gr.init(e,t)}),yr=E("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=kn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Zn=E("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=zn,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=E("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),qn=E("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var Wn=E("$ZodVoid",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Gn=E("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Se(r,e.issues)),t.value[r]=e.value}o(Mn,"handleArrayResult");var Kn=E("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?s.push(f.then(h=>Mn(h,r,c))):Mn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Nt(e,t,r,n,i){if(e.issues.length){if(i&&!(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}o(Nt,"handlePropertyResult");function zu(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=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(zu,"normalizeDef");function wu(e,t,r,n,i,s){let c=[],l=i.keySet,f=i.catchall._zod,h=f.def.type,x=f.optout==="optional";for(let T in t){if(l.has(T))continue;if(h==="never"){c.push(T);continue}let P=f.run({value:t[T],issues:[]},n);P instanceof Promise?e.push(P.then(u=>Nt(u,r,T,t,x))):Nt(P,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(wu,"handleCatchall");var Jn=E("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=At(()=>zu(t));Y(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let x=l[h]._zod;if(x.values){f[h]??(f[h]=new Set);for(let T of x.values)f[h].add(T)}}return f});let i=tt,s=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],T=c.shape;for(let P of c.keys){let u=T[P],d=u._zod.optout==="optional",g=u._zod.run({value:h[P],issues:[]},f);g instanceof Promise?x.push(g.then(m=>Nt(m,l,P,h,d))):Nt(g,l,P,h,d)}return s?wu(x,h,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Ln(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Fe(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>$e(c,n,xe())))}),t)}o(Ln,"handleUnionResults");var hr=E("$ZodUnion",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>zt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},s);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Ln(f,i,e,s)):Ln(l,i,e,s)}});var Xn=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let i={};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,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of f)i[l].add(h)}}return i});let n=At(()=>{let i=t.options,s=new Map;for(let c of i){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 f of l){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(i,s)=>{let c=i.value;if(!tt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Yn=E("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Pn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?s.push(x.then(T=>{T.issues.length&&r.issues.push(...Se(h,T.issues)),r.value[h]=T.value})):(x.issues.length&&r.issues.push(...Se(h,x.issues)),r.value[h]=x.value)}let f;for(let h in i)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&dr.test(l)&&f.issues.length){let T=t.keyType._zod.run({value:Number(l),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>$e(T,n,xe())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?s.push(x.then(T=>{T.issues.length&&r.issues.push(...Se(l,T.issues)),r.value[f.value]=T.value})):(x.issues.length&&r.issues.push(...Se(l,x.issues)),r.value[f.value]=x.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Qn=E("$ZodEnum",(e,t)=>{K.init(e,t);let r=cr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>bn.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),eo=E("$ZodLiteral",(e,t)=>{if(K.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var to=E("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ge;return r.value=i,r}});function jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(jn,"handleOptionalResult");var ro=E("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>jn(s,r.value)):jn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=E("$ZodNullable",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var oo=E("$ZodPipe",(e,t)=>{K.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let 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 i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Rt(s,t.out,n)):Rt(i,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)}o(Rt,"handlePipeResult");var io=E("$ZodCustom",(e,t)=>{Ae.init(e,t),K.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>Fn(s,r,n,e));Fn(i,r,n,e)}});function Fn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(pr(i))}}o(Fn,"handleRefineResult");var so;var vr=class{static{o(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 i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function uo(){return new vr}o(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var xr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...W(t)})}o(co,"_string");function lo(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(lo,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(po,"_url");function mo(e,t){return new e({type:"number",checks:[],...W(t)})}o(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(fo,"_coercedNumber");function go(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...W(t)})}o(go,"_int");function yo(e,t){return new e({type:"boolean",...W(t)})}o(yo,"_boolean");function ho(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(ho,"_coercedBoolean");function vo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(vo,"_coercedBigint");function xo(e){return new e({type:"any"})}o(xo,"_any");function _o(e){return new e({type:"unknown"})}o(_o,"_unknown");function Po(e,t){return new e({type:"void",...W(t)})}o(Po,"_void");function bo(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(bo,"_coercedDate");function Ct(e,t){return new On({check:"greater_than",...W(t),value:e,inclusive:!0})}o(Ct,"_gte");function me(e,t){return new Nn({check:"min_length",...W(t),minimum:e})}o(me,"_minLength");function ze(e,t){return new Dn({check:"string_format",format:"regex",...W(t),pattern:e})}o(ze,"_regex");function Eo(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var Q=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>nt(e,r,n),e.parseAsync=async(r,n)=>Ot(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ot(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>wt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=E("ZodMiniString",(e,t)=>{Dt.init(e,t),Q.init(e,t)});function a(e){return co(Mt,e)}o(a,"string");var Io=E("ZodMiniStringFormat",(e,t)=>{fr.init(e,t),Mt.init(e,t)});var Vu=E("ZodMiniURL",(e,t)=>{Bn.init(e,t),Io.init(e,t)});function To(e){return po(Vu,e)}o(To,"url");var Lt=E("ZodMiniNumber",(e,t)=>{gr.init(e,t),Q.init(e,t)});function re(e){return mo(Lt,e)}o(re,"number");var Zu=E("ZodMiniNumberFormat",(e,t)=>{Vn.init(e,t),Lt.init(e,t)});function So(e){return go(Zu,e)}o(So,"int");var _r=E("ZodMiniBoolean",(e,t)=>{yr.init(e,t),Q.init(e,t)});function Z(e){return yo(_r,e)}o(Z,"boolean");var $o=E("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),Q.init(e,t)});var Hu=E("ZodMiniAny",(e,t)=>{Hn.init(e,t),Q.init(e,t)});function at(){return xo(Hu)}o(at,"any");var qu=E("ZodMiniUnknown",(e,t)=>{qn.init(e,t),Q.init(e,t)});function k(){return _o(qu)}o(k,"unknown");var Wu=E("ZodMiniVoid",(e,t)=>{Wn.init(e,t),Q.init(e,t)});function Ao(e){return Po(Wu,e)}o(Ao,"_void");var zo=E("ZodMiniDate",(e,t)=>{Gn.init(e,t),Q.init(e,t)});var Gu=E("ZodMiniArray",(e,t)=>{Kn.init(e,t),Q.init(e,t)});function N(e,t){return new Gu({type:"array",element:e,...W(t)})}o(N,"array");var Ku=E("ZodMiniObject",(e,t)=>{Jn.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...W(t)};return new Ku(r)}o(p,"object");var Ju=E("ZodMiniUnion",(e,t)=>{hr.init(e,t),Q.init(e,t)});function D(e,t){return new Ju({type:"union",options:e,...W(t)})}o(D,"union");var Xu=E("ZodMiniDiscriminatedUnion",(e,t)=>{Xn.init(e,t),Q.init(e,t)});function we(e,t,r){return new Xu({type:"union",options:t,discriminator:e,...W(r)})}o(we,"discriminatedUnion");var Yu=E("ZodMiniRecord",(e,t)=>{Yn.init(e,t),Q.init(e,t)});function O(e,t,r){return new Yu({type:"record",keyType:e,valueType:t,...W(r)})}o(O,"record");var Qu=E("ZodMiniEnum",(e,t)=>{Qn.init(e,t),Q.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 Qu({type:"enum",entries:r,...W(t)})}o(U,"_enum");var ec=E("ZodMiniLiteral",(e,t)=>{eo.init(e,t),Q.init(e,t)});function $(e,t){return new ec({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o($,"literal");var tc=E("ZodMiniTransform",(e,t)=>{to.init(e,t),Q.init(e,t)});function ke(e){return new tc({type:"transform",transform:e})}o(ke,"transform");var rc=E("ZodMiniOptional",(e,t)=>{ro.init(e,t),Q.init(e,t)});function y(e){return new rc({type:"optional",innerType:e})}o(y,"optional");var nc=E("ZodMiniNullable",(e,t)=>{no.init(e,t),Q.init(e,t)});function st(e){return new nc({type:"nullable",innerType:e})}o(st,"nullable");var oc=E("ZodMiniPipe",(e,t)=>{oo.init(e,t),Q.init(e,t)});function Oe(e,t){return new oc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var ic=E("ZodMiniCustom",(e,t)=>{io.init(e,t),Q.init(e,t)});function jt(e,t){return Eo(ic,e??(()=>!0),t)}o(jt,"custom");var ut={};yn(ut,{bigint:()=>pc,boolean:()=>lc,date:()=>dc,number:()=>cc,string:()=>uc});function uc(e){return lo(Mt,e)}o(uc,"string");function cc(e){return fo(Lt,e)}o(cc,"number");function lc(e){return ho(_r,e)}o(lc,"boolean");function pc(e){return vo($o,e)}o(pc,"bigint");function dc(e){return bo(zo,e)}o(dc,"date");var br=p({retryOnFailure:p({defaultValue:y(Z()),hide:y(Z())}),continueOnFailure:p({defaultValue:y(Z()),hide:y(Z())})}),Pr=class{constructor(t,r,n,i,s,c,l,f,h,x,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=x;this.aiMetadata=T}static{o(this,"IAction")}},H=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=p({displayName:a(),description:y(a())}),C=o((e,t)=>p({type:$(t),required:Z(),defaultValue:y(at())}),"TPropertyValue");var ue=p({...B.shape,...C(a(),"SHORT_TEXT").shape}),_e=p({...B.shape,...C(a(),"LONG_TEXT").shape});var ko=p({label:a(),value:k()}),Ft=p({disabled:y(Z()),placeholder:y(a()),options:N(ko)});var ce=p({...B.shape,options:Ft,...C(k(),"STATIC_DROPDOWN").shape}),Pe=p({...B.shape,options:Ft,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=p({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),ct=p({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var be=p({...B.shape,...C(Z(),"CHECKBOX").shape});var Ee=p({...B.shape,...C(re(),"NUMBER").shape});var lt=p({...B.shape,streaming:y(Z()),...C(k(),"FILE").shape});var pt=p({...B.shape,...C(a(),"DATE_TIME").shape});var Oo=O(a(),D([ue,_e,ce,ct,Pe,be,Ee,lt,pt])),dt=p({...B.shape,properties:Oo,...C(N(k()),"ARRAY").shape});var mt=p({...B.shape,...C(D([O(a(),k())]),"JSON").shape});var Ro=D([ue,ce,mt,dt,Pe]),fc=O(a(),Ro),Ir=p({refreshers:N(a()),...B.shape,...C(k(),"DYNAMIC").shape});var Bt=p({...B.shape,...C(Ao(),"MARKDOWN").shape});var ft=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ft||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ve=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ve||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Tr="both_client_credentials_and_authorization_code";var ne=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ne||{}),yt=(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))(yt||{}),gc=p({strategy:U(yt),paramName:y(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Vt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vt||{}),No=p({status:y(re()),body:y(k()),headers:y(O(a(),a()))}),Do=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Vt))}),Co=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:No,handlerId:y(a()),streamStepProgress:y(U(Vt))}),yc=D([Do,Co]);var hc=p({body:k(),rawBody:y(k()),headers:O(a(),a()),queryParams:O(a(),a())});function le(e){return e==null}o(le,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var Sr=Le(require("crypto"),1);var vc=128,De,Ze,xc=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*vc),Sr.default.randomFillSync(De),Ze=0):Ze+e>De.length&&(Sr.default.randomFillSync(De),Ze=0),Ze+=e},"fillPool"),_c=o(e=>(xc(e|=0),De.subarray(Ze-e,Ze)),"random"),Pc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===s)return c}}},"customRandom"),Mo=o((e,t=21)=>Pc(e,t,_c),"customAlphabet");var bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lo=21,Cb=a().check(ze(new RegExp(`^[0-9a-zA-Z]{${Lo}}$`))),Ec=Mo(bc,Lo);var Re=Oe(ke(e=>e instanceof Date?e.toISOString():e),a()),pe={id:a(),created:Re,updated:Re},G=o(e=>y(st(e)),"Nullable");function $r(e){return y(st(U(e)))}o($r,"NullableEnum");var Lb=Oe(ke(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(Z())),Ht=o(e=>Oe(ke(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var Bb=O(a(),k());var xt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(xt||{});var eE=a().check(ze(/^#[0-9A-Fa-f]{6}$/));var rE=p({filename:a(),data:k(),type:$("file"),mimetype:y(a())});var Ic=Le(Fo());var cE=p({...pe,name:a(),permissions:N(a()),platformId:G(a()),type:a(),userCount:y(re())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var Tc=p({mode:U(Bo),value:k()}),Sc=p({auth:y(a()),fields:O(a(),Tc)}),$c=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Sc)}),Ac=p({type:$("PIECE"),toolName:a().check(me(1)),pieceMetadata:$c}),zc=p({type:$("none")}),wc=p({type:$("access_token"),accessToken:a()}),kc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),Oc=p({type:$("headers"),headers:O(a(),a())}),Rc=we("type",[zc,wc,kc,Oc]),Vo=p({type:$("FLOW"),toolName:a().check(me(1)),externalFlowId:a(),flowDisplayName:y(a())}),Zo=p({type:$("MCP"),toolName:a().check(me(1)),serverUrl:To(),protocol:U(zr),auth:Rc}),Ho=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(me(1)),sourceType:U(Ar),sourceId:a(),sourceName:a()}),Nc=we("type",[Ac,Vo,Zo,Ho]),Dc=p({displayName:a(),description:y(a()),type:U(wr)}),qo=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:G(O(a(),k())),output:y(k()),toolName:a(),status:U(kr),toolCallId:a(),startTime:a(),endTime:y(a())},jE=p(He),Wo=we("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()})]),Cc=D([qo,Wo]);var Or=(r=>(r.IMAGE="image",r.TEXT="text",r))(Or||{}),Ie=p({apiKey:a()}),Uc=Ie,Mc=p({apiKey:a(),apiKeyHash:a()}),Lc=Ie,jc=Ie,Fc=Ie,Bc=Ie,Vc=Ie,Zc=Ie,Hc=Ie,Yo=p({accessKeyId:a().check(me(1)),secretAccessKey:a().check(me(1))}),qc=p({}),Wc=p({}),Gc=p({}),Kc=p({}),Jc=p({}),Xc=p({}),Qo=p({modelId:a(),modelName:a(),modelType:U(Or)}),ei=p({apiKeyHeader:a(),baseUrl:a(),models:N(Qo),defaultHeaders:y(O(a(),a()))}),ti=p({accountId:a(),gatewayId:a(),models:N(Qo),vertexProject:y(a()),vertexRegion:y(a())}),ri=p({resourceName:a(),apiVersion:Oe(ke(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ni=p({region:a().check(me(1))}),Yc=D([Uc,Fc,Bc,Vc,Zc,jc,Lc,Mc,Yo,Hc]),oi=D([ei,ti,ri,ni,qc,Gc,Kc,Jc,Wc,Xc]),Qc=p({id:a(),name:a(),type:U(Or)}),el=p({id:a(),name:a(),provider:U(xt),config:oi,enabledForChat:Z()}),tl=p({provider:U(xt),config:oi,auth:Yc,platformId:a()});var ZE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Go=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],rl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],nl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ko=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],ol=["grok-4.20","grok-4.1-fast"],il={openai:Go,anthropic:rl,google:Ko,activepieces:[...nl.map(e=>`anthropic/${e}`),...Go.map(e=>`openai/${e}`),...Ko.map(e=>`google/${e}`),...ol.map(e=>`x-ai/${e}`)]};var Jo=128e3,al={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function sl({provider:e}){return e?al[e]??Jo:Jo}o(sl,"getMaxContextTokens");var Xo={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"},ul={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},cl=new Set(["anthropic","mistral"]);function ye(e){return{chatModels:il[e],maxContextTokens:sl({provider:e}),defaultEmbeddingModel:Xo[e],supportsEmbedding:Xo[e]!==void 0,supportsImageGeneration:!cl.has(e),webSearch:ul[e]}}o(ye,"buildProviderCapabilities");var ll={openai:ye("openai"),anthropic:ye("anthropic"),openrouter:ye("openrouter"),azure:ye("azure"),google:ye("google"),"cloudflare-gateway":ye("cloudflare-gateway"),custom:ye("custom"),bedrock:ye("bedrock"),mistral:ye("mistral"),activepieces:ye("activepieces")};var pl=p({base64Url:a(),fileName:a(),extension:y(a())}),dl=p({mimeType:a(),url:a(),fileName:y(a())}),Rr=D([pl,dl]);var ml=D([p({type:$("file"),value:Rr}),p({type:$("markdown"),value:a(),files:y(N(Rr))})]),fl=p({sessionId:a(),message:a(),files:y(N(a()))});var ai=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ai||{}),si=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(si||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var gl=D([p({...pe,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...pe,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),yl=p({...pe,name:a(),folderId:G(a()),projectId:a(),externalId:a(),status:$r(si),trigger:$r(ai)}),hl=p({...pe,tableId:a(),projectId:a(),cells:O(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),vl=p({events:N(U(Nr)),webhookUrl:a(),flowId:a()}),xl=p({fields:N(p({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),_l=p({projectId:a(),limit:y(ut.number()),cursor:y(a()),name:y(a()),externalIds:Ht(a()),folderId:y(a()),folderIds:Ht(a())}),Pl=p({records:N(N(p({fieldId:a(),value:ci()}))),tableId:a()}),bl=p({cells:y(N(p({fieldId:a(),value:ci()}))),tableId:a(),agentUpdate:y(Z())}),ui=we("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),ii("exists"),ii("not_exists")]),El=p({tableId:a(),limit:y(ut.number()),cursor:y(a()),filters:Ht(ui)});function ci(){return Oe(ke(e=>e==null?e:String(e)),st(a()))}o(ci,"coerceToString");function Ce(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ce,"valueFilter");function ii(e){return p({fieldId:a(),operator:$(e)})}o(ii,"existenceFilter");var Il=p({status:y(re()),body:y(k()),headers:y(O(a(),a()))}),Tl=p({...pe,deleted:G(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:G(a())});var li=p({name:a(),description:y(a()),type:a(),required:Z()}),Sl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(li),returnsResponse:Z()})});var pi="^[0-9]+\\.[0-9]+\\.[0-9]+$",cI=new RegExp(pi),Al="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",lI=a().check(ze(new RegExp(pi))),pI=a().check(ze(new RegExp(Al))),zl=p({packageType:$("ARCHIVE"),pieceType:U(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),di=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),mi=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),dI=D([di,mi]),mI=D([zl,di,mi]);var wl=we("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:So().check(Ct(6e4))})]),fI=p({...pe,type:U(ne),projectId:a(),flowId:a(),triggerName:a(),schedule:G(wl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:G(a()),simulate:Z()}),fi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(fi||{}),gi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gi||{}),yi=(r=>(r.S3="S3",r.DB="DB",r))(yi||{}),gI=p({...pe,projectId:G(a()),platformId:G(a()),type:U(fi),compression:U(gi),data:y(k()),location:U(yi),size:G(re()),fileName:G(a()),s3Key:G(a()),metadata:G(O(a(),a()))}),hi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(hi||{}),vi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(vi||{}),yI=p({id:a(),email:a(),firstName:a(),status:U(vi),externalId:G(a()),platformId:G(a()),platformRole:U(hi),lastName:a(),created:Re,updated:Re,lastActiveDate:G(Re),imageUrl:G(a())});var Dr=p({...B.shape,...C(O(a(),k()),"OBJECT").shape});var bi=p({...B.shape,...C(a(),"COLOR").shape});var Cr=D([ue,_e,Bt,be,ce,Pe,Er,ct,Ir,Ee,dt,Dr,mt,pt,lt,bi]),_={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 he=p({displayName:a(),description:y(a())});var Ei=p({username:a(),password:a()}),Ur=p({...he.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...C(Ei,"BASIC_AUTH").shape});var Nl=O(a(),D([ue,_e,Ee,be,ce])),Mr=p({...he.shape,props:Nl,...C(k(),"CUSTOM_AUTH").shape});var Ue=p({...he.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Dl=O(a(),D([ue,_e,Ue,Ee,be,ce,Pe,Bt])),Ii=p({...he.shape,props:Dl,...C(k(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),Ti=D([ue,Ue,ce]),Si=O(a(),Ti),Cl=p({props:y(O(a(),Ti)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:y(Z()),pkceMethod:y(D([$("plain"),$("S256")])),authorizationMethod:y(U(Lr)),grantType:y(D([U(gt),$(Tr)])),extra:y(O(a(),a()))}),$i=p({access_token:a(),props:y(Si),data:O(a(),at())}),jr=p({...he.shape,...Cl.shape,...C($i,"OAUTH2").shape});var qe=D([Ur,Mr,Ii,jr,Ue]),_t="Connection",Fr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||_t}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||_t,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||_t}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||_t}},None(){}};var GT={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 Ul=p({...B.shape,...C(k(),"CUSTOM").shape,code:a()});var Ml=D([Cr,qe]),Br=O(a(),Ml),fS=O(a(),Cr);var Ai=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),We=class{constructor(t,r,n,i,s,c,l,f,h,x,T,P,u,d,g,m,v,b,j){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=h;this.onRenew=x;this.onEnable=T;this.onDisable=P;this.onStart=u;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=j}static{o(this,"ITrigger")}},oe=o(e=>{switch(e.type){case"WEBHOOK":return new We(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 We(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 We(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 We(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,le(e.sampleData)&&le(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var zi="2",Wt="0.82.0";var Vr=class{constructor(t,r,n,i,s,c,l,f,h=Wt,x,T="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=T;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:zi}),"getContextInfo");(!Ll(h)||jl(h,Wt))&&(this.minimumSupportedRelease=Wt),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,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}},wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Vr(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 Ll(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Ll,"isValidSimpleSemver");function jl(e,t){let[r,n,i]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<l}o(jl,"isSemverLessThan");var Fl=y(O(a(),O(a(),a()))),ki=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([qe,N(qe)])),version:a(),categories:y(N(U(Ve))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(Z()),i18n:Fl}),Bl=U(["human","ai","both"]),Oi=p({description:y(a()),idempotent:y(Z())}),Ri=p({name:a(),displayName:a(),description:a(),props:Br,requireAuth:Z(),errorHandlingOptions:y(br),outputSchema:y(jt()),audience:y(Bl),aiMetadata:y(Oi)}),Ni=p({name:a(),displayName:a(),description:a(),props:Br,errorHandlingOptions:y(br),type:U(ne),sampleData:k(),handshakeConfiguration:y(jt()),renewConfiguration:y(Ai),testStrategy:U(ht),outputSchema:y(jt()),aiMetadata:y(Oi)}),Vl=p({...ki.shape,actions:O(a(),Ri),triggers:O(a(),Ni)}),Zl=p({...ki.shape,actions:re(),triggers:re(),suggestedActions:y(N(Ri)),suggestedTriggers:y(N(Ni))}),Di=p({projectUsage:re(),pieceType:U(Be),packageType:U(ft),platformId:y(a()),archiveId:y(a())}),f$=p({...Vl.shape,...Di.shape}),g$=p({...Zl.shape,...Di.shape}),y$=p({name:a(),version:a()});var Hl=Le(require("path")),ql=Le(require("fs/promises"));var Li=require("node:stream");var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}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 Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Zr,r=new Hr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Hr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Pt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Ci({error:e,requestBody:t}){return e instanceof Pt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Ci,"toFailsafeOutput");var te=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(te||{});var Jt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,se]of Object.entries(c))i.append(j,se);let l=i.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:P,extraHeaders:u,isStream:d}=Wl(t.method)?Gl(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},g=Jl({...s,...u}),m=await Kl(async()=>{let j=new AbortController,se=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let de={method:t.method.toString(),headers:g,body:P,redirect:x?"follow":"manual",signal:j.signal};return d&&(de.duplex="half"),r?.dispatcher!==void 0&&(de.dispatcher=r.dispatcher),await fetch(f,de)}finally{se!==void 0&&clearTimeout(se)}},T),v=x?300:400;if(m.status<200||m.status>=v){let j=await Ui(m,h),se=new Pt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",se),se}let b=await Ui(m,h);return{status:m.status,headers:Xl(m.headers),body:b}}};function Wl(e){return e!=="GET"&&e!=="HEAD"}o(Wl,"acceptsRequestBody");function Gl(e,t){if(Ql(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Yl(e)){let n=new Li.PassThrough;return e.on("error",i=>n.destroy(i)),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}}o(Gl,"serializeBody");async function Ui(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}}}}o(Ui,"parseResponseBody");async function Kl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Mi(n);continue}return i}catch(i){if(r=i,n<t){await Mi(n);continue}throw i}throw r}o(Kl,"sendWithRetries");function Mi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Mi,"backoff");function Jl(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}o(Jl,"normalizeHeaders");function Xl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Xl,"toHttpHeaders");function Yl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Yl,"isNodeFormData");function Ql(e){return e==null}o(Ql,"isNil");var V=new Jt;var jd=Le(require("fs")),Hs=Le(Zs());var Fd={"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 Bd(e){let t=e.split(";")[0].trim().toLowerCase();return Fd[t]??""}o(Bd,"contentTypeToExtension");var Vd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Zd=o((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:i,name:s,props:c,extraProps:l,authLocation:f="headers"}){return H({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Zd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(te).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:_.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:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,T={};switch(x){case"none":break;case"json":T.data=_.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:T,headers:P,queryParams:u,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:b,followRedirects:j}=h.propsValue;Zt(x,"Method"),Zt(T,"URL");let se=le(r)?{}:await r(h.auth,h.propsValue),de=T.url,Qe=de.startsWith("http://")||de.startsWith("https://")?de:Vd({baseUrl:t(h.auth),relativePath:de}),Te={method:x,url:Qe,headers:{...P??{},...f==="headers"||!le(f)?se:{}},queryParams:{...f==="queryParams"?se:{},...u??{}},timeout:v?v*1e3:0,followRedirects:j};if(b&&(Te.responseType="arraybuffer"),d)if(g&&g!=="none"){let ve=d.data;if(g==="form_data"){let du=ve,Tt=new Hs.default;for(let{fieldName:mn,fieldType:fn,textFieldValue:gn,fileFieldValue:ar}of du)fn==="text"&&!vt(gn)?Tt.append(mn,gn):fn==="file"&&!vt(ar)&&Tt.append(mn,ar.data,{filename:ar?.filename});Te.body=Tt,Te.headers={...Te.headers,...Tt.getHeaders()}}else Te.body=ve}else g||(Te.body=d);try{let ve=await V.sendRequest(Te);return await Hd(h.files,ve.body,ve.status,ve.headers,b)}catch(ve){if(m)return Ci({error:ve,requestBody:Te.body});throw ve}},"run")})}o(qs,"createCustomApiCallAction");var Hd=o(async(e,t,r,n,i)=>{let s;if(i&&qd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Bd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:f})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),qd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var q={baseUrl:"https://api.reachinbox.ai/api/v1/"},ae=o(async e=>{try{return(await V.sendRequest({method:"GET",url:"https://api.reachinbox.ai/api/v1/campaigns/all?sort=newest&offset=0&limit=50",headers:{Authorization:`Bearer ${e}`}})).body?.data?.rows||[]}catch(t){throw console.error("Error fetching campaigns:",t),new Error("Failed to fetch campaigns.")}},"fetchCampaigns");var Ws=H({auth:M,name:"addLeads",displayName:"Add Leads",description:"Add leads to campaigns dynamically by selecting a campaign, entering lead details, and including custom variables.",audience:"both",aiMetadata:{description:"Adds a single lead (email plus name and optional custom variables) to a specific ReachInbox campaign. Use to enroll a new contact into an outreach sequence. Requires a campaign id; not idempotent since repeated calls append the lead again.",idempotent:!1},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")}),email:_.ShortText({displayName:"Email Address",description:"Enter the email address for the lead",required:!0}),firstName:_.ShortText({displayName:"First Name",description:"Enter the first name for the lead",required:!0}),lastName:_.ShortText({displayName:"Last Name",description:"Enter the last name for the lead",required:!1}),customVariables:_.Array({displayName:"Custom Variables",description:"Add custom variables as key-value pairs for the lead.",properties:{key:_.ShortText({displayName:"Key",description:"Enter the key for the custom variable",required:!0}),value:_.ShortText({displayName:"Value",description:"Enter the value for the custom variable",required:!0})},required:!1,defaultValue:[]})},async run(e){let{campaignId:t,email:r,firstName:n,lastName:i}=e.propsValue,s=e.propsValue.customVariables||[],c={};s.forEach(f=>{c[f.key]=f.value});let l={campaignId:t,leads:[{email:r,firstName:n,lastName:i,...c}],newCoreVariables:["firstName",...s.map(f=>f.key)],duplicates:[]};try{let f=await V.sendRequest({method:"POST",url:`${q.baseUrl}leads/add`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:l});if(f.status===200)return{success:!0,message:f.body.message||"Leads added successfully.",leadCount:f.body.leadCount};throw new Error(`Failed to add leads: ${f.body.message}`)}catch(f){throw console.error("Error adding leads:",f),new Error("Failed to add leads to the campaign.")}}});var Wd=`
|
|
4
4
|
Follow the below steps:
|
|
5
5
|
|
|
6
6
|
1. Login to the ReachInbox dashboard.
|
|
@@ -13,7 +13,7 @@ i.e ${Id(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.u
|
|
|
13
13
|
|
|
14
14
|
5. Select the event type as "Campaign Completed".
|
|
15
15
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
16
|
-
`,
|
|
16
|
+
`,Gs=oe({name:"campaignCompleted",displayName:"Campaign Completed",description:"Triggers when a campaign is completed.",aiMetadata:{description:"Fires when a ReachInbox campaign finishes its full sending sequence (SEQUENCE_COMPLETED). Represents the end of outreach for a campaign, carrying campaign and lead details. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Wd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"SEQUENCE_COMPLETED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Gd=`
|
|
17
17
|
|
|
18
18
|
Follow the below steps:
|
|
19
19
|
|
|
@@ -27,7 +27,7 @@ i.e ${Id(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.u
|
|
|
27
27
|
|
|
28
28
|
5. Select the event type as "Email Bounced".
|
|
29
29
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
30
|
-
`,
|
|
30
|
+
`,Ks=oe({name:"emailBounced",displayName:"Email Bounced",description:"Triggers when an email is bounced.",aiMetadata:{description:"Fires when an outreach email bounces (EMAIL_BOUNCED) and was not delivered to the lead. Use to detect undeliverable addresses; payload includes the lead, sending account, and campaign. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Gd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"EMAIL_BOUNCED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Kd=`
|
|
31
31
|
Follow the below steps:
|
|
32
32
|
|
|
33
33
|
1. Login to the ReachInbox dashboard.
|
|
@@ -40,7 +40,7 @@ i.e ${Id(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.u
|
|
|
40
40
|
|
|
41
41
|
5. Select the event type as "Email Opened".
|
|
42
42
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
43
|
-
`,
|
|
43
|
+
`,Js=oe({name:"emailOpened",displayName:"Email Opened",description:"Triggers when an email is opened.",aiMetadata:{description:"Fires when a lead opens an outreach email (EMAIL_OPENED). Represents recipient engagement; payload includes the lead, sending account, step, and campaign. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Kd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"EMAIL_OPENED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Jd=`
|
|
44
44
|
|
|
45
45
|
Follow the below steps:
|
|
46
46
|
|
|
@@ -54,7 +54,7 @@ Follow the below steps:
|
|
|
54
54
|
|
|
55
55
|
5. Select the event type as "Email Sent".
|
|
56
56
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
57
|
-
`,
|
|
57
|
+
`,Xs=oe({name:"emailSent",displayName:"Email Sent",description:"Triggers when an email is successfully sent.",aiMetadata:{description:"Fires when an outreach email is successfully sent to a lead (EMAIL_SENT). Represents a delivered sequence step; payload includes the lead, sending account, step, and campaign. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Jd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"EMAIL_SENT",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Xd=`
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
Follow the below steps:
|
|
@@ -71,7 +71,7 @@ Follow the below steps:
|
|
|
71
71
|
|
|
72
72
|
5. Select the event type as "Lead Interested".
|
|
73
73
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
74
|
-
`,
|
|
74
|
+
`,Ys=oe({name:"leadInterested",displayName:"Lead Interested",description:"Triggers when a lead is set to interested.",aiMetadata:{description:"Fires when a lead is marked as interested in ReachInbox (LEAD_INTERESTED), signaling a positive reply or qualification. Use to route hot leads onward; payload includes the lead and campaign. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Xd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"LEAD_INTERESTED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Yd=`
|
|
75
75
|
|
|
76
76
|
Follow the below steps:
|
|
77
77
|
|
|
@@ -86,7 +86,7 @@ Follow the below steps:
|
|
|
86
86
|
|
|
87
87
|
5. Select the event type as "Lead Not Interested".
|
|
88
88
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
89
|
-
`,
|
|
89
|
+
`,Qs=oe({name:"leadNotInterested",displayName:"Lead Not Interested",description:"Triggers when a lead is set to not interested.",aiMetadata:{description:"Fires when a lead is marked as not interested in ReachInbox (LEAD_NOT_INTERESTED), signaling a negative or opt-out response. Use to suppress or follow up differently; payload includes the lead and campaign. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Yd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"LEAD_NOT_INTERESTED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Qd=`
|
|
90
90
|
|
|
91
91
|
Follow the below steps:
|
|
92
92
|
|
|
@@ -100,7 +100,7 @@ Follow the below steps:
|
|
|
100
100
|
|
|
101
101
|
5. Select the event type as "Reply Received".
|
|
102
102
|
6. Click on the "Test Trigger" button to simulate a test and capture the webhook response here.
|
|
103
|
-
`,js=oe({name:"replyReceived",displayName:"Reply Received",description:"Triggers when a reply to an email is received.",aiMetadata:{description:"Fires when a lead replies to an outreach email (REPLY_RECEIVED). Represents an inbound response; payload includes the lead, sending account, campaign, and the replied message body. Requires the webhook to be configured in ReachInbox."},props:{markdown:P.MarkDown({value:Od})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"REPLY_RECEIVED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var Fs=H({auth:M,name:"addBlocklist",displayName:"Add Blocklist",description:"Add email addresses, domains, and keywords to the blocklist.",audience:"both",aiMetadata:{description:"Adds email addresses, domains, and/or keywords to the ReachInbox blocklist so matching leads are excluded from outreach. Use to suppress contacts globally. At least one of emails, domains, or keywords must be provided; the call appends entries on each run.",idempotent:!1},props:{emails:P.Array({displayName:"Email Addresses",description:'Enter the email addresses to block (e.g., ["abc@gmail.com"])',required:!1}),domains:P.Array({displayName:"Domains",description:'Enter the domains to block (e.g., ["example.com"])',required:!1}),keywords:P.Array({displayName:"Keywords",description:'Enter keywords to block (e.g., ["spam", "blacklist"])',required:!1})},async run(e){let{emails:t,domains:r,keywords:n}=e.propsValue;if(!t?.length&&!r?.length&&!n?.length)throw new Error("Please provide at least one email, domain, or keyword to block.");let i={emails:t||[],domains:r||[],keywords:n||[]};try{let s=await Z.sendRequest({method:"POST",url:`${q.baseUrl}blocklist/add`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:i});if(s.status===200)return{success:!0,message:s.body.message||"Blocklist updated successfully."};throw new Error(`Failed to update blocklist: ${s.body.message}`)}catch(s){throw s instanceof Error?new Error(`Error updating blocklist: ${s.message}`):new Error("Unknown error occurred while updating the blocklist.")}}});var Bs=H({auth:M,name:"addEmail",displayName:"Add Email",description:"Add an email to a specific account.",audience:"both",aiMetadata:{description:"Attaches a sending email address to a specific ReachInbox campaign so that account is used for outreach. Use to assign which connected mailbox a campaign sends from. Requires both a campaign id and the email address.",idempotent:!1},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")}),email:P.ShortText({displayName:"Email",description:"Enter the email address to add to the campaign.",required:!0})},async run(e){let{campaignId:t,email:r}=e.propsValue;if(!t||!r)throw new Error("Campaign ID and Email are required.");let n=`${q.baseUrl}campaigns/add-email`;try{let i=await Z.sendRequest({method:"POST",url:n,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,email:r}});if(i.status===200)return{success:!0,message:i.body.message||"Email added successfully."};if(i.status===404)return{success:!1,message:i.body.message||"Campaign not found or no emails were added to the campaign."};throw new Error(`Failed to add email: ${i.body.message}`)}catch(i){throw new Error(`Failed to add email: ${i.message}`)}}});var Zs=H({auth:M,name:"enableWarmup",displayName:"Enable Warmup",description:"Enable warmup for specific email accounts where it is currently disabled.",audience:"both",aiMetadata:{description:"Turns on inbox warmup for a connected ReachInbox email account, identified by its account id. Use to start gradually building sending reputation for a mailbox. Idempotent: re-running for an account already warming up leaves it enabled.",idempotent:!0},props:{accountId:P.Dropdown({auth:M,displayName:"Select Email Accounts to Enable Warmup",description:"Choose email accounts that have warmup disabled.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let i=((await Z.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).filter(s=>!s.warmupEnabled&&!s.isDisconnected).map(s=>({label:`${s.email} (ID: ${s.id})`,value:s.id.toString()}));return{options:i,disabled:i.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue,r={ids:[t]};try{let n=await Z.sendRequest({method:"POST",url:`${q.baseUrl}account/warmup/enable`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:r});return{success:!0,message:`Warmup enabled for account ID: ${t}`}}catch(n){throw console.error("Error enabling warmup:",n),new Error(`Failed to enable warmup for account ID: ${t}`)}}});var Vs=H({auth:M,name:"getCampaignAnalytics",displayName:"Get Campaign Analytics",description:"Fetch analytics data for a selected campaign based on a date range.",audience:"both",aiMetadata:{description:"Retrieves performance analytics (sent, opens, clicks, replies, per-step breakdowns, and activity) for one ReachInbox campaign over a date range. Use to report on or evaluate a specific campaign. Requires a campaign id and start/end dates in YYYY-MM-DD format; read-only and idempotent.",idempotent:!0},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")}),startDate:P.ShortText({displayName:"Start Date",description:"Enter the start date (YYYY-MM-DD). E.g. 2023-10-11",required:!0}),endDate:P.ShortText({displayName:"End Date",description:"Enter the end date (YYYY-MM-DD). E.g. 2023-10-20",required:!0})},async run(e){let{campaignId:t,startDate:r,endDate:n}=e.propsValue,i=`${q.baseUrl}campaign/analytics?campaignId=${t}&startDate=${r}&endDate=${n}`;try{let s=await Z.sendRequest({method:"GET",url:i,headers:{Authorization:`Bearer ${e.auth.secret_text}`}});if(s.body.status===200)return{success:!0,message:s.body.message,data:s.body.data};throw new Error(`Failed to fetch analytics: ${s.body.message}`)}catch(s){if(s.response?.status===404)return{success:!1,message:"Campaign not found or analytics data unavailable for the provided date range."};throw new Error(`Failed to fetch analytics: ${s.message}`)}}});var Hs=H({auth:M,name:"getSummary",displayName:"Get Summary",description:"Get a summary of campaign analytics within a date range.",audience:"both",aiMetadata:{description:"Retrieves account-wide outreach analytics (totals and rates for sent, opens, clicks, and replies) aggregated across all campaigns for a date range. Use for an overall performance summary rather than a single campaign. Requires start/end dates in YYYY-MM-DD format; read-only and idempotent.",idempotent:!0},props:{startDate:P.ShortText({displayName:"Start Date",description:"Enter the start date (YYYY-MM-DD). E.g. 2023-10-11",required:!0}),endDate:P.ShortText({displayName:"End Date",description:"Enter the end date (YYYY-MM-DD). E.g. 2023-12-20",required:!0})},async run(e){let{startDate:t,endDate:r}=e.propsValue,n=`https://api.reachinbox.ai/api/v1/analytics/summary?startDate=${t}&endDate=${r}`;try{let i=await Z.sendRequest({method:"GET",url:n,headers:{Authorization:`Bearer ${e.auth.secret_text}`}});if(i.body.status===200)return{success:!0,message:i.body.message,data:i.body.data};throw new Error(`Failed to fetch summary: ${i.body.message}`)}catch(i){if(i.response?.status===404)return{success:!1,message:"Summary data not found for the provided date range."};throw new Error(`Failed to fetch summary: ${i.message}`)}}});var qs=H({auth:M,name:"pauseCampaign",displayName:"Pause Campaign",description:"Pause a selected campaign.",audience:"both",aiMetadata:{description:"Pauses a running ReachInbox campaign, identified by its campaign id, halting further sends. Use to temporarily stop outreach for a campaign. Idempotent: pausing an already-paused campaign leaves it paused.",idempotent:!0},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign to pause.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")})},async run(e){let{campaignId:t}=e.propsValue,r=`${q.baseUrl}campaigns/pause`;try{let n=await Z.sendRequest({method:"POST",url:r,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.auth.secret_text}`},body:{campaignId:t}});if(n.body.status===200)return{success:!0,message:n.body.message};throw new Error(`Failed to pause campaign: ${n.body.message}`)}catch(n){if(n.response?.status===404)return{success:!1,message:"Campaign not found or unable to pause."};throw new Error(`Failed to pause campaign: ${n.message}`)}}});var Ws=H({auth:M,name:"pauseWarmup",displayName:"Pause Warmup",description:"Pause warmup for selected email accounts.",audience:"both",aiMetadata:{description:"Turns off inbox warmup for a connected ReachInbox email account, identified by its account id. Use to stop reputation-building activity for a mailbox. Idempotent: re-running for an account already paused leaves it disabled.",idempotent:!0},props:{accountId:P.Dropdown({auth:M,displayName:"Select Email Accounts to Pause Warmup",description:"Choose email accounts that are currently warming up.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let i=((await Z.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).filter(s=>s.warmupEnabled).map(s=>({label:`${s.email} (ID: ${s.id})`,value:s.id.toString()}));return{options:i,disabled:i.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue,r={ids:[t]};try{let n=await Z.sendRequest({method:"POST",url:`${q.baseUrl}account/warmup/pause`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:r});return{success:!0,message:`Warmup paused for account ID: ${t}`}}catch(n){throw console.error("Error pausing warmup:",n),new Error(`Failed to pause warmup for account ID: ${t}`)}}});var Gs=H({auth:M,name:"removeEmail",displayName:"Remove Email",description:"Remove an email account from the system.",audience:"both",aiMetadata:{description:"Deletes a connected email account from ReachInbox, identified by its account id. Use to permanently disconnect a mailbox. Idempotent on the id: once removed, repeating the call leaves the account absent.",idempotent:!0},props:{accountId:P.Dropdown({auth:M,displayName:"Select Email Account to Remove",description:"Choose an email account to remove.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let n=((await Z.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).map(i=>({label:`${i.email} (ID: ${i.id})`,value:i.id.toString()}));return{options:n,disabled:n.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue;try{if((await Z.sendRequest({method:"DELETE",url:`${q.baseUrl}account/delete/${t}`,headers:{Authorization:`Bearer ${e.auth.secret_text}`}})).status===200)return{success:!0,message:`Email account with ID ${t} was successfully removed.`};throw new Error(`Failed to remove email account with ID: ${t}`)}catch(r){throw console.error("Error removing email account:",r),new Error(`Error removing email account with ID: ${t}`)}}});var Ks=H({auth:M,name:"setSchedule",displayName:"Set Schedule",description:"Update the schedule for a specific Campaign",audience:"both",aiMetadata:{description:"Sets the sending schedule for a ReachInbox campaign: active date range, daily start/end times, timezone, and which weekdays are enabled. Use to control when a campaign sends. Requires a campaign id; idempotent since it replaces the schedule with the supplied values.",idempotent:!0},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")}),scheduleName:P.ShortText({displayName:"Schedule Name",description:"Enter the schedule name here (e.g., New schedule).",required:!0}),startDate:P.DateTime({displayName:"Start Date",description:"Enter the start date (e.g., 2023-08-01T00:00:00.000Z).",required:!0}),endDate:P.DateTime({displayName:"End Date",description:"Enter the end date (e.g., 2024-08-25T00:00:00.000Z).",required:!0}),startTime:P.ShortText({displayName:"Start Time",description:"Enter the start time (e.g., 09:00).",required:!0}),endTime:P.ShortText({displayName:"End Time",description:"Enter the end time (e.g., 12:00).",required:!0}),timezone:P.ShortText({displayName:"Timezone",description:"Enter the timezone (e.g., America/Detroit).",required:!0}),sunday:P.Checkbox({displayName:"Sunday",description:'Choose "Yes" if you want to set a schedule for Sunday.',required:!0,defaultValue:!1}),monday:P.Checkbox({displayName:"Monday",description:'Choose "Yes" if you want to set a schedule for Monday.',required:!0,defaultValue:!1}),tuesday:P.Checkbox({displayName:"Tuesday",description:'Choose "Yes" if you want to set a schedule for Tuesday.',required:!0,defaultValue:!1}),wednesday:P.Checkbox({displayName:"Wednesday",description:'Choose "Yes" if you want to set a schedule for Wednesday.',required:!0,defaultValue:!1}),thursday:P.Checkbox({displayName:"Thursday",description:'Choose "Yes" if you want to set a schedule for Thursday.',required:!0,defaultValue:!1}),friday:P.Checkbox({displayName:"Friday",description:'Choose "Yes" if you want to set a schedule for Friday.',required:!0,defaultValue:!1}),saturday:P.Checkbox({displayName:"Saturday",description:'Choose "Yes" if you want to set a schedule for Saturday.',required:!0,defaultValue:!1})},async run(e){let{campaignId:t,scheduleName:r,startDate:n,endDate:i,startTime:s,endTime:c,timezone:d,sunday:f,monday:h,tuesday:x,wednesday:T,thursday:_,friday:u,saturday:p}=e.propsValue,g=[{name:r,timing:{from:s,to:c},days:{0:f,1:h,2:x,3:T,4:_,5:u,6:p},timezone:d}],m=`${q.baseUrl}campaigns/set-schedule`;try{let v=await Z.sendRequest({method:"PUT",url:m,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,startDate:n,endDate:i,schedules:g}});if(v.status===200)return{success:!0,message:v.body.message||"Schedule updated successfully."};throw new Error(`Failed to update schedule: ${v.body.message}`)}catch(v){throw new Error(`Failed to update schedule: ${v.message}`)}}});var Js=H({auth:M,name:"startCampaign",displayName:"Start Campaign",description:"Starts a Campaign",audience:"both",aiMetadata:{description:"Starts (launches or resumes) a ReachInbox campaign, identified by its campaign id, so it begins sending. Use to activate outreach for a campaign. Idempotent: starting an already-running campaign leaves it running.",idempotent:!0},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")})},async run(e){let{campaignId:t}=e.propsValue;if(!t)throw new Error("Campaign ID is required.");let r=`${q.baseUrl}campaigns/start`;try{let n=await Z.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t}});if(n.status===200)return{success:!0,message:n.body.message||"Campaign started successfully."};throw new Error(`Failed to start campaign: ${n.body.message}`)}catch(n){throw new Error(`Failed to start campaign: ${n.message}`)}}});var Xs=H({auth:M,name:"updateLead",displayName:"Update Lead",description:"Updates a Lead.",audience:"both",aiMetadata:{description:"Updates an existing lead in a ReachInbox campaign, overwriting its email, name, and custom-variable attributes. Use to modify a known contact's details. Requires both the campaign id and the lead id; idempotent since it sets the lead to the supplied values.",idempotent:!0},props:{campaignId:P.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")}),leadId:P.Dropdown({auth:M,displayName:"Select Lead",description:"Choose a lead from the selected campaign.",required:!0,refreshers:["campaignId"],options:o(async({auth:e,campaignId:t})=>{if(!t||!e)return{disabled:!0,options:[],placeholder:"Please connect your account first and select a campaign"};let r=await Z.sendRequest({method:"GET",url:`${q.baseUrl}leads?campaignId=${t}&lastLead=false`,headers:{Authorization:`Bearer ${e.secret_text}`}});if(r.status!==200)throw new Error("Failed to fetch leads.");let n=Array.isArray(r.body.data.leads)?r.body.data.leads:[];return{options:n.map(i=>({label:i.email,value:i.id})),disabled:n.length===0}},"options")}),email:P.ShortText({displayName:"Email",description:"Enter the new email address for the lead.",required:!0}),firstName:P.ShortText({displayName:"First Name",description:"Enter the new first name for the lead.",required:!1}),lastName:P.ShortText({displayName:"Last Name",description:"Enter the new last name for the lead.",required:!1}),customVariables:P.Array({displayName:"Custom Variables",description:"Add custom variables as key-value pairs for the lead.",properties:{key:P.ShortText({displayName:"Key",description:"Enter the key for the custom variable",required:!0}),value:P.ShortText({displayName:"Value",description:"Enter the value for the custom variable",required:!0})},required:!1,defaultValue:[]})},async run(e){let{campaignId:t,leadId:r,email:n,firstName:i,lastName:s,customVariables:c}=e.propsValue;if(!t||!r)throw new Error("Campaign ID and Lead ID are required.");let d=c||[],f={};d.forEach(x=>{f[x.key]=x.value});let h=`${q.baseUrl}leads/update`;try{let x=await Z.sendRequest({method:"PUT",url:h,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,leadId:r,email:n,attributes:{firstName:i||"",lastName:s||"",...f}}});if(x.status===200)return{success:!0,message:x.body.message||"Lead updated successfully."};throw new Error(`Failed to update lead: ${x.body.message}`)}catch(x){throw new Error(`Failed to update lead: ${x.message}`)}}});var M=Mr.SecretText({displayName:"API Key",description:"Enter your ReachInbox API key",required:!0,validate:o(async({auth:e})=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)?{valid:!0}:{valid:!1,error:"Invalid API Key. It should follow the UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."},"validate")}),Rd=vi({displayName:"Reachinbox",auth:M,minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/reachinbox.png",categories:["MARKETING"],authors:["support@reachinbox.ai","ManojKumard","Mitrajit"],actions:[Rs,Fs,Bs,Zs,Vs,Hs,qs,Ws,Gs,Ks,Js,Xs,Os({baseUrl:o(()=>"https://api.reachinbox.ai/api/v1/","baseUrl"),auth:M,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[Ns,Ds,Cs,Us,Ms,Ls,js]});0&&(module.exports={ReachinboxAuth,reachinbox});
|
|
103
|
+
`,eu=oe({name:"replyReceived",displayName:"Reply Received",description:"Triggers when a reply to an email is received.",aiMetadata:{description:"Fires when a lead replies to an outreach email (REPLY_RECEIVED). Represents an inbound response; payload includes the lead, sending account, campaign, and the replied message body. Requires the webhook to be configured in ReachInbox."},props:{markdown:_.MarkDown({value:Qd})},sampleData:{email_id:1,lead_id:1,lead_email:"recipient@example.com",email_account:"sender@example.com",step_number:1,message_id:"<test-message-id>",timestamp:"2024-03-18T08:15:51.000Z",campaign_id:1,campaign_name:"Test Name",event:"REPLY_RECEIVED",user_webhook_id:"1",lead_first_name:"Lead First Name",lead_last_name:"Lead Last Name",email_sent_body:"Sent Email body",email_replied_body:"Sent Replied body"},type:"WEBHOOK",async onEnable(e){},async onDisable(e){},async run(e){return[e.payload.body]}});var tu=H({auth:M,name:"addBlocklist",displayName:"Add Blocklist",description:"Add email addresses, domains, and keywords to the blocklist.",audience:"both",aiMetadata:{description:"Adds email addresses, domains, and/or keywords to the ReachInbox blocklist so matching leads are excluded from outreach. Use to suppress contacts globally. At least one of emails, domains, or keywords must be provided; the call appends entries on each run.",idempotent:!1},props:{emails:_.Array({displayName:"Email Addresses",description:'Enter the email addresses to block (e.g., ["abc@gmail.com"])',required:!1}),domains:_.Array({displayName:"Domains",description:'Enter the domains to block (e.g., ["example.com"])',required:!1}),keywords:_.Array({displayName:"Keywords",description:'Enter keywords to block (e.g., ["spam", "blacklist"])',required:!1})},async run(e){let{emails:t,domains:r,keywords:n}=e.propsValue;if(!t?.length&&!r?.length&&!n?.length)throw new Error("Please provide at least one email, domain, or keyword to block.");let i={emails:t||[],domains:r||[],keywords:n||[]};try{let s=await V.sendRequest({method:"POST",url:`${q.baseUrl}blocklist/add`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:i});if(s.status===200)return{success:!0,message:s.body.message||"Blocklist updated successfully."};throw new Error(`Failed to update blocklist: ${s.body.message}`)}catch(s){throw s instanceof Error?new Error(`Error updating blocklist: ${s.message}`):new Error("Unknown error occurred while updating the blocklist.")}}});var ru=H({auth:M,name:"addEmail",displayName:"Add Email",description:"Add an email to a specific account.",audience:"both",aiMetadata:{description:"Attaches a sending email address to a specific ReachInbox campaign so that account is used for outreach. Use to assign which connected mailbox a campaign sends from. Requires both a campaign id and the email address.",idempotent:!1},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")}),email:_.ShortText({displayName:"Email",description:"Enter the email address to add to the campaign.",required:!0})},async run(e){let{campaignId:t,email:r}=e.propsValue;if(!t||!r)throw new Error("Campaign ID and Email are required.");let n=`${q.baseUrl}campaigns/add-email`;try{let i=await V.sendRequest({method:"POST",url:n,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,email:r}});if(i.status===200)return{success:!0,message:i.body.message||"Email added successfully."};if(i.status===404)return{success:!1,message:i.body.message||"Campaign not found or no emails were added to the campaign."};throw new Error(`Failed to add email: ${i.body.message}`)}catch(i){throw new Error(`Failed to add email: ${i.message}`)}}});var nu=H({auth:M,name:"enableWarmup",displayName:"Enable Warmup",description:"Enable warmup for specific email accounts where it is currently disabled.",audience:"both",aiMetadata:{description:"Turns on inbox warmup for a connected ReachInbox email account, identified by its account id. Use to start gradually building sending reputation for a mailbox. Idempotent: re-running for an account already warming up leaves it enabled.",idempotent:!0},props:{accountId:_.Dropdown({auth:M,displayName:"Select Email Accounts to Enable Warmup",description:"Choose email accounts that have warmup disabled.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let i=((await V.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).filter(s=>!s.warmupEnabled&&!s.isDisconnected).map(s=>({label:`${s.email} (ID: ${s.id})`,value:s.id.toString()}));return{options:i,disabled:i.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue,r={ids:[t]};try{let n=await V.sendRequest({method:"POST",url:`${q.baseUrl}account/warmup/enable`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:r});return{success:!0,message:`Warmup enabled for account ID: ${t}`}}catch(n){throw console.error("Error enabling warmup:",n),new Error(`Failed to enable warmup for account ID: ${t}`)}}});var ou=H({auth:M,name:"getCampaignAnalytics",displayName:"Get Campaign Analytics",description:"Fetch analytics data for a selected campaign based on a date range.",audience:"both",aiMetadata:{description:"Retrieves performance analytics (sent, opens, clicks, replies, per-step breakdowns, and activity) for one ReachInbox campaign over a date range. Use to report on or evaluate a specific campaign. Requires a campaign id and start/end dates in YYYY-MM-DD format; read-only and idempotent.",idempotent:!0},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")}),startDate:_.ShortText({displayName:"Start Date",description:"Enter the start date (YYYY-MM-DD). E.g. 2023-10-11",required:!0}),endDate:_.ShortText({displayName:"End Date",description:"Enter the end date (YYYY-MM-DD). E.g. 2023-10-20",required:!0})},async run(e){let{campaignId:t,startDate:r,endDate:n}=e.propsValue,i=`${q.baseUrl}campaign/analytics?campaignId=${t}&startDate=${r}&endDate=${n}`;try{let s=await V.sendRequest({method:"GET",url:i,headers:{Authorization:`Bearer ${e.auth.secret_text}`}});if(s.body.status===200)return{success:!0,message:s.body.message,data:s.body.data};throw new Error(`Failed to fetch analytics: ${s.body.message}`)}catch(s){if(s.response?.status===404)return{success:!1,message:"Campaign not found or analytics data unavailable for the provided date range."};throw new Error(`Failed to fetch analytics: ${s.message}`)}}});var iu=H({auth:M,name:"getSummary",displayName:"Get Summary",description:"Get a summary of campaign analytics within a date range.",audience:"both",aiMetadata:{description:"Retrieves account-wide outreach analytics (totals and rates for sent, opens, clicks, and replies) aggregated across all campaigns for a date range. Use for an overall performance summary rather than a single campaign. Requires start/end dates in YYYY-MM-DD format; read-only and idempotent.",idempotent:!0},props:{startDate:_.ShortText({displayName:"Start Date",description:"Enter the start date (YYYY-MM-DD). E.g. 2023-10-11",required:!0}),endDate:_.ShortText({displayName:"End Date",description:"Enter the end date (YYYY-MM-DD). E.g. 2023-12-20",required:!0})},async run(e){let{startDate:t,endDate:r}=e.propsValue,n=`https://api.reachinbox.ai/api/v1/analytics/summary?startDate=${t}&endDate=${r}`;try{let i=await V.sendRequest({method:"GET",url:n,headers:{Authorization:`Bearer ${e.auth.secret_text}`}});if(i.body.status===200)return{success:!0,message:i.body.message,data:i.body.data};throw new Error(`Failed to fetch summary: ${i.body.message}`)}catch(i){if(i.response?.status===404)return{success:!1,message:"Summary data not found for the provided date range."};throw new Error(`Failed to fetch summary: ${i.message}`)}}});var au=H({auth:M,name:"pauseCampaign",displayName:"Pause Campaign",description:"Pause a selected campaign.",audience:"both",aiMetadata:{description:"Pauses a running ReachInbox campaign, identified by its campaign id, halting further sends. Use to temporarily stop outreach for a campaign. Idempotent: pausing an already-paused campaign leaves it paused.",idempotent:!0},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign to pause.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")})},async run(e){let{campaignId:t}=e.propsValue,r=`${q.baseUrl}campaigns/pause`;try{let n=await V.sendRequest({method:"POST",url:r,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.auth.secret_text}`},body:{campaignId:t}});if(n.body.status===200)return{success:!0,message:n.body.message};throw new Error(`Failed to pause campaign: ${n.body.message}`)}catch(n){if(n.response?.status===404)return{success:!1,message:"Campaign not found or unable to pause."};throw new Error(`Failed to pause campaign: ${n.message}`)}}});var su=H({auth:M,name:"pauseWarmup",displayName:"Pause Warmup",description:"Pause warmup for selected email accounts.",audience:"both",aiMetadata:{description:"Turns off inbox warmup for a connected ReachInbox email account, identified by its account id. Use to stop reputation-building activity for a mailbox. Idempotent: re-running for an account already paused leaves it disabled.",idempotent:!0},props:{accountId:_.Dropdown({auth:M,displayName:"Select Email Accounts to Pause Warmup",description:"Choose email accounts that are currently warming up.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let i=((await V.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).filter(s=>s.warmupEnabled).map(s=>({label:`${s.email} (ID: ${s.id})`,value:s.id.toString()}));return{options:i,disabled:i.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue,r={ids:[t]};try{let n=await V.sendRequest({method:"POST",url:`${q.baseUrl}account/warmup/pause`,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:r});return{success:!0,message:`Warmup paused for account ID: ${t}`}}catch(n){throw console.error("Error pausing warmup:",n),new Error(`Failed to pause warmup for account ID: ${t}`)}}});var uu=H({auth:M,name:"removeEmail",displayName:"Remove Email",description:"Remove an email account from the system.",audience:"both",aiMetadata:{description:"Deletes a connected email account from ReachInbox, identified by its account id. Use to permanently disconnect a mailbox. Idempotent on the id: once removed, repeating the call leaves the account absent.",idempotent:!0},props:{accountId:_.Dropdown({auth:M,displayName:"Select Email Account to Remove",description:"Choose an email account to remove.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{try{let n=((await V.sendRequest({method:"GET",url:`${q.baseUrl}account/all`,headers:{Authorization:`Bearer ${e}`}})).body?.data?.emailsConnected||[]).map(i=>({label:`${i.email} (ID: ${i.id})`,value:i.id.toString()}));return{options:n,disabled:n.length===0}}catch(t){return console.error("Error fetching email accounts:",t),{options:[],disabled:!0}}},"options")})},async run(e){let{accountId:t}=e.propsValue;try{if((await V.sendRequest({method:"DELETE",url:`${q.baseUrl}account/delete/${t}`,headers:{Authorization:`Bearer ${e.auth.secret_text}`}})).status===200)return{success:!0,message:`Email account with ID ${t} was successfully removed.`};throw new Error(`Failed to remove email account with ID: ${t}`)}catch(r){throw console.error("Error removing email account:",r),new Error(`Error removing email account with ID: ${t}`)}}});var cu=H({auth:M,name:"setSchedule",displayName:"Set Schedule",description:"Update the schedule for a specific Campaign",audience:"both",aiMetadata:{description:"Sets the sending schedule for a ReachInbox campaign: active date range, daily start/end times, timezone, and which weekdays are enabled. Use to control when a campaign sends. Requires a campaign id; idempotent since it replaces the schedule with the supplied values.",idempotent:!0},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id.toString()})),disabled:t.length===0}},"options")}),scheduleName:_.ShortText({displayName:"Schedule Name",description:"Enter the schedule name here (e.g., New schedule).",required:!0}),startDate:_.DateTime({displayName:"Start Date",description:"Enter the start date (e.g., 2023-08-01T00:00:00.000Z).",required:!0}),endDate:_.DateTime({displayName:"End Date",description:"Enter the end date (e.g., 2024-08-25T00:00:00.000Z).",required:!0}),startTime:_.ShortText({displayName:"Start Time",description:"Enter the start time (e.g., 09:00).",required:!0}),endTime:_.ShortText({displayName:"End Time",description:"Enter the end time (e.g., 12:00).",required:!0}),timezone:_.ShortText({displayName:"Timezone",description:"Enter the timezone (e.g., America/Detroit).",required:!0}),sunday:_.Checkbox({displayName:"Sunday",description:'Choose "Yes" if you want to set a schedule for Sunday.',required:!0,defaultValue:!1}),monday:_.Checkbox({displayName:"Monday",description:'Choose "Yes" if you want to set a schedule for Monday.',required:!0,defaultValue:!1}),tuesday:_.Checkbox({displayName:"Tuesday",description:'Choose "Yes" if you want to set a schedule for Tuesday.',required:!0,defaultValue:!1}),wednesday:_.Checkbox({displayName:"Wednesday",description:'Choose "Yes" if you want to set a schedule for Wednesday.',required:!0,defaultValue:!1}),thursday:_.Checkbox({displayName:"Thursday",description:'Choose "Yes" if you want to set a schedule for Thursday.',required:!0,defaultValue:!1}),friday:_.Checkbox({displayName:"Friday",description:'Choose "Yes" if you want to set a schedule for Friday.',required:!0,defaultValue:!1}),saturday:_.Checkbox({displayName:"Saturday",description:'Choose "Yes" if you want to set a schedule for Saturday.',required:!0,defaultValue:!1})},async run(e){let{campaignId:t,scheduleName:r,startDate:n,endDate:i,startTime:s,endTime:c,timezone:l,sunday:f,monday:h,tuesday:x,wednesday:T,thursday:P,friday:u,saturday:d}=e.propsValue,g=[{name:r,timing:{from:s,to:c},days:{0:f,1:h,2:x,3:T,4:P,5:u,6:d},timezone:l}],m=`${q.baseUrl}campaigns/set-schedule`;try{let v=await V.sendRequest({method:"PUT",url:m,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,startDate:n,endDate:i,schedules:g}});if(v.status===200)return{success:!0,message:v.body.message||"Schedule updated successfully."};throw new Error(`Failed to update schedule: ${v.body.message}`)}catch(v){throw new Error(`Failed to update schedule: ${v.message}`)}}});var lu=H({auth:M,name:"startCampaign",displayName:"Start Campaign",description:"Starts a Campaign",audience:"both",aiMetadata:{description:"Starts (launches or resumes) a ReachInbox campaign, identified by its campaign id, so it begins sending. Use to activate outreach for a campaign. Idempotent: starting an already-running campaign leaves it running.",idempotent:!0},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")})},async run(e){let{campaignId:t}=e.propsValue;if(!t)throw new Error("Campaign ID is required.");let r=`${q.baseUrl}campaigns/start`;try{let n=await V.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t}});if(n.status===200)return{success:!0,message:n.body.message||"Campaign started successfully."};throw new Error(`Failed to start campaign: ${n.body.message}`)}catch(n){throw new Error(`Failed to start campaign: ${n.message}`)}}});var pu=H({auth:M,name:"updateLead",displayName:"Update Lead",description:"Updates a Lead.",audience:"both",aiMetadata:{description:"Updates an existing lead in a ReachInbox campaign, overwriting its email, name, and custom-variable attributes. Use to modify a known contact's details. Requires both the campaign id and the lead id; idempotent since it sets the lead to the supplied values.",idempotent:!0},props:{campaignId:_.Dropdown({auth:M,displayName:"Select Campaign",description:"Choose a campaign from the list or enter the campaign ID manually.",required:!0,refreshers:["auth"],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};let t=await ae(e.secret_text);return{options:t.map(r=>({label:r.name,value:r.id})),disabled:t.length===0}},"options")}),leadId:_.Dropdown({auth:M,displayName:"Select Lead",description:"Choose a lead from the selected campaign.",required:!0,refreshers:["campaignId"],options:o(async({auth:e,campaignId:t})=>{if(!t||!e)return{disabled:!0,options:[],placeholder:"Please connect your account first and select a campaign"};let r=await V.sendRequest({method:"GET",url:`${q.baseUrl}leads?campaignId=${t}&lastLead=false`,headers:{Authorization:`Bearer ${e.secret_text}`}});if(r.status!==200)throw new Error("Failed to fetch leads.");let n=Array.isArray(r.body.data.leads)?r.body.data.leads:[];return{options:n.map(i=>({label:i.email,value:i.id})),disabled:n.length===0}},"options")}),email:_.ShortText({displayName:"Email",description:"Enter the new email address for the lead.",required:!0}),firstName:_.ShortText({displayName:"First Name",description:"Enter the new first name for the lead.",required:!1}),lastName:_.ShortText({displayName:"Last Name",description:"Enter the new last name for the lead.",required:!1}),customVariables:_.Array({displayName:"Custom Variables",description:"Add custom variables as key-value pairs for the lead.",properties:{key:_.ShortText({displayName:"Key",description:"Enter the key for the custom variable",required:!0}),value:_.ShortText({displayName:"Value",description:"Enter the value for the custom variable",required:!0})},required:!1,defaultValue:[]})},async run(e){let{campaignId:t,leadId:r,email:n,firstName:i,lastName:s,customVariables:c}=e.propsValue;if(!t||!r)throw new Error("Campaign ID and Lead ID are required.");let l=c||[],f={};l.forEach(x=>{f[x.key]=x.value});let h=`${q.baseUrl}leads/update`;try{let x=await V.sendRequest({method:"PUT",url:h,headers:{Authorization:`Bearer ${e.auth.secret_text}`,"Content-Type":"application/json"},body:{campaignId:t,leadId:r,email:n,attributes:{firstName:i||"",lastName:s||"",...f}}});if(x.status===200)return{success:!0,message:x.body.message||"Lead updated successfully."};throw new Error(`Failed to update lead: ${x.body.message}`)}catch(x){throw new Error(`Failed to update lead: ${x.message}`)}}});var M=Fr.SecretText({displayName:"API Key",description:"Enter your ReachInbox API key",required:!0,validate:o(async({auth:e})=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)?{valid:!0}:{valid:!1,error:"Invalid API Key. It should follow the UUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."},"validate")}),em=wi({displayName:"Reachinbox",auth:M,minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/reachinbox.png",categories:["MARKETING"],authors:["support@reachinbox.ai","ManojKumard","Mitrajit"],actions:[Ws,tu,ru,nu,ou,iu,au,su,uu,cu,lu,pu,qs({baseUrl:o(()=>"https://api.reachinbox.ai/api/v1/","baseUrl"),auth:M,authMapping:o(async e=>({Authorization:`Bearer ${e.secret_text}`}),"authMapping")})],triggers:[Gs,Ks,Js,Xs,Ys,Qs,eu]});0&&(module.exports={ReachinboxAuth,reachinbox});
|
|
104
104
|
/*! Bundled license information:
|
|
105
105
|
|
|
106
106
|
mime-types/index.js:
|