@activepieces/piece-descript 0.0.2 → 0.0.4
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 +14 -44
- 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/agent-edit.d.ts +0 -11
- package/src/lib/actions/agent-edit.d.ts.map +0 -1
- package/src/lib/actions/agent-edit.js +0 -130
- package/src/lib/actions/agent-edit.js.map +0 -1
- package/src/lib/actions/get-job-status.d.ts +0 -4
- package/src/lib/actions/get-job-status.d.ts.map +0 -1
- package/src/lib/actions/get-job-status.js +0 -32
- package/src/lib/actions/get-job-status.js.map +0 -1
- package/src/lib/actions/get-project.d.ts +0 -4
- package/src/lib/actions/get-project.d.ts.map +0 -1
- package/src/lib/actions/get-project.js +0 -28
- package/src/lib/actions/get-project.js.map +0 -1
- package/src/lib/actions/import-media.d.ts +0 -15
- package/src/lib/actions/import-media.d.ts.map +0 -1
- package/src/lib/actions/import-media.js +0 -157
- package/src/lib/actions/import-media.js.map +0 -1
- package/src/lib/actions/list-projects.d.ts +0 -11
- package/src/lib/actions/list-projects.d.ts.map +0 -1
- package/src/lib/actions/list-projects.js +0 -121
- package/src/lib/actions/list-projects.js.map +0 -1
- package/src/lib/actions/publish-project.d.ts +0 -9
- package/src/lib/actions/publish-project.d.ts.map +0 -1
- package/src/lib/actions/publish-project.js +0 -87
- package/src/lib/actions/publish-project.js.map +0 -1
- package/src/lib/auth.d.ts +0 -4
- package/src/lib/auth.d.ts.map +0 -1
- package/src/lib/auth.js +0 -41
- package/src/lib/auth.js.map +0 -1
- package/src/lib/common/index.d.ts +0 -26
- package/src/lib/common/index.d.ts.map +0 -1
- package/src/lib/common/index.js +0 -121
- package/src/lib/common/index.js.map +0 -1
- package/src/lib/triggers/job-completed.d.ts +0 -11
- package/src/lib/triggers/job-completed.d.ts.map +0 -1
- package/src/lib/triggers/job-completed.js +0 -109
- package/src/lib/triggers/job-completed.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/piece-descript",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"@activepieces/pieces-common": "0.12.3",
|
|
12
|
-
"@activepieces/pieces-framework": "0.29.0",
|
|
13
|
-
"@activepieces/shared": "0.82.0",
|
|
14
|
-
"tslib": "2.6.2"
|
|
15
|
-
}
|
|
5
|
+
"dependencies": {},
|
|
6
|
+
"files": [
|
|
7
|
+
"src/index.js",
|
|
8
|
+
"package.json",
|
|
9
|
+
"src/i18n"
|
|
10
|
+
]
|
|
16
11
|
}
|
package/src/index.js
CHANGED
|
@@ -1,44 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Object.defineProperty(exports, "descriptAuth", { enumerable: true, get: function () { return auth_1.descriptAuth; } });
|
|
16
|
-
const job_completed_1 = require("./lib/triggers/job-completed");
|
|
17
|
-
exports.descript = (0, pieces_framework_1.createPiece)({
|
|
18
|
-
displayName: 'Descript',
|
|
19
|
-
description: 'AI-powered video and podcast editor. Import media, run AI edits with Underlord, and publish.',
|
|
20
|
-
minimumSupportedRelease: '0.82.1',
|
|
21
|
-
logoUrl: 'https://cdn.activepieces.com/pieces/descript.png',
|
|
22
|
-
categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
|
|
23
|
-
auth: auth_1.descriptAuth,
|
|
24
|
-
authors: ['hugh-codes', 'onyedikachi-david'],
|
|
25
|
-
actions: [
|
|
26
|
-
import_media_1.descriptImportMediaAction,
|
|
27
|
-
agent_edit_1.descriptAgentEditAction,
|
|
28
|
-
publish_project_1.descriptPublishProjectAction,
|
|
29
|
-
get_job_status_1.descriptGetJobStatusAction,
|
|
30
|
-
list_projects_1.descriptListProjectsAction,
|
|
31
|
-
get_project_1.descriptGetProjectAction,
|
|
32
|
-
(0, pieces_common_1.createCustomApiCallAction)({
|
|
33
|
-
baseUrl: () => 'https://descriptapi.com/v1',
|
|
34
|
-
auth: auth_1.descriptAuth,
|
|
35
|
-
authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
return ({
|
|
37
|
-
Authorization: `Bearer ${(0, auth_1.getAuthToken)(auth)}`,
|
|
38
|
-
});
|
|
39
|
-
}),
|
|
40
|
-
}),
|
|
41
|
-
],
|
|
42
|
-
triggers: [job_completed_1.descriptJobCompletedTrigger],
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";var qs=Object.create;var Ye=Object.defineProperty;var Gs=Object.getOwnPropertyDescriptor;var Js=Object.getOwnPropertyNames;var Ks=Object.getPrototypeOf,Xs=Object.prototype.hasOwnProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var $=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Js(t))!Xs.call(e,i)&&i!==r&&Ye(e,i,{get:()=>t[i],enumerable:!(n=Gs(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?qs(Ks(e)):{},yn(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e)),Ys=e=>yn(Ye({},"__esModule",{value:!0}),e);var No=$((Ro,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let h=0,m=-1,_=(s.match(p.zoneIndex)||[])[0],P,M;for(_&&(_=_.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)h++;if(s.substr(0,2)==="::"&&h--,s.substr(-2,2)==="::"&&h--,h>d)return null;for(M=d-h,P=":";M--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=function(){let ne=s.split(":"),se=[];for(let Xe=0;Xe<ne.length;Xe++)se.push(parseInt(ne[Xe],16));return se}(),{parts:d,zoneId:_}}o(f,"expandIPv6");function g(s,d,h,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let _=0,P;for(;m>0;){if(P=h-m,P<0&&(P=0),s[_]>>P!==d[_]>>P)return!1;m-=h,_+=1}return!0}o(g,"matchCIDR");function y(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(y,"parseIntAuto");function b(s,d){for(;s.length<d;)s=`0${s}`;return s}o(b,"padPart");let x={};x.IPv4=function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let h,m;for(h=0;h<d.length;h++)if(m=d[h],!(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,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},_,P,M;for(_=3;_>=0;_-=1)if(P=this.octets[_],P in m){if(M=m[P],h&&M!==0)return null;M!==8&&(h=!0),d+=M}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<4;)_.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,h,m,_,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],h=0;h<4;)_.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(_)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let h=parseInt(d[2]);if(h>=0&&h<=32){let m=[this.parse(d[1]),h];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,h,m;if(d=s.match(r.fourOctet))return function(){let _=d.slice(1,6),P=[];for(let M=0;M<_.length;M++)h=_[M],P.push(y(h));return P}();if(d=s.match(r.longValue)){if(m=y(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let _=[],P;for(P=0;P<=24;P+=8)_.push(m>>P&255);return _}().reverse()}else return(d=s.match(r.twoOctet))?function(){let _=d.slice(1,4),P=[];if(m=y(_[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(_[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(d=s.match(r.threeOctet))?function(){let _=d.slice(1,5),P=[];if(m=y(_[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(y(_[0])),P.push(y(_[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=function(){function s(d,h){let m,_;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(_=this.parts[m],!(0<=_&&_<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");h&&(this.zoneId=h)}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,h){let m;if(h===void 0&&(m=d,d=m[0],h=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,h)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,h=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},_,P;for(let M=7;M>=0;M-=1)if(_=this.parts[M],_ in m){if(P=m[_],h&&P!==0)return null;P!==16&&(h=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,h=[],m=this.parts;for(let _=0;_<m.length;_++)d=m[_],h.push(d>>8),h.push(d&255);return h},s.prototype.toFixedLengthString=function(){let d=function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(b(this.parts[_].toString(16),4));return m}.call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},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),h=d[0],m=d[1];return new x.IPv4([h>>8,h&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=function(){let m=[];for(let _=0;_<this.parts.length;_++)m.push(this.parts[_].toString(16));return m}.call(this).join(":"),h="";return this.zoneId&&(h=`%${this.zoneId}`),d+h},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,h=this.toNormalizedString(),m=0,_=-1,P;for(;P=d.exec(h);)P[0].length>_&&(m=P.index,_=P[0].length);return _<0?h:`${h.substring(0,m)}::${h.substring(m+_)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),h=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],P=0;for(;P<16;)_.push(parseInt(h[P],10)|parseInt(m[P],10)^255),P++;return new this(_)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,h,m,_,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),_=[],h=0;h<16;)_.push(parseInt(m[h],10)&parseInt(P[h],10)),h++;return new this(_)}catch(M){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${M})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,h,m;if((h=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(h[2]),d>=0&&d<=128))return m=[this.parse(h[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,h,m,_,P,M;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(M=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+M,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],h=0;h<P.length;h++)if(_=P[h],!(0<=_&&_<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(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],h=0,m=Math.floor(s/8);for(;h<m;)d[h]=255,h++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,h){let m,_,P,M;h==null&&(h="unicast");for(_ in d)if(Object.prototype.hasOwnProperty.call(d,_)){for(P=d[_],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(M=P[m],s.kind()===M[0].kind()&&s.match.apply(s,M))return _}return h},typeof Ft<"u"&&Ft.exports?Ft.exports=x:e.ipaddr=x})(Ro)});var ki=$((nA,wi)=>{var zi=require("stream").Stream,Sp=require("util");wi.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");Sp.inherits(ce,zi);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=zi.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ce.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Di=$((iA,Ni)=>{var Ap=require("util"),Ri=require("stream").Stream,Oi=ki();Ni.exports=J;function J(){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(J,"CombinedStream");Ap.inherits(J,Ri);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Oi)){var r=Oi.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};J.prototype.pipe=function(e,t){return Ri.prototype.pipe.call(this,e,t),this.resume(),e};J.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}};J.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=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.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()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.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")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.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)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ui=$((sA,Ci)=>{"use strict";Ci.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 Li=$(re=>{"use strict";var qt=Ui(),zp=require("path").extname,ji=/^\s*([^;\s]*)(?:;|\s|$)/,wp=/^text\//i;re.charset=Mi;re.charsets={lookup:Mi};re.contentType=kp;re.extension=Op;re.extensions=Object.create(null);re.lookup=Rp;re.types=Object.create(null);Np(re.extensions,re.types);function Mi(e){if(!e||typeof e!="string")return!1;var t=ji.exec(e),r=t&&qt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&wp.test(t[1])?"UTF-8":!1}o(Mi,"charset");function kp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?re.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=re.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(kp,"contentType");function Op(e){if(!e||typeof e!="string")return!1;var t=ji.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Op,"extension");function Rp(e){if(!e||typeof e!="string")return!1;var t=zp("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(Rp,"lookup");function Np(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(qt).forEach(o(function(i){var u=qt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(qt[t[f]].source),y=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>y||g===y&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Np,"populateMaps")});var Bi=$((pA,Fi)=>{Fi.exports=Dp;function Dp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Dp,"defer")});var Vr=$((dA,Zi)=>{var Vi=Bi();Zi.exports=Cp;function Cp(e){var t=!1;return Vi(function(){t=!0}),o(function(n,i){t?e(n,i):Vi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Cp,"async")});var Zr=$((fA,Hi)=>{Hi.exports=Up;function Up(e){Object.keys(e.jobs).forEach(jp.bind(e)),e.jobs={}}o(Up,"abort");function jp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(jp,"clean")});var Hr=$((yA,qi)=>{var Wi=Vr(),Mp=Zr();qi.exports=Lp;function Lp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Fp(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Mp(r):r.results[i]=c,n(u,r.results))})}o(Lp,"iterate");function Fp(e,t,r,n){var i;return e.length==2?i=e(r,Wi(n)):i=e(r,t,Wi(n)),i}o(Fp,"runJob")});var Wr=$((vA,Gi)=>{Gi.exports=Bp;function Bp(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(Bp,"state")});var qr=$((_A,Ji)=>{var Vp=Zr(),Zp=Vr();Ji.exports=Hp;function Hp(e){Object.keys(this.jobs).length&&(this.index=this.size,Vp(this),Zp(e)(null,this.results))}o(Hp,"terminator")});var Xi=$((bA,Ki)=>{var Wp=Hr(),qp=Wr(),Gp=qr();Ki.exports=Jp;function Jp(e,t,r){for(var n=qp(e);n.index<(n.keyedList||e).length;)Wp(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 Gp.bind(n,r)}o(Jp,"parallel")});var Gr=$((TA,Gt)=>{var Yi=Hr(),Kp=Wr(),Xp=qr();Gt.exports=Yp;Gt.exports.ascending=Qi;Gt.exports.descending=Qp;function Yp(e,t,r,n){var i=Kp(e,r);return Yi(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){Yi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Xp.bind(i,n)}o(Yp,"serialOrdered");function Qi(e,t){return e<t?-1:e>t?1:0}o(Qi,"ascending");function Qp(e,t){return-1*Qi(e,t)}o(Qp,"descending")});var ta=$(($A,ea)=>{var el=Gr();ea.exports=tl;function tl(e,t,r){return el(e,t,null,r)}o(tl,"serial")});var na=$((AA,ra)=>{ra.exports={parallel:Xi(),serial:ta(),serialOrdered:Gr()}});var Jr=$((zA,oa)=>{"use strict";oa.exports=Object});var aa=$((wA,ia)=>{"use strict";ia.exports=Error});var ua=$((kA,sa)=>{"use strict";sa.exports=EvalError});var pa=$((OA,ca)=>{"use strict";ca.exports=RangeError});var da=$((RA,la)=>{"use strict";la.exports=ReferenceError});var fa=$((NA,ma)=>{"use strict";ma.exports=SyntaxError});var Jt=$((DA,ga)=>{"use strict";ga.exports=TypeError});var ha=$((CA,ya)=>{"use strict";ya.exports=URIError});var xa=$((UA,va)=>{"use strict";va.exports=Math.abs});var Pa=$((jA,_a)=>{"use strict";_a.exports=Math.floor});var Ia=$((MA,ba)=>{"use strict";ba.exports=Math.max});var Ea=$((LA,Ta)=>{"use strict";Ta.exports=Math.min});var Sa=$((FA,$a)=>{"use strict";$a.exports=Math.pow});var za=$((BA,Aa)=>{"use strict";Aa.exports=Math.round});var ka=$((VA,wa)=>{"use strict";wa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ra=$((HA,Oa)=>{"use strict";var rl=ka();Oa.exports=o(function(t){return rl(t)||t===0?t:t<0?-1:1},"sign")});var Da=$((qA,Na)=>{"use strict";Na.exports=Object.getOwnPropertyDescriptor});var Kr=$((GA,Ca)=>{"use strict";var Kt=Da();if(Kt)try{Kt([],"length")}catch{Kt=null}Ca.exports=Kt});var ja=$((JA,Ua)=>{"use strict";var Xt=Object.defineProperty||!1;if(Xt)try{Xt({},"a",{value:1})}catch{Xt=!1}Ua.exports=Xt});var Xr=$((KA,Ma)=>{"use strict";Ma.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ba=$((YA,Fa)=>{"use strict";var La=typeof Symbol<"u"&&Symbol,nl=Xr();Fa.exports=o(function(){return typeof La!="function"||typeof Symbol!="function"||typeof La("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:nl()},"hasNativeSymbols")});var Yr=$((ez,Va)=>{"use strict";Va.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Qr=$((tz,Za)=>{"use strict";var ol=Jr();Za.exports=ol.getPrototypeOf||null});var qa=$((rz,Wa)=>{"use strict";var il="Function.prototype.bind called on incompatible ",al=Object.prototype.toString,sl=Math.max,ul="[object Function]",Ha=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"),cl=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"),pl=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");Wa.exports=o(function(t){var r=this;if(typeof r!="function"||al.apply(r)!==ul)throw new TypeError(il+r);for(var n=cl(arguments,1),i,u=o(function(){if(this instanceof i){var y=r.apply(this,Ha(n,arguments));return Object(y)===y?y:this}return r.apply(t,Ha(n,arguments))},"binder"),c=sl(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+pl(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var We=$((oz,Ga)=>{"use strict";var ll=qa();Ga.exports=Function.prototype.bind||ll});var Yt=$((iz,Ja)=>{"use strict";Ja.exports=Function.prototype.call});var en=$((az,Ka)=>{"use strict";Ka.exports=Function.prototype.apply});var Ya=$((sz,Xa)=>{"use strict";Xa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var es=$((uz,Qa)=>{"use strict";var dl=We(),ml=en(),fl=Yt(),gl=Ya();Qa.exports=gl||dl.call(fl,ml)});var rs=$((cz,ts)=>{"use strict";var yl=We(),hl=Jt(),vl=Yt(),xl=es();ts.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new hl("a function is required");return xl(yl,vl,t)},"callBindBasic")});var us=$((lz,ss)=>{"use strict";var _l=rs(),ns=Kr(),is;try{is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var tn=!!is&&ns&&ns(Object.prototype,"__proto__"),as=Object,os=as.getPrototypeOf;ss.exports=tn&&typeof tn.get=="function"?_l([tn.get]):typeof os=="function"?o(function(t){return os(t==null?t:as(t))},"getDunder"):!1});var ms=$((mz,ds)=>{"use strict";var cs=Yr(),ps=Qr(),ls=us();ds.exports=cs?o(function(t){return cs(t)},"getProto"):ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ps(t)},"getProto"):ls?o(function(t){return ls(t)},"getProto"):null});var rn=$((gz,fs)=>{"use strict";var Pl=Function.prototype.call,bl=Object.prototype.hasOwnProperty,Il=We();fs.exports=Il.call(Pl,bl)});var Ps=$((yz,_s)=>{"use strict";var j,Tl=Jr(),El=aa(),$l=ua(),Sl=pa(),Al=da(),Ke=fa(),Je=Jt(),zl=ha(),wl=xa(),kl=Pa(),Ol=Ia(),Rl=Ea(),Nl=Sa(),Dl=za(),Cl=Ra(),vs=Function,nn=o(function(e){try{return vs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=Kr(),Ul=ja(),on=o(function(){throw new Je},"throwTypeError"),jl=xt?function(){try{return arguments.callee,on}catch{try{return xt(arguments,"callee").get}catch{return on}}}():on,qe=Ba()(),Y=ms(),Ml=Qr(),Ll=Yr(),xs=en(),_t=Yt(),Ge={},Fl=typeof Uint8Array>"u"||!Y?j:Y(Uint8Array),ke={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?j:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?j:ArrayBuffer,"%ArrayIteratorPrototype%":qe&&Y?Y([][Symbol.iterator]()):j,"%AsyncFromSyncIteratorPrototype%":j,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?j:Atomics,"%BigInt%":typeof BigInt>"u"?j:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?j:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?j:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?j:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":El,"%eval%":eval,"%EvalError%":$l,"%Float16Array%":typeof Float16Array>"u"?j:Float16Array,"%Float32Array%":typeof Float32Array>"u"?j:Float32Array,"%Float64Array%":typeof Float64Array>"u"?j:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?j:FinalizationRegistry,"%Function%":vs,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?j:Int8Array,"%Int16Array%":typeof Int16Array>"u"?j:Int16Array,"%Int32Array%":typeof Int32Array>"u"?j:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":qe&&Y?Y(Y([][Symbol.iterator]())):j,"%JSON%":typeof JSON=="object"?JSON:j,"%Map%":typeof Map>"u"?j:Map,"%MapIteratorPrototype%":typeof Map>"u"||!qe||!Y?j:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Tl,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?j:Promise,"%Proxy%":typeof Proxy>"u"?j:Proxy,"%RangeError%":Sl,"%ReferenceError%":Al,"%Reflect%":typeof Reflect>"u"?j:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?j:Set,"%SetIteratorPrototype%":typeof Set>"u"||!qe||!Y?j:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?j:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":qe&&Y?Y(""[Symbol.iterator]()):j,"%Symbol%":qe?Symbol:j,"%SyntaxError%":Ke,"%ThrowTypeError%":jl,"%TypedArray%":Fl,"%TypeError%":Je,"%Uint8Array%":typeof Uint8Array>"u"?j:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?j:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?j:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?j:Uint32Array,"%URIError%":zl,"%WeakMap%":typeof WeakMap>"u"?j:WeakMap,"%WeakRef%":typeof WeakRef>"u"?j:WeakRef,"%WeakSet%":typeof WeakSet>"u"?j:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":xs,"%Object.defineProperty%":Ul,"%Object.getPrototypeOf%":Ml,"%Math.abs%":wl,"%Math.floor%":kl,"%Math.max%":Ol,"%Math.min%":Rl,"%Math.pow%":Nl,"%Math.round%":Dl,"%Math.sign%":Cl,"%Reflect.getPrototypeOf%":Ll};if(Y)try{null.error}catch(e){gs=Y(Y(e)),ke["%Error.prototype%"]=gs}var gs,Bl=o(function e(t){var r;if(t==="%AsyncFunction%")r=nn("async function () {}");else if(t==="%GeneratorFunction%")r=nn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=nn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return ke[t]=r,r},"doEval"),ys={__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=We(),Qt=rn(),Vl=Pt.call(_t,Array.prototype.concat),Zl=Pt.call(xs,Array.prototype.splice),hs=Pt.call(_t,String.prototype.replace),er=Pt.call(_t,String.prototype.slice),Hl=Pt.call(_t,RegExp.prototype.exec),Wl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ql=/\\(\\)?/g,Gl=o(function(t){var r=er(t,0,1),n=er(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return hs(t,Wl,function(u,c,p,f){i[i.length]=p?hs(f,ql,"$1"):c||u}),i},"stringToPath"),Jl=o(function(t,r){var n=t,i;if(Qt(ys,n)&&(i=ys[n],n="%"+i[0]+"%"),Qt(ke,n)){var u=ke[n];if(u===Ge&&(u=Bl(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");_s.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(Hl(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Gl(t),i=n.length>0?n[0]:"",u=Jl("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],Zl(n,Vl([0,1],g)));for(var y=1,b=!0;y<n.length;y+=1){var x=n[y],s=er(x,0,1),d=er(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((x==="constructor"||!b)&&(f=!0),i+="."+x,c="%"+i+"%",Qt(ke,c))p=ke[c];else if(p!=null){if(!(x in p)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&y+1>=n.length){var h=xt(p,x);b=!!h,b&&"get"in h&&!("originalValue"in h.get)?p=h.get:p=p[x]}else b=Qt(p,x),p=p[x];b&&!f&&(ke[c]=p)}}return p},"GetIntrinsic")});var Is=$((vz,bs)=>{"use strict";var Kl=Xr();bs.exports=o(function(){return Kl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var $s=$((_z,Es)=>{"use strict";var Xl=Ps(),Ts=Xl("%Object.defineProperty%",!0),Yl=Is()(),Ql=rn(),ed=Jt(),tr=Yl?Symbol.toStringTag:null;Es.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 ed("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");tr&&(n||!Ql(t,tr))&&(Ts?Ts(t,tr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[tr]=r)},"setToStringTag")});var As=$((bz,Ss)=>{"use strict";var td=Function.prototype.call,rd=Object.prototype.hasOwnProperty,nd=We();Ss.exports=nd.call(td,rd)});var ws=$((Iz,zs)=>{"use strict";zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Rs=$((Tz,Os)=>{"use strict";var cn=Di(),od=require("util"),an=require("path"),id=require("http"),ad=require("https"),sd=require("url").parse,ud=require("fs"),cd=require("stream").Stream,pd=require("crypto"),sn=Li(),ld=na(),dd=$s(),$e=As(),un=ws();function ks(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(ks,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");od.inherits(L,cn);L.LINE_BREAK=`\r
|
|
2
|
+
`;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof cd))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ud.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.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="'+ks(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&un(c,r.header);var p;for(var f in c)if($e(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=an.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=an.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=an.basename(e.client._httpMessage.path||"")),r)return'filename="'+ks(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=sn.lookup(e.name)),!r&&e&&e.path&&(r=sn.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=sn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+pd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}ld.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=sd(e),n=un({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=un(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ad.request(n):r=id.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(g,y){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,y)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};dd(L.prototype,"FormData");Os.exports=L});var $d={};gn($d,{descript:()=>Ed,descriptAuth:()=>H});module.exports=Ys($d);var Qs=Object.freeze({status:"aborted"});function T(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,y=Object.keys(g);for(let b=0;b<y.length;b++){let x=y[b];x in p||(p[x]=g[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let y of g._zod.deferred)y();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var eu=Symbol("zod_brand"),pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function me(e){return e&&Object.assign(or,e),or}o(me,"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 vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function xn(e){return e==null}o(xn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var hn=Symbol("evaluating");function K(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(K,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qe,"isObject");var tu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Qe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function W(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(W,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var ru={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function De(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(De,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function _e(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(_e,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(In,"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 Tn=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,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),En=T("$ZodError",Tn),et=T("$ZodError",Tn,{Parent:Error});var ou=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 pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>_e(f,u,me())));throw sr(p,i?.callee),p}return c.value},"_parse"),At=ou(et),iu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>_e(f,u,me())));throw sr(p,i?.callee),p}return c.value},"_parseAsync"),zt=iu(et),au=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 pe;return u.issues.length?{success:!1,error:new(e??En)(u.issues.map(c=>_e(c,i,me())))}:{success:!0,data:u.value}},"_safeParse"),tt=au(et),su=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=>_e(c,i,me())))}:{success:!0,data:u.value}},"_safeParseAsync"),rt=su(et);var uu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",cu=new RegExp(`^${uu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Ce=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=T("$ZodCheckMinLength",(e,t)=>{var r;Ce.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(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=In(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var pr=T("$ZodCheckStringFormat",(e,t)=>{var r,n;Ce.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=()=>{})}),wn=T("$ZodCheckRegex",(e,t)=>{pr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var On={major:4,minor:3,patch:6};var q=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=On;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let g=De(c),y;for(let b of p){if(b._zod.def.when){if(!b._zod.def.when(c))continue}else if(g)continue;let x=c.issues.length,s=b._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new pe;if(y||s instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(g||(g=De(c,x)))});else{if(c.issues.length===x)continue;g||(g=De(c,x))}}return y?y.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(De(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new pe;return g.then(y=>e._zod.parse(y,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(y=>u(y,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new pe;return f.then(g=>i(g,n,p))}return i(f,n,p)}}K(e,"~standard",()=>({validate:o(i=>{try{let u=tt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return rt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ot=T("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),lr=T("$ZodStringFormat",(e,t)=>{pr.init(e,t),Ot.init(e,t)});var Un=T("$ZodURL",(e,t)=>{lr.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 jn=T("$ZodNumber",(e,t)=>{q.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}});var dr=T("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=An,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}}),Mn=T("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Sn,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 Ln=T("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Fn=T("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r});var Bn=T("$ZodVoid",(e,t)=>{q.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=T("$ZodDate",(e,t)=>{q.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 Rn(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Zn=T("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Rn(g,r,c))):Rn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function kt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(kt,"handlePropertyResult");function pu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(pu,"normalizeDef");function lu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,y=f.optout==="optional";for(let b in t){if(p.has(b))continue;if(g==="never"){c.push(b);continue}let x=f.run({value:t[b],issues:[]},n);x instanceof Promise?e.push(x.then(s=>kt(s,r,b,t,y))):kt(x,r,b,t,y)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(lu,"handleCatchall");var Hn=T("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Et(()=>pu(t));K(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let y=p[g]._zod;if(y.values){f[g]??(f[g]=new Set);for(let b of y.values)f[g].add(b)}}return f});let i=Qe,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let y=[],b=c.shape;for(let x of c.keys){let s=b[x],d=s._zod.optout==="optional",h=s._zod.run({value:g[x],issues:[]},f);h instanceof Promise?y.push(h.then(m=>kt(m,p,x,g,d))):kt(h,p,x,g,d)}return u?lu(y,g,p,f,n.value,e):y.length?Promise.all(y).then(()=>p):p}});function Nn(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=>!De(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=>_e(c,n,me())))}),t)}o(Nn,"handleUnionResults");var mr=T("$ZodUnion",(e,t)=>{q.init(e,t),K(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),K(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),K(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),K(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=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Nn(f,i,e,u)):Nn(p,i,e,u)}});var Wn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;K(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=Et(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Qe(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var qn=T("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let y=t.valueType._zod.run({value:i[g],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...xe(g,b.issues)),r.value[g]=b.value})):(y.issues.length&&r.issues.push(...xe(g,y.issues)),r.value[g]=y.value)}let f;for(let g in i)p.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&cr.test(p)&&f.issues.length){let b=t.keyType._zod.run({value:Number(p),issues:[]},n);if(b instanceof Promise)throw new Error("Async schemas not supported in object keys currently");b.issues.length===0&&(f=b)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(b=>_e(b,n,me())),input:p,path:[p],inst:e});continue}let y=t.valueType._zod.run({value:i[p],issues:[]},n);y instanceof Promise?u.push(y.then(b=>{b.issues.length&&r.issues.push(...xe(p,b.issues)),r.value[f.value]=b.value})):(y.issues.length&&r.issues.push(...xe(p,y.issues)),r.value[f.value]=y.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Gn=T("$ZodEnum",(e,t)=>{q.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?Ne(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=T("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Kn=T("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=T("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(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=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=T("$ZodNullable",(e,t)=>{q.init(e,t),K(e._zod,"optin",()=>t.innerType._zod.optin),K(e._zod,"optout",()=>t.innerType._zod.optout),K(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),K(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Qn=T("$ZodPipe",(e,t)=>{q.init(e,t),K(e._zod,"values",()=>t.in._zod.values),K(e._zod,"optin",()=>t.in._zod.optin),K(e._zod,"optout",()=>t.out._zod.optout),K(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var eo=T("$ZodCustom",(e,t)=>{Ce.init(e,t),q.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=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(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(Cn,"handleRefineResult");var ro,gu=Symbol("ZodOutput"),yu=Symbol("ZodInput"),fr=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 no(){return new fr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var gr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...W(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...W(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...W(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...W(t)})}o(co,"_boolean");function po(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}o(po,"_coercedBoolean");function lo(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}o(lo,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...W(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...W(t)})}o(yo,"_coercedDate");function ue(e,t){return new zn({check:"min_length",...W(t),minimum:e})}o(ue,"_minLength");function Pe(e,t){return new wn({check:"string_format",format:"regex",...W(t),pattern:e})}o(Pe,"_regex");function ho(e,t,r){let n=W(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var X=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");q.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>tt(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rt(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)=>St(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Nt=T("ZodMiniString",(e,t)=>{Ot.init(e,t),X.init(e,t)});function a(e){return oo(Nt,e)}o(a,"string");var vo=T("ZodMiniStringFormat",(e,t)=>{lr.init(e,t),Nt.init(e,t)});var $u=T("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao($u,e)}o(xo,"url");var yr=T("ZodMiniNumber",(e,t)=>{jn.init(e,t),X.init(e,t)});function ee(e){return so(yr,e)}o(ee,"number");var hr=T("ZodMiniBoolean",(e,t)=>{dr.init(e,t),X.init(e,t)});function V(e){return co(hr,e)}o(V,"boolean");var _o=T("ZodMiniBigInt",(e,t)=>{Mn.init(e,t),X.init(e,t)});var Su=T("ZodMiniAny",(e,t)=>{Ln.init(e,t),X.init(e,t)});function ot(){return mo(Su)}o(ot,"any");var Au=T("ZodMiniUnknown",(e,t)=>{Fn.init(e,t),X.init(e,t)});function k(){return fo(Au)}o(k,"unknown");var zu=T("ZodMiniVoid",(e,t)=>{Bn.init(e,t),X.init(e,t)});function Po(e){return go(zu,e)}o(Po,"_void");var bo=T("ZodMiniDate",(e,t)=>{Vn.init(e,t),X.init(e,t)});var wu=T("ZodMiniArray",(e,t)=>{Zn.init(e,t),X.init(e,t)});function N(e,t){return new wu({type:"array",element:e,...W(t)})}o(N,"array");var ku=T("ZodMiniObject",(e,t)=>{Hn.init(e,t),X.init(e,t),K(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...W(t)};return new ku(r)}o(l,"object");var Ou=T("ZodMiniUnion",(e,t)=>{mr.init(e,t),X.init(e,t)});function D(e,t){return new Ou({type:"union",options:e,...W(t)})}o(D,"union");var Ru=T("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),X.init(e,t)});function Ue(e,t,r){return new Ru({type:"union",options:t,discriminator:e,...W(r)})}o(Ue,"discriminatedUnion");var Nu=T("ZodMiniRecord",(e,t)=>{qn.init(e,t),X.init(e,t)});function O(e,t,r){return new Nu({type:"record",keyType:e,valueType:t,...W(r)})}o(O,"record");var Du=T("ZodMiniEnum",(e,t)=>{Gn.init(e,t),X.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 Du({type:"enum",entries:r,...W(t)})}o(U,"_enum");var Cu=T("ZodMiniLiteral",(e,t)=>{Jn.init(e,t),X.init(e,t)});function S(e,t){return new Cu({type:"literal",values:Array.isArray(e)?e:[e],...W(t)})}o(S,"literal");var Uu=T("ZodMiniTransform",(e,t)=>{Kn.init(e,t),X.init(e,t)});function be(e){return new Uu({type:"transform",transform:e})}o(be,"transform");var ju=T("ZodMiniOptional",(e,t)=>{Xn.init(e,t),X.init(e,t)});function v(e){return new ju({type:"optional",innerType:e})}o(v,"optional");var Mu=T("ZodMiniNullable",(e,t)=>{Yn.init(e,t),X.init(e,t)});function it(e){return new Mu({type:"nullable",innerType:e})}o(it,"nullable");var Lu=T("ZodMiniPipe",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Ie(e,t){return new Lu({type:"pipe",in:e,out:t})}o(Ie,"pipe");var Fu=T("ZodMiniCustom",(e,t)=>{eo.init(e,t),X.init(e,t)});function Dt(e,t){return ho(Fu,e??(()=>!0),t)}o(Dt,"custom");var at={};gn(at,{bigint:()=>Gu,boolean:()=>qu,date:()=>Ju,number:()=>Wu,string:()=>Hu});function Hu(e){return io(Nt,e)}o(Hu,"string");function Wu(e){return uo(yr,e)}o(Wu,"number");function qu(e){return po(hr,e)}o(qu,"boolean");function Gu(e){return lo(_o,e)}o(Gu,"bigint");function Ju(e){return yo(bo,e)}o(Ju,"date");var xr=l({retryOnFailure:l({defaultValue:v(V()),hide:v(V())}),continueOnFailure:l({defaultValue:v(V()),hide:v(V())})}),vr=class{constructor(t,r,n,i,u,c,p,f,g,y,b){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=y;this.aiMetadata=b}static{o(this,"IAction")}},te=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=l({displayName:a(),description:v(a())}),C=o((e,t)=>l({type:S(t),required:V(),defaultValue:v(ot())}),"TPropertyValue");var oe=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),fe=l({...F.shape,...C(a(),"LONG_TEXT").shape});var To=l({label:a(),value:k()}),Ct=l({disabled:v(V()),placeholder:v(a()),options:N(To)});var ie=l({...F.shape,options:Ct,...C(k(),"STATIC_DROPDOWN").shape}),ge=l({...F.shape,options:Ct,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),st=l({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ye=l({...F.shape,...C(V(),"CHECKBOX").shape});var he=l({...F.shape,...C(ee(),"NUMBER").shape});var ut=l({...F.shape,...C(k(),"FILE").shape});var ct=l({...F.shape,...C(a(),"DATE_TIME").shape});var Eo=O(a(),D([oe,fe,ie,st,ge,ye,he,ut,ct])),pt=l({...F.shape,properties:Eo,...C(N(k()),"ARRAY").shape});var lt=l({...F.shape,...C(D([O(a(),k())]),"JSON").shape});var $o=D([oe,ie,lt,pt,ge]),Xu=O(a(),$o),Pr=l({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Ut=l({...F.shape,...C(Po(),"MARKDOWN").shape});var dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(dt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Me=(_=>(_.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",_.COMMUNICATION="COMMUNICATION",_.COMMERCE="COMMERCE",_.CORE="CORE",_.UNIVERSAL_AI="UNIVERSAL_AI",_.FLOW_CONTROL="FLOW_CONTROL",_.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",_.ACCOUNTING="ACCOUNTING",_.PRODUCTIVITY="PRODUCTIVITY",_.CONTENT_AND_FILES="CONTENT_AND_FILES",_.DEVELOPER_TOOLS="DEVELOPER_TOOLS",_.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",_.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",_.HUMAN_RESOURCES="HUMAN_RESOURCES",_.PAYMENT_PROCESSING="PAYMENT_PROCESSING",_.MARKETING="MARKETING",_.SALES_AND_CRM="SALES_AND_CRM",_))(Me||{});var mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(mt||{}),br="both_client_credentials_and_authorization_code";var Te=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Te||{}),ft=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(ft||{}),Yu=l({strategy:U(ft),paramName:v(a())}),gt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(gt||{});var jt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(jt||{}),So=l({status:v(ee()),body:v(k()),headers:v(O(a(),a()))}),Ao=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(jt))}),zo=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:So,handlerId:v(a()),streamStepProgress:v(U(jt))}),Qu=D([Ao,zo]);var ec=l({body:k(),rawBody:v(k()),headers:O(a(),a()),queryParams:O(a(),a())});function Q(e){return e==null}o(Q,"isNil");function yt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(yt,"isEmpty");function Mt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Mt,"assertNotNullOrUndefined");var Ir=Re(require("crypto"),1);var tc=128,Ae,Le,rc=o(e=>{!Ae||Ae.length<e?(Ae=Buffer.allocUnsafe(e*tc),Ir.default.randomFillSync(Ae),Le=0):Le+e>Ae.length&&(Ir.default.randomFillSync(Ae),Le=0),Le+=e},"fillPool"),nc=o(e=>(rc(e|=0),Ae.subarray(Le-e,Le)),"random"),oc=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 p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),ko=o((e,t=21)=>oc(e,t,nc),"customAlphabet");var ic="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Oo=21,cb=a().check(Pe(new RegExp(`^[0-9a-zA-Z]{${Oo}}$`))),ac=ko(ic,Oo);var Ee=Ie(be(e=>e instanceof Date?e.toISOString():e),a()),ae={id:a(),created:Ee,updated:Ee},Z=o(e=>v(it(e)),"Nullable");function Tr(e){return v(it(U(e)))}o(Tr,"NullableEnum");var db=Ie(be(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(V())),Lt=o(e=>Ie(be(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var gb=O(a(),k());var ht=(y=>(y.OPENAI="openai",y.OPENROUTER="openrouter",y.ANTHROPIC="anthropic",y.AZURE="azure",y.GOOGLE="google",y.ACTIVEPIECES="activepieces",y.CLOUDFLARE_GATEWAY="cloudflare-gateway",y.CUSTOM="custom",y.BEDROCK="bedrock",y.MISTRAL="mistral",y))(ht||{});var Sb=a().check(Pe(/^#[0-9A-Fa-f]{6}$/));var zb=l({filename:a(),data:k(),type:S("file"),mimetype:v(a())});var sc=Re(No());var Cb=l({...ae,name:a(),permissions:N(a()),platformId:Z(a()),type:a(),userCount:v(ee())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),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 uc=l({mode:U(Do),value:k()}),cc=l({auth:v(a()),fields:O(a(),uc)}),pc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(cc)}),lc=l({type:S("PIECE"),toolName:a().check(ue(1)),pieceMetadata:pc}),dc=l({type:S("none")}),mc=l({type:S("access_token"),accessToken:a()}),fc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),gc=l({type:S("headers"),headers:O(a(),a())}),yc=Ue("type",[dc,mc,fc,gc]),Co=l({type:S("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:v(a())}),Uo=l({type:S("MCP"),toolName:a().check(ue(1)),serverUrl:xo(),protocol:U($r),auth:yc}),jo=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:U(Er),sourceId:a(),sourceName:a()}),hc=Ue("type",[lc,Co,Uo,jo]),vc=l({displayName:a(),description:v(a()),type:U(Sr)}),Mo=l({type:S("MARKDOWN"),markdown:a()}),Fe={type:S("TOOL_CALL"),input:Z(O(a(),k())),output:v(k()),toolName:a(),status:U(Ar),toolCallId:a(),startTime:a(),endTime:v(a())},cI=l(Fe),Lo=Ue("toolCallType",[l({...Fe,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:S("UNKNOWN"),displayName:a()})]),xc=D([Mo,Lo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),ve=l({apiKey:a()}),_c=ve,Pc=l({apiKey:a(),apiKeyHash:a()}),bc=ve,Ic=ve,Tc=ve,Ec=ve,$c=ve,Sc=ve,Ac=ve,Fo=l({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),zc=l({}),wc=l({}),kc=l({}),Oc=l({}),Rc=l({}),Nc=l({}),Bo=l({modelId:a(),modelName:a(),modelType:U(zr)}),Vo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Bo),defaultHeaders:v(O(a(),a()))}),Zo=l({accountId:a(),gatewayId:a(),models:N(Bo),vertexProject:v(a()),vertexRegion:v(a())}),Ho=l({resourceName:a(),apiVersion:Ie(be(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Wo=l({region:a().check(ue(1))}),Dc=D([_c,Tc,Ec,$c,Sc,Ic,bc,Pc,Fo,Ac]),qo=D([Vo,Zo,Ho,Wo,zc,kc,Oc,Rc,wc,Nc]),Cc=l({id:a(),name:a(),type:U(zr)}),Uc=l({id:a(),name:a(),provider:U(ht),config:qo,enabledForChat:V()}),jc=l({provider:U(ht),config:qo,auth:Dc,platformId:a()});var mI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Mc=l({base64Url:a(),fileName:a(),extension:v(a())}),Lc=l({mimeType:a(),url:a(),fileName:v(a())}),wr=D([Mc,Lc]);var Fc=D([l({type:S("file"),value:wr}),l({type:S("markdown"),value:a(),files:v(N(wr))})]),Bc=l({sessionId:a(),message:a(),files:v(N(a()))});var Jo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Jo||{}),Ko=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ko||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var Vc=D([l({...ae,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ae,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Zc=l({...ae,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Tr(Ko),trigger:Tr(Jo)}),Hc=l({...ae,tableId:a(),projectId:a(),cells:O(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Wc=l({events:N(U(kr)),webhookUrl:a(),flowId:a()}),qc=l({fields:N(l({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),Gc=l({projectId:a(),limit:v(at.number()),cursor:v(a()),name:v(a()),externalIds:Lt(a()),folderId:v(a()),folderIds:Lt(a())}),Jc=l({records:N(N(l({fieldId:a(),value:Yo()}))),tableId:a()}),Kc=l({cells:v(N(l({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:v(V())}),Xo=Ue("operator",[ze("eq"),ze("neq"),ze("gt"),ze("gte"),ze("lt"),ze("lte"),ze("co"),Go("exists"),Go("not_exists")]),Xc=l({tableId:a(),limit:v(at.number()),cursor:v(a()),filters:Lt(Xo)});function Yo(){return Ie(be(e=>e==null?e:String(e)),it(a()))}o(Yo,"coerceToString");function ze(e){return l({fieldId:a(),operator:S(e),value:a()})}o(ze,"valueFilter");function Go(e){return l({fieldId:a(),operator:S(e)})}o(Go,"existenceFilter");var Yc=l({status:v(ee()),body:v(k()),headers:v(O(a(),a()))}),Qc=l({...ae,deleted:Z(Ee),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Qo=l({name:a(),description:v(a()),type:a(),required:V()}),ep=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(Qo),returnsResponse:V()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",OI=new RegExp(ei),rp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",RI=a().check(Pe(new RegExp(ei))),NI=a().check(Pe(new RegExp(rp))),np=l({packageType:S("ARCHIVE"),pieceType:U(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),DI=D([ti,ri]),CI=D([np,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),op=l({type:U(ni),cronExpression:a(),timezone:a()}),UI=l({...ae,type:U(Te),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(op),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:V()}),oi=(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))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),jI=l({...ae,projectId:Z(a()),platformId:Z(a()),type:U(oi),compression:U(ii),data:v(k()),location:U(ai),size:Z(ee()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(O(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),MI=l({id:a(),email:a(),firstName:a(),status:U(ui),externalId:Z(a()),platformId:Z(a()),platformRole:U(si),lastName:a(),created:Ee,updated:Ee,lastActiveDate:Z(Ee),imageUrl:Z(a())});var Or=l({...F.shape,...C(O(a(),k()),"OBJECT").shape});var di=l({...F.shape,...C(a(),"COLOR").shape});var Rr=D([oe,fe,Ut,ye,ie,ge,_r,st,Pr,he,pt,Or,lt,ct,ut,di]),I={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var le=l({displayName:a(),description:v(a())});var mi=l({username:a(),password:a()}),Nr=l({...le.shape,username:l({displayName:a(),description:v(a())}),password:l({displayName:a(),description:v(a())}),...C(mi,"BASIC_AUTH").shape});var up=O(a(),D([oe,fe,he,ye,ie])),Dr=l({...le.shape,props:up,...C(k(),"CUSTOM_AUTH").shape});var we=l({...le.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var cp=O(a(),D([oe,fe,we,he,ye,ie,ge,Ut])),fi=l({...le.shape,props:cp,...C(k(),"OIDC").shape});var Cr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Cr||{}),gi=D([oe,we,ie]),yi=O(a(),gi),pp=l({props:v(O(a(),gi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:v(V()),pkceMethod:v(D([S("plain"),S("S256")])),authorizationMethod:v(U(Cr)),grantType:v(D([U(mt),S(br)])),extra:v(O(a(),a()))}),hi=l({access_token:a(),props:v(yi),data:O(a(),ot())}),Ur=l({...le.shape,...pp.shape,...C(hi,"OAUTH2").shape});var Be=D([Nr,Dr,fi,Ur,we]),vt="Connection",jr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||vt}},None(){}};var hE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var lp=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var dp=D([Rr,Be]),Mr=O(a(),dp),UE=O(a(),Rr);var vi=D([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]),Ve=class{constructor(t,r,n,i,u,c,p,f,g,y,b,x,s,d,h,m,_,P,M){this.name=t;this.displayName=r;this.description=n;this.requireAuth=i;this.props=u;this.type=c;this.handshakeConfiguration=p;this.onHandshake=f;this.renewConfiguration=g;this.onRenew=y;this.onEnable=b;this.onDisable=x;this.onStart=s;this.run=d;this.test=h;this.sampleData=m;this.testStrategy=_;this.outputSchema=P;this.aiMetadata=M}static{o(this,"ITrigger")}},xi=o(e=>{switch(e.type){case"WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,e.handshakeConfiguration??{strategy:"NONE"},e.onHandshake??(async()=>({status:200})),e.renewConfiguration??{strategy:"NONE"},e.onRenew??(async()=>Promise.resolve()),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,e.test?"TEST_FUNCTION":"SIMULATION",e.outputSchema,e.aiMetadata);case"POLLING":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"MANUAL":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,"TEST_FUNCTION",e.outputSchema,e.aiMetadata);case"APP_WEBHOOK":return new Ve(e.name,e.displayName,e.description,e.requireAuth??!0,e.props,e.type,{strategy:"NONE"},async()=>({status:200}),{strategy:"NONE"},async()=>Promise.resolve(),e.onEnable,e.onDisable,e.onStart??(async()=>Promise.resolve()),e.run,e.test??(()=>Promise.resolve([e.sampleData])),e.sampleData,Q(e.sampleData)&&Q(e.test)?"SIMULATION":"TEST_FUNCTION",e.outputSchema,e.aiMetadata)}},"createTrigger");var _i="2",Bt="0.82.0";var Lr=class{constructor(t,r,n,i,u,c,p,f,g=Bt,y,b=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=y;this.description=b;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:_i}),"getContextInfo");(!mp(g)||fp(g,Bt))&&(this.minimumSupportedRelease=Bt),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Pi=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)},"createPiece");function mp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(mp,"isValidSimpleSemver");function fp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(fp,"isSemverLessThan");var gp=v(O(a(),O(a(),a()))),bi=l({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(D([Be,N(Be)])),version:a(),categories:v(N(U(Me))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:gp}),yp=U(["human","ai","both"]),Ii=l({description:v(a()),idempotent:v(V())}),Ti=l({name:a(),displayName:a(),description:a(),props:Mr,requireAuth:V(),errorHandlingOptions:v(xr),outputSchema:v(Dt()),audience:v(yp),aiMetadata:v(Ii)}),Ei=l({name:a(),displayName:a(),description:a(),props:Mr,errorHandlingOptions:v(xr),type:U(Te),sampleData:k(),handshakeConfiguration:v(Dt()),renewConfiguration:v(vi),testStrategy:U(gt),outputSchema:v(Dt()),aiMetadata:v(Ii)}),hp=l({...bi.shape,actions:O(a(),Ti),triggers:O(a(),Ei)}),vp=l({...bi.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(Ei)),suggestedTriggers:v(N(Ti))}),$i=l({projectUsage:ee(),tags:v(N(a())),pieceType:U(je),packageType:U(dt),platformId:v(a()),archiveId:v(a())}),U$=l({...hp.shape,...$i.shape}),j$=l({...vp.shape,...$i.shape}),M$=l({name:a(),version:a()});var xp=Re(require("path")),_p=Re(require("fs/promises"));var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Zt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Br){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Br=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Ht=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Wt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Zt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[M,ne]of Object.entries(c))i.append(M,ne);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",y=t.followRedirects??!0,b=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Pp(t.body,u),h=Ip({...u,...s}),m=await bp(async()=>{let M=new AbortController,ne=t.timeout&&t.timeout>0?setTimeout(()=>M.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:h,body:x,redirect:y?"follow":"manual",signal:M.signal};return d&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(f,se)}finally{ne!==void 0&&clearTimeout(ne)}},b),_=y?300:400;if(m.status<200||m.status>=_){let M=await Si(m,g),ne=new Ht(t.body,{status:m.status,responseBody:M});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ne),ne}let P=await Si(m,g);return{status:m.status,headers:Tp(m.headers),body:P}}};function Pp(e,t){return $p(e)?{body:void 0,extraHeaders:{},isStream:!1}:Ep(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Pp,"serializeBody");async function Si(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Si,"parseResponseBody");async function bp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ai(n);continue}return i}catch(i){if(r=i,n<t){await Ai(n);continue}throw i}throw r}o(bp,"sendWithRetries");function Ai(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ai,"backoff");function Ip(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(Ip,"normalizeHeaders");function Tp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Tp,"toHttpHeaders");function Ep(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Ep,"isNodeFormData");function $p(e){return e==null}o($p,"isNil");var Ze=new Wt;var He=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(He||{});var md=Re(require("fs")),Ns=Re(Rs());var fd={"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 gd(e){let t=e.split(";")[0].trim().toLowerCase();return fd[t]??""}o(gd,"contentTypeToExtension");var yd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),hd=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 Ds({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return te({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:I.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:I.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${hd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:I.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(He).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:I.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:I.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:I.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:I.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let y=g,b={};switch(y){case"none":break;case"json":b.data=I.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":b.data=I.LongText({displayName:"Raw Body",required:!0});break;case"form_data":b.data=I.Array({displayName:"Form Data",required:!0,properties:{fieldName:I.ShortText({displayName:"Field Name",required:!0}),fieldType:I.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:I.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:I.File({displayName:"File Field Value",required:!1})}});break}return b},"props")}),response_is_binary:I.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:I.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:I.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:I.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:y,url:b,headers:x,queryParams:s,body:d,body_type:h,failsafe:m,timeout:_,response_is_binary:P,followRedirects:M}=g.propsValue;Mt(y,"Method"),Mt(b,"URL");let ne=Q(r)?{}:await r(g.auth,g.propsValue),se=b.url,Xe=se.startsWith("http://")||se.startsWith("https://")?se:yd({baseUrl:t(g.auth),relativePath:se}),Se={method:y,url:Xe,headers:{...x??{},...f==="headers"||!Q(f)?ne:{}},queryParams:{...f==="queryParams"?ne:{},...s??{}},timeout:_?_*1e3:0,followRedirects:M};if(P&&(Se.responseType="arraybuffer"),d)if(h&&h!=="none"){let de=d.data;if(h==="form_data"){let Ws=de,bt=new Ns.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:nr}of Ws)mn==="text"&&!yt(fn)?bt.append(dn,fn):mn==="file"&&!yt(nr)&&bt.append(dn,nr.data,{filename:nr?.filename});Se.body=bt,Se.headers={...Se.headers,...bt.getHeaders()}}else Se.body=de}else h||(Se.body=d);try{let de=await Ze.sendRequest(Se);return await vd(g.files,de.body,de.status,de.headers,P)}catch(de){if(m)return de.errorMessage();throw de}},"run")})}o(Ds,"createCustomApiCallAction");var vd=o(async(e,t,r,n,i)=>{let u;if(i&&xd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=gd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),xd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var rr={async poll(e,{store:t,auth:r,propsValue:n,maxItemsToPoll:i,files:u,server:c}){switch(e.strategy){case 0:{let p=await t.get("lastPoll");if(Q(p))throw new Error("lastPoll doesn't exist in the store.");let f=await e.items({store:t,auth:r,propsValue:n,lastFetchEpochMS:p,server:c}),g=f.reduce((y,b)=>Math.max(y,b.epochMilliSeconds),p);return await t.put("lastPoll",g),f.filter(y=>y.epochMilliSeconds>p).map(y=>y.data)}case 1:{let p=await t.get("lastItem"),f=await e.items({store:t,auth:r,propsValue:n,lastItemId:p,files:u,server:c}),g=f.findIndex(x=>x.id===p),y=[];Q(p)||g==-1?y=f??[]:y=f?.slice(0,g)??[],Q(i)||(y=y.slice(-i));let b=y?.[0]?.id;return Q(b)||await t.put("lastItem",b),y.map(x=>x.data)}}},async onEnable(e,{store:t,auth:r,propsValue:n,server:i}){switch(e.strategy){case 0:{await t.put("lastPoll",Date.now());break}case 1:{let c=(await e.items({store:t,auth:r,propsValue:n,lastItemId:null,server:i}))?.[0]?.id;Q(c)?await t.delete("lastItem"):await t.put("lastItem",c);break}}},async onDisable(e,t){switch(e.strategy){case 0:case 1:return}},async test(e,{auth:t,propsValue:r,store:n,files:i,server:u}){let c=[];switch(e.strategy){case 0:{c=await e.items({store:n,auth:t,propsValue:r,lastFetchEpochMS:0,server:u});break}case 1:{c=await e.items({store:n,auth:t,propsValue:r,lastItemId:null,files:i,server:u});break}}return _d(c.map(p=>p.data))}};function _d(e){return e.length<=5?e:e.slice(0,5)}o(_d,"getFirstFiveOrAll");var H=jr.SecretText({displayName:"API Token",description:["To create an API token:","1. Open **Settings** in Descript.","2. Select **API tokens** from the sidebar.","3. Click **Create token**, give it a name, select a Drive, and click **Create token**.","4. Copy the token and paste it here \u2014 you can only view it once."].join(`
|
|
4
|
+
`),required:!0,validate:o(async({auth:e})=>{try{return await Ze.sendRequest({method:"GET",url:"https://descriptapi.com/v1/status",headers:{Authorization:`Bearer ${Oe(e)}`}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API token. Please check and try again."}}},"validate")});function Oe(e){return(typeof e=="string"?e:e.secret_text).trim()}o(Oe,"getAuthToken");var Cs="https://descriptapi.com/v1";async function pn({apiKey:e,method:t,path:r,body:n,queryParams:i}){return Ze.sendRequest({method:t,url:`${Cs}${r}`,headers:{Authorization:`Bearer ${e}`},body:n,queryParams:i})}o(pn,"descriptApiCall");async function Us(e){let t=[],r;do{let n={limit:"100",sort:"name",direction:"asc"};r&&(n.cursor=r);let i=await pn({apiKey:e,method:"GET",path:"/projects",queryParams:n});t.push(...i.body.data),r=i.body.pagination.next_cursor}while(r);return t}o(Us,"fetchAllProjects");var Pd=I.Dropdown({auth:H,displayName:"Project",description:"Select the Descript project to use.",refreshers:[],required:!0,options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await Us(Oe(e))).map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),bd=o(e=>I.Dropdown({auth:H,displayName:"Composition",description:"Select the composition (timeline) within the project. If omitted, the agent chooses automatically.",refreshers:["project_id"],required:e,options:o(async({auth:t,project_id:r})=>{if(!t||!r||typeof r!="string")return{disabled:!0,options:[],placeholder:"Please select a project first"};try{return{disabled:!1,options:(await pn({apiKey:Oe(t),method:"GET",path:`/projects/${r}`})).body.compositions.map(i=>({label:i.name,value:i.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load compositions. Check your connection."}}},"options")}),"compositionIdProp"),B={BASE_URL:Cs,descriptApiCall:pn,fetchAllProjects:Us,getAuthToken:Oe,projectIdProp:Pd,compositionIdProp:bd};var js=te({auth:H,name:"agent_edit",displayName:"Agent Edit (Underlord)",description:`Use Descript's AI agent "Underlord" to edit an existing project or create a new one with a natural language prompt.`,audience:"both",aiMetadata:{description:"Starts an asynchronous Descript Underlord AI editing job driven by a natural-language prompt, operating in one of two modes: editing an existing project (optionally targeting a specific composition) or creating a new project from the prompt. Use to apply AI edits like removing filler words, adding studio sound, or assembling highlight reels. Frame the prompt as a single one-shot instruction. Not idempotent: each call queues a new job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:I.StaticDropdown({displayName:"Mode",description:"Choose whether to edit an existing project or create a brand new one.",required:!0,defaultValue:"existing",options:{options:[{label:"Edit existing project",value:"existing"},{label:"Create new project from prompt",value:"new"}]}}),project_id:I.Dropdown({auth:H,displayName:"Project",description:"Select the project for the agent to edit.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await B.fetchAllProjects(B.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:I.ShortText({displayName:"New Project Name",description:"Name for the new project (only used when creating a new project).",required:!1}),team_access:I.StaticDropdown({displayName:"Team Access",description:"Access level for team members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),composition_id:B.compositionIdProp(!1),prompt:I.LongText({displayName:"Prompt",description:'Natural language instruction for Underlord. Examples: "Add studio sound to every clip", "Remove all filler words", "Create a 30-second highlight reel with the best moments". Be specific \u2014 frame edits as a single one-shot instruction.',required:!0}),model:I.ShortText({displayName:"AI Model",description:"AI model to use for editing. Leave blank to use the Descript default.",required:!1}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,team_access:i,composition_id:u,prompt:c,model:p,callback_url:f}=e.propsValue,g={prompt:c};if(t==="existing"){if(!r)throw new Error("Please select a project to edit.");g.project_id=r,u&&(g.composition_id=u)}else{if(!n)throw new Error("Please enter a project name for the new project.");g.project_name=n,i&&(g.team_access=i)}return p&&(g.model=p),f&&(g.callback_url=f),(await B.descriptApiCall({apiKey:B.getAuthToken(e.auth),method:"POST",path:"/jobs/agent",body:g})).body}});var Ms=te({auth:H,name:"get_job_status",displayName:"Get Job Status",description:"Retrieves the current status of a Descript background job (import, agent edit, or publish). Use the job_id returned by any job-creation action.",audience:"both",aiMetadata:{description:"Looks up the current state and result of a single Descript background job (import, agent edit, or publish) by its job_id. Use to poll for completion after starting an asynchronous job and to read outputs such as share/download URLs or error messages. Read-only and idempotent.",idempotent:!0},props:{job_id:I.ShortText({displayName:"Job ID",description:'The job ID returned when you created the job (e.g. from "Import Media", "Agent Edit", or "Publish Project" actions).',required:!0})},async run(e){return(await B.descriptApiCall({apiKey:B.getAuthToken(e.auth),method:"GET",path:`/jobs/${e.propsValue.job_id}`})).body}});var Ls=te({auth:H,name:"get_project",displayName:"Get Project",description:"Retrieves details for a Descript project including its compositions and media files.",audience:"both",aiMetadata:{description:"Fetches full details for a single Descript project by ID, including its compositions and media files. Use to resolve composition IDs or inspect project contents before editing or publishing. Read-only and idempotent.",idempotent:!0},props:{project_id:B.projectIdProp},async run(e){return(await B.descriptApiCall({apiKey:B.getAuthToken(e.auth),method:"GET",path:`/projects/${e.propsValue.project_id}`})).body}});var Fs=te({auth:H,name:"import_media",displayName:"Import Media",description:"Imports a media file from a URL into a new or existing Descript project and optionally creates a composition.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript job that imports a media file from a public URL into either a newly created project or an existing one (selected via the project mode), optionally building a composition/timeline from it. Use to bring audio/video into Descript before editing or publishing; the URL must be reachable by Descript servers and support HTTP Range requests. Not idempotent: each call queues a new import job and returns a job_id to poll for completion.",idempotent:!1},props:{mode:I.StaticDropdown({displayName:"Project",description:"Create a new project or import into an existing one.",required:!0,defaultValue:"new",options:{options:[{label:"Create new project",value:"new"},{label:"Import into existing project",value:"existing"}]}}),project_id:I.Dropdown({auth:H,displayName:"Existing Project",description:"Select the project to import media into.",refreshers:["mode"],required:!1,options:o(async({auth:e,mode:t})=>{if(t!=="existing")return{disabled:!0,options:[],placeholder:"Not needed for new projects"};if(!e)return{disabled:!0,options:[],placeholder:"Please connect your account first"};try{return{disabled:!1,options:(await B.fetchAllProjects(B.getAuthToken(e))).map(n=>({label:n.name,value:n.id}))}}catch{return{disabled:!0,options:[],placeholder:"Failed to load projects. Check your connection."}}},"options")}),project_name:I.ShortText({displayName:"New Project Name",description:"Name for the new project. Only used when creating a new project.",required:!1}),folder_name:I.ShortText({displayName:"Project Folder",description:'Folder path for the new project (e.g. "Clients/Acme"). Supports nested paths using "/". Missing folders are created automatically. Only applies when creating a new project.',required:!1}),team_access:I.StaticDropdown({displayName:"Team Access",description:"Access level for Drive members on the new project. Only applies when creating a new project.",required:!1,defaultValue:"none",options:{options:[{label:"None (private to owner)",value:"none"},{label:"View",value:"view"},{label:"Comment",value:"comment"},{label:"Edit",value:"edit"}]}}),media_name:I.ShortText({displayName:"Media File Name",description:'Display name for the media file (e.g. "intro.mp4" or "Recordings/interview.mp4"). Use "/" to organize into sub-folders. Must not conflict with existing file names when importing into an existing project.',required:!0}),media_url:I.ShortText({displayName:"Media URL",description:"Public URL of the media file. Must be accessible by Descript servers and support HTTP Range requests. Sign URLs for 12\u201348 hours if they expire.",required:!0}),language:I.ShortText({displayName:"Transcription Language",description:'ISO 639-1 language code for transcription (e.g. "en", "es", "fr"). Leave blank to auto-detect from the audio.',required:!1}),composition_name:I.ShortText({displayName:"Composition Name",description:"Name for the composition (timeline) to create from the imported media. Leave blank to skip composition creation.",required:!1}),composition_width:I.Number({displayName:"Composition Width (px)",description:"Width of the composition in pixels. Defaults to 1920. Only used when a Composition Name is provided.",required:!1,defaultValue:1920}),composition_height:I.Number({displayName:"Composition Height (px)",description:"Height of the composition in pixels. Defaults to 1080. Only used when a Composition Name is provided.",required:!1,defaultValue:1080}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the import finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).",required:!1})},async run(e){let{mode:t,project_id:r,project_name:n,folder_name:i,team_access:u,media_name:c,media_url:p,language:f,composition_name:g,composition_width:y,composition_height:b,callback_url:x}=e.propsValue,s={url:p};f&&(s.language=f);let d={add_media:{[c]:s}};if(t==="existing"){if(!r)throw new Error("Please select a project to import into.");d.project_id=r}else{if(!n)throw new Error("Please enter a name for the new project.");d.project_name=n,i&&(d.folder_name=i),u&&(d.team_access=u)}return g&&(d.add_compositions=[{name:g,width:y??1920,height:b??1080,clips:[{media:c}]}]),x&&(d.callback_url=x),(await B.descriptApiCall({apiKey:B.getAuthToken(e.auth),method:"POST",path:"/jobs/import/project_media",body:d})).body}});var Bs=te({auth:H,name:"list_projects",displayName:"List Projects",description:"Returns projects in your Descript Drive. Supports filtering by name, date, and creator.",audience:"both",aiMetadata:{description:"Lists projects in the connected Descript Drive, auto-paginating through all matches. Optional filters narrow by name substring, creator (me vs anyone), and created/updated date ranges, with configurable sort field and direction; leaving filters blank returns all projects. Use to discover project IDs for other actions. Read-only and idempotent.",idempotent:!0},props:{name:I.ShortText({displayName:"Name Filter",description:"Return only projects whose name contains this string (case-insensitive).",required:!1}),created_by:I.StaticDropdown({displayName:"Created By",description:"Filter projects by creator.",required:!1,options:{options:[{label:"Anyone",value:""},{label:"Me",value:"me"}]}}),sort:I.StaticDropdown({displayName:"Sort By",description:"Field to sort results by.",required:!1,defaultValue:"created_at",options:{options:[{label:"Date created",value:"created_at"},{label:"Date updated",value:"updated_at"},{label:"Name",value:"name"},{label:"Last viewed",value:"last_viewed_at"}]}}),direction:I.StaticDropdown({displayName:"Sort Direction",description:"Sort order for results.",required:!1,defaultValue:"desc",options:{options:[{label:"Newest first (desc)",value:"desc"},{label:"Oldest first (asc)",value:"asc"}]}}),created_after:I.ShortText({displayName:"Created After",description:"Return only projects created after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),created_before:I.ShortText({displayName:"Created Before",description:"Return only projects created before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1}),updated_after:I.ShortText({displayName:"Updated After",description:"Return only projects updated after this date (ISO 8601, e.g. 2025-01-01T00:00:00Z).",required:!1}),updated_before:I.ShortText({displayName:"Updated Before",description:"Return only projects updated before this date (ISO 8601, e.g. 2025-12-31T23:59:59Z).",required:!1})},async run(e){let{name:t,created_by:r,sort:n,direction:i,created_after:u,created_before:c,updated_after:p,updated_before:f}=e.propsValue,g=B.getAuthToken(e.auth),y={limit:"100"};n&&(y.sort=n),i&&(y.direction=i),t&&(y.name=t),r&&(y.created_by=r),u&&(y.created_after=u),c&&(y.created_before=c),p&&(y.updated_after=p),f&&(y.updated_before=f);let b=[],x;do{let s={...y,...x?{cursor:x}:{}},d=await B.descriptApiCall({apiKey:g,method:"GET",path:"/projects",queryParams:s});b.push(...d.body.data),x=d.body.pagination.next_cursor}while(x);return b.map(s=>({project_id:s.id,project_name:s.name,created_at:s.created_at,updated_at:s.updated_at}))}});var Vs=te({auth:H,name:"publish_project",displayName:"Publish Project",description:"Publishes a composition from a project to create a shareable link and a downloadable export file.",audience:"both",aiMetadata:{description:"Starts an asynchronous Descript publish/export job for a project composition, producing a shareable link and a downloadable file as video or audio at a chosen resolution and share access level. Use to render and distribute a finished project. Requesting a share access level the Drive disallows returns an error. Not idempotent: each call queues a new export job and returns a job_id to poll for the share_url and download_url.",idempotent:!1},props:{project_id:B.projectIdProp,composition_id:B.compositionIdProp(!1),media_type:I.StaticDropdown({displayName:"Output Type",description:"Choose whether to export the project as a video or audio file.",required:!1,defaultValue:"Video",options:{options:[{label:"Video",value:"Video"},{label:"Audio only",value:"Audio"}]}}),resolution:I.StaticDropdown({displayName:"Video Resolution",description:"Resolution for the exported video. Only applies when Output Type is Video.",required:!1,defaultValue:"1080p",options:{options:[{label:"480p",value:"480p"},{label:"720p",value:"720p"},{label:"1080p (Full HD)",value:"1080p"},{label:"1440p (2K)",value:"1440p"},{label:"4K",value:"4K"}]}}),access_level:I.StaticDropdown({displayName:"Share Access Level",description:"Who can view the published share page. Leave blank to use your Drive's default. Note: requesting a level your Drive disallows (e.g. Public when search-engine indexing is off) will return an error.",required:!1,options:{options:[{label:"Public (anyone)",value:"public"},{label:"Unlisted (link only)",value:"unlisted"},{label:"Drive members only",value:"drive"},{label:"Private (owner only)",value:"private"}]}}),callback_url:I.ShortText({displayName:"Callback URL",description:"Optional webhook URL. When the publish job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status). The result includes share_url and download_url once complete.",required:!1})},async run(e){let{project_id:t,composition_id:r,media_type:n,resolution:i,access_level:u,callback_url:c}=e.propsValue,p={project_id:t};return r&&(p.composition_id=r),n&&(p.media_type=n),n==="Video"&&i&&(p.resolution=i),u&&(p.access_level=u),c&&(p.callback_url=c),(await B.descriptApiCall({apiKey:B.getAuthToken(e.auth),method:"POST",path:"/jobs/publish",body:p})).body}});var Id=new Set(["stopped","cancelled"]);function Td(e){return Id.has(e.job_state)}o(Td,"isCompletedJob");var Zs={job_id:"6dc3f30a-58c2-4174-96a6-dc18cf3c7776",job_type:"import/project_media",job_state:"stopped",created_at:"2025-11-18T10:30:00Z",stopped_at:"2025-11-18T10:35:00Z",drive_id:"c9c5c47e-158a-49f7-846b-4f6ee2a229a2",project_id:"9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",project_url:"https://web.descript.com/9f36ee32-5a2c-47e7-b1a3-94991d3e3ddb",result:{status:"success",media_seconds_used:136}},ln={strategy:0,items:o(async({auth:e,propsValue:t,lastFetchEpochMS:r})=>{let{job_type_filter:n}=t,i=B.getAuthToken(e),u={limit:"100"};n&&n!=="all"&&(u.type=n),r>0&&(u.created_after=new Date(r).toISOString());let c=[],p,f=0,g=10;do{f++;let y={...u,...p?{cursor:p}:{}},b=await B.descriptApiCall({apiKey:i,method:"GET",path:"/jobs",queryParams:y});c.push(...b.body.data),p=b.body.pagination.next_cursor}while(p&&f<g);return c.filter(Td).map(y=>({epochMilliSeconds:new Date(y.stopped_at??y.created_at).getTime(),data:{...y}}))},"items")},Hs=xi({auth:H,name:"job_completed",displayName:"Job Completed",description:"Triggers when a Descript background job (import, agent edit, or publish) finishes.",aiMetadata:{description:"Fires when a Descript background job reaches a terminal state (completed, failed, or cancelled), representing a finished import, agent edit, or publish job. Can be scoped to a single job type or left open to fire for any completed job type."},props:{job_type_filter:I.StaticDropdown({displayName:"Job Type Filter",description:'Only trigger for jobs of this type. Select "All job types" to trigger for any completed job.',required:!1,defaultValue:"all",options:{options:[{label:"All job types",value:"all"},{label:"Import media",value:"import/project_media"},{label:"Agent edit (Underlord)",value:"agent"}]}})},sampleData:Zs,type:"POLLING",async test(){return[Zs]},async onEnable(e){await rr.onEnable(ln,e)},async onDisable(e){await rr.onDisable(ln,e)},async run(e){return await rr.poll(ln,e)}});var Ed=Pi({displayName:"Descript",description:"AI-powered video and podcast editor. Import media, run AI edits with Underlord, and publish.",minimumSupportedRelease:"0.82.1",logoUrl:"https://cdn.activepieces.com/pieces/descript.png",categories:["CONTENT_AND_FILES"],auth:H,authors:["hugh-codes","onyedikachi-david"],actions:[Fs,js,Vs,Ms,Bs,Ls,Ds({baseUrl:o(()=>"https://descriptapi.com/v1","baseUrl"),auth:H,authMapping:o(async e=>({Authorization:`Bearer ${Oe(e)}`}),"authMapping")})],triggers:[Hs]});0&&(module.exports={descript,descriptAuth});
|
|
5
|
+
/*! Bundled license information:
|
|
6
|
+
|
|
7
|
+
mime-types/index.js:
|
|
8
|
+
(*!
|
|
9
|
+
* mime-types
|
|
10
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
11
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
12
|
+
* MIT Licensed
|
|
13
|
+
*)
|
|
14
|
+
*/
|
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":"AASA,OAAO,EAAE,YAAY,EAAgB,MAAM,YAAY,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,eAAO,MAAM,QAAQ,mHAyBnB,CAAC"}
|
package/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAAwE;AACxE,qEAA6D;AAC7D,iDAAqD;AACrD,yDAAmE;AACnE,iEAA0E;AAC1E,2DAAqE;AACrE,6DAAuE;AACvE,+DAAyE;AACzE,mEAA6E;AAC7E,qCAAwD;AAG/C,6FAHA,mBAAY,OAGA;AAFrB,gEAA2E;AAI9D,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,WAAW,EACT,8FAA8F;IAChG,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,IAAI,EAAE,mBAAY;IAClB,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;IAC5C,OAAO,EAAE;QACP,wCAAyB;QACzB,oCAAuB;QACvB,8CAA4B;QAC5B,2CAA0B;QAC1B,0CAA0B;QAC1B,sCAAwB;QACxB,IAAA,yCAAyB,EAAC;YACxB,OAAO,EAAE,GAAG,EAAE,CAAC,4BAA4B;YAC3C,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAA,mBAAY,EAAC,IAAI,CAAC,EAAE;iBAC9C,CAAC,CAAA;cAAA;SACH,CAAC;KACH;IACD,QAAQ,EAAE,CAAC,2CAA2B,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const descriptAgentEditAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
mode: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
3
|
-
project_id: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
4
|
-
project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
5
|
-
team_access: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
6
|
-
composition_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>> | import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
|
|
7
|
-
prompt: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
8
|
-
model: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
9
|
-
callback_url: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
10
|
-
}>;
|
|
11
|
-
//# sourceMappingURL=agent-edit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-edit.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/agent-edit.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB;;;;;;;;;EA2IlC,CAAC"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.descriptAgentEditAction = 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("../auth");
|
|
8
|
-
const common_1 = require("../common");
|
|
9
|
-
exports.descriptAgentEditAction = (0, pieces_framework_1.createAction)({
|
|
10
|
-
auth: auth_1.descriptAuth,
|
|
11
|
-
name: 'agent_edit',
|
|
12
|
-
displayName: 'Agent Edit (Underlord)',
|
|
13
|
-
description: 'Use Descript\'s AI agent "Underlord" to edit an existing project or create a new one with a natural language prompt.',
|
|
14
|
-
props: {
|
|
15
|
-
mode: pieces_framework_1.Property.StaticDropdown({
|
|
16
|
-
displayName: 'Mode',
|
|
17
|
-
description: 'Choose whether to edit an existing project or create a brand new one.',
|
|
18
|
-
required: true,
|
|
19
|
-
defaultValue: 'existing',
|
|
20
|
-
options: {
|
|
21
|
-
options: [
|
|
22
|
-
{ label: 'Edit existing project', value: 'existing' },
|
|
23
|
-
{ label: 'Create new project from prompt', value: 'new' },
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
}),
|
|
27
|
-
project_id: pieces_framework_1.Property.Dropdown({
|
|
28
|
-
auth: auth_1.descriptAuth,
|
|
29
|
-
displayName: 'Project',
|
|
30
|
-
description: 'Select the project for the agent to edit.',
|
|
31
|
-
refreshers: ['mode'],
|
|
32
|
-
required: false,
|
|
33
|
-
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, mode }) {
|
|
34
|
-
if (mode !== 'existing')
|
|
35
|
-
return {
|
|
36
|
-
disabled: true,
|
|
37
|
-
options: [],
|
|
38
|
-
placeholder: 'Not needed for new projects',
|
|
39
|
-
};
|
|
40
|
-
if (!auth)
|
|
41
|
-
return {
|
|
42
|
-
disabled: true,
|
|
43
|
-
options: [],
|
|
44
|
-
placeholder: 'Please connect your account first',
|
|
45
|
-
};
|
|
46
|
-
try {
|
|
47
|
-
const projects = yield common_1.descriptCommon.fetchAllProjects(common_1.descriptCommon.getAuthToken(auth));
|
|
48
|
-
return {
|
|
49
|
-
disabled: false,
|
|
50
|
-
options: projects.map((p) => ({ label: p.name, value: p.id })),
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
catch (_b) {
|
|
54
|
-
return {
|
|
55
|
-
disabled: true,
|
|
56
|
-
options: [],
|
|
57
|
-
placeholder: 'Failed to load projects. Check your connection.',
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
}),
|
|
62
|
-
project_name: pieces_framework_1.Property.ShortText({
|
|
63
|
-
displayName: 'New Project Name',
|
|
64
|
-
description: 'Name for the new project (only used when creating a new project).',
|
|
65
|
-
required: false,
|
|
66
|
-
}),
|
|
67
|
-
team_access: pieces_framework_1.Property.StaticDropdown({
|
|
68
|
-
displayName: 'Team Access',
|
|
69
|
-
description: 'Access level for team members on the new project. Only applies when creating a new project.',
|
|
70
|
-
required: false,
|
|
71
|
-
defaultValue: 'none',
|
|
72
|
-
options: {
|
|
73
|
-
options: [
|
|
74
|
-
{ label: 'None (private to owner)', value: 'none' },
|
|
75
|
-
{ label: 'View', value: 'view' },
|
|
76
|
-
{ label: 'Comment', value: 'comment' },
|
|
77
|
-
{ label: 'Edit', value: 'edit' },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
composition_id: common_1.descriptCommon.compositionIdProp(false),
|
|
82
|
-
prompt: pieces_framework_1.Property.LongText({
|
|
83
|
-
displayName: 'Prompt',
|
|
84
|
-
description: 'Natural language instruction for Underlord. Examples: "Add studio sound to every clip", "Remove all filler words", "Create a 30-second highlight reel with the best moments". Be specific — frame edits as a single one-shot instruction.',
|
|
85
|
-
required: true,
|
|
86
|
-
}),
|
|
87
|
-
model: pieces_framework_1.Property.ShortText({
|
|
88
|
-
displayName: 'AI Model',
|
|
89
|
-
description: 'AI model to use for editing. Leave blank to use the Descript default.',
|
|
90
|
-
required: false,
|
|
91
|
-
}),
|
|
92
|
-
callback_url: pieces_framework_1.Property.ShortText({
|
|
93
|
-
displayName: 'Callback URL',
|
|
94
|
-
description: 'Optional webhook URL. When the job finishes or fails, Descript will POST the job status to this URL (same payload as Get Job Status).',
|
|
95
|
-
required: false,
|
|
96
|
-
}),
|
|
97
|
-
},
|
|
98
|
-
run(context) {
|
|
99
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
const { mode, project_id, project_name, team_access, composition_id, prompt, model, callback_url, } = context.propsValue;
|
|
101
|
-
const body = { prompt };
|
|
102
|
-
if (mode === 'existing') {
|
|
103
|
-
if (!project_id)
|
|
104
|
-
throw new Error('Please select a project to edit.');
|
|
105
|
-
body['project_id'] = project_id;
|
|
106
|
-
if (composition_id)
|
|
107
|
-
body['composition_id'] = composition_id;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
if (!project_name)
|
|
111
|
-
throw new Error('Please enter a project name for the new project.');
|
|
112
|
-
body['project_name'] = project_name;
|
|
113
|
-
if (team_access)
|
|
114
|
-
body['team_access'] = team_access;
|
|
115
|
-
}
|
|
116
|
-
if (model)
|
|
117
|
-
body['model'] = model;
|
|
118
|
-
if (callback_url)
|
|
119
|
-
body['callback_url'] = callback_url;
|
|
120
|
-
const response = yield common_1.descriptCommon.descriptApiCall({
|
|
121
|
-
apiKey: common_1.descriptCommon.getAuthToken(context.auth),
|
|
122
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
123
|
-
path: '/jobs/agent',
|
|
124
|
-
body,
|
|
125
|
-
});
|
|
126
|
-
return response.body;
|
|
127
|
-
});
|
|
128
|
-
},
|
|
129
|
-
});
|
|
130
|
-
//# sourceMappingURL=agent-edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-edit.js","sourceRoot":"","sources":["../../../../src/lib/actions/agent-edit.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,kCAAuC;AACvC,sCAA2C;AAE9B,QAAA,uBAAuB,GAAG,IAAA,+BAAY,EAAC;IAClD,IAAI,EAAE,mBAAY;IAClB,IAAI,EAAE,YAAY;IAClB,WAAW,EAAE,wBAAwB;IACrC,WAAW,EACT,sHAAsH;IACxH,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,uBAAuB,EAAE,KAAK,EAAE,UAAU,EAAE;oBACrD,EAAE,KAAK,EAAE,gCAAgC,EAAE,KAAK,EAAE,KAAK,EAAE;iBAC1D;aACF;SACF,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,IAAI,EAAE,mBAAY;YAClB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,2CAA2C;YACxD,UAAU,EAAE,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAuB,EAAE,oDAAlB,EAAE,IAAI,EAAE,IAAI,EAAE;gBAC5B,IAAI,IAAI,KAAK,UAAU;oBACrB,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,6BAA6B;qBAC3C,CAAC;gBACJ,IAAI,CAAC,IAAI;oBACP,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,mCAAmC;qBACjD,CAAC;gBACJ,IAAI,CAAC;oBACH,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,gBAAgB,CACpD,uBAAc,CAAC,YAAY,CAAC,IAAI,CAAC,CAClC,CAAC;oBACF,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;qBAC/D,CAAC;gBACJ,CAAC;gBAAC,WAAM,CAAC;oBACP,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,iDAAiD;qBAC/D,CAAC;gBACJ,CAAC;YACH,CAAC,CAAA;SACF,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,kBAAkB;YAC/B,WAAW,EACT,mEAAmE;YACrE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,CAAC,cAAc,CAAC;YACnC,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,6FAA6F;YAC/F,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,EAAE,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,EAAE;oBACnD,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;oBAChC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;oBACtC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;iBACjC;aACF;SACF,CAAC;QACF,cAAc,EAAE,uBAAc,CAAC,iBAAiB,CAAC,KAAK,CAAC;QACvD,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,QAAQ;YACrB,WAAW,EACT,2OAA2O;YAC7O,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EACT,uIAAuI;YACzI,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EACJ,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,MAAM,EACN,KAAK,EACL,YAAY,GACb,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,MAAM,IAAI,GAA4B,EAAE,MAAM,EAAE,CAAC;YAEjD,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;gBACxB,IAAI,CAAC,UAAU;oBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;gBACrE,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC;gBAChC,IAAI,cAAc;oBAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAC;YAC9D,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,YAAY;oBACf,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;gBACtE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;gBACpC,IAAI,WAAW;oBAAE,IAAI,CAAC,aAAa,CAAC,GAAG,WAAW,CAAC;YACrD,CAAC;YAED,IAAI,KAAK;gBAAE,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;YACjC,IAAI,YAAY;gBAAE,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YAEtD,MAAM,QAAQ,GAAG,MAAM,uBAAc,CAAC,eAAe,CAKlD;gBACD,MAAM,EAAE,uBAAc,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC;gBACjD,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,aAAa;gBACnB,IAAI;aACL,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const descriptGetJobStatusAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
|
|
2
|
-
job_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
3
|
-
}>;
|
|
4
|
-
//# sourceMappingURL=get-job-status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-job-status.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-job-status.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,0BAA0B;;EAuBrC,CAAC"}
|