@activepieces/piece-reddit 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var js=Object.create;var Je=Object.defineProperty;var Ls=Object.getOwnPropertyDescriptor;var Fs=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var i=(e,t)=>Je(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},pn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fs(t))!Zs.call(e,o)&&o!==r&&Je(e,o,{get:()=>t[o],enumerable:!(n=Ls(t,o))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?js(Bs(e)):{},pn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),Vs=e=>pn(Je({},"__esModule",{value:!0}),e);var Ao=T((So,Mt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,l){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let g=0,m=-1,v=(u.match(d.zoneIndex)||[])[0],P,j;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)g++;if(u.substr(0,2)==="::"&&g--,u.substr(-2,2)==="::"&&g--,g>l)return null;for(j=l-g,P=":";j--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),l=function(){let re=u.split(":"),se=[];for(let Ke=0;Ke<re.length;Ke++)se.push(parseInt(re[Ke],16));return se}(),{parts:l,zoneId:v}}i(f,"expandIPv6");function h(u,l,g,m){if(u.length!==l.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),u[v]>>P!==l[v]>>P)return!1;m-=g,v+=1}return!0}i(h,"matchCIDR");function _(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(_,"parseIntAuto");function $(u,l){for(;u.length<l;)u=`0${u}`;return u}i($,"padPart");let x={};x.IPv4=function(){function u(l){if(l.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<l.length;g++)if(m=l[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=l}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(l,g){let m;if(g===void 0&&(m=l,l=m[0],g=m[1]),l.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,l.octets,8,g)},u.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],g&&j!==0)return null;j!==8&&(g=!0),l+=j}else return null;return 32-l},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let l=this.parseCIDR(u),g=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let l=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!l?!1:x.IPv4.isValidFourPartDecimal(l[1])},x.IPv4.networkAddressFromCIDR=function(u){let l,g,m,v,P;try{for(l=this.parseCIDR(u),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let l=this.parser(u);if(l===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(l)},x.IPv4.parseCIDR=function(u){let l;if(l=u.match(/^(.+)\/(\d+)$/)){let g=parseInt(l[2]);if(g>=0&&g<=32){let m=[this.parse(l[1]),g];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let l,g,m;if(l=u.match(r.fourOctet))return function(){let v=l.slice(1,6),P=[];for(let j=0;j<v.length;j++)g=v[j],P.push(_(g));return P}();if(l=u.match(r.longValue)){if(m=_(l[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(l=u.match(r.twoOctet))?function(){let v=l.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(l=u.match(r.threeOctet))?function(){let v=l.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let l=[0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)l[g]=255,g++;return m<4&&(l[m]=Math.pow(2,u%8)-1<<8-u%8),new this(l)},x.IPv6=function(){function u(l,g){let m,v;if(l.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(l[m]<<8|l[m+1]);else if(l.length===8)this.parts=l;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(l,g){let m;if(g===void 0&&(m=l,l=m[0],g=m[1]),l.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,l.parts,16,g)},u.prototype.prefixLengthFromSubnetMask=function(){let l=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),l+=P}else return null;return 128-l},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let l,g=[],m=this.parts;for(let v=0;v<m.length;v++)l=m[v],g.push(l>>8),g.push(l&255);return g},u.prototype.toFixedLengthString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let l=this.parts.slice(-2),g=l[0],m=l[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),l+g},u.prototype.toRFC5952String=function(){let l=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=l.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let l=this.parseCIDR(u),g=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(l){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${l})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let l=this.parser(u);return new this(l.parts,l.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let l,g,m,v,P;try{for(l=this.parseCIDR(u),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(u){let l=this.parser(u);if(l.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(l.parts,l.zoneId)},x.IPv6.parseCIDR=function(u){let l,g,m;if((g=u.match(/^(.+)\/(\d+)$/))&&(l=parseInt(g[2]),l>=0&&l<=128))return m=[this.parse(g[1]),l],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let l,g,m,v,P,j;if(m=u.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(u))return f(u,8);if((m=u.match(d.transitional))&&(j=m[6]||"",l=m[1],m[1].endsWith("::")||(l=l.slice(0,-1)),l=f(l+j,6),l.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return l.parts.push(P[0]<<8|P[1]),l.parts.push(P[2]<<8|P[3]),{parts:l.parts,zoneId:l.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)l[g]=255,g++;return m<16&&(l[m]=Math.pow(2,u%8)-1<<8-u%8),new this(l)},x.fromByteArray=function(u){let l=u.length;if(l===4)return new x.IPv4(u);if(l===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let l=this.parse(u);return l.kind()==="ipv6"&&l.isIPv4MappedAddress()?l.toIPv4Address():l},x.subnetMatch=function(u,l,g){let m,v,P,j;g==null&&(g="unicast");for(v in l)if(Object.prototype.hasOwnProperty.call(l,v)){for(P=l[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],u.kind()===j[0].kind()&&u.match.apply(u,j))return v}return g},typeof Mt<"u"&&Mt.exports?Mt.exports=x:e.ipaddr=x})(So)});var Ti=T((HS,Ii)=>{var bi=require("stream").Stream,xp=require("util");Ii.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(ce,"DelayedStream");xp.inherits(ce,bi);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=bi.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.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)};ce.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 Ai=T((qS,Si)=>{var _p=require("util"),Ei=require("stream").Stream,$i=Ti();Si.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(q,"CombinedStream");_p.inherits(q,Ei);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof $i)){var r=$i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};q.prototype.pipe=function(e,t){return Ei.prototype.pipe.call(this,e,t),this.resume(),e};q.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};q.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ki=T((KS,zi)=>{"use strict";zi.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 Ri=T(te=>{"use strict";var Ht=ki(),Pp=require("path").extname,Oi=/^\s*([^;\s]*)(?:;|\s|$)/,bp=/^text\//i;te.charset=wi;te.charsets={lookup:wi};te.contentType=Ip;te.extension=Tp;te.extensions=Object.create(null);te.lookup=$p;te.types=Object.create(null);Ep(te.extensions,te.types);function wi(e){if(!e||typeof e!="string")return!1;var t=Oi.exec(e),r=t&&Ht[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&bp.test(t[1])?"UTF-8":!1}i(wi,"charset");function Ip(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Ip,"contentType");function Tp(e){if(!e||typeof e!="string")return!1;var t=Oi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Tp,"extension");function $p(e){if(!e||typeof e!="string")return!1;var t=Pp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}i($p,"lookup");function Ep(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Ht).forEach(i(function(o){var s=Ht[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var d=0;d<c.length;d++){var f=c[d];if(t[f]){var h=r.indexOf(Ht[t[f]].source),_=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>_||h===_&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(Ep,"populateMaps")});var Di=T((YS,Ni)=>{Ni.exports=Sp;function Sp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(Sp,"defer")});var jr=T((eA,Ui)=>{var Ci=Di();Ui.exports=Ap;function Ap(e){var t=!1;return Ci(function(){t=!0}),i(function(n,o){t?e(n,o):Ci(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Ap,"async")});var Lr=T((rA,Mi)=>{Mi.exports=zp;function zp(e){Object.keys(e.jobs).forEach(kp.bind(e)),e.jobs={}}i(zp,"abort");function kp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(kp,"clean")});var Fr=T((oA,Li)=>{var ji=jr(),Op=Lr();Li.exports=wp;function wp(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=Rp(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Op(r):r.results[o]=c,n(s,r.results))})}i(wp,"iterate");function Rp(e,t,r,n){var o;return e.length==2?o=e(r,ji(n)):o=e(r,t,ji(n)),o}i(Rp,"runJob")});var Br=T((aA,Fi)=>{Fi.exports=Np;function Np(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(Np,"state")});var Zr=T((uA,Bi)=>{var Dp=Lr(),Cp=jr();Bi.exports=Up;function Up(e){Object.keys(this.jobs).length&&(this.index=this.size,Dp(this),Cp(e)(null,this.results))}i(Up,"terminator")});var Vi=T((pA,Zi)=>{var Mp=Fr(),jp=Br(),Lp=Zr();Zi.exports=Fp;function Fp(e,t,r){for(var n=jp(e);n.index<(n.keyedList||e).length;)Mp(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Lp.bind(n,r)}i(Fp,"parallel")});var Vr=T((dA,Wt)=>{var Hi=Fr(),Bp=Br(),Zp=Zr();Wt.exports=Vp;Wt.exports.ascending=Wi;Wt.exports.descending=Hp;function Vp(e,t,r,n){var o=Bp(e,r);return Hi(e,t,o,i(function s(c,d){if(c){n(c,d);return}if(o.index++,o.index<(o.keyedList||e).length){Hi(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),Zp.bind(o,n)}i(Vp,"serialOrdered");function Wi(e,t){return e<t?-1:e>t?1:0}i(Wi,"ascending");function Hp(e,t){return-1*Wi(e,t)}i(Hp,"descending")});var Gi=T((fA,qi)=>{var Wp=Vr();qi.exports=qp;function qp(e,t,r){return Wp(e,t,null,r)}i(qp,"serial")});var Ji=T((yA,Ki)=>{Ki.exports={parallel:Vi(),serial:Gi(),serialOrdered:Vr()}});var Hr=T((hA,Xi)=>{"use strict";Xi.exports=Object});var Qi=T((vA,Yi)=>{"use strict";Yi.exports=Error});var ta=T((xA,ea)=>{"use strict";ea.exports=EvalError});var na=T((_A,ra)=>{"use strict";ra.exports=RangeError});var ia=T((PA,oa)=>{"use strict";oa.exports=ReferenceError});var sa=T((bA,aa)=>{"use strict";aa.exports=SyntaxError});var qt=T((IA,ua)=>{"use strict";ua.exports=TypeError});var pa=T((TA,ca)=>{"use strict";ca.exports=URIError});var da=T(($A,la)=>{"use strict";la.exports=Math.abs});var fa=T((EA,ma)=>{"use strict";ma.exports=Math.floor});var ya=T((SA,ga)=>{"use strict";ga.exports=Math.max});var va=T((AA,ha)=>{"use strict";ha.exports=Math.min});var _a=T((zA,xa)=>{"use strict";xa.exports=Math.pow});var ba=T((kA,Pa)=>{"use strict";Pa.exports=Math.round});var Ta=T((OA,Ia)=>{"use strict";Ia.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var Ea=T((RA,$a)=>{"use strict";var Gp=Ta();$a.exports=i(function(t){return Gp(t)||t===0?t:t<0?-1:1},"sign")});var Aa=T((DA,Sa)=>{"use strict";Sa.exports=Object.getOwnPropertyDescriptor});var Wr=T((CA,za)=>{"use strict";var Gt=Aa();if(Gt)try{Gt([],"length")}catch{Gt=null}za.exports=Gt});var Oa=T((UA,ka)=>{"use strict";var Kt=Object.defineProperty||!1;if(Kt)try{Kt({},"a",{value:1})}catch{Kt=!1}ka.exports=Kt});var qr=T((MA,wa)=>{"use strict";wa.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==o||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var Da=T((LA,Na)=>{"use strict";var Ra=typeof Symbol<"u"&&Symbol,Kp=qr();Na.exports=i(function(){return typeof Ra!="function"||typeof Symbol!="function"||typeof Ra("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Kp()},"hasNativeSymbols")});var Gr=T((BA,Ca)=>{"use strict";Ca.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Kr=T((ZA,Ua)=>{"use strict";var Jp=Hr();Ua.exports=Jp.getPrototypeOf||null});var La=T((VA,ja)=>{"use strict";var Xp="Function.prototype.bind called on incompatible ",Yp=Object.prototype.toString,Qp=Math.max,el="[object Function]",Ma=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),tl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),rl=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");ja.exports=i(function(t){var r=this;if(typeof r!="function"||Yp.apply(r)!==el)throw new TypeError(Xp+r);for(var n=tl(arguments,1),o,s=i(function(){if(this instanceof o){var _=r.apply(this,Ma(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ma(n,arguments))},"binder"),c=Qp(0,r.length-n.length),d=[],f=0;f<c;f++)d[f]="$"+f;if(o=Function("binder","return function ("+rl(d,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var Ve=T((WA,Fa)=>{"use strict";var nl=La();Fa.exports=Function.prototype.bind||nl});var Jt=T((qA,Ba)=>{"use strict";Ba.exports=Function.prototype.call});var Jr=T((GA,Za)=>{"use strict";Za.exports=Function.prototype.apply});var Ha=T((KA,Va)=>{"use strict";Va.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var qa=T((JA,Wa)=>{"use strict";var ol=Ve(),il=Jr(),al=Jt(),sl=Ha();Wa.exports=sl||ol.call(al,il)});var Ka=T((XA,Ga)=>{"use strict";var ul=Ve(),cl=qt(),pl=Jt(),ll=qa();Ga.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new cl("a function is required");return ll(ul,pl,t)},"callBindBasic")});var ts=T((QA,es)=>{"use strict";var dl=Ka(),Ja=Wr(),Ya;try{Ya=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var Xr=!!Ya&&Ja&&Ja(Object.prototype,"__proto__"),Qa=Object,Xa=Qa.getPrototypeOf;es.exports=Xr&&typeof Xr.get=="function"?dl([Xr.get]):typeof Xa=="function"?i(function(t){return Xa(t==null?t:Qa(t))},"getDunder"):!1});var as=T((tz,is)=>{"use strict";var rs=Gr(),ns=Kr(),os=ts();is.exports=rs?i(function(t){return rs(t)},"getProto"):ns?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ns(t)},"getProto"):os?i(function(t){return os(t)},"getProto"):null});var Yr=T((nz,ss)=>{"use strict";var ml=Function.prototype.call,fl=Object.prototype.hasOwnProperty,gl=Ve();ss.exports=gl.call(ml,fl)});var fs=T((oz,ms)=>{"use strict";var M,yl=Hr(),hl=Qi(),vl=ta(),xl=na(),_l=ia(),Ge=sa(),qe=qt(),Pl=pa(),bl=da(),Il=fa(),Tl=ya(),$l=va(),El=_a(),Sl=ba(),Al=Ea(),ls=Function,Qr=i(function(e){try{return ls('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),yt=Wr(),zl=Oa(),en=i(function(){throw new qe},"throwTypeError"),kl=yt?function(){try{return arguments.callee,en}catch{try{return yt(arguments,"callee").get}catch{return en}}}():en,He=Da()(),Q=as(),Ol=Kr(),wl=Gr(),ds=Jr(),ht=Jt(),We={},Rl=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),we={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":He&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":hl,"%eval%":eval,"%EvalError%":vl,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":ls,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":He&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!He||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":yl,"%Object.getOwnPropertyDescriptor%":yt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":xl,"%ReferenceError%":_l,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!He||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":He&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":He?Symbol:M,"%SyntaxError%":Ge,"%ThrowTypeError%":kl,"%TypedArray%":Rl,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Pl,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":ht,"%Function.prototype.apply%":ds,"%Object.defineProperty%":zl,"%Object.getPrototypeOf%":Ol,"%Math.abs%":bl,"%Math.floor%":Il,"%Math.max%":Tl,"%Math.min%":$l,"%Math.pow%":El,"%Math.round%":Sl,"%Math.sign%":Al,"%Reflect.getPrototypeOf%":wl};if(Q)try{null.error}catch(e){us=Q(Q(e)),we["%Error.prototype%"]=us}var us,Nl=i(function e(t){var r;if(t==="%AsyncFunction%")r=Qr("async function () {}");else if(t==="%GeneratorFunction%")r=Qr("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=Qr("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return we[t]=r,r},"doEval"),cs={__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"]},vt=Ve(),Xt=Yr(),Dl=vt.call(ht,Array.prototype.concat),Cl=vt.call(ds,Array.prototype.splice),ps=vt.call(ht,String.prototype.replace),Yt=vt.call(ht,String.prototype.slice),Ul=vt.call(ht,RegExp.prototype.exec),Ml=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,jl=/\\(\\)?/g,Ll=i(function(t){var r=Yt(t,0,1),n=Yt(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var o=[];return ps(t,Ml,function(s,c,d,f){o[o.length]=d?ps(f,jl,"$1"):c||s}),o},"stringToPath"),Fl=i(function(t,r){var n=t,o;if(Xt(cs,n)&&(o=cs[n],n="%"+o[0]+"%"),Xt(we,n)){var s=we[n];if(s===We&&(s=Nl(n)),typeof s>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ms.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(Ul(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ll(t),o=n.length>0?n[0]:"",s=Fl("%"+o+"%",r),c=s.name,d=s.value,f=!1,h=s.alias;h&&(o=h[0],Cl(n,Dl([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],u=Yt(x,0,1),l=Yt(x,-1);if((u==='"'||u==="'"||u==="`"||l==='"'||l==="'"||l==="`")&&u!==l)throw new Ge("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),o+="."+x,c="%"+o+"%",Xt(we,c))d=we[c];else if(d!=null){if(!(x in d)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(yt&&_+1>=n.length){var g=yt(d,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?d=g.get:d=d[x]}else $=Xt(d,x),d=d[x];$&&!f&&(we[c]=d)}}return d},"GetIntrinsic")});var ys=T((az,gs)=>{"use strict";var Bl=qr();gs.exports=i(function(){return Bl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var xs=T((uz,vs)=>{"use strict";var Zl=fs(),hs=Zl("%Object.defineProperty%",!0),Vl=ys()(),Hl=Yr(),Wl=qt(),Qt=Vl?Symbol.toStringTag:null;vs.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new Wl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Qt&&(n||!Hl(t,Qt))&&(hs?hs(t,Qt,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Qt]=r)},"setToStringTag")});var Ps=T((pz,_s)=>{"use strict";var ql=Function.prototype.call,Gl=Object.prototype.hasOwnProperty,Kl=Ve();_s.exports=Kl.call(ql,Gl)});var Is=T((lz,bs)=>{"use strict";bs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Es=T((dz,$s)=>{"use strict";var on=Ai(),Jl=require("util"),tn=require("path"),Xl=require("http"),Yl=require("https"),Ql=require("url").parse,ed=require("fs"),td=require("stream").Stream,rd=require("crypto"),rn=Ri(),nd=Ji(),od=xs(),Ee=Ps(),nn=Is();function Ts(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ts,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],on.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(L,"FormData");Jl.inherits(L,on);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=on.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ee(t,"httpVersion"))&&!(t instanceof td))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Ee(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ed.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Ee(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ee(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Ts(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&nn(c,r.header);var d;for(var f in c)if(Ee(c,f)){if(d=c[f],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(s+=f+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+s+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=tn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=tn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ee(e,"httpVersion")&&(r=tn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ts(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=rn.lookup(e.name)),!r&&e&&e.path&&(r=rn.lookup(e.path)),!r&&e&&e.readable&&Ee(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=rn.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)Ee(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="--------------------------"+rd.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}nd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Ql(e),n=nn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=nn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Yl.request(n):r=Xl.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,f=i(function(h,_){return r.removeListener("error",f),r.removeListener("response",d),t.call(this,h,_)},"callback");d=f.bind(this,null),r.on("error",f),r.on("response",d)}}.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]"};od(L.prototype,"FormData");$s.exports=L});var fd={};cn(fd,{reddit:()=>md});module.exports=Vs(fd);var Hs=Object.freeze({status:"aborted"});function b(e,t,r){function n(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);let h=c.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];x in d||(d[x]=h[x].bind(d))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(d){var f;let h=r?.Parent?new s:this;n(h,d),(f=h._zod).deferred??(f.deferred=[]);for(let _ of h._zod.deferred)_();return h}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(b,"$constructor");var Ws=Symbol("zod_brand"),pe=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_t=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},tr={};function me(e){return e&&Object.assign(tr,e),tr}i(me,"config");function nr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(nr,"getEnumValues");function dn(e,t){return typeof t=="bigint"?t.toString():t}i(dn,"jsonStringifyReplacer");function bt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(bt,"cached");function mn(e){return e==null}i(mn,"nullish");function It(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(It,"cleanRegex");var ln=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==ln)return n===void 0&&(n=ln,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(K,"defineLazy");var or="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Xe,"isObject");var qs=bt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function fn(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)}i(fn,"isPlainObject");var gn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Ne,"escapeRegex");function Tt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Tt,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(V,"normalizeParams");function yn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(yn,"optionalKeys");var Gs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function De(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(De,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(_e,"prefixIssues");function Pt(e){return typeof e=="string"?e:e?.message}i(Pt,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Pt(e.inst?._zod.def?.error?.(e))??Pt(t?.error?.(e))??Pt(r.customError?.(e))??Pt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Pe,"finalizeIssue");function hn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(hn,"getLengthableOrigin");function ir(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(ir,"issue");var vn=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),xn=b("$ZodError",vn),Ye=b("$ZodError",vn,{Parent:Error});var Js=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new pe;if(c.issues.length){let d=new(o?.Err??e)(c.issues.map(f=>Pe(f,s,me())));throw or(d,o?.callee),d}return c.value},"_parse"),$t=Js(Ye),Xs=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(o?.Err??e)(c.issues.map(f=>Pe(f,s,me())));throw or(d,o?.callee),d}return c.value},"_parseAsync"),Et=Xs(Ye),Ys=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??xn)(s.issues.map(c=>Pe(c,o,me())))}:{success:!0,data:s.value}},"_safeParse"),Qe=Ys(Ye),Qs=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Pe(c,o,me())))}:{success:!0,data:s.value}},"_safeParseAsync"),et=Qs(Ye);var eu="(?:(?:\\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])))",tu=new RegExp(`^${eu}$`);var _n=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Pn=/^-?\d+n?$/;var ar=/^-?\d+(?:\.\d+)?$/,bn=/^(?:true|false)$/i;var Ce=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var In=b("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=hn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var sr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Tn=b("$ZodCheckRegex",(e,t)=>{sr.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 En={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=En;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,d,f)=>{let h=De(c),_;for(let $ of d){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,u=$._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new pe;if(_||u instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(h||(h=De(c,x)))});else{if(c.issues.length===x)continue;h||(h=De(c,x))}}return _?_.then(()=>c):c},"runChecks"),s=i((c,d,f)=>{if(De(c))return c.aborted=!0,c;let h=o(d,n,f);if(h instanceof Promise){if(f.async===!1)throw new pe;return h.then(_=>e._zod.parse(_,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(_=>s(_,c,d)):s(h,c,d)}let f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new pe;return f.then(h=>o(h,n,d))}return o(f,n,d)}}K(e,"~standard",()=>({validate:i(o=>{try{let s=Qe(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return et(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),zt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),ur=b("$ZodStringFormat",(e,t)=>{sr.init(e,t),zt.init(e,t)});var On=b("$ZodURL",(e,t)=>{ur.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var wn=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??ar,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}});var cr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=bn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Rn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Pn,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 Nn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Dn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Cn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Un=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Sn(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}i(Sn,"handleArrayResult");var Mn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let d=o[c],f=t.element._zod.run({value:d,issues:[]},n);f instanceof Promise?s.push(f.then(h=>Sn(h,r,c))):Sn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function At(e,t,r,n,o){if(e.issues.length){if(o&&!(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}i(At,"handlePropertyResult");function ru(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=yn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(ru,"normalizeDef");function nu(e,t,r,n,o,s){let c=[],d=o.keySet,f=o.catchall._zod,h=f.def.type,_=f.optout==="optional";for(let $ in t){if(d.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(u=>At(u,r,$,t,_))):At(x,r,$,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(nu,"handleCatchall");var jn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...d};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=bt(()=>ru(t));K(e._zod,"propValues",()=>{let d=t.shape,f={};for(let h in d){let _=d[h]._zod;if(_.values){f[h]??(f[h]=new Set);for(let $ of _.values)f[h].add($)}}return f});let o=Xe,s=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let h=d.value;if(!o(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let _=[],$=c.shape;for(let x of c.keys){let u=$[x],l=u._zod.optout==="optional",g=u._zod.run({value:h[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>At(m,d,x,h,l))):At(g,d,x,h,l)}return s?nu(_,h,d,f,n.value,e):_.length?Promise.all(_).then(()=>d):d}});function An(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!De(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Pe(c,n,me())))}),t)}i(An,"handleUnionResults");var pr=b("$ZodUnion",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),K(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>It(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,d=[];for(let f of t.options){let h=f._zod.run({value:o.value,issues:[]},s);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(f=>An(f,o,e,s)):An(d,o,e,s)}});var Ln=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,pr.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[d,f]of Object.entries(c)){o[d]||(o[d]=new Set);for(let h of f)o[d].add(h)}}return o});let n=bt(()=>{let o=t.options,s=new Map;for(let c of o){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of d){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!Xe(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var Fn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!fn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:o[h],issues:[]},n);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(..._e(h,$.issues)),r.value[h]=$.value})):(_.issues.length&&r.issues.push(..._e(h,_.issues)),r.value[h]=_.value)}let f;for(let h in o)d.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let d of Reflect.ownKeys(o)){if(d==="__proto__")continue;let f=t.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&ar.test(d)&&f.issues.length){let $=t.keyType._zod.run({value:Number(d),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[d]=o[d]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>Pe($,n,me())),input:d,path:[d],inst:e});continue}let _=t.valueType._zod.run({value:o[d],issues:[]},n);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(..._e(d,$.issues)),r.value[f.value]=$.value})):(_.issues.length&&r.issues.push(..._e(d,_.issues)),r.value[f.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Bn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=nr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>gn.has(typeof o)).map(o=>typeof o=="string"?Ne(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Zn=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Vn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new _t(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new pe;return r.value=o,r}});function zn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(zn,"handleOptionalResult");var Hn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${It(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>zn(s,r.value)):zn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Wn=b("$ZodNullable",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${It(r.source)}|null)$`):void 0}),K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var qn=b("$ZodPipe",(e,t)=>{H.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>St(c,t.in,n)):St(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>St(s,t.out,n)):St(o,t.out,n)}});function St(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(St,"handlePipeResult");var Gn=b("$ZodCustom",(e,t)=>{Ce.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>kn(s,r,n,e));kn(o,r,n,e)}});function kn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ir(o))}}i(kn,"handleRefineResult");var Jn,su=Symbol("ZodOutput"),uu=Symbol("ZodInput"),lr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function Xn(){return new lr}i(Xn,"registry");(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=Xn());var dr=globalThis.__zod_globalRegistry;function Yn(e,t){return new e({type:"string",...V(t)})}i(Yn,"_string");function Qn(e,t){return new e({type:"string",coerce:!0,...V(t)})}i(Qn,"_coercedString");function eo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}i(eo,"_url");function to(e,t){return new e({type:"number",checks:[],...V(t)})}i(to,"_number");function ro(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}i(ro,"_coercedNumber");function no(e,t){return new e({type:"boolean",...V(t)})}i(no,"_boolean");function oo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}i(oo,"_coercedBoolean");function io(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}i(io,"_coercedBigint");function ao(e){return new e({type:"any"})}i(ao,"_any");function so(e){return new e({type:"unknown"})}i(so,"_unknown");function uo(e,t){return new e({type:"void",...V(t)})}i(uo,"_void");function co(e,t){return new e({type:"date",coerce:!0,...V(t)})}i(co,"_coercedDate");function ue(e,t){return new In({check:"min_length",...V(t),minimum:e})}i(ue,"_minLength");function be(e,t){return new Tn({check:"string_format",format:"regex",...V(t),pattern:e})}i(be,"_regex");function po(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(po,"_custom");var J=b("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)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>Et(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)=>Tt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ot=b("ZodMiniString",(e,t)=>{zt.init(e,t),J.init(e,t)});function a(e){return Yn(Ot,e)}i(a,"string");var lo=b("ZodMiniStringFormat",(e,t)=>{ur.init(e,t),Ot.init(e,t)});var vu=b("ZodMiniURL",(e,t)=>{On.init(e,t),lo.init(e,t)});function mo(e){return eo(vu,e)}i(mo,"url");var mr=b("ZodMiniNumber",(e,t)=>{wn.init(e,t),J.init(e,t)});function ee(e){return to(mr,e)}i(ee,"number");var fr=b("ZodMiniBoolean",(e,t)=>{cr.init(e,t),J.init(e,t)});function B(e){return no(fr,e)}i(B,"boolean");var fo=b("ZodMiniBigInt",(e,t)=>{Rn.init(e,t),J.init(e,t)});var xu=b("ZodMiniAny",(e,t)=>{Nn.init(e,t),J.init(e,t)});function rt(){return ao(xu)}i(rt,"any");var _u=b("ZodMiniUnknown",(e,t)=>{Dn.init(e,t),J.init(e,t)});function O(){return so(_u)}i(O,"unknown");var Pu=b("ZodMiniVoid",(e,t)=>{Cn.init(e,t),J.init(e,t)});function go(e){return uo(Pu,e)}i(go,"_void");var yo=b("ZodMiniDate",(e,t)=>{Un.init(e,t),J.init(e,t)});var bu=b("ZodMiniArray",(e,t)=>{Mn.init(e,t),J.init(e,t)});function N(e,t){return new bu({type:"array",element:e,...V(t)})}i(N,"array");var Iu=b("ZodMiniObject",(e,t)=>{jn.init(e,t),J.init(e,t),K(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Iu(r)}i(p,"object");var Tu=b("ZodMiniUnion",(e,t)=>{pr.init(e,t),J.init(e,t)});function D(e,t){return new Tu({type:"union",options:e,...V(t)})}i(D,"union");var $u=b("ZodMiniDiscriminatedUnion",(e,t)=>{Ln.init(e,t),J.init(e,t)});function Ue(e,t,r){return new $u({type:"union",options:t,discriminator:e,...V(r)})}i(Ue,"discriminatedUnion");var Eu=b("ZodMiniRecord",(e,t)=>{Fn.init(e,t),J.init(e,t)});function w(e,t,r){return new Eu({type:"record",keyType:e,valueType:t,...V(r)})}i(w,"record");var Su=b("ZodMiniEnum",(e,t)=>{Bn.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Su({type:"enum",entries:r,...V(t)})}i(U,"_enum");var Au=b("ZodMiniLiteral",(e,t)=>{Zn.init(e,t),J.init(e,t)});function E(e,t){return new Au({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}i(E,"literal");var zu=b("ZodMiniTransform",(e,t)=>{Vn.init(e,t),J.init(e,t)});function Ie(e){return new zu({type:"transform",transform:e})}i(Ie,"transform");var ku=b("ZodMiniOptional",(e,t)=>{Hn.init(e,t),J.init(e,t)});function y(e){return new ku({type:"optional",innerType:e})}i(y,"optional");var Ou=b("ZodMiniNullable",(e,t)=>{Wn.init(e,t),J.init(e,t)});function nt(e){return new Ou({type:"nullable",innerType:e})}i(nt,"nullable");var wu=b("ZodMiniPipe",(e,t)=>{qn.init(e,t),J.init(e,t)});function Te(e,t){return new wu({type:"pipe",in:e,out:t})}i(Te,"pipe");var Ru=b("ZodMiniCustom",(e,t)=>{Gn.init(e,t),J.init(e,t)});function wt(e,t){return po(Ru,e??(()=>!0),t)}i(wt,"custom");var ot={};cn(ot,{bigint:()=>Lu,boolean:()=>ju,date:()=>Fu,number:()=>Mu,string:()=>Uu});function Uu(e){return Qn(Ot,e)}i(Uu,"string");function Mu(e){return ro(mr,e)}i(Mu,"number");function ju(e){return oo(fr,e)}i(ju,"boolean");function Lu(e){return io(fo,e)}i(Lu,"bigint");function Fu(e){return co(yo,e)}i(Fu,"date");var yr=p({retryOnFailure:p({defaultValue:y(B()),hide:y(B())}),continueOnFailure:p({defaultValue:y(B()),hide:y(B())})}),gr=class{constructor(t,r,n,o,s,c,d,f,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=d;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{i(this,"IAction")}},X=i(e=>new gr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:y(a())}),C=i((e,t)=>p({type:E(t),required:B(),defaultValue:y(rt())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),fe=p({...F.shape,...C(a(),"LONG_TEXT").shape});var vo=p({label:a(),value:O()}),Rt=p({disabled:y(B()),placeholder:y(a()),options:N(vo)});var oe=p({...F.shape,options:Rt,...C(O(),"STATIC_DROPDOWN").shape}),ge=p({...F.shape,options:Rt,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var hr=p({...F.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),it=p({...F.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ye=p({...F.shape,...C(B(),"CHECKBOX").shape});var he=p({...F.shape,...C(ee(),"NUMBER").shape});var at=p({...F.shape,...C(O(),"FILE").shape});var st=p({...F.shape,...C(a(),"DATE_TIME").shape});var xo=w(a(),D([ne,fe,oe,it,ge,ye,he,at,st])),ut=p({...F.shape,properties:xo,...C(N(O()),"ARRAY").shape});var ct=p({...F.shape,...C(D([w(a(),O())]),"JSON").shape});var _o=D([ne,oe,ct,ut,ge]),Zu=w(a(),_o),vr=p({refreshers:N(a()),...F.shape,...C(O(),"DYNAMIC").shape});var Nt=p({...F.shape,...C(go(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),je=(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))(je||{});var Le=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Le||{}),xr="both_client_credentials_and_authorization_code";var Ae=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ae||{}),lt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(lt||{}),Vu=p({strategy:U(lt),paramName:y(a())}),dt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(dt||{});var Dt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Dt||{}),Po=p({status:y(ee()),body:y(O()),headers:y(w(a(),a()))}),bo=p({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Dt))}),Io=p({type:E("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Po,handlerId:y(a()),streamStepProgress:y(U(Dt))}),Hu=D([bo,Io]);var Wu=p({body:O(),rawBody:y(O()),headers:w(a(),a()),queryParams:w(a(),a())});function ve(e){return e==null}i(ve,"isNil");function mt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(mt,"isEmpty");function Ct(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(Ct,"assertNotNullOrUndefined");var _r=Re(require("crypto"),1);var qu=128,ze,Fe,Gu=i(e=>{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*qu),_r.default.randomFillSync(ze),Fe=0):Fe+e>ze.length&&(_r.default.randomFillSync(ze),Fe=0),Fe+=e},"fillPool"),Ku=i(e=>(Gu(e|=0),ze.subarray(Fe-e,Fe)),"random"),Ju=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let d=r(o),f=o;for(;f--;)if(c+=e[d[f]&n]||"",c.length===s)return c}}},"customRandom"),$o=i((e,t=21)=>Ju(e,t,Ku),"customAlphabet");var Xu="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Eo=21,XP=a().check(be(new RegExp(`^[0-9a-zA-Z]{${Eo}}$`))),Yu=$o(Xu,Eo);var $e=Te(Ie(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:$e,updated:$e},Z=i(e=>y(nt(e)),"Nullable");function Pr(e){return y(nt(U(e)))}i(Pr,"NullableEnum");var eb=Te(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Ut=i(e=>Te(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var nb=w(a(),O());var ft=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(ft||{});var gb=a().check(be(/^#[0-9A-Fa-f]{6}$/));var hb=p({filename:a(),data:O(),type:E("file"),mimetype:y(a())});var Qu=Re(Ao());var Tb=p({...ie,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:y(ee())});var zo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(zo||{}),br=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(br||{}),Ir=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ir||{});var Tr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Tr||{});var $r=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))($r||{});var ec=p({mode:U(zo),value:O()}),tc=p({auth:y(a()),fields:w(a(),ec)}),rc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(tc)}),nc=p({type:E("PIECE"),toolName:a().check(ue(1)),pieceMetadata:rc}),oc=p({type:E("none")}),ic=p({type:E("access_token"),accessToken:a()}),ac=p({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),sc=p({type:E("headers"),headers:w(a(),a())}),uc=Ue("type",[oc,ic,ac,sc]),ko=p({type:E("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:y(a())}),Oo=p({type:E("MCP"),toolName:a().check(ue(1)),serverUrl:mo(),protocol:U(Ir),auth:uc}),wo=p({type:E("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U(br),sourceId:a(),sourceName:a()}),cc=Ue("type",[nc,ko,Oo,wo]),pc=p({displayName:a(),description:y(a()),type:U(Tr)}),Ro=p({type:E("MARKDOWN"),markdown:a()}),Be={type:E("TOOL_CALL"),input:Z(w(a(),O())),output:y(O()),toolName:a(),status:U($r),toolCallId:a(),startTime:a(),endTime:y(a())},Xb=p(Be),No=Ue("toolCallType",[p({...Be,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Be,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),p({...Be,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),p({...Be,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Be,toolCallType:E("UNKNOWN"),displayName:a()})]),lc=D([Ro,No]);var Er=(r=>(r.IMAGE="image",r.TEXT="text",r))(Er||{}),xe=p({apiKey:a()}),dc=xe,mc=p({apiKey:a(),apiKeyHash:a()}),fc=xe,gc=xe,yc=xe,hc=xe,vc=xe,xc=xe,_c=xe,Do=p({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Pc=p({}),bc=p({}),Ic=p({}),Tc=p({}),$c=p({}),Ec=p({}),Co=p({modelId:a(),modelName:a(),modelType:U(Er)}),Uo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Co),defaultHeaders:y(w(a(),a()))}),Mo=p({accountId:a(),gatewayId:a(),models:N(Co),vertexProject:y(a()),vertexRegion:y(a())}),jo=p({resourceName:a(),apiVersion:Te(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),Lo=p({region:a().check(ue(1))}),Sc=D([dc,yc,hc,vc,xc,gc,fc,mc,Do,_c]),Fo=D([Uo,Mo,jo,Lo,Pc,Ic,Tc,$c,bc,Ec]),Ac=p({id:a(),name:a(),type:U(Er)}),zc=p({id:a(),name:a(),provider:U(ft),config:Fo,enabledForChat:B()}),kc=p({provider:U(ft),config:Fo,auth:Sc,platformId:a()});var tI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Oc=p({base64Url:a(),fileName:a(),extension:y(a())}),wc=p({mimeType:a(),url:a(),fileName:y(a())}),Sr=D([Oc,wc]);var Rc=D([p({type:E("file"),value:Sr}),p({type:E("markdown"),value:a(),files:y(N(Sr))})]),Nc=p({sessionId:a(),message:a(),files:y(N(a()))});var Zo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Zo||{}),Vo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Vo||{}),Ar=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ar||{});var Dc=D([p({...ie,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),Cc=p({...ie,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Pr(Vo),trigger:Pr(Zo)}),Uc=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),Mc=p({events:N(U(Ar)),webhookUrl:a(),flowId:a()}),jc=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Lc=p({projectId:a(),limit:y(ot.number()),cursor:y(a()),name:y(a()),externalIds:Ut(a()),folderId:y(a()),folderIds:Ut(a())}),Fc=p({records:N(N(p({fieldId:a(),value:Wo()}))),tableId:a()}),Bc=p({cells:y(N(p({fieldId:a(),value:Wo()}))),tableId:a(),agentUpdate:y(B())}),Ho=Ue("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),Bo("exists"),Bo("not_exists")]),Zc=p({tableId:a(),limit:y(ot.number()),cursor:y(a()),filters:Ut(Ho)});function Wo(){return Te(Ie(e=>e==null?e:String(e)),nt(a()))}i(Wo,"coerceToString");function ke(e){return p({fieldId:a(),operator:E(e),value:a()})}i(ke,"valueFilter");function Bo(e){return p({fieldId:a(),operator:E(e)})}i(Bo,"existenceFilter");var Vc=p({status:y(ee()),body:y(O()),headers:y(w(a(),a()))}),Hc=p({...ie,deleted:Z($e),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var qo=p({name:a(),description:y(a()),type:a(),required:B()}),Wc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(qo),returnsResponse:B()})});var Go="^[0-9]+\\.[0-9]+\\.[0-9]+$",_I=new RegExp(Go),Gc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",PI=a().check(be(new RegExp(Go))),bI=a().check(be(new RegExp(Gc))),Kc=p({packageType:E("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Ko=p({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Jo=p({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),II=D([Ko,Jo]),TI=D([Kc,Ko,Jo]),Xo=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(Xo||{}),Jc=p({type:U(Xo),cronExpression:a(),timezone:a()}),$I=p({...ie,type:U(Ae),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Jc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),Yo=(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))(Yo||{}),Qo=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Qo||{}),ei=(r=>(r.S3="S3",r.DB="DB",r))(ei||{}),EI=p({...ie,projectId:Z(a()),platformId:Z(a()),type:U(Yo),compression:U(Qo),data:y(O()),location:U(ei),size:Z(ee()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),ti=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(ti||{}),ri=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ri||{}),SI=p({id:a(),email:a(),firstName:a(),status:U(ri),externalId:Z(a()),platformId:Z(a()),platformRole:U(ti),lastName:a(),created:$e,updated:$e,lastActiveDate:Z($e),imageUrl:Z(a())});var zr=p({...F.shape,...C(w(a(),O()),"OBJECT").shape});var ai=p({...F.shape,...C(a(),"COLOR").shape});var kr=D([ne,fe,Nt,ye,oe,ge,hr,it,vr,he,ut,zr,ct,st,at,ai]),S={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 le=p({displayName:a(),description:y(a())});var si=p({username:a(),password:a()}),Or=p({...le.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...C(si,"BASIC_AUTH").shape});var ep=w(a(),D([ne,fe,he,ye,oe])),wr=p({...le.shape,props:ep,...C(O(),"CUSTOM_AUTH").shape});var Oe=p({...le.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var tp=w(a(),D([ne,fe,Oe,he,ye,oe,ge,Nt])),ui=p({...le.shape,props:tp,...C(O(),"OIDC").shape});var jt=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(jt||{}),ci=D([ne,Oe,oe]),pi=w(a(),ci),rp=p({props:y(w(a(),ci)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([E("none"),E("consent"),E("login"),E("omit")])),pkce:y(B()),pkceMethod:y(D([E("plain"),E("S256")])),authorizationMethod:y(U(jt)),grantType:y(D([U(Le),E(xr)])),extra:y(w(a(),a()))}),li=p({access_token:a(),props:y(pi),data:w(a(),rt())}),Rr=p({...le.shape,...rp.shape,...C(li,"OAUTH2").shape});var Ze=D([Or,wr,ui,Rr,Oe]),gt="Connection",Nr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||gt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||gt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||gt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||gt}},None(){}};var i$={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=p({...F.shape,...C(O(),"CUSTOM").shape,code:a()});var op=D([kr,Ze]),Dr=w(a(),op),$$=w(a(),kr);var di=D([p({strategy:E("CRON"),cronExpression:a()}),p({strategy:E("NONE")})]);var mi="2",Lt="0.82.0";var Cr=class{constructor(t,r,n,o,s,c,d,f,h=Lt,_,$=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=d;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:mi}),"getContextInfo");(!ip(h)||ap(h,Lt))&&(this.minimumSupportedRelease=Lt),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},fi=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Cr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function ip(e){return/^\d+\.\d+\.\d+$/.test(e)}i(ip,"isValidSimpleSemver");function ap(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,d]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<d}i(ap,"isSemverLessThan");var sp=y(w(a(),w(a(),a()))),gi=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([Ze,N(Ze)])),version:a(),categories:y(N(U(je))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:sp}),up=U(["human","ai","both"]),yi=p({description:y(a()),idempotent:y(B())}),hi=p({name:a(),displayName:a(),description:a(),props:Dr,requireAuth:B(),errorHandlingOptions:y(yr),outputSchema:y(wt()),audience:y(up),aiMetadata:y(yi)}),vi=p({name:a(),displayName:a(),description:a(),props:Dr,errorHandlingOptions:y(yr),type:U(Ae),sampleData:O(),handshakeConfiguration:y(wt()),renewConfiguration:y(di),testStrategy:U(dt),outputSchema:y(wt()),aiMetadata:y(yi)}),cp=p({...gi.shape,actions:w(a(),hi),triggers:w(a(),vi)}),pp=p({...gi.shape,actions:ee(),triggers:ee(),suggestedActions:y(N(vi)),suggestedTriggers:y(N(hi))}),xi=p({projectUsage:ee(),tags:y(N(a())),pieceType:U(Me),packageType:U(pt),platformId:y(a()),archiveId:y(a())}),$E=p({...cp.shape,...xi.shape}),EE=p({...pp.shape,...xi.shape}),SE=p({name:a(),version:a()});var lp=Re(require("path")),dp=Re(require("fs/promises"));var Ft=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Bt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new Ur,r=new Mr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Ur=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Mr=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var Zt=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Vt=class extends Ft{static{i(this,"FetchHttpClient")}constructor(t="",r=new Bt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[j,re]of Object.entries(c))o.append(j,re);let d=o.toString(),f=d?`${n}?${d}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:u,isStream:l}=mp(t.body,s),g=gp({...s,...u}),m=await fp(async()=>{let j=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:j.signal};return l&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{re!==void 0&&clearTimeout(re)}},$),v=_?300:400;if(m.status<200||m.status>=v){let j=await _i(m,h),re=new Zt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await _i(m,h);return{status:m.status,headers:yp(m.headers),body:P}}};function mp(e,t){return vp(e)?{body:void 0,extraHeaders:{},isStream:!1}:hp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(mp,"serializeBody");async function _i(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(_i,"parseResponseBody");async function fp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Pi(n);continue}return o}catch(o){if(r=o,n<t){await Pi(n);continue}throw o}throw r}i(fp,"sendWithRetries");function Pi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Pi,"backoff");function gp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(gp,"normalizeHeaders");function yp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(yp,"toHttpHeaders");function hp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(hp,"isNodeFormData");function vp(e){return e==null}i(vp,"isNil");var Y=new Vt;var ae=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ae||{});var id=Re(require("fs")),Ss=Re(Es());var ad={"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 sd(e){let t=e.split(";")[0].trim().toLowerCase();return ad[t]??""}i(sd,"contentTypeToExtension");var ud=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),cd=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function As({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:d,authLocation:f="headers"}){return X({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:h})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
1
|
+
"use strict";var Qs=Object.create;var Xe=Object.defineProperty;var eu=Object.getOwnPropertyDescriptor;var tu=Object.getOwnPropertyNames;var ru=Object.getPrototypeOf,nu=Object.prototype.hasOwnProperty;var i=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},dn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tu(t))!nu.call(e,o)&&o!==r&&Xe(e,o,{get:()=>t[o],enumerable:!(n=eu(t,o))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?Qs(ru(e)):{},mn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),ou=e=>mn(Xe({},"__esModule",{value:!0}),e);var Uo=T((Co,Bt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function f(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let g=0,m=-1,v=(u.match(l.zoneIndex)||[])[0],P,L;for(v&&(v=v.substring(1),u=u.replace(/%.+$/,""));(m=u.indexOf(":",m+1))>=0;)g++;if(u.substr(0,2)==="::"&&g--,u.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=(function(){let re=u.split(":"),se=[];for(let Je=0;Je<re.length;Je++)se.push(parseInt(re[Je],16));return se})(),{parts:d,zoneId:v}}i(f,"expandIPv6");function h(u,d,g,m){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),u[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}i(h,"matchCIDR");function _(u){if(o.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}i(_,"parseIntAuto");function $(u,d){for(;u.length<d;)u=`0${u}`;return u}i($,"padPart");let x={};x.IPv4=(function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return i(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,L;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(L=m[P],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u})(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,g,m,v,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,g,m;if(d=u.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let L=0;L<v.length;L++)g=v[L],P.push(_(g));return P})();if(d=u.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=u.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=u.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=(function(){function u(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return i(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},u.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},u.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},u.prototype.toString=function(){return this.toRFC5952String()},u})(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,g,m,v,P;try{for(d=this.parseCIDR(u),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(u){let d=this.parser(u);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(u){let d,g,m;if((g=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,g,m,v,P,L;if(m=u.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(u))return f(u,8);if((m=u.match(l.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(u/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,g){let m,v,P,L;g==null&&(g="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(L=P[m],u.kind()===L[0].kind()&&u.match.apply(u,L))return v}return g},typeof Bt<"u"&&Bt.exports?Bt.exports=x:e.ipaddr=x})(Co)});var Mi=T((yA,Ui)=>{var Ci=require("stream").Stream,jp=require("util");Ui.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i(pe,"DelayedStream");jp.inherits(pe,Ci);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Ci.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.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)};pe.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 Bi=T((vA,Fi)=>{var Fp=require("util"),ji=require("stream").Stream,Li=Mi();Fi.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}i(W,"CombinedStream");Fp.inherits(W,ji);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 Li)){var r=Li.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 ji.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 Vi=T((_A,Zi)=>{"use strict";Zi.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 Wi=T(te=>{"use strict";var qt=Vi(),Bp=require("path").extname,Hi=/^\s*([^;\s]*)(?:;|\s|$)/,Zp=/^text\//i;te.charset=Gi;te.charsets={lookup:Gi};te.contentType=Vp;te.extension=Hp;te.extensions=Object.create(null);te.lookup=Gp;te.types=Object.create(null);Wp(te.extensions,te.types);function Gi(e){if(!e||typeof e!="string")return!1;var t=Hi.exec(e),r=t&&qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Zp.test(t[1])?"UTF-8":!1}i(Gi,"charset");function Vp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(Vp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=Hi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(Hp,"extension");function Gp(e){if(!e||typeof e!="string")return!1;var t=Bp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}i(Gp,"lookup");function Wp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(qt).forEach(i(function(o){var s=qt[o],c=s.extensions;if(!(!c||!c.length)){e[o]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var h=r.indexOf(qt[t[f]].source),_=r.indexOf(s.source);if(t[f]!=="application/octet-stream"&&(h>_||h===_&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(Wp,"populateMaps")});var Ki=T((IA,qi)=>{qi.exports=qp;function qp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(qp,"defer")});var Br=T((EA,Xi)=>{var Ji=Ki();Xi.exports=Kp;function Kp(e){var t=!1;return Ji(function(){t=!0}),i(function(n,o){t?e(n,o):Ji(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(Kp,"async")});var Zr=T((SA,Yi)=>{Yi.exports=Jp;function Jp(e){Object.keys(e.jobs).forEach(Xp.bind(e)),e.jobs={}}i(Jp,"abort");function Xp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(Xp,"clean")});var Vr=T((zA,ea)=>{var Qi=Br(),Yp=Zr();ea.exports=Qp;function Qp(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=el(t,o,e[o],function(s,c){o in r.jobs&&(delete r.jobs[o],s?Yp(r):r.results[o]=c,n(s,r.results))})}i(Qp,"iterate");function el(e,t,r,n){var o;return e.length==2?o=e(r,Qi(n)):o=e(r,t,Qi(n)),o}i(el,"runJob")});var Hr=T((kA,ta)=>{ta.exports=tl;function tl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,s){return t(e[o],e[s])}),n}i(tl,"state")});var Gr=T((RA,ra)=>{var rl=Zr(),nl=Br();ra.exports=ol;function ol(e){Object.keys(this.jobs).length&&(this.index=this.size,rl(this),nl(e)(null,this.results))}i(ol,"terminator")});var oa=T((DA,na)=>{var il=Vr(),al=Hr(),sl=Gr();na.exports=ul;function ul(e,t,r){for(var n=al(e);n.index<(n.keyedList||e).length;)il(e,t,n,function(o,s){if(o){r(o,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return sl.bind(n,r)}i(ul,"parallel")});var Wr=T((UA,Kt)=>{var ia=Vr(),cl=Hr(),pl=Gr();Kt.exports=ll;Kt.exports.ascending=aa;Kt.exports.descending=dl;function ll(e,t,r,n){var o=cl(e,r);return ia(e,t,o,i(function s(c,l){if(c){n(c,l);return}if(o.index++,o.index<(o.keyedList||e).length){ia(e,t,o,s);return}n(null,o.results)},"iteratorHandler")),pl.bind(o,n)}i(ll,"serialOrdered");function aa(e,t){return e<t?-1:e>t?1:0}i(aa,"ascending");function dl(e,t){return-1*aa(e,t)}i(dl,"descending")});var ua=T((LA,sa)=>{var ml=Wr();sa.exports=fl;function fl(e,t,r){return ml(e,t,null,r)}i(fl,"serial")});var pa=T((FA,ca)=>{ca.exports={parallel:oa(),serial:ua(),serialOrdered:Wr()}});var qr=T((BA,la)=>{"use strict";la.exports=Object});var ma=T((ZA,da)=>{"use strict";da.exports=Error});var ga=T((VA,fa)=>{"use strict";fa.exports=EvalError});var ha=T((HA,ya)=>{"use strict";ya.exports=RangeError});var xa=T((GA,va)=>{"use strict";va.exports=ReferenceError});var Pa=T((WA,_a)=>{"use strict";_a.exports=SyntaxError});var Jt=T((qA,ba)=>{"use strict";ba.exports=TypeError});var Ta=T((KA,Ia)=>{"use strict";Ia.exports=URIError});var $a=T((JA,Ea)=>{"use strict";Ea.exports=Math.abs});var Aa=T((XA,Sa)=>{"use strict";Sa.exports=Math.floor});var Oa=T((YA,za)=>{"use strict";za.exports=Math.max});var wa=T((QA,ka)=>{"use strict";ka.exports=Math.min});var Na=T((ez,Ra)=>{"use strict";Ra.exports=Math.pow});var Ca=T((tz,Da)=>{"use strict";Da.exports=Math.round});var Ma=T((rz,Ua)=>{"use strict";Ua.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var ja=T((oz,La)=>{"use strict";var gl=Ma();La.exports=i(function(t){return gl(t)||t===0?t:t<0?-1:1},"sign")});var Ba=T((az,Fa)=>{"use strict";Fa.exports=Object.getOwnPropertyDescriptor});var Kr=T((sz,Za)=>{"use strict";var Xt=Ba();if(Xt)try{Xt([],"length")}catch{Xt=null}Za.exports=Xt});var Ha=T((uz,Va)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Va.exports=Yt});var Jr=T((cz,Ga)=>{"use strict";Ga.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ka=T((lz,qa)=>{"use strict";var Wa=typeof Symbol<"u"&&Symbol,yl=Jr();qa.exports=i(function(){return typeof Wa!="function"||typeof Symbol!="function"||typeof Wa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yl()},"hasNativeSymbols")});var Xr=T((mz,Ja)=>{"use strict";Ja.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Yr=T((fz,Xa)=>{"use strict";var hl=qr();Xa.exports=hl.getPrototypeOf||null});var es=T((gz,Qa)=>{"use strict";var vl="Function.prototype.bind called on incompatible ",xl=Object.prototype.toString,_l=Math.max,Pl="[object Function]",Ya=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),bl=i(function(t,r){for(var n=[],o=r||0,s=0;o<t.length;o+=1,s+=1)n[s]=t[o];return n},"slicy"),Il=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Qa.exports=i(function(t){var r=this;if(typeof r!="function"||xl.apply(r)!==Pl)throw new TypeError(vl+r);for(var n=bl(arguments,1),o,s=i(function(){if(this instanceof o){var _=r.apply(this,Ya(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ya(n,arguments))},"binder"),c=_l(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(o=Function("binder","return function ("+Il(l,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var h=i(function(){},"Empty");h.prototype=r.prototype,o.prototype=new h,h.prototype=null}return o},"bind")});var He=T((hz,ts)=>{"use strict";var Tl=es();ts.exports=Function.prototype.bind||Tl});var Qt=T((vz,rs)=>{"use strict";rs.exports=Function.prototype.call});var Qr=T((xz,ns)=>{"use strict";ns.exports=Function.prototype.apply});var is=T((_z,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ss=T((Pz,as)=>{"use strict";var El=He(),$l=Qr(),Sl=Qt(),Al=is();as.exports=Al||El.call(Sl,$l)});var cs=T((bz,us)=>{"use strict";var zl=He(),Ol=Jt(),kl=Qt(),wl=ss();us.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Ol("a function is required");return wl(zl,kl,t)},"callBindBasic")});var gs=T((Tz,fs)=>{"use strict";var Rl=cs(),ps=Kr(),ds;try{ds=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var en=!!ds&&ps&&ps(Object.prototype,"__proto__"),ms=Object,ls=ms.getPrototypeOf;fs.exports=en&&typeof en.get=="function"?Rl([en.get]):typeof ls=="function"?i(function(t){return ls(t==null?t:ms(t))},"getDunder"):!1});var _s=T(($z,xs)=>{"use strict";var ys=Xr(),hs=Yr(),vs=gs();xs.exports=ys?i(function(t){return ys(t)},"getProto"):hs?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return hs(t)},"getProto"):vs?i(function(t){return vs(t)},"getProto"):null});var tn=T((Az,Ps)=>{"use strict";var Nl=Function.prototype.call,Dl=Object.prototype.hasOwnProperty,Cl=He();Ps.exports=Cl.call(Nl,Dl)});var As=T((zz,Ss)=>{"use strict";var M,Ul=qr(),Ml=ma(),Ll=ga(),jl=ha(),Fl=xa(),Ke=Pa(),qe=Jt(),Bl=Ta(),Zl=$a(),Vl=Aa(),Hl=Oa(),Gl=wa(),Wl=Na(),ql=Ca(),Kl=ja(),Es=Function,rn=i(function(e){try{return Es('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Kr(),Jl=Ha(),nn=i(function(){throw new qe},"throwTypeError"),Xl=vt?(function(){try{return arguments.callee,nn}catch{try{return vt(arguments,"callee").get}catch{return nn}}})():nn,Ge=Ka()(),Q=_s(),Yl=Yr(),Ql=Xr(),$s=Qr(),xt=Qt(),We={},ed=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ml,"%eval%":eval,"%EvalError%":Ll,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":Es,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ul,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":jl,"%ReferenceError%":Fl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Ge?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":Xl,"%TypedArray%":ed,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Bl,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":$s,"%Object.defineProperty%":Jl,"%Object.getPrototypeOf%":Yl,"%Math.abs%":Zl,"%Math.floor%":Vl,"%Math.max%":Hl,"%Math.min%":Gl,"%Math.pow%":Wl,"%Math.round%":ql,"%Math.sign%":Kl,"%Reflect.getPrototypeOf%":Ql};if(Q)try{null.error}catch(e){bs=Q(Q(e)),De["%Error.prototype%"]=bs}var bs,td=i(function e(t){var r;if(t==="%AsyncFunction%")r=rn("async function () {}");else if(t==="%GeneratorFunction%")r=rn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&Q&&(r=Q(o.prototype))}return De[t]=r,r},"doEval"),Is={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_t=He(),er=tn(),rd=_t.call(xt,Array.prototype.concat),nd=_t.call($s,Array.prototype.splice),Ts=_t.call(xt,String.prototype.replace),tr=_t.call(xt,String.prototype.slice),od=_t.call(xt,RegExp.prototype.exec),id=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ad=/\\(\\)?/g,sd=i(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var o=[];return Ts(t,id,function(s,c,l,f){o[o.length]=l?Ts(f,ad,"$1"):c||s}),o},"stringToPath"),ud=i(function(t,r){var n=t,o;if(er(Is,n)&&(o=Is[n],n="%"+o[0]+"%"),er(De,n)){var s=De[n];if(s===We&&(s=td(n)),typeof s>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ss.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(od(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=sd(t),o=n.length>0?n[0]:"",s=ud("%"+o+"%",r),c=s.name,l=s.value,f=!1,h=s.alias;h&&(o=h[0],nd(n,rd([0,1],h)));for(var _=1,$=!0;_<n.length;_+=1){var x=n[_],u=tr(x,0,1),d=tr(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),o+="."+x,c="%"+o+"%",er(De,c))l=De[c];else if(l!=null){if(!(x in l)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&_+1>=n.length){var g=vt(l,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[x]}else $=er(l,x),l=l[x];$&&!f&&(De[c]=l)}}return l},"GetIntrinsic")});var Os=T((kz,zs)=>{"use strict";var cd=Jr();zs.exports=i(function(){return cd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Rs=T((Rz,ws)=>{"use strict";var pd=As(),ks=pd("%Object.defineProperty%",!0),ld=Os()(),dd=tn(),md=Jt(),rr=ld?Symbol.toStringTag:null;ws.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new md("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!dd(t,rr))&&(ks?ks(t,rr,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ds=T((Dz,Ns)=>{"use strict";var fd=Function.prototype.call,gd=Object.prototype.hasOwnProperty,yd=He();Ns.exports=yd.call(fd,gd)});var Us=T((Cz,Cs)=>{"use strict";Cs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var js=T((Uz,Ls)=>{"use strict";var un=Bi(),hd=require("util"),on=require("path"),vd=require("http"),xd=require("https"),_d=require("url").parse,Pd=require("fs"),bd=require("stream").Stream,Id=require("crypto"),an=Wi(),Td=pa(),Ed=Rs(),Oe=Ds(),sn=Us();function Ms(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(Ms,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],un.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(j,"FormData");hd.inherits(j,un);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=un.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(o),n(t),n(s),this._trackLength(o,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof bd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Pd.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Ms(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&sn(c,r.header);var l;for(var f in c)if(Oe(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(s+=f+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+s+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=on.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=on.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=on.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ms(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=an.lookup(e.name)),!r&&e&&e.path&&(r=an.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=an.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Id.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Td.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=_d(e),n=sn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=sn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=xd.request(n):r=vd.request(n),this.getLength(function(s,c){if(s&&s!=="Unknown stream"){this._error(s);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=i(function(h,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,h,_)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Ed(j.prototype,"FormData");Ls.exports=j});var Dd={};dn(Dd,{reddit:()=>Nd});module.exports=ou(Dd);var iu=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let h=c.prototype,_=Object.keys(h);for(let $=0;$<_.length;$++){let x=_[$];x in l||(l[x]=h[x].bind(l))}}i(n,"init");let o=r?.Parent??Object;class s extends o{static{i(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(l){var f;let h=r?.Parent?new s:this;n(h,l),(f=h._zod).deferred??(f.deferred=[]);for(let _ of h._zod.deferred)_();return h}return i(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}i(b,"$constructor");var le=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ge(e){return e&&Object.assign(or,e),or}i(ge,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(ar,"getEnumValues");function gn(e,t){return typeof t=="bigint"?t.toString():t}i(gn,"jsonStringifyReplacer");function Tt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Tt,"cached");function yn(e){return e==null}i(yn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Et,"cleanRegex");var fn=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==fn)return n===void 0&&(n=fn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(K,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(Ye,"isObject");var au=Tt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function hn(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)}i(hn,"isPlainObject");var vn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(Ue,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i($t,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(Z,"normalizeParams");function xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(xn,"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}i(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}i(It,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Ie,"finalizeIssue");function Pn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Pn,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(ur,"issue");var bn=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),In=b("$ZodError",bn),Qe=b("$ZodError",bn,{Parent:Error});var uu=i(e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new le;if(c.issues.length){let l=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,ge())));throw sr(l,o?.callee),l}return c.value},"_parse"),St=uu(Qe),cu=i(e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(o?.Err??e)(c.issues.map(f=>Ie(f,s,ge())));throw sr(l,o?.callee),l}return c.value},"_parseAsync"),At=cu(Qe),pu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new le;return s.issues.length?{success:!1,error:new(e??In)(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParse"),et=pu(Qe),lu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>Ie(c,o,ge())))}:{success:!0,data:s.value}},"_safeParseAsync"),tt=lu(Qe);var du="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mu=new RegExp(`^${du}$`);var Tn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),En=/^-?\d+n?$/,$n=/^-?\d+$/,cr=/^-?\d+(?:\.\d+)?$/,Sn=/^(?:true|false)$/i;var Te=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),fu={number:"number",bigint:"bigint",object:"date"};var An=b("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=fu[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var zn=b("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=_n[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=$n)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<o&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>s&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var On=b("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!yn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let c=Pn(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var pr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),kn=b("$ZodCheckRegex",(e,t)=>{pr.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 Rn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=i((c,l,f)=>{let h=Me(c),_;for(let $ of l){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,u=$._zod.check(c);if(u instanceof Promise&&f?.async===!1)throw new le;if(_||u instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(h||(h=Me(c,x)))});else{if(c.issues.length===x)continue;h||(h=Me(c,x))}}return _?_.then(()=>c):c},"runChecks"),s=i((c,l,f)=>{if(Me(c))return c.aborted=!0,c;let h=o(l,n,f);if(h instanceof Promise){if(f.async===!1)throw new le;return h.then(_=>e._zod.parse(_,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(_=>s(_,c,l)):s(h,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new le;return f.then(h=>o(h,n,l))}return o(f,n,l)}}K(e,"~standard",()=>({validate:i(o=>{try{let s=et(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return tt(e,o).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(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}}),lr=b("$ZodStringFormat",(e,t)=>{pr.init(e,t),kt.init(e,t)});var Mn=b("$ZodURL",(e,t)=>{lr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var dr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),Ln=b("$ZodNumberFormat",(e,t)=>{zn.init(e,t),dr.init(e,t)}),mr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Sn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),jn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=En,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 Fn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Bn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Zn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),Vn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,s=o instanceof Date;return s&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Nn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}i(Nn,"handleArrayResult");var Hn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let c=0;c<o.length;c++){let l=o[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?s.push(f.then(h=>Nn(h,r,c))):Nn(f,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Ot(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(Ot,"handlePropertyResult");function gu(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=xn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(gu,"normalizeDef");function yu(e,t,r,n,o,s){let c=[],l=o.keySet,f=o.catchall._zod,h=f.def.type,_=f.optout==="optional";for(let $ in t){if(l.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Ot(u,r,$,t,_))):Ot(x,r,$,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}i(yu,"handleCatchall");var Gn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Tt(()=>gu(t));K(e._zod,"propValues",()=>{let l=t.shape,f={};for(let h in l){let _=l[h]._zod;if(_.values){f[h]??(f[h]=new Set);for(let $ of _.values)f[h].add($)}}return f});let o=Ye,s=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let h=l.value;if(!o(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let _=[],$=c.shape;for(let x of c.keys){let u=$[x],d=u._zod.optout==="optional",g=u._zod.run({value:h[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>Ot(m,l,x,h,d))):Ot(g,l,x,h,d)}return s?yu(_,h,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function Dn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!Me(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>Ie(c,n,ge())))}),t)}i(Dn,"handleUnionResults");var fr=b("$ZodUnion",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),K(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Et(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let c=!1,l=[];for(let f of t.options){let h=f._zod.run({value:o.value,issues:[]},s);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(f=>Dn(f,o,e,s)):Dn(l,o,e,s)}});var Wn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fr.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let o={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[l,f]of Object.entries(c)){o[l]||(o[l]=new Set);for(let h of f)o[l].add(h)}}return o});let n=Tt(()=>{let o=t.options,s=new Map;for(let c of o){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(s.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);s.set(f,c)}}return s});e._zod.parse=(o,s)=>{let c=o.value;if(!Ye(c))return o.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),o;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),o)}});var qn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!hn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:o[h],issues:[]},n);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(...be(h,$.issues)),r.value[h]=$.value})):(_.issues.length&&r.issues.push(...be(h,_.issues)),r.value[h]=_.value)}let f;for(let h in o)l.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&cr.test(l)&&f.issues.length){let $=t.keyType._zod.run({value:Number(l),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>Ie($,n,ge())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:o[l],issues:[]},n);_ instanceof Promise?s.push(_.then($=>{$.issues.length&&r.issues.push(...be(l,$.issues)),r.value[f.value]=$.value})):(_.issues.length&&r.issues.push(...be(l,_.issues)),r.value[f.value]=_.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Kn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>vn.has(typeof o)).map(o=>typeof o=="string"?Ue(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{let c=o.value;return n.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),Jn=b("$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,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var Xn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new le;return r.value=o,r}});function Cn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(Cn,"handleOptionalResult");var Yn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Cn(s,r.value)):Cn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Qn=b("$ZodNullable",(e,t)=>{H.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),K(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 eo=b("$ZodPipe",(e,t)=>{H.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>zt(c,t.in,n)):zt(s,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>zt(s,t.out,n)):zt(o,t.out,n)}});function zt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(zt,"handlePipeResult");var to=b("$ZodCustom",(e,t)=>{Te.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>Un(s,r,n,e));Un(o,r,n,e)}});function Un(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ur(o))}}i(Un,"handleRefineResult");var no;var gr=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function oo(){return new gr}i(oo,"registry");(no=globalThis).__zod_globalRegistry??(no.__zod_globalRegistry=oo());var yr=globalThis.__zod_globalRegistry;function io(e,t){return new e({type:"string",...Z(t)})}i(io,"_string");function ao(e,t){return new e({type:"string",coerce:!0,...Z(t)})}i(ao,"_coercedString");function so(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}i(so,"_url");function uo(e,t){return new e({type:"number",checks:[],...Z(t)})}i(uo,"_number");function co(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}i(co,"_coercedNumber");function po(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}i(po,"_int");function lo(e,t){return new e({type:"boolean",...Z(t)})}i(lo,"_boolean");function mo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}i(mo,"_coercedBoolean");function fo(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}i(fo,"_coercedBigint");function go(e){return new e({type:"any"})}i(go,"_any");function yo(e){return new e({type:"unknown"})}i(yo,"_unknown");function ho(e,t){return new e({type:"void",...Z(t)})}i(ho,"_void");function vo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}i(vo,"_coercedDate");function wt(e,t){return new An({check:"greater_than",...Z(t),value:e,inclusive:!0})}i(wt,"_gte");function ue(e,t){return new On({check:"min_length",...Z(t),minimum:e})}i(ue,"_minLength");function Ee(e,t){return new kn({check:"string_format",format:"regex",...Z(t),pattern:e})}i(Ee,"_regex");function xo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(xo,"_custom");var J=b("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)=>St(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>At(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)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Nt=b("ZodMiniString",(e,t)=>{kt.init(e,t),J.init(e,t)});function a(e){return io(Nt,e)}i(a,"string");var _o=b("ZodMiniStringFormat",(e,t)=>{lr.init(e,t),Nt.init(e,t)});var zu=b("ZodMiniURL",(e,t)=>{Mn.init(e,t),_o.init(e,t)});function Po(e){return so(zu,e)}i(Po,"url");var Dt=b("ZodMiniNumber",(e,t)=>{dr.init(e,t),J.init(e,t)});function ee(e){return uo(Dt,e)}i(ee,"number");var Ou=b("ZodMiniNumberFormat",(e,t)=>{Ln.init(e,t),Dt.init(e,t)});function bo(e){return po(Ou,e)}i(bo,"int");var hr=b("ZodMiniBoolean",(e,t)=>{mr.init(e,t),J.init(e,t)});function B(e){return lo(hr,e)}i(B,"boolean");var Io=b("ZodMiniBigInt",(e,t)=>{jn.init(e,t),J.init(e,t)});var ku=b("ZodMiniAny",(e,t)=>{Fn.init(e,t),J.init(e,t)});function nt(){return go(ku)}i(nt,"any");var wu=b("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),J.init(e,t)});function k(){return yo(wu)}i(k,"unknown");var Ru=b("ZodMiniVoid",(e,t)=>{Zn.init(e,t),J.init(e,t)});function To(e){return ho(Ru,e)}i(To,"_void");var Eo=b("ZodMiniDate",(e,t)=>{Vn.init(e,t),J.init(e,t)});var Nu=b("ZodMiniArray",(e,t)=>{Hn.init(e,t),J.init(e,t)});function N(e,t){return new Nu({type:"array",element:e,...Z(t)})}i(N,"array");var Du=b("ZodMiniObject",(e,t)=>{Gn.init(e,t),J.init(e,t),K(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Du(r)}i(p,"object");var Cu=b("ZodMiniUnion",(e,t)=>{fr.init(e,t),J.init(e,t)});function D(e,t){return new Cu({type:"union",options:e,...Z(t)})}i(D,"union");var Uu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),J.init(e,t)});function $e(e,t,r){return new Uu({type:"union",options:t,discriminator:e,...Z(r)})}i($e,"discriminatedUnion");var Mu=b("ZodMiniRecord",(e,t)=>{qn.init(e,t),J.init(e,t)});function w(e,t,r){return new Mu({type:"record",keyType:e,valueType:t,...Z(r)})}i(w,"record");var Lu=b("ZodMiniEnum",(e,t)=>{Kn.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Lu({type:"enum",entries:r,...Z(t)})}i(U,"_enum");var ju=b("ZodMiniLiteral",(e,t)=>{Jn.init(e,t),J.init(e,t)});function E(e,t){return new ju({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}i(E,"literal");var Fu=b("ZodMiniTransform",(e,t)=>{Xn.init(e,t),J.init(e,t)});function Se(e){return new Fu({type:"transform",transform:e})}i(Se,"transform");var Bu=b("ZodMiniOptional",(e,t)=>{Yn.init(e,t),J.init(e,t)});function y(e){return new Bu({type:"optional",innerType:e})}i(y,"optional");var Zu=b("ZodMiniNullable",(e,t)=>{Qn.init(e,t),J.init(e,t)});function ot(e){return new Zu({type:"nullable",innerType:e})}i(ot,"nullable");var Vu=b("ZodMiniPipe",(e,t)=>{eo.init(e,t),J.init(e,t)});function Ae(e,t){return new Vu({type:"pipe",in:e,out:t})}i(Ae,"pipe");var Hu=b("ZodMiniCustom",(e,t)=>{to.init(e,t),J.init(e,t)});function Ct(e,t){return xo(Hu,e??(()=>!0),t)}i(Ct,"custom");var it={};dn(it,{bigint:()=>Xu,boolean:()=>Ju,date:()=>Yu,number:()=>Ku,string:()=>qu});function qu(e){return ao(Nt,e)}i(qu,"string");function Ku(e){return co(Dt,e)}i(Ku,"number");function Ju(e){return mo(hr,e)}i(Ju,"boolean");function Xu(e){return fo(Io,e)}i(Xu,"bigint");function Yu(e){return vo(Eo,e)}i(Yu,"date");var xr=p({retryOnFailure:p({defaultValue:y(B()),hide:y(B())}),continueOnFailure:p({defaultValue:y(B()),hide:y(B())})}),vr=class{constructor(t,r,n,o,s,c,l,f,h,_,$){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=s;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=_;this.aiMetadata=$}static{i(this,"IAction")}},X=i(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:y(a())}),C=i((e,t)=>p({type:E(t),required:B(),defaultValue:y(nt())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),ye=p({...F.shape,...C(a(),"LONG_TEXT").shape});var So=p({label:a(),value:k()}),Ut=p({disabled:y(B()),placeholder:y(a()),options:N(So)});var oe=p({...F.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),he=p({...F.shape,options:Ut,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=p({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),at=p({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=p({...F.shape,...C(B(),"CHECKBOX").shape});var xe=p({...F.shape,...C(ee(),"NUMBER").shape});var st=p({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var ut=p({...F.shape,...C(a(),"DATE_TIME").shape});var Ao=w(a(),D([ne,ye,oe,at,he,ve,xe,st,ut])),ct=p({...F.shape,properties:Ao,...C(N(k()),"ARRAY").shape});var pt=p({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var zo=D([ne,oe,pt,ct,he]),ec=w(a(),zo),Pr=p({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Mt=p({...F.shape,...C(To(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),je=(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))(je||{});var Fe=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Fe||{}),br="both_client_credentials_and_authorization_code";var ke=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(ke||{}),dt=(s=>(s.NONE="NONE",s.HEADER_PRESENT="HEADER_PRESENT",s.QUERY_PRESENT="QUERY_PRESENT",s.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",s.HEAD_REQUEST="HEAD_REQUEST",s))(dt||{}),tc=p({strategy:U(dt),paramName:y(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Oo=p({status:y(ee()),body:y(k()),headers:y(w(a(),a()))}),ko=p({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Lt))}),wo=p({type:E("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Oo,handlerId:y(a()),streamStepProgress:y(U(Lt))}),rc=D([ko,wo]);var nc=p({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ce(e){return e==null}i(ce,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(ft,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(jt,"assertNotNullOrUndefined");var Ir=Ce(require("crypto"),1);var oc=128,we,Be,ic=i(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*oc),Ir.default.randomFillSync(we),Be=0):Be+e>we.length&&(Ir.default.randomFillSync(we),Be=0),Be+=e},"fillPool"),ac=i(e=>(ic(e|=0),we.subarray(Be-e,Be)),"random"),sc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let l=r(o),f=o;for(;f--;)if(c+=e[l[f]&n]||"",c.length===s)return c}}},"customRandom"),No=i((e,t=21)=>sc(e,t,ac),"customAlphabet");var uc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Do=21,yb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Do}}$`))),cc=No(uc,Do);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:ze,updated:ze},V=i(e=>y(ot(e)),"Nullable");function Tr(e){return y(ot(U(e)))}i(Tr,"NullableEnum");var xb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Ft=i(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var bb=w(a(),k());var gt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(gt||{});var Nb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var Cb=p({filename:a(),data:k(),type:E("file"),mimetype:y(a())});var pc=Ce(Uo());var Zb=p({...ie,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:y(ee())});var Mo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Mo||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var lc=p({mode:U(Mo),value:k()}),dc=p({auth:y(a()),fields:w(a(),lc)}),mc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(dc)}),fc=p({type:E("PIECE"),toolName:a().check(ue(1)),pieceMetadata:mc}),gc=p({type:E("none")}),yc=p({type:E("access_token"),accessToken:a()}),hc=p({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),vc=p({type:E("headers"),headers:w(a(),a())}),xc=$e("type",[gc,yc,hc,vc]),Lo=p({type:E("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:y(a())}),jo=p({type:E("MCP"),toolName:a().check(ue(1)),serverUrl:Po(),protocol:U($r),auth:xc}),Fo=p({type:E("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),_c=$e("type",[fc,Lo,jo,Fo]),Pc=p({displayName:a(),description:y(a()),type:U(Sr)}),Bo=p({type:E("MARKDOWN"),markdown:a()}),Ze={type:E("TOOL_CALL"),input:V(w(a(),k())),output:y(k()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},_I=p(Ze),Zo=$e("toolCallType",[p({...Ze,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ze,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ze,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),p({...Ze,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ze,toolCallType:E("UNKNOWN"),displayName:a()})]),bc=D([Bo,Zo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),_e=p({apiKey:a()}),Ic=_e,Tc=p({apiKey:a(),apiKeyHash:a()}),Ec=_e,$c=_e,Sc=_e,Ac=_e,zc=_e,Oc=_e,kc=_e,qo=p({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),wc=p({}),Rc=p({}),Nc=p({}),Dc=p({}),Cc=p({}),Uc=p({}),Ko=p({modelId:a(),modelName:a(),modelType:U(zr)}),Jo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Ko),defaultHeaders:y(w(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:N(Ko),vertexProject:y(a()),vertexRegion:y(a())}),Yo=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),Qo=p({region:a().check(ue(1))}),Mc=D([Ic,Sc,Ac,zc,Oc,$c,Ec,Tc,qo,kc]),ei=D([Jo,Xo,Yo,Qo,wc,Nc,Dc,Cc,Rc,Uc]),Lc=p({id:a(),name:a(),type:U(zr)}),jc=p({id:a(),name:a(),provider:U(gt),config:ei,enabledForChat:B()}),Fc=p({provider:U(gt),config:ei,auth:Mc,platformId:a()});var TI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Vo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Bc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Zc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ho=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Vc=["grok-4.20","grok-4.1-fast"],Hc={openai:Vo,anthropic:Bc,google:Ho,activepieces:[...Zc.map(e=>`anthropic/${e}`),...Vo.map(e=>`openai/${e}`),...Ho.map(e=>`google/${e}`),...Vc.map(e=>`x-ai/${e}`)]};var Go=128e3,Gc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Wc({provider:e}){return e?Gc[e]??Go:Go}i(Wc,"getMaxContextTokens");var Wo={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"},qc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Kc=new Set(["anthropic","mistral"]);function de(e){return{chatModels:Hc[e],maxContextTokens:Wc({provider:e}),defaultEmbeddingModel:Wo[e],supportsEmbedding:Wo[e]!==void 0,supportsImageGeneration:!Kc.has(e),webSearch:qc[e]}}i(de,"buildProviderCapabilities");var Jc={openai:de("openai"),anthropic:de("anthropic"),openrouter:de("openrouter"),azure:de("azure"),google:de("google"),"cloudflare-gateway":de("cloudflare-gateway"),custom:de("custom"),bedrock:de("bedrock"),mistral:de("mistral"),activepieces:de("activepieces")};var Xc=p({base64Url:a(),fileName:a(),extension:y(a())}),Yc=p({mimeType:a(),url:a(),fileName:y(a())}),Or=D([Xc,Yc]);var Qc=D([p({type:E("file"),value:Or}),p({type:E("markdown"),value:a(),files:y(N(Or))})]),ep=p({sessionId:a(),message:a(),files:y(N(a()))});var ri=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ri||{}),ni=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ni||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var tp=D([p({...ie,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),rp=p({...ie,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Tr(ni),trigger:Tr(ri)}),np=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),op=p({events:N(U(kr)),webhookUrl:a(),flowId:a()}),ip=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),ap=p({projectId:a(),limit:y(it.number()),cursor:y(a()),name:y(a()),externalIds:Ft(a()),folderId:y(a()),folderIds:Ft(a())}),sp=p({records:N(N(p({fieldId:a(),value:ii()}))),tableId:a()}),up=p({cells:y(N(p({fieldId:a(),value:ii()}))),tableId:a(),agentUpdate:y(B())}),oi=$e("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),ti("exists"),ti("not_exists")]),cp=p({tableId:a(),limit:y(it.number()),cursor:y(a()),filters:Ft(oi)});function ii(){return Ae(Se(e=>e==null?e:String(e)),ot(a()))}i(ii,"coerceToString");function Re(e){return p({fieldId:a(),operator:E(e),value:a()})}i(Re,"valueFilter");function ti(e){return p({fieldId:a(),operator:E(e)})}i(ti,"existenceFilter");var pp=p({status:y(ee()),body:y(k()),headers:y(w(a(),a()))}),lp=p({...ie,deleted:V(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var ai=p({name:a(),description:y(a()),type:a(),required:B()}),dp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(ai),returnsResponse:B()})});var si="^[0-9]+\\.[0-9]+\\.[0-9]+$",ZI=new RegExp(si),fp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",VI=a().check(Ee(new RegExp(si))),HI=a().check(Ee(new RegExp(fp))),gp=p({packageType:E("ARCHIVE"),pieceType:U(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ui=p({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ci=p({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),GI=D([ui,ci]),WI=D([gp,ui,ci]);var yp=$e("type",[p({type:E("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:E("INTERVAL"),intervalMs:bo().check(wt(6e4))})]),qI=p({...ie,type:U(ke),projectId:a(),flowId:a(),triggerName:a(),schedule:V(yp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),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||{}),li=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(li||{}),di=(r=>(r.S3="S3",r.DB="DB",r))(di||{}),KI=p({...ie,projectId:V(a()),platformId:V(a()),type:U(pi),compression:U(li),data:y(k()),location:U(di),size:V(ee()),fileName:V(a()),s3Key:V(a()),metadata:V(w(a(),a()))}),mi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(mi||{}),fi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(fi||{}),JI=p({id:a(),email:a(),firstName:a(),status:U(fi),externalId:V(a()),platformId:V(a()),platformRole:U(mi),lastName:a(),created:ze,updated:ze,lastActiveDate:V(ze),imageUrl:V(a())});var wr=p({...F.shape,...C(w(a(),k()),"OBJECT").shape});var vi=p({...F.shape,...C(a(),"COLOR").shape});var Rr=D([ne,ye,Mt,ve,oe,he,_r,at,Pr,xe,ct,wr,pt,ut,st,vi]),S={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 me=p({displayName:a(),description:y(a())});var xi=p({username:a(),password:a()}),Nr=p({...me.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...C(xi,"BASIC_AUTH").shape});var _p=w(a(),D([ne,ye,xe,ve,oe])),Dr=p({...me.shape,props:_p,...C(k(),"CUSTOM_AUTH").shape});var Ne=p({...me.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Pp=w(a(),D([ne,ye,Ne,xe,ve,oe,he,Mt])),_i=p({...me.shape,props:Pp,...C(k(),"OIDC").shape});var Zt=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Zt||{}),Pi=D([ne,Ne,oe]),bi=w(a(),Pi),bp=p({props:y(w(a(),Pi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([E("none"),E("consent"),E("login"),E("omit")])),pkce:y(B()),pkceMethod:y(D([E("plain"),E("S256")])),authorizationMethod:y(U(Zt)),grantType:y(D([U(Fe),E(br)])),extra:y(w(a(),a()))}),Ii=p({access_token:a(),props:y(bi),data:w(a(),nt())}),Cr=p({...me.shape,...bp.shape,...C(Ii,"OAUTH2").shape});var Ve=D([Nr,Dr,_i,Cr,Ne]),yt="Connection",Ur={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var AE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Ip=p({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Tp=D([Rr,Ve]),Mr=w(a(),Tp),qE=w(a(),Rr);var Ti=D([p({strategy:E("CRON"),cronExpression:a()}),p({strategy:E("NONE")})]);var Ei="2",Vt="0.82.0";var Lr=class{constructor(t,r,n,o,s,c,l,f,h=Vt,_,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Ei}),"getContextInfo");(!Ep(h)||$p(h,Vt))&&(this.minimumSupportedRelease=Vt),s.forEach(u=>this._actions[u.name]=u),c.forEach(u=>this._triggers[u.name]=u)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},$i=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(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 Ep(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Ep,"isValidSimpleSemver");function $p(e,t){let[r,n,o]=e.split(".").map(Number),[s,c,l]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:o<l}i($p,"isSemverLessThan");var Sp=y(w(a(),w(a(),a()))),Si=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([Ve,N(Ve)])),version:a(),categories:y(N(U(je))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:Sp}),Ap=U(["human","ai","both"]),Ai=p({description:y(a()),idempotent:y(B())}),zi=p({name:a(),displayName:a(),description:a(),props:Mr,requireAuth:B(),errorHandlingOptions:y(xr),outputSchema:y(Ct()),audience:y(Ap),aiMetadata:y(Ai)}),Oi=p({name:a(),displayName:a(),description:a(),props:Mr,errorHandlingOptions:y(xr),type:U(ke),sampleData:k(),handshakeConfiguration:y(Ct()),renewConfiguration:y(Ti),testStrategy:U(mt),outputSchema:y(Ct()),aiMetadata:y(Ai)}),zp=p({...Si.shape,actions:w(a(),zi),triggers:w(a(),Oi)}),Op=p({...Si.shape,actions:ee(),triggers:ee(),suggestedActions:y(N(zi)),suggestedTriggers:y(N(Oi))}),ki=p({projectUsage:ee(),pieceType:U(Le),packageType:U(lt),platformId:y(a()),archiveId:y(a())}),q$=p({...zp.shape,...ki.shape}),K$=p({...Op.shape,...ki.shape}),J$=p({name:a(),version:a()});var kp=Ce(require("path")),wp=Ce(require("fs/promises"));var Di=require("node:stream");var Ht=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((s,c)=>{o.append(c,s)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new jr,r=new Fr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},jr=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Fr=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var ht=class extends Error{constructor(r,n){let o=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:s},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=s}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function wi({error:e,requestBody:t}){return e instanceof ht?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}i(wi,"toFailsafeOutput");var ae=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ae||{});var Wt=class extends Ht{static{i(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))o.append(L,re);let l=o.toString(),f=l?`${n}?${l}`:n,h=t.responseType??"json",_=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:u,isStream:d}=Rp(t.method)?Np(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},g=Cp({...s,...u}),m=await Dp(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:L.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{re!==void 0&&clearTimeout(re)}},$),v=_?300:400;if(m.status<200||m.status>=v){let L=await Ri(m,h),re=new ht(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Ri(m,h);return{status:m.status,headers:Up(m.headers),body:P}}};function Rp(e){return e!=="GET"&&e!=="HEAD"}i(Rp,"acceptsRequestBody");function Np(e,t){if(Lp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Mp(e)){let n=new Di.PassThrough;return e.on("error",o=>n.destroy(o)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Np,"serializeBody");async function Ri(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Ri,"parseResponseBody");async function Dp(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Ni(n);continue}return o}catch(o){if(r=o,n<t){await Ni(n);continue}throw o}throw r}i(Dp,"sendWithRetries");function Ni(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Ni,"backoff");function Cp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}i(Cp,"normalizeHeaders");function Up(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(Up,"toHttpHeaders");function Mp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}i(Mp,"isNodeFormData");function Lp(e){return e==null}i(Lp,"isNil");var Y=new Wt;var $d=Ce(require("fs")),Fs=Ce(js());var Sd={"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 Ad(e){let t=e.split(";")[0].trim().toLowerCase();return Sd[t]??""}i(Ad,"contentTypeToExtension");var zd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Od=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Bs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:s,props:c,extraProps:l,authLocation:f="headers"}){return X({audience:"human",name:s||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:h})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Od(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ae).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.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:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:h})=>{if(!h)return{};let _=h,$={};switch(_){case"none":break;case"json":$.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async h=>{let{method:_,url:$,headers:x,queryParams:u,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:L}=h.propsValue;jt(_,"Method"),jt($,"URL");let re=ce(r)?{}:await r(h.auth,h.propsValue),se=$.url,Je=se.startsWith("http://")||se.startsWith("https://")?se:zd({baseUrl:t(h.auth),relativePath:se}),Pe={method:_,url:Je,headers:{...x??{},...f==="headers"||!ce(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...u??{}},timeout:v?v*1e3:0,followRedirects:L};if(P&&(Pe.responseType="arraybuffer"),d)if(g&&g!=="none"){let fe=d.data;if(g==="form_data"){let Ys=fe,Pt=new Fs.default;for(let{fieldName:cn,fieldType:pn,textFieldValue:ln,fileFieldValue:nr}of Ys)pn==="text"&&!ft(ln)?Pt.append(cn,ln):pn==="file"&&!ft(nr)&&Pt.append(cn,nr.data,{filename:nr?.filename});Pe.body=Pt,Pe.headers={...Pe.headers,...Pt.getHeaders()}}else Pe.body=fe}else g||(Pe.body=d);try{let fe=await Y.sendRequest(Pe);return await kd(h.files,fe.body,fe.status,fe.headers,P)}catch(fe){if(m)return wi({error:fe,requestBody:Pe.body});throw fe}},"run")})}i(Bs,"createCustomApiCallAction");var kd=i(async(e,t,r,n,o)=>{let s;if(o&&wd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Ad(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),s=await e.write({fileName:`output.${l}`,data:f})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),wd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Rd=`
|
|
4
4
|
To obtain your Reddit API credentials:
|
|
5
5
|
|
|
6
6
|
1. Go to https://www.reddit.com/prefs/apps.
|
|
@@ -13,7 +13,7 @@ To obtain your Reddit API credentials:
|
|
|
13
13
|
- redirect uri: as shown in Redirect URL field
|
|
14
14
|
5. Click "create app".
|
|
15
15
|
6. Note down the client ID (under the app name) and client secret.
|
|
16
|
-
`,G=Nr.OAuth2({description:dd,authUrl:"https://www.reddit.com/api/v1/authorize",tokenUrl:"https://www.reddit.com/api/v1/access_token",required:!0,scope:["identity","read","submit","edit","history","flair"],authorizationMethod:"HEADER",extra:{grantType:"authorization_code",responseType:"code"}});var zs=X({auth:G,name:"retrieveRedditPost",displayName:"Retrieve Post",description:"Fetch top posts in a subreddit with optional size limit.",audience:"both",aiMetadata:{description:"Lists posts from a given subreddit, choosing the listing via a category (hot, new, top, rising, or controversial). Use it to read or monitor a subreddit's feed rather than to look up one known post. Requires the subreddit name; an optional size caps how many posts are returned (max 100). Read-only and idempotent.",idempotent:!0},props:{post_category:S.StaticDropdown({displayName:"Post Category",description:"Select the category of posts to retrieve",required:!0,defaultValue:"hot",options:{options:[{label:"Hot",value:"hot"},{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Rising",value:"rising"},{label:"Controversial",value:"controversial"}]}}),subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to fetch posts from",required:!0}),size:S.Number({displayName:"Number of Posts",description:"Number of posts to fetch (max 100)",required:!1,defaultValue:10})},async run(e){let t=`https://oauth.reddit.com/r/${e.propsValue.subreddit}/${e.propsValue.post_category}`,r=e.propsValue.size||10,n=await Y.sendRequest({method:"GET",url:t,queryParams:{limit:r.toString()},headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)throw new Error(`Reddit API error: ${n.status} ${JSON.stringify(n.body)}`);return n.body}});var ks=X({auth:G,name:"getRedditPostDetails",displayName:"Get Post Details",description:"Fetch detailed information about a specific Reddit post using its ID.",audience:"both",aiMetadata:{description:"Looks up one specific Reddit post by its ID and returns its full metadata (title, author, body, score, counts, flags). Use it when you already have a post ID and need details for that single post, not to browse a subreddit. Accepts the ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "t3_abc123" or "abc123")',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=`https://oauth.reddit.com/api/info?id=t3_${t}`,n=await Y.sendRequest({method:"GET",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)return{error:`Failed to retrieve post details: ${n.status}`,details:n.body};let o=n.body?.data?.children??[];if(o.length===0)return{error:"No post found with the given ID"};let s=o[0].data,c={id:s.id,title:s.title,author:s.author,author_fullname:s.author_fullname,subreddit:s.subreddit,subreddit_id:s.subreddit_id,selftext:s.selftext,selftext_html:s.selftext_html,score:s.score,upvote_ratio:s.upvote_ratio,created_utc:s.created_utc,permalink:s.permalink,url:s.url,domain:s.domain,num_comments:s.num_comments,is_self:s.is_self,is_video:s.is_video,is_original_content:s.is_original_content,over_18:s.over_18,spoiler:s.spoiler,locked:s.locked,stickied:s.stickied,post_hint:s.post_hint};return s.media&&(c.media=s.media),s.gallery_data&&(c.gallery_data=s.gallery_data),c}});var Os=X({auth:G,name:"createRedditPost",displayName:"Create Post",description:"Submit a new self (text) post to a subreddit.",audience:"both",aiMetadata:{description:"Submits a new self (text) post to a subreddit on behalf of the authenticated account. Use it to publish original text content; it cannot post links, images, or media. Requires the target subreddit, a title, and the text body. Not idempotent \u2014 each call creates a separate post.",idempotent:!1},props:{subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to post in (without r/).",required:!0}),title:S.ShortText({displayName:"Title",description:"Title of the Reddit post.",required:!0}),content:S.LongText({displayName:"Content",description:"Text content of the post.",required:!0})},async run(e){let{subreddit:t,title:r,content:n}=e.propsValue,o="https://oauth.reddit.com/api/submit",s=new URLSearchParams({api_type:"json",sr:t,title:r,text:n,kind:"self"}),c=await Y.sendRequest({method:"POST",url:o,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:s.toString()});return c.status!==200?{error:`Failed to create post: ${c.status}`,details:c.body}:c.body}});var ws=X({auth:G,name:"createRedditComment",displayName:"Create Comment",description:"Comment on a Reddit post or reply to a comment.",audience:"both",aiMetadata:{description:"Posts a comment from the authenticated account, either as a top-level reply to a post or as a nested reply to another comment, determined by the parent ID type (t3_ for a post, t1_ for a comment). Requires the parent ID and the comment text. Not idempotent \u2014 each call creates a separate comment.",idempotent:!1},props:{parent_id:S.ShortText({displayName:"Parent ID",description:"ID of the post (t3_*) or comment (t1_*) to reply to.",required:!0}),content:S.LongText({displayName:"Comment Text",description:"Text of the comment.",required:!0})},async run(e){let t=e.propsValue.parent_id.trim();!t.startsWith("t1_")&&!t.startsWith("t3_")&&(t=`t3_${t}`);let r="https://oauth.reddit.com/api/comment",n=new URLSearchParams({thing_id:t,text:e.propsValue.content,api_type:"json"}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to create comment: ${o.status}`,details:o.body}:o.body}});var Rs=X({auth:G,name:"fetchPostComments",displayName:"Fetch Post Comments",description:"Fetch comments from a specific Reddit post.",audience:"both",aiMetadata:{description:"Retrieves the threaded comments of one Reddit post identified by its ID, including nested replies. Use it to read discussion on a known post; the sort option (new, top, hot, best, old, controversial) and a limit on top-level comments are configurable. Accepts the post ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "abc123" or "t3_abc123").',required:!0}),sort:S.StaticDropdown({displayName:"Sort By",description:"Sorting method for comments",defaultValue:"new",required:!1,options:{options:[{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Hot",value:"hot"},{label:"Best",value:"best"},{label:"Old",value:"old"},{label:"Controversial",value:"controversial"}]}}),limit:S.Number({displayName:"Limit",description:"Maximum number of top-level comments to fetch",defaultValue:10,required:!1})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=await Y.sendRequest({method:"GET",url:`https://oauth.reddit.com/comments/${t}`,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},queryParams:{sort:e.propsValue.sort??"new",limit:(e.propsValue.limit??10).toString()}});if(r.status!==200)return{error:`Failed to retrieve comments: ${r.status}`,details:r.body};function n(c){return c.filter(d=>d.kind==="t1").map(d=>{let f=d.data;return{id:f.id,author:f.author,body:f.body,score:f.score,created_utc:f.created_utc,permalink:f.permalink,edited:f.edited,is_submitter:f.is_submitter,stickied:f.stickied,replies:f.replies&&typeof f.replies=="object"?n(f.replies.data.children):[]}})}i(n,"processComments");let s=r.body[1]?.data?.children??[];return n(s)}});var Ns=X({auth:G,name:"editRedditPost",displayName:"Edit Post",description:"Edits the content of an existing Reddit post.",audience:"both",aiMetadata:{description:"Replaces the text body of an existing self post owned by the authenticated account, identified by post ID. Use it to update a post you previously created; it only edits text posts, not link or media posts. Requires the post ID (with or without the t3_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the post in the same state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to edit (e.g., "abc123" or "t3_abc123").',required:!0}),content:S.LongText({displayName:"New Post Content",description:"Updated text content for the post.",required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t3_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit post: ${o.status}`,details:o.body}:o.body}});var Ds=X({auth:G,name:"editRedditComment",displayName:"Edit Comment",description:"Edits the content of an existing Reddit comment.",audience:"both",aiMetadata:{description:"Replaces the text of an existing comment owned by the authenticated account, identified by comment ID. Use it to update a comment you previously posted. Requires the comment ID (with or without the t1_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the comment in the same state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to edit (e.g., "def456" or "t1_def456").',required:!0}),content:S.LongText({displayName:"New Comment Content",description:"Updated text content for the comment.",required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t1_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit comment: ${o.status}`,details:o.body}:o.body}});var Cs=X({auth:G,name:"deleteRedditPost",displayName:"Delete Post",description:"Delete a specific Reddit post by ID.",audience:"both",aiMetadata:{description:"Deletes a post owned by the authenticated account, identified by post ID. Use it to permanently remove a post you previously created. Requires the post ID (with or without the t3_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to delete (e.g., "abc123" or "t3_abc123").',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t3_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete post: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Us=X({auth:G,name:"deleteRedditComment",displayName:"Delete Comment",description:"Delete a specific Reddit comment by ID.",audience:"both",aiMetadata:{description:"Deletes a comment owned by the authenticated account, identified by comment ID. Use it to permanently remove a comment you previously posted. Requires the comment ID (with or without the t1_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to delete (e.g., "def456" or "t1_def456").',required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t1_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete comment: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var md=fi({displayName:"Reddit",description:"Interact with Reddit - fetch and submit posts.",logoUrl:"https://cdn.activepieces.com/pieces/reddit.png",minimumSupportedRelease:"0.36.1",categories:["COMMUNICATION"],authors:["bhaviksingla1403"],auth:G,actions:[zs,ks,Os,ws,Rs,Ns,Ds,Cs,Us,As({auth:G,baseUrl:i(()=>"https://oauth.reddit.com","baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`,"User-Agent":"ActivePieces/1.0.0"}),"authMapping")})],triggers:[]});0&&(module.exports={reddit});
|
|
16
|
+
`,q=Ur.OAuth2({description:Rd,authUrl:"https://www.reddit.com/api/v1/authorize",tokenUrl:"https://www.reddit.com/api/v1/access_token",required:!0,scope:["identity","read","submit","edit","history","flair"],authorizationMethod:"HEADER",extra:{grantType:"authorization_code",responseType:"code"}});var Zs=X({auth:q,name:"retrieveRedditPost",displayName:"Retrieve Post",description:"Fetch top posts in a subreddit with optional size limit.",audience:"both",aiMetadata:{description:"Lists posts from a given subreddit, choosing the listing via a category (hot, new, top, rising, or controversial). Use it to read or monitor a subreddit's feed rather than to look up one known post. Requires the subreddit name; an optional size caps how many posts are returned (max 100). Read-only and idempotent.",idempotent:!0},props:{post_category:S.StaticDropdown({displayName:"Post Category",description:"Select the category of posts to retrieve",required:!0,defaultValue:"hot",options:{options:[{label:"Hot",value:"hot"},{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Rising",value:"rising"},{label:"Controversial",value:"controversial"}]}}),subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to fetch posts from",required:!0}),size:S.Number({displayName:"Number of Posts",description:"Number of posts to fetch (max 100)",required:!1,defaultValue:10})},async run(e){let t=`https://oauth.reddit.com/r/${e.propsValue.subreddit}/${e.propsValue.post_category}`,r=e.propsValue.size||10,n=await Y.sendRequest({method:"GET",url:t,queryParams:{limit:r.toString()},headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)throw new Error(`Reddit API error: ${n.status} ${JSON.stringify(n.body)}`);return n.body}});var Vs=X({auth:q,name:"getRedditPostDetails",displayName:"Get Post Details",description:"Fetch detailed information about a specific Reddit post using its ID.",audience:"both",aiMetadata:{description:"Looks up one specific Reddit post by its ID and returns its full metadata (title, author, body, score, counts, flags). Use it when you already have a post ID and need details for that single post, not to browse a subreddit. Accepts the ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "t3_abc123" or "abc123")',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=`https://oauth.reddit.com/api/info?id=t3_${t}`,n=await Y.sendRequest({method:"GET",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},timeout:5e3});if(n.status!==200)return{error:`Failed to retrieve post details: ${n.status}`,details:n.body};let o=n.body?.data?.children??[];if(o.length===0)return{error:"No post found with the given ID"};let s=o[0].data,c={id:s.id,title:s.title,author:s.author,author_fullname:s.author_fullname,subreddit:s.subreddit,subreddit_id:s.subreddit_id,selftext:s.selftext,selftext_html:s.selftext_html,score:s.score,upvote_ratio:s.upvote_ratio,created_utc:s.created_utc,permalink:s.permalink,url:s.url,domain:s.domain,num_comments:s.num_comments,is_self:s.is_self,is_video:s.is_video,is_original_content:s.is_original_content,over_18:s.over_18,spoiler:s.spoiler,locked:s.locked,stickied:s.stickied,post_hint:s.post_hint};return s.media&&(c.media=s.media),s.gallery_data&&(c.gallery_data=s.gallery_data),c}});var Hs=X({auth:q,name:"createRedditPost",displayName:"Create Post",description:"Submit a new self (text) post to a subreddit.",audience:"both",aiMetadata:{description:"Submits a new self (text) post to a subreddit on behalf of the authenticated account. Use it to publish original text content; it cannot post links, images, or media. Requires the target subreddit, a title, and the text body. Not idempotent \u2014 each call creates a separate post.",idempotent:!1},props:{subreddit:S.ShortText({displayName:"Subreddit",description:"The subreddit to post in (without r/).",required:!0}),title:S.ShortText({displayName:"Title",description:"Title of the Reddit post.",required:!0}),content:S.LongText({displayName:"Content",description:"Text content of the post.",required:!0})},async run(e){let{subreddit:t,title:r,content:n}=e.propsValue,o="https://oauth.reddit.com/api/submit",s=new URLSearchParams({api_type:"json",sr:t,title:r,text:n,kind:"self"}),c=await Y.sendRequest({method:"POST",url:o,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:s.toString()});return c.status!==200?{error:`Failed to create post: ${c.status}`,details:c.body}:c.body}});var Gs=X({auth:q,name:"createRedditComment",displayName:"Create Comment",description:"Comment on a Reddit post or reply to a comment.",audience:"both",aiMetadata:{description:"Posts a comment from the authenticated account, either as a top-level reply to a post or as a nested reply to another comment, determined by the parent ID type (t3_ for a post, t1_ for a comment). Requires the parent ID and the comment text. Not idempotent \u2014 each call creates a separate comment.",idempotent:!1},props:{parent_id:S.ShortText({displayName:"Parent ID",description:"ID of the post (t3_*) or comment (t1_*) to reply to.",required:!0}),content:S.LongText({displayName:"Comment Text",description:"Text of the comment.",required:!0})},async run(e){let t=e.propsValue.parent_id.trim();!t.startsWith("t1_")&&!t.startsWith("t3_")&&(t=`t3_${t}`);let r="https://oauth.reddit.com/api/comment",n=new URLSearchParams({thing_id:t,text:e.propsValue.content,api_type:"json"}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to create comment: ${o.status}`,details:o.body}:o.body}});var Ws=X({auth:q,name:"fetchPostComments",displayName:"Fetch Post Comments",description:"Fetch comments from a specific Reddit post.",audience:"both",aiMetadata:{description:"Retrieves the threaded comments of one Reddit post identified by its ID, including nested replies. Use it to read discussion on a known post; the sort option (new, top, hot, best, old, controversial) and a limit on top-level comments are configurable. Accepts the post ID with or without the t3_ prefix. Read-only and idempotent.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'The ID of the Reddit post (e.g. "abc123" or "t3_abc123").',required:!0}),sort:S.StaticDropdown({displayName:"Sort By",description:"Sorting method for comments",defaultValue:"new",required:!1,options:{options:[{label:"New",value:"new"},{label:"Top",value:"top"},{label:"Hot",value:"hot"},{label:"Best",value:"best"},{label:"Old",value:"old"},{label:"Controversial",value:"controversial"}]}}),limit:S.Number({displayName:"Limit",description:"Maximum number of top-level comments to fetch",defaultValue:10,required:!1})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r=await Y.sendRequest({method:"GET",url:`https://oauth.reddit.com/comments/${t}`,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/json"},queryParams:{sort:e.propsValue.sort??"new",limit:(e.propsValue.limit??10).toString()}});if(r.status!==200)return{error:`Failed to retrieve comments: ${r.status}`,details:r.body};function n(c){return c.filter(l=>l.kind==="t1").map(l=>{let f=l.data;return{id:f.id,author:f.author,body:f.body,score:f.score,created_utc:f.created_utc,permalink:f.permalink,edited:f.edited,is_submitter:f.is_submitter,stickied:f.stickied,replies:f.replies&&typeof f.replies=="object"?n(f.replies.data.children):[]}})}i(n,"processComments");let s=r.body[1]?.data?.children??[];return n(s)}});var qs=X({auth:q,name:"editRedditPost",displayName:"Edit Post",description:"Edits the content of an existing Reddit post.",audience:"both",aiMetadata:{description:"Replaces the text body of an existing self post owned by the authenticated account, identified by post ID. Use it to update a post you previously created; it only edits text posts, not link or media posts. Requires the post ID (with or without the t3_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the post in the same state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to edit (e.g., "abc123" or "t3_abc123").',required:!0}),content:S.LongText({displayName:"New Post Content",description:"Updated text content for the post.",required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t3_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit post: ${o.status}`,details:o.body}:o.body}});var Ks=X({auth:q,name:"editRedditComment",displayName:"Edit Comment",description:"Edits the content of an existing Reddit comment.",audience:"both",aiMetadata:{description:"Replaces the text of an existing comment owned by the authenticated account, identified by comment ID. Use it to update a comment you previously posted. Requires the comment ID (with or without the t1_ prefix) and the new content. Idempotent \u2014 repeating with the same content leaves the comment in the same state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to edit (e.g., "def456" or "t1_def456").',required:!0}),content:S.LongText({displayName:"New Comment Content",description:"Updated text content for the comment.",required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/editusertext",n=new URLSearchParams({api_type:"json",thing_id:`t1_${t}`,text:e.propsValue.content}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to edit comment: ${o.status}`,details:o.body}:o.body}});var Js=X({auth:q,name:"deleteRedditPost",displayName:"Delete Post",description:"Delete a specific Reddit post by ID.",audience:"both",aiMetadata:{description:"Deletes a post owned by the authenticated account, identified by post ID. Use it to permanently remove a post you previously created. Requires the post ID (with or without the t3_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{post_id:S.ShortText({displayName:"Post ID",description:'ID of the Reddit post to delete (e.g., "abc123" or "t3_abc123").',required:!0})},async run(e){let t=e.propsValue.post_id.trim();t.startsWith("t3_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t3_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete post: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Xs=X({auth:q,name:"deleteRedditComment",displayName:"Delete Comment",description:"Delete a specific Reddit comment by ID.",audience:"both",aiMetadata:{description:"Deletes a comment owned by the authenticated account, identified by comment ID. Use it to permanently remove a comment you previously posted. Requires the comment ID (with or without the t1_ prefix). Idempotent \u2014 once deleted, repeating the call leaves the same end state.",idempotent:!0},props:{comment_id:S.ShortText({displayName:"Comment ID",description:'ID of the Reddit comment to delete (e.g., "def456" or "t1_def456").',required:!0})},async run(e){let t=e.propsValue.comment_id.trim();t.startsWith("t1_")&&(t=t.slice(3));let r="https://oauth.reddit.com/api/del",n=new URLSearchParams({api_type:"json",id:`t1_${t}`}),o=await Y.sendRequest({method:"POST",url:r,headers:{Authorization:`Bearer ${e.auth.access_token}`,"User-Agent":"ActivePieces Reddit Client","Content-Type":"application/x-www-form-urlencoded"},body:n.toString()});return o.status!==200?{error:`Failed to delete comment: ${o.status}`,details:o.body}:{success:!0,response:o.body}}});var Nd=$i({displayName:"Reddit",description:"Interact with Reddit - fetch and submit posts.",logoUrl:"https://cdn.activepieces.com/pieces/reddit.png",minimumSupportedRelease:"0.36.1",categories:["COMMUNICATION"],authors:["bhaviksingla1403"],auth:q,actions:[Zs,Vs,Hs,Gs,Ws,qs,Ks,Js,Xs,Bs({auth:q,baseUrl:i(()=>"https://oauth.reddit.com","baseUrl"),authMapping:i(async e=>({Authorization:`Bearer ${e.access_token}`,"User-Agent":"ActivePieces/1.0.0"}),"authMapping")})],triggers:[]});0&&(module.exports={reddit});
|
|
17
17
|
/*! Bundled license information:
|
|
18
18
|
|
|
19
19
|
mime-types/index.js:
|