@activepieces/piece-bigcommerce 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";var bu=Object.create;var Xe=Object.defineProperty;var Tu=Object.getOwnPropertyDescriptor;var Iu=Object.getOwnPropertyNames;var Eu=Object.getPrototypeOf,Su=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),An=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},zn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Iu(t))!Su.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=Tu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?bu(Eu(e)):{},zn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),$u=e=>zn(Xe({},"__esModule",{value:!0}),e);var Wo=$((qo,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,x=(s.match(l.zoneIndex)||[])[0],b,F;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(F=d-g,b=":";F--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let ie=s.split(":"),ce=[];for(let Je=0;Je<ie.length;Je++)ce.push(parseInt(ie[Je],16));return ce}(),{parts:d,zoneId:x}}o(y,"expandIPv6");function v(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,b;for(;m>0;){if(b=g-m,b<0&&(b=0),s[x]>>b!==d[x]>>b)return!1;m-=g,x+=1}return!0}o(v,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function A(s,d){for(;s.length<d;)s=`0${s}`;return s}o(A,"padPart");let _={};_.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,b,F;for(x=3;x>=0;x-=1)if(b=this.octets[x],b in m){if(F=m[b],g&&F!==0)return null;F!==8&&(g=!0),d+=F}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<4;)x.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,g,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],g=0;g<4;)x.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return function(){let x=d.slice(1,6),b=[];for(let F=0;F<x.length;F++)g=x[F],b.push(P(g));return b}();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],b;for(b=0;b<=24;b+=8)x.push(m>>b&255);return x}().reverse()}else return(d=s.match(r.twoOctet))?function(){let x=d.slice(1,4),b=[];if(m=P(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b}():(d=s.match(r.threeOctet))?function(){let x=d.slice(1,5),b=[];if(m=P(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(P(x[1])),b.push(m>>8&255),b.push(m&255),b}():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=function(){function s(d,g){let m,x;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,b;for(let F=7;F>=0;F-=1)if(x=this.parts[F],x in m){if(b=m[x],g&&b!==0)return null;b!==16&&(g=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(A(this.parts[x].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,x=-1,b;for(;b=d.exec(g);)b[0].length>x&&(m=b.index,x=b[0].length);return x<0?g:`${g.substring(0,m)}::${g.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<16;)x.push(parseInt(g[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,g,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],g=0;g<16;)x.push(parseInt(m[g],10)&parseInt(b[g],10)),g++;return new this(x)}catch(F){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${F})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,g,m,x,b,F;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return y(s,8);if((m=s.match(l.transitional))&&(F=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=y(d+F,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<b.length;g++)if(x=b[g],!(0<=x&&x<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,g){let m,x,b,F;g==null&&(g="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(b=d[x],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(F=b[m],s.kind()===F[0].kind()&&s.match.apply(s,F))return x}return g},typeof Ft<"u"&&Ft.exports?Ft.exports=_:e.ipaddr=_})(qo)});var Vi=$((KA,Bi)=>{var Fi=require("stream").Stream,rl=require("util");Bi.exports=de;function de(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(de,"DelayedStream");rl.inherits(de,Fi);de.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(de.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});de.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};de.prototype.resume=function(){this._released||this.release(),this.source.resume()};de.prototype.pause=function(){this.source.pause()};de.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};de.prototype.pipe=function(){var e=Fi.prototype.pipe.apply(this,arguments);return this.resume(),e};de.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)};de.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 Wi=$((XA,qi)=>{var nl=require("util"),Hi=require("stream").Stream,Zi=Vi();qi.exports=X;function X(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(X,"CombinedStream");nl.inherits(X,Hi);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof Zi)){var r=Zi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return Hi.prototype.pipe.call(this,e,t),this.resume(),e};X.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};X.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ki=$((QA,Gi)=>{"use strict";Gi.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 Yi=$(ne=>{"use strict";var Kt=Ki(),ol=require("path").extname,Ji=/^\s*([^;\s]*)(?:;|\s|$)/,il=/^text\//i;ne.charset=Xi;ne.charsets={lookup:Xi};ne.contentType=al;ne.extension=sl;ne.extensions=Object.create(null);ne.lookup=ul;ne.types=Object.create(null);cl(ne.extensions,ne.types);function Xi(e){if(!e||typeof e!="string")return!1;var t=Ji.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&il.test(t[1])?"UTF-8":!1}o(Xi,"charset");function al(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ne.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ne.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(al,"contentType");function sl(e){if(!e||typeof e!="string")return!1;var t=Ji.exec(e),r=t&&ne.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(sl,"extension");function ul(e){if(!e||typeof e!="string")return!1;var t=ol("x."+e).toLowerCase().substr(1);return t&&ne.types[t]||!1}o(ul,"lookup");function cl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(o(function(i){var u=Kt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var y=c[l];if(t[y]){var v=r.indexOf(Kt[t[y]].source),P=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(v>P||v===P&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(cl,"populateMaps")});var ea=$((rz,Qi)=>{Qi.exports=pl;function pl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(pl,"defer")});var Wr=$((oz,ra)=>{var ta=ea();ra.exports=ll;function ll(e){var t=!1;return ta(function(){t=!0}),o(function(n,i){t?e(n,i):ta(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(ll,"async")});var Gr=$((az,na)=>{na.exports=dl;function dl(e){Object.keys(e.jobs).forEach(ml.bind(e)),e.jobs={}}o(dl,"abort");function ml(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(ml,"clean")});var Kr=$((uz,ia)=>{var oa=Wr(),fl=Gr();ia.exports=gl;function gl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=yl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?fl(r):r.results[i]=c,n(u,r.results))})}o(gl,"iterate");function yl(e,t,r,n){var i;return e.length==2?i=e(r,oa(n)):i=e(r,t,oa(n)),i}o(yl,"runJob")});var Jr=$((pz,aa)=>{aa.exports=hl;function hl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(hl,"state")});var Xr=$((dz,sa)=>{var vl=Gr(),xl=Wr();sa.exports=_l;function _l(e){Object.keys(this.jobs).length&&(this.index=this.size,vl(this),xl(e)(null,this.results))}o(_l,"terminator")});var ca=$((fz,ua)=>{var Pl=Kr(),bl=Jr(),Tl=Xr();ua.exports=Il;function Il(e,t,r){for(var n=bl(e);n.index<(n.keyedList||e).length;)Pl(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Tl.bind(n,r)}o(Il,"parallel")});var Yr=$((yz,Jt)=>{var pa=Kr(),El=Jr(),Sl=Xr();Jt.exports=$l;Jt.exports.ascending=la;Jt.exports.descending=Al;function $l(e,t,r,n){var i=El(e,r);return pa(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){pa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Sl.bind(i,n)}o($l,"serialOrdered");function la(e,t){return e<t?-1:e>t?1:0}o(la,"ascending");function Al(e,t){return-1*la(e,t)}o(Al,"descending")});var ma=$((vz,da)=>{var zl=Yr();da.exports=wl;function wl(e,t,r){return zl(e,t,null,r)}o(wl,"serial")});var ga=$((_z,fa)=>{fa.exports={parallel:ca(),serial:ma(),serialOrdered:Yr()}});var Qr=$((Pz,ya)=>{"use strict";ya.exports=Object});var va=$((bz,ha)=>{"use strict";ha.exports=Error});var _a=$((Tz,xa)=>{"use strict";xa.exports=EvalError});var ba=$((Iz,Pa)=>{"use strict";Pa.exports=RangeError});var Ia=$((Ez,Ta)=>{"use strict";Ta.exports=ReferenceError});var Sa=$((Sz,Ea)=>{"use strict";Ea.exports=SyntaxError});var Xt=$(($z,$a)=>{"use strict";$a.exports=TypeError});var za=$((Az,Aa)=>{"use strict";Aa.exports=URIError});var ka=$((zz,wa)=>{"use strict";wa.exports=Math.abs});var Na=$((wz,Oa)=>{"use strict";Oa.exports=Math.floor});var Ca=$((kz,Ra)=>{"use strict";Ra.exports=Math.max});var Ua=$((Oz,Da)=>{"use strict";Da.exports=Math.min});var ja=$((Nz,Ma)=>{"use strict";Ma.exports=Math.pow});var Fa=$((Rz,La)=>{"use strict";La.exports=Math.round});var Va=$((Cz,Ba)=>{"use strict";Ba.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ha=$((Uz,Za)=>{"use strict";var kl=Va();Za.exports=o(function(t){return kl(t)||t===0?t:t<0?-1:1},"sign")});var Wa=$((jz,qa)=>{"use strict";qa.exports=Object.getOwnPropertyDescriptor});var en=$((Lz,Ga)=>{"use strict";var Yt=Wa();if(Yt)try{Yt([],"length")}catch{Yt=null}Ga.exports=Yt});var Ja=$((Fz,Ka)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Ka.exports=Qt});var tn=$((Bz,Xa)=>{"use strict";Xa.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var es=$((Zz,Qa)=>{"use strict";var Ya=typeof Symbol<"u"&&Symbol,Ol=tn();Qa.exports=o(function(){return typeof Ya!="function"||typeof Symbol!="function"||typeof Ya("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ol()},"hasNativeSymbols")});var rn=$((qz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=$((Wz,rs)=>{"use strict";var Nl=Qr();rs.exports=Nl.getPrototypeOf||null});var is=$((Gz,os)=>{"use strict";var Rl="Function.prototype.bind called on incompatible ",Cl=Object.prototype.toString,Dl=Math.max,Ul="[object Function]",ns=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Ml=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),jl=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");os.exports=o(function(t){var r=this;if(typeof r!="function"||Cl.apply(r)!==Ul)throw new TypeError(Rl+r);for(var n=Ml(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,ns(n,arguments));return Object(P)===P?P:this}return r.apply(t,ns(n,arguments))},"binder"),c=Dl(0,r.length-n.length),l=[],y=0;y<c;y++)l[y]="$"+y;if(i=Function("binder","return function ("+jl(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var v=o(function(){},"Empty");v.prototype=r.prototype,i.prototype=new v,v.prototype=null}return i},"bind")});var He=$((Jz,as)=>{"use strict";var Ll=is();as.exports=Function.prototype.bind||Ll});var er=$((Xz,ss)=>{"use strict";ss.exports=Function.prototype.call});var on=$((Yz,us)=>{"use strict";us.exports=Function.prototype.apply});var ps=$((Qz,cs)=>{"use strict";cs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ds=$((ew,ls)=>{"use strict";var Fl=He(),Bl=on(),Vl=er(),Zl=ps();ls.exports=Zl||Fl.call(Vl,Bl)});var fs=$((tw,ms)=>{"use strict";var Hl=He(),ql=Xt(),Wl=er(),Gl=ds();ms.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ql("a function is required");return Gl(Hl,Wl,t)},"callBindBasic")});var _s=$((nw,xs)=>{"use strict";var Kl=fs(),gs=en(),hs;try{hs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!hs&&gs&&gs(Object.prototype,"__proto__"),vs=Object,ys=vs.getPrototypeOf;xs.exports=an&&typeof an.get=="function"?Kl([an.get]):typeof ys=="function"?o(function(t){return ys(t==null?t:vs(t))},"getDunder"):!1});var Es=$((iw,Is)=>{"use strict";var Ps=rn(),bs=nn(),Ts=_s();Is.exports=Ps?o(function(t){return Ps(t)},"getProto"):bs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return bs(t)},"getProto"):Ts?o(function(t){return Ts(t)},"getProto"):null});var sn=$((sw,Ss)=>{"use strict";var Jl=Function.prototype.call,Xl=Object.prototype.hasOwnProperty,Yl=He();Ss.exports=Yl.call(Jl,Xl)});var Ns=$((uw,Os)=>{"use strict";var L,Ql=Qr(),ed=va(),td=_a(),rd=ba(),nd=Ia(),Ke=Sa(),Ge=Xt(),od=za(),id=ka(),ad=Na(),sd=Ca(),ud=Ua(),cd=ja(),pd=Fa(),ld=Ha(),ws=Function,un=o(function(e){try{return ws('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=en(),dd=Ja(),cn=o(function(){throw new Ge},"throwTypeError"),md=xt?function(){try{return arguments.callee,cn}catch{try{return xt(arguments,"callee").get}catch{return cn}}}():cn,qe=es()(),te=Es(),fd=nn(),gd=rn(),ks=on(),_t=er(),We={},yd=typeof Uint8Array>"u"||!te?L:te(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&te?te([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":ed,"%eval%":eval,"%EvalError%":td,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":ws,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&te?te(te([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!te?L:te(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Ql,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":rd,"%ReferenceError%":nd,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!te?L:te(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&te?te(""[Symbol.iterator]()):L,"%Symbol%":qe?Symbol:L,"%SyntaxError%":Ke,"%ThrowTypeError%":md,"%TypedArray%":yd,"%TypeError%":Ge,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":od,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":ks,"%Object.defineProperty%":dd,"%Object.getPrototypeOf%":fd,"%Math.abs%":id,"%Math.floor%":ad,"%Math.max%":sd,"%Math.min%":ud,"%Math.pow%":cd,"%Math.round%":pd,"%Math.sign%":ld,"%Reflect.getPrototypeOf%":gd};if(te)try{null.error}catch(e){$s=te(te(e)),Ne["%Error.prototype%"]=$s}var $s,hd=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&te&&(r=te(i.prototype))}return Ne[t]=r,r},"doEval"),As={__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=He(),tr=sn(),vd=Pt.call(_t,Array.prototype.concat),xd=Pt.call(ks,Array.prototype.splice),zs=Pt.call(_t,String.prototype.replace),rr=Pt.call(_t,String.prototype.slice),_d=Pt.call(_t,RegExp.prototype.exec),Pd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bd=/\\(\\)?/g,Td=o(function(t){var r=rr(t,0,1),n=rr(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 zs(t,Pd,function(u,c,l,y){i[i.length]=l?zs(y,bd,"$1"):c||u}),i},"stringToPath"),Id=o(function(t,r){var n=t,i;if(tr(As,n)&&(i=As[n],n="%"+i[0]+"%"),tr(Ne,n)){var u=Ne[n];if(u===We&&(u=hd(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Os.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(_d(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Td(t),i=n.length>0?n[0]:"",u=Id("%"+i+"%",r),c=u.name,l=u.value,y=!1,v=u.alias;v&&(i=v[0],xd(n,vd([0,1],v)));for(var P=1,A=!0;P<n.length;P+=1){var _=n[P],s=rr(_,0,1),d=rr(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((_==="constructor"||!A)&&(y=!0),i+="."+_,c="%"+i+"%",tr(Ne,c))l=Ne[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&P+1>=n.length){var g=xt(l,_);A=!!g,A&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else A=tr(l,_),l=l[_];A&&!y&&(Ne[c]=l)}}return l},"GetIntrinsic")});var Cs=$((pw,Rs)=>{"use strict";var Ed=tn();Rs.exports=o(function(){return Ed()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ms=$((dw,Us)=>{"use strict";var Sd=Ns(),Ds=Sd("%Object.defineProperty%",!0),$d=Cs()(),Ad=sn(),zd=Xt(),nr=$d?Symbol.toStringTag:null;Us.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 zd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!Ad(t,nr))&&(Ds?Ds(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Ls=$((fw,js)=>{"use strict";var wd=Function.prototype.call,kd=Object.prototype.hasOwnProperty,Od=He();js.exports=Od.call(wd,kd)});var Bs=$((gw,Fs)=>{"use strict";Fs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Hs=$((yw,Zs)=>{"use strict";var mn=Wi(),Nd=require("util"),pn=require("path"),Rd=require("http"),Cd=require("https"),Dd=require("url").parse,Ud=require("fs"),Md=require("stream").Stream,jd=require("crypto"),ln=Yi(),Ld=ga(),Fd=Ms(),Ae=Ls(),dn=Bs();function Vs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Vs,"escapeHeaderParam");function B(e){if(!(this instanceof B))return new B(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(B,"FormData");Nd.inherits(B,mn);B.LINE_BREAK=`\r
|
|
2
|
-
`;B.DEFAULT_CONTENT_TYPE="application/octet-stream";B.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};B.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)+B.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ae(t,"httpVersion"))&&!(t instanceof Md))&&(r.knownLength||this._valuesToMeasure.push(t))};B.prototype._lengthRetriever=function(e,t){Ae(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ud.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ae(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ae(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};B.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Vs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(c,r.header);var l;for(var y in c)if(Ae(c,y)){if(l=c[y],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=y+": "+l.join("; ")+B.LINE_BREAK)}return"--"+this.getBoundary()+B.LINE_BREAK+u+B.LINE_BREAK};B.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=pn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=pn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ae(e,"httpVersion")&&(r=pn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Vs(r)+'"'};B.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=ln.lookup(e.name)),!r&&e&&e.path&&(r=ln.lookup(e.path)),!r&&e&&e.readable&&Ae(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=ln.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=B.DEFAULT_CONTENT_TYPE),r};B.prototype._multiPartFooter=function(){return function(e){var t=B.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};B.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+B.LINE_BREAK};B.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ae(e,t)&&(r[t.toLowerCase()]=e[t]);return r};B.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};B.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};B.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(B.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};B.prototype._generateBoundary=function(){this._boundary="--------------------------"+jd.randomBytes(12).toString("hex")};B.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};B.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};B.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}Ld.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};B.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Dd(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Cd.request(n):r=Rd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,y=o(function(v,P){return r.removeListener("error",y),r.removeListener("response",l),t.call(this,v,P)},"callback");l=y.bind(this,null),r.on("error",y),r.on("response",l)}}.bind(this)),r};B.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};B.prototype.toString=function(){return"[object FormData]"};Fd(B.prototype,"FormData");Zs.exports=B});var vm={};An(vm,{bigcommerce:()=>hm});module.exports=$u(vm);var Au=Object.freeze({status:"aborted"});function E(e,t,r){function n(l,y){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:y,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,y);let v=c.prototype,P=Object.keys(v);for(let A=0;A<P.length;A++){let _=P[A];_ in l||(l[_]=v[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var y;let v=r?.Parent?new u:this;n(v,l),(y=v._zod).deferred??(y.deferred=[]);for(let P of v._zod.deferred)P();return v}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(E,"$constructor");var zu=Symbol("zod_brand"),me=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ur={};function ye(e){return e&&Object.assign(ur,e),ur}o(ye,"config");function pr(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(pr,"getEnumValues");function kn(e,t){return typeof t=="bigint"?t.toString():t}o(kn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function On(e){return e==null}o(On,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var wn=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==wn)return n===void 0&&(n=wn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var lr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var wu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Nn(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(Nn,"isPlainObject");var Rn=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"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 Cn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Cn,"optionalKeys");var ku={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 Ue(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(Ue,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Te(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(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 dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var Un=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,kn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Mn=E("$ZodError",Un),Qe=E("$ZodError",Un,{Parent:Error});var Nu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(y=>Te(y,u,ye())));throw lr(l,i?.callee),l}return c.value},"_parse"),At=Nu(Qe),Ru=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(y=>Te(y,u,ye())));throw lr(l,i?.callee),l}return c.value},"_parseAsync"),zt=Ru(Qe),Cu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??Mn)(u.issues.map(c=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),et=Cu(Qe),Du=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Te(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),tt=Du(Qe);var Uu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Mu=new RegExp(`^${Uu}$`);var jn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Ln=/^-?\d+n?$/;var mr=/^-?\d+(?:\.\d+)?$/,Fn=/^(?:true|false)$/i;var Me=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Bn=E("$ZodCheckMinLength",(e,t)=>{var r;Me.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!On(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=Dn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Me.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Vn=E("$ZodCheckRegex",(e,t)=>{fr.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 Hn={major:4,minor:3,patch:6};var G=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Hn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,y)=>{let v=Ue(c),P;for(let A of l){if(A._zod.def.when){if(!A._zod.def.when(c))continue}else if(v)continue;let _=c.issues.length,s=A._zod.check(c);if(s instanceof Promise&&y?.async===!1)throw new me;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(v||(v=Ue(c,_)))});else{if(c.issues.length===_)continue;v||(v=Ue(c,_))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,l,y)=>{if(Ue(c))return c.aborted=!0,c;let v=i(l,n,y);if(v instanceof Promise){if(y.async===!1)throw new me;return v.then(P=>e._zod.parse(P,y))}return e._zod.parse(v,y)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let v=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return v instanceof Promise?v.then(P=>u(P,c,l)):u(v,c,l)}let y=e._zod.parse(c,l);if(y instanceof Promise){if(l.async===!1)throw new me;return y.then(v=>i(v,n,l))}return i(y,n,l)}}Y(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ot=E("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jn(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}}),gr=E("$ZodStringFormat",(e,t)=>{fr.init(e,t),Ot.init(e,t)});var Jn=E("$ZodURL",(e,t)=>{gr.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 Xn=E("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var yr=E("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=Fn,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}}),Yn=E("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=Ln,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=E("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),eo=E("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var to=E("$ZodVoid",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),ro=E("$ZodDate",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function qn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(qn,"handleArrayResult");var no=E("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],y=t.element._zod.run({value:l,issues:[]},n);y instanceof Promise?u.push(y.then(v=>qn(v,r,c))):qn(y,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function kt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(kt,"handlePropertyResult");function ju(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=Cn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(ju,"normalizeDef");function Lu(e,t,r,n,i,u){let c=[],l=i.keySet,y=i.catchall._zod,v=y.def.type,P=y.optout==="optional";for(let A in t){if(l.has(A))continue;if(v==="never"){c.push(A);continue}let _=y.run({value:t[A],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>kt(s,r,A,t,P))):kt(_,r,A,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Lu,"handleCatchall");var oo=E("$ZodObject",(e,t)=>{if(G.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...l};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=Et(()=>ju(t));Y(e._zod,"propValues",()=>{let l=t.shape,y={};for(let v in l){let P=l[v]._zod;if(P.values){y[v]??(y[v]=new Set);for(let A of P.values)y[v].add(A)}}return y});let i=Ye,u=t.catchall,c;e._zod.parse=(l,y)=>{c??(c=n.value);let v=l.value;if(!i(v))return l.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),l;l.value={};let P=[],A=c.shape;for(let _ of c.keys){let s=A[_],d=s._zod.optout==="optional",g=s._zod.run({value:v[_],issues:[]},y);g instanceof Promise?P.push(g.then(m=>kt(m,l,_,v,d))):kt(g,l,_,v,d)}return u?Lu(P,v,l,y,n.value,e):P.length?Promise.all(P).then(()=>l):l}});function Wn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ue(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Te(c,n,ye())))}),t)}o(Wn,"handleUnionResults");var hr=E("$ZodUnion",(e,t)=>{G.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>St(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let y of t.options){let v=y._zod.run({value:i.value,issues:[]},u);if(v instanceof Promise)l.push(v),c=!0;else{if(v.issues.length===0)return v;l.push(v)}}return c?Promise.all(l).then(y=>Wn(y,i,e,u)):Wn(l,i,e,u)}});var io=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,hr.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,y]of Object.entries(c)){i[l]||(i[l]=new Set);for(let v of y)i[l].add(v)}}return i});let n=Et(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let y of l){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ao=E("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Nn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let v of c)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){l.add(typeof v=="number"?v.toString():v);let P=t.valueType._zod.run({value:i[v],issues:[]},n);P instanceof Promise?u.push(P.then(A=>{A.issues.length&&r.issues.push(...be(v,A.issues)),r.value[v]=A.value})):(P.issues.length&&r.issues.push(...be(v,P.issues)),r.value[v]=P.value)}let y;for(let v in i)l.has(v)||(y=y??[],y.push(v));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let y=t.keyType._zod.run({value:l,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&mr.test(l)&&y.issues.length){let A=t.keyType._zod.run({value:Number(l),issues:[]},n);if(A instanceof Promise)throw new Error("Async schemas not supported in object keys currently");A.issues.length===0&&(y=A)}if(y.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(A=>Te(A,n,ye())),input:l,path:[l],inst:e});continue}let P=t.valueType._zod.run({value:i[l],issues:[]},n);P instanceof Promise?u.push(P.then(A=>{A.issues.length&&r.issues.push(...be(l,A.issues)),r.value[y.value]=A.value})):(P.issues.length&&r.issues.push(...be(l,P.issues)),r.value[y.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var so=E("$ZodEnum",(e,t)=>{G.init(e,t);let r=pr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Rn.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),uo=E("$ZodLiteral",(e,t)=>{if(G.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var co=E("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(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 me;return r.value=i,r}});function Gn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Gn,"handleOptionalResult");var po=E("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Gn(u,r.value)):Gn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var lo=E("$ZodNullable",(e,t)=>{G.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var mo=E("$ZodPipe",(e,t)=>{G.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var fo=E("$ZodCustom",(e,t)=>{Me.init(e,t),G.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Kn(u,r,n,e));Kn(i,r,n,e)}});function Kn(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(dr(i))}}o(Kn,"handleRefineResult");var yo,Zu=Symbol("ZodOutput"),Hu=Symbol("ZodInput"),vr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ho(){return new vr}o(ho,"registry");(yo=globalThis).__zod_globalRegistry??(yo.__zod_globalRegistry=ho());var xr=globalThis.__zod_globalRegistry;function vo(e,t){return new e({type:"string",...W(t)})}o(vo,"_string");function xo(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(xo,"_coercedString");function _o(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(_o,"_url");function Po(e,t){return new e({type:"number",checks:[],...W(t)})}o(Po,"_number");function bo(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(bo,"_coercedNumber");function To(e,t){return new e({type:"boolean",...W(t)})}o(To,"_boolean");function Io(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(Io,"_coercedBoolean");function Eo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(Eo,"_coercedBigint");function So(e){return new e({type:"any"})}o(So,"_any");function $o(e){return new e({type:"unknown"})}o($o,"_unknown");function Ao(e,t){return new e({type:"void",...W(t)})}o(Ao,"_void");function zo(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(zo,"_coercedDate");function pe(e,t){return new Bn({check:"min_length",...W(t),minimum:e})}o(pe,"_minLength");function Ie(e,t){return new Vn({check:"string_format",format:"regex",...W(t),pattern:e})}o(Ie,"_regex");function wo(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(wo,"_custom");var Q=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$t(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Rt=E("ZodMiniString",(e,t)=>{Ot.init(e,t),Q.init(e,t)});function a(e){return vo(Rt,e)}o(a,"string");var ko=E("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),Rt.init(e,t)});var tc=E("ZodMiniURL",(e,t)=>{Jn.init(e,t),ko.init(e,t)});function Oo(e){return _o(tc,e)}o(Oo,"url");var _r=E("ZodMiniNumber",(e,t)=>{Xn.init(e,t),Q.init(e,t)});function re(e){return Po(_r,e)}o(re,"number");var Pr=E("ZodMiniBoolean",(e,t)=>{yr.init(e,t),Q.init(e,t)});function H(e){return To(Pr,e)}o(H,"boolean");var No=E("ZodMiniBigInt",(e,t)=>{Yn.init(e,t),Q.init(e,t)});var rc=E("ZodMiniAny",(e,t)=>{Qn.init(e,t),Q.init(e,t)});function nt(){return So(rc)}o(nt,"any");var nc=E("ZodMiniUnknown",(e,t)=>{eo.init(e,t),Q.init(e,t)});function N(){return $o(nc)}o(N,"unknown");var oc=E("ZodMiniVoid",(e,t)=>{to.init(e,t),Q.init(e,t)});function Ro(e){return Ao(oc,e)}o(Ro,"_void");var Co=E("ZodMiniDate",(e,t)=>{ro.init(e,t),Q.init(e,t)});var ic=E("ZodMiniArray",(e,t)=>{no.init(e,t),Q.init(e,t)});function D(e,t){return new ic({type:"array",element:e,...W(t)})}o(D,"array");var ac=E("ZodMiniObject",(e,t)=>{oo.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...W(t)};return new ac(r)}o(p,"object");var sc=E("ZodMiniUnion",(e,t)=>{hr.init(e,t),Q.init(e,t)});function U(e,t){return new sc({type:"union",options:e,...W(t)})}o(U,"union");var uc=E("ZodMiniDiscriminatedUnion",(e,t)=>{io.init(e,t),Q.init(e,t)});function je(e,t,r){return new uc({type:"union",options:t,discriminator:e,...W(r)})}o(je,"discriminatedUnion");var cc=E("ZodMiniRecord",(e,t)=>{ao.init(e,t),Q.init(e,t)});function R(e,t,r){return new cc({type:"record",keyType:e,valueType:t,...W(r)})}o(R,"record");var pc=E("ZodMiniEnum",(e,t)=>{so.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function j(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new pc({type:"enum",entries:r,...W(t)})}o(j,"_enum");var lc=E("ZodMiniLiteral",(e,t)=>{uo.init(e,t),Q.init(e,t)});function z(e,t){return new lc({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o(z,"literal");var dc=E("ZodMiniTransform",(e,t)=>{co.init(e,t),Q.init(e,t)});function Ee(e){return new dc({type:"transform",transform:e})}o(Ee,"transform");var mc=E("ZodMiniOptional",(e,t)=>{po.init(e,t),Q.init(e,t)});function h(e){return new mc({type:"optional",innerType:e})}o(h,"optional");var fc=E("ZodMiniNullable",(e,t)=>{lo.init(e,t),Q.init(e,t)});function ot(e){return new fc({type:"nullable",innerType:e})}o(ot,"nullable");var gc=E("ZodMiniPipe",(e,t)=>{mo.init(e,t),Q.init(e,t)});function Se(e,t){return new gc({type:"pipe",in:e,out:t})}o(Se,"pipe");var yc=E("ZodMiniCustom",(e,t)=>{fo.init(e,t),Q.init(e,t)});function Ct(e,t){return wo(yc,e??(()=>!0),t)}o(Ct,"custom");var it={};An(it,{bigint:()=>Tc,boolean:()=>bc,date:()=>Ic,number:()=>Pc,string:()=>_c});function _c(e){return xo(Rt,e)}o(_c,"string");function Pc(e){return bo(_r,e)}o(Pc,"number");function bc(e){return Io(Pr,e)}o(bc,"boolean");function Tc(e){return Eo(No,e)}o(Tc,"bigint");function Ic(e){return zo(Co,e)}o(Ic,"date");var Tr=p({retryOnFailure:p({defaultValue:h(H()),hide:h(H())}),continueOnFailure:p({defaultValue:h(H()),hide:h(H())})}),br=class{constructor(t,r,n,i,u,c,l,y,v,P,A){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=y;this.outputSchema=v;this.audience=P;this.aiMetadata=A}static{o(this,"IAction")}},V=o(e=>new br(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 Z=p({displayName:a(),description:h(a())}),M=o((e,t)=>p({type:z(t),required:H(),defaultValue:h(nt())}),"TPropertyValue");var ae=p({...Z.shape,...M(a(),"SHORT_TEXT").shape}),he=p({...Z.shape,...M(a(),"LONG_TEXT").shape});var Uo=p({label:a(),value:N()}),Dt=p({disabled:h(H()),placeholder:h(a()),options:D(Uo)});var se=p({...Z.shape,options:Dt,...M(N(),"STATIC_DROPDOWN").shape}),ve=p({...Z.shape,options:Dt,...M(D(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ir=p({...Z.shape,...M(N(),"DROPDOWN").shape,refreshers:D(a())}),at=p({...Z.shape,...M(D(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var xe=p({...Z.shape,...M(H(),"CHECKBOX").shape});var _e=p({...Z.shape,...M(re(),"NUMBER").shape});var st=p({...Z.shape,...M(N(),"FILE").shape});var ut=p({...Z.shape,...M(a(),"DATE_TIME").shape});var Mo=R(a(),U([ae,he,se,at,ve,xe,_e,st,ut])),ct=p({...Z.shape,properties:Mo,...M(D(N()),"ARRAY").shape});var pt=p({...Z.shape,...M(U([R(a(),N())]),"JSON").shape});var jo=U([ae,se,pt,ct,ve]),Sc=R(a(),jo),Er=p({refreshers:D(a()),...Z.shape,...M(N(),"DYNAMIC").shape});var Ut=p({...Z.shape,...M(Ro(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),Le=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Le||{}),dt=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(dt||{});var mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(mt||{}),Sr="both_client_credentials_and_authorization_code";var ee=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ee||{}),ft=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(ft||{}),$c=p({strategy:j(ft),paramName:h(a())}),gt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(gt||{});var Mt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Mt||{}),Lo=p({status:h(re()),body:h(N()),headers:h(R(a(),a()))}),Fo=p({type:z("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(j(Mt))}),Bo=p({type:z("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Lo,handlerId:h(a()),streamStepProgress:h(j(Mt))}),Ac=U([Fo,Bo]);var zc=p({body:N(),rawBody:h(N()),headers:R(a(),a()),queryParams:R(a(),a())});function le(e){return e==null}o(le,"isNil");function yt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(yt,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var $r=Ce(require("crypto"),1);var wc=128,we,Fe,kc=o(e=>{!we||we.length<e?(we=Buffer.allocUnsafe(e*wc),$r.default.randomFillSync(we),Fe=0):Fe+e>we.length&&($r.default.randomFillSync(we),Fe=0),Fe+=e},"fillPool"),Oc=o(e=>(kc(e|=0),we.subarray(Fe-e,Fe)),"random"),Nc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),y=i;for(;y--;)if(c+=e[l[y]&n]||"",c.length===u)return c}}},"customRandom"),Zo=o((e,t=21)=>Nc(e,t,Oc),"customAlphabet");var Rc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ho=21,tT=a().check(Ie(new RegExp(`^[0-9a-zA-Z]{${Ho}}$`))),Cc=Zo(Rc,Ho);var $e=Se(Ee(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:$e,updated:$e},q=o(e=>h(ot(e)),"Nullable");function Ar(e){return h(ot(j(e)))}o(Ar,"NullableEnum");var oT=Se(Ee(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(H())),Lt=o(e=>Se(Ee(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(D(e))),"OptionalArrayFromQuery");var sT=R(a(),N());var ht=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(ht||{});var xT=a().check(Ie(/^#[0-9A-Fa-f]{6}$/));var PT=p({filename:a(),data:N(),type:z("file"),mimetype:h(a())});var Dc=Ce(Wo());var AT=p({...ue,name:a(),permissions:D(a()),platformId:q(a()),type:a(),userCount:h(re())});var Go=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Go||{}),zr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(zr||{}),wr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(wr||{});var kr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(kr||{});var Or=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Or||{});var Uc=p({mode:j(Go),value:N()}),Mc=p({auth:h(a()),fields:R(a(),Uc)}),jc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(Mc)}),Lc=p({type:z("PIECE"),toolName:a().check(pe(1)),pieceMetadata:jc}),Fc=p({type:z("none")}),Bc=p({type:z("access_token"),accessToken:a()}),Vc=p({type:z("api_key"),apiKey:a(),apiKeyHeader:a()}),Zc=p({type:z("headers"),headers:R(a(),a())}),Hc=je("type",[Fc,Bc,Vc,Zc]),Ko=p({type:z("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:h(a())}),Jo=p({type:z("MCP"),toolName:a().check(pe(1)),serverUrl:Oo(),protocol:j(wr),auth:Hc}),Xo=p({type:z("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:j(zr),sourceId:a(),sourceName:a()}),qc=je("type",[Lc,Ko,Jo,Xo]),Wc=p({displayName:a(),description:h(a()),type:j(kr)}),Yo=p({type:z("MARKDOWN"),markdown:a()}),Be={type:z("TOOL_CALL"),input:q(R(a(),N())),output:h(N()),toolName:a(),status:j(Or),toolCallId:a(),startTime:a(),endTime:h(a())},tI=p(Be),Qo=je("toolCallType",[p({...Be,toolCallType:z("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Be,toolCallType:z("FLOW"),displayName:a(),externalFlowId:a()}),p({...Be,toolCallType:z("MCP"),displayName:a(),serverUrl:a()}),p({...Be,toolCallType:z("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Be,toolCallType:z("UNKNOWN"),displayName:a()})]),Gc=U([Yo,Qo]);var Nr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Nr||{}),Pe=p({apiKey:a()}),Kc=Pe,Jc=p({apiKey:a(),apiKeyHash:a()}),Xc=Pe,Yc=Pe,Qc=Pe,ep=Pe,tp=Pe,rp=Pe,np=Pe,ei=p({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),op=p({}),ip=p({}),ap=p({}),sp=p({}),up=p({}),cp=p({}),ti=p({modelId:a(),modelName:a(),modelType:j(Nr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:D(ti),defaultHeaders:h(R(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:D(ti),vertexProject:h(a()),vertexRegion:h(a())}),oi=p({resourceName:a(),apiVersion:Se(Ee(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ii=p({region:a().check(pe(1))}),pp=U([Kc,Qc,ep,tp,rp,Yc,Xc,Jc,ei,np]),ai=U([ri,ni,oi,ii,op,ap,sp,up,ip,cp]),lp=p({id:a(),name:a(),type:j(Nr)}),dp=p({id:a(),name:a(),provider:j(ht),config:ai,enabledForChat:H()}),mp=p({provider:j(ht),config:ai,auth:pp,platformId:a()});var iI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var fp=p({base64Url:a(),fileName:a(),extension:h(a())}),gp=p({mimeType:a(),url:a(),fileName:h(a())}),Rr=U([fp,gp]);var yp=U([p({type:z("file"),value:Rr}),p({type:z("markdown"),value:a(),files:h(D(Rr))})]),hp=p({sessionId:a(),message:a(),files:h(D(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Cr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Cr||{});var vp=U([p({...ue,name:a(),externalId:a(),type:z("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:D(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:U([z("TEXT"),z("NUMBER"),z("DATE")]),tableId:a(),projectId:a()})]),xp=p({...ue,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Ar(ci),trigger:Ar(ui)}),_p=p({...ue,tableId:a(),projectId:a(),cells:R(a(),p({updated:a(),created:a(),value:N(),fieldName:a()}))}),Pp=p({events:D(j(Cr)),webhookUrl:a(),flowId:a()}),bp=p({fields:D(p({id:a(),name:a()})),rows:D(R(a(),a())),name:a()}),Tp=p({projectId:a(),limit:h(it.number()),cursor:h(a()),name:h(a()),externalIds:Lt(a()),folderId:h(a()),folderIds:Lt(a())}),Ip=p({records:D(D(p({fieldId:a(),value:li()}))),tableId:a()}),Ep=p({cells:h(D(p({fieldId:a(),value:li()}))),tableId:a(),agentUpdate:h(H())}),pi=je("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),si("exists"),si("not_exists")]),Sp=p({tableId:a(),limit:h(it.number()),cursor:h(a()),filters:Lt(pi)});function li(){return Se(Ee(e=>e==null?e:String(e)),ot(a()))}o(li,"coerceToString");function ke(e){return p({fieldId:a(),operator:z(e),value:a()})}o(ke,"valueFilter");function si(e){return p({fieldId:a(),operator:z(e)})}o(si,"existenceFilter");var $p=p({status:h(re()),body:h(N()),headers:h(R(a(),a()))}),Ap=p({...ue,deleted:q($e),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var di=p({name:a(),description:h(a()),type:a(),required:H()}),zp=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:D(di),returnsResponse:H()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",II=new RegExp(mi),kp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",EI=a().check(Ie(new RegExp(mi))),SI=a().check(Ie(new RegExp(kp))),Op=p({packageType:z("ARCHIVE"),pieceType:j(Le),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:z("REGISTRY"),pieceType:z("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:z("REGISTRY"),pieceType:z("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),$I=U([fi,gi]),AI=U([Op,fi,gi]),yi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(yi||{}),Np=p({type:j(yi),cronExpression:a(),timezone:a()}),zI=p({...ue,type:j(ee),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Np),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:H()}),hi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(hi||{}),vi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(vi||{}),xi=(r=>(r.S3="S3",r.DB="DB",r))(xi||{}),wI=p({...ue,projectId:q(a()),platformId:q(a()),type:j(hi),compression:j(vi),data:h(N()),location:j(xi),size:q(re()),fileName:q(a()),s3Key:q(a()),metadata:q(R(a(),a()))}),_i=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_i||{}),Pi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Pi||{}),kI=p({id:a(),email:a(),firstName:a(),status:j(Pi),externalId:q(a()),platformId:q(a()),platformRole:j(_i),lastName:a(),created:$e,updated:$e,lastActiveDate:q($e),imageUrl:q(a())});var Dr=p({...Z.shape,...M(R(a(),N()),"OBJECT").shape});var Ei=p({...Z.shape,...M(a(),"COLOR").shape});var Ur=U([ae,he,Ut,xe,se,ve,Ir,at,Er,_e,ct,Dr,pt,ut,st,Ei]),f={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 fe=p({displayName:a(),description:h(a())});var Si=p({username:a(),password:a()}),Mr=p({...fe.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...M(Si,"BASIC_AUTH").shape});var Up=R(a(),U([ae,he,_e,xe,se])),jr=p({...fe.shape,props:Up,...M(N(),"CUSTOM_AUTH").shape});var Oe=p({...fe.shape,...M(p({auth:a()}),"SECRET_TEXT").shape});var Mp=R(a(),U([ae,he,Oe,_e,xe,se,ve,Ut])),$i=p({...fe.shape,props:Mp,...M(N(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),Ai=U([ae,Oe,se]),zi=R(a(),Ai),jp=p({props:h(R(a(),Ai)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:h(U([z("none"),z("consent"),z("login"),z("omit")])),pkce:h(H()),pkceMethod:h(U([z("plain"),z("S256")])),authorizationMethod:h(j(Lr)),grantType:h(U([j(mt),z(Sr)])),extra:h(R(a(),a()))}),wi=p({access_token:a(),props:h(zi),data:R(a(),nt())}),Fr=p({...fe.shape,...jp.shape,...M(wi,"OAUTH2").shape});var Ve=U([Mr,jr,$i,Fr,Oe]),vt="Connection",Br={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||vt}},None(){}};var cS={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 Lp=p({...Z.shape,...M(N(),"CUSTOM").shape,code:a()});var Fp=U([Ur,Ve]),Vr=R(a(),Fp),zS=R(a(),Ur);var ki=U([p({strategy:z("CRON"),cronExpression:a()}),p({strategy:z("NONE")})]),Ze=class{constructor(t,r,n,i,u,c,l,y,v,P,A,_,s,d,g,m,x,b,F){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=l;this.onHandshake=y;this.renewConfiguration=v;this.onRenew=P;this.onEnable=A;this.onDisable=_;this.onStart=s;this.run=d;this.test=g;this.sampleData=m;this.testStrategy=x;this.outputSchema=b;this.aiMetadata=F}static{o(this,"ITrigger")}},J=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,le(e.sampleData)&&le(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Oi="2",Bt="0.82.0";var Zr=class{constructor(t,r,n,i,u,c,l,y,v=Bt,P,A=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=y;this.minimumSupportedRelease=v;this.maximumSupportedRelease=P;this.description=A;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Oi}),"getContextInfo");(!Bp(v)||Vp(v,Bt))&&(this.minimumSupportedRelease=Bt),u.forEach(_=>this._actions[_.name]=_),c.forEach(_=>this._triggers[_.name]=_)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ni=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Zr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Bp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Bp,"isValidSimpleSemver");function Vp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Vp,"isSemverLessThan");var Zp=h(R(a(),R(a(),a()))),Ri=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:h(a()),directoryPath:h(a()),auth:h(U([Ve,D(Ve)])),version:a(),categories:h(D(j(dt))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),i18n:Zp}),Hp=j(["human","ai","both"]),Ci=p({description:h(a()),idempotent:h(H())}),Di=p({name:a(),displayName:a(),description:a(),props:Vr,requireAuth:H(),errorHandlingOptions:h(Tr),outputSchema:h(Ct()),audience:h(Hp),aiMetadata:h(Ci)}),Ui=p({name:a(),displayName:a(),description:a(),props:Vr,errorHandlingOptions:h(Tr),type:j(ee),sampleData:N(),handshakeConfiguration:h(Ct()),renewConfiguration:h(ki),testStrategy:j(gt),outputSchema:h(Ct()),aiMetadata:h(Ci)}),qp=p({...Ri.shape,actions:R(a(),Di),triggers:R(a(),Ui)}),Wp=p({...Ri.shape,actions:re(),triggers:re(),suggestedActions:h(D(Ui)),suggestedTriggers:h(D(Di))}),Mi=p({projectUsage:re(),tags:h(D(a())),pieceType:j(Le),packageType:j(lt),platformId:h(a()),archiveId:h(a())}),z$=p({...qp.shape,...Mi.shape}),w$=p({...Wp.shape,...Mi.shape}),k$=p({name:a(),version:a()});var Gp=Ce(require("path")),Kp=Ce(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Zt=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 Ht=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var qt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Zt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[F,ie]of Object.entries(c))i.append(F,ie);let l=i.toString(),y=l?`${n}?${l}`:n,v=t.responseType??"json",P=t.followRedirects??!0,A=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Jp(t.body,u),g=Yp({...u,...s}),m=await Xp(async()=>{let F=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>F.abort(),t.timeout):void 0;try{let ce={method:t.method.toString(),headers:g,body:_,redirect:P?"follow":"manual",signal:F.signal};return d&&(ce.duplex="half"),r?.dispatcher!==void 0&&(ce.dispatcher=r.dispatcher),await fetch(y,ce)}finally{ie!==void 0&&clearTimeout(ie)}},A),x=P?300:400;if(m.status<200||m.status>=x){let F=await ji(m,v),ie=new Ht(t.body,{status:m.status,responseBody:F});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let b=await ji(m,v);return{status:m.status,headers:Qp(m.headers),body:b}}};function Jp(e,t){return tl(e)?{body:void 0,extraHeaders:{},isStream:!1}:el(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(Jp,"serializeBody");async function ji(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ji,"parseResponseBody");async function Xp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Li(n);continue}return i}catch(i){if(r=i,n<t){await Li(n);continue}throw i}throw r}o(Xp,"sendWithRetries");function Li(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Li,"backoff");function Yp(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(Yp,"normalizeHeaders");function Qp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Qp,"toHttpHeaders");function el(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(el,"isNodeFormData");function tl(e){return e==null}o(tl,"isNil");var Wt=new qt;var Gt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Gt||{});var Bd=Ce(require("fs")),qs=Ce(Hs());var Vd={"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 Vd[t]??""}o(Zd,"contentTypeToExtension");var Hd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),qd=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 Ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:y="headers"}){return V({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:f.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:v})=>({url:f.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${
|
|
1
|
+
"use strict";var Hu=Object.create;var Qe=Object.defineProperty;var Gu=Object.getOwnPropertyDescriptor;var qu=Object.getOwnPropertyNames;var Wu=Object.getPrototypeOf,Ku=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var A=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Nn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},Cn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qu(t))!Ku.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=Gu(t,i))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?Hu(Wu(e)):{},Cn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),Ju=e=>Cn(Qe({},"__esModule",{value:!0}),e);var si=A((ai,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"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function h(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],b,B;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(B=d-y,b=":";B--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let ie=s.split(":"),de=[];for(let Te=0;Te<ie.length;Te++)de.push(parseInt(ie[Te],16));return de})(),{parts:d,zoneId:v}}o(h,"expandIPv6");function P(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,b;for(;m>0;){if(b=y-m,b<0&&(b=0),s[v]>>b!==d[v]>>b)return!1;m-=y,v+=1}return!0}o(P,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function z(s,d){for(;s.length<d;)s=`0${s}`;return s}o(z,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return P(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,b,B;for(v=3;v>=0;v-=1)if(b=this.octets[v],b in m){if(B=m[b],y&&B!==0)return null;B!==8&&(y=!0),d+=B}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<4;)v.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,y,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<4;)v.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),b=[];for(let B=0;B<v.length;B++)y=v[B],b.push(_(y));return b})();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],b;for(b=0;b<=24;b+=8)v.push(m>>b&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),b=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),b=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(_(v[0])),b.push(_(v[1])),b.push(m>>8&255),b.push(m&255),b})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,y){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return P(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,b;for(let B=7;B>=0;B-=1)if(v=this.parts[B],v in m){if(b=m[v],y&&b!==0)return null;b!==16&&(y=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(z(this.parts[v].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],m=d[1];return new x.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,v=-1,b;for(;b=d.exec(y);)b[0].length>v&&(m=b.index,v=b[0].length);return v<0?y:`${y.substring(0,m)}::${y.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],b=0;for(;b<16;)v.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,y,m,v,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],y=0;y<16;)v.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(v)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,y,m,v,b,B;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return h(s,8);if((m=s.match(p.transitional))&&(B=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=h(d+B,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<b.length;y++)if(v=b[y],!(0<=v&&v<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,y){let m,v,b,B;y==null&&(y="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(b=d[v],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(B=b[m],s.kind()===B[0].kind()&&s.match.apply(s,B))return v}return y},typeof Gt<"u"&&Gt.exports?Gt.exports=x:e.ipaddr=x})(ai)});var la=A((Gz,pa)=>{var ca=require("stream").Stream,Nl=require("util");pa.exports=le;function le(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(le,"DelayedStream");Nl.inherits(le,ca);le.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(le.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});le.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};le.prototype.resume=function(){this._released||this.release(),this.source.resume()};le.prototype.pause=function(){this.source.pause()};le.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};le.prototype.pipe=function(){var e=ca.prototype.pipe.apply(this,arguments);return this.resume(),e};le.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)};le.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 ga=A((Wz,fa)=>{var Cl=require("util"),ma=require("stream").Stream,da=la();fa.exports=X;function X(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(X,"CombinedStream");Cl.inherits(X,ma);X.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};X.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};X.prototype.append=function(e){var t=X.isStreamLike(e);if(t){if(!(e instanceof da)){var r=da.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};X.prototype.pipe=function(e,t){return ma.prototype.pipe.call(this,e,t),this.resume(),e};X.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};X.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=X.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};X.prototype._pipeNext=function(e){this._currentStream=e;var t=X.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};X.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};X.prototype.write=function(e){this.emit("data",e)};X.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};X.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};X.prototype.end=function(){this._reset(),this.emit("end")};X.prototype.destroy=function(){this._reset(),this.emit("close")};X.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};X.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};X.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};X.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ha=A((Jz,ya)=>{"use strict";ya.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 xa=A(ne=>{"use strict";var Qt=ha(),Dl=require("path").extname,va=/^\s*([^;\s]*)(?:;|\s|$)/,Ul=/^text\//i;ne.charset=_a;ne.charsets={lookup:_a};ne.contentType=Ml;ne.extension=Ll;ne.extensions=Object.create(null);ne.lookup=jl;ne.types=Object.create(null);Bl(ne.extensions,ne.types);function _a(e){if(!e||typeof e!="string")return!1;var t=va.exec(e),r=t&&Qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Ul.test(t[1])?"UTF-8":!1}o(_a,"charset");function Ml(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?ne.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=ne.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Ml,"contentType");function Ll(e){if(!e||typeof e!="string")return!1;var t=va.exec(e),r=t&&ne.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ll,"extension");function jl(e){if(!e||typeof e!="string")return!1;var t=Dl("x."+e).toLowerCase().substr(1);return t&&ne.types[t]||!1}o(jl,"lookup");function Bl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Qt).forEach(o(function(i){var u=Qt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var h=c[p];if(t[h]){var P=r.indexOf(Qt[t[h]].source),_=r.indexOf(u.source);if(t[h]!=="application/octet-stream"&&(P>_||P===_&&t[h].substr(0,12)==="application/"))continue}t[h]=i}}},"forEachMimeType"))}o(Bl,"populateMaps")});var ba=A((Qz,Pa)=>{Pa.exports=Fl;function Fl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Fl,"defer")});var Qr=A((tw,Ea)=>{var Ta=ba();Ea.exports=Vl;function Vl(e){var t=!1;return Ta(function(){t=!0}),o(function(n,i){t?e(n,i):Ta(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Vl,"async")});var en=A((nw,Ia)=>{Ia.exports=Zl;function Zl(e){Object.keys(e.jobs).forEach(Hl.bind(e)),e.jobs={}}o(Zl,"abort");function Hl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Hl,"clean")});var tn=A((iw,Aa)=>{var Sa=Qr(),Gl=en();Aa.exports=ql;function ql(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Wl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Gl(r):r.results[i]=c,n(u,r.results))})}o(ql,"iterate");function Wl(e,t,r,n){var i;return e.length==2?i=e(r,Sa(n)):i=e(r,t,Sa(n)),i}o(Wl,"runJob")});var rn=A((sw,$a)=>{$a.exports=Kl;function Kl(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Kl,"state")});var nn=A((cw,za)=>{var Jl=en(),Xl=Qr();za.exports=Yl;function Yl(e){Object.keys(this.jobs).length&&(this.index=this.size,Jl(this),Xl(e)(null,this.results))}o(Yl,"terminator")});var Oa=A((lw,wa)=>{var Ql=tn(),ed=rn(),td=nn();wa.exports=rd;function rd(e,t,r){for(var n=ed(e);n.index<(n.keyedList||e).length;)Ql(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return td.bind(n,r)}o(rd,"parallel")});var on=A((mw,er)=>{var ka=tn(),nd=rn(),od=nn();er.exports=id;er.exports.ascending=Ra;er.exports.descending=ad;function id(e,t,r,n){var i=nd(e,r);return ka(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ka(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),od.bind(i,n)}o(id,"serialOrdered");function Ra(e,t){return e<t?-1:e>t?1:0}o(Ra,"ascending");function ad(e,t){return-1*Ra(e,t)}o(ad,"descending")});var Ca=A((gw,Na)=>{var sd=on();Na.exports=ud;function ud(e,t,r){return sd(e,t,null,r)}o(ud,"serial")});var Ua=A((hw,Da)=>{Da.exports={parallel:Oa(),serial:Ca(),serialOrdered:on()}});var an=A((vw,Ma)=>{"use strict";Ma.exports=Object});var ja=A((_w,La)=>{"use strict";La.exports=Error});var Fa=A((xw,Ba)=>{"use strict";Ba.exports=EvalError});var Za=A((Pw,Va)=>{"use strict";Va.exports=RangeError});var Ga=A((bw,Ha)=>{"use strict";Ha.exports=ReferenceError});var Wa=A((Tw,qa)=>{"use strict";qa.exports=SyntaxError});var tr=A((Ew,Ka)=>{"use strict";Ka.exports=TypeError});var Xa=A((Iw,Ja)=>{"use strict";Ja.exports=URIError});var Qa=A((Sw,Ya)=>{"use strict";Ya.exports=Math.abs});var ts=A((Aw,es)=>{"use strict";es.exports=Math.floor});var ns=A(($w,rs)=>{"use strict";rs.exports=Math.max});var is=A((zw,os)=>{"use strict";os.exports=Math.min});var ss=A((ww,as)=>{"use strict";as.exports=Math.pow});var cs=A((Ow,us)=>{"use strict";us.exports=Math.round});var ls=A((kw,ps)=>{"use strict";ps.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ms=A((Nw,ds)=>{"use strict";var cd=ls();ds.exports=o(function(t){return cd(t)||t===0?t:t<0?-1:1},"sign")});var gs=A((Dw,fs)=>{"use strict";fs.exports=Object.getOwnPropertyDescriptor});var sn=A((Uw,ys)=>{"use strict";var rr=gs();if(rr)try{rr([],"length")}catch{rr=null}ys.exports=rr});var vs=A((Mw,hs)=>{"use strict";var nr=Object.defineProperty||!1;if(nr)try{nr({},"a",{value:1})}catch{nr=!1}hs.exports=nr});var un=A((Lw,_s)=>{"use strict";_s.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var bs=A((Bw,Ps)=>{"use strict";var xs=typeof Symbol<"u"&&Symbol,pd=un();Ps.exports=o(function(){return typeof xs!="function"||typeof Symbol!="function"||typeof xs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:pd()},"hasNativeSymbols")});var cn=A((Vw,Ts)=>{"use strict";Ts.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var pn=A((Zw,Es)=>{"use strict";var ld=an();Es.exports=ld.getPrototypeOf||null});var As=A((Hw,Ss)=>{"use strict";var dd="Function.prototype.bind called on incompatible ",md=Object.prototype.toString,fd=Math.max,gd="[object Function]",Is=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),yd=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),hd=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");Ss.exports=o(function(t){var r=this;if(typeof r!="function"||md.apply(r)!==gd)throw new TypeError(dd+r);for(var n=yd(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Is(n,arguments));return Object(_)===_?_:this}return r.apply(t,Is(n,arguments))},"binder"),c=fd(0,r.length-n.length),p=[],h=0;h<c;h++)p[h]="$"+h;if(i=Function("binder","return function ("+hd(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var P=o(function(){},"Empty");P.prototype=r.prototype,i.prototype=new P,P.prototype=null}return i},"bind")});var We=A((qw,$s)=>{"use strict";var vd=As();$s.exports=Function.prototype.bind||vd});var or=A((Ww,zs)=>{"use strict";zs.exports=Function.prototype.call});var ln=A((Kw,ws)=>{"use strict";ws.exports=Function.prototype.apply});var ks=A((Jw,Os)=>{"use strict";Os.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ns=A((Xw,Rs)=>{"use strict";var _d=We(),xd=ln(),Pd=or(),bd=ks();Rs.exports=bd||_d.call(Pd,xd)});var Ds=A((Yw,Cs)=>{"use strict";var Td=We(),Ed=tr(),Id=or(),Sd=Ns();Cs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Ed("a function is required");return Sd(Td,Id,t)},"callBindBasic")});var Fs=A((eO,Bs)=>{"use strict";var Ad=Ds(),Us=sn(),Ls;try{Ls=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var dn=!!Ls&&Us&&Us(Object.prototype,"__proto__"),js=Object,Ms=js.getPrototypeOf;Bs.exports=dn&&typeof dn.get=="function"?Ad([dn.get]):typeof Ms=="function"?o(function(t){return Ms(t==null?t:js(t))},"getDunder"):!1});var qs=A((rO,Gs)=>{"use strict";var Vs=cn(),Zs=pn(),Hs=Fs();Gs.exports=Vs?o(function(t){return Vs(t)},"getProto"):Zs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Zs(t)},"getProto"):Hs?o(function(t){return Hs(t)},"getProto"):null});var mn=A((oO,Ws)=>{"use strict";var $d=Function.prototype.call,zd=Object.prototype.hasOwnProperty,wd=We();Ws.exports=wd.call($d,zd)});var tu=A((iO,eu)=>{"use strict";var j,Od=an(),kd=ja(),Rd=Fa(),Nd=Za(),Cd=Ga(),Ye=Wa(),Xe=tr(),Dd=Xa(),Ud=Qa(),Md=ts(),Ld=ns(),jd=is(),Bd=ss(),Fd=cs(),Vd=ms(),Ys=Function,fn=o(function(e){try{return Ys('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),bt=sn(),Zd=vs(),gn=o(function(){throw new Xe},"throwTypeError"),Hd=bt?(function(){try{return arguments.callee,gn}catch{try{return bt(arguments,"callee").get}catch{return gn}}})():gn,Ke=bs()(),re=qs(),Gd=pn(),qd=cn(),Qs=ln(),Tt=or(),Je={},Wd=typeof Uint8Array>"u"||!re?j:re(Uint8Array),Ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":Ke&&re?re([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%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%":kd,"%eval%":eval,"%EvalError%":Rd,"%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%":Ys,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ke&&re?re(re([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ke||!re?j:re(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Od,"%Object.getOwnPropertyDescriptor%":bt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":Nd,"%ReferenceError%":Cd,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ke||!re?j:re(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ke&&re?re(""[Symbol.iterator]()):j,"%Symbol%":Ke?Symbol:j,"%SyntaxError%":Ye,"%ThrowTypeError%":Hd,"%TypedArray%":Wd,"%TypeError%":Xe,"%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%":Dd,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":Tt,"%Function.prototype.apply%":Qs,"%Object.defineProperty%":Zd,"%Object.getPrototypeOf%":Gd,"%Math.abs%":Ud,"%Math.floor%":Md,"%Math.max%":Ld,"%Math.min%":jd,"%Math.pow%":Bd,"%Math.round%":Fd,"%Math.sign%":Vd,"%Reflect.getPrototypeOf%":qd};if(re)try{null.error}catch(e){Ks=re(re(e)),Ue["%Error.prototype%"]=Ks}var Ks,Kd=o(function e(t){var r;if(t==="%AsyncFunction%")r=fn("async function () {}");else if(t==="%GeneratorFunction%")r=fn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=fn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&re&&(r=re(i.prototype))}return Ue[t]=r,r},"doEval"),Js={__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"]},Et=We(),ir=mn(),Jd=Et.call(Tt,Array.prototype.concat),Xd=Et.call(Qs,Array.prototype.splice),Xs=Et.call(Tt,String.prototype.replace),ar=Et.call(Tt,String.prototype.slice),Yd=Et.call(Tt,RegExp.prototype.exec),Qd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,em=/\\(\\)?/g,tm=o(function(t){var r=ar(t,0,1),n=ar(t,-1);if(r==="%"&&n!=="%")throw new Ye("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ye("invalid intrinsic syntax, expected opening `%`");var i=[];return Xs(t,Qd,function(u,c,p,h){i[i.length]=p?Xs(h,em,"$1"):c||u}),i},"stringToPath"),rm=o(function(t,r){var n=t,i;if(ir(Js,n)&&(i=Js[n],n="%"+i[0]+"%"),ir(Ue,n)){var u=Ue[n];if(u===Je&&(u=Kd(n)),typeof u>"u"&&!r)throw new Xe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ye("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");eu.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Xe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Xe('"allowMissing" argument must be a boolean');if(Yd(/^%?[^%]*%?$/,t)===null)throw new Ye("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=tm(t),i=n.length>0?n[0]:"",u=rm("%"+i+"%",r),c=u.name,p=u.value,h=!1,P=u.alias;P&&(i=P[0],Xd(n,Jd([0,1],P)));for(var _=1,z=!0;_<n.length;_+=1){var x=n[_],s=ar(x,0,1),d=ar(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ye("property names with quotes must have matching quotes");if((x==="constructor"||!z)&&(h=!0),i+="."+x,c="%"+i+"%",ir(Ue,c))p=Ue[c];else if(p!=null){if(!(x in p)){if(!r)throw new Xe("base intrinsic for "+t+" exists, but the property is not available.");return}if(bt&&_+1>=n.length){var y=bt(p,x);z=!!y,z&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[x]}else z=ir(p,x),p=p[x];z&&!h&&(Ue[c]=p)}}return p},"GetIntrinsic")});var nu=A((sO,ru)=>{"use strict";var nm=un();ru.exports=o(function(){return nm()&&!!Symbol.toStringTag},"hasToStringTagShams")});var au=A((cO,iu)=>{"use strict";var om=tu(),ou=om("%Object.defineProperty%",!0),im=nu()(),am=mn(),sm=tr(),sr=im?Symbol.toStringTag:null;iu.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 sm("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");sr&&(n||!am(t,sr))&&(ou?ou(t,sr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[sr]=r)},"setToStringTag")});var uu=A((lO,su)=>{"use strict";var um=Function.prototype.call,cm=Object.prototype.hasOwnProperty,pm=We();su.exports=pm.call(um,cm)});var pu=A((dO,cu)=>{"use strict";cu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var mu=A((mO,du)=>{"use strict";var _n=ga(),lm=require("util"),yn=require("path"),dm=require("http"),mm=require("https"),fm=require("url").parse,gm=require("fs"),ym=require("stream").Stream,hm=require("crypto"),hn=xa(),vm=Ua(),_m=au(),Ne=uu(),vn=pu();function lu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(lu,"escapeHeaderParam");function Z(e){if(!(this instanceof Z))return new Z(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],_n.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(Z,"FormData");lm.inherits(Z,_n);Z.LINE_BREAK=`\r
|
|
2
|
+
`;Z.DEFAULT_CONTENT_TYPE="application/octet-stream";Z.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=_n.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};Z.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)+Z.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ne(t,"httpVersion"))&&!(t instanceof ym))&&(r.knownLength||this._valuesToMeasure.push(t))};Z.prototype._lengthRetriever=function(e,t){Ne(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):gm.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ne(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ne(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};Z.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+lu(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&vn(c,r.header);var p;for(var h in c)if(Ne(c,h)){if(p=c[h],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=h+": "+p.join("; ")+Z.LINE_BREAK)}return"--"+this.getBoundary()+Z.LINE_BREAK+u+Z.LINE_BREAK};Z.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=yn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=yn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ne(e,"httpVersion")&&(r=yn.basename(e.client._httpMessage.path||"")),r)return'filename="'+lu(r)+'"'};Z.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=hn.lookup(e.name)),!r&&e&&e.path&&(r=hn.lookup(e.path)),!r&&e&&e.readable&&Ne(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=hn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=Z.DEFAULT_CONTENT_TYPE),r};Z.prototype._multiPartFooter=function(){return function(e){var t=Z.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};Z.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Z.LINE_BREAK};Z.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ne(e,t)&&(r[t.toLowerCase()]=e[t]);return r};Z.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};Z.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Z.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(Z.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};Z.prototype._generateBoundary=function(){this._boundary="--------------------------"+hm.randomBytes(12).toString("hex")};Z.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};Z.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};Z.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}vm.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};Z.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=fm(e),n=vn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=vn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=mm.request(n):r=dm.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,h=o(function(P,_){return r.removeListener("error",h),r.removeListener("response",p),t.call(this,P,_)},"callback");p=h.bind(this,null),r.on("error",h),r.on("response",p)}}.bind(this)),r};Z.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};Z.prototype.toString=function(){return"[object FormData]"};_m(Z.prototype,"FormData");du.exports=Z});var Jm={};Nn(Jm,{bigcommerce:()=>Km});module.exports=Ju(Jm);var Xu=Object.freeze({status:"aborted"});function E(e,t,r){function n(p,h){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:h,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,h);let P=c.prototype,_=Object.keys(P);for(let z=0;z<_.length;z++){let x=_[z];x in p||(p[x]=P[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var h;let P=r?.Parent?new u:this;n(P,p),(h=P._zod).deferred??(h.deferred=[]);for(let _ of P._zod.deferred)_();return P}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(E,"$constructor");var me=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"}},dr={};function he(e){return e&&Object.assign(dr,e),dr}o(he,"config");function fr(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(fr,"getEnumValues");function Un(e,t){return typeof t=="bigint"?t.toString():t}o(Un,"jsonStringifyReplacer");function $t(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o($t,"cached");function Mn(e){return e==null}o(Mn,"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 Dn=Symbol("evaluating");function Y(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Dn)return n===void 0&&(n=Dn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(Y,"defineLazy");var gr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var Yu=$t(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ln(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Ln,"isPlainObject");var jn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function wt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(wt,"clone");function G(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(G,"normalizeParams");function Bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Bn,"optionalKeys");var Fn={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 Be(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(Be,"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 At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function Se(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Se,"finalizeIssue");function Vn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Vn,"getLengthableOrigin");function yr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(yr,"issue");var Zn=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,Un,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Hn=E("$ZodError",Zn),tt=E("$ZodError",Zn,{Parent:Error});var ec=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new me;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(h=>Se(h,u,he())));throw gr(p,i?.callee),p}return c.value},"_parse"),Ot=ec(tt),tc=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(h=>Se(h,u,he())));throw gr(p,i?.callee),p}return c.value},"_parseAsync"),kt=tc(tt),rc=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new me;return u.issues.length?{success:!1,error:new(e??Hn)(u.issues.map(c=>Se(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),rt=rc(tt),nc=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Se(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=nc(tt);var oc="(?:(?:\\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])))",ic=new RegExp(`^${oc}$`);var Gn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),qn=/^-?\d+n?$/,Wn=/^-?\d+$/,hr=/^-?\d+(?:\.\d+)?$/,Kn=/^(?:true|false)$/i;var Ae=E("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ac={number:"number",bigint:"bigint",object:"date"};var Jn=E("$ZodCheckGreaterThan",(e,t)=>{Ae.init(e,t);let r=ac[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Xn=E("$ZodCheckNumberFormat",(e,t)=>{Ae.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Fn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Wn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Yn=E("$ZodCheckMinLength",(e,t)=>{var r;Ae.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Mn(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=Vn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var vr=E("$ZodCheckStringFormat",(e,t)=>{var r,n;Ae.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Qn=E("$ZodCheckRegex",(e,t)=>{vr.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 to={major:4,minor:3,patch:6};var K=E("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,h)=>{let P=Be(c),_;for(let z of p){if(z._zod.def.when){if(!z._zod.def.when(c))continue}else if(P)continue;let x=c.issues.length,s=z._zod.check(c);if(s instanceof Promise&&h?.async===!1)throw new me;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(P||(P=Be(c,x)))});else{if(c.issues.length===x)continue;P||(P=Be(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,p,h)=>{if(Be(c))return c.aborted=!0,c;let P=i(p,n,h);if(P instanceof Promise){if(h.async===!1)throw new me;return P.then(_=>e._zod.parse(_,h))}return e._zod.parse(P,h)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let P=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return P instanceof Promise?P.then(_=>u(_,c,p)):u(P,c,p)}let h=e._zod.parse(c,p);if(h instanceof Promise){if(p.async===!1)throw new me;return h.then(P=>i(P,n,p))}return i(h,n,p)}}Y(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ct=E("$ZodString",(e,t)=>{K.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gn(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=E("$ZodStringFormat",(e,t)=>{vr.init(e,t),Ct.init(e,t)});var ao=E("$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 xr=E("$ZodNumber",(e,t)=>{K.init(e,t),e._zod.pattern=e._zod.bag.pattern??hr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),so=E("$ZodNumberFormat",(e,t)=>{Xn.init(e,t),xr.init(e,t)}),Pr=E("$ZodBoolean",(e,t)=>{K.init(e,t),e._zod.pattern=Kn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),uo=E("$ZodBigInt",(e,t)=>{K.init(e,t),e._zod.pattern=qn,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 co=E("$ZodAny",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),po=E("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r});var lo=E("$ZodVoid",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),mo=E("$ZodDate",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ro(e,t,r){e.issues.length&&t.issues.push(...Ie(r,e.issues)),t.value[r]=e.value}o(ro,"handleArrayResult");var fo=E("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],h=t.element._zod.run({value:p,issues:[]},n);h instanceof Promise?u.push(h.then(P=>ro(P,r,c))):ro(h,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Nt(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(Nt,"handlePropertyResult");function sc(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(sc,"normalizeDef");function uc(e,t,r,n,i,u){let c=[],p=i.keySet,h=i.catchall._zod,P=h.def.type,_=h.optout==="optional";for(let z in t){if(p.has(z))continue;if(P==="never"){c.push(z);continue}let x=h.run({value:t[z],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Nt(s,r,z,t,_))):Nt(x,r,z,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(uc,"handleCatchall");var go=E("$ZodObject",(e,t)=>{if(K.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let h={...p};return Object.defineProperty(t,"shape",{value:h}),h},"get")})}let n=$t(()=>sc(t));Y(e._zod,"propValues",()=>{let p=t.shape,h={};for(let P in p){let _=p[P]._zod;if(_.values){h[P]??(h[P]=new Set);for(let z of _.values)h[P].add(z)}}return h});let i=et,u=t.catchall,c;e._zod.parse=(p,h)=>{c??(c=n.value);let P=p.value;if(!i(P))return p.issues.push({expected:"object",code:"invalid_type",input:P,inst:e}),p;p.value={};let _=[],z=c.shape;for(let x of c.keys){let s=z[x],d=s._zod.optout==="optional",y=s._zod.run({value:P[x],issues:[]},h);y instanceof Promise?_.push(y.then(m=>Nt(m,p,x,P,d))):Nt(y,p,x,P,d)}return u?uc(_,P,p,h,n.value,e):_.length?Promise.all(_).then(()=>p):p}});function no(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Be(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Se(c,n,he())))}),t)}o(no,"handleUnionResults");var br=E("$ZodUnion",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>zt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let h of t.options){let P=h._zod.run({value:i.value,issues:[]},u);if(P instanceof Promise)p.push(P),c=!0;else{if(P.issues.length===0)return P;p.push(P)}}return c?Promise.all(p).then(h=>no(h,i,e,u)):no(p,i,e,u)}});var yo=E("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,br.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,h]of Object.entries(c)){i[p]||(i[p]=new Set);for(let P of h)i[p].add(P)}}return i});let n=$t(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let h of p){if(u.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);u.set(h,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!et(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ho=E("$ZodRecord",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Ln(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let P of c)if(typeof P=="string"||typeof P=="number"||typeof P=="symbol"){p.add(typeof P=="number"?P.toString():P);let _=t.valueType._zod.run({value:i[P],issues:[]},n);_ instanceof Promise?u.push(_.then(z=>{z.issues.length&&r.issues.push(...Ie(P,z.issues)),r.value[P]=z.value})):(_.issues.length&&r.issues.push(...Ie(P,_.issues)),r.value[P]=_.value)}let h;for(let P in i)p.has(P)||(h=h??[],h.push(P));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:h})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let h=t.keyType._zod.run({value:p,issues:[]},n);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&hr.test(p)&&h.issues.length){let z=t.keyType._zod.run({value:Number(p),issues:[]},n);if(z instanceof Promise)throw new Error("Async schemas not supported in object keys currently");z.issues.length===0&&(h=z)}if(h.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(z=>Se(z,n,he())),input:p,path:[p],inst:e});continue}let _=t.valueType._zod.run({value:i[p],issues:[]},n);_ instanceof Promise?u.push(_.then(z=>{z.issues.length&&r.issues.push(...Ie(p,z.issues)),r.value[h.value]=z.value})):(_.issues.length&&r.issues.push(...Ie(p,_.issues)),r.value[h.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var vo=E("$ZodEnum",(e,t)=>{K.init(e,t);let r=fr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>jn.has(typeof i)).map(i=>typeof i=="string"?je(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),_o=E("$ZodLiteral",(e,t)=>{if(K.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var xo=E("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new me;return r.value=i,r}});function oo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(oo,"handleOptionalResult");var Po=E("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>oo(u,r.value)):oo(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var bo=E("$ZodNullable",(e,t)=>{K.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${zt(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var To=E("$ZodPipe",(e,t)=>{K.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Rt(c,t.in,n)):Rt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Rt(u,t.out,n)):Rt(i,t.out,n)}});function Rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Rt,"handlePipeResult");var Eo=E("$ZodCustom",(e,t)=>{Ae.init(e,t),K.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>io(u,r,n,e));io(i,r,n,e)}});function io(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(yr(i))}}o(io,"handleRefineResult");var So;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 Ao(){return new Tr}o(Ao,"registry");(So=globalThis).__zod_globalRegistry??(So.__zod_globalRegistry=Ao());var Er=globalThis.__zod_globalRegistry;function $o(e,t){return new e({type:"string",...G(t)})}o($o,"_string");function zo(e,t){return new e({type:"string",coerce:!0,...G(t)})}o(zo,"_coercedString");function wo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...G(t)})}o(wo,"_url");function Oo(e,t){return new e({type:"number",checks:[],...G(t)})}o(Oo,"_number");function ko(e,t){return new e({type:"number",coerce:!0,checks:[],...G(t)})}o(ko,"_coercedNumber");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...G(t)})}o(Ro,"_int");function No(e,t){return new e({type:"boolean",...G(t)})}o(No,"_boolean");function Co(e,t){return new e({type:"boolean",coerce:!0,...G(t)})}o(Co,"_coercedBoolean");function Do(e,t){return new e({type:"bigint",coerce:!0,...G(t)})}o(Do,"_coercedBigint");function Uo(e){return new e({type:"any"})}o(Uo,"_any");function Mo(e){return new e({type:"unknown"})}o(Mo,"_unknown");function Lo(e,t){return new e({type:"void",...G(t)})}o(Lo,"_void");function jo(e,t){return new e({type:"date",coerce:!0,...G(t)})}o(jo,"_coercedDate");function Dt(e,t){return new Jn({check:"greater_than",...G(t),value:e,inclusive:!0})}o(Dt,"_gte");function pe(e,t){return new Yn({check:"min_length",...G(t),minimum:e})}o(pe,"_minLength");function $e(e,t){return new Qn({check:"string_format",format:"regex",...G(t),pattern:e})}o($e,"_regex");function Bo(e,t,r){let n=G(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Bo,"_custom");var Q=E("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");K.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>wt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Mt=E("ZodMiniString",(e,t)=>{Ct.init(e,t),Q.init(e,t)});function a(e){return $o(Mt,e)}o(a,"string");var Fo=E("ZodMiniStringFormat",(e,t)=>{_r.init(e,t),Mt.init(e,t)});var Pc=E("ZodMiniURL",(e,t)=>{ao.init(e,t),Fo.init(e,t)});function Vo(e){return wo(Pc,e)}o(Vo,"url");var Lt=E("ZodMiniNumber",(e,t)=>{xr.init(e,t),Q.init(e,t)});function ee(e){return Oo(Lt,e)}o(ee,"number");var bc=E("ZodMiniNumberFormat",(e,t)=>{so.init(e,t),Lt.init(e,t)});function Zo(e){return Ro(bc,e)}o(Zo,"int");var Ir=E("ZodMiniBoolean",(e,t)=>{Pr.init(e,t),Q.init(e,t)});function V(e){return No(Ir,e)}o(V,"boolean");var Ho=E("ZodMiniBigInt",(e,t)=>{uo.init(e,t),Q.init(e,t)});var Tc=E("ZodMiniAny",(e,t)=>{co.init(e,t),Q.init(e,t)});function it(){return Uo(Tc)}o(it,"any");var Ec=E("ZodMiniUnknown",(e,t)=>{po.init(e,t),Q.init(e,t)});function D(){return Mo(Ec)}o(D,"unknown");var Ic=E("ZodMiniVoid",(e,t)=>{lo.init(e,t),Q.init(e,t)});function Go(e){return Lo(Ic,e)}o(Go,"_void");var qo=E("ZodMiniDate",(e,t)=>{mo.init(e,t),Q.init(e,t)});var Sc=E("ZodMiniArray",(e,t)=>{fo.init(e,t),Q.init(e,t)});function k(e,t){return new Sc({type:"array",element:e,...G(t)})}o(k,"array");var Ac=E("ZodMiniObject",(e,t)=>{go.init(e,t),Q.init(e,t),Y(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...G(t)};return new Ac(r)}o(l,"object");var $c=E("ZodMiniUnion",(e,t)=>{br.init(e,t),Q.init(e,t)});function L(e,t){return new $c({type:"union",options:e,...G(t)})}o(L,"union");var zc=E("ZodMiniDiscriminatedUnion",(e,t)=>{yo.init(e,t),Q.init(e,t)});function ze(e,t,r){return new zc({type:"union",options:t,discriminator:e,...G(r)})}o(ze,"discriminatedUnion");var wc=E("ZodMiniRecord",(e,t)=>{ho.init(e,t),Q.init(e,t)});function U(e,t,r){return new wc({type:"record",keyType:e,valueType:t,...G(r)})}o(U,"record");var Oc=E("ZodMiniEnum",(e,t)=>{vo.init(e,t),Q.init(e,t),e.options=Object.values(t.entries)});function w(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Oc({type:"enum",entries:r,...G(t)})}o(w,"_enum");var kc=E("ZodMiniLiteral",(e,t)=>{_o.init(e,t),Q.init(e,t)});function $(e,t){return new kc({type:"literal",values:Array.isArray(e)?e:[e],...G(t)})}o($,"literal");var Rc=E("ZodMiniTransform",(e,t)=>{xo.init(e,t),Q.init(e,t)});function we(e){return new Rc({type:"transform",transform:e})}o(we,"transform");var Nc=E("ZodMiniOptional",(e,t)=>{Po.init(e,t),Q.init(e,t)});function f(e){return new Nc({type:"optional",innerType:e})}o(f,"optional");var Cc=E("ZodMiniNullable",(e,t)=>{bo.init(e,t),Q.init(e,t)});function at(e){return new Cc({type:"nullable",innerType:e})}o(at,"nullable");var Dc=E("ZodMiniPipe",(e,t)=>{To.init(e,t),Q.init(e,t)});function Oe(e,t){return new Dc({type:"pipe",in:e,out:t})}o(Oe,"pipe");var Uc=E("ZodMiniCustom",(e,t)=>{Eo.init(e,t),Q.init(e,t)});function jt(e,t){return Bo(Uc,e??(()=>!0),t)}o(jt,"custom");var st={};Nn(st,{bigint:()=>Vc,boolean:()=>Fc,date:()=>Zc,number:()=>Bc,string:()=>jc});function jc(e){return zo(Mt,e)}o(jc,"string");function Bc(e){return ko(Lt,e)}o(Bc,"number");function Fc(e){return Co(Ir,e)}o(Fc,"boolean");function Vc(e){return Do(Ho,e)}o(Vc,"bigint");function Zc(e){return jo(qo,e)}o(Zc,"date");var Ar=l({retryOnFailure:l({defaultValue:f(V()),hide:f(V())}),continueOnFailure:l({defaultValue:f(V()),hide:f(V())})}),Sr=class{constructor(t,r,n,i,u,c,p,h,P,_,z,x,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=p;this.requireAuth=h;this.errorHandlingOptions=P;this.outputSchema=_;this.audience=z;this.aiMetadata=x;this.classification=s}static{o(this,"IAction")}},H=o(e=>new Sr(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var F=l({displayName:a(),description:f(a()),advanced:f(V()),width:f(w(["half","full"])),icon:f(a()),placeholder:f(a())}),M=o((e,t)=>l({type:$(t),required:V(),defaultValue:f(it())}),"TPropertyValue");var ae=l({...F.shape,...M(a(),"SHORT_TEXT").shape}),ve=l({...F.shape,...M(a(),"LONG_TEXT").shape});var Ko=l({label:a(),value:D(),description:f(a()),icon:f(a())}),Bt=l({disabled:f(V()),placeholder:f(a()),options:k(Ko)});var Gc=w(["cards"]),se=l({...F.shape,options:Bt,display:f(Gc),...M(D(),"STATIC_DROPDOWN").shape}),_e=l({...F.shape,options:Bt,...M(k(D()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var $r=l({...F.shape,...M(D(),"DROPDOWN").shape,refreshers:k(a())}),ut=l({...F.shape,...M(k(D()),"MULTI_SELECT_DROPDOWN").shape,refreshers:k(a())});var xe=l({...F.shape,reveals:f(k(a())),...M(V(),"CHECKBOX").shape});var Pe=l({...F.shape,display:f(w(["stepper"])),min:f(ee()),max:f(ee()),step:f(ee()),...M(ee(),"NUMBER").shape});var ct=l({...F.shape,streaming:f(V()),...M(D(),"FILE").shape});var pt=l({...F.shape,...M(a(),"DATE_TIME").shape});var Jo=U(a(),L([ae,ve,se,ut,_e,xe,Pe,ct,pt])),lt=l({...F.shape,properties:Jo,...M(k(D()),"ARRAY").shape});var Xo=w(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Yo=l({preset:f(Xo),after:f(a()),before:f(a())}),zr=l({...F.shape,display:f(w(["dropdown"])),...M(Yo,"DATE_RANGE").shape});var dt=l({...F.shape,...M(L([U(a(),D())]),"JSON").shape});var Qo=L([ae,se,dt,lt,_e]),qc=U(a(),Qo),wr=l({refreshers:k(a()),...F.shape,...M(D(),"DYNAMIC").shape});var Ft=l({...F.shape,...M(Go(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),ft=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(ft||{});var gt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(gt||{}),Or="both_client_credentials_and_authorization_code";var te=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(te||{}),yt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(yt||{}),Wc=l({strategy:w(yt),paramName:f(a())}),ht=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ht||{});var Vt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vt||{}),ei=l({status:f(ee()),body:f(D()),headers:f(U(a(),a()))}),ti=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f(w(Vt))}),ri=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:ei,handlerId:f(a()),streamStepProgress:f(w(Vt))}),Kc=L([ti,ri]);var Jc=l({body:D(),rawBody:f(D()),headers:U(a(),a()),queryParams:U(a(),a())});function ue(e){return e==null}o(ue,"isNil");function vt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(vt,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var kr=Le(require("crypto"),1);var Xc=128,ke,Ve,Yc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*Xc),kr.default.randomFillSync(ke),Ve=0):Ve+e>ke.length&&(kr.default.randomFillSync(ke),Ve=0)}catch(t){throw ke=void 0,t}Ve+=e},"fillPool"),Qc=o(e=>(Yc(e|=0),ke.subarray(Ve-e,Ve)),"random"),ep=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{if(u<=0)return"";let c="";for(;;){let p=r(i),h=i;for(;h--;)if(c+=e[p[h]&n]||"",c.length===u)return c}}},"customRandom"),oi=o((e,t=21)=>ep(e,t,Qc),"customAlphabet");var tp="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ii=21,CT=a().check($e(new RegExp(`^[0-9a-zA-Z]{${ii}}$`))),rp=oi(tp,ii);var Re=Oe(we(e=>e instanceof Date?e.toISOString():e),a()),ce={id:a(),created:Re,updated:Re},W=o(e=>f(at(e)),"Nullable");function Rr(e){return f(at(w(e)))}o(Rr,"NullableEnum");var MT=Oe(we(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(V())),Ht=o(e=>Oe(we(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(k(e))),"OptionalArrayFromQuery");var BT=U(a(),D());var _t=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(_t||{});var QT=a().check($e(/^#[0-9A-Fa-f]{6}$/));var tE=l({filename:a(),data:D(),type:$("file"),mimetype:f(a())});var np=Le(si());var uE=l({...ce,name:a(),permissions:k(a()),platformId:W(a()),type:a(),userCount:f(ee())});var ui=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ui||{}),Nr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Nr||{}),Cr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Cr||{});var Dr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Dr||{});var Ur=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ur||{});var op=l({mode:w(ui),value:D()}),ip=l({auth:f(a()),fields:U(a(),op)}),ap=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(ip)}),sp=l({type:$("PIECE"),toolName:a().check(pe(1)),pieceMetadata:ap}),up=l({type:$("none")}),cp=l({type:$("access_token"),accessToken:a()}),pp=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),lp=l({type:$("headers"),headers:U(a(),a())}),dp=ze("type",[up,cp,pp,lp]),ci=l({type:$("FLOW"),toolName:a().check(pe(1)),externalFlowId:a(),flowDisplayName:f(a())}),pi=l({type:$("MCP"),toolName:a().check(pe(1)),serverUrl:Vo(),protocol:w(Cr),auth:dp}),li=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(pe(1)),sourceType:w(Nr),sourceId:a(),sourceName:a()}),mp=ze("type",[sp,ci,pi,li]),fp=l({displayName:a(),description:f(a()),type:w(Dr)}),di=l({type:$("MARKDOWN"),markdown:a()}),Ze={type:$("TOOL_CALL"),input:W(U(a(),D())),output:f(D()),toolName:a(),status:w(Ur),toolCallId:a(),startTime:a(),endTime:f(a())},LE=l(Ze),mi=ze("toolCallType",[l({...Ze,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Ze,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Ze,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Ze,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Ze,toolCallType:$("UNKNOWN"),displayName:a()})]),gp=L([di,mi]);var Mr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Mr||{}),be=l({apiKey:a()}),yp=be,hp=l({apiKey:a(),apiKeyHash:a()}),vp=be,_p=be,xp=be,Pp=be,bp=be,Tp=be,Ep=be,vi=l({accessKeyId:a().check(pe(1)),secretAccessKey:a().check(pe(1))}),Ip=l({}),Sp=l({}),Ap=l({}),$p=l({}),zp=l({}),wp=l({}),_i=l({modelId:a(),modelName:a(),modelType:w(Mr)}),xi=l({apiKeyHeader:a(),baseUrl:a(),models:k(_i),defaultHeaders:f(U(a(),a()))}),Pi=l({accountId:a(),gatewayId:a(),models:k(_i),vertexProject:f(a()),vertexRegion:f(a())}),bi=l({resourceName:a(),apiVersion:Oe(we(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),Ti=l({region:a().check(pe(1))}),Op=L([yp,xp,Pp,bp,Tp,_p,vp,hp,vi,Ep]),Ei=L([xi,Pi,bi,Ti,Ip,Ap,$p,zp,Sp,wp]),kp=l({id:a(),name:a(),type:w(Mr)}),Rp=l({id:a(),name:a(),provider:w(_t),config:Ei,enabledForChat:V()}),Np=l({provider:w(_t),config:Ei,auth:Op,platformId:a()});var VE={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},fi=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Cp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Dp=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],gi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Up=["grok-4.20","grok-4.1-fast"],Mp={openai:fi,anthropic:Cp,google:gi,activepieces:[...Dp.map(e=>`anthropic/${e}`),...fi.map(e=>`openai/${e}`),...gi.map(e=>`google/${e}`),...Up.map(e=>`x-ai/${e}`)]};var yi=128e3,Lp={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function jp({provider:e}){return e?Lp[e]??yi:yi}o(jp,"getMaxContextTokens");var hi={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"},Bp={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Fp=new Set(["anthropic","mistral"]);function fe(e){return{chatModels:Mp[e],maxContextTokens:jp({provider:e}),defaultEmbeddingModel:hi[e],supportsEmbedding:hi[e]!==void 0,supportsImageGeneration:!Fp.has(e),webSearch:Bp[e]}}o(fe,"buildProviderCapabilities");var Vp={openai:fe("openai"),anthropic:fe("anthropic"),openrouter:fe("openrouter"),azure:fe("azure"),google:fe("google"),"cloudflare-gateway":fe("cloudflare-gateway"),custom:fe("custom"),bedrock:fe("bedrock"),mistral:fe("mistral"),activepieces:fe("activepieces")};var Zp=l({base64Url:a(),fileName:a(),extension:f(a())}),Hp=l({mimeType:a(),url:a(),fileName:f(a())}),Lr=L([Zp,Hp]);var Gp=L([l({type:$("file"),value:Lr}),l({type:$("markdown"),value:a(),files:f(k(Lr))})]),qp=l({sessionId:a(),message:a(),files:f(k(a()))});var Si=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Si||{}),Ai=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ai||{}),jr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(jr||{});var Wp=L([l({...ce,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:k(l({value:a()}))})}),l({...ce,name:a(),externalId:a(),type:L([$("TEXT"),$("NUMBER"),$("DATE"),$("DATETIME")]),tableId:a(),projectId:a()})]),Kp=l({...ce,name:a(),folderId:W(a()),projectId:a(),externalId:a(),status:Rr(Ai),trigger:Rr(Si)}),Jp=l({...ce,tableId:a(),projectId:a(),cells:U(a(),l({updated:a(),created:a(),value:D(),fieldName:a()}))}),Xp=l({events:k(w(jr)),webhookUrl:a(),flowId:a()}),Yp=l({fields:k(l({id:a(),name:a()})),rows:k(U(a(),a())),name:a()}),Qp=l({projectId:a(),limit:f(st.number()),cursor:f(a()),name:f(a()),externalIds:Ht(a()),folderId:f(a()),folderIds:Ht(a())}),el=l({records:k(k(l({fieldId:a(),value:zi()}))),tableId:a()}),tl=l({cells:f(k(l({fieldId:a(),value:zi()}))),tableId:a(),agentUpdate:f(V())}),$i=ze("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),Ii("exists"),Ii("not_exists")]),rl=l({tableId:a(),limit:f(st.number()),cursor:f(a()),filters:Ht($i)});function zi(){return Oe(we(e=>e==null?e:String(e)),at(a()))}o(zi,"coerceToString");function Ce(e){return l({fieldId:a(),operator:$(e),value:a()})}o(Ce,"valueFilter");function Ii(e){return l({fieldId:a(),operator:$(e)})}o(Ii,"existenceFilter");var nl=l({status:f(ee()),body:f(D()),headers:f(U(a(),a()))}),ol=l({...ce,deleted:W(Re),ownerId:a(),displayName:a(),platformId:a(),externalId:W(a())});var wi=l({name:a(),description:f(a()),type:a(),required:V()}),il=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:k(wi),returnsResponse:V()})});var Oi="^[0-9]+\\.[0-9]+\\.[0-9]+$",uI=new RegExp(Oi),sl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",cI=a().check($e(new RegExp(Oi))),pI=a().check($e(new RegExp(sl))),ul=l({packageType:$("ARCHIVE"),pieceType:w(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ki=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Ri=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),lI=L([ki,Ri]),dI=L([ul,ki,Ri]);var cl=ze("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Zo().check(Dt(6e4))})]),mI=l({...ce,type:w(te),projectId:a(),flowId:a(),triggerName:a(),schedule:W(cl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:W(a()),simulate:V()}),Ni=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(Ni||{}),Ci=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ci||{}),Di=(r=>(r.S3="S3",r.DB="DB",r))(Di||{}),fI=l({...ce,projectId:W(a()),platformId:W(a()),type:w(Ni),compression:w(Ci),data:f(D()),location:w(Di),size:W(ee()),fileName:W(a()),s3Key:W(a()),metadata:W(U(a(),a()))}),Ui=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ui||{}),Mi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Mi||{}),gI=l({id:a(),email:a(),firstName:a(),status:w(Mi),externalId:W(a()),platformId:W(a()),platformRole:w(Ui),lastName:a(),created:Re,updated:Re,lastActiveDate:W(Re),imageUrl:W(a())});var Br=l({...F.shape,...M(U(a(),D()),"OBJECT").shape});var Fr=l({...F.shape,formatProperty:f(a()),...M(a(),"RICH_TEXT").shape});var Fi=l({...F.shape,...M(a(),"COLOR").shape});var Vr=L([ae,ve,Fr,Ft,xe,se,_e,$r,ut,wr,Pe,lt,Br,dt,pt,zr,ct,Fi]),g={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var ge=l({displayName:a(),description:f(a()),hasConnectionIdentifier:f(V())});var Vi=l({username:a(),password:a()}),Zr=l({...ge.shape,username:l({displayName:a(),description:f(a())}),password:l({displayName:a(),description:f(a())}),...M(Vi,"BASIC_AUTH").shape});var ml=U(a(),L([ae,ve,Pe,xe,se])),Hr=l({...ge.shape,props:ml,...M(D(),"CUSTOM_AUTH").shape});var De=l({...ge.shape,...M(l({auth:a()}),"SECRET_TEXT").shape});var fl=U(a(),L([ae,ve,De,Pe,xe,se,_e,Ft])),Zi=l({...ge.shape,props:fl,...M(D(),"OIDC").shape});var Gr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Gr||{}),Hi=L([ae,De,se]),Gi=U(a(),Hi),gl=l({props:f(U(a(),Hi)),authUrl:a(),tokenUrl:a(),scope:k(a()),prompt:f(L([$("none"),$("consent"),$("login"),$("omit")])),pkce:f(V()),pkceMethod:f(L([$("plain"),$("S256")])),authorizationMethod:f(w(Gr)),grantType:f(L([w(gt),$(Or)])),extra:f(U(a(),a()))}),qi=l({access_token:a(),props:f(Gi),data:U(a(),it())}),qr=l({...ge.shape,...gl.shape,...M(qi,"OAUTH2").shape});var He=L([Zr,Hr,Zi,qr,De]),xt="Connection",Wr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var YS={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 yl=l({...F.shape,...M(D(),"CUSTOM").shape,code:a()});var hl=L([Vr,He]),Kr=U(a(),hl),_A=U(a(),Vr);var Wi=L([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]),Ge=class{constructor(t,r,n,i,u,c,p,h,P,_,z,x,s,d,y,m,v,b,B,ie,de){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=h;this.renewConfiguration=P;this.onRenew=_;this.onEnable=z;this.onDisable=x;this.onStart=s;this.run=d;this.test=y;this.sampleData=m;this.testStrategy=v;this.outputSchema=b;this.aiMetadata=B;this.classification=ie;this.propertyGroups=de}static{o(this,"ITrigger")}},J=o(e=>{switch(e.type){case"WEBHOOK":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"POLLING":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"MANUAL":return new Ge(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups);case"APP_WEBHOOK":return new Ge(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,ue(e.sampleData)&&ue(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata,e.classification,e.propertyGroups)}},"createTrigger");var Ki="2",qt="0.82.0";var Jr=class{constructor(t,r,n,i,u,c,p,h,P=qt,_,z="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=h;this.minimumSupportedRelease=P;this.maximumSupportedRelease=_;this.description=z;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ki}),"getContextInfo");(!_l(P)||xl(P,qt))&&(this.minimumSupportedRelease=qt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:vl(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}},Xi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Jr(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 vl(e){if(e!==void 0)return Array.isArray(e)?e.map(Ji):Ji(e)}o(vl,"withConnectionIdentifierFlag");function Ji(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Ji,"flagConnectionIdentifier");function _l(e){return/^\d+\.\d+\.\d+$/.test(e)}o(_l,"isValidSimpleSemver");function xl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(xl,"isSemverLessThan");var Pl=f(U(a(),U(a(),a()))),Yi=l({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:k(a()),platformId:f(a()),directoryPath:f(a()),auth:f(L([He,k(He)])),version:a(),categories:f(k(w(ft))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(V()),i18n:Pl}),bl=w(["human","ai","both"]),Qi=l({description:f(a()),idempotent:f(V())}),ea=w(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Tl=w(["tabs","section","summary","builder","footer"]),ta=l({key:a(),display:Tl,label:f(a()),description:f(a()),icon:f(a()),props:k(a())}),ra=l({name:a(),displayName:a(),description:a(),props:Kr,propertyGroups:f(k(ta)),requireAuth:V(),errorHandlingOptions:f(Ar),outputSchema:f(jt()),audience:f(bl),aiMetadata:f(Qi),classification:f(ea)}),na=l({name:a(),displayName:a(),description:a(),props:Kr,propertyGroups:f(k(ta)),errorHandlingOptions:f(Ar),type:w(te),sampleData:D(),handshakeConfiguration:f(jt()),renewConfiguration:f(Wi),testStrategy:w(ht),outputSchema:f(jt()),aiMetadata:f(Qi),classification:f(ea)}),El=l({...Yi.shape,actions:U(a(),ra),triggers:U(a(),na)}),Il=l({...Yi.shape,actions:ee(),triggers:ee(),suggestedActions:f(k(ra)),suggestedTriggers:f(k(na))}),oa=l({projectUsage:ee(),pieceType:w(Fe),packageType:w(mt),platformId:f(a()),archiveId:f(a())}),P$=l({...El.shape,...oa.shape}),b$=l({...Il.shape,...oa.shape}),T$=l({name:a(),version:a()});var Sl=Le(require("path")),Al=Le(require("fs/promises"));var qe=require("node:stream");var Wt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Kt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Xr,r=new Yr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Xr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Yr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Pt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function ia({error:e,requestBody:t}){return e instanceof Pt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(ia,"toFailsafeOutput");var Jt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Jt||{});var Xt=class extends Wt{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),u=this.getHeaders(t),c=t.queryParams??{};for(let[B,ie]of Object.entries(c))i.append(B,ie);let p=i.toString(),h=p?`${n}?${p}`:n,P=t.responseType??"json",_=t.followRedirects??!0,z=t.retries??0,{body:x,extraHeaders:s,isStream:d}=$l(t.method)?zl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=Ol({...u,...s}),m=await wl(async()=>{let B=new AbortController,ie=t.timeout&&t.timeout>0?setTimeout(()=>B.abort(),t.timeout):void 0;try{let de={method:t.method.toString(),headers:y,body:x,redirect:_?"follow":"manual",signal:B.signal};return d&&(de.duplex="half"),r?.dispatcher!==void 0&&(de.dispatcher=r.dispatcher),await fetch(h,de)}finally{ie!==void 0&&clearTimeout(ie)}},d?0:z),v=_?300:400;if(m.status<200||m.status>=v){let B=await aa(m,P==="stream"?"text":P),ie=new Pt(t.body,{status:m.status,responseBody:B});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ie),ie}let b=await aa(m,P);return{status:m.status,headers:kl(m.headers),body:b}}};function $l(e){return e!=="GET"&&e!=="HEAD"}o($l,"acceptsRequestBody");function zl(e,t){if(ua(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Rl(e)){let n=new qe.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof qe.Readable?{body:e,extraHeaders:{},isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(zl,"serializeBody");async function aa(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return ua(e.body)?qe.Readable.from([]):qe.Readable.fromWeb(e.body);case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(aa,"parseResponseBody");async function wl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await sa(n);continue}return i}catch(i){if(r=i,n<t){await sa(n);continue}throw i}throw r}o(wl,"sendWithRetries");function sa(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(sa,"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 kl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(kl,"toHttpHeaders");function Rl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Rl,"isNodeFormData");function ua(e){return e==null}o(ua,"isNil");var Yt=new Xt;var xm=Le(require("fs")),fu=Le(mu());var Pm={"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 bm(e){let t=e.split(";")[0].trim().toLowerCase();return Pm[t]??""}o(bm,"contentTypeToExtension");var Tm=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Em=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 gu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:h="headers",classification:P="WRITE"}){return H({audience:"human",name:u||"custom_api_call",classification:P,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:g.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:_})=>({url:g.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Em(t,_)}/resource or /resource`,required:!0,defaultValue:_?t(_):"",...c?.url??{}})}),"props")}),method:g.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Jt).map(_=>({label:_,value:_}))},...c?.method??{}}),headers:g.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:g.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:g.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:g.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:_})=>{if(!_)return{};let z=_,x={};switch(z){case"none":break;case"json":x.data=g.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":x.data=g.LongText({displayName:"Raw Body",required:!0});break;case"form_data":x.data=g.Array({displayName:"Form Data",required:!0,properties:{fieldName:g.ShortText({displayName:"Field Name",required:!0}),fieldType:g.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:g.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:g.File({displayName:"File Field Value",required:!1})}});break}return x},"props")}),response_is_binary:g.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:g.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:g.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:g.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async _=>{let{method:z,url:x,headers:s,queryParams:d,body:y,body_type:m,failsafe:v,timeout:b,response_is_binary:B,followRedirects:ie}=_.propsValue;Zt(z,"Method"),Zt(x,"URL");let de=ue(r)?{}:await r(_.auth,_.propsValue),Te=x.url,Vu=Te.startsWith("http://")||Te.startsWith("https://")?Te:Tm({baseUrl:t(_.auth),relativePath:Te}),Ee={method:z,url:Vu,headers:{...s??{},...h==="headers"||!ue(h)?de:{}},queryParams:{...h==="queryParams"?de:{},...d??{}},timeout:b?b*1e3:0,followRedirects:ie};if(B&&(Ee.responseType="arraybuffer"),y)if(m&&m!=="none"){let ye=y.data;if(m==="form_data"){let Zu=ye,It=new fu.default;for(let{fieldName:On,fieldType:kn,textFieldValue:Rn,fileFieldValue:lr}of Zu)kn==="text"&&!vt(Rn)?It.append(On,Rn):kn==="file"&&!vt(lr)&&It.append(On,lr.data,{filename:lr?.filename});Ee.body=It,Ee.headers={...Ee.headers,...It.getHeaders()}}else Ee.body=ye}else m||(Ee.body=y);try{let ye=await Yt.sendRequest(Ee);return await Im(_.files,ye.body,ye.status,ye.headers,B)}catch(ye){if(v)return ia({error:ye,requestBody:Ee.body});throw ye}},"run")})}o(gu,"createCustomApiCallAction");var Im=o(async(e,t,r,n,i)=>{let u;if(i&&Sm(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=bm(c??"")||"txt",h;t instanceof ArrayBuffer?h=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?h=t:h=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:h})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Sm=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ur=o(e=>`https://api.bigcommerce.com/stores/${e}`,"GET_BASE_URL");function Me(e){return{disabled:!0,options:[],placeholder:e}}o(Me,"handleDropdownError");async function oe({method:e,path:t,body:r,auth:n,filter:i=!1}){let u=ur(n.storeHash),c=i&&r?Array.isArray(r)?r.map(p=>cr(p)):cr(r):r;return await Yt.sendRequest({method:e,url:`${u}${t}`,headers:{"X-Auth-Token":n.accessToken,"Content-Type":"application/json",Accept:"application/json"},body:c}).then(p=>p.body).catch(p=>{throw new Error(`Error in request to ${t}: ${p.message||JSON.stringify(p)}`)})}o(oe,"fireHttpRequest");var T={async createWebhook({auth:e,payload:t}){return await oe({auth:e,path:"/v3/hooks",method:"POST",body:t})},async createCustomer({auth:e,payload:t}){return await oe({auth:e,path:"/v3/customers",method:"POST",body:t})},async fetchCustomers({auth:e,queryString:t}){return await oe({auth:e,path:`/v3/customers${t?`?${t}`:""}`,method:"GET"})},async fetchCustomerAddresses({auth:e,queryString:t}){return await oe({auth:e,path:`/v3/customers/addresses${t?`?${t}`:""}`,method:"GET"})},async fetchProducts({auth:e,queryString:t}){return await oe({auth:e,path:`/v3/catalog/products${t?`?${t}`:""}`,method:"GET"})},async createProduct({auth:e,payload:t}){return await oe({auth:e,path:"/v3/catalog/products",method:"POST",body:t,filter:!0})},async updateProduct({auth:e,productId:t,payload:r}){return await oe({auth:e,path:`/v3/catalog/products/${t}`,method:"PUT",body:r,filter:!0})},async deleteProduct({auth:e,productId:t}){return await oe({auth:e,path:`/v3/catalog/products/${t}`,method:"DELETE"})},async fetchOrders({auth:e,queryString:t}){return await oe({auth:e,path:`/v2/orders${t?`?${t}`:""}`,method:"GET"})},async fetchOrder({auth:e,orderId:t}){return await oe({auth:e,path:`/v2/orders/${t}`,method:"GET"})},async fetchCategories({auth:e,queryString:t}){return await oe({auth:e,path:`/v3/catalog/categories${t?`?${t}`:""}`,method:"GET"})},async createBlogPost({auth:e,payload:t}){return await oe({auth:e,path:"/v2/blog/posts",method:"POST",body:t})},async createCustomerAddress({auth:e,payload:t}){return await oe({auth:e,path:"/v3/customers/addresses",method:"POST",body:t})},async deleteWebhook({auth:e,webhookId:t}){return await oe({auth:e,path:`/v3/hooks/${t}`,method:"DELETE"})}};function cr(e){if(e!=null)return typeof e!="object"?e:Array.isArray(e)?e.map(cr):Object.fromEntries(Object.entries(e).filter(([t,r])=>r!=null).map(([t,r])=>[t,cr(r)]))}o(cr,"filterNulls");var I=Wr.CustomAuth({description:"Enter your BigCommerce API credentials. ",props:{instruction:g.MarkDown({value:`1. Login to https://www.bigcommerce.com/essentials/
|
|
4
4
|
2. Go to Settings
|
|
5
5
|
3. Scroll down to API
|
|
6
6
|
4. Click on "Store Level API Accounts"
|
|
7
7
|
5. Click "Create API Account" button
|
|
8
8
|
6. Enter a name and add required scopes
|
|
9
|
-
7. Save - you will get a downloaded file containing your access token and store hash`}),storeHash:f.ShortText({displayName:"Store Hash",description:"Your BigCommerce store hash (e.g., abcd1234)",required:!0}),accessToken:f.ShortText({displayName:"Access Token",description:"Your BigCommerce API access token",required:!0})},required:!0,async validate(e){try{return await T.fetchProducts({auth:e.auth}),{valid:!0}}catch{return{valid:!1,error:"Could not validate credentials. please check your credentials are correct."}}}});var Kd="abandoned cart",fn=`${Kd}-trigger-store-key`,Jd="store/cart/abandoned",Gs=J({auth:I,name:"abandonedCart",displayName:"Abandoned Cart",description:"Triggers when a cart is abandoned",aiMetadata:{description:"Fires when a shopper abandons a cart in the BigCommerce store (the cart sits inactive without checkout completing). The event identifies the affected cart; use it to drive abandoned-cart recovery flows."},props:{},sampleData:{producer:"stores/dxqdddcaklwsso",hash:"3610addd127e330084ddddd7ddd09b78abfd1a85",created_at:1761809622,store_id:"1003425529",scope:"store/cart/abandoned",data:{type:"cart",id:"ss-598f-4c95-813b-0ess950562770d"}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Jd,destination:e.webhookUrl,is_active:!0}});await e.store.put(fn,t.data.id)},async onDisable(e){let t=await e.store.get(fn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(fn)})},async run(e){return[e.payload.body]}});var Xd="cart created",gn=`${Xd}-trigger-store-key`,Yd="store/cart/created",Ks=J({auth:I,name:"cartCreated",displayName:"Cart Created",description:"Triggers when a new cart is created",aiMetadata:{description:"Fires when a new shopping cart is created in the BigCommerce store (a shopper adds the first item to a fresh cart). The event identifies the new cart."},props:{},sampleData:{producer:"stores/dxqdddcaklwsso",hash:"3610addd127e330084ddddd7ddd09b78abfd1a85",created_at:1761809622,store_id:"1003425529",scope:"store/cart/created",data:{type:"cart",id:"ss-598f-4c95-813b-0ess950562770d"}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Yd,destination:e.webhookUrl,is_active:!0}});await e.store.put(gn,t.data.id)},async onDisable(e){let t=await e.store.get(gn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(gn)})},async run(e){return[e.payload.body]}});var Qd="customer address created",yn=`${Qd}-trigger-store-key`,em="store/customer/address/created",Js=J({auth:I,name:"customerAddressCreated",displayName:"Customer Address Created",description:"Triggers when a new customer address is created",aiMetadata:{description:"Fires when a new address is added to a customer in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/address/created",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:em,destination:e.webhookUrl,is_active:!0}});await e.store.put(yn,t.data.id)},async onDisable(e){let t=await e.store.get(yn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(yn)})},async run(e){return[e.payload.body]}});var tm="customer address updated",hn=`${tm}-trigger-store-key`,rm="store/customer/address/updated",Xs=J({auth:I,name:"customerAddressUpdated",displayName:"Customer Address Updated",description:"Triggers when a new customer address is updated",aiMetadata:{description:"Fires when an existing customer address is updated in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/address/updated",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:rm,destination:e.webhookUrl,is_active:!0}});await e.store.put(hn,t.data.id)},async onDisable(e){let t=await e.store.get(hn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(hn)})},async run(e){return[e.payload.body]}});var nm="customer created",vn=`${nm}-trigger-store-key`,om="store/customer/created",Ys=J({auth:I,name:"customerCreated",displayName:"Customer Created",description:"Triggers when a new customer is created",aiMetadata:{description:"Fires when a new customer is created in the BigCommerce store. The event identifies the new customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/created",data:{type:"customer",id:2,origin_channel_id:1,channel_ids:[1]}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:om,destination:e.webhookUrl,is_active:!0}});await e.store.put(vn,t.data.id)},async onDisable(e){let t=await e.store.get(vn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(vn)})},async run(e){return[e.payload.body]}});var im="customer updated",xn=`${im}-trigger-store-key`,am="store/customer/updated",Qs=J({auth:I,name:"customerUpdated",displayName:"Customer Updated",description:"Triggers when a customer is updated",aiMetadata:{description:"Fires when an existing customer record is updated in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/updated",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:am,destination:e.webhookUrl,is_active:!0}});await e.store.put(xn,t.data.id)},async onDisable(e){let t=await e.store.get(xn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(xn)})},async run(e){return[e.payload.body]}});var sm="order created",_n=`${sm}-trigger-store-key`,um="store/order/created",eu=J({auth:I,name:"orderCreated",displayName:"Order Created",description:"Triggers when a new order is created",aiMetadata:{description:"Fires when a new order is created in the BigCommerce store. The event identifies the new order; pair with Get Order to fetch its full details."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/created",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:um,destination:e.webhookUrl,is_active:!0}});await e.store.put(_n,t.data.id)},async onDisable(e){let t=await e.store.get(_n);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(_n)})},async run(e){return[e.payload.body]}});var cm="order updated",Pn=`${cm}-trigger-store-key`,pm="store/order/updated",tu=J({auth:I,name:"orderUpdated",displayName:"Order Updated",description:"Triggers when an order is updated",aiMetadata:{description:"Fires when an existing order is updated in the BigCommerce store (any change to the order, not just its status). The event identifies the affected order; pair with Get Order for full details."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/updated",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:pm,destination:e.webhookUrl,is_active:!0}});await e.store.put(Pn,t.data.id)},async onDisable(e){let t=await e.store.get(Pn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(Pn)})},async run(e){return[e.payload.body]}});var lm="order status updated",bn=`${lm}-trigger-store-key`,dm="store/order/statusUpdated",ru=J({auth:I,name:"orderStatusUpdated",displayName:"Order Status Updated",description:"Triggers when an order status has changed",aiMetadata:{description:"Fires specifically when an order\u2019s status changes in the BigCommerce store (e.g. moves to shipped or completed). Use this instead of Order Updated when you only care about status transitions. The event identifies the affected order."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/statusUpdated",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:dm,destination:e.webhookUrl,is_active:!0}});await e.store.put(bn,t.data.id)},async onDisable(e){let t=await e.store.get(bn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(bn)})},async run(e){return[e.payload.body]}});var mm="product created",Tn=`${mm}-trigger-store-key`,fm="store/product/created",nu=J({auth:I,name:"productCreated",displayName:"Product Created",description:"Triggers when a new product is created",aiMetadata:{description:"Fires when a new product is added to the BigCommerce store catalog. The event identifies the new product."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"c6db17090e98d2c58c0cb1988b5e9ace48215e22",created_at:1761808831,store_id:"1003425529",scope:"store/product/created",data:{type:"product",id:113}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:fm,destination:e.webhookUrl,is_active:!0}});await e.store.put(Tn,t.data.id)},async onDisable(e){let t=await e.store.get(Tn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(Tn)})},async run(e){return[e.payload.body]}});var gm="shipment created",In=`${gm}-trigger-store-key`,ym="store/shipment/created",ou=J({auth:I,name:"shipmentCreated",displayName:"Shipment Created",description:"Triggers when a new shipment is created",aiMetadata:{description:"Fires when a new shipment is created for an order in the BigCommerce store (items are shipped/fulfilled). The event identifies the new shipment."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/shipment/created",data:{type:"shipment",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:ym,destination:e.webhookUrl,is_active:!0}});await e.store.put(In,t.data.id)},async onDisable(e){let t=await e.store.get(In);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(In)})},async run(e){return[e.payload.body]}});var iu=V({auth:I,name:"createCustomer",displayName:"Create Customer",description:"Creates a customer",audience:"both",aiMetadata:{description:"Creates a new customer record in a BigCommerce store from an email plus first/last name (company, phone, and notes optional). Use to register a shopper or contact. Not idempotent: each call adds a new customer, and BigCommerce rejects a duplicate email rather than returning the existing one, so call Search Customer or Find or Create Customer first if the customer may already exist.",idempotent:!1},props:{email:f.ShortText({displayName:"Email",description:"Customer email address",required:!0}),first_name:f.ShortText({displayName:"First Name",description:"Customer first name",required:!0}),last_name:f.ShortText({displayName:"Last Name",description:"Customer last name",required:!0}),company:f.ShortText({displayName:"Company",description:"Customer company name",required:!1}),phone:f.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),notes:f.LongText({displayName:"Notes",description:"Customer notes",required:!1})},async run(e){return await T.createCustomer({auth:e.auth.props,payload:[{email:e.propsValue.email,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,company:e.propsValue.company,phone:e.propsValue.phone,notes:e.propsValue.notes}]})}});var au=V({auth:I,name:"createAProduct",displayName:"Create a Product",description:"Creates a Product",audience:"both",aiMetadata:{description:"Creates a new catalog product in a BigCommerce store. Use to add an item to the store. Requires name, type (physical or digital), weight, and price; SKU, description, and brand_id are optional. Not idempotent: each call adds a new product, so search the catalog first if it may already exist.",idempotent:!1},props:{name:f.ShortText({displayName:"Product Name",description:"Name of the product",required:!0}),type:f.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!0,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),sku:f.ShortText({displayName:"SKU",description:"Product SKU",required:!1}),description:f.LongText({displayName:"Description",description:"Product description",required:!1}),weight:f.Number({displayName:"Weight",description:"Product weight",required:!0}),price:f.Number({displayName:"Price",description:"Product price",required:!0}),brand_id:f.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){return await T.createProduct({auth:e.auth.props,payload:{name:e.propsValue.name,type:e.propsValue.type,sku:e.propsValue.sku,description:e.propsValue.description,weight:e.propsValue.weight,price:e.propsValue.price,brand_id:e.propsValue.brand_id}})}});var su=V({auth:I,name:"updateAProduct",displayName:"Update a Product",description:"Updates an existing Product",audience:"both",aiMetadata:{description:"Updates an existing catalog product in a BigCommerce store, identified by its productId. Only the fields you supply are sent (null/undefined values are dropped so existing data is preserved), so use it for partial edits to name, type, SKU, description, weight, price, or brand. Idempotent: re-applying the same field values leaves the product in the same state.",idempotent:!0},props:{productId:f.ShortText({displayName:"Product ID",description:"The ID of the product to update",required:!0}),name:f.ShortText({displayName:"Product Name",description:"Name of the product",required:!1}),type:f.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!1,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),sku:f.ShortText({displayName:"SKU",description:"Product SKU",required:!1}),description:f.LongText({displayName:"Description",description:"Product description",required:!1}),weight:f.Number({displayName:"Weight",description:"Product weight",required:!1}),price:f.Number({displayName:"Price",description:"Product price",required:!1}),brand_id:f.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){let{productId:t,...r}=e.propsValue,n=Object.fromEntries(Object.entries(r).filter(([i,u])=>u!=null));return await T.updateProduct({auth:e.auth.props,productId:t,payload:n})}});var uu=V({auth:I,name:"deleteAProduct",displayName:"Delete a Product",description:"Deletes an existing Product",audience:"both",aiMetadata:{description:"Permanently deletes a catalog product from a BigCommerce store by its productId. Use to remove an item from the store. This is destructive and cannot be undone. Effectively idempotent: deleting an already-removed product has no further effect, though the call may error if the id no longer exists.",idempotent:!0},props:{productId:f.ShortText({displayName:"Product ID",description:"The ID of the product to delete",required:!0})},async run(e){return await T.deleteProduct({auth:e.auth.props,productId:e.propsValue.productId})}});var cu=V({auth:I,name:"getOrder",displayName:"Get Order",description:"Gets details of an order",audience:"both",aiMetadata:{description:"Retrieves the full details of a single BigCommerce order by its orderId. Use when you already have an order id (e.g. from an order trigger or List Orders) and need its data. Idempotent read-only lookup with no side effects.",idempotent:!0},props:{orderId:f.ShortText({displayName:"Order ID",description:"The ID of the order to retrieve",required:!0})},async run(e){return await T.fetchOrder({auth:e.auth.props,orderId:e.propsValue.orderId})}});var pu=V({auth:I,name:"listOrders",displayName:"List Orders",description:"Lists all orders",audience:"both",aiMetadata:{description:"Lists orders from a BigCommerce store. With no filters it returns all orders; optionally narrow by customer_id and/or status_id to a subset. Use to browse or find orders when you do not have a specific order id. Idempotent read-only query with no side effects.",idempotent:!0},props:{customer_id:f.Number({displayName:"Customer ID",description:"Filter by customer ID",required:!1}),status_id:f.Number({displayName:"Status ID",description:"Filter by status ID",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.customer_id!==void 0&&e.propsValue.customer_id!==null&&t.append("customer_id",e.propsValue.customer_id.toString()),e.propsValue.status_id!==void 0&&e.propsValue.status_id!==null&&t.append("status_id",e.propsValue.status_id.toString()),await T.fetchOrders({auth:e.auth.props,queryString:t.toString()})}});var lu=V({auth:I,name:"listCategories",displayName:"List Categories",description:"Lists all categories",audience:"both",aiMetadata:{description:"Lists product categories from a BigCommerce store. With no name filter it returns all categories; provide a name to filter to matching categories. Use to discover category names or ids before assigning products. Idempotent read-only query with no side effects.",idempotent:!0},props:{name:f.ShortText({displayName:"Category Name",description:"Filter by category name",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.name&&t.append("name",e.propsValue.name),await T.fetchCategories({auth:e.auth.props,queryString:t.toString()})}});var du=V({auth:I,name:"createBlogPost",displayName:"Create Blog Post",description:"Creates a blog post",audience:"both",aiMetadata:{description:"Creates a blog post in a BigCommerce store's blog. Requires a title and body (HTML supported); author, URL, published date, meta description/keywords, tags, and a published flag are optional. Use to publish store blog content. Not idempotent: each call creates a new post.",idempotent:!1},props:{title:f.ShortText({displayName:"Title",description:"Blog post title",required:!0}),body:f.LongText({displayName:"Body",description:"Blog post content (HTML supported)",required:!0}),author:f.ShortText({displayName:"Author",description:"Author name",required:!1}),url:f.ShortText({displayName:"URL",description:"URL for the public blog post. Example - /blog/welcome-bigcommerce/",required:!1}),published_date:f.DateTime({displayName:"Published Date",description:"Published Date for the blog post. Example - Wed, 10 Aug 2022 15:39:15 -0500",required:!1}),meta_description:f.LongText({displayName:"Meta Description",description:"Description text for this blog post\u2019s <meta/> element.",required:!1}),meta_keywords:f.LongText({displayName:"Meta Keywords",description:"Comma seperated (,) Keywords for this blog post\u2019s <meta/> element. Eg welcome, bigcommerce",required:!1}),tags:f.Array({displayName:"Tags",description:"Array of tags",required:!1}),is_published:f.Checkbox({displayName:"Is Published",description:"Whether the post is published",required:!1,defaultValue:!0})},async run(e){return await T.createBlogPost({auth:e.auth.props,payload:{title:e.propsValue.title,body:e.propsValue.body,author:e.propsValue.author,tags:e.propsValue.tags,is_published:e.propsValue.is_published,meta_description:e.propsValue.meta_description,meta_keywords:e.propsValue.meta_keywords,published_date:e.propsValue.published_date,url:e.propsValue.url}})}});var ar=o(({required:e})=>f.Dropdown({auth:I,displayName:"Customer",description:"Select the customer",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!t)return Re("Please connect your account first");try{let r=await T.fetchCustomers({auth:t.props}),n=Array.isArray(r?.data)?r.data:[];return n.length===0?Re("No customers found"):{disabled:!1,options:n.map(u=>({label:[u.first_name,u.last_name].filter(l=>typeof l=="string"&&l.trim()!=="").join(" ")||u.email||u.id,value:u.id}))}}catch{return Re("Failed to load customers")}},"options")}),"customerDropdown"),mu=o(({required:e})=>f.MultiSelectDropdown({auth:I,displayName:"Customers",description:"Select the customers",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!t)return Re("Please connect your account first");try{let r=await T.fetchCustomers({auth:t.props}),n=Array.isArray(r?.data)?r.data:[];return n.length===0?Re("No customers found"):{disabled:!1,options:n.map(u=>({label:[u.first_name,u.last_name].filter(l=>typeof l=="string"&&l.trim()!=="").join(" ")||u.email||u.id,value:u.id}))}}catch{return Re("Failed to load customers")}},"options")}),"multiCustomerDropdown");var fu=V({auth:I,name:"createCustomerAddress",displayName:"Create Customer Address",description:"Creates a customer's address",audience:"both",aiMetadata:{description:"Adds a new address to an existing BigCommerce customer, identified by customer_id (selected from a dropdown of store customers). Requires name, address line 1, city, state/province, postal code, and an ISO 3166-1 alpha-2 country code. Use to attach a shipping or billing address to a customer. Not idempotent: each call appends a new address even if an identical one exists, so use Find or Create Customer\u2019s Address to avoid duplicates.",idempotent:!1},props:{customer_id:ar({required:!0}),first_name:f.ShortText({displayName:"First Name",required:!0}),last_name:f.ShortText({displayName:"Last Name",required:!0}),address1:f.ShortText({displayName:"Address Line 1",required:!0}),address2:f.ShortText({displayName:"Address Line 2",required:!1}),city:f.ShortText({displayName:"City",required:!0}),state_or_province:f.ShortText({displayName:"State/Province",required:!0}),postal_code:f.ShortText({displayName:"Postal Code",required:!0}),country_code:f.ShortText({displayName:"Country Code",description:"ISO 3166-1 alpha-2 country code",required:!0}),phone:f.ShortText({displayName:"Phone",required:!1})},async run(e){return await T.createCustomerAddress({auth:e.auth.props,payload:[{customer_id:e.propsValue.customer_id,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,address1:e.propsValue.address1,address2:e.propsValue.address2,city:e.propsValue.city,state_or_province:e.propsValue.state_or_province,postal_code:e.propsValue.postal_code,country_code:e.propsValue.country_code,phone:e.propsValue.phone}]})}});var gu=V({auth:I,name:"searchCustomer",displayName:"Search Customer",description:"Searches for a registered customer",audience:"both",aiMetadata:{description:"Searches registered customers in a BigCommerce store by email, phone, and/or name. With no filters it returns all customers; supplying any filter narrows to matches. Use to look up a customer or check whether one exists before creating it. Idempotent read-only query with no side effects.",idempotent:!0},props:{email:f.ShortText({displayName:"Email",description:"Customer email to search for",required:!1}),phone:f.ShortText({displayName:"Phone Number",description:"Phone Number to search for",required:!1}),name:f.ShortText({displayName:"Name",description:"Customer name to search for",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.email&&t.append("email:in",e.propsValue.email),e.propsValue.name&&t.append("name:in",`${e.propsValue.name}`),e.propsValue.phone&&t.append("phone:in",e.propsValue.phone),await T.fetchCustomers({auth:e.auth.props,queryString:t.toString()})}});var yu=V({auth:I,name:"searchProduct",displayName:"Search Product",description:"Searches for a product in the catalog",audience:"both",aiMetadata:{description:"Searches the BigCommerce product catalog by name, SKU, type, brand, weight, and/or price. With no filters it returns all products; supplying any filter narrows to matches. Use to find a product or its id, or to check whether one exists before creating it. Idempotent read-only query with no side effects.",idempotent:!0},props:{name:f.ShortText({displayName:"Product Name",description:"Product name to search for",required:!1}),sku:f.ShortText({displayName:"SKU",description:"Product SKU to search for",required:!1}),type:f.StaticDropdown({displayName:"Product Type",required:!1,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),brand_id:f.ShortText({displayName:"Brand ID",description:"Brand ID to search for",required:!1}),weight:f.Number({displayName:"Weight",required:!1}),price:f.Number({displayName:"Price",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.name&&t.append("name",e.propsValue.name),e.propsValue.sku&&t.append("sku",e.propsValue.sku),e.propsValue.brand_id&&t.append("brand_id",e.propsValue.brand_id),e.propsValue.type&&t.append("type",e.propsValue.type),e.propsValue.price&&t.append("price",String(e.propsValue.price)),e.propsValue.weight&&t.append("weight",String(e.propsValue.weight)),await T.fetchProducts({auth:e.auth.props,queryString:t.toString()})}});var hu=V({auth:I,name:"searchCustomerAddress",displayName:"Search Customer Address",description:"Searches for a customer\u2019s address",audience:"both",aiMetadata:{description:"Searches customer addresses in a BigCommerce store, optionally filtered by one or more customer ids and/or a name. With no filters it returns all addresses; supplying filters narrows to matches. Use to look up addresses belonging to specific customers. Idempotent read-only query with no side effects.",idempotent:!0},props:{customer_ids:mu({required:!1}),name:f.ShortText({displayName:"Name",description:"Customer name to search for",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.customer_ids&&t.append("customer_ids:in",e.propsValue.customer_ids.join(",")),e.propsValue.name&&t.append("name:in",`${e.propsValue.name}`),await T.fetchCustomerAddresses({auth:e.auth.props,queryString:t.toString()})}});var vu=V({auth:I,name:"findOrCreateCustomer",displayName:"Find or Create Customer",description:"Finds or creates a customer",audience:"both",aiMetadata:{description:"Looks up a BigCommerce customer by email (and phone if given) and returns the match if found, otherwise creates a new customer from the supplied details. Use this instead of Create Customer when the customer may already exist, to avoid duplicate-email errors. Idempotent: repeated calls match the same existing record rather than creating duplicates.",idempotent:!0},props:{email:f.ShortText({displayName:"Email",description:"Customer email address",required:!0}),first_name:f.ShortText({displayName:"First Name",description:"Customer first name",required:!0}),last_name:f.ShortText({displayName:"Last Name",description:"Customer last name",required:!0}),company:f.ShortText({displayName:"Company",description:"Customer company name",required:!1}),phone:f.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),notes:f.LongText({displayName:"Notes",description:"Customer notes",required:!1})},async run(e){let t=new URLSearchParams;t.append("email:in",e.propsValue.email),e.propsValue.phone&&t.append("phone:in",e.propsValue.phone);let r=await T.fetchCustomers({auth:e.auth.props,queryString:t.toString()});return r.data&&r.data.length>0?{found:!0,data:r.data}:{found:!1,data:(await T.createCustomer({auth:e.auth.props,payload:[{email:e.propsValue.email,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,company:e.propsValue.company,phone:e.propsValue.phone,notes:e.propsValue.notes}]})).data}}});var xu=V({auth:I,name:"findOrCreateProduct",displayName:"Find or Create Product",description:"Finds or creates a product",audience:"both",aiMetadata:{description:"Looks up a catalog product by exact name and returns the match if found, otherwise creates a new product from the supplied details (type, weight, and price required). Use instead of Create a Product when the item may already exist, to avoid duplicates. Idempotent: repeated calls match the same existing product by name rather than creating duplicates.",idempotent:!0},props:{name:f.ShortText({displayName:"Product Name",required:!0}),sku:f.ShortText({displayName:"SKU",required:!1}),type:f.StaticDropdown({displayName:"Product Type",required:!0,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),weight:f.Number({displayName:"Weight",required:!0}),price:f.Number({displayName:"Price",required:!0}),description:f.LongText({displayName:"Description",required:!1}),brand_id:f.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){let t=new URLSearchParams;t.append("name",e.propsValue.name);let r=await T.fetchProducts({auth:e.auth.props,queryString:t.toString()});return r.data&&r.data.length>0?{found:!0,data:r.data}:{found:!1,data:(await T.createProduct({auth:e.auth.props,payload:{name:e.propsValue.name,type:e.propsValue.type,sku:e.propsValue.sku,description:e.propsValue.description,weight:e.propsValue.weight,price:e.propsValue.price,brand_id:e.propsValue.brand_id}})).data}}});var _u=V({auth:I,name:"findOrCreateCustomersAddress",displayName:"Find or Create Customer\u2019s Address",description:"Finds or creates a customer\u2019s address",audience:"both",aiMetadata:{description:"For a given customer_id, looks up that customer\u2019s addresses and returns the one matching the supplied address line 1, city, and postal code if it exists, otherwise creates a new address from the supplied details. Use instead of Create Customer Address when the address may already be on file, to avoid duplicates. Idempotent: repeated calls reuse the matching address rather than appending duplicates.",idempotent:!0},props:{customer_id:ar({required:!0}),first_name:f.ShortText({displayName:"First Name",required:!0}),last_name:f.ShortText({displayName:"Last Name",required:!0}),address1:f.ShortText({displayName:"Address Line 1",required:!0}),address2:f.ShortText({displayName:"Address Line 2",required:!1}),city:f.ShortText({displayName:"City",required:!0}),state_or_province:f.ShortText({displayName:"State/Province",required:!0}),postal_code:f.ShortText({displayName:"Postal Code",required:!0}),country_code:f.ShortText({displayName:"Country Code",description:"ISO 3166-1 alpha-2 country code",required:!0}),phone:f.ShortText({displayName:"Phone",required:!1})},async run(e){let t=new URLSearchParams;t.append("customer_id:in",e.propsValue.customer_id);let r=await T.fetchCustomerAddresses({auth:e.auth.props,queryString:t.toString()});if(r.data&&r.data.length>0){let i=r.data.find(u=>u.address1===e.propsValue.address1&&u.city===e.propsValue.city&&u.postal_code===e.propsValue.postal_code);if(i)return{found:!0,data:i}}return{found:!1,data:(await T.createCustomerAddress({auth:e.auth.props,payload:[{customer_id:e.propsValue.customer_id,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,address1:e.propsValue.address1,address2:e.propsValue.address2,city:e.propsValue.city,state_or_province:e.propsValue.state_or_province,postal_code:e.propsValue.postal_code,country_code:e.propsValue.country_code,phone:e.propsValue.phone}]})).data}}});var hm=Ni({displayName:"BigCommerce",description:"BigCommerce is a leading e-commerce platform that enables businesses to create and manage online stores.",auth:I,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/bigcommerce.png",authors:["gs03-dev","sanket-a11y","Angelebeats"],actions:[iu,au,su,uu,cu,pu,lu,du,fu,gu,yu,hu,vu,xu,_u,Ws({auth:I,baseUrl:o(e=>e?or(e.props.storeHash):"","baseUrl"),authMapping:o(async e=>({"X-Auth-Token":e.props.accessToken,"Content-Type":"application/json",Accept:"application/json"}),"authMapping")})],triggers:[Gs,Ks,Js,Xs,Ys,Qs,eu,tu,ru,nu,ou]});0&&(module.exports={bigcommerce});
|
|
9
|
+
7. Save - you will get a downloaded file containing your access token and store hash`}),storeHash:g.ShortText({displayName:"Store Hash",description:"Your BigCommerce store hash (e.g., abcd1234)",required:!0}),accessToken:g.ShortText({displayName:"Access Token",description:"Your BigCommerce API access token",required:!0})},required:!0,async validate(e){try{return await T.fetchProducts({auth:e.auth}),{valid:!0}}catch{return{valid:!1,error:"Could not validate credentials. please check your credentials are correct."}}}});var Am="abandoned cart",xn=`${Am}-trigger-store-key`,$m="store/cart/abandoned",yu=J({auth:I,name:"abandonedCart",classification:"READ",displayName:"Abandoned Cart",description:"Triggers when a cart is abandoned",aiMetadata:{description:"Fires when a shopper abandons a cart in the BigCommerce store (the cart sits inactive without checkout completing). The event identifies the affected cart; use it to drive abandoned-cart recovery flows."},props:{},sampleData:{producer:"stores/dxqdddcaklwsso",hash:"3610addd127e330084ddddd7ddd09b78abfd1a85",created_at:1761809622,store_id:"1003425529",scope:"store/cart/abandoned",data:{type:"cart",id:"ss-598f-4c95-813b-0ess950562770d"}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:$m,destination:e.webhookUrl,is_active:!0}});await e.store.put(xn,t.data.id)},async onDisable(e){let t=await e.store.get(xn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(xn)})},async run(e){return[e.payload.body]}});var zm="cart created",Pn=`${zm}-trigger-store-key`,wm="store/cart/created",hu=J({auth:I,name:"cartCreated",classification:"READ",displayName:"Cart Created",description:"Triggers when a new cart is created",aiMetadata:{description:"Fires when a new shopping cart is created in the BigCommerce store (a shopper adds the first item to a fresh cart). The event identifies the new cart."},props:{},sampleData:{producer:"stores/dxqdddcaklwsso",hash:"3610addd127e330084ddddd7ddd09b78abfd1a85",created_at:1761809622,store_id:"1003425529",scope:"store/cart/created",data:{type:"cart",id:"ss-598f-4c95-813b-0ess950562770d"}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:wm,destination:e.webhookUrl,is_active:!0}});await e.store.put(Pn,t.data.id)},async onDisable(e){let t=await e.store.get(Pn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(Pn)})},async run(e){return[e.payload.body]}});var Om="customer address created",bn=`${Om}-trigger-store-key`,km="store/customer/address/created",vu=J({auth:I,name:"customerAddressCreated",classification:"READ",displayName:"Customer Address Created",description:"Triggers when a new customer address is created",aiMetadata:{description:"Fires when a new address is added to a customer in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/address/created",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:km,destination:e.webhookUrl,is_active:!0}});await e.store.put(bn,t.data.id)},async onDisable(e){let t=await e.store.get(bn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(bn)})},async run(e){return[e.payload.body]}});var Rm="customer address updated",Tn=`${Rm}-trigger-store-key`,Nm="store/customer/address/updated",_u=J({auth:I,name:"customerAddressUpdated",classification:"READ",displayName:"Customer Address Updated",description:"Triggers when a new customer address is updated",aiMetadata:{description:"Fires when an existing customer address is updated in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/address/updated",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Nm,destination:e.webhookUrl,is_active:!0}});await e.store.put(Tn,t.data.id)},async onDisable(e){let t=await e.store.get(Tn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(Tn)})},async run(e){return[e.payload.body]}});var Cm="customer created",En=`${Cm}-trigger-store-key`,Dm="store/customer/created",xu=J({auth:I,name:"customerCreated",classification:"READ",displayName:"Customer Created",description:"Triggers when a new customer is created",aiMetadata:{description:"Fires when a new customer is created in the BigCommerce store. The event identifies the new customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/created",data:{type:"customer",id:2,origin_channel_id:1,channel_ids:[1]}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Dm,destination:e.webhookUrl,is_active:!0}});await e.store.put(En,t.data.id)},async onDisable(e){let t=await e.store.get(En);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(En)})},async run(e){return[e.payload.body]}});var Um="customer updated",In=`${Um}-trigger-store-key`,Mm="store/customer/updated",Pu=J({auth:I,name:"customerUpdated",classification:"READ",displayName:"Customer Updated",description:"Triggers when a customer is updated",aiMetadata:{description:"Fires when an existing customer record is updated in the BigCommerce store. The event identifies the affected customer."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/customer/updated",data:{type:"customer",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Mm,destination:e.webhookUrl,is_active:!0}});await e.store.put(In,t.data.id)},async onDisable(e){let t=await e.store.get(In);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(In)})},async run(e){return[e.payload.body]}});var Lm="order created",Sn=`${Lm}-trigger-store-key`,jm="store/order/created",bu=J({auth:I,name:"orderCreated",classification:"READ",displayName:"Order Created",description:"Triggers when a new order is created",aiMetadata:{description:"Fires when a new order is created in the BigCommerce store. The event identifies the new order; pair with Get Order to fetch its full details."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/created",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:jm,destination:e.webhookUrl,is_active:!0}});await e.store.put(Sn,t.data.id)},async onDisable(e){let t=await e.store.get(Sn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(Sn)})},async run(e){return[e.payload.body]}});var Bm="order updated",An=`${Bm}-trigger-store-key`,Fm="store/order/updated",Tu=J({auth:I,name:"orderUpdated",classification:"READ",displayName:"Order Updated",description:"Triggers when an order is updated",aiMetadata:{description:"Fires when an existing order is updated in the BigCommerce store (any change to the order, not just its status). The event identifies the affected order; pair with Get Order for full details."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/updated",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Fm,destination:e.webhookUrl,is_active:!0}});await e.store.put(An,t.data.id)},async onDisable(e){let t=await e.store.get(An);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(An)})},async run(e){return[e.payload.body]}});var Vm="order status updated",$n=`${Vm}-trigger-store-key`,Zm="store/order/statusUpdated",Eu=J({auth:I,name:"orderStatusUpdated",classification:"READ",displayName:"Order Status Updated",description:"Triggers when an order status has changed",aiMetadata:{description:"Fires specifically when an order\u2019s status changes in the BigCommerce store (e.g. moves to shipped or completed). Use this instead of Order Updated when you only care about status transitions. The event identifies the affected order."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/order/statusUpdated",data:{type:"order",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Zm,destination:e.webhookUrl,is_active:!0}});await e.store.put($n,t.data.id)},async onDisable(e){let t=await e.store.get($n);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete($n)})},async run(e){return[e.payload.body]}});var Hm="product created",zn=`${Hm}-trigger-store-key`,Gm="store/product/created",Iu=J({auth:I,name:"productCreated",classification:"READ",displayName:"Product Created",description:"Triggers when a new product is created",aiMetadata:{description:"Fires when a new product is added to the BigCommerce store catalog. The event identifies the new product."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"c6db17090e98d2c58c0cb1988b5e9ace48215e22",created_at:1761808831,store_id:"1003425529",scope:"store/product/created",data:{type:"product",id:113}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Gm,destination:e.webhookUrl,is_active:!0}});await e.store.put(zn,t.data.id)},async onDisable(e){let t=await e.store.get(zn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(zn)})},async run(e){return[e.payload.body]}});var qm="shipment created",wn=`${qm}-trigger-store-key`,Wm="store/shipment/created",Su=J({auth:I,name:"shipmentCreated",classification:"READ",displayName:"Shipment Created",description:"Triggers when a new shipment is created",aiMetadata:{description:"Fires when a new shipment is created for an order in the BigCommerce store (items are shipped/fulfilled). The event identifies the new shipment."},props:{},sampleData:{producer:"stores/xqcaklwsso",hash:"d7b899890f5e0e98a3e074f018b14b07d5d89360",created_at:1761808595,store_id:"1003425529",scope:"store/shipment/created",data:{type:"shipment",id:2}},type:"WEBHOOK",async onEnable(e){let t=await T.createWebhook({auth:e.auth.props,payload:{scope:Wm,destination:e.webhookUrl,is_active:!0}});await e.store.put(wn,t.data.id)},async onDisable(e){let t=await e.store.get(wn);t&&await T.deleteWebhook({auth:e.auth.props,webhookId:t}).then(async()=>{await e.store.delete(wn)})},async run(e){return[e.payload.body]}});var Au=H({auth:I,name:"createCustomer",classification:"WRITE",displayName:"Create Customer",description:"Creates a customer",audience:"both",aiMetadata:{description:"Creates a new customer record in a BigCommerce store from an email plus first/last name (company, phone, and notes optional). Use to register a shopper or contact. Not idempotent: each call adds a new customer, and BigCommerce rejects a duplicate email rather than returning the existing one, so call Search Customer or Find or Create Customer first if the customer may already exist.",idempotent:!1},props:{email:g.ShortText({displayName:"Email",description:"Customer email address",required:!0}),first_name:g.ShortText({displayName:"First Name",description:"Customer first name",required:!0}),last_name:g.ShortText({displayName:"Last Name",description:"Customer last name",required:!0}),company:g.ShortText({displayName:"Company",description:"Customer company name",required:!1}),phone:g.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),notes:g.LongText({displayName:"Notes",description:"Customer notes",required:!1})},async run(e){return await T.createCustomer({auth:e.auth.props,payload:[{email:e.propsValue.email,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,company:e.propsValue.company,phone:e.propsValue.phone,notes:e.propsValue.notes}]})}});var $u=H({auth:I,name:"createAProduct",classification:"WRITE",displayName:"Create a Product",description:"Creates a Product",audience:"both",aiMetadata:{description:"Creates a new catalog product in a BigCommerce store. Use to add an item to the store. Requires name, type (physical or digital), weight, and price; SKU, description, and brand_id are optional. Not idempotent: each call adds a new product, so search the catalog first if it may already exist.",idempotent:!1},props:{name:g.ShortText({displayName:"Product Name",description:"Name of the product",required:!0}),type:g.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!0,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),sku:g.ShortText({displayName:"SKU",description:"Product SKU",required:!1}),description:g.LongText({displayName:"Description",description:"Product description",required:!1}),weight:g.Number({displayName:"Weight",description:"Product weight",required:!0}),price:g.Number({displayName:"Price",description:"Product price",required:!0}),brand_id:g.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){return await T.createProduct({auth:e.auth.props,payload:{name:e.propsValue.name,type:e.propsValue.type,sku:e.propsValue.sku,description:e.propsValue.description,weight:e.propsValue.weight,price:e.propsValue.price,brand_id:e.propsValue.brand_id}})}});var zu=H({auth:I,name:"updateAProduct",classification:"WRITE",displayName:"Update a Product",description:"Updates an existing Product",audience:"both",aiMetadata:{description:"Updates an existing catalog product in a BigCommerce store, identified by its productId. Only the fields you supply are sent (null/undefined values are dropped so existing data is preserved), so use it for partial edits to name, type, SKU, description, weight, price, or brand. Idempotent: re-applying the same field values leaves the product in the same state.",idempotent:!0},props:{productId:g.ShortText({displayName:"Product ID",description:"The ID of the product to update",required:!0}),name:g.ShortText({displayName:"Product Name",description:"Name of the product",required:!1}),type:g.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!1,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),sku:g.ShortText({displayName:"SKU",description:"Product SKU",required:!1}),description:g.LongText({displayName:"Description",description:"Product description",required:!1}),weight:g.Number({displayName:"Weight",description:"Product weight",required:!1}),price:g.Number({displayName:"Price",description:"Product price",required:!1}),brand_id:g.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){let{productId:t,...r}=e.propsValue,n=Object.fromEntries(Object.entries(r).filter(([i,u])=>u!=null));return await T.updateProduct({auth:e.auth.props,productId:t,payload:n})}});var wu=H({auth:I,name:"deleteAProduct",classification:"DESTRUCTIVE",displayName:"Delete a Product",description:"Deletes an existing Product",audience:"both",aiMetadata:{description:"Permanently deletes a catalog product from a BigCommerce store by its productId. Use to remove an item from the store. This is destructive and cannot be undone. Effectively idempotent: deleting an already-removed product has no further effect, though the call may error if the id no longer exists.",idempotent:!0},props:{productId:g.ShortText({displayName:"Product ID",description:"The ID of the product to delete",required:!0})},async run(e){return await T.deleteProduct({auth:e.auth.props,productId:e.propsValue.productId})}});var Ou=H({auth:I,name:"getOrder",classification:"READ",displayName:"Get Order",description:"Gets details of an order",audience:"both",aiMetadata:{description:"Retrieves the full details of a single BigCommerce order by its orderId. Use when you already have an order id (e.g. from an order trigger or List Orders) and need its data. Idempotent read-only lookup with no side effects.",idempotent:!0},props:{orderId:g.ShortText({displayName:"Order ID",description:"The ID of the order to retrieve",required:!0})},async run(e){return await T.fetchOrder({auth:e.auth.props,orderId:e.propsValue.orderId})}});var ku=H({auth:I,name:"listOrders",classification:"SEARCH",displayName:"List Orders",description:"Lists all orders",audience:"both",aiMetadata:{description:"Lists orders from a BigCommerce store. With no filters it returns all orders; optionally narrow by customer_id and/or status_id to a subset. Use to browse or find orders when you do not have a specific order id. Idempotent read-only query with no side effects.",idempotent:!0},props:{customer_id:g.Number({displayName:"Customer ID",description:"Filter by customer ID",required:!1}),status_id:g.Number({displayName:"Status ID",description:"Filter by status ID",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.customer_id!==void 0&&e.propsValue.customer_id!==null&&t.append("customer_id",e.propsValue.customer_id.toString()),e.propsValue.status_id!==void 0&&e.propsValue.status_id!==null&&t.append("status_id",e.propsValue.status_id.toString()),await T.fetchOrders({auth:e.auth.props,queryString:t.toString()})}});var Ru=H({auth:I,name:"listCategories",classification:"SEARCH",displayName:"List Categories",description:"Lists all categories",audience:"both",aiMetadata:{description:"Lists product categories from a BigCommerce store. With no name filter it returns all categories; provide a name to filter to matching categories. Use to discover category names or ids before assigning products. Idempotent read-only query with no side effects.",idempotent:!0},props:{name:g.ShortText({displayName:"Category Name",description:"Filter by category name",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.name&&t.append("name",e.propsValue.name),await T.fetchCategories({auth:e.auth.props,queryString:t.toString()})}});var Nu=H({auth:I,name:"createBlogPost",classification:"WRITE",displayName:"Create Blog Post",description:"Creates a blog post",audience:"both",aiMetadata:{description:"Creates a blog post in a BigCommerce store's blog. Requires a title and body (HTML supported); author, URL, published date, meta description/keywords, tags, and a published flag are optional. Use to publish store blog content. Not idempotent: each call creates a new post.",idempotent:!1},props:{title:g.ShortText({displayName:"Title",description:"Blog post title",required:!0}),body:g.LongText({displayName:"Body",description:"Blog post content (HTML supported)",required:!0}),author:g.ShortText({displayName:"Author",description:"Author name",required:!1}),url:g.ShortText({displayName:"URL",description:"URL for the public blog post. Example - /blog/welcome-bigcommerce/",required:!1}),published_date:g.DateTime({displayName:"Published Date",description:"Published Date for the blog post. Example - Wed, 10 Aug 2022 15:39:15 -0500",required:!1}),meta_description:g.LongText({displayName:"Meta Description",description:"Description text for this blog post\u2019s <meta/> element.",required:!1}),meta_keywords:g.LongText({displayName:"Meta Keywords",description:"Comma seperated (,) Keywords for this blog post\u2019s <meta/> element. Eg welcome, bigcommerce",required:!1}),tags:g.Array({displayName:"Tags",description:"Array of tags",required:!1}),is_published:g.Checkbox({displayName:"Is Published",description:"Whether the post is published",required:!1,defaultValue:!0})},async run(e){return await T.createBlogPost({auth:e.auth.props,payload:{title:e.propsValue.title,body:e.propsValue.body,author:e.propsValue.author,tags:e.propsValue.tags,is_published:e.propsValue.is_published,meta_description:e.propsValue.meta_description,meta_keywords:e.propsValue.meta_keywords,published_date:e.propsValue.published_date,url:e.propsValue.url}})}});var pr=o(({required:e})=>g.Dropdown({auth:I,displayName:"Customer",description:"Select the customer",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!t)return Me("Please connect your account first");try{let r=await T.fetchCustomers({auth:t.props}),n=Array.isArray(r?.data)?r.data:[];return n.length===0?Me("No customers found"):{disabled:!1,options:n.map(u=>({label:[u.first_name,u.last_name].filter(p=>typeof p=="string"&&p.trim()!=="").join(" ")||u.email||u.id,value:u.id}))}}catch{return Me("Failed to load customers")}},"options")}),"customerDropdown"),Cu=o(({required:e})=>g.MultiSelectDropdown({auth:I,displayName:"Customers",description:"Select the customers",required:e,refreshers:["auth"],options:o(async({auth:t})=>{if(!t)return Me("Please connect your account first");try{let r=await T.fetchCustomers({auth:t.props}),n=Array.isArray(r?.data)?r.data:[];return n.length===0?Me("No customers found"):{disabled:!1,options:n.map(u=>({label:[u.first_name,u.last_name].filter(p=>typeof p=="string"&&p.trim()!=="").join(" ")||u.email||u.id,value:u.id}))}}catch{return Me("Failed to load customers")}},"options")}),"multiCustomerDropdown");var Du=H({auth:I,name:"createCustomerAddress",classification:"WRITE",displayName:"Create Customer Address",description:"Creates a customer's address",audience:"both",aiMetadata:{description:"Adds a new address to an existing BigCommerce customer, identified by customer_id (selected from a dropdown of store customers). Requires name, address line 1, city, state/province, postal code, and an ISO 3166-1 alpha-2 country code. Use to attach a shipping or billing address to a customer. Not idempotent: each call appends a new address even if an identical one exists, so use Find or Create Customer\u2019s Address to avoid duplicates.",idempotent:!1},props:{customer_id:pr({required:!0}),first_name:g.ShortText({displayName:"First Name",required:!0}),last_name:g.ShortText({displayName:"Last Name",required:!0}),address1:g.ShortText({displayName:"Address Line 1",required:!0}),address2:g.ShortText({displayName:"Address Line 2",required:!1}),city:g.ShortText({displayName:"City",required:!0}),state_or_province:g.ShortText({displayName:"State/Province",required:!0}),postal_code:g.ShortText({displayName:"Postal Code",required:!0}),country_code:g.ShortText({displayName:"Country Code",description:"ISO 3166-1 alpha-2 country code",required:!0}),phone:g.ShortText({displayName:"Phone",required:!1})},async run(e){return await T.createCustomerAddress({auth:e.auth.props,payload:[{customer_id:e.propsValue.customer_id,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,address1:e.propsValue.address1,address2:e.propsValue.address2,city:e.propsValue.city,state_or_province:e.propsValue.state_or_province,postal_code:e.propsValue.postal_code,country_code:e.propsValue.country_code,phone:e.propsValue.phone}]})}});var Uu=H({auth:I,name:"searchCustomer",classification:"SEARCH",displayName:"Search Customer",description:"Searches for a registered customer",audience:"both",aiMetadata:{description:"Searches registered customers in a BigCommerce store by email, phone, and/or name. With no filters it returns all customers; supplying any filter narrows to matches. Use to look up a customer or check whether one exists before creating it. Idempotent read-only query with no side effects.",idempotent:!0},props:{email:g.ShortText({displayName:"Email",description:"Customer email to search for",required:!1}),phone:g.ShortText({displayName:"Phone Number",description:"Phone Number to search for",required:!1}),name:g.ShortText({displayName:"Name",description:"Customer name to search for",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.email&&t.append("email:in",e.propsValue.email),e.propsValue.name&&t.append("name:in",`${e.propsValue.name}`),e.propsValue.phone&&t.append("phone:in",e.propsValue.phone),await T.fetchCustomers({auth:e.auth.props,queryString:t.toString()})}});var Mu=H({auth:I,name:"searchProduct",classification:"SEARCH",displayName:"Search Product",description:"Searches for a product in the catalog",audience:"both",aiMetadata:{description:"Searches the BigCommerce product catalog by name, SKU, type, brand, weight, and/or price. With no filters it returns all products; supplying any filter narrows to matches. Use to find a product or its id, or to check whether one exists before creating it. Idempotent read-only query with no side effects.",idempotent:!0},props:{name:g.ShortText({displayName:"Product Name",description:"Product name to search for",required:!1}),sku:g.ShortText({displayName:"SKU",description:"Product SKU to search for",required:!1}),type:g.StaticDropdown({displayName:"Product Type",required:!1,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),brand_id:g.ShortText({displayName:"Brand ID",description:"Brand ID to search for",required:!1}),weight:g.Number({displayName:"Weight",required:!1}),price:g.Number({displayName:"Price",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.name&&t.append("name",e.propsValue.name),e.propsValue.sku&&t.append("sku",e.propsValue.sku),e.propsValue.brand_id&&t.append("brand_id",e.propsValue.brand_id),e.propsValue.type&&t.append("type",e.propsValue.type),e.propsValue.price&&t.append("price",String(e.propsValue.price)),e.propsValue.weight&&t.append("weight",String(e.propsValue.weight)),await T.fetchProducts({auth:e.auth.props,queryString:t.toString()})}});var Lu=H({auth:I,name:"searchCustomerAddress",classification:"SEARCH",displayName:"Search Customer Address",description:"Searches for a customer\u2019s address",audience:"both",aiMetadata:{description:"Searches customer addresses in a BigCommerce store, optionally filtered by one or more customer ids and/or a name. With no filters it returns all addresses; supplying filters narrows to matches. Use to look up addresses belonging to specific customers. Idempotent read-only query with no side effects.",idempotent:!0},props:{customer_ids:Cu({required:!1}),name:g.ShortText({displayName:"Name",description:"Customer name to search for",required:!1})},async run(e){let t=new URLSearchParams;return e.propsValue.customer_ids&&t.append("customer_ids:in",e.propsValue.customer_ids.join(",")),e.propsValue.name&&t.append("name:in",`${e.propsValue.name}`),await T.fetchCustomerAddresses({auth:e.auth.props,queryString:t.toString()})}});var ju=H({auth:I,name:"findOrCreateCustomer",classification:"WRITE",displayName:"Find or Create Customer",description:"Finds or creates a customer",audience:"both",aiMetadata:{description:"Looks up a BigCommerce customer by email (and phone if given) and returns the match if found, otherwise creates a new customer from the supplied details. Use this instead of Create Customer when the customer may already exist, to avoid duplicate-email errors. Idempotent: repeated calls match the same existing record rather than creating duplicates.",idempotent:!0},props:{email:g.ShortText({displayName:"Email",description:"Customer email address",required:!0}),first_name:g.ShortText({displayName:"First Name",description:"Customer first name",required:!0}),last_name:g.ShortText({displayName:"Last Name",description:"Customer last name",required:!0}),company:g.ShortText({displayName:"Company",description:"Customer company name",required:!1}),phone:g.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),notes:g.LongText({displayName:"Notes",description:"Customer notes",required:!1})},async run(e){let t=new URLSearchParams;t.append("email:in",e.propsValue.email),e.propsValue.phone&&t.append("phone:in",e.propsValue.phone);let r=await T.fetchCustomers({auth:e.auth.props,queryString:t.toString()});return r.data&&r.data.length>0?{found:!0,data:r.data}:{found:!1,data:(await T.createCustomer({auth:e.auth.props,payload:[{email:e.propsValue.email,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,company:e.propsValue.company,phone:e.propsValue.phone,notes:e.propsValue.notes}]})).data}}});var Bu=H({auth:I,name:"findOrCreateProduct",classification:"WRITE",displayName:"Find or Create Product",description:"Finds or creates a product",audience:"both",aiMetadata:{description:"Looks up a catalog product by exact name and returns the match if found, otherwise creates a new product from the supplied details (type, weight, and price required). Use instead of Create a Product when the item may already exist, to avoid duplicates. Idempotent: repeated calls match the same existing product by name rather than creating duplicates.",idempotent:!0},props:{name:g.ShortText({displayName:"Product Name",required:!0}),sku:g.ShortText({displayName:"SKU",required:!1}),type:g.StaticDropdown({displayName:"Product Type",required:!0,options:{options:[{label:"Physical",value:"physical"},{label:"Digital",value:"digital"}]}}),weight:g.Number({displayName:"Weight",required:!0}),price:g.Number({displayName:"Price",required:!0}),description:g.LongText({displayName:"Description",required:!1}),brand_id:g.Number({displayName:"Brand ID",description:"Brand ID",required:!1})},async run(e){let t=new URLSearchParams;t.append("name",e.propsValue.name);let r=await T.fetchProducts({auth:e.auth.props,queryString:t.toString()});return r.data&&r.data.length>0?{found:!0,data:r.data}:{found:!1,data:(await T.createProduct({auth:e.auth.props,payload:{name:e.propsValue.name,type:e.propsValue.type,sku:e.propsValue.sku,description:e.propsValue.description,weight:e.propsValue.weight,price:e.propsValue.price,brand_id:e.propsValue.brand_id}})).data}}});var Fu=H({auth:I,name:"findOrCreateCustomersAddress",classification:"WRITE",displayName:"Find or Create Customer\u2019s Address",description:"Finds or creates a customer\u2019s address",audience:"both",aiMetadata:{description:"For a given customer_id, looks up that customer\u2019s addresses and returns the one matching the supplied address line 1, city, and postal code if it exists, otherwise creates a new address from the supplied details. Use instead of Create Customer Address when the address may already be on file, to avoid duplicates. Idempotent: repeated calls reuse the matching address rather than appending duplicates.",idempotent:!0},props:{customer_id:pr({required:!0}),first_name:g.ShortText({displayName:"First Name",required:!0}),last_name:g.ShortText({displayName:"Last Name",required:!0}),address1:g.ShortText({displayName:"Address Line 1",required:!0}),address2:g.ShortText({displayName:"Address Line 2",required:!1}),city:g.ShortText({displayName:"City",required:!0}),state_or_province:g.ShortText({displayName:"State/Province",required:!0}),postal_code:g.ShortText({displayName:"Postal Code",required:!0}),country_code:g.ShortText({displayName:"Country Code",description:"ISO 3166-1 alpha-2 country code",required:!0}),phone:g.ShortText({displayName:"Phone",required:!1})},async run(e){let t=new URLSearchParams;t.append("customer_id:in",e.propsValue.customer_id);let r=await T.fetchCustomerAddresses({auth:e.auth.props,queryString:t.toString()});if(r.data&&r.data.length>0){let i=r.data.find(u=>u.address1===e.propsValue.address1&&u.city===e.propsValue.city&&u.postal_code===e.propsValue.postal_code);if(i)return{found:!0,data:i}}return{found:!1,data:(await T.createCustomerAddress({auth:e.auth.props,payload:[{customer_id:e.propsValue.customer_id,first_name:e.propsValue.first_name,last_name:e.propsValue.last_name,address1:e.propsValue.address1,address2:e.propsValue.address2,city:e.propsValue.city,state_or_province:e.propsValue.state_or_province,postal_code:e.propsValue.postal_code,country_code:e.propsValue.country_code,phone:e.propsValue.phone}]})).data}}});var Km=Xi({displayName:"BigCommerce",description:"BigCommerce is a leading e-commerce platform that enables businesses to create and manage online stores.",auth:I,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/bigcommerce.png",authors:["gs03-dev","sanket-a11y","Angelebeats"],actions:[Au,$u,zu,wu,Ou,ku,Ru,Nu,Du,Uu,Mu,Lu,ju,Bu,Fu,gu({auth:I,baseUrl:o(e=>e?ur(e.props.storeHash):"","baseUrl"),authMapping:o(async e=>({"X-Auth-Token":e.props.accessToken,"Content-Type":"application/json",Accept:"application/json"}),"authMapping")})],triggers:[yu,hu,vu,_u,xu,Pu,bu,Tu,Eu,Iu,Su]});0&&(module.exports={bigcommerce});
|
|
10
10
|
/*! Bundled license information:
|
|
11
11
|
|
|
12
12
|
mime-types/index.js:
|