@activepieces/piece-alai 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -12
- package/src/index.js +20 -43
- package/src/index.d.ts +0 -4
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/add-slide.d.ts +0 -13
- package/src/lib/actions/add-slide.d.ts.map +0 -1
- package/src/lib/actions/add-slide.js +0 -82
- package/src/lib/actions/add-slide.js.map +0 -1
- package/src/lib/actions/delete-presentation.d.ts +0 -6
- package/src/lib/actions/delete-presentation.d.ts.map +0 -1
- package/src/lib/actions/delete-presentation.js +0 -39
- package/src/lib/actions/delete-presentation.js.map +0 -1
- package/src/lib/actions/export-presentation.d.ts +0 -9
- package/src/lib/actions/export-presentation.d.ts.map +0 -1
- package/src/lib/actions/export-presentation.js +0 -99
- package/src/lib/actions/export-presentation.js.map +0 -1
- package/src/lib/actions/generate-presentation.d.ts +0 -18
- package/src/lib/actions/generate-presentation.d.ts.map +0 -1
- package/src/lib/actions/generate-presentation.js +0 -221
- package/src/lib/actions/generate-presentation.js.map +0 -1
- package/src/lib/actions/get-generation.d.ts +0 -6
- package/src/lib/actions/get-generation.d.ts.map +0 -1
- package/src/lib/actions/get-generation.js +0 -40
- package/src/lib/actions/get-generation.js.map +0 -1
- package/src/lib/common/auth.d.ts +0 -4
- package/src/lib/common/auth.d.ts.map +0 -1
- package/src/lib/common/auth.js +0 -49
- package/src/lib/common/auth.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -4
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -36
- package/src/lib/common/props.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-alai",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"build": "tsc -p tsconfig.lib.json && cp package.json dist/",
|
|
15
|
-
"lint": "eslint 'src/**/*.ts'"
|
|
16
|
-
}
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"files": [
|
|
8
|
+
"src/index.js",
|
|
9
|
+
"package.json",
|
|
10
|
+
"src/i18n"
|
|
11
|
+
]
|
|
17
12
|
}
|
package/src/index.js
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const export_presentation_1 = require("./lib/actions/export-presentation");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
categories: [
|
|
22
|
-
shared_1.PieceCategory.CONTENT_AND_FILES,
|
|
23
|
-
shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE,
|
|
24
|
-
],
|
|
25
|
-
actions: [
|
|
26
|
-
generate_presentation_1.generatePresentation,
|
|
27
|
-
get_generation_1.getGeneration,
|
|
28
|
-
export_presentation_1.exportPresentation,
|
|
29
|
-
add_slide_1.addSlide,
|
|
30
|
-
delete_presentation_1.deletePresentation,
|
|
31
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
32
|
-
auth: auth_1.alaiAuth,
|
|
33
|
-
baseUrl: () => 'https://slides-api.getalai.com/api/v1',
|
|
34
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
35
|
-
return {
|
|
36
|
-
Authorization: `Bearer ${auth.props.apiKey}`,
|
|
37
|
-
};
|
|
38
|
-
}),
|
|
39
|
-
}),
|
|
40
|
-
],
|
|
41
|
-
triggers: [],
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var Ys=Object.create;var Xe=Object.defineProperty;var Qs=Object.getOwnPropertyDescriptor;var eu=Object.getOwnPropertyNames;var tu=Object.getPrototypeOf,ru=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},dn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of eu(t))!ru.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=Qs(t,i))||n.enumerable});return e};var Me=(e,t,r)=>(r=e!=null?Ys(tu(e)):{},mn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),nu=e=>mn(Xe({},"__esModule",{value:!0}),e);var Uo=E((Co,Bt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],_,M;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>d)return null;for(M=d-f,_=":";M--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Y=s.split(":"),re=[];for(let ke=0;ke<Y.length;ke++)re.push(parseInt(Y[ke],16));return re})(),{parts:d,zoneId:v}}o(g,"expandIPv6");function h(s,d,f,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=f-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=f,v+=1}return!0}o(h,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let P={};P.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<d.length;f++)if(m=d[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,M;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(M=m[_],f&&M!==0)return null;M!==8&&(f=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return P.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),P.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(f[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.isIPv4=function(s){return this.parser(s)!==null},P.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},P.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv4.isValidFourPartDecimal=function(s){return!!(P.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},P.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!P.IPv4.isValidCIDR(s)||!d?!1:P.IPv4.isValidFourPartDecimal(d[1])},P.IPv4.networkAddressFromCIDR=function(s){let d,f,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(_[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},P.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},P.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(d[2]);if(f>=0&&f<=32){let m=[this.parse(d[1]),f];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},P.IPv4.parser=function(s){let d,f,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let M=0;M<v.length;M++)f=v[M],_.push(x(f));return _})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(x(v[0])),_.push(x(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},P.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.IPv6=(function(){function s(d,f){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");f&&(this.zoneId=f)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,f){let m;if(f===void 0&&(m=d,d=m[0],f=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,f=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let M=7;M>=0;M-=1)if(v=this.parts[M],v in m){if(_=m[v],f&&_!==0)return null;_!==16&&(f=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return P.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,f=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],f.push(d>>8),f.push(d&255);return f},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),f=d[0],m=d[1];return new P.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),d+f},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(f);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),P.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),f=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(f[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},P.IPv6.isIPv6=function(s){return this.parser(s)!==null},P.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},P.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},P.IPv6.networkAddressFromCIDR=function(s){let d,f,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(_[f],10)),f++;return new this(v)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},P.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},P.IPv6.parseCIDR=function(s){let d,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(f[2]),d>=0&&d<=128))return m=[this.parse(f[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},P.IPv6.parser=function(s){let d,f,m,v,_,M;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return g(s,8);if((m=s.match(l.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+M,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<_.length;f++)if(v=_[f],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},P.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)d[f]=255,f++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},P.fromByteArray=function(s){let d=s.length;if(d===4)return new P.IPv4(s);if(d===16)return new P.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},P.isValid=function(s){return P.IPv6.isValid(s)||P.IPv4.isValid(s)},P.isValidCIDR=function(s){return P.IPv6.isValidCIDR(s)||P.IPv4.isValidCIDR(s)},P.parse=function(s){if(P.IPv6.isValid(s))return P.IPv6.parse(s);if(P.IPv4.isValid(s))return P.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},P.parseCIDR=function(s){try{return P.IPv6.parseCIDR(s)}catch{try{return P.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},P.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},P.subnetMatch=function(s,d,f){let m,v,_,M;f==null&&(f="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(M=_[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return v}return f},typeof Bt<"u"&&Bt.exports?Bt.exports=P:e.ipaddr=P})(Co)});var Mi=E((gA,Ui)=>{var Ci=require("stream").Stream,Ll=require("util");Ui.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");Ll.inherits(pe,Ci);pe.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Ci.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Bi=E((hA,Fi)=>{var jl=require("util"),ji=require("stream").Stream,Li=Mi();Fi.exports=W;function W(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(W,"CombinedStream");jl.inherits(W,ji);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof Li)){var r=Li.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};W.prototype.pipe=function(e,t){return ji.prototype.pipe.call(this,e,t),this.resume(),e};W.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};W.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Vi=E((xA,Zi)=>{"use strict";Zi.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Wi=E(te=>{"use strict";var qt=Vi(),Fl=require("path").extname,Hi=/^\s*([^;\s]*)(?:;|\s|$)/,Bl=/^text\//i;te.charset=Gi;te.charsets={lookup:Gi};te.contentType=Zl;te.extension=Vl;te.extensions=Object.create(null);te.lookup=Hl;te.types=Object.create(null);Gl(te.extensions,te.types);function Gi(e){if(!e||typeof e!="string")return!1;var t=Hi.exec(e),r=t&&qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Bl.test(t[1])?"UTF-8":!1}o(Gi,"charset");function Zl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Zl,"contentType");function Vl(e){if(!e||typeof e!="string")return!1;var t=Hi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Vl,"extension");function Hl(e){if(!e||typeof e!="string")return!1;var t=Fl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Hl,"lookup");function Gl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(qt).forEach(o(function(i){var u=qt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var g=c[l];if(t[g]){var h=r.indexOf(qt[t[g]].source),x=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(h>x||h===x&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(Gl,"populateMaps")});var Ki=E((bA,qi)=>{qi.exports=Wl;function Wl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Wl,"defer")});var Br=E((TA,Xi)=>{var Ji=Ki();Xi.exports=ql;function ql(e){var t=!1;return Ji(function(){t=!0}),o(function(n,i){t?e(n,i):Ji(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(ql,"async")});var Zr=E(($A,Yi)=>{Yi.exports=Kl;function Kl(e){Object.keys(e.jobs).forEach(Jl.bind(e)),e.jobs={}}o(Kl,"abort");function Jl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Jl,"clean")});var Vr=E((AA,ea)=>{var Qi=Br(),Xl=Zr();ea.exports=Yl;function Yl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Ql(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Xl(r):r.results[i]=c,n(u,r.results))})}o(Yl,"iterate");function Ql(e,t,r,n){var i;return e.length==2?i=e(r,Qi(n)):i=e(r,t,Qi(n)),i}o(Ql,"runJob")});var Hr=E((OA,ta)=>{ta.exports=ep;function ep(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(ep,"state")});var Gr=E((wA,ra)=>{var tp=Zr(),rp=Br();ra.exports=np;function np(e){Object.keys(this.jobs).length&&(this.index=this.size,tp(this),rp(e)(null,this.results))}o(np,"terminator")});var oa=E((NA,na)=>{var op=Vr(),ip=Hr(),ap=Gr();na.exports=sp;function sp(e,t,r){for(var n=ip(e);n.index<(n.keyedList||e).length;)op(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return ap.bind(n,r)}o(sp,"parallel")});var Wr=E((CA,Kt)=>{var ia=Vr(),up=Hr(),cp=Gr();Kt.exports=lp;Kt.exports.ascending=aa;Kt.exports.descending=pp;function lp(e,t,r,n){var i=up(e,r);return ia(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){ia(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),cp.bind(i,n)}o(lp,"serialOrdered");function aa(e,t){return e<t?-1:e>t?1:0}o(aa,"ascending");function pp(e,t){return-1*aa(e,t)}o(pp,"descending")});var ua=E((MA,sa)=>{var dp=Wr();sa.exports=mp;function mp(e,t,r){return dp(e,t,null,r)}o(mp,"serial")});var la=E((jA,ca)=>{ca.exports={parallel:oa(),serial:ua(),serialOrdered:Wr()}});var qr=E((FA,pa)=>{"use strict";pa.exports=Object});var ma=E((BA,da)=>{"use strict";da.exports=Error});var ga=E((ZA,fa)=>{"use strict";fa.exports=EvalError});var ha=E((VA,ya)=>{"use strict";ya.exports=RangeError});var xa=E((HA,va)=>{"use strict";va.exports=ReferenceError});var _a=E((GA,Pa)=>{"use strict";Pa.exports=SyntaxError});var Jt=E((WA,ba)=>{"use strict";ba.exports=TypeError});var Ta=E((qA,Ia)=>{"use strict";Ia.exports=URIError});var $a=E((KA,Ea)=>{"use strict";Ea.exports=Math.abs});var Aa=E((JA,Sa)=>{"use strict";Sa.exports=Math.floor});var Oa=E((XA,za)=>{"use strict";za.exports=Math.max});var wa=E((YA,ka)=>{"use strict";ka.exports=Math.min});var Na=E((QA,Ra)=>{"use strict";Ra.exports=Math.pow});var Ca=E((ez,Da)=>{"use strict";Da.exports=Math.round});var Ma=E((tz,Ua)=>{"use strict";Ua.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ja=E((nz,La)=>{"use strict";var fp=Ma();La.exports=o(function(t){return fp(t)||t===0?t:t<0?-1:1},"sign")});var Ba=E((iz,Fa)=>{"use strict";Fa.exports=Object.getOwnPropertyDescriptor});var Kr=E((az,Za)=>{"use strict";var Xt=Ba();if(Xt)try{Xt([],"length")}catch{Xt=null}Za.exports=Xt});var Ha=E((sz,Va)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Va.exports=Yt});var Jr=E((uz,Ga)=>{"use strict";Ga.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ka=E((lz,qa)=>{"use strict";var Wa=typeof Symbol<"u"&&Symbol,gp=Jr();qa.exports=o(function(){return typeof Wa!="function"||typeof Symbol!="function"||typeof Wa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:gp()},"hasNativeSymbols")});var Xr=E((dz,Ja)=>{"use strict";Ja.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Yr=E((mz,Xa)=>{"use strict";var yp=qr();Xa.exports=yp.getPrototypeOf||null});var es=E((fz,Qa)=>{"use strict";var hp="Function.prototype.bind called on incompatible ",vp=Object.prototype.toString,xp=Math.max,Pp="[object Function]",Ya=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),_p=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),bp=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Qa.exports=o(function(t){var r=this;if(typeof r!="function"||vp.apply(r)!==Pp)throw new TypeError(hp+r);for(var n=_p(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,Ya(n,arguments));return Object(x)===x?x:this}return r.apply(t,Ya(n,arguments))},"binder"),c=xp(0,r.length-n.length),l=[],g=0;g<c;g++)l[g]="$"+g;if(i=Function("binder","return function ("+bp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ge=E((yz,ts)=>{"use strict";var Ip=es();ts.exports=Function.prototype.bind||Ip});var Qt=E((hz,rs)=>{"use strict";rs.exports=Function.prototype.call});var Qr=E((vz,ns)=>{"use strict";ns.exports=Function.prototype.apply});var is=E((xz,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ss=E((Pz,as)=>{"use strict";var Tp=Ge(),Ep=Qr(),$p=Qt(),Sp=is();as.exports=Sp||Tp.call($p,Ep)});var cs=E((_z,us)=>{"use strict";var Ap=Ge(),zp=Jt(),Op=Qt(),kp=ss();us.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new zp("a function is required");return kp(Ap,Op,t)},"callBindBasic")});var gs=E((Iz,fs)=>{"use strict";var wp=cs(),ls=Kr(),ds;try{ds=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var en=!!ds&&ls&&ls(Object.prototype,"__proto__"),ms=Object,ps=ms.getPrototypeOf;fs.exports=en&&typeof en.get=="function"?wp([en.get]):typeof ps=="function"?o(function(t){return ps(t==null?t:ms(t))},"getDunder"):!1});var Ps=E((Ez,xs)=>{"use strict";var ys=Xr(),hs=Yr(),vs=gs();xs.exports=ys?o(function(t){return ys(t)},"getProto"):hs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return hs(t)},"getProto"):vs?o(function(t){return vs(t)},"getProto"):null});var tn=E((Sz,_s)=>{"use strict";var Rp=Function.prototype.call,Np=Object.prototype.hasOwnProperty,Dp=Ge();_s.exports=Dp.call(Rp,Np)});var As=E((Az,Ss)=>{"use strict";var L,Cp=qr(),Up=ma(),Mp=ga(),Lp=ha(),jp=xa(),Je=_a(),Ke=Jt(),Fp=Ta(),Bp=$a(),Zp=Aa(),Vp=Oa(),Hp=wa(),Gp=Na(),Wp=Ca(),qp=ja(),Es=Function,rn=o(function(e){try{return Es('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Kr(),Kp=Ha(),nn=o(function(){throw new Ke},"throwTypeError"),Jp=vt?(function(){try{return arguments.callee,nn}catch{try{return vt(arguments,"callee").get}catch{return nn}}})():nn,We=Ka()(),X=Ps(),Xp=Yr(),Yp=Xr(),$s=Qr(),xt=Qt(),qe={},Qp=typeof Uint8Array>"u"||!X?L:X(Uint8Array),Ue={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":We&&X?X([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Up,"%eval%":eval,"%EvalError%":Mp,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":Es,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&X?X(X([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!X?L:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Cp,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Lp,"%ReferenceError%":jp,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!X?L:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&X?X(""[Symbol.iterator]()):L,"%Symbol%":We?Symbol:L,"%SyntaxError%":Je,"%ThrowTypeError%":Jp,"%TypedArray%":Qp,"%TypeError%":Ke,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Fp,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":$s,"%Object.defineProperty%":Kp,"%Object.getPrototypeOf%":Xp,"%Math.abs%":Bp,"%Math.floor%":Zp,"%Math.max%":Vp,"%Math.min%":Hp,"%Math.pow%":Gp,"%Math.round%":Wp,"%Math.sign%":qp,"%Reflect.getPrototypeOf%":Yp};if(X)try{null.error}catch(e){bs=X(X(e)),Ue["%Error.prototype%"]=bs}var bs,ed=o(function e(t){var r;if(t==="%AsyncFunction%")r=rn("async function () {}");else if(t==="%GeneratorFunction%")r=rn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Ue[t]=r,r},"doEval"),Is={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pt=Ge(),er=tn(),td=Pt.call(xt,Array.prototype.concat),rd=Pt.call($s,Array.prototype.splice),Ts=Pt.call(xt,String.prototype.replace),tr=Pt.call(xt,String.prototype.slice),nd=Pt.call(xt,RegExp.prototype.exec),od=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,id=/\\(\\)?/g,ad=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var i=[];return Ts(t,od,function(u,c,l,g){i[i.length]=l?Ts(g,id,"$1"):c||u}),i},"stringToPath"),sd=o(function(t,r){var n=t,i;if(er(Is,n)&&(i=Is[n],n="%"+i[0]+"%"),er(Ue,n)){var u=Ue[n];if(u===qe&&(u=ed(n)),typeof u>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ss.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(nd(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ad(t),i=n.length>0?n[0]:"",u=sd("%"+i+"%",r),c=u.name,l=u.value,g=!1,h=u.alias;h&&(i=h[0],rd(n,td([0,1],h)));for(var x=1,I=!0;x<n.length;x+=1){var P=n[x],s=tr(P,0,1),d=tr(P,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Je("property names with quotes must have matching quotes");if((P==="constructor"||!I)&&(g=!0),i+="."+P,c="%"+i+"%",er(Ue,c))l=Ue[c];else if(l!=null){if(!(P in l)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&x+1>=n.length){var f=vt(l,P);I=!!f,I&&"get"in f&&!("originalValue"in f.get)?l=f.get:l=l[P]}else I=er(l,P),l=l[P];I&&!g&&(Ue[c]=l)}}return l},"GetIntrinsic")});var Os=E((Oz,zs)=>{"use strict";var ud=Jr();zs.exports=o(function(){return ud()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Rs=E((wz,ws)=>{"use strict";var cd=As(),ks=cd("%Object.defineProperty%",!0),ld=Os()(),pd=tn(),dd=Jt(),rr=ld?Symbol.toStringTag:null;ws.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new dd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!pd(t,rr))&&(ks?ks(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ds=E((Nz,Ns)=>{"use strict";var md=Function.prototype.call,fd=Object.prototype.hasOwnProperty,gd=Ge();Ns.exports=gd.call(md,fd)});var Us=E((Dz,Cs)=>{"use strict";Cs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var js=E((Cz,Ls)=>{"use strict";var un=Bi(),yd=require("util"),on=require("path"),hd=require("http"),vd=require("https"),xd=require("url").parse,Pd=require("fs"),_d=require("stream").Stream,bd=require("crypto"),an=Wi(),Id=la(),Td=Rs(),Oe=Ds(),sn=Us();function Ms(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ms,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],un.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");yd.inherits(j,un);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=un.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Oe(t,"httpVersion"))&&!(t instanceof _d))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Oe(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Pd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Oe(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Oe(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ms(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&sn(c,r.header);var l;for(var g in c)if(Oe(c,g)){if(l=c[g],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=g+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=on.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=on.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Oe(e,"httpVersion")&&(r=on.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ms(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=an.lookup(e.name)),!r&&e&&e.path&&(r=an.lookup(e.path)),!r&&e&&e.readable&&Oe(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=an.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Oe(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+bd.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Id.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=xd(e),n=sn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=sn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=vd.request(n):r=hd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,g=o(function(h,x){return r.removeListener("error",g),r.removeListener("response",l),t.call(this,h,x)},"callback");l=g.bind(this,null),r.on("error",g),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Td(j.prototype,"FormData");Ls.exports=j});var Nd={};dn(Nd,{alai:()=>Rd});module.exports=nu(Nd);var ou=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,g){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,g);let h=c.prototype,x=Object.keys(h);for(let I=0;I<x.length;I++){let P=x[I];P in l||(l[P]=h[P].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var g;let h=r?.Parent?new u:this;n(h,l),(g=h._zod).deferred??(g.deferred=[]);for(let x of h._zod.deferred)x();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var de=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function ye(e){return e&&Object.assign(or,e),or}o(ye,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function gn(e,t){return typeof t=="bigint"?t.toString():t}o(gn,"jsonStringifyReplacer");function Tt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Tt,"cached");function yn(e){return e==null}o(yn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Et,"cleanRegex");var fn=Symbol("evaluating");function q(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==fn)return n===void 0&&(n=fn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(q,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var iu=Tt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function hn(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hn,"isPlainObject");var vn=new Set(["string","number","symbol"]);function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Le,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(xn,"optionalKeys");var Pn={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 je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(je,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function _n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(_n,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var bn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),In=b("$ZodError",bn),Qe=b("$ZodError",bn,{Parent:Error});var su=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new de;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(g=>Ie(g,u,ye())));throw sr(l,i?.callee),l}return c.value},"_parse"),St=su(Qe),uu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(g=>Ie(g,u,ye())));throw sr(l,i?.callee),l}return c.value},"_parseAsync"),At=uu(Qe),cu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new de;return u.issues.length?{success:!1,error:new(e??In)(u.issues.map(c=>Ie(c,i,ye())))}:{success:!0,data:u.value}},"_safeParse"),et=cu(Qe),lu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,ye())))}:{success:!0,data:u.value}},"_safeParseAsync"),tt=lu(Qe);var pu="(?:(?:\\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])))",du=new RegExp(`^${pu}$`);var Tn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),En=/^-?\d+n?$/,$n=/^-?\d+$/,cr=/^-?\d+(?:\.\d+)?$/,Sn=/^(?:true|false)$/i;var Te=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),mu={number:"number",bigint:"bigint",object:"date"};var An=b("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=mu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var zn=b("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Pn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=$n)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var On=b("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!yn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=_n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),kn=b("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Rn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Rn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,g)=>{let h=je(c),x;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(h)continue;let P=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new de;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==P&&(h||(h=je(c,P)))});else{if(c.issues.length===P)continue;h||(h=je(c,P))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,g)=>{if(je(c))return c.aborted=!0,c;let h=i(l,n,g);if(h instanceof Promise){if(g.async===!1)throw new de;return h.then(x=>e._zod.parse(x,g))}return e._zod.parse(h,g)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return h instanceof Promise?h.then(x=>u(x,c,l)):u(h,c,l)}let g=e._zod.parse(c,l);if(g instanceof Promise){if(l.async===!1)throw new de;return g.then(h=>i(h,n,l))}return i(g,n,l)}}q(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),pr=b("$ZodStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var Mn=b("$ZodURL",(e,t)=>{pr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var dr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Ln=b("$ZodNumberFormat",(e,t)=>{zn.init(e,t),dr.init(e,t)}),mr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Sn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=En,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Fn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Bn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Zn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Vn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Nn(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Nn,"handleArrayResult");var Hn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],g=t.element._zod.run({value:l,issues:[]},n);g instanceof Promise?u.push(g.then(h=>Nn(h,r,c))):Nn(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function fu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=xn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(fu,"normalizeDef");function gu(e,t,r,n,i,u){let c=[],l=i.keySet,g=i.catchall._zod,h=g.def.type,x=g.optout==="optional";for(let I in t){if(l.has(I))continue;if(h==="never"){c.push(I);continue}let P=g.run({value:t[I],issues:[]},n);P instanceof Promise?e.push(P.then(s=>Ot(s,r,I,t,x))):Ot(P,r,I,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(gu,"handleCatchall");var Gn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...l};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Tt(()=>fu(t));q(e._zod,"propValues",()=>{let l=t.shape,g={};for(let h in l){let x=l[h]._zod;if(x.values){g[h]??(g[h]=new Set);for(let I of x.values)g[h].add(I)}}return g});let i=Ye,u=t.catchall,c;e._zod.parse=(l,g)=>{c??(c=n.value);let h=l.value;if(!i(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;l.value={};let x=[],I=c.shape;for(let P of c.keys){let s=I[P],d=s._zod.optout==="optional",f=s._zod.run({value:h[P],issues:[]},g);f instanceof Promise?x.push(f.then(m=>Ot(m,l,P,h,d))):Ot(f,l,P,h,d)}return u?gu(x,h,l,g,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Dn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!je(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,ye())))}),t)}o(Dn,"handleUnionResults");var fr=b("$ZodUnion",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),q(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),q(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),q(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Et(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let g of t.options){let h=g._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)l.push(h),c=!0;else{if(h.issues.length===0)return h;l.push(h)}}return c?Promise.all(l).then(g=>Dn(g,i,e,u)):Dn(l,i,e,u)}});var Wn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,fr.init(e,t);let r=e._zod.parse;q(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,g]of Object.entries(c)){i[l]||(i[l]=new Set);for(let h of g)i[l].add(h)}}return i});let n=Tt(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of l){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var qn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!hn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){l.add(typeof h=="number"?h.toString():h);let x=t.valueType._zod.run({value:i[h],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...be(h,I.issues)),r.value[h]=I.value})):(x.issues.length&&r.issues.push(...be(h,x.issues)),r.value[h]=x.value)}let g;for(let h in i)l.has(h)||(g=g??[],g.push(h));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let g=t.keyType._zod.run({value:l,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&cr.test(l)&&g.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(g=I)}if(g.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(I=>Ie(I,n,ye())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(I=>{I.issues.length&&r.issues.push(...be(l,I.issues)),r.value[g.value]=I.value})):(x.issues.length&&r.issues.push(...be(l,x.issues)),r.value[g.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Kn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vn.has(typeof i)).map(i=>typeof i=="string"?Le(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),Jn=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Le(n):n?Le(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Xn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new de;return r.value=i,r}});function Cn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Cn,"handleOptionalResult");var Yn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Cn(u,r.value)):Cn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Qn=b("$ZodNullable",(e,t)=>{H.init(e,t),q(e._zod,"optin",()=>t.innerType._zod.optin),q(e._zod,"optout",()=>t.innerType._zod.optout),q(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var eo=b("$ZodPipe",(e,t)=>{H.init(e,t),q(e._zod,"values",()=>t.in._zod.values),q(e._zod,"optin",()=>t.in._zod.optin),q(e._zod,"optout",()=>t.out._zod.optout),q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>zt(c,t.in,n)):zt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>zt(u,t.out,n)):zt(i,t.out,n)}});function zt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(zt,"handlePipeResult");var to=b("$ZodCustom",(e,t)=>{Te.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Un(u,r,n,e));Un(i,r,n,e)}});function Un(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Un,"handleRefineResult");var no;var gr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function oo(){return new gr}o(oo,"registry");(no=globalThis).__zod_globalRegistry??(no.__zod_globalRegistry=oo());var yr=globalThis.__zod_globalRegistry;function io(e,t){return new e({type:"string",...Z(t)})}o(io,"_string");function ao(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(ao,"_coercedString");function so(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(so,"_url");function uo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(uo,"_number");function co(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(co,"_coercedNumber");function lo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(lo,"_int");function po(e,t){return new e({type:"boolean",...Z(t)})}o(po,"_boolean");function mo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(mo,"_coercedBoolean");function fo(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(fo,"_coercedBigint");function go(e){return new e({type:"any"})}o(go,"_any");function yo(e){return new e({type:"unknown"})}o(yo,"_unknown");function ho(e,t){return new e({type:"void",...Z(t)})}o(ho,"_void");function vo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(vo,"_coercedDate");function wt(e,t){return new An({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(wt,"_gte");function ce(e,t){return new On({check:"min_length",...Z(t),minimum:e})}o(ce,"_minLength");function Ee(e,t){return new kn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Ee,"_regex");function xo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(xo,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>St(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>At(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Nt=b("ZodMiniString",(e,t)=>{kt.init(e,t),K.init(e,t)});function a(e){return io(Nt,e)}o(a,"string");var Po=b("ZodMiniStringFormat",(e,t)=>{pr.init(e,t),Nt.init(e,t)});var Au=b("ZodMiniURL",(e,t)=>{Mn.init(e,t),Po.init(e,t)});function _o(e){return so(Au,e)}o(_o,"url");var Dt=b("ZodMiniNumber",(e,t)=>{dr.init(e,t),K.init(e,t)});function Q(e){return uo(Dt,e)}o(Q,"number");var zu=b("ZodMiniNumberFormat",(e,t)=>{Ln.init(e,t),Dt.init(e,t)});function bo(e){return lo(zu,e)}o(bo,"int");var hr=b("ZodMiniBoolean",(e,t)=>{mr.init(e,t),K.init(e,t)});function B(e){return po(hr,e)}o(B,"boolean");var Io=b("ZodMiniBigInt",(e,t)=>{jn.init(e,t),K.init(e,t)});var Ou=b("ZodMiniAny",(e,t)=>{Fn.init(e,t),K.init(e,t)});function nt(){return go(Ou)}o(nt,"any");var ku=b("ZodMiniUnknown",(e,t)=>{Bn.init(e,t),K.init(e,t)});function k(){return yo(ku)}o(k,"unknown");var wu=b("ZodMiniVoid",(e,t)=>{Zn.init(e,t),K.init(e,t)});function To(e){return ho(wu,e)}o(To,"_void");var Eo=b("ZodMiniDate",(e,t)=>{Vn.init(e,t),K.init(e,t)});var Ru=b("ZodMiniArray",(e,t)=>{Hn.init(e,t),K.init(e,t)});function N(e,t){return new Ru({type:"array",element:e,...Z(t)})}o(N,"array");var Nu=b("ZodMiniObject",(e,t)=>{Gn.init(e,t),K.init(e,t),q(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Nu(r)}o(p,"object");var Du=b("ZodMiniUnion",(e,t)=>{fr.init(e,t),K.init(e,t)});function D(e,t){return new Du({type:"union",options:e,...Z(t)})}o(D,"union");var Cu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),K.init(e,t)});function $e(e,t,r){return new Cu({type:"union",options:t,discriminator:e,...Z(r)})}o($e,"discriminatedUnion");var Uu=b("ZodMiniRecord",(e,t)=>{qn.init(e,t),K.init(e,t)});function w(e,t,r){return new Uu({type:"record",keyType:e,valueType:t,...Z(r)})}o(w,"record");var Mu=b("ZodMiniEnum",(e,t)=>{Kn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Mu({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var Lu=b("ZodMiniLiteral",(e,t)=>{Jn.init(e,t),K.init(e,t)});function $(e,t){return new Lu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o($,"literal");var ju=b("ZodMiniTransform",(e,t)=>{Xn.init(e,t),K.init(e,t)});function Se(e){return new ju({type:"transform",transform:e})}o(Se,"transform");var Fu=b("ZodMiniOptional",(e,t)=>{Yn.init(e,t),K.init(e,t)});function y(e){return new Fu({type:"optional",innerType:e})}o(y,"optional");var Bu=b("ZodMiniNullable",(e,t)=>{Qn.init(e,t),K.init(e,t)});function ot(e){return new Bu({type:"nullable",innerType:e})}o(ot,"nullable");var Zu=b("ZodMiniPipe",(e,t)=>{eo.init(e,t),K.init(e,t)});function Ae(e,t){return new Zu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Vu=b("ZodMiniCustom",(e,t)=>{to.init(e,t),K.init(e,t)});function Ct(e,t){return xo(Vu,e??(()=>!0),t)}o(Ct,"custom");var it={};dn(it,{bigint:()=>Ju,boolean:()=>Ku,date:()=>Xu,number:()=>qu,string:()=>Wu});function Wu(e){return ao(Nt,e)}o(Wu,"string");function qu(e){return co(Dt,e)}o(qu,"number");function Ku(e){return mo(hr,e)}o(Ku,"boolean");function Ju(e){return fo(Io,e)}o(Ju,"bigint");function Xu(e){return vo(Eo,e)}o(Xu,"date");var xr=p({retryOnFailure:p({defaultValue:y(B()),hide:y(B())}),continueOnFailure:p({defaultValue:y(B()),hide:y(B())})}),vr=class{constructor(t,r,n,i,u,c,l,g,h,x,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=g;this.outputSchema=h;this.audience=x;this.aiMetadata=I}static{o(this,"IAction")}},se=o(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:y(a())}),C=o((e,t)=>p({type:$(t),required:B(),defaultValue:y(nt())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),he=p({...F.shape,...C(a(),"LONG_TEXT").shape});var So=p({label:a(),value:k()}),Ut=p({disabled:y(B()),placeholder:y(a()),options:N(So)});var oe=p({...F.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),ve=p({...F.shape,options:Ut,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),at=p({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var xe=p({...F.shape,...C(B(),"CHECKBOX").shape});var Pe=p({...F.shape,...C(Q(),"NUMBER").shape});var st=p({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var ut=p({...F.shape,...C(a(),"DATE_TIME").shape});var Ao=w(a(),D([ne,he,oe,at,ve,xe,Pe,st,ut])),ct=p({...F.shape,properties:Ao,...C(N(k()),"ARRAY").shape});var lt=p({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var zo=D([ne,oe,lt,ct,ve]),Qu=w(a(),zo),_r=p({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Mt=p({...F.shape,...C(To(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Be=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Be||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),br="both_client_credentials_and_authorization_code";var we=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(we||{}),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||{}),ec=p({strategy:U(mt),paramName:y(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Oo=p({status:y(Q()),body:y(k()),headers:y(w(a(),a()))}),ko=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(Lt))}),wo=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Oo,handlerId:y(a()),streamStepProgress:y(U(Lt))}),tc=D([ko,wo]);var rc=p({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function le(e){return e==null}o(le,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Ir=Me(require("crypto"),1);var nc=128,Re,Ze,oc=o(e=>{!Re||Re.length<e?(Re=Buffer.allocUnsafe(e*nc),Ir.default.randomFillSync(Re),Ze=0):Ze+e>Re.length&&(Ir.default.randomFillSync(Re),Ze=0),Ze+=e},"fillPool"),ic=o(e=>(oc(e|=0),Re.subarray(Ze-e,Ze)),"random"),ac=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),g=i;for(;g--;)if(c+=e[l[g]&n]||"",c.length===u)return c}}},"customRandom"),No=o((e,t=21)=>ac(e,t,ic),"customAlphabet");var sc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Do=21,gb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Do}}$`))),uc=No(sc,Do);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),ue={id:a(),created:ze,updated:ze},V=o(e=>y(ot(e)),"Nullable");function Tr(e){return y(ot(U(e)))}o(Tr,"NullableEnum");var vb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),Ft=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(N(e))),"OptionalArrayFromQuery");var _b=w(a(),k());var yt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(yt||{});var Rb=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var Db=p({filename:a(),data:k(),type:$("file"),mimetype:y(a())});var cc=Me(Uo());var Bb=p({...ue,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:y(Q())});var Mo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Mo||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var lc=p({mode:U(Mo),value:k()}),pc=p({auth:y(a()),fields:w(a(),lc)}),dc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(pc)}),mc=p({type:$("PIECE"),toolName:a().check(ce(1)),pieceMetadata:dc}),fc=p({type:$("none")}),gc=p({type:$("access_token"),accessToken:a()}),yc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),hc=p({type:$("headers"),headers:w(a(),a())}),vc=$e("type",[fc,gc,yc,hc]),Lo=p({type:$("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:y(a())}),jo=p({type:$("MCP"),toolName:a().check(ce(1)),serverUrl:_o(),protocol:U($r),auth:vc}),Fo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),xc=$e("type",[mc,Lo,jo,Fo]),Pc=p({displayName:a(),description:y(a()),type:U(Sr)}),Bo=p({type:$("MARKDOWN"),markdown:a()}),Ve={type:$("TOOL_CALL"),input:V(w(a(),k())),output:y(k()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:y(a())},xI=p(Ve),Zo=$e("toolCallType",[p({...Ve,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ve,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ve,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...Ve,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ve,toolCallType:$("UNKNOWN"),displayName:a()})]),_c=D([Bo,Zo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),_e=p({apiKey:a()}),bc=_e,Ic=p({apiKey:a(),apiKeyHash:a()}),Tc=_e,Ec=_e,$c=_e,Sc=_e,Ac=_e,zc=_e,Oc=_e,qo=p({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),kc=p({}),wc=p({}),Rc=p({}),Nc=p({}),Dc=p({}),Cc=p({}),Ko=p({modelId:a(),modelName:a(),modelType:U(zr)}),Jo=p({apiKeyHeader:a(),baseUrl:a(),models:N(Ko),defaultHeaders:y(w(a(),a()))}),Xo=p({accountId:a(),gatewayId:a(),models:N(Ko),vertexProject:y(a()),vertexRegion:y(a())}),Yo=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),Qo=p({region:a().check(ce(1))}),Uc=D([bc,$c,Sc,Ac,zc,Ec,Tc,Ic,qo,Oc]),ei=D([Jo,Xo,Yo,Qo,kc,Rc,Nc,Dc,wc,Cc]),Mc=p({id:a(),name:a(),type:U(zr)}),Lc=p({id:a(),name:a(),provider:U(yt),config:ei,enabledForChat:B()}),jc=p({provider:U(yt),config:ei,auth:Uc,platformId:a()});var II={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Vo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Fc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Bc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ho=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Zc=["grok-4.20","grok-4.1-fast"],Vc={openai:Vo,anthropic:Fc,google:Ho,activepieces:[...Bc.map(e=>`anthropic/${e}`),...Vo.map(e=>`openai/${e}`),...Ho.map(e=>`google/${e}`),...Zc.map(e=>`x-ai/${e}`)]};var Go=128e3,Hc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Gc({provider:e}){return e?Hc[e]??Go:Go}o(Gc,"getMaxContextTokens");var Wo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Wc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},qc=new Set(["anthropic","mistral"]);function me(e){return{chatModels:Vc[e],maxContextTokens:Gc({provider:e}),defaultEmbeddingModel:Wo[e],supportsEmbedding:Wo[e]!==void 0,supportsImageGeneration:!qc.has(e),webSearch:Wc[e]}}o(me,"buildProviderCapabilities");var Kc={openai:me("openai"),anthropic:me("anthropic"),openrouter:me("openrouter"),azure:me("azure"),google:me("google"),"cloudflare-gateway":me("cloudflare-gateway"),custom:me("custom"),bedrock:me("bedrock"),mistral:me("mistral"),activepieces:me("activepieces")};var Jc=p({base64Url:a(),fileName:a(),extension:y(a())}),Xc=p({mimeType:a(),url:a(),fileName:y(a())}),Or=D([Jc,Xc]);var Yc=D([p({type:$("file"),value:Or}),p({type:$("markdown"),value:a(),files:y(N(Or))})]),Qc=p({sessionId:a(),message:a(),files:y(N(a()))});var ri=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ri||{}),ni=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ni||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var el=D([p({...ue,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ue,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),tl=p({...ue,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Tr(ni),trigger:Tr(ri)}),rl=p({...ue,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),nl=p({events:N(U(kr)),webhookUrl:a(),flowId:a()}),ol=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),il=p({projectId:a(),limit:y(it.number()),cursor:y(a()),name:y(a()),externalIds:Ft(a()),folderId:y(a()),folderIds:Ft(a())}),al=p({records:N(N(p({fieldId:a(),value:ii()}))),tableId:a()}),sl=p({cells:y(N(p({fieldId:a(),value:ii()}))),tableId:a(),agentUpdate:y(B())}),oi=$e("operator",[Ne("eq"),Ne("neq"),Ne("gt"),Ne("gte"),Ne("lt"),Ne("lte"),Ne("co"),ti("exists"),ti("not_exists")]),ul=p({tableId:a(),limit:y(it.number()),cursor:y(a()),filters:Ft(oi)});function ii(){return Ae(Se(e=>e==null?e:String(e)),ot(a()))}o(ii,"coerceToString");function Ne(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ne,"valueFilter");function ti(e){return p({fieldId:a(),operator:$(e)})}o(ti,"existenceFilter");var cl=p({status:y(Q()),body:y(k()),headers:y(w(a(),a()))}),ll=p({...ue,deleted:V(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var ai=p({name:a(),description:y(a()),type:a(),required:B()}),pl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(ai),returnsResponse:B()})});var si="^[0-9]+\\.[0-9]+\\.[0-9]+$",BI=new RegExp(si),ml="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",ZI=a().check(Ee(new RegExp(si))),VI=a().check(Ee(new RegExp(ml))),fl=p({packageType:$("ARCHIVE"),pieceType:U(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ui=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ci=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),HI=D([ui,ci]),GI=D([fl,ui,ci]);var gl=$e("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:bo().check(wt(6e4))})]),WI=p({...ue,type:U(we),projectId:a(),flowId:a(),triggerName:a(),schedule:V(gl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),li=(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))(li||{}),pi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(pi||{}),di=(r=>(r.S3="S3",r.DB="DB",r))(di||{}),qI=p({...ue,projectId:V(a()),platformId:V(a()),type:U(li),compression:U(pi),data:y(k()),location:U(di),size:V(Q()),fileName:V(a()),s3Key:V(a()),metadata:V(w(a(),a()))}),mi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(mi||{}),fi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(fi||{}),KI=p({id:a(),email:a(),firstName:a(),status:U(fi),externalId:V(a()),platformId:V(a()),platformRole:U(mi),lastName:a(),created:ze,updated:ze,lastActiveDate:V(ze),imageUrl:V(a())});var wr=p({...F.shape,...C(w(a(),k()),"OBJECT").shape});var vi=p({...F.shape,...C(a(),"COLOR").shape});var Rr=D([ne,he,Mt,xe,oe,ve,Pr,at,_r,Pe,ct,wr,lt,ut,st,vi]),S={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var fe=p({displayName:a(),description:y(a())});var xi=p({username:a(),password:a()}),Nr=p({...fe.shape,username:p({displayName:a(),description:y(a())}),password:p({displayName:a(),description:y(a())}),...C(xi,"BASIC_AUTH").shape});var xl=w(a(),D([ne,he,Pe,xe,oe])),Dr=p({...fe.shape,props:xl,...C(k(),"CUSTOM_AUTH").shape});var De=p({...fe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Pl=w(a(),D([ne,he,De,Pe,xe,oe,ve,Mt])),Pi=p({...fe.shape,props:Pl,...C(k(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),_i=D([ne,De,oe]),bi=w(a(),_i),_l=p({props:y(w(a(),_i)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:y(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:y(B()),pkceMethod:y(D([$("plain"),$("S256")])),authorizationMethod:y(U(Cr)),grantType:y(D([U(dt),$(br)])),extra:y(w(a(),a()))}),Ii=p({access_token:a(),props:y(bi),data:w(a(),nt())}),Ur=p({...fe.shape,..._l.shape,...C(Ii,"OAUTH2").shape});var He=D([Nr,Dr,Pi,Ur,De]),ht="Connection",Zt={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var SE={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 bl=p({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Il=D([Rr,He]),Mr=w(a(),Il),WE=w(a(),Rr);var Ti=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]);var Ei="2",Vt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,l,g,h=Vt,x,I="",P){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=g;this.minimumSupportedRelease=h;this.maximumSupportedRelease=x;this.description=I;this.deprecated=P;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ei}),"getContextInfo");(!Tl(h)||El(h,Vt))&&(this.minimumSupportedRelease=Vt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},$i=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Tl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Tl,"isValidSimpleSemver");function El(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(El,"isSemverLessThan");var $l=y(w(a(),w(a(),a()))),Si=p({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:y(a()),directoryPath:y(a()),auth:y(D([He,N(He)])),version:a(),categories:y(N(U(Be))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:$l}),Sl=U(["human","ai","both"]),Ai=p({description:y(a()),idempotent:y(B())}),zi=p({name:a(),displayName:a(),description:a(),props:Mr,requireAuth:B(),errorHandlingOptions:y(xr),outputSchema:y(Ct()),audience:y(Sl),aiMetadata:y(Ai)}),Oi=p({name:a(),displayName:a(),description:a(),props:Mr,errorHandlingOptions:y(xr),type:U(we),sampleData:k(),handshakeConfiguration:y(Ct()),renewConfiguration:y(Ti),testStrategy:U(ft),outputSchema:y(Ct()),aiMetadata:y(Ai)}),Al=p({...Si.shape,actions:w(a(),zi),triggers:w(a(),Oi)}),zl=p({...Si.shape,actions:Q(),triggers:Q(),suggestedActions:y(N(zi)),suggestedTriggers:y(N(Oi))}),ki=p({projectUsage:Q(),pieceType:U(Fe),packageType:U(pt),platformId:y(a()),archiveId:y(a())}),W$=p({...Al.shape,...ki.shape}),q$=p({...zl.shape,...ki.shape}),K$=p({name:a(),version:a()});var Ol=Me(require("path")),kl=Me(require("fs/promises"));var Di=require("node:stream");var Ht=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new jr,r=new Fr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},jr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Fr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ce=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function wi({error:e,requestBody:t}){return e instanceof Ce?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(wi,"toFailsafeOutput");var ge=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ge||{});var Wt=class extends Ht{static{o(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,Y]of Object.entries(c))i.append(M,Y);let l=i.toString(),g=l?`${n}?${l}`:n,h=t.responseType??"json",x=t.followRedirects??!0,I=t.retries??0,{body:P,extraHeaders:s,isStream:d}=wl(t.method)?Rl(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},f=Dl({...u,...s}),m=await Nl(async()=>{let M=new AbortController,Y=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let re={method:t.method.toString(),headers:f,body:P,redirect:x?"follow":"manual",signal:M.signal};return d&&(re.duplex="half"),r?.dispatcher!==void 0&&(re.dispatcher=r.dispatcher),await fetch(g,re)}finally{Y!==void 0&&clearTimeout(Y)}},I),v=x?300:400;if(m.status<200||m.status>=v){let M=await Ri(m,h),Y=new Ce(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Y),Y}let _=await Ri(m,h);return{status:m.status,headers:Cl(m.headers),body:_}}};function wl(e){return e!=="GET"&&e!=="HEAD"}o(wl,"acceptsRequestBody");function Rl(e,t){if(Ml(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Ul(e)){let n=new Di.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Rl,"serializeBody");async function Ri(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ri,"parseResponseBody");async function Nl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ni(n);continue}return i}catch(i){if(r=i,n<t){await Ni(n);continue}throw i}throw r}o(Nl,"sendWithRetries");function Ni(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ni,"backoff");function Dl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(Dl,"normalizeHeaders");function Cl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Cl,"toHttpHeaders");function Ul(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Ul,"isNodeFormData");function Ml(e){return e==null}o(Ml,"isNil");var J=new Wt;var Ed=Me(require("fs")),Fs=Me(js());var $d={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Sd(e){let t=e.split(";")[0].trim().toLowerCase();return $d[t]??""}o(Sd,"contentTypeToExtension");var Ad=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),zd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Bs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:g="headers"}){return se({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${zd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ge).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let x=h,I={};switch(x){case"none":break;case"json":I.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async h=>{let{method:x,url:I,headers:P,queryParams:s,body:d,body_type:f,failsafe:m,timeout:v,response_is_binary:_,followRedirects:M}=h.propsValue;jt(x,"Method"),jt(I,"URL");let Y=le(r)?{}:await r(h.auth,h.propsValue),re=I.url,ke=re.startsWith("http://")||re.startsWith("https://")?re:Ad({baseUrl:t(h.auth),relativePath:re}),ie={method:x,url:ke,headers:{...P??{},...g==="headers"||!le(g)?Y:{}},queryParams:{...g==="queryParams"?Y:{},...s??{}},timeout:v?v*1e3:0,followRedirects:M};if(_&&(ie.responseType="arraybuffer"),d)if(f&&f!=="none"){let ae=d.data;if(f==="form_data"){let Xs=ae,_t=new Fs.default;for(let{fieldName:cn,fieldType:ln,textFieldValue:pn,fileFieldValue:nr}of Xs)ln==="text"&&!gt(pn)?_t.append(cn,pn):ln==="file"&&!gt(nr)&&_t.append(cn,nr.data,{filename:nr?.filename});ie.body=_t,ie.headers={...ie.headers,..._t.getHeaders()}}else ie.body=ae}else f||(ie.body=d);try{let ae=await J.sendRequest(ie);return await Od(h.files,ae.body,ae.status,ae.headers,_)}catch(ae){if(m)return wi({error:ae,requestBody:ie.body});throw ae}},"run")})}o(Bs,"createCustomApiCallAction");var Od=o(async(e,t,r,n,i)=>{let u;if(i&&kd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=Sd(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),kd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var wd=`
|
|
4
|
+
Follow these steps to get your Alai API Key:
|
|
5
|
+
|
|
6
|
+
1. Go to [**https://getalai.com/api**](https://getalai.com/api) and sign up or log in.
|
|
7
|
+
2. Navigate to the **API Keys** section.
|
|
8
|
+
3. Click **Create API Key** and give it a name (e.g., "Activepieces").
|
|
9
|
+
4. Copy the key and paste it below.
|
|
10
|
+
`,ee=Zt.CustomAuth({description:wd,required:!0,props:{apiKey:Zt.SecretText({displayName:"API Key",description:"Paste your API key here.",required:!0})},async validate(e){let t=e.auth.apiKey;try{return await J.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/ping",headers:{Authorization:`Bearer ${t}`}}),{valid:!0}}catch(r){return r instanceof Ce&&r.response.status===401?{valid:!1,error:"Invalid API Key"}:{valid:!1,error:"Failed to connect to Alai API"}}}});var Zs=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),Vs=se({auth:ee,name:"generatePresentation",displayName:"Generate Presentation",description:"Create a new AI-generated presentation from text.",audience:"both",aiMetadata:{description:"Generate a brand-new presentation from input text via the Alai AI API, with optional controls for tone, slide count, text density, theme, and AI images. Use this to turn raw text into slides. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the deck finishes (up to Max Wait Time). Not idempotent: each call starts a new generation.",idempotent:!1},props:{inputText:S.LongText({displayName:"Input Text",description:"The text content to generate a presentation from.",required:!0}),additionalInstructions:S.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the presentation should be generated.",required:!1}),exportFormats:S.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in after generation.",required:!1,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),title:S.ShortText({displayName:"Title",description:"A title for the presentation. If not provided, one will be generated.",required:!1}),themeId:S.ShortText({displayName:"Theme ID",description:"The ID of the presentation theme to use. If not provided, a default theme will be applied.",required:!1}),slideRange:S.ShortText({displayName:"Slide Range",description:"Target slide count: auto, 1, 2-5, 6-10, 11-15, 16-20, 21-25, 26-50.",required:!1}),tone:S.StaticDropdown({displayName:"Tone",description:"The tone of voice for the presentation content.",required:!1,options:{options:[{label:"Default",value:"DEFAULT"},{label:"Professional",value:"PROFESSIONAL"},{label:"Casual",value:"CASUAL"},{label:"Technical",value:"TECHNICAL"},{label:"Educational",value:"EDUCATIONAL"},{label:"Inspirational",value:"INSPIRATIONAL"},{label:"Narrative",value:"NARRATIVE"},{label:"Persuasive",value:"PERSUASIVE"},{label:"Authoritative",value:"AUTHORITATIVE"},{label:"Empathetic",value:"EMPATHETIC"}]}}),contentMode:S.StaticDropdown({displayName:"Content Mode",description:"How the input text should be handled.",required:!1,options:{options:[{label:"Preserve",value:"PRESERVE"},{label:"Condense",value:"CONDENSE"},{label:"Enhance",value:"ENHANCE"},{label:"Custom",value:"CUSTOM"}]}}),amountMode:S.StaticDropdown({displayName:"Text Density",description:"The amount of text to include per slide.",required:!1,options:{options:[{label:"Minimal",value:"MINIMAL"},{label:"Essential",value:"ESSENTIAL"},{label:"Balanced",value:"BALANCED"},{label:"Detailed",value:"DETAILED"}]}}),includeAiImages:S.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the presentation.",required:!1,defaultValue:!0}),imageStyle:S.StaticDropdown({displayName:"Image Style",description:"The style for AI-generated images.",required:!1,options:{options:[{label:"Auto",value:"auto"},{label:"Realistic",value:"realistic"},{label:"Artistic",value:"artistic"},{label:"Cartoon",value:"cartoon"},{label:"3D",value:"three_d"}]}}),waitForCompletion:S.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:S.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{inputText:t,additionalInstructions:r,exportFormats:n,title:i,themeId:u,slideRange:c,tone:l,contentMode:g,amountMode:h,includeAiImages:x,imageStyle:I,waitForCompletion:P,maxWaitTime:s}=e.propsValue,d={input_text:t};r&&(d.additional_instructions=r),n&&n.length>0?d.export_formats=n:d.export_formats=["link"];let f={};i&&(f.title=i),u&&(f.theme_id=u),c&&(f.slide_range=c),Object.keys(f).length>0&&(d.presentation_options=f);let m={};l&&(m.tone=l),g&&(m.content_mode=g),h&&(m.amount_mode=h),Object.keys(m).length>0&&(d.text_options=m);let v={};x!=null&&(v.include_ai_images=x),I&&(v.style=I),Object.keys(v).length>0&&(d.image_options=v);let _=await J.sendRequest({method:"POST",url:"https://slides-api.getalai.com/api/v1/generations",headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:d}),M=_.body?.generation_id;if(!M)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(_.body)}`);if(!P)return _.body;await Zs(1e3);let Y=(s||300)*1e3,re=Date.now(),ke=5e3;for(;Date.now()-re<Y;){let ie=await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${M}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),ae=ie.body?.status;if(ae==="completed")return ie.body;if(ae==="failed")throw new Error(`Generation failed: ${ie.body?.error||"Unknown error"}`);await Zs(ke)}throw new Error(`Generation timed out after ${s||300} seconds`)}});var Hs=se({auth:ee,name:"getGeneration",displayName:"Get Generation",description:"Fetch the status and result of a generation job.",audience:"both",aiMetadata:{description:"Look up the current status and result of an Alai generation job by its generation_id (returned by Generate Presentation or Export Presentation). Use this to poll for completion or retrieve the finished output and export links. Read-only and idempotent. Requires a valid generation_id.",idempotent:!0},props:{generationId:S.ShortText({displayName:"Generation ID",description:'The ID of the generation job (from the "Generate Presentation" action).',required:!0})},async run(e){let{generationId:t}=e.propsValue;return(await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,Accept:"application/json"}})).body}});var Gs=o(e=>new Promise(t=>setTimeout(t,e)),"sleep"),Ws=se({auth:ee,name:"exportPresentation",displayName:"Export Presentation",description:"Export a presentation in the specified formats.",audience:"both",aiMetadata:{description:"Export an existing Alai presentation into one or more formats (link, PDF, and/or PPTX) by its presentation ID. Use this to render a deck for download or sharing. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the export finishes (up to Max Wait Time). Not idempotent: each call kicks off a new export job. Requires the presentation ID and at least one export format.",idempotent:!1},props:{presentationId:S.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to export.",required:!0}),exportFormats:S.StaticMultiSelectDropdown({displayName:"Export Formats",description:"Formats to export the presentation in.",required:!0,options:{options:[{label:"Link",value:"link"},{label:"PDF",value:"pdf"},{label:"PowerPoint (PPTX)",value:"ppt"}]}}),waitForCompletion:S.Checkbox({displayName:"Wait for Completion",description:"Wait for the presentation generation to complete before returning.",required:!1,defaultValue:!1}),maxWaitTime:S.Number({displayName:"Max Wait Time (seconds)",description:"Maximum time to wait for completion (default 300 seconds / 5 minutes).",required:!1,defaultValue:300})},async run(e){let{presentationId:t,exportFormats:r,waitForCompletion:n,maxWaitTime:i}=e.propsValue,u=await J.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/exports`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:{export_formats:r}}),c=u.body?.generation_id;if(!c)throw new Error(`Failed to get generation_id from response: ${JSON.stringify(u.body)}`);if(!n)return u.body;await Gs(1e3);let l=(i||300)*1e3,g=Date.now(),h=5e3;for(;Date.now()-g<l;){let x=await J.sendRequest({method:"GET",url:`https://slides-api.getalai.com/api/v1/generations/${c}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}}),I=x.body?.status;if(I==="completed")return x.body;if(I==="failed")throw new Error(`Generation failed: ${x.body?.error||"Unknown error"}`);await Gs(h)}throw new Error(`Generation timed out after ${i||300} seconds`)}});var qs=S.Dropdown({auth:ee,displayName:"Presentation",description:"Select a presentation",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{options:[]};let r=(await J.sendRequest({method:"GET",url:"https://slides-api.getalai.com/api/v1/presentations",headers:{Authorization:`Bearer ${e.props.apiKey}`,Accept:"application/json"}})).body?.presentations||[];return{disabled:r.length===0,options:r.map(n=>({label:n.title,value:n.presentation_id}))}},"options")});var Ks=se({auth:ee,name:"addSlide",displayName:"Add Slide",description:"Add a new slide to an existing presentation.",audience:"both",aiMetadata:{description:'Generate and insert a new AI-authored slide into an existing Alai presentation, given the presentation ID and the slide content/topic; optional slide order controls where it lands (a numeric index, or "end" to append). Use this to extend a deck after it has been generated. Not idempotent: each call appends another slide.',idempotent:!1},props:{presentationId:qs,slide_context:S.LongText({displayName:"Slide Context",description:"The content or topic for the slide to be generated.",required:!0}),additionalInstructions:S.LongText({displayName:"Additional Instructions",description:"Extra instructions for how the slide should be generated.",required:!1}),slide_order:S.ShortText({displayName:"Slide Order",description:'The position to insert the new slide (e.g., "0" for the first slide, "end" to add at the end).',required:!1}),includeAiImages:S.Checkbox({displayName:"Include AI Images",description:"Whether to include AI-generated images in the slide.",required:!1,defaultValue:!0}),imageStyle:S.ShortText({displayName:"Image Style",description:"The style for AI-generated images.",required:!1})},async run(e){let{presentationId:t,slide_context:r,additionalInstructions:n,slide_order:i,includeAiImages:u,imageStyle:c}=e.propsValue,l={};n&&(l.additional_instructions=n),i&&(l.slide_order=isNaN(Number(i))?i:Number(i)),u?l.num_image_variants=c?2:1:l.num_image_variants=0;let g={slide_context:r,options:l,export_formats:["link"]};return(await J.sendRequest({method:"POST",url:`https://slides-api.getalai.com/api/v1/presentations/${t}/slides`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`,"Content-Type":"application/json"},body:g})).body}});var Js=se({auth:ee,name:"deletePresentation",displayName:"Delete Presentation",description:"Delete a presentation by its ID.",audience:"both",aiMetadata:{description:"Permanently delete an Alai presentation by its ID. Use this to remove a deck the user no longer needs. Destructive but idempotent: once deleted, repeating the call with the same ID leaves the same end state. Requires the presentation ID.",idempotent:!0},props:{presentationId:S.ShortText({displayName:"Presentation ID",description:"The ID of the presentation to delete.",required:!0})},async run(e){let{presentationId:t}=e.propsValue;return(await J.sendRequest({method:"DELETE",url:`https://slides-api.getalai.com/api/v1/presentations/${t}`,headers:{Authorization:`Bearer ${e.auth.props.apiKey}`}})).body}});var Rd=$i({displayName:"Alai",auth:ee,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/alai.png",authors:["getalai","sanket-a11y"],description:"AI-powered presentation generation API. Create, export, and manage professional presentations from text.",categories:["CONTENT_AND_FILES","ARTIFICIAL_INTELLIGENCE"],actions:[Vs,Hs,Ws,Ks,Js,Bs({auth:ee,baseUrl:o(()=>"https://slides-api.getalai.com/api/v1","baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e.props.apiKey}`}),"authMapping")})],triggers:[]});0&&(module.exports={alai});
|
|
11
|
+
/*! Bundled license information:
|
|
12
|
+
|
|
13
|
+
mime-types/index.js:
|
|
14
|
+
(*!
|
|
15
|
+
* mime-types
|
|
16
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
17
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
18
|
+
* MIT Licensed
|
|
19
|
+
*)
|
|
20
|
+
*/
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,IAAI;;GA6Bf,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,iDAAqD;AACrD,4CAA6C;AAC7C,+EAA2E;AAC3E,iEAA6D;AAC7D,2EAAuE;AACvE,uDAAmD;AACnD,2EAAuE;AACvE,+DAAwE;AAE3D,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC9B,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,eAAQ;IACd,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8CAA8C;IACvD,OAAO,EAAE,CAAC,SAAS,EAAC,aAAa,CAAC;IAClC,WAAW,EACT,0GAA0G;IAC5G,UAAU,EAAE;QACV,sBAAa,CAAC,iBAAiB;QAC/B,sBAAa,CAAC,uBAAuB;KACtC;IACD,OAAO,EAAE;QACP,4CAAoB;QACpB,8BAAa;QACb,wCAAkB;QAClB,oBAAQ;QACR,wCAAkB;QAClB,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,eAAQ;YACd,OAAO,EAAE,GAAG,EAAE,CAAC,uCAAuC;YACtD,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;iBAC7C,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const addSlide: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>, {
|
|
4
|
-
presentationId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
5
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
6
|
-
}>>;
|
|
7
|
-
slide_context: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
-
additionalInstructions: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
9
|
-
slide_order: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
includeAiImages: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
11
|
-
imageStyle: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=add-slide.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-slide.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/add-slide.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;;;;;;;;;EA0EnB,CAAC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addSlide = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const props_1 = require("../common/props");
|
|
9
|
-
exports.addSlide = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.alaiAuth,
|
|
11
|
-
name: 'addSlide',
|
|
12
|
-
displayName: 'Add Slide',
|
|
13
|
-
description: 'Add a new slide to an existing presentation.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Generate and insert a new AI-authored slide into an existing Alai presentation, given the presentation ID and the slide content/topic; optional slide order controls where it lands (a numeric index, or "end" to append). Use this to extend a deck after it has been generated. Not idempotent: each call appends another slide.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
presentationId: props_1.presentationId,
|
|
21
|
-
slide_context: pieces_framework_1.Property.LongText({
|
|
22
|
-
displayName: 'Slide Context',
|
|
23
|
-
description: 'The content or topic for the slide to be generated.',
|
|
24
|
-
required: true,
|
|
25
|
-
}),
|
|
26
|
-
additionalInstructions: pieces_framework_1.Property.LongText({
|
|
27
|
-
displayName: 'Additional Instructions',
|
|
28
|
-
description: 'Extra instructions for how the slide should be generated.',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
slide_order: pieces_framework_1.Property.ShortText({
|
|
32
|
-
displayName: 'Slide Order',
|
|
33
|
-
description: 'The position to insert the new slide (e.g., "0" for the first slide, "end" to add at the end).',
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
includeAiImages: pieces_framework_1.Property.Checkbox({
|
|
37
|
-
displayName: 'Include AI Images',
|
|
38
|
-
description: 'Whether to include AI-generated images in the slide.',
|
|
39
|
-
required: false,
|
|
40
|
-
defaultValue: true,
|
|
41
|
-
}),
|
|
42
|
-
imageStyle: pieces_framework_1.Property.ShortText({
|
|
43
|
-
displayName: 'Image Style',
|
|
44
|
-
description: 'The style for AI-generated images.',
|
|
45
|
-
required: false,
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
run(context) {
|
|
49
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
const { presentationId, slide_context, additionalInstructions, slide_order, includeAiImages, imageStyle } = context.propsValue;
|
|
51
|
-
const options = {};
|
|
52
|
-
if (additionalInstructions) {
|
|
53
|
-
options['additional_instructions'] = additionalInstructions;
|
|
54
|
-
}
|
|
55
|
-
if (slide_order) {
|
|
56
|
-
options['slide_order'] = isNaN(Number(slide_order)) ? slide_order : Number(slide_order);
|
|
57
|
-
}
|
|
58
|
-
if (includeAiImages) {
|
|
59
|
-
options['num_image_variants'] = imageStyle ? 2 : 1;
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
options['num_image_variants'] = 0;
|
|
63
|
-
}
|
|
64
|
-
const body = {
|
|
65
|
-
slide_context: slide_context,
|
|
66
|
-
options,
|
|
67
|
-
export_formats: ['link'],
|
|
68
|
-
};
|
|
69
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
70
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
71
|
-
url: `https://slides-api.getalai.com/api/v1/presentations/${presentationId}/slides`,
|
|
72
|
-
headers: {
|
|
73
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
74
|
-
'Content-Type': 'application/json',
|
|
75
|
-
},
|
|
76
|
-
body,
|
|
77
|
-
});
|
|
78
|
-
return response.body;
|
|
79
|
-
});
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
//# sourceMappingURL=add-slide.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-slide.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-slide.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,yCAA0C;AAC1C,2CAAiD;AAEpC,QAAA,QAAQ,GAAG,IAAA,+BAAY,EAAC;IACnC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,oUAAoU;QACtU,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,cAAc,EAAE,sBAAc;QAC9B,aAAa,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,sBAAsB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxC,WAAW,EAAE,yBAAyB;YACtC,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,gGAAgG;YAC7G,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,eAAe,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACjC,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,IAAI;SACnB,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,cAAc,EAAE,aAAa,EAAE,sBAAsB,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,GACvG,OAAO,CAAC,UAAU,CAAC;YAErB,MAAM,OAAO,GAA4B,EAAE,CAAC;YAC5C,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,OAAO,CAAC,yBAAyB,CAAC,GAAG,sBAAsB,CAAC;YAC9D,CAAC;YACD,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;YAC1F,CAAC;YACD,IAAI,eAAe,EAAE,CAAC;gBACpB,OAAO,CAAC,oBAAoB,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACrD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;YACpC,CAAC;YAED,MAAM,IAAI,GAA4B;gBACpC,aAAa,EAAE,aAAa;gBAC5B,OAAO;gBACP,cAAc,EAAE,CAAC,MAAM,CAAC;aACzB,CAAC;YAEF,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,uDAAuD,cAAc,SAAS;gBACnF,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBACpD,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI;aACL,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const deletePresentation: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>, {
|
|
4
|
-
presentationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=delete-presentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-presentation.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/delete-presentation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;EA6B7B,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deletePresentation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
exports.deletePresentation = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.alaiAuth,
|
|
10
|
-
name: 'deletePresentation',
|
|
11
|
-
displayName: 'Delete Presentation',
|
|
12
|
-
description: 'Delete a presentation by its ID.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Permanently delete an Alai presentation by its ID. Use this to remove a deck the user no longer needs. Destructive but idempotent: once deleted, repeating the call with the same ID leaves the same end state. Requires the presentation ID.',
|
|
16
|
-
idempotent: true,
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
presentationId: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'Presentation ID',
|
|
21
|
-
description: 'The ID of the presentation to delete.',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
run(context) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const { presentationId } = context.propsValue;
|
|
28
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
29
|
-
method: pieces_common_1.HttpMethod.DELETE,
|
|
30
|
-
url: `https://slides-api.getalai.com/api/v1/presentations/${presentationId}`,
|
|
31
|
-
headers: {
|
|
32
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
return response.body;
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=delete-presentation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-presentation.js","sourceRoot":"","sources":["../../../../src/lib/actions/delete-presentation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,yCAA0C;AAE7B,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,kCAAkC;IAC/C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+OAA+O;QACjP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,cAAc,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACjC,WAAW,EAAE,iBAAiB;YAC9B,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,uDAAuD,cAAc,EAAE;gBAC5E,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;iBACrD;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const exportPresentation: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>, {
|
|
4
|
-
presentationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
exportFormats: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, true>;
|
|
6
|
-
waitForCompletion: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
7
|
-
maxWaitTime: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=export-presentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-presentation.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/export-presentation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB;;;;;;;EAwG7B,CAAC"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exportPresentation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
9
|
-
exports.exportPresentation = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.alaiAuth,
|
|
11
|
-
name: 'exportPresentation',
|
|
12
|
-
displayName: 'Export Presentation',
|
|
13
|
-
description: 'Export a presentation in the specified formats.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Export an existing Alai presentation into one or more formats (link, PDF, and/or PPTX) by its presentation ID. Use this to render a deck for download or sharing. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the export finishes (up to Max Wait Time). Not idempotent: each call kicks off a new export job. Requires the presentation ID and at least one export format.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
presentationId: pieces_framework_1.Property.ShortText({
|
|
21
|
-
displayName: 'Presentation ID',
|
|
22
|
-
description: 'The ID of the presentation to export.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
exportFormats: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
26
|
-
displayName: 'Export Formats',
|
|
27
|
-
description: 'Formats to export the presentation in.',
|
|
28
|
-
required: true,
|
|
29
|
-
options: {
|
|
30
|
-
options: [
|
|
31
|
-
{ label: 'Link', value: 'link' },
|
|
32
|
-
{ label: 'PDF', value: 'pdf' },
|
|
33
|
-
{ label: 'PowerPoint (PPTX)', value: 'ppt' },
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
}),
|
|
37
|
-
waitForCompletion: pieces_framework_1.Property.Checkbox({
|
|
38
|
-
displayName: 'Wait for Completion',
|
|
39
|
-
description: 'Wait for the presentation generation to complete before returning.',
|
|
40
|
-
required: false,
|
|
41
|
-
defaultValue: false,
|
|
42
|
-
}),
|
|
43
|
-
maxWaitTime: pieces_framework_1.Property.Number({
|
|
44
|
-
displayName: 'Max Wait Time (seconds)',
|
|
45
|
-
description: 'Maximum time to wait for completion (default 300 seconds / 5 minutes).',
|
|
46
|
-
required: false,
|
|
47
|
-
defaultValue: 300,
|
|
48
|
-
}),
|
|
49
|
-
},
|
|
50
|
-
run(context) {
|
|
51
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
var _a, _b, _c;
|
|
53
|
-
const { presentationId, exportFormats, waitForCompletion, maxWaitTime } = context.propsValue;
|
|
54
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
55
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
56
|
-
url: `https://slides-api.getalai.com/api/v1/presentations/${presentationId}/exports`,
|
|
57
|
-
headers: {
|
|
58
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
59
|
-
'Content-Type': 'application/json',
|
|
60
|
-
},
|
|
61
|
-
body: {
|
|
62
|
-
export_formats: exportFormats,
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
const generationId = (_a = response.body) === null || _a === void 0 ? void 0 : _a.generation_id;
|
|
66
|
-
if (!generationId) {
|
|
67
|
-
throw new Error(`Failed to get generation_id from response: ${JSON.stringify(response.body)}`);
|
|
68
|
-
}
|
|
69
|
-
if (!waitForCompletion) {
|
|
70
|
-
return response.body;
|
|
71
|
-
}
|
|
72
|
-
yield sleep(1000);
|
|
73
|
-
// Poll for completion
|
|
74
|
-
const maxWait = (maxWaitTime || 300) * 1000; // Convert to milliseconds
|
|
75
|
-
const startTime = Date.now();
|
|
76
|
-
const pollInterval = 5000; // Poll every 5 seconds
|
|
77
|
-
while (Date.now() - startTime < maxWait) {
|
|
78
|
-
const statusResponse = yield pieces_common_1.httpClient.sendRequest({
|
|
79
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
80
|
-
url: `https://slides-api.getalai.com/api/v1/generations/${generationId}`,
|
|
81
|
-
headers: {
|
|
82
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
const status = (_b = statusResponse.body) === null || _b === void 0 ? void 0 : _b.status;
|
|
86
|
-
if (status === 'completed') {
|
|
87
|
-
return statusResponse.body;
|
|
88
|
-
}
|
|
89
|
-
else if (status === 'failed') {
|
|
90
|
-
throw new Error(`Generation failed: ${((_c = statusResponse.body) === null || _c === void 0 ? void 0 : _c.error) || 'Unknown error'}`);
|
|
91
|
-
}
|
|
92
|
-
// Wait before polling again
|
|
93
|
-
yield sleep(pollInterval);
|
|
94
|
-
}
|
|
95
|
-
throw new Error(`Generation timed out after ${maxWaitTime || 300} seconds`);
|
|
96
|
-
});
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
//# sourceMappingURL=export-presentation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-presentation.js","sourceRoot":"","sources":["../../../../src/lib/actions/export-presentation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const generatePresentation: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>, {
|
|
4
|
-
inputText: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
|
-
additionalInstructions: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
6
|
-
exportFormats: import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false>;
|
|
7
|
-
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
|
-
themeId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
slideRange: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
tone: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
11
|
-
contentMode: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
12
|
-
amountMode: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
13
|
-
includeAiImages: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
14
|
-
imageStyle: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
15
|
-
waitForCompletion: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
16
|
-
maxWaitTime: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
17
|
-
}>;
|
|
18
|
-
//# sourceMappingURL=generate-presentation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-presentation.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/generate-presentation.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;EAmP/B,CAAC"}
|
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generatePresentation = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
9
|
-
exports.generatePresentation = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.alaiAuth,
|
|
11
|
-
name: 'generatePresentation',
|
|
12
|
-
displayName: 'Generate Presentation',
|
|
13
|
-
description: 'Create a new AI-generated presentation from text.',
|
|
14
|
-
audience: 'both',
|
|
15
|
-
aiMetadata: {
|
|
16
|
-
description: 'Generate a brand-new presentation from input text via the Alai AI API, with optional controls for tone, slide count, text density, theme, and AI images. Use this to turn raw text into slides. By default it returns immediately with a generation_id (poll Get Generation for status); set Wait for Completion to block until the deck finishes (up to Max Wait Time). Not idempotent: each call starts a new generation.',
|
|
17
|
-
idempotent: false,
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
inputText: pieces_framework_1.Property.LongText({
|
|
21
|
-
displayName: 'Input Text',
|
|
22
|
-
description: 'The text content to generate a presentation from.',
|
|
23
|
-
required: true,
|
|
24
|
-
}),
|
|
25
|
-
additionalInstructions: pieces_framework_1.Property.LongText({
|
|
26
|
-
displayName: 'Additional Instructions',
|
|
27
|
-
description: 'Extra instructions for how the presentation should be generated.',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
exportFormats: pieces_framework_1.Property.StaticMultiSelectDropdown({
|
|
31
|
-
displayName: 'Export Formats',
|
|
32
|
-
description: 'Formats to export the presentation in after generation.',
|
|
33
|
-
required: false,
|
|
34
|
-
options: {
|
|
35
|
-
options: [
|
|
36
|
-
{ label: 'Link', value: 'link' },
|
|
37
|
-
{ label: 'PDF', value: 'pdf' },
|
|
38
|
-
{ label: 'PowerPoint (PPTX)', value: 'ppt' },
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
title: pieces_framework_1.Property.ShortText({
|
|
43
|
-
displayName: 'Title',
|
|
44
|
-
description: 'A title for the presentation. If not provided, one will be generated.',
|
|
45
|
-
required: false,
|
|
46
|
-
}),
|
|
47
|
-
themeId: pieces_framework_1.Property.ShortText({
|
|
48
|
-
displayName: 'Theme ID',
|
|
49
|
-
description: 'The ID of the presentation theme to use. If not provided, a default theme will be applied.',
|
|
50
|
-
required: false,
|
|
51
|
-
}),
|
|
52
|
-
slideRange: pieces_framework_1.Property.ShortText({
|
|
53
|
-
displayName: 'Slide Range',
|
|
54
|
-
description: 'Target slide count: auto, 1, 2-5, 6-10, 11-15, 16-20, 21-25, 26-50.',
|
|
55
|
-
required: false,
|
|
56
|
-
}),
|
|
57
|
-
tone: pieces_framework_1.Property.StaticDropdown({
|
|
58
|
-
displayName: 'Tone',
|
|
59
|
-
description: 'The tone of voice for the presentation content.',
|
|
60
|
-
required: false,
|
|
61
|
-
options: {
|
|
62
|
-
options: [
|
|
63
|
-
{ label: 'Default', value: 'DEFAULT' },
|
|
64
|
-
{ label: 'Professional', value: 'PROFESSIONAL' },
|
|
65
|
-
{ label: 'Casual', value: 'CASUAL' },
|
|
66
|
-
{ label: 'Technical', value: 'TECHNICAL' },
|
|
67
|
-
{ label: 'Educational', value: 'EDUCATIONAL' },
|
|
68
|
-
{ label: 'Inspirational', value: 'INSPIRATIONAL' },
|
|
69
|
-
{ label: 'Narrative', value: 'NARRATIVE' },
|
|
70
|
-
{ label: 'Persuasive', value: 'PERSUASIVE' },
|
|
71
|
-
{ label: 'Authoritative', value: 'AUTHORITATIVE' },
|
|
72
|
-
{ label: 'Empathetic', value: 'EMPATHETIC' },
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
}),
|
|
76
|
-
contentMode: pieces_framework_1.Property.StaticDropdown({
|
|
77
|
-
displayName: 'Content Mode',
|
|
78
|
-
description: 'How the input text should be handled.',
|
|
79
|
-
required: false,
|
|
80
|
-
options: {
|
|
81
|
-
options: [
|
|
82
|
-
{ label: 'Preserve', value: 'PRESERVE' },
|
|
83
|
-
{ label: 'Condense', value: 'CONDENSE' },
|
|
84
|
-
{ label: 'Enhance', value: 'ENHANCE' },
|
|
85
|
-
{ label: 'Custom', value: 'CUSTOM' },
|
|
86
|
-
],
|
|
87
|
-
},
|
|
88
|
-
}),
|
|
89
|
-
amountMode: pieces_framework_1.Property.StaticDropdown({
|
|
90
|
-
displayName: 'Text Density',
|
|
91
|
-
description: 'The amount of text to include per slide.',
|
|
92
|
-
required: false,
|
|
93
|
-
options: {
|
|
94
|
-
options: [
|
|
95
|
-
{ label: 'Minimal', value: 'MINIMAL' },
|
|
96
|
-
{ label: 'Essential', value: 'ESSENTIAL' },
|
|
97
|
-
{ label: 'Balanced', value: 'BALANCED' },
|
|
98
|
-
{ label: 'Detailed', value: 'DETAILED' },
|
|
99
|
-
],
|
|
100
|
-
},
|
|
101
|
-
}),
|
|
102
|
-
includeAiImages: pieces_framework_1.Property.Checkbox({
|
|
103
|
-
displayName: 'Include AI Images',
|
|
104
|
-
description: 'Whether to include AI-generated images in the presentation.',
|
|
105
|
-
required: false,
|
|
106
|
-
defaultValue: true,
|
|
107
|
-
}),
|
|
108
|
-
imageStyle: pieces_framework_1.Property.StaticDropdown({
|
|
109
|
-
displayName: 'Image Style',
|
|
110
|
-
description: 'The style for AI-generated images.',
|
|
111
|
-
required: false,
|
|
112
|
-
options: {
|
|
113
|
-
options: [
|
|
114
|
-
{ label: 'Auto', value: 'auto' },
|
|
115
|
-
{ label: 'Realistic', value: 'realistic' },
|
|
116
|
-
{ label: 'Artistic', value: 'artistic' },
|
|
117
|
-
{ label: 'Cartoon', value: 'cartoon' },
|
|
118
|
-
{ label: '3D', value: 'three_d' },
|
|
119
|
-
],
|
|
120
|
-
},
|
|
121
|
-
}),
|
|
122
|
-
waitForCompletion: pieces_framework_1.Property.Checkbox({
|
|
123
|
-
displayName: 'Wait for Completion',
|
|
124
|
-
description: 'Wait for the presentation generation to complete before returning.',
|
|
125
|
-
required: false,
|
|
126
|
-
defaultValue: false,
|
|
127
|
-
}),
|
|
128
|
-
maxWaitTime: pieces_framework_1.Property.Number({
|
|
129
|
-
displayName: 'Max Wait Time (seconds)',
|
|
130
|
-
description: 'Maximum time to wait for completion (default 300 seconds / 5 minutes).',
|
|
131
|
-
required: false,
|
|
132
|
-
defaultValue: 300,
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
135
|
-
run(context) {
|
|
136
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
var _a, _b, _c;
|
|
138
|
-
const { inputText, additionalInstructions, exportFormats, title, themeId, slideRange, tone, contentMode, amountMode, includeAiImages, imageStyle, waitForCompletion, maxWaitTime, } = context.propsValue;
|
|
139
|
-
const body = {
|
|
140
|
-
input_text: inputText,
|
|
141
|
-
};
|
|
142
|
-
if (additionalInstructions)
|
|
143
|
-
body['additional_instructions'] = additionalInstructions;
|
|
144
|
-
if (exportFormats && exportFormats.length > 0)
|
|
145
|
-
body['export_formats'] = exportFormats;
|
|
146
|
-
else
|
|
147
|
-
body['export_formats'] = ['link'];
|
|
148
|
-
const presentationOptions = {};
|
|
149
|
-
if (title)
|
|
150
|
-
presentationOptions['title'] = title;
|
|
151
|
-
if (themeId)
|
|
152
|
-
presentationOptions['theme_id'] = themeId;
|
|
153
|
-
if (slideRange)
|
|
154
|
-
presentationOptions['slide_range'] = slideRange;
|
|
155
|
-
if (Object.keys(presentationOptions).length > 0) {
|
|
156
|
-
body['presentation_options'] = presentationOptions;
|
|
157
|
-
}
|
|
158
|
-
const textOptions = {};
|
|
159
|
-
if (tone)
|
|
160
|
-
textOptions['tone'] = tone;
|
|
161
|
-
if (contentMode)
|
|
162
|
-
textOptions['content_mode'] = contentMode;
|
|
163
|
-
if (amountMode)
|
|
164
|
-
textOptions['amount_mode'] = amountMode;
|
|
165
|
-
if (Object.keys(textOptions).length > 0) {
|
|
166
|
-
body['text_options'] = textOptions;
|
|
167
|
-
}
|
|
168
|
-
const imageOptions = {};
|
|
169
|
-
if (includeAiImages !== undefined && includeAiImages !== null) {
|
|
170
|
-
imageOptions['include_ai_images'] = includeAiImages;
|
|
171
|
-
}
|
|
172
|
-
if (imageStyle)
|
|
173
|
-
imageOptions['style'] = imageStyle;
|
|
174
|
-
if (Object.keys(imageOptions).length > 0) {
|
|
175
|
-
body['image_options'] = imageOptions;
|
|
176
|
-
}
|
|
177
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
178
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
179
|
-
url: 'https://slides-api.getalai.com/api/v1/generations',
|
|
180
|
-
headers: {
|
|
181
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
182
|
-
'Content-Type': 'application/json',
|
|
183
|
-
},
|
|
184
|
-
body,
|
|
185
|
-
});
|
|
186
|
-
const generationId = (_a = response.body) === null || _a === void 0 ? void 0 : _a.generation_id;
|
|
187
|
-
if (!generationId) {
|
|
188
|
-
throw new Error(`Failed to get generation_id from response: ${JSON.stringify(response.body)}`);
|
|
189
|
-
}
|
|
190
|
-
if (!waitForCompletion) {
|
|
191
|
-
return response.body;
|
|
192
|
-
}
|
|
193
|
-
// Wait a bit before polling to ensure the generation is indexed in the database
|
|
194
|
-
yield sleep(1000);
|
|
195
|
-
// Poll for completion
|
|
196
|
-
const maxWait = (maxWaitTime || 300) * 1000; // Convert to milliseconds
|
|
197
|
-
const startTime = Date.now();
|
|
198
|
-
const pollInterval = 5000; // Poll every 5 seconds
|
|
199
|
-
while (Date.now() - startTime < maxWait) {
|
|
200
|
-
const statusResponse = yield pieces_common_1.httpClient.sendRequest({
|
|
201
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
202
|
-
url: `https://slides-api.getalai.com/api/v1/generations/${generationId}`,
|
|
203
|
-
headers: {
|
|
204
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
205
|
-
},
|
|
206
|
-
});
|
|
207
|
-
const status = (_b = statusResponse.body) === null || _b === void 0 ? void 0 : _b.status;
|
|
208
|
-
if (status === 'completed') {
|
|
209
|
-
return statusResponse.body;
|
|
210
|
-
}
|
|
211
|
-
else if (status === 'failed') {
|
|
212
|
-
throw new Error(`Generation failed: ${((_c = statusResponse.body) === null || _c === void 0 ? void 0 : _c.error) || 'Unknown error'}`);
|
|
213
|
-
}
|
|
214
|
-
// Wait before polling again
|
|
215
|
-
yield sleep(pollInterval);
|
|
216
|
-
}
|
|
217
|
-
throw new Error(`Generation timed out after ${maxWaitTime || 300} seconds`);
|
|
218
|
-
});
|
|
219
|
-
},
|
|
220
|
-
});
|
|
221
|
-
//# sourceMappingURL=generate-presentation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-presentation.js","sourceRoot":"","sources":["../../../../src/lib/actions/generate-presentation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const getGeneration: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>, {
|
|
4
|
-
generationId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
5
|
-
}>;
|
|
6
|
-
//# sourceMappingURL=get-generation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-generation.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-generation.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;EA8BxB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGeneration = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const auth_1 = require("../common/auth");
|
|
8
|
-
exports.getGeneration = (0, pieces_framework_1.createAction)({
|
|
9
|
-
auth: auth_1.alaiAuth,
|
|
10
|
-
name: 'getGeneration',
|
|
11
|
-
displayName: 'Get Generation',
|
|
12
|
-
description: 'Fetch the status and result of a generation job.',
|
|
13
|
-
audience: 'both',
|
|
14
|
-
aiMetadata: {
|
|
15
|
-
description: 'Look up the current status and result of an Alai generation job by its generation_id (returned by Generate Presentation or Export Presentation). Use this to poll for completion or retrieve the finished output and export links. Read-only and idempotent. Requires a valid generation_id.',
|
|
16
|
-
idempotent: true,
|
|
17
|
-
},
|
|
18
|
-
props: {
|
|
19
|
-
generationId: pieces_framework_1.Property.ShortText({
|
|
20
|
-
displayName: 'Generation ID',
|
|
21
|
-
description: 'The ID of the generation job (from the "Generate Presentation" action).',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
run(context) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const { generationId } = context.propsValue;
|
|
28
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
29
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
30
|
-
url: `https://slides-api.getalai.com/api/v1/generations/${generationId}`,
|
|
31
|
-
headers: {
|
|
32
|
-
Authorization: `Bearer ${context.auth.props.apiKey}`,
|
|
33
|
-
Accept: 'application/json',
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
return response.body;
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
//# sourceMappingURL=get-generation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-generation.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-generation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,yCAA0C;AAE7B,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,eAAQ;IACd,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,8RAA8R;QAChS,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,yEAAyE;YACtF,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5C,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,qDAAqD,YAAY,EAAE;gBACxE,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;oBACpD,MAAM,EAAE,kBAAkB;iBAC3B;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
package/src/lib/common/auth.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,QAAQ;;EA8BnB,CAAC"}
|
package/src/lib/common/auth.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.alaiAuth = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
7
|
-
const markdownDescription = `
|
|
8
|
-
Follow these steps to get your Alai API Key:
|
|
9
|
-
|
|
10
|
-
1. Go to [**https://getalai.com/api**](https://getalai.com/api) and sign up or log in.
|
|
11
|
-
2. Navigate to the **API Keys** section.
|
|
12
|
-
3. Click **Create API Key** and give it a name (e.g., "Activepieces").
|
|
13
|
-
4. Copy the key and paste it below.
|
|
14
|
-
`;
|
|
15
|
-
exports.alaiAuth = pieces_framework_1.PieceAuth.CustomAuth({
|
|
16
|
-
description: markdownDescription,
|
|
17
|
-
required: true,
|
|
18
|
-
props: {
|
|
19
|
-
apiKey: pieces_framework_1.PieceAuth.SecretText({
|
|
20
|
-
displayName: 'API Key',
|
|
21
|
-
description: 'Paste your API key here.',
|
|
22
|
-
required: true,
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
25
|
-
validate(auth) {
|
|
26
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const apiKey = auth.auth.apiKey;
|
|
28
|
-
try {
|
|
29
|
-
yield pieces_common_1.httpClient.sendRequest({
|
|
30
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
31
|
-
url: 'https://slides-api.getalai.com/api/v1/ping',
|
|
32
|
-
headers: {
|
|
33
|
-
Authorization: `Bearer ${apiKey}`,
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
return { valid: true };
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
if (e instanceof pieces_common_1.HttpError) {
|
|
40
|
-
if (e.response.status === 401) {
|
|
41
|
-
return { valid: false, error: 'Invalid API Key' };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return { valid: false, error: 'Failed to connect to Alai API' };
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAgF;AAEhF,MAAM,mBAAmB,GAAG;;;;;;;CAO3B,CAAC;AAEW,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,WAAW,EAAE,mBAAmB;IAChC,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACL,MAAM,EAAE,4BAAS,CAAC,UAAU,CAAC;YAC3B,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,0BAA0B;YACvC,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,QAAQ,CAAC,IAAI;;YACjB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;YAChC,IAAI,CAAC;gBACH,MAAM,0BAAU,CAAC,WAAW,CAAC;oBAC3B,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,GAAG,EAAE,4CAA4C;oBACjD,OAAO,EAAE;wBACP,aAAa,EAAE,UAAU,MAAM,EAAE;qBAClC;iBACF,CAAC,CAAC;gBACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;YACzB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,YAAY,yBAAS,EAAE,CAAC;oBAC3B,IAAI,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;wBAC9B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;oBACpD,CAAC;gBACH,CAAC;gBACD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,+BAA+B,EAAE,CAAC;YAClE,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const presentationId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
2
|
-
apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
3
|
-
}>>;
|
|
4
|
-
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;GA2BzB,CAAC"}
|
package/src/lib/common/props.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.presentationId = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
|
-
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
7
|
-
const auth_1 = require("./auth");
|
|
8
|
-
exports.presentationId = pieces_framework_1.Property.Dropdown({
|
|
9
|
-
auth: auth_1.alaiAuth,
|
|
10
|
-
displayName: 'Presentation',
|
|
11
|
-
description: 'Select a presentation',
|
|
12
|
-
required: true,
|
|
13
|
-
refreshers: [],
|
|
14
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
15
|
-
var _b;
|
|
16
|
-
if (!auth)
|
|
17
|
-
return { options: [] };
|
|
18
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
19
|
-
method: pieces_common_1.HttpMethod.GET,
|
|
20
|
-
url: 'https://slides-api.getalai.com/api/v1/presentations',
|
|
21
|
-
headers: {
|
|
22
|
-
Authorization: `Bearer ${auth.props.apiKey}`,
|
|
23
|
-
Accept: 'application/json',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
const presentations = ((_b = response.body) === null || _b === void 0 ? void 0 : _b.presentations) || [];
|
|
27
|
-
return {
|
|
28
|
-
disabled: presentations.length === 0,
|
|
29
|
-
options: presentations.map((presentation) => ({
|
|
30
|
-
label: presentation.title,
|
|
31
|
-
value: presentation.presentation_id,
|
|
32
|
-
})),
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=props.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":";;;;AAAA,+DAAqE;AACrE,qEAA0D;AAC1D,iCAAkC;AAErB,QAAA,cAAc,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAC9C,IAAI,EAAE,eAAQ;IACd,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,uBAAuB;IACpC,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACtB,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;QAClC,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;YAC5C,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,qDAAqD;YAC1D,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBAC5C,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QACH,MAAM,aAAa,GAAG,CAAA,MAAA,QAAQ,CAAC,IAAI,0CAAE,aAAa,KAAI,EAAE,CAAC;QACzD,OAAO;YACL,QAAQ,EAAE,aAAa,CAAC,MAAM,KAAK,CAAC;YACpC,OAAO,EAAE,aAAa,CAAC,GAAG,CACxB,CAAC,YAAwD,EAAE,EAAE,CAAC,CAAC;gBAC7D,KAAK,EAAE,YAAY,CAAC,KAAK;gBACzB,KAAK,EAAE,YAAY,CAAC,eAAe;aACpC,CAAC,CACH;SACF,CAAC;IACJ,CAAC,CAAA;CACF,CAAC,CAAC"}
|