@activepieces/piece-azure-devops 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-azure-devops",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "main": "./src/index.js",
5
5
  "dependencies": {},
6
6
  "files": [
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var su=Object.create;var Je=Object.defineProperty;var uu=Object.getOwnPropertyDescriptor;var cu=Object.getOwnPropertyNames;var pu=Object.getPrototypeOf,lu=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},In=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cu(t))!lu.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=uu(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?su(pu(e)):{},In(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),du=e=>In(Je({},"__esModule",{value:!0}),e);var Fo=S((Lo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(u,d){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let y=0,f=-1,_=(u.match(p.zoneIndex)||[])[0],P,L;for(_&&(_=_.substring(1),u=u.replace(/%.+$/,""));(f=u.indexOf(":",f+1))>=0;)y++;if(u.substr(0,2)==="::"&&y--,u.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return u=u.replace("::",P),u[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),d=function(){let re=u.split(":"),se=[];for(let Ke=0;Ke<re.length;Ke++)se.push(parseInt(re[Ke],16));return se}(),{parts:d,zoneId:_}}o(m,"expandIPv6");function g(u,d,y,f){if(u.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),u[_]>>P!==d[_]>>P)return!1;f-=y,_+=1}return!0}o(g,"matchCIDR");function h(u){if(i.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(n.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}o(h,"parseIntAuto");function b(u,d){for(;u.length<d;)u=`0${u}`;return u}o(b,"padPart");let x={};x.IPv4=function(){function u(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(u,"IPv4"),u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,18,0,0]),15],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]],as112:[[new u([192,175,48,0]),24],[new u([192,31,196,0]),24]],amt:[[new u([192,52,193,0]),24]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,L;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),x.IPv4.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(u){return this.parser(u)!==null},x.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(u){try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(u){return!!(x.IPv4.isValid(u)&&u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(u){let d=u.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(u)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<4;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(u){let d=this.parser(u);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(u){let d;if(d=u.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(u){let d,y,f;if(d=u.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let L=0;L<_.length;L++)y=_[L],P.push(h(y));return P}();if(d=u.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(f>>P&255);return _}().reverse()}else return(d=u.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(f=h(_[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=u.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(f=h(_[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(_[0])),P.push(h(_[1])),P.push(f>>8&255),P.push(f&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.IPv6=function(){function u(d,y){let f,_;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(_=this.parts[f],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(u,"IPv6"),u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],discard:[new u([256,0,0,0,0,0,0,0]),64],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],benchmarking:[new u([8193,2,0,0,0,0,0,0]),48],amt:[new u([8193,3,0,0,0,0,0,0]),32],as112v6:[[new u([8193,4,274,0,0,0,0,0]),48],[new u([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new u([8193,16,0,0,0,0,0,0]),28],orchid2:[new u([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new u([8193,48,0,0,0,0,0,0]),28],reserved:[[new u([8193,0,0,0,0,0,0,0]),23],[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},u.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},_,P;for(let L=7;L>=0;L-=1)if(_=this.parts[L],_ in f){if(P=f[_],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},u.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let _=0;_<f.length;_++)d=f[_],y.push(d>>8),y.push(d&255);return y},u.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(b(this.parts[_].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new x.IPv4([y>>8,y&255,f>>8,f&255])},u.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let _=0;_<this.parts.length;_++)f.push(this.parts[_].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},u.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,_=-1,P;for(;P=d.exec(y);)P[0].length>_&&(f=P.index,_=P[0].length);return _<0?y:`${y.substring(0,f)}::${y.substring(f+_)}`},u.prototype.toString=function(){return this.toRFC5952String()},u}(),x.IPv6.broadcastAddressFromCIDR=function(u){try{let d=this.parseCIDR(u),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(u){return this.parser(u)!==null},x.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{let d=this.parser(u);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{return this.parseCIDR(u),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(u){let d,y,f,_,P;try{for(d=this.parseCIDR(u),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],y=0;y<16;)_.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(_)}catch(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,y,f;if((y=u.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(u){let d,y,f,_,P,L;if(f=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(u))return m(u,8);if((f=u.match(p.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(_=P[y],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(u){if(u=parseInt(u),u<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(u/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,u%8)-1<<8-u%8),new this(d)},x.fromByteArray=function(u){let d=u.length;if(d===4)return new x.IPv4(u);if(d===16)return new x.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(u){return x.IPv6.isValid(u)||x.IPv4.isValid(u)},x.isValidCIDR=function(u){return x.IPv6.isValidCIDR(u)||x.IPv4.isValidCIDR(u)},x.parse=function(u){if(x.IPv6.isValid(u))return x.IPv6.parse(u);if(x.IPv4.isValid(u))return x.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(u){try{return x.IPv6.parseCIDR(u)}catch{try{return x.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(u){let d=this.parse(u);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(u,d,y){let f,_,P,L;y==null&&(y="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],u.kind()===L[0].kind()&&u.match.apply(u,L))return _}return y},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(Lo)});var Ui=S((NA,Ci)=>{var Ni=require("stream").Stream,Fp=require("util");Ci.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=[]}o(ce,"DelayedStream");Fp.inherits(ce,Ni);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(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=Ni.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 Fi=S((UA,Li)=>{var Bp=require("util"),ji=require("stream").Stream,Mi=Ui();Li.exports=G;function G(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(G,"CombinedStream");Bp.inherits(G,ji);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Mi)){var r=Mi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};G.prototype.pipe=function(e,t){return ji.prototype.pipe.call(this,e,t),this.resume(),e};G.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};G.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Vi=S((jA,Bi)=>{"use strict";Bi.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 Hi=S(te=>{"use strict";var Yt=Vi(),Vp=require("path").extname,Zi=/^\s*([^;\s]*)(?:;|\s|$)/,Zp=/^text\//i;te.charset=Wi;te.charsets={lookup:Wi};te.contentType=Wp;te.extension=Hp;te.extensions=Object.create(null);te.lookup=qp;te.types=Object.create(null);Gp(te.extensions,te.types);function Wi(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Zp.test(t[1])?"UTF-8":!1}o(Wi,"charset");function Wp(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}o(Wp,"contentType");function Hp(e){if(!e||typeof e!="string")return!1;var t=Zi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Hp,"extension");function qp(e){if(!e||typeof e!="string")return!1;var t=Vp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(qp,"lookup");function Gp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var s=Yt[i],c=s.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var m=c[p];if(t[m]){var g=r.indexOf(Yt[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=i}}},"forEachMimeType"))}o(Gp,"populateMaps")});var Gi=S((BA,qi)=>{qi.exports=Kp;function Kp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Kp,"defer")});var Gr=S((ZA,Ji)=>{var Ki=Gi();Ji.exports=Jp;function Jp(e){var t=!1;return Ki(function(){t=!0}),o(function(n,i){t?e(n,i):Ki(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Jp,"async")});var Kr=S((HA,Xi)=>{Xi.exports=Xp;function Xp(e){Object.keys(e.jobs).forEach(Yp.bind(e)),e.jobs={}}o(Xp,"abort");function Yp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Yp,"clean")});var Jr=S((GA,Qi)=>{var Yi=Gr(),Qp=Kr();Qi.exports=el;function el(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=tl(t,i,e[i],function(s,c){i in r.jobs&&(delete r.jobs[i],s?Qp(r):r.results[i]=c,n(s,r.results))})}o(el,"iterate");function tl(e,t,r,n){var i;return e.length==2?i=e(r,Yi(n)):i=e(r,t,Yi(n)),i}o(tl,"runJob")});var Xr=S((JA,ea)=>{ea.exports=rl;function rl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])}),n}o(rl,"state")});var Yr=S((YA,ta)=>{var nl=Kr(),ol=Gr();ta.exports=il;function il(e){Object.keys(this.jobs).length&&(this.index=this.size,nl(this),ol(e)(null,this.results))}o(il,"terminator")});var na=S((ez,ra)=>{var al=Jr(),sl=Xr(),ul=Yr();ra.exports=cl;function cl(e,t,r){for(var n=sl(e);n.index<(n.keyedList||e).length;)al(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return ul.bind(n,r)}o(cl,"parallel")});var Qr=S((rz,Qt)=>{var oa=Jr(),pl=Xr(),ll=Yr();Qt.exports=dl;Qt.exports.ascending=ia;Qt.exports.descending=ml;function dl(e,t,r,n){var i=pl(e,r);return oa(e,t,i,o(function s(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){oa(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),ll.bind(i,n)}o(dl,"serialOrdered");function ia(e,t){return e<t?-1:e>t?1:0}o(ia,"ascending");function ml(e,t){return-1*ia(e,t)}o(ml,"descending")});var sa=S((oz,aa)=>{var fl=Qr();aa.exports=gl;function gl(e,t,r){return fl(e,t,null,r)}o(gl,"serial")});var ca=S((az,ua)=>{ua.exports={parallel:na(),serial:sa(),serialOrdered:Qr()}});var en=S((sz,pa)=>{"use strict";pa.exports=Object});var da=S((uz,la)=>{"use strict";la.exports=Error});var fa=S((cz,ma)=>{"use strict";ma.exports=EvalError});var ya=S((pz,ga)=>{"use strict";ga.exports=RangeError});var va=S((lz,ha)=>{"use strict";ha.exports=ReferenceError});var _a=S((dz,xa)=>{"use strict";xa.exports=SyntaxError});var er=S((mz,Pa)=>{"use strict";Pa.exports=TypeError});var Ia=S((fz,ba)=>{"use strict";ba.exports=URIError});var Ea=S((gz,Ta)=>{"use strict";Ta.exports=Math.abs});var $a=S((yz,Sa)=>{"use strict";Sa.exports=Math.floor});var za=S((hz,Aa)=>{"use strict";Aa.exports=Math.max});var wa=S((vz,ka)=>{"use strict";ka.exports=Math.min});var Ra=S((xz,Oa)=>{"use strict";Oa.exports=Math.pow});var Na=S((_z,Da)=>{"use strict";Da.exports=Math.round});var Ua=S((Pz,Ca)=>{"use strict";Ca.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ja=S((Iz,Ma)=>{"use strict";var yl=Ua();Ma.exports=o(function(t){return yl(t)||t===0?t:t<0?-1:1},"sign")});var Fa=S((Ez,La)=>{"use strict";La.exports=Object.getOwnPropertyDescriptor});var tn=S((Sz,Ba)=>{"use strict";var tr=Fa();if(tr)try{tr([],"length")}catch{tr=null}Ba.exports=tr});var Za=S(($z,Va)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Va.exports=rr});var rn=S((Az,Wa)=>{"use strict";Wa.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ga=S((kz,qa)=>{"use strict";var Ha=typeof Symbol<"u"&&Symbol,hl=rn();qa.exports=o(function(){return typeof Ha!="function"||typeof Symbol!="function"||typeof Ha("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:hl()},"hasNativeSymbols")});var nn=S((Oz,Ka)=>{"use strict";Ka.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var on=S((Rz,Ja)=>{"use strict";var vl=en();Ja.exports=vl.getPrototypeOf||null});var Qa=S((Dz,Ya)=>{"use strict";var xl="Function.prototype.bind called on incompatible ",_l=Object.prototype.toString,Pl=Math.max,bl="[object Function]",Xa=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Il=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Tl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ya.exports=o(function(t){var r=this;if(typeof r!="function"||_l.apply(r)!==bl)throw new TypeError(xl+r);for(var n=Il(arguments,1),i,s=o(function(){if(this instanceof i){var h=r.apply(this,Xa(n,arguments));return Object(h)===h?h:this}return r.apply(t,Xa(n,arguments))},"binder"),c=Pl(0,r.length-n.length),p=[],m=0;m<c;m++)p[m]="$"+m;if(i=Function("binder","return function ("+Tl(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ze=S((Cz,es)=>{"use strict";var El=Qa();es.exports=Function.prototype.bind||El});var nr=S((Uz,ts)=>{"use strict";ts.exports=Function.prototype.call});var an=S((Mz,rs)=>{"use strict";rs.exports=Function.prototype.apply});var os=S((jz,ns)=>{"use strict";ns.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var as=S((Lz,is)=>{"use strict";var Sl=Ze(),$l=an(),Al=nr(),zl=os();is.exports=zl||Sl.call(Al,$l)});var us=S((Fz,ss)=>{"use strict";var kl=Ze(),wl=er(),Ol=nr(),Rl=as();ss.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new wl("a function is required");return Rl(kl,Ol,t)},"callBindBasic")});var fs=S((Vz,ms)=>{"use strict";var Dl=us(),cs=tn(),ls;try{ls=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var sn=!!ls&&cs&&cs(Object.prototype,"__proto__"),ds=Object,ps=ds.getPrototypeOf;ms.exports=sn&&typeof sn.get=="function"?Dl([sn.get]):typeof ps=="function"?o(function(t){return ps(t==null?t:ds(t))},"getDunder"):!1});var xs=S((Wz,vs)=>{"use strict";var gs=nn(),ys=on(),hs=fs();vs.exports=gs?o(function(t){return gs(t)},"getProto"):ys?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ys(t)},"getProto"):hs?o(function(t){return hs(t)},"getProto"):null});var un=S((qz,_s)=>{"use strict";var Nl=Function.prototype.call,Cl=Object.prototype.hasOwnProperty,Ul=Ze();_s.exports=Ul.call(Nl,Cl)});var $s=S((Gz,Ss)=>{"use strict";var j,Ml=en(),jl=da(),Ll=fa(),Fl=ya(),Bl=va(),Ge=_a(),qe=er(),Vl=Ia(),Zl=Ea(),Wl=$a(),Hl=za(),ql=wa(),Gl=Ra(),Kl=Na(),Jl=ja(),Ts=Function,cn=o(function(e){try{return Ts('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=tn(),Xl=Za(),pn=o(function(){throw new qe},"throwTypeError"),Yl=xt?function(){try{return arguments.callee,pn}catch{try{return xt(arguments,"callee").get}catch{return pn}}}():pn,We=Ga()(),Y=xs(),Ql=on(),ed=nn(),Es=an(),_t=nr(),He={},td=typeof Uint8Array>"u"||!Y?j:Y(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":We&&Y?Y([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jl,"%eval%":eval,"%EvalError%":Ll,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":Ts,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&Y?Y(Y([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Y?j:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ml,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":Fl,"%ReferenceError%":Bl,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Y?j:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Y?Y(""[Symbol.iterator]()):j,"%Symbol%":We?Symbol:j,"%SyntaxError%":Ge,"%ThrowTypeError%":Yl,"%TypedArray%":td,"%TypeError%":qe,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":Vl,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":Es,"%Object.defineProperty%":Xl,"%Object.getPrototypeOf%":Ql,"%Math.abs%":Zl,"%Math.floor%":Wl,"%Math.max%":Hl,"%Math.min%":ql,"%Math.pow%":Gl,"%Math.round%":Kl,"%Math.sign%":Jl,"%Reflect.getPrototypeOf%":ed};if(Y)try{null.error}catch(e){Ps=Y(Y(e)),Oe["%Error.prototype%"]=Ps}var Ps,rd=o(function e(t){var r;if(t==="%AsyncFunction%")r=cn("async function () {}");else if(t==="%GeneratorFunction%")r=cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return Oe[t]=r,r},"doEval"),bs={__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"]},Pt=Ze(),or=un(),nd=Pt.call(_t,Array.prototype.concat),od=Pt.call(Es,Array.prototype.splice),Is=Pt.call(_t,String.prototype.replace),ir=Pt.call(_t,String.prototype.slice),id=Pt.call(_t,RegExp.prototype.exec),ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,sd=/\\(\\)?/g,ud=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return Is(t,ad,function(s,c,p,m){i[i.length]=p?Is(m,sd,"$1"):c||s}),i},"stringToPath"),cd=o(function(t,r){var n=t,i;if(or(bs,n)&&(i=bs[n],n="%"+i[0]+"%"),or(Oe,n)){var s=Oe[n];if(s===He&&(s=rd(n)),typeof s>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ss.exports=o(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(id(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ud(t),i=n.length>0?n[0]:"",s=cd("%"+i+"%",r),c=s.name,p=s.value,m=!1,g=s.alias;g&&(i=g[0],od(n,nd([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var x=n[h],u=ir(x,0,1),d=ir(x,-1);if((u==='"'||u==="'"||u==="`"||d==='"'||d==="'"||d==="`")&&u!==d)throw new Ge("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(m=!0),i+="."+x,c="%"+i+"%",or(Oe,c))p=Oe[c];else if(p!=null){if(!(x in p)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&h+1>=n.length){var y=xt(p,x);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[x]}else b=or(p,x),p=p[x];b&&!m&&(Oe[c]=p)}}return p},"GetIntrinsic")});var zs=S((Jz,As)=>{"use strict";var pd=rn();As.exports=o(function(){return pd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Os=S((Yz,ws)=>{"use strict";var ld=$s(),ks=ld("%Object.defineProperty%",!0),dd=zs()(),md=un(),fd=er(),ar=dd?Symbol.toStringTag:null;ws.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new fd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!md(t,ar))&&(ks?ks(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Ds=S((ek,Rs)=>{"use strict";var gd=Function.prototype.call,yd=Object.prototype.hasOwnProperty,hd=Ze();Rs.exports=hd.call(gd,yd)});var Cs=S((tk,Ns)=>{"use strict";Ns.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var js=S((rk,Ms)=>{"use strict";var fn=Fi(),vd=require("util"),ln=require("path"),xd=require("http"),_d=require("https"),Pd=require("url").parse,bd=require("fs"),Id=require("stream").Stream,Td=require("crypto"),dn=Hi(),Ed=ca(),Sd=Os(),$e=Ds(),mn=Cs();function Us(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Us,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");vd.inherits(F,fn);F.LINE_BREAK=`\r
2
- `;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=fn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof Id))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):bd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",c={"Content-Disposition":["form-data",'name="'+Us(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&mn(c,r.header);var p;for(var m in c)if($e(c,m)){if(p=c[m],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=m+": "+p.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Us(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=dn.lookup(e.name)),!r&&e&&e.path&&(r=dn.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=dn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Td.randomBytes(12).toString("hex")};F.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Ed.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Pd(e),n=mn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=mn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=_d.request(n):r=xd.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 p,m=o(function(g,h){return r.removeListener("error",m),r.removeListener("response",p),t.call(this,g,h)},"callback");p=m.bind(this,null),r.on("error",m),r.on("response",p)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};Sd(F.prototype,"FormData");Ms.exports=F});var om={};bn(om,{azureDevOps:()=>nm});module.exports=du(om);var mu=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,m);let g=c.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let x=h[b];x in p||(p[x]=g[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function c(p){var m;let g=r?.Parent?new s:this;n(g,p),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var fu=Symbol("zod_brand"),pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},pr={};function fe(e){return e&&Object.assign(pr,e),pr}o(fe,"config");function dr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(dr,"getEnumValues");function En(e,t){return typeof t=="bigint"?t.toString():t}o(En,"jsonStringifyReplacer");function At(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(At,"cached");function Sn(e){return e==null}o(Sn,"nullish");function zt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(zt,"cleanRegex");var Tn=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Tn)return n===void 0&&(n=Tn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var mr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var gu=At(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function $n(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o($n,"isPlainObject");var An=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function kt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(kt,"clone");function W(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(W,"normalizeParams");function zn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(zn,"optionalKeys");var yu={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 Ne(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ne,"aborted");function Pe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Pe,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=$t(e.inst?._zod.def?.error?.(e))??$t(t?.error?.(e))??$t(r.customError?.(e))??$t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function kn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(kn,"getLengthableOrigin");function fr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(fr,"issue");var wn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,En,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),On=T("$ZodError",wn),Ye=T("$ZodError",wn,{Parent:Error});var vu=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise)throw new pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(m=>be(m,s,fe())));throw mr(p,i?.callee),p}return c.value},"_parse"),wt=vu(Ye),xu=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},s);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(m=>be(m,s,fe())));throw mr(p,i?.callee),p}return c.value},"_parseAsync"),Ot=xu(Ye),_u=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??On)(s.issues.map(c=>be(c,i,fe())))}:{success:!0,data:s.value}},"_safeParse"),Qe=_u(Ye),Pu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(c=>be(c,i,fe())))}:{success:!0,data:s.value}},"_safeParseAsync"),et=Pu(Ye);var bu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Iu=new RegExp(`^${bu}$`);var Rn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Dn=/^-?\d+n?$/;var gr=/^-?\d+(?:\.\d+)?$/,Nn=/^(?:true|false)$/i;var Ce=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Cn=T("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Sn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=kn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var yr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.init(e,t),e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=T("$ZodCheckRegex",(e,t)=>{yr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var jn={major:4,minor:3,patch:6};var H=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,m)=>{let g=Ne(c),h;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,u=b._zod.check(c);if(u instanceof Promise&&m?.async===!1)throw new pe;if(h||u instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await u,c.issues.length!==x&&(g||(g=Ne(c,x)))});else{if(c.issues.length===x)continue;g||(g=Ne(c,x))}}return h?h.then(()=>c):c},"runChecks"),s=o((c,p,m)=>{if(Ne(c))return c.aborted=!0,c;let g=i(p,n,m);if(g instanceof Promise){if(m.async===!1)throw new pe;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,c,p)):s(g,c,p)}let m=e._zod.parse(c,p);if(m instanceof Promise){if(p.async===!1)throw new pe;return m.then(g=>i(g,n,p))}return i(m,n,p)}}J(e,"~standard",()=>({validate:o(i=>{try{let s=Qe(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=T("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),hr=T("$ZodStringFormat",(e,t)=>{yr.init(e,t),Nt.init(e,t)});var Zn=T("$ZodURL",(e,t)=>{hr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Wn=T("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??gr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}});var vr=T("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Nn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Hn=T("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Dn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var qn=T("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Gn=T("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Kn=T("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=T("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function Ln(e,t,r){e.issues.length&&t.issues.push(...Pe(r,e.issues)),t.value[r]=e.value}o(Ln,"handleArrayResult");var Xn=T("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let c=0;c<i.length;c++){let p=i[c],m=t.element._zod.run({value:p,issues:[]},n);m instanceof Promise?s.push(m.then(g=>Ln(g,r,c))):Ln(m,r,c)}return s.length?Promise.all(s).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Pe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function Tu(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=zn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Tu,"normalizeDef");function Eu(e,t,r,n,i,s){let c=[],p=i.keySet,m=i.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){c.push(b);continue}let x=m.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(u=>Dt(u,r,b,t,h))):Dt(x,r,b,t,h)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(Eu,"handleCatchall");var Yn=T("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let m={...p};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=At(()=>Tu(t));J(e._zod,"propValues",()=>{let p=t.shape,m={};for(let g in p){let h=p[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let i=Xe,s=t.catchall,c;e._zod.parse=(p,m)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let h=[],b=c.shape;for(let x of c.keys){let u=b[x],d=u._zod.optout==="optional",y=u._zod.run({value:g[x],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Dt(f,p,x,g,d))):Dt(y,p,x,g,d)}return s?Eu(h,g,p,m,n.value,e):h.length?Promise.all(h).then(()=>p):p}});function Fn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Ne(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(c=>be(c,n,fe())))}),t)}o(Fn,"handleUnionResults");var xr=T("$ZodUnion",(e,t)=>{H.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>zt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let c=!1,p=[];for(let m of t.options){let g=m._zod.run({value:i.value,issues:[]},s);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(m=>Fn(m,i,e,s)):Fn(p,i,e,s)}});var Qn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let s of t.options){let c=s._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,m]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of m)i[p].add(g)}}return i});let n=At(()=>{let i=t.options,s=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let m of p){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,c)}}return s});e._zod.parse=(i,s)=>{let c=i.value;if(!Xe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=T("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!$n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:i[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Pe(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Pe(g,h.issues)),r.value[g]=h.value)}let m;for(let g in i)p.has(g)||(m=m??[],m.push(g));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:m})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let m=t.keyType._zod.run({value:p,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&gr.test(p)&&m.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>be(b,n,fe())),input:p,path:[p],inst:e});continue}let h=t.valueType._zod.run({value:i[p],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Pe(p,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Pe(p,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var to=T("$ZodEnum",(e,t)=>{H.init(e,t);let r=dr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>An.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=T("$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"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var no=T("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=T("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Bn(s,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=T("$ZodNullable",(e,t)=>{H.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=T("$ZodPipe",(e,t)=>{H.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=t.out._zod.run(r,n);return s instanceof Promise?s.then(c=>Rt(c,t.in,n)):Rt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Rt(s,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var so=T("$ZodCustom",(e,t)=>{Ce.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>Vn(s,r,n,e));Vn(i,r,n,e)}});function Vn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(fr(i))}}o(Vn,"handleRefineResult");var co,zu=Symbol("ZodOutput"),ku=Symbol("ZodInput"),_r=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function po(){return new _r}o(po,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=po());var Pr=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",...W(t)})}o(lo,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...W(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"boolean",...W(t)})}o(ho,"_boolean");function vo(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(vo,"_coercedBoolean");function xo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(xo,"_coercedBigint");function _o(e){return new e({type:"any"})}o(_o,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function bo(e,t){return new e({type:"void",...W(t)})}o(bo,"_void");function Io(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(Io,"_coercedDate");function ue(e,t){return new Cn({check:"min_length",...W(t),minimum:e})}o(ue,"_minLength");function Ie(e,t){return new Un({check:"string_format",format:"regex",...W(t),pattern:e})}o(Ie,"_regex");function To(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(To,"_custom");var X=T("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)=>wt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>Ot(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)=>kt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ut=T("ZodMiniString",(e,t)=>{Nt.init(e,t),X.init(e,t)});function a(e){return lo(Ut,e)}o(a,"string");var Eo=T("ZodMiniStringFormat",(e,t)=>{hr.init(e,t),Ut.init(e,t)});var Lu=T("ZodMiniURL",(e,t)=>{Zn.init(e,t),Eo.init(e,t)});function So(e){return fo(Lu,e)}o(So,"url");var br=T("ZodMiniNumber",(e,t)=>{Wn.init(e,t),X.init(e,t)});function ee(e){return go(br,e)}o(ee,"number");var Ir=T("ZodMiniBoolean",(e,t)=>{vr.init(e,t),X.init(e,t)});function V(e){return ho(Ir,e)}o(V,"boolean");var $o=T("ZodMiniBigInt",(e,t)=>{Hn.init(e,t),X.init(e,t)});var Fu=T("ZodMiniAny",(e,t)=>{qn.init(e,t),X.init(e,t)});function rt(){return _o(Fu)}o(rt,"any");var Bu=T("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),X.init(e,t)});function w(){return Po(Bu)}o(w,"unknown");var Vu=T("ZodMiniVoid",(e,t)=>{Kn.init(e,t),X.init(e,t)});function Ao(e){return bo(Vu,e)}o(Ao,"_void");var zo=T("ZodMiniDate",(e,t)=>{Jn.init(e,t),X.init(e,t)});var Zu=T("ZodMiniArray",(e,t)=>{Xn.init(e,t),X.init(e,t)});function N(e,t){return new Zu({type:"array",element:e,...W(t)})}o(N,"array");var Wu=T("ZodMiniObject",(e,t)=>{Yn.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...W(t)};return new Wu(r)}o(l,"object");var Hu=T("ZodMiniUnion",(e,t)=>{xr.init(e,t),X.init(e,t)});function C(e,t){return new Hu({type:"union",options:e,...W(t)})}o(C,"union");var qu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Ue(e,t,r){return new qu({type:"union",options:t,discriminator:e,...W(r)})}o(Ue,"discriminatedUnion");var Gu=T("ZodMiniRecord",(e,t)=>{eo.init(e,t),X.init(e,t)});function O(e,t,r){return new Gu({type:"record",keyType:e,valueType:t,...W(r)})}o(O,"record");var Ku=T("ZodMiniEnum",(e,t)=>{to.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ku({type:"enum",entries:r,...W(t)})}o(M,"_enum");var Ju=T("ZodMiniLiteral",(e,t)=>{ro.init(e,t),X.init(e,t)});function $(e,t){return new Ju({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o($,"literal");var Xu=T("ZodMiniTransform",(e,t)=>{no.init(e,t),X.init(e,t)});function Te(e){return new Xu({type:"transform",transform:e})}o(Te,"transform");var Yu=T("ZodMiniOptional",(e,t)=>{oo.init(e,t),X.init(e,t)});function v(e){return new Yu({type:"optional",innerType:e})}o(v,"optional");var Qu=T("ZodMiniNullable",(e,t)=>{io.init(e,t),X.init(e,t)});function nt(e){return new Qu({type:"nullable",innerType:e})}o(nt,"nullable");var ec=T("ZodMiniPipe",(e,t)=>{ao.init(e,t),X.init(e,t)});function Ee(e,t){return new ec({type:"pipe",in:e,out:t})}o(Ee,"pipe");var tc=T("ZodMiniCustom",(e,t)=>{so.init(e,t),X.init(e,t)});function Mt(e,t){return To(tc,e??(()=>!0),t)}o(Mt,"custom");var ot={};bn(ot,{bigint:()=>uc,boolean:()=>sc,date:()=>cc,number:()=>ac,string:()=>ic});function ic(e){return mo(Ut,e)}o(ic,"string");function ac(e){return yo(br,e)}o(ac,"number");function sc(e){return vo(Ir,e)}o(sc,"boolean");function uc(e){return xo($o,e)}o(uc,"bigint");function cc(e){return Io(zo,e)}o(cc,"date");var Er=l({retryOnFailure:l({defaultValue:v(V()),hide:v(V())}),continueOnFailure:l({defaultValue:v(V()),hide:v(V())})}),Tr=class{constructor(t,r,n,i,s,c,p,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=c;this.requireAuth=p;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{o(this,"IAction")}},ie=o(e=>new Tr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=l({displayName:a(),description:v(a())}),U=o((e,t)=>l({type:$(t),required:V(),defaultValue:v(rt())}),"TPropertyValue");var ne=l({...B.shape,...U(a(),"SHORT_TEXT").shape}),ge=l({...B.shape,...U(a(),"LONG_TEXT").shape});var wo=l({label:a(),value:w()}),jt=l({disabled:v(V()),placeholder:v(a()),options:N(wo)});var oe=l({...B.shape,options:jt,...U(w(),"STATIC_DROPDOWN").shape}),ye=l({...B.shape,options:jt,...U(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Sr=l({...B.shape,...U(w(),"DROPDOWN").shape,refreshers:N(a())}),it=l({...B.shape,...U(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=l({...B.shape,...U(V(),"CHECKBOX").shape});var ve=l({...B.shape,...U(ee(),"NUMBER").shape});var at=l({...B.shape,...U(w(),"FILE").shape});var st=l({...B.shape,...U(a(),"DATE_TIME").shape});var Oo=O(a(),C([ne,ge,oe,it,ye,he,ve,at,st])),ut=l({...B.shape,properties:Oo,...U(N(w()),"ARRAY").shape});var ct=l({...B.shape,...U(C([O(a(),w())]),"JSON").shape});var Ro=C([ne,oe,ct,ut,ye]),lc=O(a(),Ro),$r=l({refreshers:N(a()),...B.shape,...U(w(),"DYNAMIC").shape});var Lt=l({...B.shape,...U(Ao(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),je=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(je||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Ar="both_client_credentials_and_authorization_code";var xe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(xe||{}),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||{}),dc=l({strategy:M(dt),paramName:v(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Ft=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ft||{}),Do=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),No=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(M(Ft))}),Co=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Do,handlerId:v(a()),streamStepProgress:v(M(Ft))}),mc=C([No,Co]);var fc=l({body:w(),rawBody:v(w()),headers:O(a(),a()),queryParams:O(a(),a())});function Q(e){return e==null}o(Q,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var zr=Re(require("crypto"),1);var gc=128,ze,Le,yc=o(e=>{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*gc),zr.default.randomFillSync(ze),Le=0):Le+e>ze.length&&(zr.default.randomFillSync(ze),Le=0),Le+=e},"fillPool"),hc=o(e=>(yc(e|=0),ze.subarray(Le-e,Le)),"random"),vc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let c="";for(;;){let p=r(i),m=i;for(;m--;)if(c+=e[p[m]&n]||"",c.length===s)return c}}},"customRandom"),Mo=o((e,t=21)=>vc(e,t,hc),"customAlphabet");var xc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",jo=21,Fb=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${jo}}$`))),_c=Mo(xc,jo);var Se=Ee(Te(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:Se,updated:Se},Z=o(e=>v(nt(e)),"Nullable");function kr(e){return v(nt(M(e)))}o(kr,"NullableEnum");var Zb=Ee(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(V())),Vt=o(e=>Ee(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var qb=O(a(),w());var gt=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(gt||{});var iI=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var sI=l({filename:a(),data:w(),type:$("file"),mimetype:v(a())});var Pc=Re(Fo());var fI=l({...ae,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:v(ee())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),wr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(wr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var Rr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Rr||{});var Dr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Dr||{});var bc=l({mode:M(Bo),value:w()}),Ic=l({auth:v(a()),fields:O(a(),bc)}),Tc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(Ic)}),Ec=l({type:$("PIECE"),toolName:a().check(ue(1)),pieceMetadata:Tc}),Sc=l({type:$("none")}),$c=l({type:$("access_token"),accessToken:a()}),Ac=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),zc=l({type:$("headers"),headers:O(a(),a())}),kc=Ue("type",[Sc,$c,Ac,zc]),Vo=l({type:$("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Zo=l({type:$("MCP"),toolName:a().check(ue(1)),serverUrl:So(),protocol:M(Or),auth:kc}),Wo=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:M(wr),sourceId:a(),sourceName:a()}),wc=Ue("type",[Ec,Vo,Zo,Wo]),Oc=l({displayName:a(),description:v(a()),type:M(Rr)}),Ho=l({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:Z(O(a(),w())),output:v(w()),toolName:a(),status:M(Dr),toolCallId:a(),startTime:a(),endTime:v(a())},FI=l(Fe),qo=Ue("toolCallType",[l({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),Rc=C([Ho,qo]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),_e=l({apiKey:a()}),Dc=_e,Nc=l({apiKey:a(),apiKeyHash:a()}),Cc=_e,Uc=_e,Mc=_e,jc=_e,Lc=_e,Fc=_e,Bc=_e,Go=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Vc=l({}),Zc=l({}),Wc=l({}),Hc=l({}),qc=l({}),Gc=l({}),Ko=l({modelId:a(),modelName:a(),modelType:M(Nr)}),Jo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Ko),defaultHeaders:v(O(a(),a()))}),Xo=l({accountId:a(),gatewayId:a(),models:N(Ko),vertexProject:v(a()),vertexRegion:v(a())}),Yo=l({resourceName:a(),apiVersion:Ee(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Qo=l({region:a().check(ue(1))}),Kc=C([Dc,Mc,jc,Lc,Fc,Uc,Cc,Nc,Go,Bc]),ei=C([Jo,Xo,Yo,Qo,Vc,Wc,Hc,qc,Zc,Gc]),Jc=l({id:a(),name:a(),type:M(Nr)}),Xc=l({id:a(),name:a(),provider:M(gt),config:ei,enabledForChat:V()}),Yc=l({provider:M(gt),config:ei,auth:Kc,platformId:a()});var WI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Qc=l({base64Url:a(),fileName:a(),extension:v(a())}),ep=l({mimeType:a(),url:a(),fileName:v(a())}),Cr=C([Qc,ep]);var tp=C([l({type:$("file"),value:Cr}),l({type:$("markdown"),value:a(),files:v(N(Cr))})]),rp=l({sessionId:a(),message:a(),files:v(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||{}),Ur=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Ur||{});var np=C([l({...ae,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:C([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),op=l({...ae,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:kr(ni),trigger:kr(ri)}),ip=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),ap=l({events:N(M(Ur)),webhookUrl:a(),flowId:a()}),sp=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),up=l({projectId:a(),limit:v(ot.number()),cursor:v(a()),name:v(a()),externalIds:Vt(a()),folderId:v(a()),folderIds:Vt(a())}),cp=l({records:N(N(l({fieldId:a(),value:ii()}))),tableId:a()}),pp=l({cells:v(N(l({fieldId:a(),value:ii()}))),tableId:a(),agentUpdate:v(V())}),oi=Ue("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),ti("exists"),ti("not_exists")]),lp=l({tableId:a(),limit:v(ot.number()),cursor:v(a()),filters:Vt(oi)});function ii(){return Ee(Te(e=>e==null?e:String(e)),nt(a()))}o(ii,"coerceToString");function ke(e){return l({fieldId:a(),operator:$(e),value:a()})}o(ke,"valueFilter");function ti(e){return l({fieldId:a(),operator:$(e)})}o(ti,"existenceFilter");var dp=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),mp=l({...ae,deleted:Z(Se),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var ai=l({name:a(),description:v(a()),type:a(),required:V()}),fp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(ai),returnsResponse:V()})});var si="^[0-9]+\\.[0-9]+\\.[0-9]+$",pT=new RegExp(si),yp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",lT=a().check(Ie(new RegExp(si))),dT=a().check(Ie(new RegExp(yp))),hp=l({packageType:$("ARCHIVE"),pieceType:M(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ui=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ci=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),mT=C([ui,ci]),fT=C([hp,ui,ci]),pi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(pi||{}),vp=l({type:M(pi),cronExpression:a(),timezone:a()}),gT=l({...ae,type:M(xe),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(vp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:V()}),li=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(li||{}),di=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(di||{}),mi=(r=>(r.S3="S3",r.DB="DB",r))(mi||{}),yT=l({...ae,projectId:Z(a()),platformId:Z(a()),type:M(li),compression:M(di),data:v(w()),location:M(mi),size:Z(ee()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),fi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(fi||{}),gi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(gi||{}),hT=l({id:a(),email:a(),firstName:a(),status:M(gi),externalId:Z(a()),platformId:Z(a()),platformRole:M(fi),lastName:a(),created:Se,updated:Se,lastActiveDate:Z(Se),imageUrl:Z(a())});var Mr=l({...B.shape,...U(O(a(),w()),"OBJECT").shape});var xi=l({...B.shape,...U(a(),"COLOR").shape});var jr=C([ne,ge,Lt,he,oe,ye,Sr,it,$r,ve,ut,Mr,ct,st,at,xi]),D={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=l({displayName:a(),description:v(a())});var _i=l({username:a(),password:a()}),Lr=l({...le.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...U(_i,"BASIC_AUTH").shape});var bp=O(a(),C([ne,ge,ve,he,oe])),Fr=l({...le.shape,props:bp,...U(w(),"CUSTOM_AUTH").shape});var we=l({...le.shape,...U(l({auth:a()}),"SECRET_TEXT").shape});var Ip=O(a(),C([ne,ge,we,ve,he,oe,ye,Lt])),Pi=l({...le.shape,props:Ip,...U(w(),"OIDC").shape});var Br=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Br||{}),bi=C([ne,we,oe]),Ii=O(a(),bi),Tp=l({props:v(O(a(),bi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(C([$("none"),$("consent"),$("login"),$("omit")])),pkce:v(V()),pkceMethod:v(C([$("plain"),$("S256")])),authorizationMethod:v(M(Br)),grantType:v(C([M(lt),$(Ar)])),extra:v(O(a(),a()))}),Ti=l({access_token:a(),props:v(Ii),data:O(a(),rt())}),Vr=l({...le.shape,...Tp.shape,...U(Ti,"OAUTH2").shape});var Be=C([Lr,Fr,Pi,Vr,we]),yt="Connection",Wt={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 KE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Ep=l({...B.shape,...U(w(),"CUSTOM").shape,code:a()});var Sp=C([jr,Be]),Zr=O(a(),Sp),gS=O(a(),jr);var Ei=C([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),Ve=class{constructor(t,r,n,i,s,c,p,m,g,h,b,x,u,d,y,f,_,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=c;this.handshakeConfiguration=p;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=x;this.onStart=u;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=L}static{o(this,"ITrigger")}},Ht=o(e=>{switch(e.type){case"WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Q(e.sampleData)&&Q(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Si="2",qt="0.82.0";var Wr=class{constructor(t,r,n,i,s,c,p,m,g=qt,h,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Si}),"getContextInfo");(!$p(g)||Ap(g,qt))&&(this.minimumSupportedRelease=qt),s.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},$i=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Wr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function $p(e){return/^\d+\.\d+\.\d+$/.test(e)}o($p,"isValidSimpleSemver");function Ap(e,t){let[r,n,i]=e.split(".").map(Number),[s,c,p]=t.split(".").map(Number);return r!==s?r<s:n!==c?n<c:i<p}o(Ap,"isSemverLessThan");var zp=v(O(a(),O(a(),a()))),Ai=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(C([Be,N(Be)])),version:a(),categories:v(N(M(je))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:zp}),kp=M(["human","ai","both"]),zi=l({description:v(a()),idempotent:v(V())}),ki=l({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:V(),errorHandlingOptions:v(Er),outputSchema:v(Mt()),audience:v(kp),aiMetadata:v(zi)}),wi=l({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:v(Er),type:M(xe),sampleData:w(),handshakeConfiguration:v(Mt()),renewConfiguration:v(Ei),testStrategy:M(mt),outputSchema:v(Mt()),aiMetadata:v(zi)}),wp=l({...Ai.shape,actions:O(a(),ki),triggers:O(a(),wi)}),Op=l({...Ai.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(wi)),suggestedTriggers:v(N(ki))}),Oi=l({projectUsage:ee(),tags:v(N(a())),pieceType:M(Me),packageType:M(pt),platformId:v(a()),archiveId:v(a())}),g$=l({...wp.shape,...Oi.shape}),y$=l({...Op.shape,...Oi.shape}),h$=l({name:a(),version:a()});var Rp=Re(require("path")),Dp=Re(require("fs/promises"));var Gt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,c)=>{i.append(c,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};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 Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new qr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},qr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Jt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Xt=class extends Gt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Kt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))i.append(L,re);let p=i.toString(),m=p?`${n}?${p}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:u,isStream:d}=Np(t.body,s),y=Up({...s,...u}),f=await Cp(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:y,body:x,redirect:h?"follow":"manual",signal:L.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(m,se)}finally{re!==void 0&&clearTimeout(re)}},b),_=h?300:400;if(f.status<200||f.status>=_){let L=await Ri(f,g),re=new Jt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Ri(f,g);return{status:f.status,headers:Mp(f.headers),body:P}}};function Np(e,t){return Lp(e)?{body:void 0,extraHeaders:{},isStream:!1}:jp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(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();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ri,"parseResponseBody");async function Cp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Di(n);continue}return i}catch(i){if(r=i,n<t){await Di(n);continue}throw i}throw r}o(Cp,"sendWithRetries");function Di(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Di,"backoff");function Up(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(Up,"normalizeHeaders");function Mp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Mp,"toHttpHeaders");function jp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(jp,"isNodeFormData");function Lp(e){return e==null}o(Lp,"isNil");var ht=new Xt;var vt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(vt||{});var $d=Re(require("fs")),Ls=Re(js());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 zd(e){let t=e.split(";")[0].trim().toLowerCase();return Ad[t]??""}o(zd,"contentTypeToExtension");var kd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),wd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Fs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:c,extraProps:p,authLocation:m="headers"}){return ie({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:D.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:D.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${wd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:D.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(vt).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:D.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:D.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:D.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:D.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=D.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=D.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=D.Array({displayName:"Form Data",required:!0,properties:{fieldName:D.ShortText({displayName:"Field Name",required:!0}),fieldType:D.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:D.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:D.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:D.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:D.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:D.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:D.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:h,url:b,headers:x,queryParams:u,body:d,body_type:y,failsafe:f,timeout:_,response_is_binary:P,followRedirects:L}=g.propsValue;Bt(h,"Method"),Bt(b,"URL");let re=Q(r)?{}:await r(g.auth,g.propsValue),se=b.url,Ke=se.startsWith("http://")||se.startsWith("https://")?se:kd({baseUrl:t(g.auth),relativePath:se}),Ae={method:h,url:Ke,headers:{...x??{},...m==="headers"||!Q(m)?re:{}},queryParams:{...m==="queryParams"?re:{},...u??{}},timeout:_?_*1e3:0,followRedirects:L};if(P&&(Ae.responseType="arraybuffer"),d)if(y&&y!=="none"){let me=d.data;if(y==="form_data"){let au=me,Et=new Ls.default;for(let{fieldName:xn,fieldType:_n,textFieldValue:Pn,fileFieldValue:cr}of au)_n==="text"&&!ft(Pn)?Et.append(xn,Pn):_n==="file"&&!ft(cr)&&Et.append(xn,cr.data,{filename:cr?.filename});Ae.body=Et,Ae.headers={...Ae.headers,...Et.getHeaders()}}else Ae.body=me}else y||(Ae.body=d);try{let me=await ht.sendRequest(Ae);return await Od(g.files,me.body,me.status,me.headers,P)}catch(me){if(f)return me.errorMessage();throw me}},"run")})}o(Fs,"createCustomApiCallAction");var Od=o(async(e,t,r,n,i)=>{let s;if(i&&Rd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=zd(c??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),Rd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var bt={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Q(p))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),p);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>p).map(h=>h.data)}case 1:{let p=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:c}),g=m.findIndex(x=>x.id===p),h=[];Q(p)||g==-1?h=m??[]:h=m?.slice(0,g)??[],Q(i)||(h=h.slice(-i));let b=h?.[0]?.id;return Q(b)||await t.put("lastItem",b),h.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Q(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:s}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:s});break}}return Dd(c.map(p=>p.data))}};function Dd(e){return e.length<=5?e:e.slice(0,5)}o(Dd,"getFirstFiveOrAll");function Nd(e){return e}o(Nd,"asAzureAuth");function It(e,t){if(typeof e!="string"||e.length===0)throw new Error(`Expected non-empty string for "${t}", got ${typeof e}`);return e}o(It,"narrowString");function Bs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Bs,"isRecord");function Cd(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}o(Cd,"generateWebhookToken");function Ud(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e.charCodeAt(n)^t.charCodeAt(n);return r===0}o(Ud,"timingSafeEqual");function Tt(e){if(typeof e=="object"&&e!==null){let t=e,r=t.response?.status??t.status;if(typeof r=="number")return` (HTTP ${r})`}return""}o(Tt,"extractHttpStatus");function Md(e){if(!Bs(e))return null;let{eventType:t,resource:r}=e;return typeof t!="string"||!Bs(r)||t!=="workitem.created"&&t!=="workitem.updated"&&t!=="workitem.commented"?null:{eventType:t,resource:r}}o(Md,"parseWebhookPayload");var jd=`To get your Personal Access Token (PAT):
1
+ "use strict";var Pu=Object.create;var Xe=Object.defineProperty;var bu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},En=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},Sn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Iu(t))!Eu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=bu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?Pu(Tu(e)):{},Sn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),Su=e=>Sn(Xe({},"__esModule",{value:!0}),e);var Jo=S((Ko,Gt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),s="%[0-9a-z]{1,}",u="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(s,"i"),native:new RegExp(`^(::)?(${u})?([0-9a-f]+)?(::)?(${s})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${s})?)$`,"i"),transitional:new RegExp(`^((?:${u})|(?:::)(?:${u})?)${t}\\.${t}\\.${t}\\.${t}(${s})?$`,"i")};function m(c,d){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let y=0,f=-1,x=(c.match(p.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(f=c.indexOf(":",f+1))>=0;)y++;if(c.substr(0,2)==="::"&&y--,c.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return c=c.replace("::",P),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),d=(function(){let re=c.split(":"),se=[];for(let Je=0;Je<re.length;Je++)se.push(parseInt(re[Je],16));return se})(),{parts:d,zoneId:x}}o(m,"expandIPv6");function g(c,d,y,f){if(c.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),c[x]>>P!==d[x]>>P)return!1;f-=y,x+=1}return!0}o(g,"matchCIDR");function h(c){if(i.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}o(h,"parseIntAuto");function b(c,d){for(;c.length<d;)c=`0${c}`;return c}o(b,"padPart");let _={};_.IPv4=(function(){function c(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c})(),_.IPv4.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(c){return this.parser(c)!==null},_.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(c){return!!(_.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(c){let d=c.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(c)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(c){let d=this.parser(c);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(c){let d;if(d=c.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(c){let d,y,f;if(d=c.match(r.fourOctet))return(function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)y=x[L],P.push(h(y));return P})();if(d=c.match(r.longValue)){if(f=h(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return(function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(f>>P&255);return x})().reverse()}else return(d=c.match(r.twoOctet))?(function(){let x=d.slice(1,4),P=[];if(f=h(x[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P})():(d=c.match(r.threeOctet))?(function(){let x=d.slice(1,5),P=[];if(f=h(x[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(h(x[0])),P.push(h(x[1])),P.push(f>>8&255),P.push(f&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},_.IPv6=(function(){function c(d,y){let f,x;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(x=this.parts[f],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in f){if(P=f[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},c.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let x=0;x<f.length;x++)d=f[x],y.push(d>>8),y.push(d&255);return y},c.prototype.toFixedLengthString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(b(this.parts[x].toString(16),4));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new _.IPv4([y>>8,y&255,f>>8,f&255])},c.prototype.toNormalizedString=function(){let d=(function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(this.parts[x].toString(16));return f}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(f=P.index,x=P[0].length);return x<0?y:`${y.substring(0,f)}::${y.substring(f+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c})(),_.IPv6.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(c){return this.parser(c)!==null},_.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let d=this.parser(c);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},_.IPv6.parse=function(c){let d=this.parser(c);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(c){let d,y,f;if((y=c.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(c){let d,y,f,x,P,L;if(f=c.match(p.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(p.native.test(c))return m(c,8);if((f=c.match(p.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=m(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},_.fromByteArray=function(c){let d=c.length;if(d===4)return new _.IPv4(c);if(d===16)return new _.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(c){return _.IPv6.isValid(c)||_.IPv4.isValid(c)},_.isValidCIDR=function(c){return _.IPv6.isValidCIDR(c)||_.IPv4.isValidCIDR(c)},_.parse=function(c){if(_.IPv6.isValid(c))return _.IPv6.parse(c);if(_.IPv4.isValid(c))return _.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(c){try{return _.IPv6.parseCIDR(c)}catch{try{return _.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(c){let d=this.parse(c);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(c,d,y){let f,x,P,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],c.kind()===L[0].kind()&&c.match.apply(c,L))return x}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=_:e.ipaddr=_})(Ko)});var Xi=S((az,Ji)=>{var Ki=require("stream").Stream,ul=require("util");Ji.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=[]}o(ce,"DelayedStream");ul.inherits(ce,Ki);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(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=Ki.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 ta=S((uz,ea)=>{var cl=require("util"),Qi=require("stream").Stream,Yi=Xi();ea.exports=G;function G(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(G,"CombinedStream");cl.inherits(G,Qi);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Yi)){var r=Yi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};G.prototype.pipe=function(e,t){return Qi.prototype.pipe.call(this,e,t),this.resume(),e};G.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};G.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var na=S((pz,ra)=>{"use strict";ra.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 aa=S(te=>{"use strict";var tr=na(),pl=require("path").extname,oa=/^\s*([^;\s]*)(?:;|\s|$)/,ll=/^text\//i;te.charset=ia;te.charsets={lookup:ia};te.contentType=dl;te.extension=ml;te.extensions=Object.create(null);te.lookup=fl;te.types=Object.create(null);gl(te.extensions,te.types);function ia(e){if(!e||typeof e!="string")return!1;var t=oa.exec(e),r=t&&tr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ll.test(t[1])?"UTF-8":!1}o(ia,"charset");function dl(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}o(dl,"contentType");function ml(e){if(!e||typeof e!="string")return!1;var t=oa.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(ml,"extension");function fl(e){if(!e||typeof e!="string")return!1;var t=pl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(fl,"lookup");function gl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(tr).forEach(o(function(i){var s=tr[i],u=s.extensions;if(!(!u||!u.length)){e[i]=u;for(var p=0;p<u.length;p++){var m=u[p];if(t[m]){var g=r.indexOf(tr[t[m]].source),h=r.indexOf(s.source);if(t[m]!=="application/octet-stream"&&(g>h||g===h&&t[m].substr(0,12)==="application/"))continue}t[m]=i}}},"forEachMimeType"))}o(gl,"populateMaps")});var ua=S((mz,sa)=>{sa.exports=yl;function yl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(yl,"defer")});var Xr=S((gz,pa)=>{var ca=ua();pa.exports=hl;function hl(e){var t=!1;return ca(function(){t=!0}),o(function(n,i){t?e(n,i):ca(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(hl,"async")});var Yr=S((hz,la)=>{la.exports=vl;function vl(e){Object.keys(e.jobs).forEach(xl.bind(e)),e.jobs={}}o(vl,"abort");function xl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(xl,"clean")});var Qr=S((xz,ma)=>{var da=Xr(),_l=Yr();ma.exports=Pl;function Pl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=bl(t,i,e[i],function(s,u){i in r.jobs&&(delete r.jobs[i],s?_l(r):r.results[i]=u,n(s,r.results))})}o(Pl,"iterate");function bl(e,t,r,n){var i;return e.length==2?i=e(r,da(n)):i=e(r,t,da(n)),i}o(bl,"runJob")});var en=S((Pz,fa)=>{fa.exports=Il;function Il(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,s){return t(e[i],e[s])}),n}o(Il,"state")});var tn=S((Iz,ga)=>{var Tl=Yr(),El=Xr();ga.exports=Sl;function Sl(e){Object.keys(this.jobs).length&&(this.index=this.size,Tl(this),El(e)(null,this.results))}o(Sl,"terminator")});var ha=S((Ez,ya)=>{var Al=Qr(),$l=en(),zl=tn();ya.exports=kl;function kl(e,t,r){for(var n=$l(e);n.index<(n.keyedList||e).length;)Al(e,t,n,function(i,s){if(i){r(i,s);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return zl.bind(n,r)}o(kl,"parallel")});var rn=S((Az,rr)=>{var va=Qr(),wl=en(),Ol=tn();rr.exports=Rl;rr.exports.ascending=xa;rr.exports.descending=Dl;function Rl(e,t,r,n){var i=wl(e,r);return va(e,t,i,o(function s(u,p){if(u){n(u,p);return}if(i.index++,i.index<(i.keyedList||e).length){va(e,t,i,s);return}n(null,i.results)},"iteratorHandler")),Ol.bind(i,n)}o(Rl,"serialOrdered");function xa(e,t){return e<t?-1:e>t?1:0}o(xa,"ascending");function Dl(e,t){return-1*xa(e,t)}o(Dl,"descending")});var Pa=S((zz,_a)=>{var Nl=rn();_a.exports=Cl;function Cl(e,t,r){return Nl(e,t,null,r)}o(Cl,"serial")});var Ia=S((wz,ba)=>{ba.exports={parallel:ha(),serial:Pa(),serialOrdered:rn()}});var nn=S((Oz,Ta)=>{"use strict";Ta.exports=Object});var Sa=S((Rz,Ea)=>{"use strict";Ea.exports=Error});var $a=S((Dz,Aa)=>{"use strict";Aa.exports=EvalError});var ka=S((Nz,za)=>{"use strict";za.exports=RangeError});var Oa=S((Cz,wa)=>{"use strict";wa.exports=ReferenceError});var Da=S((Uz,Ra)=>{"use strict";Ra.exports=SyntaxError});var nr=S((Mz,Na)=>{"use strict";Na.exports=TypeError});var Ua=S((jz,Ca)=>{"use strict";Ca.exports=URIError});var ja=S((Lz,Ma)=>{"use strict";Ma.exports=Math.abs});var Fa=S((Fz,La)=>{"use strict";La.exports=Math.floor});var Va=S((Bz,Ba)=>{"use strict";Ba.exports=Math.max});var Ha=S((Vz,Za)=>{"use strict";Za.exports=Math.min});var qa=S((Zz,Wa)=>{"use strict";Wa.exports=Math.pow});var Ka=S((Hz,Ga)=>{"use strict";Ga.exports=Math.round});var Xa=S((Wz,Ja)=>{"use strict";Ja.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Qa=S((Gz,Ya)=>{"use strict";var Ul=Xa();Ya.exports=o(function(t){return Ul(t)||t===0?t:t<0?-1:1},"sign")});var ts=S((Jz,es)=>{"use strict";es.exports=Object.getOwnPropertyDescriptor});var on=S((Xz,rs)=>{"use strict";var or=ts();if(or)try{or([],"length")}catch{or=null}rs.exports=or});var os=S((Yz,ns)=>{"use strict";var ir=Object.defineProperty||!1;if(ir)try{ir({},"a",{value:1})}catch{ir=!1}ns.exports=ir});var an=S((Qz,is)=>{"use strict";is.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var u=Object.getOwnPropertySymbols(t);if(u.length!==1||u[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var us=S((tk,ss)=>{"use strict";var as=typeof Symbol<"u"&&Symbol,Ml=an();ss.exports=o(function(){return typeof as!="function"||typeof Symbol!="function"||typeof as("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ml()},"hasNativeSymbols")});var sn=S((nk,cs)=>{"use strict";cs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var un=S((ok,ps)=>{"use strict";var jl=nn();ps.exports=jl.getPrototypeOf||null});var ms=S((ik,ds)=>{"use strict";var Ll="Function.prototype.bind called on incompatible ",Fl=Object.prototype.toString,Bl=Math.max,Vl="[object Function]",ls=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var s=0;s<r.length;s+=1)n[s+t.length]=r[s];return n},"concatty"),Zl=o(function(t,r){for(var n=[],i=r||0,s=0;i<t.length;i+=1,s+=1)n[s]=t[i];return n},"slicy"),Hl=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");ds.exports=o(function(t){var r=this;if(typeof r!="function"||Fl.apply(r)!==Vl)throw new TypeError(Ll+r);for(var n=Zl(arguments,1),i,s=o(function(){if(this instanceof i){var h=r.apply(this,ls(n,arguments));return Object(h)===h?h:this}return r.apply(t,ls(n,arguments))},"binder"),u=Bl(0,r.length-n.length),p=[],m=0;m<u;m++)p[m]="$"+m;if(i=Function("binder","return function ("+Hl(p,",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var He=S((sk,fs)=>{"use strict";var Wl=ms();fs.exports=Function.prototype.bind||Wl});var ar=S((uk,gs)=>{"use strict";gs.exports=Function.prototype.call});var cn=S((ck,ys)=>{"use strict";ys.exports=Function.prototype.apply});var vs=S((pk,hs)=>{"use strict";hs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var _s=S((lk,xs)=>{"use strict";var ql=He(),Gl=cn(),Kl=ar(),Jl=vs();xs.exports=Jl||ql.call(Kl,Gl)});var bs=S((dk,Ps)=>{"use strict";var Xl=He(),Yl=nr(),Ql=ar(),ed=_s();Ps.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Yl("a function is required");return ed(Xl,Ql,t)},"callBindBasic")});var $s=S((fk,As)=>{"use strict";var td=bs(),Is=on(),Es;try{Es=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var pn=!!Es&&Is&&Is(Object.prototype,"__proto__"),Ss=Object,Ts=Ss.getPrototypeOf;As.exports=pn&&typeof pn.get=="function"?td([pn.get]):typeof Ts=="function"?o(function(t){return Ts(t==null?t:Ss(t))},"getDunder"):!1});var Rs=S((yk,Os)=>{"use strict";var zs=sn(),ks=un(),ws=$s();Os.exports=zs?o(function(t){return zs(t)},"getProto"):ks?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ks(t)},"getProto"):ws?o(function(t){return ws(t)},"getProto"):null});var ln=S((vk,Ds)=>{"use strict";var rd=Function.prototype.call,nd=Object.prototype.hasOwnProperty,od=He();Ds.exports=od.call(rd,nd)});var Fs=S((xk,Ls)=>{"use strict";var j,id=nn(),ad=Sa(),sd=$a(),ud=ka(),cd=Oa(),Ke=Da(),Ge=nr(),pd=Ua(),ld=ja(),dd=Fa(),md=Va(),fd=Ha(),gd=qa(),yd=Ka(),hd=Qa(),Ms=Function,dn=o(function(e){try{return Ms('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Pt=on(),vd=os(),mn=o(function(){throw new Ge},"throwTypeError"),xd=Pt?(function(){try{return arguments.callee,mn}catch{try{return Pt(arguments,"callee").get}catch{return mn}}})():mn,We=us()(),Q=Rs(),_d=un(),Pd=sn(),js=cn(),bt=ar(),qe={},bd=typeof Uint8Array>"u"||!Q?j:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":We&&Q?Q([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ad,"%eval%":eval,"%EvalError%":sd,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":Ms,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&Q?Q(Q([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Q?j:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":id,"%Object.getOwnPropertyDescriptor%":Pt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":ud,"%ReferenceError%":cd,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Q?j:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Q?Q(""[Symbol.iterator]()):j,"%Symbol%":We?Symbol:j,"%SyntaxError%":Ke,"%ThrowTypeError%":xd,"%TypedArray%":bd,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":pd,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":js,"%Object.defineProperty%":vd,"%Object.getPrototypeOf%":_d,"%Math.abs%":ld,"%Math.floor%":dd,"%Math.max%":md,"%Math.min%":fd,"%Math.pow%":gd,"%Math.round%":yd,"%Math.sign%":hd,"%Reflect.getPrototypeOf%":Pd};if(Q)try{null.error}catch(e){Ns=Q(Q(e)),Ne["%Error.prototype%"]=Ns}var Ns,Id=o(function e(t){var r;if(t==="%AsyncFunction%")r=dn("async function () {}");else if(t==="%GeneratorFunction%")r=dn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=dn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ne[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"]},It=He(),sr=ln(),Td=It.call(bt,Array.prototype.concat),Ed=It.call(js,Array.prototype.splice),Us=It.call(bt,String.prototype.replace),ur=It.call(bt,String.prototype.slice),Sd=It.call(bt,RegExp.prototype.exec),Ad=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$d=/\\(\\)?/g,zd=o(function(t){var r=ur(t,0,1),n=ur(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 i=[];return Us(t,Ad,function(s,u,p,m){i[i.length]=p?Us(m,$d,"$1"):u||s}),i},"stringToPath"),kd=o(function(t,r){var n=t,i;if(sr(Cs,n)&&(i=Cs[n],n="%"+i[0]+"%"),sr(Ne,n)){var s=Ne[n];if(s===qe&&(s=Id(n)),typeof s>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ls.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(Sd(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=zd(t),i=n.length>0?n[0]:"",s=kd("%"+i+"%",r),u=s.name,p=s.value,m=!1,g=s.alias;g&&(i=g[0],Ed(n,Td([0,1],g)));for(var h=1,b=!0;h<n.length;h+=1){var _=n[h],c=ur(_,0,1),d=ur(_,-1);if((c==='"'||c==="'"||c==="`"||d==='"'||d==="'"||d==="`")&&c!==d)throw new Ke("property names with quotes must have matching quotes");if((_==="constructor"||!b)&&(m=!0),i+="."+_,u="%"+i+"%",sr(Ne,u))p=Ne[u];else if(p!=null){if(!(_ in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(Pt&&h+1>=n.length){var y=Pt(p,_);b=!!y,b&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[_]}else b=sr(p,_),p=p[_];b&&!m&&(Ne[u]=p)}}return p},"GetIntrinsic")});var Vs=S((Pk,Bs)=>{"use strict";var wd=an();Bs.exports=o(function(){return wd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ws=S((Ik,Hs)=>{"use strict";var Od=Fs(),Zs=Od("%Object.defineProperty%",!0),Rd=Vs()(),Dd=ln(),Nd=nr(),cr=Rd?Symbol.toStringTag:null;Hs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Nd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");cr&&(n||!Dd(t,cr))&&(Zs?Zs(t,cr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[cr]=r)},"setToStringTag")});var Gs=S((Ek,qs)=>{"use strict";var Cd=Function.prototype.call,Ud=Object.prototype.hasOwnProperty,Md=He();qs.exports=Md.call(Cd,Ud)});var Js=S((Sk,Ks)=>{"use strict";Ks.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Qs=S((Ak,Ys)=>{"use strict";var hn=ta(),jd=require("util"),fn=require("path"),Ld=require("http"),Fd=require("https"),Bd=require("url").parse,Vd=require("fs"),Zd=require("stream").Stream,Hd=require("crypto"),gn=aa(),Wd=Ia(),qd=Ws(),we=Gs(),yn=Js();function Xs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Xs,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],hn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");jd.inherits(F,hn);F.LINE_BREAK=`\r
2
+ `;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=hn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),s=this._multiPartFooter();n(i),n(t),n(s),this._trackLength(i,t,r)};F.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&we(t,"httpVersion"))&&!(t instanceof Zd))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Vd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),s="",u={"Content-Disposition":["form-data",'name="'+Xs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&yn(u,r.header);var p;for(var m in u)if(we(u,m)){if(p=u[m],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(s+=m+": "+p.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+s+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=fn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=fn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=fn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Xs(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=gn.lookup(e.name)),!r&&e&&e.path&&(r=gn.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=gn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)we(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Hd.randomBytes(12).toString("hex")};F.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Wd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Bd(e),n=yn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=yn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Fd.request(n):r=Ld.request(n),this.getLength(function(s,u){if(s&&s!=="Unknown stream"){this._error(s);return}if(u&&r.setHeader("Content-Length",u),this.pipe(r),t){var p,m=o(function(g,h){return r.removeListener("error",m),r.removeListener("response",p),t.call(this,g,h)},"callback");p=m.bind(this,null),r.on("error",m),r.on("response",p)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};qd(F.prototype,"FormData");Ys.exports=F});var Em={};En(Em,{azureDevOps:()=>Tm});module.exports=Su(Em);var Au=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:u,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,m);let g=u.prototype,h=Object.keys(g);for(let b=0;b<h.length;b++){let _=h[b];_ in p||(p[_]=g[_].bind(p))}}o(n,"init");let i=r?.Parent??Object;class s extends i{static{o(this,"Definition")}}Object.defineProperty(s,"name",{value:e});function u(p){var m;let g=r?.Parent?new s:this;n(g,p),(m=g._zod).deferred??(m.deferred=[]);for(let h of g._zod.deferred)h();return g}return o(u,"_"),Object.defineProperty(u,"init",{value:n}),Object.defineProperty(u,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(u,"name",{value:e}),u}o(T,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$t=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},mr={};function ge(e){return e&&Object.assign(mr,e),mr}o(ge,"config");function gr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(gr,"getEnumValues");function $n(e,t){return typeof t=="bigint"?t.toString():t}o($n,"jsonStringifyReplacer");function kt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(kt,"cached");function zn(e){return e==null}o(zn,"nullish");function wt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(wt,"cleanRegex");var An=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==An)return n===void 0&&(n=An,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var yr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var $u=kt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function kn(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(kn,"isPlainObject");var wn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function Ot(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Ot,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function On(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(On,"optionalKeys");var Rn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Me(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Me,"aborted");function Ie(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Ie,"prefixIssues");function zt(e){return typeof e=="string"?e:e?.message}o(zt,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=zt(e.inst?._zod.def?.error?.(e))??zt(t?.error?.(e))??zt(r.customError?.(e))??zt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Te,"finalizeIssue");function Dn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Dn,"getLengthableOrigin");function hr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(hr,"issue");var Nn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,$n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Cn=T("$ZodError",Nn),Qe=T("$ZodError",Nn,{Parent:Error});var ku=o(e=>(t,r,n,i)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise)throw new pe;if(u.issues.length){let p=new(i?.Err??e)(u.issues.map(m=>Te(m,s,ge())));throw yr(p,i?.callee),p}return u.value},"_parse"),Rt=ku(Qe),wu=o(e=>async(t,r,n,i)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},s);if(u instanceof Promise&&(u=await u),u.issues.length){let p=new(i?.Err??e)(u.issues.map(m=>Te(m,s,ge())));throw yr(p,i?.callee),p}return u.value},"_parseAsync"),Dt=wu(Qe),Ou=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new pe;return s.issues.length?{success:!1,error:new(e??Cn)(s.issues.map(u=>Te(u,i,ge())))}:{success:!0,data:s.value}},"_safeParse"),et=Ou(Qe),Ru=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(u=>Te(u,i,ge())))}:{success:!0,data:s.value}},"_safeParseAsync"),tt=Ru(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])))",Nu=new RegExp(`^${Du}$`);var Un=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Mn=/^-?\d+n?$/,jn=/^-?\d+$/,vr=/^-?\d+(?:\.\d+)?$/,Ln=/^(?:true|false)$/i;var Ee=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Cu={number:"number",bigint:"bigint",object:"date"};var Fn=T("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=Cu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Bn=T("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,s]=Rn[t.format];e._zod.onattach.push(u=>{let p=u._zod.bag;p.format=t.format,p.minimum=i,p.maximum=s,r&&(p.pattern=jn)}),e._zod.check=u=>{let p=u.value;if(r){if(!Number.isInteger(p)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?u.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&u.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>s&&u.issues.push({origin:"number",input:p,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Vn=T("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!zn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let u=Dn(i);n.issues.push({origin:u,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var xr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.init(e,t),e._zod.onattach.push(i=>{let s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Zn=T("$ZodCheckRegex",(e,t)=>{xr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Wn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let s of i._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((u,p,m)=>{let g=Me(u),h;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(u))continue}else if(g)continue;let _=u.issues.length,c=b._zod.check(u);if(c instanceof Promise&&m?.async===!1)throw new pe;if(h||c instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await c,u.issues.length!==_&&(g||(g=Me(u,_)))});else{if(u.issues.length===_)continue;g||(g=Me(u,_))}}return h?h.then(()=>u):u},"runChecks"),s=o((u,p,m)=>{if(Me(u))return u.aborted=!0,u;let g=i(p,n,m);if(g instanceof Promise){if(m.async===!1)throw new pe;return g.then(h=>e._zod.parse(h,m))}return e._zod.parse(g,m)},"handleCanaryResult");e._zod.run=(u,p)=>{if(p.skipChecks)return e._zod.parse(u,p);if(p.direction==="backward"){let g=e._zod.parse({value:u.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(h=>s(h,u,p)):s(g,u,p)}let m=e._zod.parse(u,p);if(m instanceof Promise){if(p.async===!1)throw new pe;return m.then(g=>i(g,n,p))}return i(m,n,p)}}J(e,"~standard",()=>({validate:o(i=>{try{let s=et(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return tt(e,i).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ut=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Un(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}}),_r=T("$ZodStringFormat",(e,t)=>{xr.init(e,t),Ut.init(e,t)});var Xn=T("$ZodURL",(e,t)=>{_r.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Pr=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??vr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),r}}),Yn=T("$ZodNumberFormat",(e,t)=>{Bn.init(e,t),Pr.init(e,t)}),br=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Ln,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Qn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=Mn,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 eo=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),to=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var ro=T("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),no=T("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),r}});function qn(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(qn,"handleArrayResult");var oo=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let s=[];for(let u=0;u<i.length;u++){let p=i[u],m=t.element._zod.run({value:p,issues:[]},n);m instanceof Promise?s.push(m.then(g=>qn(g,r,u))):qn(m,r,u)}return s.length?Promise.all(s).then(()=>r):r}});function Ct(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Ie(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ct,"handlePropertyResult");function Uu(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=On(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Uu,"normalizeDef");function Mu(e,t,r,n,i,s){let u=[],p=i.keySet,m=i.catchall._zod,g=m.def.type,h=m.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){u.push(b);continue}let _=m.run({value:t[b],issues:[]},n);_ instanceof Promise?e.push(_.then(c=>Ct(c,r,b,t,h))):Ct(_,r,b,t,h)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}o(Mu,"handleCatchall");var io=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let m={...p};return Object.defineProperty(t,"shape",{value:m}),m},"get")})}let n=kt(()=>Uu(t));J(e._zod,"propValues",()=>{let p=t.shape,m={};for(let g in p){let h=p[g]._zod;if(h.values){m[g]??(m[g]=new Set);for(let b of h.values)m[g].add(b)}}return m});let i=Ye,s=t.catchall,u;e._zod.parse=(p,m)=>{u??(u=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let h=[],b=u.shape;for(let _ of u.keys){let c=b[_],d=c._zod.optout==="optional",y=c._zod.run({value:g[_],issues:[]},m);y instanceof Promise?h.push(y.then(f=>Ct(f,p,_,g,d))):Ct(y,p,_,g,d)}return s?Mu(h,g,p,m,n.value,e):h.length?Promise.all(h).then(()=>p):p}});function Gn(e,t,r,n){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let i=e.filter(s=>!Me(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(u=>Te(u,n,ge())))}),t)}o(Gn,"handleUnionResults");var Ir=T("$ZodUnion",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>wt(s.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(r)return n(i,s);let u=!1,p=[];for(let m of t.options){let g=m._zod.run({value:i.value,issues:[]},s);if(g instanceof Promise)p.push(g),u=!0;else{if(g.issues.length===0)return g;p.push(g)}}return u?Promise.all(p).then(m=>Gn(m,i,e,s)):Gn(p,i,e,s)}});var ao=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ir.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let s of t.options){let u=s._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[p,m]of Object.entries(u)){i[p]||(i[p]=new Set);for(let g of m)i[p].add(g)}}return i});let n=kt(()=>{let i=t.options,s=new Map;for(let u of i){let p=u._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let m of p){if(s.has(m))throw new Error(`Duplicate discriminator value "${String(m)}"`);s.set(m,u)}}return s});e._zod.parse=(i,s)=>{let u=i.value;if(!Ye(u))return i.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),i;let p=n.value.get(u?.[t.discriminator]);return p?p._zod.run(i,s):t.unionFallback?r(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:u,path:[t.discriminator],inst:e}),i)}});var so=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!kn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let s=[],u=t.keyType._zod.values;if(u){r.value={};let p=new Set;for(let g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let h=t.valueType._zod.run({value:i[g],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(g,b.issues)),r.value[g]=b.value})):(h.issues.length&&r.issues.push(...Ie(g,h.issues)),r.value[g]=h.value)}let m;for(let g in i)p.has(g)||(m=m??[],m.push(g));m&&m.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:m})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let m=t.keyType._zod.run({value:p,issues:[]},n);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&vr.test(p)&&m.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(m=b)}if(m.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:m.issues.map(b=>Te(b,n,ge())),input:p,path:[p],inst:e});continue}let h=t.valueType._zod.run({value:i[p],issues:[]},n);h instanceof Promise?s.push(h.then(b=>{b.issues.length&&r.issues.push(...Ie(p,b.issues)),r.value[m.value]=b.value})):(h.issues.length&&r.issues.push(...Ie(p,h.issues)),r.value[m.value]=h.value)}}return s.length?Promise.all(s).then(()=>r):r}});var uo=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=gr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>wn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{let u=i.value;return n.has(u)||i.issues.push({code:"invalid_value",values:r,input:u,inst:e}),i}}),co=T("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}});var po=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new $t(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(u=>(r.value=u,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Kn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Kn,"handleOptionalResult");var lo=T("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(s=>Kn(s,r.value)):Kn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var mo=T("$ZodNullable",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${wt(r.source)}|null)$`):void 0}),J(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 fo=T("$ZodPipe",(e,t)=>{W.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(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(u=>Nt(u,t.in,n)):Nt(s,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(s=>Nt(s,t.out,n)):Nt(i,t.out,n)}});function Nt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Nt,"handlePipeResult");var go=T("$ZodCustom",(e,t)=>{Ee.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(s=>Jn(s,r,n,e));Jn(i,r,n,e)}});function Jn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(hr(i))}}o(Jn,"handleRefineResult");var ho;var Tr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function vo(){return new Tr}o(vo,"registry");(ho=globalThis).__zod_globalRegistry??(ho.__zod_globalRegistry=vo());var Er=globalThis.__zod_globalRegistry;function xo(e,t){return new e({type:"string",...Z(t)})}o(xo,"_string");function _o(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(_o,"_coercedString");function Po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(Po,"_url");function bo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(bo,"_number");function Io(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(Io,"_coercedNumber");function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(To,"_int");function Eo(e,t){return new e({type:"boolean",...Z(t)})}o(Eo,"_boolean");function So(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(So,"_coercedBoolean");function Ao(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(Ao,"_coercedBigint");function $o(e){return new e({type:"any"})}o($o,"_any");function zo(e){return new e({type:"unknown"})}o(zo,"_unknown");function ko(e,t){return new e({type:"void",...Z(t)})}o(ko,"_void");function wo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(wo,"_coercedDate");function Mt(e,t){return new Fn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Mt,"_gte");function ue(e,t){return new Vn({check:"min_length",...Z(t),minimum:e})}o(ue,"_minLength");function Se(e,t){return new Zn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Se,"_regex");function Oo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Oo,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Rt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>Dt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Ot(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Lt=T("ZodMiniString",(e,t)=>{Ut.init(e,t),X.init(e,t)});function a(e){return xo(Lt,e)}o(a,"string");var Ro=T("ZodMiniStringFormat",(e,t)=>{_r.init(e,t),Lt.init(e,t)});var Xu=T("ZodMiniURL",(e,t)=>{Xn.init(e,t),Ro.init(e,t)});function Do(e){return Po(Xu,e)}o(Do,"url");var Ft=T("ZodMiniNumber",(e,t)=>{Pr.init(e,t),X.init(e,t)});function ee(e){return bo(Ft,e)}o(ee,"number");var Yu=T("ZodMiniNumberFormat",(e,t)=>{Yn.init(e,t),Ft.init(e,t)});function No(e){return To(Yu,e)}o(No,"int");var Sr=T("ZodMiniBoolean",(e,t)=>{br.init(e,t),X.init(e,t)});function V(e){return Eo(Sr,e)}o(V,"boolean");var Co=T("ZodMiniBigInt",(e,t)=>{Qn.init(e,t),X.init(e,t)});var Qu=T("ZodMiniAny",(e,t)=>{eo.init(e,t),X.init(e,t)});function nt(){return $o(Qu)}o(nt,"any");var ec=T("ZodMiniUnknown",(e,t)=>{to.init(e,t),X.init(e,t)});function w(){return zo(ec)}o(w,"unknown");var tc=T("ZodMiniVoid",(e,t)=>{ro.init(e,t),X.init(e,t)});function Uo(e){return ko(tc,e)}o(Uo,"_void");var Mo=T("ZodMiniDate",(e,t)=>{no.init(e,t),X.init(e,t)});var rc=T("ZodMiniArray",(e,t)=>{oo.init(e,t),X.init(e,t)});function N(e,t){return new rc({type:"array",element:e,...Z(t)})}o(N,"array");var nc=T("ZodMiniObject",(e,t)=>{io.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new nc(r)}o(l,"object");var oc=T("ZodMiniUnion",(e,t)=>{Ir.init(e,t),X.init(e,t)});function C(e,t){return new oc({type:"union",options:e,...Z(t)})}o(C,"union");var ic=T("ZodMiniDiscriminatedUnion",(e,t)=>{ao.init(e,t),X.init(e,t)});function Ae(e,t,r){return new ic({type:"union",options:t,discriminator:e,...Z(r)})}o(Ae,"discriminatedUnion");var ac=T("ZodMiniRecord",(e,t)=>{so.init(e,t),X.init(e,t)});function O(e,t,r){return new ac({type:"record",keyType:e,valueType:t,...Z(r)})}o(O,"record");var sc=T("ZodMiniEnum",(e,t)=>{uo.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new sc({type:"enum",entries:r,...Z(t)})}o(M,"_enum");var uc=T("ZodMiniLiteral",(e,t)=>{co.init(e,t),X.init(e,t)});function A(e,t){return new uc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(A,"literal");var cc=T("ZodMiniTransform",(e,t)=>{po.init(e,t),X.init(e,t)});function $e(e){return new cc({type:"transform",transform:e})}o($e,"transform");var pc=T("ZodMiniOptional",(e,t)=>{lo.init(e,t),X.init(e,t)});function v(e){return new pc({type:"optional",innerType:e})}o(v,"optional");var lc=T("ZodMiniNullable",(e,t)=>{mo.init(e,t),X.init(e,t)});function ot(e){return new lc({type:"nullable",innerType:e})}o(ot,"nullable");var dc=T("ZodMiniPipe",(e,t)=>{fo.init(e,t),X.init(e,t)});function ze(e,t){return new dc({type:"pipe",in:e,out:t})}o(ze,"pipe");var mc=T("ZodMiniCustom",(e,t)=>{go.init(e,t),X.init(e,t)});function Bt(e,t){return Oo(mc,e??(()=>!0),t)}o(Bt,"custom");var it={};En(it,{bigint:()=>xc,boolean:()=>vc,date:()=>_c,number:()=>hc,string:()=>yc});function yc(e){return _o(Lt,e)}o(yc,"string");function hc(e){return Io(Ft,e)}o(hc,"number");function vc(e){return So(Sr,e)}o(vc,"boolean");function xc(e){return Ao(Co,e)}o(xc,"bigint");function _c(e){return wo(Mo,e)}o(_c,"date");var $r=l({retryOnFailure:l({defaultValue:v(V()),hide:v(V())}),continueOnFailure:l({defaultValue:v(V()),hide:v(V())})}),Ar=class{constructor(t,r,n,i,s,u,p,m,g,h,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=s;this.test=u;this.requireAuth=p;this.errorHandlingOptions=m;this.outputSchema=g;this.audience=h;this.aiMetadata=b}static{o(this,"IAction")}},ie=o(e=>new Ar(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var B=l({displayName:a(),description:v(a())}),U=o((e,t)=>l({type:A(t),required:V(),defaultValue:v(nt())}),"TPropertyValue");var ne=l({...B.shape,...U(a(),"SHORT_TEXT").shape}),ye=l({...B.shape,...U(a(),"LONG_TEXT").shape});var Lo=l({label:a(),value:w()}),Vt=l({disabled:v(V()),placeholder:v(a()),options:N(Lo)});var oe=l({...B.shape,options:Vt,...U(w(),"STATIC_DROPDOWN").shape}),he=l({...B.shape,options:Vt,...U(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var zr=l({...B.shape,...U(w(),"DROPDOWN").shape,refreshers:N(a())}),at=l({...B.shape,...U(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=l({...B.shape,...U(V(),"CHECKBOX").shape});var xe=l({...B.shape,...U(ee(),"NUMBER").shape});var st=l({...B.shape,streaming:v(V()),...U(w(),"FILE").shape});var ut=l({...B.shape,...U(a(),"DATE_TIME").shape});var Fo=O(a(),C([ne,ye,oe,at,he,ve,xe,st,ut])),ct=l({...B.shape,properties:Fo,...U(N(w()),"ARRAY").shape});var pt=l({...B.shape,...U(C([O(a(),w())]),"JSON").shape});var Bo=C([ne,oe,pt,ct,he]),bc=O(a(),Bo),kr=l({refreshers:N(a()),...B.shape,...U(w(),"DYNAMIC").shape});var Zt=l({...B.shape,...U(Uo(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Le=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Le||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),wr="both_client_credentials_and_authorization_code";var _e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(_e||{}),mt=(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))(mt||{}),Ic=l({strategy:M(mt),paramName:v(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Ht=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ht||{}),Vo=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),Zo=l({type:A("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(M(Ht))}),Ho=l({type:A("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:Vo,handlerId:v(a()),streamStepProgress:v(M(Ht))}),Tc=C([Zo,Ho]);var Ec=l({body:w(),rawBody:v(w()),headers:O(a(),a()),queryParams:O(a(),a())});function Y(e){return e==null}o(Y,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Wt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Wt,"assertNotNullOrUndefined");var Or=Ce(require("crypto"),1);var Sc=128,Oe,Fe,Ac=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*Sc),Or.default.randomFillSync(Oe),Fe=0):Fe+e>Oe.length&&(Or.default.randomFillSync(Oe),Fe=0),Fe+=e},"fillPool"),$c=o(e=>(Ac(e|=0),Oe.subarray(Fe-e,Fe)),"random"),zc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(s=t)=>{let u="";for(;;){let p=r(i),m=i;for(;m--;)if(u+=e[p[m]&n]||"",u.length===s)return u}}},"customRandom"),qo=o((e,t=21)=>zc(e,t,$c),"customAlphabet");var kc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,aI=a().check(Se(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),wc=qo(kc,Go);var ke=ze($e(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:ke,updated:ke},H=o(e=>v(ot(e)),"Nullable");function Rr(e){return v(ot(M(e)))}o(Rr,"NullableEnum");var cI=ze($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(V())),qt=o(e=>ze($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var dI=O(a(),w());var yt=(h=>(h.OPENAI="openai",h.OPENROUTER="openrouter",h.ANTHROPIC="anthropic",h.AZURE="azure",h.GOOGLE="google",h.ACTIVEPIECES="activepieces",h.CLOUDFLARE_GATEWAY="cloudflare-gateway",h.CUSTOM="custom",h.BEDROCK="bedrock",h.MISTRAL="mistral",h))(yt||{});var TI=a().check(Se(/^#[0-9A-Fa-f]{6}$/));var SI=l({filename:a(),data:w(),type:A("file"),mimetype:v(a())});var Oc=Ce(Jo());var RI=l({...ae,name:a(),permissions:N(a()),platformId:H(a()),type:a(),userCount:v(ee())});var Xo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Xo||{}),Dr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Dr||{}),Nr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Nr||{});var Cr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Cr||{});var Ur=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ur||{});var Rc=l({mode:M(Xo),value:w()}),Dc=l({auth:v(a()),fields:O(a(),Rc)}),Nc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(Dc)}),Cc=l({type:A("PIECE"),toolName:a().check(ue(1)),pieceMetadata:Nc}),Uc=l({type:A("none")}),Mc=l({type:A("access_token"),accessToken:a()}),jc=l({type:A("api_key"),apiKey:a(),apiKeyHeader:a()}),Lc=l({type:A("headers"),headers:O(a(),a())}),Fc=Ae("type",[Uc,Mc,jc,Lc]),Yo=l({type:A("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Qo=l({type:A("MCP"),toolName:a().check(ue(1)),serverUrl:Do(),protocol:M(Nr),auth:Fc}),ei=l({type:A("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:M(Dr),sourceId:a(),sourceName:a()}),Bc=Ae("type",[Cc,Yo,Qo,ei]),Vc=l({displayName:a(),description:v(a()),type:M(Cr)}),ti=l({type:A("MARKDOWN"),markdown:a()}),Be={type:A("TOOL_CALL"),input:H(O(a(),w())),output:v(w()),toolName:a(),status:M(Ur),toolCallId:a(),startTime:a(),endTime:v(a())},pT=l(Be),ri=Ae("toolCallType",[l({...Be,toolCallType:A("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:A("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:A("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:A("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:A("UNKNOWN"),displayName:a()})]),Zc=C([ti,ri]);var Mr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mr||{}),Pe=l({apiKey:a()}),Hc=Pe,Wc=l({apiKey:a(),apiKeyHash:a()}),qc=Pe,Gc=Pe,Kc=Pe,Jc=Pe,Xc=Pe,Yc=Pe,Qc=Pe,si=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),ep=l({}),tp=l({}),rp=l({}),np=l({}),op=l({}),ip=l({}),ui=l({modelId:a(),modelName:a(),modelType:M(Mr)}),ci=l({apiKeyHeader:a(),baseUrl:a(),models:N(ui),defaultHeaders:v(O(a(),a()))}),pi=l({accountId:a(),gatewayId:a(),models:N(ui),vertexProject:v(a()),vertexRegion:v(a())}),li=l({resourceName:a(),apiVersion:ze($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),di=l({region:a().check(ue(1))}),ap=C([Hc,Kc,Jc,Xc,Yc,Gc,qc,Wc,si,Qc]),mi=C([ci,pi,li,di,ep,rp,np,op,tp,ip]),sp=l({id:a(),name:a(),type:M(Mr)}),up=l({id:a(),name:a(),provider:M(yt),config:mi,enabledForChat:V()}),cp=l({provider:M(yt),config:mi,auth:ap,platformId:a()});var fT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},ni=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],pp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],lp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],oi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],dp=["grok-4.20","grok-4.1-fast"],mp={openai:ni,anthropic:pp,google:oi,activepieces:[...lp.map(e=>`anthropic/${e}`),...ni.map(e=>`openai/${e}`),...oi.map(e=>`google/${e}`),...dp.map(e=>`x-ai/${e}`)]};var ii=128e3,fp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function gp({provider:e}){return e?fp[e]??ii:ii}o(gp,"getMaxContextTokens");var ai={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"},yp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},hp=new Set(["anthropic","mistral"]);function le(e){return{chatModels:mp[e],maxContextTokens:gp({provider:e}),defaultEmbeddingModel:ai[e],supportsEmbedding:ai[e]!==void 0,supportsImageGeneration:!hp.has(e),webSearch:yp[e]}}o(le,"buildProviderCapabilities");var vp={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var xp=l({base64Url:a(),fileName:a(),extension:v(a())}),_p=l({mimeType:a(),url:a(),fileName:v(a())}),jr=C([xp,_p]);var Pp=C([l({type:A("file"),value:jr}),l({type:A("markdown"),value:a(),files:v(N(jr))})]),bp=l({sessionId:a(),message:a(),files:v(N(a()))});var gi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(gi||{}),yi=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(yi||{}),Lr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Lr||{});var Ip=C([l({...ae,name:a(),externalId:a(),type:A("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:C([A("TEXT"),A("NUMBER"),A("DATE")]),tableId:a(),projectId:a()})]),Tp=l({...ae,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:Rr(yi),trigger:Rr(gi)}),Ep=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:w(),fieldName:a()}))}),Sp=l({events:N(M(Lr)),webhookUrl:a(),flowId:a()}),Ap=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),$p=l({projectId:a(),limit:v(it.number()),cursor:v(a()),name:v(a()),externalIds:qt(a()),folderId:v(a()),folderIds:qt(a())}),zp=l({records:N(N(l({fieldId:a(),value:vi()}))),tableId:a()}),kp=l({cells:v(N(l({fieldId:a(),value:vi()}))),tableId:a(),agentUpdate:v(V())}),hi=Ae("operator",[Re("eq"),Re("neq"),Re("gt"),Re("gte"),Re("lt"),Re("lte"),Re("co"),fi("exists"),fi("not_exists")]),wp=l({tableId:a(),limit:v(it.number()),cursor:v(a()),filters:qt(hi)});function vi(){return ze($e(e=>e==null?e:String(e)),ot(a()))}o(vi,"coerceToString");function Re(e){return l({fieldId:a(),operator:A(e),value:a()})}o(Re,"valueFilter");function fi(e){return l({fieldId:a(),operator:A(e)})}o(fi,"existenceFilter");var Op=l({status:v(ee()),body:v(w()),headers:v(O(a(),a()))}),Rp=l({...ae,deleted:H(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var xi=l({name:a(),description:v(a()),type:a(),required:V()}),Dp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(xi),returnsResponse:V()})});var _i="^[0-9]+\\.[0-9]+\\.[0-9]+$",RT=new RegExp(_i),Cp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",DT=a().check(Se(new RegExp(_i))),NT=a().check(Se(new RegExp(Cp))),Up=l({packageType:A("ARCHIVE"),pieceType:M(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Pi=l({packageType:A("REGISTRY"),pieceType:A("OFFICIAL"),pieceName:a(),pieceVersion:a()}),bi=l({packageType:A("REGISTRY"),pieceType:A("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),CT=C([Pi,bi]),UT=C([Up,Pi,bi]);var Mp=Ae("type",[l({type:A("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:A("INTERVAL"),intervalMs:No().check(Mt(6e4))})]),MT=l({...ae,type:M(_e),projectId:a(),flowId:a(),triggerName:a(),schedule:H(Mp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:V()}),Ii=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(Ii||{}),Ti=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ti||{}),Ei=(r=>(r.S3="S3",r.DB="DB",r))(Ei||{}),jT=l({...ae,projectId:H(a()),platformId:H(a()),type:M(Ii),compression:M(Ti),data:v(w()),location:M(Ei),size:H(ee()),fileName:H(a()),s3Key:H(a()),metadata:H(O(a(),a()))}),Si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Si||{}),Ai=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ai||{}),LT=l({id:a(),email:a(),firstName:a(),status:M(Ai),externalId:H(a()),platformId:H(a()),platformRole:M(Si),lastName:a(),created:ke,updated:ke,lastActiveDate:H(ke),imageUrl:H(a())});var Fr=l({...B.shape,...U(O(a(),w()),"OBJECT").shape});var wi=l({...B.shape,...U(a(),"COLOR").shape});var Br=C([ne,ye,Zt,ve,oe,he,zr,at,kr,xe,ct,Fr,pt,ut,st,wi]),D={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 de=l({displayName:a(),description:v(a())});var Oi=l({username:a(),password:a()}),Vr=l({...de.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...U(Oi,"BASIC_AUTH").shape});var Bp=O(a(),C([ne,ye,xe,ve,oe])),Zr=l({...de.shape,props:Bp,...U(w(),"CUSTOM_AUTH").shape});var De=l({...de.shape,...U(l({auth:a()}),"SECRET_TEXT").shape});var Vp=O(a(),C([ne,ye,De,xe,ve,oe,he,Zt])),Ri=l({...de.shape,props:Vp,...U(w(),"OIDC").shape});var Hr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Hr||{}),Di=C([ne,De,oe]),Ni=O(a(),Di),Zp=l({props:v(O(a(),Di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(C([A("none"),A("consent"),A("login"),A("omit")])),pkce:v(V()),pkceMethod:v(C([A("plain"),A("S256")])),authorizationMethod:v(M(Hr)),grantType:v(C([M(dt),A(wr)])),extra:v(O(a(),a()))}),Ci=l({access_token:a(),props:v(Ni),data:O(a(),nt())}),Wr=l({...de.shape,...Zp.shape,...U(Ci,"OAUTH2").shape});var Ve=C([Vr,Zr,Ri,Wr,De]),ht="Connection",Kt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var vS={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 Hp=l({...B.shape,...U(w(),"CUSTOM").shape,code:a()});var Wp=C([Br,Ve]),qr=O(a(),Wp),MS=O(a(),Br);var Ui=C([l({strategy:A("CRON"),cronExpression:a()}),l({strategy:A("NONE")})]),Ze=class{constructor(t,r,n,i,s,u,p,m,g,h,b,_,c,d,y,f,x,P,L){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=s;this.type=u;this.handshakeConfiguration=p;this.onHandshake=m;this.renewConfiguration=g;this.onRenew=h;this.onEnable=b;this.onDisable=_;this.onStart=c;this.run=d;this.test=y;this.sampleData=f;this.testStrategy=x;this.outputSchema=P;this.aiMetadata=L}static{o(this,"ITrigger")}},Jt=o(e=>{switch(e.type){case"WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ze(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Y(e.sampleData)&&Y(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Mi="2",Xt="0.82.0";var Gr=class{constructor(t,r,n,i,s,u,p,m,g=Xt,h,b="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=m;this.minimumSupportedRelease=g;this.maximumSupportedRelease=h;this.description=b;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Mi}),"getContextInfo");(!qp(g)||Gp(g,Xt))&&(this.minimumSupportedRelease=Xt),s.forEach(c=>this._actions[c.name]=c),u.forEach(c=>this._triggers[c.name]=c)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},ji=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(s=>s.type===r.type)))throw new Error("Auth properties must be unique by type");return new Gr(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 qp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(qp,"isValidSimpleSemver");function Gp(e,t){let[r,n,i]=e.split(".").map(Number),[s,u,p]=t.split(".").map(Number);return r!==s?r<s:n!==u?n<u:i<p}o(Gp,"isSemverLessThan");var Kp=v(O(a(),O(a(),a()))),Li=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(C([Ve,N(Ve)])),version:a(),categories:v(N(M(Le))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),deprecated:v(V()),i18n:Kp}),Jp=M(["human","ai","both"]),Fi=l({description:v(a()),idempotent:v(V())}),Bi=l({name:a(),displayName:a(),description:a(),props:qr,requireAuth:V(),errorHandlingOptions:v($r),outputSchema:v(Bt()),audience:v(Jp),aiMetadata:v(Fi)}),Vi=l({name:a(),displayName:a(),description:a(),props:qr,errorHandlingOptions:v($r),type:M(_e),sampleData:w(),handshakeConfiguration:v(Bt()),renewConfiguration:v(Ui),testStrategy:M(ft),outputSchema:v(Bt()),aiMetadata:v(Fi)}),Xp=l({...Li.shape,actions:O(a(),Bi),triggers:O(a(),Vi)}),Yp=l({...Li.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(Bi)),suggestedTriggers:v(N(Vi))}),Zi=l({projectUsage:ee(),pieceType:M(je),packageType:M(lt),platformId:v(a()),archiveId:v(a())}),MA=l({...Xp.shape,...Zi.shape}),jA=l({...Yp.shape,...Zi.shape}),LA=l({name:a(),version:a()});var Qp=Ce(require("path")),el=Ce(require("fs/promises"));var Gi=require("node:stream");var Yt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((s,u)=>{i.append(u,s)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Kr,r=new Jr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Kr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Jr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var vt=class extends Error{constructor(r,n){let i=n.status||500,s=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:s},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=s}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Hi({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Hi,"toFailsafeOutput");var xt=(u=>(u.GET="GET",u.POST="POST",u.PATCH="PATCH",u.PUT="PUT",u.DELETE="DELETE",u.HEAD="HEAD",u))(xt||{});var er=class extends Yt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Qt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),s=this.getHeaders(t),u=t.queryParams??{};for(let[L,re]of Object.entries(u))i.append(L,re);let p=i.toString(),m=p?`${n}?${p}`:n,g=t.responseType??"json",h=t.followRedirects??!0,b=t.retries??0,{body:_,extraHeaders:c,isStream:d}=tl(t.method)?rl(t.body,s):{body:void 0,extraHeaders:{},isStream:!1},y=ol({...s,...c}),f=await nl(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:y,body:_,redirect:h?"follow":"manual",signal:L.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(m,se)}finally{re!==void 0&&clearTimeout(re)}},b),x=h?300:400;if(f.status<200||f.status>=x){let L=await Wi(f,g),re=new vt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Wi(f,g);return{status:f.status,headers:il(f.headers),body:P}}};function tl(e){return e!=="GET"&&e!=="HEAD"}o(tl,"acceptsRequestBody");function rl(e,t){if(sl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(al(e)){let n=new Gi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(rl,"serializeBody");async function Wi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Wi,"parseResponseBody");async function nl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await qi(n);continue}return i}catch(i){if(r=i,n<t){await qi(n);continue}throw i}throw r}o(nl,"sendWithRetries");function qi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(qi,"backoff");function ol(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(ol,"normalizeHeaders");function il(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(il,"toHttpHeaders");function al(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(al,"isNodeFormData");function sl(e){return e==null}o(sl,"isNil");var _t=new er;var Gd=Ce(require("fs")),eu=Ce(Qs());var Kd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Jd(e){let t=e.split(";")[0].trim().toLowerCase();return Kd[t]??""}o(Jd,"contentTypeToExtension");var Xd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Yd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function tu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:s,props:u,extraProps:p,authLocation:m="headers"}){return ie({audience:"human",name:s||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:D.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:D.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Yd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...u?.url??{}})}),"props")}),method:D.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(xt).map(g=>({label:g,value:g}))},...u?.method??{}}),headers:D.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...u?.headers??{}}),queryParams:D.Object({displayName:"Query Parameters",required:!0,...u?.queryParams??{}}),body_type:D.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:D.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let h=g,b={};switch(h){case"none":break;case"json":b.data=D.Json({displayName:"JSON Body",required:!0,...u?.body??{}});break;case"raw":b.data=D.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=D.Array({displayName:"Form Data",required:!0,properties:{fieldName:D.ShortText({displayName:"Field Name",required:!0}),fieldType:D.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:D.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:D.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:D.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:D.Checkbox({displayName:"No Error on Failure",required:!1,...u?.failsafe??{}}),timeout:D.Number({displayName:"Timeout (in seconds)",required:!1,...u?.timeout??{}}),followRedirects:D.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:h,url:b,headers:_,queryParams:c,body:d,body_type:y,failsafe:f,timeout:x,response_is_binary:P,followRedirects:L}=g.propsValue;Wt(h,"Method"),Wt(b,"URL");let re=Y(r)?{}:await r(g.auth,g.propsValue),se=b.url,Je=se.startsWith("http://")||se.startsWith("https://")?se:Xd({baseUrl:t(g.auth),relativePath:se}),be={method:h,url:Je,headers:{..._??{},...m==="headers"||!Y(m)?re:{}},queryParams:{...m==="queryParams"?re:{},...c??{}},timeout:x?x*1e3:0,followRedirects:L};if(P&&(be.responseType="arraybuffer"),d)if(y&&y!=="none"){let fe=d.data;if(y==="form_data"){let _u=fe,At=new eu.default;for(let{fieldName:bn,fieldType:In,textFieldValue:Tn,fileFieldValue:dr}of _u)In==="text"&&!gt(Tn)?At.append(bn,Tn):In==="file"&&!gt(dr)&&At.append(bn,dr.data,{filename:dr?.filename});be.body=At,be.headers={...be.headers,...At.getHeaders()}}else be.body=fe}else y||(be.body=d);try{let fe=await _t.sendRequest(be);return await Qd(g.files,fe.body,fe.status,fe.headers,P)}catch(fe){if(f)return Hi({error:fe,requestBody:be.body});throw fe}},"run")})}o(tu,"createCustomApiCallAction");var Qd=o(async(e,t,r,n,i)=>{let s;if(i&&em(t)){let u=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Jd(u??"")||"txt",m;t instanceof ArrayBuffer?m=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?m=t:m=Buffer.from(t),s=await e.write({fileName:`output.${p}`,data:m})}else s=t;return{status:r,headers:n,body:s}},"handleBinaryResponse"),em=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Tt={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:s,server:u}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Y(p))throw new Error("lastPoll doesn't exist in the store.");let m=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:u}),g=m.reduce((h,b)=>Math.max(h,b.epochMilliSeconds),p);return await t.put("lastPoll",g),m.filter(h=>h.epochMilliSeconds>p).map(h=>h.data)}case 1:{let p=await t.get("lastItem"),m=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:s,server:u}),g=m.findIndex(_=>_.id===p),h=[];Y(p)||g==-1?h=m??[]:h=m?.slice(0,g)??[],Y(i)||(h=h.slice(-i));let b=h?.[0]?.id;return Y(b)||await t.put("lastItem",b),h.map(_=>_.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let u=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Y(u)?await t.delete("lastItem"):await t.put("lastItem",u);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:s}){let u=[];switch(e.strategy){case 0:{u=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:s});break}case 1:{u=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:s});break}}return tm(u.map(p=>p.data))}};function tm(e){return e.length<=5?e:e.slice(0,5)}o(tm,"getFirstFiveOrAll");function rm(e){return e}o(rm,"asAzureAuth");function Et(e,t){if(typeof e!="string"||e.length===0)throw new Error(`Expected non-empty string for "${t}", got ${typeof e}`);return e}o(Et,"narrowString");function ru(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ru,"isRecord");function nm(){let e=new Uint8Array(32);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}o(nm,"generateWebhookToken");function om(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e.charCodeAt(n)^t.charCodeAt(n);return r===0}o(om,"timingSafeEqual");function St(e){if(typeof e=="object"&&e!==null){let t=e,r=t.response?.status??t.status;if(typeof r=="number")return` (HTTP ${r})`}return""}o(St,"extractHttpStatus");function im(e){if(!ru(e))return null;let{eventType:t,resource:r}=e;return typeof t!="string"||!ru(r)||t!=="workitem.created"&&t!=="workitem.updated"&&t!=="workitem.commented"?null:{eventType:t,resource:r}}o(im,"parseWebhookPayload");var am=`To get your Personal Access Token (PAT):
4
4
 
5
5
  1. Go to **Azure DevOps** and click your profile icon (top-right)
6
6
  2. Select **Personal access tokens**
@@ -11,7 +11,7 @@ i.e ${wd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.u
11
11
  - **Project and Team**: Read
12
12
  6. Click **Create** and copy the token (you won't see it again)
13
13
 
14
- **Organization URL** is your Azure DevOps URL, e.g. \`https://dev.azure.com/mycompany\``,K=Wt.CustomAuth({description:jd,required:!0,props:{organizationUrl:D.ShortText({displayName:"Organization URL",description:"Your Azure DevOps organization URL (e.g. https://dev.azure.com/mycompany)",required:!0}),pat:Wt.SecretText({displayName:"Personal Access Token",description:"Your Azure DevOps PAT with Work Items (Read & Write) and Project and Team (Read) scopes.",required:!0})},validate:o(async({auth:e})=>{if(!Ks(e.organizationUrl))return{valid:!1,error:"Organization URL must be a valid HTTP/HTTPS URL"};let t=gn(e.organizationUrl),r=Buffer.from(`:${e.pat}`).toString("base64");try{return(await ht.sendRequest({method:"GET",url:`${t}/_apis/projects`,headers:{Authorization:`Basic ${r}`},queryParams:{"api-version":"7.1"}})).body.value!==void 0?{valid:!0}:{valid:!1,error:"Invalid PAT or Organization URL"}}catch{return{valid:!1,error:"Invalid PAT or Organization URL"}}},"validate")});async function de({organizationUrl:e,pat:t,method:r,endpoint:n,body:i,queryParams:s,isJsonPatch:c=!1}){let p=gn(e),m=Buffer.from(`:${t}`).toString("base64"),g={};if(s)for(let[x,u]of Object.entries(s))u!=null&&(g[x]=u);let h={Authorization:`Basic ${m}`};return i!==void 0&&(h["Content-Type"]=c?"application/json-patch+json":"application/json"),(await ht.sendRequest({method:r,url:`${p}${n}`,headers:h,queryParams:g,body:i})).body}o(de,"azureDevOpsApiCall");async function Ld(e){return de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:"/_apis/projects",queryParams:{"api-version":"7.1"}})}o(Ld,"fetchProjects");async function Fd(e,t){return de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes`,queryParams:{"api-version":"7.1"}})}o(Fd,"fetchWorkItemTypes");function Hs(e){let t=e.fields;return{id:e.id,rev:e.rev,url:e.url??null,title:t["System.Title"]??null,work_item_type:t["System.WorkItemType"]??null,state:t["System.State"]??null,reason:t["System.Reason"]??null,assigned_to:t["System.AssignedTo"]?.displayName??null,assigned_to_email:t["System.AssignedTo"]?.uniqueName??null,created_date:t["System.CreatedDate"]??null,created_by:t["System.CreatedBy"]?.displayName??null,changed_date:t["System.ChangedDate"]??null,changed_by:t["System.ChangedBy"]?.displayName??null,area_path:t["System.AreaPath"]??null,iteration_path:t["System.IterationPath"]??null,priority:t["Microsoft.VSTS.Common.Priority"]??null,description:t["System.Description"]??null,project:t["System.TeamProject"]??null}}o(Hs,"flattenWorkItem");async function Bd({organizationUrl:e,pat:t,ids:r}){if(r.length===0)return[];let n=[],i=200;for(let s=0;s<r.length;s+=i){let c=r.slice(s,s+i),p=await de({organizationUrl:e,pat:t,method:"GET",endpoint:"/_apis/wit/workitems",queryParams:{ids:c.join(","),$expand:"all","api-version":"7.1"}});p.value&&n.push(...p.value.map(Hs))}return n}o(Bd,"fetchWorkItemsByIds");async function Vd({auth:e,projectId:t,eventType:r,webhookUrl:n,workItemType:i,basicAuthUsername:s,basicAuthPassword:c}){let p={projectId:t};i&&(p.workItemType=i);let m={url:n,resourceDetailsToSend:"all",messagesToSend:"none",detailedMessagesToSend:"none"};return s!==void 0&&(m.basicAuthUsername=s),c!==void 0&&(m.basicAuthPassword=c),de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"POST",endpoint:"/_apis/hooks/subscriptions",queryParams:{"api-version":"7.1"},body:{publisherId:"tfs",eventType:r,resourceVersion:"1.0",consumerId:"webHooks",consumerActionId:"httpRequest",publisherInputs:p,consumerInputs:m}})}o(Vd,"createSubscription");async function Zd({auth:e,subscriptionId:t}){await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"DELETE",endpoint:`/_apis/hooks/subscriptions/${t}`,queryParams:{"api-version":"7.1"}})}o(Zd,"deleteSubscription");async function Wd(e,t){return(await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}`,queryParams:{"api-version":"7.1"}})).id??null}o(Wd,"fetchProjectId");var Hd=25,Vs=5;async function qs(e,t){let n=(await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams`,queryParams:{"api-version":"7.1",$top:String(Hd)}})).value??[],i=new Map;for(let s=0;s<n.length;s+=Vs){let c=n.slice(s,s+Vs),p=await Promise.all(c.map(m=>de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams/${m.id}/members`,queryParams:{"api-version":"7.1",$top:"200"}})));for(let m of p)for(let g of m.value??[]){let h=g.identity;h?.id&&!i.has(h.id)&&i.set(h.id,h)}}return Array.from(i.values())}o(qs,"fetchTeamMembers");async function Gs(e,t,r){return(await de({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes/${encodeURIComponent(r)}`,queryParams:{"api-version":"7.1"}})).states??[]}o(Gs,"fetchWorkItemTypeStates");function qd(e){return D.Dropdown({displayName:"Assigned To",description:"Select the person to assign this work item to. Only project team members are listed \u2014 use the Custom API Call action if you need to assign a user outside your teams.",refreshers:["project"],required:e,auth:K,options:o(async({auth:t,project:r})=>{if(!t)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!r)return{disabled:!0,options:[],placeholder:"Please select a project first"};let n=t;try{let i=await qs(n,It(r,"project"));return i.length===0?{disabled:!1,options:[],placeholder:"No team members found in this project."}:{disabled:!1,options:i.map(s=>({label:s.uniqueName?`${s.displayName} (${s.uniqueName})`:s.displayName,value:s.uniqueName??s.displayName}))}}catch(i){return{disabled:!0,options:[],placeholder:`Load failed${Tt(i)}. Check PAT.`}}},"options")})}o(qd,"createAssignedToDropdown");function Zs(e,t){return D.Dropdown({displayName:"State",description:t,refreshers:["project","work_item_type"],required:e,auth:K,options:o(async({auth:r,project:n,work_item_type:i})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};if(!i)return{disabled:!0,options:[],placeholder:"Please select a work item type first"};let s=r;try{let c=await Gs(s,It(n,"project"),It(i,"work_item_type"));return c.length===0?{disabled:!1,options:[],placeholder:"No states defined for this work item type."}:{disabled:!1,options:c.map(p=>({label:p.category?`${p.name} (${p.category})`:p.name,value:p.name}))}}catch(c){return{disabled:!0,options:[],placeholder:`Load failed${Tt(c)}. Check PAT.`}}},"options")})}o(Zs,"createStateDropdown");function Ws(e,t){return D.Dropdown({displayName:"Work Item Type",description:t,refreshers:["project"],required:e,auth:K,options:o(async({auth:r,project:n})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};let i=r;try{let s=await Fd(i,It(n,"project"));return!s.value||s.value.length===0?{disabled:!1,options:[],placeholder:"No work item types found."}:{disabled:!1,options:s.value.map(c=>({label:c.name,value:c.name}))}}catch(s){return{disabled:!0,options:[],placeholder:`Load failed${Tt(s)}. Check PAT.`}}},"options")})}o(Ws,"createWorkItemTypeDropdown");var I={projectDropdown:D.Dropdown({displayName:"Project",description:"Select the Azure DevOps project",refreshers:[],required:!0,auth:K,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};let t=e;try{let r=await Ld(t);return!r.value||r.value.length===0?{disabled:!1,options:[],placeholder:"No projects found. Create one in Azure DevOps first."}:{disabled:!1,options:r.value.map(n=>({label:n.name,value:n.name}))}}catch(r){return{disabled:!0,options:[],placeholder:`Load failed${Tt(r)}. Check PAT.`}}},"options")}),workItemTypeDropdown:Ws(!0,"Select the type of work item (e.g. Bug, Task, User Story)"),workItemTypeDropdownOptional:Ws(!1,"Filter by work item type. Leave empty to trigger for all types."),assignedToDropdown:qd(!1),stateDropdown:Zs(!1,"New state for the work item. Leave empty to keep the current state."),stateDropdownOptional:Zs(!1,"Filter by state. Leave empty to trigger for all states."),priorityDropdown:D.StaticDropdown({displayName:"Priority",description:"The priority of the work item",required:!1,options:{options:[{label:"1 - Critical",value:"1"},{label:"2 - High",value:"2"},{label:"3 - Medium",value:"3"},{label:"4 - Low",value:"4"}]}}),escapeWiqlString:Gd,sanitizeOrgUrl:gn,isValidUrl:Ks,asAuth:Nd,narrowString:It,parseWebhookPayload:Md,generateWebhookToken:Cd,timingSafeEqual:Ud,extractHttpStatus:Tt,apiCall:de,fetchWorkItemsByIds:Bd,flattenWorkItem:Hs,fetchProjectId:Wd,fetchTeamMembers:qs,fetchWorkItemTypeStates:Gs,createSubscription:Vd,deleteSubscription:Zd};function gn(e){return e.replace(/\/+$/,"")}o(gn,"sanitizeOrgUrl");function Gd(e){return e.replace(/'/g,"''")}o(Gd,"escapeWiqlString");function Ks(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}o(Ks,"isValidUrl");var yn=[{label:"Work Item Created",value:"workitem.created"},{label:"Work Item Updated",value:"workitem.updated"},{label:"Work Item Commented",value:"workitem.commented"}];var Js=ie({auth:K,name:"create_work_item",displayName:"Create Work Item",description:"Creates a new work item (Bug, Task, User Story, etc.) in Azure DevOps",audience:"both",aiMetadata:{description:"Creates a new work item of the chosen type (Bug, Task, User Story, etc.) in an Azure DevOps project, optionally setting description, assignee, and priority. Use to file a new tracked item. Requires a project and work item type; not idempotent, as each call creates a separate item with a new ID.",idempotent:!1},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdown,title:D.ShortText({displayName:"Title",description:"The title of the work item",required:!0}),description:D.LongText({displayName:"Description",description:"Detailed description of the work item (supports HTML)",required:!1}),assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_type:r,title:n,description:i,assigned_to:s,priority:c}=e.propsValue,p=e.auth,m=I.sanitizeOrgUrl(p.props.organizationUrl),g=[{op:"add",path:"/fields/System.Title",value:n}];i&&g.push({op:"add",path:"/fields/System.Description",value:i}),s&&g.push({op:"add",path:"/fields/System.AssignedTo",value:s}),c&&g.push({op:"add",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(c)});let h=await I.apiCall({organizationUrl:m,pat:p.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/$${encodeURIComponent(I.narrowString(r,"work_item_type"))}`,queryParams:{"api-version":"7.1"},body:g,isJsonPatch:!0});return I.flattenWorkItem(h)}});var Xs=ie({auth:K,name:"get_work_item",displayName:"Get Work Item",description:"Retrieves a work item by ID from Azure DevOps",audience:"both",aiMetadata:{description:"Fetches a single Azure DevOps work item by its numeric ID, returning its fields (title, state, assignee, etc.). Use to look up details of a known work item; requires the project and the numeric work item ID, not a title. Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0})},async run(e){let{project:t,work_item_id:r}=e.propsValue,n=e.auth,i=I.sanitizeOrgUrl(n.props.organizationUrl),s=await I.apiCall({organizationUrl:i,pat:n.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(s)}});var Ys=ie({auth:K,name:"update_work_item",displayName:"Update Work Item",description:"Updates an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Updates fields (title, description, state, assignee, priority) on an existing Azure DevOps work item identified by its numeric ID; only the fields you provide are changed. Use to modify a known work item rather than to look it up or create one. Requires the project and numeric work item ID; the work item type prop only loads the matching state list and does not change the item type. Idempotent, since it replaces fields to a fixed target value keyed on a stable ID.",idempotent:!0},props:{project:I.projectDropdown,work_item_type:{...I.workItemTypeDropdown,description:"Type of the work item. Used only to load the matching list of states below \u2014 it does not change the work item's type. Changing type requires a separate Azure DevOps operation not supported here."},work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically from a previous step, use a reference like `{{trigger.id}}` or the output of a Get/List step \u2014 not the title.",required:!0}),title:D.ShortText({displayName:"Title",description:"New title for the work item",required:!1}),description:D.LongText({displayName:"Description",description:"New description for the work item (supports HTML)",required:!1}),state:I.stateDropdown,assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_id:r,title:n,description:i,state:s,assigned_to:c,priority:p}=e.propsValue,m=e.auth,g=I.sanitizeOrgUrl(m.props.organizationUrl),h=encodeURIComponent(t),b=[];if(sr(n)&&b.push({op:"replace",path:"/fields/System.Title",value:n}),sr(i)&&b.push({op:"replace",path:"/fields/System.Description",value:i}),sr(s)&&b.push({op:"replace",path:"/fields/System.State",value:s}),sr(c)&&b.push({op:"replace",path:"/fields/System.AssignedTo",value:c}),p!=null&&b.push({op:"replace",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(p)}),b.length===0){let u=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"GET",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(u)}let x=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"PATCH",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{"api-version":"7.1"},body:b,isJsonPatch:!0});return I.flattenWorkItem(x)}});function sr(e){return typeof e=="string"&&e.length>0}o(sr,"isNonEmptyString");var Kd="SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] <> '' ORDER BY [System.ChangedDate] DESC",Qs=ie({auth:K,name:"list_work_items",displayName:"List Work Items",description:"Lists work items from Azure DevOps using a WIQL query",audience:"both",aiMetadata:{description:"Queries work items in an Azure DevOps project and returns their fields. Leave the WIQL query empty to list all work items ordered by most recently changed, or supply a custom WIQL query to filter (by type, state, assignee, etc.). Use to search or enumerate work items; requires a project, and results are capped by the limit (default 50, max 200). Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,wiql_query:D.LongText({displayName:"WIQL Query",description:"The WIQL query to execute. Default: SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC",required:!1}),limit:D.Number({displayName:"Limit",description:"Maximum number of work items to return (default: 50, max: 200)",required:!1,defaultValue:50})},async run(e){let{project:t,wiql_query:r,limit:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),c=r||Kd,p=Math.max(1,Math.min(n??50,200)),m=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/wiql`,queryParams:{$top:`${p}`,"api-version":"7.1"},body:{query:c}});if(!m.workItems||m.workItems.length===0)return[];let g=m.workItems.map(b=>b.id);return await I.fetchWorkItemsByIds({organizationUrl:s,pat:i.props.pat,ids:g})}});var eu=ie({auth:K,name:"add_comment",displayName:"Add Comment",description:"Adds a comment to an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Posts a new comment (HTML supported) on an existing Azure DevOps work item identified by its numeric ID. Use to add a note or update to a known work item. Requires the project, numeric work item ID, and comment text; not idempotent, as each call appends a separate comment.",idempotent:!1},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0}),comment:D.LongText({displayName:"Comment",description:"The comment text to add (supports HTML)",required:!0})},async run(e){let{project:t,work_item_id:r,comment:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),c=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workItems/${r}/comments`,queryParams:{"api-version":"7.1-preview.4"},body:{text:n}});return{id:c.id,work_item_id:c.workItemId,text:c.text??null,created_by:c.createdBy?.displayName??null,created_by_email:c.createdBy?.uniqueName??null,created_date:c.createdDate??null,modified_by:c.modifiedBy?.displayName??null,modified_date:c.modifiedDate??null}}});var Jd={project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,state_filter:I.stateDropdownOptional},Xd=14,ur={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let n=I.sanitizeOrgUrl(e.props.organizationUrl),{project:i,work_item_type:s,state_filter:c}=t,p=I.narrowString(i,"project"),m=r&&r>0?r+1:Date.now()-Xd*24*60*60*1e3,g=new Date(m).toISOString().slice(0,10),b=`SELECT [System.Id], [System.ChangedDate] FROM WorkItems WHERE [System.TeamProject] = '${I.escapeWiqlString(p)}' AND [System.ChangedDate] >= '${g}'`;if(s){let y=I.escapeWiqlString(I.narrowString(s,"work_item_type"));b+=` AND [System.WorkItemType] = '${y}'`}if(c){let y=I.escapeWiqlString(I.narrowString(c,"state_filter"));b+=` AND [System.State] = '${y}'`}b+=" ORDER BY [System.ChangedDate] DESC";let x=await I.apiCall({organizationUrl:n,pat:e.props.pat,method:"POST",endpoint:`/${encodeURIComponent(p)}/_apis/wit/wiql`,queryParams:{$top:"200","api-version":"7.1"},body:{query:b}});if(!x.workItems||x.workItems.length===0)return[];let u=x.workItems.map(y=>y.id);return(await I.fetchWorkItemsByIds({organizationUrl:n,pat:e.props.pat,ids:u})).map(y=>({epochMilliSeconds:y.changed_date?new Date(y.changed_date).getTime():Date.now(),data:y}))},"items")},Yd={id:123,rev:1,url:"https://dev.azure.com/myorg/myproject/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},tu=Ht({auth:K,name:"new_updated_work_item",displayName:"New or Updated Work Item (Polling)",description:"Polls Azure DevOps every few minutes and fires when a work item is created or updated. Use this when your Activepieces instance is not reachable from the public internet; otherwise prefer the Instant trigger. Pick a work item type to unlock the state filter.",aiMetadata:{description:"Fires for each Azure DevOps work item created or changed since the last poll in the chosen project, discovered by periodic polling rather than instantly. Optionally narrow to a single work item type and, once a type is set, to a specific state. Prefer the Instant trigger when the Activepieces instance is publicly reachable."},props:Jd,sampleData:Yd,type:"POLLING",async test(e){return await bt.test(ur,e)},async onEnable(e){await bt.onEnable(ur,e)},async onDisable(e){await bt.onDisable(ur,e)},async run(e){return await bt.poll(ur,e)}});var hn="azure_devops_workitem_subscription_ids",vn="azure_devops_workitem_webhook_token",ru="activepieces",nu={id:123,rev:2,url:"https://dev.azure.com/myorg/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},ou=Ht({auth:K,name:"new_updated_work_item_webhook",displayName:"New or Updated Work Item (Instant)",description:"Fires instantly when a work item is created, updated, or commented on in Azure DevOps via a Service Hooks subscription. Requires a public webhook URL reachable from Azure DevOps.",aiMetadata:{description:"Fires in real time via an Azure DevOps Service Hooks subscription when a work item in the chosen project is created, updated, or commented on, depending on which of those event types are selected. Optionally scope to a single work item type. Requires a publicly reachable webhook URL; use the Polling trigger instead when the instance is not internet-reachable."},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,events:D.StaticMultiSelectDropdown({displayName:"Events",description:"Which work item lifecycle events should trigger this flow. Select at least one.",required:!0,defaultValue:["workitem.created","workitem.updated"],options:{options:[...yn]}})},sampleData:nu,type:"WEBHOOK",async onEnable(e){let t=I.narrowString(e.propsValue.project,"project"),r=typeof e.propsValue.work_item_type=="string"&&e.propsValue.work_item_type.length>0?e.propsValue.work_item_type:void 0,n=rm(e.propsValue.events??[]),i=await I.fetchProjectId(e.auth,t);if(!i)throw new Error(`Project "${t}" not found in Azure DevOps.`);let s=I.generateWebhookToken();await e.store.put(vn,s);let c=[];for(let p of n){let m=await I.createSubscription({auth:e.auth,projectId:i,eventType:p,webhookUrl:e.webhookUrl,workItemType:r,basicAuthUsername:ru,basicAuthPassword:s});c.push(m.id),await e.store.put(hn,c)}},async onDisable(e){let t=await e.store.get(hn)??[];for(let r of t)try{await I.deleteSubscription({auth:e.auth,subscriptionId:r})}catch{}await e.store.delete(hn),await e.store.delete(vn)},async run(e){let t=await e.store.get(vn);if(!t)return[];let r=em(e.payload.headers);if(!r||!tm(r,ru,t))return[];let n=I.parseWebhookPayload(e.payload.body);return n?n.eventType==="workitem.commented"?[Qd(n)]:[iu(n.resource)]:[]},async test(){return[nu]}});function iu(e){return I.flattenWorkItem({id:e.id??e.workItemId??0,rev:e.rev??0,url:e.url,fields:e.revision?.fields??e.fields??{}})}o(iu,"flattenResource");function Qd(e){let{resource:t}=e;return{...iu(t),comment:t.revision?.comment?.content??null}}o(Qd,"flattenCommentEvent");function em(e){let t=e.authorization??e.Authorization;return typeof t=="string"?t:null}o(em,"extractAuthHeader");function tm(e,t,r){let n="Basic ";if(!e.startsWith(n))return!1;let i;try{i=Buffer.from(e.slice(n.length),"base64").toString("utf-8")}catch{return!1}let s=i.indexOf(":");if(s<0)return!1;let c=i.slice(0,s),p=i.slice(s+1);return I.timingSafeEqual(c,t)&&I.timingSafeEqual(p,r)}o(tm,"verifyBasicAuth");function rm(e){let t=yn.map(r=>r.value);return e.filter(r=>typeof r=="string"&&t.includes(r))}o(rm,"filterToHookEvents");var nm=$i({displayName:"Azure DevOps",description:"Track work, code, and ship software with Azure Boards, Repos, and Pipelines.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/azure-devops.png",categories:["DEVELOPER_TOOLS"],auth:K,authors:["majewskibartosz"],actions:[Js,Xs,Ys,Qs,eu,Fs({baseUrl:o(e=>I.sanitizeOrgUrl(I.asAuth(e).props.organizationUrl),"baseUrl"),auth:K,authMapping:o(async e=>({Authorization:`Basic ${Buffer.from(`:${I.asAuth(e).props.pat}`).toString("base64")}`}),"authMapping")})],triggers:[ou,tu]});0&&(module.exports={azureDevOps});
14
+ **Organization URL** is your Azure DevOps URL, e.g. \`https://dev.azure.com/mycompany\``,K=Kt.CustomAuth({description:am,required:!0,props:{organizationUrl:D.ShortText({displayName:"Organization URL",description:"Your Azure DevOps organization URL (e.g. https://dev.azure.com/mycompany)",required:!0}),pat:Kt.SecretText({displayName:"Personal Access Token",description:"Your Azure DevOps PAT with Work Items (Read & Write) and Project and Team (Read) scopes.",required:!0})},validate:o(async({auth:e})=>{if(!cu(e.organizationUrl))return{valid:!1,error:"Organization URL must be a valid HTTP/HTTPS URL"};let t=vn(e.organizationUrl),r=Buffer.from(`:${e.pat}`).toString("base64");try{return(await _t.sendRequest({method:"GET",url:`${t}/_apis/projects`,headers:{Authorization:`Basic ${r}`},queryParams:{"api-version":"7.1"}})).body.value!==void 0?{valid:!0}:{valid:!1,error:"Invalid PAT or Organization URL"}}catch{return{valid:!1,error:"Invalid PAT or Organization URL"}}},"validate")});async function me({organizationUrl:e,pat:t,method:r,endpoint:n,body:i,queryParams:s,isJsonPatch:u=!1}){let p=vn(e),m=Buffer.from(`:${t}`).toString("base64"),g={};if(s)for(let[_,c]of Object.entries(s))c!=null&&(g[_]=c);let h={Authorization:`Basic ${m}`};return i!==void 0&&(h["Content-Type"]=u?"application/json-patch+json":"application/json"),(await _t.sendRequest({method:r,url:`${p}${n}`,headers:h,queryParams:g,body:i})).body}o(me,"azureDevOpsApiCall");async function sm(e){return me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:"/_apis/projects",queryParams:{"api-version":"7.1"}})}o(sm,"fetchProjects");async function um(e,t){return me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes`,queryParams:{"api-version":"7.1"}})}o(um,"fetchWorkItemTypes");function au(e){let t=e.fields;return{id:e.id,rev:e.rev,url:e.url??null,title:t["System.Title"]??null,work_item_type:t["System.WorkItemType"]??null,state:t["System.State"]??null,reason:t["System.Reason"]??null,assigned_to:t["System.AssignedTo"]?.displayName??null,assigned_to_email:t["System.AssignedTo"]?.uniqueName??null,created_date:t["System.CreatedDate"]??null,created_by:t["System.CreatedBy"]?.displayName??null,changed_date:t["System.ChangedDate"]??null,changed_by:t["System.ChangedBy"]?.displayName??null,area_path:t["System.AreaPath"]??null,iteration_path:t["System.IterationPath"]??null,priority:t["Microsoft.VSTS.Common.Priority"]??null,description:t["System.Description"]??null,project:t["System.TeamProject"]??null}}o(au,"flattenWorkItem");async function cm({organizationUrl:e,pat:t,ids:r}){if(r.length===0)return[];let n=[],i=200;for(let s=0;s<r.length;s+=i){let u=r.slice(s,s+i),p=await me({organizationUrl:e,pat:t,method:"GET",endpoint:"/_apis/wit/workitems",queryParams:{ids:u.join(","),$expand:"all","api-version":"7.1"}});p.value&&n.push(...p.value.map(au))}return n}o(cm,"fetchWorkItemsByIds");async function pm({auth:e,projectId:t,eventType:r,webhookUrl:n,workItemType:i,basicAuthUsername:s,basicAuthPassword:u}){let p={projectId:t};i&&(p.workItemType=i);let m={url:n,resourceDetailsToSend:"all",messagesToSend:"none",detailedMessagesToSend:"none"};return s!==void 0&&(m.basicAuthUsername=s),u!==void 0&&(m.basicAuthPassword=u),me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"POST",endpoint:"/_apis/hooks/subscriptions",queryParams:{"api-version":"7.1"},body:{publisherId:"tfs",eventType:r,resourceVersion:"1.0",consumerId:"webHooks",consumerActionId:"httpRequest",publisherInputs:p,consumerInputs:m}})}o(pm,"createSubscription");async function lm({auth:e,subscriptionId:t}){await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"DELETE",endpoint:`/_apis/hooks/subscriptions/${t}`,queryParams:{"api-version":"7.1"}})}o(lm,"deleteSubscription");async function dm(e,t){return(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}`,queryParams:{"api-version":"7.1"}})).id??null}o(dm,"fetchProjectId");var mm=25,nu=5;async function su(e,t){let n=(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams`,queryParams:{"api-version":"7.1",$top:String(mm)}})).value??[],i=new Map;for(let s=0;s<n.length;s+=nu){let u=n.slice(s,s+nu),p=await Promise.all(u.map(m=>me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/_apis/projects/${encodeURIComponent(t)}/teams/${m.id}/members`,queryParams:{"api-version":"7.1",$top:"200"}})));for(let m of p)for(let g of m.value??[]){let h=g.identity;h?.id&&!i.has(h.id)&&i.set(h.id,h)}}return Array.from(i.values())}o(su,"fetchTeamMembers");async function uu(e,t,r){return(await me({organizationUrl:e.props.organizationUrl,pat:e.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitemtypes/${encodeURIComponent(r)}`,queryParams:{"api-version":"7.1"}})).states??[]}o(uu,"fetchWorkItemTypeStates");function fm(e){return D.Dropdown({displayName:"Assigned To",description:"Select the person to assign this work item to. Only project team members are listed \u2014 use the Custom API Call action if you need to assign a user outside your teams.",refreshers:["project"],required:e,auth:K,options:o(async({auth:t,project:r})=>{if(!t)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!r)return{disabled:!0,options:[],placeholder:"Please select a project first"};let n=t;try{let i=await su(n,Et(r,"project"));return i.length===0?{disabled:!1,options:[],placeholder:"No team members found in this project."}:{disabled:!1,options:i.map(s=>({label:s.uniqueName?`${s.displayName} (${s.uniqueName})`:s.displayName,value:s.uniqueName??s.displayName}))}}catch(i){return{disabled:!0,options:[],placeholder:`Load failed${St(i)}. Check PAT.`}}},"options")})}o(fm,"createAssignedToDropdown");function ou(e,t){return D.Dropdown({displayName:"State",description:t,refreshers:["project","work_item_type"],required:e,auth:K,options:o(async({auth:r,project:n,work_item_type:i})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};if(!i)return{disabled:!0,options:[],placeholder:"Please select a work item type first"};let s=r;try{let u=await uu(s,Et(n,"project"),Et(i,"work_item_type"));return u.length===0?{disabled:!1,options:[],placeholder:"No states defined for this work item type."}:{disabled:!1,options:u.map(p=>({label:p.category?`${p.name} (${p.category})`:p.name,value:p.name}))}}catch(u){return{disabled:!0,options:[],placeholder:`Load failed${St(u)}. Check PAT.`}}},"options")})}o(ou,"createStateDropdown");function iu(e,t){return D.Dropdown({displayName:"Work Item Type",description:t,refreshers:["project"],required:e,auth:K,options:o(async({auth:r,project:n})=>{if(!r)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};if(!n)return{disabled:!0,options:[],placeholder:"Please select a project first"};let i=r;try{let s=await um(i,Et(n,"project"));return!s.value||s.value.length===0?{disabled:!1,options:[],placeholder:"No work item types found."}:{disabled:!1,options:s.value.map(u=>({label:u.name,value:u.name}))}}catch(s){return{disabled:!0,options:[],placeholder:`Load failed${St(s)}. Check PAT.`}}},"options")})}o(iu,"createWorkItemTypeDropdown");var I={projectDropdown:D.Dropdown({displayName:"Project",description:"Select the Azure DevOps project",refreshers:[],required:!0,auth:K,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your Azure DevOps account first"};let t=e;try{let r=await sm(t);return!r.value||r.value.length===0?{disabled:!1,options:[],placeholder:"No projects found. Create one in Azure DevOps first."}:{disabled:!1,options:r.value.map(n=>({label:n.name,value:n.name}))}}catch(r){return{disabled:!0,options:[],placeholder:`Load failed${St(r)}. Check PAT.`}}},"options")}),workItemTypeDropdown:iu(!0,"Select the type of work item (e.g. Bug, Task, User Story)"),workItemTypeDropdownOptional:iu(!1,"Filter by work item type. Leave empty to trigger for all types."),assignedToDropdown:fm(!1),stateDropdown:ou(!1,"New state for the work item. Leave empty to keep the current state."),stateDropdownOptional:ou(!1,"Filter by state. Leave empty to trigger for all states."),priorityDropdown:D.StaticDropdown({displayName:"Priority",description:"The priority of the work item",required:!1,options:{options:[{label:"1 - Critical",value:"1"},{label:"2 - High",value:"2"},{label:"3 - Medium",value:"3"},{label:"4 - Low",value:"4"}]}}),escapeWiqlString:gm,sanitizeOrgUrl:vn,isValidUrl:cu,asAuth:rm,narrowString:Et,parseWebhookPayload:im,generateWebhookToken:nm,timingSafeEqual:om,extractHttpStatus:St,apiCall:me,fetchWorkItemsByIds:cm,flattenWorkItem:au,fetchProjectId:dm,fetchTeamMembers:su,fetchWorkItemTypeStates:uu,createSubscription:pm,deleteSubscription:lm};function vn(e){return e.replace(/\/+$/,"")}o(vn,"sanitizeOrgUrl");function gm(e){return e.replace(/'/g,"''")}o(gm,"escapeWiqlString");function cu(e){try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}o(cu,"isValidUrl");var xn=[{label:"Work Item Created",value:"workitem.created"},{label:"Work Item Updated",value:"workitem.updated"},{label:"Work Item Commented",value:"workitem.commented"}];var pu=ie({auth:K,name:"create_work_item",displayName:"Create Work Item",description:"Creates a new work item (Bug, Task, User Story, etc.) in Azure DevOps",audience:"both",aiMetadata:{description:"Creates a new work item of the chosen type (Bug, Task, User Story, etc.) in an Azure DevOps project, optionally setting description, assignee, and priority. Use to file a new tracked item. Requires a project and work item type; not idempotent, as each call creates a separate item with a new ID.",idempotent:!1},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdown,title:D.ShortText({displayName:"Title",description:"The title of the work item",required:!0}),description:D.LongText({displayName:"Description",description:"Detailed description of the work item (supports HTML)",required:!1}),assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_type:r,title:n,description:i,assigned_to:s,priority:u}=e.propsValue,p=e.auth,m=I.sanitizeOrgUrl(p.props.organizationUrl),g=[{op:"add",path:"/fields/System.Title",value:n}];i&&g.push({op:"add",path:"/fields/System.Description",value:i}),s&&g.push({op:"add",path:"/fields/System.AssignedTo",value:s}),u&&g.push({op:"add",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(u)});let h=await I.apiCall({organizationUrl:m,pat:p.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/$${encodeURIComponent(I.narrowString(r,"work_item_type"))}`,queryParams:{"api-version":"7.1"},body:g,isJsonPatch:!0});return I.flattenWorkItem(h)}});var lu=ie({auth:K,name:"get_work_item",displayName:"Get Work Item",description:"Retrieves a work item by ID from Azure DevOps",audience:"both",aiMetadata:{description:"Fetches a single Azure DevOps work item by its numeric ID, returning its fields (title, state, assignee, etc.). Use to look up details of a known work item; requires the project and the numeric work item ID, not a title. Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0})},async run(e){let{project:t,work_item_id:r}=e.propsValue,n=e.auth,i=I.sanitizeOrgUrl(n.props.organizationUrl),s=await I.apiCall({organizationUrl:i,pat:n.props.pat,method:"GET",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(s)}});var du=ie({auth:K,name:"update_work_item",displayName:"Update Work Item",description:"Updates an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Updates fields (title, description, state, assignee, priority) on an existing Azure DevOps work item identified by its numeric ID; only the fields you provide are changed. Use to modify a known work item rather than to look it up or create one. Requires the project and numeric work item ID; the work item type prop only loads the matching state list and does not change the item type. Idempotent, since it replaces fields to a fixed target value keyed on a stable ID.",idempotent:!0},props:{project:I.projectDropdown,work_item_type:{...I.workItemTypeDropdown,description:"Type of the work item. Used only to load the matching list of states below \u2014 it does not change the work item's type. Changing type requires a separate Azure DevOps operation not supported here."},work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically from a previous step, use a reference like `{{trigger.id}}` or the output of a Get/List step \u2014 not the title.",required:!0}),title:D.ShortText({displayName:"Title",description:"New title for the work item",required:!1}),description:D.LongText({displayName:"Description",description:"New description for the work item (supports HTML)",required:!1}),state:I.stateDropdown,assigned_to:I.assignedToDropdown,priority:I.priorityDropdown},async run(e){let{project:t,work_item_id:r,title:n,description:i,state:s,assigned_to:u,priority:p}=e.propsValue,m=e.auth,g=I.sanitizeOrgUrl(m.props.organizationUrl),h=encodeURIComponent(t),b=[];if(pr(n)&&b.push({op:"replace",path:"/fields/System.Title",value:n}),pr(i)&&b.push({op:"replace",path:"/fields/System.Description",value:i}),pr(s)&&b.push({op:"replace",path:"/fields/System.State",value:s}),pr(u)&&b.push({op:"replace",path:"/fields/System.AssignedTo",value:u}),p!=null&&b.push({op:"replace",path:"/fields/Microsoft.VSTS.Common.Priority",value:Number(p)}),b.length===0){let c=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"GET",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{$expand:"all","api-version":"7.1"}});return I.flattenWorkItem(c)}let _=await I.apiCall({organizationUrl:g,pat:m.props.pat,method:"PATCH",endpoint:`/${h}/_apis/wit/workitems/${r}`,queryParams:{"api-version":"7.1"},body:b,isJsonPatch:!0});return I.flattenWorkItem(_)}});function pr(e){return typeof e=="string"&&e.length>0}o(pr,"isNonEmptyString");var ym="SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.WorkItemType] <> '' ORDER BY [System.ChangedDate] DESC",mu=ie({auth:K,name:"list_work_items",displayName:"List Work Items",description:"Lists work items from Azure DevOps using a WIQL query",audience:"both",aiMetadata:{description:"Queries work items in an Azure DevOps project and returns their fields. Leave the WIQL query empty to list all work items ordered by most recently changed, or supply a custom WIQL query to filter (by type, state, assignee, etc.). Use to search or enumerate work items; requires a project, and results are capped by the limit (default 50, max 200). Read-only and idempotent.",idempotent:!0},props:{project:I.projectDropdown,wiql_query:D.LongText({displayName:"WIQL Query",description:"The WIQL query to execute. Default: SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project ORDER BY [System.ChangedDate] DESC",required:!1}),limit:D.Number({displayName:"Limit",description:"Maximum number of work items to return (default: 50, max: 200)",required:!1,defaultValue:50})},async run(e){let{project:t,wiql_query:r,limit:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),u=r||ym,p=Math.max(1,Math.min(n??50,200)),m=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/wiql`,queryParams:{$top:`${p}`,"api-version":"7.1"},body:{query:u}});if(!m.workItems||m.workItems.length===0)return[];let g=m.workItems.map(b=>b.id);return await I.fetchWorkItemsByIds({organizationUrl:s,pat:i.props.pat,ids:g})}});var fu=ie({auth:K,name:"add_comment",displayName:"Add Comment",description:"Adds a comment to an existing work item in Azure DevOps",audience:"both",aiMetadata:{description:"Posts a new comment (HTML supported) on an existing Azure DevOps work item identified by its numeric ID. Use to add a note or update to a known work item. Requires the project, numeric work item ID, and comment text; not idempotent, as each call appends a separate comment.",idempotent:!1},props:{project:I.projectDropdown,work_item_id:D.Number({displayName:"Work Item ID",description:"Numeric ID of the work item (e.g. 123). To pass it dynamically, reference the ID from a previous step (e.g. `{{trigger.id}}`), not the title.",required:!0}),comment:D.LongText({displayName:"Comment",description:"The comment text to add (supports HTML)",required:!0})},async run(e){let{project:t,work_item_id:r,comment:n}=e.propsValue,i=e.auth,s=I.sanitizeOrgUrl(i.props.organizationUrl),u=await I.apiCall({organizationUrl:s,pat:i.props.pat,method:"POST",endpoint:`/${encodeURIComponent(t)}/_apis/wit/workItems/${r}/comments`,queryParams:{"api-version":"7.1-preview.4"},body:{text:n}});return{id:u.id,work_item_id:u.workItemId,text:u.text??null,created_by:u.createdBy?.displayName??null,created_by_email:u.createdBy?.uniqueName??null,created_date:u.createdDate??null,modified_by:u.modifiedBy?.displayName??null,modified_date:u.modifiedDate??null}}});var hm={project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,state_filter:I.stateDropdownOptional},vm=14,lr={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let n=I.sanitizeOrgUrl(e.props.organizationUrl),{project:i,work_item_type:s,state_filter:u}=t,p=I.narrowString(i,"project"),m=r&&r>0?r+1:Date.now()-vm*24*60*60*1e3,g=new Date(m).toISOString().slice(0,10),b=`SELECT [System.Id], [System.ChangedDate] FROM WorkItems WHERE [System.TeamProject] = '${I.escapeWiqlString(p)}' AND [System.ChangedDate] >= '${g}'`;if(s){let y=I.escapeWiqlString(I.narrowString(s,"work_item_type"));b+=` AND [System.WorkItemType] = '${y}'`}if(u){let y=I.escapeWiqlString(I.narrowString(u,"state_filter"));b+=` AND [System.State] = '${y}'`}b+=" ORDER BY [System.ChangedDate] DESC";let _=await I.apiCall({organizationUrl:n,pat:e.props.pat,method:"POST",endpoint:`/${encodeURIComponent(p)}/_apis/wit/wiql`,queryParams:{$top:"200","api-version":"7.1"},body:{query:b}});if(!_.workItems||_.workItems.length===0)return[];let c=_.workItems.map(y=>y.id);return(await I.fetchWorkItemsByIds({organizationUrl:n,pat:e.props.pat,ids:c})).map(y=>({epochMilliSeconds:y.changed_date?new Date(y.changed_date).getTime():Date.now(),data:y}))},"items")},xm={id:123,rev:1,url:"https://dev.azure.com/myorg/myproject/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},gu=Jt({auth:K,name:"new_updated_work_item",displayName:"New or Updated Work Item (Polling)",description:"Polls Azure DevOps every few minutes and fires when a work item is created or updated. Use this when your Activepieces instance is not reachable from the public internet; otherwise prefer the Instant trigger. Pick a work item type to unlock the state filter.",aiMetadata:{description:"Fires for each Azure DevOps work item created or changed since the last poll in the chosen project, discovered by periodic polling rather than instantly. Optionally narrow to a single work item type and, once a type is set, to a specific state. Prefer the Instant trigger when the Activepieces instance is publicly reachable."},props:hm,sampleData:xm,type:"POLLING",async test(e){return await Tt.test(lr,e)},async onEnable(e){await Tt.onEnable(lr,e)},async onDisable(e){await Tt.onDisable(lr,e)},async run(e){return await Tt.poll(lr,e)}});var _n="azure_devops_workitem_subscription_ids",Pn="azure_devops_workitem_webhook_token",yu="activepieces",hu={id:123,rev:2,url:"https://dev.azure.com/myorg/_apis/wit/workItems/123",title:"Fix login page bug",work_item_type:"Bug",state:"Active",reason:"New",assigned_to:"John Doe",assigned_to_email:"john.doe@example.com",created_date:"2024-03-15T10:30:00Z",created_by:"Jane Smith",changed_date:"2024-03-15T14:45:00Z",changed_by:"John Doe",area_path:"MyProject\\Backend",iteration_path:"MyProject\\Sprint 5",priority:2,description:"<p>Users cannot log in after password reset.</p>",project:"MyProject"},vu=Jt({auth:K,name:"new_updated_work_item_webhook",displayName:"New or Updated Work Item (Instant)",description:"Fires instantly when a work item is created, updated, or commented on in Azure DevOps via a Service Hooks subscription. Requires a public webhook URL reachable from Azure DevOps.",aiMetadata:{description:"Fires in real time via an Azure DevOps Service Hooks subscription when a work item in the chosen project is created, updated, or commented on, depending on which of those event types are selected. Optionally scope to a single work item type. Requires a publicly reachable webhook URL; use the Polling trigger instead when the instance is not internet-reachable."},props:{project:I.projectDropdown,work_item_type:I.workItemTypeDropdownOptional,events:D.StaticMultiSelectDropdown({displayName:"Events",description:"Which work item lifecycle events should trigger this flow. Select at least one.",required:!0,defaultValue:["workitem.created","workitem.updated"],options:{options:[...xn]}})},sampleData:hu,type:"WEBHOOK",async onEnable(e){let t=I.narrowString(e.propsValue.project,"project"),r=typeof e.propsValue.work_item_type=="string"&&e.propsValue.work_item_type.length>0?e.propsValue.work_item_type:void 0,n=Im(e.propsValue.events??[]),i=await I.fetchProjectId(e.auth,t);if(!i)throw new Error(`Project "${t}" not found in Azure DevOps.`);let s=I.generateWebhookToken();await e.store.put(Pn,s);let u=[];for(let p of n){let m=await I.createSubscription({auth:e.auth,projectId:i,eventType:p,webhookUrl:e.webhookUrl,workItemType:r,basicAuthUsername:yu,basicAuthPassword:s});u.push(m.id),await e.store.put(_n,u)}},async onDisable(e){let t=await e.store.get(_n)??[];for(let r of t)try{await I.deleteSubscription({auth:e.auth,subscriptionId:r})}catch{}await e.store.delete(_n),await e.store.delete(Pn)},async run(e){let t=await e.store.get(Pn);if(!t)return[];let r=Pm(e.payload.headers);if(!r||!bm(r,yu,t))return[];let n=I.parseWebhookPayload(e.payload.body);return n?n.eventType==="workitem.commented"?[_m(n)]:[xu(n.resource)]:[]},async test(){return[hu]}});function xu(e){return I.flattenWorkItem({id:e.id??e.workItemId??0,rev:e.rev??0,url:e.url,fields:e.revision?.fields??e.fields??{}})}o(xu,"flattenResource");function _m(e){let{resource:t}=e;return{...xu(t),comment:t.revision?.comment?.content??null}}o(_m,"flattenCommentEvent");function Pm(e){let t=e.authorization??e.Authorization;return typeof t=="string"?t:null}o(Pm,"extractAuthHeader");function bm(e,t,r){let n="Basic ";if(!e.startsWith(n))return!1;let i;try{i=Buffer.from(e.slice(n.length),"base64").toString("utf-8")}catch{return!1}let s=i.indexOf(":");if(s<0)return!1;let u=i.slice(0,s),p=i.slice(s+1);return I.timingSafeEqual(u,t)&&I.timingSafeEqual(p,r)}o(bm,"verifyBasicAuth");function Im(e){let t=xn.map(r=>r.value);return e.filter(r=>typeof r=="string"&&t.includes(r))}o(Im,"filterToHookEvents");var Tm=ji({displayName:"Azure DevOps",description:"Track work, code, and ship software with Azure Boards, Repos, and Pipelines.",minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/azure-devops.png",categories:["DEVELOPER_TOOLS"],auth:K,authors:["majewskibartosz"],actions:[pu,lu,du,mu,fu,tu({baseUrl:o(e=>I.sanitizeOrgUrl(I.asAuth(e).props.organizationUrl),"baseUrl"),auth:K,authMapping:o(async e=>({Authorization:`Basic ${Buffer.from(`:${I.asAuth(e).props.pat}`).toString("base64")}`}),"authMapping")})],triggers:[vu,gu]});0&&(module.exports={azureDevOps});
15
15
  /*! Bundled license information:
16
16
 
17
17
  mime-types/index.js: