@activepieces/piece-chatwoot 0.0.5 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-chatwoot",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var tu=Object.create;var Je=Object.defineProperty;var ru=Object.getOwnPropertyDescriptor;var nu=Object.getOwnPropertyNames;var ou=Object.getPrototypeOf,iu=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(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}},vn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nu(t))!iu.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=ru(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?tu(ou(e)):{},xn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),au=e=>xn(Je({},"__esModule",{value:!0}),e);var Zo=E((Bo,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 f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,v=(s.match(p.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(":"),oe=[];for(let Ke=0;Ke<Q.length;Ke++)oe.push(parseInt(Q[Ke],16));return oe})(),{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 x(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(x,"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 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 _.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(),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")}},_.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,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")}},_.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 v=d.slice(1,6),P=[];for(let M=0;M<v.length;M++)y=v[M],P.push(x(y));return P})();if(d=s.match(r.longValue)){if(m=x(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=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(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=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[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,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 _.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 _.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})(),_.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})`)}},_.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,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})`)}},_.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,v,P,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.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},_.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,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 Wt<"u"&&Wt.exports?Wt.exports=_:e.ipaddr=_})(Bo)});var Hi=E((_A,Vi)=>{var Zi=require("stream").Stream,Bp=require("util");Vi.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");Bp.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 Ki=E((bA,qi)=>{var Zp=require("util"),Gi=require("stream").Stream,Wi=Hi();qi.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");Zp.inherits(G,Gi);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 Gi.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 Xi=E((TA,Ji)=>{"use strict";Ji.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 ea=E(Y=>{"use strict";var Yt=Xi(),Vp=require("path").extname,Yi=/^\s*([^;\s]*)(?:;|\s|$)/,Hp=/^text\//i;Y.charset=Qi;Y.charsets={lookup:Qi};Y.contentType=Wp;Y.extension=Gp;Y.extensions=Object.create(null);Y.lookup=qp;Y.types=Object.create(null);Kp(Y.extensions,Y.types);function Qi(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Hp.test(t[1])?"UTF-8":!1}o(Qi,"charset");function Wp(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(Wp,"contentType");function Gp(e){if(!e||typeof e!="string")return!1;var t=Yi.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Gp,"extension");function qp(e){if(!e||typeof e!="string")return!1;var t=Vp("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(qp,"lookup");function Kp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var u=Yt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(Yt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>x||g===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Kp,"populateMaps")});var ra=E((SA,ta)=>{ta.exports=Jp;function Jp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Jp,"defer")});var Gr=E((zA,oa)=>{var na=ra();oa.exports=Xp;function Xp(e){var t=!1;return na(function(){t=!0}),o(function(n,i){t?e(n,i):na(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Xp,"async")});var qr=E((kA,ia)=>{ia.exports=Yp;function Yp(e){Object.keys(e.jobs).forEach(Qp.bind(e)),e.jobs={}}o(Yp,"abort");function Qp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Qp,"clean")});var Kr=E((RA,sa)=>{var aa=Gr(),el=qr();sa.exports=tl;function tl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=rl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?el(r):r.results[i]=c,n(u,r.results))})}o(tl,"iterate");function rl(e,t,r,n){var i;return e.length==2?i=e(r,aa(n)):i=e(r,t,aa(n)),i}o(rl,"runJob")});var Jr=E((DA,ua)=>{ua.exports=nl;function nl(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(nl,"state")});var Xr=E((UA,ca)=>{var ol=qr(),il=Gr();ca.exports=al;function al(e){Object.keys(this.jobs).length&&(this.index=this.size,ol(this),il(e)(null,this.results))}o(al,"terminator")});var la=E((LA,pa)=>{var sl=Kr(),ul=Jr(),cl=Xr();pa.exports=pl;function pl(e,t,r){for(var n=ul(e);n.index<(n.keyedList||e).length;)sl(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 cl.bind(n,r)}o(pl,"parallel")});var Yr=E((FA,Qt)=>{var da=Kr(),ll=Jr(),dl=Xr();Qt.exports=ml;Qt.exports.ascending=ma;Qt.exports.descending=fl;function ml(e,t,r,n){var i=ll(e,r);return da(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){da(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),dl.bind(i,n)}o(ml,"serialOrdered");function ma(e,t){return e<t?-1:e>t?1:0}o(ma,"ascending");function fl(e,t){return-1*ma(e,t)}o(fl,"descending")});var ga=E((ZA,fa)=>{var gl=Yr();fa.exports=yl;function yl(e,t,r){return gl(e,t,null,r)}o(yl,"serial")});var ha=E((HA,ya)=>{ya.exports={parallel:la(),serial:ga(),serialOrdered:Yr()}});var Qr=E((WA,va)=>{"use strict";va.exports=Object});var _a=E((GA,xa)=>{"use strict";xa.exports=Error});var ba=E((qA,Pa)=>{"use strict";Pa.exports=EvalError});var Ta=E((KA,Ia)=>{"use strict";Ia.exports=RangeError});var $a=E((JA,Ea)=>{"use strict";Ea.exports=ReferenceError});var Aa=E((XA,Sa)=>{"use strict";Sa.exports=SyntaxError});var er=E((YA,za)=>{"use strict";za.exports=TypeError});var ka=E((QA,Oa)=>{"use strict";Oa.exports=URIError});var Ra=E((ez,wa)=>{"use strict";wa.exports=Math.abs});var Da=E((tz,Na)=>{"use strict";Na.exports=Math.floor});var Ua=E((rz,Ca)=>{"use strict";Ca.exports=Math.max});var La=E((nz,Ma)=>{"use strict";Ma.exports=Math.min});var Fa=E((oz,ja)=>{"use strict";ja.exports=Math.pow});var Za=E((iz,Ba)=>{"use strict";Ba.exports=Math.round});var Ha=E((az,Va)=>{"use strict";Va.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=E((uz,Wa)=>{"use strict";var hl=Ha();Wa.exports=o(function(t){return hl(t)||t===0?t:t<0?-1:1},"sign")});var Ka=E((pz,qa)=>{"use strict";qa.exports=Object.getOwnPropertyDescriptor});var en=E((lz,Ja)=>{"use strict";var tr=Ka();if(tr)try{tr([],"length")}catch{tr=null}Ja.exports=tr});var Ya=E((dz,Xa)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Xa.exports=rr});var tn=E((mz,Qa)=>{"use strict";Qa.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 rs=E((gz,ts)=>{"use strict";var es=typeof Symbol<"u"&&Symbol,vl=tn();ts.exports=o(function(){return typeof es!="function"||typeof Symbol!="function"||typeof es("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vl()},"hasNativeSymbols")});var rn=E((hz,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=E((vz,os)=>{"use strict";var xl=Qr();os.exports=xl.getPrototypeOf||null});var ss=E((xz,as)=>{"use strict";var _l="Function.prototype.bind called on incompatible ",Pl=Object.prototype.toString,bl=Math.max,Il="[object Function]",is=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"),Tl=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"),El=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");as.exports=o(function(t){var r=this;if(typeof r!="function"||Pl.apply(r)!==Il)throw new TypeError(_l+r);for(var n=Tl(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,is(n,arguments));return Object(x)===x?x:this}return r.apply(t,is(n,arguments))},"binder"),c=bl(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+El(p,",")+"){ 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 Ve=E((Pz,us)=>{"use strict";var $l=ss();us.exports=Function.prototype.bind||$l});var nr=E((bz,cs)=>{"use strict";cs.exports=Function.prototype.call});var on=E((Iz,ps)=>{"use strict";ps.exports=Function.prototype.apply});var ds=E((Tz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var fs=E((Ez,ms)=>{"use strict";var Sl=Ve(),Al=on(),zl=nr(),Ol=ds();ms.exports=Ol||Sl.call(zl,Al)});var ys=E(($z,gs)=>{"use strict";var kl=Ve(),wl=er(),Rl=nr(),Nl=fs();gs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new wl("a function is required");return Nl(kl,Rl,t)},"callBindBasic")});var bs=E((Az,Ps)=>{"use strict";var Dl=ys(),hs=en(),xs;try{xs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!xs&&hs&&hs(Object.prototype,"__proto__"),_s=Object,vs=_s.getPrototypeOf;Ps.exports=an&&typeof an.get=="function"?Dl([an.get]):typeof vs=="function"?o(function(t){return vs(t==null?t:_s(t))},"getDunder"):!1});var Ss=E((Oz,$s)=>{"use strict";var Is=rn(),Ts=nn(),Es=bs();$s.exports=Is?o(function(t){return Is(t)},"getProto"):Ts?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ts(t)},"getProto"):Es?o(function(t){return Es(t)},"getProto"):null});var sn=E((wz,As)=>{"use strict";var Cl=Function.prototype.call,Ul=Object.prototype.hasOwnProperty,Ml=Ve();As.exports=Ml.call(Cl,Ul)});var Ds=E((Rz,Ns)=>{"use strict";var U,Ll=Qr(),jl=_a(),Fl=ba(),Bl=Ta(),Zl=$a(),qe=Aa(),Ge=er(),Vl=ka(),Hl=Ra(),Wl=Da(),Gl=Ua(),ql=La(),Kl=Fa(),Jl=Za(),Xl=Ga(),ws=Function,un=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=en(),Yl=Ya(),cn=o(function(){throw new Ge},"throwTypeError"),Ql=_t?(function(){try{return arguments.callee,cn}catch{try{return _t(arguments,"callee").get}catch{return cn}}})():cn,He=rs()(),J=Ss(),ed=nn(),td=rn(),Rs=on(),Pt=nr(),We={},rd=typeof Uint8Array>"u"||!J?U:J(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":He&&J?J([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%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%":jl,"%eval%":eval,"%EvalError%":Fl,"%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%":ws,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":He&&J?J(J([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!He||!J?U:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ll,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":Bl,"%ReferenceError%":Zl,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!He||!J?U:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":He&&J?J(""[Symbol.iterator]()):U,"%Symbol%":He?Symbol:U,"%SyntaxError%":qe,"%ThrowTypeError%":Ql,"%TypedArray%":rd,"%TypeError%":Ge,"%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%":Vl,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":Rs,"%Object.defineProperty%":Yl,"%Object.getPrototypeOf%":ed,"%Math.abs%":Hl,"%Math.floor%":Wl,"%Math.max%":Gl,"%Math.min%":ql,"%Math.pow%":Kl,"%Math.round%":Jl,"%Math.sign%":Xl,"%Reflect.getPrototypeOf%":td};if(J)try{null.error}catch(e){zs=J(J(e)),Ne["%Error.prototype%"]=zs}var zs,nd=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("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 Ne[t]=r,r},"doEval"),Os={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bt=Ve(),or=sn(),od=bt.call(Pt,Array.prototype.concat),id=bt.call(Rs,Array.prototype.splice),ks=bt.call(Pt,String.prototype.replace),ir=bt.call(Pt,String.prototype.slice),ad=bt.call(Pt,RegExp.prototype.exec),sd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ud=/\\(\\)?/g,cd=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return ks(t,sd,function(u,c,p,f){i[i.length]=p?ks(f,ud,"$1"):c||u}),i},"stringToPath"),pd=o(function(t,r){var n=t,i;if(or(Os,n)&&(i=Os[n],n="%"+i[0]+"%"),or(Ne,n)){var u=Ne[n];if(u===We&&(u=nd(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(ad(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=cd(t),i=n.length>0?n[0]:"",u=pd("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],id(n,od([0,1],g)));for(var x=1,b=!0;x<n.length;x+=1){var _=n[x],s=ir(_,0,1),d=ir(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(f=!0),i+="."+_,c="%"+i+"%",or(Ne,c))p=Ne[c];else if(p!=null){if(!(_ in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&x+1>=n.length){var y=_t(p,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else b=or(p,_),p=p[_];b&&!f&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Us=E((Dz,Cs)=>{"use strict";var ld=tn();Cs.exports=o(function(){return ld()&&!!Symbol.toStringTag},"hasToStringTagShams")});var js=E((Uz,Ls)=>{"use strict";var dd=Ds(),Ms=dd("%Object.defineProperty%",!0),md=Us()(),fd=sn(),gd=er(),ar=md?Symbol.toStringTag:null;Ls.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 gd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!fd(t,ar))&&(Ms?Ms(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Bs=E((Lz,Fs)=>{"use strict";var yd=Function.prototype.call,hd=Object.prototype.hasOwnProperty,vd=Ve();Fs.exports=vd.call(yd,hd)});var Vs=E((jz,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Gs=E((Fz,Ws)=>{"use strict";var mn=Ki(),xd=require("util"),pn=require("path"),_d=require("http"),Pd=require("https"),bd=require("url").parse,Id=require("fs"),Td=require("stream").Stream,Ed=require("crypto"),ln=ea(),$d=ha(),Sd=js(),ze=Bs(),dn=Vs();function Hs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Hs,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");xd.inherits(L,mn);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.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)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ze(t,"httpVersion"))&&!(t instanceof Td))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){ze(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Id.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Hs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(c,r.header);var p;for(var f in c)if(ze(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=pn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=pn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ze(e,"httpVersion")&&(r=pn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Hs(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&ze(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ze(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+Ed.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}$d.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=bd(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Pd.request(n):r=_d.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,f=o(function(g,x){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,x)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};Sd(L.prototype,"FormData");Ws.exports=L});var Ld={};vn(Ld,{chatwoot:()=>Md});module.exports=au(Ld);var su=Object.freeze({status:"aborted"});function I(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,x=Object.keys(g);for(let b=0;b<x.length;b++){let _=x[b];_ in p||(p[_]=g[_].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 f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let x of g._zod.deferred)x();return g}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(I,"$constructor");var se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},cr={};function le(e){return e&&Object.assign(cr,e),cr}o(le,"config");function lr(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(lr,"getEnumValues");function Pn(e,t){return typeof t=="bigint"?t.toString():t}o(Pn,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function bn(e){return e==null}o(bn,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var _n=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var uu=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var Tn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function Z(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(Z,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var $n={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Me(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Me,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(_e,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function Sn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Sn,"getLengthableOrigin");function mr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(mr,"issue");var An=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,Pn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=I("$ZodError",An),Ye=I("$ZodError",An,{Parent:Error});var pu=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(f=>Pe(f,u,le())));throw dr(p,i?.callee),p}return c.value},"_parse"),Ot=pu(Ye),lu=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(f=>Pe(f,u,le())));throw dr(p,i?.callee),p}return c.value},"_parseAsync"),kt=lu(Ye),du=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??zn)(u.issues.map(c=>Pe(c,i,le())))}:{success:!0,data:u.value}},"_safeParse"),Qe=du(Ye),mu=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=>Pe(c,i,le())))}:{success:!0,data:u.value}},"_safeParseAsync"),et=mu(Ye);var fu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",gu=new RegExp(`^${fu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,wn=/^-?\d+$/,fr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var be=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),yu={number:"number",bigint:"bigint",object:"date"};var Nn=I("$ZodCheckGreaterThan",(e,t)=>{be.init(e,t);let r=yu[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 Dn=I("$ZodCheckNumberFormat",(e,t)=>{be.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=$n[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=wn)}),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 Cn=I("$ZodCheckMinLength",(e,t)=>{var r;be.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(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=Sn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var gr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;be.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=()=>{})}),Un=I("$ZodCheckRegex",(e,t)=>{gr.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 Ln={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=Ln;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,f)=>{let g=Me(c),x;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let _=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new se;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(g||(g=Me(c,_)))});else{if(c.issues.length===_)continue;g||(g=Me(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Me(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new se;return g.then(x=>e._zod.parse(x,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(x=>u(x,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new se;return f.then(g=>i(g,n,p))}return i(f,n,p)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=Qe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=I("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(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}}),yr=I("$ZodStringFormat",(e,t)=>{gr.init(e,t),Nt.init(e,t)});var Vn=I("$ZodURL",(e,t)=>{yr.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 hr=I("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??fr,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}}),Hn=I("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),hr.init(e,t)}),vr=I("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Rn,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}}),Wn=I("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=kn,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 Gn=I("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),qn=I("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Kn=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}}),Jn=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 jn(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=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 p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>jn(g,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(..._e(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Rt,"handlePropertyResult");function hu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(hu,"normalizeDef");function vu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,x=f.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){c.push(b);continue}let _=f.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Rt(s,r,b,t,x))):Rt(_,r,b,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(vu,"handleCatchall");var Yn=I("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=St(()=>hu(t));q(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let x=p[g]._zod;if(x.values){f[g]??(f[g]=new Set);for(let b of x.values)f[g].add(b)}}return f});let i=Xe,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let x=[],b=c.shape;for(let _ of c.keys){let s=b[_],d=s._zod.optout==="optional",y=s._zod.run({value:g[_],issues:[]},f);y instanceof Promise?x.push(y.then(m=>Rt(m,p,_,g,d))):Rt(y,p,_,g,d)}return u?vu(x,g,p,f,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function Fn(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=>!Me(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=>Pe(c,n,le())))}),t)}o(Fn,"handleUnionResults");var xr=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=>At(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 f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Fn(f,i,e,u)):Fn(p,i,e,u)}});var Qn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.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,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=St(()=>{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 f of p){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(!Xe(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 eo=I("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(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 g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let x=t.valueType._zod.run({value:i[g],issues:[]},n);x instanceof Promise?u.push(x.then(b=>{b.issues.length&&r.issues.push(..._e(g,b.issues)),r.value[g]=b.value})):(x.issues.length&&r.issues.push(..._e(g,x.issues)),r.value[g]=x.value)}let f;for(let g in i)p.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 p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&fr.test(p)&&f.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&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>Pe(b,n,le())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:i[p],issues:[]},n);x instanceof Promise?u.push(x.then(b=>{b.issues.length&&r.issues.push(..._e(p,b.issues)),r.value[f.value]=b.value})):(x.issues.length&&r.issues.push(..._e(p,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=I("$ZodEnum",(e,t)=>{H.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Tn.has(typeof i)).map(i=>typeof i=="string"?Ue(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}}),ro=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"?Ue(n):n?Ue(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 no=I("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new se;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=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(`^(${At(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=>Bn(u,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=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(`^(${At(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 ao=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=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var so=I("$ZodCustom",(e,t)=>{be.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=>Zn(u,r,n,e));Zn(i,r,n,e)}});function Zn(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(mr(i))}}o(Zn,"handleRefineResult");var co;var _r=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 po(){return new _r}o(po,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=po());var Pr=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",...Z(t)})}o(lo,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...Z(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...Z(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(xo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(_o,"_coercedBigint");function Po(e){return new e({type:"any"})}o(Po,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function Io(e,t){return new e({type:"void",...Z(t)})}o(Io,"_void");function To(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(To,"_coercedDate");function Dt(e,t){return new Nn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Dt,"_gte");function ie(e,t){return new Cn({check:"min_length",...Z(t),minimum:e})}o(ie,"_minLength");function Ie(e,t){return new Un({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Ie,"_regex");function Eo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_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)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(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)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ut=I("ZodMiniString",(e,t)=>{Nt.init(e,t),K.init(e,t)});function a(e){return lo(Ut,e)}o(a,"string");var $o=I("ZodMiniStringFormat",(e,t)=>{yr.init(e,t),Ut.init(e,t)});var ku=I("ZodMiniURL",(e,t)=>{Vn.init(e,t),$o.init(e,t)});function So(e){return fo(ku,e)}o(So,"url");var Mt=I("ZodMiniNumber",(e,t)=>{hr.init(e,t),K.init(e,t)});function X(e){return go(Mt,e)}o(X,"number");var wu=I("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),Mt.init(e,t)});function Ao(e){return ho(wu,e)}o(Ao,"int");var br=I("ZodMiniBoolean",(e,t)=>{vr.init(e,t),K.init(e,t)});function F(e){return vo(br,e)}o(F,"boolean");var zo=I("ZodMiniBigInt",(e,t)=>{Wn.init(e,t),K.init(e,t)});var Ru=I("ZodMiniAny",(e,t)=>{Gn.init(e,t),K.init(e,t)});function rt(){return Po(Ru)}o(rt,"any");var Nu=I("ZodMiniUnknown",(e,t)=>{qn.init(e,t),K.init(e,t)});function O(){return bo(Nu)}o(O,"unknown");var Du=I("ZodMiniVoid",(e,t)=>{Kn.init(e,t),K.init(e,t)});function Oo(e){return Io(Du,e)}o(Oo,"_void");var ko=I("ZodMiniDate",(e,t)=>{Jn.init(e,t),K.init(e,t)});var Cu=I("ZodMiniArray",(e,t)=>{Xn.init(e,t),K.init(e,t)});function R(e,t){return new Cu({type:"array",element:e,...Z(t)})}o(R,"array");var Uu=I("ZodMiniObject",(e,t)=>{Yn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Uu(r)}o(l,"object");var Mu=I("ZodMiniUnion",(e,t)=>{xr.init(e,t),K.init(e,t)});function N(e,t){return new Mu({type:"union",options:e,...Z(t)})}o(N,"union");var Lu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),K.init(e,t)});function Te(e,t,r){return new Lu({type:"union",options:t,discriminator:e,...Z(r)})}o(Te,"discriminatedUnion");var ju=I("ZodMiniRecord",(e,t)=>{eo.init(e,t),K.init(e,t)});function k(e,t,r){return new ju({type:"record",keyType:e,valueType:t,...Z(r)})}o(k,"record");var Fu=I("ZodMiniEnum",(e,t)=>{to.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 Fu({type:"enum",entries:r,...Z(t)})}o(C,"_enum");var Bu=I("ZodMiniLiteral",(e,t)=>{ro.init(e,t),K.init(e,t)});function $(e,t){return new Bu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o($,"literal");var Zu=I("ZodMiniTransform",(e,t)=>{no.init(e,t),K.init(e,t)});function Ee(e){return new Zu({type:"transform",transform:e})}o(Ee,"transform");var Vu=I("ZodMiniOptional",(e,t)=>{oo.init(e,t),K.init(e,t)});function h(e){return new Vu({type:"optional",innerType:e})}o(h,"optional");var Hu=I("ZodMiniNullable",(e,t)=>{io.init(e,t),K.init(e,t)});function nt(e){return new Hu({type:"nullable",innerType:e})}o(nt,"nullable");var Wu=I("ZodMiniPipe",(e,t)=>{ao.init(e,t),K.init(e,t)});function $e(e,t){return new Wu({type:"pipe",in:e,out:t})}o($e,"pipe");var Gu=I("ZodMiniCustom",(e,t)=>{so.init(e,t),K.init(e,t)});function Lt(e,t){return Eo(Gu,e??(()=>!0),t)}o(Lt,"custom");var ot={};vn(ot,{bigint:()=>Qu,boolean:()=>Yu,date:()=>ec,number:()=>Xu,string:()=>Ju});function Ju(e){return mo(Ut,e)}o(Ju,"string");function Xu(e){return yo(Mt,e)}o(Xu,"number");function Yu(e){return xo(br,e)}o(Yu,"boolean");function Qu(e){return _o(zo,e)}o(Qu,"bigint");function ec(e){return To(ko,e)}o(ec,"date");var Tr=l({retryOnFailure:l({defaultValue:h(F()),hide:h(F())}),continueOnFailure:l({defaultValue:h(F()),hide:h(F())})}),Ir=class{constructor(t,r,n,i,u,c,p,f,g,x,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=x;this.aiMetadata=b}static{o(this,"IAction")}},jt=o(e=>new Ir(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var j=l({displayName:a(),description:h(a())}),D=o((e,t)=>l({type:$(t),required:F(),defaultValue:h(rt())}),"TPropertyValue");var ee=l({...j.shape,...D(a(),"SHORT_TEXT").shape}),de=l({...j.shape,...D(a(),"LONG_TEXT").shape});var Ro=l({label:a(),value:O()}),Ft=l({disabled:h(F()),placeholder:h(a()),options:R(Ro)});var te=l({...j.shape,options:Ft,...D(O(),"STATIC_DROPDOWN").shape}),me=l({...j.shape,options:Ft,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Er=l({...j.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),it=l({...j.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var fe=l({...j.shape,...D(F(),"CHECKBOX").shape});var ge=l({...j.shape,...D(X(),"NUMBER").shape});var at=l({...j.shape,streaming:h(F()),...D(O(),"FILE").shape});var st=l({...j.shape,...D(a(),"DATE_TIME").shape});var No=k(a(),N([ee,de,te,it,me,fe,ge,at,st])),ut=l({...j.shape,properties:No,...D(R(O()),"ARRAY").shape});var ct=l({...j.shape,...D(N([k(a(),O())]),"JSON").shape});var Do=N([ee,te,ct,ut,me]),rc=k(a(),Do),$r=l({refreshers:R(a()),...j.shape,...D(O(),"DYNAMIC").shape});var Bt=l({...j.shape,...D(Oo(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),lt=(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))(lt||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),Sr="both_client_credentials_and_authorization_code";var Se=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Se||{}),mt=(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))(mt||{}),nc=l({strategy:C(mt),paramName:h(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Zt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Zt||{}),Co=l({status:h(X()),body:h(O()),headers:h(k(a(),a()))}),Uo=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(C(Zt))}),Mo=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Co,handlerId:h(a()),streamStepProgress:h(C(Zt))}),oc=N([Uo,Mo]);var ic=l({body:O(),rawBody:h(O()),headers:k(a(),a()),queryParams:k(a(),a())});function re(e){return e==null}o(re,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Vt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Vt,"assertNotNullOrUndefined");var Ar=Ce(require("crypto"),1);var ac=128,ke,je,sc=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*ac),Ar.default.randomFillSync(ke),je=0):je+e>ke.length&&(Ar.default.randomFillSync(ke),je=0),je+=e},"fillPool"),uc=o(e=>(sc(e|=0),ke.subarray(je-e,je)),"random"),cc=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 p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>cc(e,t,uc),"customAlphabet");var pc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fo=21,_b=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${Fo}}$`))),lc=jo(pc,Fo);var Ae=$e(Ee(e=>e instanceof Date?e.toISOString():e),a()),ne={id:a(),created:Ae,updated:Ae},V=o(e=>h(nt(e)),"Nullable");function zr(e){return h(nt(C(e)))}o(zr,"NullableEnum");var Ib=$e(Ee(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(F())),Ht=o(e=>$e(Ee(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(R(e))),"OptionalArrayFromQuery");var $b=k(a(),O());var yt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(yt||{});var Mb=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var jb=l({filename:a(),data:O(),type:$("file"),mimetype:h(a())});var dc=Ce(Zo());var Gb=l({...ne,name:a(),permissions:R(a()),platformId:V(a()),type:a(),userCount:h(X())});var Vo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Vo||{}),Or=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Or||{}),kr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(kr||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Rr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Rr||{});var mc=l({mode:C(Vo),value:O()}),fc=l({auth:h(a()),fields:k(a(),mc)}),gc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(fc)}),yc=l({type:$("PIECE"),toolName:a().check(ie(1)),pieceMetadata:gc}),hc=l({type:$("none")}),vc=l({type:$("access_token"),accessToken:a()}),xc=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),_c=l({type:$("headers"),headers:k(a(),a())}),Pc=Te("type",[hc,vc,xc,_c]),Ho=l({type:$("FLOW"),toolName:a().check(ie(1)),externalFlowId:a(),flowDisplayName:h(a())}),Wo=l({type:$("MCP"),toolName:a().check(ie(1)),serverUrl:So(),protocol:C(kr),auth:Pc}),Go=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ie(1)),sourceType:C(Or),sourceId:a(),sourceName:a()}),bc=Te("type",[yc,Ho,Wo,Go]),Ic=l({displayName:a(),description:h(a()),type:C(wr)}),qo=l({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:V(k(a(),O())),output:h(O()),toolName:a(),status:C(Rr),toolCallId:a(),startTime:a(),endTime:h(a())},TI=l(Fe),Ko=Te("toolCallType",[l({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),Tc=N([qo,Ko]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),ye=l({apiKey:a()}),Ec=ye,$c=l({apiKey:a(),apiKeyHash:a()}),Sc=ye,Ac=ye,zc=ye,Oc=ye,kc=ye,wc=ye,Rc=ye,ei=l({accessKeyId:a().check(ie(1)),secretAccessKey:a().check(ie(1))}),Nc=l({}),Dc=l({}),Cc=l({}),Uc=l({}),Mc=l({}),Lc=l({}),ti=l({modelId:a(),modelName:a(),modelType:C(Nr)}),ri=l({apiKeyHeader:a(),baseUrl:a(),models:R(ti),defaultHeaders:h(k(a(),a()))}),ni=l({accountId:a(),gatewayId:a(),models:R(ti),vertexProject:h(a()),vertexRegion:h(a())}),oi=l({resourceName:a(),apiVersion:$e(Ee(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ii=l({region:a().check(ie(1))}),jc=N([Ec,zc,Oc,kc,wc,Ac,Sc,$c,ei,Rc]),ai=N([ri,ni,oi,ii,Nc,Cc,Uc,Mc,Dc,Lc]),Fc=l({id:a(),name:a(),type:C(Nr)}),Bc=l({id:a(),name:a(),provider:C(yt),config:ai,enabledForChat:F()}),Zc=l({provider:C(yt),config:ai,auth:jc,platformId:a()});var AI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Vc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Hc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Wc=["grok-4.20","grok-4.1-fast"],Gc={openai:Jo,anthropic:Vc,google:Xo,activepieces:[...Hc.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...Wc.map(e=>`x-ai/${e}`)]};var Yo=128e3,qc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Kc({provider:e}){return e?qc[e]??Yo:Yo}o(Kc,"getMaxContextTokens");var Qo={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"},Jc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Xc=new Set(["anthropic","mistral"]);function ue(e){return{chatModels:Gc[e],maxContextTokens:Kc({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!Xc.has(e),webSearch:Jc[e]}}o(ue,"buildProviderCapabilities");var Yc={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 Qc=l({base64Url:a(),fileName:a(),extension:h(a())}),ep=l({mimeType:a(),url:a(),fileName:h(a())}),Dr=N([Qc,ep]);var tp=N([l({type:$("file"),value:Dr}),l({type:$("markdown"),value:a(),files:h(R(Dr))})]),rp=l({sessionId:a(),message:a(),files:h(R(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var np=N([l({...ne,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:R(l({value:a()}))})}),l({...ne,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),op=l({...ne,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:zr(ci),trigger:zr(ui)}),ip=l({...ne,tableId:a(),projectId:a(),cells:k(a(),l({updated:a(),created:a(),value:O(),fieldName:a()}))}),ap=l({events:R(C(Cr)),webhookUrl:a(),flowId:a()}),sp=l({fields:R(l({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),up=l({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Ht(a()),folderId:h(a()),folderIds:Ht(a())}),cp=l({records:R(R(l({fieldId:a(),value:li()}))),tableId:a()}),pp=l({cells:h(R(l({fieldId:a(),value:li()}))),tableId:a(),agentUpdate:h(F())}),pi=Te("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),si("exists"),si("not_exists")]),lp=l({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Ht(pi)});function li(){return $e(Ee(e=>e==null?e:String(e)),nt(a()))}o(li,"coerceToString");function we(e){return l({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function si(e){return l({fieldId:a(),operator:$(e)})}o(si,"existenceFilter");var dp=l({status:h(X()),body:h(O()),headers:h(k(a(),a()))}),mp=l({...ne,deleted:V(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var di=l({name:a(),description:h(a()),type:a(),required:F()}),fp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:R(di),returnsResponse:F()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",GI=new RegExp(mi),yp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",qI=a().check(Ie(new RegExp(mi))),KI=a().check(Ie(new RegExp(yp))),hp=l({packageType:$("ARCHIVE"),pieceType:C(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),JI=N([fi,gi]),XI=N([hp,fi,gi]);var vp=Te("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Ao().check(Dt(6e4))})]),YI=l({...ne,type:C(Se),projectId:a(),flowId:a(),triggerName:a(),schedule:V(vp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:F()}),yi=(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))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),QI=l({...ne,projectId:V(a()),platformId:V(a()),type:C(yi),compression:C(hi),data:h(O()),location:C(vi),size:V(X()),fileName:V(a()),s3Key:V(a()),metadata:V(k(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),eT=l({id:a(),email:a(),firstName:a(),status:C(_i),externalId:V(a()),platformId:V(a()),platformRole:C(xi),lastName:a(),created:Ae,updated:Ae,lastActiveDate:V(Ae),imageUrl:V(a())});var Ur=l({...j.shape,...D(k(a(),O()),"OBJECT").shape});var Ti=l({...j.shape,...D(a(),"COLOR").shape});var Mr=N([ee,de,Bt,fe,te,me,Er,it,$r,ge,ut,Ur,ct,st,at,Ti]),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 ce=l({displayName:a(),description:h(a())});var Ei=l({username:a(),password:a()}),Lr=l({...ce.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...D(Ei,"BASIC_AUTH").shape});var bp=k(a(),N([ee,de,ge,fe,te])),jr=l({...ce.shape,props:bp,...D(O(),"CUSTOM_AUTH").shape});var Re=l({...ce.shape,...D(l({auth:a()}),"SECRET_TEXT").shape});var Ip=k(a(),N([ee,de,Re,ge,fe,te,me,Bt])),$i=l({...ce.shape,props:Ip,...D(O(),"OIDC").shape});var Fr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Fr||{}),Si=N([ee,Re,te]),Ai=k(a(),Si),Tp=l({props:h(k(a(),Si)),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(Fr)),grantType:h(N([C(dt),$(Sr)])),extra:h(k(a(),a()))}),zi=l({access_token:a(),props:h(Ai),data:k(a(),rt())}),Br=l({...ce.shape,...Tp.shape,...D(zi,"OAUTH2").shape});var Be=N([Lr,jr,$i,Br,Re]),ht="Connection",Gt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var wE={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 Ep=l({...j.shape,...D(O(),"CUSTOM").shape,code:a()});var $p=N([Mr,Be]),Zr=k(a(),$p),YE=k(a(),Mr);var Oi=N([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),Ze=class{constructor(t,r,n,i,u,c,p,f,g,x,b,_,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=p;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=x;this.onEnable=b;this.onDisable=_;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")}},ki=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);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);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);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)}},"createTrigger");var wi="2",qt="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,p,f,g=qt,x,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=x;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wi}),"getContextInfo");(!Sp(g)||Ap(g,qt))&&(this.minimumSupportedRelease=qt),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: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}},Ri=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 Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Sp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Sp,"isValidSimpleSemver");function Ap(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(Ap,"isSemverLessThan");var zp=h(k(a(),k(a(),a()))),Ni=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:h(a()),directoryPath:h(a()),auth:h(N([Be,R(Be)])),version:a(),categories:h(R(C(lt))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(F()),i18n:zp}),Op=C(["human","ai","both"]),Di=l({description:h(a()),idempotent:h(F())}),Ci=l({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:F(),errorHandlingOptions:h(Tr),outputSchema:h(Lt()),audience:h(Op),aiMetadata:h(Di)}),Ui=l({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:h(Tr),type:C(Se),sampleData:O(),handshakeConfiguration:h(Lt()),renewConfiguration:h(Oi),testStrategy:C(ft),outputSchema:h(Lt()),aiMetadata:h(Di)}),kp=l({...Ni.shape,actions:k(a(),Ci),triggers:k(a(),Ui)}),wp=l({...Ni.shape,actions:X(),triggers:X(),suggestedActions:h(R(Ci)),suggestedTriggers:h(R(Ui))}),Mi=l({projectUsage:X(),pieceType:C(Le),packageType:C(pt),platformId:h(a()),archiveId:h(a())}),Y$=l({...kp.shape,...Mi.shape}),Q$=l({...wp.shape,...Mi.shape}),eS=l({name:a(),version:a()});var Rp=Ce(require("path")),Np=Ce(require("fs/promises"));var Bi=require("node:stream");var Kt=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 Jt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new Wr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Wr=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 vt=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 Li({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Li,"toFailsafeOutput");var xt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(xt||{});var Xt=class extends Kt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Jt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams: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(),f=p?`${n}?${p}`:n,g=t.responseType??"json",x=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Dp(t.method)?Cp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Mp({...u,...s}),m=await Up(async()=>{let M=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let oe={method:t.method.toString(),headers:y,body:_,redirect:x?"follow":"manual",signal:M.signal};return d&&(oe.duplex="half"),r?.dispatcher!==void 0&&(oe.dispatcher=r.dispatcher),await fetch(f,oe)}finally{Q!==void 0&&clearTimeout(Q)}},b),v=x?300:400;if(m.status<200||m.status>=v){let M=await ji(m,g),Q=new vt(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let P=await ji(m,g);return{status:m.status,headers:Lp(m.headers),body:P}}};function Dp(e){return e!=="GET"&&e!=="HEAD"}o(Dp,"acceptsRequestBody");function Cp(e,t){if(Fp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(jp(e)){let n=new Bi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Cp,"serializeBody");async function ji(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ji,"parseResponseBody");async function Up(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Fi(n);continue}return i}catch(i){if(r=i,n<t){await Fi(n);continue}throw i}throw r}o(Up,"sendWithRetries");function Fi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Fi,"backoff");function Mp(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(Mp,"normalizeHeaders");function Lp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Lp,"toHttpHeaders");function jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(jp,"isNodeFormData");function Fp(e){return e==null}o(Fp,"isNil");var he=new Xt;var Ad=Ce(require("fs")),qs=Ce(Gs());var zd={"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 Od(e){let t=e.split(";")[0].trim().toLowerCase();return zd[t]??""}o(Od,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wd=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 Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return jt({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 ${wd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:B.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(xt).map(g=>({label:g,value:g}))},...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:g})=>{if(!g)return{};let x=g,b={};switch(x){case"none":break;case"json":b.data=B.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=B.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.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 b},"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 g=>{let{method:x,url:b,headers:_,queryParams:s,body:d,body_type:y,failsafe:m,timeout:v,response_is_binary:P,followRedirects:M}=g.propsValue;Vt(x,"Method"),Vt(b,"URL");let Q=re(r)?{}:await r(g.auth,g.propsValue),oe=b.url,Ke=oe.startsWith("http://")||oe.startsWith("https://")?oe:kd({baseUrl:t(g.auth),relativePath:oe}),xe={method:x,url:Ke,headers:{..._??{},...f==="headers"||!re(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(P&&(xe.responseType="arraybuffer"),d)if(y&&y!=="none"){let pe=d.data;if(y==="form_data"){let eu=pe,Tt=new qs.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ur}of eu)yn==="text"&&!gt(hn)?Tt.append(gn,hn):yn==="file"&&!gt(ur)&&Tt.append(gn,ur.data,{filename:ur?.filename});xe.body=Tt,xe.headers={...xe.headers,...Tt.getHeaders()}}else xe.body=pe}else y||(xe.body=d);try{let pe=await he.sendRequest(xe);return await Rd(g.files,pe.body,pe.status,pe.headers,P)}catch(pe){if(m)return Li({error:pe,requestBody:xe.body});throw pe}},"run")})}o(Ks,"createCustomApiCallAction");var Rd=o(async(e,t,r,n,i)=>{let u;if(i&&Nd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Od(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Nd=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 Oe(e){return{baseUrl:e.props.baseUrl??"",accountId:e.props.accountId??0,apiAccessToken:e.props.apiAccessToken??""}}o(Oe,"getChatwootAuth");var Dd=`
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
- `,De=Gt.CustomAuth({displayName:"Chatwoot Connection",required:!0,description:Dd,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:Gt.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 Js=3,Cd=1e3;async function Ud(e,t,r,n,i){let c=It(e,t).CONVERSATION_MESSAGES(r),p;for(let f=0;f<Js;f++)try{return(await he.sendRequest({method:"POST",url:c,headers:{[ve]:n,"Content-Type":"application/json"},body:i})).body}catch(g){p=g instanceof Error?g:new Error(String(g));let b=g.response?.status;if(!(b===429||b!==void 0&&b>=500)||f===Js-1)throw p;let s=Cd*Math.pow(2,f);await new Promise(d=>setTimeout(d,s))}throw p??new Error("Send message failed after retries")}o(Ud,"sendWithRetry");var Xs=jt({auth:De,name:"send_message",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=Oe(e.auth),u={content:r,message_type:"outgoing",private:n,content_type:"text"},c=await Ud(i.baseUrl,i.accountId,t,i.apiAccessToken,u);return{success:!0,messageId:c.id,conversationId:c.conversation_id,status:c.status}}});var fn="_chatwoot_webhook_id";function sr(e){return e==null||typeof e!="string"?"":e.trim().replace(/\/+$/,"")}o(sr,"normalizeUrl");function Ys(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(Ys,"toWebhookList");var Qs=ki({auth:De,name:"new_message",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=Oe(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=Ys(u.body),p=sr(n),f=c.find(g=>sr(g.url)===p);f?i=f.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 f=await he.sendRequest({method:"GET",url:r.WEBHOOKS,headers:{[ve]:t.apiAccessToken}}),g=Ys(f.body),x=sr(n),b=g.find(_=>sr(_.url)===x);if(b?.id)i=b.id;else throw u}else throw u}await e.store.put(fn,{webhookId:i})},async onDisable(e){let t=Oe(e.auth),r=It(t.baseUrl,t.accountId),n=await e.store.get(fn);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(fn)}},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,f=r.sender,g=r.account,x=0;if(c!=null&&typeof c=="object"){if("display_id"in c){let P=c.display_id;x=P!=null&&Number(P)||0}else if("id"in c){let P=c.id;x=P!=null&&Number(P)||0}}let b=p||f,_=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=g!=null&&typeof g=="object"&&"id"in g&&Number(g.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:x,contactId:_,contactName:s,accountId:d,createdAt:m}]}});var Md=Ri({displayName:"Chatwoot",description:"Receive and reply to customer messages with Chatwoot",auth:De,minimumSupportedRelease:"0.30.0",logoUrl:"https://cdn.activepieces.com/pieces/chatwoot.png",authors:["AhmadTash"],actions:[Xs,Ks({auth:De,baseUrl:o(e=>Oe(e).baseUrl,"baseUrl"),authMapping:o(async e=>{let t=Oe(e);return{[ve]:t.apiAccessToken}},"authMapping")})],triggers:[Qs]});0&&(module.exports={chatwoot});
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: