@activepieces/piece-chatwoot 0.0.4 → 0.0.6
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 +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var Fs=Object.create;var Ke=Object.defineProperty;var Bs=Object.getOwnPropertyDescriptor;var Zs=Object.getOwnPropertyNames;var Vs=Object.getPrototypeOf,Hs=Object.prototype.hasOwnProperty;var o=(e,t)=>Ke(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Ke(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zs(t))!Hs.call(e,i)&&i!==r&&Ke(e,i,{get:()=>t[i],enumerable:!(n=Bs(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?Fs(Vs(e)):{},yn(t||!e||!e.__esModule?Ke(r,"default",{value:e,enumerable:!0}):r,e)),Ws=e=>yn(Ke({},"__esModule",{value:!0}),e);var No=E((Ro,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"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(M=d-y,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let Q=s.split(":"),ne=[];for(let qe=0;qe<Q.length;qe++)ne.push(parseInt(Q[qe],16));return ne}(),{parts:d,zoneId:v}}o(f,"expandIPv6");function g(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=y,v+=1}return!0}o(g,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function b(s,d){for(;s.length<d;)s=`0${s}`;return s}o(b,"padPart");let x={};x.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,M;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(M=m[P],y&&M!==0)return null;M!==8&&(y=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];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")},x.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return function(){let v=d.slice(1,6),P=[];for(let M=0;M<v.length;M++)y=v[M],P.push(_(y));return P}();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(d=s.match(r.twoOctet))?function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=function(){function s(d,y){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");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!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,P;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(P=m[v],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(b(this.parts[v].toString(16),4));return m}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new x.IPv4([y>>8,y&255,m>>8,m&255])},s.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(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(y);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,y,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[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")},x.IPv6.parser=function(s){let d,y,m,v,P,M;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(v=P[y],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,y){let m,v,P,M;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return y},typeof Bt<"u"&&Bt.exports?Bt.exports=x:e.ipaddr=x})(Ro)});var Oi=E((KS,ki)=>{var zi=require("stream").Stream,Pp=require("util");ki.exports=ae;function ae(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ae,"DelayedStream");Pp.inherits(ae,zi);ae.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(ae.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ae.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ae.prototype.resume=function(){this._released||this.release(),this.source.resume()};ae.prototype.pause=function(){this.source.pause()};ae.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ae.prototype.pipe=function(){var e=zi.prototype.pipe.apply(this,arguments);return this.resume(),e};ae.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)};ae.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 Di=E((XS,Ni)=>{var bp=require("util"),Ri=require("stream").Stream,wi=Oi();Ni.exports=G;function G(){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(G,"CombinedStream");bp.inherits(G,Ri);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof wi)){var r=wi.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};G.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.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=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.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()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.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)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ui=E((QS,Ci)=>{"use strict";Ci.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 Li=E(Y=>{"use strict";var Kt=Ui(),Ip=require("path").extname,Mi=/^\s*([^;\s]*)(?:;|\s|$)/,Tp=/^text\//i;Y.charset=ji;Y.charsets={lookup:ji};Y.contentType=Ep;Y.extension=$p;Y.extensions=Object.create(null);Y.lookup=Sp;Y.types=Object.create(null);Ap(Y.extensions,Y.types);function ji(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Tp.test(t[1])?"UTF-8":!1}o(ji,"charset");function Ep(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Ep,"contentType");function $p(e){if(!e||typeof e!="string")return!1;var t=Mi.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o($p,"extension");function Sp(e){if(!e||typeof e!="string")return!1;var t=Ip("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(Sp,"lookup");function Ap(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(o(function(i){var u=Kt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var g=r.indexOf(Kt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>_||g===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Ap,"populateMaps")});var Bi=E((rA,Fi)=>{Fi.exports=zp;function zp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(zp,"defer")});var Vr=E((oA,Vi)=>{var Zi=Bi();Vi.exports=kp;function kp(e){var t=!1;return Zi(function(){t=!0}),o(function(n,i){t?e(n,i):Zi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(kp,"async")});var Hr=E((aA,Hi)=>{Hi.exports=Op;function Op(e){Object.keys(e.jobs).forEach(wp.bind(e)),e.jobs={}}o(Op,"abort");function wp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(wp,"clean")});var Wr=E((uA,Gi)=>{var Wi=Vr(),Rp=Hr();Gi.exports=Np;function Np(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Dp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Rp(r):r.results[i]=c,n(u,r.results))})}o(Np,"iterate");function Dp(e,t,r,n){var i;return e.length==2?i=e(r,Wi(n)):i=e(r,t,Wi(n)),i}o(Dp,"runJob")});var Gr=E((pA,qi)=>{qi.exports=Cp;function Cp(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,u){return t(e[i],e[u])}),n}o(Cp,"state")});var qr=E((dA,Ki)=>{var Up=Hr(),Mp=Vr();Ki.exports=jp;function jp(e){Object.keys(this.jobs).length&&(this.index=this.size,Up(this),Mp(e)(null,this.results))}o(jp,"terminator")});var Xi=E((fA,Ji)=>{var Lp=Wr(),Fp=Gr(),Bp=qr();Ji.exports=Zp;function Zp(e,t,r){for(var n=Fp(e);n.index<(n.keyedList||e).length;)Lp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Bp.bind(n,r)}o(Zp,"parallel")});var Kr=E((yA,Jt)=>{var Yi=Wr(),Vp=Gr(),Hp=qr();Jt.exports=Wp;Jt.exports.ascending=Qi;Jt.exports.descending=Gp;function Wp(e,t,r,n){var i=Vp(e,r);return Yi(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){Yi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Hp.bind(i,n)}o(Wp,"serialOrdered");function Qi(e,t){return e<t?-1:e>t?1:0}o(Qi,"ascending");function Gp(e,t){return-1*Qi(e,t)}o(Gp,"descending")});var ta=E((vA,ea)=>{var qp=Kr();ea.exports=Kp;function Kp(e,t,r){return qp(e,t,null,r)}o(Kp,"serial")});var na=E((_A,ra)=>{ra.exports={parallel:Xi(),serial:ta(),serialOrdered:Kr()}});var Jr=E((PA,oa)=>{"use strict";oa.exports=Object});var aa=E((bA,ia)=>{"use strict";ia.exports=Error});var ua=E((IA,sa)=>{"use strict";sa.exports=EvalError});var pa=E((TA,ca)=>{"use strict";ca.exports=RangeError});var da=E((EA,la)=>{"use strict";la.exports=ReferenceError});var fa=E(($A,ma)=>{"use strict";ma.exports=SyntaxError});var Xt=E((SA,ga)=>{"use strict";ga.exports=TypeError});var ha=E((AA,ya)=>{"use strict";ya.exports=URIError});var xa=E((zA,va)=>{"use strict";va.exports=Math.abs});var Pa=E((kA,_a)=>{"use strict";_a.exports=Math.floor});var Ia=E((OA,ba)=>{"use strict";ba.exports=Math.max});var Ea=E((wA,Ta)=>{"use strict";Ta.exports=Math.min});var Sa=E((RA,$a)=>{"use strict";$a.exports=Math.pow});var za=E((NA,Aa)=>{"use strict";Aa.exports=Math.round});var Oa=E((DA,ka)=>{"use strict";ka.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=E((UA,wa)=>{"use strict";var Jp=Oa();wa.exports=o(function(t){return Jp(t)||t===0?t:t<0?-1:1},"sign")});var Da=E((jA,Na)=>{"use strict";Na.exports=Object.getOwnPropertyDescriptor});var Xr=E((LA,Ca)=>{"use strict";var Yt=Da();if(Yt)try{Yt([],"length")}catch{Yt=null}Ca.exports=Yt});var Ma=E((FA,Ua)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ua.exports=Qt});var Yr=E((BA,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 u 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 Ba=E((VA,Fa)=>{"use strict";var La=typeof Symbol<"u"&&Symbol,Xp=Yr();Fa.exports=o(function(){return typeof La!="function"||typeof Symbol!="function"||typeof La("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Xp()},"hasNativeSymbols")});var Qr=E((WA,Za)=>{"use strict";Za.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var en=E((GA,Va)=>{"use strict";var Yp=Jr();Va.exports=Yp.getPrototypeOf||null});var Ga=E((qA,Wa)=>{"use strict";var Qp="Function.prototype.bind called on incompatible ",el=Object.prototype.toString,tl=Math.max,rl="[object Function]",Ha=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),nl=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),ol=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");Wa.exports=o(function(t){var r=this;if(typeof r!="function"||el.apply(r)!==rl)throw new TypeError(Qp+r);for(var n=nl(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ha(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ha(n,arguments))},"binder"),c=tl(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+ol(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ze=E((JA,qa)=>{"use strict";var il=Ga();qa.exports=Function.prototype.bind||il});var er=E((XA,Ka)=>{"use strict";Ka.exports=Function.prototype.call});var tn=E((YA,Ja)=>{"use strict";Ja.exports=Function.prototype.apply});var Ya=E((QA,Xa)=>{"use strict";Xa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var es=E((ez,Qa)=>{"use strict";var al=Ze(),sl=tn(),ul=er(),cl=Ya();Qa.exports=cl||al.call(ul,sl)});var rs=E((tz,ts)=>{"use strict";var pl=Ze(),ll=Xt(),dl=er(),ml=es();ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ll("a function is required");return ml(pl,dl,t)},"callBindBasic")});var us=E((nz,ss)=>{"use strict";var fl=rs(),ns=Xr(),is;try{is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var rn=!!is&&ns&&ns(Object.prototype,"__proto__"),as=Object,os=as.getPrototypeOf;ss.exports=rn&&typeof rn.get=="function"?fl([rn.get]):typeof os=="function"?o(function(t){return os(t==null?t:as(t))},"getDunder"):!1});var ms=E((iz,ds)=>{"use strict";var cs=Qr(),ps=en(),ls=us();ds.exports=cs?o(function(t){return cs(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"):ls?o(function(t){return ls(t)},"getProto"):null});var nn=E((sz,fs)=>{"use strict";var gl=Function.prototype.call,yl=Object.prototype.hasOwnProperty,hl=Ze();fs.exports=hl.call(gl,yl)});var Ps=E((uz,_s)=>{"use strict";var U,vl=Jr(),xl=aa(),_l=ua(),Pl=pa(),bl=da(),Ge=fa(),We=Xt(),Il=ha(),Tl=xa(),El=Pa(),$l=Ia(),Sl=Ea(),Al=Sa(),zl=za(),kl=Ra(),vs=Function,on=o(function(e){try{return vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Xr(),Ol=Ma(),an=o(function(){throw new We},"throwTypeError"),wl=vt?function(){try{return arguments.callee,an}catch{try{return vt(arguments,"callee").get}catch{return an}}}():an,Ve=Ba()(),J=ms(),Rl=en(),Nl=Qr(),xs=tn(),xt=er(),He={},Dl=typeof Uint8Array>"u"||!J?U:J(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&J?J([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":xl,"%eval%":eval,"%EvalError%":_l,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":vs,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&J?J(J([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!J?U:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":vl,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Pl,"%ReferenceError%":bl,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!J?U:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&J?J(""[Symbol.iterator]()):U,"%Symbol%":Ve?Symbol:U,"%SyntaxError%":Ge,"%ThrowTypeError%":wl,"%TypedArray%":Dl,"%TypeError%":We,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":Il,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":xs,"%Object.defineProperty%":Ol,"%Object.getPrototypeOf%":Rl,"%Math.abs%":Tl,"%Math.floor%":El,"%Math.max%":$l,"%Math.min%":Sl,"%Math.pow%":Al,"%Math.round%":zl,"%Math.sign%":kl,"%Reflect.getPrototypeOf%":Nl};if(J)try{null.error}catch(e){gs=J(J(e)),Oe["%Error.prototype%"]=gs}var gs,Cl=o(function e(t){var r;if(t==="%AsyncFunction%")r=on("async function () {}");else if(t==="%GeneratorFunction%")r=on("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=on("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&J&&(r=J(i.prototype))}return Oe[t]=r,r},"doEval"),ys={__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"]},_t=Ze(),tr=nn(),Ul=_t.call(xt,Array.prototype.concat),Ml=_t.call(xs,Array.prototype.splice),hs=_t.call(xt,String.prototype.replace),rr=_t.call(xt,String.prototype.slice),jl=_t.call(xt,RegExp.prototype.exec),Ll=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Fl=/\\(\\)?/g,Bl=o(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return hs(t,Ll,function(u,c,l,f){i[i.length]=l?hs(f,Fl,"$1"):c||u}),i},"stringToPath"),Zl=o(function(t,r){var n=t,i;if(tr(ys,n)&&(i=ys[n],n="%"+i[0]+"%"),tr(Oe,n)){var u=Oe[n];if(u===He&&(u=Cl(n)),typeof u>"u"&&!r)throw new We("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_s.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new We("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new We('"allowMissing" argument must be a boolean');if(jl(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Bl(t),i=n.length>0?n[0]:"",u=Zl("%"+i+"%",r),c=u.name,l=u.value,f=!1,g=u.alias;g&&(i=g[0],Ml(n,Ul([0,1],g)));for(var _=1,b=!0;_<n.length;_+=1){var x=n[_],s=rr(x,0,1),d=rr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ge("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(f=!0),i+="."+x,c="%"+i+"%",tr(Oe,c))l=Oe[c];else if(l!=null){if(!(x in l)){if(!r)throw new We("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&_+1>=n.length){var y=vt(l,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[x]}else b=tr(l,x),l=l[x];b&&!f&&(Oe[c]=l)}}return l},"GetIntrinsic")});var Is=E((pz,bs)=>{"use strict";var Vl=Yr();bs.exports=o(function(){return Vl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=E((dz,Es)=>{"use strict";var Hl=Ps(),Ts=Hl("%Object.defineProperty%",!0),Wl=Is()(),Gl=nn(),ql=Xt(),nr=Wl?Symbol.toStringTag:null;Es.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 ql("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!Gl(t,nr))&&(Ts?Ts(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var As=E((fz,Ss)=>{"use strict";var Kl=Function.prototype.call,Jl=Object.prototype.hasOwnProperty,Xl=Ze();Ss.exports=Xl.call(Kl,Jl)});var ks=E((gz,zs)=>{"use strict";zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=E((yz,ws)=>{"use strict";var pn=Di(),Yl=require("util"),sn=require("path"),Ql=require("http"),ed=require("https"),td=require("url").parse,rd=require("fs"),nd=require("stream").Stream,od=require("crypto"),un=Li(),id=na(),ad=$s(),Ee=As(),cn=ks();function Os(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Os,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],pn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Yl.inherits(j,pn);j.LINE_BREAK=`\r
|
|
2
|
-
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=pn.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),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ee(t,"httpVersion"))&&!(t instanceof nd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Ee(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):rd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ee(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ee(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Os(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&cn(c,r.header);var l;for(var f in c)if(Ee(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ee(e,"httpVersion")&&(r=sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Os(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=un.lookup(e.name)),!r&&e&&e.path&&(r=un.lookup(e.path)),!r&&e&&e.readable&&Ee(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=un.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ee(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+od.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}id.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=td(e),n=cn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=cn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ed.request(n):r=Ql.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(g,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,_)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};ad(j.prototype,"FormData");ws.exports=j});var vd={};gn(vd,{chatwoot:()=>hd});module.exports=Ws(vd);var Gs=Object.freeze({status:"aborted"});function I(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 g=c.prototype,_=Object.keys(g);for(let b=0;b<_.length;b++){let x=_[b];x in l||(l[x]=g[x].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let g=r?.Parent?new u:this;n(g,l),(f=g._zod).deferred??(f.deferred=[]);for(let _ of g._zod.deferred)_();return g}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(I,"$constructor");var qs=Symbol("zod_brand"),se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ar={};function pe(e){return e&&Object.assign(ar,e),ar}o(pe,"config");function ur(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(ur,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function xn(e){return e==null}o(xn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var hn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Je,"isObject");var Ks=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Je(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Je(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function V(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(V,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var Js={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 De(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(De,"aborted");function ve(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(ve,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function xe(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(xe,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(In,"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 Tn=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,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),En=I("$ZodError",Tn),Xe=I("$ZodError",Tn,{Parent:Error});var Ys=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new se;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw cr(l,i?.callee),l}return c.value},"_parse"),At=Ys(Xe),Qs=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw cr(l,i?.callee),l}return c.value},"_parseAsync"),zt=Qs(Xe),eu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new se;return u.issues.length?{success:!1,error:new(e??En)(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParse"),Ye=eu(Xe),tu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParseAsync"),Qe=tu(Xe);var ru="(?:(?:\\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])))",nu=new RegExp(`^${ru}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var lr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Ce=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=I("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(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=In(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var dr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.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=()=>{})}),kn=I("$ZodCheckRegex",(e,t)=>{dr.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 H=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 u of i._zod.onattach)u(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 g=De(c),_;for(let b of l){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new se;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(g||(g=De(c,x)))});else{if(c.issues.length===x)continue;g||(g=De(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(De(c))return c.aborted=!0,c;let g=i(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new se;return g.then(_=>e._zod.parse(_,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(_=>u(_,c,l)):u(g,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new se;return f.then(g=>i(g,n,l))}return i(f,n,l)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=Ye(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Qe(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),wt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(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}}),mr=I("$ZodStringFormat",(e,t)=>{dr.init(e,t),wt.init(e,t)});var Un=I("$ZodURL",(e,t)=>{mr.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 Mn=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??lr,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 u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var fr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=An,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}}),jn=I("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Sn,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 Ln=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Fn=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Bn=I("$ZodVoid",(e,t)=>{H.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}}),Zn=I("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Rn(e,t,r){e.issues.length&&t.issues.push(...ve(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=I("$ZodArray",(e,t)=>{H.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 u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Rn(g,r,c))):Rn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ve(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function ou(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=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(ou,"normalizeDef");function iu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,g=f.def.type,_=f.optout==="optional";for(let b in t){if(l.has(b))continue;if(g==="never"){c.push(b);continue}let x=f.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Ot(s,r,b,t,_))):Ot(x,r,b,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(iu,"handleCatchall");var Hn=I("$ZodObject",(e,t)=>{if(H.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=Et(()=>ou(t));q(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let _=l[g]._zod;if(_.values){f[g]??(f[g]=new Set);for(let b of _.values)f[g].add(b)}}return f});let i=Je,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let g=l.value;if(!i(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let _=[],b=c.shape;for(let x of c.keys){let s=b[x],d=s._zod.optout==="optional",y=s._zod.run({value:g[x],issues:[]},f);y instanceof Promise?_.push(y.then(m=>Ot(m,l,x,g,d))):Ot(y,l,x,g,d)}return u?iu(_,g,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function Nn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!De(u));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(u=>u.issues.map(c=>xe(c,n,pe())))}),t)}o(Nn,"handleUnionResults");var gr=I("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(f=>Nn(f,i,e,u)):Nn(l,i,e,u)}});var Wn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let g of f)i[l].add(g)}}return i});let n=Et(()=>{let i=t.options,u=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(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Je(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,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Gn=I("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let _=t.valueType._zod.run({value:i[g],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...ve(g,b.issues)),r.value[g]=b.value})):(_.issues.length&&r.issues.push(...ve(g,_.issues)),r.value[g]=_.value)}let f;for(let g in i)l.has(g)||(f=f??[],f.push(g));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"&&lr.test(l)&&f.issues.length){let b=t.keyType._zod.run({value:Number(l),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>xe(b,n,pe())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:i[l],issues:[]},n);_ instanceof Promise?u.push(_.then(b=>{b.issues.length&&r.issues.push(...ve(l,b.issues)),r.value[f.value]=b.value})):(_.issues.length&&r.issues.push(...ve(l,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var qn=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?Ne(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Kn=I("$ZodLiteral",(e,t)=>{if(H.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"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Jn=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(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 se;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=I("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(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(u=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=I("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Qn=I("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,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 eo=I("$ZodCustom",(e,t)=>{Ce.init(e,t),H.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(u=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(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(Cn,"handleRefineResult");var ro,cu=Symbol("ZodOutput"),pu=Symbol("ZodInput"),yr=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 no(){return new yr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var hr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...V(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...V(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...V(t)})}o(co,"_boolean");function po(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(po,"_coercedBoolean");function lo(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(lo,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...V(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(yo,"_coercedDate");function oe(e,t){return new zn({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function _e(e,t){return new kn({check:"string_format",format:"regex",...V(t),pattern:e})}o(_e,"_regex");function ho(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var K=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ye(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qe(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)=>St(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Nt=I("ZodMiniString",(e,t)=>{wt.init(e,t),K.init(e,t)});function a(e){return oo(Nt,e)}o(a,"string");var vo=I("ZodMiniStringFormat",(e,t)=>{mr.init(e,t),Nt.init(e,t)});var _u=I("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(_u,e)}o(xo,"url");var vr=I("ZodMiniNumber",(e,t)=>{Mn.init(e,t),K.init(e,t)});function X(e){return so(vr,e)}o(X,"number");var xr=I("ZodMiniBoolean",(e,t)=>{fr.init(e,t),K.init(e,t)});function F(e){return co(xr,e)}o(F,"boolean");var _o=I("ZodMiniBigInt",(e,t)=>{jn.init(e,t),K.init(e,t)});var Pu=I("ZodMiniAny",(e,t)=>{Ln.init(e,t),K.init(e,t)});function tt(){return mo(Pu)}o(tt,"any");var bu=I("ZodMiniUnknown",(e,t)=>{Fn.init(e,t),K.init(e,t)});function k(){return fo(bu)}o(k,"unknown");var Iu=I("ZodMiniVoid",(e,t)=>{Bn.init(e,t),K.init(e,t)});function Po(e){return go(Iu,e)}o(Po,"_void");var bo=I("ZodMiniDate",(e,t)=>{Zn.init(e,t),K.init(e,t)});var Tu=I("ZodMiniArray",(e,t)=>{Vn.init(e,t),K.init(e,t)});function R(e,t){return new Tu({type:"array",element:e,...V(t)})}o(R,"array");var Eu=I("ZodMiniObject",(e,t)=>{Hn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Eu(r)}o(p,"object");var $u=I("ZodMiniUnion",(e,t)=>{gr.init(e,t),K.init(e,t)});function N(e,t){return new $u({type:"union",options:e,...V(t)})}o(N,"union");var Su=I("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),K.init(e,t)});function Ue(e,t,r){return new Su({type:"union",options:t,discriminator:e,...V(r)})}o(Ue,"discriminatedUnion");var Au=I("ZodMiniRecord",(e,t)=>{Gn.init(e,t),K.init(e,t)});function O(e,t,r){return new Au({type:"record",keyType:e,valueType:t,...V(r)})}o(O,"record");var zu=I("ZodMiniEnum",(e,t)=>{qn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new zu({type:"enum",entries:r,...V(t)})}o(C,"_enum");var ku=I("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),K.init(e,t)});function $(e,t){return new ku({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o($,"literal");var Ou=I("ZodMiniTransform",(e,t)=>{Jn.init(e,t),K.init(e,t)});function Pe(e){return new Ou({type:"transform",transform:e})}o(Pe,"transform");var wu=I("ZodMiniOptional",(e,t)=>{Xn.init(e,t),K.init(e,t)});function h(e){return new wu({type:"optional",innerType:e})}o(h,"optional");var Ru=I("ZodMiniNullable",(e,t)=>{Yn.init(e,t),K.init(e,t)});function rt(e){return new Ru({type:"nullable",innerType:e})}o(rt,"nullable");var Nu=I("ZodMiniPipe",(e,t)=>{Qn.init(e,t),K.init(e,t)});function be(e,t){return new Nu({type:"pipe",in:e,out:t})}o(be,"pipe");var Du=I("ZodMiniCustom",(e,t)=>{eo.init(e,t),K.init(e,t)});function Dt(e,t){return ho(Du,e??(()=>!0),t)}o(Dt,"custom");var nt={};gn(nt,{bigint:()=>Bu,boolean:()=>Fu,date:()=>Zu,number:()=>Lu,string:()=>ju});function ju(e){return io(Nt,e)}o(ju,"string");function Lu(e){return uo(vr,e)}o(Lu,"number");function Fu(e){return po(xr,e)}o(Fu,"boolean");function Bu(e){return lo(_o,e)}o(Bu,"bigint");function Zu(e){return yo(bo,e)}o(Zu,"date");var Pr=p({retryOnFailure:p({defaultValue:h(F()),hide:h(F())}),continueOnFailure:p({defaultValue:h(F()),hide:h(F())})}),_r=class{constructor(t,r,n,i,u,c,l,f,g,_,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=_;this.aiMetadata=b}static{o(this,"IAction")}},Ct=o(e=>new _r(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 L=p({displayName:a(),description:h(a())}),D=o((e,t)=>p({type:$(t),required:F(),defaultValue:h(tt())}),"TPropertyValue");var ee=p({...L.shape,...D(a(),"SHORT_TEXT").shape}),le=p({...L.shape,...D(a(),"LONG_TEXT").shape});var To=p({label:a(),value:k()}),Ut=p({disabled:h(F()),placeholder:h(a()),options:R(To)});var te=p({...L.shape,options:Ut,...D(k(),"STATIC_DROPDOWN").shape}),de=p({...L.shape,options:Ut,...D(R(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var br=p({...L.shape,...D(k(),"DROPDOWN").shape,refreshers:R(a())}),ot=p({...L.shape,...D(R(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var me=p({...L.shape,...D(F(),"CHECKBOX").shape});var fe=p({...L.shape,...D(X(),"NUMBER").shape});var it=p({...L.shape,...D(k(),"FILE").shape});var at=p({...L.shape,...D(a(),"DATE_TIME").shape});var Eo=O(a(),N([ee,le,te,ot,de,me,fe,it,at])),st=p({...L.shape,properties:Eo,...D(R(k()),"ARRAY").shape});var ut=p({...L.shape,...D(N([O(a(),k())]),"JSON").shape});var $o=N([ee,te,ut,st,de]),Hu=O(a(),$o),Ir=p({refreshers:R(a()),...L.shape,...D(k(),"DYNAMIC").shape});var Mt=p({...L.shape,...D(Po(),"MARKDOWN").shape});var ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ct||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),pt=(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))(pt||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Tr="both_client_credentials_and_authorization_code";var Ie=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ie||{}),dt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(dt||{}),Wu=p({strategy:C(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),So=p({status:h(X()),body:h(k()),headers:h(O(a(),a()))}),Ao=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(C(jt))}),zo=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:So,handlerId:h(a()),streamStepProgress:h(C(jt))}),Gu=N([Ao,zo]);var qu=p({body:k(),rawBody:h(k()),headers:O(a(),a()),queryParams:O(a(),a())});function ie(e){return e==null}o(ie,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Lt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Lt,"assertNotNullOrUndefined");var Er=Re(require("crypto"),1);var Ku=128,Ae,je,Ju=o(e=>{!Ae||Ae.length<e?(Ae=Buffer.allocUnsafe(e*Ku),Er.default.randomFillSync(Ae),je=0):je+e>Ae.length&&(Er.default.randomFillSync(Ae),je=0),je+=e},"fillPool"),Xu=o(e=>(Ju(e|=0),Ae.subarray(je-e,je)),"random"),Yu=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(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),Oo=o((e,t=21)=>Yu(e,t,Xu),"customAlphabet");var Qu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,tb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),ec=Oo(Qu,wo);var Te=be(Pe(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Te,updated:Te},Z=o(e=>h(rt(e)),"Nullable");function $r(e){return h(rt(C(e)))}o($r,"NullableEnum");var ob=be(Pe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(F())),Ft=o(e=>be(Pe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(R(e))),"OptionalArrayFromQuery");var sb=O(a(),k());var gt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(gt||{});var xb=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var Pb=p({filename:a(),data:k(),type:$("file"),mimetype:h(a())});var tc=Re(No());var Ab=p({...re,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:h(X())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Sr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sr||{}),Ar=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ar||{});var zr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(zr||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var rc=p({mode:C(Do),value:k()}),nc=p({auth:h(a()),fields:O(a(),rc)}),oc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(nc)}),ic=p({type:$("PIECE"),toolName:a().check(oe(1)),pieceMetadata:oc}),ac=p({type:$("none")}),sc=p({type:$("access_token"),accessToken:a()}),uc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),cc=p({type:$("headers"),headers:O(a(),a())}),pc=Ue("type",[ac,sc,uc,cc]),Co=p({type:$("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:h(a())}),Uo=p({type:$("MCP"),toolName:a().check(oe(1)),serverUrl:xo(),protocol:C(Ar),auth:pc}),Mo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:C(Sr),sourceId:a(),sourceName:a()}),lc=Ue("type",[ic,Co,Uo,Mo]),dc=p({displayName:a(),description:h(a()),type:C(zr)}),jo=p({type:$("MARKDOWN"),markdown:a()}),Le={type:$("TOOL_CALL"),input:Z(O(a(),k())),output:h(k()),toolName:a(),status:C(kr),toolCallId:a(),startTime:a(),endTime:h(a())},tI=p(Le),Lo=Ue("toolCallType",[p({...Le,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Le,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...Le,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...Le,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Le,toolCallType:$("UNKNOWN"),displayName:a()})]),mc=N([jo,Lo]);var Or=(r=>(r.IMAGE="image",r.TEXT="text",r))(Or||{}),ge=p({apiKey:a()}),fc=ge,gc=p({apiKey:a(),apiKeyHash:a()}),yc=ge,hc=ge,vc=ge,xc=ge,_c=ge,Pc=ge,bc=ge,Fo=p({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),Ic=p({}),Tc=p({}),Ec=p({}),$c=p({}),Sc=p({}),Ac=p({}),Bo=p({modelId:a(),modelName:a(),modelType:C(Or)}),Zo=p({apiKeyHeader:a(),baseUrl:a(),models:R(Bo),defaultHeaders:h(O(a(),a()))}),Vo=p({accountId:a(),gatewayId:a(),models:R(Bo),vertexProject:h(a()),vertexRegion:h(a())}),Ho=p({resourceName:a(),apiVersion:be(Pe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Wo=p({region:a().check(oe(1))}),zc=N([fc,vc,xc,_c,Pc,hc,yc,gc,Fo,bc]),Go=N([Zo,Vo,Ho,Wo,Ic,Ec,$c,Sc,Tc,Ac]),kc=p({id:a(),name:a(),type:C(Or)}),Oc=p({id:a(),name:a(),provider:C(gt),config:Go,enabledForChat:F()}),wc=p({provider:C(gt),config:Go,auth:zc,platformId:a()});var iI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Rc=p({base64Url:a(),fileName:a(),extension:h(a())}),Nc=p({mimeType:a(),url:a(),fileName:h(a())}),wr=N([Rc,Nc]);var Dc=N([p({type:$("file"),value:wr}),p({type:$("markdown"),value:a(),files:h(R(wr))})]),Cc=p({sessionId:a(),message:a(),files:h(R(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),Rr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Rr||{});var Uc=N([p({...re,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:R(p({value:a()}))})}),p({...re,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),Mc=p({...re,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:$r(Jo),trigger:$r(Ko)}),jc=p({...re,tableId:a(),projectId:a(),cells:O(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),Lc=p({events:R(C(Rr)),webhookUrl:a(),flowId:a()}),Fc=p({fields:R(p({id:a(),name:a()})),rows:R(O(a(),a())),name:a()}),Bc=p({projectId:a(),limit:h(nt.number()),cursor:h(a()),name:h(a()),externalIds:Ft(a()),folderId:h(a()),folderIds:Ft(a())}),Zc=p({records:R(R(p({fieldId:a(),value:Yo()}))),tableId:a()}),Vc=p({cells:h(R(p({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:h(F())}),Xo=Ue("operator",[ze("eq"),ze("neq"),ze("gt"),ze("gte"),ze("lt"),ze("lte"),ze("co"),qo("exists"),qo("not_exists")]),Hc=p({tableId:a(),limit:h(nt.number()),cursor:h(a()),filters:Ft(Xo)});function Yo(){return be(Pe(e=>e==null?e:String(e)),rt(a()))}o(Yo,"coerceToString");function ze(e){return p({fieldId:a(),operator:$(e),value:a()})}o(ze,"valueFilter");function qo(e){return p({fieldId:a(),operator:$(e)})}o(qo,"existenceFilter");var Wc=p({status:h(X()),body:h(k()),headers:h(O(a(),a()))}),Gc=p({...re,deleted:Z(Te),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Qo=p({name:a(),description:h(a()),type:a(),required:F()}),qc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:R(Qo),returnsResponse:F()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",TI=new RegExp(ei),Jc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",EI=a().check(_e(new RegExp(ei))),$I=a().check(_e(new RegExp(Jc))),Xc=p({packageType:$("ARCHIVE"),pieceType:C(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),SI=N([ti,ri]),AI=N([Xc,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),Yc=p({type:C(ni),cronExpression:a(),timezone:a()}),zI=p({...re,type:C(Ie),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Yc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:F()}),oi=(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))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),kI=p({...re,projectId:Z(a()),platformId:Z(a()),type:C(oi),compression:C(ii),data:h(k()),location:C(ai),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),OI=p({id:a(),email:a(),firstName:a(),status:C(ui),externalId:Z(a()),platformId:Z(a()),platformRole:C(si),lastName:a(),created:Te,updated:Te,lastActiveDate:Z(Te),imageUrl:Z(a())});var Nr=p({...L.shape,...D(O(a(),k()),"OBJECT").shape});var di=p({...L.shape,...D(a(),"COLOR").shape});var Dr=N([ee,le,Mt,me,te,de,br,ot,Ir,fe,st,Nr,ut,at,it,di]),B={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 ue=p({displayName:a(),description:h(a())});var mi=p({username:a(),password:a()}),Cr=p({...ue.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...D(mi,"BASIC_AUTH").shape});var rp=O(a(),N([ee,le,fe,me,te])),Ur=p({...ue.shape,props:rp,...D(k(),"CUSTOM_AUTH").shape});var ke=p({...ue.shape,...D(p({auth:a()}),"SECRET_TEXT").shape});var np=O(a(),N([ee,le,ke,fe,me,te,de,Mt])),fi=p({...ue.shape,props:np,...D(k(),"OIDC").shape});var Mr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Mr||{}),gi=N([ee,ke,te]),yi=O(a(),gi),op=p({props:h(O(a(),gi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:h(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(F()),pkceMethod:h(N([$("plain"),$("S256")])),authorizationMethod:h(C(Mr)),grantType:h(N([C(lt),$(Tr)])),extra:h(O(a(),a()))}),hi=p({access_token:a(),props:h(yi),data:O(a(),tt())}),jr=p({...ue.shape,...op.shape,...D(hi,"OAUTH2").shape});var Fe=N([Cr,Ur,fi,jr,ke]),yt="Connection",Zt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var cE={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 ip=p({...L.shape,...D(k(),"CUSTOM").shape,code:a()});var ap=N([Dr,Fe]),Lr=O(a(),ap),zE=O(a(),Dr);var vi=N([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]),Be=class{constructor(t,r,n,i,u,c,l,f,g,_,b,x,s,d,y,m,v,P,M){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=_;this.onEnable=b;this.onDisable=x;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=v;this.outputSchema=P;this.aiMetadata=M}static{o(this,"ITrigger")}},xi=o(e=>{switch(e.type){case"WEBHOOK":return new Be(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 Be(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 Be(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 Be(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,ie(e.sampleData)&&ie(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var _i="2",Vt="0.82.0";var Fr=class{constructor(t,r,n,i,u,c,l,f,g=Vt,_,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=_;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:_i}),"getContextInfo");(!sp(g)||up(g,Vt))&&(this.minimumSupportedRelease=Vt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}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}},Pi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Fr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function sp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(sp,"isValidSimpleSemver");function up(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(up,"isSemverLessThan");var cp=h(O(a(),O(a(),a()))),bi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:h(a()),directoryPath:h(a()),auth:h(N([Fe,R(Fe)])),version:a(),categories:h(R(C(pt))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:cp}),pp=C(["human","ai","both"]),Ii=p({description:h(a()),idempotent:h(F())}),Ti=p({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:F(),errorHandlingOptions:h(Pr),outputSchema:h(Dt()),audience:h(pp),aiMetadata:h(Ii)}),Ei=p({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:h(Pr),type:C(Ie),sampleData:k(),handshakeConfiguration:h(Dt()),renewConfiguration:h(vi),testStrategy:C(mt),outputSchema:h(Dt()),aiMetadata:h(Ii)}),lp=p({...bi.shape,actions:O(a(),Ti),triggers:O(a(),Ei)}),dp=p({...bi.shape,actions:X(),triggers:X(),suggestedActions:h(R(Ei)),suggestedTriggers:h(R(Ti))}),$i=p({projectUsage:X(),tags:h(R(a())),pieceType:C(Me),packageType:C(ct),platformId:h(a()),archiveId:h(a())}),z$=p({...lp.shape,...$i.shape}),k$=p({...dp.shape,...$i.shape}),O$=p({name:a(),version:a()});var mp=Re(require("path")),fp=Re(require("fs/promises"));var Ht=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((u,c)=>{i.append(c,u)}),{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 Wt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Br,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=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 Gt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Ht{static{o(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,Q]of Object.entries(c))i.append(M,Q);let l=i.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",_=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:s,isStream:d}=gp(t.body,u),y=hp({...u,...s}),m=await yp(async()=>{let M=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:y,body:x,redirect:_?"follow":"manual",signal:M.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(f,ne)}finally{Q!==void 0&&clearTimeout(Q)}},b),v=_?300:400;if(m.status<200||m.status>=v){let M=await Si(m,g),Q=new Gt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let P=await Si(m,g);return{status:m.status,headers:vp(m.headers),body:P}}};function gp(e,t){return _p(e)?{body:void 0,extraHeaders:{},isStream:!1}:xp(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(gp,"serializeBody");async function Si(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(Si,"parseResponseBody");async function yp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ai(n);continue}return i}catch(i){if(r=i,n<t){await Ai(n);continue}throw i}throw r}o(yp,"sendWithRetries");function Ai(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ai,"backoff");function hp(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(hp,"normalizeHeaders");function vp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(vp,"toHttpHeaders");function xp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(xp,"isNodeFormData");function _p(e){return e==null}o(_p,"isNil");var ye=new qt;var ht=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ht||{});var sd=Re(require("fs")),Ns=Re(Rs());var ud={"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 cd(e){let t=e.split(";")[0].trim().toLowerCase();return ud[t]??""}o(cd,"contentTypeToExtension");var pd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),ld=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 Ds({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return Ct({audience:"human",name:u||"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:B.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:B.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 pu=Object.create;var Xe=Object.defineProperty;var lu=Object.getOwnPropertyDescriptor;var du=Object.getOwnPropertyNames;var mu=Object.getPrototypeOf,fu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Pn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of du(t))!fu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=lu(t,i))||n.enumerable});return e};var Ue=(e,t,r)=>(r=e!=null?pu(mu(e)):{},bn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),gu=e=>bn(Xe({},"__esModule",{value:!0}),e);var qo=E((Wo,Wt)=>{(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"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(p.zoneIndex)||[])[0],P,M;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(M=d-y,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Q=s.split(":"),ae=[];for(let xe=0;xe<Q.length;xe++)ae.push(parseInt(Q[xe],16));return ae})(),{parts:d,zoneId:x}}o(g,"expandIPv6");function h(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;m>0;){if(P=y-m,P<0&&(P=0),s[x]>>P!==d[x]>>P)return!1;m-=y,x+=1}return!0}o(h,"matchCIDR");function v(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(v,"parseIntAuto");function b(s,d){for(;s.length<d;)s=`0${s}`;return s}o(b,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,M;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in m){if(M=m[P],y&&M!==0)return null;M!==8&&(y=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];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(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let M=0;M<x.length;M++)y=x[M],P.push(v(y));return P})();if(d=s.match(r.longValue)){if(m=v(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(m>>P&255);return x})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(m=v(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(m=v(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(v(x[0])),P.push(v(x[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,y){let m,x;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(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,P;for(let M=7;M>=0;M-=1)if(x=this.parts[M],x in m){if(P=m[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(b(this.parts[x].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new _.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(m=P.index,x=P[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(m[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,y,m,x,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[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")},_.IPv6.parser=function(s){let d,y,m,x,P,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return g(s,8);if((m=s.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,y){let m,x,P,M;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return x}return y},typeof Wt<"u"&&Wt.exports?Wt.exports=_:e.ipaddr=_})(Wo)});var Qi=E((G$,Yi)=>{var Xi=require("stream").Stream,Qp=require("util");Yi.exports=ie;function ie(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ie,"DelayedStream");Qp.inherits(ie,Xi);ie.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(ie.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ie.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ie.prototype.resume=function(){this._released||this.release(),this.source.resume()};ie.prototype.pause=function(){this.source.pause()};ie.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ie.prototype.pipe=function(){var e=Xi.prototype.pipe.apply(this,arguments);return this.resume(),e};ie.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)};ie.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 na=E((q$,ra)=>{var el=require("util"),ta=require("stream").Stream,ea=Qi();ra.exports=W;function W(){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(W,"CombinedStream");el.inherits(W,ta);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof ea)){var r=ea.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};W.prototype.pipe=function(e,t){return ta.prototype.pipe.call(this,e,t),this.resume(),e};W.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}};W.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=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.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()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.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")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.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)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ia=E((J$,oa)=>{"use strict";oa.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 ua=E(Y=>{"use strict";var Qt=ia(),tl=require("path").extname,aa=/^\s*([^;\s]*)(?:;|\s|$)/,rl=/^text\//i;Y.charset=sa;Y.charsets={lookup:sa};Y.contentType=nl;Y.extension=ol;Y.extensions=Object.create(null);Y.lookup=il;Y.types=Object.create(null);al(Y.extensions,Y.types);function sa(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&Qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&rl.test(t[1])?"UTF-8":!1}o(sa,"charset");function nl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(nl,"contentType");function ol(e){if(!e||typeof e!="string")return!1;var t=aa.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ol,"extension");function il(e){if(!e||typeof e!="string")return!1;var t=tl("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(il,"lookup");function al(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Qt).forEach(o(function(i){var u=Qt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var g=c[p];if(t[g]){var h=r.indexOf(Qt[t[g]].source),v=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(h>v||h===v&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(al,"populateMaps")});var pa=E((Q$,ca)=>{ca.exports=sl;function sl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(sl,"defer")});var Jr=E((tz,da)=>{var la=pa();da.exports=ul;function ul(e){var t=!1;return la(function(){t=!0}),o(function(n,i){t?e(n,i):la(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(ul,"async")});var Xr=E((nz,ma)=>{ma.exports=cl;function cl(e){Object.keys(e.jobs).forEach(pl.bind(e)),e.jobs={}}o(cl,"abort");function pl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(pl,"clean")});var Yr=E((iz,ga)=>{var fa=Jr(),ll=Xr();ga.exports=dl;function dl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ml(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ll(r):r.results[i]=c,n(u,r.results))})}o(dl,"iterate");function ml(e,t,r,n){var i;return e.length==2?i=e(r,fa(n)):i=e(r,t,fa(n)),i}o(ml,"runJob")});var Qr=E((sz,ya)=>{ya.exports=fl;function fl(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,u){return t(e[i],e[u])}),n}o(fl,"state")});var en=E((cz,ha)=>{var gl=Xr(),yl=Jr();ha.exports=hl;function hl(e){Object.keys(this.jobs).length&&(this.index=this.size,gl(this),yl(e)(null,this.results))}o(hl,"terminator")});var xa=E((lz,va)=>{var vl=Yr(),xl=Qr(),_l=en();va.exports=Pl;function Pl(e,t,r){for(var n=xl(e);n.index<(n.keyedList||e).length;)vl(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return _l.bind(n,r)}o(Pl,"parallel")});var tn=E((mz,er)=>{var _a=Yr(),bl=Qr(),Tl=en();er.exports=Il;er.exports.ascending=Pa;er.exports.descending=El;function Il(e,t,r,n){var i=bl(e,r);return _a(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){_a(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Tl.bind(i,n)}o(Il,"serialOrdered");function Pa(e,t){return e<t?-1:e>t?1:0}o(Pa,"ascending");function El(e,t){return-1*Pa(e,t)}o(El,"descending")});var Ta=E((gz,ba)=>{var Sl=tn();ba.exports=Al;function Al(e,t,r){return Sl(e,t,null,r)}o(Al,"serial")});var Ea=E((hz,Ia)=>{Ia.exports={parallel:xa(),serial:Ta(),serialOrdered:tn()}});var rn=E((vz,Sa)=>{"use strict";Sa.exports=Object});var $a=E((xz,Aa)=>{"use strict";Aa.exports=Error});var Oa=E((_z,za)=>{"use strict";za.exports=EvalError});var wa=E((Pz,ka)=>{"use strict";ka.exports=RangeError});var Da=E((bz,Ra)=>{"use strict";Ra.exports=ReferenceError});var Ca=E((Tz,Na)=>{"use strict";Na.exports=SyntaxError});var tr=E((Iz,Ua)=>{"use strict";Ua.exports=TypeError});var La=E((Ez,Ma)=>{"use strict";Ma.exports=URIError});var Fa=E((Sz,ja)=>{"use strict";ja.exports=Math.abs});var Va=E((Az,Ba)=>{"use strict";Ba.exports=Math.floor});var Ha=E(($z,Za)=>{"use strict";Za.exports=Math.max});var Wa=E((zz,Ga)=>{"use strict";Ga.exports=Math.min});var Ka=E((Oz,qa)=>{"use strict";qa.exports=Math.pow});var Xa=E((kz,Ja)=>{"use strict";Ja.exports=Math.round});var Qa=E((wz,Ya)=>{"use strict";Ya.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ts=E((Dz,es)=>{"use strict";var $l=Qa();es.exports=o(function(t){return $l(t)||t===0?t:t<0?-1:1},"sign")});var ns=E((Cz,rs)=>{"use strict";rs.exports=Object.getOwnPropertyDescriptor});var nn=E((Uz,os)=>{"use strict";var rr=ns();if(rr)try{rr([],"length")}catch{rr=null}os.exports=rr});var as=E((Mz,is)=>{"use strict";var nr=Object.defineProperty||!1;if(nr)try{nr({},"a",{value:1})}catch{nr=!1}is.exports=nr});var on=E((Lz,ss)=>{"use strict";ss.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 u 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 p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var ps=E((Fz,cs)=>{"use strict";var us=typeof Symbol<"u"&&Symbol,zl=on();cs.exports=o(function(){return typeof us!="function"||typeof Symbol!="function"||typeof us("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:zl()},"hasNativeSymbols")});var an=E((Vz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var sn=E((Zz,ds)=>{"use strict";var Ol=rn();ds.exports=Ol.getPrototypeOf||null});var gs=E((Hz,fs)=>{"use strict";var kl="Function.prototype.bind called on incompatible ",wl=Object.prototype.toString,Rl=Math.max,Dl="[object Function]",ms=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Nl=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Cl=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");fs.exports=o(function(t){var r=this;if(typeof r!="function"||wl.apply(r)!==Dl)throw new TypeError(kl+r);for(var n=Nl(arguments,1),i,u=o(function(){if(this instanceof i){var v=r.apply(this,ms(n,arguments));return Object(v)===v?v:this}return r.apply(t,ms(n,arguments))},"binder"),c=Rl(0,r.length-n.length),p=[],g=0;g<c;g++)p[g]="$"+g;if(i=Function("binder","return function ("+Cl(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ge=E((Wz,ys)=>{"use strict";var Ul=gs();ys.exports=Function.prototype.bind||Ul});var or=E((qz,hs)=>{"use strict";hs.exports=Function.prototype.call});var un=E((Kz,vs)=>{"use strict";vs.exports=Function.prototype.apply});var _s=E((Jz,xs)=>{"use strict";xs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var bs=E((Xz,Ps)=>{"use strict";var Ml=Ge(),Ll=un(),jl=or(),Fl=_s();Ps.exports=Fl||Ml.call(jl,Ll)});var Is=E((Yz,Ts)=>{"use strict";var Bl=Ge(),Vl=tr(),Zl=or(),Hl=bs();Ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Vl("a function is required");return Hl(Bl,Zl,t)},"callBindBasic")});var Os=E((eO,zs)=>{"use strict";var Gl=Is(),Es=nn(),As;try{As=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var cn=!!As&&Es&&Es(Object.prototype,"__proto__"),$s=Object,Ss=$s.getPrototypeOf;zs.exports=cn&&typeof cn.get=="function"?Gl([cn.get]):typeof Ss=="function"?o(function(t){return Ss(t==null?t:$s(t))},"getDunder"):!1});var Ns=E((rO,Ds)=>{"use strict";var ks=an(),ws=sn(),Rs=Os();Ds.exports=ks?o(function(t){return ks(t)},"getProto"):ws?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ws(t)},"getProto"):Rs?o(function(t){return Rs(t)},"getProto"):null});var pn=E((oO,Cs)=>{"use strict";var Wl=Function.prototype.call,ql=Object.prototype.hasOwnProperty,Kl=Ge();Cs.exports=Kl.call(Wl,ql)});var Vs=E((iO,Bs)=>{"use strict";var U,Jl=rn(),Xl=$a(),Yl=Oa(),Ql=wa(),ed=Da(),Je=Ca(),Ke=tr(),td=La(),rd=Fa(),nd=Va(),od=Ha(),id=Wa(),ad=Ka(),sd=Xa(),ud=ts(),js=Function,ln=o(function(e){try{return js('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=nn(),cd=as(),dn=o(function(){throw new Ke},"throwTypeError"),pd=Pt?(function(){try{return arguments.callee,dn}catch{try{return Pt(arguments,"callee").get}catch{return dn}}})():dn,We=ps()(),X=Ns(),ld=sn(),dd=an(),Fs=un(),bt=or(),qe={},md=typeof Uint8Array>"u"||!X?U:X(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":We&&X?X([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Xl,"%eval%":eval,"%EvalError%":Yl,"%Float16Array%":typeof Float16Array>"u"?U:Float16Array,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":js,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&X?X(X([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!X?U:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Jl,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Ql,"%ReferenceError%":ed,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!X?U:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&X?X(""[Symbol.iterator]()):U,"%Symbol%":We?Symbol:U,"%SyntaxError%":Je,"%ThrowTypeError%":pd,"%TypedArray%":md,"%TypeError%":Ke,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":td,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":Fs,"%Object.defineProperty%":cd,"%Object.getPrototypeOf%":ld,"%Math.abs%":rd,"%Math.floor%":nd,"%Math.max%":od,"%Math.min%":id,"%Math.pow%":ad,"%Math.round%":sd,"%Math.sign%":ud,"%Reflect.getPrototypeOf%":dd};if(X)try{null.error}catch(e){Us=X(X(e)),Ne["%Error.prototype%"]=Us}var Us,fd=o(function e(t){var r;if(t==="%AsyncFunction%")r=ln("async function () {}");else if(t==="%GeneratorFunction%")r=ln("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=ln("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Ne[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"]},Tt=Ge(),ir=pn(),gd=Tt.call(bt,Array.prototype.concat),yd=Tt.call(Fs,Array.prototype.splice),Ls=Tt.call(bt,String.prototype.replace),ar=Tt.call(bt,String.prototype.slice),hd=Tt.call(bt,RegExp.prototype.exec),vd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xd=/\\(\\)?/g,_d=o(function(t){var r=ar(t,0,1),n=ar(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var i=[];return Ls(t,vd,function(u,c,p,g){i[i.length]=p?Ls(g,xd,"$1"):c||u}),i},"stringToPath"),Pd=o(function(t,r){var n=t,i;if(ir(Ms,n)&&(i=Ms[n],n="%"+i[0]+"%"),ir(Ne,n)){var u=Ne[n];if(u===qe&&(u=fd(n)),typeof u>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Bs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(hd(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_d(t),i=n.length>0?n[0]:"",u=Pd("%"+i+"%",r),c=u.name,p=u.value,g=!1,h=u.alias;h&&(i=h[0],yd(n,gd([0,1],h)));for(var v=1,b=!0;v<n.length;v+=1){var _=n[v],s=ar(_,0,1),d=ar(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Je("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(g=!0),i+="."+_,c="%"+i+"%",ir(Ne,c))p=Ne[c];else if(p!=null){if(!(_ in p)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&v+1>=n.length){var y=Pt(p,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else b=ir(p,_),p=p[_];b&&!g&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Hs=E((sO,Zs)=>{"use strict";var bd=on();Zs.exports=o(function(){return bd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var qs=E((cO,Ws)=>{"use strict";var Td=Vs(),Gs=Td("%Object.defineProperty%",!0),Id=Hs()(),Ed=pn(),Sd=tr(),sr=Id?Symbol.toStringTag:null;Ws.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 Sd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");sr&&(n||!Ed(t,sr))&&(Gs?Gs(t,sr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[sr]=r)},"setToStringTag")});var Js=E((lO,Ks)=>{"use strict";var Ad=Function.prototype.call,$d=Object.prototype.hasOwnProperty,zd=Ge();Ks.exports=zd.call(Ad,$d)});var Ys=E((dO,Xs)=>{"use strict";Xs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var tu=E((mO,eu)=>{"use strict";var yn=na(),Od=require("util"),mn=require("path"),kd=require("http"),wd=require("https"),Rd=require("url").parse,Dd=require("fs"),Nd=require("stream").Stream,Cd=require("crypto"),fn=ua(),Ud=Ea(),Md=qs(),ke=Js(),gn=Ys();function Qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Qs,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],yn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");Od.inherits(F,yn);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=yn.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),u=this._multiPartFooter();n(i),n(t),n(u),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&&ke(t,"httpVersion"))&&!(t instanceof Nd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){ke(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)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(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),u="",c={"Content-Disposition":["form-data",'name="'+Qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&gn(c,r.header);var p;for(var g in c)if(ke(c,g)){if(p=c[g],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=g+": "+p.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+u+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=mn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=mn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=mn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Qs(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=fn.lookup(e.name)),!r&&e&&e.path&&(r=fn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=fn.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)ke(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="--------------------------"+Cd.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}Ud.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=Rd(e),n=gn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=gn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=wd.request(n):r=kd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,g=o(function(h,v){return r.removeListener("error",g),r.removeListener("response",p),t.call(this,h,v)},"callback");p=g.bind(this,null),r.on("error",g),r.on("response",p)}}.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]"};Md(F.prototype,"FormData");eu.exports=F});var Jd={};Pn(Jd,{chatwoot:()=>Kd});module.exports=gu(Jd);var yu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,g);let h=c.prototype,v=Object.keys(h);for(let b=0;b<v.length;b++){let _=v[b];_ in p||(p[_]=h[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var g;let h=r?.Parent?new u:this;n(h,p),(g=h._zod).deferred??(g.deferred=[]);for(let v of h._zod.deferred)v();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var se=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"}},pr={};function le(e){return e&&Object.assign(pr,e),pr}o(le,"config");function dr(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(dr,"getEnumValues");function In(e,t){return typeof t=="bigint"?t.toString():t}o(In,"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 En(e){return e==null}o(En,"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 Tn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var hu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Sn(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Sn,"isPlainObject");var An=new Set(["string","number","symbol"]);function Me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Me,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function V(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(V,"normalizeParams");function $n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o($n,"optionalKeys");var zn={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 Le(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(Le,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function On(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(On,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(fr,"issue");var kn=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,In,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),wn=T("$ZodError",kn),Qe=T("$ZodError",kn,{Parent:Error});var xu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new se;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(g=>be(g,u,le())));throw mr(p,i?.callee),p}return c.value},"_parse"),kt=xu(Qe),_u=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(g=>be(g,u,le())));throw mr(p,i?.callee),p}return c.value},"_parseAsync"),wt=_u(Qe),Pu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new se;return u.issues.length?{success:!1,error:new(e??wn)(u.issues.map(c=>be(c,i,le())))}:{success:!0,data:u.value}},"_safeParse"),et=Pu(Qe),bu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>be(c,i,le())))}:{success:!0,data:u.value}},"_safeParseAsync"),tt=bu(Qe);var Tu="(?:(?:\\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])))",Iu=new RegExp(`^${Tu}$`);var Rn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/,Nn=/^-?\d+$/,gr=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i;var Te=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Eu={number:"number",bigint:"bigint",object:"date"};var Un=T("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=Eu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(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 Mn=T("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=zn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Nn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,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:p,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}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Ln=T("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!En(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=On(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.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=()=>{})}),jn=T("$ZodCheckRegex",(e,t)=>{yr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Bn={major:4,minor:3,patch:6};var G=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(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,p,g)=>{let h=Le(c),v;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(h)continue;let _=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new se;if(v||s instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(h||(h=Le(c,_)))});else{if(c.issues.length===_)continue;h||(h=Le(c,_))}}return v?v.then(()=>c):c},"runChecks"),u=o((c,p,g)=>{if(Le(c))return c.aborted=!0,c;let h=i(p,n,g);if(h instanceof Promise){if(g.async===!1)throw new se;return h.then(v=>e._zod.parse(v,g))}return e._zod.parse(h,g)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(v=>u(v,c,p)):u(h,c,p)}let g=e._zod.parse(c,p);if(g instanceof Promise){if(p.async===!1)throw new se;return g.then(h=>i(h,n,p))}return i(g,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Nt.init(e,t)});var Wn=T("$ZodURL",(e,t)=>{hr.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 vr=T("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),qn=T("$ZodNumberFormat",(e,t)=>{Mn.init(e,t),vr.init(e,t)}),xr=T("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Cn,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}}),Kn=T("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=Dn,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 Jn=T("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Xn=T("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var Yn=T("$ZodVoid",(e,t)=>{G.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}}),Qn=T("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Vn(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Vn,"handleArrayResult");var eo=T("$ZodArray",(e,t)=>{G.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 u=[];for(let c=0;c<i.length;c++){let p=i[c],g=t.element._zod.run({value:p,issues:[]},n);g instanceof Promise?u.push(g.then(h=>Vn(h,r,c))):Vn(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function Su(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(Su,"normalizeDef");function Au(e,t,r,n,i,u){let c=[],p=i.keySet,g=i.catchall._zod,h=g.def.type,v=g.optout==="optional";for(let b in t){if(p.has(b))continue;if(h==="never"){c.push(b);continue}let _=g.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Dt(s,r,b,t,v))):Dt(_,r,b,t,v)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Au,"handleCatchall");var to=T("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...p};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=$t(()=>Su(t));q(e._zod,"propValues",()=>{let p=t.shape,g={};for(let h in p){let v=p[h]._zod;if(v.values){g[h]??(g[h]=new Set);for(let b of v.values)g[h].add(b)}}return g});let i=Ye,u=t.catchall,c;e._zod.parse=(p,g)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let v=[],b=c.shape;for(let _ of c.keys){let s=b[_],d=s._zod.optout==="optional",y=s._zod.run({value:h[_],issues:[]},g);y instanceof Promise?v.push(y.then(m=>Dt(m,p,_,h,d))):Dt(y,p,_,h,d)}return u?Au(v,h,p,g,n.value,e):v.length?Promise.all(v).then(()=>p):p}});function Zn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Le(u));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(u=>u.issues.map(c=>be(c,n,le())))}),t)}o(Zn,"handleUnionResults");var _r=T("$ZodUnion",(e,t)=>{G.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>zt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let g of t.options){let h=g._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(g=>Zn(g,i,e,u)):Zn(p,i,e,u)}});var ro=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,_r.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,g]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of g)i[p].add(h)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of p){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var no=T("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Sn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let v=t.valueType._zod.run({value:i[h],issues:[]},n);v instanceof Promise?u.push(v.then(b=>{b.issues.length&&r.issues.push(...Pe(h,b.issues)),r.value[h]=b.value})):(v.issues.length&&r.issues.push(...Pe(h,v.issues)),r.value[h]=v.value)}let g;for(let h in i)p.has(h)||(g=g??[],g.push(h));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let g=t.keyType._zod.run({value:p,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&gr.test(p)&&g.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(g=b)}if(g.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(b=>be(b,n,le())),input:p,path:[p],inst:e});continue}let v=t.valueType._zod.run({value:i[p],issues:[]},n);v instanceof Promise?u.push(v.then(b=>{b.issues.length&&r.issues.push(...Pe(p,b.issues)),r.value[g.value]=b.value})):(v.issues.length&&r.issues.push(...Pe(p,v.issues)),r.value[g.value]=v.value)}}return u.length?Promise.all(u).then(()=>r):r}});var oo=T("$ZodEnum",(e,t)=>{G.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?Me(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),io=T("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Me(n):n?Me(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var ao=T("$ZodTransform",(e,t)=>{G.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 se;return r.value=i,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Hn,"handleOptionalResult");var so=T("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${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(u=>Hn(u,r.value)):Hn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var uo=T("$ZodNullable",(e,t)=>{G.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var co=T("$ZodPipe",(e,t)=>{G.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Rt(c,t.in,n)):Rt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Rt(u,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 po=T("$ZodCustom",(e,t)=>{Te.init(e,t),G.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(u=>Gn(u,r,n,e));Gn(i,r,n,e)}});function Gn(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(fr(i))}}o(Gn,"handleRefineResult");var mo;var Pr=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 fo(){return new Pr}o(fo,"registry");(mo=globalThis).__zod_globalRegistry??(mo.__zod_globalRegistry=fo());var br=globalThis.__zod_globalRegistry;function go(e,t){return new e({type:"string",...V(t)})}o(go,"_string");function yo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(yo,"_coercedString");function ho(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(ho,"_url");function vo(e,t){return new e({type:"number",checks:[],...V(t)})}o(vo,"_number");function xo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(xo,"_coercedNumber");function _o(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(_o,"_int");function Po(e,t){return new e({type:"boolean",...V(t)})}o(Po,"_boolean");function bo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(bo,"_coercedBoolean");function To(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(To,"_coercedBigint");function Io(e){return new e({type:"any"})}o(Io,"_any");function Eo(e){return new e({type:"unknown"})}o(Eo,"_unknown");function So(e,t){return new e({type:"void",...V(t)})}o(So,"_void");function Ao(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(Ao,"_coercedDate");function Ct(e,t){return new Un({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Ct,"_gte");function oe(e,t){return new Ln({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function Ie(e,t){return new jn({check:"string_format",format:"regex",...V(t),pattern:e})}o(Ie,"_regex");function $o(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o($o,"_custom");var K=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>kt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>wt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(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)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=T("ZodMiniString",(e,t)=>{Nt.init(e,t),K.init(e,t)});function a(e){return go(Mt,e)}o(a,"string");var zo=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Mt.init(e,t)});var ju=T("ZodMiniURL",(e,t)=>{Wn.init(e,t),zo.init(e,t)});function Oo(e){return ho(ju,e)}o(Oo,"url");var Lt=T("ZodMiniNumber",(e,t)=>{vr.init(e,t),K.init(e,t)});function J(e){return vo(Lt,e)}o(J,"number");var Fu=T("ZodMiniNumberFormat",(e,t)=>{qn.init(e,t),Lt.init(e,t)});function ko(e){return _o(Fu,e)}o(ko,"int");var Tr=T("ZodMiniBoolean",(e,t)=>{xr.init(e,t),K.init(e,t)});function j(e){return Po(Tr,e)}o(j,"boolean");var wo=T("ZodMiniBigInt",(e,t)=>{Kn.init(e,t),K.init(e,t)});var Bu=T("ZodMiniAny",(e,t)=>{Jn.init(e,t),K.init(e,t)});function nt(){return Io(Bu)}o(nt,"any");var Vu=T("ZodMiniUnknown",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(){return Eo(Vu)}o(R,"unknown");var Zu=T("ZodMiniVoid",(e,t)=>{Yn.init(e,t),K.init(e,t)});function Ro(e){return So(Zu,e)}o(Ro,"_void");var Do=T("ZodMiniDate",(e,t)=>{Qn.init(e,t),K.init(e,t)});var Hu=T("ZodMiniArray",(e,t)=>{eo.init(e,t),K.init(e,t)});function z(e,t){return new Hu({type:"array",element:e,...V(t)})}o(z,"array");var Gu=T("ZodMiniObject",(e,t)=>{to.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new Gu(r)}o(l,"object");var Wu=T("ZodMiniUnion",(e,t)=>{_r.init(e,t),K.init(e,t)});function C(e,t){return new Wu({type:"union",options:e,...V(t)})}o(C,"union");var qu=T("ZodMiniDiscriminatedUnion",(e,t)=>{ro.init(e,t),K.init(e,t)});function Ee(e,t,r){return new qu({type:"union",options:t,discriminator:e,...V(r)})}o(Ee,"discriminatedUnion");var Ku=T("ZodMiniRecord",(e,t)=>{no.init(e,t),K.init(e,t)});function D(e,t,r){return new Ku({type:"record",keyType:e,valueType:t,...V(r)})}o(D,"record");var Ju=T("ZodMiniEnum",(e,t)=>{oo.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function A(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ju({type:"enum",entries:r,...V(t)})}o(A,"_enum");var Xu=T("ZodMiniLiteral",(e,t)=>{io.init(e,t),K.init(e,t)});function S(e,t){return new Xu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var Yu=T("ZodMiniTransform",(e,t)=>{ao.init(e,t),K.init(e,t)});function Se(e){return new Yu({type:"transform",transform:e})}o(Se,"transform");var Qu=T("ZodMiniOptional",(e,t)=>{so.init(e,t),K.init(e,t)});function f(e){return new Qu({type:"optional",innerType:e})}o(f,"optional");var ec=T("ZodMiniNullable",(e,t)=>{uo.init(e,t),K.init(e,t)});function ot(e){return new ec({type:"nullable",innerType:e})}o(ot,"nullable");var tc=T("ZodMiniPipe",(e,t)=>{co.init(e,t),K.init(e,t)});function Ae(e,t){return new tc({type:"pipe",in:e,out:t})}o(Ae,"pipe");var rc=T("ZodMiniCustom",(e,t)=>{po.init(e,t),K.init(e,t)});function jt(e,t){return $o(rc,e??(()=>!0),t)}o(jt,"custom");var it={};Pn(it,{bigint:()=>uc,boolean:()=>sc,date:()=>cc,number:()=>ac,string:()=>ic});function ic(e){return yo(Mt,e)}o(ic,"string");function ac(e){return xo(Lt,e)}o(ac,"number");function sc(e){return bo(Tr,e)}o(sc,"boolean");function uc(e){return To(wo,e)}o(uc,"bigint");function cc(e){return Ao(Do,e)}o(cc,"date");var Er=l({retryOnFailure:l({defaultValue:f(j()),hide:f(j())}),continueOnFailure:l({defaultValue:f(j()),hide:f(j())})}),Ir=class{constructor(t,r,n,i,u,c,p,g,h,v,b,_,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=p;this.requireAuth=g;this.errorHandlingOptions=h;this.outputSchema=v;this.audience=b;this.aiMetadata=_;this.classification=s}static{o(this,"IAction")}},Ft=o(e=>new Ir(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var L=l({displayName:a(),description:f(a()),advanced:f(j()),width:f(A(["half","full"])),icon:f(a()),placeholder:f(a())}),N=o((e,t)=>l({type:S(t),required:j(),defaultValue:f(nt())}),"TPropertyValue");var ee=l({...L.shape,...N(a(),"SHORT_TEXT").shape}),de=l({...L.shape,...N(a(),"LONG_TEXT").shape});var Co=l({label:a(),value:R(),description:f(a()),icon:f(a())}),Bt=l({disabled:f(j()),placeholder:f(a()),options:z(Co)});var lc=A(["cards"]),te=l({...L.shape,options:Bt,display:f(lc),...N(R(),"STATIC_DROPDOWN").shape}),me=l({...L.shape,options:Bt,...N(z(R()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Sr=l({...L.shape,...N(R(),"DROPDOWN").shape,refreshers:z(a())}),at=l({...L.shape,...N(z(R()),"MULTI_SELECT_DROPDOWN").shape,refreshers:z(a())});var fe=l({...L.shape,reveals:f(z(a())),...N(j(),"CHECKBOX").shape});var ge=l({...L.shape,display:f(A(["stepper"])),min:f(J()),max:f(J()),step:f(J()),...N(J(),"NUMBER").shape});var st=l({...L.shape,streaming:f(j()),...N(R(),"FILE").shape});var ut=l({...L.shape,...N(a(),"DATE_TIME").shape});var Uo=D(a(),C([ee,de,te,at,me,fe,ge,st,ut])),ct=l({...L.shape,properties:Uo,...N(z(R()),"ARRAY").shape});var Mo=A(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Lo=l({preset:f(Mo),after:f(a()),before:f(a())}),Ar=l({...L.shape,display:f(A(["dropdown"])),...N(Lo,"DATE_RANGE").shape});var pt=l({...L.shape,...N(C([D(a(),R())]),"JSON").shape});var jo=C([ee,te,pt,ct,me]),dc=D(a(),jo),$r=l({refreshers:z(a()),...L.shape,...N(R(),"DYNAMIC").shape});var Vt=l({...L.shape,...N(Ro(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),dt=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(dt||{});var mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(mt||{}),zr="both_client_credentials_and_authorization_code";var $e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))($e||{}),ft=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(ft||{}),mc=l({strategy:A(ft),paramName:f(a())}),gt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(gt||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Fo=l({status:f(J()),body:f(R()),headers:f(D(a(),a()))}),Bo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f(A(Zt))}),Vo=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Fo,handlerId:f(a()),streamStepProgress:f(A(Zt))}),fc=C([Bo,Vo]);var gc=l({body:R(),rawBody:f(R()),headers:D(a(),a()),queryParams:D(a(),a())});function re(e){return e==null}o(re,"isNil");function yt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(yt,"isEmpty");function Ht(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ht,"assertNotNullOrUndefined");var Or=Ue(require("crypto"),1);var yc=128,ze,Fe,hc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*yc),Or.default.randomFillSync(ze),Fe=0):Fe+e>ze.length&&(Or.default.randomFillSync(ze),Fe=0)}catch(t){throw ze=void 0,t}Fe+=e},"fillPool"),vc=o(e=>(hc(e|=0),ze.subarray(Fe-e,Fe)),"random"),xc=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(u=t)=>{if(u<=0)return"";let c="";for(;;){let p=r(i),g=i;for(;g--;)if(c+=e[p[g]&n]||"",c.length===u)return c}}},"customRandom"),Ho=o((e,t=21)=>xc(e,t,vc),"customAlphabet");var _c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,Nb=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),Pc=Ho(_c,Go);var Oe=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ne={id:a(),created:Oe,updated:Oe},H=o(e=>f(ot(e)),"Nullable");function kr(e){return f(ot(A(e)))}o(kr,"NullableEnum");var Mb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(j())),Gt=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(z(e))),"OptionalArrayFromQuery");var Fb=D(a(),R());var ht=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(ht||{});var Qb=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var tT=l({filename:a(),data:R(),type:S("file"),mimetype:f(a())});var bc=Ue(qo());var uT=l({...ne,name:a(),permissions:z(a()),platformId:H(a()),type:a(),userCount:f(J())});var Ko=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Ko||{}),wr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(wr||{}),Rr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Rr||{});var Dr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Dr||{});var Nr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Nr||{});var Tc=l({mode:A(Ko),value:R()}),Ic=l({auth:f(a()),fields:D(a(),Tc)}),Ec=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(Ic)}),Sc=l({type:S("PIECE"),toolName:a().check(oe(1)),pieceMetadata:Ec}),Ac=l({type:S("none")}),$c=l({type:S("access_token"),accessToken:a()}),zc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Oc=l({type:S("headers"),headers:D(a(),a())}),kc=Ee("type",[Ac,$c,zc,Oc]),Jo=l({type:S("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:f(a())}),Xo=l({type:S("MCP"),toolName:a().check(oe(1)),serverUrl:Oo(),protocol:A(Rr),auth:kc}),Yo=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:A(wr),sourceId:a(),sourceName:a()}),wc=Ee("type",[Sc,Jo,Xo,Yo]),Rc=l({displayName:a(),description:f(a()),type:A(Dr)}),Qo=l({type:S("MARKDOWN"),markdown:a()}),Be={type:S("TOOL_CALL"),input:H(D(a(),R())),output:f(R()),toolName:a(),status:A(Nr),toolCallId:a(),startTime:a(),endTime:f(a())},LT=l(Be),ei=Ee("toolCallType",[l({...Be,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:S("UNKNOWN"),displayName:a()})]),Dc=C([Qo,ei]);var Cr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Cr||{}),ye=l({apiKey:a()}),Nc=ye,Cc=l({apiKey:a(),apiKeyHash:a()}),Uc=ye,Mc=ye,Lc=ye,jc=ye,Fc=ye,Bc=ye,Vc=ye,ii=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),Zc=l({}),Hc=l({}),Gc=l({}),Wc=l({}),qc=l({}),Kc=l({}),ai=l({modelId:a(),modelName:a(),modelType:A(Cr)}),si=l({apiKeyHeader:a(),baseUrl:a(),models:z(ai),defaultHeaders:f(D(a(),a()))}),ui=l({accountId:a(),gatewayId:a(),models:z(ai),vertexProject:f(a()),vertexRegion:f(a())}),ci=l({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),pi=l({region:a().check(oe(1))}),Jc=C([Nc,Lc,jc,Fc,Bc,Mc,Uc,Cc,ii,Vc]),li=C([si,ui,ci,pi,Zc,Gc,Wc,qc,Hc,Kc]),Xc=l({id:a(),name:a(),type:A(Cr)}),Yc=l({id:a(),name:a(),provider:A(ht),config:li,enabledForChat:j()}),Qc=l({provider:A(ht),config:li,auth:Jc,platformId:a()});var VT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ti=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],ep=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],tp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],ri=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],rp=["grok-4.20","grok-4.1-fast"],np={openai:ti,anthropic:ep,google:ri,activepieces:[...tp.map(e=>`anthropic/${e}`),...ti.map(e=>`openai/${e}`),...ri.map(e=>`google/${e}`),...rp.map(e=>`x-ai/${e}`)]};var ni=128e3,op={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function ip({provider:e}){return e?op[e]??ni:ni}o(ip,"getMaxContextTokens");var oi={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},ap={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},sp=new Set(["anthropic","mistral"]);function ue(e){return{chatModels:np[e],maxContextTokens:ip({provider:e}),defaultEmbeddingModel:oi[e],supportsEmbedding:oi[e]!==void 0,supportsImageGeneration:!sp.has(e),webSearch:ap[e]}}o(ue,"buildProviderCapabilities");var up={openai:ue("openai"),anthropic:ue("anthropic"),openrouter:ue("openrouter"),azure:ue("azure"),google:ue("google"),"cloudflare-gateway":ue("cloudflare-gateway"),custom:ue("custom"),bedrock:ue("bedrock"),mistral:ue("mistral"),activepieces:ue("activepieces")};var cp=l({base64Url:a(),fileName:a(),extension:f(a())}),pp=l({mimeType:a(),url:a(),fileName:f(a())}),Ur=C([cp,pp]);var lp=C([l({type:S("file"),value:Ur}),l({type:S("markdown"),value:a(),files:f(z(Ur))})]),dp=l({sessionId:a(),message:a(),files:f(z(a()))});var mi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(mi||{}),fi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(fi||{}),Mr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Mr||{});var mp=C([l({...ne,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:z(l({value:a()}))})}),l({...ne,name:a(),externalId:a(),type:C([S("TEXT"),S("NUMBER"),S("DATE"),S("DATETIME")]),tableId:a(),projectId:a()})]),fp=l({...ne,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:kr(fi),trigger:kr(mi)}),gp=l({...ne,tableId:a(),projectId:a(),cells:D(a(),l({updated:a(),created:a(),value:R(),fieldName:a()}))}),yp=l({events:z(A(Mr)),webhookUrl:a(),flowId:a()}),hp=l({fields:z(l({id:a(),name:a()})),rows:z(D(a(),a())),name:a()}),vp=l({projectId:a(),limit:f(it.number()),cursor:f(a()),name:f(a()),externalIds:Gt(a()),folderId:f(a()),folderIds:Gt(a())}),xp=l({records:z(z(l({fieldId:a(),value:yi()}))),tableId:a()}),_p=l({cells:f(z(l({fieldId:a(),value:yi()}))),tableId:a(),agentUpdate:f(j())}),gi=Ee("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),di("exists"),di("not_exists")]),Pp=l({tableId:a(),limit:f(it.number()),cursor:f(a()),filters:Gt(gi)});function yi(){return Ae(Se(e=>e==null?e:String(e)),ot(a()))}o(yi,"coerceToString");function Re(e){return l({fieldId:a(),operator:S(e),value:a()})}o(Re,"valueFilter");function di(e){return l({fieldId:a(),operator:S(e)})}o(di,"existenceFilter");var bp=l({status:f(J()),body:f(R()),headers:f(D(a(),a()))}),Tp=l({...ne,deleted:H(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var hi=l({name:a(),description:f(a()),type:a(),required:j()}),Ip=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:z(hi),returnsResponse:j()})});var vi="^[0-9]+\\.[0-9]+\\.[0-9]+$",uI=new RegExp(vi),Sp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",cI=a().check(Ie(new RegExp(vi))),pI=a().check(Ie(new RegExp(Sp))),Ap=l({packageType:S("ARCHIVE"),pieceType:A(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),xi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),_i=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),lI=C([xi,_i]),dI=C([Ap,xi,_i]);var $p=Ee("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:ko().check(Ct(6e4))})]),mI=l({...ne,type:A($e),projectId:a(),flowId:a(),triggerName:a(),schedule:H($p),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:j()}),Pi=(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))(Pi||{}),bi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(bi||{}),Ti=(r=>(r.S3="S3",r.DB="DB",r))(Ti||{}),fI=l({...ne,projectId:H(a()),platformId:H(a()),type:A(Pi),compression:A(bi),data:f(R()),location:A(Ti),size:H(J()),fileName:H(a()),s3Key:H(a()),metadata:H(D(a(),a()))}),Ii=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ii||{}),Ei=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ei||{}),gI=l({id:a(),email:a(),firstName:a(),status:A(Ei),externalId:H(a()),platformId:H(a()),platformRole:A(Ii),lastName:a(),created:Oe,updated:Oe,lastActiveDate:H(Oe),imageUrl:H(a())});var Lr=l({...L.shape,...N(D(a(),R()),"OBJECT").shape});var jr=l({...L.shape,formatProperty:f(a()),...N(a(),"RICH_TEXT").shape});var zi=l({...L.shape,...N(a(),"COLOR").shape});var Fr=C([ee,de,jr,Vt,fe,te,me,Sr,at,$r,ge,ct,Lr,pt,ut,Ar,st,zi]),B={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var ce=l({displayName:a(),description:f(a()),hasConnectionIdentifier:f(j())});var Oi=l({username:a(),password:a()}),Br=l({...ce.shape,username:l({displayName:a(),description:f(a())}),password:l({displayName:a(),description:f(a())}),...N(Oi,"BASIC_AUTH").shape});var wp=D(a(),C([ee,de,ge,fe,te])),Vr=l({...ce.shape,props:wp,...N(R(),"CUSTOM_AUTH").shape});var De=l({...ce.shape,...N(l({auth:a()}),"SECRET_TEXT").shape});var Rp=D(a(),C([ee,de,De,ge,fe,te,me,Vt])),ki=l({...ce.shape,props:Rp,...N(R(),"OIDC").shape});var Zr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zr||{}),wi=C([ee,De,te]),Ri=D(a(),wi),Dp=l({props:f(D(a(),wi)),authUrl:a(),tokenUrl:a(),scope:z(a()),prompt:f(C([S("none"),S("consent"),S("login"),S("omit")])),pkce:f(j()),pkceMethod:f(C([S("plain"),S("S256")])),authorizationMethod:f(A(Zr)),grantType:f(C([A(mt),S(zr)])),extra:f(D(a(),a()))}),Di=l({access_token:a(),props:f(Ri),data:D(a(),nt())}),Hr=l({...ce.shape,...Dp.shape,...N(Di,"OAUTH2").shape});var Ve=C([Br,Vr,ki,Hr,De]),vt="Connection",qt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||vt}},None(){}};var YE={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 Np=l({...L.shape,...N(R(),"CUSTOM").shape,code:a()});var Cp=C([Fr,Ve]),Gr=D(a(),Cp),xS=D(a(),Fr);var Ni=C([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]),Ze=class{constructor(t,r,n,i,u,c,p,g,h,v,b,_,s,d,y,m,x,P,M,Q,ae){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=g;this.renewConfiguration=h;this.onRenew=v;this.onEnable=b;this.onDisable=_;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=M;this.classification=Q;this.propertyGroups=ae}static{o(this,"ITrigger")}},Ci=o(e=>{switch(e.type){case"WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new Ze(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,re(e.sampleData)&&re(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Ui="2",Kt="0.82.0";var Wr=class{constructor(t,r,n,i,u,c,p,g,h=Kt,v,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=g;this.minimumSupportedRelease=h;this.maximumSupportedRelease=v;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ui}),"getContextInfo");(!Mp(h)||Lp(h,Kt))&&(this.minimumSupportedRelease=Kt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}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:Up(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}},Li=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(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 Up(e){if(e!==void 0)return Array.isArray(e)?e.map(Mi):Mi(e)}o(Up,"withConnectionIdentifierFlag");function Mi(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Mi,"flagConnectionIdentifier");function Mp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Mp,"isValidSimpleSemver");function Lp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Lp,"isSemverLessThan");var jp=f(D(a(),D(a(),a()))),ji=l({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:z(a()),platformId:f(a()),directoryPath:f(a()),auth:f(C([Ve,z(Ve)])),version:a(),categories:f(z(A(dt))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(j()),i18n:jp}),Fp=A(["human","ai","both"]),Fi=l({description:f(a()),idempotent:f(j())}),Bi=A(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Bp=A(["tabs","section","summary","builder","footer"]),Vi=l({key:a(),display:Bp,label:f(a()),description:f(a()),icon:f(a()),props:z(a())}),Zi=l({name:a(),displayName:a(),description:a(),props:Gr,propertyGroups:f(z(Vi)),requireAuth:j(),errorHandlingOptions:f(Er),outputSchema:f(jt()),audience:f(Fp),aiMetadata:f(Fi),classification:f(Bi)}),Hi=l({name:a(),displayName:a(),description:a(),props:Gr,propertyGroups:f(z(Vi)),errorHandlingOptions:f(Er),type:A($e),sampleData:R(),handshakeConfiguration:f(jt()),renewConfiguration:f(Ni),testStrategy:A(gt),outputSchema:f(jt()),aiMetadata:f(Fi),classification:f(Bi)}),Vp=l({...ji.shape,actions:D(a(),Zi),triggers:D(a(),Hi)}),Zp=l({...ji.shape,actions:J(),triggers:J(),suggestedActions:f(z(Zi)),suggestedTriggers:f(z(Hi))}),Gi=l({projectUsage:J(),pieceType:A(je),packageType:A(lt),platformId:f(a()),archiveId:f(a())}),PA=l({...Vp.shape,...Gi.shape}),bA=l({...Zp.shape,...Gi.shape}),TA=l({name:a(),version:a()});var Hp=Ue(require("path")),Gp=Ue(require("fs/promises"));var He=require("node:stream");var Jt=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((u,c)=>{i.append(c,u)}),{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 Xt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new qr,r=new Kr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},qr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Kr=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 xt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Wi({error:e,requestBody:t}){return e instanceof xt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Wi,"toFailsafeOutput");var _t=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(_t||{});var Yt=class extends Jt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Xt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,Q]of Object.entries(c))i.append(M,Q);let p=i.toString(),g=p?`${n}?${p}`:n,h=t.responseType??"json",v=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Wp(t.method)?qp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Jp({...u,...s}),m=await Kp(async()=>{let M=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:y,body:_,redirect:v?"follow":"manual",signal:M.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(g,ae)}finally{Q!==void 0&&clearTimeout(Q)}},d?0:b),x=v?300:400;if(m.status<200||m.status>=x){let M=await qi(m,h==="stream"?"text":h),Q=new xt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let P=await qi(m,h);return{status:m.status,headers:Xp(m.headers),body:P}}};function Wp(e){return e!=="GET"&&e!=="HEAD"}o(Wp,"acceptsRequestBody");function qp(e,t){if(Ji(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Yp(e)){let n=new He.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof He.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(qp,"serializeBody");async function qi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Ji(e.body)?He.Readable.from([]):He.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(qi,"parseResponseBody");async function Kp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ki(n);continue}return i}catch(i){if(r=i,n<t){await Ki(n);continue}throw i}throw r}o(Kp,"sendWithRetries");function Ki(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ki,"backoff");function Jp(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(Jp,"normalizeHeaders");function Xp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Xp,"toHttpHeaders");function Yp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Yp,"isNodeFormData");function Ji(e){return e==null}o(Ji,"isNil");var he=new Yt;var Ld=Ue(require("fs")),ru=Ue(tu());var jd={"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 Fd(e){let t=e.split(";")[0].trim().toLowerCase();return jd[t]??""}o(Fd,"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"),Vd=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 nu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:g="headers",classification:h="WRITE"}){return Ft({audience:"human",name:u||"custom_api_call",classification:h,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:B.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:v})=>({url:B.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Vd(t,v)}/resource or /resource`,required:!0,defaultValue:v?t(v):"",...c?.url??{}})}),"props")}),method:B.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(_t).map(v=>({label:v,value:v}))},...c?.method??{}}),headers:B.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:B.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:B.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:B.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:v})=>{if(!v)return{};let b=v,_={};switch(b){case"none":break;case"json":_.data=B.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":_.data=B.LongText({displayName:"Raw Body",required:!0});break;case"form_data":_.data=B.Array({displayName:"Form Data",required:!0,properties:{fieldName:B.ShortText({displayName:"Field Name",required:!0}),fieldType:B.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:B.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:B.File({displayName:"File Field Value",required:!1})}});break}return _},"props")}),response_is_binary:B.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:B.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:B.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:B.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async v=>{let{method:b,url:_,headers:s,queryParams:d,body:y,body_type:m,failsafe:x,timeout:P,response_is_binary:M,followRedirects:Q}=v.propsValue;Ht(b,"Method"),Ht(_,"URL");let ae=re(r)?{}:await r(v.auth,v.propsValue),xe=_.url,uu=xe.startsWith("http://")||xe.startsWith("https://")?xe:Bd({baseUrl:t(v.auth),relativePath:xe}),_e={method:b,url:uu,headers:{...s??{},...g==="headers"||!re(g)?ae:{}},queryParams:{...g==="queryParams"?ae:{},...d??{}},timeout:P?P*1e3:0,followRedirects:Q};if(M&&(_e.responseType="arraybuffer"),y)if(m&&m!=="none"){let pe=y.data;if(m==="form_data"){let cu=pe,Et=new ru.default;for(let{fieldName:vn,fieldType:xn,textFieldValue:_n,fileFieldValue:cr}of cu)xn==="text"&&!yt(_n)?Et.append(vn,_n):xn==="file"&&!yt(cr)&&Et.append(vn,cr.data,{filename:cr?.filename});_e.body=Et,_e.headers={..._e.headers,...Et.getHeaders()}}else _e.body=pe}else m||(_e.body=y);try{let pe=await he.sendRequest(_e);return await Zd(v.files,pe.body,pe.status,pe.headers,M)}catch(pe){if(x)return Wi({error:pe,requestBody:_e.body});throw pe}},"run")})}o(nu,"createCustomApiCallAction");var Zd=o(async(e,t,r,n,i)=>{let u;if(i&&Hd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Fd(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Hd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");function It(e,t){let r=(e??"").replace(/\/+$/,"");return{WEBHOOKS:`${r}/api/v1/accounts/${t}/webhooks`,WEBHOOK_BY_ID:o(n=>`${r}/api/v1/accounts/${t}/webhooks/${n}`,"WEBHOOK_BY_ID"),CONVERSATION_MESSAGES:o(n=>`${r}/api/v1/accounts/${t}/conversations/${n}/messages`,"CONVERSATION_MESSAGES"),PROFILE:`${r}/auth/sign_in`}}o(It,"chatwootEndpoints");var ve="api_access_token";function we(e){return{baseUrl:e.props.baseUrl??"",accountId:e.props.accountId??0,apiAccessToken:e.props.apiAccessToken??""}}o(we,"getChatwootAuth");var Gd=`
|
|
4
4
|
To connect your Chatwoot account:
|
|
5
5
|
|
|
6
6
|
**Chatwoot URL:**
|
|
@@ -17,7 +17,7 @@ To connect your Chatwoot account:
|
|
|
17
17
|
1. In your Chatwoot dashboard, the Account ID is visible in the URL: \`/app/accounts/{ACCOUNT_ID}/...\`
|
|
18
18
|
2. It is a numeric value (e.g. 1, 2, etc.)
|
|
19
19
|
|
|
20
|
-
`,
|
|
20
|
+
`,Ce=qt.CustomAuth({displayName:"Chatwoot Connection",required:!0,description:Gd,props:{baseUrl:B.ShortText({displayName:"Chatwoot URL",description:"Your Chatwoot instance URL (e.g. https://app.chatwoot.com)",required:!0,defaultValue:"https://app.chatwoot.com"}),apiAccessToken:qt.SecretText({displayName:"API Access Token",description:"Your user API access token from Profile Settings",required:!0}),accountId:B.Number({displayName:"Account ID",description:"Your numeric account ID (visible in the dashboard URL)",required:!0})}});var ou=3,Wd=1e3;async function qd(e,t,r,n,i){let c=It(e,t).CONVERSATION_MESSAGES(r),p;for(let g=0;g<ou;g++)try{return(await he.sendRequest({method:"POST",url:c,headers:{[ve]:n,"Content-Type":"application/json"},body:i})).body}catch(h){p=h instanceof Error?h:new Error(String(h));let b=h.response?.status;if(!(b===429||b!==void 0&&b>=500)||g===ou-1)throw p;let s=Wd*Math.pow(2,g);await new Promise(d=>setTimeout(d,s))}throw p??new Error("Send message failed after retries")}o(qd,"sendWithRetry");var iu=Ft({auth:Ce,name:"send_message",classification:"WRITE",displayName:"Send Message",description:"Send a message reply to a Chatwoot conversation",audience:"both",aiMetadata:{description:"Posts a new message to an existing Chatwoot conversation, identified by its numeric conversation display ID. Use to reply to a customer or, by enabling the private-note option, to leave an internal note visible only to agents rather than to the contact. Not idempotent \u2014 each call appends another message.",idempotent:!1},props:{conversationId:B.Number({displayName:"Conversation ID",description:"The numeric conversation display ID. Available from the trigger output.",required:!0}),message:B.LongText({displayName:"Message",description:"The text message to send",required:!0}),isPrivate:B.Checkbox({displayName:"Private Note",description:"If checked, sends as a private note visible only to agents (not the contact)",required:!0,defaultValue:!1})},async run(e){let{conversationId:t,message:r,isPrivate:n}=e.propsValue,i=we(e.auth),u={content:r,message_type:"outgoing",private:n,content_type:"text"},c=await qd(i.baseUrl,i.accountId,t,i.apiAccessToken,u);return{success:!0,messageId:c.id,conversationId:c.conversation_id,status:c.status}}});var hn="_chatwoot_webhook_id";function ur(e){return e==null||typeof e!="string"?"":e.trim().replace(/\/+$/,"")}o(ur,"normalizeUrl");function au(e){if(Array.isArray(e))return e;if(e&&typeof e=="object"){let t=e;for(let i of["payload","data","webhooks"]){let u=t[i];if(Array.isArray(u))return u}let r=t.payload;if(r&&typeof r=="object"){let u=r.webhooks;if(Array.isArray(u))return u}let n=t.data;if(n&&typeof n=="object"){let u=n.webhooks;if(Array.isArray(u))return u}}return[]}o(au,"toWebhookList");var su=Ci({auth:Ce,name:"new_message",classification:"READ",displayName:"New Incoming Message",description:"Triggers when a contact sends a new message in a Chatwoot conversation",aiMetadata:{description:"Fires when a contact sends a new inbound message in a Chatwoot conversation. Only incoming, non-empty messages are emitted (outgoing agent replies and private notes are filtered out), representing a fresh customer message awaiting a response."},type:"WEBHOOK",props:{},sampleData:{messageId:42,content:"Hello, I need help with my order",messageType:"incoming",conversationId:7,contactId:15,contactName:"Jane Doe",accountId:1,createdAt:"2024-06-15 10:30:00 UTC"},async onEnable(e){let t=we(e.auth),r=It(t.baseUrl,t.accountId),n=e.webhookUrl,i;try{let u=await he.sendRequest({method:"GET",url:r.WEBHOOKS,headers:{[ve]:t.apiAccessToken}}),c=au(u.body),p=ur(n),g=c.find(h=>ur(h.url)===p);g?i=g.id:i=(await he.sendRequest({method:"POST",url:r.WEBHOOKS,headers:{[ve]:t.apiAccessToken,"Content-Type":"application/json"},body:{url:n,subscriptions:["message_created"]}})).body.payload.webhook.id}catch(u){let c=u?.response?.status,p=u?.response?.body;if(c===422&&p&&typeof p=="object"&&"message"in p&&p.message?.includes("already been taken")){let g=await he.sendRequest({method:"GET",url:r.WEBHOOKS,headers:{[ve]:t.apiAccessToken}}),h=au(g.body),v=ur(n),b=h.find(_=>ur(_.url)===v);if(b?.id)i=b.id;else throw u}else throw u}await e.store.put(hn,{webhookId:i})},async onDisable(e){let t=we(e.auth),r=It(t.baseUrl,t.accountId),n=await e.store.get(hn);if(n?.webhookId){try{await he.sendRequest({method:"DELETE",url:r.WEBHOOK_BY_ID(n.webhookId),headers:{[ve]:t.apiAccessToken}})}catch(i){console.error("[Chatwoot] Error deleting webhook:",i)}await e.store.delete(hn)}},async run(e){let t=e.payload?.body,r=t&&typeof t=="object"&&"payload"in t?t.payload:t;if(!r||typeof r!="object")return[];if(r.event!=="message_created")return[];if(r.message_type!=="incoming")return[];let u=r.content;if(u==null||String(u).trim().length===0)return[];let c=r.conversation,p=r.contact,g=r.sender,h=r.account,v=0;if(c!=null&&typeof c=="object"){if("display_id"in c){let P=c.display_id;v=P!=null&&Number(P)||0}else if("id"in c){let P=c.id;v=P!=null&&Number(P)||0}}let b=p||g,_=b!=null&&typeof b=="object"&&"id"in b&&Number(b.id)||0,s=b!=null&&typeof b=="object"&&"name"in b?String(b.name):"Unknown",d=h!=null&&typeof h=="object"&&"id"in h&&Number(h.id)||0,y=typeof r.id=="number"?r.id:Number(r.id)||0,m=r.created_at!=null?String(r.created_at):"";return[{messageId:y,content:String(u).trim(),messageType:"incoming",conversationId:v,contactId:_,contactName:s,accountId:d,createdAt:m}]}});var Kd=Li({displayName:"Chatwoot",description:"Receive and reply to customer messages with Chatwoot",auth:Ce,minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/chatwoot.png",authors:["AhmadTash"],actions:[iu,nu({auth:Ce,baseUrl:o(e=>we(e).baseUrl,"baseUrl"),authMapping:o(async e=>{let t=we(e);return{[ve]:t.apiAccessToken}},"authMapping")})],triggers:[su]});0&&(module.exports={chatwoot});
|
|
21
21
|
/*! Bundled license information:
|
|
22
22
|
|
|
23
23
|
mime-types/index.js:
|