@activepieces/piece-pdfcrowd 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/piece-pdfcrowd",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
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.0",
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,35 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pdfcrowd = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("./lib/common/auth");
7
- const url_to_pdf_1 = require("./lib/actions/url-to-pdf");
8
- const html_to_pdf_1 = require("./lib/actions/html-to-pdf");
9
- const shared_1 = require("@activepieces/shared");
10
- const pieces_common_1 = require("@activepieces/pieces-common");
11
- const client_1 = require("./lib/common/client");
12
- exports.pdfcrowd = (0, pieces_framework_1.createPiece)({
13
- displayName: 'Pdfcrowd',
14
- auth: auth_1.pdfcrowdAuth,
15
- minimumSupportedRelease: '0.36.1',
16
- logoUrl: 'https://cdn.activepieces.com/pieces/pdfcrowd.png',
17
- authors: ['pdfcrowd', 'sanket-a11y'],
18
- categories: [shared_1.PieceCategory.CONTENT_AND_FILES],
19
- description: 'Convert web pages and HTML to PDF with advanced formatting options',
20
- actions: [
21
- url_to_pdf_1.urlToPdfAction,
22
- html_to_pdf_1.htmlToPdfAction,
23
- (0, pieces_common_1.createCustomApiCallAction)({
24
- auth: auth_1.pdfcrowdAuth,
25
- baseUrl: () => client_1.BASE_URL,
26
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
- return {
28
- Authorization: `Basic ${Buffer.from(`${auth.username}:${auth.password}`).toString('base64')}`,
29
- };
30
- }),
31
- }),
32
- ],
33
- triggers: [],
34
- });
35
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Us=Object.create;var Je=Object.defineProperty;var Ms=Object.getOwnPropertyDescriptor;var Ls=Object.getOwnPropertyNames;var js=Object.getPrototypeOf,Fs=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ls(t))!Fs.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=Ms(t,i))||n.enumerable});return e};var he=(e,t,r)=>(r=e!=null?Us(js(e)):{},mn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),Bs=e=>mn(Je({},"__esModule",{value:!0}),e);var ko=w((zo,Mt)=>{(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,}",p="(?:[0-9a-f]+::?)+",m={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${p})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${p})|(?:::)(?:${p})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function g(c,d){if(c.indexOf("::")!==c.lastIndexOf("::"))return null;let y=0,f=-1,x=(c.match(m.zoneIndex)||[])[0],P,L;for(x&&(x=x.substring(1),c=c.replace(/%.+$/,""));(f=c.indexOf(":",f+1))>=0;)y++;if(c.substr(0,2)==="::"&&y--,c.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,P=":";L--;)P+="0:";return c=c.replace("::",P),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),d=function(){let Q=c.split(":"),ne=[];for(let Ge=0;Ge<Q.length;Ge++)ne.push(parseInt(Q[Ge],16));return ne}(),{parts:d,zoneId:x}}o(g,"expandIPv6");function v(c,d,y,f){if(c.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,P;for(;f>0;){if(P=y-f,P<0&&(P=0),c[x]>>P!==d[x]>>P)return!1;f-=y,x+=1}return!0}o(v,"matchCIDR");function b(c){if(i.test(c))return parseInt(c,16);if(c[0]==="0"&&!isNaN(parseInt(c[1],10))){if(n.test(c))return parseInt(c,8);throw new Error(`ipaddr: cannot parse ${c} as octal`)}return parseInt(c,10)}o(b,"parseIntAuto");function T(c,d){for(;c.length<d;)c=`0${c}`;return c}o(T,"padPart");let h={};h.IPv4=function(){function c(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,f;for(y=0;y<d.length;y++)if(f=d[y],!(0<=f&&f<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(c,"IPv4"),c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,18,0,0]),15],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]],as112:[[new c([192,175,48,0]),24],[new c([192,31,196,0]),24]],amt:[[new c([192,52,193,0]),24]]},c.prototype.kind=function(){return"ipv4"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return v(this.octets,d.octets,8,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,P,L;for(x=3;x>=0;x-=1)if(P=this.octets[x],P in f){if(L=f[P],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},c.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toString=function(){return this.octets.join(".")},c}(),h.IPv4.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<4;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(c){return this.parser(c)!==null},h.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(c){try{return this.parseCIDR(c),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(c){return!!(h.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(c){let d=c.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(c)||!d?!1:h.IPv4.isValidFourPartDecimal(d[1])},h.IPv4.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(c){let d=this.parser(c);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},h.IPv4.parseCIDR=function(c){let d;if(d=c.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let f=[this.parse(d[1]),y];return Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(c){let d,y,f;if(d=c.match(r.fourOctet))return function(){let x=d.slice(1,6),P=[];for(let L=0;L<x.length;L++)y=x[L],P.push(b(y));return P}();if(d=c.match(r.longValue)){if(f=b(d[1]),f>4294967295||f<0)throw new Error("ipaddr: address outside defined range");return function(){let x=[],P;for(P=0;P<=24;P+=8)x.push(f>>P&255);return x}().reverse()}else return(d=c.match(r.twoOctet))?function(){let x=d.slice(1,4),P=[];if(f=b(x[1]),f>16777215||f<0)throw new Error("ipaddr: address outside defined range");return P.push(b(x[0])),P.push(f>>16&255),P.push(f>>8&255),P.push(f&255),P}():(d=c.match(r.threeOctet))?function(){let x=d.slice(1,5),P=[];if(f=b(x[2]),f>65535||f<0)throw new Error("ipaddr: address outside defined range");return P.push(b(x[0])),P.push(b(x[1])),P.push(f>>8&255),P.push(f&255),P}():null},h.IPv4.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<4&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},h.IPv6=function(){function c(d,y){let f,x;if(d.length===16)for(this.parts=[],f=0;f<=14;f+=2)this.parts.push(d[f]<<8|d[f+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(f=0;f<this.parts.length;f++)if(x=this.parts[f],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}return o(c,"IPv6"),c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],discard:[new c([256,0,0,0,0,0,0,0]),64],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],benchmarking:[new c([8193,2,0,0,0,0,0,0]),48],amt:[new c([8193,3,0,0,0,0,0,0]),32],as112v6:[[new c([8193,4,274,0,0,0,0,0]),48],[new c([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new c([8193,16,0,0,0,0,0,0]),28],orchid2:[new c([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new c([8193,48,0,0,0,0,0,0]),28],reserved:[[new c([8193,0,0,0,0,0,0,0]),23],[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.kind=function(){return"ipv6"},c.prototype.match=function(d,y){let f;if(y===void 0&&(f=d,d=f[0],y=f[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return v(this.parts,d.parts,16,y)},c.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,f={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},x,P;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in f){if(P=f[x],y&&P!==0)return null;P!==16&&(y=!0),d+=P}else return null;return 128-d},c.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},c.prototype.toByteArray=function(){let d,y=[],f=this.parts;for(let x=0;x<f.length;x++)d=f[x],y.push(d>>8),y.push(d&255);return y},c.prototype.toFixedLengthString=function(){let d=function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(T(this.parts[x].toString(16),4));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),y=d[0],f=d[1];return new h.IPv4([y>>8,y&255,f>>8,f&255])},c.prototype.toNormalizedString=function(){let d=function(){let f=[];for(let x=0;x<this.parts.length;x++)f.push(this.parts[x].toString(16));return f}.call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},c.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),f=0,x=-1,P;for(;P=d.exec(y);)P[0].length>x&&(f=P.index,x=P[0].length);return x<0?y:`${y.substring(0,f)}::${y.substring(f+x)}`},c.prototype.toString=function(){return this.toRFC5952String()},c}(),h.IPv6.broadcastAddressFromCIDR=function(c){try{let d=this.parseCIDR(c),y=d[0].toByteArray(),f=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],P=0;for(;P<16;)x.push(parseInt(y[P],10)|parseInt(f[P],10)^255),P++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},h.IPv6.isIPv6=function(c){return this.parser(c)!==null},h.IPv6.isValid=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{let d=this.parser(c);return new this(d.parts,d.zoneId),!0}catch{return!1}},h.IPv6.isValidCIDR=function(c){if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return this.parseCIDR(c),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(c){let d,y,f,x,P;try{for(d=this.parseCIDR(c),f=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(f[y],10)&parseInt(P[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},h.IPv6.parse=function(c){let d=this.parser(c);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},h.IPv6.parseCIDR=function(c){let d,y,f;if((y=c.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return f=[this.parse(y[1]),d],Object.defineProperty(f,"toString",{value:o(function(){return this.join("/")},"value")}),f;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(c){let d,y,f,x,P,L;if(f=c.match(m.deprecatedTransitional))return this.parser(`::ffff:${f[1]}`);if(m.native.test(c))return g(c,8);if((f=c.match(m.transitional))&&(L=f[6]||"",d=f[1],f[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+L,6),d.parts)){for(P=[parseInt(f[2]),parseInt(f[3]),parseInt(f[4]),parseInt(f[5])],y=0;y<P.length;y++)if(x=P[y],!(0<=x&&x<=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},h.IPv6.subnetMaskFromPrefixLength=function(c){if(c=parseInt(c),c<0||c>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],y=0,f=Math.floor(c/8);for(;y<f;)d[y]=255,y++;return f<16&&(d[f]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},h.fromByteArray=function(c){let d=c.length;if(d===4)return new h.IPv4(c);if(d===16)return new h.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(c){return h.IPv6.isValid(c)||h.IPv4.isValid(c)},h.isValidCIDR=function(c){return h.IPv6.isValidCIDR(c)||h.IPv4.isValidCIDR(c)},h.parse=function(c){if(h.IPv6.isValid(c))return h.IPv6.parse(c);if(h.IPv4.isValid(c))return h.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(c){try{return h.IPv6.parseCIDR(c)}catch{try{return h.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(c){let d=this.parse(c);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},h.subnetMatch=function(c,d,y){let f,x,P,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(P=d[x],P[0]&&!(P[0]instanceof Array)&&(P=[P]),f=0;f<P.length;f++)if(L=P[f],c.kind()===L[0].kind()&&c.match.apply(c,L))return x}return y},typeof Mt<"u"&&Mt.exports?Mt.exports=h:e.ipaddr=h})(zo)});var Ei=w((VE,wi)=>{var Ii=require("stream").Stream,yl=require("util");wi.exports=ie;function ie(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ie,"DelayedStream");yl.inherits(ie,Ii);ie.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(ie.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ie.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ie.prototype.resume=function(){this._released||this.release(),this.source.resume()};ie.prototype.pause=function(){this.source.pause()};ie.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ie.prototype.pipe=function(){var e=Ii.prototype.pipe.apply(this,arguments);return this.resume(),e};ie.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)};ie.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 ki=w((qE,zi)=>{var vl=require("util"),Ai=require("stream").Stream,$i=Ei();zi.exports=W;function W(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(W,"CombinedStream");vl.inherits(W,Ai);W.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};W.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};W.prototype.append=function(e){var t=W.isStreamLike(e);if(t){if(!(e instanceof $i)){var r=$i.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};W.prototype.pipe=function(e,t){return Ai.prototype.pipe.call(this,e,t),this.resume(),e};W.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};W.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=W.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};W.prototype._pipeNext=function(e){this._currentStream=e;var t=W.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};W.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};W.prototype.write=function(e){this.emit("data",e)};W.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};W.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};W.prototype.end=function(){this._reset(),this.emit("end")};W.prototype.destroy=function(){this._reset(),this.emit("close")};W.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};W.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};W.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};W.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Oi=w((WE,Di)=>{"use strict";Di.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 Ci=w(Y=>{"use strict";var Zt=Oi(),_l=require("path").extname,Ni=/^\s*([^;\s]*)(?:;|\s|$)/,xl=/^text\//i;Y.charset=Ri;Y.charsets={lookup:Ri};Y.contentType=bl;Y.extension=Pl;Y.extensions=Object.create(null);Y.lookup=Tl;Y.types=Object.create(null);Sl(Y.extensions,Y.types);function Ri(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&Zt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&xl.test(t[1])?"UTF-8":!1}o(Ri,"charset");function bl(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?Y.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=Y.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(bl,"contentType");function Pl(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Pl,"extension");function Tl(e){if(!e||typeof e!="string")return!1;var t=_l("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(Tl,"lookup");function Sl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Zt).forEach(o(function(i){var u=Zt[i],p=u.extensions;if(!(!p||!p.length)){e[i]=p;for(var m=0;m<p.length;m++){var g=p[m];if(t[g]){var v=r.indexOf(Zt[t[g]].source),b=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(v>b||v===b&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(Sl,"populateMaps")});var Mi=w((KE,Ui)=>{Ui.exports=Il;function Il(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Il,"defer")});var Br=w((YE,ji)=>{var Li=Mi();ji.exports=wl;function wl(e){var t=!1;return Li(function(){t=!0}),o(function(n,i){t?e(n,i):Li(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(wl,"async")});var Vr=w((e$,Fi)=>{Fi.exports=El;function El(e){Object.keys(e.jobs).forEach($l.bind(e)),e.jobs={}}o(El,"abort");function $l(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o($l,"clean")});var Zr=w((r$,Vi)=>{var Bi=Br(),Al=Vr();Vi.exports=zl;function zl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=kl(t,i,e[i],function(u,p){i in r.jobs&&(delete r.jobs[i],u?Al(r):r.results[i]=p,n(u,r.results))})}o(zl,"iterate");function kl(e,t,r,n){var i;return e.length==2?i=e(r,Bi(n)):i=e(r,t,Bi(n)),i}o(kl,"runJob")});var qr=w((o$,Zi)=>{Zi.exports=Dl;function Dl(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(Dl,"state")});var Hr=w((a$,qi)=>{var Ol=Vr(),Nl=Br();qi.exports=Rl;function Rl(e){Object.keys(this.jobs).length&&(this.index=this.size,Ol(this),Nl(e)(null,this.results))}o(Rl,"terminator")});var Wi=w((c$,Hi)=>{var Cl=Zr(),Ul=qr(),Ml=Hr();Hi.exports=Ll;function Ll(e,t,r){for(var n=Ul(e);n.index<(n.keyedList||e).length;)Cl(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 Ml.bind(n,r)}o(Ll,"parallel")});var Wr=w((l$,qt)=>{var Gi=Zr(),jl=qr(),Fl=Hr();qt.exports=Bl;qt.exports.ascending=Ji;qt.exports.descending=Vl;function Bl(e,t,r,n){var i=jl(e,r);return Gi(e,t,i,o(function u(p,m){if(p){n(p,m);return}if(i.index++,i.index<(i.keyedList||e).length){Gi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Fl.bind(i,n)}o(Bl,"serialOrdered");function Ji(e,t){return e<t?-1:e>t?1:0}o(Ji,"ascending");function Vl(e,t){return-1*Ji(e,t)}o(Vl,"descending")});var Xi=w((d$,Ki)=>{var Zl=Wr();Ki.exports=ql;function ql(e,t,r){return Zl(e,t,null,r)}o(ql,"serial")});var Qi=w((f$,Yi)=>{Yi.exports={parallel:Wi(),serial:Xi(),serialOrdered:Wr()}});var Gr=w((g$,ea)=>{"use strict";ea.exports=Object});var ra=w((h$,ta)=>{"use strict";ta.exports=Error});var oa=w((y$,na)=>{"use strict";na.exports=EvalError});var aa=w((v$,ia)=>{"use strict";ia.exports=RangeError});var ca=w((_$,sa)=>{"use strict";sa.exports=ReferenceError});var la=w((x$,ua)=>{"use strict";ua.exports=SyntaxError});var Ht=w((b$,pa)=>{"use strict";pa.exports=TypeError});var ma=w((P$,da)=>{"use strict";da.exports=URIError});var ga=w((T$,fa)=>{"use strict";fa.exports=Math.abs});var ya=w((S$,ha)=>{"use strict";ha.exports=Math.floor});var _a=w((I$,va)=>{"use strict";va.exports=Math.max});var ba=w((w$,xa)=>{"use strict";xa.exports=Math.min});var Ta=w((E$,Pa)=>{"use strict";Pa.exports=Math.pow});var Ia=w(($$,Sa)=>{"use strict";Sa.exports=Math.round});var Ea=w((A$,wa)=>{"use strict";wa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Aa=w((k$,$a)=>{"use strict";var Hl=Ea();$a.exports=o(function(t){return Hl(t)||t===0?t:t<0?-1:1},"sign")});var ka=w((O$,za)=>{"use strict";za.exports=Object.getOwnPropertyDescriptor});var Jr=w((N$,Da)=>{"use strict";var Wt=ka();if(Wt)try{Wt([],"length")}catch{Wt=null}Da.exports=Wt});var Na=w((R$,Oa)=>{"use strict";var Gt=Object.defineProperty||!1;if(Gt)try{Gt({},"a",{value:1})}catch{Gt=!1}Oa.exports=Gt});var Kr=w((C$,Ra)=>{"use strict";Ra.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 p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(t,r);if(m.value!==i||m.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ma=w((M$,Ua)=>{"use strict";var Ca=typeof Symbol<"u"&&Symbol,Wl=Kr();Ua.exports=o(function(){return typeof Ca!="function"||typeof Symbol!="function"||typeof Ca("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Wl()},"hasNativeSymbols")});var Xr=w((j$,La)=>{"use strict";La.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Yr=w((F$,ja)=>{"use strict";var Gl=Gr();ja.exports=Gl.getPrototypeOf||null});var Va=w((B$,Ba)=>{"use strict";var Jl="Function.prototype.bind called on incompatible ",Kl=Object.prototype.toString,Xl=Math.max,Yl="[object Function]",Fa=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"),Ql=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"),ep=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");Ba.exports=o(function(t){var r=this;if(typeof r!="function"||Kl.apply(r)!==Yl)throw new TypeError(Jl+r);for(var n=Ql(arguments,1),i,u=o(function(){if(this instanceof i){var b=r.apply(this,Fa(n,arguments));return Object(b)===b?b:this}return r.apply(t,Fa(n,arguments))},"binder"),p=Xl(0,r.length-n.length),m=[],g=0;g<p;g++)m[g]="$"+g;if(i=Function("binder","return function ("+ep(m,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var v=o(function(){},"Empty");v.prototype=r.prototype,i.prototype=new v,v.prototype=null}return i},"bind")});var Ve=w((Z$,Za)=>{"use strict";var tp=Va();Za.exports=Function.prototype.bind||tp});var Jt=w((q$,qa)=>{"use strict";qa.exports=Function.prototype.call});var Qr=w((H$,Ha)=>{"use strict";Ha.exports=Function.prototype.apply});var Ga=w((W$,Wa)=>{"use strict";Wa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ka=w((G$,Ja)=>{"use strict";var rp=Ve(),np=Qr(),op=Jt(),ip=Ga();Ja.exports=ip||rp.call(op,np)});var Ya=w((J$,Xa)=>{"use strict";var ap=Ve(),sp=Ht(),cp=Jt(),up=Ka();Xa.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new sp("a function is required");return up(ap,cp,t)},"callBindBasic")});var os=w((X$,ns)=>{"use strict";var lp=Ya(),Qa=Jr(),ts;try{ts=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var en=!!ts&&Qa&&Qa(Object.prototype,"__proto__"),rs=Object,es=rs.getPrototypeOf;ns.exports=en&&typeof en.get=="function"?lp([en.get]):typeof es=="function"?o(function(t){return es(t==null?t:rs(t))},"getDunder"):!1});var us=w((Q$,cs)=>{"use strict";var is=Xr(),as=Yr(),ss=os();cs.exports=is?o(function(t){return is(t)},"getProto"):as?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return as(t)},"getProto"):ss?o(function(t){return ss(t)},"getProto"):null});var tn=w((tA,ls)=>{"use strict";var pp=Function.prototype.call,dp=Object.prototype.hasOwnProperty,mp=Ve();ls.exports=mp.call(pp,dp)});var ys=w((rA,hs)=>{"use strict";var M,fp=Gr(),gp=ra(),hp=oa(),yp=aa(),vp=ca(),We=la(),He=Ht(),_p=ma(),xp=ga(),bp=ya(),Pp=_a(),Tp=ba(),Sp=Ta(),Ip=Ia(),wp=Aa(),fs=Function,rn=o(function(e){try{return fs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),ht=Jr(),Ep=Na(),nn=o(function(){throw new He},"throwTypeError"),$p=ht?function(){try{return arguments.callee,nn}catch{try{return ht(arguments,"callee").get}catch{return nn}}}():nn,Ze=Ma()(),K=us(),Ap=Yr(),zp=Xr(),gs=Qr(),yt=Jt(),qe={},kp=typeof Uint8Array>"u"||!K?M:K(Uint8Array),ze={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&K?K([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":gp,"%eval%":eval,"%EvalError%":hp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":fs,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&K?K(K([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!K?M:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":fp,"%Object.getOwnPropertyDescriptor%":ht,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":yp,"%ReferenceError%":vp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!K?M:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&K?K(""[Symbol.iterator]()):M,"%Symbol%":Ze?Symbol:M,"%SyntaxError%":We,"%ThrowTypeError%":$p,"%TypedArray%":kp,"%TypeError%":He,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":_p,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":yt,"%Function.prototype.apply%":gs,"%Object.defineProperty%":Ep,"%Object.getPrototypeOf%":Ap,"%Math.abs%":xp,"%Math.floor%":bp,"%Math.max%":Pp,"%Math.min%":Tp,"%Math.pow%":Sp,"%Math.round%":Ip,"%Math.sign%":wp,"%Reflect.getPrototypeOf%":zp};if(K)try{null.error}catch(e){ps=K(K(e)),ze["%Error.prototype%"]=ps}var ps,Dp=o(function e(t){var r;if(t==="%AsyncFunction%")r=rn("async function () {}");else if(t==="%GeneratorFunction%")r=rn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&K&&(r=K(i.prototype))}return ze[t]=r,r},"doEval"),ds={__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"]},vt=Ve(),Kt=tn(),Op=vt.call(yt,Array.prototype.concat),Np=vt.call(gs,Array.prototype.splice),ms=vt.call(yt,String.prototype.replace),Xt=vt.call(yt,String.prototype.slice),Rp=vt.call(yt,RegExp.prototype.exec),Cp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Up=/\\(\\)?/g,Mp=o(function(t){var r=Xt(t,0,1),n=Xt(t,-1);if(r==="%"&&n!=="%")throw new We("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new We("invalid intrinsic syntax, expected opening `%`");var i=[];return ms(t,Cp,function(u,p,m,g){i[i.length]=m?ms(g,Up,"$1"):p||u}),i},"stringToPath"),Lp=o(function(t,r){var n=t,i;if(Kt(ds,n)&&(i=ds[n],n="%"+i[0]+"%"),Kt(ze,n)){var u=ze[n];if(u===qe&&(u=Dp(n)),typeof u>"u"&&!r)throw new He("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new We("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");hs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new He("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new He('"allowMissing" argument must be a boolean');if(Rp(/^%?[^%]*%?$/,t)===null)throw new We("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Mp(t),i=n.length>0?n[0]:"",u=Lp("%"+i+"%",r),p=u.name,m=u.value,g=!1,v=u.alias;v&&(i=v[0],Np(n,Op([0,1],v)));for(var b=1,T=!0;b<n.length;b+=1){var h=n[b],c=Xt(h,0,1),d=Xt(h,-1);if((c==='"'||c==="'"||c==="`"||d==='"'||d==="'"||d==="`")&&c!==d)throw new We("property names with quotes must have matching quotes");if((h==="constructor"||!T)&&(g=!0),i+="."+h,p="%"+i+"%",Kt(ze,p))m=ze[p];else if(m!=null){if(!(h in m)){if(!r)throw new He("base intrinsic for "+t+" exists, but the property is not available.");return}if(ht&&b+1>=n.length){var y=ht(m,h);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?m=y.get:m=m[h]}else T=Kt(m,h),m=m[h];T&&!g&&(ze[p]=m)}}return m},"GetIntrinsic")});var _s=w((oA,vs)=>{"use strict";var jp=Kr();vs.exports=o(function(){return jp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Ps=w((aA,bs)=>{"use strict";var Fp=ys(),xs=Fp("%Object.defineProperty%",!0),Bp=_s()(),Vp=tn(),Zp=Ht(),Yt=Bp?Symbol.toStringTag:null;bs.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 Zp("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Yt&&(n||!Vp(t,Yt))&&(xs?xs(t,Yt,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[Yt]=r)},"setToStringTag")});var Ss=w((cA,Ts)=>{"use strict";var qp=Function.prototype.call,Hp=Object.prototype.hasOwnProperty,Wp=Ve();Ts.exports=Wp.call(qp,Hp)});var ws=w((uA,Is)=>{"use strict";Is.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Qt=w((lA,$s)=>{"use strict";var cn=ki(),Gp=require("util"),on=require("path"),Jp=require("http"),Kp=require("https"),Xp=require("url").parse,Yp=require("fs"),Qp=require("stream").Stream,ed=require("crypto"),an=Ci(),td=Qi(),rd=Ps(),Se=Ss(),sn=ws();function Es(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Es,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],cn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Gp.inherits(j,cn);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=cn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};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&&Se(t,"httpVersion"))&&!(t instanceof Qp))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Se(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Yp.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Se(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Se(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="",p={"Content-Disposition":["form-data",'name="'+Es(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&sn(p,r.header);var m;for(var g in p)if(Se(p,g)){if(m=p[g],m==null)continue;Array.isArray(m)||(m=[m]),m.length&&(u+=g+": "+m.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=on.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=on.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Se(e,"httpVersion")&&(r=on.basename(e.client._httpMessage.path||"")),r)return'filename="'+Es(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=an.lookup(e.name)),!r&&e&&e.path&&(r=an.lookup(e.path)),!r&&e&&e.readable&&Se(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=an.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Se(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="--------------------------"+ed.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}td.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=Xp(e),n=sn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=sn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Kp.request(n):r=Jp.request(n),this.getLength(function(u,p){if(u&&u!=="Unknown stream"){this._error(u);return}if(p&&r.setHeader("Content-Length",p),this.pipe(r),t){var m,g=o(function(v,b){return r.removeListener("error",g),r.removeListener("response",m),t.call(this,v,b)},"callback");m=g.bind(this,null),r.on("error",g),r.on("response",m)}}.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]"};rd(j.prototype,"FormData");$s.exports=j});var dd={};dn(dd,{pdfcrowd:()=>pd});module.exports=Bs(dd);var Vs=Object.freeze({status:"aborted"});function S(e,t,r){function n(m,g){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:g,constr:p,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,g);let v=p.prototype,b=Object.keys(v);for(let T=0;T<b.length;T++){let h=b[T];h in m||(m[h]=v[h].bind(m))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function p(m){var g;let v=r?.Parent?new u:this;n(v,m),(g=v._zod).deferred??(g.deferred=[]);for(let b of v._zod.deferred)b();return v}return o(p,"_"),Object.defineProperty(p,"init",{value:n}),Object.defineProperty(p,Symbol.hasInstance,{value:o(m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}o(S,"$constructor");var Zs=Symbol("zod_brand"),ae=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},xt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},nr={};function ue(e){return e&&Object.assign(nr,e),nr}o(ue,"config");function ir(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(ir,"getEnumValues");function gn(e,t){return typeof t=="bigint"?t.toString():t}o(gn,"jsonStringifyReplacer");function Pt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Pt,"cached");function hn(e){return e==null}o(hn,"nullish");function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Tt,"cleanRegex");var fn=Symbol("evaluating");function G(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==fn)return n===void 0&&(n=fn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(G,"defineLazy");var ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ke(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ke,"isObject");var qs=Pt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function yn(e){if(Ke(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ke(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(yn,"isPlainObject");var vn=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(_n,"optionalKeys");var Hs={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 Oe(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(Oe,"aborted");function ye(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(ye,"prefixIssues");function bt(e){return typeof e=="string"?e:e?.message}o(bt,"unwrapMessage");function ve(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=bt(e.inst?._zod.def?.error?.(e))??bt(t?.error?.(e))??bt(r.customError?.(e))??bt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(ve,"finalizeIssue");function xn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(xn,"getLengthableOrigin");function sr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(sr,"issue");var bn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Pn=S("$ZodError",bn),Xe=S("$ZodError",bn,{Parent:Error});var Gs=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise)throw new ae;if(p.issues.length){let m=new(i?.Err??e)(p.issues.map(g=>ve(g,u,ue())));throw ar(m,i?.callee),m}return p.value},"_parse"),It=Gs(Xe),Js=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise&&(p=await p),p.issues.length){let m=new(i?.Err??e)(p.issues.map(g=>ve(g,u,ue())));throw ar(m,i?.callee),m}return p.value},"_parseAsync"),wt=Js(Xe),Ks=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 ae;return u.issues.length?{success:!1,error:new(e??Pn)(u.issues.map(p=>ve(p,i,ue())))}:{success:!0,data:u.value}},"_safeParse"),Ye=Ks(Xe),Xs=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(p=>ve(p,i,ue())))}:{success:!0,data:u.value}},"_safeParseAsync"),Qe=Xs(Xe);var Ys="(?:(?:\\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])))",Qs=new RegExp(`^${Ys}$`);var Tn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,In=/^(?:true|false)$/i;var Ne=S("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var wn=S("$ZodCheckMinLength",(e,t)=>{var r;Ne.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!hn(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 p=xn(i);n.issues.push({origin:p,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var ur=S("$ZodCheckStringFormat",(e,t)=>{var r,n;Ne.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=()=>{})}),En=S("$ZodCheckRegex",(e,t)=>{ur.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 An={major:4,minor:3,patch:6};var q=S("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=An;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((p,m,g)=>{let v=Oe(p),b;for(let T of m){if(T._zod.def.when){if(!T._zod.def.when(p))continue}else if(v)continue;let h=p.issues.length,c=T._zod.check(p);if(c instanceof Promise&&g?.async===!1)throw new ae;if(b||c instanceof Promise)b=(b??Promise.resolve()).then(async()=>{await c,p.issues.length!==h&&(v||(v=Oe(p,h)))});else{if(p.issues.length===h)continue;v||(v=Oe(p,h))}}return b?b.then(()=>p):p},"runChecks"),u=o((p,m,g)=>{if(Oe(p))return p.aborted=!0,p;let v=i(m,n,g);if(v instanceof Promise){if(g.async===!1)throw new ae;return v.then(b=>e._zod.parse(b,g))}return e._zod.parse(v,g)},"handleCanaryResult");e._zod.run=(p,m)=>{if(m.skipChecks)return e._zod.parse(p,m);if(m.direction==="backward"){let v=e._zod.parse({value:p.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(b=>u(b,p,m)):u(v,p,m)}let g=e._zod.parse(p,m);if(g instanceof Promise){if(m.async===!1)throw new ae;return g.then(v=>i(v,n,m))}return i(g,n,m)}}G(e,"~standard",()=>({validate:o(i=>{try{let u=Ye(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Qe(e,i).then(p=>p.success?{value:p.data}:{issues:p.error?.issues})}},"validate"),vendor:"zod",version:1}))}),At=S("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),lr=S("$ZodStringFormat",(e,t)=>{ur.init(e,t),At.init(e,t)});var Nn=S("$ZodURL",(e,t)=>{lr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Rn=S("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var pr=S("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=In,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}}),Cn=S("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=Sn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Un=S("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=r=>r}),Mn=S("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=r=>r});var Ln=S("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),jn=S("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function zn(e,t,r){e.issues.length&&t.issues.push(...ye(r,e.issues)),t.value[r]=e.value}o(zn,"handleArrayResult");var Fn=S("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let p=0;p<i.length;p++){let m=i[p],g=t.element._zod.run({value:m,issues:[]},n);g instanceof Promise?u.push(g.then(v=>zn(v,r,p))):zn(g,r,p)}return u.length?Promise.all(u).then(()=>r):r}});function $t(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ye(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o($t,"handlePropertyResult");function ec(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=_n(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(ec,"normalizeDef");function tc(e,t,r,n,i,u){let p=[],m=i.keySet,g=i.catchall._zod,v=g.def.type,b=g.optout==="optional";for(let T in t){if(m.has(T))continue;if(v==="never"){p.push(T);continue}let h=g.run({value:t[T],issues:[]},n);h instanceof Promise?e.push(h.then(c=>$t(c,r,T,t,b))):$t(h,r,T,t,b)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(tc,"handleCatchall");var Bn=S("$ZodObject",(e,t)=>{if(q.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let m=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...m};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Pt(()=>ec(t));G(e._zod,"propValues",()=>{let m=t.shape,g={};for(let v in m){let b=m[v]._zod;if(b.values){g[v]??(g[v]=new Set);for(let T of b.values)g[v].add(T)}}return g});let i=Ke,u=t.catchall,p;e._zod.parse=(m,g)=>{p??(p=n.value);let v=m.value;if(!i(v))return m.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),m;m.value={};let b=[],T=p.shape;for(let h of p.keys){let c=T[h],d=c._zod.optout==="optional",y=c._zod.run({value:v[h],issues:[]},g);y instanceof Promise?b.push(y.then(f=>$t(f,m,h,v,d))):$t(y,m,h,v,d)}return u?tc(b,v,m,g,n.value,e):b.length?Promise.all(b).then(()=>m):m}});function kn(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=>!Oe(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(p=>ve(p,n,ue())))}),t)}o(kn,"handleUnionResults");var dr=S("$ZodUnion",(e,t)=>{q.init(e,t),G(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),G(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),G(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),G(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=>Tt(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 p=!1,m=[];for(let g of t.options){let v=g._zod.run({value:i.value,issues:[]},u);if(v instanceof Promise)m.push(v),p=!0;else{if(v.issues.length===0)return v;m.push(v)}}return p?Promise.all(m).then(g=>kn(g,i,e,u)):kn(m,i,e,u)}});var Vn=S("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,dr.init(e,t);let r=e._zod.parse;G(e._zod,"propValues",()=>{let i={};for(let u of t.options){let p=u._zod.propValues;if(!p||Object.keys(p).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[m,g]of Object.entries(p)){i[m]||(i[m]=new Set);for(let v of g)i[m].add(v)}}return i});let n=Pt(()=>{let i=t.options,u=new Map;for(let p of i){let m=p._zod.propValues?.[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(let g of m){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,p)}}return u});e._zod.parse=(i,u)=>{let p=i.value;if(!Ke(p))return i.issues.push({code:"invalid_type",expected:"object",input:p,inst:e}),i;let m=n.value.get(p?.[t.discriminator]);return m?m._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:p,path:[t.discriminator],inst:e}),i)}});var Zn=S("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!yn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],p=t.keyType._zod.values;if(p){r.value={};let m=new Set;for(let v of p)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){m.add(typeof v=="number"?v.toString():v);let b=t.valueType._zod.run({value:i[v],issues:[]},n);b instanceof Promise?u.push(b.then(T=>{T.issues.length&&r.issues.push(...ye(v,T.issues)),r.value[v]=T.value})):(b.issues.length&&r.issues.push(...ye(v,b.issues)),r.value[v]=b.value)}let g;for(let v in i)m.has(v)||(g=g??[],g.push(v));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let m of Reflect.ownKeys(i)){if(m==="__proto__")continue;let g=t.keyType._zod.run({value:m,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&cr.test(m)&&g.issues.length){let T=t.keyType._zod.run({value:Number(m),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(g=T)}if(g.issues.length){t.mode==="loose"?r.value[m]=i[m]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(T=>ve(T,n,ue())),input:m,path:[m],inst:e});continue}let b=t.valueType._zod.run({value:i[m],issues:[]},n);b instanceof Promise?u.push(b.then(T=>{T.issues.length&&r.issues.push(...ye(m,T.issues)),r.value[g.value]=T.value})):(b.issues.length&&r.issues.push(...ye(m,b.issues)),r.value[g.value]=b.value)}}return u.length?Promise.all(u).then(()=>r):r}});var qn=S("$ZodEnum",(e,t)=>{q.init(e,t);let r=ir(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vn.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let p=i.value;return n.has(p)||i.issues.push({code:"invalid_value",values:r,input:p,inst:e}),i}}),Hn=S("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Wn=S("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new xt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(p=>(r.value=p,r));if(i instanceof Promise)throw new ae;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Gn=S("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Jn=S("$ZodNullable",(e,t)=>{q.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)}|null)$`):void 0}),G(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 Kn=S("$ZodPipe",(e,t)=>{q.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(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(p=>Et(p,t.in,n)):Et(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Et(u,t.out,n)):Et(i,t.out,n)}});function Et(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Et,"handlePipeResult");var Xn=S("$ZodCustom",(e,t)=>{Ne.init(e,t),q.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>On(u,r,n,e));On(i,r,n,e)}});function On(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(sr(i))}}o(On,"handleRefineResult");var Qn,ic=Symbol("ZodOutput"),ac=Symbol("ZodInput"),mr=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 eo(){return new mr}o(eo,"registry");(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=eo());var fr=globalThis.__zod_globalRegistry;function to(e,t){return new e({type:"string",...Z(t)})}o(to,"_string");function ro(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(ro,"_coercedString");function no(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(no,"_url");function oo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(oo,"_number");function io(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(io,"_coercedNumber");function ao(e,t){return new e({type:"boolean",...Z(t)})}o(ao,"_boolean");function so(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(so,"_coercedBoolean");function co(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(co,"_coercedBigint");function uo(e){return new e({type:"any"})}o(uo,"_any");function lo(e){return new e({type:"unknown"})}o(lo,"_unknown");function po(e,t){return new e({type:"void",...Z(t)})}o(po,"_void");function mo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(mo,"_coercedDate");function oe(e,t){return new wn({check:"min_length",...Z(t),minimum:e})}o(oe,"_minLength");function _e(e,t){return new En({check:"string_format",format:"regex",...Z(t),pattern:e})}o(_e,"_regex");function fo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(fo,"_custom");var J=S("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");q.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>It(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ye(e,r,n),e.parseAsync=async(r,n)=>wt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qe(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>St(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),kt=S("ZodMiniString",(e,t)=>{At.init(e,t),J.init(e,t)});function a(e){return to(kt,e)}o(a,"string");var go=S("ZodMiniStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var hc=S("ZodMiniURL",(e,t)=>{Nn.init(e,t),go.init(e,t)});function ho(e){return no(hc,e)}o(ho,"url");var gr=S("ZodMiniNumber",(e,t)=>{Rn.init(e,t),J.init(e,t)});function X(e){return oo(gr,e)}o(X,"number");var hr=S("ZodMiniBoolean",(e,t)=>{pr.init(e,t),J.init(e,t)});function B(e){return ao(hr,e)}o(B,"boolean");var yo=S("ZodMiniBigInt",(e,t)=>{Cn.init(e,t),J.init(e,t)});var yc=S("ZodMiniAny",(e,t)=>{Un.init(e,t),J.init(e,t)});function tt(){return uo(yc)}o(tt,"any");var vc=S("ZodMiniUnknown",(e,t)=>{Mn.init(e,t),J.init(e,t)});function k(){return lo(vc)}o(k,"unknown");var _c=S("ZodMiniVoid",(e,t)=>{Ln.init(e,t),J.init(e,t)});function vo(e){return po(_c,e)}o(vo,"_void");var _o=S("ZodMiniDate",(e,t)=>{jn.init(e,t),J.init(e,t)});var xc=S("ZodMiniArray",(e,t)=>{Fn.init(e,t),J.init(e,t)});function N(e,t){return new xc({type:"array",element:e,...Z(t)})}o(N,"array");var bc=S("ZodMiniObject",(e,t)=>{Bn.init(e,t),J.init(e,t),G(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...Z(t)};return new bc(r)}o(l,"object");var Pc=S("ZodMiniUnion",(e,t)=>{dr.init(e,t),J.init(e,t)});function R(e,t){return new Pc({type:"union",options:e,...Z(t)})}o(R,"union");var Tc=S("ZodMiniDiscriminatedUnion",(e,t)=>{Vn.init(e,t),J.init(e,t)});function Re(e,t,r){return new Tc({type:"union",options:t,discriminator:e,...Z(r)})}o(Re,"discriminatedUnion");var Sc=S("ZodMiniRecord",(e,t)=>{Zn.init(e,t),J.init(e,t)});function D(e,t,r){return new Sc({type:"record",keyType:e,valueType:t,...Z(r)})}o(D,"record");var Ic=S("ZodMiniEnum",(e,t)=>{qn.init(e,t),J.init(e,t),e.options=Object.values(t.entries)});function U(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ic({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var wc=S("ZodMiniLiteral",(e,t)=>{Hn.init(e,t),J.init(e,t)});function E(e,t){return new wc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(E,"literal");var Ec=S("ZodMiniTransform",(e,t)=>{Wn.init(e,t),J.init(e,t)});function xe(e){return new Ec({type:"transform",transform:e})}o(xe,"transform");var $c=S("ZodMiniOptional",(e,t)=>{Gn.init(e,t),J.init(e,t)});function _(e){return new $c({type:"optional",innerType:e})}o(_,"optional");var Ac=S("ZodMiniNullable",(e,t)=>{Jn.init(e,t),J.init(e,t)});function rt(e){return new Ac({type:"nullable",innerType:e})}o(rt,"nullable");var zc=S("ZodMiniPipe",(e,t)=>{Kn.init(e,t),J.init(e,t)});function be(e,t){return new zc({type:"pipe",in:e,out:t})}o(be,"pipe");var kc=S("ZodMiniCustom",(e,t)=>{Xn.init(e,t),J.init(e,t)});function Dt(e,t){return fo(kc,e??(()=>!0),t)}o(Dt,"custom");var nt={};dn(nt,{bigint:()=>Mc,boolean:()=>Uc,date:()=>Lc,number:()=>Cc,string:()=>Rc});function Rc(e){return ro(kt,e)}o(Rc,"string");function Cc(e){return io(gr,e)}o(Cc,"number");function Uc(e){return so(hr,e)}o(Uc,"boolean");function Mc(e){return co(yo,e)}o(Mc,"bigint");function Lc(e){return mo(_o,e)}o(Lc,"date");var vr=l({retryOnFailure:l({defaultValue:_(B()),hide:_(B())}),continueOnFailure:l({defaultValue:_(B()),hide:_(B())})}),yr=class{constructor(t,r,n,i,u,p,m,g,v,b,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=p;this.requireAuth=m;this.errorHandlingOptions=g;this.outputSchema=v;this.audience=b;this.aiMetadata=T}static{o(this,"IAction")}},Ce=o(e=>new yr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=l({displayName:a(),description:_(a())}),C=o((e,t)=>l({type:E(t),required:B(),defaultValue:_(tt())}),"TPropertyValue");var ee=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),le=l({...F.shape,...C(a(),"LONG_TEXT").shape});var bo=l({label:a(),value:k()}),Ot=l({disabled:_(B()),placeholder:_(a()),options:N(bo)});var te=l({...F.shape,options:Ot,...C(k(),"STATIC_DROPDOWN").shape}),pe=l({...F.shape,options:Ot,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),ot=l({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var de=l({...F.shape,...C(B(),"CHECKBOX").shape});var me=l({...F.shape,...C(X(),"NUMBER").shape});var it=l({...F.shape,...C(k(),"FILE").shape});var at=l({...F.shape,...C(a(),"DATE_TIME").shape});var Po=D(a(),R([ee,le,te,ot,pe,de,me,it,at])),st=l({...F.shape,properties:Po,...C(N(k()),"ARRAY").shape});var ct=l({...F.shape,...C(R([D(a(),k())]),"JSON").shape});var To=R([ee,te,ct,st,pe]),Fc=D(a(),To),xr=l({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Nt=l({...F.shape,...C(vo(),"MARKDOWN").shape});var ut=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ut||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Me||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),br="both_client_credentials_and_authorization_code";var we=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(we||{}),pt=(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))(pt||{}),Bc=l({strategy:U(pt),paramName:_(a())}),dt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(dt||{});var Rt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Rt||{}),So=l({status:_(X()),body:_(k()),headers:_(D(a(),a()))}),Io=l({type:E("DELAY"),resumeDateTime:a(),requestIdToReply:_(a()),handlerId:_(a()),streamStepProgress:_(U(Rt))}),wo=l({type:E("WEBHOOK"),requestId:a(),requestIdToReply:_(a()),response:So,handlerId:_(a()),streamStepProgress:_(U(Rt))}),Vc=R([Io,wo]);var Zc=l({body:k(),rawBody:_(k()),headers:D(a(),a()),queryParams:D(a(),a())});function fe(e){return e==null}o(fe,"isNil");function mt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(mt,"isEmpty");function Ct(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ct,"assertNotNullOrUndefined");var Pr=he(require("crypto"),1);var qc=128,Ee,Le,Hc=o(e=>{!Ee||Ee.length<e?(Ee=Buffer.allocUnsafe(e*qc),Pr.default.randomFillSync(Ee),Le=0):Le+e>Ee.length&&(Pr.default.randomFillSync(Ee),Le=0),Le+=e},"fillPool"),Wc=o(e=>(Hc(e|=0),Ee.subarray(Le-e,Le)),"random"),Gc=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 p="";for(;;){let m=r(i),g=i;for(;g--;)if(p+=e[m[g]&n]||"",p.length===u)return p}}},"customRandom"),$o=o((e,t=21)=>Gc(e,t,Wc),"customAlphabet");var Jc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Ao=21,Jb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${Ao}}$`))),Kc=$o(Jc,Ao);var Pe=be(xe(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Pe,updated:Pe},V=o(e=>_(rt(e)),"Nullable");function Tr(e){return _(rt(U(e)))}o(Tr,"NullableEnum");var Yb=be(xe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),_(B())),Ut=o(e=>be(xe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),_(N(e))),"OptionalArrayFromQuery");var tP=D(a(),k());var ft=(b=>(b.OPENAI="openai",b.OPENROUTER="openrouter",b.ANTHROPIC="anthropic",b.AZURE="azure",b.GOOGLE="google",b.ACTIVEPIECES="activepieces",b.CLOUDFLARE_GATEWAY="cloudflare-gateway",b.CUSTOM="custom",b.BEDROCK="bedrock",b.MISTRAL="mistral",b))(ft||{});var mP=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var gP=l({filename:a(),data:k(),type:E("file"),mimetype:_(a())});var Xc=he(ko());var PP=l({...re,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:_(X())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Sr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sr||{}),Ir=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ir||{});var wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(wr||{});var Er=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Er||{});var Yc=l({mode:U(Do),value:k()}),Qc=l({auth:_(a()),fields:D(a(),Yc)}),eu=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:_(Qc)}),tu=l({type:E("PIECE"),toolName:a().check(oe(1)),pieceMetadata:eu}),ru=l({type:E("none")}),nu=l({type:E("access_token"),accessToken:a()}),ou=l({type:E("api_key"),apiKey:a(),apiKeyHeader:a()}),iu=l({type:E("headers"),headers:D(a(),a())}),au=Re("type",[ru,nu,ou,iu]),Oo=l({type:E("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:_(a())}),No=l({type:E("MCP"),toolName:a().check(oe(1)),serverUrl:ho(),protocol:U(Ir),auth:au}),Ro=l({type:E("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:U(Sr),sourceId:a(),sourceName:a()}),su=Re("type",[tu,Oo,No,Ro]),cu=l({displayName:a(),description:_(a()),type:U(wr)}),Co=l({type:E("MARKDOWN"),markdown:a()}),je={type:E("TOOL_CALL"),input:V(D(a(),k())),output:_(k()),toolName:a(),status:U(Er),toolCallId:a(),startTime:a(),endTime:_(a())},JP=l(je),Uo=Re("toolCallType",[l({...je,toolCallType:E("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:E("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:E("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:E("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:E("UNKNOWN"),displayName:a()})]),uu=R([Co,Uo]);var $r=(r=>(r.IMAGE="image",r.TEXT="text",r))($r||{}),ge=l({apiKey:a()}),lu=ge,pu=l({apiKey:a(),apiKeyHash:a()}),du=ge,mu=ge,fu=ge,gu=ge,hu=ge,yu=ge,vu=ge,Mo=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),_u=l({}),xu=l({}),bu=l({}),Pu=l({}),Tu=l({}),Su=l({}),Lo=l({modelId:a(),modelName:a(),modelType:U($r)}),jo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Lo),defaultHeaders:_(D(a(),a()))}),Fo=l({accountId:a(),gatewayId:a(),models:N(Lo),vertexProject:_(a()),vertexRegion:_(a())}),Bo=l({resourceName:a(),apiVersion:be(xe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),_(a()))}),Vo=l({region:a().check(oe(1))}),Iu=R([lu,fu,gu,hu,yu,mu,du,pu,Mo,vu]),Zo=R([jo,Fo,Bo,Vo,_u,bu,Pu,Tu,xu,Su]),wu=l({id:a(),name:a(),type:U($r)}),Eu=l({id:a(),name:a(),provider:U(ft),config:Zo,enabledForChat:B()}),$u=l({provider:U(ft),config:Zo,auth:Iu,platformId:a()});var QP={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Au=l({base64Url:a(),fileName:a(),extension:_(a())}),zu=l({mimeType:a(),url:a(),fileName:_(a())}),Ar=R([Au,zu]);var ku=R([l({type:E("file"),value:Ar}),l({type:E("markdown"),value:a(),files:_(N(Ar))})]),Du=l({sessionId:a(),message:a(),files:_(N(a()))});var Ho=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ho||{}),Wo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wo||{}),zr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(zr||{});var Ou=R([l({...re,name:a(),externalId:a(),type:E("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:R([E("TEXT"),E("NUMBER"),E("DATE")]),tableId:a(),projectId:a()})]),Nu=l({...re,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Tr(Wo),trigger:Tr(Ho)}),Ru=l({...re,tableId:a(),projectId:a(),cells:D(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Cu=l({events:N(U(zr)),webhookUrl:a(),flowId:a()}),Uu=l({fields:N(l({id:a(),name:a()})),rows:N(D(a(),a())),name:a()}),Mu=l({projectId:a(),limit:_(nt.number()),cursor:_(a()),name:_(a()),externalIds:Ut(a()),folderId:_(a()),folderIds:Ut(a())}),Lu=l({records:N(N(l({fieldId:a(),value:Jo()}))),tableId:a()}),ju=l({cells:_(N(l({fieldId:a(),value:Jo()}))),tableId:a(),agentUpdate:_(B())}),Go=Re("operator",[$e("eq"),$e("neq"),$e("gt"),$e("gte"),$e("lt"),$e("lte"),$e("co"),qo("exists"),qo("not_exists")]),Fu=l({tableId:a(),limit:_(nt.number()),cursor:_(a()),filters:Ut(Go)});function Jo(){return be(xe(e=>e==null?e:String(e)),rt(a()))}o(Jo,"coerceToString");function $e(e){return l({fieldId:a(),operator:E(e),value:a()})}o($e,"valueFilter");function qo(e){return l({fieldId:a(),operator:E(e)})}o(qo,"existenceFilter");var Bu=l({status:_(X()),body:_(k()),headers:_(D(a(),a()))}),Vu=l({...re,deleted:V(Pe),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var Ko=l({name:a(),description:_(a()),type:a(),required:B()}),Zu=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(Ko),returnsResponse:B()})});var Xo="^[0-9]+\\.[0-9]+\\.[0-9]+$",vT=new RegExp(Xo),Hu="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",_T=a().check(_e(new RegExp(Xo))),xT=a().check(_e(new RegExp(Hu))),Wu=l({packageType:E("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Yo=l({packageType:E("REGISTRY"),pieceType:E("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Qo=l({packageType:E("REGISTRY"),pieceType:E("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),bT=R([Yo,Qo]),PT=R([Wu,Yo,Qo]),ei=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ei||{}),Gu=l({type:U(ei),cronExpression:a(),timezone:a()}),TT=l({...re,type:U(we),projectId:a(),flowId:a(),triggerName:a(),schedule:V(Gu),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),ti=(f=>(f.UNKNOWN="UNKNOWN",f.FLOW_RUN_LOG="FLOW_RUN_LOG",f.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",f.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",f.FLOW_STEP_FILE="FLOW_STEP_FILE",f.SAMPLE_DATA="SAMPLE_DATA",f.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",f.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",f.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",f.PROJECT_RELEASE="PROJECT_RELEASE",f.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",f.PLATFORM_ASSET="PLATFORM_ASSET",f.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",f.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",f.KNOWLEDGE_BASE="KNOWLEDGE_BASE",f.FLOW_BUNDLE="FLOW_BUNDLE",f))(ti||{}),ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ri||{}),ni=(r=>(r.S3="S3",r.DB="DB",r))(ni||{}),ST=l({...re,projectId:V(a()),platformId:V(a()),type:U(ti),compression:U(ri),data:_(k()),location:U(ni),size:V(X()),fileName:V(a()),s3Key:V(a()),metadata:V(D(a(),a()))}),oi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(oi||{}),ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ii||{}),IT=l({id:a(),email:a(),firstName:a(),status:U(ii),externalId:V(a()),platformId:V(a()),platformRole:U(oi),lastName:a(),created:Pe,updated:Pe,lastActiveDate:V(Pe),imageUrl:V(a())});var kr=l({...F.shape,...C(D(a(),k()),"OBJECT").shape});var ui=l({...F.shape,...C(a(),"COLOR").shape});var Dr=R([ee,le,Nt,de,te,pe,_r,ot,xr,me,st,kr,ct,at,it,ui]),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 se=l({displayName:a(),description:_(a())});var li=l({username:a(),password:a()}),Or=l({...se.shape,username:l({displayName:a(),description:_(a())}),password:l({displayName:a(),description:_(a())}),...C(li,"BASIC_AUTH").shape});var Yu=D(a(),R([ee,le,me,de,te])),Nr=l({...se.shape,props:Yu,...C(k(),"CUSTOM_AUTH").shape});var Ae=l({...se.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Qu=D(a(),R([ee,le,Ae,me,de,te,pe,Nt])),pi=l({...se.shape,props:Qu,...C(k(),"OIDC").shape});var Rr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Rr||{}),di=R([ee,Ae,te]),mi=D(a(),di),el=l({props:_(D(a(),di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:_(R([E("none"),E("consent"),E("login"),E("omit")])),pkce:_(B()),pkceMethod:_(R([E("plain"),E("S256")])),authorizationMethod:_(U(Rr)),grantType:_(R([U(lt),E(br)])),extra:_(D(a(),a()))}),fi=l({access_token:a(),props:_(mi),data:D(a(),tt())}),Cr=l({...se.shape,...el.shape,...C(fi,"OAUTH2").shape});var Fe=R([Or,Nr,pi,Cr,Ae]),gt="Connection",Ur={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||gt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||gt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||gt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||gt}},None(){}};var nI={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 tl=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var rl=R([Dr,Fe]),Mr=D(a(),rl),TI=D(a(),Dr);var gi=R([l({strategy:E("CRON"),cronExpression:a()}),l({strategy:E("NONE")})]);var hi="2",Lt="0.82.0";var Lr=class{constructor(t,r,n,i,u,p,m,g,v=Lt,b,T=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=m;this.auth=g;this.minimumSupportedRelease=v;this.maximumSupportedRelease=b;this.description=T;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:hi}),"getContextInfo");(!nl(v)||ol(v,Lt))&&(this.minimumSupportedRelease=Lt),u.forEach(h=>this._actions[h.name]=h),p.forEach(h=>this._triggers[h.name]=h)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},yi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Lr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function nl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(nl,"isValidSimpleSemver");function ol(e,t){let[r,n,i]=e.split(".").map(Number),[u,p,m]=t.split(".").map(Number);return r!==u?r<u:n!==p?n<p:i<m}o(ol,"isSemverLessThan");var il=_(D(a(),D(a(),a()))),vi=l({id:_(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:_(a()),directoryPath:_(a()),auth:_(R([Fe,N(Fe)])),version:a(),categories:_(N(U(Me))),minimumSupportedRelease:_(a()),maximumSupportedRelease:_(a()),i18n:il}),al=U(["human","ai","both"]),_i=l({description:_(a()),idempotent:_(B())}),xi=l({name:a(),displayName:a(),description:a(),props:Mr,requireAuth:B(),errorHandlingOptions:_(vr),outputSchema:_(Dt()),audience:_(al),aiMetadata:_(_i)}),bi=l({name:a(),displayName:a(),description:a(),props:Mr,errorHandlingOptions:_(vr),type:U(we),sampleData:k(),handshakeConfiguration:_(Dt()),renewConfiguration:_(gi),testStrategy:U(dt),outputSchema:_(Dt()),aiMetadata:_(_i)}),sl=l({...vi.shape,actions:D(a(),xi),triggers:D(a(),bi)}),cl=l({...vi.shape,actions:X(),triggers:X(),suggestedActions:_(N(bi)),suggestedTriggers:_(N(xi))}),Pi=l({projectUsage:X(),tags:_(N(a())),pieceType:U(Ue),packageType:U(ut),platformId:_(a()),archiveId:_(a())}),Tw=l({...sl.shape,...Pi.shape}),Sw=l({...cl.shape,...Pi.shape}),Iw=l({name:a(),version:a()});var ul=he(require("path")),ll=he(require("fs/promises"));var jt=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,p)=>{i.append(p,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ft=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new jr,r=new Fr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},jr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Fr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var 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}}};var Vt=class extends jt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ft){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),p=t.queryParams??{};for(let[L,Q]of Object.entries(p))i.append(L,Q);let m=i.toString(),g=m?`${n}?${m}`:n,v=t.responseType??"json",b=t.followRedirects??!0,T=t.retries??0,{body:h,extraHeaders:c,isStream:d}=pl(t.body,u),y=ml({...u,...c}),f=await dl(async()=>{let L=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:y,body:h,redirect:b?"follow":"manual",signal:L.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(g,ne)}finally{Q!==void 0&&clearTimeout(Q)}},T),x=b?300:400;if(f.status<200||f.status>=x){let L=await Ti(f,v),Q=new Bt(t.body,{status:f.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let P=await Ti(f,v);return{status:f.status,headers:fl(f.headers),body:P}}};function pl(e,t){return hl(e)?{body:void 0,extraHeaders:{},isStream:!1}:gl(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(pl,"serializeBody");async function Ti(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ti,"parseResponseBody");async function dl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Si(n);continue}return i}catch(i){if(r=i,n<t){await Si(n);continue}throw i}throw r}o(dl,"sendWithRetries");function Si(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Si,"backoff");function ml(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(ml,"normalizeHeaders");function fl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(fl,"toHttpHeaders");function gl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(gl,"isNodeFormData");function hl(e){return e==null}o(hl,"isNil");var Te=new Vt;var Be=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.DELETE="DELETE",p.HEAD="HEAD",p))(Be||{});var nd=he(require("fs")),As=he(Qt());var od={"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 id(e){let t=e.split(";")[0].trim().toLowerCase();return od[t]??""}o(id,"contentTypeToExtension");var ad=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),sd=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 zs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:p,extraProps:m,authLocation:g="headers"}){return Ce({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:v})=>({url:s.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${sd(t,v)}/resource or /resource`,required:!0,defaultValue:v?t(v):"",...p?.url??{}})}),"props")}),method:s.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Be).map(v=>({label:v,value:v}))},...p?.method??{}}),headers:s.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...p?.headers??{}}),queryParams:s.Object({displayName:"Query Parameters",required:!0,...p?.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:v})=>{if(!v)return{};let b=v,T={};switch(b){case"none":break;case"json":T.data=s.Json({displayName:"JSON Body",required:!0,...p?.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,...p?.failsafe??{}}),timeout:s.Number({displayName:"Timeout (in seconds)",required:!1,...p?.timeout??{}}),followRedirects:s.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...m},run:o(async v=>{let{method:b,url:T,headers:h,queryParams:c,body:d,body_type:y,failsafe:f,timeout:x,response_is_binary:P,followRedirects:L}=v.propsValue;Ct(b,"Method"),Ct(T,"URL");let Q=fe(r)?{}:await r(v.auth,v.propsValue),ne=T.url,Ge=ne.startsWith("http://")||ne.startsWith("https://")?ne:ad({baseUrl:t(v.auth),relativePath:ne}),Ie={method:b,url:Ge,headers:{...h??{},...g==="headers"||!fe(g)?Q:{}},queryParams:{...g==="queryParams"?Q:{},...c??{}},timeout:x?x*1e3:0,followRedirects:L};if(P&&(Ie.responseType="arraybuffer"),d)if(y&&y!=="none"){let ce=d.data;if(y==="form_data"){let Cs=ce,_t=new As.default;for(let{fieldName:un,fieldType:ln,textFieldValue:pn,fileFieldValue:rr}of Cs)ln==="text"&&!mt(pn)?_t.append(un,pn):ln==="file"&&!mt(rr)&&_t.append(un,rr.data,{filename:rr?.filename});Ie.body=_t,Ie.headers={...Ie.headers,..._t.getHeaders()}}else Ie.body=ce}else y||(Ie.body=d);try{let ce=await Te.sendRequest(Ie);return await cd(v.files,ce.body,ce.status,ce.headers,P)}catch(ce){if(f)return ce.errorMessage();throw ce}},"run")})}o(zs,"createCustomApiCallAction");var cd=o(async(e,t,r,n,i)=>{let u;if(i&&ud(t)){let p=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],m=id(p??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${m}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),ud=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var ke=Ur.BasicAuth({displayName:"Pdfcrowd Credentials",description:"Your Pdfcrowd API credentials. Get them at https://pdfcrowd.com/user/account/",required:!0,username:{displayName:"Username",description:"Your Pdfcrowd username"},password:{displayName:"API Key",description:"Your Pdfcrowd API key"},validate:o(async({auth:e})=>{try{let t=Buffer.from(`${e.username}:${e.password}`).toString("base64");return(await Te.sendRequest({method:"GET",url:"https://api.pdfcrowd.com/api/info/",headers:{Authorization:`Basic ${t}`}})).status>=400?{valid:!1,error:"Invalid username or API key"}:{valid:!0}}catch(t){return{valid:!1,error:"Connection failed: "+t.message}}},"validate")});var ks="https://api.pdfcrowd.com/api",ld="24.04";function er(e){return`https://api.pdfcrowd.com/convert/${e||ld}/`}o(er,"getConvertUrl");function tr(e){return"Basic "+Buffer.from(`${e.username}:${e.password}`).toString("base64")}o(tr,"getAuthHeader");var Ds=he(Qt()),Os=Ce({name:"url_to_pdf",displayName:"Convert URL to PDF",description:"Convert a web page URL to PDF document",audience:"both",aiMetadata:{description:"Render a publicly accessible web page URL into a PDF file via the Pdfcrowd API, returning the generated document. Choose this when the source is a live URL rather than raw HTML markup (use Convert HTML to PDF for an HTML string). Supports extensive layout, header/footer, watermark, and security options. Not idempotent: each call performs a fresh conversion that produces a new file and consumes account credits.",idempotent:!1},auth:ke,props:{url:s.ShortText({displayName:"URL",description:"The URL of the web page to convert. Must be publicly accessible.",required:!0}),outputFilename:s.ShortText({displayName:"Output Filename",description:"The filename for the generated PDF",required:!1,defaultValue:"document.pdf"}),page_size:s.StaticDropdown({displayName:"Page Size",description:"Set the output page size using standard formats (A4, Letter, A3, etc.). Use A4 for international documents, Letter for US-based content, or larger sizes like A3 for posters and presentations.",required:!1,options:{options:[{label:"A0",value:"A0"},{label:"A1",value:"A1"},{label:"A2",value:"A2"},{label:"A3",value:"A3"},{label:"A4",value:"A4"},{label:"A5",value:"A5"},{label:"A6",value:"A6"},{label:"Letter",value:"Letter"}]},defaultValue:"A4"}),page_width:s.ShortText({displayName:"Page Width",description:"Set custom page dimensions when standard sizes don't fit your needs. Useful for banners, receipts, custom forms, or when matching specific printing equipment. The safe maximum is 200in - larger sizes may fail to open in some PDF viewers. For standard sizes like A4 or Letter, use the predefined page size option instead.",required:!1}),page_height:s.ShortText({displayName:"Page Height",description:'Set custom page height for specific formats like receipts, banners, or legal documents. Set to "-1" for a single-page PDF that expands to fit all content vertically - ideal for web pages, infographics, or documents where page breaks are undesirable. The safe maximum is 200in otherwise some viewers cannot open the PDF. For standard sizes, use the predefined page size option instead.',required:!1}),orientation:s.StaticDropdown({displayName:"Orientation",description:"Set the output page orientation to portrait or landscape. Use landscape for wide content like spreadsheets, charts, or dashboards. Use portrait for standard documents and text-heavy content.",required:!1,options:{options:[{label:"landscape",value:"landscape"},{label:"portrait",value:"portrait"}]},defaultValue:"portrait"}),margin_top:s.ShortText({displayName:"Margin Top",description:"Control white space at the top of the page. Increase for header space, formal documents, or annotation room (e.g., 1in or more). Decrease to maximize content area or fit more content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content starts and where headers appear.",required:!1}),margin_right:s.ShortText({displayName:"Margin Right",description:"Control white space on the right edge of the page. Increase for binding/hole-punch clearance or note-taking space (e.g., 1in or more). Decrease to fit wider content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content wraps and text line length.",required:!1}),margin_bottom:s.ShortText({displayName:"Margin Bottom",description:"Control white space at the bottom of the page. Increase for footer space, page numbers, or formal documents (e.g., 1in or more). Decrease to fit more content per page (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content ends and where footers appear.",required:!1}),margin_left:s.ShortText({displayName:"Margin Left",description:"Control white space on the left edge of the page. Increase for binding/hole-punch clearance or note-taking space (e.g., 1in or more). Decrease to fit wider content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content starts horizontally and text line length.",required:!1}),no_margins:s.Checkbox({displayName:"No Margins",description:"Disable all page margins to use the entire page area. Use this for full-bleed designs where content should extend to the page edges, such as posters, certificates, or branded materials. Combine with custom CSS to ensure your content fills the page properly.",required:!1}),print_page_range:s.ShortText({displayName:"Print Page Range",description:'Set the page range to print when you only need specific pages from the conversion. Use this to extract individual pages (e.g., "2"), specific ranges (e.g., "3-7"), or combinations (e.g., "1,4-6,last"). Ideal for creating excerpts from long documents or excluding cover pages from batch processing.',required:!1}),content_viewport_width:s.StaticDropdown({displayName:"Content Viewport Width",description:"Set the viewport width for formatting the HTML content when generating a PDF. Use this to control how responsive designs render - prevent mobile styles from applying when you want desktop layout, or ensure content appears at the right width. Specify a viewport width to control content rendering, ensuring it mimics the appearance on various devices or matches specific design requirements.",required:!1,options:{options:[{label:"balanced",value:"balanced"},{label:"small",value:"small"},{label:"medium",value:"medium"},{label:"large",value:"large"},{label:"extra-large",value:"extra-large"}]},defaultValue:"medium"}),content_viewport_height:s.StaticDropdown({displayName:"Content Viewport Height",description:"Set the viewport height for formatting the HTML content when generating a PDF. Specify a viewport height to enforce loading of lazy-loaded images and affect vertical positioning of absolutely positioned elements within the content.",required:!1,options:{options:[{label:"auto",value:"auto"},{label:"large",value:"large"}]},defaultValue:"auto"}),content_fit_mode:s.StaticDropdown({displayName:"Content Fit Mode",description:"Specify the mode for fitting the HTML content to the print area by upscaling or downscaling it. Use this to prevent content from being cut off at page edges or to enable smart scaling of oversized content.",required:!1,options:{options:[{label:"auto",value:"auto"},{label:"smart-scaling",value:"smart-scaling"},{label:"no-scaling",value:"no-scaling"},{label:"viewport-width",value:"viewport-width"},{label:"content-width",value:"content-width"},{label:"single-page",value:"single-page"},{label:"single-page-ratio",value:"single-page-ratio"}]},defaultValue:"auto"}),remove_blank_pages:s.StaticDropdown({displayName:"Remove Blank Pages",description:'Specify which blank pages to exclude from the output document to create cleaner PDFs. Use "trailing" to remove empty pages at the end caused by page break issues. Use "all" to remove blank pages throughout the document when converting content with formatting quirks. Helps eliminate unwanted white pages from the final output.',required:!1,options:{options:[{label:"trailing",value:"trailing"},{label:"all",value:"all"},{label:"none",value:"none"}]},defaultValue:"trailing"}),header_url:s.LongText({displayName:"Header URL",description:"Load an HTML code from the specified URL and use it as the page header.",required:!1}),header_html:s.LongText({displayName:"Header HTML",description:"Set the HTML header content with custom styling and dynamic page numbers. Use this to add page numbers, document titles, author names, dates, or company branding to the top of every page. Supports full HTML/CSS for complete design control. Use special CSS classes like pdfcrowd-page-number and pdfcrowd-page-count for dynamic content. Ideal for reports, invoices, and professional documents.",required:!1}),header_height:s.ShortText({displayName:"Header Height",description:"Set the header height to allocate space for header content and prevent overlap with main content. Increase this if your header text is getting cut off or overlapping with page content. Must be large enough to accommodate your header HTML including any multi-line text or images.",required:!1}),footer_url:s.LongText({displayName:"Footer URL",description:"Load an HTML code from the specified URL and use it as the page footer.",required:!1}),footer_html:s.LongText({displayName:"Footer HTML",description:"Set the HTML footer content with custom styling and dynamic page numbers. Use this to add page numbers, copyright notices, document dates, or company information to the bottom of every page. Supports full HTML/CSS for complete design control. Use special CSS classes like pdfcrowd-page-number and pdfcrowd-page-count for dynamic content. Ideal for contracts, reports, and official documents.",required:!1}),footer_height:s.ShortText({displayName:"Footer Height",description:"Set the footer height to allocate space for footer content and prevent overlap with main content. Increase this if your footer text is getting cut off or overlapping with page content. Must be large enough to accommodate your footer HTML including any multi-line text or images.",required:!1}),no_header_footer_horizontal_margins:s.Checkbox({displayName:"No Header Footer Horizontal Margins",description:"Disable horizontal page margins for header and footer. The header/footer contents width will be equal to the physical page width.",required:!1}),exclude_header_on_pages:s.ShortText({displayName:"Exclude Header On Pages",description:"The page header content is not printed on the specified pages. To remove the entire header area, use the conversion config.",required:!1}),exclude_footer_on_pages:s.ShortText({displayName:"Exclude Footer On Pages",description:"The page footer content is not printed on the specified pages. To remove the entire footer area, use the conversion config.",required:!1}),header_footer_scale_factor:s.Number({displayName:"Header Footer Scale Factor",description:"Set the scaling factor (zoom) for the header and footer.",required:!1}),page_numbering_offset:s.Number({displayName:"Page Numbering Offset",description:"Set the numbering offset for page numbers in header/footer HTML to continue page numbering from a previous document. Use this when generating document sections separately - for example, if you have already generated pages 1-10, set offset to 10. The next section will then start numbering at page 11. Essential for multi-part reports or book chapters.",required:!1}),page_watermark_url:s.ShortText({displayName:"Page Watermark URL",description:"Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.",required:!1}),multipage_watermark_url:s.ShortText({displayName:"Multipage Watermark URL",description:"Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.",required:!1}),page_background_url:s.ShortText({displayName:"Page Background URL",description:"Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the background.",required:!1}),multipage_background_url:s.ShortText({displayName:"Multipage Background URL",description:"Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF. A background can be either a PDF or an image.",required:!1}),page_background_color:s.ShortText({displayName:"Page Background Color",description:"Set a solid background color for all pages, filling the entire page area including margins. Useful for creating branded PDFs with corporate colors, highlighting draft documents, or improving readability with off-white backgrounds. Supports transparency with RGBA format - use semi-transparent colors for subtle effects without obscuring content. Format as RGB (FF0000) or RGBA (FF000080) hexadecimal.",required:!1}),use_print_media:s.Checkbox({displayName:"Use Print Media",description:"Use the print version of the page if available via @media print CSS rules. Enable this when converting websites that have print-optimized styles. Many sites hide navigation, ads, and sidebars in print mode. Produces cleaner PDFs by using the design the website creator intended for printing.",required:!1}),no_background:s.Checkbox({displayName:"No Background",description:"Do not print the background graphics to create printer-friendly PDFs. Use this when documents will be physically printed to save ink costs and improve readability. Removes background colors, images, and patterns while preserving text and foreground content. Particularly useful for documents with dark backgrounds or decorative elements.",required:!1}),disable_javascript:s.Checkbox({displayName:"Disable JavaScript",description:"Do not execute JavaScript during conversion. Use this to improve conversion speed when JavaScript is not needed, prevent dynamic content changes, or avoid security risks from untrusted scripts. Note that disabling JavaScript means lazy-loaded images and AJAX content will not load.",required:!1}),disable_image_loading:s.Checkbox({displayName:"Disable Image Loading",description:"Do not load images during conversion to create text-only PDFs. Use this to significantly speed up conversion, reduce file size, or create accessible text-focused documents. Ideal for converting documentation where images are not needed, reducing bandwidth usage, or creating lightweight PDFs for email distribution.",required:!1}),disable_remote_fonts:s.Checkbox({displayName:"Disable Remote Fonts",description:"Disable loading fonts from remote sources. Use this to speed up conversion by avoiding font download delays, ensure consistent rendering with system fonts, or work around font loading failures. Note that text will fall back to system fonts, which may change the document's appearance.",required:!1}),load_iframes:s.StaticDropdown({displayName:"Load Iframes",description:'Specifies how iframes are handled during conversion. Use "all" to include all embedded content (videos, maps, widgets). Use "same-origin" to include only content from the same domain for security purposes. Use "none" to exclude all iframes for faster conversion and to avoid third-party content issues. Disabling iframes can significantly improve performance and reliability.',required:!1,options:{options:[{label:"all",value:"all"},{label:"same-origin",value:"same-origin"},{label:"none",value:"none"}]},defaultValue:"all"}),block_ads:s.Checkbox({displayName:"Block Ads",description:"Automatically block common advertising networks and tracking scripts during conversion, producing cleaner PDFs with faster conversion times. Filters out third-party ad content, analytics beacons, and ad network resources. Ideal for converting news sites, blogs, or any ad-heavy content where ads distract from the main message. May occasionally block legitimate third-party content - disable if critical third-party resources are missing.",required:!1}),default_encoding:s.ShortText({displayName:"Default Encoding",description:'Specify the character encoding when the HTML lacks proper charset declaration or has incorrect encoding. Prevents garbled text for non-English content, especially legacy pages without UTF-8 encoding. Set to "utf-8" for modern content, "iso-8859-1" for Western European legacy pages, or other encodings for specific regional content. Only needed when auto-detection fails and you see corrupted characters in the output.',required:!1}),locale:s.ShortText({displayName:"Locale",description:'Set the locale for the conversion to control regional formatting of dates, times, and numbers. Use this when converting content for specific regions - for example, set to "en-US" for MM/DD/YYYY dates and comma thousand separators, or "de-DE" for DD.MM.YYYY dates and period thousand separators. Essential for financial reports, invoices, or localized content.',required:!1}),http_auth_user_name:s.ShortText({displayName:"HTTP Auth User Name",description:"Set the HTTP authentication user name. Required to access protected web pages or staging environments.",required:!1}),http_auth_password:s.ShortText({displayName:"HTTP Auth Password",description:"Set the HTTP authentication password. Required to access protected web pages or staging environments.",required:!1}),cookies:s.ShortText({displayName:"Cookies",description:"Set HTTP cookies to be included in all requests made by the converter to access authenticated or session-based content. Use this when converting pages that require login, maintain user sessions, or personalize content based on cookies. Essential for converting member-only areas, dashboards, or any content behind cookie-based authentication. Format as semicolon-separated name=value pairs.",required:!1}),verify_ssl_certificates:s.Checkbox({displayName:"Verify SSL Certificates",description:"Enforce SSL certificate validation for secure connections, preventing conversions from sites with invalid certificates. Enable when converting from production sites with valid certificates to ensure security. When disabled, allows conversion from any HTTPS site regardless of certificate validity - including development servers with self-signed certificates, internal corporate sites with expired certificates, or local testing environments.",required:!1}),fail_on_main_url_error:s.Checkbox({displayName:"Fail On Main URL Error",description:"Abort the conversion if the HTTP status code of the main URL is greater than or equal to 400 (client/server errors). Use this in automated workflows to catch broken URLs or authentication failures early rather than producing invalid PDFs. Ensures your system does not silently generate error page PDFs when source content is unavailable.",required:!1}),fail_on_any_url_error:s.Checkbox({displayName:"Fail On Any URL Error",description:"Abort the conversion if any sub-request (images, stylesheets, scripts) fails with HTTP 400+ errors. Use this for strict quality control when all assets must load successfully.",required:!1}),css_page_rule_mode:s.StaticDropdown({displayName:"CSS Page Rule Mode",description:'Specifies behavior in the presence of CSS @page rules to control which settings take precedence. Use "default" to prioritize API settings over CSS rules, ensuring consistent output regardless of input HTML. Use "mode2" to respect CSS @page rules for print-optimized HTML. This solves conflicts when CSS tries to override your API page setup.',required:!1,options:{options:[{label:"default",value:"default"},{label:"mode1",value:"mode1"},{label:"mode2",value:"mode2"}]},defaultValue:"default"}),custom_css:s.LongText({displayName:"Custom CSS",description:"Apply custom CSS to the input HTML document to modify the visual appearance and layout of your content dynamically. Use this to override default styles, adjust spacing, change fonts, or fix layout issues without modifying the source HTML. Use !important in your CSS rules to prioritize and override conflicting styles.",required:!1}),custom_javascript:s.LongText({displayName:"Custom JavaScript",description:"Run a custom JavaScript after the document is loaded and ready to print. Use this to modify page content before conversion, remove unwanted elements, or trigger specific page states. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.",required:!1}),on_load_javascript:s.ShortText({displayName:"On Load JavaScript",description:"Run a custom JavaScript right after the document is loaded. The script is intended for early DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.",required:!1}),custom_http_header:s.ShortText({displayName:"Custom HTTP Header",description:"Set a custom HTTP header to be included in all requests made by the converter. Use this to pass authentication tokens to protected sites, add tracking headers for analytics, or provide API keys for accessing private content. Essential when converting content from APIs or internal systems that require special headers for access control.",required:!1}),javascript_delay:s.Number({displayName:"JavaScript Delay",description:'Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. Use this to ensure lazy-loaded images, AJAX content, or animations complete before conversion. Your license defines the maximum wait time by "Max Delay" parameter.',required:!1}),element_to_convert:s.ShortText({displayName:"Element To Convert",description:"Convert only the specified element from the main document and its children. Use this to extract specific portions of a page (like article content) while excluding navigation, headers, footers, or sidebars. The element is specified by one or more CSS selectors. If the element is not found, the conversion fails. If multiple elements are found, the first one is used.",required:!1}),element_to_convert_mode:s.StaticDropdown({displayName:"Element To Convert Mode",description:'Control how CSS styles are applied when converting only part of a page. The "cut-out" option extracts the element into a new document root, which may break CSS selectors like "body > div". The "remove-siblings" option keeps the element in its original DOM position but deletes other elements, preserving descendant selectors. The "hide-siblings" option keeps all elements but hides non-selected ones with display:none, preserving all CSS context.',required:!1,options:{options:[{label:"cut-out",value:"cut-out"},{label:"remove-siblings",value:"remove-siblings"},{label:"hide-siblings",value:"hide-siblings"}]},defaultValue:"cut-out"}),wait_for_element:s.ShortText({displayName:"Wait For Element",description:'Wait for the specified element in a source document. Use this when specific dynamic content must be ready before conversion, avoiding unnecessary delays from a fixed JavaScript delay. The element is specified by one or more CSS selectors. The element is searched for in the main document and all iframes. If the element is not found, the conversion fails. Your license defines the maximum wait time by the "Max Delay" parameter.',required:!1}),auto_detect_element_to_convert:s.Checkbox({displayName:"Auto Detect Element To Convert",description:"The main HTML element for conversion is detected automatically. Use this when you want to extract article or main content without knowing the exact CSS selector, automatically excluding navigation and sidebars.",required:!1}),readability_enhancements:s.StaticDropdown({displayName:"Readability Enhancements",description:'Automatically enhance the input HTML to improve readability by removing clutter and reformatting content. Use this when converting web pages with excessive navigation, ads, or sidebars that distract from the main content. Different versions (v1-v4) use progressively aggressive algorithms - start with "v1" and increase if more cleanup is needed. Ideal for converting blog posts, articles, or documentation into clean PDFs.',required:!1,options:{options:[{label:"none",value:"none"},{label:"readability-v1",value:"readability-v1"},{label:"readability-v2",value:"readability-v2"},{label:"readability-v3",value:"readability-v3"},{label:"readability-v4",value:"readability-v4"}]},defaultValue:"none"}),scale_factor:s.Number({displayName:"Scale Factor",description:"Set the scaling factor (zoom) for the main page area to fit content better. Use values below 100% to shrink oversized content that is getting cut off at page edges. Use values above 100% to enlarge small content for better readability. Common use cases include shrinking wide tables to fit (70-80%), or enlarging mobile-optimized layouts for desktop PDFs (120-150%).",required:!1}),jpeg_quality:s.Number({displayName:"JPEG Quality",description:"Set the quality of embedded JPEG images to balance file size and visual quality. Use 100% for archival documents or when image quality is critical. Use 70-85% for web distribution to significantly reduce file size with minimal visible quality loss. Use lower values (50-60%) only when file size is more important than image clarity. Common artifacts below 60% include blockiness and color banding.",required:!1}),convert_images_to_jpeg:s.StaticDropdown({displayName:"Convert Images To JPEG",description:'Specify which image types will be converted to JPEG to reduce PDF file size. Use "opaque" to convert only non-transparent images (safe for most documents). Use "all" to convert everything including transparent images (transparent areas become white). Use "none" to preserve original image formats. Ideal for reducing file size when distributing large image-heavy PDFs via email or web.',required:!1,options:{options:[{label:"none",value:"none"},{label:"opaque",value:"opaque"},{label:"all",value:"all"}]},defaultValue:"none"}),image_dpi:s.Number({displayName:"Image DPI",description:"Set the DPI of images in PDF to control resolution and file size. Use 300 DPI for professional printing, 150 DPI for everyday documents, 96 DPI for screen-only viewing, or 72 DPI for web distribution. Lower DPI creates smaller files but reduces image quality. Use 0 to preserve original image resolution. Note that this only downscales - it will not upscale low-resolution images.",required:!1}),enable_pdf_forms:s.Checkbox({displayName:"Enable PDF Forms",description:"Convert HTML forms to fillable PDF forms that users can complete in PDF readers. Use this to create interactive PDFs from HTML forms. Ideal for creating fillable applications, surveys, or order forms that work offline. Details can be found in the blog post.",required:!1}),linearize:s.Checkbox({displayName:"Linearize",description:"Create linearized PDF. This is also known as Fast Web View. Use this to optimize PDFs for progressive download, allowing users to start viewing the first page while the rest downloads.",required:!1}),encrypt:s.Checkbox({displayName:"Encrypt",description:"Encrypt the PDF to prevent search engines from indexing the contents and add an extra layer of security. Use this for confidential documents, internal reports, or any content you do not want appearing in search results. Combine with a password to require authentication for viewing, or just use encryption alone to prevent indexing while keeping the PDF publicly readable.",required:!1}),user_password:s.ShortText({displayName:"User Password",description:"Protect the PDF with a user password to restrict who can open and view the document. Recipients must enter this password to view the PDF. Use this for confidential documents, sensitive data, or content distribution where you want to control access. Combine with permission flags to restrict what users can do after opening.",required:!1}),owner_password:s.ShortText({displayName:"Owner Password",description:"Protect the PDF with an owner password for administrative control. This password allows changing permissions, passwords, and document restrictions - like a master key. Use different user and owner passwords to give recipients restricted access while retaining full control. The owner password should be kept confidential and different from the user password.",required:!1}),no_print:s.Checkbox({displayName:"No Print",description:"Disallow printing of the output PDF to protect sensitive content. Use this for confidential documents, copyrighted materials, or preview versions you want to restrict.",required:!1}),no_modify:s.Checkbox({displayName:"No Modify",description:"Disallow modification of the output PDF to maintain document integrity. Use this for official documents, contracts, or records that should not be altered after creation. Prevents recipients from editing content, adding annotations, or extracting pages.",required:!1}),no_copy:s.Checkbox({displayName:"No Copy",description:"Disallow text and graphics extraction from the output PDF to protect copyrighted content. Use this for ebooks, proprietary documents, or materials where you want to prevent easy copying and redistribution.",required:!1}),title:s.ShortText({displayName:"Title",description:"Set the title of the PDF that appears in PDF reader title bars and document properties. Use descriptive titles for better organization and searchability in document management systems. This metadata helps users identify documents when multiple PDFs are open and improves accessibility for screen readers.",required:!1}),subject:s.ShortText({displayName:"Subject",description:"Set the subject of the PDF to categorize or summarize the document content. Use this to add searchable metadata for document management systems, improve organization in large PDF libraries, or provide context about the document's purpose. Appears in PDF properties dialog.",required:!1}),author:s.ShortText({displayName:"Author",description:"Set the author of the PDF for attribution and document tracking. Use this to identify who created the document, important for official documents, reports, or publications. This metadata appears in PDF properties and helps with document management and version control.",required:!1}),keywords:s.ShortText({displayName:"Keywords",description:"Associate keywords with the document to improve searchability in document management systems. Use relevant terms that describe the content, making it easier to find documents later. Separate multiple keywords with commas. Particularly useful for large document repositories or DAM systems.",required:!1}),extract_meta_tags:s.Checkbox({displayName:"Extract Meta Tags",description:"Extract meta tags (author, keywords and description) from the input HTML and automatically populate PDF metadata. Use this when converting web pages that already have proper HTML meta tags, saving you from manually setting title, author, and keywords. Ideal for automated conversion workflows where source HTML is well-structured.",required:!1}),page_layout:s.StaticDropdown({displayName:"Page Layout",description:'Control how pages appear when the PDF opens in viewers that respect these preferences. "single-page" for focused reading one page at a time. "one-column" for continuous scrolling like a web page. "two-column-left" for book-like layouts with odd pages on left (international standard). "two-column-right" for magazines with odd pages on right.',required:!1,options:{options:[{label:"single-page",value:"single-page"},{label:"one-column",value:"one-column"},{label:"two-column-left",value:"two-column-left"},{label:"two-column-right",value:"two-column-right"}]}}),page_mode:s.StaticDropdown({displayName:"Page Mode",description:'Control the initial display mode when the PDF opens. "full-screen" for presentations and kiosk displays where you want an immersive experience. "thumbnails" for long documents where visual page navigation is helpful. "outlines" for structured documents with bookmarks/table of contents.',required:!1,options:{options:[{label:"full-screen",value:"full-screen"},{label:"thumbnails",value:"thumbnails"},{label:"outlines",value:"outlines"}]}}),initial_zoom_type:s.StaticDropdown({displayName:"Initial Zoom Type",description:"Control how the PDF is initially zoomed when opened.",required:!1,options:{options:[{label:"fit-width",value:"fit-width"},{label:"fit-height",value:"fit-height"},{label:"fit-page",value:"fit-page"}]}}),initial_page:s.Number({displayName:"Initial Page",description:"Display the specified page when the document is opened.",required:!1}),initial_zoom:s.Number({displayName:"Initial Zoom",description:"Specify the initial page zoom in percents when the document is opened.",required:!1}),hide_toolbar:s.Checkbox({displayName:"Hide Toolbar",description:"Hide the viewer's toolbar when the PDF is opened to provide a cleaner, more focused reading experience. Use this for presentations, kiosk displays, or immersive reading where you want minimal UI distractions.",required:!1}),hide_menubar:s.Checkbox({displayName:"Hide Menubar",description:"Hide the viewer's menu bar when the PDF is opened for a cleaner interface. Use this for kiosk mode, presentations, or embedded PDFs where you want to minimize UI elements.",required:!1}),hide_window_ui:s.Checkbox({displayName:"Hide Window UI",description:"Hide user interface elements like scroll bars and navigation controls when the PDF opens. Use this for presentation mode, digital signage, or embedded PDFs where you want the most minimal interface possible. Combines with other UI hiding options for full-screen immersive viewing.",required:!1}),fit_window:s.Checkbox({displayName:"Fit Window",description:"Resize the PDF viewer window to fit the size of the first displayed page when opened. Use this to ensure the PDF opens at an appropriate size rather than filling the entire screen. Particularly useful for small documents, forms, or certificates that look better at actual size.",required:!1}),center_window:s.Checkbox({displayName:"Center Window",description:"Position the PDF viewer window in the center of the screen when opened. Use this with window resizing to create a professional, centered display for forms, certificates, or small documents. Improves the initial viewing experience by avoiding corner-positioned windows.",required:!1}),display_title:s.Checkbox({displayName:"Display Title",description:"Display the title of the HTML document in the PDF viewer's title bar instead of the filename. Use this to show more descriptive titles when PDFs are opened - particularly useful when the filename is cryptic or auto-generated. Improves user experience by showing meaningful document names.",required:!1}),right_to_left:s.Checkbox({displayName:"Right To Left",description:"Set the predominant reading order for text to right-to-left. This option has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up.",required:!1}),data_string:s.LongText({displayName:"Data String",description:"Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.",required:!1}),data_format:s.StaticDropdown({displayName:"Data Format",description:'Specify the input data format. Use "auto" for automatic detection or explicitly set to JSON, XML, YAML, or CSV when format is known.',required:!1,options:{options:[{label:"auto",value:"auto"},{label:"json",value:"json"},{label:"xml",value:"xml"},{label:"yaml",value:"yaml"},{label:"csv",value:"csv"}]},defaultValue:"auto"}),data_ignore_undefined:s.Checkbox({displayName:"Data Ignore Undefined",description:"Ignore undefined variables in the HTML template. The default mode is strict so any undefined variable causes the conversion to fail. You can use {% if variable is defined %} to check if the variable is defined.",required:!1}),data_auto_escape:s.Checkbox({displayName:"Data Auto Escape",description:"Auto escape HTML symbols in the input data before placing them into the output.",required:!1}),data_trim_blocks:s.Checkbox({displayName:"Data Trim Blocks",description:"Auto trim whitespace around each template command block.",required:!1}),data_options:s.LongText({displayName:"Data Options",description:"Set the advanced data options as comma separated key=value pairs: csv_delimiter - The CSV data delimiter, the default is ,. xml_remove_root - Remove the root XML element from the input data. data_root - The name of the root element inserted into the input data without a root node (e.g. CSV), the default is data.",required:!1}),debug_log:s.Checkbox({displayName:"Debug Log",description:"Turn on debug logging to troubleshoot conversion issues. Details about the conversion process, including resource loading, rendering steps, and error messages are stored in the debug log. Use this when conversions fail or produce unexpected results.",required:!1}),tag:s.ShortText({displayName:"Tag",description:"Tag the conversion with a custom value for tracking and analytics. Use this to categorize conversions by customer ID, document type, or business unit. The tag appears in conversion statistics. A value longer than 32 characters is cut off.",required:!1}),http_proxy:s.ShortText({displayName:"HTTP Proxy",description:"A proxy server used by the conversion process for accessing the source URLs with HTTP scheme. This can help circumvent regional restrictions or provide limited access to your intranet.",required:!1}),https_proxy:s.ShortText({displayName:"HTTPS Proxy",description:"A proxy server used by the conversion process for accessing the source URLs with HTTPS scheme. This can help circumvent regional restrictions or provide limited access to your intranet.",required:!1}),layout_dpi:s.Number({displayName:"Layout DPI",description:"Set the internal DPI resolution used for positioning of PDF contents. It can help in situations where there are small inaccuracies in the PDF. It is recommended to use values that are a multiple of 72, such as 288 or 360.",required:!1}),main_document_css_annotation:s.Checkbox({displayName:"Main Document CSS Annotation",description:"Add special CSS classes to the main document's body element. This allows applying custom styling based on these classes: pdfcrowd-page-X - where X is the current page number pdfcrowd-page-odd - odd page pdfcrowd-page-even - even page",required:!1}),header_footer_css_annotation:s.Checkbox({displayName:"Header Footer CSS Annotation",description:"Add special CSS classes to the header/footer's body element. This allows applying custom styling based on these classes: pdfcrowd-page-X - where X is the current page number pdfcrowd-page-count-X - where X is the total page count pdfcrowd-page-first - the first page pdfcrowd-page-last - the last page pdfcrowd-page-odd - odd page pdfcrowd-page-even - even page",required:!1}),conversion_config:s.LongText({displayName:"Conversion Config",description:`Configure conversion via JSON. The configuration defines various page settings for individual PDF pages or ranges of pages. It provides flexibility in designing each page of the PDF, giving control over each page's size, header, footer, etc. If a page or parameter is not explicitly specified, the system will use the default settings for that page or attribute. If a JSON configuration is provided, the settings in the JSON will take precedence over the global options. The structure of the JSON must be: pageSetup: An array of objects where each object defines the configuration for a specific page or range of pages. The following properties can be set for each page object: pages: A comma-separated list of page numbers or ranges. Special strings may be used, such as odd, even, and last. For example: 1-: from page 1 to the end of the document 2: only the 2nd page 2,4,6: pages 2, 4, and 6 2-5: pages 2 through 5 odd,2: the 2nd page and all odd pages pageSize: The page size (optional). Possible values: A0, A1, A2, A3, A4, A5, A6, Letter. pageWidth: The width of the page (optional). pageHeight: The height of the page (optional). marginLeft: Left margin (optional). marginRight: Right margin (optional). marginTop: Top margin (optional). marginBottom: Bottom margin (optional). displayHeader: Header appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) displayFooter: Footer appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) headerHeight: Height of the header (optional). footerHeight: Height of the footer (optional). orientation: Page orientation, such as "portrait" or "landscape" (optional). backgroundColor: Page background color in RRGGBB or RRGGBBAA hexadecimal format (optional). Dimensions may be empty, 0 or specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".`,required:!1}),converter_version:s.StaticDropdown({displayName:"Converter Version",description:"Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.",required:!1,options:{options:[{label:"24.04",value:"24.04"},{label:"20.10",value:"20.10"},{label:"18.10",value:"18.10"}]},defaultValue:"24.04"}),page_watermark:s.File({displayName:"Page Watermark",description:'Apply the first page of a watermark PDF to every page of the output PDF. Use this to add transparent overlays like "DRAFT" stamps, security markings, or branding elements that appear on top of content. Ideal for confidential document marking or adding protective overlays.',required:!1}),multipage_watermark:s.File({displayName:"Multipage Watermark",description:"Apply each page of a watermark PDF to the corresponding page of the output PDF. Use this for page-specific watermarks where different pages need different overlays - for example, different approval stamps per department. If the watermark has fewer pages than the output, the last watermark page is repeated for remaining pages.",required:!1}),page_background:s.File({displayName:"Page Background",description:"Apply the first page of a background PDF to every page of the output PDF. Use this to add letterheads, branded templates, or decorative backgrounds that appear behind your content. Backgrounds appear beneath content, while watermarks layer on top. Perfect for adding company letterheads to reports or applying branded templates to dynamically generated content.",required:!1}),multipage_background:s.File({displayName:"Multipage Background",description:"Apply each page of a background PDF to the corresponding page of the output PDF. Use this for page-specific backgrounds where each page needs a different template - for example, different letterheads for front and back pages. If the background has fewer pages than the output, the last background page is repeated for remaining pages.",required:!1})},async run(e){let{auth:t,propsValue:r}=e,n=new Ds.default;n.append("url",r.url);let i=["page_size","page_width","page_height","orientation","margin_top","margin_right","margin_bottom","margin_left","no_margins","print_page_range","content_viewport_width","content_viewport_height","content_fit_mode","remove_blank_pages","header_url","header_html","header_height","footer_url","footer_html","footer_height","no_header_footer_horizontal_margins","exclude_header_on_pages","exclude_footer_on_pages","header_footer_scale_factor","page_numbering_offset","page_watermark_url","multipage_watermark_url","page_background_url","multipage_background_url","page_background_color","use_print_media","no_background","disable_javascript","disable_image_loading","disable_remote_fonts","load_iframes","block_ads","default_encoding","locale","http_auth_user_name","http_auth_password","cookies","verify_ssl_certificates","fail_on_main_url_error","fail_on_any_url_error","css_page_rule_mode","custom_css","custom_javascript","on_load_javascript","custom_http_header","javascript_delay","element_to_convert","element_to_convert_mode","wait_for_element","auto_detect_element_to_convert","readability_enhancements","scale_factor","jpeg_quality","convert_images_to_jpeg","image_dpi","enable_pdf_forms","linearize","encrypt","user_password","owner_password","no_print","no_modify","no_copy","title","subject","author","keywords","extract_meta_tags","page_layout","page_mode","initial_zoom_type","initial_page","initial_zoom","hide_toolbar","hide_menubar","hide_window_ui","fit_window","center_window","display_title","right_to_left","debug_log","tag","http_proxy","https_proxy","layout_dpi","main_document_css_annotation","header_footer_css_annotation","conversion_config"];for(let h of i){let c=r[h];c!=null&&c!==""&&c!==!1&&n.append(h,String(c))}if(r.data_string){n.append("data_string",String(r.data_string));let h=["data_format","data_ignore_undefined","data_auto_escape","data_trim_blocks","data_options"];for(let c of h){let d=r[c];d!=null&&d!==""&&d!==!1&&n.append(c,String(d))}}let u=["page_watermark","multipage_watermark","page_background","multipage_background"];for(let h of u){let c=r[h];c?.data&&n.append(h,c.data,{filename:c.filename||`${h}.pdf`})}let p=n.getBuffer(),m=r.converter_version||"24.04",g=await Te.sendRequest({method:"POST",url:er(m),headers:{Authorization:tr(t),"User-Agent":"pdfcrowd-activepieces/1.1.0",...n.getHeaders()},body:p,responseType:"arraybuffer"});if(g.status>=400){let h=Buffer.from(g.body).toString("utf-8");throw new Error(`Conversion failed (${g.status}): ${h}`)}let v=r.outputFilename||"document.pdf",b=await e.files.write({fileName:v,data:Buffer.from(g.body)}),T=g.headers||{};return{file:b,filename:v,jobId:T["x-pdfcrowd-job-id"]||"",pageCount:T["x-pdfcrowd-pages"]||"0",outputSize:T["x-pdfcrowd-output-size"]||"0",consumedCredits:T["x-pdfcrowd-consumed-credits"]||"0",remainingCredits:T["x-pdfcrowd-remaining-credits"]||"0"}}});var Ns=he(Qt()),Rs=Ce({name:"html_to_pdf",displayName:"Convert HTML to PDF",description:"Convert HTML content (string) to PDF document",audience:"both",aiMetadata:{description:"Render a raw HTML string into a PDF file via the Pdfcrowd API, returning the generated document. Choose this when you already have HTML markup (e.g. a generated invoice or report) rather than a live page URL (use Convert URL to PDF for a URL). Supports extensive layout, header/footer, watermark, and security options, plus template data injection. Not idempotent: each call performs a fresh conversion that produces a new file and consumes account credits.",idempotent:!1},auth:ke,props:{htmlContent:s.LongText({displayName:"HTML Content",description:"The HTML content to convert to PDF",required:!0}),outputFilename:s.ShortText({displayName:"Output Filename",description:"The filename for the generated PDF",required:!1,defaultValue:"document.pdf"}),page_size:s.StaticDropdown({displayName:"Page Size",description:"Set the output page size using standard formats (A4, Letter, A3, etc.). Use A4 for international documents, Letter for US-based content, or larger sizes like A3 for posters and presentations.",required:!1,options:{options:[{label:"A0",value:"A0"},{label:"A1",value:"A1"},{label:"A2",value:"A2"},{label:"A3",value:"A3"},{label:"A4",value:"A4"},{label:"A5",value:"A5"},{label:"A6",value:"A6"},{label:"Letter",value:"Letter"}]},defaultValue:"A4"}),page_width:s.ShortText({displayName:"Page Width",description:"Set custom page dimensions when standard sizes don't fit your needs. Useful for banners, receipts, custom forms, or when matching specific printing equipment. The safe maximum is 200in - larger sizes may fail to open in some PDF viewers. For standard sizes like A4 or Letter, use the predefined page size option instead.",required:!1}),page_height:s.ShortText({displayName:"Page Height",description:'Set custom page height for specific formats like receipts, banners, or legal documents. Set to "-1" for a single-page PDF that expands to fit all content vertically - ideal for web pages, infographics, or documents where page breaks are undesirable. The safe maximum is 200in otherwise some viewers cannot open the PDF. For standard sizes, use the predefined page size option instead.',required:!1}),orientation:s.StaticDropdown({displayName:"Orientation",description:"Set the output page orientation to portrait or landscape. Use landscape for wide content like spreadsheets, charts, or dashboards. Use portrait for standard documents and text-heavy content.",required:!1,options:{options:[{label:"landscape",value:"landscape"},{label:"portrait",value:"portrait"}]},defaultValue:"portrait"}),margin_top:s.ShortText({displayName:"Margin Top",description:"Control white space at the top of the page. Increase for header space, formal documents, or annotation room (e.g., 1in or more). Decrease to maximize content area or fit more content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content starts and where headers appear.",required:!1}),margin_right:s.ShortText({displayName:"Margin Right",description:"Control white space on the right edge of the page. Increase for binding/hole-punch clearance or note-taking space (e.g., 1in or more). Decrease to fit wider content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content wraps and text line length.",required:!1}),margin_bottom:s.ShortText({displayName:"Margin Bottom",description:"Control white space at the bottom of the page. Increase for footer space, page numbers, or formal documents (e.g., 1in or more). Decrease to fit more content per page (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content ends and where footers appear.",required:!1}),margin_left:s.ShortText({displayName:"Margin Left",description:"Control white space on the left edge of the page. Increase for binding/hole-punch clearance or note-taking space (e.g., 1in or more). Decrease to fit wider content (e.g., 5mm to 10mm). Default 0.4in balances readability with space efficiency. Set to 0 for full-bleed designs. Affects where content starts horizontally and text line length.",required:!1}),no_margins:s.Checkbox({displayName:"No Margins",description:"Disable all page margins to use the entire page area. Use this for full-bleed designs where content should extend to the page edges, such as posters, certificates, or branded materials. Combine with custom CSS to ensure your content fills the page properly.",required:!1}),print_page_range:s.ShortText({displayName:"Print Page Range",description:'Set the page range to print when you only need specific pages from the conversion. Use this to extract individual pages (e.g., "2"), specific ranges (e.g., "3-7"), or combinations (e.g., "1,4-6,last"). Ideal for creating excerpts from long documents or excluding cover pages from batch processing.',required:!1}),content_viewport_width:s.StaticDropdown({displayName:"Content Viewport Width",description:"Set the viewport width for formatting the HTML content when generating a PDF. Use this to control how responsive designs render - prevent mobile styles from applying when you want desktop layout, or ensure content appears at the right width. Specify a viewport width to control content rendering, ensuring it mimics the appearance on various devices or matches specific design requirements.",required:!1,options:{options:[{label:"balanced",value:"balanced"},{label:"small",value:"small"},{label:"medium",value:"medium"},{label:"large",value:"large"},{label:"extra-large",value:"extra-large"}]},defaultValue:"medium"}),content_viewport_height:s.StaticDropdown({displayName:"Content Viewport Height",description:"Set the viewport height for formatting the HTML content when generating a PDF. Specify a viewport height to enforce loading of lazy-loaded images and affect vertical positioning of absolutely positioned elements within the content.",required:!1,options:{options:[{label:"auto",value:"auto"},{label:"large",value:"large"}]},defaultValue:"auto"}),content_fit_mode:s.StaticDropdown({displayName:"Content Fit Mode",description:"Specify the mode for fitting the HTML content to the print area by upscaling or downscaling it. Use this to prevent content from being cut off at page edges or to enable smart scaling of oversized content.",required:!1,options:{options:[{label:"auto",value:"auto"},{label:"smart-scaling",value:"smart-scaling"},{label:"no-scaling",value:"no-scaling"},{label:"viewport-width",value:"viewport-width"},{label:"content-width",value:"content-width"},{label:"single-page",value:"single-page"},{label:"single-page-ratio",value:"single-page-ratio"}]},defaultValue:"auto"}),remove_blank_pages:s.StaticDropdown({displayName:"Remove Blank Pages",description:'Specify which blank pages to exclude from the output document to create cleaner PDFs. Use "trailing" to remove empty pages at the end caused by page break issues. Use "all" to remove blank pages throughout the document when converting content with formatting quirks. Helps eliminate unwanted white pages from the final output.',required:!1,options:{options:[{label:"trailing",value:"trailing"},{label:"all",value:"all"},{label:"none",value:"none"}]},defaultValue:"trailing"}),header_url:s.LongText({displayName:"Header URL",description:"Load an HTML code from the specified URL and use it as the page header.",required:!1}),header_html:s.LongText({displayName:"Header HTML",description:"Set the HTML header content with custom styling and dynamic page numbers. Use this to add page numbers, document titles, author names, dates, or company branding to the top of every page. Supports full HTML/CSS for complete design control. Use special CSS classes like pdfcrowd-page-number and pdfcrowd-page-count for dynamic content. Ideal for reports, invoices, and professional documents.",required:!1}),header_height:s.ShortText({displayName:"Header Height",description:"Set the header height to allocate space for header content and prevent overlap with main content. Increase this if your header text is getting cut off or overlapping with page content. Must be large enough to accommodate your header HTML including any multi-line text or images.",required:!1}),footer_url:s.LongText({displayName:"Footer URL",description:"Load an HTML code from the specified URL and use it as the page footer.",required:!1}),footer_html:s.LongText({displayName:"Footer HTML",description:"Set the HTML footer content with custom styling and dynamic page numbers. Use this to add page numbers, copyright notices, document dates, or company information to the bottom of every page. Supports full HTML/CSS for complete design control. Use special CSS classes like pdfcrowd-page-number and pdfcrowd-page-count for dynamic content. Ideal for contracts, reports, and official documents.",required:!1}),footer_height:s.ShortText({displayName:"Footer Height",description:"Set the footer height to allocate space for footer content and prevent overlap with main content. Increase this if your footer text is getting cut off or overlapping with page content. Must be large enough to accommodate your footer HTML including any multi-line text or images.",required:!1}),no_header_footer_horizontal_margins:s.Checkbox({displayName:"No Header Footer Horizontal Margins",description:"Disable horizontal page margins for header and footer. The header/footer contents width will be equal to the physical page width.",required:!1}),exclude_header_on_pages:s.ShortText({displayName:"Exclude Header On Pages",description:"The page header content is not printed on the specified pages. To remove the entire header area, use the conversion config.",required:!1}),exclude_footer_on_pages:s.ShortText({displayName:"Exclude Footer On Pages",description:"The page footer content is not printed on the specified pages. To remove the entire footer area, use the conversion config.",required:!1}),header_footer_scale_factor:s.Number({displayName:"Header Footer Scale Factor",description:"Set the scaling factor (zoom) for the header and footer.",required:!1}),page_numbering_offset:s.Number({displayName:"Page Numbering Offset",description:"Set the numbering offset for page numbers in header/footer HTML to continue page numbering from a previous document. Use this when generating document sections separately - for example, if you have already generated pages 1-10, set offset to 10. The next section will then start numbering at page 11. Essential for multi-part reports or book chapters.",required:!1}),page_watermark_url:s.ShortText({displayName:"Page Watermark URL",description:"Load a file from the specified URL and apply the file as a watermark to each page of the output PDF. A watermark can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the watermark.",required:!1}),multipage_watermark_url:s.ShortText({displayName:"Multipage Watermark URL",description:"Load a file from the specified URL and apply each page of the file as a watermark to the corresponding page of the output PDF. A watermark can be either a PDF or an image.",required:!1}),page_background_url:s.ShortText({displayName:"Page Background URL",description:"Load a file from the specified URL and apply the file as a background to each page of the output PDF. A background can be either a PDF or an image. If a multi-page file (PDF or TIFF) is used, the first page is used as the background.",required:!1}),multipage_background_url:s.ShortText({displayName:"Multipage Background URL",description:"Load a file from the specified URL and apply each page of the file as a background to the corresponding page of the output PDF. A background can be either a PDF or an image.",required:!1}),page_background_color:s.ShortText({displayName:"Page Background Color",description:"Set a solid background color for all pages, filling the entire page area including margins. Useful for creating branded PDFs with corporate colors, highlighting draft documents, or improving readability with off-white backgrounds. Supports transparency with RGBA format - use semi-transparent colors for subtle effects without obscuring content. Format as RGB (FF0000) or RGBA (FF000080) hexadecimal.",required:!1}),use_print_media:s.Checkbox({displayName:"Use Print Media",description:"Use the print version of the page if available via @media print CSS rules. Enable this when converting websites that have print-optimized styles. Many sites hide navigation, ads, and sidebars in print mode. Produces cleaner PDFs by using the design the website creator intended for printing.",required:!1}),no_background:s.Checkbox({displayName:"No Background",description:"Do not print the background graphics to create printer-friendly PDFs. Use this when documents will be physically printed to save ink costs and improve readability. Removes background colors, images, and patterns while preserving text and foreground content. Particularly useful for documents with dark backgrounds or decorative elements.",required:!1}),disable_javascript:s.Checkbox({displayName:"Disable JavaScript",description:"Do not execute JavaScript during conversion. Use this to improve conversion speed when JavaScript is not needed, prevent dynamic content changes, or avoid security risks from untrusted scripts. Note that disabling JavaScript means lazy-loaded images and AJAX content will not load.",required:!1}),disable_image_loading:s.Checkbox({displayName:"Disable Image Loading",description:"Do not load images during conversion to create text-only PDFs. Use this to significantly speed up conversion, reduce file size, or create accessible text-focused documents. Ideal for converting documentation where images are not needed, reducing bandwidth usage, or creating lightweight PDFs for email distribution.",required:!1}),disable_remote_fonts:s.Checkbox({displayName:"Disable Remote Fonts",description:"Disable loading fonts from remote sources. Use this to speed up conversion by avoiding font download delays, ensure consistent rendering with system fonts, or work around font loading failures. Note that text will fall back to system fonts, which may change the document's appearance.",required:!1}),load_iframes:s.StaticDropdown({displayName:"Load Iframes",description:'Specifies how iframes are handled during conversion. Use "all" to include all embedded content (videos, maps, widgets). Use "same-origin" to include only content from the same domain for security purposes. Use "none" to exclude all iframes for faster conversion and to avoid third-party content issues. Disabling iframes can significantly improve performance and reliability.',required:!1,options:{options:[{label:"all",value:"all"},{label:"same-origin",value:"same-origin"},{label:"none",value:"none"}]},defaultValue:"all"}),block_ads:s.Checkbox({displayName:"Block Ads",description:"Automatically block common advertising networks and tracking scripts during conversion, producing cleaner PDFs with faster conversion times. Filters out third-party ad content, analytics beacons, and ad network resources. Ideal for converting news sites, blogs, or any ad-heavy content where ads distract from the main message. May occasionally block legitimate third-party content - disable if critical third-party resources are missing.",required:!1}),default_encoding:s.ShortText({displayName:"Default Encoding",description:'Specify the character encoding when the HTML lacks proper charset declaration or has incorrect encoding. Prevents garbled text for non-English content, especially legacy pages without UTF-8 encoding. Set to "utf-8" for modern content, "iso-8859-1" for Western European legacy pages, or other encodings for specific regional content. Only needed when auto-detection fails and you see corrupted characters in the output.',required:!1}),locale:s.ShortText({displayName:"Locale",description:'Set the locale for the conversion to control regional formatting of dates, times, and numbers. Use this when converting content for specific regions - for example, set to "en-US" for MM/DD/YYYY dates and comma thousand separators, or "de-DE" for DD.MM.YYYY dates and period thousand separators. Essential for financial reports, invoices, or localized content.',required:!1}),http_auth_user_name:s.ShortText({displayName:"HTTP Auth User Name",description:"Set the HTTP authentication user name. Required to access protected web pages or staging environments.",required:!1}),http_auth_password:s.ShortText({displayName:"HTTP Auth Password",description:"Set the HTTP authentication password. Required to access protected web pages or staging environments.",required:!1}),cookies:s.ShortText({displayName:"Cookies",description:"Set HTTP cookies to be included in all requests made by the converter to access authenticated or session-based content. Use this when converting pages that require login, maintain user sessions, or personalize content based on cookies. Essential for converting member-only areas, dashboards, or any content behind cookie-based authentication. Format as semicolon-separated name=value pairs.",required:!1}),verify_ssl_certificates:s.Checkbox({displayName:"Verify SSL Certificates",description:"Enforce SSL certificate validation for secure connections, preventing conversions from sites with invalid certificates. Enable when converting from production sites with valid certificates to ensure security. When disabled, allows conversion from any HTTPS site regardless of certificate validity - including development servers with self-signed certificates, internal corporate sites with expired certificates, or local testing environments.",required:!1}),fail_on_main_url_error:s.Checkbox({displayName:"Fail On Main URL Error",description:"Abort the conversion if the HTTP status code of the main URL is greater than or equal to 400 (client/server errors). Use this in automated workflows to catch broken URLs or authentication failures early rather than producing invalid PDFs. Ensures your system does not silently generate error page PDFs when source content is unavailable.",required:!1}),fail_on_any_url_error:s.Checkbox({displayName:"Fail On Any URL Error",description:"Abort the conversion if any sub-request (images, stylesheets, scripts) fails with HTTP 400+ errors. Use this for strict quality control when all assets must load successfully.",required:!1}),css_page_rule_mode:s.StaticDropdown({displayName:"CSS Page Rule Mode",description:'Specifies behavior in the presence of CSS @page rules to control which settings take precedence. Use "default" to prioritize API settings over CSS rules, ensuring consistent output regardless of input HTML. Use "mode2" to respect CSS @page rules for print-optimized HTML. This solves conflicts when CSS tries to override your API page setup.',required:!1,options:{options:[{label:"default",value:"default"},{label:"mode1",value:"mode1"},{label:"mode2",value:"mode2"}]},defaultValue:"default"}),custom_css:s.LongText({displayName:"Custom CSS",description:"Apply custom CSS to the input HTML document to modify the visual appearance and layout of your content dynamically. Use this to override default styles, adjust spacing, change fonts, or fix layout issues without modifying the source HTML. Use !important in your CSS rules to prioritize and override conflicting styles.",required:!1}),custom_javascript:s.LongText({displayName:"Custom JavaScript",description:"Run a custom JavaScript after the document is loaded and ready to print. Use this to modify page content before conversion, remove unwanted elements, or trigger specific page states. The script is intended for post-load DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.",required:!1}),on_load_javascript:s.ShortText({displayName:"On Load JavaScript",description:"Run a custom JavaScript right after the document is loaded. The script is intended for early DOM manipulation (add/remove elements, update CSS, ...). In addition to the standard browser APIs, the custom JavaScript code can use helper functions from our JavaScript library.",required:!1}),custom_http_header:s.ShortText({displayName:"Custom HTTP Header",description:"Set a custom HTTP header to be included in all requests made by the converter. Use this to pass authentication tokens to protected sites, add tracking headers for analytics, or provide API keys for accessing private content. Essential when converting content from APIs or internal systems that require special headers for access control.",required:!1}),javascript_delay:s.Number({displayName:"JavaScript Delay",description:'Wait the specified number of milliseconds to finish all JavaScript after the document is loaded. Use this to ensure lazy-loaded images, AJAX content, or animations complete before conversion. Your license defines the maximum wait time by "Max Delay" parameter.',required:!1}),element_to_convert:s.ShortText({displayName:"Element To Convert",description:"Convert only the specified element from the main document and its children. Use this to extract specific portions of a page (like article content) while excluding navigation, headers, footers, or sidebars. The element is specified by one or more CSS selectors. If the element is not found, the conversion fails. If multiple elements are found, the first one is used.",required:!1}),element_to_convert_mode:s.StaticDropdown({displayName:"Element To Convert Mode",description:'Control how CSS styles are applied when converting only part of a page. The "cut-out" option extracts the element into a new document root, which may break CSS selectors like "body > div". The "remove-siblings" option keeps the element in its original DOM position but deletes other elements, preserving descendant selectors. The "hide-siblings" option keeps all elements but hides non-selected ones with display:none, preserving all CSS context.',required:!1,options:{options:[{label:"cut-out",value:"cut-out"},{label:"remove-siblings",value:"remove-siblings"},{label:"hide-siblings",value:"hide-siblings"}]},defaultValue:"cut-out"}),wait_for_element:s.ShortText({displayName:"Wait For Element",description:'Wait for the specified element in a source document. Use this when specific dynamic content must be ready before conversion, avoiding unnecessary delays from a fixed JavaScript delay. The element is specified by one or more CSS selectors. The element is searched for in the main document and all iframes. If the element is not found, the conversion fails. Your license defines the maximum wait time by the "Max Delay" parameter.',required:!1}),auto_detect_element_to_convert:s.Checkbox({displayName:"Auto Detect Element To Convert",description:"The main HTML element for conversion is detected automatically. Use this when you want to extract article or main content without knowing the exact CSS selector, automatically excluding navigation and sidebars.",required:!1}),readability_enhancements:s.StaticDropdown({displayName:"Readability Enhancements",description:'Automatically enhance the input HTML to improve readability by removing clutter and reformatting content. Use this when converting web pages with excessive navigation, ads, or sidebars that distract from the main content. Different versions (v1-v4) use progressively aggressive algorithms - start with "v1" and increase if more cleanup is needed. Ideal for converting blog posts, articles, or documentation into clean PDFs.',required:!1,options:{options:[{label:"none",value:"none"},{label:"readability-v1",value:"readability-v1"},{label:"readability-v2",value:"readability-v2"},{label:"readability-v3",value:"readability-v3"},{label:"readability-v4",value:"readability-v4"}]},defaultValue:"none"}),scale_factor:s.Number({displayName:"Scale Factor",description:"Set the scaling factor (zoom) for the main page area to fit content better. Use values below 100% to shrink oversized content that is getting cut off at page edges. Use values above 100% to enlarge small content for better readability. Common use cases include shrinking wide tables to fit (70-80%), or enlarging mobile-optimized layouts for desktop PDFs (120-150%).",required:!1}),jpeg_quality:s.Number({displayName:"JPEG Quality",description:"Set the quality of embedded JPEG images to balance file size and visual quality. Use 100% for archival documents or when image quality is critical. Use 70-85% for web distribution to significantly reduce file size with minimal visible quality loss. Use lower values (50-60%) only when file size is more important than image clarity. Common artifacts below 60% include blockiness and color banding.",required:!1}),convert_images_to_jpeg:s.StaticDropdown({displayName:"Convert Images To JPEG",description:'Specify which image types will be converted to JPEG to reduce PDF file size. Use "opaque" to convert only non-transparent images (safe for most documents). Use "all" to convert everything including transparent images (transparent areas become white). Use "none" to preserve original image formats. Ideal for reducing file size when distributing large image-heavy PDFs via email or web.',required:!1,options:{options:[{label:"none",value:"none"},{label:"opaque",value:"opaque"},{label:"all",value:"all"}]},defaultValue:"none"}),image_dpi:s.Number({displayName:"Image DPI",description:"Set the DPI of images in PDF to control resolution and file size. Use 300 DPI for professional printing, 150 DPI for everyday documents, 96 DPI for screen-only viewing, or 72 DPI for web distribution. Lower DPI creates smaller files but reduces image quality. Use 0 to preserve original image resolution. Note that this only downscales - it will not upscale low-resolution images.",required:!1}),enable_pdf_forms:s.Checkbox({displayName:"Enable PDF Forms",description:"Convert HTML forms to fillable PDF forms that users can complete in PDF readers. Use this to create interactive PDFs from HTML forms. Ideal for creating fillable applications, surveys, or order forms that work offline. Details can be found in the blog post.",required:!1}),linearize:s.Checkbox({displayName:"Linearize",description:"Create linearized PDF. This is also known as Fast Web View. Use this to optimize PDFs for progressive download, allowing users to start viewing the first page while the rest downloads.",required:!1}),encrypt:s.Checkbox({displayName:"Encrypt",description:"Encrypt the PDF to prevent search engines from indexing the contents and add an extra layer of security. Use this for confidential documents, internal reports, or any content you do not want appearing in search results. Combine with a password to require authentication for viewing, or just use encryption alone to prevent indexing while keeping the PDF publicly readable.",required:!1}),user_password:s.ShortText({displayName:"User Password",description:"Protect the PDF with a user password to restrict who can open and view the document. Recipients must enter this password to view the PDF. Use this for confidential documents, sensitive data, or content distribution where you want to control access. Combine with permission flags to restrict what users can do after opening.",required:!1}),owner_password:s.ShortText({displayName:"Owner Password",description:"Protect the PDF with an owner password for administrative control. This password allows changing permissions, passwords, and document restrictions - like a master key. Use different user and owner passwords to give recipients restricted access while retaining full control. The owner password should be kept confidential and different from the user password.",required:!1}),no_print:s.Checkbox({displayName:"No Print",description:"Disallow printing of the output PDF to protect sensitive content. Use this for confidential documents, copyrighted materials, or preview versions you want to restrict.",required:!1}),no_modify:s.Checkbox({displayName:"No Modify",description:"Disallow modification of the output PDF to maintain document integrity. Use this for official documents, contracts, or records that should not be altered after creation. Prevents recipients from editing content, adding annotations, or extracting pages.",required:!1}),no_copy:s.Checkbox({displayName:"No Copy",description:"Disallow text and graphics extraction from the output PDF to protect copyrighted content. Use this for ebooks, proprietary documents, or materials where you want to prevent easy copying and redistribution.",required:!1}),title:s.ShortText({displayName:"Title",description:"Set the title of the PDF that appears in PDF reader title bars and document properties. Use descriptive titles for better organization and searchability in document management systems. This metadata helps users identify documents when multiple PDFs are open and improves accessibility for screen readers.",required:!1}),subject:s.ShortText({displayName:"Subject",description:"Set the subject of the PDF to categorize or summarize the document content. Use this to add searchable metadata for document management systems, improve organization in large PDF libraries, or provide context about the document's purpose. Appears in PDF properties dialog.",required:!1}),author:s.ShortText({displayName:"Author",description:"Set the author of the PDF for attribution and document tracking. Use this to identify who created the document, important for official documents, reports, or publications. This metadata appears in PDF properties and helps with document management and version control.",required:!1}),keywords:s.ShortText({displayName:"Keywords",description:"Associate keywords with the document to improve searchability in document management systems. Use relevant terms that describe the content, making it easier to find documents later. Separate multiple keywords with commas. Particularly useful for large document repositories or DAM systems.",required:!1}),extract_meta_tags:s.Checkbox({displayName:"Extract Meta Tags",description:"Extract meta tags (author, keywords and description) from the input HTML and automatically populate PDF metadata. Use this when converting web pages that already have proper HTML meta tags, saving you from manually setting title, author, and keywords. Ideal for automated conversion workflows where source HTML is well-structured.",required:!1}),page_layout:s.StaticDropdown({displayName:"Page Layout",description:'Control how pages appear when the PDF opens in viewers that respect these preferences. "single-page" for focused reading one page at a time. "one-column" for continuous scrolling like a web page. "two-column-left" for book-like layouts with odd pages on left (international standard). "two-column-right" for magazines with odd pages on right.',required:!1,options:{options:[{label:"single-page",value:"single-page"},{label:"one-column",value:"one-column"},{label:"two-column-left",value:"two-column-left"},{label:"two-column-right",value:"two-column-right"}]}}),page_mode:s.StaticDropdown({displayName:"Page Mode",description:'Control the initial display mode when the PDF opens. "full-screen" for presentations and kiosk displays where you want an immersive experience. "thumbnails" for long documents where visual page navigation is helpful. "outlines" for structured documents with bookmarks/table of contents.',required:!1,options:{options:[{label:"full-screen",value:"full-screen"},{label:"thumbnails",value:"thumbnails"},{label:"outlines",value:"outlines"}]}}),initial_zoom_type:s.StaticDropdown({displayName:"Initial Zoom Type",description:"Control how the PDF is initially zoomed when opened.",required:!1,options:{options:[{label:"fit-width",value:"fit-width"},{label:"fit-height",value:"fit-height"},{label:"fit-page",value:"fit-page"}]}}),initial_page:s.Number({displayName:"Initial Page",description:"Display the specified page when the document is opened.",required:!1}),initial_zoom:s.Number({displayName:"Initial Zoom",description:"Specify the initial page zoom in percents when the document is opened.",required:!1}),hide_toolbar:s.Checkbox({displayName:"Hide Toolbar",description:"Hide the viewer's toolbar when the PDF is opened to provide a cleaner, more focused reading experience. Use this for presentations, kiosk displays, or immersive reading where you want minimal UI distractions.",required:!1}),hide_menubar:s.Checkbox({displayName:"Hide Menubar",description:"Hide the viewer's menu bar when the PDF is opened for a cleaner interface. Use this for kiosk mode, presentations, or embedded PDFs where you want to minimize UI elements.",required:!1}),hide_window_ui:s.Checkbox({displayName:"Hide Window UI",description:"Hide user interface elements like scroll bars and navigation controls when the PDF opens. Use this for presentation mode, digital signage, or embedded PDFs where you want the most minimal interface possible. Combines with other UI hiding options for full-screen immersive viewing.",required:!1}),fit_window:s.Checkbox({displayName:"Fit Window",description:"Resize the PDF viewer window to fit the size of the first displayed page when opened. Use this to ensure the PDF opens at an appropriate size rather than filling the entire screen. Particularly useful for small documents, forms, or certificates that look better at actual size.",required:!1}),center_window:s.Checkbox({displayName:"Center Window",description:"Position the PDF viewer window in the center of the screen when opened. Use this with window resizing to create a professional, centered display for forms, certificates, or small documents. Improves the initial viewing experience by avoiding corner-positioned windows.",required:!1}),display_title:s.Checkbox({displayName:"Display Title",description:"Display the title of the HTML document in the PDF viewer's title bar instead of the filename. Use this to show more descriptive titles when PDFs are opened - particularly useful when the filename is cryptic or auto-generated. Improves user experience by showing meaningful document names.",required:!1}),right_to_left:s.Checkbox({displayName:"Right To Left",description:"Set the predominant reading order for text to right-to-left. This option has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up.",required:!1}),data_string:s.LongText({displayName:"Data String",description:"Set the input data for template rendering. The data format can be JSON, XML, YAML or CSV.",required:!1}),data_format:s.StaticDropdown({displayName:"Data Format",description:'Specify the input data format. Use "auto" for automatic detection or explicitly set to JSON, XML, YAML, or CSV when format is known.',required:!1,options:{options:[{label:"auto",value:"auto"},{label:"json",value:"json"},{label:"xml",value:"xml"},{label:"yaml",value:"yaml"},{label:"csv",value:"csv"}]},defaultValue:"auto"}),data_ignore_undefined:s.Checkbox({displayName:"Data Ignore Undefined",description:"Ignore undefined variables in the HTML template. The default mode is strict so any undefined variable causes the conversion to fail. You can use {% if variable is defined %} to check if the variable is defined.",required:!1}),data_auto_escape:s.Checkbox({displayName:"Data Auto Escape",description:"Auto escape HTML symbols in the input data before placing them into the output.",required:!1}),data_trim_blocks:s.Checkbox({displayName:"Data Trim Blocks",description:"Auto trim whitespace around each template command block.",required:!1}),data_options:s.LongText({displayName:"Data Options",description:"Set the advanced data options as comma separated key=value pairs: csv_delimiter - The CSV data delimiter, the default is ,. xml_remove_root - Remove the root XML element from the input data. data_root - The name of the root element inserted into the input data without a root node (e.g. CSV), the default is data.",required:!1}),debug_log:s.Checkbox({displayName:"Debug Log",description:"Turn on debug logging to troubleshoot conversion issues. Details about the conversion process, including resource loading, rendering steps, and error messages are stored in the debug log. Use this when conversions fail or produce unexpected results.",required:!1}),tag:s.ShortText({displayName:"Tag",description:"Tag the conversion with a custom value for tracking and analytics. Use this to categorize conversions by customer ID, document type, or business unit. The tag appears in conversion statistics. A value longer than 32 characters is cut off.",required:!1}),http_proxy:s.ShortText({displayName:"HTTP Proxy",description:"A proxy server used by the conversion process for accessing the source URLs with HTTP scheme. This can help circumvent regional restrictions or provide limited access to your intranet.",required:!1}),https_proxy:s.ShortText({displayName:"HTTPS Proxy",description:"A proxy server used by the conversion process for accessing the source URLs with HTTPS scheme. This can help circumvent regional restrictions or provide limited access to your intranet.",required:!1}),layout_dpi:s.Number({displayName:"Layout DPI",description:"Set the internal DPI resolution used for positioning of PDF contents. It can help in situations where there are small inaccuracies in the PDF. It is recommended to use values that are a multiple of 72, such as 288 or 360.",required:!1}),main_document_css_annotation:s.Checkbox({displayName:"Main Document CSS Annotation",description:"Add special CSS classes to the main document's body element. This allows applying custom styling based on these classes: pdfcrowd-page-X - where X is the current page number pdfcrowd-page-odd - odd page pdfcrowd-page-even - even page",required:!1}),header_footer_css_annotation:s.Checkbox({displayName:"Header Footer CSS Annotation",description:"Add special CSS classes to the header/footer's body element. This allows applying custom styling based on these classes: pdfcrowd-page-X - where X is the current page number pdfcrowd-page-count-X - where X is the total page count pdfcrowd-page-first - the first page pdfcrowd-page-last - the last page pdfcrowd-page-odd - odd page pdfcrowd-page-even - even page",required:!1}),conversion_config:s.LongText({displayName:"Conversion Config",description:`Configure conversion via JSON. The configuration defines various page settings for individual PDF pages or ranges of pages. It provides flexibility in designing each page of the PDF, giving control over each page's size, header, footer, etc. If a page or parameter is not explicitly specified, the system will use the default settings for that page or attribute. If a JSON configuration is provided, the settings in the JSON will take precedence over the global options. The structure of the JSON must be: pageSetup: An array of objects where each object defines the configuration for a specific page or range of pages. The following properties can be set for each page object: pages: A comma-separated list of page numbers or ranges. Special strings may be used, such as odd, even, and last. For example: 1-: from page 1 to the end of the document 2: only the 2nd page 2,4,6: pages 2, 4, and 6 2-5: pages 2 through 5 odd,2: the 2nd page and all odd pages pageSize: The page size (optional). Possible values: A0, A1, A2, A3, A4, A5, A6, Letter. pageWidth: The width of the page (optional). pageHeight: The height of the page (optional). marginLeft: Left margin (optional). marginRight: Right margin (optional). marginTop: Top margin (optional). marginBottom: Bottom margin (optional). displayHeader: Header appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) displayFooter: Footer appearance (optional). Possible values: none: completely excluded space: only the content is excluded, the space is used content: the content is printed (default) headerHeight: Height of the header (optional). footerHeight: Height of the footer (optional). orientation: Page orientation, such as "portrait" or "landscape" (optional). backgroundColor: Page background color in RRGGBB or RRGGBBAA hexadecimal format (optional). Dimensions may be empty, 0 or specified in inches "in", millimeters "mm", centimeters "cm", pixels "px", or points "pt".`,required:!1}),converter_version:s.StaticDropdown({displayName:"Converter Version",description:"Set the converter version. Different versions may produce different output. Choose which one provides the best output for your case.",required:!1,options:{options:[{label:"24.04",value:"24.04"},{label:"20.10",value:"20.10"},{label:"18.10",value:"18.10"}]},defaultValue:"24.04"}),page_watermark:s.File({displayName:"Page Watermark",description:'Apply the first page of a watermark PDF to every page of the output PDF. Use this to add transparent overlays like "DRAFT" stamps, security markings, or branding elements that appear on top of content. Ideal for confidential document marking or adding protective overlays.',required:!1}),multipage_watermark:s.File({displayName:"Multipage Watermark",description:"Apply each page of a watermark PDF to the corresponding page of the output PDF. Use this for page-specific watermarks where different pages need different overlays - for example, different approval stamps per department. If the watermark has fewer pages than the output, the last watermark page is repeated for remaining pages.",required:!1}),page_background:s.File({displayName:"Page Background",description:"Apply the first page of a background PDF to every page of the output PDF. Use this to add letterheads, branded templates, or decorative backgrounds that appear behind your content. Backgrounds appear beneath content, while watermarks layer on top. Perfect for adding company letterheads to reports or applying branded templates to dynamically generated content.",required:!1}),multipage_background:s.File({displayName:"Multipage Background",description:"Apply each page of a background PDF to the corresponding page of the output PDF. Use this for page-specific backgrounds where each page needs a different template - for example, different letterheads for front and back pages. If the background has fewer pages than the output, the last background page is repeated for remaining pages.",required:!1})},async run(e){let{auth:t,propsValue:r}=e,n=new Ns.default;n.append("text",r.htmlContent);let i=["page_size","page_width","page_height","orientation","margin_top","margin_right","margin_bottom","margin_left","no_margins","print_page_range","content_viewport_width","content_viewport_height","content_fit_mode","remove_blank_pages","header_url","header_html","header_height","footer_url","footer_html","footer_height","no_header_footer_horizontal_margins","exclude_header_on_pages","exclude_footer_on_pages","header_footer_scale_factor","page_numbering_offset","page_watermark_url","multipage_watermark_url","page_background_url","multipage_background_url","page_background_color","use_print_media","no_background","disable_javascript","disable_image_loading","disable_remote_fonts","load_iframes","block_ads","default_encoding","locale","http_auth_user_name","http_auth_password","cookies","verify_ssl_certificates","fail_on_main_url_error","fail_on_any_url_error","css_page_rule_mode","custom_css","custom_javascript","on_load_javascript","custom_http_header","javascript_delay","element_to_convert","element_to_convert_mode","wait_for_element","auto_detect_element_to_convert","readability_enhancements","scale_factor","jpeg_quality","convert_images_to_jpeg","image_dpi","enable_pdf_forms","linearize","encrypt","user_password","owner_password","no_print","no_modify","no_copy","title","subject","author","keywords","extract_meta_tags","page_layout","page_mode","initial_zoom_type","initial_page","initial_zoom","hide_toolbar","hide_menubar","hide_window_ui","fit_window","center_window","display_title","right_to_left","debug_log","tag","http_proxy","https_proxy","layout_dpi","main_document_css_annotation","header_footer_css_annotation","conversion_config"];for(let h of i){let c=r[h];c!=null&&c!==""&&c!==!1&&n.append(h,String(c))}if(r.data_string){n.append("data_string",String(r.data_string));let h=["data_format","data_ignore_undefined","data_auto_escape","data_trim_blocks","data_options"];for(let c of h){let d=r[c];d!=null&&d!==""&&d!==!1&&n.append(c,String(d))}}let u=["page_watermark","multipage_watermark","page_background","multipage_background"];for(let h of u){let c=r[h];c?.data&&n.append(h,c.data,{filename:c.filename||`${h}.pdf`})}let p=n.getBuffer(),m=r.converter_version||"24.04",g=await Te.sendRequest({method:"POST",url:er(m),headers:{Authorization:tr(t),"User-Agent":"pdfcrowd-activepieces/1.1.0",...n.getHeaders()},body:p,responseType:"arraybuffer"});if(g.status>=400){let h=Buffer.from(g.body).toString("utf-8");throw new Error(`Conversion failed (${g.status}): ${h}`)}let v=r.outputFilename||"document.pdf",b=await e.files.write({fileName:v,data:Buffer.from(g.body)}),T=g.headers||{};return{file:b,filename:v,jobId:T["x-pdfcrowd-job-id"]||"",pageCount:T["x-pdfcrowd-pages"]||"0",outputSize:T["x-pdfcrowd-output-size"]||"0",consumedCredits:T["x-pdfcrowd-consumed-credits"]||"0",remainingCredits:T["x-pdfcrowd-remaining-credits"]||"0"}}});var pd=yi({displayName:"Pdfcrowd",auth:ke,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/pdfcrowd.png",authors:["pdfcrowd","sanket-a11y"],categories:["CONTENT_AND_FILES"],description:"Convert web pages and HTML to PDF with advanced formatting options",actions:[Os,Rs,zs({auth:ke,baseUrl:o(()=>ks,"baseUrl"),authMapping:o(async e=>({Authorization:`Basic ${Buffer.from(`${e.username}:${e.password}`).toString("base64")}`}),"authMapping")})],triggers:[]});0&&(module.exports={pdfcrowd});
4
+ /*! Bundled license information:
5
+
6
+ mime-types/index.js:
7
+ (*!
8
+ * mime-types
9
+ * Copyright(c) 2014 Jonathan Ong
10
+ * Copyright(c) 2015 Douglas Christopher Wilson
11
+ * MIT Licensed
12
+ *)
13
+ */
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const pdfcrowd: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").BasicAuthProperty>;
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,QAAQ,4GAyBnB,CAAC"}
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAA6D;AAC7D,4CAAiD;AACjD,yDAA0D;AAC1D,2DAA4D;AAC5D,iDAAqD;AACrD,+DAAwE;AACxE,gDAA+C;AAElC,QAAA,QAAQ,GAAG,IAAA,8BAAW,EAAC;IAClC,WAAW,EAAE,UAAU;IACvB,IAAI,EAAE,mBAAY;IAClB,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,kDAAkD;IAC3D,OAAO,EAAE,CAAC,UAAU,EAAE,aAAa,CAAC;IACpC,UAAU,EAAE,CAAC,sBAAa,CAAC,iBAAiB,CAAC;IAC7C,WAAW,EACT,oEAAoE;IACtE,OAAO,EAAE;QACP,2BAAc;QACd,6BAAe;QACf,IAAA,yCAAyB,EAAC;YACxB,IAAI,EAAE,mBAAY;YAClB,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAQ;YACvB,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAC1B,OAAO;oBACL,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CACjC,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EAAE,CACpC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;iBACvB,CAAC;YACJ,CAAC,CAAA;SACF,CAAC;KACH;IACD,QAAQ,EAAE,EAAE;CACb,CAAC,CAAC"}