@activepieces/piece-klaviyo 0.1.2 → 0.1.3
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 +7 -13
- package/src/index.js +31 -53
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-profile-to-list.d.ts +0 -5
- package/src/lib/actions/add-profile-to-list.d.ts.map +0 -1
- package/src/lib/actions/add-profile-to-list.js +0 -49
- package/src/lib/actions/add-profile-to-list.js.map +0 -1
- package/src/lib/actions/create-list.d.ts +0 -4
- package/src/lib/actions/create-list.d.ts.map +0 -1
- package/src/lib/actions/create-list.js +0 -49
- package/src/lib/actions/create-list.js.map +0 -1
- package/src/lib/actions/create-profile.d.ts +0 -25
- package/src/lib/actions/create-profile.d.ts.map +0 -1
- package/src/lib/actions/create-profile.js +0 -208
- package/src/lib/actions/create-profile.js.map +0 -1
- package/src/lib/actions/find-list-by-name.d.ts +0 -5
- package/src/lib/actions/find-list-by-name.d.ts.map +0 -1
- package/src/lib/actions/find-list-by-name.js +0 -74
- package/src/lib/actions/find-list-by-name.js.map +0 -1
- package/src/lib/actions/find-profile-by-email-phone.d.ts +0 -5
- package/src/lib/actions/find-profile-by-email-phone.d.ts.map +0 -1
- package/src/lib/actions/find-profile-by-email-phone.js +0 -96
- package/src/lib/actions/find-profile-by-email-phone.js.map +0 -1
- package/src/lib/actions/find-tag-by-name.d.ts +0 -4
- package/src/lib/actions/find-tag-by-name.d.ts.map +0 -1
- package/src/lib/actions/find-tag-by-name.js +0 -65
- package/src/lib/actions/find-tag-by-name.js.map +0 -1
- package/src/lib/actions/remove-profile-from-list.d.ts +0 -5
- package/src/lib/actions/remove-profile-from-list.d.ts.map +0 -1
- package/src/lib/actions/remove-profile-from-list.js +0 -52
- package/src/lib/actions/remove-profile-from-list.js.map +0 -1
- package/src/lib/actions/subscribe-profile.d.ts +0 -10
- package/src/lib/actions/subscribe-profile.d.ts.map +0 -1
- package/src/lib/actions/subscribe-profile.js +0 -126
- package/src/lib/actions/subscribe-profile.js.map +0 -1
- package/src/lib/actions/unsubscribe-profile.d.ts +0 -8
- package/src/lib/actions/unsubscribe-profile.d.ts.map +0 -1
- package/src/lib/actions/unsubscribe-profile.js +0 -110
- package/src/lib/actions/unsubscribe-profile.js.map +0 -1
- package/src/lib/actions/update-profile.d.ts +0 -27
- package/src/lib/actions/update-profile.d.ts.map +0 -1
- package/src/lib/actions/update-profile.js +0 -221
- package/src/lib/actions/update-profile.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -5
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -76
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/client.d.ts +0 -7
- package/src/lib/common/client.d.ts.map +0 -1
- package/src/lib/common/client.js +0 -82
- package/src/lib/common/client.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -6
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -129
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/triggers/new-profile.d.ts +0 -3
- package/src/lib/triggers/new-profile.d.ts.map +0 -1
- package/src/lib/triggers/new-profile.js +0 -147
- package/src/lib/triggers/new-profile.js.map +0 -1
- package/src/lib/triggers/profile-added-to-list-segment.d.ts +0 -19
- package/src/lib/triggers/profile-added-to-list-segment.d.ts.map +0 -1
- package/src/lib/triggers/profile-added-to-list-segment.js +0 -235
- package/src/lib/triggers/profile-added-to-list-segment.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-klaviyo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.30.0",
|
|
13
|
-
"@activepieces/shared": "0.87.1",
|
|
14
|
-
"dayjs": "1.11.9",
|
|
15
|
-
"tslib": "2.6.2"
|
|
16
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
17
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,53 +1,31 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
exports.klaviyo = (0, pieces_framework_1.createPiece)({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
create_list_1.createList,
|
|
33
|
-
find_list_by_name_1.findListByName,
|
|
34
|
-
find_profile_by_email_phone_1.findProfileByEmailPhone,
|
|
35
|
-
find_tag_by_name_1.findTagByName,
|
|
36
|
-
remove_profile_from_list_1.removeProfileFromList,
|
|
37
|
-
subscribe_profile_1.subscribeProfile,
|
|
38
|
-
unsubscribe_profile_1.unsubscribeProfile,
|
|
39
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
40
|
-
baseUrl: () => 'https://a.klaviyo.com/api',
|
|
41
|
-
auth: auth_1.klaviyoAuth,
|
|
42
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
return ({
|
|
44
|
-
Authorization: (0, auth_1.getAuthorizationHeader)(auth),
|
|
45
|
-
revision: '2025-04-15',
|
|
46
|
-
accept: 'application/vnd.api+json',
|
|
47
|
-
});
|
|
48
|
-
}),
|
|
49
|
-
}),
|
|
50
|
-
],
|
|
51
|
-
triggers: [new_profile_1.newProfileTrigger, profile_added_to_list_segment_1.profileAddedToListOrSegmentTrigger],
|
|
52
|
-
});
|
|
53
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var Iu=Object.create;var bt=Object.defineProperty;var Tu=Object.getOwnPropertyDescriptor;var Su=Object.getOwnPropertyNames;var $u=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var i=(e,t)=>bt(e,"name",{value:t,configurable:!0});var k=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Bn=(e,t)=>{for(var r in t)bt(e,r,{get:t[r],enumerable:!0})},Vn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Su(t))!Eu.call(e,o)&&o!==r&&bt(e,o,{get:()=>t[o],enumerable:!(n=Tu(t,o))||n.enumerable});return e};var Le=(e,t,r)=>(r=e!=null?Iu($u(e)):{},Vn(t||!e||!e.__esModule?bt(r,"default",{value:e,enumerable:!0}):r,e)),Au=e=>Vn(bt({},"__esModule",{value:!0}),e);var si=k((ai,pr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(c,p){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let h=0,m=-1,x=(c.match(l.zoneIndex)||[])[0],I,D;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(m=c.indexOf(":",m+1))>=0;)h++;if(c.substr(0,2)==="::"&&h--,c.substr(-2,2)==="::"&&h--,h>p)return null;for(D=p-h,I=":";D--;)I+="0:";return c=c.replace("::",I),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),p=function(){let Q=c.split(":"),oe=[];for(let ye=0;ye<Q.length;ye++)oe.push(parseInt(Q[ye],16));return oe}(),{parts:p,zoneId:x}}i(f,"expandIPv6");function g(c,p,h,m){if(c.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,I;for(;m>0;){if(I=h-m,I<0&&(I=0),c[x]>>I!==p[x]>>I)return!1;m-=h,x+=1}return!0}i(g,"matchCIDR");function v(c){if(o.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}i(v,"parseIntAuto");function P(c,p){for(;c.length<p;)c=`0${c}`;return c}i(P,"padPart");let y={};y.IPv4=function(){function c(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let h,m;for(h=0;h<p.length;h++)if(m=p[h],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return i(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(p,h){let m;if(h===void 0&&(m=p,p=m[0],h=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,p.octets,8,h)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,h=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,I,D;for(x=3;x>=0;x-=1)if(I=this.octets[x],I in m){if(D=m[I],h&&D!==0)return null;D!==8&&(h=!0),p+=D}else return null;return 32-p},c.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return y.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c}(),y.IPv4.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),h=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],I=0;for(;I<4;)x.push(parseInt(h[I],10)|parseInt(m[I],10)^255),I++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.isIPv4=function(c){return this.parser(c)!==null},y.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},y.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},y.IPv4.isValidFourPartDecimal=function(c){return!!(y.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},y.IPv4.isValidCIDRFourPartDecimal=function(c){let p=c.match(/^(.+)\/(\d+)$/);return!y.IPv4.isValidCIDR(c)||!p?!1:y.IPv4.isValidFourPartDecimal(p[1])},y.IPv4.networkAddressFromCIDR=function(c){let p,h,m,x,I;try{for(p=this.parseCIDR(c),m=p[0].toByteArray(),I=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],h=0;h<4;)x.push(parseInt(m[h],10)&parseInt(I[h],10)),h++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},y.IPv4.parse=function(c){let p=this.parser(c);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},y.IPv4.parseCIDR=function(c){let p;if(p=c.match(/^(.+)\/(\d+)$/)){let h=parseInt(p[2]);if(h>=0&&h<=32){let m=[this.parse(p[1]),h];return Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},y.IPv4.parser=function(c){let p,h,m;if(p=c.match(r.fourOctet))return function(){let x=p.slice(1,6),I=[];for(let D=0;D<x.length;D++)h=x[D],I.push(v(h));return I}();if(p=c.match(r.longValue)){if(m=v(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],I;for(I=0;I<=24;I+=8)x.push(m>>I&255);return x}().reverse()}else return(p=c.match(r.twoOctet))?function(){let x=p.slice(1,4),I=[];if(m=v(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return I.push(v(x[0])),I.push(m>>16&255),I.push(m>>8&255),I.push(m&255),I}():(p=c.match(r.threeOctet))?function(){let x=p.slice(1,5),I=[];if(m=v(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return I.push(v(x[0])),I.push(v(x[1])),I.push(m>>8&255),I.push(m&255),I}():null},y.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],h=0,m=Math.floor(c/8);for(;h<m;)p[h]=255,h++;return m<4&&(p[m]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},y.IPv6=function(){function c(p,h){let m,x;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;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");h&&(this.zoneId=h)}return i(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(p,h){let m;if(h===void 0&&(m=p,p=m[0],h=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,p.parts,16,h)},c.prototype.prefixLengthFromSubnetMask=function(){let p=0,h=!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,I;for(let D=7;D>=0;D-=1)if(x=this.parts[D],x in m){if(I=m[x],h&&I!==0)return null;I!==16&&(h=!0),p+=I}else return null;return 128-p},c.prototype.range=function(){return y.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let p,h=[],m=this.parts;for(let x=0;x<m.length;x++)p=m[x],h.push(p>>8),h.push(p&255);return h},c.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(P(this.parts[x].toString(16),4));return m}.call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),p+h},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),h=p[0],m=p[1];return new y.IPv4([h>>8,h&255,m>>8,m&255])},c.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}.call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),p+h},c.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,h=this.toNormalizedString(),m=0,x=-1,I;for(;I=p.exec(h);)I[0].length>x&&(m=I.index,x=I[0].length);return x<0?h:`${h.substring(0,m)}::${h.substring(m+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c}(),y.IPv6.broadcastAddressFromCIDR=function(c){try{let p=this.parseCIDR(c),h=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],I=0;for(;I<16;)x.push(parseInt(h[I],10)|parseInt(m[I],10)^255),I++;return new this(x)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},y.IPv6.isIPv6=function(c){return this.parser(c)!==null},y.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let p=this.parser(c);return new this(p.parts,p.zoneId),!0}catch{return!1}},y.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},y.IPv6.networkAddressFromCIDR=function(c){let p,h,m,x,I;try{for(p=this.parseCIDR(c),m=p[0].toByteArray(),I=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),x=[],h=0;h<16;)x.push(parseInt(m[h],10)&parseInt(I[h],10)),h++;return new this(x)}catch(D){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${D})`)}},y.IPv6.parse=function(c){let p=this.parser(c);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},y.IPv6.parseCIDR=function(c){let p,h,m;if((h=c.match(/^(.+)\/(\d+)$/))&&(p=parseInt(h[2]),p>=0&&p<=128))return m=[this.parse(h[1]),p],Object.defineProperty(m,"toString",{value:i(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},y.IPv6.parser=function(c){let p,h,m,x,I,D;if(m=c.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(c))return f(c,8);if((m=c.match(l.transitional))&&(D=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+D,6),p.parts)){for(I=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],h=0;h<I.length;h++)if(x=I[h],!(0<=x&&x<=255))return null;return p.parts.push(I[0]<<8|I[1]),p.parts.push(I[2]<<8|I[3]),{parts:p.parts,zoneId:p.zoneId}}return null},y.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,m=Math.floor(c/8);for(;h<m;)p[h]=255,h++;return m<16&&(p[m]=Math.pow(2,c%8)-1<<8-c%8),new this(p)},y.fromByteArray=function(c){let p=c.length;if(p===4)return new y.IPv4(c);if(p===16)return new y.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},y.isValid=function(c){return y.IPv6.isValid(c)||y.IPv4.isValid(c)},y.isValidCIDR=function(c){return y.IPv6.isValidCIDR(c)||y.IPv4.isValidCIDR(c)},y.parse=function(c){if(y.IPv6.isValid(c))return y.IPv6.parse(c);if(y.IPv4.isValid(c))return y.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},y.parseCIDR=function(c){try{return y.IPv6.parseCIDR(c)}catch{try{return y.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},y.process=function(c){let p=this.parse(c);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},y.subnetMatch=function(c,p,h){let m,x,I,D;h==null&&(h="unicast");for(x in p)if(Object.prototype.hasOwnProperty.call(p,x)){for(I=p[x],I[0]&&!(I[0]instanceof Array)&&(I=[I]),m=0;m<I.length;m++)if(D=I[m],c.kind()===D[0].kind()&&c.match.apply(c,D))return x}return h},typeof pr<"u"&&pr.exports?pr.exports=y:e.ipaddr=y})(ai)});var ra=k((OA,ta)=>{var ea=require("stream").Stream,np=require("util");ta.exports=$e;function $e(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}i($e,"DelayedStream");np.inherits($e,ea);$e.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var o=e.emit;return e.emit=function(){return r._handleEmit(arguments),o.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty($e.prototype,"readable",{configurable:!0,enumerable:!0,get:i(function(){return this.source.readable},"get")});$e.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};$e.prototype.resume=function(){this._released||this.release(),this.source.resume()};$e.prototype.pause=function(){this.source.pause()};$e.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};$e.prototype.pipe=function(){var e=ea.prototype.pipe.apply(this,arguments);return this.resume(),e};$e.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)};$e.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 aa=k((NA,ia)=>{var op=require("util"),oa=require("stream").Stream,na=ra();ia.exports=ce;function ce(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}i(ce,"CombinedStream");op.inherits(ce,oa);ce.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};ce.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};ce.prototype.append=function(e){var t=ce.isStreamLike(e);if(t){if(!(e instanceof na)){var r=na.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};ce.prototype.pipe=function(e,t){return oa.prototype.pipe.call(this,e,t),this.resume(),e};ce.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}};ce.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=ce.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};ce.prototype._pipeNext=function(e){this._currentStream=e;var t=ce.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()};ce.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};ce.prototype.write=function(e){this.emit("data",e)};ce.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};ce.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")};ce.prototype.end=function(){this._reset(),this.emit("end")};ce.prototype.destroy=function(){this._reset(),this.emit("close")};ce.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};ce.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};ce.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)};ce.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ua=k((CA,sa)=>{"use strict";sa.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 pa=k(_e=>{"use strict";var _r=ua(),ip=require("path").extname,ca=/^\s*([^;\s]*)(?:;|\s|$)/,ap=/^text\//i;_e.charset=la;_e.charsets={lookup:la};_e.contentType=sp;_e.extension=up;_e.extensions=Object.create(null);_e.lookup=cp;_e.types=Object.create(null);lp(_e.extensions,_e.types);function la(e){if(!e||typeof e!="string")return!1;var t=ca.exec(e),r=t&&_r[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ap.test(t[1])?"UTF-8":!1}i(la,"charset");function sp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?_e.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=_e.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}i(sp,"contentType");function up(e){if(!e||typeof e!="string")return!1;var t=ca.exec(e),r=t&&_e.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}i(up,"extension");function cp(e){if(!e||typeof e!="string")return!1;var t=ip("x."+e).toLowerCase().substr(1);return t&&_e.types[t]||!1}i(cp,"lookup");function lp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(_r).forEach(i(function(o){var u=_r[o],s=u.extensions;if(!(!s||!s.length)){e[o]=s;for(var l=0;l<s.length;l++){var f=s[l];if(t[f]){var g=r.indexOf(_r[t[f]].source),v=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>v||g===v&&t[f].substr(0,12)==="application/"))continue}t[f]=o}}},"forEachMimeType"))}i(lp,"populateMaps")});var ma=k((LA,da)=>{da.exports=pp;function pp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}i(pp,"defer")});var hn=k((FA,ga)=>{var fa=ma();ga.exports=dp;function dp(e){var t=!1;return fa(function(){t=!0}),i(function(n,o){t?e(n,o):fa(i(function(){e(n,o)},"nextTick_callback"))},"async_callback")}i(dp,"async")});var vn=k((VA,ya)=>{ya.exports=mp;function mp(e){Object.keys(e.jobs).forEach(fp.bind(e)),e.jobs={}}i(mp,"abort");function fp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}i(fp,"clean")});var xn=k((HA,va)=>{var ha=hn(),gp=vn();va.exports=yp;function yp(e,t,r,n){var o=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[o]=hp(t,o,e[o],function(u,s){o in r.jobs&&(delete r.jobs[o],u?gp(r):r.results[o]=s,n(u,r.results))})}i(yp,"iterate");function hp(e,t,r,n){var o;return e.length==2?o=e(r,ha(n)):o=e(r,t,ha(n)),o}i(hp,"runJob")});var _n=k((WA,xa)=>{xa.exports=vp;function vp(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(o,u){return t(e[o],e[u])}),n}i(vp,"state")});var Pn=k((KA,_a)=>{var xp=vn(),_p=hn();_a.exports=Pp;function Pp(e){Object.keys(this.jobs).length&&(this.index=this.size,xp(this),_p(e)(null,this.results))}i(Pp,"terminator")});var ba=k((XA,Pa)=>{var bp=xn(),Ip=_n(),Tp=Pn();Pa.exports=Sp;function Sp(e,t,r){for(var n=Ip(e);n.index<(n.keyedList||e).length;)bp(e,t,n,function(o,u){if(o){r(o,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Tp.bind(n,r)}i(Sp,"parallel")});var bn=k((QA,Pr)=>{var Ia=xn(),$p=_n(),Ep=Pn();Pr.exports=Ap;Pr.exports.ascending=Ta;Pr.exports.descending=zp;function Ap(e,t,r,n){var o=$p(e,r);return Ia(e,t,o,i(function u(s,l){if(s){n(s,l);return}if(o.index++,o.index<(o.keyedList||e).length){Ia(e,t,o,u);return}n(null,o.results)},"iteratorHandler")),Ep.bind(o,n)}i(Ap,"serialOrdered");function Ta(e,t){return e<t?-1:e>t?1:0}i(Ta,"ascending");function zp(e,t){return-1*Ta(e,t)}i(zp,"descending")});var $a=k((tz,Sa)=>{var wp=bn();Sa.exports=kp;function kp(e,t,r){return wp(e,t,null,r)}i(kp,"serial")});var Aa=k((nz,Ea)=>{Ea.exports={parallel:ba(),serial:$a(),serialOrdered:bn()}});var In=k((oz,za)=>{"use strict";za.exports=Object});var ka=k((iz,wa)=>{"use strict";wa.exports=Error});var Ra=k((az,Oa)=>{"use strict";Oa.exports=EvalError});var Da=k((sz,Na)=>{"use strict";Na.exports=RangeError});var Ua=k((uz,Ca)=>{"use strict";Ca.exports=ReferenceError});var La=k((cz,Ma)=>{"use strict";Ma.exports=SyntaxError});var br=k((lz,ja)=>{"use strict";ja.exports=TypeError});var Ba=k((pz,Fa)=>{"use strict";Fa.exports=URIError});var Za=k((dz,Va)=>{"use strict";Va.exports=Math.abs});var qa=k((mz,Ha)=>{"use strict";Ha.exports=Math.floor});var Ga=k((fz,Wa)=>{"use strict";Wa.exports=Math.max});var Ja=k((gz,Ka)=>{"use strict";Ka.exports=Math.min});var Ya=k((yz,Xa)=>{"use strict";Xa.exports=Math.pow});var es=k((hz,Qa)=>{"use strict";Qa.exports=Math.round});var rs=k((vz,ts)=>{"use strict";ts.exports=Number.isNaN||i(function(t){return t!==t},"isNaN")});var os=k((_z,ns)=>{"use strict";var Op=rs();ns.exports=i(function(t){return Op(t)||t===0?t:t<0?-1:1},"sign")});var as=k((bz,is)=>{"use strict";is.exports=Object.getOwnPropertyDescriptor});var Tn=k((Iz,ss)=>{"use strict";var Ir=as();if(Ir)try{Ir([],"length")}catch{Ir=null}ss.exports=Ir});var cs=k((Tz,us)=>{"use strict";var Tr=Object.defineProperty||!1;if(Tr)try{Tr({},"a",{value:1})}catch{Tr=!1}us.exports=Tr});var Sn=k((Sz,ls)=>{"use strict";ls.exports=i(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;t[r]=o;for(var 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 s=Object.getOwnPropertySymbols(t);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==o||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ms=k((Ez,ds)=>{"use strict";var ps=typeof Symbol<"u"&&Symbol,Rp=Sn();ds.exports=i(function(){return typeof ps!="function"||typeof Symbol!="function"||typeof ps("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Rp()},"hasNativeSymbols")});var $n=k((zz,fs)=>{"use strict";fs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var En=k((wz,gs)=>{"use strict";var Np=In();gs.exports=Np.getPrototypeOf||null});var vs=k((kz,hs)=>{"use strict";var Dp="Function.prototype.bind called on incompatible ",Cp=Object.prototype.toString,Up=Math.max,Mp="[object Function]",ys=i(function(t,r){for(var n=[],o=0;o<t.length;o+=1)n[o]=t[o];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Lp=i(function(t,r){for(var n=[],o=r||0,u=0;o<t.length;o+=1,u+=1)n[u]=t[o];return n},"slicy"),jp=i(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");hs.exports=i(function(t){var r=this;if(typeof r!="function"||Cp.apply(r)!==Mp)throw new TypeError(Dp+r);for(var n=Lp(arguments,1),o,u=i(function(){if(this instanceof o){var v=r.apply(this,ys(n,arguments));return Object(v)===v?v:this}return r.apply(t,ys(n,arguments))},"binder"),s=Up(0,r.length-n.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(o=Function("binder","return function ("+jp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=i(function(){},"Empty");g.prototype=r.prototype,o.prototype=new g,g.prototype=null}return o},"bind")});var ft=k((Rz,xs)=>{"use strict";var Fp=vs();xs.exports=Function.prototype.bind||Fp});var Sr=k((Nz,_s)=>{"use strict";_s.exports=Function.prototype.call});var An=k((Dz,Ps)=>{"use strict";Ps.exports=Function.prototype.apply});var Is=k((Cz,bs)=>{"use strict";bs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ss=k((Uz,Ts)=>{"use strict";var Bp=ft(),Vp=An(),Zp=Sr(),Hp=Is();Ts.exports=Hp||Bp.call(Zp,Vp)});var Es=k((Mz,$s)=>{"use strict";var qp=ft(),Wp=br(),Gp=Sr(),Kp=Ss();$s.exports=i(function(t){if(t.length<1||typeof t[0]!="function")throw new Wp("a function is required");return Kp(qp,Gp,t)},"callBindBasic")});var Rs=k((jz,Os)=>{"use strict";var Jp=Es(),As=Tn(),ws;try{ws=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var zn=!!ws&&As&&As(Object.prototype,"__proto__"),ks=Object,zs=ks.getPrototypeOf;Os.exports=zn&&typeof zn.get=="function"?Jp([zn.get]):typeof zs=="function"?i(function(t){return zs(t==null?t:ks(t))},"getDunder"):!1});var Ms=k((Bz,Us)=>{"use strict";var Ns=$n(),Ds=En(),Cs=Rs();Us.exports=Ns?i(function(t){return Ns(t)},"getProto"):Ds?i(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ds(t)},"getProto"):Cs?i(function(t){return Cs(t)},"getProto"):null});var wn=k((Zz,Ls)=>{"use strict";var Xp=Function.prototype.call,Yp=Object.prototype.hasOwnProperty,Qp=ft();Ls.exports=Qp.call(Xp,Yp)});var qs=k((Hz,Hs)=>{"use strict";var W,ed=In(),td=ka(),rd=Ra(),nd=Da(),od=Ua(),vt=La(),ht=br(),id=Ba(),ad=Za(),sd=qa(),ud=Ga(),cd=Ja(),ld=Ya(),pd=es(),dd=os(),Vs=Function,kn=i(function(e){try{return Vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Vt=Tn(),md=cs(),On=i(function(){throw new ht},"throwTypeError"),fd=Vt?function(){try{return arguments.callee,On}catch{try{return Vt(arguments,"callee").get}catch{return On}}}():On,gt=ms()(),fe=Ms(),gd=En(),yd=$n(),Zs=An(),Zt=Sr(),yt={},hd=typeof Uint8Array>"u"||!fe?W:fe(Uint8Array),tt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?W:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?W:ArrayBuffer,"%ArrayIteratorPrototype%":gt&&fe?fe([][Symbol.iterator]()):W,"%AsyncFromSyncIteratorPrototype%":W,"%AsyncFunction%":yt,"%AsyncGenerator%":yt,"%AsyncGeneratorFunction%":yt,"%AsyncIteratorPrototype%":yt,"%Atomics%":typeof Atomics>"u"?W:Atomics,"%BigInt%":typeof BigInt>"u"?W:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?W:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?W:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?W:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":td,"%eval%":eval,"%EvalError%":rd,"%Float16Array%":typeof Float16Array>"u"?W:Float16Array,"%Float32Array%":typeof Float32Array>"u"?W:Float32Array,"%Float64Array%":typeof Float64Array>"u"?W:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?W:FinalizationRegistry,"%Function%":Vs,"%GeneratorFunction%":yt,"%Int8Array%":typeof Int8Array>"u"?W:Int8Array,"%Int16Array%":typeof Int16Array>"u"?W:Int16Array,"%Int32Array%":typeof Int32Array>"u"?W:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gt&&fe?fe(fe([][Symbol.iterator]())):W,"%JSON%":typeof JSON=="object"?JSON:W,"%Map%":typeof Map>"u"?W:Map,"%MapIteratorPrototype%":typeof Map>"u"||!gt||!fe?W:fe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":ed,"%Object.getOwnPropertyDescriptor%":Vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?W:Promise,"%Proxy%":typeof Proxy>"u"?W:Proxy,"%RangeError%":nd,"%ReferenceError%":od,"%Reflect%":typeof Reflect>"u"?W:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?W:Set,"%SetIteratorPrototype%":typeof Set>"u"||!gt||!fe?W:fe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?W:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gt&&fe?fe(""[Symbol.iterator]()):W,"%Symbol%":gt?Symbol:W,"%SyntaxError%":vt,"%ThrowTypeError%":fd,"%TypedArray%":hd,"%TypeError%":ht,"%Uint8Array%":typeof Uint8Array>"u"?W:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?W:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?W:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?W:Uint32Array,"%URIError%":id,"%WeakMap%":typeof WeakMap>"u"?W:WeakMap,"%WeakRef%":typeof WeakRef>"u"?W:WeakRef,"%WeakSet%":typeof WeakSet>"u"?W:WeakSet,"%Function.prototype.call%":Zt,"%Function.prototype.apply%":Zs,"%Object.defineProperty%":md,"%Object.getPrototypeOf%":gd,"%Math.abs%":ad,"%Math.floor%":sd,"%Math.max%":ud,"%Math.min%":cd,"%Math.pow%":ld,"%Math.round%":pd,"%Math.sign%":dd,"%Reflect.getPrototypeOf%":yd};if(fe)try{null.error}catch(e){js=fe(fe(e)),tt["%Error.prototype%"]=js}var js,vd=i(function e(t){var r;if(t==="%AsyncFunction%")r=kn("async function () {}");else if(t==="%GeneratorFunction%")r=kn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=kn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var o=e("%AsyncGenerator%");o&&fe&&(r=fe(o.prototype))}return tt[t]=r,r},"doEval"),Fs={__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"]},Ht=ft(),$r=wn(),xd=Ht.call(Zt,Array.prototype.concat),_d=Ht.call(Zs,Array.prototype.splice),Bs=Ht.call(Zt,String.prototype.replace),Er=Ht.call(Zt,String.prototype.slice),Pd=Ht.call(Zt,RegExp.prototype.exec),bd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Id=/\\(\\)?/g,Td=i(function(t){var r=Er(t,0,1),n=Er(t,-1);if(r==="%"&&n!=="%")throw new vt("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new vt("invalid intrinsic syntax, expected opening `%`");var o=[];return Bs(t,bd,function(u,s,l,f){o[o.length]=l?Bs(f,Id,"$1"):s||u}),o},"stringToPath"),Sd=i(function(t,r){var n=t,o;if($r(Fs,n)&&(o=Fs[n],n="%"+o[0]+"%"),$r(tt,n)){var u=tt[n];if(u===yt&&(u=vd(n)),typeof u>"u"&&!r)throw new ht("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:u}}throw new vt("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Hs.exports=i(function(t,r){if(typeof t!="string"||t.length===0)throw new ht("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new ht('"allowMissing" argument must be a boolean');if(Pd(/^%?[^%]*%?$/,t)===null)throw new vt("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Td(t),o=n.length>0?n[0]:"",u=Sd("%"+o+"%",r),s=u.name,l=u.value,f=!1,g=u.alias;g&&(o=g[0],_d(n,xd([0,1],g)));for(var v=1,P=!0;v<n.length;v+=1){var y=n[v],c=Er(y,0,1),p=Er(y,-1);if((c==='"'||c==="'"||c==="`"||p==='"'||p==="'"||p==="`")&&c!==p)throw new vt("property names with quotes must have matching quotes");if((y==="constructor"||!P)&&(f=!0),o+="."+y,s="%"+o+"%",$r(tt,s))l=tt[s];else if(l!=null){if(!(y in l)){if(!r)throw new ht("base intrinsic for "+t+" exists, but the property is not available.");return}if(Vt&&v+1>=n.length){var h=Vt(l,y);P=!!h,P&&"get"in h&&!("originalValue"in h.get)?l=h.get:l=l[y]}else P=$r(l,y),l=l[y];P&&!f&&(tt[s]=l)}}return l},"GetIntrinsic")});var Gs=k((Wz,Ws)=>{"use strict";var $d=Sn();Ws.exports=i(function(){return $d()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Xs=k((Kz,Js)=>{"use strict";var Ed=qs(),Ks=Ed("%Object.defineProperty%",!0),Ad=Gs()(),zd=wn(),wd=br(),Ar=Ad?Symbol.toStringTag:null;Js.exports=i(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,o=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof o<"u"&&typeof o!="boolean")throw new wd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Ar&&(n||!zd(t,Ar))&&(Ks?Ks(t,Ar,{configurable:!o,enumerable:!1,value:r,writable:!1}):t[Ar]=r)},"setToStringTag")});var Qs=k((Xz,Ys)=>{"use strict";var kd=Function.prototype.call,Od=Object.prototype.hasOwnProperty,Rd=ft();Ys.exports=Rd.call(kd,Od)});var tu=k((Yz,eu)=>{"use strict";eu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var ou=k((Qz,nu)=>{"use strict";var Cn=aa(),Nd=require("util"),Rn=require("path"),Dd=require("http"),Cd=require("https"),Ud=require("url").parse,Md=require("fs"),Ld=require("stream").Stream,jd=require("crypto"),Nn=pa(),Fd=Aa(),Bd=Xs(),qe=Qs(),Dn=tu();function ru(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}i(ru,"escapeHeaderParam");function K(e){if(!(this instanceof K))return new K(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],Cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}i(K,"FormData");Nd.inherits(K,Cn);K.LINE_BREAK=`\r
|
|
2
|
+
`;K.DEFAULT_CONTENT_TYPE="application/octet-stream";K.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=Cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var o=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(o),n(t),n(u),this._trackLength(o,t,r)};K.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)+K.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&qe(t,"httpVersion"))&&!(t instanceof Ld))&&(r.knownLength||this._valuesToMeasure.push(t))};K.prototype._lengthRetriever=function(e,t){qe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Md.stat(e.path,function(r,n){if(r){t(r);return}var o=n.size-(e.start?e.start:0);t(null,o)}):qe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):qe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};K.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),o=this._getContentType(t,r),u="",s={"Content-Disposition":["form-data",'name="'+ru(e)+'"'].concat(n||[]),"Content-Type":[].concat(o||[])};typeof r.header=="object"&&Dn(s,r.header);var l;for(var f in s)if(qe(s,f)){if(l=s[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+K.LINE_BREAK)}return"--"+this.getBoundary()+K.LINE_BREAK+u+K.LINE_BREAK};K.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Rn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Rn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&qe(e,"httpVersion")&&(r=Rn.basename(e.client._httpMessage.path||"")),r)return'filename="'+ru(r)+'"'};K.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=Nn.lookup(e.name)),!r&&e&&e.path&&(r=Nn.lookup(e.path)),!r&&e&&e.readable&&qe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=Nn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=K.DEFAULT_CONTENT_TYPE),r};K.prototype._multiPartFooter=function(){return function(e){var t=K.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};K.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+K.LINE_BREAK};K.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)qe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};K.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};K.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};K.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(K.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};K.prototype._generateBoundary=function(){this._boundary="--------------------------"+jd.randomBytes(12).toString("hex")};K.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};K.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};K.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}Fd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(o){t+=o}),e(null,t)})};K.prototype.submit=function(e,t){var r,n,o={method:"post"};return typeof e=="string"?(e=Ud(e),n=Dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},o)):(n=Dn(e,o),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Cd.request(n):r=Dd.request(n),this.getLength(function(u,s){if(u&&u!=="Unknown stream"){this._error(u);return}if(s&&r.setHeader("Content-Length",s),this.pipe(r),t){var l,f=i(function(g,v){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,v)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};K.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};K.prototype.toString=function(){return"[object FormData]"};Bd(K.prototype,"FormData");nu.exports=K});var Ln=k((Un,Mn)=>{(function(e,t){typeof Un=="object"&&typeof Mn<"u"?Mn.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs=t()})(Un,function(){"use strict";var e=1e3,t=6e4,r=36e5,n="millisecond",o="second",u="minute",s="hour",l="day",f="week",g="month",v="quarter",P="year",y="date",c="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:i(function(R){var S=["th","st","nd","rd"],T=R%100;return"["+R+(S[(T-20)%10]||S[T]||S[0])+"]"},"ordinal")},x=i(function(R,S,T){var A=String(R);return!A||A.length>=S?R:""+Array(S+1-A.length).join(T)+R},"m"),I={s:x,z:i(function(R){var S=-R.utcOffset(),T=Math.abs(S),A=Math.floor(T/60),$=T%60;return(S<=0?"+":"-")+x(A,2,"0")+":"+x($,2,"0")},"z"),m:i(function R(S,T){if(S.date()<T.date())return-R(T,S);var A=12*(T.year()-S.year())+(T.month()-S.month()),$=S.clone().add(A,g),O=T-$<0,Z=S.clone().add(A+(O?-1:1),g);return+(-(A+(T-$)/(O?$-Z:Z-$))||0)},"t"),a:i(function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},"a"),p:i(function(R){return{M:g,y:P,w:f,d:l,D:y,h:s,m:u,s:o,ms:n,Q:v}[R]||String(R||"").toLowerCase().replace(/s$/,"")},"p"),u:i(function(R){return R===void 0},"u")},D="en",Q={};Q[D]=m;var oe=i(function(R){return R instanceof we},"p"),ye=i(function R(S,T,A){var $;if(!S)return D;if(typeof S=="string"){var O=S.toLowerCase();Q[O]&&($=O),T&&(Q[O]=T,$=O);var Z=S.split("-");if(!$&&Z.length>1)return R(Z[0])}else{var te=S.name;Q[te]=S,$=te}return!A&&$&&(D=$),$||!A&&D},"t"),Y=i(function(R,S){if(oe(R))return R.clone();var T=typeof S=="object"?S:{};return T.date=R,T.args=arguments,new we(T)},"w"),E=I;E.l=ye,E.i=oe,E.w=function(R,S){return Y(R,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var we=function(){function R(T){this.$L=ye(T.locale,null,!0),this.parse(T)}i(R,"M");var S=R.prototype;return S.parse=function(T){this.$d=function(A){var $=A.date,O=A.utc;if($===null)return new Date(NaN);if(E.u($))return new Date;if($ instanceof Date)return new Date($);if(typeof $=="string"&&!/Z$/i.test($)){var Z=$.match(p);if(Z){var te=Z[2]-1||0,le=(Z[7]||"0").substring(0,3);return O?new Date(Date.UTC(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,le)):new Date(Z[1],te,Z[3]||1,Z[4]||0,Z[5]||0,Z[6]||0,le)}}return new Date($)}(T),this.$x=T.x||{},this.init()},S.init=function(){var T=this.$d;this.$y=T.getFullYear(),this.$M=T.getMonth(),this.$D=T.getDate(),this.$W=T.getDay(),this.$H=T.getHours(),this.$m=T.getMinutes(),this.$s=T.getSeconds(),this.$ms=T.getMilliseconds()},S.$utils=function(){return E},S.isValid=function(){return this.$d.toString()!==c},S.isSame=function(T,A){var $=Y(T);return this.startOf(A)<=$&&$<=this.endOf(A)},S.isAfter=function(T,A){return Y(T)<this.startOf(A)},S.isBefore=function(T,A){return this.endOf(A)<Y(T)},S.$g=function(T,A,$){return E.u(T)?this[A]:this.set($,T)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(T,A){var $=this,O=!!E.u(A)||A,Z=E.p(T),te=i(function(Je,xe){var Me=E.w($.$u?Date.UTC($.$y,xe,Je):new Date($.$y,xe,Je),$);return O?Me:Me.endOf(l)},"l"),le=i(function(Je,xe){return E.w($.toDate()[Je].apply($.toDate("s"),(O?[0,0,0,0]:[23,59,59,999]).slice(xe)),$)},"$"),me=this.$W,he=this.$M,Ie=this.$D,rt="set"+(this.$u?"UTC":"");switch(Z){case P:return O?te(1,0):te(31,11);case g:return O?te(1,he):te(0,he+1);case f:var Ke=this.$locale().weekStart||0,_t=(me<Ke?me+7:me)-Ke;return te(O?Ie-_t:Ie+(6-_t),he);case l:case y:return le(rt+"Hours",0);case s:return le(rt+"Minutes",1);case u:return le(rt+"Seconds",2);case o:return le(rt+"Milliseconds",3);default:return this.clone()}},S.endOf=function(T){return this.startOf(T,!1)},S.$set=function(T,A){var $,O=E.p(T),Z="set"+(this.$u?"UTC":""),te=($={},$[l]=Z+"Date",$[y]=Z+"Date",$[g]=Z+"Month",$[P]=Z+"FullYear",$[s]=Z+"Hours",$[u]=Z+"Minutes",$[o]=Z+"Seconds",$[n]=Z+"Milliseconds",$)[O],le=O===l?this.$D+(A-this.$W):A;if(O===g||O===P){var me=this.clone().set(y,1);me.$d[te](le),me.init(),this.$d=me.set(y,Math.min(this.$D,me.daysInMonth())).$d}else te&&this.$d[te](le);return this.init(),this},S.set=function(T,A){return this.clone().$set(T,A)},S.get=function(T){return this[E.p(T)]()},S.add=function(T,A){var $,O=this;T=Number(T);var Z=E.p(A),te=i(function(he){var Ie=Y(O);return E.w(Ie.date(Ie.date()+Math.round(he*T)),O)},"y");if(Z===g)return this.set(g,this.$M+T);if(Z===P)return this.set(P,this.$y+T);if(Z===l)return te(1);if(Z===f)return te(7);var le=($={},$[u]=t,$[s]=r,$[o]=e,$)[Z]||1,me=this.$d.getTime()+T*le;return E.w(me,this)},S.subtract=function(T,A){return this.add(-1*T,A)},S.format=function(T){var A=this,$=this.$locale();if(!this.isValid())return $.invalidDate||c;var O=T||"YYYY-MM-DDTHH:mm:ssZ",Z=E.z(this),te=this.$H,le=this.$m,me=this.$M,he=$.weekdays,Ie=$.months,rt=$.meridiem,Ke=i(function(xe,Me,Pt,qt){return xe&&(xe[Me]||xe(A,O))||Pt[Me].slice(0,qt)},"h"),_t=i(function(xe){return E.s(te%12||12,xe,"0")},"d"),Je=rt||function(xe,Me,Pt){var qt=xe<12?"AM":"PM";return Pt?qt.toLowerCase():qt};return O.replace(h,function(xe,Me){return Me||function(Pt){switch(Pt){case"YY":return String(A.$y).slice(-2);case"YYYY":return E.s(A.$y,4,"0");case"M":return me+1;case"MM":return E.s(me+1,2,"0");case"MMM":return Ke($.monthsShort,me,Ie,3);case"MMMM":return Ke(Ie,me);case"D":return A.$D;case"DD":return E.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return Ke($.weekdaysMin,A.$W,he,2);case"ddd":return Ke($.weekdaysShort,A.$W,he,3);case"dddd":return he[A.$W];case"H":return String(te);case"HH":return E.s(te,2,"0");case"h":return _t(1);case"hh":return _t(2);case"a":return Je(te,le,!0);case"A":return Je(te,le,!1);case"m":return String(le);case"mm":return E.s(le,2,"0");case"s":return String(A.$s);case"ss":return E.s(A.$s,2,"0");case"SSS":return E.s(A.$ms,3,"0");case"Z":return Z}return null}(xe)||Z.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(T,A,$){var O,Z=this,te=E.p(A),le=Y(T),me=(le.utcOffset()-this.utcOffset())*t,he=this-le,Ie=i(function(){return E.m(Z,le)},"D");switch(te){case P:O=Ie()/12;break;case g:O=Ie();break;case v:O=Ie()/3;break;case f:O=(he-me)/6048e5;break;case l:O=(he-me)/864e5;break;case s:O=he/r;break;case u:O=he/t;break;case o:O=he/e;break;default:O=he}return $?O:E.a(O)},S.daysInMonth=function(){return this.endOf(g).$D},S.$locale=function(){return Q[this.$L]},S.locale=function(T,A){if(!T)return this.$L;var $=this.clone(),O=ye(T,A,!0);return O&&($.$L=O),$},S.clone=function(){return E.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},R}(),re=we.prototype;return Y.prototype=re,[["$ms",n],["$s",o],["$m",u],["$H",s],["$W",l],["$M",g],["$y",P],["$D",y]].forEach(function(R){re[R[1]]=function(S){return this.$g(S,R[0],R[1])}}),Y.extend=function(R,S){return R.$i||(R(S,we,Y),R.$i=!0),Y},Y.locale=ye,Y.isDayjs=oe,Y.unix=function(R){return Y(1e3*R)},Y.en=Q[D],Y.Ls=Q,Y.p={},Y})});var tm={};Bn(tm,{klaviyo:()=>em});module.exports=Au(tm);var zu=Object.freeze({status:"aborted"});function z(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:s,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let g=s.prototype,v=Object.keys(g);for(let P=0;P<v.length;P++){let y=v[P];y in l||(l[y]=g[y].bind(l))}}i(n,"init");let o=r?.Parent??Object;class u extends o{static{i(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function s(l){var f;let g=r?.Parent?new u:this;n(g,l),(f=g._zod).deferred??(f.deferred=[]);for(let v of g._zod.deferred)v();return g}return i(s,"_"),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:i(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(s,"name",{value:e}),s}i(z,"$constructor");var wu=Symbol("zod_brand"),Ee=class extends Error{static{i(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Wt=class extends Error{static{i(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Or={};function ke(e){return e&&Object.assign(Or,e),Or}i(ke,"config");function Nr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}i(Nr,"getEnumValues");function Hn(e,t){return typeof t=="bigint"?t.toString():t}i(Hn,"jsonStringifyReplacer");function Kt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}i(Kt,"cached");function qn(e){return e==null}i(qn,"nullish");function Jt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}i(Jt,"cleanRegex");var Zn=Symbol("evaluating");function pe(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Zn)return n===void 0&&(n=Zn,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}i(pe,"defineLazy");var Dr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function It(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}i(It,"isObject");var ku=Kt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Wn(e){if(It(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(It(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}i(Wn,"isPlainObject");var Gn=new Set(["string","number","symbol"]);function nt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}i(nt,"escapeRegex");function Xt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}i(Xt,"clone");function ie(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:i(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:i(()=>t.error,"error")}:t}i(ie,"normalizeParams");function Kn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}i(Kn,"optionalKeys");var Ou={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 ot(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}i(ot,"aborted");function je(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}i(je,"prefixIssues");function Gt(e){return typeof e=="string"?e:e?.message}i(Gt,"unwrapMessage");function Fe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=Gt(e.inst?._zod.def?.error?.(e))??Gt(t?.error?.(e))??Gt(r.customError?.(e))??Gt(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}i(Fe,"finalizeIssue");function Jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}i(Jn,"getLengthableOrigin");function Cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}i(Cr,"issue");var Xn=i((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Hn,2),Object.defineProperty(e,"toString",{value:i(()=>e.message,"value"),enumerable:!1})},"initializer"),Yn=z("$ZodError",Xn),Tt=z("$ZodError",Xn,{Parent:Error});var Nu=i(e=>(t,r,n,o)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},u);if(s instanceof Promise)throw new Ee;if(s.issues.length){let l=new(o?.Err??e)(s.issues.map(f=>Fe(f,u,ke())));throw Dr(l,o?.callee),l}return s.value},"_parse"),Yt=Nu(Tt),Du=i(e=>async(t,r,n,o)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},u);if(s instanceof Promise&&(s=await s),s.issues.length){let l=new(o?.Err??e)(s.issues.map(f=>Fe(f,u,ke())));throw Dr(l,o?.callee),l}return s.value},"_parseAsync"),Qt=Du(Tt),Cu=i(e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},o);if(u instanceof Promise)throw new Ee;return u.issues.length?{success:!1,error:new(e??Yn)(u.issues.map(s=>Fe(s,o,ke())))}:{success:!0,data:u.value}},"_safeParse"),St=Cu(Tt),Uu=i(e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},o);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(s=>Fe(s,o,ke())))}:{success:!0,data:u.value}},"_safeParseAsync"),$t=Uu(Tt);var Mu="(?:(?:\\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])))",Lu=new RegExp(`^${Mu}$`);var Qn=i(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),eo=/^-?\d+n?$/;var Ur=/^-?\d+(?:\.\d+)?$/,to=/^(?:true|false)$/i;var it=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ro=z("$ZodCheckMinLength",(e,t)=>{var r;it.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!qn(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let s=Jn(o);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}});var Mr=z("$ZodCheckStringFormat",(e,t)=>{var r,n;it.init(e,t),e._zod.onattach.push(o=>{let u=o._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=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),no=z("$ZodCheckRegex",(e,t)=>{Mr.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 io={major:4,minor:3,patch:6};var ae=z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=io;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let u of o._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 o=i((s,l,f)=>{let g=ot(s),v;for(let P of l){if(P._zod.def.when){if(!P._zod.def.when(s))continue}else if(g)continue;let y=s.issues.length,c=P._zod.check(s);if(c instanceof Promise&&f?.async===!1)throw new Ee;if(v||c instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await c,s.issues.length!==y&&(g||(g=ot(s,y)))});else{if(s.issues.length===y)continue;g||(g=ot(s,y))}}return v?v.then(()=>s):s},"runChecks"),u=i((s,l,f)=>{if(ot(s))return s.aborted=!0,s;let g=o(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new Ee;return g.then(v=>e._zod.parse(v,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(s,l)=>{if(l.skipChecks)return e._zod.parse(s,l);if(l.direction==="backward"){let g=e._zod.parse({value:s.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(v=>u(v,s,l)):u(g,s,l)}let f=e._zod.parse(s,l);if(f instanceof Promise){if(l.async===!1)throw new Ee;return f.then(g=>o(g,n,l))}return o(f,n,l)}}pe(e,"~standard",()=>({validate:i(o=>{try{let u=St(e,o);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return $t(e,o).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},"validate"),vendor:"zod",version:1}))}),rr=z("$ZodString",(e,t)=>{ae.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Lr=z("$ZodStringFormat",(e,t)=>{Mr.init(e,t),rr.init(e,t)});var lo=z("$ZodURL",(e,t)=>{Lr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var po=z("$ZodNumber",(e,t)=>{ae.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ur,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let u=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...u?{received:u}:{}}),r}});var jr=z("$ZodBoolean",(e,t)=>{ae.init(e,t),e._zod.pattern=to,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),mo=z("$ZodBigInt",(e,t)=>{ae.init(e,t),e._zod.pattern=eo,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 fo=z("$ZodAny",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r}),go=z("$ZodUnknown",(e,t)=>{ae.init(e,t),e._zod.parse=r=>r});var yo=z("$ZodVoid",(e,t)=>{ae.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:e}),r}}),ho=z("$ZodDate",(e,t)=>{ae.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,u=o instanceof Date;return u&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ao(e,t,r){e.issues.length&&t.issues.push(...je(r,e.issues)),t.value[r]=e.value}i(ao,"handleArrayResult");var vo=z("$ZodArray",(e,t)=>{ae.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let u=[];for(let s=0;s<o.length;s++){let l=o[s],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(g=>ao(g,r,s))):ao(f,r,s)}return u.length?Promise.all(u).then(()=>r):r}});function tr(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...je(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}i(tr,"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=Kn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}i(ju,"normalizeDef");function Fu(e,t,r,n,o,u){let s=[],l=o.keySet,f=o.catchall._zod,g=f.def.type,v=f.optout==="optional";for(let P in t){if(l.has(P))continue;if(g==="never"){s.push(P);continue}let y=f.run({value:t[P],issues:[]},n);y instanceof Promise?e.push(y.then(c=>tr(c,r,P,t,v))):tr(y,r,P,t,v)}return s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}i(Fu,"handleCatchall");var xo=z("$ZodObject",(e,t)=>{if(ae.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:i(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Kt(()=>ju(t));pe(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let v=l[g]._zod;if(v.values){f[g]??(f[g]=new Set);for(let P of v.values)f[g].add(P)}}return f});let o=It,u=t.catchall,s;e._zod.parse=(l,f)=>{s??(s=n.value);let g=l.value;if(!o(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let v=[],P=s.shape;for(let y of s.keys){let c=P[y],p=c._zod.optout==="optional",h=c._zod.run({value:g[y],issues:[]},f);h instanceof Promise?v.push(h.then(m=>tr(m,l,y,g,p))):tr(h,l,y,g,p)}return u?Fu(v,g,l,f,n.value,e):v.length?Promise.all(v).then(()=>l):l}});function so(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let o=e.filter(u=>!ot(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(s=>Fe(s,n,ke())))}),t)}i(so,"handleUnionResults");var Fr=z("$ZodUnion",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),pe(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),pe(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),pe(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>Jt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(r)return n(o,u);let s=!1,l=[];for(let f of t.options){let g=f._zod.run({value:o.value,issues:[]},u);if(g instanceof Promise)l.push(g),s=!0;else{if(g.issues.length===0)return g;l.push(g)}}return s?Promise.all(l).then(f=>so(f,o,e,u)):so(l,o,e,u)}});var _o=z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Fr.init(e,t);let r=e._zod.parse;pe(e._zod,"propValues",()=>{let o={};for(let u of t.options){let s=u._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(s)){o[l]||(o[l]=new Set);for(let g of f)o[l].add(g)}}return o});let n=Kt(()=>{let o=t.options,u=new Map;for(let s of o){let l=s._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,s)}}return u});e._zod.parse=(o,u)=>{let s=o.value;if(!It(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;let l=n.value.get(s?.[t.discriminator]);return l?l._zod.run(o,u):t.unionFallback?r(o,u):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}});var Po=z("$ZodRecord",(e,t)=>{ae.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Wn(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;let u=[],s=t.keyType._zod.values;if(s){r.value={};let l=new Set;for(let g of s)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.add(typeof g=="number"?g.toString():g);let v=t.valueType._zod.run({value:o[g],issues:[]},n);v instanceof Promise?u.push(v.then(P=>{P.issues.length&&r.issues.push(...je(g,P.issues)),r.value[g]=P.value})):(v.issues.length&&r.issues.push(...je(g,v.issues)),r.value[g]=v.value)}let f;for(let g in o)l.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(o)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Ur.test(l)&&f.issues.length){let P=t.keyType._zod.run({value:Number(l),issues:[]},n);if(P instanceof Promise)throw new Error("Async schemas not supported in object keys currently");P.issues.length===0&&(f=P)}if(f.issues.length){t.mode==="loose"?r.value[l]=o[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(P=>Fe(P,n,ke())),input:l,path:[l],inst:e});continue}let v=t.valueType._zod.run({value:o[l],issues:[]},n);v instanceof Promise?u.push(v.then(P=>{P.issues.length&&r.issues.push(...je(l,P.issues)),r.value[f.value]=P.value})):(v.issues.length&&r.issues.push(...je(l,v.issues)),r.value[f.value]=v.value)}}return u.length?Promise.all(u).then(()=>r):r}});var bo=z("$ZodEnum",(e,t)=>{ae.init(e,t);let r=Nr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Gn.has(typeof o)).map(o=>typeof o=="string"?nt(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{let s=o.value;return n.has(s)||o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),Io=z("$ZodLiteral",(e,t)=>{if(ae.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"?nt(n):n?nt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var To=z("$ZodTransform",(e,t)=>{ae.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Wt(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(r.value=s,r));if(o instanceof Promise)throw new Ee;return r.value=o,r}});function uo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}i(uo,"handleOptionalResult");var So=z("$ZodOptional",(e,t)=>{ae.init(e,t),e._zod.optin="optional",e._zod.optout="optional",pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Jt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(u=>uo(u,r.value)):uo(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var $o=z("$ZodNullable",(e,t)=>{ae.init(e,t),pe(e._zod,"optin",()=>t.innerType._zod.optin),pe(e._zod,"optout",()=>t.innerType._zod.optout),pe(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Jt(r.source)}|null)$`):void 0}),pe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Eo=z("$ZodPipe",(e,t)=>{ae.init(e,t),pe(e._zod,"values",()=>t.in._zod.values),pe(e._zod,"optin",()=>t.in._zod.optin),pe(e._zod,"optout",()=>t.out._zod.optout),pe(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(s=>er(s,t.in,n)):er(u,t.in,n)}let o=t.in._zod.run(r,n);return o instanceof Promise?o.then(u=>er(u,t.out,n)):er(o,t.out,n)}});function er(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}i(er,"handlePipeResult");var Ao=z("$ZodCustom",(e,t)=>{it.init(e,t),ae.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(u=>co(u,r,n,e));co(o,r,n,e)}});function co(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Cr(o))}}i(co,"handleRefineResult");var wo,Hu=Symbol("ZodOutput"),qu=Symbol("ZodInput"),Br=class{static{i(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function ko(){return new Br}i(ko,"registry");(wo=globalThis).__zod_globalRegistry??(wo.__zod_globalRegistry=ko());var Vr=globalThis.__zod_globalRegistry;function Oo(e,t){return new e({type:"string",...ie(t)})}i(Oo,"_string");function Ro(e,t){return new e({type:"string",coerce:!0,...ie(t)})}i(Ro,"_coercedString");function No(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ie(t)})}i(No,"_url");function Do(e,t){return new e({type:"number",checks:[],...ie(t)})}i(Do,"_number");function Co(e,t){return new e({type:"number",coerce:!0,checks:[],...ie(t)})}i(Co,"_coercedNumber");function Uo(e,t){return new e({type:"boolean",...ie(t)})}i(Uo,"_boolean");function Mo(e,t){return new e({type:"boolean",coerce:!0,...ie(t)})}i(Mo,"_coercedBoolean");function Lo(e,t){return new e({type:"bigint",coerce:!0,...ie(t)})}i(Lo,"_coercedBigint");function jo(e){return new e({type:"any"})}i(jo,"_any");function Fo(e){return new e({type:"unknown"})}i(Fo,"_unknown");function Bo(e,t){return new e({type:"void",...ie(t)})}i(Bo,"_void");function Vo(e,t){return new e({type:"date",coerce:!0,...ie(t)})}i(Vo,"_coercedDate");function Se(e,t){return new ro({check:"min_length",...ie(t),minimum:e})}i(Se,"_minLength");function Be(e,t){return new no({check:"string_format",format:"regex",...ie(t),pattern:e})}i(Be,"_regex");function Zo(e,t,r){let n=ie(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}i(Zo,"_custom");var de=z("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");ae.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Yt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>St(e,r,n),e.parseAsync=async(r,n)=>Qt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>$t(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)=>Xt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),or=z("ZodMiniString",(e,t)=>{rr.init(e,t),de.init(e,t)});function a(e){return Oo(or,e)}i(a,"string");var Ho=z("ZodMiniStringFormat",(e,t)=>{Lr.init(e,t),or.init(e,t)});var rc=z("ZodMiniURL",(e,t)=>{lo.init(e,t),Ho.init(e,t)});function qo(e){return No(rc,e)}i(qo,"url");var Zr=z("ZodMiniNumber",(e,t)=>{po.init(e,t),de.init(e,t)});function ve(e){return Do(Zr,e)}i(ve,"number");var Hr=z("ZodMiniBoolean",(e,t)=>{jr.init(e,t),de.init(e,t)});function ee(e){return Uo(Hr,e)}i(ee,"boolean");var Wo=z("ZodMiniBigInt",(e,t)=>{mo.init(e,t),de.init(e,t)});var nc=z("ZodMiniAny",(e,t)=>{fo.init(e,t),de.init(e,t)});function At(){return jo(nc)}i(At,"any");var oc=z("ZodMiniUnknown",(e,t)=>{go.init(e,t),de.init(e,t)});function L(){return Fo(oc)}i(L,"unknown");var ic=z("ZodMiniVoid",(e,t)=>{yo.init(e,t),de.init(e,t)});function Go(e){return Bo(ic,e)}i(Go,"_void");var Ko=z("ZodMiniDate",(e,t)=>{ho.init(e,t),de.init(e,t)});var ac=z("ZodMiniArray",(e,t)=>{vo.init(e,t),de.init(e,t)});function B(e,t){return new ac({type:"array",element:e,...ie(t)})}i(B,"array");var sc=z("ZodMiniObject",(e,t)=>{xo.init(e,t),de.init(e,t),pe(e,"shape",()=>t.shape)});function d(e,t){let r={type:"object",shape:e??{},...ie(t)};return new sc(r)}i(d,"object");var uc=z("ZodMiniUnion",(e,t)=>{Fr.init(e,t),de.init(e,t)});function V(e,t){return new uc({type:"union",options:e,...ie(t)})}i(V,"union");var cc=z("ZodMiniDiscriminatedUnion",(e,t)=>{_o.init(e,t),de.init(e,t)});function at(e,t,r){return new cc({type:"union",options:t,discriminator:e,...ie(r)})}i(at,"discriminatedUnion");var lc=z("ZodMiniRecord",(e,t)=>{Po.init(e,t),de.init(e,t)});function j(e,t,r){return new lc({type:"record",keyType:e,valueType:t,...ie(r)})}i(j,"record");var pc=z("ZodMiniEnum",(e,t)=>{bo.init(e,t),de.init(e,t),e.options=Object.values(t.entries)});function q(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new pc({type:"enum",entries:r,...ie(t)})}i(q,"_enum");var dc=z("ZodMiniLiteral",(e,t)=>{Io.init(e,t),de.init(e,t)});function N(e,t){return new dc({type:"literal",values:Array.isArray(e)?e:[e],...ie(t)})}i(N,"literal");var mc=z("ZodMiniTransform",(e,t)=>{To.init(e,t),de.init(e,t)});function Ve(e){return new mc({type:"transform",transform:e})}i(Ve,"transform");var fc=z("ZodMiniOptional",(e,t)=>{So.init(e,t),de.init(e,t)});function _(e){return new fc({type:"optional",innerType:e})}i(_,"optional");var gc=z("ZodMiniNullable",(e,t)=>{$o.init(e,t),de.init(e,t)});function zt(e){return new gc({type:"nullable",innerType:e})}i(zt,"nullable");var yc=z("ZodMiniPipe",(e,t)=>{Eo.init(e,t),de.init(e,t)});function Ze(e,t){return new yc({type:"pipe",in:e,out:t})}i(Ze,"pipe");var hc=z("ZodMiniCustom",(e,t)=>{Ao.init(e,t),de.init(e,t)});function ir(e,t){return Zo(hc,e??(()=>!0),t)}i(ir,"custom");var wt={};Bn(wt,{bigint:()=>Tc,boolean:()=>Ic,date:()=>Sc,number:()=>bc,string:()=>Pc});function Pc(e){return Ro(or,e)}i(Pc,"string");function bc(e){return Co(Zr,e)}i(bc,"number");function Ic(e){return Mo(Hr,e)}i(Ic,"boolean");function Tc(e){return Lo(Wo,e)}i(Tc,"bigint");function Sc(e){return Vo(Ko,e)}i(Sc,"date");var Wr=d({retryOnFailure:d({defaultValue:_(ee()),hide:_(ee())}),continueOnFailure:d({defaultValue:_(ee()),hide:_(ee())})}),qr=class{constructor(t,r,n,o,u,s,l,f,g,v,P){this.name=t;this.displayName=r;this.description=n;this.props=o;this.run=u;this.test=s;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=v;this.aiMetadata=P}static{i(this,"IAction")}},se=i(e=>new qr(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 X=d({displayName:a(),description:_(a())}),H=i((e,t)=>d({type:N(t),required:ee(),defaultValue:_(At())}),"TPropertyValue");var Pe=d({...X.shape,...H(a(),"SHORT_TEXT").shape}),Oe=d({...X.shape,...H(a(),"LONG_TEXT").shape});var Xo=d({label:a(),value:L()}),ar=d({disabled:_(ee()),placeholder:_(a()),options:B(Xo)});var be=d({...X.shape,options:ar,...H(L(),"STATIC_DROPDOWN").shape}),Re=d({...X.shape,options:ar,...H(B(L()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Gr=d({...X.shape,...H(L(),"DROPDOWN").shape,refreshers:B(a())}),kt=d({...X.shape,...H(B(L()),"MULTI_SELECT_DROPDOWN").shape,refreshers:B(a())});var Ne=d({...X.shape,...H(ee(),"CHECKBOX").shape});var De=d({...X.shape,...H(ve(),"NUMBER").shape});var Ot=d({...X.shape,...H(L(),"FILE").shape});var Rt=d({...X.shape,...H(a(),"DATE_TIME").shape});var Yo=j(a(),V([Pe,Oe,be,kt,Re,Ne,De,Ot,Rt])),Nt=d({...X.shape,properties:Yo,...H(B(L()),"ARRAY").shape});var Dt=d({...X.shape,...H(V([j(a(),L())]),"JSON").shape});var Qo=V([Pe,be,Dt,Nt,Re]),Ec=j(a(),Qo),Kr=d({refreshers:B(a()),...X.shape,...H(L(),"DYNAMIC").shape});var sr=d({...X.shape,...H(Go(),"MARKDOWN").shape});var Ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(Ct||{}),st=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(st||{}),ut=(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))(ut||{});var Ut=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(Ut||{}),Jr="both_client_credentials_and_authorization_code";var Ce=(o=>(o.POLLING="POLLING",o.WEBHOOK="WEBHOOK",o.APP_WEBHOOK="APP_WEBHOOK",o.MANUAL="MANUAL",o))(Ce||{}),Mt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(Mt||{}),Ac=d({strategy:q(Mt),paramName:_(a())}),Lt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Lt||{});var ur=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(ur||{}),ei=d({status:_(ve()),body:_(L()),headers:_(j(a(),a()))}),ti=d({type:N("DELAY"),resumeDateTime:a(),requestIdToReply:_(a()),handlerId:_(a()),streamStepProgress:_(q(ur))}),ri=d({type:N("WEBHOOK"),requestId:a(),requestIdToReply:_(a()),response:ei,handlerId:_(a()),streamStepProgress:_(q(ur))}),zc=V([ti,ri]);var wc=d({body:L(),rawBody:_(L()),headers:j(a(),a()),queryParams:j(a(),a())});function ge(e){return e==null}i(ge,"isNil");function jt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}i(jt,"isEmpty");function cr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}i(cr,"assertNotNullOrUndefined");var Xr=Le(require("crypto"),1);var kc=128,Xe,ct,Oc=i(e=>{!Xe||Xe.length<e?(Xe=Buffer.allocUnsafe(e*kc),Xr.default.randomFillSync(Xe),ct=0):ct+e>Xe.length&&(Xr.default.randomFillSync(Xe),ct=0),ct+=e},"fillPool"),Rc=i(e=>(Oc(e|=0),Xe.subarray(ct-e,ct)),"random"),Nc=i((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,o=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let s="";for(;;){let l=r(o),f=o;for(;f--;)if(s+=e[l[f]&n]||"",s.length===u)return s}}},"customRandom"),oi=i((e,t=21)=>Nc(e,t,Rc),"customAlphabet");var Dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ii=21,Mb=a().check(Be(new RegExp(`^[0-9a-zA-Z]{${ii}}$`))),Cc=oi(Dc,ii);var He=Ze(Ve(e=>e instanceof Date?e.toISOString():e),a()),Te={id:a(),created:He,updated:He},ne=i(e=>_(zt(e)),"Nullable");function Yr(e){return _(zt(q(e)))}i(Yr,"NullableEnum");var Fb=Ze(Ve(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),_(ee())),lr=i(e=>Ze(Ve(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),_(B(e))),"OptionalArrayFromQuery");var Zb=j(a(),L());var Ft=(v=>(v.OPENAI="openai",v.OPENROUTER="openrouter",v.ANTHROPIC="anthropic",v.AZURE="azure",v.GOOGLE="google",v.ACTIVEPIECES="activepieces",v.CLOUDFLARE_GATEWAY="cloudflare-gateway",v.CUSTOM="custom",v.BEDROCK="bedrock",v.MISTRAL="mistral",v))(Ft||{});var rI=a().check(Be(/^#[0-9A-Fa-f]{6}$/));var oI=d({filename:a(),data:L(),type:N("file"),mimetype:_(a())});var Uc=Le(si());var pI=d({...Te,name:a(),permissions:B(a()),platformId:ne(a()),type:a(),userCount:_(ve())});var ui=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ui||{}),Qr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Qr||{}),en=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(en||{});var tn=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(tn||{});var rn=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(rn||{});var Mc=d({mode:q(ui),value:L()}),Lc=d({auth:_(a()),fields:j(a(),Mc)}),jc=d({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:_(Lc)}),Fc=d({type:N("PIECE"),toolName:a().check(Se(1)),pieceMetadata:jc}),Bc=d({type:N("none")}),Vc=d({type:N("access_token"),accessToken:a()}),Zc=d({type:N("api_key"),apiKey:a(),apiKeyHeader:a()}),Hc=d({type:N("headers"),headers:j(a(),a())}),qc=at("type",[Bc,Vc,Zc,Hc]),ci=d({type:N("FLOW"),toolName:a().check(Se(1)),externalFlowId:a(),flowDisplayName:_(a())}),li=d({type:N("MCP"),toolName:a().check(Se(1)),serverUrl:qo(),protocol:q(en),auth:qc}),pi=d({type:N("KNOWLEDGE_BASE"),toolName:a().check(Se(1)),sourceType:q(Qr),sourceId:a(),sourceName:a()}),Wc=at("type",[Fc,ci,li,pi]),Gc=d({displayName:a(),description:_(a()),type:q(tn)}),di=d({type:N("MARKDOWN"),markdown:a()}),lt={type:N("TOOL_CALL"),input:ne(j(a(),L())),output:_(L()),toolName:a(),status:q(rn),toolCallId:a(),startTime:a(),endTime:_(a())},MI=d(lt),mi=at("toolCallType",[d({...lt,toolCallType:N("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),d({...lt,toolCallType:N("FLOW"),displayName:a(),externalFlowId:a()}),d({...lt,toolCallType:N("MCP"),displayName:a(),serverUrl:a()}),d({...lt,toolCallType:N("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),d({...lt,toolCallType:N("UNKNOWN"),displayName:a()})]),Kc=V([di,mi]);var nn=(r=>(r.IMAGE="image",r.TEXT="text",r))(nn||{}),Ue=d({apiKey:a()}),Jc=Ue,Xc=d({apiKey:a(),apiKeyHash:a()}),Yc=Ue,Qc=Ue,el=Ue,tl=Ue,rl=Ue,nl=Ue,ol=Ue,fi=d({accessKeyId:a().check(Se(1)),secretAccessKey:a().check(Se(1))}),il=d({}),al=d({}),sl=d({}),ul=d({}),cl=d({}),ll=d({}),gi=d({modelId:a(),modelName:a(),modelType:q(nn)}),yi=d({apiKeyHeader:a(),baseUrl:a(),models:B(gi),defaultHeaders:_(j(a(),a()))}),hi=d({accountId:a(),gatewayId:a(),models:B(gi),vertexProject:_(a()),vertexRegion:_(a())}),vi=d({resourceName:a(),apiVersion:Ze(Ve(e=>typeof e=="string"&&e.trim().length===0?void 0:e),_(a()))}),xi=d({region:a().check(Se(1))}),pl=V([Jc,el,tl,rl,nl,Qc,Yc,Xc,fi,ol]),_i=V([yi,hi,vi,xi,il,sl,ul,cl,al,ll]),dl=d({id:a(),name:a(),type:q(nn)}),ml=d({id:a(),name:a(),provider:q(Ft),config:_i,enabledForChat:ee()}),fl=d({provider:q(Ft),config:_i,auth:pl,platformId:a()});var BI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var gl=d({base64Url:a(),fileName:a(),extension:_(a())}),yl=d({mimeType:a(),url:a(),fileName:_(a())}),on=V([gl,yl]);var hl=V([d({type:N("file"),value:on}),d({type:N("markdown"),value:a(),files:_(B(on))})]),vl=d({sessionId:a(),message:a(),files:_(B(a()))});var bi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(bi||{}),Ii=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ii||{}),an=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(an||{});var xl=V([d({...Te,name:a(),externalId:a(),type:N("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:d({options:B(d({value:a()}))})}),d({...Te,name:a(),externalId:a(),type:V([N("TEXT"),N("NUMBER"),N("DATE")]),tableId:a(),projectId:a()})]),_l=d({...Te,name:a(),folderId:ne(a()),projectId:a(),externalId:a(),status:Yr(Ii),trigger:Yr(bi)}),Pl=d({...Te,tableId:a(),projectId:a(),cells:j(a(),d({updated:a(),created:a(),value:L(),fieldName:a()}))}),bl=d({events:B(q(an)),webhookUrl:a(),flowId:a()}),Il=d({fields:B(d({id:a(),name:a()})),rows:B(j(a(),a())),name:a()}),Tl=d({projectId:a(),limit:_(wt.number()),cursor:_(a()),name:_(a()),externalIds:lr(a()),folderId:_(a()),folderIds:lr(a())}),Sl=d({records:B(B(d({fieldId:a(),value:Si()}))),tableId:a()}),$l=d({cells:_(B(d({fieldId:a(),value:Si()}))),tableId:a(),agentUpdate:_(ee())}),Ti=at("operator",[Ye("eq"),Ye("neq"),Ye("gt"),Ye("gte"),Ye("lt"),Ye("lte"),Ye("co"),Pi("exists"),Pi("not_exists")]),El=d({tableId:a(),limit:_(wt.number()),cursor:_(a()),filters:lr(Ti)});function Si(){return Ze(Ve(e=>e==null?e:String(e)),zt(a()))}i(Si,"coerceToString");function Ye(e){return d({fieldId:a(),operator:N(e),value:a()})}i(Ye,"valueFilter");function Pi(e){return d({fieldId:a(),operator:N(e)})}i(Pi,"existenceFilter");var Al=d({status:_(ve()),body:_(L()),headers:_(j(a(),a()))}),zl=d({...Te,deleted:ne(He),ownerId:a(),displayName:a(),platformId:a(),externalId:ne(a())});var $i=d({name:a(),description:_(a()),type:a(),required:ee()}),wl=d({pieceName:a(),triggerName:a(),input:d({toolName:a(),toolDescription:a(),inputSchema:B($i),returnsResponse:ee()})});var Ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",sT=new RegExp(Ei),Ol="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",uT=a().check(Be(new RegExp(Ei))),cT=a().check(Be(new RegExp(Ol))),Rl=d({packageType:N("ARCHIVE"),pieceType:q(st),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Ai=d({packageType:N("REGISTRY"),pieceType:N("OFFICIAL"),pieceName:a(),pieceVersion:a()}),zi=d({packageType:N("REGISTRY"),pieceType:N("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),lT=V([Ai,zi]),pT=V([Rl,Ai,zi]),wi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(wi||{}),Nl=d({type:q(wi),cronExpression:a(),timezone:a()}),dT=d({...Te,type:q(Ce),projectId:a(),flowId:a(),triggerName:a(),schedule:ne(Nl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:ne(a()),simulate:ee()}),ki=(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))(ki||{}),Oi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Oi||{}),Ri=(r=>(r.S3="S3",r.DB="DB",r))(Ri||{}),mT=d({...Te,projectId:ne(a()),platformId:ne(a()),type:q(ki),compression:q(Oi),data:_(L()),location:q(Ri),size:ne(ve()),fileName:ne(a()),s3Key:ne(a()),metadata:ne(j(a(),a()))}),Ni=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ni||{}),Di=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Di||{}),fT=d({id:a(),email:a(),firstName:a(),status:q(Di),externalId:ne(a()),platformId:ne(a()),platformRole:q(Ni),lastName:a(),created:He,updated:He,lastActiveDate:ne(He),imageUrl:ne(a())});var un=d({...X.shape,...H(j(a(),L()),"OBJECT").shape});var Mi=d({...X.shape,...H(a(),"COLOR").shape});var cn=V([Pe,Oe,sr,Ne,be,Re,Gr,kt,Kr,De,Nt,un,Dt,Rt,Ot,Mi]),b={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var Ae=d({displayName:a(),description:_(a())});var Li=d({username:a(),password:a()}),ln=d({...Ae.shape,username:d({displayName:a(),description:_(a())}),password:d({displayName:a(),description:_(a())}),...H(Li,"BASIC_AUTH").shape});var Ml=j(a(),V([Pe,Oe,De,Ne,be])),pn=d({...Ae.shape,props:Ml,...H(L(),"CUSTOM_AUTH").shape});var Qe=d({...Ae.shape,...H(d({auth:a()}),"SECRET_TEXT").shape});var Ll=j(a(),V([Pe,Oe,Qe,De,Ne,be,Re,sr])),ji=d({...Ae.shape,props:Ll,...H(L(),"OIDC").shape});var dr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(dr||{}),Fi=V([Pe,Qe,be]),Bi=j(a(),Fi),jl=d({props:_(j(a(),Fi)),authUrl:a(),tokenUrl:a(),scope:B(a()),prompt:_(V([N("none"),N("consent"),N("login"),N("omit")])),pkce:_(ee()),pkceMethod:_(V([N("plain"),N("S256")])),authorizationMethod:_(q(dr)),grantType:_(V([q(Ut),N(Jr)])),extra:_(j(a(),a()))}),Vi=d({access_token:a(),props:_(Bi),data:j(a(),At())}),dn=d({...Ae.shape,...jl.shape,...H(Vi,"OAUTH2").shape});var pt=V([ln,pn,ji,dn,Qe]),Bt="Connection",mr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Bt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Bt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Bt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Bt}},None(){}};var qS={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 Fl=d({...X.shape,...H(L(),"CUSTOM").shape,code:a()});var Bl=V([cn,pt]),mn=j(a(),Bl),d$=j(a(),cn);var Zi=V([d({strategy:N("CRON"),cronExpression:a()}),d({strategy:N("NONE")})]),dt=class{constructor(t,r,n,o,u,s,l,f,g,v,P,y,c,p,h,m,x,I,D){this.name=t;this.displayName=r;this.description=n;this.requireAuth=o;this.props=u;this.type=s;this.handshakeConfiguration=l;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=v;this.onEnable=P;this.onDisable=y;this.onStart=c;this.run=p;this.test=h;this.sampleData=m;this.testStrategy=x;this.outputSchema=I;this.aiMetadata=D}static{i(this,"ITrigger")}},fr=i(e=>{switch(e.type){case"WEBHOOK":return new dt(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 dt(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 dt(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 dt(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,ge(e.sampleData)&&ge(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var Hi="2",gr="0.82.0";var fn=class{constructor(t,r,n,o,u,s,l,f,g=gr,v,P=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=o;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=v;this.description=P;this._actions={};this._triggers={};this.getContextInfo=i(()=>({version:Hi}),"getContextInfo");(!Vl(g)||Zl(g,gr))&&(this.minimumSupportedRelease=gr),u.forEach(y=>this._actions[y.name]=y),s.forEach(y=>this._triggers[y.name]=y)}static{i(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},qi=i(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,o)=>n===o.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new fn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function Vl(e){return/^\d+\.\d+\.\d+$/.test(e)}i(Vl,"isValidSimpleSemver");function Zl(e,t){let[r,n,o]=e.split(".").map(Number),[u,s,l]=t.split(".").map(Number);return r!==u?r<u:n!==s?n<s:o<l}i(Zl,"isSemverLessThan");var Hl=_(j(a(),j(a(),a()))),Wi=d({id:_(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:B(a()),platformId:_(a()),directoryPath:_(a()),auth:_(V([pt,B(pt)])),version:a(),categories:_(B(q(ut))),minimumSupportedRelease:_(a()),maximumSupportedRelease:_(a()),i18n:Hl}),ql=q(["human","ai","both"]),Gi=d({description:_(a()),idempotent:_(ee())}),Ki=d({name:a(),displayName:a(),description:a(),props:mn,requireAuth:ee(),errorHandlingOptions:_(Wr),outputSchema:_(ir()),audience:_(ql),aiMetadata:_(Gi)}),Ji=d({name:a(),displayName:a(),description:a(),props:mn,errorHandlingOptions:_(Wr),type:q(Ce),sampleData:L(),handshakeConfiguration:_(ir()),renewConfiguration:_(Zi),testStrategy:q(Lt),outputSchema:_(ir()),aiMetadata:_(Gi)}),Wl=d({...Wi.shape,actions:j(a(),Ki),triggers:j(a(),Ji)}),Gl=d({...Wi.shape,actions:ve(),triggers:ve(),suggestedActions:_(B(Ji)),suggestedTriggers:_(B(Ki))}),Xi=d({projectUsage:ve(),tags:_(B(a())),pieceType:q(st),packageType:q(Ct),platformId:_(a()),archiveId:_(a())}),dE=d({...Wl.shape,...Xi.shape}),mE=d({...Gl.shape,...Xi.shape}),fE=d({name:a(),version:a()});var Kl=Le(require("path")),Jl=Le(require("fs/promises"));var yr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{i(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,o=new URLSearchParams;return r.searchParams.forEach((u,s)=>{o.append(s,u)}),{urlWithoutQueryParams:n,queryParams:o}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var hr=class{static{i(this,"DelegatingAuthenticationConverter")}constructor(t=new gn,r=new yn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},gn=class{static{i(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},yn=class{static{i(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,o=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${o}`,r}};var vr=class extends Error{constructor(r,n){let o=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:o,body:u},request:{body:r}}));this.requestBody=r;this.status=o,this.responseBody=u}static{i(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var xr=class extends yr{static{i(this,"FetchHttpClient")}constructor(t="",r=new hr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:o}=this.getUrl(t),u=this.getHeaders(t),s=t.queryParams??{};for(let[D,Q]of Object.entries(s))o.append(D,Q);let l=o.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",v=t.followRedirects??!0,P=t.retries??0,{body:y,extraHeaders:c,isStream:p}=Xl(t.body,u),h=Ql({...u,...c}),m=await Yl(async()=>{let D=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>D.abort(),t.timeout):void 0;try{let oe={method:t.method.toString(),headers:h,body:y,redirect:v?"follow":"manual",signal:D.signal};return p&&(oe.duplex="half"),r?.dispatcher!==void 0&&(oe.dispatcher=r.dispatcher),await fetch(f,oe)}finally{Q!==void 0&&clearTimeout(Q)}},P),x=v?300:400;if(m.status<200||m.status>=x){let D=await Yi(m,g),Q=new vr(t.body,{status:m.status,responseBody:D});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let I=await Yi(m,g);return{status:m.status,headers:ep(m.headers),body:I}}};function Xl(e,t){return rp(e)?{body:void 0,extraHeaders:{},isStream:!1}:tp(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}i(Xl,"serializeBody");async function Yi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}i(Yi,"parseResponseBody");async function Yl(e,t){let r;for(let n=0;n<=t;n++)try{let o=await e();if(o.status>=500&&n<t){await Qi(n);continue}return o}catch(o){if(r=o,n<t){await Qi(n);continue}throw o}throw r}i(Yl,"sendWithRetries");function Qi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}i(Qi,"backoff");function Ql(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}i(Ql,"normalizeHeaders");function ep(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}i(ep,"toHttpHeaders");function tp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}i(tp,"isNodeFormData");function rp(e){return e==null}i(rp,"isNil");var mt=new xr;var et=(s=>(s.GET="GET",s.POST="POST",s.PATCH="PATCH",s.PUT="PUT",s.DELETE="DELETE",s.HEAD="HEAD",s))(et||{});var Vd=Le(require("fs")),iu=Le(ou());var Zd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Hd(e){let t=e.split(";")[0].trim().toLowerCase();return Zd[t]??""}i(Hd,"contentTypeToExtension");var qd=i(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Wd=i((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function au({auth:e,baseUrl:t,authMapping:r,description:n,displayName:o,name:u,props:s,extraProps:l,authLocation:f="headers"}){return se({audience:"human",name:u||"custom_api_call",displayName:o||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:i(async({auth:g})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Wd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...s?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(et).map(g=>({label:g,value:g}))},...s?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...s?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...s?.queryParams??{}}),body_type:b.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:i(async({body_type:g})=>{if(!g)return{};let v=g,P={};switch(v){case"none":break;case"json":P.data=b.Json({displayName:"JSON Body",required:!0,...s?.body??{}});break;case"raw":P.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":P.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return P},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...s?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...s?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:i(async g=>{let{method:v,url:P,headers:y,queryParams:c,body:p,body_type:h,failsafe:m,timeout:x,response_is_binary:I,followRedirects:D}=g.propsValue;cr(v,"Method"),cr(P,"URL");let Q=ge(r)?{}:await r(g.auth,g.propsValue),oe=P.url,ye=oe.startsWith("http://")||oe.startsWith("https://")?oe:qd({baseUrl:t(g.auth),relativePath:oe}),Y={method:v,url:ye,headers:{...y??{},...f==="headers"||!ge(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...c??{}},timeout:x?x*1e3:0,followRedirects:D};if(I&&(Y.responseType="arraybuffer"),p)if(h&&h!=="none"){let E=p.data;if(h==="form_data"){let we=E,re=new iu.default;for(let{fieldName:R,fieldType:S,textFieldValue:T,fileFieldValue:A}of we)S==="text"&&!jt(T)?re.append(R,T):S==="file"&&!jt(A)&&re.append(R,A.data,{filename:A?.filename});Y.body=re,Y.headers={...Y.headers,...re.getHeaders()}}else Y.body=E}else h||(Y.body=p);try{let E=await mt.sendRequest(Y);return await Gd(g.files,E.body,E.status,E.headers,I)}catch(E){if(m)return E.errorMessage();throw E}},"run")})}i(au,"createCustomApiCallAction");var Gd=i(async(e,t,r,n,o)=>{let u;if(o&&Kd(t)){let s=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Hd(s??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Kd=i(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ze={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:o,files:u,server:s}){switch(e.strategy){case 0:{let l=await t.get("lastPoll");if(ge(l))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:l,server:s}),g=f.reduce((v,P)=>Math.max(v,P.epochMilliSeconds),l);return await t.put("lastPoll",g),f.filter(v=>v.epochMilliSeconds>l).map(v=>v.data)}case 1:{let l=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:l,files:u,server:s}),g=f.findIndex(y=>y.id===l),v=[];ge(l)||g==-1?v=f??[]:v=f?.slice(0,g)??[],ge(o)||(v=v.slice(-o));let P=v?.[0]?.id;return ge(P)||await t.put("lastItem",P),v.map(y=>y.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:o}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let s=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:o}))?.[0]?.id;ge(s)?await t.delete("lastItem"):await t.put("lastItem",s);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:o,server:u}){let s=[];switch(e.strategy){case 0:{s=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{s=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:o,server:u});break}}return Jd(s.map(l=>l.data))}};function Jd(e){return e.length<=5?e:e.slice(0,5)}i(Jd,"getFirstFiveOrAll");var J=[mr.SecretText({displayName:"Private API Key",description:`Authenticate using your Klaviyo Private API Key.
|
|
4
|
+
|
|
5
|
+
**Steps:**
|
|
6
|
+
1. Log in to Klaviyo \u2192 go to **Settings \u2192 API Keys**
|
|
7
|
+
2. Click **Create Private API Key**
|
|
8
|
+
3. Give it a name and select the required scopes
|
|
9
|
+
4. Copy the key (starts with \`pk_\`) and paste it below`,required:!0,validate:i(async({auth:e})=>{try{return await mt.sendRequest({method:"GET",url:"https://a.klaviyo.com/api/accounts",headers:{Authorization:`Klaviyo-API-Key ${e}`,revision:"2025-04-15",accept:"application/vnd.api+json"}}),{valid:!0}}catch{return{valid:!1,error:"Invalid Private API Key. Check your key in Klaviyo \u2192 Settings \u2192 API Keys."}}},"validate")}),mr.OAuth2({description:`
|
|
10
|
+
To connect via OAuth2, follow the [Klaviyo OAuth setup guide](https://developers.klaviyo.com/en/docs/set_up_oauth) to register your app, then set the **Redirect URI** to {{redirectUrl}} and enable the following **scopes** in your app settings:
|
|
11
|
+
- profiles:read
|
|
12
|
+
- profiles:write
|
|
13
|
+
- lists:read
|
|
14
|
+
- lists:write
|
|
15
|
+
- tags:read
|
|
16
|
+
- segments:read
|
|
17
|
+
- events:read
|
|
18
|
+
- events:write
|
|
19
|
+
- subscriptions:read
|
|
20
|
+
- subscriptions:write
|
|
21
|
+
- accounts:read`,authUrl:"https://www.klaviyo.com/oauth/authorize",tokenUrl:"https://a.klaviyo.com/oauth/token",required:!0,scope:["profiles:read","profiles:write","lists:read","lists:write","tags:read","segments:read","events:read","events:write","subscriptions:read","subscriptions:write","accounts:read"],pkce:!0,pkceMethod:"S256",authorizationMethod:"HEADER"})];function zr(e){return e.type==="SECRET_TEXT"?`Klaviyo-API-Key ${e.secret_text}`:`Bearer ${e.access_token}`}i(zr,"getAuthorizationHeader");async function su(e,t){let n=new Map;for(let o=0;o<t.length;o+=100){let u=t.slice(o,o+100),s=new URLSearchParams;s.set("filter",`any(id,${JSON.stringify(u)})`),s.set("page[size]",String(100));let l=await G(e,"GET",`/profiles?${s.toString()}`);for(let f of l.data??[])n.set(f.id,f.attributes)}return n}i(su,"fetchProfilesByIds");function We(e){if(Array.isArray(e))return e.filter(Boolean);if(typeof e=="string"){let t=e.trim();if(t.startsWith("["))try{let r=JSON.parse(t);if(Array.isArray(r))return r.filter(Boolean)}catch{}return[t].filter(Boolean)}return[]}i(We,"normalizeProfileIds");var Xd="https://a.klaviyo.com/api";async function G(e,t,r,n){try{return(await mt.sendRequest({method:t,url:`${Xd}${r}`,headers:{Authorization:zr(e),accept:"application/vnd.api+json","content-type":"application/vnd.api+json",revision:"2025-04-15"},body:n})).body}catch(o){throw o.response?.status===401||o.response?.status===403?new Error("Authentication failed. Please check your API key or access token."):o.response?.status===429?new Error("Rate limit exceeded. Please wait and try again."):o.response?.status>=400&&o.response?.status<500?new Error(`Client error: ${o.response?.body?.message||JSON.stringify(o.response?.body)}`):o.response?.status>=500?new Error("Server error from Klaviyo API. Please try again later."):new Error(`Unexpected error: ${o.message||String(o)}`)}}i(G,"makeRequest");var uu=se({auth:J,name:"createProfile",displayName:"Create Profile",description:"Add new user profile with email/SMS subscription options",audience:"both",aiMetadata:{description:"Creates a new profile (contact) in Klaviyo with identity, location, and custom-property attributes. Use when adding a person who is not yet in Klaviyo; to modify someone who already exists use Update Profile. Requires at least one identifier (email, phone number, or external ID); not idempotent, so each call creates a profile.",idempotent:!1},props:{email:b.ShortText({displayName:"Email",description:"Email address (recommended identifier)",required:!1}),phone_number:b.ShortText({displayName:"Phone Number",description:"Phone number in E.164 format (e.g., +15005550006)",required:!1}),external_id:b.ShortText({displayName:"External ID",description:"Unique identifier from external system",required:!1}),first_name:b.ShortText({displayName:"First Name",required:!1}),last_name:b.ShortText({displayName:"Last Name",required:!1}),organization:b.ShortText({displayName:"Organization",description:"Company name",required:!1}),locale:b.ShortText({displayName:"Locale",description:"Language tag (e.g., en-US)",required:!1}),title:b.ShortText({displayName:"Job Title",required:!1}),image:b.ShortText({displayName:"Image URL",description:"Profile image URL",required:!1}),address1:b.ShortText({displayName:"Address 1",description:"Street address line 1",required:!1}),address2:b.ShortText({displayName:"Address 2",description:"Street address line 2",required:!1}),city:b.ShortText({displayName:"City",required:!1}),country:b.ShortText({displayName:"Country",required:!1}),region:b.ShortText({displayName:"Region/State",required:!1}),zip:b.ShortText({displayName:"Zip Code",required:!1}),timezone:b.ShortText({displayName:"Timezone",description:"IANA timezone (e.g., America/New_York)",required:!1}),ip:b.ShortText({displayName:"IP Address",required:!1}),latitude:b.Number({displayName:"Latitude",description:"Latitude coordinate (4 decimal places recommended)",required:!1}),longitude:b.Number({displayName:"Longitude",description:"Longitude coordinate (4 decimal places recommended)",required:!1}),custom_properties:b.Object({displayName:"Custom Properties",description:"Key-value pairs for segmentation and personalization",required:!1}),include_subscriptions:b.Checkbox({displayName:"Include Subscriptions",description:"Return subscription data in response",required:!1,defaultValue:!1}),include_predictive_analytics:b.Checkbox({displayName:"Include Predictive Analytics",description:"Return predictive analytics in response",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let{email:r,phone_number:n,external_id:o,first_name:u,last_name:s,organization:l,locale:f,title:g,image:v,address1:P,address2:y,city:c,country:p,region:h,zip:m,timezone:x,ip:I,latitude:D,longitude:Q,custom_properties:oe,include_subscriptions:ye,include_predictive_analytics:Y}=t;if(!r&&!n&&!o)throw new Error("At least one identifier is required: email, phone_number, or external_id");let E={};r&&(E.email=r),n&&(E.phone_number=n),o&&(E.external_id=o),u&&(E.first_name=u),s&&(E.last_name=s),l&&(E.organization=l),f&&(E.locale=f),g&&(E.title=g),v&&(E.image=v),(P||y||c||p||h||m||x||I||D||Q)&&(E.location={},P&&(E.location.address1=P),y&&(E.location.address2=y),c&&(E.location.city=c),p&&(E.location.country=p),h&&(E.location.region=h),m&&(E.location.zip=m),x&&(E.location.timezone=x),I&&(E.location.ip=I),D&&(E.location.latitude=D),Q&&(E.location.longitude=Q)),oe&&(E.properties=oe);let re={data:{type:"profile",attributes:E}},R=new URLSearchParams,S=[];ye&&S.push("subscriptions"),Y&&S.push("predictive_analytics"),S.length>0&&R.append("additional-fields[profile]",S.join(","));let T=`/profiles${R.toString()?"?"+R.toString():""}`;return await G(e,"POST",T,re)}});var cu=b.Dropdown({displayName:"Profile Id",required:!0,auth:J,refreshers:["auth"],options:i(async({auth:e})=>e?{disabled:!1,options:(await G(e,"GET","/profiles",{})).data.map(n=>{let o=n.attributes.first_name||"",u=n.attributes.last_name||"";return{label:[o,u].filter(Boolean).join(" ")||n.attributes.email||n.id,value:n.id}})}:{disabled:!0,placeholder:"Connect your account",options:[]},"options")}),lu=b.MultiSelectDropdown({displayName:"Profile Ids",description:"Select one or more Klaviyo profiles",required:!0,auth:J,refreshers:["auth"],options:i(async({auth:e})=>e?{options:(await G(e,"GET","/profiles")).data.map(n=>{let o=n.attributes.first_name||"",u=n.attributes.last_name||"",s=n.attributes.email||"";return{label:[o,u].filter(Boolean).join(" ")+(s?` (${s})`:"")||n.id,value:n.id}})}:{disabled:!0,placeholder:"Connect your account",options:[]},"options")}),xt=b.MultiSelectDropdown({displayName:"Profile Ids",description:"Select one or more Klaviyo profiles",required:!0,auth:J,refreshers:["auth","list_id"],options:i(async({auth:e,list_id:t})=>!e||!t?{disabled:!0,placeholder:"Connect your account",options:[]}:{options:(await G(e,"GET",`/lists/${t}/profiles`)).data.map(o=>{let u=o.attributes.first_name||"",s=o.attributes.last_name||"",l=o.attributes.email||"";return{label:[u,s].filter(Boolean).join(" ")+(l?` (${l})`:"")||o.id,value:o.id}})},"options")}),Ge=b.Dropdown({displayName:"List Id",required:!0,auth:J,refreshers:["auth"],options:i(async({auth:e})=>e?{disabled:!1,options:(await G(e,"GET","/lists",{})).data.map(n=>({label:n.attributes.name||n.id,value:n.id}))}:{disabled:!0,placeholder:"Connect your account",options:[]},"options")}),pu=b.ShortText({displayName:"Country Code",description:"Enter 2-letter ISO country code. Popular: US, GB, CA, DE, FR, AU, JP, CN, IN, BR",required:!1});var du=se({auth:J,name:"updateProfile",displayName:"Update Profile",description:"Update existing profile data and preferences.",audience:"both",aiMetadata:{description:"Updates an existing Klaviyo profile by its profile ID, overwriting only the supplied identity, location, and custom-property fields. Use when modifying a known profile; the profile ID is required, so resolve it first (e.g. via Find Profile by Email/Phone). Idempotent: re-running with the same input leaves the profile in the same state.",idempotent:!0},props:{profile_id:cu,email:b.ShortText({displayName:"Email",description:"Individual's email address",required:!1}),phone_number:b.ShortText({displayName:"Phone Number",description:"Phone number in E.164 format (e.g., +15005550006)",required:!1}),external_id:b.ShortText({displayName:"External ID",description:"Unique identifier from external system (e.g., POS system)",required:!1}),anonymous_id:b.ShortText({displayName:"Anonymous ID",description:"Anonymous identifier for the profile",required:!1}),first_name:b.ShortText({displayName:"First Name",description:"Individual's first name",required:!1}),last_name:b.ShortText({displayName:"Last Name",description:"Individual's last name",required:!1}),organization:b.ShortText({displayName:"Organization",description:"Company or organization name",required:!1}),locale:b.ShortText({displayName:"Locale",description:"Locale in IETF BCP 47 format (e.g., en-US)",required:!1}),title:b.ShortText({displayName:"Title",description:"Individual's job title",required:!1}),image:b.ShortText({displayName:"Image URL",description:"URL pointing to profile image location",required:!1}),address1:b.ShortText({displayName:"Address 1",description:"First line of street address",required:!1}),address2:b.ShortText({displayName:"Address 2",description:"Second line of street address",required:!1}),city:b.ShortText({displayName:"City",description:"City name",required:!1}),country:pu,region:b.ShortText({displayName:"Region",description:"Region within country (state/province)",required:!1}),zip:b.ShortText({displayName:"Zip Code",description:"Postal/zip code",required:!1}),timezone:b.ShortText({displayName:"Timezone",description:"IANA timezone (e.g., America/New_York)",required:!1}),ip:b.ShortText({displayName:"IP Address",description:"IP address of the profile",required:!1}),latitude:b.Number({displayName:"Latitude",description:"Latitude coordinate (4 decimal places recommended)",required:!1}),longitude:b.Number({displayName:"Longitude",description:"Longitude coordinate (4 decimal places recommended)",required:!1}),custom_properties:b.Object({displayName:"Custom Properties",description:"Key/value pairs for custom profile properties",required:!1}),include_subscriptions:b.Checkbox({displayName:"Include Subscriptions",description:"Include subscription data in response",required:!1,defaultValue:!1}),include_predictive_analytics:b.Checkbox({displayName:"Include Predictive Analytics",description:"Include predictive analytics data in response",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let{profile_id:r,email:n,phone_number:o,external_id:u,anonymous_id:s,first_name:l,last_name:f,organization:g,locale:v,title:P,image:y,address1:c,address2:p,city:h,country:m,region:x,zip:I,timezone:D,ip:Q,latitude:oe,longitude:ye,custom_properties:Y,include_subscriptions:E,include_predictive_analytics:we}=t,re={};if(n!==void 0&&(re.email=n),o!==void 0&&(re.phone_number=o),u!==void 0&&(re.external_id=u),s!==void 0&&(re.anonymous_id=s),l!==void 0&&(re.first_name=l),f!==void 0&&(re.last_name=f),g!==void 0&&(re.organization=g),v!==void 0&&(re.locale=v),P!==void 0&&(re.title=P),y!==void 0&&(re.image=y),c!==void 0||p!==void 0||h!==void 0||m!==void 0||x!==void 0||I!==void 0||D!==void 0||Q!==void 0||oe!==void 0||ye!==void 0){let O={};c!==void 0&&(O.address1=c),p!==void 0&&(O.address2=p),h!==void 0&&(O.city=h),m!==void 0&&(O.country=m),x!==void 0&&(O.region=x),I!==void 0&&(O.zip=I),D!==void 0&&(O.timezone=D),Q!==void 0&&(O.ip=Q),oe!==void 0&&(O.latitude=oe),ye!==void 0&&(O.longitude=ye),re.location=O}Y!==void 0&&(re.properties=Y);let S={data:{type:"profile",id:r,attributes:re}},T=[],A=[];E&&A.push("subscriptions"),we&&A.push("predictive_analytics"),A.length>0&&T.push(`additional-fields[profile]=${A.join(",")}`);let $=T.length>0?`?${T.join("&")}`:"";return await G(e,"PATCH",`/profiles/${r}${$}`,S)}});var mu=se({auth:J,name:"addProfileToList",displayName:"Add Profile to List",description:"Add profiles to a specific list without changing subscription status.",audience:"both",aiMetadata:{description:"Adds one or more existing profiles (by profile ID) to a Klaviyo list as members, without altering their email/SMS subscription consent. Use to manage list membership; for opt-in/consent changes use Subscribe Profile instead. Requires a list ID and at least one profile ID; idempotent, since re-adding an existing member is a no-op.",idempotent:!0},props:{list_id:Ge,profile_id:lu},async run({auth:e,propsValue:t}){let{list_id:r,profile_id:n}=t,o=We(n);if(!o||o.length===0)throw new Error("At least one profile is required");let u={data:o.map(l=>({type:"profile",id:l}))},s=await G(e,"POST",`/lists/${r}/relationships/profiles`,u);return!s||Object.keys(s).length===0?{success:!0,message:`Successfully added ${o.length} profile(s) to list`,profiles_added:o.length}:s}});var jn=Le(Ln());var wr={strategy:0,items:i(async({auth:e,lastFetchEpochMS:t})=>{let r=t?new Date(t).toISOString():(0,jn.default)().subtract(24,"hours").toISOString(),n=[],o=new URLSearchParams;o.append("filter",`greater-than(created,${r})`),o.append("page[size]","100"),o.append("sort","created");let u=await G(e,"GET",`/profiles?${o.toString()}`);for(n.push(...u.data||[]);u.links?.next&&n.length<500;){let s=u.links.next.match(/page%5Bcursor%5D=([^&]+)/);if(!s)break;let l=decodeURIComponent(s[1]),f=new URLSearchParams;f.append("filter",`greater-than(created,${r})`),f.append("page[size]","100"),f.append("page[cursor]",l),f.append("sort","created"),u=await G(e,"GET",`/profiles?${f.toString()}`),n.push(...u.data||[])}return n.map(s=>{let l=s.attributes.location??{};return{epochMilliSeconds:(0,jn.default)(s.attributes.created).valueOf(),data:{id:s.id,email:s.attributes.email??null,phone_number:s.attributes.phone_number??null,external_id:s.attributes.external_id??null,first_name:s.attributes.first_name??null,last_name:s.attributes.last_name??null,full_name:[s.attributes.first_name,s.attributes.last_name].filter(Boolean).join(" ")||null,organization:s.attributes.organization??null,locale:s.attributes.locale??null,title:s.attributes.title??null,image:s.attributes.image??null,created:s.attributes.created,updated:s.attributes.updated,last_event_date:s.attributes.last_event_date??null,address1:l.address1??null,address2:l.address2??null,city:l.city??null,country:l.country??null,region:l.region??null,zip:l.zip??null,timezone:l.timezone??null,ip:l.ip??null,latitude:l.latitude??null,longitude:l.longitude??null}}})},"items")},fu=fr({auth:J,name:"newProfile",displayName:"New Profile",description:"Triggers when a new profile is created in Klaviyo.",aiMetadata:{description:"Fires when a new profile (contact) is created in the Klaviyo account, polling for profiles by their created timestamp. Each event represents one newly added profile across the whole account, regardless of list or segment membership."},props:{},sampleData:{id:"01JZTTZ2NNC8ZCP45SM4J84RG2",email:"sarah.mason@klaviyo-demo.com",phone_number:"+15005550006",external_id:null,first_name:"Sarah",last_name:"Mason",full_name:"Sarah Mason",organization:null,locale:null,title:"Regional Manager",image:null,created:"2025-07-10T18:53:32+00:00",updated:"2025-07-10T18:53:32+00:00",last_event_date:null,address1:null,address2:null,city:null,country:null,region:null,zip:null,timezone:null,ip:null,latitude:null,longitude:null},type:"POLLING",async test(e){return await ze.test(wr,{store:e.store,auth:e.auth,propsValue:e.propsValue,files:e.files})},async onEnable(e){await ze.onEnable(wr,{store:e.store,auth:e.auth,propsValue:e.propsValue})},async onDisable(e){await ze.onDisable(wr,{store:e.store,auth:e.auth,propsValue:e.propsValue})},async run(e){return await ze.poll(wr,{store:e.store,auth:e.auth,propsValue:e.propsValue,files:e.files})}});var gu=se({auth:J,name:"createList",displayName:"Create List",description:"Create a new subscriber list.",audience:"both",aiMetadata:{description:"Creates a new, empty subscriber list in Klaviyo with the given name. Use when you need a fresh list to group profiles into; to find an existing list use Find List by Name. Requires a non-empty name; not idempotent, so each call creates another list even if the name matches an existing one.",idempotent:!1},props:{name:b.ShortText({displayName:"List Name",description:"Name for the new list",required:!0})},async run({auth:e,propsValue:t}){let{name:r}=t;if(!r||r.trim().length===0)throw new Error("List name cannot be empty");let n={data:{type:"list",attributes:{name:r.trim()}}},o=await G(e,"POST","/lists",n);return{success:!0,message:`List "${r}" created successfully`,list:o.data}}});var yu=se({auth:J,name:"findListByName",displayName:"Find List by Name",description:"Find lists by name with optional additional data",audience:"both",aiMetadata:{description:"Looks up Klaviyo lists by an exact name match and returns the matching lists with their IDs. Use to resolve a list name into a list ID before actions that require one (add/remove/subscribe). Requires a list name; matching is exact, not partial. Read-only and idempotent.",idempotent:!0},props:{search_query:b.LongText({displayName:"List Name(s)",description:"Enter list name",required:!0}),include_additional_data:b.Checkbox({displayName:"Include Additional Data",description:"Include related flow and tag information",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let{search_query:r,include_additional_data:n}=t;if(!r||r.trim().length===0)throw new Error("List name is required");let o=r.trim(),u="";u=`equals(name,"${o}")`;let s=new URLSearchParams;s.append("filter",u),s.append("page[size]","10"),s.append("sort","name"),n&&s.append("include","tags");let l=await G(e,"GET",`/lists?${s.toString()}`),f=l.data||[];if(f.length===0)return{success:!1,message:`No lists found with ${o}`,lists:[],count:0};let g=f.map(v=>({id:v.id,name:v.attributes.name,created:v.attributes.created,updated:v.attributes.updated,opt_in_process:v.attributes.opt_in_process}));return{success:!0,message:`Found ${f.length} list(s) matching your search`,lists:g,rawresponse:l}}});var hu=se({auth:J,name:"findProfileByEmailPhone",displayName:"Find Profile by Email/Phone",description:"Find a profile using email or phone number.",audience:"both",aiMetadata:{description:'Looks up a Klaviyo profile by exact email address or phone number and returns matching profiles with their IDs. The search value is auto-detected as an email (must contain "@" and be valid) or a phone number (E.164 recommended). Use to resolve a contact into a profile ID before update/subscribe/list actions. Read-only and idempotent.',idempotent:!0},props:{search_query:b.ShortText({displayName:"Email or Phone Number",description:"Enter an email address or phone number (E.164 format recommended)",required:!0}),include_additional_data:b.Checkbox({displayName:"Include Additional Data",description:"Include subscriptions and predictive analytics data",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let{search_query:r,include_additional_data:n}=t;if(!r||r.trim().length===0)throw new Error("Email or phone number is required");let o=r.trim(),u="",s=o.includes("@");if(s){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o))throw new Error("Please enter a valid email address");u=`equals(email,"${o}")`}else{if(!/^[\+]?[1-9][\d\s\-\(\)\.]{7,15}$/.test(o))throw new Error("Please enter a valid phone number (E.164 format recommended, e.g., +1234567890)");u=`equals(phone_number,"${o}")`}let l=new URLSearchParams;l.append("filter",u),l.append("page[size]","50"),n&&l.append("additional-fields[profile]","subscriptions,predictive_analytics");let f=await G(e,"GET",`/profiles?${l.toString()}`),g=f.data||[];if(g.length===0)return{success:!1,message:`No profile found with ${s?"email":"phone number"}: ${o}`,profiles:[],count:0};let v=g.map(P=>({id:P.id,email:P.attributes.email,phone_number:P.attributes.phone_number,first_name:P.attributes.first_name,last_name:P.attributes.last_name,external_id:P.attributes.external_id,full_name:[P.attributes.first_name,P.attributes.last_name].filter(Boolean).join(" ")||null,created:P.attributes.created,updated:P.attributes.updated,full_profile:P.attributes}));return{success:!0,message:`Found ${g.length} profile(s) matching ${s?"email":"phone number"}: ${o}`,profiles:v,count:g.length,raw_response:f}}});var vu=se({auth:J,name:"findTagByName",displayName:"Find Tag by Name",description:"Find tags whose name contains the search query.",audience:"both",aiMetadata:{description:"Searches Klaviyo tags by a partial (contains) name match and returns matching tags with their IDs. Use to discover tag IDs by keyword. Requires a search value; matching is substring-based, not exact. Read-only and idempotent.",idempotent:!0},props:{search_query:b.ShortText({displayName:"Tag Name",description:"Search for tags whose name contains this value.",required:!0})},async run({auth:e,propsValue:t}){let{search_query:r}=t;if(!r||r.trim().length===0)throw new Error("Tag name is required");let n=r.trim(),o=`contains(name,"${n.replace(/"/g,'\\"')}")`,u=new URLSearchParams;u.append("filter",o),u.append("page[size]","50"),u.append("sort","name");let l=(await G(e,"GET",`/tags?${u.toString()}`)).data||[];if(l.length===0)return{success:!1,message:`No tags found containing "${n}"`,tags:[],count:0};let f=l.map(g=>({id:g.id,name:g.attributes.name??""}));return{success:!0,message:`Found ${l.length} tag(s) containing "${n}"`,tags:f,count:l.length,search_query:n}}});var xu=se({auth:J,name:"removeProfileFromList",displayName:"Remove Profile from List",description:"Remove profiles from a specific list.",audience:"both",aiMetadata:{description:"Removes one or more profiles (by profile ID) from a Klaviyo list, ending their membership without changing subscription consent. Use to take profiles off a list; requires a list ID and at least one profile ID (max 1000 per call). Idempotent, since removing a profile that is not a member is a no-op.",idempotent:!0},props:{list_id:Ge,profile_ids:xt},async run({propsValue:e,auth:t}){let{list_id:r,profile_ids:n}=e,o=We(n);if(!o||o.length===0)throw new Error("At least one profile must be selected");if(o.length>1e3)throw new Error("Maximum of 1000 profiles can be removed at once");let u={data:o.map(l=>({type:"profile",id:l}))},s=await G(t,"DELETE",`/lists/${r}/relationships/profiles`,u);return s||{success:!0,message:`Successfully removed ${o.length} profile(s) from the list`,profiles_removed:o.length}}});var _u=se({auth:J,name:"subscribeProfile",displayName:"Subscribe Profile",description:"Subscribe profiles to email or SMS marketing on a list.",audience:"both",aiMetadata:{description:"Opts profiles in to email and/or SMS marketing consent via a bulk subscription job, optionally scoped to a list. At least one channel must be selected; enabling historical import bypasses double opt-in and requires a consent date. Use this for consent changes rather than Add Profile to List (which only sets membership). Not idempotent: each call queues a new subscription job (max 1000 profiles).",idempotent:!1},props:{list_id:Ge,profile_ids:xt,subscribe_email:b.Checkbox({displayName:"Subscribe to Email",description:"Subscribe selected profiles to email marketing.",required:!1,defaultValue:!0}),subscribe_sms:b.Checkbox({displayName:"Subscribe to SMS",description:"Subscribe selected profiles to SMS marketing.",required:!1,defaultValue:!1}),historical_import:b.Checkbox({displayName:"Historical Import",description:"Bypass double opt-in and mark as a historical import.",required:!1,defaultValue:!1}),consented_at:b.ShortText({displayName:"Consent Date",description:"ISO 8601 datetime when consent was given (required for historical import, e.g. 2024-01-15T10:00:00Z).",required:!1}),custom_source:b.ShortText({displayName:"Custom Source",description:'Label for the subscription source (e.g. "Website Form").',required:!1})},async run({auth:e,propsValue:t}){let{list_id:r,profile_ids:n,subscribe_email:o,subscribe_sms:u,historical_import:s,consented_at:l,custom_source:f}=t,g=We(n);if(!g||g.length===0)throw new Error("At least one profile must be selected.");if(g.length>1e3)throw new Error("Maximum of 1000 profiles can be subscribed at once.");if(!o&&!u)throw new Error("At least one subscription channel must be selected (Email or SMS).");if(s&&!l)throw new Error("Consent Date is required when Historical Import is enabled.");let v=await su(e,g),P=g.map(p=>{let h=v.get(p)??{},m={};o&&(m.email={marketing:{consent:"SUBSCRIBED"}},s&&l&&(m.email.marketing.consented_at=l)),u&&(m.sms={marketing:{consent:"SUBSCRIBED"}},s&&l&&(m.sms.marketing.consented_at=l));let x={subscriptions:m};return o&&h.email&&(x.email=h.email),u&&h.phone_number&&(x.phone_number=h.phone_number),{type:"profile",id:p,attributes:x}}),y={data:{type:"profile-subscription-bulk-create-job",attributes:{profiles:{data:P}}}};return r&&(y.data.relationships={list:{data:{type:"list",id:r}}}),f&&(y.data.attributes.custom_source=f),s&&(y.data.attributes.historical_import=!0),{success:!0,job_id:(await G(e,"POST","/profile-subscription-bulk-create-jobs",y))?.data?.id,profiles_count:P.length,list_id:r||null,subscribed_email:o??!1,subscribed_sms:u??!1,historical_import:s??!1}}});var Pu=se({auth:J,name:"unsubscribeProfile",displayName:"Unsubscribe Profile",description:"Unsubscribe profiles from email or SMS marketing on a list.",audience:"both",aiMetadata:{description:"Opts profiles out of email, SMS, and/or SMS transactional consent via a bulk unsubscribe job, optionally scoped to a list. At least one channel must be selected. Use to revoke marketing consent; not idempotent, since each call queues a new unsubscribe job (max 100 profiles).",idempotent:!1},props:{list_id:Ge,profile_ids:xt,unsubscribe_email:b.Checkbox({displayName:"Unsubscribe from Email",description:"Unsubscribe selected profiles from email marketing.",required:!1,defaultValue:!0}),unsubscribe_sms:b.Checkbox({displayName:"Unsubscribe from SMS",description:"Unsubscribe selected profiles from SMS marketing.",required:!1,defaultValue:!1}),unsubscribe_sms_transactional:b.Checkbox({displayName:"Unsubscribe from SMS Transactional",description:"Unsubscribe selected profiles from SMS transactional messages.",required:!1,defaultValue:!1})},async run({auth:e,propsValue:t}){let{list_id:r,profile_ids:n,unsubscribe_email:o,unsubscribe_sms:u,unsubscribe_sms_transactional:s}=t,l=We(n);if(!l||l.length===0)throw new Error("At least one profile must be selected.");if(l.length>100)throw new Error("Maximum of 100 profiles can be unsubscribed at once.");if(!o&&!u&&!s)throw new Error("At least one unsubscribe channel must be selected.");let f=await Promise.all(l.map(y=>G(e,"GET",`/profiles/${y}`,{}))),g=l.map((y,c)=>{let p=f[c]?.data?.attributes??{},h={};o&&(h.email={marketing:{consent:"UNSUBSCRIBED"}}),u&&(h.sms=h.sms||{},h.sms.marketing={consent:"UNSUBSCRIBED"}),s&&(h.sms=h.sms||{},h.sms.transactional={consent:"UNSUBSCRIBED"});let m={subscriptions:h};return o&&p.email&&(m.email=p.email),(u||s)&&p.phone_number&&(m.phone_number=p.phone_number),{type:"profile",id:y,attributes:m}}),v={data:{type:"profile-subscription-bulk-delete-job",attributes:{profiles:{data:g}}}};return r&&(v.data.relationships={list:{data:{type:"list",id:r}}}),{success:!0,job_id:(await G(e,"POST","/profile-subscription-bulk-delete-jobs",v))?.data?.id,profiles_count:g.length,list_id:r||null,unsubscribed_email:o??!1,unsubscribed_sms:u??!1,unsubscribed_sms_transactional:s??!1}}});var Fn=Le(Ln());var Qd={targetType:b.StaticDropdown({displayName:"Target Type",description:"Monitor a list or segment for new profile additions.",required:!0,options:{options:[{label:"List",value:"list"},{label:"Segment",value:"segment"}]}}),listId:b.Dropdown({displayName:"List",description:"Select the list to monitor for new profile additions.",required:!1,auth:J,refreshers:["auth","targetType"],options:i(async({auth:e,targetType:t})=>{if(t!=="list")return{disabled:!0,options:[]};if(!e)return{disabled:!0,placeholder:"Connect your account",options:[]};try{return{disabled:!1,options:((await G(e,"GET","/lists",{})).data||[]).map(n=>({label:n.attributes.name||n.id,value:n.id}))}}catch{return{disabled:!0,placeholder:"Error loading lists",options:[]}}},"options")}),segmentId:b.Dropdown({displayName:"Segment",description:"Select the segment to monitor for new profile additions.",required:!1,auth:J,refreshers:["auth","targetType"],options:i(async({auth:e,targetType:t})=>{if(t!=="segment")return{disabled:!0,options:[]};if(!e)return{disabled:!0,placeholder:"Connect your account",options:[]};try{return{disabled:!1,options:((await G(e,"GET","/segments",{})).data||[]).map(n=>({label:n.attributes.name||n.id,value:n.id}))}}catch{return{disabled:!0,placeholder:"Error loading segments",options:[]}}},"options")})},kr={strategy:0,items:i(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{targetType:n,listId:o,segmentId:u}=t;if(n==="list"&&!o)throw new Error("Please select a list to monitor.");if(n==="segment"&&!u)throw new Error("Please select a segment to monitor.");let s=n==="list"?o:u,l=n==="list"?`/lists/${s}/profiles`:`/segments/${s}/profiles`,f=r?new Date(r).toISOString():(0,Fn.default)().subtract(24,"hours").toISOString(),g=new URLSearchParams;g.append("filter",`greater-than(joined_group_at,${f})`),g.append("page[size]","100"),g.append("sort","joined_group_at");let v=[],P=await G(e,"GET",`${l}?${g.toString()}`);for(v.push(...P.data||[]);P.links?.next&&v.length<1e3;){let y=P.links.next.match(/page%5Bcursor%5D=([^&]+)/);if(!y)break;let c=decodeURIComponent(y[1]),p=new URLSearchParams;p.append("filter",`greater-than(joined_group_at,${f})`),p.append("page[size]","100"),p.append("page[cursor]",c),p.append("sort","joined_group_at"),P=await G(e,"GET",`${l}?${p.toString()}`),v.push(...P.data||[])}return v.map(y=>{let c=y.attributes.location??{};return{epochMilliSeconds:(0,Fn.default)(y.attributes.joined_group_at??y.attributes.created).valueOf(),data:{id:y.id,email:y.attributes.email??null,phone_number:y.attributes.phone_number??null,external_id:y.attributes.external_id??null,first_name:y.attributes.first_name??null,last_name:y.attributes.last_name??null,full_name:[y.attributes.first_name,y.attributes.last_name].filter(Boolean).join(" ")||null,organization:y.attributes.organization??null,locale:y.attributes.locale??null,title:y.attributes.title??null,image:y.attributes.image??null,created:y.attributes.created,updated:y.attributes.updated,joined_group_at:y.attributes.joined_group_at??null,last_event_date:y.attributes.last_event_date??null,address1:c.address1??null,address2:c.address2??null,city:c.city??null,country:c.country??null,region:c.region??null,zip:c.zip??null,timezone:c.timezone??null,ip:c.ip??null,latitude:c.latitude??null,longitude:c.longitude??null,target_type:n,target_id:s}}})},"items")},bu=fr({auth:J,name:"profile_added_to_list_or_segment",displayName:"Profile Added to List/Segment",description:"Triggers when a profile is added to a specific list or segment.",aiMetadata:{description:"Fires when a profile joins a chosen Klaviyo list or segment, polling by the profile join timestamp. The monitored target is configurable as either a specific list or a specific segment, so each event represents one profile newly added to that particular group."},props:Qd,sampleData:{id:"01JZTTZ2NNC8ZCP45SM4J84RG2",email:"sarah.mason@klaviyo-demo.com",phone_number:"+15005550006",external_id:null,first_name:"Sarah",last_name:"Mason",full_name:"Sarah Mason",organization:null,locale:null,title:"Regional Manager",image:null,created:"2025-07-10T18:53:32+00:00",updated:"2025-07-10T18:53:32+00:00",joined_group_at:"2025-07-16T10:00:00+00:00",last_event_date:null,address1:null,address2:null,city:null,country:null,region:null,zip:null,timezone:null,ip:null,latitude:null,longitude:null,target_type:"list",target_id:"RB89mt"},type:"POLLING",async test(e){return await ze.test(kr,{store:e.store,auth:e.auth,propsValue:e.propsValue,files:e.files})},async onEnable(e){await ze.onEnable(kr,{store:e.store,auth:e.auth,propsValue:e.propsValue})},async onDisable(e){await ze.onDisable(kr,{store:e.store,auth:e.auth,propsValue:e.propsValue})},async run(e){return await ze.poll(kr,{store:e.store,auth:e.auth,propsValue:e.propsValue,files:e.files})}});var em=qi({displayName:"Klaviyo",auth:J,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/klaviyo.png",categories:["MARKETING"],authors:["Sanket6652"],actions:[uu,du,mu,gu,yu,hu,vu,xu,_u,Pu,au({baseUrl:i(()=>"https://a.klaviyo.com/api","baseUrl"),auth:J,authMapping:i(async e=>({Authorization:zr(e),revision:"2025-04-15",accept:"application/vnd.api+json"}),"authMapping")})],triggers:[fu,bu]});0&&(module.exports={klaviyo});
|
|
22
|
+
/*! Bundled license information:
|
|
23
|
+
|
|
24
|
+
mime-types/index.js:
|
|
25
|
+
(*!
|
|
26
|
+
* mime-types
|
|
27
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
28
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
29
|
+
* MIT Licensed
|
|
30
|
+
*)
|
|
31
|
+
*/
|
package/src/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export declare const klaviyo: import("@activepieces/pieces-framework").Piece<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,OAAO,uOA6BlB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,+DAAwE;AACxE,iDAAqD;AAErD,4CAI2B;AAC3B,iEAA6D;AAC7D,iEAA6D;AAE7D,2EAAqE;AACrE,4DAA+D;AAC/D,2DAAuD;AACvD,uEAAiE;AACjE,2FAAoF;AACpF,qEAA+D;AAC/D,qFAA+E;AAC/E,uEAAmE;AACnE,2EAAuE;AACvE,gGAAkG;AAErF,QAAA,OAAO,GAAG,IAAA,8BAAW,EAAC;IACjC,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,kBAAW;IACjB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,UAAU,EAAE,CAAC,sBAAa,CAAC,SAAS,CAAC;IACrC,OAAO,EAAE,CAAC,YAAY,CAAC;IACvB,OAAO,EAAE;QACP,8BAAa;QACb,8BAAa;QACb,sCAAgB;QAChB,wBAAU;QACV,kCAAc;QACd,qDAAuB;QACvB,gCAAa;QACb,gDAAqB;QACrB,oCAAgB;QAChB,wCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,2BAA2B;YAC1C,IAAI,EAAE,kBAAW;YACjB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,IAAA,6BAAsB,EAAC,IAAwB,CAAC;oBAC/D,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,0BAA0B;iBACnC,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,+BAAiB,EAAE,kEAAkC,CAAC;CAClE,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export declare const addProfileToList: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
list_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
3
|
-
profile_id: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true, (import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[]>;
|
|
4
|
-
}>;
|
|
5
|
-
//# sourceMappingURL=add-profile-to-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-profile-to-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-profile-to-list.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,gBAAgB;;;EA+C3B,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addProfileToList = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const props_1 = require("../common/props");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const client_1 = require("../common/client");
|
|
9
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
10
|
-
exports.addProfileToList = (0, pieces_framework_1.createAction)({
|
|
11
|
-
auth: auth_1.klaviyoAuth,
|
|
12
|
-
name: 'addProfileToList',
|
|
13
|
-
displayName: 'Add Profile to List',
|
|
14
|
-
description: 'Add profiles to a specific list without changing subscription status.',
|
|
15
|
-
audience: 'both',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Adds one or more existing profiles (by profile ID) to a Klaviyo list as members, without altering their email/SMS subscription consent. Use to manage list membership; for opt-in/consent changes use Subscribe Profile instead. Requires a list ID and at least one profile ID; idempotent, since re-adding an existing member is a no-op.',
|
|
18
|
-
idempotent: true,
|
|
19
|
-
},
|
|
20
|
-
props: {
|
|
21
|
-
list_id: props_1.listIdDropdown,
|
|
22
|
-
profile_id: props_1.allProfileIdsMultiSelectDropdown,
|
|
23
|
-
},
|
|
24
|
-
run(_a) {
|
|
25
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
|
|
26
|
-
const { list_id, profile_id: rawProfileId } = propsValue;
|
|
27
|
-
const profile_id = (0, client_1.normalizeProfileIds)(rawProfileId);
|
|
28
|
-
if (!profile_id || profile_id.length === 0) {
|
|
29
|
-
throw new Error('At least one profile is required');
|
|
30
|
-
}
|
|
31
|
-
const body = {
|
|
32
|
-
data: profile_id.map((id) => ({
|
|
33
|
-
type: 'profile',
|
|
34
|
-
id,
|
|
35
|
-
})),
|
|
36
|
-
};
|
|
37
|
-
const response = yield (0, client_1.makeRequest)(auth, pieces_common_1.HttpMethod.POST, `/lists/${list_id}/relationships/profiles`, body);
|
|
38
|
-
if (!response || Object.keys(response).length === 0) {
|
|
39
|
-
return {
|
|
40
|
-
success: true,
|
|
41
|
-
message: `Successfully added ${profile_id.length} profile(s) to list`,
|
|
42
|
-
profiles_added: profile_id.length,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
return response;
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=add-profile-to-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-profile-to-list.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-profile-to-list.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,2CAAmF;AACnF,yCAA+D;AAC/D,6CAAoE;AACpE,+DAAyD;AAE5C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,kBAAW;IACjB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,qBAAqB;IAClC,WAAW,EACT,uEAAuE;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,6UAA6U;QAC1V,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,sBAAc;QACvB,UAAU,EAAE,wCAAgC;KAC7C;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC;YACzD,MAAM,UAAU,GAAG,IAAA,4BAAmB,EAAC,YAAY,CAAC,CAAC;YAErD,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACtD,CAAC;YAED,MAAM,IAAI,GAAG;gBACX,IAAI,EAAG,UAAuB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;oBAC1C,IAAI,EAAE,SAAS;oBACf,EAAE;iBACH,CAAC,CAAC;aACJ,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,IAAA,oBAAW,EAChC,IAAwB,EACxB,0BAAU,CAAC,IAAI,EACf,UAAU,OAAO,yBAAyB,EAC1C,IAAI,CACL,CAAC;YAEF,IAAI,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACpD,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,OAAO,EAAE,sBAAsB,UAAU,CAAC,MAAM,qBAAqB;oBACrE,cAAc,EAAE,UAAU,CAAC,MAAM;iBAClC,CAAC;YACJ,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const createList: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").SecretTextProperty<true> | import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>)[], {
|
|
2
|
-
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=create-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-list.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU;;EA8CrB,CAAC"}
|