@activepieces/piece-polydoc 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-polydoc",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "dependencies": {},
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var du=Object.create;var dt=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty;var o=(e,t)=>dt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),kn=(e,t)=>{for(var r in t)dt(e,r,{get:t[r],enumerable:!0})},wn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!yu.call(e,i)&&i!==r&&dt(e,i,{get:()=>t[i],enumerable:!(n=mu(t,i))||n.enumerable});return e};var ke=(e,t,r)=>(r=e!=null?du(gu(e)):{},wn(t||!e||!e.__esModule?dt(r,"default",{value:e,enumerable:!0}):r,e)),hu=e=>wn(dt({},"__esModule",{value:!0}),e);var Ko=E((Jo,nr)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,p){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],_,j;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>p)return null;for(j=p-g,_=":";j--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),p=function(){let Q=s.split(":"),ne=[];for(let pt=0;pt<Q.length;pt++)ne.push(parseInt(Q[pt],16));return ne}(),{parts:p,zoneId:v}}o(f,"expandIPv6");function h(s,p,g,m){if(s.length!==p.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==p[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function $(s,p){for(;s.length<p;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=function(){function s(p){if(p.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<p.length;g++)if(m=p[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=p}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,p.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,j;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(j=m[_],g&&j!==0)return null;j!==8&&(g=!0),p+=j}else return null;return 32-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let p=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!p?!1:x.IPv4.isValidFourPartDecimal(p[1])},x.IPv4.networkAddressFromCIDR=function(s){let p,g,m,v,_;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),_=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let p=this.parser(s);if(p===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(p)},x.IPv4.parseCIDR=function(s){let p;if(p=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(p[2]);if(g>=0&&g<=32){let m=[this.parse(p[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let p,g,m;if(p=s.match(r.fourOctet))return function(){let v=p.slice(1,6),_=[];for(let j=0;j<v.length;j++)g=v[j],_.push(P(g));return _}();if(p=s.match(r.longValue)){if(m=P(p[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v}().reverse()}else return(p=s.match(r.twoOctet))?function(){let v=p.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_}():(p=s.match(r.threeOctet))?function(){let v=p.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let p=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)p[g]=255,g++;return m<4&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.IPv6=function(){function s(p,g){let m,v;if(p.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(p[m]<<8|p[m+1]);else if(p.length===8)this.parts=p;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(p,g){let m;if(g===void 0&&(m=p,p=m[0],g=m[1]),p.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,p.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let p=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),p+=_}else return null;return 128-p},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let p,g=[],m=this.parts;for(let v=0;v<m.length;v++)p=m[v],g.push(p>>8),g.push(p&255);return g},s.prototype.toFixedLengthString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let p=this.parts.slice(-2),g=p[0],m=p[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let p=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),p+g},s.prototype.toRFC5952String=function(){let p=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=p.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let p=this.parseCIDR(s),g=p[0].toByteArray(),m=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(p){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${p})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let p=this.parser(s);return new this(p.parts,p.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let p,g,m,v,_;try{for(p=this.parseCIDR(s),m=p[0].toByteArray(),_=this.subnetMaskFromPrefixLength(p[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(s){let p=this.parser(s);if(p.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(p.parts,p.zoneId)},x.IPv6.parseCIDR=function(s){let p,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(p=parseInt(g[2]),p>=0&&p<=128))return m=[this.parse(g[1]),p],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let p,g,m,v,_,j;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return f(s,8);if((m=s.match(d.transitional))&&(j=m[6]||"",p=m[1],m[1].endsWith("::")||(p=p.slice(0,-1)),p=f(p+j,6),p.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return p.parts.push(_[0]<<8|_[1]),p.parts.push(_[2]<<8|_[3]),{parts:p.parts,zoneId:p.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)p[g]=255,g++;return m<16&&(p[m]=Math.pow(2,s%8)-1<<8-s%8),new this(p)},x.fromByteArray=function(s){let p=s.length;if(p===4)return new x.IPv4(s);if(p===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let p=this.parse(s);return p.kind()==="ipv6"&&p.isIPv4MappedAddress()?p.toIPv4Address():p},x.subnetMatch=function(s,p,g){let m,v,_,j;g==null&&(g="unicast");for(v in p)if(Object.prototype.hasOwnProperty.call(p,v)){for(_=p[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(j=_[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return g},typeof nr<"u"&&nr.exports?nr.exports=x:e.ipaddr=x})(Jo)});var qi=E((TA,Hi)=>{var Zi=require("stream").Stream,ql=require("util");Hi.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");ql.inherits(ie,Zi);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=Zi.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=E((EA,Ji)=>{var Wl=require("util"),Gi=require("stream").Stream,Wi=qi();Ji.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");Wl.inherits(W,Gi);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 Wi)){var r=Wi.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 Gi.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 Yi=E((SA,Xi)=>{"use strict";Xi.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 ta=E(Y=>{"use strict";var lr=Yi(),Gl=require("path").extname,Qi=/^\s*([^;\s]*)(?:;|\s|$)/,Jl=/^text\//i;Y.charset=ea;Y.charsets={lookup:ea};Y.contentType=Kl;Y.extension=Xl;Y.extensions=Object.create(null);Y.lookup=Yl;Y.types=Object.create(null);Ql(Y.extensions,Y.types);function ea(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&lr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Jl.test(t[1])?"UTF-8":!1}o(ea,"charset");function Kl(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(Kl,"contentType");function Xl(e){if(!e||typeof e!="string")return!1;var t=Qi.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Xl,"extension");function Yl(e){if(!e||typeof e!="string")return!1;var t=Gl("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(Yl,"lookup");function Ql(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(lr).forEach(o(function(i){var u=lr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var d=0;d<c.length;d++){var f=c[d];if(t[f]){var h=r.indexOf(lr[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>P||h===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Ql,"populateMaps")});var na=E((OA,ra)=>{ra.exports=ep;function ep(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(ep,"defer")});var sn=E((wA,ia)=>{var oa=na();ia.exports=tp;function tp(e){var t=!1;return oa(function(){t=!0}),o(function(n,i){t?e(n,i):oa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(tp,"async")});var un=E((DA,aa)=>{aa.exports=rp;function rp(e){Object.keys(e.jobs).forEach(np.bind(e)),e.jobs={}}o(rp,"abort");function np(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(np,"clean")});var cn=E((CA,ua)=>{var sa=sn(),op=un();ua.exports=ip;function ip(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ap(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?op(r):r.results[i]=c,n(u,r.results))})}o(ip,"iterate");function ap(e,t,r,n){var i;return e.length==2?i=e(r,sa(n)):i=e(r,t,sa(n)),i}o(ap,"runJob")});var ln=E((MA,ca)=>{ca.exports=sp;function sp(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(sp,"state")});var pn=E((LA,la)=>{var up=un(),cp=sn();la.exports=lp;function lp(e){Object.keys(this.jobs).length&&(this.index=this.size,up(this),cp(e)(null,this.results))}o(lp,"terminator")});var da=E((BA,pa)=>{var pp=cn(),dp=ln(),mp=pn();pa.exports=fp;function fp(e,t,r){for(var n=dp(e);n.index<(n.keyedList||e).length;)pp(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 mp.bind(n,r)}o(fp,"parallel")});var dn=E((ZA,pr)=>{var ma=cn(),gp=ln(),yp=pn();pr.exports=hp;pr.exports.ascending=fa;pr.exports.descending=vp;function hp(e,t,r,n){var i=gp(e,r);return ma(e,t,i,o(function u(c,d){if(c){n(c,d);return}if(i.index++,i.index<(i.keyedList||e).length){ma(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),yp.bind(i,n)}o(hp,"serialOrdered");function fa(e,t){return e<t?-1:e>t?1:0}o(fa,"ascending");function vp(e,t){return-1*fa(e,t)}o(vp,"descending")});var ya=E((qA,ga)=>{var xp=dn();ga.exports=Pp;function Pp(e,t,r){return xp(e,t,null,r)}o(Pp,"serial")});var va=E((GA,ha)=>{ha.exports={parallel:da(),serial:ya(),serialOrdered:dn()}});var mn=E((JA,xa)=>{"use strict";xa.exports=Object});var _a=E((KA,Pa)=>{"use strict";Pa.exports=Error});var Ta=E((XA,ba)=>{"use strict";ba.exports=EvalError});var Ea=E((YA,Ia)=>{"use strict";Ia.exports=RangeError});var Sa=E((QA,$a)=>{"use strict";$a.exports=ReferenceError});var za=E((ez,Aa)=>{"use strict";Aa.exports=SyntaxError});var dr=E((tz,Oa)=>{"use strict";Oa.exports=TypeError});var wa=E((rz,ka)=>{"use strict";ka.exports=URIError});var Da=E((nz,Ra)=>{"use strict";Ra.exports=Math.abs});var Ca=E((oz,Na)=>{"use strict";Na.exports=Math.floor});var Ma=E((iz,Ua)=>{"use strict";Ua.exports=Math.max});var La=E((az,ja)=>{"use strict";ja.exports=Math.min});var Ba=E((sz,Fa)=>{"use strict";Fa.exports=Math.pow});var Za=E((uz,Va)=>{"use strict";Va.exports=Math.round});var qa=E((cz,Ha)=>{"use strict";Ha.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ga=E((pz,Wa)=>{"use strict";var _p=qa();Wa.exports=o(function(t){return _p(t)||t===0?t:t<0?-1:1},"sign")});var Ka=E((mz,Ja)=>{"use strict";Ja.exports=Object.getOwnPropertyDescriptor});var fn=E((fz,Xa)=>{"use strict";var mr=Ka();if(mr)try{mr([],"length")}catch{mr=null}Xa.exports=mr});var Qa=E((gz,Ya)=>{"use strict";var fr=Object.defineProperty||!1;if(fr)try{fr({},"a",{value:1})}catch{fr=!1}Ya.exports=fr});var gn=E((yz,es)=>{"use strict";es.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var ns=E((vz,rs)=>{"use strict";var ts=typeof Symbol<"u"&&Symbol,bp=gn();rs.exports=o(function(){return typeof ts!="function"||typeof Symbol!="function"||typeof ts("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:bp()},"hasNativeSymbols")});var yn=E((Pz,os)=>{"use strict";os.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var hn=E((_z,is)=>{"use strict";var Tp=mn();is.exports=Tp.getPrototypeOf||null});var us=E((bz,ss)=>{"use strict";var Ip="Function.prototype.bind called on incompatible ",Ep=Object.prototype.toString,$p=Math.max,Sp="[object Function]",as=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"),Ap=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"),zp=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");ss.exports=o(function(t){var r=this;if(typeof r!="function"||Ep.apply(r)!==Sp)throw new TypeError(Ip+r);for(var n=Ap(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,as(n,arguments));return Object(P)===P?P:this}return r.apply(t,as(n,arguments))},"binder"),c=$p(0,r.length-n.length),d=[],f=0;f<c;f++)d[f]="$"+f;if(i=Function("binder","return function ("+zp(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Be=E((Iz,cs)=>{"use strict";var Op=us();cs.exports=Function.prototype.bind||Op});var gr=E((Ez,ls)=>{"use strict";ls.exports=Function.prototype.call});var vn=E(($z,ps)=>{"use strict";ps.exports=Function.prototype.apply});var ms=E((Sz,ds)=>{"use strict";ds.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var gs=E((Az,fs)=>{"use strict";var kp=Be(),wp=vn(),Rp=gr(),Dp=ms();fs.exports=Dp||kp.call(Rp,wp)});var hs=E((zz,ys)=>{"use strict";var Np=Be(),Cp=dr(),Up=gr(),Mp=gs();ys.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Cp("a function is required");return Mp(Np,Up,t)},"callBindBasic")});var Ts=E((kz,bs)=>{"use strict";var jp=hs(),vs=fn(),Ps;try{Ps=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var xn=!!Ps&&vs&&vs(Object.prototype,"__proto__"),_s=Object,xs=_s.getPrototypeOf;bs.exports=xn&&typeof xn.get=="function"?jp([xn.get]):typeof xs=="function"?o(function(t){return xs(t==null?t:_s(t))},"getDunder"):!1});var As=E((Rz,Ss)=>{"use strict";var Is=yn(),Es=hn(),$s=Ts();Ss.exports=Is?o(function(t){return Is(t)},"getProto"):Es?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Es(t)},"getProto"):$s?o(function(t){return $s(t)},"getProto"):null});var Pn=E((Nz,zs)=>{"use strict";var Lp=Function.prototype.call,Fp=Object.prototype.hasOwnProperty,Bp=Be();zs.exports=Bp.call(Lp,Fp)});var Cs=E((Cz,Ns)=>{"use strict";var M,Vp=mn(),Zp=_a(),Hp=Ta(),qp=Ea(),Wp=Sa(),qe=za(),He=dr(),Gp=wa(),Jp=Da(),Kp=Ca(),Xp=Ma(),Yp=La(),Qp=Ba(),ed=Za(),td=Ga(),Rs=Function,_n=o(function(e){try{return Rs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Dt=fn(),rd=Qa(),bn=o(function(){throw new He},"throwTypeError"),nd=Dt?function(){try{return arguments.callee,bn}catch{try{return Dt(arguments,"callee").get}catch{return bn}}}():bn,Ve=ns()(),K=As(),od=hn(),id=yn(),Ds=vn(),Nt=gr(),Ze={},ad=typeof Uint8Array>"u"||!K?M:K(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&K?K([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ze,"%AsyncGenerator%":Ze,"%AsyncGeneratorFunction%":Ze,"%AsyncIteratorPrototype%":Ze,"%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%":Zp,"%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%":Rs,"%GeneratorFunction%":Ze,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&K?K(K([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!K?M:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Vp,"%Object.getOwnPropertyDescriptor%":Dt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":qp,"%ReferenceError%":Wp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!K?M:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&K?K(""[Symbol.iterator]()):M,"%Symbol%":Ve?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":nd,"%TypedArray%":ad,"%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%":Gp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Nt,"%Function.prototype.apply%":Ds,"%Object.defineProperty%":rd,"%Object.getPrototypeOf%":od,"%Math.abs%":Jp,"%Math.floor%":Kp,"%Math.max%":Xp,"%Math.min%":Yp,"%Math.pow%":Qp,"%Math.round%":ed,"%Math.sign%":td,"%Reflect.getPrototypeOf%":id};if(K)try{null.error}catch(e){Os=K(K(e)),Oe["%Error.prototype%"]=Os}var Os,sd=o(function e(t){var r;if(t==="%AsyncFunction%")r=_n("async function () {}");else if(t==="%GeneratorFunction%")r=_n("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=_n("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 Oe[t]=r,r},"doEval"),ks={__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"]},Ct=Be(),yr=Pn(),ud=Ct.call(Nt,Array.prototype.concat),cd=Ct.call(Ds,Array.prototype.splice),ws=Ct.call(Nt,String.prototype.replace),hr=Ct.call(Nt,String.prototype.slice),ld=Ct.call(Nt,RegExp.prototype.exec),pd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dd=/\\(\\)?/g,md=o(function(t){var r=hr(t,0,1),n=hr(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return ws(t,pd,function(u,c,d,f){i[i.length]=d?ws(f,dd,"$1"):c||u}),i},"stringToPath"),fd=o(function(t,r){var n=t,i;if(yr(ks,n)&&(i=ks[n],n="%"+i[0]+"%"),yr(Oe,n)){var u=Oe[n];if(u===Ze&&(u=sd(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 qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ns.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(ld(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=md(t),i=n.length>0?n[0]:"",u=fd("%"+i+"%",r),c=u.name,d=u.value,f=!1,h=u.alias;h&&(i=h[0],cd(n,ud([0,1],h)));for(var P=1,$=!0;P<n.length;P+=1){var x=n[P],s=hr(x,0,1),p=hr(x,-1);if((s==='"'||s==="'"||s==="`"||p==='"'||p==="'"||p==="`")&&s!==p)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),i+="."+x,c="%"+i+"%",yr(Oe,c))d=Oe[c];else if(d!=null){if(!(x in d)){if(!r)throw new He("base intrinsic for "+t+" exists, but the property is not available.");return}if(Dt&&P+1>=n.length){var g=Dt(d,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?d=g.get:d=d[x]}else $=yr(d,x),d=d[x];$&&!f&&(Oe[c]=d)}}return d},"GetIntrinsic")});var Ms=E((Mz,Us)=>{"use strict";var gd=gn();Us.exports=o(function(){return gd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Fs=E((Lz,Ls)=>{"use strict";var yd=Cs(),js=yd("%Object.defineProperty%",!0),hd=Ms()(),vd=Pn(),xd=dr(),vr=hd?Symbol.toStringTag:null;Ls.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 xd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");vr&&(n||!vd(t,vr))&&(js?js(t,vr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[vr]=r)},"setToStringTag")});var Vs=E((Bz,Bs)=>{"use strict";var Pd=Function.prototype.call,_d=Object.prototype.hasOwnProperty,bd=Be();Bs.exports=bd.call(Pd,_d)});var Hs=E((Vz,Zs)=>{"use strict";Zs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Gs=E((Zz,Ws)=>{"use strict";var $n=Ki(),Td=require("util"),Tn=require("path"),Id=require("http"),Ed=require("https"),$d=require("url").parse,Sd=require("fs"),Ad=require("stream").Stream,zd=require("crypto"),In=ta(),Od=va(),kd=Fs(),Ie=Vs(),En=Hs();function qs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(qs,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],$n.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Td.inherits(L,$n);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=$n.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Ie(t,"httpVersion"))&&!(t instanceof Ad))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){Ie(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Sd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Ie(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Ie(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+qs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&En(c,r.header);var d;for(var f in c)if(Ie(c,f)){if(d=c[f],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=f+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=Tn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Tn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Ie(e,"httpVersion")&&(r=Tn.basename(e.client._httpMessage.path||"")),r)return'filename="'+qs(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=In.lookup(e.name)),!r&&e&&e.path&&(r=In.lookup(e.path)),!r&&e&&e.readable&&Ie(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=In.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Ie(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+zd.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Od.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=$d(e),n=En({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=En(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Ed.request(n):r=Id.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var d,f=o(function(h,P){return r.removeListener("error",f),r.removeListener("response",d),t.call(this,h,P)},"callback");d=f.bind(this,null),r.on("error",f),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};kd(L.prototype,"FormData");Ws.exports=L});var qd={};kn(qd,{polydoc:()=>Hd});module.exports=hu(qd);var vu=Object.freeze({status:"aborted"});function T(e,t,r){function n(d,f){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,f);let h=c.prototype,P=Object.keys(h);for(let $=0;$<P.length;$++){let x=P[$];x in d||(d[x]=h[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(d){var f;let h=r?.Parent?new u:this;n(h,d),(f=h._zod).deferred??(f.deferred=[]);for(let P of h._zod.deferred)P();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var xu=Symbol("zod_brand"),ae=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},br={};function ce(e){return e&&Object.assign(br,e),br}o(ce,"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 Dn(e,t){return typeof t=="bigint"?t.toString():t}o(Dn,"jsonStringifyReplacer");function Ft(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Ft,"cached");function Nn(e){return e==null}o(Nn,"nullish");function Bt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Bt,"cleanRegex");var Rn=Symbol("evaluating");function G(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Rn)return n===void 0&&(n=Rn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(G,"defineLazy");var Er="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function mt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(mt,"isObject");var Pu=Ft(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Cn(e){if(mt(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(mt(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Cn,"isPlainObject");var Un=new Set(["string","number","symbol"]);function we(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(we,"escapeRegex");function Vt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Vt,"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 Mn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Mn,"optionalKeys");var _u={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 Re(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(Re,"aborted");function he(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(he,"prefixIssues");function Lt(e){return typeof e=="string"?e:e?.message}o(Lt,"unwrapMessage");function ve(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Lt(e.inst?._zod.def?.error?.(e))??Lt(t?.error?.(e))??Lt(r.customError?.(e))??Lt(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 jn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(jn,"getLengthableOrigin");function $r(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o($r,"issue");var Ln=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,Dn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Fn=T("$ZodError",Ln),ft=T("$ZodError",Ln,{Parent:Error});var Tu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new ae;if(c.issues.length){let d=new(i?.Err??e)(c.issues.map(f=>ve(f,u,ce())));throw Er(d,i?.callee),d}return c.value},"_parse"),Zt=Tu(ft),Iu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let d=new(i?.Err??e)(c.issues.map(f=>ve(f,u,ce())));throw Er(d,i?.callee),d}return c.value},"_parseAsync"),Ht=Iu(ft),Eu=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??Fn)(u.issues.map(c=>ve(c,i,ce())))}:{success:!0,data:u.value}},"_safeParse"),gt=Eu(ft),$u=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>ve(c,i,ce())))}:{success:!0,data:u.value}},"_safeParseAsync"),yt=$u(ft);var Su="(?:(?:\\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])))",Au=new RegExp(`^${Su}$`);var Bn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Vn=/^-?\d+n?$/;var Sr=/^-?\d+(?:\.\d+)?$/,Zn=/^(?:true|false)$/i;var De=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Hn=T("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Nn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=jn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var Ar=T("$ZodCheckStringFormat",(e,t)=>{var r,n;De.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=()=>{})}),qn=T("$ZodCheckRegex",(e,t)=>{Ar.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 Gn={major:4,minor:3,patch:6};var H=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Gn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,d,f)=>{let h=Re(c),P;for(let $ of d){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ae;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Re(c,x)))});else{if(c.issues.length===x)continue;h||(h=Re(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,d,f)=>{if(Re(c))return c.aborted=!0,c;let h=i(d,n,f);if(h instanceof Promise){if(f.async===!1)throw new ae;return h.then(P=>e._zod.parse(P,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,d)=>{if(d.skipChecks)return e._zod.parse(c,d);if(d.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,c,d)):u(h,c,d)}let f=e._zod.parse(c,d);if(f instanceof Promise){if(d.async===!1)throw new ae;return f.then(h=>i(h,n,d))}return i(f,n,d)}}G(e,"~standard",()=>({validate:o(i=>{try{let u=gt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return yt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Gt=T("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Bn(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}}),zr=T("$ZodStringFormat",(e,t)=>{Ar.init(e,t),Gt.init(e,t)});var Qn=T("$ZodURL",(e,t)=>{zr.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 eo=T("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sr,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 Or=T("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Zn,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}}),to=T("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Vn,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 ro=T("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),no=T("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var oo=T("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),io=T("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Jn(e,t,r){e.issues.length&&t.issues.push(...he(r,e.issues)),t.value[r]=e.value}o(Jn,"handleArrayResult");var ao=T("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let d=i[c],f=t.element._zod.run({value:d,issues:[]},n);f instanceof Promise?u.push(f.then(h=>Jn(h,r,c))):Jn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...he(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Wt,"handlePropertyResult");function zu(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=Mn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(zu,"normalizeDef");function Ou(e,t,r,n,i,u){let c=[],d=i.keySet,f=i.catchall._zod,h=f.def.type,P=f.optout==="optional";for(let $ in t){if(d.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Wt(s,r,$,t,P))):Wt(x,r,$,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Ou,"handleCatchall");var so=T("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...d};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Ft(()=>zu(t));G(e._zod,"propValues",()=>{let d=t.shape,f={};for(let h in d){let P=d[h]._zod;if(P.values){f[h]??(f[h]=new Set);for(let $ of P.values)f[h].add($)}}return f});let i=mt,u=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let P=[],$=c.shape;for(let x of c.keys){let s=$[x],p=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?P.push(g.then(m=>Wt(m,d,x,h,p))):Wt(g,d,x,h,p)}return u?Ou(P,h,d,f,n.value,e):P.length?Promise.all(P).then(()=>d):d}});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=>!Re(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>ve(c,n,ce())))}),t)}o(Kn,"handleUnionResults");var kr=T("$ZodUnion",(e,t)=>{H.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=>Bt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,d=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)d.push(h),c=!0;else{if(h.issues.length===0)return h;d.push(h)}}return c?Promise.all(d).then(f=>Kn(f,i,e,u)):Kn(d,i,e,u)}});var uo=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,kr.init(e,t);let r=e._zod.parse;G(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,f]of Object.entries(c)){i[d]||(i[d]=new Set);for(let h of f)i[d].add(h)}}return i});let n=Ft(()=>{let i=t.options,u=new Map;for(let c of i){let d=c._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of d){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!mt(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let d=n.value.get(c?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var co=T("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Cn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let d=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...he(h,$.issues)),r.value[h]=$.value})):(P.issues.length&&r.issues.push(...he(h,P.issues)),r.value[h]=P.value)}let f;for(let h in i)d.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let f=t.keyType._zod.run({value:d,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&Sr.test(d)&&f.issues.length){let $=t.keyType._zod.run({value:Number(d),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>ve($,n,ce())),input:d,path:[d],inst:e});continue}let P=t.valueType._zod.run({value:i[d],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...he(d,$.issues)),r.value[f.value]=$.value})):(P.issues.length&&r.issues.push(...he(d,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var lo=T("$ZodEnum",(e,t)=>{H.init(e,t);let r=Ir(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Un.has(typeof i)).map(i=>typeof i=="string"?we(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),po=T("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?we(n):n?we(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 mo=T("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ae;return r.value=i,r}});function Xn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Xn,"handleOptionalResult");var fo=T("$ZodOptional",(e,t)=>{H.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(`^(${Bt(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=>Xn(u,r.value)):Xn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var go=T("$ZodNullable",(e,t)=>{H.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(`^(${Bt(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 yo=T("$ZodPipe",(e,t)=>{H.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(c=>qt(c,t.in,n)):qt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>qt(u,t.out,n)):qt(i,t.out,n)}});function qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(qt,"handlePipeResult");var ho=T("$ZodCustom",(e,t)=>{De.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Yn(u,r,n,e));Yn(i,r,n,e)}});function Yn(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($r(i))}}o(Yn,"handleRefineResult");var xo,Du=Symbol("ZodOutput"),Nu=Symbol("ZodInput"),wr=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 Po(){return new wr}o(Po,"registry");(xo=globalThis).__zod_globalRegistry??(xo.__zod_globalRegistry=Po());var Rr=globalThis.__zod_globalRegistry;function _o(e,t){return new e({type:"string",...Z(t)})}o(_o,"_string");function bo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(bo,"_coercedString");function To(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(To,"_url");function Io(e,t){return new e({type:"number",checks:[],...Z(t)})}o(Io,"_number");function Eo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(Eo,"_coercedNumber");function $o(e,t){return new e({type:"boolean",...Z(t)})}o($o,"_boolean");function So(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(So,"_coercedBoolean");function Ao(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(Ao,"_coercedBigint");function zo(e){return new e({type:"any"})}o(zo,"_any");function Oo(e){return new e({type:"unknown"})}o(Oo,"_unknown");function ko(e,t){return new e({type:"void",...Z(t)})}o(ko,"_void");function wo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(wo,"_coercedDate");function oe(e,t){return new Hn({check:"min_length",...Z(t),minimum:e})}o(oe,"_minLength");function xe(e,t){return new qn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(xe,"_regex");function Ro(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Ro,"_custom");var J=T("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Zt(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>gt(e,r,n),e.parseAsync=async(r,n)=>Ht(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>yt(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)=>Vt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Kt=T("ZodMiniString",(e,t)=>{Gt.init(e,t),J.init(e,t)});function a(e){return _o(Kt,e)}o(a,"string");var Do=T("ZodMiniStringFormat",(e,t)=>{zr.init(e,t),Kt.init(e,t)});var Hu=T("ZodMiniURL",(e,t)=>{Qn.init(e,t),Do.init(e,t)});function No(e){return To(Hu,e)}o(No,"url");var Dr=T("ZodMiniNumber",(e,t)=>{eo.init(e,t),J.init(e,t)});function X(e){return Io(Dr,e)}o(X,"number");var Nr=T("ZodMiniBoolean",(e,t)=>{Or.init(e,t),J.init(e,t)});function B(e){return $o(Nr,e)}o(B,"boolean");var Co=T("ZodMiniBigInt",(e,t)=>{to.init(e,t),J.init(e,t)});var qu=T("ZodMiniAny",(e,t)=>{ro.init(e,t),J.init(e,t)});function vt(){return zo(qu)}o(vt,"any");var Wu=T("ZodMiniUnknown",(e,t)=>{no.init(e,t),J.init(e,t)});function k(){return Oo(Wu)}o(k,"unknown");var Gu=T("ZodMiniVoid",(e,t)=>{oo.init(e,t),J.init(e,t)});function Uo(e){return ko(Gu,e)}o(Uo,"_void");var Mo=T("ZodMiniDate",(e,t)=>{io.init(e,t),J.init(e,t)});var Ju=T("ZodMiniArray",(e,t)=>{ao.init(e,t),J.init(e,t)});function D(e,t){return new Ju({type:"array",element:e,...Z(t)})}o(D,"array");var Ku=T("ZodMiniObject",(e,t)=>{so.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 Ku(r)}o(l,"object");var Xu=T("ZodMiniUnion",(e,t)=>{kr.init(e,t),J.init(e,t)});function N(e,t){return new Xu({type:"union",options:e,...Z(t)})}o(N,"union");var Yu=T("ZodMiniDiscriminatedUnion",(e,t)=>{uo.init(e,t),J.init(e,t)});function Ne(e,t,r){return new Yu({type:"union",options:t,discriminator:e,...Z(r)})}o(Ne,"discriminatedUnion");var Qu=T("ZodMiniRecord",(e,t)=>{co.init(e,t),J.init(e,t)});function w(e,t,r){return new Qu({type:"record",keyType:e,valueType:t,...Z(r)})}o(w,"record");var ec=T("ZodMiniEnum",(e,t)=>{lo.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 ec({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var tc=T("ZodMiniLiteral",(e,t)=>{po.init(e,t),J.init(e,t)});function S(e,t){return new tc({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o(S,"literal");var rc=T("ZodMiniTransform",(e,t)=>{mo.init(e,t),J.init(e,t)});function Pe(e){return new rc({type:"transform",transform:e})}o(Pe,"transform");var nc=T("ZodMiniOptional",(e,t)=>{fo.init(e,t),J.init(e,t)});function y(e){return new nc({type:"optional",innerType:e})}o(y,"optional");var oc=T("ZodMiniNullable",(e,t)=>{go.init(e,t),J.init(e,t)});function xt(e){return new oc({type:"nullable",innerType:e})}o(xt,"nullable");var ic=T("ZodMiniPipe",(e,t)=>{yo.init(e,t),J.init(e,t)});function _e(e,t){return new ic({type:"pipe",in:e,out:t})}o(_e,"pipe");var ac=T("ZodMiniCustom",(e,t)=>{ho.init(e,t),J.init(e,t)});function Xt(e,t){return Ro(ac,e??(()=>!0),t)}o(Xt,"custom");var Pt={};kn(Pt,{bigint:()=>mc,boolean:()=>dc,date:()=>fc,number:()=>pc,string:()=>lc});function lc(e){return bo(Kt,e)}o(lc,"string");function pc(e){return Eo(Dr,e)}o(pc,"number");function dc(e){return So(Nr,e)}o(dc,"boolean");function mc(e){return Ao(Co,e)}o(mc,"bigint");function fc(e){return wo(Mo,e)}o(fc,"date");var Ur=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),Cr=class{constructor(t,r,n,i,u,c,d,f,h,P,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=d;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=P;this.aiMetadata=$}static{o(this,"IAction")}},be=o(e=>new Cr(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:y(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:y(vt())}),"TPropertyValue");var ee=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),le=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Lo=l({label:a(),value:k()}),Yt=l({disabled:y(B()),placeholder:y(a()),options:D(Lo)});var te=l({...F.shape,options:Yt,...C(k(),"STATIC_DROPDOWN").shape}),pe=l({...F.shape,options:Yt,...C(D(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Mr=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:D(a())}),_t=l({...F.shape,...C(D(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var de=l({...F.shape,...C(B(),"CHECKBOX").shape});var me=l({...F.shape,...C(X(),"NUMBER").shape});var bt=l({...F.shape,...C(k(),"FILE").shape});var Tt=l({...F.shape,...C(a(),"DATE_TIME").shape});var Fo=w(a(),N([ee,le,te,_t,pe,de,me,bt,Tt])),It=l({...F.shape,properties:Fo,...C(D(k()),"ARRAY").shape});var Et=l({...F.shape,...C(N([w(a(),k())]),"JSON").shape});var Bo=N([ee,te,Et,It,pe]),yc=w(a(),Bo),jr=l({refreshers:D(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Qt=l({...F.shape,...C(Uo(),"MARKDOWN").shape});var $t=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))($t||{}),Ce=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ce||{}),Ue=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ue||{});var St=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(St||{}),Lr="both_client_credentials_and_authorization_code";var $e=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))($e||{}),At=(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))(At||{}),hc=l({strategy:U(At),paramName:y(a())}),zt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(zt||{});var er=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(er||{}),Vo=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Zo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(er))}),Ho=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Vo,handlerId:y(a()),streamStepProgress:y(U(er))}),vc=N([Zo,Ho]);var xc=l({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function fe(e){return e==null}o(fe,"isNil");function Ot(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(Ot,"isEmpty");function tr(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(tr,"assertNotNullOrUndefined");var Fr=ke(require("crypto"),1);var Pc=128,Se,Me,_c=o(e=>{!Se||Se.length<e?(Se=Buffer.allocUnsafe(e*Pc),Fr.default.randomFillSync(Se),Me=0):Me+e>Se.length&&(Fr.default.randomFillSync(Se),Me=0),Me+=e},"fillPool"),bc=o(e=>(_c(e|=0),Se.subarray(Me-e,Me)),"random"),Tc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let d=r(i),f=i;for(;f--;)if(c+=e[d[f]&n]||"",c.length===u)return c}}},"customRandom"),Wo=o((e,t=21)=>Tc(e,t,bc),"customAlphabet");var Ic="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Go=21,zb=a().check(xe(new RegExp(`^[0-9a-zA-Z]{${Go}}$`))),Ec=Wo(Ic,Go);var Te=_e(Pe(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Te,updated:Te},V=o(e=>y(xt(e)),"Nullable");function Br(e){return y(xt(U(e)))}o(Br,"NullableEnum");var wb=_e(Pe(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),rr=o(e=>_e(Pe(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(D(e))),"OptionalArrayFromQuery");var Nb=w(a(),k());var kt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(kt||{});var Wb=a().check(xe(/^#[0-9A-Fa-f]{6}$/));var Jb=l({filename:a(),data:k(),type:S("file"),mimetype:y(a())});var $c=ke(Ko());var rT=l({...re,name:a(),permissions:D(a()),platformId:V(a()),type:a(),userCount:y(X())});var Xo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Xo||{}),Vr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Vr||{}),Zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Zr||{});var Hr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Hr||{});var qr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(qr||{});var Sc=l({mode:U(Xo),value:k()}),Ac=l({auth:y(a()),fields:w(a(),Sc)}),zc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Ac)}),Oc=l({type:S("PIECE"),toolName:a().check(oe(1)),pieceMetadata:zc}),kc=l({type:S("none")}),wc=l({type:S("access_token"),accessToken:a()}),Rc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Dc=l({type:S("headers"),headers:w(a(),a())}),Nc=Ne("type",[kc,wc,Rc,Dc]),Yo=l({type:S("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:y(a())}),Qo=l({type:S("MCP"),toolName:a().check(oe(1)),serverUrl:No(),protocol:U(Zr),auth:Nc}),ei=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:U(Vr),sourceId:a(),sourceName:a()}),Cc=Ne("type",[Oc,Yo,Qo,ei]),Uc=l({displayName:a(),description:y(a()),type:U(Hr)}),ti=l({type:S("MARKDOWN"),markdown:a()}),je={type:S("TOOL_CALL"),input:V(w(a(),k())),output:y(k()),toolName:a(),status:U(qr),toolCallId:a(),startTime:a(),endTime:y(a())},zT=l(je),ri=Ne("toolCallType",[l({...je,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:S("UNKNOWN"),displayName:a()})]),Mc=N([ti,ri]);var Wr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Wr||{}),ge=l({apiKey:a()}),jc=ge,Lc=l({apiKey:a(),apiKeyHash:a()}),Fc=ge,Bc=ge,Vc=ge,Zc=ge,Hc=ge,qc=ge,Wc=ge,ni=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),Gc=l({}),Jc=l({}),Kc=l({}),Xc=l({}),Yc=l({}),Qc=l({}),oi=l({modelId:a(),modelName:a(),modelType:U(Wr)}),ii=l({apiKeyHeader:a(),baseUrl:a(),models:D(oi),defaultHeaders:y(w(a(),a()))}),ai=l({accountId:a(),gatewayId:a(),models:D(oi),vertexProject:y(a()),vertexRegion:y(a())}),si=l({resourceName:a(),apiVersion:_e(Pe(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),ui=l({region:a().check(oe(1))}),el=N([jc,Vc,Zc,Hc,qc,Bc,Fc,Lc,ni,Wc]),ci=N([ii,ai,si,ui,Gc,Kc,Xc,Yc,Jc,Qc]),tl=l({id:a(),name:a(),type:U(Wr)}),rl=l({id:a(),name:a(),provider:U(kt),config:ci,enabledForChat:B()}),nl=l({provider:U(kt),config:ci,auth:el,platformId:a()});var RT={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var ol=l({base64Url:a(),fileName:a(),extension:y(a())}),il=l({mimeType:a(),url:a(),fileName:y(a())}),Gr=N([ol,il]);var al=N([l({type:S("file"),value:Gr}),l({type:S("markdown"),value:a(),files:y(D(Gr))})]),sl=l({sessionId:a(),message:a(),files:y(D(a()))});var pi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(pi||{}),di=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(di||{}),Jr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Jr||{});var ul=N([l({...re,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:D(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),cl=l({...re,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Br(di),trigger:Br(pi)}),ll=l({...re,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),pl=l({events:D(U(Jr)),webhookUrl:a(),flowId:a()}),dl=l({fields:D(l({id:a(),name:a()})),rows:D(w(a(),a())),name:a()}),ml=l({projectId:a(),limit:y(Pt.number()),cursor:y(a()),name:y(a()),externalIds:rr(a()),folderId:y(a()),folderIds:rr(a())}),fl=l({records:D(D(l({fieldId:a(),value:fi()}))),tableId:a()}),gl=l({cells:y(D(l({fieldId:a(),value:fi()}))),tableId:a(),agentUpdate:y(B())}),mi=Ne("operator",[Ae("eq"),Ae("neq"),Ae("gt"),Ae("gte"),Ae("lt"),Ae("lte"),Ae("co"),li("exists"),li("not_exists")]),yl=l({tableId:a(),limit:y(Pt.number()),cursor:y(a()),filters:rr(mi)});function fi(){return _e(Pe(e=>e==null?e:String(e)),xt(a()))}o(fi,"coerceToString");function Ae(e){return l({fieldId:a(),operator:S(e),value:a()})}o(Ae,"valueFilter");function li(e){return l({fieldId:a(),operator:S(e)})}o(li,"existenceFilter");var hl=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),vl=l({...re,deleted:V(Te),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var gi=l({name:a(),description:y(a()),type:a(),required:B()}),xl=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:D(gi),returnsResponse:B()})});var yi="^[0-9]+\\.[0-9]+\\.[0-9]+$",YT=new RegExp(yi),_l="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",QT=a().check(xe(new RegExp(yi))),eI=a().check(xe(new RegExp(_l))),bl=l({packageType:S("ARCHIVE"),pieceType:U(Ce),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),hi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),vi=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),tI=N([hi,vi]),rI=N([bl,hi,vi]),xi=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(xi||{}),Tl=l({type:U(xi),cronExpression:a(),timezone:a()}),nI=l({...re,type:U($e),projectId:a(),flowId:a(),triggerName:a(),schedule:V(Tl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),Pi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(Pi||{}),_i=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(_i||{}),bi=(r=>(r.S3="S3",r.DB="DB",r))(bi||{}),oI=l({...re,projectId:V(a()),platformId:V(a()),type:U(Pi),compression:U(_i),data:y(k()),location:U(bi),size:V(X()),fileName:V(a()),s3Key:V(a()),metadata:V(w(a(),a()))}),Ti=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ti||{}),Ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ii||{}),iI=l({id:a(),email:a(),firstName:a(),status:U(Ii),externalId:V(a()),platformId:V(a()),platformRole:U(Ti),lastName:a(),created:Te,updated:Te,lastActiveDate:V(Te),imageUrl:V(a())});var Kr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var Ai=l({...F.shape,...C(a(),"COLOR").shape});var Xr=N([ee,le,Qt,de,te,pe,Mr,_t,jr,me,It,Kr,Et,Tt,bt,Ai]),b={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var se=l({displayName:a(),description:y(a())});var zi=l({username:a(),password:a()}),Yr=l({...se.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(zi,"BASIC_AUTH").shape});var Sl=w(a(),N([ee,le,me,de,te])),Qr=l({...se.shape,props:Sl,...C(k(),"CUSTOM_AUTH").shape});var ze=l({...se.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Al=w(a(),N([ee,le,ze,me,de,te,pe,Qt])),Oi=l({...se.shape,props:Al,...C(k(),"OIDC").shape});var en=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(en||{}),ki=N([ee,ze,te]),wi=w(a(),ki),zl=l({props:y(w(a(),ki)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:y(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(B()),pkceMethod:y(N([S("plain"),S("S256")])),authorizationMethod:y(U(en)),grantType:y(N([U(St),S(Lr)])),extra:y(w(a(),a()))}),Ri=l({access_token:a(),props:y(wi),data:w(a(),vt())}),tn=l({...se.shape,...zl.shape,...C(Ri,"OAUTH2").shape});var Le=N([Yr,Qr,Oi,tn,ze]),wt="Connection",or={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||wt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||wt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||wt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||wt}},None(){}};var UE={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 Ol=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var kl=N([Xr,Le]),rn=w(a(),kl),n$=w(a(),Xr);var Di=N([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var Ni="2",ir="0.82.0";var nn=class{constructor(t,r,n,i,u,c,d,f,h=ir,P,$=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=$;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ni}),"getContextInfo");(!wl(h)||Rl(h,ir))&&(this.minimumSupportedRelease=ir),u.forEach(x=>this._actions[x.name]=x),c.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ci=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 nn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function wl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(wl,"isValidSimpleSemver");function Rl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,d]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<d}o(Rl,"isSemverLessThan");var Dl=y(w(a(),w(a(),a()))),Ui=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:y(a()),directoryPath:y(a()),auth:y(N([Le,D(Le)])),version:a(),categories:y(D(U(Ue))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),i18n:Dl}),Nl=U(["human","ai","both"]),Mi=l({description:y(a()),idempotent:y(B())}),ji=l({name:a(),displayName:a(),description:a(),props:rn,requireAuth:B(),errorHandlingOptions:y(Ur),outputSchema:y(Xt()),audience:y(Nl),aiMetadata:y(Mi)}),Li=l({name:a(),displayName:a(),description:a(),props:rn,errorHandlingOptions:y(Ur),type:U($e),sampleData:k(),handshakeConfiguration:y(Xt()),renewConfiguration:y(Di),testStrategy:U(zt),outputSchema:y(Xt()),aiMetadata:y(Mi)}),Cl=l({...Ui.shape,actions:w(a(),ji),triggers:w(a(),Li)}),Ul=l({...Ui.shape,actions:X(),triggers:X(),suggestedActions:y(D(Li)),suggestedTriggers:y(D(ji))}),Fi=l({projectUsage:X(),tags:y(D(a())),pieceType:U(Ce),packageType:U($t),platformId:y(a()),archiveId:y(a())}),nS=l({...Cl.shape,...Fi.shape}),oS=l({...Ul.shape,...Fi.shape}),iS=l({name:a(),version:a()});var Ml=ke(require("path")),jl=ke(require("fs/promises"));var ar=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var sr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new on,r=new an){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},on=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},an=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 ur=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 cr=class extends ar{static{o(this,"FetchHttpClient")}constructor(t="",r=new sr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[j,Q]of Object.entries(c))i.append(j,Q);let d=i.toString(),f=d?`${n}?${d}`:n,h=t.responseType??"json",P=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:p}=Ll(t.body,u),g=Bl({...u,...s}),m=await Fl(async()=>{let j=new AbortController,Q=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ne={method:t.method.toString(),headers:g,body:x,redirect:P?"follow":"manual",signal:j.signal};return p&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(f,ne)}finally{Q!==void 0&&clearTimeout(Q)}},$),v=P?300:400;if(m.status<200||m.status>=v){let j=await Bi(m,h),Q=new ur(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let _=await Bi(m,h);return{status:m.status,headers:Vl(m.headers),body:_}}};function Ll(e,t){return Hl(e)?{body:void 0,extraHeaders:{},isStream:!1}:Zl(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(Ll,"serializeBody");async function Bi(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(Bi,"parseResponseBody");async function Fl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Vi(n);continue}return i}catch(i){if(r=i,n<t){await Vi(n);continue}throw i}throw r}o(Fl,"sendWithRetries");function Vi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Vi,"backoff");function Bl(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(Bl,"normalizeHeaders");function Vl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Vl,"toHttpHeaders");function Zl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(Zl,"isNodeFormData");function Hl(e){return e==null}o(Hl,"isNil");var Fe=new cr;var Rt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Rt||{});var wd=ke(require("fs")),Js=ke(Gs());var Rd={"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 Dd(e){let t=e.split(";")[0].trim().toLowerCase();return Rd[t]??""}o(Dd,"contentTypeToExtension");var Nd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Cd=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 Ks({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:d,authLocation:f="headers"}){return be({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:b.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:b.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Cd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:b.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Rt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:b.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:b.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:b.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:b.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,$={};switch(P){case"none":break;case"json":$.data=b.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=b.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=b.Array({displayName:"Form Data",required:!0,properties:{fieldName:b.ShortText({displayName:"Field Name",required:!0}),fieldType:b.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:b.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:b.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:b.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:b.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:b.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:b.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:P,url:$,headers:x,queryParams:s,body:p,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:j}=h.propsValue;tr(P,"Method"),tr($,"URL");let Q=fe(r)?{}:await r(h.auth,h.propsValue),ne=$.url,pt=ne.startsWith("http://")||ne.startsWith("https://")?ne:Nd({baseUrl:t(h.auth),relativePath:ne}),Ee={method:P,url:pt,headers:{...x??{},...f==="headers"||!fe(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(_&&(Ee.responseType="arraybuffer"),p)if(g&&g!=="none"){let ue=p.data;if(g==="form_data"){let pu=ue,Mt=new Js.default;for(let{fieldName:An,fieldType:zn,textFieldValue:On,fileFieldValue:_r}of pu)zn==="text"&&!Ot(On)?Mt.append(An,On):zn==="file"&&!Ot(_r)&&Mt.append(An,_r.data,{filename:_r?.filename});Ee.body=Mt,Ee.headers={...Ee.headers,...Mt.getHeaders()}}else Ee.body=ue}else g||(Ee.body=p);try{let ue=await Fe.sendRequest(Ee);return await Ud(h.files,ue.body,ue.status,ue.headers,_)}catch(ue){if(m)return ue.errorMessage();throw ue}},"run")})}o(Ks,"createCustomApiCallAction");var Ud=o(async(e,t,r,n,i)=>{let u;if(i&&Md(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=Dd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Md=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var xr="https://api.polydoc.tech",Xs="/pdf/convert",Pr="/screenshot/convert",Ys=[{label:"URL (render a web page)",value:"url"},{label:"HTML (render an inline HTML string)",value:"html"},{label:"Template (render a saved PolyDoc template by ID)",value:"template"}],Qs=[{label:"Download (return the file)",value:"download"},{label:"Cloud Storage (upload to a presigned URL)",value:"cloudStorage"},{label:"Webhook (deliver the file to a URL)",value:"webhook"}],eu=["A3","A4","A5","Ledger","Legal","Letter","Tabloid"],tu=["png","jpeg","webp"],ru=[{label:"Binary file (write the image to a file)",value:"binaryFile"},{label:"Base64 (return the image as a base64 string)",value:"base64"}],nu=[{label:"ZUGFeRD (Germany / EU)",value:"zugferd"},{label:"Factur-X (France / EU)",value:"facturx"}],ou=["minimum","basicwl","basic","en16931","extended"];var jd=`Get an API key from the PolyDoc dashboard (dashboard.polydoc.tech, API Keys). It is sent as Authorization: Bearer <key>.
1
+ "use strict";var Eu=Object.create;var mt=Object.defineProperty;var Su=Object.getOwnPropertyDescriptor;var $u=Object.getOwnPropertyNames;var Au=Object.getPrototypeOf,zu=Object.prototype.hasOwnProperty;var o=(e,t)=>mt(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Dn=(e,t)=>{for(var r in t)mt(e,r,{get:t[r],enumerable:!0})},Nn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $u(t))!zu.call(e,i)&&i!==r&&mt(e,i,{get:()=>t[i],enumerable:!(n=Su(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?Eu(Au(e)):{},Nn(t||!e||!e.__esModule?mt(r,"default",{value:e,enumerable:!0}):r,e)),Ou=e=>Nn(mt({},"__esModule",{value:!0}),e);var ii=E((oi,ar)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(p.zoneIndex)||[])[0],_,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,_=":";L--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let Q=s.split(":"),ne=[];for(let dt=0;dt<Q.length;dt++)ne.push(parseInt(Q[dt],16));return ne})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function h(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(h,"matchCIDR");function P(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(P,"parseIntAuto");function $(s,d){for(;s.length<d;)s=`0${s}`;return s}o($,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,L;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(L=m[_],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let L=0;L<v.length;L++)g=v[L],_.push(P(g));return _})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push($(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,_,L;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return f(s,8);if((m=s.match(p.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,_,L;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(L=_[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return g},typeof ar<"u"&&ar.exports?ar.exports=x:e.ipaddr=x})(oi)});var ia=E((GA,oa)=>{var na=require("stream").Stream,pp=require("util");oa.exports=ae;function ae(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ae,"DelayedStream");pp.inherits(ae,na);ae.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(ae.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ae.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ae.prototype.resume=function(){this._released||this.release(),this.source.resume()};ae.prototype.pause=function(){this.source.pause()};ae.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ae.prototype.pipe=function(){var e=na.prototype.pipe.apply(this,arguments);return this.resume(),e};ae.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)};ae.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 ca=E((WA,ua)=>{var dp=require("util"),sa=require("stream").Stream,aa=ia();ua.exports=q;function q(){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(q,"CombinedStream");dp.inherits(q,sa);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof aa)){var r=aa.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};q.prototype.pipe=function(e,t){return sa.prototype.pipe.call(this,e,t),this.resume(),e};q.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}};q.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=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.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()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.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")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.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)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var pa=E((KA,la)=>{"use strict";la.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 fa=E(Y=>{"use strict";var mr=pa(),mp=require("path").extname,da=/^\s*([^;\s]*)(?:;|\s|$)/,fp=/^text\//i;Y.charset=ma;Y.charsets={lookup:ma};Y.contentType=gp;Y.extension=yp;Y.extensions=Object.create(null);Y.lookup=hp;Y.types=Object.create(null);vp(Y.extensions,Y.types);function ma(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&mr[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&fp.test(t[1])?"UTF-8":!1}o(ma,"charset");function gp(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(gp,"contentType");function yp(e){if(!e||typeof e!="string")return!1;var t=da.exec(e),r=t&&Y.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(yp,"extension");function hp(e){if(!e||typeof e!="string")return!1;var t=mp("x."+e).toLowerCase().substr(1);return t&&Y.types[t]||!1}o(hp,"lookup");function vp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(mr).forEach(o(function(i){var u=mr[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var h=r.indexOf(mr[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(h>P||h===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(vp,"populateMaps")});var ya=E((QA,ga)=>{ga.exports=xp;function xp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(xp,"defer")});var ln=E((tz,va)=>{var ha=ya();va.exports=Pp;function Pp(e){var t=!1;return ha(function(){t=!0}),o(function(n,i){t?e(n,i):ha(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Pp,"async")});var pn=E((nz,xa)=>{xa.exports=_p;function _p(e){Object.keys(e.jobs).forEach(bp.bind(e)),e.jobs={}}o(_p,"abort");function bp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(bp,"clean")});var dn=E((iz,_a)=>{var Pa=ln(),Tp=pn();_a.exports=Ip;function Ip(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Ep(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Tp(r):r.results[i]=c,n(u,r.results))})}o(Ip,"iterate");function Ep(e,t,r,n){var i;return e.length==2?i=e(r,Pa(n)):i=e(r,t,Pa(n)),i}o(Ep,"runJob")});var mn=E((sz,ba)=>{ba.exports=Sp;function Sp(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(Sp,"state")});var fn=E((cz,Ta)=>{var $p=pn(),Ap=ln();Ta.exports=zp;function zp(e){Object.keys(this.jobs).length&&(this.index=this.size,$p(this),Ap(e)(null,this.results))}o(zp,"terminator")});var Ea=E((pz,Ia)=>{var Op=dn(),kp=mn(),wp=fn();Ia.exports=Rp;function Rp(e,t,r){for(var n=kp(e);n.index<(n.keyedList||e).length;)Op(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return wp.bind(n,r)}o(Rp,"parallel")});var gn=E((mz,fr)=>{var Sa=dn(),Dp=mn(),Np=fn();fr.exports=Cp;fr.exports.ascending=$a;fr.exports.descending=Up;function Cp(e,t,r,n){var i=Dp(e,r);return Sa(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){Sa(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Np.bind(i,n)}o(Cp,"serialOrdered");function $a(e,t){return e<t?-1:e>t?1:0}o($a,"ascending");function Up(e,t){return-1*$a(e,t)}o(Up,"descending")});var za=E((gz,Aa)=>{var Mp=gn();Aa.exports=Lp;function Lp(e,t,r){return Mp(e,t,null,r)}o(Lp,"serial")});var ka=E((hz,Oa)=>{Oa.exports={parallel:Ea(),serial:za(),serialOrdered:gn()}});var yn=E((vz,wa)=>{"use strict";wa.exports=Object});var Da=E((xz,Ra)=>{"use strict";Ra.exports=Error});var Ca=E((Pz,Na)=>{"use strict";Na.exports=EvalError});var Ma=E((_z,Ua)=>{"use strict";Ua.exports=RangeError});var ja=E((bz,La)=>{"use strict";La.exports=ReferenceError});var Ba=E((Tz,Fa)=>{"use strict";Fa.exports=SyntaxError});var gr=E((Iz,Va)=>{"use strict";Va.exports=TypeError});var Ha=E((Ez,Za)=>{"use strict";Za.exports=URIError});var qa=E((Sz,Ga)=>{"use strict";Ga.exports=Math.abs});var Ja=E(($z,Wa)=>{"use strict";Wa.exports=Math.floor});var Xa=E((Az,Ka)=>{"use strict";Ka.exports=Math.max});var Qa=E((zz,Ya)=>{"use strict";Ya.exports=Math.min});var ts=E((Oz,es)=>{"use strict";es.exports=Math.pow});var ns=E((kz,rs)=>{"use strict";rs.exports=Math.round});var is=E((wz,os)=>{"use strict";os.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var ss=E((Dz,as)=>{"use strict";var jp=is();as.exports=o(function(t){return jp(t)||t===0?t:t<0?-1:1},"sign")});var cs=E((Cz,us)=>{"use strict";us.exports=Object.getOwnPropertyDescriptor});var hn=E((Uz,ls)=>{"use strict";var yr=cs();if(yr)try{yr([],"length")}catch{yr=null}ls.exports=yr});var ds=E((Mz,ps)=>{"use strict";var hr=Object.defineProperty||!1;if(hr)try{hr({},"a",{value:1})}catch{hr=!1}ps.exports=hr});var vn=E((Lz,ms)=>{"use strict";ms.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var p=Object.getOwnPropertyDescriptor(t,r);if(p.value!==i||p.enumerable!==!0)return!1}return!0},"hasSymbols")});var ys=E((Fz,gs)=>{"use strict";var fs=typeof Symbol<"u"&&Symbol,Fp=vn();gs.exports=o(function(){return typeof fs!="function"||typeof Symbol!="function"||typeof fs("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Fp()},"hasNativeSymbols")});var xn=E((Vz,hs)=>{"use strict";hs.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Pn=E((Zz,vs)=>{"use strict";var Bp=yn();vs.exports=Bp.getPrototypeOf||null});var _s=E((Hz,Ps)=>{"use strict";var Vp="Function.prototype.bind called on incompatible ",Zp=Object.prototype.toString,Hp=Math.max,Gp="[object Function]",xs=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"),qp=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"),Wp=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");Ps.exports=o(function(t){var r=this;if(typeof r!="function"||Zp.apply(r)!==Gp)throw new TypeError(Vp+r);for(var n=qp(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,xs(n,arguments));return Object(P)===P?P:this}return r.apply(t,xs(n,arguments))},"binder"),c=Hp(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+Wp(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ve=E((qz,bs)=>{"use strict";var Jp=_s();bs.exports=Function.prototype.bind||Jp});var vr=E((Wz,Ts)=>{"use strict";Ts.exports=Function.prototype.call});var _n=E((Jz,Is)=>{"use strict";Is.exports=Function.prototype.apply});var Ss=E((Kz,Es)=>{"use strict";Es.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var As=E((Xz,$s)=>{"use strict";var Kp=Ve(),Xp=_n(),Yp=vr(),Qp=Ss();$s.exports=Qp||Kp.call(Yp,Xp)});var Os=E((Yz,zs)=>{"use strict";var ed=Ve(),td=gr(),rd=vr(),nd=As();zs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new td("a function is required");return nd(ed,rd,t)},"callBindBasic")});var Cs=E((eO,Ns)=>{"use strict";var od=Os(),ks=hn(),Rs;try{Rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var bn=!!Rs&&ks&&ks(Object.prototype,"__proto__"),Ds=Object,ws=Ds.getPrototypeOf;Ns.exports=bn&&typeof bn.get=="function"?od([bn.get]):typeof ws=="function"?o(function(t){return ws(t==null?t:Ds(t))},"getDunder"):!1});var Fs=E((rO,js)=>{"use strict";var Us=xn(),Ms=Pn(),Ls=Cs();js.exports=Us?o(function(t){return Us(t)},"getProto"):Ms?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ms(t)},"getProto"):Ls?o(function(t){return Ls(t)},"getProto"):null});var Tn=E((oO,Bs)=>{"use strict";var id=Function.prototype.call,ad=Object.prototype.hasOwnProperty,sd=Ve();Bs.exports=sd.call(id,ad)});var Js=E((iO,Ws)=>{"use strict";var M,ud=yn(),cd=Da(),ld=Ca(),pd=Ma(),dd=ja(),qe=Ba(),Ge=gr(),md=Ha(),fd=qa(),gd=Ja(),yd=Xa(),hd=Qa(),vd=ts(),xd=ns(),Pd=ss(),Gs=Function,In=o(function(e){try{return Gs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),Nt=hn(),_d=ds(),En=o(function(){throw new Ge},"throwTypeError"),bd=Nt?(function(){try{return arguments.callee,En}catch{try{return Nt(arguments,"callee").get}catch{return En}}})():En,Ze=ys()(),K=Fs(),Td=Pn(),Id=xn(),qs=_n(),Ct=vr(),He={},Ed=typeof Uint8Array>"u"||!K?M:K(Uint8Array),Re={__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%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%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%":cd,"%eval%":eval,"%EvalError%":ld,"%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%":Gs,"%GeneratorFunction%":He,"%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%":ud,"%Object.getOwnPropertyDescriptor%":Nt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":pd,"%ReferenceError%":dd,"%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%":qe,"%ThrowTypeError%":bd,"%TypedArray%":Ed,"%TypeError%":Ge,"%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%":md,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Ct,"%Function.prototype.apply%":qs,"%Object.defineProperty%":_d,"%Object.getPrototypeOf%":Td,"%Math.abs%":fd,"%Math.floor%":gd,"%Math.max%":yd,"%Math.min%":hd,"%Math.pow%":vd,"%Math.round%":xd,"%Math.sign%":Pd,"%Reflect.getPrototypeOf%":Id};if(K)try{null.error}catch(e){Vs=K(K(e)),Re["%Error.prototype%"]=Vs}var Vs,Sd=o(function e(t){var r;if(t==="%AsyncFunction%")r=In("async function () {}");else if(t==="%GeneratorFunction%")r=In("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=In("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 Re[t]=r,r},"doEval"),Zs={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ut=Ve(),xr=Tn(),$d=Ut.call(Ct,Array.prototype.concat),Ad=Ut.call(qs,Array.prototype.splice),Hs=Ut.call(Ct,String.prototype.replace),Pr=Ut.call(Ct,String.prototype.slice),zd=Ut.call(Ct,RegExp.prototype.exec),Od=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,kd=/\\(\\)?/g,wd=o(function(t){var r=Pr(t,0,1),n=Pr(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return Hs(t,Od,function(u,c,p,f){i[i.length]=p?Hs(f,kd,"$1"):c||u}),i},"stringToPath"),Rd=o(function(t,r){var n=t,i;if(xr(Zs,n)&&(i=Zs[n],n="%"+i[0]+"%"),xr(Re,n)){var u=Re[n];if(u===He&&(u=Sd(n)),typeof u>"u"&&!r)throw new Ge("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ws.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ge("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ge('"allowMissing" argument must be a boolean');if(zd(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=wd(t),i=n.length>0?n[0]:"",u=Rd("%"+i+"%",r),c=u.name,p=u.value,f=!1,h=u.alias;h&&(i=h[0],Ad(n,$d([0,1],h)));for(var P=1,$=!0;P<n.length;P+=1){var x=n[P],s=Pr(x,0,1),d=Pr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!$)&&(f=!0),i+="."+x,c="%"+i+"%",xr(Re,c))p=Re[c];else if(p!=null){if(!(x in p)){if(!r)throw new Ge("base intrinsic for "+t+" exists, but the property is not available.");return}if(Nt&&P+1>=n.length){var g=Nt(p,x);$=!!g,$&&"get"in g&&!("originalValue"in g.get)?p=g.get:p=p[x]}else $=xr(p,x),p=p[x];$&&!f&&(Re[c]=p)}}return p},"GetIntrinsic")});var Xs=E((sO,Ks)=>{"use strict";var Dd=vn();Ks.exports=o(function(){return Dd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var eu=E((cO,Qs)=>{"use strict";var Nd=Js(),Ys=Nd("%Object.defineProperty%",!0),Cd=Xs()(),Ud=Tn(),Md=gr(),_r=Cd?Symbol.toStringTag:null;Qs.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 Md("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");_r&&(n||!Ud(t,_r))&&(Ys?Ys(t,_r,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[_r]=r)},"setToStringTag")});var ru=E((pO,tu)=>{"use strict";var Ld=Function.prototype.call,jd=Object.prototype.hasOwnProperty,Fd=Ve();tu.exports=Fd.call(Ld,jd)});var ou=E((dO,nu)=>{"use strict";nu.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var su=E((mO,au)=>{"use strict";var zn=ca(),Bd=require("util"),Sn=require("path"),Vd=require("http"),Zd=require("https"),Hd=require("url").parse,Gd=require("fs"),qd=require("stream").Stream,Wd=require("crypto"),$n=fa(),Jd=ka(),Kd=eu(),$e=ru(),An=ou();function iu(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(iu,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],zn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Bd.inherits(j,zn);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=zn.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&&$e(t,"httpVersion"))&&!(t instanceof qd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Gd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+iu(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&An(c,r.header);var p;for(var f in c)if($e(c,f)){if(p=c[f],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=f+": "+p.join("; ")+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=Sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=Sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=Sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+iu(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=$n.lookup(e.name)),!r&&e&&e.path&&(r=$n.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=$n.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)$e(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="--------------------------"+Wd.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}Jd.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=Hd(e),n=An({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=An(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Zd.request(n):r=Vd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(h,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,h,P)},"callback");p=f.bind(this,null),r.on("error",f),r.on("response",p)}}.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]"};Kd(j.prototype,"FormData");au.exports=j});var pm={};Dn(pm,{polydoc:()=>lm});module.exports=Ou(pm);var ku=Object.freeze({status:"aborted"});function b(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let h=c.prototype,P=Object.keys(h);for(let $=0;$<P.length;$++){let x=P[$];x in p||(p[x]=h[x].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let h=r?.Parent?new u:this;n(h,p),(f=h._zod).deferred??(f.deferred=[]);for(let P of h._zod.deferred)P();return h}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var se=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},jt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},Er={};function pe(e){return e&&Object.assign(Er,e),Er}o(pe,"config");function $r(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($r,"getEnumValues");function Un(e,t){return typeof t=="bigint"?t.toString():t}o(Un,"jsonStringifyReplacer");function Bt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Bt,"cached");function Mn(e){return e==null}o(Mn,"nullish");function Vt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Vt,"cleanRegex");var Cn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Cn)return n===void 0&&(n=Cn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var Ar="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(ft,"isObject");var wu=Bt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ln(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ft(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Ln,"isPlainObject");var jn=new Set(["string","number","symbol"]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ne,"escapeRegex");function Zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Zt,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function Fn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(Fn,"optionalKeys");var Bn={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 Ce(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(Ce,"aborted");function ve(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(ve,"prefixIssues");function Ft(e){return typeof e=="string"?e:e?.message}o(Ft,"unwrapMessage");function xe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Ft(e.inst?._zod.def?.error?.(e))??Ft(t?.error?.(e))??Ft(r.customError?.(e))??Ft(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(xe,"finalizeIssue");function Vn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Vn,"getLengthableOrigin");function zr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(zr,"issue");var Zn=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,Un,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Hn=b("$ZodError",Zn),gt=b("$ZodError",Zn,{Parent:Error});var Du=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new se;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parse"),Ht=Du(gt),Nu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>xe(f,u,pe())));throw Ar(p,i?.callee),p}return c.value},"_parseAsync"),Gt=Nu(gt),Cu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new se;return u.issues.length?{success:!1,error:new(e??Hn)(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParse"),yt=Cu(gt),Uu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>xe(c,i,pe())))}:{success:!0,data:u.value}},"_safeParseAsync"),ht=Uu(gt);var Mu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Lu=new RegExp(`^${Mu}$`);var Gn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),qn=/^-?\d+n?$/,Wn=/^-?\d+$/,Or=/^-?\d+(?:\.\d+)?$/,Jn=/^(?:true|false)$/i;var Pe=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),ju={number:"number",bigint:"bigint",object:"date"};var Kn=b("$ZodCheckGreaterThan",(e,t)=>{Pe.init(e,t);let r=ju[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Xn=b("$ZodCheckNumberFormat",(e,t)=>{Pe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Bn[t.format];e._zod.onattach.push(c=>{let p=c._zod.bag;p.format=t.format,p.minimum=i,p.maximum=u,r&&(p.pattern=Wn)}),e._zod.check=c=>{let p=c.value;if(r){if(!Number.isInteger(p)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:p,inst:e});return}if(!Number.isSafeInteger(p)){p>0?c.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}p<i&&c.issues.push({origin:"number",input:p,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),p>u&&c.issues.push({origin:"number",input:p,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Yn=b("$ZodCheckMinLength",(e,t)=>{var r;Pe.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Mn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Vn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var kr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Pe.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=()=>{})}),Qn=b("$ZodCheckRegex",(e,t)=>{kr.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 to={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=to;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let h=Ce(c),P;for(let $ of p){if($._zod.def.when){if(!$._zod.def.when(c))continue}else if(h)continue;let x=c.issues.length,s=$._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new se;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(h||(h=Ce(c,x)))});else{if(c.issues.length===x)continue;h||(h=Ce(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ce(c))return c.aborted=!0,c;let h=i(p,n,f);if(h instanceof Promise){if(f.async===!1)throw new se;return h.then(P=>e._zod.parse(P,f))}return e._zod.parse(h,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let h=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return h instanceof Promise?h.then(P=>u(P,c,p)):u(h,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new se;return f.then(h=>i(h,n,p))}return i(f,n,p)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=yt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return ht(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Jt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Gn(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}}),wr=b("$ZodStringFormat",(e,t)=>{kr.init(e,t),Jt.init(e,t)});var ao=b("$ZodURL",(e,t)=>{wr.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 Rr=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??Or,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}}),so=b("$ZodNumberFormat",(e,t)=>{Xn.init(e,t),Rr.init(e,t)}),Dr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=Jn,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}}),uo=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=qn,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 co=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),lo=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var po=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),mo=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function ro(e,t,r){e.issues.length&&t.issues.push(...ve(r,e.issues)),t.value[r]=e.value}o(ro,"handleArrayResult");var fo=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(h=>ro(h,r,c))):ro(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...ve(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Wt,"handlePropertyResult");function Fu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=Fn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Fu,"normalizeDef");function Bu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,h=f.def.type,P=f.optout==="optional";for(let $ in t){if(p.has($))continue;if(h==="never"){c.push($);continue}let x=f.run({value:t[$],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Wt(s,r,$,t,P))):Wt(x,r,$,t,P)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(Bu,"handleCatchall");var go=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...p};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=Bt(()=>Fu(t));W(e._zod,"propValues",()=>{let p=t.shape,f={};for(let h in p){let P=p[h]._zod;if(P.values){f[h]??(f[h]=new Set);for(let $ of P.values)f[h].add($)}}return f});let i=ft,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;p.value={};let P=[],$=c.shape;for(let x of c.keys){let s=$[x],d=s._zod.optout==="optional",g=s._zod.run({value:h[x],issues:[]},f);g instanceof Promise?P.push(g.then(m=>Wt(m,p,x,h,d))):Wt(g,p,x,h,d)}return u?Bu(P,h,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function no(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=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>xe(c,n,pe())))}),t)}o(no,"handleUnionResults");var Nr=b("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(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=>Vt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let h=f._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)p.push(h),c=!0;else{if(h.issues.length===0)return h;p.push(h)}}return c?Promise.all(p).then(f=>no(f,i,e,u)):no(p,i,e,u)}});var yo=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Nr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let h of f)i[p].add(h)}}return i});let n=Bt(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of p){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!ft(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let p=n.value.get(c?.[t.discriminator]);return p?p._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var ho=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Ln(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let h of c)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){p.add(typeof h=="number"?h.toString():h);let P=t.valueType._zod.run({value:i[h],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...ve(h,$.issues)),r.value[h]=$.value})):(P.issues.length&&r.issues.push(...ve(h,P.issues)),r.value[h]=P.value)}let f;for(let h in i)p.has(h)||(f=f??[],f.push(h));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Or.test(p)&&f.issues.length){let $=t.keyType._zod.run({value:Number(p),issues:[]},n);if($ instanceof Promise)throw new Error("Async schemas not supported in object keys currently");$.issues.length===0&&(f=$)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map($=>xe($,n,pe())),input:p,path:[p],inst:e});continue}let P=t.valueType._zod.run({value:i[p],issues:[]},n);P instanceof Promise?u.push(P.then($=>{$.issues.length&&r.issues.push(...ve(p,$.issues)),r.value[f.value]=$.value})):(P.issues.length&&r.issues.push(...ve(p,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var vo=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=$r(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>jn.has(typeof i)).map(i=>typeof i=="string"?Ne(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),xo=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ne(n):n?Ne(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Po=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new jt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new se;return r.value=i,r}});function oo(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(oo,"handleOptionalResult");var _o=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vt(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=>oo(u,r.value)):oo(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var bo=b("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Vt(r.source)}|null)$`):void 0}),W(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 To=b("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>qt(c,t.in,n)):qt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>qt(u,t.out,n)):qt(i,t.out,n)}});function qt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(qt,"handlePipeResult");var Io=b("$ZodCustom",(e,t)=>{Pe.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>io(u,r,n,e));io(i,r,n,e)}});function io(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(zr(i))}}o(io,"handleRefineResult");var So;var Cr=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 $o(){return new Cr}o($o,"registry");(So=globalThis).__zod_globalRegistry??(So.__zod_globalRegistry=$o());var Ur=globalThis.__zod_globalRegistry;function Ao(e,t){return new e({type:"string",...V(t)})}o(Ao,"_string");function zo(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(zo,"_coercedString");function Oo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(Oo,"_url");function ko(e,t){return new e({type:"number",checks:[],...V(t)})}o(ko,"_number");function wo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(wo,"_coercedNumber");function Ro(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...V(t)})}o(Ro,"_int");function Do(e,t){return new e({type:"boolean",...V(t)})}o(Do,"_boolean");function No(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(No,"_coercedBoolean");function Co(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(Co,"_coercedBigint");function Uo(e){return new e({type:"any"})}o(Uo,"_any");function Mo(e){return new e({type:"unknown"})}o(Mo,"_unknown");function Lo(e,t){return new e({type:"void",...V(t)})}o(Lo,"_void");function jo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(jo,"_coercedDate");function Kt(e,t){return new Kn({check:"greater_than",...V(t),value:e,inclusive:!0})}o(Kt,"_gte");function oe(e,t){return new Yn({check:"min_length",...V(t),minimum:e})}o(oe,"_minLength");function _e(e,t){return new Qn({check:"string_format",format:"regex",...V(t),pattern:e})}o(_e,"_regex");function Fo(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Fo,"_custom");var J=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ht(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>yt(e,r,n),e.parseAsync=async(r,n)=>Gt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>ht(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)=>Zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Yt=b("ZodMiniString",(e,t)=>{Jt.init(e,t),J.init(e,t)});function a(e){return Ao(Yt,e)}o(a,"string");var Bo=b("ZodMiniStringFormat",(e,t)=>{wr.init(e,t),Yt.init(e,t)});var tc=b("ZodMiniURL",(e,t)=>{ao.init(e,t),Bo.init(e,t)});function Vo(e){return Oo(tc,e)}o(Vo,"url");var Qt=b("ZodMiniNumber",(e,t)=>{Rr.init(e,t),J.init(e,t)});function X(e){return ko(Qt,e)}o(X,"number");var rc=b("ZodMiniNumberFormat",(e,t)=>{so.init(e,t),Qt.init(e,t)});function Zo(e){return Ro(rc,e)}o(Zo,"int");var Mr=b("ZodMiniBoolean",(e,t)=>{Dr.init(e,t),J.init(e,t)});function B(e){return Do(Mr,e)}o(B,"boolean");var Ho=b("ZodMiniBigInt",(e,t)=>{uo.init(e,t),J.init(e,t)});var nc=b("ZodMiniAny",(e,t)=>{co.init(e,t),J.init(e,t)});function xt(){return Uo(nc)}o(xt,"any");var oc=b("ZodMiniUnknown",(e,t)=>{lo.init(e,t),J.init(e,t)});function k(){return Mo(oc)}o(k,"unknown");var ic=b("ZodMiniVoid",(e,t)=>{po.init(e,t),J.init(e,t)});function Go(e){return Lo(ic,e)}o(Go,"_void");var qo=b("ZodMiniDate",(e,t)=>{mo.init(e,t),J.init(e,t)});var ac=b("ZodMiniArray",(e,t)=>{fo.init(e,t),J.init(e,t)});function D(e,t){return new ac({type:"array",element:e,...V(t)})}o(D,"array");var sc=b("ZodMiniObject",(e,t)=>{go.init(e,t),J.init(e,t),W(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...V(t)};return new sc(r)}o(l,"object");var uc=b("ZodMiniUnion",(e,t)=>{Nr.init(e,t),J.init(e,t)});function N(e,t){return new uc({type:"union",options:e,...V(t)})}o(N,"union");var cc=b("ZodMiniDiscriminatedUnion",(e,t)=>{yo.init(e,t),J.init(e,t)});function be(e,t,r){return new cc({type:"union",options:t,discriminator:e,...V(r)})}o(be,"discriminatedUnion");var lc=b("ZodMiniRecord",(e,t)=>{ho.init(e,t),J.init(e,t)});function w(e,t,r){return new lc({type:"record",keyType:e,valueType:t,...V(r)})}o(w,"record");var pc=b("ZodMiniEnum",(e,t)=>{vo.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 pc({type:"enum",entries:r,...V(t)})}o(U,"_enum");var dc=b("ZodMiniLiteral",(e,t)=>{xo.init(e,t),J.init(e,t)});function S(e,t){return new dc({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o(S,"literal");var mc=b("ZodMiniTransform",(e,t)=>{Po.init(e,t),J.init(e,t)});function Te(e){return new mc({type:"transform",transform:e})}o(Te,"transform");var fc=b("ZodMiniOptional",(e,t)=>{_o.init(e,t),J.init(e,t)});function y(e){return new fc({type:"optional",innerType:e})}o(y,"optional");var gc=b("ZodMiniNullable",(e,t)=>{bo.init(e,t),J.init(e,t)});function Pt(e){return new gc({type:"nullable",innerType:e})}o(Pt,"nullable");var yc=b("ZodMiniPipe",(e,t)=>{To.init(e,t),J.init(e,t)});function Ie(e,t){return new yc({type:"pipe",in:e,out:t})}o(Ie,"pipe");var hc=b("ZodMiniCustom",(e,t)=>{Io.init(e,t),J.init(e,t)});function er(e,t){return Fo(hc,e??(()=>!0),t)}o(er,"custom");var _t={};Dn(_t,{bigint:()=>Tc,boolean:()=>bc,date:()=>Ic,number:()=>_c,string:()=>Pc});function Pc(e){return zo(Yt,e)}o(Pc,"string");function _c(e){return wo(Qt,e)}o(_c,"number");function bc(e){return No(Mr,e)}o(bc,"boolean");function Tc(e){return Co(Ho,e)}o(Tc,"bigint");function Ic(e){return jo(qo,e)}o(Ic,"date");var jr=l({retryOnFailure:l({defaultValue:y(B()),hide:y(B())}),continueOnFailure:l({defaultValue:y(B()),hide:y(B())})}),Lr=class{constructor(t,r,n,i,u,c,p,f,h,P,$){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=h;this.audience=P;this.aiMetadata=$}static{o(this,"IAction")}},Ee=o(e=>new Lr(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:y(a())}),C=o((e,t)=>l({type:S(t),required:B(),defaultValue:y(xt())}),"TPropertyValue");var ee=l({...F.shape,...C(a(),"SHORT_TEXT").shape}),de=l({...F.shape,...C(a(),"LONG_TEXT").shape});var Jo=l({label:a(),value:k()}),tr=l({disabled:y(B()),placeholder:y(a()),options:D(Jo)});var te=l({...F.shape,options:tr,...C(k(),"STATIC_DROPDOWN").shape}),me=l({...F.shape,options:tr,...C(D(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Fr=l({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:D(a())}),bt=l({...F.shape,...C(D(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:D(a())});var fe=l({...F.shape,...C(B(),"CHECKBOX").shape});var ge=l({...F.shape,...C(X(),"NUMBER").shape});var Tt=l({...F.shape,streaming:y(B()),...C(k(),"FILE").shape});var It=l({...F.shape,...C(a(),"DATE_TIME").shape});var Ko=w(a(),N([ee,de,te,bt,me,fe,ge,Tt,It])),Et=l({...F.shape,properties:Ko,...C(D(k()),"ARRAY").shape});var St=l({...F.shape,...C(N([w(a(),k())]),"JSON").shape});var Xo=N([ee,te,St,Et,me]),Sc=w(a(),Xo),Br=l({refreshers:D(a()),...F.shape,...C(k(),"DYNAMIC").shape});var rr=l({...F.shape,...C(Go(),"MARKDOWN").shape});var $t=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))($t||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Me||{});var At=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(At||{}),Vr="both_client_credentials_and_authorization_code";var ze=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(ze||{}),zt=(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))(zt||{}),$c=l({strategy:U(zt),paramName:y(a())}),Ot=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(Ot||{});var nr=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(nr||{}),Yo=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Qo=l({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:y(a()),handlerId:y(a()),streamStepProgress:y(U(nr))}),ei=l({type:S("WEBHOOK"),requestId:a(),requestIdToReply:y(a()),response:Yo,handlerId:y(a()),streamStepProgress:y(U(nr))}),Ac=N([Qo,ei]);var zc=l({body:k(),rawBody:y(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ie(e){return e==null}o(ie,"isNil");function kt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(kt,"isEmpty");function or(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(or,"assertNotNullOrUndefined");var Zr=De(require("crypto"),1);var Oc=128,Oe,Le,kc=o(e=>{!Oe||Oe.length<e?(Oe=Buffer.allocUnsafe(e*Oc),Zr.default.randomFillSync(Oe),Le=0):Le+e>Oe.length&&(Zr.default.randomFillSync(Oe),Le=0),Le+=e},"fillPool"),wc=o(e=>(kc(e|=0),Oe.subarray(Le-e,Le)),"random"),Rc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let p=r(i),f=i;for(;f--;)if(c+=e[p[f]&n]||"",c.length===u)return c}}},"customRandom"),ri=o((e,t=21)=>Rc(e,t,wc),"customAlphabet");var Dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ni=21,Gb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${ni}}$`))),Nc=ri(Dc,ni);var Se=Ie(Te(e=>e instanceof Date?e.toISOString():e),a()),re={id:a(),created:Se,updated:Se},Z=o(e=>y(Pt(e)),"Nullable");function Hr(e){return y(Pt(U(e)))}o(Hr,"NullableEnum");var Jb=Ie(Te(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),y(B())),ir=o(e=>Ie(Te(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),y(D(e))),"OptionalArrayFromQuery");var Yb=w(a(),k());var wt=(P=>(P.OPENAI="openai",P.OPENROUTER="openrouter",P.ANTHROPIC="anthropic",P.AZURE="azure",P.GOOGLE="google",P.ACTIVEPIECES="activepieces",P.CLOUDFLARE_GATEWAY="cloudflare-gateway",P.CUSTOM="custom",P.BEDROCK="bedrock",P.MISTRAL="mistral",P))(wt||{});var lT=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var dT=l({filename:a(),data:k(),type:S("file"),mimetype:y(a())});var Cc=De(ii());var xT=l({...re,name:a(),permissions:D(a()),platformId:Z(a()),type:a(),userCount:y(X())});var ai=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(ai||{}),Gr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Gr||{}),qr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(qr||{});var Wr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Wr||{});var Jr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Jr||{});var Uc=l({mode:U(ai),value:k()}),Mc=l({auth:y(a()),fields:w(a(),Uc)}),Lc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:y(Mc)}),jc=l({type:S("PIECE"),toolName:a().check(oe(1)),pieceMetadata:Lc}),Fc=l({type:S("none")}),Bc=l({type:S("access_token"),accessToken:a()}),Vc=l({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),Zc=l({type:S("headers"),headers:w(a(),a())}),Hc=be("type",[Fc,Bc,Vc,Zc]),si=l({type:S("FLOW"),toolName:a().check(oe(1)),externalFlowId:a(),flowDisplayName:y(a())}),ui=l({type:S("MCP"),toolName:a().check(oe(1)),serverUrl:Vo(),protocol:U(qr),auth:Hc}),ci=l({type:S("KNOWLEDGE_BASE"),toolName:a().check(oe(1)),sourceType:U(Gr),sourceId:a(),sourceName:a()}),Gc=be("type",[jc,si,ui,ci]),qc=l({displayName:a(),description:y(a()),type:U(Wr)}),li=l({type:S("MARKDOWN"),markdown:a()}),je={type:S("TOOL_CALL"),input:Z(w(a(),k())),output:y(k()),toolName:a(),status:U(Jr),toolCallId:a(),startTime:a(),endTime:y(a())},KT=l(je),pi=be("toolCallType",[l({...je,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...je,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),l({...je,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),l({...je,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...je,toolCallType:S("UNKNOWN"),displayName:a()})]),Wc=N([li,pi]);var Kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Kr||{}),ye=l({apiKey:a()}),Jc=ye,Kc=l({apiKey:a(),apiKeyHash:a()}),Xc=ye,Yc=ye,Qc=ye,el=ye,tl=ye,rl=ye,nl=ye,yi=l({accessKeyId:a().check(oe(1)),secretAccessKey:a().check(oe(1))}),ol=l({}),il=l({}),al=l({}),sl=l({}),ul=l({}),cl=l({}),hi=l({modelId:a(),modelName:a(),modelType:U(Kr)}),vi=l({apiKeyHeader:a(),baseUrl:a(),models:D(hi),defaultHeaders:y(w(a(),a()))}),xi=l({accountId:a(),gatewayId:a(),models:D(hi),vertexProject:y(a()),vertexRegion:y(a())}),Pi=l({resourceName:a(),apiVersion:Ie(Te(e=>typeof e=="string"&&e.trim().length===0?void 0:e),y(a()))}),_i=l({region:a().check(oe(1))}),ll=N([Jc,Qc,el,tl,rl,Yc,Xc,Kc,yi,nl]),bi=N([vi,xi,Pi,_i,ol,al,sl,ul,il,cl]),pl=l({id:a(),name:a(),type:U(Kr)}),dl=l({id:a(),name:a(),provider:U(wt),config:bi,enabledForChat:B()}),ml=l({provider:U(wt),config:bi,auth:ll,platformId:a()});var eI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},di=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],fl=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],gl=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],mi=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],yl=["grok-4.20","grok-4.1-fast"],hl={openai:di,anthropic:fl,google:mi,activepieces:[...gl.map(e=>`anthropic/${e}`),...di.map(e=>`openai/${e}`),...mi.map(e=>`google/${e}`),...yl.map(e=>`x-ai/${e}`)]};var fi=128e3,vl={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function xl({provider:e}){return e?vl[e]??fi:fi}o(xl,"getMaxContextTokens");var gi={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Pl={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},_l=new Set(["anthropic","mistral"]);function ue(e){return{chatModels:hl[e],maxContextTokens:xl({provider:e}),defaultEmbeddingModel:gi[e],supportsEmbedding:gi[e]!==void 0,supportsImageGeneration:!_l.has(e),webSearch:Pl[e]}}o(ue,"buildProviderCapabilities");var bl={openai:ue("openai"),anthropic:ue("anthropic"),openrouter:ue("openrouter"),azure:ue("azure"),google:ue("google"),"cloudflare-gateway":ue("cloudflare-gateway"),custom:ue("custom"),bedrock:ue("bedrock"),mistral:ue("mistral"),activepieces:ue("activepieces")};var Tl=l({base64Url:a(),fileName:a(),extension:y(a())}),Il=l({mimeType:a(),url:a(),fileName:y(a())}),Xr=N([Tl,Il]);var El=N([l({type:S("file"),value:Xr}),l({type:S("markdown"),value:a(),files:y(D(Xr))})]),Sl=l({sessionId:a(),message:a(),files:y(D(a()))});var Ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ii||{}),Ei=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Ei||{}),Yr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Yr||{});var $l=N([l({...re,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:D(l({value:a()}))})}),l({...re,name:a(),externalId:a(),type:N([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Al=l({...re,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Hr(Ei),trigger:Hr(Ii)}),zl=l({...re,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),Ol=l({events:D(U(Yr)),webhookUrl:a(),flowId:a()}),kl=l({fields:D(l({id:a(),name:a()})),rows:D(w(a(),a())),name:a()}),wl=l({projectId:a(),limit:y(_t.number()),cursor:y(a()),name:y(a()),externalIds:ir(a()),folderId:y(a()),folderIds:ir(a())}),Rl=l({records:D(D(l({fieldId:a(),value:$i()}))),tableId:a()}),Dl=l({cells:y(D(l({fieldId:a(),value:$i()}))),tableId:a(),agentUpdate:y(B())}),Si=be("operator",[ke("eq"),ke("neq"),ke("gt"),ke("gte"),ke("lt"),ke("lte"),ke("co"),Ti("exists"),Ti("not_exists")]),Nl=l({tableId:a(),limit:y(_t.number()),cursor:y(a()),filters:ir(Si)});function $i(){return Ie(Te(e=>e==null?e:String(e)),Pt(a()))}o($i,"coerceToString");function ke(e){return l({fieldId:a(),operator:S(e),value:a()})}o(ke,"valueFilter");function Ti(e){return l({fieldId:a(),operator:S(e)})}o(Ti,"existenceFilter");var Cl=l({status:y(X()),body:y(k()),headers:y(w(a(),a()))}),Ul=l({...re,deleted:Z(Se),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Ai=l({name:a(),description:y(a()),type:a(),required:B()}),Ml=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:D(Ai),returnsResponse:B()})});var zi="^[0-9]+\\.[0-9]+\\.[0-9]+$",xI=new RegExp(zi),jl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",PI=a().check(_e(new RegExp(zi))),_I=a().check(_e(new RegExp(jl))),Fl=l({packageType:S("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Oi=l({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ki=l({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),bI=N([Oi,ki]),TI=N([Fl,Oi,ki]);var Bl=be("type",[l({type:S("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:S("INTERVAL"),intervalMs:Zo().check(Kt(6e4))})]),II=l({...re,type:U(ze),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Bl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),wi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(wi||{}),Ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(Ri||{}),Di=(r=>(r.S3="S3",r.DB="DB",r))(Di||{}),EI=l({...re,projectId:Z(a()),platformId:Z(a()),type:U(wi),compression:U(Ri),data:y(k()),location:U(Di),size:Z(X()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(w(a(),a()))}),Ni=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(Ni||{}),Ci=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(Ci||{}),SI=l({id:a(),email:a(),firstName:a(),status:U(Ci),externalId:Z(a()),platformId:Z(a()),platformRole:U(Ni),lastName:a(),created:Se,updated:Se,lastActiveDate:Z(Se),imageUrl:Z(a())});var Qr=l({...F.shape,...C(w(a(),k()),"OBJECT").shape});var ji=l({...F.shape,...C(a(),"COLOR").shape});var en=N([ee,de,rr,fe,te,me,Fr,bt,Br,ge,Et,Qr,St,It,Tt,ji]),T={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 ce=l({displayName:a(),description:y(a())});var Fi=l({username:a(),password:a()}),tn=l({...ce.shape,username:l({displayName:a(),description:y(a())}),password:l({displayName:a(),description:y(a())}),...C(Fi,"BASIC_AUTH").shape});var Gl=w(a(),N([ee,de,ge,fe,te])),rn=l({...ce.shape,props:Gl,...C(k(),"CUSTOM_AUTH").shape});var we=l({...ce.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var ql=w(a(),N([ee,de,we,ge,fe,te,me,rr])),Bi=l({...ce.shape,props:ql,...C(k(),"OIDC").shape});var nn=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(nn||{}),Vi=N([ee,we,te]),Zi=w(a(),Vi),Wl=l({props:y(w(a(),Vi)),authUrl:a(),tokenUrl:a(),scope:D(a()),prompt:y(N([S("none"),S("consent"),S("login"),S("omit")])),pkce:y(B()),pkceMethod:y(N([S("plain"),S("S256")])),authorizationMethod:y(U(nn)),grantType:y(N([U(At),S(Vr)])),extra:y(w(a(),a()))}),Hi=l({access_token:a(),props:y(Zi),data:w(a(),xt())}),on=l({...ce.shape,...Wl.shape,...C(Hi,"OAUTH2").shape});var Fe=N([tn,rn,Bi,on,we]),Rt="Connection",sr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||Rt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||Rt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||Rt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||Rt}},None(){}};var oS={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 Jl=l({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Kl=N([en,Fe]),an=w(a(),Kl),IS=w(a(),en);var Gi=N([l({strategy:S("CRON"),cronExpression:a()}),l({strategy:S("NONE")})]);var qi="2",ur="0.82.0";var sn=class{constructor(t,r,n,i,u,c,p,f,h=ur,P,$="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=h;this.maximumSupportedRelease=P;this.description=$;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:qi}),"getContextInfo");(!Xl(h)||Yl(h,ur))&&(this.minimumSupportedRelease=ur),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Wi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new sn(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Xl(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Xl,"isValidSimpleSemver");function Yl(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,p]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<p}o(Yl,"isSemverLessThan");var Ql=y(w(a(),w(a(),a()))),Ji=l({id:y(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:D(a()),platformId:y(a()),directoryPath:y(a()),auth:y(N([Fe,D(Fe)])),version:a(),categories:y(D(U(Me))),minimumSupportedRelease:y(a()),maximumSupportedRelease:y(a()),deprecated:y(B()),i18n:Ql}),ep=U(["human","ai","both"]),Ki=l({description:y(a()),idempotent:y(B())}),Xi=l({name:a(),displayName:a(),description:a(),props:an,requireAuth:B(),errorHandlingOptions:y(jr),outputSchema:y(er()),audience:y(ep),aiMetadata:y(Ki)}),Yi=l({name:a(),displayName:a(),description:a(),props:an,errorHandlingOptions:y(jr),type:U(ze),sampleData:k(),handshakeConfiguration:y(er()),renewConfiguration:y(Gi),testStrategy:U(Ot),outputSchema:y(er()),aiMetadata:y(Ki)}),tp=l({...Ji.shape,actions:w(a(),Xi),triggers:w(a(),Yi)}),rp=l({...Ji.shape,actions:X(),triggers:X(),suggestedActions:y(D(Xi)),suggestedTriggers:y(D(Yi))}),Qi=l({projectUsage:X(),pieceType:U(Ue),packageType:U($t),platformId:y(a()),archiveId:y(a())}),I$=l({...tp.shape,...Qi.shape}),E$=l({...rp.shape,...Qi.shape}),S$=l({name:a(),version:a()});var np=De(require("path")),op=De(require("fs/promises"));var ra=require("node:stream");var cr=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var lr=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new un,r=new cn){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},un=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},cn=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 pr=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 dr=class extends cr{static{o(this,"FetchHttpClient")}constructor(t="",r=new lr){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,Q]of Object.entries(c))i.append(L,Q);let p=i.toString(),f=p?`${n}?${p}`:n,h=t.responseType??"json",P=t.followRedirects??!0,$=t.retries??0,{body:x,extraHeaders:s,isStream:d}=ip(t.body,u),g=sp({...u,...s}),m=await ap(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:g,body:x,redirect:P?"follow":"manual",signal:L.signal};return d&&(ne.duplex="half"),r?.dispatcher!==void 0&&(ne.dispatcher=r.dispatcher),await fetch(f,ne)}finally{Q!==void 0&&clearTimeout(Q)}},$),v=P?300:400;if(m.status<200||m.status>=v){let L=await ea(m,h),Q=new pr(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",Q),Q}let _=await ea(m,h);return{status:m.status,headers:up(m.headers),body:_}}};function ip(e,t){if(lp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(cp(e)){let n=new ra.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(ip,"serializeBody");async function ea(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ea,"parseResponseBody");async function ap(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await ta(n);continue}return i}catch(i){if(r=i,n<t){await ta(n);continue}throw i}throw r}o(ap,"sendWithRetries");function ta(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(ta,"backoff");function sp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r.toLowerCase()]=Array.isArray(n)?n.join(", "):n);return t}o(sp,"normalizeHeaders");function up(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(up,"toHttpHeaders");function cp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(cp,"isNodeFormData");function lp(e){return e==null}o(lp,"isNil");var Be=new dr;var Dt=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Dt||{});var Xd=De(require("fs")),uu=De(su());var Yd={"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 Qd(e){let t=e.split(";")[0].trim().toLowerCase();return Yd[t]??""}o(Qd,"contentTypeToExtension");var em=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),tm=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 cu({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return Ee({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:T.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:T.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${tm(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...c?.url??{}})}),"props")}),method:T.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Dt).map(h=>({label:h,value:h}))},...c?.method??{}}),headers:T.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:T.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:T.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:T.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let P=h,$={};switch(P){case"none":break;case"json":$.data=T.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":$.data=T.LongText({displayName:"Raw Body",required:!0});break;case"form_data":$.data=T.Array({displayName:"Form Data",required:!0,properties:{fieldName:T.ShortText({displayName:"Field Name",required:!0}),fieldType:T.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:T.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:T.File({displayName:"File Field Value",required:!1})}});break}return $},"props")}),response_is_binary:T.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:T.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:T.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:T.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async h=>{let{method:P,url:$,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:L}=h.propsValue;or(P,"Method"),or($,"URL");let Q=ie(r)?{}:await r(h.auth,h.propsValue),ne=$.url,dt=ne.startsWith("http://")||ne.startsWith("https://")?ne:em({baseUrl:t(h.auth),relativePath:ne}),Ae={method:P,url:dt,headers:{...x??{},...f==="headers"||!ie(f)?Q:{}},queryParams:{...f==="queryParams"?Q:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(_&&(Ae.responseType="arraybuffer"),d)if(g&&g!=="none"){let le=d.data;if(g==="form_data"){let Iu=le,Lt=new uu.default;for(let{fieldName:kn,fieldType:wn,textFieldValue:Rn,fileFieldValue:Ir}of Iu)wn==="text"&&!kt(Rn)?Lt.append(kn,Rn):wn==="file"&&!kt(Ir)&&Lt.append(kn,Ir.data,{filename:Ir?.filename});Ae.body=Lt,Ae.headers={...Ae.headers,...Lt.getHeaders()}}else Ae.body=le}else g||(Ae.body=d);try{let le=await Be.sendRequest(Ae);return await rm(h.files,le.body,le.status,le.headers,_)}catch(le){if(m)return le.errorMessage();throw le}},"run")})}o(cu,"createCustomApiCallAction");var rm=o(async(e,t,r,n,i)=>{let u;if(i&&nm(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Qd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),nm=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var br="https://api.polydoc.tech",lu="/pdf/convert",Tr="/screenshot/convert",pu=[{label:"URL (render a web page)",value:"url"},{label:"HTML (render an inline HTML string)",value:"html"},{label:"Template (render a saved PolyDoc template by ID)",value:"template"}],du=[{label:"Download (return the file)",value:"download"},{label:"Cloud Storage (upload to a presigned URL)",value:"cloudStorage"},{label:"Webhook (deliver the file to a URL)",value:"webhook"}],mu=["A3","A4","A5","Ledger","Legal","Letter","Tabloid"],fu=["png","jpeg","webp"],gu=[{label:"Binary file (write the image to a file)",value:"binaryFile"},{label:"Base64 (return the image as a base64 string)",value:"base64"}],yu=[{label:"ZUGFeRD (Germany / EU)",value:"zugferd"},{label:"Factur-X (France / EU)",value:"facturx"}],hu=["minimum","basicwl","basic","en16931","extended"];var om=`Get an API key from the PolyDoc dashboard (dashboard.polydoc.tech, API Keys). It is sent as Authorization: Bearer <key>.
4
4
 
5
- Turn on **Sandbox** to test against sandbox quota (output is watermarked). Leave it off for production conversions.`,ye=or.CustomAuth({description:jd,required:!0,props:{apiKey:or.SecretText({displayName:"API Key",description:"Your PolyDoc API key from dashboard.polydoc.tech.",required:!0}),sandbox:b.Checkbox({displayName:"Sandbox",description:"Use sandbox quota (watermarked output).",required:!1,defaultValue:!1})},validate:o(async({auth:e})=>{let t=e.apiKey;if(!t)return{valid:!1,error:"API key is required."};try{return await Fe.sendRequest({method:"POST",url:`${xr.replace(/\/+$/,"")}${Pr}`,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-Sandbox":e.sandbox?"true":"false"},body:{source:"<p>polydoc</p>",screenshot:{type:"png"}},responseType:"arraybuffer"}),{valid:!0}}catch(r){let n=r?.response?.status;return n===401?{valid:!1,error:"Invalid PolyDoc API key."}:{valid:!1,error:`Could not validate the PolyDoc API key (${n?`the API returned HTTP ${n}`:"the API was unreachable"}). Check the key and try again.`}}},"validate")});function iu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(iu,"isPlainObject");function au(e,t){let r={...e};for(let[n,i]of Object.entries(t))iu(i)&&iu(r[n])?r[n]=au(r[n],i):r[n]=i;return r}o(au,"mergeDeep");function Ld(e){switch(e.sourceType){case"url":return e.url??"";case"html":return e.html??"";case"template":return`[template:${e.templateId??""}]`;default:return""}}o(Ld,"resolveSource");function Fd(e){let t={};typeof e.format=="string"&&e.format!==""&&(t.format=e.format);for(let n of["landscape","printBackground","outline","tagged"])typeof e[n]=="boolean"&&(t[n]=e[n]);return typeof e.scale=="number"&&(t.scale=e.scale),typeof e.pageRanges=="string"&&e.pageRanges!==""&&(t.pageRanges=e.pageRanges),["marginTop","marginRight","marginBottom","marginLeft"].some(n=>e[n]!==void 0&&e[n]!=="")&&(t.margin={top:e.marginTop??"2",right:e.marginRight??"1",bottom:e.marginBottom??"2",left:e.marginLeft??"1"}),Object.keys(t).length>0?t:void 0}o(Fd,"buildLayout");function Bd(e){let t={};typeof e.imageType=="string"&&e.imageType!==""&&(t.type=e.imageType),typeof e.fullPage=="boolean"&&(t.fullPage=e.fullPage),typeof e.quality=="number"&&(t.quality=e.quality),e.encoding==="base64"&&(t.encoding="base64");let r=typeof e.viewportWidth=="number",n=typeof e.viewportHeight=="number";if(r!==n)throw new Error("Both viewport width and height are required to set a custom viewport.");if(r&&n){let i={width:e.viewportWidth,height:e.viewportHeight};typeof e.devicePixelRatio=="number"&&e.devicePixelRatio>0&&(i.devicePixelRatio=e.devicePixelRatio),t.viewport=i}return Object.keys(t).length>0?t:void 0}o(Bd,"buildScreenshot");function We(e){let t=e.operation==="screenshot"?Pr:Xs,r={source:Ld(e)};if(e.templateData&&Object.keys(e.templateData).length>0&&(r.templateData=e.templateData),e.filename&&(r.filename=e.filename),e.tag&&(r.tag=e.tag),typeof e.timeout=="number"&&e.timeout>0&&(r.timeout=e.timeout),e.operation==="pdf"){let c=e.pdfOptions?Fd(e.pdfOptions):void 0;c&&(r.layout=c)}if(e.operation==="screenshot"){let c=e.screenshotOptions?Bd(e.screenshotOptions):void 0;c&&(r.screenshot=c)}if(e.operation==="einvoice"){let c={standard:e.eInvoiceStandard,profile:e.eInvoiceProfile,invoice:e.invoice??{}};typeof e.eInvoiceVerify=="boolean"&&(c.verify=e.eInvoiceVerify),r.eInvoice=c}let n=e.delivery??{mode:"download"},i=n.mode==="download";n.mode==="cloudStorage"&&n.presignedUrl&&(r.cloudStorage={presignedUrl:n.presignedUrl}),n.mode==="webhook"&&n.webhook&&(r.webhook=n.webhook);let u=e.advanced&&Object.keys(e.advanced).length>0?au(r,e.advanced):r;return{endpoint:t,body:u,isBinary:i}}o(We,"buildRequestBody");function su(e,t){return e==="screenshot"?`screenshot.${t==="jpeg"?"jpg":t??"png"}`:"document.pdf"}o(su,"defaultFilename");async function Ge(e,t){let r=xr.replace(/\/+$/,""),n=await Fe.sendRequest({method:"POST",url:`${r}${t.endpoint}`,headers:{Authorization:`Bearer ${e.props.apiKey}`,"Content-Type":"application/json","X-Sandbox":e.props.sandbox?"true":"false"},body:t.body,responseType:t.isBinary?"arraybuffer":"json"});return{status:n.status,headers:n.headers??{},body:n.body}}o(Ge,"polyDocRequest");function Je(e){let r=e?.response?.body;if(r instanceof ArrayBuffer?r=Buffer.from(r).toString("utf8"):Buffer.isBuffer(r)&&(r=r.toString("utf8")),typeof r=="string"){let n=r;try{r=JSON.parse(n)}catch{return n||void 0}}if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,i=n.message;if(typeof i=="string")return i;let u=n.error;if(typeof u=="string")return u}}o(Je,"extractApiErrorMessage");async function Ke(e){let{response:t,isBinary:r,files:n,operation:i,filename:u,imageType:c}=e;if(!r)return t.body??{success:!0};let d=(Sn(t.headers["content-type"])??"application/octet-stream").split(";")[0].trim(),f=Vd(t.body),h=u||su(i,c);return{success:!0,file:await n.write({fileName:h,data:f}),fileName:h,contentType:d,sizeBytes:f.length,conversionId:Sn(t.headers["x-conversion-id"]),creditUsed:Sn(t.headers["x-credit-used"])}}o(Ke,"shapeOutput");function Sn(e){return Array.isArray(e)?e[0]:e}o(Sn,"headerValue");function Vd(e){if(Buffer.isBuffer(e))return e;if(e instanceof ArrayBuffer)return Buffer.from(e);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(typeof e=="string")return Buffer.from(e,"binary");throw new Error("PolyDoc returned an unexpected response body for a binary delivery; expected file bytes.")}o(Vd,"toBuffer");var Xe=o((e="url")=>b.StaticDropdown({displayName:"Source Type",description:"Where the content comes from",required:!0,defaultValue:e,options:{disabled:!1,options:Ys.map(t=>({label:t.label,value:t.value}))}}),"sourceTypeProp"),Ye=b.LongText({displayName:"Source",description:"The URL, inline HTML, or saved template ID, matching the Source Type above.",required:!0}),Qe=b.Json({displayName:"Template Data",description:"Data passed to the Liquid template renderer (used only when Source Type is Template).",required:!1,defaultValue:{}}),et=b.StaticDropdown({displayName:"Delivery",description:"How the generated file is returned",required:!0,defaultValue:"download",options:{disabled:!1,options:Qs.map(e=>({label:e.label,value:e.value}))}}),tt=b.ShortText({displayName:"Presigned URL",description:"HTTP PUT presigned URL from your storage provider (required for Cloud Storage delivery).",required:!1}),rt=b.ShortText({displayName:"Webhook URL",description:"URL the generated file is delivered to (required for Webhook delivery).",required:!1}),nt=b.Json({displayName:"Webhook Options",description:"Extra webhook settings merged with the URL: async, method, headers, retries, retryDelay, timeout.",required:!1,defaultValue:{}}),ot=b.ShortText({displayName:"Filename",description:"Output filename (overrides the default).",required:!1}),it=b.ShortText({displayName:"Tag",description:"Label for logging and analytics (max 30 characters).",required:!1}),at=b.Number({displayName:"Timeout (ms)",description:"Conversion timeout in milliseconds.",required:!1}),st=b.Json({displayName:"Advanced (JSON)",description:"Raw fields deep-merged into the request body for any API option not exposed above (e.g. pdf.watermark, pdf.pdfa, render, request).",required:!1,defaultValue:{}});function Ut(e){let t=e;if(typeof t=="string"){let r=t.trim();if(r==="")return;try{t=JSON.parse(r)}catch{return}}if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return Object.keys(r).length>0?r:void 0}}o(Ut,"asJsonObject");function ut(e){let t=e.sourceType??"url",r=e.source??"";return t==="html"?{sourceType:t,html:r}:t==="template"?{sourceType:t,templateId:r,templateData:Ut(e.templateData)}:{sourceType:t,url:r}}o(ut,"resolveSourceParams");function ct(e){let t=e.deliveryMode??"download";if(t==="cloudStorage"){let r=e.presignedUrl??"";if(!r)throw new Error("Cloud Storage delivery requires a Presigned URL.");return{mode:t,presignedUrl:r}}if(t==="webhook"){let r=e.webhookUrl??"";if(!r)throw new Error("Webhook delivery requires a Webhook URL.");let n=Ut(e.webhookOptions)??{};return{mode:t,webhook:{url:r,...n}}}return{mode:"download"}}o(ct,"resolveDelivery");function lt(e){return{filename:e.filename||void 0,tag:e.tag||void 0,timeout:typeof e.timeout=="number"?e.timeout:void 0,advanced:Ut(e.advanced)}}o(lt,"resolveMetadata");var uu=be({auth:ye,name:"capture_screenshot",displayName:"Capture Screenshot",description:"Capture a screenshot of a URL, inline HTML, or a saved template.",aiMetadata:{description:"Captures a screenshot (PNG, JPEG, or WebP) of a URL, an inline HTML string, or a saved PolyDoc template. Supports full-page capture, custom viewport, and base64 or file output. Idempotent: the same input yields the same image.",idempotent:!0},props:{sourceType:Xe("url"),source:Ye,templateData:Qe,imageType:b.StaticDropdown({displayName:"Image Type",required:!1,defaultValue:"png",options:{disabled:!1,options:tu.map(e=>({label:e,value:e}))}}),fullPage:b.Checkbox({displayName:"Full Page",description:"Capture the entire scrollable page.",required:!1,defaultValue:!1}),quality:b.Number({displayName:"Quality",description:"Compression quality for JPEG/WebP (0 to 100).",required:!1}),viewportWidth:b.Number({displayName:"Viewport Width",description:"Viewport width in CSS pixels.",required:!1}),viewportHeight:b.Number({displayName:"Viewport Height",description:"Viewport height in CSS pixels.",required:!1}),devicePixelRatio:b.Number({displayName:"Device Pixel Ratio",description:"Device pixel ratio, e.g. 2 for retina (0 to 10).",required:!1}),outputEncoding:b.StaticDropdown({displayName:"Output",description:"Return the image as a file (default) or as a base64 string.",required:!1,defaultValue:"binaryFile",options:{disabled:!1,options:ru.map(e=>({label:e.label,value:e.value}))}}),deliveryMode:et,presignedUrl:tt,webhookUrl:rt,webhookOptions:nt,filename:ot,tag:it,timeout:at,advanced:st},async run(e){let t=e.propsValue,r=t.outputEncoding==="base64",n={operation:"screenshot",...ut(t),...lt(t),delivery:ct(t),screenshotOptions:{imageType:t.imageType,fullPage:t.fullPage,quality:t.quality,encoding:r?"base64":void 0,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,devicePixelRatio:t.devicePixelRatio}},i=We(n);r&&(i.isBinary=!1);try{let u=await Ge(e.auth,i);return await Ke({response:u,isBinary:i.isBinary,files:e.files,operation:"screenshot",filename:n.filename,imageType:t.imageType})}catch(u){throw new Error(Je(u)??u.message)}}});var cu=be({auth:ye,name:"convert_to_pdf",displayName:"Convert to PDF",description:"Convert HTML, a URL, or a saved template to a PDF.",aiMetadata:{description:"Converts a URL, an inline HTML string, or a saved PolyDoc template into a PDF and returns the file (or delivers it to cloud storage / a webhook). Use it to render documents like invoices, reports, or contracts. Idempotent: the same input yields the same PDF.",idempotent:!0},props:{sourceType:Xe("url"),source:Ye,templateData:Qe,format:b.StaticDropdown({displayName:"Page Format",required:!1,defaultValue:"A4",options:{disabled:!1,options:eu.map(e=>({label:e,value:e}))}}),landscape:b.Checkbox({displayName:"Landscape",required:!1,defaultValue:!1}),printBackground:b.Checkbox({displayName:"Print Background",description:"Print background graphics and colors.",required:!1,defaultValue:!0}),scale:b.Number({displayName:"Scale",description:"Render scale (0.1 to 2).",required:!1}),pageRanges:b.ShortText({displayName:"Page Ranges",description:'Pages to include, e.g. "1-5, 8". Empty means all pages.',required:!1}),outline:b.Checkbox({displayName:"Outline (Bookmarks)",description:"Generate PDF bookmarks from HTML headings.",required:!1,defaultValue:!1}),tagged:b.Checkbox({displayName:"Tagged (Accessible)",description:"Produce a tagged, accessible PDF.",required:!1,defaultValue:!1}),marginTop:b.ShortText({displayName:"Margin Top",description:"Top margin with optional unit, e.g. 10mm, 1cm, 0.5in.",required:!1}),marginRight:b.ShortText({displayName:"Margin Right",required:!1}),marginBottom:b.ShortText({displayName:"Margin Bottom",required:!1}),marginLeft:b.ShortText({displayName:"Margin Left",required:!1}),deliveryMode:et,presignedUrl:tt,webhookUrl:rt,webhookOptions:nt,filename:ot,tag:it,timeout:at,advanced:st},async run(e){let t=e.propsValue,r={operation:"pdf",...ut(t),...lt(t),delivery:ct(t),pdfOptions:{format:t.format,landscape:t.landscape,printBackground:t.printBackground,scale:t.scale,pageRanges:t.pageRanges,outline:t.outline,tagged:t.tagged,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft}},n=We(r);try{let i=await Ge(e.auth,n);return await Ke({response:i,isBinary:n.isBinary,files:e.files,operation:"pdf",filename:r.filename})}catch(i){throw new Error(Je(i)??i.message)}}});var Zd={number:"INV-001",issueDate:"2026-01-31",dueDate:"2026-03-02",currencyCode:"EUR",seller:{name:"Your Company GmbH",address:{line1:"Main St 1",city:"Berlin",postalCode:"10115",countryCode:"DE"},taxId:"DE123456789"},buyer:{name:"Customer SARL",address:{line1:"Rue 2",city:"Paris",postalCode:"75001",countryCode:"FR"}},lines:[{description:"Widget",quantity:2,unitPrice:10,lineTotal:20,vatRate:19,vatCategoryCode:"S"}],taxSummary:[{categoryCode:"S",rate:19,taxableAmount:20,taxAmount:3.8}],paymentTerms:"Net 30 days",totalNetAmount:20,totalTaxAmount:3.8,totalGrossAmount:23.8},lu=be({auth:ye,name:"generate_einvoice",displayName:"Generate E-Invoice",description:"Generate a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) from a visual layout plus structured invoice data.",aiMetadata:{description:"Generates a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) by embedding structured invoice XML into a visual PDF layout. EN 16931 requires payment terms or a due date, a seller tax ID for VAT category S, and consistent totals. Idempotent: the same input yields the same PDF.",idempotent:!0},props:{sourceType:Xe("html"),source:Ye,templateData:Qe,standard:b.StaticDropdown({displayName:"Standard",description:"The hybrid e-invoice standard to embed.",required:!0,defaultValue:"zugferd",options:{disabled:!1,options:nu.map(e=>({label:e.label,value:e.value}))}}),profile:b.StaticDropdown({displayName:"Profile",description:"The data granularity profile to validate against.",required:!0,defaultValue:"en16931",options:{disabled:!1,options:ou.map(e=>({label:e,value:e}))}}),invoice:b.Json({displayName:"Invoice Data",description:"Structured invoice data: number, dates, currency, seller, buyer, lines, totals. EN 16931 needs payment terms (or due date), seller taxId for VAT category S, and consistent totals. See docs.polydoc.tech.",required:!0,defaultValue:Zd}),verify:b.Checkbox({displayName:"Verify",description:"Validate PDF/A and e-invoice compliance (returns an error if it fails).",required:!1,defaultValue:!1}),deliveryMode:et,presignedUrl:tt,webhookUrl:rt,webhookOptions:nt,filename:ot,tag:it,timeout:at,advanced:st},async run(e){let t=e.propsValue,r={operation:"einvoice",...ut(t),...lt(t),delivery:ct(t),eInvoiceStandard:t.standard,eInvoiceProfile:t.profile,eInvoiceVerify:t.verify===!0,invoice:Ut(t.invoice)??{}},n=We(r);try{let i=await Ge(e.auth,n);return await Ke({response:i,isBinary:n.isBinary,files:e.files,operation:"einvoice",filename:r.filename})}catch(i){throw new Error(Je(i)??i.message)}}});var Hd=Ci({displayName:"PolyDoc",description:"Convert HTML or a URL to PDF, capture screenshots, and generate EU e-invoices (Factur-X / ZUGFeRD).",auth:ye,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/polydoc.png",categories:["CONTENT_AND_FILES","PRODUCTIVITY"],authors:["polydoc-tech","sanket-a11y"],actions:[cu,uu,lu,Ks({baseUrl:o(()=>"https://api.podio.com","baseUrl"),auth:ye,authMapping:o(async e=>({Authorization:`Bearer ${e.props.apikey}`,"X-Sandbox":e.props.sandbox?"true":"false"}),"authMapping")})],triggers:[]});0&&(module.exports={polydoc});
5
+ Turn on **Sandbox** to test against sandbox quota (output is watermarked). Leave it off for production conversions.`,he=sr.CustomAuth({description:om,required:!0,props:{apiKey:sr.SecretText({displayName:"API Key",description:"Your PolyDoc API key from dashboard.polydoc.tech.",required:!0}),sandbox:T.Checkbox({displayName:"Sandbox",description:"Use sandbox quota (watermarked output).",required:!1,defaultValue:!1})},validate:o(async({auth:e})=>{let t=e.apiKey;if(!t)return{valid:!1,error:"API key is required."};try{return await Be.sendRequest({method:"POST",url:`${br.replace(/\/+$/,"")}${Tr}`,headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","X-Sandbox":e.sandbox?"true":"false"},body:{source:"<p>polydoc</p>",screenshot:{type:"png"}},responseType:"arraybuffer"}),{valid:!0}}catch(r){let n=r?.response?.status;return n===401?{valid:!1,error:"Invalid PolyDoc API key."}:{valid:!1,error:`Could not validate the PolyDoc API key (${n?`the API returned HTTP ${n}`:"the API was unreachable"}). Check the key and try again.`}}},"validate")});function vu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(vu,"isPlainObject");function xu(e,t){let r={...e};for(let[n,i]of Object.entries(t))vu(i)&&vu(r[n])?r[n]=xu(r[n],i):r[n]=i;return r}o(xu,"mergeDeep");function im(e){switch(e.sourceType){case"url":return e.url??"";case"html":return e.html??"";case"template":return`[template:${e.templateId??""}]`;default:return""}}o(im,"resolveSource");function am(e){let t={};typeof e.format=="string"&&e.format!==""&&(t.format=e.format);for(let n of["landscape","printBackground","outline","tagged"])typeof e[n]=="boolean"&&(t[n]=e[n]);return typeof e.scale=="number"&&(t.scale=e.scale),typeof e.pageRanges=="string"&&e.pageRanges!==""&&(t.pageRanges=e.pageRanges),["marginTop","marginRight","marginBottom","marginLeft"].some(n=>e[n]!==void 0&&e[n]!=="")&&(t.margin={top:e.marginTop??"2",right:e.marginRight??"1",bottom:e.marginBottom??"2",left:e.marginLeft??"1"}),Object.keys(t).length>0?t:void 0}o(am,"buildLayout");function sm(e){let t={};typeof e.imageType=="string"&&e.imageType!==""&&(t.type=e.imageType),typeof e.fullPage=="boolean"&&(t.fullPage=e.fullPage),typeof e.quality=="number"&&(t.quality=e.quality),e.encoding==="base64"&&(t.encoding="base64");let r=typeof e.viewportWidth=="number",n=typeof e.viewportHeight=="number";if(r!==n)throw new Error("Both viewport width and height are required to set a custom viewport.");if(r&&n){let i={width:e.viewportWidth,height:e.viewportHeight};typeof e.devicePixelRatio=="number"&&e.devicePixelRatio>0&&(i.devicePixelRatio=e.devicePixelRatio),t.viewport=i}return Object.keys(t).length>0?t:void 0}o(sm,"buildScreenshot");function We(e){let t=e.operation==="screenshot"?Tr:lu,r={source:im(e)};if(e.templateData&&Object.keys(e.templateData).length>0&&(r.templateData=e.templateData),e.filename&&(r.filename=e.filename),e.tag&&(r.tag=e.tag),typeof e.timeout=="number"&&e.timeout>0&&(r.timeout=e.timeout),e.operation==="pdf"){let c=e.pdfOptions?am(e.pdfOptions):void 0;c&&(r.layout=c)}if(e.operation==="screenshot"){let c=e.screenshotOptions?sm(e.screenshotOptions):void 0;c&&(r.screenshot=c)}if(e.operation==="einvoice"){let c={standard:e.eInvoiceStandard,profile:e.eInvoiceProfile,invoice:e.invoice??{}};typeof e.eInvoiceVerify=="boolean"&&(c.verify=e.eInvoiceVerify),r.eInvoice=c}let n=e.delivery??{mode:"download"},i=n.mode==="download";n.mode==="cloudStorage"&&n.presignedUrl&&(r.cloudStorage={presignedUrl:n.presignedUrl}),n.mode==="webhook"&&n.webhook&&(r.webhook=n.webhook);let u=e.advanced&&Object.keys(e.advanced).length>0?xu(r,e.advanced):r;return{endpoint:t,body:u,isBinary:i}}o(We,"buildRequestBody");function Pu(e,t){return e==="screenshot"?`screenshot.${t==="jpeg"?"jpg":t??"png"}`:"document.pdf"}o(Pu,"defaultFilename");async function Je(e,t){let r=br.replace(/\/+$/,""),n=await Be.sendRequest({method:"POST",url:`${r}${t.endpoint}`,headers:{Authorization:`Bearer ${e.props.apiKey}`,"Content-Type":"application/json","X-Sandbox":e.props.sandbox?"true":"false"},body:t.body,responseType:t.isBinary?"arraybuffer":"json"});return{status:n.status,headers:n.headers??{},body:n.body}}o(Je,"polyDocRequest");function Ke(e){let r=e?.response?.body;if(r instanceof ArrayBuffer?r=Buffer.from(r).toString("utf8"):Buffer.isBuffer(r)&&(r=r.toString("utf8")),typeof r=="string"){let n=r;try{r=JSON.parse(n)}catch{return n||void 0}}if(r&&typeof r=="object"&&!Array.isArray(r)){let n=r,i=n.message;if(typeof i=="string")return i;let u=n.error;if(typeof u=="string")return u}}o(Ke,"extractApiErrorMessage");async function Xe(e){let{response:t,isBinary:r,files:n,operation:i,filename:u,imageType:c}=e;if(!r)return t.body??{success:!0};let p=(On(t.headers["content-type"])??"application/octet-stream").split(";")[0].trim(),f=um(t.body),h=u||Pu(i,c);return{success:!0,file:await n.write({fileName:h,data:f}),fileName:h,contentType:p,sizeBytes:f.length,conversionId:On(t.headers["x-conversion-id"]),creditUsed:On(t.headers["x-credit-used"])}}o(Xe,"shapeOutput");function On(e){return Array.isArray(e)?e[0]:e}o(On,"headerValue");function um(e){if(Buffer.isBuffer(e))return e;if(e instanceof ArrayBuffer)return Buffer.from(e);if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);if(typeof e=="string")return Buffer.from(e,"binary");throw new Error("PolyDoc returned an unexpected response body for a binary delivery; expected file bytes.")}o(um,"toBuffer");var Ye=o((e="url")=>T.StaticDropdown({displayName:"Source Type",description:"Where the content comes from",required:!0,defaultValue:e,options:{disabled:!1,options:pu.map(t=>({label:t.label,value:t.value}))}}),"sourceTypeProp"),Qe=T.LongText({displayName:"Source",description:"The URL, inline HTML, or saved template ID, matching the Source Type above.",required:!0}),et=T.Json({displayName:"Template Data",description:"Data passed to the Liquid template renderer (used only when Source Type is Template).",required:!1,defaultValue:{}}),tt=T.StaticDropdown({displayName:"Delivery",description:"How the generated file is returned",required:!0,defaultValue:"download",options:{disabled:!1,options:du.map(e=>({label:e.label,value:e.value}))}}),rt=T.ShortText({displayName:"Presigned URL",description:"HTTP PUT presigned URL from your storage provider (required for Cloud Storage delivery).",required:!1}),nt=T.ShortText({displayName:"Webhook URL",description:"URL the generated file is delivered to (required for Webhook delivery).",required:!1}),ot=T.Json({displayName:"Webhook Options",description:"Extra webhook settings merged with the URL: async, method, headers, retries, retryDelay, timeout.",required:!1,defaultValue:{}}),it=T.ShortText({displayName:"Filename",description:"Output filename (overrides the default).",required:!1}),at=T.ShortText({displayName:"Tag",description:"Label for logging and analytics (max 30 characters).",required:!1}),st=T.Number({displayName:"Timeout (ms)",description:"Conversion timeout in milliseconds.",required:!1}),ut=T.Json({displayName:"Advanced (JSON)",description:"Raw fields deep-merged into the request body for any API option not exposed above (e.g. pdf.watermark, pdf.pdfa, render, request).",required:!1,defaultValue:{}});function Mt(e){let t=e;if(typeof t=="string"){let r=t.trim();if(r==="")return;try{t=JSON.parse(r)}catch{return}}if(t&&typeof t=="object"&&!Array.isArray(t)){let r=t;return Object.keys(r).length>0?r:void 0}}o(Mt,"asJsonObject");function ct(e){let t=e.sourceType??"url",r=e.source??"";return t==="html"?{sourceType:t,html:r}:t==="template"?{sourceType:t,templateId:r,templateData:Mt(e.templateData)}:{sourceType:t,url:r}}o(ct,"resolveSourceParams");function lt(e){let t=e.deliveryMode??"download";if(t==="cloudStorage"){let r=e.presignedUrl??"";if(!r)throw new Error("Cloud Storage delivery requires a Presigned URL.");return{mode:t,presignedUrl:r}}if(t==="webhook"){let r=e.webhookUrl??"";if(!r)throw new Error("Webhook delivery requires a Webhook URL.");let n=Mt(e.webhookOptions)??{};return{mode:t,webhook:{url:r,...n}}}return{mode:"download"}}o(lt,"resolveDelivery");function pt(e){return{filename:e.filename||void 0,tag:e.tag||void 0,timeout:typeof e.timeout=="number"?e.timeout:void 0,advanced:Mt(e.advanced)}}o(pt,"resolveMetadata");var _u=Ee({auth:he,name:"capture_screenshot",displayName:"Capture Screenshot",description:"Capture a screenshot of a URL, inline HTML, or a saved template.",aiMetadata:{description:"Captures a screenshot (PNG, JPEG, or WebP) of a URL, an inline HTML string, or a saved PolyDoc template. Supports full-page capture, custom viewport, and base64 or file output. Not idempotent: each call performs a fresh capture on PolyDoc that produces a new file and consumes account credits, and a URL capture reflects the page as it is at capture time.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,imageType:T.StaticDropdown({displayName:"Image Type",required:!1,defaultValue:"png",options:{disabled:!1,options:fu.map(e=>({label:e,value:e}))}}),fullPage:T.Checkbox({displayName:"Full Page",description:"Capture the entire scrollable page.",required:!1,defaultValue:!1}),quality:T.Number({displayName:"Quality",description:"Compression quality for JPEG/WebP (0 to 100).",required:!1}),viewportWidth:T.Number({displayName:"Viewport Width",description:"Viewport width in CSS pixels.",required:!1}),viewportHeight:T.Number({displayName:"Viewport Height",description:"Viewport height in CSS pixels.",required:!1}),devicePixelRatio:T.Number({displayName:"Device Pixel Ratio",description:"Device pixel ratio, e.g. 2 for retina (0 to 10).",required:!1}),outputEncoding:T.StaticDropdown({displayName:"Output",description:"Return the image as a file (default) or as a base64 string.",required:!1,defaultValue:"binaryFile",options:{disabled:!1,options:gu.map(e=>({label:e.label,value:e.value}))}}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r=t.outputEncoding==="base64",n={operation:"screenshot",...ct(t),...pt(t),delivery:lt(t),screenshotOptions:{imageType:t.imageType,fullPage:t.fullPage,quality:t.quality,encoding:r?"base64":void 0,viewportWidth:t.viewportWidth,viewportHeight:t.viewportHeight,devicePixelRatio:t.devicePixelRatio}},i=We(n);r&&(i.isBinary=!1);try{let u=await Je(e.auth,i);return await Xe({response:u,isBinary:i.isBinary,files:e.files,operation:"screenshot",filename:n.filename,imageType:t.imageType})}catch(u){throw new Error(Ke(u)??u.message)}}});var bu=Ee({auth:he,name:"convert_to_pdf",displayName:"Convert to PDF",description:"Convert HTML, a URL, or a saved template to a PDF.",aiMetadata:{description:"Converts a URL, an inline HTML string, or a saved PolyDoc template into a PDF and returns the file (or delivers it to cloud storage / a webhook). Use it to render documents like invoices, reports, or contracts. Not idempotent: each call performs a fresh conversion on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("url"),source:Qe,templateData:et,format:T.StaticDropdown({displayName:"Page Format",required:!1,defaultValue:"A4",options:{disabled:!1,options:mu.map(e=>({label:e,value:e}))}}),landscape:T.Checkbox({displayName:"Landscape",required:!1,defaultValue:!1}),printBackground:T.Checkbox({displayName:"Print Background",description:"Print background graphics and colors.",required:!1,defaultValue:!0}),scale:T.Number({displayName:"Scale",description:"Render scale (0.1 to 2).",required:!1}),pageRanges:T.ShortText({displayName:"Page Ranges",description:'Pages to include, e.g. "1-5, 8". Empty means all pages.',required:!1}),outline:T.Checkbox({displayName:"Outline (Bookmarks)",description:"Generate PDF bookmarks from HTML headings.",required:!1,defaultValue:!1}),tagged:T.Checkbox({displayName:"Tagged (Accessible)",description:"Produce a tagged, accessible PDF.",required:!1,defaultValue:!1}),marginTop:T.ShortText({displayName:"Margin Top",description:"Top margin with optional unit, e.g. 10mm, 1cm, 0.5in.",required:!1}),marginRight:T.ShortText({displayName:"Margin Right",required:!1}),marginBottom:T.ShortText({displayName:"Margin Bottom",required:!1}),marginLeft:T.ShortText({displayName:"Margin Left",required:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"pdf",...ct(t),...pt(t),delivery:lt(t),pdfOptions:{format:t.format,landscape:t.landscape,printBackground:t.printBackground,scale:t.scale,pageRanges:t.pageRanges,outline:t.outline,tagged:t.tagged,marginTop:t.marginTop,marginRight:t.marginRight,marginBottom:t.marginBottom,marginLeft:t.marginLeft}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"pdf",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var cm={number:"INV-001",issueDate:"2026-01-31",dueDate:"2026-03-02",currencyCode:"EUR",seller:{name:"Your Company GmbH",address:{line1:"Main St 1",city:"Berlin",postalCode:"10115",countryCode:"DE"},taxId:"DE123456789"},buyer:{name:"Customer SARL",address:{line1:"Rue 2",city:"Paris",postalCode:"75001",countryCode:"FR"}},lines:[{description:"Widget",quantity:2,unitPrice:10,lineTotal:20,vatRate:19,vatCategoryCode:"S"}],taxSummary:[{categoryCode:"S",rate:19,taxableAmount:20,taxAmount:3.8}],paymentTerms:"Net 30 days",totalNetAmount:20,totalTaxAmount:3.8,totalGrossAmount:23.8},Tu=Ee({auth:he,name:"generate_einvoice",displayName:"Generate E-Invoice",description:"Generate a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) from a visual layout plus structured invoice data.",aiMetadata:{description:"Generates a hybrid e-invoice PDF (Factur-X / ZUGFeRD, EN 16931) by embedding structured invoice XML into a visual PDF layout. EN 16931 requires payment terms or a due date, a seller tax ID for VAT category S, and consistent totals. Not idempotent: each call performs a fresh generation on PolyDoc that produces a new file and consumes account credits, and the cloud-storage and webhook delivery modes send the file to an external destination.",idempotent:!1},props:{sourceType:Ye("html"),source:Qe,templateData:et,standard:T.StaticDropdown({displayName:"Standard",description:"The hybrid e-invoice standard to embed.",required:!0,defaultValue:"zugferd",options:{disabled:!1,options:yu.map(e=>({label:e.label,value:e.value}))}}),profile:T.StaticDropdown({displayName:"Profile",description:"The data granularity profile to validate against.",required:!0,defaultValue:"en16931",options:{disabled:!1,options:hu.map(e=>({label:e,value:e}))}}),invoice:T.Json({displayName:"Invoice Data",description:"Structured invoice data: number, dates, currency, seller, buyer, lines, totals. EN 16931 needs payment terms (or due date), seller taxId for VAT category S, and consistent totals. See docs.polydoc.tech.",required:!0,defaultValue:cm}),verify:T.Checkbox({displayName:"Verify",description:"Validate PDF/A and e-invoice compliance (returns an error if it fails).",required:!1,defaultValue:!1}),deliveryMode:tt,presignedUrl:rt,webhookUrl:nt,webhookOptions:ot,filename:it,tag:at,timeout:st,advanced:ut},async run(e){let t=e.propsValue,r={operation:"einvoice",...ct(t),...pt(t),delivery:lt(t),eInvoiceStandard:t.standard,eInvoiceProfile:t.profile,eInvoiceVerify:t.verify===!0,invoice:Mt(t.invoice)??{}},n=We(r);try{let i=await Je(e.auth,n);return await Xe({response:i,isBinary:n.isBinary,files:e.files,operation:"einvoice",filename:r.filename})}catch(i){throw new Error(Ke(i)??i.message)}}});var lm=Wi({displayName:"PolyDoc",description:"Convert HTML or a URL to PDF, capture screenshots, and generate EU e-invoices (Factur-X / ZUGFeRD).",auth:he,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/polydoc.png",categories:["CONTENT_AND_FILES","PRODUCTIVITY"],authors:["polydoc-tech","sanket-a11y"],actions:[bu,_u,Tu,cu({baseUrl:o(()=>"https://api.podio.com","baseUrl"),auth:he,authMapping:o(async e=>({Authorization:`Bearer ${e.props.apikey}`,"X-Sandbox":e.props.sandbox?"true":"false"}),"authMapping")})],triggers:[]});0&&(module.exports={polydoc});
6
6
  /*! Bundled license information:
7
7
 
8
8
  mime-types/index.js: