@activepieces/piece-camb-ai 0.1.5 → 0.1.7

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 CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/piece-camb-ai",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "dependencies": {
8
- "@activepieces/pieces-common": "0.12.3",
9
- "@activepieces/pieces-framework": "0.30.0",
10
- "@activepieces/shared": "0.87.1",
11
- "form-data": "4.0.4",
12
- "tslib": "2.3.0"
13
- },
14
- "scripts": {
15
- "build": "tsc -p tsconfig.lib.json && cp package.json dist/",
16
- "lint": "eslint 'src/**/*.ts'"
17
- }
6
+ "dependencies": {},
7
+ "files": [
8
+ "src/index.js",
9
+ "package.json",
10
+ "src/i18n"
11
+ ]
18
12
  }
package/src/index.js CHANGED
@@ -1,38 +1,20 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cambAi = 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 create_text_to_sound_1 = require("./lib/actions/create-text-to-sound");
8
- const create_text_to_speech_1 = require("./lib/actions/create-text-to-speech");
9
- const create_translation_1 = require("./lib/actions/create-translation");
10
- const create_transcription_1 = require("./lib/actions/create-transcription");
11
- const common_1 = require("./lib/common");
12
- const shared_1 = require("@activepieces/shared");
13
- const auth_1 = require("./lib/auth");
14
- exports.cambAi = (0, pieces_framework_1.createPiece)({
15
- displayName: "Camb.AI",
16
- auth: auth_1.cambaiAuth,
17
- minimumSupportedRelease: '0.36.1',
18
- logoUrl: "https://cdn.activepieces.com/pieces/camb-ai.png",
19
- authors: ['david-oluwaseun420', 'sanket-a11y'],
20
- categories: [shared_1.PieceCategory.ARTIFICIAL_INTELLIGENCE],
21
- actions: [
22
- create_text_to_sound_1.createTextToSound,
23
- create_text_to_speech_1.createTextToSpeech,
24
- create_translation_1.createTranslation,
25
- create_transcription_1.createTranscription,
26
- (0, pieces_common_1.createCustomApiCallAction)({
27
- auth: auth_1.cambaiAuth,
28
- baseUrl: () => common_1.API_BASE_URL,
29
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- return {
31
- 'x-api-key': auth.secret_text,
32
- };
33
- }),
34
- }),
35
- ],
36
- triggers: [],
37
- });
38
- //# sourceMappingURL=index.js.map
1
+ "use strict";var nu=Object.create;var tt=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var o=(e,t)=>tt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)tt(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of iu(t))!su.call(e,i)&&i!==r&&tt(e,i,{get:()=>t[i],enumerable:!(n=ou(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?nu(au(e)):{},xn(t||!e||!e.__esModule?tt(r,"default",{value:e,enumerable:!0}):r,e)),uu=e=>xn(tt({},"__esModule",{value:!0}),e);var Zo=E((Bo,Wt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,U;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(U=d-g,P=":";U--;)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 ee=s.split(":"),ae=[];for(let et=0;et<ee.length;et++)ae.push(parseInt(ee[et],16));return ae})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function y(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(y,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let _={};_.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,U;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(U=m[P],g&&U!==0)return null;U!==8&&(g=!0),d+=U}else return null;return 32-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return _.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),_.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.isIPv4=function(s){return this.parser(s)!==null},_.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},_.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv4.isValidFourPartDecimal=function(s){return!!(_.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},_.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!_.IPv4.isValidCIDR(s)||!d?!1:_.IPv4.isValidFourPartDecimal(d[1])},_.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},_.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},_.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},_.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let U=0;U<v.length;U++)g=v[U],P.push(x(g));return P})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=x(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=x(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(x(v[0])),P.push(x(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},_.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let U=7;U>=0;U-=1)if(v=this.parts[U],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return _.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(T(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new _.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),_.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},_.IPv6.isIPv6=function(s){return this.parser(s)!==null},_.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},_.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},_.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(U){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${U})`)}},_.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},_.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},_.IPv6.parser=function(s){let d,g,m,v,P,U;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(U=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+U,6),d.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},_.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},_.fromByteArray=function(s){let d=s.length;if(d===4)return new _.IPv4(s);if(d===16)return new _.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},_.isValid=function(s){return _.IPv6.isValid(s)||_.IPv4.isValid(s)},_.isValidCIDR=function(s){return _.IPv6.isValidCIDR(s)||_.IPv4.isValidCIDR(s)},_.parse=function(s){if(_.IPv6.isValid(s))return _.IPv6.parse(s);if(_.IPv4.isValid(s))return _.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},_.parseCIDR=function(s){try{return _.IPv6.parseCIDR(s)}catch{try{return _.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},_.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},_.subnetMatch=function(s,d,g){let m,v,P,U;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(U=P[m],s.kind()===U[0].kind()&&s.match.apply(s,U))return v}return g},typeof Wt<"u"&&Wt.exports?Wt.exports=_:e.ipaddr=_})(Bo)});var Vi=E((xA,Zi)=>{var Bi=require("stream").Stream,Vl=require("util");Zi.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");Vl.inherits(ce,Bi);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=Bi.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 qi=E((PA,Wi)=>{var Hl=require("util"),Gi=require("stream").Stream,Hi=Vi();Wi.exports=K;function K(){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(K,"CombinedStream");Hl.inherits(K,Gi);K.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};K.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};K.prototype.append=function(e){var t=K.isStreamLike(e);if(t){if(!(e instanceof Hi)){var r=Hi.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};K.prototype.pipe=function(e,t){return Gi.prototype.pipe.call(this,e,t),this.resume(),e};K.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}};K.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=K.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};K.prototype._pipeNext=function(e){this._currentStream=e;var t=K.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()};K.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};K.prototype.write=function(e){this.emit("data",e)};K.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};K.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")};K.prototype.end=function(){this._reset(),this.emit("end")};K.prototype.destroy=function(){this._reset(),this.emit("close")};K.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};K.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};K.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)};K.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Ji=E((TA,Ki)=>{"use strict";Ki.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 Qi=E(re=>{"use strict";var Yt=Ji(),Gl=require("path").extname,Xi=/^\s*([^;\s]*)(?:;|\s|$)/,Wl=/^text\//i;re.charset=Yi;re.charsets={lookup:Yi};re.contentType=ql;re.extension=Kl;re.extensions=Object.create(null);re.lookup=Jl;re.types=Object.create(null);Xl(re.extensions,re.types);function Yi(e){if(!e||typeof e!="string")return!1;var t=Xi.exec(e),r=t&&Yt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Wl.test(t[1])?"UTF-8":!1}o(Yi,"charset");function ql(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(ql,"contentType");function Kl(e){if(!e||typeof e!="string")return!1;var t=Xi.exec(e),r=t&&re.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Kl,"extension");function Jl(e){if(!e||typeof e!="string")return!1;var t=Gl("x."+e).toLowerCase().substr(1);return t&&re.types[t]||!1}o(Jl,"lookup");function Xl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Yt).forEach(o(function(i){var u=Yt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var y=r.indexOf(Yt[t[f]].source),x=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>x||y===x&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Xl,"populateMaps")});var ta=E(($A,ea)=>{ea.exports=Yl;function Yl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Yl,"defer")});var Wr=E((AA,na)=>{var ra=ta();na.exports=Ql;function Ql(e){var t=!1;return ra(function(){t=!0}),o(function(n,i){t?e(n,i):ra(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Ql,"async")});var qr=E((OA,oa)=>{oa.exports=ep;function ep(e){Object.keys(e.jobs).forEach(tp.bind(e)),e.jobs={}}o(ep,"abort");function tp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(tp,"clean")});var Kr=E((wA,aa)=>{var ia=Wr(),rp=qr();aa.exports=np;function np(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=op(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?rp(r):r.results[i]=c,n(u,r.results))})}o(np,"iterate");function op(e,t,r,n){var i;return e.length==2?i=e(r,ia(n)):i=e(r,t,ia(n)),i}o(op,"runJob")});var Jr=E((NA,sa)=>{sa.exports=ip;function ip(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(ip,"state")});var Xr=E((CA,ua)=>{var ap=qr(),sp=Wr();ua.exports=up;function up(e){Object.keys(this.jobs).length&&(this.index=this.size,ap(this),sp(e)(null,this.results))}o(up,"terminator")});var la=E((MA,ca)=>{var cp=Kr(),lp=Jr(),pp=Xr();ca.exports=dp;function dp(e,t,r){for(var n=lp(e);n.index<(n.keyedList||e).length;)cp(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 pp.bind(n,r)}o(dp,"parallel")});var Yr=E((jA,Qt)=>{var pa=Kr(),mp=Jr(),fp=Xr();Qt.exports=gp;Qt.exports.ascending=da;Qt.exports.descending=yp;function gp(e,t,r,n){var i=mp(e,r);return pa(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){pa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),fp.bind(i,n)}o(gp,"serialOrdered");function da(e,t){return e<t?-1:e>t?1:0}o(da,"ascending");function yp(e,t){return-1*da(e,t)}o(yp,"descending")});var fa=E((BA,ma)=>{var hp=Yr();ma.exports=vp;function vp(e,t,r){return hp(e,t,null,r)}o(vp,"serial")});var ya=E((VA,ga)=>{ga.exports={parallel:la(),serial:fa(),serialOrdered:Yr()}});var Qr=E((HA,ha)=>{"use strict";ha.exports=Object});var xa=E((GA,va)=>{"use strict";va.exports=Error});var Pa=E((WA,_a)=>{"use strict";_a.exports=EvalError});var Ta=E((qA,ba)=>{"use strict";ba.exports=RangeError});var Ea=E((KA,Ia)=>{"use strict";Ia.exports=ReferenceError});var Sa=E((JA,$a)=>{"use strict";$a.exports=SyntaxError});var er=E((XA,Aa)=>{"use strict";Aa.exports=TypeError});var Oa=E((YA,za)=>{"use strict";za.exports=URIError});var wa=E((QA,ka)=>{"use strict";ka.exports=Math.abs});var Na=E((ez,Ra)=>{"use strict";Ra.exports=Math.floor});var Ca=E((tz,Da)=>{"use strict";Da.exports=Math.max});var Ma=E((rz,Ua)=>{"use strict";Ua.exports=Math.min});var ja=E((nz,La)=>{"use strict";La.exports=Math.pow});var Ba=E((oz,Fa)=>{"use strict";Fa.exports=Math.round});var Va=E((iz,Za)=>{"use strict";Za.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=E((sz,Ha)=>{"use strict";var xp=Va();Ha.exports=o(function(t){return xp(t)||t===0?t:t<0?-1:1},"sign")});var qa=E((cz,Wa)=>{"use strict";Wa.exports=Object.getOwnPropertyDescriptor});var en=E((lz,Ka)=>{"use strict";var tr=qa();if(tr)try{tr([],"length")}catch{tr=null}Ka.exports=tr});var Xa=E((pz,Ja)=>{"use strict";var rr=Object.defineProperty||!1;if(rr)try{rr({},"a",{value:1})}catch{rr=!1}Ja.exports=rr});var tn=E((dz,Ya)=>{"use strict";Ya.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var ts=E((fz,es)=>{"use strict";var Qa=typeof Symbol<"u"&&Symbol,_p=tn();es.exports=o(function(){return typeof Qa!="function"||typeof Symbol!="function"||typeof Qa("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_p()},"hasNativeSymbols")});var rn=E((yz,rs)=>{"use strict";rs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var nn=E((hz,ns)=>{"use strict";var Pp=Qr();ns.exports=Pp.getPrototypeOf||null});var as=E((vz,is)=>{"use strict";var bp="Function.prototype.bind called on incompatible ",Tp=Object.prototype.toString,Ip=Math.max,Ep="[object Function]",os=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),$p=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),Sp=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");is.exports=o(function(t){var r=this;if(typeof r!="function"||Tp.apply(r)!==Ep)throw new TypeError(bp+r);for(var n=$p(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,os(n,arguments));return Object(x)===x?x:this}return r.apply(t,os(n,arguments))},"binder"),c=Ip(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+Sp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var Ge=E((_z,ss)=>{"use strict";var Ap=as();ss.exports=Function.prototype.bind||Ap});var nr=E((Pz,us)=>{"use strict";us.exports=Function.prototype.call});var on=E((bz,cs)=>{"use strict";cs.exports=Function.prototype.apply});var ps=E((Tz,ls)=>{"use strict";ls.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ms=E((Iz,ds)=>{"use strict";var zp=Ge(),Op=on(),kp=nr(),wp=ps();ds.exports=wp||zp.call(kp,Op)});var gs=E((Ez,fs)=>{"use strict";var Rp=Ge(),Np=er(),Dp=nr(),Cp=ms();fs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Np("a function is required");return Cp(Rp,Dp,t)},"callBindBasic")});var Ps=E((Sz,_s)=>{"use strict";var Up=gs(),ys=en(),vs;try{vs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var an=!!vs&&ys&&ys(Object.prototype,"__proto__"),xs=Object,hs=xs.getPrototypeOf;_s.exports=an&&typeof an.get=="function"?Up([an.get]):typeof hs=="function"?o(function(t){return hs(t==null?t:xs(t))},"getDunder"):!1});var $s=E((zz,Es)=>{"use strict";var bs=rn(),Ts=nn(),Is=Ps();Es.exports=bs?o(function(t){return bs(t)},"getProto"):Ts?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ts(t)},"getProto"):Is?o(function(t){return Is(t)},"getProto"):null});var sn=E((kz,Ss)=>{"use strict";var Mp=Function.prototype.call,Lp=Object.prototype.hasOwnProperty,jp=Ge();Ss.exports=jp.call(Mp,Lp)});var Ns=E((wz,Rs)=>{"use strict";var L,Fp=Qr(),Bp=xa(),Zp=Pa(),Vp=Ta(),Hp=Ea(),Je=Sa(),Ke=er(),Gp=Oa(),Wp=wa(),qp=Na(),Kp=Ca(),Jp=Ma(),Xp=ja(),Yp=Ba(),Qp=Ga(),ks=Function,un=o(function(e){try{return ks('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Tt=en(),ed=Xa(),cn=o(function(){throw new Ke},"throwTypeError"),td=Tt?(function(){try{return arguments.callee,cn}catch{try{return Tt(arguments,"callee").get}catch{return cn}}})():cn,We=ts()(),Y=$s(),rd=nn(),nd=rn(),ws=on(),It=nr(),qe={},od=typeof Uint8Array>"u"||!Y?L:Y(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":We&&Y?Y([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Bp,"%eval%":eval,"%EvalError%":Zp,"%Float16Array%":typeof Float16Array>"u"?L:Float16Array,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":ks,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&Y?Y(Y([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!Y?L:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Fp,"%Object.getOwnPropertyDescriptor%":Tt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":Vp,"%ReferenceError%":Hp,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!Y?L:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&Y?Y(""[Symbol.iterator]()):L,"%Symbol%":We?Symbol:L,"%SyntaxError%":Je,"%ThrowTypeError%":td,"%TypedArray%":od,"%TypeError%":Ke,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":Gp,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet,"%Function.prototype.call%":It,"%Function.prototype.apply%":ws,"%Object.defineProperty%":ed,"%Object.getPrototypeOf%":rd,"%Math.abs%":Wp,"%Math.floor%":qp,"%Math.max%":Kp,"%Math.min%":Jp,"%Math.pow%":Xp,"%Math.round%":Yp,"%Math.sign%":Qp,"%Reflect.getPrototypeOf%":nd};if(Y)try{null.error}catch(e){As=Y(Y(e)),Me["%Error.prototype%"]=As}var As,id=o(function e(t){var r;if(t==="%AsyncFunction%")r=un("async function () {}");else if(t==="%GeneratorFunction%")r=un("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=un("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return Me[t]=r,r},"doEval"),zs={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Et=Ge(),or=sn(),ad=Et.call(It,Array.prototype.concat),sd=Et.call(ws,Array.prototype.splice),Os=Et.call(It,String.prototype.replace),ir=Et.call(It,String.prototype.slice),ud=Et.call(It,RegExp.prototype.exec),cd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ld=/\\(\\)?/g,pd=o(function(t){var r=ir(t,0,1),n=ir(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var i=[];return Os(t,cd,function(u,c,l,f){i[i.length]=l?Os(f,ld,"$1"):c||u}),i},"stringToPath"),dd=o(function(t,r){var n=t,i;if(or(zs,n)&&(i=zs[n],n="%"+i[0]+"%"),or(Me,n)){var u=Me[n];if(u===qe&&(u=id(n)),typeof u>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Rs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(ud(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=pd(t),i=n.length>0?n[0]:"",u=dd("%"+i+"%",r),c=u.name,l=u.value,f=!1,y=u.alias;y&&(i=y[0],sd(n,ad([0,1],y)));for(var x=1,T=!0;x<n.length;x+=1){var _=n[x],s=ir(_,0,1),d=ir(_,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Je("property names with quotes must have matching quotes");if((_==="constructor"||!T)&&(f=!0),i+="."+_,c="%"+i+"%",or(Me,c))l=Me[c];else if(l!=null){if(!(_ in l)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(Tt&&x+1>=n.length){var g=Tt(l,_);T=!!g,T&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[_]}else T=or(l,_),l=l[_];T&&!f&&(Me[c]=l)}}return l},"GetIntrinsic")});var Cs=E((Nz,Ds)=>{"use strict";var md=tn();Ds.exports=o(function(){return md()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ls=E((Cz,Ms)=>{"use strict";var fd=Ns(),Us=fd("%Object.defineProperty%",!0),gd=Cs()(),yd=sn(),hd=er(),ar=gd?Symbol.toStringTag:null;Ms.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 hd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");ar&&(n||!yd(t,ar))&&(Us?Us(t,ar,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[ar]=r)},"setToStringTag")});var Fs=E((Mz,js)=>{"use strict";var vd=Function.prototype.call,xd=Object.prototype.hasOwnProperty,_d=Ge();js.exports=_d.call(vd,xd)});var Zs=E((Lz,Bs)=>{"use strict";Bs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var fn=E((jz,Hs)=>{"use strict";var mn=qi(),Pd=require("util"),ln=require("path"),bd=require("http"),Td=require("https"),Id=require("url").parse,Ed=require("fs"),$d=require("stream").Stream,Sd=require("crypto"),pn=Qi(),Ad=ya(),zd=Ls(),ke=Fs(),dn=Zs();function Vs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Vs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],mn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Pd.inherits(j,mn);j.LINE_BREAK=`\r
2
+ `;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=mn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ke(t,"httpVersion"))&&!(t instanceof $d))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ed.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Vs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&dn(c,r.header);var l;for(var f in c)if(ke(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Vs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=pn.lookup(e.name)),!r&&e&&e.path&&(r=pn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=pn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ke(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+Sd.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Ad.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Id(e),n=dn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=dn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Td.request(n):r=bd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(y,x){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,y,x)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};zd(j.prototype,"FormData");Hs.exports=j});var Md={};vn(Md,{cambAi:()=>Ud});module.exports=uu(Md);var cu=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let y=c.prototype,x=Object.keys(y);for(let T=0;T<x.length;T++){let _=x[T];_ in l||(l[_]=y[_].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let y=r?.Parent?new u:this;n(y,l),(f=y._zod).deferred??(f.deferred=[]);for(let x of y._zod.deferred)x();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var le=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},St=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ur={};function ge(e){return e&&Object.assign(ur,e),ur}o(ge,"config");function lr(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(lr,"getEnumValues");function Pn(e,t){return typeof t=="bigint"?t.toString():t}o(Pn,"jsonStringifyReplacer");function zt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(zt,"cached");function bn(e){return e==null}o(bn,"nullish");function Ot(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Ot,"cleanRegex");var _n=Symbol("evaluating");function J(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_n)return n===void 0&&(n=_n,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(J,"defineLazy");var pr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function rt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(rt,"isObject");var lu=zt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Tn(e){if(rt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(rt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Tn,"isPlainObject");var In=new Set(["string","number","symbol"]);function Le(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Le,"escapeRegex");function kt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(kt,"clone");function V(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(V,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var $n={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function je(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(je,"aborted");function Te(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Te,"prefixIssues");function At(e){return typeof e=="string"?e:e?.message}o(At,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=At(e.inst?._zod.def?.error?.(e))??At(t?.error?.(e))??At(r.customError?.(e))??At(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function Sn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Sn,"getLengthableOrigin");function dr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(dr,"issue");var An=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,Pn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=b("$ZodError",An),nt=b("$ZodError",An,{Parent:Error});var du=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 le;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ge())));throw pr(l,i?.callee),l}return c.value},"_parse"),wt=du(nt),mu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ge())));throw pr(l,i?.callee),l}return c.value},"_parseAsync"),Rt=mu(nt),fu=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 le;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>Ie(c,i,ge())))}:{success:!0,data:u.value}},"_safeParse"),ot=fu(nt),gu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,ge())))}:{success:!0,data:u.value}},"_safeParseAsync"),it=gu(nt);var yu="(?:(?:\\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])))",hu=new RegExp(`^${yu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,wn=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,Rn=/^(?:true|false)$/i;var Ee=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),vu={number:"number",bigint:"bigint",object:"date"};var Nn=b("$ZodCheckGreaterThan",(e,t)=>{Ee.init(e,t);let r=vu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Dn=b("$ZodCheckNumberFormat",(e,t)=>{Ee.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=$n[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=wn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Cn=b("$ZodCheckMinLength",(e,t)=>{var r;Ee.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(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=Sn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var fr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ee.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=()=>{})}),Un=b("$ZodCheckRegex",(e,t)=>{fr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Ln={major:4,minor:3,patch:6};var W=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ln;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let y=je(c),x;for(let T of l){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(y)continue;let _=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new le;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==_&&(y||(y=je(c,_)))});else{if(c.issues.length===_)continue;y||(y=je(c,_))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(je(c))return c.aborted=!0,c;let y=i(l,n,f);if(y instanceof Promise){if(f.async===!1)throw new le;return y.then(x=>e._zod.parse(x,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return y instanceof Promise?y.then(x=>u(x,c,l)):u(y,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new le;return f.then(y=>i(y,n,l))}return i(f,n,l)}}J(e,"~standard",()=>({validate:o(i=>{try{let u=ot(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return it(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ct=b("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),gr=b("$ZodStringFormat",(e,t)=>{fr.init(e,t),Ct.init(e,t)});var Vn=b("$ZodURL",(e,t)=>{gr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var yr=b("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??mr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=b("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),yr.init(e,t)}),hr=b("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=Rn,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}}),Gn=b("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=kn,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 Wn=b("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),qn=b("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Kn=b("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=b("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,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 jn(e,t,r){e.issues.length&&t.issues.push(...Te(r,e.issues)),t.value[r]=e.value}o(jn,"handleArrayResult");var Xn=b("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(y=>jn(y,r,c))):jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Dt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Te(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Dt,"handlePropertyResult");function xu(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=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(xu,"normalizeDef");function _u(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,y=f.def.type,x=f.optout==="optional";for(let T in t){if(l.has(T))continue;if(y==="never"){c.push(T);continue}let _=f.run({value:t[T],issues:[]},n);_ instanceof Promise?e.push(_.then(s=>Dt(s,r,T,t,x))):Dt(_,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(_u,"handleCatchall");var Yn=b("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=zt(()=>xu(t));J(e._zod,"propValues",()=>{let l=t.shape,f={};for(let y in l){let x=l[y]._zod;if(x.values){f[y]??(f[y]=new Set);for(let T of x.values)f[y].add(T)}}return f});let i=rt,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let y=l.value;if(!i(y))return l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l;l.value={};let x=[],T=c.shape;for(let _ of c.keys){let s=T[_],d=s._zod.optout==="optional",g=s._zod.run({value:y[_],issues:[]},f);g instanceof Promise?x.push(g.then(m=>Dt(m,l,_,y,d))):Dt(g,l,_,y,d)}return u?_u(x,y,l,f,n.value,e):x.length?Promise.all(x).then(()=>l):l}});function Fn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!je(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,ge())))}),t)}o(Fn,"handleUnionResults");var vr=b("$ZodUnion",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),J(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),J(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),J(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Ot(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)l.push(y),c=!0;else{if(y.issues.length===0)return y;l.push(y)}}return c?Promise.all(l).then(f=>Fn(f,i,e,u)):Fn(l,i,e,u)}});var Qn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,vr.init(e,t);let r=e._zod.parse;J(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let y of f)i[l].add(y)}}return i});let n=zt(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){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(!rt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var eo=b("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Tn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){l.add(typeof y=="number"?y.toString():y);let x=t.valueType._zod.run({value:i[y],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Te(y,T.issues)),r.value[y]=T.value})):(x.issues.length&&r.issues.push(...Te(y,x.issues)),r.value[y]=x.value)}let f;for(let y in i)l.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&mr.test(l)&&f.issues.length){let T=t.keyType._zod.run({value:Number(l),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>Ie(T,n,ge())),input:l,path:[l],inst:e});continue}let x=t.valueType._zod.run({value:i[l],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...Te(l,T.issues)),r.value[f.value]=T.value})):(x.issues.length&&r.issues.push(...Te(l,x.issues)),r.value[f.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=b("$ZodEnum",(e,t)=>{W.init(e,t);let r=lr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>In.has(typeof i)).map(i=>typeof i=="string"?Le(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=b("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Le(n):n?Le(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=b("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new St(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new le;return r.value=i,r}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Bn,"handleOptionalResult");var oo=b("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ot(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=>Bn(u,r.value)):Bn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=b("$ZodNullable",(e,t)=>{W.init(e,t),J(e._zod,"optin",()=>t.innerType._zod.optin),J(e._zod,"optout",()=>t.innerType._zod.optout),J(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ot(r.source)}|null)$`):void 0}),J(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=b("$ZodPipe",(e,t)=>{W.init(e,t),J(e._zod,"values",()=>t.in._zod.values),J(e._zod,"optin",()=>t.in._zod.optin),J(e._zod,"optout",()=>t.out._zod.optout),J(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>Nt(c,t.in,n)):Nt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Nt(u,t.out,n)):Nt(i,t.out,n)}});function Nt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Nt,"handlePipeResult");var so=b("$ZodCustom",(e,t)=>{Ee.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Zn(u,r,n,e));Zn(i,r,n,e)}});function Zn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(dr(i))}}o(Zn,"handleRefineResult");var co;var xr=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 lo(){return new xr}o(lo,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=lo());var _r=globalThis.__zod_globalRegistry;function po(e,t){return new e({type:"string",...V(t)})}o(po,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...V(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...V(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(xo,"_coercedBoolean");function _o(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(_o,"_coercedBigint");function Po(e){return new e({type:"any"})}o(Po,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function To(e,t){return new e({type:"void",...V(t)})}o(To,"_void");function Io(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(Io,"_coercedDate");function Ut(e,t){return new Nn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Ut,"_gte");function se(e,t){return new Cn({check:"min_length",...V(t),minimum:e})}o(se,"_minLength");function $e(e,t){return new Un({check:"string_format",format:"regex",...V(t),pattern:e})}o($e,"_regex");function Eo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var X=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>wt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ot(e,r,n),e.parseAsync=async(r,n)=>Rt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>it(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>kt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Lt=b("ZodMiniString",(e,t)=>{Ct.init(e,t),X.init(e,t)});function a(e){return po(Lt,e)}o(a,"string");var $o=b("ZodMiniStringFormat",(e,t)=>{gr.init(e,t),Lt.init(e,t)});var Ru=b("ZodMiniURL",(e,t)=>{Vn.init(e,t),$o.init(e,t)});function So(e){return fo(Ru,e)}o(So,"url");var jt=b("ZodMiniNumber",(e,t)=>{yr.init(e,t),X.init(e,t)});function te(e){return go(jt,e)}o(te,"number");var Nu=b("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),jt.init(e,t)});function Ao(e){return ho(Nu,e)}o(Ao,"int");var Pr=b("ZodMiniBoolean",(e,t)=>{hr.init(e,t),X.init(e,t)});function B(e){return vo(Pr,e)}o(B,"boolean");var zo=b("ZodMiniBigInt",(e,t)=>{Gn.init(e,t),X.init(e,t)});var Du=b("ZodMiniAny",(e,t)=>{Wn.init(e,t),X.init(e,t)});function st(){return Po(Du)}o(st,"any");var Cu=b("ZodMiniUnknown",(e,t)=>{qn.init(e,t),X.init(e,t)});function k(){return bo(Cu)}o(k,"unknown");var Uu=b("ZodMiniVoid",(e,t)=>{Kn.init(e,t),X.init(e,t)});function Oo(e){return To(Uu,e)}o(Oo,"_void");var ko=b("ZodMiniDate",(e,t)=>{Jn.init(e,t),X.init(e,t)});var Mu=b("ZodMiniArray",(e,t)=>{Xn.init(e,t),X.init(e,t)});function N(e,t){return new Mu({type:"array",element:e,...V(t)})}o(N,"array");var Lu=b("ZodMiniObject",(e,t)=>{Yn.init(e,t),X.init(e,t),J(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...V(t)};return new Lu(r)}o(p,"object");var ju=b("ZodMiniUnion",(e,t)=>{vr.init(e,t),X.init(e,t)});function D(e,t){return new ju({type:"union",options:e,...V(t)})}o(D,"union");var Fu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),X.init(e,t)});function Se(e,t,r){return new Fu({type:"union",options:t,discriminator:e,...V(r)})}o(Se,"discriminatedUnion");var Bu=b("ZodMiniRecord",(e,t)=>{eo.init(e,t),X.init(e,t)});function w(e,t,r){return new Bu({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var Zu=b("ZodMiniEnum",(e,t)=>{to.init(e,t),X.init(e,t),e.options=Object.values(t.entries)});function M(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Zu({type:"enum",entries:r,...V(t)})}o(M,"_enum");var Vu=b("ZodMiniLiteral",(e,t)=>{ro.init(e,t),X.init(e,t)});function $(e,t){return new Vu({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o($,"literal");var Hu=b("ZodMiniTransform",(e,t)=>{no.init(e,t),X.init(e,t)});function Ae(e){return new Hu({type:"transform",transform:e})}o(Ae,"transform");var Gu=b("ZodMiniOptional",(e,t)=>{oo.init(e,t),X.init(e,t)});function h(e){return new Gu({type:"optional",innerType:e})}o(h,"optional");var Wu=b("ZodMiniNullable",(e,t)=>{io.init(e,t),X.init(e,t)});function ut(e){return new Wu({type:"nullable",innerType:e})}o(ut,"nullable");var qu=b("ZodMiniPipe",(e,t)=>{ao.init(e,t),X.init(e,t)});function ze(e,t){return new qu({type:"pipe",in:e,out:t})}o(ze,"pipe");var Ku=b("ZodMiniCustom",(e,t)=>{so.init(e,t),X.init(e,t)});function Ft(e,t){return Eo(Ku,e??(()=>!0),t)}o(Ft,"custom");var ct={};vn(ct,{bigint:()=>tc,boolean:()=>ec,date:()=>rc,number:()=>Qu,string:()=>Yu});function Yu(e){return mo(Lt,e)}o(Yu,"string");function Qu(e){return yo(jt,e)}o(Qu,"number");function ec(e){return xo(Pr,e)}o(ec,"boolean");function tc(e){return _o(zo,e)}o(tc,"bigint");function rc(e){return Io(ko,e)}o(rc,"date");var Tr=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),br=class{constructor(t,r,n,i,u,c,l,f,y,x,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=y;this.audience=x;this.aiMetadata=T}static{o(this,"IAction")}},pe=o(e=>new br(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:$(t),required:B(),defaultValue:h(st())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),ye=p({...F.shape,...C(a(),"LONG_TEXT").shape});var Ro=p({label:a(),value:k()}),Bt=p({disabled:h(B()),placeholder:h(a()),options:N(Ro)});var oe=p({...F.shape,options:Bt,...C(k(),"STATIC_DROPDOWN").shape}),he=p({...F.shape,options:Bt,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Ir=p({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),lt=p({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=p({...F.shape,...C(B(),"CHECKBOX").shape});var xe=p({...F.shape,...C(te(),"NUMBER").shape});var pt=p({...F.shape,streaming:h(B()),...C(k(),"FILE").shape});var dt=p({...F.shape,...C(a(),"DATE_TIME").shape});var No=w(a(),D([ne,ye,oe,lt,he,ve,xe,pt,dt])),mt=p({...F.shape,properties:No,...C(N(k()),"ARRAY").shape});var ft=p({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var Do=D([ne,oe,ft,mt,he]),oc=w(a(),Do),Er=p({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Zt=p({...F.shape,...C(Oo(),"MARKDOWN").shape});var gt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(gt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Be=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Be||{});var yt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(yt||{}),$r="both_client_credentials_and_authorization_code";var Ne=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ne||{}),ht=(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))(ht||{}),ic=p({strategy:M(ht),paramName:h(a())}),vt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(vt||{});var Vt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Vt||{}),Co=p({status:h(te()),body:h(k()),headers:h(w(a(),a()))}),Uo=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(M(Vt))}),Mo=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Co,handlerId:h(a()),streamStepProgress:h(M(Vt))}),ac=D([Uo,Mo]);var sc=p({body:k(),rawBody:h(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ue(e){return e==null}o(ue,"isNil");function xt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(xt,"isEmpty");function Ht(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ht,"assertNotNullOrUndefined");var Sr=Re(require("crypto"),1);var uc=128,De,Ze,cc=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*uc),Sr.default.randomFillSync(De),Ze=0):Ze+e>De.length&&(Sr.default.randomFillSync(De),Ze=0),Ze+=e},"fillPool"),lc=o(e=>(cc(e|=0),De.subarray(Ze-e,Ze)),"random"),pc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),jo=o((e,t=21)=>pc(e,t,lc),"customAlphabet");var dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fo=21,xb=a().check($e(new RegExp(`^[0-9a-zA-Z]{${Fo}}$`))),mc=jo(dc,Fo);var Oe=ze(Ae(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Oe,updated:Oe},G=o(e=>h(ut(e)),"Nullable");function Ar(e){return h(ut(M(e)))}o(Ar,"NullableEnum");var bb=ze(Ae(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Gt=o(e=>ze(Ae(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var Eb=w(a(),k());var _t=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(_t||{});var Ub=a().check($e(/^#[0-9A-Fa-f]{6}$/));var Lb=p({filename:a(),data:k(),type:$("file"),mimetype:h(a())});var fc=Re(Zo());var Gb=p({...ie,name:a(),permissions:N(a()),platformId:G(a()),type:a(),userCount:h(te())});var Vo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Vo||{}),zr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(zr||{}),Or=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Or||{});var kr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(kr||{});var wr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(wr||{});var gc=p({mode:M(Vo),value:k()}),yc=p({auth:h(a()),fields:w(a(),gc)}),hc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(yc)}),vc=p({type:$("PIECE"),toolName:a().check(se(1)),pieceMetadata:hc}),xc=p({type:$("none")}),_c=p({type:$("access_token"),accessToken:a()}),Pc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),bc=p({type:$("headers"),headers:w(a(),a())}),Tc=Se("type",[xc,_c,Pc,bc]),Ho=p({type:$("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:h(a())}),Go=p({type:$("MCP"),toolName:a().check(se(1)),serverUrl:So(),protocol:M(Or),auth:Tc}),Wo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:M(zr),sourceId:a(),sourceName:a()}),Ic=Se("type",[vc,Ho,Go,Wo]),Ec=p({displayName:a(),description:h(a()),type:M(kr)}),qo=p({type:$("MARKDOWN"),markdown:a()}),Ve={type:$("TOOL_CALL"),input:G(w(a(),k())),output:h(k()),toolName:a(),status:M(wr),toolCallId:a(),startTime:a(),endTime:h(a())},TT=p(Ve),Ko=Se("toolCallType",[p({...Ve,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ve,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ve,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...Ve,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ve,toolCallType:$("UNKNOWN"),displayName:a()})]),$c=D([qo,Ko]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),_e=p({apiKey:a()}),Sc=_e,Ac=p({apiKey:a(),apiKeyHash:a()}),zc=_e,Oc=_e,kc=_e,wc=_e,Rc=_e,Nc=_e,Dc=_e,ei=p({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Cc=p({}),Uc=p({}),Mc=p({}),Lc=p({}),jc=p({}),Fc=p({}),ti=p({modelId:a(),modelName:a(),modelType:M(Rr)}),ri=p({apiKeyHeader:a(),baseUrl:a(),models:N(ti),defaultHeaders:h(w(a(),a()))}),ni=p({accountId:a(),gatewayId:a(),models:N(ti),vertexProject:h(a()),vertexRegion:h(a())}),oi=p({resourceName:a(),apiVersion:ze(Ae(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ii=p({region:a().check(se(1))}),Bc=D([Sc,kc,wc,Rc,Nc,Oc,zc,Ac,ei,Dc]),ai=D([ri,ni,oi,ii,Cc,Mc,Lc,jc,Uc,Fc]),Zc=p({id:a(),name:a(),type:M(Rr)}),Vc=p({id:a(),name:a(),provider:M(_t),config:ai,enabledForChat:B()}),Hc=p({provider:M(_t),config:ai,auth:Bc,platformId:a()});var ST={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Jo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Gc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Wc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Xo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],qc=["grok-4.20","grok-4.1-fast"],Kc={openai:Jo,anthropic:Gc,google:Xo,activepieces:[...Wc.map(e=>`anthropic/${e}`),...Jo.map(e=>`openai/${e}`),...Xo.map(e=>`google/${e}`),...qc.map(e=>`x-ai/${e}`)]};var Yo=128e3,Jc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Xc({provider:e}){return e?Jc[e]??Yo:Yo}o(Xc,"getMaxContextTokens");var Qo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Yc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Qc=new Set(["anthropic","mistral"]);function de(e){return{chatModels:Kc[e],maxContextTokens:Xc({provider:e}),defaultEmbeddingModel:Qo[e],supportsEmbedding:Qo[e]!==void 0,supportsImageGeneration:!Qc.has(e),webSearch:Yc[e]}}o(de,"buildProviderCapabilities");var el={openai:de("openai"),anthropic:de("anthropic"),openrouter:de("openrouter"),azure:de("azure"),google:de("google"),"cloudflare-gateway":de("cloudflare-gateway"),custom:de("custom"),bedrock:de("bedrock"),mistral:de("mistral"),activepieces:de("activepieces")};var tl=p({base64Url:a(),fileName:a(),extension:h(a())}),rl=p({mimeType:a(),url:a(),fileName:h(a())}),Nr=D([tl,rl]);var nl=D([p({type:$("file"),value:Nr}),p({type:$("markdown"),value:a(),files:h(N(Nr))})]),ol=p({sessionId:a(),message:a(),files:h(N(a()))});var ui=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ui||{}),ci=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ci||{}),Dr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Dr||{});var il=D([p({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),al=p({...ie,name:a(),folderId:G(a()),projectId:a(),externalId:a(),status:Ar(ci),trigger:Ar(ui)}),sl=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),ul=p({events:N(M(Dr)),webhookUrl:a(),flowId:a()}),cl=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),ll=p({projectId:a(),limit:h(ct.number()),cursor:h(a()),name:h(a()),externalIds:Gt(a()),folderId:h(a()),folderIds:Gt(a())}),pl=p({records:N(N(p({fieldId:a(),value:pi()}))),tableId:a()}),dl=p({cells:h(N(p({fieldId:a(),value:pi()}))),tableId:a(),agentUpdate:h(B())}),li=Se("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),si("exists"),si("not_exists")]),ml=p({tableId:a(),limit:h(ct.number()),cursor:h(a()),filters:Gt(li)});function pi(){return ze(Ae(e=>e==null?e:String(e)),ut(a()))}o(pi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ce,"valueFilter");function si(e){return p({fieldId:a(),operator:$(e)})}o(si,"existenceFilter");var fl=p({status:h(te()),body:h(k()),headers:h(w(a(),a()))}),gl=p({...ie,deleted:G(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:G(a())});var di=p({name:a(),description:h(a()),type:a(),required:B()}),yl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(di),returnsResponse:B()})});var mi="^[0-9]+\\.[0-9]+\\.[0-9]+$",GT=new RegExp(mi),vl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",WT=a().check($e(new RegExp(mi))),qT=a().check($e(new RegExp(vl))),xl=p({packageType:$("ARCHIVE"),pieceType:M(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),fi=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),gi=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),KT=D([fi,gi]),JT=D([xl,fi,gi]);var _l=Se("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:Ao().check(Ut(6e4))})]),XT=p({...ie,type:M(Ne),projectId:a(),flowId:a(),triggerName:a(),schedule:G(_l),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:G(a()),simulate:B()}),yi=(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))(yi||{}),hi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(hi||{}),vi=(r=>(r.S3="S3",r.DB="DB",r))(vi||{}),YT=p({...ie,projectId:G(a()),platformId:G(a()),type:M(yi),compression:M(hi),data:h(k()),location:M(vi),size:G(te()),fileName:G(a()),s3Key:G(a()),metadata:G(w(a(),a()))}),xi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(xi||{}),_i=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(_i||{}),QT=p({id:a(),email:a(),firstName:a(),status:M(_i),externalId:G(a()),platformId:G(a()),platformRole:M(xi),lastName:a(),created:Oe,updated:Oe,lastActiveDate:G(Oe),imageUrl:G(a())});var Cr=p({...F.shape,...C(w(a(),k()),"OBJECT").shape});var Ii=p({...F.shape,...C(a(),"COLOR").shape});var Ur=D([ne,ye,Zt,ve,oe,he,Ir,lt,Er,xe,mt,Cr,ft,dt,pt,Ii]),S={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var me=p({displayName:a(),description:h(a())});var Ei=p({username:a(),password:a()}),Mr=p({...me.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(Ei,"BASIC_AUTH").shape});var Il=w(a(),D([ne,ye,xe,ve,oe])),Lr=p({...me.shape,props:Il,...C(k(),"CUSTOM_AUTH").shape});var Ue=p({...me.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var El=w(a(),D([ne,ye,Ue,xe,ve,oe,he,Zt])),$i=p({...me.shape,props:El,...C(k(),"OIDC").shape});var jr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(jr||{}),Si=D([ne,Ue,oe]),Ai=w(a(),Si),$l=p({props:h(w(a(),Si)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(B()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(M(jr)),grantType:h(D([M(yt),$($r)])),extra:h(w(a(),a()))}),zi=p({access_token:a(),props:h(Ai),data:w(a(),st())}),Fr=p({...me.shape,...$l.shape,...C(zi,"OAUTH2").shape});var He=D([Mr,Lr,$i,Fr,Ue]),Pt="Connection",Br={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Pt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Pt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Pt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Pt}},None(){}};var kE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var Sl=p({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Al=D([Ur,He]),Zr=w(a(),Al),XE=w(a(),Ur);var Oi=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]);var ki="2",qt="0.82.0";var Vr=class{constructor(t,r,n,i,u,c,l,f,y=qt,x,T="",_){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=x;this.description=T;this.deprecated=_;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:ki}),"getContextInfo");(!zl(y)||Ol(y,qt))&&(this.minimumSupportedRelease=qt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},wi=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 Vr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function zl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(zl,"isValidSimpleSemver");function Ol(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(Ol,"isSemverLessThan");var kl=h(w(a(),w(a(),a()))),Ri=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([He,N(He)])),version:a(),categories:h(N(M(Be))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(B()),i18n:kl}),wl=M(["human","ai","both"]),Ni=p({description:h(a()),idempotent:h(B())}),Di=p({name:a(),displayName:a(),description:a(),props:Zr,requireAuth:B(),errorHandlingOptions:h(Tr),outputSchema:h(Ft()),audience:h(wl),aiMetadata:h(Ni)}),Ci=p({name:a(),displayName:a(),description:a(),props:Zr,errorHandlingOptions:h(Tr),type:M(Ne),sampleData:k(),handshakeConfiguration:h(Ft()),renewConfiguration:h(Oi),testStrategy:M(vt),outputSchema:h(Ft()),aiMetadata:h(Ni)}),Rl=p({...Ri.shape,actions:w(a(),Di),triggers:w(a(),Ci)}),Nl=p({...Ri.shape,actions:te(),triggers:te(),suggestedActions:h(N(Di)),suggestedTriggers:h(N(Ci))}),Ui=p({projectUsage:te(),pieceType:M(Fe),packageType:M(gt),platformId:h(a()),archiveId:h(a())}),X$=p({...Rl.shape,...Ui.shape}),Y$=p({...Nl.shape,...Ui.shape}),Q$=p({name:a(),version:a()});var Dl=Re(require("path")),Cl=Re(require("fs/promises"));var Fi=require("node:stream");var Kt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Jt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new Gr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Gr=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 bt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Mi({error:e,requestBody:t}){return e instanceof bt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Mi,"toFailsafeOutput");var Pe=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Pe||{});var Xt=class extends Kt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Jt){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[U,ee]of Object.entries(c))i.append(U,ee);let l=i.toString(),f=l?`${n}?${l}`:n,y=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:_,extraHeaders:s,isStream:d}=Ul(t.method)?Ml(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=jl({...u,...s}),m=await Ll(async()=>{let U=new AbortController,ee=t.timeout&&t.timeout>0?setTimeout(()=>U.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:g,body:_,redirect:x?"follow":"manual",signal:U.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{ee!==void 0&&clearTimeout(ee)}},T),v=x?300:400;if(m.status<200||m.status>=v){let U=await Li(m,y),ee=new bt(t.body,{status:m.status,responseBody:U});throw console.error("[HttpClient#(sanitized error message)] Request failed:",ee),ee}let P=await Li(m,y);return{status:m.status,headers:Fl(m.headers),body:P}}};function Ul(e){return e!=="GET"&&e!=="HEAD"}o(Ul,"acceptsRequestBody");function Ml(e,t){if(Zl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Bl(e)){let n=new Fi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Ml,"serializeBody");async function Li(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Li,"parseResponseBody");async function Ll(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await ji(n);continue}return i}catch(i){if(r=i,n<t){await ji(n);continue}throw i}throw r}o(Ll,"sendWithRetries");function ji(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(ji,"backoff");function jl(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(jl,"normalizeHeaders");function Fl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Fl,"toHttpHeaders");function Bl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Bl,"isNodeFormData");function Zl(e){return e==null}o(Zl,"isNil");var Z=new Xt;var Od=Re(require("fs")),Gs=Re(fn());var kd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function wd(e){let t=e.split(";")[0].trim().toLowerCase();return kd[t]??""}o(wd,"contentTypeToExtension");var Rd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Nd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return pe({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Nd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Pe).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let x=y,T={};switch(x){case"none":break;case"json":T.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async y=>{let{method:x,url:T,headers:_,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:U}=y.propsValue;Ht(x,"Method"),Ht(T,"URL");let ee=ue(r)?{}:await r(y.auth,y.propsValue),ae=T.url,et=ae.startsWith("http://")||ae.startsWith("https://")?ae:Rd({baseUrl:t(y.auth),relativePath:ae}),be={method:x,url:et,headers:{..._??{},...f==="headers"||!ue(f)?ee:{}},queryParams:{...f==="queryParams"?ee:{},...s??{}},timeout:v?v*1e3:0,followRedirects:U};if(P&&(be.responseType="arraybuffer"),d)if(g&&g!=="none"){let fe=d.data;if(g==="form_data"){let ru=fe,$t=new Gs.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:sr}of ru)yn==="text"&&!xt(hn)?$t.append(gn,hn):yn==="file"&&!xt(sr)&&$t.append(gn,sr.data,{filename:sr?.filename});be.body=$t,be.headers={...be.headers,...$t.getHeaders()}}else be.body=fe}else g||(be.body=d);try{let fe=await Z.sendRequest(be);return await Dd(y.files,fe.body,fe.status,fe.headers,P)}catch(fe){if(m)return Mi({error:fe,requestBody:be.body});throw fe}},"run")})}o(Ws,"createCustomApiCallAction");var Dd=o(async(e,t,r,n,i)=>{let u;if(i&&Cd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=wd(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.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Cd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var H="https://client.camb.ai/apis",we=5e3;var Xe=10,qs=120,Ks=S.Dropdown({auth:Q,displayName:"Voice",description:"Select the voice to generate the speech.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${H}/list-voices`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.voice_name,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Ye=S.Dropdown({auth:Q,displayName:"Source Language",description:"Select the original language of the input text.",required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${H}/source-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Js=S.Dropdown({displayName:"Target Language",description:"Select the language to translate the text into.",auth:Q,required:!0,refreshers:[],options:o(async({auth:e})=>e?{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${H}/target-languages`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:`${n.language} (${n.short_name})`,value:n.id}))}:{disabled:!0,options:[],placeholder:"Please authenticate first"},"options")}),Qe=S.Dropdown({displayName:"Folder",auth:Q,description:"Select the folder to save the task in.",required:!1,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[],placeholder:"Please authenticate first"};try{return{disabled:!1,options:((await Z.sendRequest({method:"GET",url:`${H}/folders`,headers:{"x-api-key":e.secret_text}})).body??[]).map(n=>({label:n.folder_name,value:n.folder_id}))}}catch{return{disabled:!0,options:[],placeholder:"Could not load folders."}}},"options")});var Q=Br.SecretText({displayName:"API Key",description:`
4
+ To get your API key, please follow these steps:
5
+ 1. Log in to your [CAMB.AI Studio](https://camb.ai/studio/) account.
6
+ 2. Navigate to your workspace's API Keys dashboard.
7
+ 3. Create a new key if you haven't already.
8
+ 4. Copy the API key and paste it here.
9
+ `,required:!0,validate:o(async({auth:e})=>{try{return await Z.sendRequest({method:"GET",url:`${H}/source-languages`,headers:{"x-api-key":e}}),{valid:!0}}catch{return{valid:!1,error:"Invalid API Key."}}},"validate")});var Xs=pe({auth:Q,name:"create_text_to_sound",displayName:"Create Text-to-Sound",description:"Convert input text into \u201Csound effects\u201D using an AI model.",audience:"both",aiMetadata:{description:"Generates a sound-effect audio clip from a text prompt describing the desired effect using Camb.AI, polling until the generation task completes and returning the audio. Use to synthesize non-speech sound effects (not spoken voice \u2014 use Create Text-to-Speech for that). Duration is capped at 10 seconds (defaults to 8). Not idempotent: each call starts a new generation task and produces fresh audio.",idempotent:!1},props:{prompt:S.LongText({displayName:"Prompt",description:"A clear, descriptive explanation of the desired audio effect. Concise prompts yield more accurate results.",required:!0}),duration:S.Number({displayName:"Duration (seconds)",description:"The desired length of the audio in seconds (max 10). Defaults to 8 if not set.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Qe},async run(e){let{auth:t}=e,{prompt:r,duration:n,project_name:i,project_description:u,folder_id:c}=e.propsValue,l={prompt:r};n&&(l.duration=n),i&&(l.project_name=i),u&&(l.project_description=u),c&&(l.folder_id=c);let y=(await Z.sendRequest({method:"POST",url:`${H}/text-to-sound`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:l})).body.task_id,x=0,T=null;for(;x<Xe;){let s=await Z.sendRequest({method:"GET",url:`${H}/text-to-sound/${y}`,headers:{"x-api-key":t.secret_text}}),d=s.body.status;if(d==="SUCCESS"){T=s.body.run_id??null;break}if(d==="FAILED")throw new Error(`Sound generation task failed: ${JSON.stringify(s.body)}`);await new Promise(g=>setTimeout(g,we)),x++}if(!T)throw new Error("Sound generation task timed out or failed to return a run_id.");return{audio:(await Z.sendRequest({method:"GET",url:`${H}/text-to-sound-result/${T}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"})).body}}});var Ys=pe({auth:Q,name:"create_text_to_speech",displayName:"Create Text-to-Speech",description:"Convert text into speech using a specified voice, language, gender, and age group.",audience:"both",aiMetadata:{description:"Synthesizes spoken-voice audio from text via Camb.AI text-to-speech, polling until the task completes and writing the resulting WAV to a file. Requires a language and a voice_id (both selected from Camb.AI dropdowns); optionally tune gender and age. Use for spoken narration/dialogue; for non-speech sound effects use Create Text-to-Sound instead. Not idempotent: each call starts a new synthesis task and produces a new audio file.",idempotent:!1},props:{text:S.LongText({displayName:"Text",description:"The text to be converted to speech.",required:!0}),language:Ye,voice_id:Ks,gender:S.StaticDropdown({displayName:"Gender",description:"The gender of the speaker.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:S.Number({displayName:"Age",description:"The age of the speaker to be generated.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Qe},async run(e){let{auth:t}=e,{text:r,language:n,voice_id:i,gender:u,age:c,project_name:l,project_description:f,folder_id:y}=e.propsValue,x={text:r,language:Number(n),voice_id:Number(i)};u!==void 0&&(x.gender=u),c&&(x.age=c),l&&(x.project_name=l),f&&(x.project_description=f),y&&(x.folder_id=y);let _=(await Z.sendRequest({method:"POST",url:`${H}/tts`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:x})).body.task_id,s=0,d=null;for(;s<Xe;){let U=await Z.sendRequest({method:"GET",url:`${H}/tts/${_}`,headers:{"x-api-key":t.secret_text}});if(U.body.status==="SUCCESS"){d=U.body.run_id??null;break}if(U.body.status==="FAILED")throw new Error(`Text-to-Speech task failed: ${JSON.stringify(U.body)}`);await new Promise(ee=>setTimeout(ee,we)),s++}if(!d)throw new Error("Text-to-Speech task timed out or failed to return a run_id.");let g=await Z.sendRequest({method:"GET",url:`${H}/tts-result/${d}`,headers:{"x-api-key":t.secret_text},responseType:"arraybuffer"}),m=`speech_${d}.wav`,v=Buffer.from(g.body);return{message:"Speech generated successfully.",audio_url:await e.files.write({fileName:m,data:v}),run_id:d}}});var Qs=pe({auth:Q,name:"create_translation",displayName:"Create Translation",description:"Translate text from a source language to a target language.",audience:"both",aiMetadata:{description:"Translates text from a source language to a target language via Camb.AI, polling until the translation task completes. Each input line is treated as a separate segment to translate, and both languages are chosen from Camb.AI dropdowns; optionally tune formality, gender, and target audience age. Use for text translation only (not audio \u2014 use Create Transcription for speech-to-text). Not idempotent: each call starts a new translation task.",idempotent:!1},props:{texts:S.LongText({displayName:"Text to Translate",description:"The text to be translated. You can enter multiple lines; each line will be treated as a separate text segment.",required:!0}),source_language:Ye,target_language:Js,formality:S.StaticDropdown({displayName:"Formality",description:"Adjust the formality level to match your context.",required:!1,options:{options:[{label:"Formal",value:1},{label:"Informal",value:2}]}}),gender:S.StaticDropdown({displayName:"Gender",description:"Specify grammatical gender preferences when relevant in the target language.",required:!1,options:{options:[{label:"Male",value:1},{label:"Female",value:2},{label:"Neutral",value:0},{label:"Unspecified",value:9}]}}),age:S.Number({displayName:"Audience Age",description:"Helps adjust vocabulary and expressions to be age-appropriate.",required:!1}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1})},async run(e){let{auth:t}=e,{texts:r,source_language:n,target_language:i,formality:u,gender:c,age:l,project_name:f}=e.propsValue,y={texts:r.split(`
10
+ `).filter(g=>g.trim().length>0),source_language:Number(n),target_language:Number(i)};u!==void 0&&(y.formality=u),c!==void 0&&(y.gender=c),l&&(y.age=l),f&&(y.project_name=f);let T=(await Z.sendRequest({method:"POST",url:`${H}/translate`,headers:{"x-api-key":t.secret_text,"Content-Type":"application/json"},body:y})).body.task_id,_=null,s=0;for(;s<Xe;){let g=await Z.sendRequest({method:"GET",url:`${H}/translate/${T}`,headers:{"x-api-key":t.secret_text}});if(g.body.status==="SUCCESS"){_=g.body.run_id??null;break}if(g.body.status==="ERROR"||g.body.status==="FAILED")throw new Error(`Translation task failed: ${JSON.stringify(g.body)}`);await new Promise(m=>setTimeout(m,we)),s++}if(!_)throw new Error("Translation task timed out or failed to return a task_id.");return(await Z.sendRequest({method:"GET",url:`${H}/translation-result/${_}`,headers:{"x-api-key":t.secret_text}})).body}});var eu=Re(fn());var tu=pe({auth:Q,name:"create_transcription",displayName:"Create Transcription",description:"Creates a task to process speech into readable text.",audience:"both",aiMetadata:{description:"Transcribes speech from an audio/video source into text via Camb.AI, polling until the transcription task completes. The media can be supplied either as an uploaded file (max 20MB) or as a public file URL, selected via the media source mode; you must specify the spoken language. Use to convert recorded speech to text. Not idempotent: each call starts a new transcription task.",idempotent:!1},props:{language:Ye,source_type:S.StaticDropdown({displayName:"Media Source",description:"Choose whether to upload a file or provide a URL.",required:!0,defaultValue:"file",options:{options:[{label:"Upload File",value:"file"},{label:"File URL",value:"url"}]}}),media:S.DynamicProperties({auth:Q,displayName:"Media",required:!0,refreshers:["source_type"],props:o(async e=>{let t=e.source_type,r={};return t==="file"?r.media_file=S.File({displayName:"Media File",description:"The media file (e.g., MP3, WAV, MP4) to transcribe. Max size: 20MB.",required:!0}):t==="url"&&(r.media_url=S.ShortText({displayName:"Media URL",description:"A public URL to the media file to transcribe.",required:!0})),r},"props")}),project_name:S.ShortText({displayName:"Project Name",description:"A memorable name for your project to help organize tasks in your Camb.ai workspace.",required:!1}),project_description:S.LongText({displayName:"Project Description",description:"Provide details about your project's goals and specifications for documentation purposes.",required:!1}),folder_id:Qe},async run(e){let{auth:t}=e,{language:r,source_type:n,media:i,project_name:u,project_description:c,folder_id:l}=e.propsValue,f=new eu.default;if(f.append("language",Number(r).toString()),u&&f.append("project_name",u),c&&f.append("project_description",c),l&&f.append("folder_id",l.toString()),n==="url"){if(!i.media_url)throw new Error("Media URL is required when source is 'File URL'.");f.append("media_url",i.media_url)}else{if(!i.media_file)throw new Error("Media File is required when source is 'Upload File'.");let m=i.media_file;f.append("media_file",m.data,m.filename)}let y=await f.getBuffer(),x={"x-api-key":t.secret_text,...f.getHeaders()},_=(await Z.sendRequest({method:"POST",url:`${H}/transcribe`,headers:x,body:y})).body.task_id,s=null,d=0;for(;d<qs;){let m=await Z.sendRequest({method:"GET",url:`${H}/transcribe/${_}`,headers:{"x-api-key":t.secret_text}});if(m.body.status==="SUCCESS"){s=m.body.run_id??null;break}if(m.body.status==="FAILED")throw new Error(`Transcription task failed: ${JSON.stringify(m.body)}`);await new Promise(v=>setTimeout(v,we)),d++}if(!s)throw new Error("Transcription task timed out or failed to return a task_id.");return(await Z.sendRequest({method:"GET",url:`${H}/transcription-result/${s}`,headers:{"x-api-key":t.secret_text}})).body}});var Ud=wi({displayName:"Camb.AI",auth:Q,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/camb-ai.png",authors:["david-oluwaseun420","sanket-a11y"],categories:["ARTIFICIAL_INTELLIGENCE"],actions:[Xs,Ys,Qs,tu,Ws({auth:Q,baseUrl:o(()=>H,"baseUrl"),authMapping:o(async e=>({"x-api-key":e.secret_text}),"authMapping")})],triggers:[]});0&&(module.exports={cambAi});
11
+ /*! Bundled license information:
12
+
13
+ mime-types/index.js:
14
+ (*!
15
+ * mime-types
16
+ * Copyright(c) 2014 Jonathan Ong
17
+ * Copyright(c) 2015 Douglas Christopher Wilson
18
+ * MIT Licensed
19
+ *)
20
+ */
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const cambAi: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,MAAM,mHAuBjB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAgG;AAChG,6EAAuE;AACvE,+EAAyE;AACzE,yEAAqE;AACrE,6EAAyE;AACzE,yCAA4C;AAC5C,iDAAqD;AACrD,qCAAwC;AAE3B,QAAA,MAAM,GAAG,IAAA,8BAAW,EAAC;IAC9B,WAAW,EAAE,SAAS;IACtB,IAAI,EAAE,iBAAU;IAChB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,iDAAiD;IAC1D,OAAO,EAAE,CAAC,oBAAoB,EAAC,aAAa,CAAC;IAC7C,UAAU,EAAC,CAAC,sBAAa,CAAC,uBAAuB,CAAC;IAClD,OAAO,EAAE;QACL,wCAAiB;QACjB,0CAAkB;QAClB,sCAAiB;QACjB,0CAAmB;QACnB,IAAA,yCAAyB,EAAC;YACtB,IAAI,EAAE,iBAAU;YAChB,OAAO,EAAE,GAAG,EAAE,CAAC,qBAAY;YAC3B,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBACxB,OAAO;oBACH,WAAW,EAAE,IAAI,CAAC,WAAW;iBAChC,CAAC;YACN,CAAC,CAAA;SACJ,CAAC;KACL;IACD,QAAQ,EAAE,EAAE;CACf,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const createTextToSound: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- prompt: import("@activepieces/pieces-framework").LongTextProperty<true>;
3
- duration: import("@activepieces/pieces-framework").NumberProperty<false>;
4
- project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- project_description: import("@activepieces/pieces-framework").LongTextProperty<false>;
6
- folder_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
7
- }>;
8
- //# sourceMappingURL=create-text-to-sound.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-text-to-sound.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-text-to-sound.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;;;;;EAiG5B,CAAC"}
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTextToSound = 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
- const common_2 = require("../common");
10
- exports.createTextToSound = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.cambaiAuth,
12
- name: 'create_text_to_sound',
13
- displayName: 'Create Text-to-Sound',
14
- description: 'Convert input text into “sound effects” using an AI model.',
15
- audience: 'both',
16
- aiMetadata: { description: 'Generates a sound-effect audio clip from a text prompt describing the desired effect using Camb.AI, polling until the generation task completes and returning the audio. Use to synthesize non-speech sound effects (not spoken voice — use Create Text-to-Speech for that). Duration is capped at 10 seconds (defaults to 8). Not idempotent: each call starts a new generation task and produces fresh audio.', idempotent: false },
17
- props: {
18
- prompt: pieces_framework_1.Property.LongText({
19
- displayName: 'Prompt',
20
- description: 'A clear, descriptive explanation of the desired audio effect. Concise prompts yield more accurate results.',
21
- required: true,
22
- }),
23
- duration: pieces_framework_1.Property.Number({
24
- displayName: 'Duration (seconds)',
25
- description: 'The desired length of the audio in seconds (max 10). Defaults to 8 if not set.',
26
- required: false,
27
- }),
28
- project_name: pieces_framework_1.Property.ShortText({
29
- displayName: 'Project Name',
30
- description: 'A memorable name for your project to help organize tasks in your Camb.ai workspace.',
31
- required: false,
32
- }),
33
- project_description: pieces_framework_1.Property.LongText({
34
- displayName: 'Project Description',
35
- description: 'Provide details about your project\'s goals and specifications for documentation purposes.',
36
- required: false,
37
- }),
38
- folder_id: common_2.listFoldersDropdown,
39
- },
40
- run(context) {
41
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
- var _a;
43
- const { auth } = context;
44
- const { prompt, duration, project_name, project_description, folder_id } = context.propsValue;
45
- const payload = { prompt };
46
- if (duration)
47
- payload['duration'] = duration;
48
- if (project_name)
49
- payload['project_name'] = project_name;
50
- if (project_description)
51
- payload['project_description'] = project_description;
52
- if (folder_id)
53
- payload['folder_id'] = folder_id;
54
- const initialResponse = yield pieces_common_1.httpClient.sendRequest({
55
- method: pieces_common_1.HttpMethod.POST,
56
- url: `${common_1.API_BASE_URL}/text-to-sound`,
57
- headers: {
58
- 'x-api-key': auth.secret_text,
59
- 'Content-Type': 'application/json'
60
- },
61
- body: payload,
62
- });
63
- const taskId = initialResponse.body.task_id;
64
- let attempts = 0;
65
- let run_id = null;
66
- while (attempts < common_1.MAX_POLLING_ATTEMPTS) {
67
- const statusResponse = yield pieces_common_1.httpClient.sendRequest({
68
- method: pieces_common_1.HttpMethod.GET,
69
- url: `${common_1.API_BASE_URL}/text-to-sound/${taskId}`,
70
- headers: {
71
- 'x-api-key': auth.secret_text,
72
- },
73
- });
74
- const status = statusResponse.body.status;
75
- if (status === 'SUCCESS') {
76
- run_id = (_a = statusResponse.body.run_id) !== null && _a !== void 0 ? _a : null;
77
- break;
78
- }
79
- if (status === 'FAILED') {
80
- throw new Error(`Sound generation task failed: ${JSON.stringify(statusResponse.body)}`);
81
- }
82
- yield new Promise(resolve => setTimeout(resolve, common_1.POLLING_INTERVAL_MS));
83
- attempts++;
84
- }
85
- if (!run_id) {
86
- throw new Error("Sound generation task timed out or failed to return a run_id.");
87
- }
88
- const audioResponse = yield pieces_common_1.httpClient.sendRequest({
89
- method: pieces_common_1.HttpMethod.GET,
90
- url: `${common_1.API_BASE_URL}/text-to-sound-result/${run_id}`,
91
- headers: { 'x-api-key': auth.secret_text },
92
- responseType: 'arraybuffer',
93
- });
94
- return { audio: audioResponse.body };
95
- });
96
- },
97
- });
98
- //# sourceMappingURL=create-text-to-sound.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-text-to-sound.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-text-to-sound.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAqC;AACrC,sCAAoF;AACpF,sCAAgD;AAEnC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,4DAA4D;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,iZAAiZ,EAAE,UAAU,EAAE,KAAK,EAAE;IACjc,KAAK,EAAE;QACH,MAAM,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,4GAA4G;YACzH,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,oBAAoB;YACjC,WAAW,EAAE,gFAAgF;YAC7F,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC7B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,qFAAqF;YAClG,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACnC,WAAW,EAAE,qBAAqB;YAClC,WAAW,EAAE,4FAA4F;YACzG,QAAQ,EAAE,KAAK;SAClB,CAAC;QACF,SAAS,EAAE,4BAAmB;KACjC;IACK,GAAG,CAAC,OAAO;;;YACb,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;YACzB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS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C;oBAC5C,MAAM;gBACV,CAAC;gBAED,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;oBAEtB,MAAM,IAAI,KAAK,CAAC,iCAAiC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC5F,CAAC;gBAGD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,4BAAmB,CAAC,CAAC,CAAC;gBACvE,QAAQ,EAAE,CAAC;YACf,CAAC;YAGD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;YACrF,CAAC;YACD,MAAM,aAAa,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC/C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,yBAAyB,MAAM,EAAE;gBACrD,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBAC1C,YAAY,EAAE,aAAa;aAC9B,CAAC,CAAC;YAEH,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC;QAEzC,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- export declare const createTextToSpeech: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
3
- language: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- voice_id: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- gender: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
6
- age: import("@activepieces/pieces-framework").NumberProperty<false>;
7
- project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- project_description: import("@activepieces/pieces-framework").LongTextProperty<false>;
9
- folder_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- }>;
11
- //# sourceMappingURL=create-text-to-speech.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-text-to-speech.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-text-to-speech.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB;;;;;;;;;EAkH7B,CAAC"}
@@ -1,119 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTextToSpeech = 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
- const common_2 = require("../common");
10
- exports.createTextToSpeech = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.cambaiAuth,
12
- name: 'create_text_to_speech',
13
- displayName: 'Create Text-to-Speech',
14
- description: 'Convert text into speech using a specified voice, language, gender, and age group.',
15
- audience: 'both',
16
- aiMetadata: { description: 'Synthesizes spoken-voice audio from text via Camb.AI text-to-speech, polling until the task completes and writing the resulting WAV to a file. Requires a language and a voice_id (both selected from Camb.AI dropdowns); optionally tune gender and age. Use for spoken narration/dialogue; for non-speech sound effects use Create Text-to-Sound instead. Not idempotent: each call starts a new synthesis task and produces a new audio file.', idempotent: false },
17
- props: {
18
- text: pieces_framework_1.Property.LongText({
19
- displayName: 'Text',
20
- description: 'The text to be converted to speech.',
21
- required: true,
22
- }),
23
- language: common_1.listSourceLanguagesDropdown,
24
- voice_id: common_1.listVoicesDropdown,
25
- gender: pieces_framework_1.Property.StaticDropdown({
26
- displayName: 'Gender',
27
- description: 'The gender of the speaker.',
28
- required: false,
29
- options: {
30
- options: [
31
- { label: 'Male', value: 1 },
32
- { label: 'Female', value: 2 },
33
- { label: 'Neutral', value: 0 },
34
- { label: 'Unspecified', value: 9 },
35
- ],
36
- }
37
- }),
38
- age: pieces_framework_1.Property.Number({
39
- displayName: 'Age',
40
- description: 'The age of the speaker to be generated.',
41
- required: false,
42
- }),
43
- project_name: pieces_framework_1.Property.ShortText({
44
- displayName: 'Project Name',
45
- description: 'A memorable name for your project to help organize tasks in your Camb.ai workspace.',
46
- required: false,
47
- }),
48
- project_description: pieces_framework_1.Property.LongText({
49
- displayName: 'Project Description',
50
- description: 'Provide details about your project\'s goals and specifications for documentation purposes.',
51
- required: false,
52
- }),
53
- folder_id: common_2.listFoldersDropdown,
54
- },
55
- run(context) {
56
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
57
- var _a;
58
- const { auth } = context;
59
- const { text, language, voice_id, gender, age, project_name, project_description, folder_id } = context.propsValue;
60
- const payload = { text, language: Number(language), voice_id: Number(voice_id) };
61
- if (gender !== undefined)
62
- payload['gender'] = gender;
63
- if (age)
64
- payload['age'] = age;
65
- if (project_name)
66
- payload['project_name'] = project_name;
67
- if (project_description)
68
- payload['project_description'] = project_description;
69
- if (folder_id)
70
- payload['folder_id'] = folder_id;
71
- const initialResponse = yield pieces_common_1.httpClient.sendRequest({
72
- method: pieces_common_1.HttpMethod.POST,
73
- url: `${common_1.API_BASE_URL}/tts`,
74
- headers: { 'x-api-key': auth.secret_text, 'Content-Type': 'application/json' },
75
- body: payload,
76
- });
77
- const taskId = initialResponse.body.task_id;
78
- let attempts = 0;
79
- let run_id = null;
80
- while (attempts < common_1.MAX_POLLING_ATTEMPTS) {
81
- const statusResponse = yield pieces_common_1.httpClient.sendRequest({
82
- method: pieces_common_1.HttpMethod.GET,
83
- url: `${common_1.API_BASE_URL}/tts/${taskId}`,
84
- headers: { 'x-api-key': auth.secret_text },
85
- });
86
- if (statusResponse.body.status === 'SUCCESS') {
87
- run_id = (_a = statusResponse.body.run_id) !== null && _a !== void 0 ? _a : null;
88
- break;
89
- }
90
- if (statusResponse.body.status === 'FAILED') {
91
- throw new Error(`Text-to-Speech task failed: ${JSON.stringify(statusResponse.body)}`);
92
- }
93
- yield new Promise(resolve => setTimeout(resolve, common_1.POLLING_INTERVAL_MS));
94
- attempts++;
95
- }
96
- if (!run_id) {
97
- throw new Error("Text-to-Speech task timed out or failed to return a run_id.");
98
- }
99
- const audioResponse = yield pieces_common_1.httpClient.sendRequest({
100
- method: pieces_common_1.HttpMethod.GET,
101
- url: `${common_1.API_BASE_URL}/tts-result/${run_id}`,
102
- headers: { 'x-api-key': auth.secret_text },
103
- responseType: 'arraybuffer',
104
- });
105
- const fileName = `speech_${run_id}.wav`;
106
- const fileData = Buffer.from(audioResponse.body);
107
- const fileUrl = yield context.files.write({
108
- fileName,
109
- data: fileData,
110
- });
111
- return {
112
- message: "Speech generated successfully.",
113
- audio_url: fileUrl,
114
- run_id: run_id,
115
- };
116
- });
117
- },
118
- });
119
- //# sourceMappingURL=create-text-to-speech.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-text-to-speech.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-text-to-speech.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAmF;AACnF,kCAAqC;AACrC,sCAAoI;AACpI,sCAAgD;AAEnC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,oFAAoF;IACjG,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kbAAkb,EAAE,UAAU,EAAE,KAAK,EAAE;IACle,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,QAAQ,EAAE,oCAA2B;QACrC,QAAQ,EAAE,2BAAkB;QAC5B,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,W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IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAC1F,CAAC;gBAED,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,4BAAmB,CAAC,CAAC,CAAC;gBACvE,QAAQ,EAAE,CAAC;YACf,CAAC;YAGD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;YACnF,CAAC;YAGD,MAAM,aAAa,GAAiB,MAAM,0BAAU,CAAC,WAAW,CAAC;gBAC7D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,eAAe,MAAM,EAAE;gBAC3C,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;gBAC1C,YAAY,EAAE,aAAa;aAC9B,CAAC,CAAC;YAEH,MAAM,QAAQ,GAAG,UAAU,MAAM,MAAM,CAAC;YACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAmB,CAAC,CAAC;YAChE,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;gBACtC,QAAQ;gBACR,IAAI,EAAE,QAAQ;aACjB,CAAC,CAAC;YAEH,OAAO;gBACH,OAAO,EAAE,gCAAgC;gBACzC,SAAS,EAAE,OAAO;gBAClB,MAAM,EAAE,MAAM;aACjB,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const createTranscription: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- language: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- source_type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
4
- media: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- project_description: import("@activepieces/pieces-framework").LongTextProperty<false>;
7
- folder_id: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- }>;
9
- //# sourceMappingURL=create-transcription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-transcription.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-transcription.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;EA4H9B,CAAC"}
@@ -1,132 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTranscription = 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
- const form_data_1 = tslib_1.__importDefault(require("form-data"));
10
- const common_2 = require("../common");
11
- exports.createTranscription = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.cambaiAuth,
13
- name: 'create_transcription',
14
- displayName: 'Create Transcription',
15
- description: 'Creates a task to process speech into readable text.',
16
- audience: 'both',
17
- aiMetadata: { description: 'Transcribes speech from an audio/video source into text via Camb.AI, polling until the transcription task completes. The media can be supplied either as an uploaded file (max 20MB) or as a public file URL, selected via the media source mode; you must specify the spoken language. Use to convert recorded speech to text. Not idempotent: each call starts a new transcription task.', idempotent: false },
18
- props: {
19
- language: common_1.listSourceLanguagesDropdown,
20
- source_type: pieces_framework_1.Property.StaticDropdown({
21
- displayName: 'Media Source',
22
- description: 'Choose whether to upload a file or provide a URL.',
23
- required: true,
24
- defaultValue: 'file',
25
- options: {
26
- options: [
27
- { label: 'Upload File', value: 'file' },
28
- { label: 'File URL', value: 'url' },
29
- ]
30
- },
31
- }),
32
- media: pieces_framework_1.Property.DynamicProperties({
33
- auth: auth_1.cambaiAuth,
34
- displayName: 'Media',
35
- required: true,
36
- refreshers: ['source_type'],
37
- props: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
38
- const sourceType = context['source_type'];
39
- const fields = {};
40
- if (sourceType === 'file') {
41
- fields['media_file'] = pieces_framework_1.Property.File({
42
- displayName: 'Media File',
43
- description: 'The media file (e.g., MP3, WAV, MP4) to transcribe. Max size: 20MB.',
44
- required: true,
45
- });
46
- }
47
- else if (sourceType === 'url') {
48
- fields['media_url'] = pieces_framework_1.Property.ShortText({
49
- displayName: 'Media URL',
50
- description: 'A public URL to the media file to transcribe.',
51
- required: true,
52
- });
53
- }
54
- return fields;
55
- })
56
- }),
57
- project_name: pieces_framework_1.Property.ShortText({
58
- displayName: 'Project Name',
59
- description: 'A memorable name for your project to help organize tasks in your Camb.ai workspace.',
60
- required: false,
61
- }),
62
- project_description: pieces_framework_1.Property.LongText({
63
- displayName: 'Project Description',
64
- description: 'Provide details about your project\'s goals and specifications for documentation purposes.',
65
- required: false,
66
- }),
67
- folder_id: common_2.listFoldersDropdown,
68
- },
69
- run(context) {
70
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
71
- var _a;
72
- const { auth } = context;
73
- const { language, source_type, media, project_name, project_description, folder_id } = context.propsValue;
74
- const formData = new form_data_1.default();
75
- formData.append('language', Number(language).toString());
76
- if (project_name)
77
- formData.append('project_name', project_name);
78
- if (project_description)
79
- formData.append('project_description', project_description);
80
- if (folder_id)
81
- formData.append('folder_id', folder_id.toString());
82
- if (source_type === 'url') {
83
- if (!media['media_url'])
84
- throw new Error("Media URL is required when source is 'File URL'.");
85
- formData.append('media_url', media['media_url']);
86
- }
87
- else {
88
- if (!media['media_file'])
89
- throw new Error("Media File is required when source is 'Upload File'.");
90
- const fileData = media['media_file'];
91
- formData.append('media_file', fileData.data, fileData.filename);
92
- }
93
- const requestBody = yield formData.getBuffer();
94
- const headers = Object.assign({ 'x-api-key': auth.secret_text }, formData.getHeaders());
95
- const initialResponse = yield pieces_common_1.httpClient.sendRequest({
96
- method: pieces_common_1.HttpMethod.POST,
97
- url: `${common_1.API_BASE_URL}/transcribe`,
98
- headers: headers,
99
- body: requestBody,
100
- });
101
- const taskId = initialResponse.body.task_id;
102
- let run_id = null;
103
- let attempts = 0;
104
- while (attempts < common_1.LONG_MAX_POLLING_ATTEMPTS) {
105
- const statusResponse = yield pieces_common_1.httpClient.sendRequest({
106
- method: pieces_common_1.HttpMethod.GET,
107
- url: `${common_1.API_BASE_URL}/transcribe/${taskId}`,
108
- headers: { 'x-api-key': auth.secret_text },
109
- });
110
- if (statusResponse.body.status === 'SUCCESS') {
111
- run_id = (_a = statusResponse.body.run_id) !== null && _a !== void 0 ? _a : null;
112
- break;
113
- }
114
- if (statusResponse.body.status === 'FAILED') {
115
- throw new Error(`Transcription task failed: ${JSON.stringify(statusResponse.body)}`);
116
- }
117
- yield new Promise(resolve => setTimeout(resolve, common_1.POLLING_INTERVAL_MS));
118
- attempts++;
119
- }
120
- if (!run_id) {
121
- throw new Error("Transcription task timed out or failed to return a task_id.");
122
- }
123
- const resultResponse = yield pieces_common_1.httpClient.sendRequest({
124
- method: pieces_common_1.HttpMethod.GET,
125
- url: `${common_1.API_BASE_URL}/transcription-result/${run_id}`,
126
- headers: { 'x-api-key': auth.secret_text },
127
- });
128
- return resultResponse.body;
129
- });
130
- },
131
- });
132
- //# sourceMappingURL=create-transcription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-transcription.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-transcription.ts"],"names":[],"mappings":";;;;AAAA,qEAAmG;AACnG,+DAAmG;AACnG,kCAAqC;AACrC,sCAAsH;AACtH,kEAAiC;AACjC,sCAAgD;AAEnC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,sDAAsD;IAC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E,CAAC;oBAC1C,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACzF,CAAC;gBACD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,4BAAmB,CAAC,CAAC,CAAC;gBACvE,QAAQ,EAAE,CAAC;YACf,CAAC;YAED,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;YACnF,CAAC;YACD,MAAM,cAAc,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA+B;gBAC9E,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,yBAAyB,MAAM,EAAE;gBACrD,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;aAC7C,CAAC,CAAC;YAEH,OAAO,cAAc,CAAC,IAAI,CAAC;QAE/B,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const createTranslation: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- texts: import("@activepieces/pieces-framework").LongTextProperty<true>;
3
- source_language: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
4
- target_language: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
5
- formality: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
6
- gender: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
7
- age: import("@activepieces/pieces-framework").NumberProperty<false>;
8
- project_name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- }>;
10
- //# sourceMappingURL=create-translation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-translation.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-translation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;EA6G5B,CAAC"}
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createTranslation = 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.createTranslation = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.cambaiAuth,
11
- name: 'create_translation',
12
- displayName: 'Create Translation',
13
- description: 'Translate text from a source language to a target language.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Translates text from a source language to a target language via Camb.AI, polling until the translation task completes. Each input line is treated as a separate segment to translate, and both languages are chosen from Camb.AI dropdowns; optionally tune formality, gender, and target audience age. Use for text translation only (not audio — use Create Transcription for speech-to-text). Not idempotent: each call starts a new translation task.', idempotent: false },
16
- props: {
17
- texts: pieces_framework_1.Property.LongText({
18
- displayName: 'Text to Translate',
19
- description: 'The text to be translated. You can enter multiple lines; each line will be treated as a separate text segment.',
20
- required: true,
21
- }),
22
- source_language: common_1.listSourceLanguagesDropdown,
23
- target_language: common_1.listTargetLanguagesDropdown,
24
- formality: pieces_framework_1.Property.StaticDropdown({
25
- displayName: 'Formality',
26
- description: 'Adjust the formality level to match your context.',
27
- required: false,
28
- options: {
29
- options: [
30
- { label: 'Formal', value: 1 },
31
- { label: 'Informal', value: 2 },
32
- ]
33
- }
34
- }),
35
- gender: pieces_framework_1.Property.StaticDropdown({
36
- displayName: 'Gender',
37
- description: 'Specify grammatical gender preferences when relevant in the target language.',
38
- required: false,
39
- options: {
40
- options: [
41
- { label: 'Male', value: 1 },
42
- { label: 'Female', value: 2 },
43
- { label: 'Neutral', value: 0 },
44
- { label: 'Unspecified', value: 9 },
45
- ],
46
- }
47
- }),
48
- age: pieces_framework_1.Property.Number({
49
- displayName: 'Audience Age',
50
- description: 'Helps adjust vocabulary and expressions to be age-appropriate.',
51
- required: false,
52
- }),
53
- project_name: pieces_framework_1.Property.ShortText({
54
- displayName: 'Project Name',
55
- description: 'A memorable name for your project to help organize tasks in your Camb.ai workspace.',
56
- required: false,
57
- }),
58
- },
59
- run(context) {
60
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- var _a;
62
- const { auth } = context;
63
- const { texts, source_language, target_language, formality, gender, age, project_name } = context.propsValue;
64
- const payload = {
65
- texts: texts.split('\n').filter(line => line.trim().length > 0),
66
- source_language: Number(source_language),
67
- target_language: Number(target_language),
68
- };
69
- if (formality !== undefined)
70
- payload['formality'] = formality;
71
- if (gender !== undefined)
72
- payload['gender'] = gender;
73
- if (age)
74
- payload['age'] = age;
75
- if (project_name)
76
- payload['project_name'] = project_name;
77
- const initialResponse = yield pieces_common_1.httpClient.sendRequest({
78
- method: pieces_common_1.HttpMethod.POST,
79
- url: `${common_1.API_BASE_URL}/translate`,
80
- headers: { 'x-api-key': auth.secret_text, 'Content-Type': 'application/json' },
81
- body: payload,
82
- });
83
- const taskId = initialResponse.body.task_id;
84
- let run_id = null;
85
- let attempts = 0;
86
- while (attempts < common_1.MAX_POLLING_ATTEMPTS) {
87
- const statusResponse = yield pieces_common_1.httpClient.sendRequest({
88
- method: pieces_common_1.HttpMethod.GET,
89
- url: `${common_1.API_BASE_URL}/translate/${taskId}`,
90
- headers: { 'x-api-key': auth.secret_text },
91
- });
92
- if (statusResponse.body.status === 'SUCCESS') {
93
- run_id = (_a = statusResponse.body.run_id) !== null && _a !== void 0 ? _a : null;
94
- break;
95
- }
96
- if (statusResponse.body.status === 'ERROR' || statusResponse.body.status === 'FAILED') {
97
- throw new Error(`Translation task failed: ${JSON.stringify(statusResponse.body)}`);
98
- }
99
- yield new Promise(resolve => setTimeout(resolve, common_1.POLLING_INTERVAL_MS));
100
- attempts++;
101
- }
102
- if (!run_id) {
103
- throw new Error("Translation task timed out or failed to return a task_id.");
104
- }
105
- const resultResponse = yield pieces_common_1.httpClient.sendRequest({
106
- method: pieces_common_1.HttpMethod.GET,
107
- url: `${common_1.API_BASE_URL}/translation-result/${run_id}`,
108
- headers: { 'x-api-key': auth.secret_text },
109
- });
110
- return resultResponse.body;
111
- });
112
- },
113
- });
114
- //# sourceMappingURL=create-translation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-translation.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-translation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAqE;AACrE,kCAAqC;AACrC,sCAA4I;AAE/H,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,iBAAU;IAChB,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,6DAA6D;IAC1E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2bAA2b,EAAE,UAAU,EAAE,KAAK,EAAE;IAC3e,KAAK,EAAE;QACH,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,gHAAgH;YAC7H,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,eAAe,EAAE,oCAA2B;QAC5C,eAAe,EAAE,oCAA2B;QAC5C,SAAS,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC/B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACL,OAAO,EAAE;oBACL,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE;oBAC7B,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE;iBAClC;aACJ;SACJ,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC5B,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,8EAA8E;YAC3F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;gBACD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,4BAAmB,CAAC,CAAC,CAAC;gBACvE,QAAQ,EAAE,CAAC;YACf,CAAC;YAGD,IAAI,CAAC,MAAM,EAAE,CAAC;gBACV,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;YACjF,CAAC;YAED,MAAM,cAAc,GAAG,MAAM,0BAAU,CAAC,WAAW,CAA6B;gBAC5E,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,uBAAuB,MAAM,EAAE;gBACnD,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE;aAC7C,CAAC,CAAC;YAEH,OAAO,cAAc,CAAC,IAAI,CAAC;QAG/B,CAAC;KAAA;CACJ,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const cambaiAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,mEA6BrB,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cambaiAuth = 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 common_1 = require("./common");
8
- exports.cambaiAuth = pieces_framework_1.PieceAuth.SecretText({
9
- displayName: "API Key",
10
- description: `
11
- To get your API key, please follow these steps:
12
- 1. Log in to your [CAMB.AI Studio](https://camb.ai/studio/) account.
13
- 2. Navigate to your workspace's API Keys dashboard.
14
- 3. Create a new key if you haven't already.
15
- 4. Copy the API key and paste it here.
16
- `,
17
- required: true,
18
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
19
- try {
20
- yield pieces_common_1.httpClient.sendRequest({
21
- method: pieces_common_1.HttpMethod.GET,
22
- url: `${common_1.API_BASE_URL}/source-languages`,
23
- headers: {
24
- 'x-api-key': auth,
25
- }
26
- });
27
- return {
28
- valid: true,
29
- };
30
- }
31
- catch (e) {
32
- return {
33
- valid: false,
34
- error: 'Invalid API Key.',
35
- };
36
- }
37
- })
38
- });
39
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAqE;AACrE,qCAAwC;AAE3B,QAAA,UAAU,GAAG,4BAAS,CAAC,UAAU,CAAC;IAC3C,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;;;;;;KAMZ;IACD,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACrB,IAAI,CAAC;YACD,MAAM,0BAAU,CAAC,WAAW,CAAC;gBACzB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,GAAG,qBAAY,mBAAmB;gBACvC,OAAO,EAAE;oBACL,WAAW,EAAE,IAAI;iBACpB;aACJ,CAAC,CAAC;YACH,OAAO;gBACH,KAAK,EAAE,IAAI;aACd,CAAC;QACN,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,OAAO;gBACH,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,kBAAkB;aAC5B,CAAC;QACN,CAAC;IACL,CAAC,CAAA;CACJ,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const API_BASE_URL = "https://client.camb.ai/apis";
2
- export declare const POLLING_INTERVAL_MS = 5000;
3
- export declare const LONG_POLLING_INTERVAL_MS = 10000;
4
- export declare const MAX_POLLING_ATTEMPTS = 10;
5
- export declare const LONG_MAX_POLLING_ATTEMPTS = 120;
6
- export declare const listVoicesDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
7
- export declare const listSourceLanguagesDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
8
- export declare const listTargetLanguagesDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
9
- export declare const listFoldersDropdown: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,gCAAgC,CAAC;AAC1D,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAmB7C,eAAO,MAAM,kBAAkB,4IA8B7B,CAAC;AAGH,eAAO,MAAM,2BAA2B,4IA8BtC,CAAC;AAGH,eAAO,MAAM,2BAA2B,4IA8BtC,CAAC;AAEH,eAAO,MAAM,mBAAmB,6IAsC9B,CAAC"}
@@ -1,150 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listFoldersDropdown = exports.listTargetLanguagesDropdown = exports.listSourceLanguagesDropdown = exports.listVoicesDropdown = exports.LONG_MAX_POLLING_ATTEMPTS = exports.MAX_POLLING_ATTEMPTS = exports.LONG_POLLING_INTERVAL_MS = exports.POLLING_INTERVAL_MS = exports.API_BASE_URL = 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
- exports.API_BASE_URL = "https://client.camb.ai/apis";
9
- exports.POLLING_INTERVAL_MS = 5000;
10
- exports.LONG_POLLING_INTERVAL_MS = 10000;
11
- exports.MAX_POLLING_ATTEMPTS = 10;
12
- exports.LONG_MAX_POLLING_ATTEMPTS = 120;
13
- exports.listVoicesDropdown = pieces_framework_1.Property.Dropdown({
14
- auth: auth_1.cambaiAuth,
15
- displayName: 'Voice',
16
- description: 'Select the voice to generate the speech.',
17
- required: true,
18
- refreshers: [],
19
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
20
- var _b;
21
- if (!auth) {
22
- return {
23
- disabled: true,
24
- options: [],
25
- placeholder: 'Please authenticate first',
26
- };
27
- }
28
- const response = yield pieces_common_1.httpClient.sendRequest({
29
- method: pieces_common_1.HttpMethod.GET,
30
- url: `${exports.API_BASE_URL}/list-voices`,
31
- headers: {
32
- 'x-api-key': auth.secret_text,
33
- },
34
- });
35
- const voices = (_b = response.body) !== null && _b !== void 0 ? _b : [];
36
- return {
37
- disabled: false,
38
- options: voices.map((voice) => ({
39
- label: voice.voice_name,
40
- value: voice.id,
41
- })),
42
- };
43
- }),
44
- });
45
- exports.listSourceLanguagesDropdown = pieces_framework_1.Property.Dropdown({
46
- auth: auth_1.cambaiAuth,
47
- displayName: 'Source Language',
48
- description: 'Select the original language of the input text.',
49
- required: true,
50
- refreshers: [],
51
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
52
- var _b;
53
- if (!auth) {
54
- return {
55
- disabled: true,
56
- options: [],
57
- placeholder: 'Please authenticate first',
58
- };
59
- }
60
- const response = yield pieces_common_1.httpClient.sendRequest({
61
- method: pieces_common_1.HttpMethod.GET,
62
- url: `${exports.API_BASE_URL}/source-languages`,
63
- headers: {
64
- 'x-api-key': auth.secret_text,
65
- },
66
- });
67
- const languages = (_b = response.body) !== null && _b !== void 0 ? _b : [];
68
- return {
69
- disabled: false,
70
- options: languages.map((lang) => ({
71
- label: `${lang.language} (${lang.short_name})`,
72
- value: lang.id,
73
- })),
74
- };
75
- }),
76
- });
77
- exports.listTargetLanguagesDropdown = pieces_framework_1.Property.Dropdown({
78
- displayName: 'Target Language',
79
- description: 'Select the language to translate the text into.',
80
- auth: auth_1.cambaiAuth,
81
- required: true,
82
- refreshers: [],
83
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
84
- var _b;
85
- if (!auth) {
86
- return {
87
- disabled: true,
88
- options: [],
89
- placeholder: 'Please authenticate first',
90
- };
91
- }
92
- const response = yield pieces_common_1.httpClient.sendRequest({
93
- method: pieces_common_1.HttpMethod.GET,
94
- url: `${exports.API_BASE_URL}/target-languages`,
95
- headers: {
96
- 'x-api-key': auth.secret_text,
97
- },
98
- });
99
- const languages = (_b = response.body) !== null && _b !== void 0 ? _b : [];
100
- return {
101
- disabled: false,
102
- options: languages.map((lang) => ({
103
- label: `${lang.language} (${lang.short_name})`,
104
- value: lang.id,
105
- })),
106
- };
107
- }),
108
- });
109
- exports.listFoldersDropdown = pieces_framework_1.Property.Dropdown({
110
- displayName: 'Folder',
111
- auth: auth_1.cambaiAuth,
112
- description: 'Select the folder to save the task in.',
113
- required: false,
114
- refreshers: [],
115
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
116
- var _b;
117
- if (!auth) {
118
- return {
119
- disabled: true,
120
- options: [],
121
- placeholder: 'Please authenticate first',
122
- };
123
- }
124
- try {
125
- const response = yield pieces_common_1.httpClient.sendRequest({
126
- method: pieces_common_1.HttpMethod.GET,
127
- url: `${exports.API_BASE_URL}/folders`,
128
- headers: {
129
- 'x-api-key': auth.secret_text,
130
- },
131
- });
132
- const folders = (_b = response.body) !== null && _b !== void 0 ? _b : [];
133
- return {
134
- disabled: false,
135
- options: folders.map((folder) => ({
136
- label: folder.folder_name,
137
- value: folder.folder_id,
138
- })),
139
- };
140
- }
141
- catch (error) {
142
- return {
143
- disabled: true,
144
- options: [],
145
- placeholder: "Could not load folders."
146
- };
147
- }
148
- }),
149
- });
150
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA0D;AAC1D,+DAAqE;AACrE,kCAAqC;AAGxB,QAAA,YAAY,GAAG,6BAA6B,CAAC;AAC7C,QAAA,mBAAmB,GAAG,IAAI,CAAC;AAC3B,QAAA,wBAAwB,GAAG,KAAK,CAAC;AACjC,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAC1B,QAAA,yBAAyB,GAAG,GAAG,CAAC;AAmBhC,QAAA,kBAAkB,GAAG,2BAAQ,CAAC,QAAQ,CAAC;IAChD,IAAI,EAAE,iBAAU;IAChB,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,0CAA0C;IACvD,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,EAAE;IACd,OAAO,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;;QACpB,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO;gBACH,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,2BAA2B;aAC3C,CAAC;QACN,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAU;YACnD,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,GAAG,oBAAY,cAAc;YAClC,OAAO,EAAE;gBACL,WAAW,EAAE,IAAI,CAAC,WAAW;aAChC;SACJ,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAA,QAAQ,CAAC,IAAI,mCAAI,EAAE,CAAC;QACnC,OAAO;YACH,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBAC5B,KAAK,EAAE,KAAK,CAAC,UAAU;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