@activepieces/piece-bokio 0.0.8 → 0.0.9

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 +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/piece-bokio",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "dependencies": {},
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var nu=Object.create;var Je=Object.defineProperty;var ou=Object.getOwnPropertyDescriptor;var iu=Object.getOwnPropertyNames;var au=Object.getPrototypeOf,su=Object.prototype.hasOwnProperty;var o=(e,t)=>Je(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},gn=(e,t)=>{for(var r in t)Je(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of iu(t))!su.call(e,i)&&i!==r&&Je(e,i,{get:()=>t[i],enumerable:!(n=ou(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?nu(au(e)):{},yn(t||!e||!e.__esModule?Je(r,"default",{value:e,enumerable:!0}):r,e)),uu=e=>yn(Je({},"__esModule",{value:!0}),e);var jo=S((Lo,Ft)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(p.zoneIndex)||[])[0],b,L;for(x&&(x=x.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)y++;if(s.substr(0,2)==="::"&&y--,s.substr(-2,2)==="::"&&y--,y>d)return null;for(L=d-y,b=":";L--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ae=[];for(let Ke=0;Ke<re.length;Ke++)ae.push(parseInt(re[Ke],16));return ae})(),{parts:d,zoneId:x}}o(f,"expandIPv6");function g(s,d,y,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let x=0,b;for(;m>0;){if(b=y-m,b<0&&(b=0),s[x]>>b!==d[x]>>b)return!1;m-=y,x+=1}return!0}o(g,"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 T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let v={};v.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let y,m;for(y=0;y<d.length;y++)if(m=d[y],!(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,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return g(this.octets,d.octets,8,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},x,b,L;for(x=3;x>=0;x-=1)if(b=this.octets[x],b in m){if(L=m[b],y&&L!==0)return null;L!==8&&(y=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return v.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),v.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<4;)x.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.IPv4.isIPv4=function(s){return this.parser(s)!==null},v.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},v.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},v.IPv4.isValidFourPartDecimal=function(s){return!!(v.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},v.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!v.IPv4.isValidCIDR(s)||!d?!1:v.IPv4.isValidFourPartDecimal(d[1])},v.IPv4.networkAddressFromCIDR=function(s){let d,y,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<4;)x.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(x)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},v.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)},v.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let y=parseInt(d[2]);if(y>=0&&y<=32){let m=[this.parse(d[1]),y];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")},v.IPv4.parser=function(s){let d,y,m;if(d=s.match(r.fourOctet))return(function(){let x=d.slice(1,6),b=[];for(let L=0;L<x.length;L++)y=x[L],b.push(P(y));return b})();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 x=[],b;for(b=0;b<=24;b+=8)x.push(m>>b&255);return x})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let x=d.slice(1,4),b=[];if(m=P(x[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let x=d.slice(1,5),b=[];if(m=P(x[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(P(x[0])),b.push(P(x[1])),b.push(m>>8&255),b.push(m&255),b})():null},v.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],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},v.IPv6=(function(){function s(d,y){let m,x;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(x=this.parts[m],!(0<=x&&x<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");y&&(this.zoneId=y)}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,y){let m;if(y===void 0&&(m=d,d=m[0],y=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return g(this.parts,d.parts,16,y)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,y=!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},x,b;for(let L=7;L>=0;L-=1)if(x=this.parts[L],x in m){if(b=m[x],y&&b!==0)return null;b!==16&&(y=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return v.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,y=[],m=this.parts;for(let x=0;x<m.length;x++)d=m[x],y.push(d>>8),y.push(d&255);return y},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(T(this.parts[x].toString(16),4));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},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),y=d[0],m=d[1];return new v.IPv4([y>>8,y&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let x=0;x<this.parts.length;x++)m.push(this.parts[x].toString(16));return m}).call(this).join(":"),y="";return this.zoneId&&(y=`%${this.zoneId}`),d+y},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,y=this.toNormalizedString(),m=0,x=-1,b;for(;b=d.exec(y);)b[0].length>x&&(m=b.index,x=b[0].length);return x<0?y:`${y.substring(0,m)}::${y.substring(m+x)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),v.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),y=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],b=0;for(;b<16;)x.push(parseInt(y[b],10)|parseInt(m[b],10)^255),b++;return new this(x)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},v.IPv6.isIPv6=function(s){return this.parser(s)!==null},v.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}},v.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},v.IPv6.networkAddressFromCIDR=function(s){let d,y,m,x,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),x=[],y=0;y<16;)x.push(parseInt(m[y],10)&parseInt(b[y],10)),y++;return new this(x)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},v.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)},v.IPv6.parseCIDR=function(s){let d,y,m;if((y=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(y[2]),d>=0&&d<=128))return m=[this.parse(y[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")},v.IPv6.parser=function(s){let d,y,m,x,b,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(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y<b.length;y++)if(x=b[y],!(0<=x&&x<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},v.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],y=0,m=Math.floor(s/8);for(;y<m;)d[y]=255,y++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},v.fromByteArray=function(s){let d=s.length;if(d===4)return new v.IPv4(s);if(d===16)return new v.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},v.isValid=function(s){return v.IPv6.isValid(s)||v.IPv4.isValid(s)},v.isValidCIDR=function(s){return v.IPv6.isValidCIDR(s)||v.IPv4.isValidCIDR(s)},v.parse=function(s){if(v.IPv6.isValid(s))return v.IPv6.parse(s);if(v.IPv4.isValid(s))return v.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},v.parseCIDR=function(s){try{return v.IPv6.parseCIDR(s)}catch{try{return v.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},v.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},v.subnetMatch=function(s,d,y){let m,x,b,L;y==null&&(y="unicast");for(x in d)if(Object.prototype.hasOwnProperty.call(d,x)){for(b=d[x],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(L=b[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return x}return y},typeof Ft<"u"&&Ft.exports?Ft.exports=v:e.ipaddr=v})(Lo)});var Bi=S((_A,ji)=>{var Li=require("stream").Stream,Vp=require("util");ji.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");Vp.inherits(ce,Li);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Li.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ce.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Hi=S((IA,Vi)=>{var Hp=require("util"),Zi=require("stream").Stream,Fi=Bi();Vi.exports=J;function J(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(J,"CombinedStream");Hp.inherits(J,Zi);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Fi)){var r=Fi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};J.prototype.pipe=function(e,t){return Zi.prototype.pipe.call(this,e,t),this.resume(),e};J.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};J.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Gi=S((EA,qi)=>{"use strict";qi.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 Ji=S(te=>{"use strict";var Wt=Gi(),qp=require("path").extname,Wi=/^\s*([^;\s]*)(?:;|\s|$)/,Gp=/^text\//i;te.charset=Ki;te.charsets={lookup:Ki};te.contentType=Wp;te.extension=Kp;te.extensions=Object.create(null);te.lookup=Jp;te.types=Object.create(null);Xp(te.extensions,te.types);function Ki(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Gp.test(t[1])?"UTF-8":!1}o(Ki,"charset");function Wp(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(Wp,"contentType");function Kp(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Kp,"extension");function Jp(e){if(!e||typeof e!="string")return!1;var t=qp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Jp,"lookup");function Xp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var f=c[p];if(t[f]){var g=r.indexOf(Wt[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(g>P||g===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Xp,"populateMaps")});var Yi=S((AA,Xi)=>{Xi.exports=Yp;function Yp(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Yp,"defer")});var Hr=S((OA,ea)=>{var Qi=Yi();ea.exports=Qp;function Qp(e){var t=!1;return Qi(function(){t=!0}),o(function(n,i){t?e(n,i):Qi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Qp,"async")});var qr=S((wA,ta)=>{ta.exports=el;function el(e){Object.keys(e.jobs).forEach(tl.bind(e)),e.jobs={}}o(el,"abort");function tl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(tl,"clean")});var Gr=S((NA,na)=>{var ra=Hr(),rl=qr();na.exports=nl;function nl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=ol(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?rl(r):r.results[i]=c,n(u,r.results))})}o(nl,"iterate");function ol(e,t,r,n){var i;return e.length==2?i=e(r,ra(n)):i=e(r,t,ra(n)),i}o(ol,"runJob")});var Wr=S((CA,oa)=>{oa.exports=il;function il(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(il,"state")});var Kr=S((MA,ia)=>{var al=qr(),sl=Hr();ia.exports=ul;function ul(e){Object.keys(this.jobs).length&&(this.index=this.size,al(this),sl(e)(null,this.results))}o(ul,"terminator")});var sa=S((jA,aa)=>{var cl=Gr(),pl=Wr(),ll=Kr();aa.exports=dl;function dl(e,t,r){for(var n=pl(e);n.index<(n.keyedList||e).length;)cl(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return ll.bind(n,r)}o(dl,"parallel")});var Jr=S((FA,Kt)=>{var ua=Gr(),ml=Wr(),fl=Kr();Kt.exports=gl;Kt.exports.ascending=ca;Kt.exports.descending=yl;function gl(e,t,r,n){var i=ml(e,r);return ua(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ua(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),fl.bind(i,n)}o(gl,"serialOrdered");function ca(e,t){return e<t?-1:e>t?1:0}o(ca,"ascending");function yl(e,t){return-1*ca(e,t)}o(yl,"descending")});var la=S((VA,pa)=>{var hl=Jr();pa.exports=vl;function vl(e,t,r){return hl(e,t,null,r)}o(vl,"serial")});var ma=S((qA,da)=>{da.exports={parallel:sa(),serial:la(),serialOrdered:Jr()}});var Xr=S((GA,fa)=>{"use strict";fa.exports=Object});var ya=S((WA,ga)=>{"use strict";ga.exports=Error});var va=S((KA,ha)=>{"use strict";ha.exports=EvalError});var Pa=S((JA,xa)=>{"use strict";xa.exports=RangeError});var ba=S((XA,_a)=>{"use strict";_a.exports=ReferenceError});var Ta=S((YA,Ia)=>{"use strict";Ia.exports=SyntaxError});var Jt=S((QA,Ea)=>{"use strict";Ea.exports=TypeError});var $a=S((ez,Sa)=>{"use strict";Sa.exports=URIError});var za=S((tz,Aa)=>{"use strict";Aa.exports=Math.abs});var ka=S((rz,Oa)=>{"use strict";Oa.exports=Math.floor});var Ra=S((nz,wa)=>{"use strict";wa.exports=Math.max});var Da=S((oz,Na)=>{"use strict";Na.exports=Math.min});var Ua=S((iz,Ca)=>{"use strict";Ca.exports=Math.pow});var La=S((az,Ma)=>{"use strict";Ma.exports=Math.round});var Ba=S((sz,ja)=>{"use strict";ja.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Za=S((cz,Fa)=>{"use strict";var xl=Ba();Fa.exports=o(function(t){return xl(t)||t===0?t:t<0?-1:1},"sign")});var Ha=S((lz,Va)=>{"use strict";Va.exports=Object.getOwnPropertyDescriptor});var Yr=S((dz,qa)=>{"use strict";var Xt=Ha();if(Xt)try{Xt([],"length")}catch{Xt=null}qa.exports=Xt});var Wa=S((mz,Ga)=>{"use strict";var Yt=Object.defineProperty||!1;if(Yt)try{Yt({},"a",{value:1})}catch{Yt=!1}Ga.exports=Yt});var Qr=S((fz,Ka)=>{"use strict";Ka.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 Ya=S((yz,Xa)=>{"use strict";var Ja=typeof Symbol<"u"&&Symbol,Pl=Qr();Xa.exports=o(function(){return typeof Ja!="function"||typeof Symbol!="function"||typeof Ja("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Pl()},"hasNativeSymbols")});var en=S((vz,Qa)=>{"use strict";Qa.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var tn=S((xz,es)=>{"use strict";var _l=Xr();es.exports=_l.getPrototypeOf||null});var ns=S((Pz,rs)=>{"use strict";var bl="Function.prototype.bind called on incompatible ",Il=Object.prototype.toString,Tl=Math.max,El="[object Function]",ts=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"),Sl=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"),$l=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");rs.exports=o(function(t){var r=this;if(typeof r!="function"||Il.apply(r)!==El)throw new TypeError(bl+r);for(var n=Sl(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,ts(n,arguments));return Object(P)===P?P:this}return r.apply(t,ts(n,arguments))},"binder"),c=Tl(0,r.length-n.length),p=[],f=0;f<c;f++)p[f]="$"+f;if(i=Function("binder","return function ("+$l(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var g=o(function(){},"Empty");g.prototype=r.prototype,i.prototype=new g,g.prototype=null}return i},"bind")});var Ze=S((bz,os)=>{"use strict";var Al=ns();os.exports=Function.prototype.bind||Al});var Qt=S((Iz,is)=>{"use strict";is.exports=Function.prototype.call});var rn=S((Tz,as)=>{"use strict";as.exports=Function.prototype.apply});var us=S((Ez,ss)=>{"use strict";ss.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ps=S((Sz,cs)=>{"use strict";var zl=Ze(),Ol=rn(),kl=Qt(),wl=us();cs.exports=wl||zl.call(kl,Ol)});var ds=S(($z,ls)=>{"use strict";var Rl=Ze(),Nl=Jt(),Dl=Qt(),Cl=ps();ls.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Nl("a function is required");return Cl(Rl,Dl,t)},"callBindBasic")});var vs=S((zz,hs)=>{"use strict";var Ul=ds(),ms=Yr(),gs;try{gs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var nn=!!gs&&ms&&ms(Object.prototype,"__proto__"),ys=Object,fs=ys.getPrototypeOf;hs.exports=nn&&typeof nn.get=="function"?Ul([nn.get]):typeof fs=="function"?o(function(t){return fs(t==null?t:ys(t))},"getDunder"):!1});var Is=S((kz,bs)=>{"use strict";var xs=en(),Ps=tn(),_s=vs();bs.exports=xs?o(function(t){return xs(t)},"getProto"):Ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ps(t)},"getProto"):_s?o(function(t){return _s(t)},"getProto"):null});var on=S((Rz,Ts)=>{"use strict";var Ml=Function.prototype.call,Ll=Object.prototype.hasOwnProperty,jl=Ze();Ts.exports=jl.call(Ml,Ll)});var ks=S((Nz,Os)=>{"use strict";var M,Bl=Xr(),Fl=ya(),Zl=va(),Vl=Pa(),Hl=ba(),Ge=Ta(),qe=Jt(),ql=$a(),Gl=za(),Wl=ka(),Kl=Ra(),Jl=Da(),Xl=Ua(),Yl=La(),Ql=Za(),As=Function,an=o(function(e){try{return As('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),vt=Yr(),ed=Wa(),sn=o(function(){throw new qe},"throwTypeError"),td=vt?(function(){try{return arguments.callee,sn}catch{try{return vt(arguments,"callee").get}catch{return sn}}})():sn,Ve=Ya()(),Q=Is(),rd=tn(),nd=en(),zs=rn(),xt=Qt(),He={},od=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&Q?Q([][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%":Fl,"%eval%":eval,"%EvalError%":Zl,"%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%":As,"%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%":Ve&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Bl,"%Object.getOwnPropertyDescriptor%":vt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Vl,"%ReferenceError%":Hl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Ve?Symbol:M,"%SyntaxError%":Ge,"%ThrowTypeError%":td,"%TypedArray%":od,"%TypeError%":qe,"%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%":ql,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":xt,"%Function.prototype.apply%":zs,"%Object.defineProperty%":ed,"%Object.getPrototypeOf%":rd,"%Math.abs%":Gl,"%Math.floor%":Wl,"%Math.max%":Kl,"%Math.min%":Jl,"%Math.pow%":Xl,"%Math.round%":Yl,"%Math.sign%":Ql,"%Reflect.getPrototypeOf%":nd};if(Q)try{null.error}catch(e){Es=Q(Q(e)),Ne["%Error.prototype%"]=Es}var Es,id=o(function e(t){var r;if(t==="%AsyncFunction%")r=an("async function () {}");else if(t==="%GeneratorFunction%")r=an("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=an("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Ne[t]=r,r},"doEval"),Ss={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pt=Ze(),er=on(),ad=Pt.call(xt,Array.prototype.concat),sd=Pt.call(zs,Array.prototype.splice),$s=Pt.call(xt,String.prototype.replace),tr=Pt.call(xt,String.prototype.slice),ud=Pt.call(xt,RegExp.prototype.exec),cd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pd=/\\(\\)?/g,ld=o(function(t){var r=tr(t,0,1),n=tr(t,-1);if(r==="%"&&n!=="%")throw new Ge("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ge("invalid intrinsic syntax, expected opening `%`");var i=[];return $s(t,cd,function(u,c,p,f){i[i.length]=p?$s(f,pd,"$1"):c||u}),i},"stringToPath"),dd=o(function(t,r){var n=t,i;if(er(Ss,n)&&(i=Ss[n],n="%"+i[0]+"%"),er(Ne,n)){var u=Ne[n];if(u===He&&(u=id(n)),typeof u>"u"&&!r)throw new qe("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ge("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Os.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new qe("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new qe('"allowMissing" argument must be a boolean');if(ud(/^%?[^%]*%?$/,t)===null)throw new Ge("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ld(t),i=n.length>0?n[0]:"",u=dd("%"+i+"%",r),c=u.name,p=u.value,f=!1,g=u.alias;g&&(i=g[0],sd(n,ad([0,1],g)));for(var P=1,T=!0;P<n.length;P+=1){var v=n[P],s=tr(v,0,1),d=tr(v,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ge("property names with quotes must have matching quotes");if((v==="constructor"||!T)&&(f=!0),i+="."+v,c="%"+i+"%",er(Ne,c))p=Ne[c];else if(p!=null){if(!(v in p)){if(!r)throw new qe("base intrinsic for "+t+" exists, but the property is not available.");return}if(vt&&P+1>=n.length){var y=vt(p,v);T=!!y,T&&"get"in y&&!("originalValue"in y.get)?p=y.get:p=p[v]}else T=er(p,v),p=p[v];T&&!f&&(Ne[c]=p)}}return p},"GetIntrinsic")});var Rs=S((Cz,ws)=>{"use strict";var md=Qr();ws.exports=o(function(){return md()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Cs=S((Mz,Ds)=>{"use strict";var fd=ks(),Ns=fd("%Object.defineProperty%",!0),gd=Rs()(),yd=on(),hd=Jt(),rr=gd?Symbol.toStringTag:null;Ds.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new hd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");rr&&(n||!yd(t,rr))&&(Ns?Ns(t,rr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[rr]=r)},"setToStringTag")});var Ms=S((jz,Us)=>{"use strict";var vd=Function.prototype.call,xd=Object.prototype.hasOwnProperty,Pd=Ze();Us.exports=Pd.call(vd,xd)});var js=S((Bz,Ls)=>{"use strict";Ls.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Zs=S((Fz,Fs)=>{"use strict";var ln=Hi(),_d=require("util"),un=require("path"),bd=require("http"),Id=require("https"),Td=require("url").parse,Ed=require("fs"),Sd=require("stream").Stream,$d=require("crypto"),cn=Ji(),Ad=ma(),zd=Cs(),ze=Ms(),pn=js();function Bs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Bs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");_d.inherits(j,ln);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=ln.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&&ze(t,"httpVersion"))&&!(t instanceof Sd))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){ze(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Ed.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ze(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ze(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="'+Bs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(c,r.header);var p;for(var f in c)if(ze(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=un.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=un.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ze(e,"httpVersion")&&(r=un.basename(e.client._httpMessage.path||"")),r)return'filename="'+Bs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=cn.lookup(e.name)),!r&&e&&e.path&&(r=cn.lookup(e.path)),!r&&e&&e.readable&&ze(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=cn.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)ze(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="--------------------------"+$d.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Ad.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Td(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Id.request(n):r=bd.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var p,f=o(function(g,P){return r.removeListener("error",f),r.removeListener("response",p),t.call(this,g,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]"};zd(j.prototype,"FormData");Fs.exports=j});var jd={};gn(jd,{bokio:()=>Ld});module.exports=uu(jd);var cu=Object.freeze({status:"aborted"});function I(e,t,r){function n(p,f){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,f);let g=c.prototype,P=Object.keys(g);for(let T=0;T<P.length;T++){let v=P[T];v in p||(p[v]=g[v].bind(p))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(p){var f;let g=r?.Parent?new u:this;n(g,p),(f=g._zod).deferred??(f.deferred=[]);for(let P of g._zod.deferred)P();return g}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},bt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ir={};function fe(e){return e&&Object.assign(ir,e),ir}o(fe,"config");function sr(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(sr,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function Tt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Tt,"cached");function xn(e){return e==null}o(xn,"nullish");function Et(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Et,"cleanRegex");var hn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Xe,"isObject");var pu=Tt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pn(e){if(Xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Xe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(Pn,"isPlainObject");var _n=new Set(["string","number","symbol"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ce,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function H(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(H,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var In={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 Ue(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(Ue,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(_e,"prefixIssues");function It(e){return typeof e=="string"?e:e?.message}o(It,"unwrapMessage");function be(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(r.customError?.(e))??It(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(be,"finalizeIssue");function Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(cr,"issue");var En=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sn=I("$ZodError",En),Ye=I("$ZodError",En,{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 pe;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw ur(p,i?.callee),p}return c.value},"_parse"),$t=du(Ye),mu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let p=new(i?.Err??e)(c.issues.map(f=>be(f,u,fe())));throw ur(p,i?.callee),p}return c.value},"_parseAsync"),At=mu(Ye),fu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new pe;return u.issues.length?{success:!1,error:new(e??Sn)(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),Qe=fu(Ye),gu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>be(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),et=gu(Ye);var yu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",hu=new RegExp(`^${yu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),An=/^-?\d+n?$/,zn=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,On=/^(?:true|false)$/i;var Ie=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),vu={number:"number",bigint:"bigint",object:"date"};var kn=I("$ZodCheckGreaterThan",(e,t)=>{Ie.init(e,t);let r=vu[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var wn=I("$ZodCheckNumberFormat",(e,t)=>{Ie.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=In[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=zn)}),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 Rn=I("$ZodCheckMinLength",(e,t)=>{var r;Ie.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var lr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Ie.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=()=>{})}),Nn=I("$ZodCheckRegex",(e,t)=>{lr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Cn={major:4,minor:3,patch:6};var G=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,p,f)=>{let g=Ue(c),P;for(let T of p){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(g)continue;let v=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new pe;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==v&&(g||(g=Ue(c,v)))});else{if(c.issues.length===v)continue;g||(g=Ue(c,v))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,p,f)=>{if(Ue(c))return c.aborted=!0,c;let g=i(p,n,f);if(g instanceof Promise){if(f.async===!1)throw new pe;return g.then(P=>e._zod.parse(P,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return g instanceof Promise?g.then(P=>u(P,c,p)):u(g,c,p)}let f=e._zod.parse(c,p);if(f instanceof Promise){if(p.async===!1)throw new pe;return f.then(g=>i(g,n,p))}return i(f,n,p)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=Qe(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return et(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),kt=I("$ZodString",(e,t)=>{G.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),dr=I("$ZodStringFormat",(e,t)=>{lr.init(e,t),kt.init(e,t)});var Bn=I("$ZodURL",(e,t)=>{dr.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 mr=I("$ZodNumber",(e,t)=>{G.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,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}}),Fn=I("$ZodNumberFormat",(e,t)=>{wn.init(e,t),mr.init(e,t)}),fr=I("$ZodBoolean",(e,t)=>{G.init(e,t),e._zod.pattern=On,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}}),Zn=I("$ZodBigInt",(e,t)=>{G.init(e,t),e._zod.pattern=An,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 Vn=I("$ZodAny",(e,t)=>{G.init(e,t),e._zod.parse=r=>r}),Hn=I("$ZodUnknown",(e,t)=>{G.init(e,t),e._zod.parse=r=>r});var qn=I("$ZodVoid",(e,t)=>{G.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}}),Gn=I("$ZodDate",(e,t)=>{G.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 Un(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}o(Un,"handleArrayResult");var Wn=I("$ZodArray",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],f=t.element._zod.run({value:p,issues:[]},n);f instanceof Promise?u.push(f.then(g=>Un(g,r,c))):Un(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Ot(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(..._e(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Ot,"handlePropertyResult");function xu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(xu,"normalizeDef");function Pu(e,t,r,n,i,u){let c=[],p=i.keySet,f=i.catchall._zod,g=f.def.type,P=f.optout==="optional";for(let T in t){if(p.has(T))continue;if(g==="never"){c.push(T);continue}let v=f.run({value:t[T],issues:[]},n);v instanceof Promise?e.push(v.then(s=>Ot(s,r,T,t,P))):Ot(v,r,T,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(Pu,"handleCatchall");var Kn=I("$ZodObject",(e,t)=>{if(G.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=Tt(()=>xu(t));X(e._zod,"propValues",()=>{let p=t.shape,f={};for(let g in p){let P=p[g]._zod;if(P.values){f[g]??(f[g]=new Set);for(let T of P.values)f[g].add(T)}}return f});let i=Xe,u=t.catchall,c;e._zod.parse=(p,f)=>{c??(c=n.value);let g=p.value;if(!i(g))return p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p;p.value={};let P=[],T=c.shape;for(let v of c.keys){let s=T[v],d=s._zod.optout==="optional",y=s._zod.run({value:g[v],issues:[]},f);y instanceof Promise?P.push(y.then(m=>Ot(m,p,v,g,d))):Ot(y,p,v,g,d)}return u?Pu(P,g,p,f,n.value,e):P.length?Promise.all(P).then(()=>p):p}});function Mn(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=>!Ue(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=>be(c,n,fe())))}),t)}o(Mn,"handleUnionResults");var gr=I("$ZodUnion",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Et(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,p=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)p.push(g),c=!0;else{if(g.issues.length===0)return g;p.push(g)}}return c?Promise.all(p).then(f=>Mn(f,i,e,u)):Mn(p,i,e,u)}});var Jn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;X(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[p,f]of Object.entries(c)){i[p]||(i[p]=new Set);for(let g of f)i[p].add(g)}}return i});let n=Tt(()=>{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(!Xe(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 Xn=I("$ZodRecord",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Pn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let p=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){p.add(typeof g=="number"?g.toString():g);let P=t.valueType._zod.run({value:i[g],issues:[]},n);P instanceof Promise?u.push(P.then(T=>{T.issues.length&&r.issues.push(..._e(g,T.issues)),r.value[g]=T.value})):(P.issues.length&&r.issues.push(..._e(g,P.issues)),r.value[g]=P.value)}let f;for(let g in i)p.has(g)||(f=f??[],f.push(g));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let f=t.keyType._zod.run({value:p,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&pr.test(p)&&f.issues.length){let T=t.keyType._zod.run({value:Number(p),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(f=T)}if(f.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(T=>be(T,n,fe())),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(T=>{T.issues.length&&r.issues.push(..._e(p,T.issues)),r.value[f.value]=T.value})):(P.issues.length&&r.issues.push(..._e(p,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Yn=I("$ZodEnum",(e,t)=>{G.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>_n.has(typeof i)).map(i=>typeof i=="string"?Ce(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}}),Qn=I("$ZodLiteral",(e,t)=>{if(G.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"?Ce(n):n?Ce(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 eo=I("$ZodTransform",(e,t)=>{G.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new bt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Ln(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Ln,"handleOptionalResult");var to=I("$ZodOptional",(e,t)=>{G.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Ln(u,r.value)):Ln(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ro=I("$ZodNullable",(e,t)=>{G.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Et(r.source)}|null)$`):void 0}),X(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 no=I("$ZodPipe",(e,t)=>{G.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>zt(c,t.in,n)):zt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>zt(u,t.out,n)):zt(i,t.out,n)}});function zt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(zt,"handlePipeResult");var oo=I("$ZodCustom",(e,t)=>{Ie.init(e,t),G.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=>jn(u,r,n,e));jn(i,r,n,e)}});function jn(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(cr(i))}}o(jn,"handleRefineResult");var ao;var yr=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 so(){return new yr}o(so,"registry");(ao=globalThis).__zod_globalRegistry??(ao.__zod_globalRegistry=so());var hr=globalThis.__zod_globalRegistry;function uo(e,t){return new e({type:"string",...H(t)})}o(uo,"_string");function co(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(co,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(po,"_url");function lo(e,t){return new e({type:"number",checks:[],...H(t)})}o(lo,"_number");function mo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(mo,"_coercedNumber");function fo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(fo,"_int");function go(e,t){return new e({type:"boolean",...H(t)})}o(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}o(vo,"_any");function xo(e){return new e({type:"unknown"})}o(xo,"_unknown");function Po(e,t){return new e({type:"void",...H(t)})}o(Po,"_void");function _o(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(_o,"_coercedDate");function wt(e,t){return new kn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(wt,"_gte");function se(e,t){return new Rn({check:"min_length",...H(t),minimum:e})}o(se,"_minLength");function Te(e,t){return new Nn({check:"string_format",format:"regex",...H(t),pattern:e})}o(Te,"_regex");function bo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(bo,"_custom");var Y=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");G.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Qe(e,r,n),e.parseAsync=async(r,n)=>At(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>et(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>St(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Nt=I("ZodMiniString",(e,t)=>{kt.init(e,t),Y.init(e,t)});function a(e){return uo(Nt,e)}o(a,"string");var Io=I("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Nt.init(e,t)});var Ru=I("ZodMiniURL",(e,t)=>{Bn.init(e,t),Io.init(e,t)});function To(e){return po(Ru,e)}o(To,"url");var Dt=I("ZodMiniNumber",(e,t)=>{mr.init(e,t),Y.init(e,t)});function ee(e){return lo(Dt,e)}o(ee,"number");var Nu=I("ZodMiniNumberFormat",(e,t)=>{Fn.init(e,t),Dt.init(e,t)});function Eo(e){return fo(Nu,e)}o(Eo,"int");var vr=I("ZodMiniBoolean",(e,t)=>{fr.init(e,t),Y.init(e,t)});function F(e){return go(vr,e)}o(F,"boolean");var So=I("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),Y.init(e,t)});var Du=I("ZodMiniAny",(e,t)=>{Vn.init(e,t),Y.init(e,t)});function rt(){return vo(Du)}o(rt,"any");var Cu=I("ZodMiniUnknown",(e,t)=>{Hn.init(e,t),Y.init(e,t)});function k(){return xo(Cu)}o(k,"unknown");var Uu=I("ZodMiniVoid",(e,t)=>{qn.init(e,t),Y.init(e,t)});function $o(e){return Po(Uu,e)}o($o,"_void");var Ao=I("ZodMiniDate",(e,t)=>{Gn.init(e,t),Y.init(e,t)});var Mu=I("ZodMiniArray",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function N(e,t){return new Mu({type:"array",element:e,...H(t)})}o(N,"array");var Lu=I("ZodMiniObject",(e,t)=>{Kn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...H(t)};return new Lu(r)}o(l,"object");var ju=I("ZodMiniUnion",(e,t)=>{gr.init(e,t),Y.init(e,t)});function D(e,t){return new ju({type:"union",options:e,...H(t)})}o(D,"union");var Bu=I("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function Ee(e,t,r){return new Bu({type:"union",options:t,discriminator:e,...H(r)})}o(Ee,"discriminatedUnion");var Fu=I("ZodMiniRecord",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function w(e,t,r){return new Fu({type:"record",keyType:e,valueType:t,...H(r)})}o(w,"record");var Zu=I("ZodMiniEnum",(e,t)=>{Yn.init(e,t),Y.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 Zu({type:"enum",entries:r,...H(t)})}o(U,"_enum");var Vu=I("ZodMiniLiteral",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function $(e,t){return new Vu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o($,"literal");var Hu=I("ZodMiniTransform",(e,t)=>{eo.init(e,t),Y.init(e,t)});function Se(e){return new Hu({type:"transform",transform:e})}o(Se,"transform");var qu=I("ZodMiniOptional",(e,t)=>{to.init(e,t),Y.init(e,t)});function h(e){return new qu({type:"optional",innerType:e})}o(h,"optional");var Gu=I("ZodMiniNullable",(e,t)=>{ro.init(e,t),Y.init(e,t)});function nt(e){return new Gu({type:"nullable",innerType:e})}o(nt,"nullable");var Wu=I("ZodMiniPipe",(e,t)=>{no.init(e,t),Y.init(e,t)});function $e(e,t){return new Wu({type:"pipe",in:e,out:t})}o($e,"pipe");var Ku=I("ZodMiniCustom",(e,t)=>{oo.init(e,t),Y.init(e,t)});function Ct(e,t){return bo(Ku,e??(()=>!0),t)}o(Ct,"custom");var ot={};gn(ot,{bigint:()=>tc,boolean:()=>ec,date:()=>rc,number:()=>Qu,string:()=>Yu});function Yu(e){return co(Nt,e)}o(Yu,"string");function Qu(e){return mo(Dt,e)}o(Qu,"number");function ec(e){return yo(vr,e)}o(ec,"boolean");function tc(e){return ho(So,e)}o(tc,"bigint");function rc(e){return _o(Ao,e)}o(rc,"date");var Pr=l({retryOnFailure:l({defaultValue:h(F()),hide:h(F())}),continueOnFailure:l({defaultValue:h(F()),hide:h(F())})}),xr=class{constructor(t,r,n,i,u,c,p,f,g,P,T){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=p;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=P;this.aiMetadata=T}static{o(this,"IAction")}},W=o(e=>new xr(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 B=l({displayName:a(),description:h(a())}),C=o((e,t)=>l({type:$(t),required:F(),defaultValue:h(rt())}),"TPropertyValue");var ne=l({...B.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...B.shape,...C(a(),"LONG_TEXT").shape});var Oo=l({label:a(),value:k()}),Ut=l({disabled:h(F()),placeholder:h(a()),options:N(Oo)});var oe=l({...B.shape,options:Ut,...C(k(),"STATIC_DROPDOWN").shape}),ye=l({...B.shape,options:Ut,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=l({...B.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),it=l({...B.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var he=l({...B.shape,...C(F(),"CHECKBOX").shape});var ve=l({...B.shape,...C(ee(),"NUMBER").shape});var at=l({...B.shape,streaming:h(F()),...C(k(),"FILE").shape});var st=l({...B.shape,...C(a(),"DATE_TIME").shape});var ko=w(a(),D([ne,ge,oe,it,ye,he,ve,at,st])),ut=l({...B.shape,properties:ko,...C(N(k()),"ARRAY").shape});var ct=l({...B.shape,...C(D([w(a(),k())]),"JSON").shape});var wo=D([ne,oe,ct,ut,ye]),oc=w(a(),wo),br=l({refreshers:N(a()),...B.shape,...C(k(),"DYNAMIC").shape});var Mt=l({...B.shape,...C($o(),"MARKDOWN").shape});var pt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(pt||{}),Me=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Me||{}),Le=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Le||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),Ir="both_client_credentials_and_authorization_code";var Oe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Oe||{}),dt=(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))(dt||{}),ic=l({strategy:U(dt),paramName:h(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Ro=l({status:h(ee()),body:h(k()),headers:h(w(a(),a()))}),No=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Lt))}),Do=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Ro,handlerId:h(a()),streamStepProgress:h(U(Lt))}),ac=D([No,Do]);var sc=l({body:k(),rawBody:h(k()),headers:w(a(),a()),queryParams:w(a(),a())});function ue(e){return e==null}o(ue,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function jt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(jt,"assertNotNullOrUndefined");var Tr=De(require("crypto"),1);var uc=128,ke,je,cc=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*uc),Tr.default.randomFillSync(ke),je=0):je+e>ke.length&&(Tr.default.randomFillSync(ke),je=0),je+=e},"fillPool"),pc=o(e=>(cc(e|=0),ke.subarray(je-e,je)),"random"),lc=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"),Uo=o((e,t=21)=>lc(e,t,pc),"customAlphabet");var dc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Mo=21,_b=a().check(Te(new RegExp(`^[0-9a-zA-Z]{${Mo}}$`))),mc=Uo(dc,Mo);var Ae=$e(Se(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Ae,updated:Ae},q=o(e=>h(nt(e)),"Nullable");function Er(e){return h(nt(U(e)))}o(Er,"NullableEnum");var Tb=$e(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(F())),Bt=o(e=>$e(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var $b=w(a(),k());var gt=(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))(gt||{});var Lb=a().check(Te(/^#[0-9A-Fa-f]{6}$/));var Bb=l({filename:a(),data:k(),type:$("file"),mimetype:h(a())});var fc=De(jo());var Wb=l({...ie,name:a(),permissions:N(a()),platformId:q(a()),type:a(),userCount:h(ee())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Sr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sr||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var gc=l({mode:U(Bo),value:k()}),yc=l({auth:h(a()),fields:w(a(),gc)}),hc=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(yc)}),vc=l({type:$("PIECE"),toolName:a().check(se(1)),pieceMetadata:hc}),xc=l({type:$("none")}),Pc=l({type:$("access_token"),accessToken:a()}),_c=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),bc=l({type:$("headers"),headers:w(a(),a())}),Ic=Ee("type",[xc,Pc,_c,bc]),Fo=l({type:$("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:h(a())}),Zo=l({type:$("MCP"),toolName:a().check(se(1)),serverUrl:To(),protocol:U($r),auth:Ic}),Vo=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Sr),sourceId:a(),sourceName:a()}),Tc=Ee("type",[vc,Fo,Zo,Vo]),Ec=l({displayName:a(),description:h(a()),type:U(Ar)}),Ho=l({type:$("MARKDOWN"),markdown:a()}),Be={type:$("TOOL_CALL"),input:q(w(a(),k())),output:h(k()),toolName:a(),status:U(zr),toolCallId:a(),startTime:a(),endTime:h(a())},EI=l(Be),qo=Ee("toolCallType",[l({...Be,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Be,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Be,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Be,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Be,toolCallType:$("UNKNOWN"),displayName:a()})]),Sc=D([Ho,qo]);var Or=(r=>(r.IMAGE="image",r.TEXT="text",r))(Or||{}),xe=l({apiKey:a()}),$c=xe,Ac=l({apiKey:a(),apiKeyHash:a()}),zc=xe,Oc=xe,kc=xe,wc=xe,Rc=xe,Nc=xe,Dc=xe,Xo=l({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),Cc=l({}),Uc=l({}),Mc=l({}),Lc=l({}),jc=l({}),Bc=l({}),Yo=l({modelId:a(),modelName:a(),modelType:U(Or)}),Qo=l({apiKeyHeader:a(),baseUrl:a(),models:N(Yo),defaultHeaders:h(w(a(),a()))}),ei=l({accountId:a(),gatewayId:a(),models:N(Yo),vertexProject:h(a()),vertexRegion:h(a())}),ti=l({resourceName:a(),apiVersion:$e(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ri=l({region:a().check(se(1))}),Fc=D([$c,kc,wc,Rc,Nc,Oc,zc,Ac,Xo,Dc]),ni=D([Qo,ei,ti,ri,Cc,Mc,Lc,jc,Uc,Bc]),Zc=l({id:a(),name:a(),type:U(Or)}),Vc=l({id:a(),name:a(),provider:U(gt),config:ni,enabledForChat:F()}),Hc=l({provider:U(gt),config:ni,auth:Fc,platformId:a()});var zI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Go=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],qc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Gc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Wo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],Wc=["grok-4.20","grok-4.1-fast"],Kc={openai:Go,anthropic:qc,google:Wo,activepieces:[...Gc.map(e=>`anthropic/${e}`),...Go.map(e=>`openai/${e}`),...Wo.map(e=>`google/${e}`),...Wc.map(e=>`x-ai/${e}`)]};var Ko=128e3,Jc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Xc({provider:e}){return e?Jc[e]??Ko:Ko}o(Xc,"getMaxContextTokens");var Jo={openai:"text-embedding-3-small",google:"text-embedding-004",azure:"text-embedding-3-small",activepieces:"text-embedding-3-small",openrouter:"openai/text-embedding-3-small"},Yc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Qc=new Set(["anthropic","mistral"]);function le(e){return{chatModels:Kc[e],maxContextTokens:Xc({provider:e}),defaultEmbeddingModel:Jo[e],supportsEmbedding:Jo[e]!==void 0,supportsImageGeneration:!Qc.has(e),webSearch:Yc[e]}}o(le,"buildProviderCapabilities");var ep={openai:le("openai"),anthropic:le("anthropic"),openrouter:le("openrouter"),azure:le("azure"),google:le("google"),"cloudflare-gateway":le("cloudflare-gateway"),custom:le("custom"),bedrock:le("bedrock"),mistral:le("mistral"),activepieces:le("activepieces")};var tp=l({base64Url:a(),fileName:a(),extension:h(a())}),rp=l({mimeType:a(),url:a(),fileName:h(a())}),kr=D([tp,rp]);var np=D([l({type:$("file"),value:kr}),l({type:$("markdown"),value:a(),files:h(N(kr))})]),op=l({sessionId:a(),message:a(),files:h(N(a()))});var ii=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ii||{}),ai=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ai||{}),wr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(wr||{});var ip=D([l({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:N(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),ap=l({...ie,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:Er(ai),trigger:Er(ii)}),sp=l({...ie,tableId:a(),projectId:a(),cells:w(a(),l({updated:a(),created:a(),value:k(),fieldName:a()}))}),up=l({events:N(U(wr)),webhookUrl:a(),flowId:a()}),cp=l({fields:N(l({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),pp=l({projectId:a(),limit:h(ot.number()),cursor:h(a()),name:h(a()),externalIds:Bt(a()),folderId:h(a()),folderIds:Bt(a())}),lp=l({records:N(N(l({fieldId:a(),value:ui()}))),tableId:a()}),dp=l({cells:h(N(l({fieldId:a(),value:ui()}))),tableId:a(),agentUpdate:h(F())}),si=Ee("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),oi("exists"),oi("not_exists")]),mp=l({tableId:a(),limit:h(ot.number()),cursor:h(a()),filters:Bt(si)});function ui(){return $e(Se(e=>e==null?e:String(e)),nt(a()))}o(ui,"coerceToString");function we(e){return l({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function oi(e){return l({fieldId:a(),operator:$(e)})}o(oi,"existenceFilter");var fp=l({status:h(ee()),body:h(k()),headers:h(w(a(),a()))}),gp=l({...ie,deleted:q(Ae),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var ci=l({name:a(),description:h(a()),type:a(),required:F()}),yp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:N(ci),returnsResponse:F()})});var pi="^[0-9]+\\.[0-9]+\\.[0-9]+$",WI=new RegExp(pi),vp="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",KI=a().check(Te(new RegExp(pi))),JI=a().check(Te(new RegExp(vp))),xp=l({packageType:$("ARCHIVE"),pieceType:U(Me),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),li=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),di=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),XI=D([li,di]),YI=D([xp,li,di]);var Pp=Ee("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Eo().check(wt(6e4))})]),QI=l({...ie,type:U(Oe),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Pp),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:F()}),mi=(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))(mi||{}),fi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(fi||{}),gi=(r=>(r.S3="S3",r.DB="DB",r))(gi||{}),eT=l({...ie,projectId:q(a()),platformId:q(a()),type:U(mi),compression:U(fi),data:h(k()),location:U(gi),size:q(ee()),fileName:q(a()),s3Key:q(a()),metadata:q(w(a(),a()))}),yi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(yi||{}),hi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(hi||{}),tT=l({id:a(),email:a(),firstName:a(),status:U(hi),externalId:q(a()),platformId:q(a()),platformRole:U(yi),lastName:a(),created:Ae,updated:Ae,lastActiveDate:q(Ae),imageUrl:q(a())});var Rr=l({...B.shape,...C(w(a(),k()),"OBJECT").shape});var _i=l({...B.shape,...C(a(),"COLOR").shape});var Nr=D([ne,ge,Mt,he,oe,ye,_r,it,br,ve,ut,Rr,ct,st,at,_i]),_={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=l({displayName:a(),description:h(a())});var bi=l({username:a(),password:a()}),Dr=l({...de.shape,username:l({displayName:a(),description:h(a())}),password:l({displayName:a(),description:h(a())}),...C(bi,"BASIC_AUTH").shape});var Tp=w(a(),D([ne,ge,ve,he,oe])),Cr=l({...de.shape,props:Tp,...C(k(),"CUSTOM_AUTH").shape});var Re=l({...de.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Ep=w(a(),D([ne,ge,Re,ve,he,oe,ye,Mt])),Ii=l({...de.shape,props:Ep,...C(k(),"OIDC").shape});var Ur=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ur||{}),Ti=D([ne,Re,oe]),Ei=w(a(),Ti),Sp=l({props:h(w(a(),Ti)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(F()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(U(Ur)),grantType:h(D([U(lt),$(Ir)])),extra:h(w(a(),a()))}),Si=l({access_token:a(),props:h(Ei),data:w(a(),rt())}),Mr=l({...de.shape,...Sp.shape,...C(Si,"OAUTH2").shape});var Fe=D([Dr,Cr,Ii,Mr,Re]),yt="Connection",Lr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var RE={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 $p=l({...B.shape,...C(k(),"CUSTOM").shape,code:a()});var Ap=D([Nr,Fe]),jr=w(a(),Ap),QE=w(a(),Nr);var $i=D([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]);var Ai="2",Zt="0.82.0";var Br=class{constructor(t,r,n,i,u,c,p,f,g=Zt,P,T="",v){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=P;this.description=T;this.deprecated=v;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ai}),"getContextInfo");(!zp(g)||Op(g,Zt))&&(this.minimumSupportedRelease=Zt),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}},zi=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 Br(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 zp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(zp,"isValidSimpleSemver");function Op(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(Op,"isSemverLessThan");var kp=h(w(a(),w(a(),a()))),Oi=l({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Fe,N(Fe)])),version:a(),categories:h(N(U(Le))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(F()),i18n:kp}),wp=U(["human","ai","both"]),ki=l({description:h(a()),idempotent:h(F())}),wi=l({name:a(),displayName:a(),description:a(),props:jr,requireAuth:F(),errorHandlingOptions:h(Pr),outputSchema:h(Ct()),audience:h(wp),aiMetadata:h(ki)}),Ri=l({name:a(),displayName:a(),description:a(),props:jr,errorHandlingOptions:h(Pr),type:U(Oe),sampleData:k(),handshakeConfiguration:h(Ct()),renewConfiguration:h($i),testStrategy:U(mt),outputSchema:h(Ct()),aiMetadata:h(ki)}),Rp=l({...Oi.shape,actions:w(a(),wi),triggers:w(a(),Ri)}),Np=l({...Oi.shape,actions:ee(),triggers:ee(),suggestedActions:h(N(wi)),suggestedTriggers:h(N(Ri))}),Ni=l({projectUsage:ee(),pieceType:U(Me),packageType:U(pt),platformId:h(a()),archiveId:h(a())}),QS=l({...Rp.shape,...Ni.shape}),e$=l({...Np.shape,...Ni.shape}),t$=l({name:a(),version:a()});var Dp=De(require("path")),Cp=De(require("fs/promises"));var Mi=require("node:stream");var Vt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};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 Ht=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Fr,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Fr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var ht=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Di({error:e,requestBody:t}){return e instanceof ht?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Di,"toFailsafeOutput");var Vr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Vr||{});var qt=class extends Vt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ht){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,re]of Object.entries(c))i.append(L,re);let p=i.toString(),f=p?`${n}?${p}`:n,g=t.responseType??"json",P=t.followRedirects??!0,T=t.retries??0,{body:v,extraHeaders:s,isStream:d}=Up(t.method)?Mp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},y=jp({...u,...s}),m=await Lp(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:y,body:v,redirect:P?"follow":"manual",signal:L.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{re!==void 0&&clearTimeout(re)}},T),x=P?300:400;if(m.status<200||m.status>=x){let L=await Ci(m,g),re=new ht(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Ci(m,g);return{status:m.status,headers:Bp(m.headers),body:b}}};function Up(e){return e!=="GET"&&e!=="HEAD"}o(Up,"acceptsRequestBody");function Mp(e,t){if(Zp(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Fp(e)){let n=new Mi.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(Mp,"serializeBody");async function Ci(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(Ci,"parseResponseBody");async function Lp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ui(n);continue}return i}catch(i){if(r=i,n<t){await Ui(n);continue}throw i}throw r}o(Lp,"sendWithRetries");function Ui(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ui,"backoff");function jp(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(jp,"normalizeHeaders");function Bp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Bp,"toHttpHeaders");function Fp(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Fp,"isNodeFormData");function Zp(e){return e==null}o(Zp,"isNil");var Gt=new qt;var Od=De(require("fs")),Vs=De(Zs());var kd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function wd(e){let t=e.split(";")[0].trim().toLowerCase();return kd[t]??""}o(wd,"contentTypeToExtension");var Rd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Nd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Hs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:f="headers"}){return W({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:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:g})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
- i.e ${Nd(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Vr).map(g=>({label:g,value:g}))},...c?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:_.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:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:g})=>{if(!g)return{};let P=g,T={};switch(P){case"none":break;case"json":T.data=_.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":T.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":T.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return T},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async g=>{let{method:P,url:T,headers:v,queryParams:s,body:d,body_type:y,failsafe:m,timeout:x,response_is_binary:b,followRedirects:L}=g.propsValue;jt(P,"Method"),jt(T,"URL");let re=ue(r)?{}:await r(g.auth,g.propsValue),ae=T.url,Ke=ae.startsWith("http://")||ae.startsWith("https://")?ae:Rd({baseUrl:t(g.auth),relativePath:ae}),Pe={method:P,url:Ke,headers:{...v??{},...f==="headers"||!ue(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...s??{}},timeout:x?x*1e3:0,followRedirects:L};if(b&&(Pe.responseType="arraybuffer"),d)if(y&&y!=="none"){let me=d.data;if(y==="form_data"){let ru=me,_t=new Vs.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:or}of ru)mn==="text"&&!ft(fn)?_t.append(dn,fn):mn==="file"&&!ft(or)&&_t.append(dn,or.data,{filename:or?.filename});Pe.body=_t,Pe.headers={...Pe.headers,..._t.getHeaders()}}else Pe.body=me}else y||(Pe.body=d);try{let me=await Gt.sendRequest(Pe);return await Dd(g.files,me.body,me.status,me.headers,b)}catch(me){if(m)return Di({error:me,requestBody:Pe.body});throw me}},"run")})}o(Hs,"createCustomApiCallAction");var Dd=o(async(e,t,r,n,i)=>{let u;if(i&&Cd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=wd(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),Cd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Ud="https://api.bokio.se/v1";async function V(e,t,r,n){try{return(await Gt.sendRequest({method:t,url:`${Ud}${r}`,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:n})).body}catch(i){throw new Error(`Unexpected error: ${i.message||String(i)}`)}}o(V,"makeRequest");var Z=Lr.CustomAuth({displayName:"Bokio API Key",description:"Bokio API Key is required to authenticate requests to Bokio",required:!0,props:{companyId:_.ShortText({displayName:"Company ID",description:"Enter your Bokio Company ID ",required:!0}),api_key:_.ShortText({displayName:"API Key",description:"Enter your Bokio API Key",required:!0})},validate:o(async({auth:e})=>{if(e)try{return await V(e.api_key,"GET",`/companies/${e.companyId}/journal-entries`),{valid:!0}}catch{return{valid:!1,error:"Invalid Api Key"}}return{valid:!1,error:"Invalid Api Key"}},"validate")});var qs=W({auth:Z,name:"createCustomer",displayName:"Create Customer",description:"Creates a new customer in Bokio",audience:"both",aiMetadata:{description:"Creates a new customer record in a Bokio accounting company. Use to register a person or company before invoicing them; only customer name and type (individual/company) are required, with optional VAT/org number, contact, and address details. Not idempotent \u2014 each call creates a separate customer.",idempotent:!1},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer",required:!0}),type:_.StaticDropdown({displayName:"Customer Type",description:"Type of the customer",required:!0,options:{options:[{label:"Individual",value:"private"},{label:"Company",value:"company"}]}}),vatNumber:_.ShortText({displayName:"VAT Number",description:"Customer VAT number",required:!1}),orgNumber:_.ShortText({displayName:"Organization Number",description:"Customer organization number",required:!1}),paymentTerms:_.ShortText({displayName:"Payment Terms",description:"Payment terms for the customer. Payment terms for the invoices. Payment terms can both take free text or days, in digits, until the payment is due.",required:!1}),customerNumber:_.ShortText({displayName:"Customer Number",description:"Customer number (optional)",required:!1}),email:_.ShortText({displayName:"Email",description:"Customer email address",required:!1}),phone:_.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),lin1:_.ShortText({displayName:"Address line 1",description:"Customer address line 1",required:!1}),line2:_.ShortText({displayName:"Address line 2",description:"Customer address line 2",required:!1}),zipCode:_.ShortText({displayName:"Zip Code",description:"Customer zip code",required:!1}),city:_.ShortText({displayName:"City",description:"Customer city",required:!1}),country:_.ShortText({displayName:"Country",description:"Customer country (ISO 3166-1 alpha-2 country code)",required:!1})},async run(e){let{customerName:t,type:r,vatNumber:n,orgNumber:i,paymentTerms:u,customerNumber:c,email:p,phone:f,lin1:g,line2:P,zipCode:T,city:v,country:s}=e.propsValue,{api_key:d,companyId:y}=e.auth.props,m={name:t,type:r};n&&(m.vat_number=n),i&&(m.org_number=i),c&&(m.customer_number=c),u&&(m.payment_terms=u);let x={};p&&(x.email=p),f&&(x.phone=f),Object.keys(x).length>0&&(m.contactsDetails=x);let b={};return g&&(b.line_1=g),P&&(b.line_2=P),T&&(b.zip_code=T),v&&(b.city=v),s&&(b.country=s),Object.keys(b).length>0&&(m.address=b),await V(d,"POST",`/companies/${y}/customers`,m)}});var nr=_.Dropdown({auth:Z,displayName:"Invoice",description:"Select the invoice",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};try{return{disabled:!1,options:(await V(e.props.api_key,"GET",`/companies/${e.props.companyId}/invoices?limit=100`)).items.map(n=>({label:`#${n.invoiceNumber} - ${n.customerRef.customerName}`,value:n.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),Md=_.StaticDropdown({displayName:"Unit Type",description:"Unit type for the item",required:!1,options:{options:[{label:"Unspecified",value:"unspecified"},{label:"Piece",value:"piece"},{label:"Hour",value:"hour"},{label:"Day",value:"day"},{label:"Month",value:"month"},{label:"Kilogram",value:"kilogram"},{label:"Gram",value:"gram"},{label:"Liter",value:"liter"},{label:"Meter",value:"meter"},{label:"Centimeter",value:"centimeter"},{label:"Millimeter",value:"millimeter"},{label:"Meter Squared",value:"meterSquared"},{label:"Meter Cubic",value:"meterCubic"},{label:"Mile",value:"mile"},{label:"Kilometer",value:"kilometer"},{label:"Gigabyte",value:"gigabyte"},{label:"Hectar",value:"hectar"},{label:"Words",value:"words"},{label:"Year",value:"year"},{label:"Week",value:"week"},{label:"Minute",value:"minute"},{label:"Megabyte",value:"megabyte"},{label:"Ton",value:"ton"}]}}),We=_.DynamicProperties({auth:Z,displayName:"Item Details",description:"Configure item details based on item type",required:!1,refreshers:["itemType"],props:o(async({itemType:e})=>{let t={description:_.ShortText({displayName:"Description",description:"Description of the line item",required:!0})};return e==="salesItem"&&(t.itemRefId=_.ShortText({displayName:"Item Reference ID",description:"UUID of the item reference",required:!1}),t.productType=_.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!0,options:{options:[{label:"Goods",value:"goods"},{label:"Service",value:"service"}]}}),t.unitType=Md,t.quantity=_.Number({displayName:"Quantity",description:"Quantity of the item",required:!0,defaultValue:1}),t.unitPrice=_.Number({displayName:"Unit Price",description:"Price per unit",required:!0}),t.taxRate=_.Number({displayName:"Tax Rate",description:"Tax rate in percentage (e.g., 25 for 25%)",required:!1})),t},"props")});var Gs=W({auth:Z,name:"createInvoice",displayName:"Create Invoice",description:"Creates a new draft invoice in Bokio",audience:"both",aiMetadata:{description:"Creates a new draft invoice in a Bokio company with a single line item. Use to start a new customer invoice; invoice date, due date, and item type are required, and the customer is linked by passing the customer UUID. Not idempotent \u2014 each call creates a separate draft invoice.",idempotent:!1},props:{invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate (defaults to 1)",required:!1}),itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the line item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:We},async run(e){let{invoiceType:t,customerRef:r,invoiceDate:n,dueDate:i,orderNumberReference:u,currency:c,currencyRate:p,itemType:f,dynamicProps:g}=e.propsValue,{api_key:P,companyId:T}=e.auth.props,v={type:t||"invoice",invoiceDate:n,dueDate:i};r&&(v.customerRef={id:r}),u&&(v.orderNumberReference=u),c&&(v.currency=c),p!=null&&(v.currencyRate=p);let s={};return f==="salesItem"&&g&&(s.itemType=f,v.description=g?.description,s.quantity=g.quantity,s.unitPrice=g.unitPrice,g.itemRefId&&(s.itemRef={id:g.itemRefId}),g.productType&&(s.productType=g.productType),g.unitType&&(s.unitType=g.unitType),g.taxRate!==void 0&&g.taxRate!==null&&(s.taxRate=g.taxRate)),v.lineItems=[s],await V(P,"POST",`/companies/${T}/invoices`,v)}});var Ws=W({auth:Z,name:"addLineItemToInvoice",displayName:"Add line item to invoice",description:"Adds a line item to an existing draft invoice",audience:"both",aiMetadata:{description:"Appends a single line item to an existing draft invoice in Bokio, identified by invoice ID. Use to add a product, service, or description-only row to an invoice that already exists; pricing fields apply only when item type is a sales item. Not idempotent \u2014 each call appends another line item.",idempotent:!1},props:{invoiceId:nr,itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:We},async run(e){let{invoiceId:t,itemType:r,dynamicProps:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={itemType:r,description:n?.description};return r==="salesItem"&&n&&(c.quantity=n.quantity,c.unitPrice=n.unitPrice,n.itemRefId&&(c.itemRef={id:n.itemRefId}),n.productType&&(c.productType=n.productType),n.unitType&&(c.unitType=n.unitType),n.taxRate!==void 0&&n.taxRate!==null&&(c.taxRate=n.taxRate)),await V(i,"POST",`/companies/${u}/invoices/${t}/line-items`,c)}});var Ks=W({auth:Z,name:"createAnItem",displayName:"Create an item",description:"Creates a new item in Bokio",audience:"both",aiMetadata:{description:"Creates a new reusable item (a sales item with pricing, or a text item) in a Bokio company catalog. Use to define a product or service that can later be referenced on invoices; item type is required. Not idempotent \u2014 each call creates a separate item.",idempotent:!1},props:{itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Text",value:"text"}]}}),dynamicProps:We},async run(e){let{itemType:t,dynamicProps:r}=e.propsValue,{api_key:n,companyId:i}=e.auth.props,u={itemType:t,description:r?.description};return r?.productType&&(u.productType=r.productType),r?.unitType&&(u.unitType=r.unitType),r?.unitPrice!==void 0&&r?.unitPrice!==null&&(u.unitPrice=r.unitPrice),r?.taxRate!==void 0&&r?.taxRate!==null&&(u.taxRate=r.taxRate),await V(n,"POST",`/companies/${i}/items`,u)}});var Js=W({auth:Z,name:"createAJournalEntry",displayName:"Create a journal entry",description:"Creates a new journal entry in Bokio",audience:"both",aiMetadata:{description:"Records a new bookkeeping journal entry in a Bokio company, posting debit/credit amounts against account numbers. Use for manual double-entry transactions; the entry date is required and items carry the per-account debit/credit lines. Not idempotent \u2014 each call posts a separate journal entry.",idempotent:!1},props:{title:_.ShortText({displayName:"Title",description:"Title of the journal entry",required:!1}),date:_.ShortText({displayName:"Date",description:"Journal entry date (YYYY-MM-DD)",required:!0}),items:_.Array({displayName:"Items (JSON)",description:"Journal entry items as JSON array. Each item should have: account (account number), debit (optional), credit (optional)",required:!1,properties:{account:_.Number({displayName:"Account Number",description:"Account number for the journal entry item",required:!1}),debit:_.Number({displayName:"Debit Amount",description:"Debit amount for the journal entry item",required:!1}),credit:_.Number({displayName:"Credit Amount",description:"Credit amount for the journal entry item",required:!1})}})},async run(e){let{title:t,date:r,items:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={date:r};return t&&(c.title=t),n&&(c.items=n),await V(i,"POST",`/companies/${u}/journal-entries`,c)}});var Xs=W({auth:Z,name:"updateAnInvoice",displayName:"Update an invoice",description:"Updates an existing draft invoice in Bokio",audience:"both",aiMetadata:{description:"Updates an existing draft invoice in Bokio, identified by invoice ID, replacing fields such as type, customer, dates, currency, and the full line-items list (passed as a JSON array). Use to modify an invoice that already exists rather than create one. Idempotent \u2014 repeating the same update yields the same invoice state.",idempotent:!0},props:{invoiceId:nr,invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate",required:!1}),lineItemsJson:_.LongText({displayName:"Line Items (JSON)",description:"Line items as JSON array. Each item should have: itemRef (object with id), description, quantity, unitPrice, unit, itemType (PRODUCT or SERVICE), vat",required:!1})},async run(e){let{invoiceId:t,invoiceType:r,customerRef:n,invoiceDate:i,dueDate:u,orderNumberReference:c,currency:p,currencyRate:f,lineItemsJson:g}=e.propsValue,{api_key:P,companyId:T}=e.auth.props,v={};if(r&&(v.type=r),n&&(v.customerRef={id:n}),i&&(v.invoiceDate=i),u&&(v.dueDate=u),c&&(v.orderNumberReference=c),p&&(v.currency=p),f!=null&&(v.currencyRate=f),g)try{v.lineItems=JSON.parse(g)}catch{throw new Error("Invalid JSON format for line items")}return await V(P,"PUT",`/companies/${T}/invoices/${t}`,v)}});var Ys=W({auth:Z,name:"findCustomer",displayName:"Find Customer",description:"Find customers in Bokio by filtering and pagination",audience:"both",aiMetadata:{description:"Lists customers in a Bokio company with pagination, optionally filtered by name, type, VAT number, or organization number. Leaving the filter empty returns all customers; supplying a filter type and value narrows to matching records. Use to look up a customer or their ID. Idempotent read-only lookup.",idempotent:!0},props:{filterType:_.StaticDropdown({displayName:"Filter Type",description:"Type of filter to use",required:!1,options:{options:[{label:"Name",value:"name"},{label:"Type",value:"type"},{label:"VAT Number",value:"vatNumber"},{label:"Organization Number",value:"orgNumber"}]}}),filterValue:_.ShortText({displayName:"Filter Value",description:"Value to filter by",required:!1}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{filterType:t,filterValue:r,page:n,pageSize:i}=e.propsValue,{api_key:u,companyId:c}=e.auth.props,p="";t&&r&&(p=`${t}=='${r}'`);let f=new URLSearchParams;n!=null?f.append("page",String(n)):f.append("page","1"),i!=null?f.append("pageSize",String(i)):f.append("pageSize","25"),p&&f.append("query",p);let g=`/companies/${c}/customers?${f.toString()}`;return await V(u,"GET",g)}});var Qs=W({auth:Z,name:"getDraftInvoiceByCustomerName",displayName:"Get Draft Invoice by Customer Name",description:"Get all draft invoices for a customer by customer name",audience:"both",aiMetadata:{description:"Looks up a Bokio customer by exact name and returns their draft invoices with pagination. Use when you have a customer name (not an ID) and want their pending draft invoices; returns an empty result if no customer matches. Idempotent read-only lookup.",idempotent:!0},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer to find draft invoices for",required:!0}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{customerName:t,page:r,pageSize:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c=new URLSearchParams;c.append("page","1"),c.append("pageSize","100"),c.append("query",`name=='${t}'`);let p=`/companies/${u}/customers?${c.toString()}`,f=await V(i,"GET",p);if(!f.items||f.items.length===0)return{message:`No customer found with name: ${t}`,items:[]};let g=f.items[0].id,P=new URLSearchParams;r!=null?P.append("page",String(r)):P.append("page","1"),n!=null?P.append("pageSize",String(n)):P.append("pageSize","25"),P.append("query",`status==draft&&customerRef==${g}`);let T=`/companies/${u}/invoices?${P.toString()}`,v=await V(i,"GET",T);return{customerName:f.items[0].name,customerId:g,...v}}});var eu=W({auth:Z,name:"getAnInvoice",displayName:"Get an invoice",description:"Retrieve a specific invoice by its ID",audience:"both",aiMetadata:{description:"Retrieves a single invoice from a Bokio company by its invoice ID. Use when you already have the invoice ID and need its full details. Idempotent read-only lookup.",idempotent:!0},props:{invoiceId:_.ShortText({displayName:"Invoice ID",description:"The ID of the invoice to retrieve",required:!0})},async run(e){let{invoiceId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await V(r,"GET",`/companies/${n}/invoices/${t}`)}});var tu=W({auth:Z,name:"getAJournalEntry",displayName:"Get a journal entry",description:"Retrieve a specific journal entry by its ID",audience:"both",aiMetadata:{description:"Retrieves a single journal entry from a Bokio company by its UUID. Use when you already have the journal entry ID and need its full bookkeeping details. Idempotent read-only lookup.",idempotent:!0},props:{journalEntryId:_.ShortText({displayName:"Journal Entry ID",description:"UUID of the journal entry",required:!0})},async run(e){let{journalEntryId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await V(r,"GET",`/companies/${n}/journal-entries/${t}`)}});var Ld=zi({displayName:"Bokio",auth:Z,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/bokio.png",authors:["sanket-a11y"],categories:["ACCOUNTING"],description:"Bokio is an accounting software platform which offers digital bookkeeping, invoicing, and financial management tools to help simplify accounting processes.",actions:[qs,Gs,Ws,Ks,Js,Xs,Ys,Qs,eu,tu,Hs({auth:Z,baseUrl:o(e=>`https://api.bokio.se/v1/companies/${e?.props.companyId}`,"baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e?.props.api_key}`}),"authMapping")})],triggers:[]});0&&(module.exports={bokio});
1
+ "use strict";var du=Object.create;var Xe=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,yu=Object.prototype.hasOwnProperty;var o=(e,t)=>Xe(e,"name",{value:t,configurable:!0});var S=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},vn=(e,t)=>{for(var r in t)Xe(e,r,{get:t[r],enumerable:!0})},xn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!yu.call(e,i)&&i!==r&&Xe(e,i,{get:()=>t[i],enumerable:!(n=mu(t,i))||n.enumerable});return e};var Ce=(e,t,r)=>(r=e!=null?du(gu(e)):{},xn(t||!e||!e.__esModule?Xe(r,"default",{value:e,enumerable:!0}):r,e)),hu=e=>xn(Xe({},"__esModule",{value:!0}),e);var Ho=S((Zo,Vt)=>{(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 g(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let v=0,m=-1,P=(s.match(p.zoneIndex)||[])[0],b,j;for(P&&(P=P.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)v++;if(s.substr(0,2)==="::"&&v--,s.substr(-2,2)==="::"&&v--,v>d)return null;for(j=d-v,b=":";j--;)b+="0:";return s=s.replace("::",b),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let oe=s.split(":"),de=[];for(let Pe=0;Pe<oe.length;Pe++)de.push(parseInt(oe[Pe],16));return de})(),{parts:d,zoneId:P}}o(g,"expandIPv6");function y(s,d,v,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let P=0,b;for(;m>0;){if(b=v-m,b<0&&(b=0),s[P]>>b!==d[P]>>b)return!1;m-=v,P+=1}return!0}o(y,"matchCIDR");function x(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(x,"parseIntAuto");function T(s,d){for(;s.length<d;)s=`0${s}`;return s}o(T,"padPart");let h={};h.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let v,m;for(v=0;v<d.length;v++)if(m=d[v],!(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,v){let m;if(v===void 0&&(m=d,d=m[0],v=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,d.octets,8,v)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,v=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},P,b,j;for(P=3;P>=0;P-=1)if(b=this.octets[P],b in m){if(j=m[b],v&&j!==0)return null;j!==8&&(v=!0),d+=j}else return null;return 32-d},s.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),h.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),v=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],b=0;for(;b<4;)P.push(parseInt(v[b],10)|parseInt(m[b],10)^255),b++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(s){return this.parser(s)!==null},h.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},h.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(s){return!!(h.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!h.IPv4.isValidCIDR(s)||!d?!1:h.IPv4.isValidFourPartDecimal(d[1])},h.IPv4.networkAddressFromCIDR=function(s){let d,v,m,P,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],v=0;v<4;)P.push(parseInt(m[v],10)&parseInt(b[v],10)),v++;return new this(P)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.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)},h.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let v=parseInt(d[2]);if(v>=0&&v<=32){let m=[this.parse(d[1]),v];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")},h.IPv4.parser=function(s){let d,v,m;if(d=s.match(r.fourOctet))return(function(){let P=d.slice(1,6),b=[];for(let j=0;j<P.length;j++)v=P[j],b.push(x(v));return b})();if(d=s.match(r.longValue)){if(m=x(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let P=[],b;for(b=0;b<=24;b+=8)P.push(m>>b&255);return P})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let P=d.slice(1,4),b=[];if(m=x(P[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(P[0])),b.push(m>>16&255),b.push(m>>8&255),b.push(m&255),b})():(d=s.match(r.threeOctet))?(function(){let P=d.slice(1,5),b=[];if(m=x(P[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return b.push(x(P[0])),b.push(x(P[1])),b.push(m>>8&255),b.push(m&255),b})():null},h.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],v=0,m=Math.floor(s/8);for(;v<m;)d[v]=255,v++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},h.IPv6=(function(){function s(d,v){let m,P;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(P=this.parts[m],!(0<=P&&P<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");v&&(this.zoneId=v)}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,v){let m;if(v===void 0&&(m=d,d=m[0],v=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,d.parts,16,v)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,v=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},P,b;for(let j=7;j>=0;j-=1)if(P=this.parts[j],P in m){if(b=m[P],v&&b!==0)return null;b!==16&&(v=!0),d+=b}else return null;return 128-d},s.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,v=[],m=this.parts;for(let P=0;P<m.length;P++)d=m[P],v.push(d>>8),v.push(d&255);return v},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let P=0;P<this.parts.length;P++)m.push(T(this.parts[P].toString(16),4));return m}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),d+v},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),v=d[0],m=d[1];return new h.IPv4([v>>8,v&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let P=0;P<this.parts.length;P++)m.push(this.parts[P].toString(16));return m}).call(this).join(":"),v="";return this.zoneId&&(v=`%${this.zoneId}`),d+v},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),m=0,P=-1,b;for(;b=d.exec(v);)b[0].length>P&&(m=b.index,P=b[0].length);return P<0?v:`${v.substring(0,m)}::${v.substring(m+P)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),h.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),v=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],b=0;for(;b<16;)P.push(parseInt(v[b],10)|parseInt(m[b],10)^255),b++;return new this(P)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},h.IPv6.isIPv6=function(s){return this.parser(s)!==null},h.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}},h.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(s){let d,v,m,P,b;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),b=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),P=[],v=0;v<16;)P.push(parseInt(m[v],10)&parseInt(b[v],10)),v++;return new this(P)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},h.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)},h.IPv6.parseCIDR=function(s){let d,v,m;if((v=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(v[2]),d>=0&&d<=128))return m=[this.parse(v[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")},h.IPv6.parser=function(s){let d,v,m,P,b,j;if(m=s.match(p.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(p.native.test(s))return g(s,8);if((m=s.match(p.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=g(d+j,6),d.parts)){for(b=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],v=0;v<b.length;v++)if(P=b[v],!(0<=P&&P<=255))return null;return d.parts.push(b[0]<<8|b[1]),d.parts.push(b[2]<<8|b[3]),{parts:d.parts,zoneId:d.zoneId}}return null},h.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],v=0,m=Math.floor(s/8);for(;v<m;)d[v]=255,v++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},h.fromByteArray=function(s){let d=s.length;if(d===4)return new h.IPv4(s);if(d===16)return new h.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(s){return h.IPv6.isValid(s)||h.IPv4.isValid(s)},h.isValidCIDR=function(s){return h.IPv6.isValidCIDR(s)||h.IPv4.isValidCIDR(s)},h.parse=function(s){if(h.IPv6.isValid(s))return h.IPv6.parse(s);if(h.IPv4.isValid(s))return h.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(s){try{return h.IPv6.parseCIDR(s)}catch{try{return h.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},h.subnetMatch=function(s,d,v){let m,P,b,j;v==null&&(v="unicast");for(P in d)if(Object.prototype.hasOwnProperty.call(d,P)){for(b=d[P],b[0]&&!(b[0]instanceof Array)&&(b=[b]),m=0;m<b.length;m++)if(j=b[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return P}return v},typeof Vt<"u"&&Vt.exports?Vt.exports=h:e.ipaddr=h})(Zo)});var Ki=S((qA,Wi)=>{var qi=require("stream").Stream,tl=require("util");Wi.exports=ue;function ue(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ue,"DelayedStream");tl.inherits(ue,qi);ue.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(ue.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ue.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ue.prototype.resume=function(){this._released||this.release(),this.source.resume()};ue.prototype.pause=function(){this.source.pause()};ue.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ue.prototype.pipe=function(){var e=qi.prototype.pipe.apply(this,arguments);return this.resume(),e};ue.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)};ue.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Qi=S((KA,Yi)=>{var rl=require("util"),Xi=require("stream").Stream,Ji=Ki();Yi.exports=J;function J(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(J,"CombinedStream");rl.inherits(J,Xi);J.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};J.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};J.prototype.append=function(e){var t=J.isStreamLike(e);if(t){if(!(e instanceof Ji)){var r=Ji.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};J.prototype.pipe=function(e,t){return Xi.prototype.pipe.call(this,e,t),this.resume(),e};J.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};J.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=J.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};J.prototype._pipeNext=function(e){this._currentStream=e;var t=J.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};J.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};J.prototype.write=function(e){this.emit("data",e)};J.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};J.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};J.prototype.end=function(){this._reset(),this.emit("end")};J.prototype.destroy=function(){this._reset(),this.emit("close")};J.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};J.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};J.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};J.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var ta=S((XA,ea)=>{"use strict";ea.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 oa=S(te=>{"use strict";var Kt=ta(),nl=require("path").extname,ra=/^\s*([^;\s]*)(?:;|\s|$)/,ol=/^text\//i;te.charset=na;te.charsets={lookup:na};te.contentType=il;te.extension=al;te.extensions=Object.create(null);te.lookup=sl;te.types=Object.create(null);ul(te.extensions,te.types);function na(e){if(!e||typeof e!="string")return!1;var t=ra.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&ol.test(t[1])?"UTF-8":!1}o(na,"charset");function il(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o(il,"contentType");function al(e){if(!e||typeof e!="string")return!1;var t=ra.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(al,"extension");function sl(e){if(!e||typeof e!="string")return!1;var t=nl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(sl,"lookup");function ul(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Kt).forEach(o(function(i){var u=Kt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var p=0;p<c.length;p++){var g=c[p];if(t[g]){var y=r.indexOf(Kt[t[g]].source),x=r.indexOf(u.source);if(t[g]!=="application/octet-stream"&&(y>x||y===x&&t[g].substr(0,12)==="application/"))continue}t[g]=i}}},"forEachMimeType"))}o(ul,"populateMaps")});var aa=S((ez,ia)=>{ia.exports=cl;function cl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(cl,"defer")});var Wr=S((rz,ua)=>{var sa=aa();ua.exports=pl;function pl(e){var t=!1;return sa(function(){t=!0}),o(function(n,i){t?e(n,i):sa(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(pl,"async")});var Kr=S((oz,ca)=>{ca.exports=ll;function ll(e){Object.keys(e.jobs).forEach(dl.bind(e)),e.jobs={}}o(ll,"abort");function dl(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(dl,"clean")});var Jr=S((az,la)=>{var pa=Wr(),ml=Kr();la.exports=fl;function fl(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=gl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?ml(r):r.results[i]=c,n(u,r.results))})}o(fl,"iterate");function gl(e,t,r,n){var i;return e.length==2?i=e(r,pa(n)):i=e(r,t,pa(n)),i}o(gl,"runJob")});var Xr=S((uz,da)=>{da.exports=yl;function yl(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(yl,"state")});var Yr=S((pz,ma)=>{var hl=Kr(),vl=Wr();ma.exports=xl;function xl(e){Object.keys(this.jobs).length&&(this.index=this.size,hl(this),vl(e)(null,this.results))}o(xl,"terminator")});var ga=S((dz,fa)=>{var Pl=Jr(),_l=Xr(),bl=Yr();fa.exports=Il;function Il(e,t,r){for(var n=_l(e);n.index<(n.keyedList||e).length;)Pl(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 bl.bind(n,r)}o(Il,"parallel")});var Qr=S((fz,Jt)=>{var ya=Jr(),Tl=Xr(),El=Yr();Jt.exports=Sl;Jt.exports.ascending=ha;Jt.exports.descending=$l;function Sl(e,t,r,n){var i=Tl(e,r);return ya(e,t,i,o(function u(c,p){if(c){n(c,p);return}if(i.index++,i.index<(i.keyedList||e).length){ya(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),El.bind(i,n)}o(Sl,"serialOrdered");function ha(e,t){return e<t?-1:e>t?1:0}o(ha,"ascending");function $l(e,t){return-1*ha(e,t)}o($l,"descending")});var xa=S((yz,va)=>{var Al=Qr();va.exports=zl;function zl(e,t,r){return Al(e,t,null,r)}o(zl,"serial")});var _a=S((vz,Pa)=>{Pa.exports={parallel:ga(),serial:xa(),serialOrdered:Qr()}});var en=S((xz,ba)=>{"use strict";ba.exports=Object});var Ta=S((Pz,Ia)=>{"use strict";Ia.exports=Error});var Sa=S((_z,Ea)=>{"use strict";Ea.exports=EvalError});var Aa=S((bz,$a)=>{"use strict";$a.exports=RangeError});var Oa=S((Iz,za)=>{"use strict";za.exports=ReferenceError});var Ra=S((Tz,ka)=>{"use strict";ka.exports=SyntaxError});var Xt=S((Ez,wa)=>{"use strict";wa.exports=TypeError});var Da=S((Sz,Na)=>{"use strict";Na.exports=URIError});var Ua=S(($z,Ca)=>{"use strict";Ca.exports=Math.abs});var ja=S((Az,Ma)=>{"use strict";Ma.exports=Math.floor});var Ba=S((zz,La)=>{"use strict";La.exports=Math.max});var Va=S((Oz,Fa)=>{"use strict";Fa.exports=Math.min});var Ha=S((kz,Za)=>{"use strict";Za.exports=Math.pow});var qa=S((Rz,Ga)=>{"use strict";Ga.exports=Math.round});var Ka=S((wz,Wa)=>{"use strict";Wa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Xa=S((Dz,Ja)=>{"use strict";var Ol=Ka();Ja.exports=o(function(t){return Ol(t)||t===0?t:t<0?-1:1},"sign")});var Qa=S((Uz,Ya)=>{"use strict";Ya.exports=Object.getOwnPropertyDescriptor});var tn=S((Mz,es)=>{"use strict";var Yt=Qa();if(Yt)try{Yt([],"length")}catch{Yt=null}es.exports=Yt});var rs=S((jz,ts)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}ts.exports=Qt});var rn=S((Lz,ns)=>{"use strict";ns.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 as=S((Fz,is)=>{"use strict";var os=typeof Symbol<"u"&&Symbol,kl=rn();is.exports=o(function(){return typeof os!="function"||typeof Symbol!="function"||typeof os("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:kl()},"hasNativeSymbols")});var nn=S((Zz,ss)=>{"use strict";ss.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var on=S((Hz,us)=>{"use strict";var Rl=en();us.exports=Rl.getPrototypeOf||null});var ls=S((Gz,ps)=>{"use strict";var wl="Function.prototype.bind called on incompatible ",Nl=Object.prototype.toString,Dl=Math.max,Cl="[object Function]",cs=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"),Ul=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"),Ml=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"||Nl.apply(r)!==Cl)throw new TypeError(wl+r);for(var n=Ul(arguments,1),i,u=o(function(){if(this instanceof i){var x=r.apply(this,cs(n,arguments));return Object(x)===x?x:this}return r.apply(t,cs(n,arguments))},"binder"),c=Dl(0,r.length-n.length),p=[],g=0;g<c;g++)p[g]="$"+g;if(i=Function("binder","return function ("+Ml(p,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var He=S((Wz,ds)=>{"use strict";var jl=ls();ds.exports=Function.prototype.bind||jl});var er=S((Kz,ms)=>{"use strict";ms.exports=Function.prototype.call});var an=S((Jz,fs)=>{"use strict";fs.exports=Function.prototype.apply});var ys=S((Xz,gs)=>{"use strict";gs.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var vs=S((Yz,hs)=>{"use strict";var Ll=He(),Bl=an(),Fl=er(),Vl=ys();hs.exports=Vl||Ll.call(Fl,Bl)});var Ps=S((Qz,xs)=>{"use strict";var Zl=He(),Hl=Xt(),Gl=er(),ql=vs();xs.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Hl("a function is required");return ql(Zl,Gl,t)},"callBindBasic")});var Ss=S((tO,Es)=>{"use strict";var Wl=Ps(),_s=tn(),Is;try{Is=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var sn=!!Is&&_s&&_s(Object.prototype,"__proto__"),Ts=Object,bs=Ts.getPrototypeOf;Es.exports=sn&&typeof sn.get=="function"?Wl([sn.get]):typeof bs=="function"?o(function(t){return bs(t==null?t:Ts(t))},"getDunder"):!1});var ks=S((nO,Os)=>{"use strict";var $s=nn(),As=on(),zs=Ss();Os.exports=$s?o(function(t){return $s(t)},"getProto"):As?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return As(t)},"getProto"):zs?o(function(t){return zs(t)},"getProto"):null});var un=S((iO,Rs)=>{"use strict";var Kl=Function.prototype.call,Jl=Object.prototype.hasOwnProperty,Xl=He();Rs.exports=Xl.call(Kl,Jl)});var js=S((aO,Ms)=>{"use strict";var M,Yl=en(),Ql=Ta(),ed=Sa(),td=Aa(),rd=Oa(),Ke=Ra(),We=Xt(),nd=Da(),od=Ua(),id=ja(),ad=Ba(),sd=Va(),ud=Ha(),cd=qa(),pd=Xa(),Cs=Function,cn=o(function(e){try{return Cs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=tn(),ld=rs(),pn=o(function(){throw new We},"throwTypeError"),dd=xt?(function(){try{return arguments.callee,pn}catch{try{return xt(arguments,"callee").get}catch{return pn}}})():pn,Ge=as()(),ee=ks(),md=on(),fd=nn(),Us=an(),Pt=er(),qe={},gd=typeof Uint8Array>"u"||!ee?M:ee(Uint8Array),De={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&ee?ee([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":qe,"%AsyncGenerator%":qe,"%AsyncGeneratorFunction%":qe,"%AsyncIteratorPrototype%":qe,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Ql,"%eval%":eval,"%EvalError%":ed,"%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%":Cs,"%GeneratorFunction%":qe,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&ee?ee(ee([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!ee?M:ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Yl,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":td,"%ReferenceError%":rd,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!ee?M:ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&ee?ee(""[Symbol.iterator]()):M,"%Symbol%":Ge?Symbol:M,"%SyntaxError%":Ke,"%ThrowTypeError%":dd,"%TypedArray%":gd,"%TypeError%":We,"%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%":nd,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":Pt,"%Function.prototype.apply%":Us,"%Object.defineProperty%":ld,"%Object.getPrototypeOf%":md,"%Math.abs%":od,"%Math.floor%":id,"%Math.max%":ad,"%Math.min%":sd,"%Math.pow%":ud,"%Math.round%":cd,"%Math.sign%":pd,"%Reflect.getPrototypeOf%":fd};if(ee)try{null.error}catch(e){ws=ee(ee(e)),De["%Error.prototype%"]=ws}var ws,yd=o(function e(t){var r;if(t==="%AsyncFunction%")r=cn("async function () {}");else if(t==="%GeneratorFunction%")r=cn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=cn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ee&&(r=ee(i.prototype))}return De[t]=r,r},"doEval"),Ns={__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"]},_t=He(),tr=un(),hd=_t.call(Pt,Array.prototype.concat),vd=_t.call(Us,Array.prototype.splice),Ds=_t.call(Pt,String.prototype.replace),rr=_t.call(Pt,String.prototype.slice),xd=_t.call(Pt,RegExp.prototype.exec),Pd=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_d=/\\(\\)?/g,bd=o(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Ke("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Ke("invalid intrinsic syntax, expected opening `%`");var i=[];return Ds(t,Pd,function(u,c,p,g){i[i.length]=p?Ds(g,_d,"$1"):c||u}),i},"stringToPath"),Id=o(function(t,r){var n=t,i;if(tr(Ns,n)&&(i=Ns[n],n="%"+i[0]+"%"),tr(De,n)){var u=De[n];if(u===qe&&(u=yd(n)),typeof u>"u"&&!r)throw new We("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Ke("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ms.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new We("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new We('"allowMissing" argument must be a boolean');if(xd(/^%?[^%]*%?$/,t)===null)throw new Ke("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=bd(t),i=n.length>0?n[0]:"",u=Id("%"+i+"%",r),c=u.name,p=u.value,g=!1,y=u.alias;y&&(i=y[0],vd(n,hd([0,1],y)));for(var x=1,T=!0;x<n.length;x+=1){var h=n[x],s=rr(h,0,1),d=rr(h,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Ke("property names with quotes must have matching quotes");if((h==="constructor"||!T)&&(g=!0),i+="."+h,c="%"+i+"%",tr(De,c))p=De[c];else if(p!=null){if(!(h in p)){if(!r)throw new We("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&x+1>=n.length){var v=xt(p,h);T=!!v,T&&"get"in v&&!("originalValue"in v.get)?p=v.get:p=p[h]}else T=tr(p,h),p=p[h];T&&!g&&(De[c]=p)}}return p},"GetIntrinsic")});var Bs=S((uO,Ls)=>{"use strict";var Td=rn();Ls.exports=o(function(){return Td()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Zs=S((pO,Vs)=>{"use strict";var Ed=js(),Fs=Ed("%Object.defineProperty%",!0),Sd=Bs()(),$d=un(),Ad=Xt(),nr=Sd?Symbol.toStringTag:null;Vs.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 Ad("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!$d(t,nr))&&(Fs?Fs(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Gs=S((dO,Hs)=>{"use strict";var zd=Function.prototype.call,Od=Object.prototype.hasOwnProperty,kd=He();Hs.exports=kd.call(zd,Od)});var Ws=S((mO,qs)=>{"use strict";qs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Xs=S((fO,Js)=>{"use strict";var fn=Qi(),Rd=require("util"),ln=require("path"),wd=require("http"),Nd=require("https"),Dd=require("url").parse,Cd=require("fs"),Ud=require("stream").Stream,Md=require("crypto"),dn=oa(),jd=_a(),Ld=Zs(),ke=Gs(),mn=Ws();function Ks(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ks,"escapeHeaderParam");function F(e){if(!(this instanceof F))return new F(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],fn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(F,"FormData");Rd.inherits(F,fn);F.LINE_BREAK=`\r
2
+ `;F.DEFAULT_CONTENT_TYPE="application/octet-stream";F.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=fn.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)};F.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)+F.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&ke(t,"httpVersion"))&&!(t instanceof Ud))&&(r.knownLength||this._valuesToMeasure.push(t))};F.prototype._lengthRetriever=function(e,t){ke(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Cd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):ke(e,"httpVersion")?t(null,Number(e.headers["content-length"])):ke(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};F.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ks(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&mn(c,r.header);var p;for(var g in c)if(ke(c,g)){if(p=c[g],p==null)continue;Array.isArray(p)||(p=[p]),p.length&&(u+=g+": "+p.join("; ")+F.LINE_BREAK)}return"--"+this.getBoundary()+F.LINE_BREAK+u+F.LINE_BREAK};F.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=ln.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=ln.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&ke(e,"httpVersion")&&(r=ln.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ks(r)+'"'};F.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=dn.lookup(e.name)),!r&&e&&e.path&&(r=dn.lookup(e.path)),!r&&e&&e.readable&&ke(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=dn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=F.DEFAULT_CONTENT_TYPE),r};F.prototype._multiPartFooter=function(){return function(e){var t=F.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};F.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+F.LINE_BREAK};F.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)ke(e,t)&&(r[t.toLowerCase()]=e[t]);return r};F.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};F.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};F.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(F.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};F.prototype._generateBoundary=function(){this._boundary="--------------------------"+Md.randomBytes(12).toString("hex")};F.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};F.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};F.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)})};F.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Dd(e),n=mn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=mn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=Nd.request(n):r=wd.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,g=o(function(y,x){return r.removeListener("error",g),r.removeListener("response",p),t.call(this,y,x)},"callback");p=g.bind(this,null),r.on("error",g),r.on("response",p)}}.bind(this)),r};F.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};F.prototype.toString=function(){return"[object FormData]"};Ld(F.prototype,"FormData");Js.exports=F});var Xd={};vn(Xd,{bokio:()=>Jd});module.exports=hu(Xd);var vu=Object.freeze({status:"aborted"});function I(e,t,r){function n(p,g){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:g,constr:c,traits:new Set},enumerable:!1}),p._zod.traits.has(e))return;p._zod.traits.add(e),t(p,g);let y=c.prototype,x=Object.keys(y);for(let T=0;T<x.length;T++){let h=x[T];h in p||(p[h]=y[h].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 g;let y=r?.Parent?new u:this;n(y,p),(g=y._zod).deferred??(g.deferred=[]);for(let x of y._zod.deferred)x();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(I,"$constructor");var ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},It=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ar={};function fe(e){return e&&Object.assign(ar,e),ar}o(fe,"config");function ur(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(ur,"getEnumValues");function _n(e,t){return typeof t=="bigint"?t.toString():t}o(_n,"jsonStringifyReplacer");function Et(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(Et,"cached");function bn(e){return e==null}o(bn,"nullish");function St(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(St,"cleanRegex");var Pn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Pn)return n===void 0&&(n=Pn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ye(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ye,"isObject");var xu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function In(e){if(Ye(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ye(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(In,"isPlainObject");var Tn=new Set(["string","number","symbol"]);function Ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Ue,"escapeRegex");function $t(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o($t,"clone");function H(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(H,"normalizeParams");function En(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(En,"optionalKeys");var Sn={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 Me(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(Me,"aborted");function be(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(be,"prefixIssues");function Tt(e){return typeof e=="string"?e:e?.message}o(Tt,"unwrapMessage");function Ie(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=Tt(e.inst?._zod.def?.error?.(e))??Tt(t?.error?.(e))??Tt(r.customError?.(e))??Tt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Ie,"finalizeIssue");function $n(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o($n,"getLengthableOrigin");function pr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(pr,"issue");var An=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,_n,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),zn=I("$ZodError",An),Qe=I("$ZodError",An,{Parent:Error});var _u=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 ce;if(c.issues.length){let p=new(i?.Err??e)(c.issues.map(g=>Ie(g,u,fe())));throw cr(p,i?.callee),p}return c.value},"_parse"),At=_u(Qe),bu=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(g=>Ie(g,u,fe())));throw cr(p,i?.callee),p}return c.value},"_parseAsync"),zt=bu(Qe),Iu=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 ce;return u.issues.length?{success:!1,error:new(e??zn)(u.issues.map(c=>Ie(c,i,fe())))}:{success:!0,data:u.value}},"_safeParse"),et=Iu(Qe),Tu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,fe())))}:{success:!0,data:u.value}},"_safeParseAsync"),tt=Tu(Qe);var Eu="(?:(?:\\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])))",Su=new RegExp(`^${Eu}$`);var On=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),kn=/^-?\d+n?$/,Rn=/^-?\d+$/,lr=/^-?\d+(?:\.\d+)?$/,wn=/^(?:true|false)$/i;var Te=I("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),$u={number:"number",bigint:"bigint",object:"date"};var Nn=I("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=$u[typeof t.value];e._zod.onattach.push(n=>{let i=n._zod.bag,u=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}});var Dn=I("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Sn[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=Rn)}),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 Cn=I("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!bn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=$n(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var dr=I("$ZodCheckStringFormat",(e,t)=>{var r,n;Te.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Un=I("$ZodCheckRegex",(e,t)=>{dr.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 jn={major:4,minor:3,patch:6};var W=I("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=jn;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,g)=>{let y=Me(c),x;for(let T of p){if(T._zod.def.when){if(!T._zod.def.when(c))continue}else if(y)continue;let h=c.issues.length,s=T._zod.check(c);if(s instanceof Promise&&g?.async===!1)throw new ce;if(x||s instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await s,c.issues.length!==h&&(y||(y=Me(c,h)))});else{if(c.issues.length===h)continue;y||(y=Me(c,h))}}return x?x.then(()=>c):c},"runChecks"),u=o((c,p,g)=>{if(Me(c))return c.aborted=!0,c;let y=i(p,n,g);if(y instanceof Promise){if(g.async===!1)throw new ce;return y.then(x=>e._zod.parse(x,g))}return e._zod.parse(y,g)},"handleCanaryResult");e._zod.run=(c,p)=>{if(p.skipChecks)return e._zod.parse(c,p);if(p.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...p,skipChecks:!0});return y instanceof Promise?y.then(x=>u(x,c,p)):u(y,c,p)}let g=e._zod.parse(c,p);if(g instanceof Promise){if(p.async===!1)throw new ce;return g.then(y=>i(y,n,p))}return i(g,n,p)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=et(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return tt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Rt=I("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??On(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),mr=I("$ZodStringFormat",(e,t)=>{dr.init(e,t),Rt.init(e,t)});var Zn=I("$ZodURL",(e,t)=>{mr.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 fr=I("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??lr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Hn=I("$ZodNumberFormat",(e,t)=>{Dn.init(e,t),fr.init(e,t)}),gr=I("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=wn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Gn=I("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=kn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var qn=I("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Wn=I("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var Kn=I("$ZodVoid",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Jn=I("$ZodDate",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Ln(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Ln,"handleArrayResult");var Xn=I("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let p=i[c],g=t.element._zod.run({value:p,issues:[]},n);g instanceof Promise?u.push(g.then(y=>Ln(y,r,c))):Ln(g,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function kt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(kt,"handlePropertyResult");function Au(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=En(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(Au,"normalizeDef");function zu(e,t,r,n,i,u){let c=[],p=i.keySet,g=i.catchall._zod,y=g.def.type,x=g.optout==="optional";for(let T in t){if(p.has(T))continue;if(y==="never"){c.push(T);continue}let h=g.run({value:t[T],issues:[]},n);h instanceof Promise?e.push(h.then(s=>kt(s,r,T,t,x))):kt(h,r,T,t,x)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(zu,"handleCatchall");var Yn=I("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let p=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let g={...p};return Object.defineProperty(t,"shape",{value:g}),g},"get")})}let n=Et(()=>Au(t));X(e._zod,"propValues",()=>{let p=t.shape,g={};for(let y in p){let x=p[y]._zod;if(x.values){g[y]??(g[y]=new Set);for(let T of x.values)g[y].add(T)}}return g});let i=Ye,u=t.catchall,c;e._zod.parse=(p,g)=>{c??(c=n.value);let y=p.value;if(!i(y))return p.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),p;p.value={};let x=[],T=c.shape;for(let h of c.keys){let s=T[h],d=s._zod.optout==="optional",v=s._zod.run({value:y[h],issues:[]},g);v instanceof Promise?x.push(v.then(m=>kt(m,p,h,y,d))):kt(v,p,h,y,d)}return u?zu(x,y,p,g,n.value,e):x.length?Promise.all(x).then(()=>p):p}});function Bn(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=>!Me(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,fe())))}),t)}o(Bn,"handleUnionResults");var yr=I("$ZodUnion",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),X(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),X(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),X(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=>St(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 g of t.options){let y=g._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)p.push(y),c=!0;else{if(y.issues.length===0)return y;p.push(y)}}return c?Promise.all(p).then(g=>Bn(g,i,e,u)):Bn(p,i,e,u)}});var Qn=I("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yr.init(e,t);let r=e._zod.parse;X(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,g]of Object.entries(c)){i[p]||(i[p]=new Set);for(let y of g)i[p].add(y)}}return i});let n=Et(()=>{let i=t.options,u=new Map;for(let c of i){let p=c._zod.propValues?.[t.discriminator];if(!p||p.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let g of p){if(u.has(g))throw new Error(`Duplicate discriminator value "${String(g)}"`);u.set(g,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Ye(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let 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 eo=I("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!In(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 y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){p.add(typeof y=="number"?y.toString():y);let x=t.valueType._zod.run({value:i[y],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...be(y,T.issues)),r.value[y]=T.value})):(x.issues.length&&r.issues.push(...be(y,x.issues)),r.value[y]=x.value)}let g;for(let y in i)p.has(y)||(g=g??[],g.push(y));g&&g.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:g})}else{r.value={};for(let p of Reflect.ownKeys(i)){if(p==="__proto__")continue;let g=t.keyType._zod.run({value:p,issues:[]},n);if(g instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&lr.test(p)&&g.issues.length){let T=t.keyType._zod.run({value:Number(p),issues:[]},n);if(T instanceof Promise)throw new Error("Async schemas not supported in object keys currently");T.issues.length===0&&(g=T)}if(g.issues.length){t.mode==="loose"?r.value[p]=i[p]:r.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map(T=>Ie(T,n,fe())),input:p,path:[p],inst:e});continue}let x=t.valueType._zod.run({value:i[p],issues:[]},n);x instanceof Promise?u.push(x.then(T=>{T.issues.length&&r.issues.push(...be(p,T.issues)),r.value[g.value]=T.value})):(x.issues.length&&r.issues.push(...be(p,x.issues)),r.value[g.value]=x.value)}}return u.length?Promise.all(u).then(()=>r):r}});var to=I("$ZodEnum",(e,t)=>{W.init(e,t);let r=ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Tn.has(typeof i)).map(i=>typeof i=="string"?Ue(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let c=i.value;return n.has(c)||i.issues.push({code:"invalid_value",values:r,input:c,inst:e}),i}}),ro=I("$ZodLiteral",(e,t)=>{if(W.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Ue(n):n?Ue(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var no=I("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new It(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(r.value=c,r));if(i instanceof Promise)throw new ce;return r.value=i,r}});function Fn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Fn,"handleOptionalResult");var oo=I("$ZodOptional",(e,t)=>{W.init(e,t),e._zod.optin="optional",e._zod.optout="optional",X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(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=>Fn(u,r.value)):Fn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var io=I("$ZodNullable",(e,t)=>{W.init(e,t),X(e._zod,"optin",()=>t.innerType._zod.optin),X(e._zod,"optout",()=>t.innerType._zod.optout),X(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${St(r.source)}|null)$`):void 0}),X(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var ao=I("$ZodPipe",(e,t)=>{W.init(e,t),X(e._zod,"values",()=>t.in._zod.values),X(e._zod,"optin",()=>t.in._zod.optin),X(e._zod,"optout",()=>t.out._zod.optout),X(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=>Ot(c,t.in,n)):Ot(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>Ot(u,t.out,n)):Ot(i,t.out,n)}});function Ot(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(Ot,"handlePipeResult");var so=I("$ZodCustom",(e,t)=>{Te.init(e,t),W.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Vn(u,r,n,e));Vn(i,r,n,e)}});function Vn(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(pr(i))}}o(Vn,"handleRefineResult");var co;var hr=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 hr}o(po,"registry");(co=globalThis).__zod_globalRegistry??(co.__zod_globalRegistry=po());var vr=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",...H(t)})}o(lo,"_string");function mo(e,t){return new e({type:"string",coerce:!0,...H(t)})}o(mo,"_coercedString");function fo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...H(t)})}o(fo,"_url");function go(e,t){return new e({type:"number",checks:[],...H(t)})}o(go,"_number");function yo(e,t){return new e({type:"number",coerce:!0,checks:[],...H(t)})}o(yo,"_coercedNumber");function ho(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...H(t)})}o(ho,"_int");function vo(e,t){return new e({type:"boolean",...H(t)})}o(vo,"_boolean");function xo(e,t){return new e({type:"boolean",coerce:!0,...H(t)})}o(xo,"_coercedBoolean");function Po(e,t){return new e({type:"bigint",coerce:!0,...H(t)})}o(Po,"_coercedBigint");function _o(e){return new e({type:"any"})}o(_o,"_any");function bo(e){return new e({type:"unknown"})}o(bo,"_unknown");function Io(e,t){return new e({type:"void",...H(t)})}o(Io,"_void");function To(e,t){return new e({type:"date",coerce:!0,...H(t)})}o(To,"_coercedDate");function wt(e,t){return new Nn({check:"greater_than",...H(t),value:e,inclusive:!0})}o(wt,"_gte");function ae(e,t){return new Cn({check:"min_length",...H(t),minimum:e})}o(ae,"_minLength");function Ee(e,t){return new Un({check:"string_format",format:"regex",...H(t),pattern:e})}o(Ee,"_regex");function Eo(e,t,r){let n=H(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Eo,"_custom");var Y=I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");W.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>et(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>tt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>$t(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Dt=I("ZodMiniString",(e,t)=>{Rt.init(e,t),Y.init(e,t)});function a(e){return lo(Dt,e)}o(a,"string");var So=I("ZodMiniStringFormat",(e,t)=>{mr.init(e,t),Dt.init(e,t)});var Fu=I("ZodMiniURL",(e,t)=>{Zn.init(e,t),So.init(e,t)});function $o(e){return fo(Fu,e)}o($o,"url");var Ct=I("ZodMiniNumber",(e,t)=>{fr.init(e,t),Y.init(e,t)});function Q(e){return go(Ct,e)}o(Q,"number");var Vu=I("ZodMiniNumberFormat",(e,t)=>{Hn.init(e,t),Ct.init(e,t)});function Ao(e){return ho(Vu,e)}o(Ao,"int");var xr=I("ZodMiniBoolean",(e,t)=>{gr.init(e,t),Y.init(e,t)});function B(e){return vo(xr,e)}o(B,"boolean");var zo=I("ZodMiniBigInt",(e,t)=>{Gn.init(e,t),Y.init(e,t)});var Zu=I("ZodMiniAny",(e,t)=>{qn.init(e,t),Y.init(e,t)});function nt(){return _o(Zu)}o(nt,"any");var Hu=I("ZodMiniUnknown",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function N(){return bo(Hu)}o(N,"unknown");var Gu=I("ZodMiniVoid",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function Oo(e){return Io(Gu,e)}o(Oo,"_void");var ko=I("ZodMiniDate",(e,t)=>{Jn.init(e,t),Y.init(e,t)});var qu=I("ZodMiniArray",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function O(e,t){return new qu({type:"array",element:e,...H(t)})}o(O,"array");var Wu=I("ZodMiniObject",(e,t)=>{Yn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function l(e,t){let r={type:"object",shape:e??{},...H(t)};return new Wu(r)}o(l,"object");var Ku=I("ZodMiniUnion",(e,t)=>{yr.init(e,t),Y.init(e,t)});function U(e,t){return new Ku({type:"union",options:e,...H(t)})}o(U,"union");var Ju=I("ZodMiniDiscriminatedUnion",(e,t)=>{Qn.init(e,t),Y.init(e,t)});function Se(e,t,r){return new Ju({type:"union",options:t,discriminator:e,...H(r)})}o(Se,"discriminatedUnion");var Xu=I("ZodMiniRecord",(e,t)=>{eo.init(e,t),Y.init(e,t)});function D(e,t,r){return new Xu({type:"record",keyType:e,valueType:t,...H(r)})}o(D,"record");var Yu=I("ZodMiniEnum",(e,t)=>{to.init(e,t),Y.init(e,t),e.options=Object.values(t.entries)});function A(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Yu({type:"enum",entries:r,...H(t)})}o(A,"_enum");var Qu=I("ZodMiniLiteral",(e,t)=>{ro.init(e,t),Y.init(e,t)});function $(e,t){return new Qu({type:"literal",values:Array.isArray(e)?e:[e],...H(t)})}o($,"literal");var ec=I("ZodMiniTransform",(e,t)=>{no.init(e,t),Y.init(e,t)});function $e(e){return new ec({type:"transform",transform:e})}o($e,"transform");var tc=I("ZodMiniOptional",(e,t)=>{oo.init(e,t),Y.init(e,t)});function f(e){return new tc({type:"optional",innerType:e})}o(f,"optional");var rc=I("ZodMiniNullable",(e,t)=>{io.init(e,t),Y.init(e,t)});function ot(e){return new rc({type:"nullable",innerType:e})}o(ot,"nullable");var nc=I("ZodMiniPipe",(e,t)=>{ao.init(e,t),Y.init(e,t)});function Ae(e,t){return new nc({type:"pipe",in:e,out:t})}o(Ae,"pipe");var oc=I("ZodMiniCustom",(e,t)=>{so.init(e,t),Y.init(e,t)});function Ut(e,t){return Eo(oc,e??(()=>!0),t)}o(Ut,"custom");var it={};vn(it,{bigint:()=>pc,boolean:()=>cc,date:()=>lc,number:()=>uc,string:()=>sc});function sc(e){return mo(Dt,e)}o(sc,"string");function uc(e){return yo(Ct,e)}o(uc,"number");function cc(e){return xo(xr,e)}o(cc,"boolean");function pc(e){return Po(zo,e)}o(pc,"bigint");function lc(e){return To(ko,e)}o(lc,"date");var _r=l({retryOnFailure:l({defaultValue:f(B()),hide:f(B())}),continueOnFailure:l({defaultValue:f(B()),hide:f(B())})}),Pr=class{constructor(t,r,n,i,u,c,p,g,y,x,T,h,s){this.name=t;this.displayName=r;this.description=n;this.props=i;this.propertyGroups=u;this.run=c;this.test=p;this.requireAuth=g;this.errorHandlingOptions=y;this.outputSchema=x;this.audience=T;this.aiMetadata=h;this.classification=s}static{o(this,"IAction")}},K=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.propertyGroups,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata,e.classification),"createAction");var L=l({displayName:a(),description:f(a()),advanced:f(B()),width:f(A(["half","full"])),icon:f(a()),placeholder:f(a())}),C=o((e,t)=>l({type:$(t),required:B(),defaultValue:f(nt())}),"TPropertyValue");var re=l({...L.shape,...C(a(),"SHORT_TEXT").shape}),ge=l({...L.shape,...C(a(),"LONG_TEXT").shape});var wo=l({label:a(),value:N(),description:f(a()),icon:f(a())}),Mt=l({disabled:f(B()),placeholder:f(a()),options:O(wo)});var mc=A(["cards"]),ne=l({...L.shape,options:Mt,display:f(mc),...C(N(),"STATIC_DROPDOWN").shape}),ye=l({...L.shape,options:Mt,...C(O(N()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var br=l({...L.shape,...C(N(),"DROPDOWN").shape,refreshers:O(a())}),at=l({...L.shape,...C(O(N()),"MULTI_SELECT_DROPDOWN").shape,refreshers:O(a())});var he=l({...L.shape,reveals:f(O(a())),...C(B(),"CHECKBOX").shape});var ve=l({...L.shape,display:f(A(["stepper"])),min:f(Q()),max:f(Q()),step:f(Q()),...C(Q(),"NUMBER").shape});var st=l({...L.shape,streaming:f(B()),...C(N(),"FILE").shape});var ut=l({...L.shape,...C(a(),"DATE_TIME").shape});var No=D(a(),U([re,ge,ne,at,ye,he,ve,st,ut])),ct=l({...L.shape,properties:No,...C(O(N()),"ARRAY").shape});var Do=A(["any_time","last_24_hours","last_7_days","last_30_days","last_90_days","this_month","custom"]),Co=l({preset:f(Do),after:f(a()),before:f(a())}),Ir=l({...L.shape,display:f(A(["dropdown"])),...C(Co,"DATE_RANGE").shape});var pt=l({...L.shape,...C(U([D(a(),N())]),"JSON").shape});var Uo=U([re,ne,pt,ct,ye]),fc=D(a(),Uo),Tr=l({refreshers:O(a()),...L.shape,...C(N(),"DYNAMIC").shape});var jt=l({...L.shape,...C(Oo(),"MARKDOWN").shape});var lt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(lt||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),Le=(P=>(P.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",P.COMMUNICATION="COMMUNICATION",P.COMMERCE="COMMERCE",P.CORE="CORE",P.UNIVERSAL_AI="UNIVERSAL_AI",P.FLOW_CONTROL="FLOW_CONTROL",P.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",P.ACCOUNTING="ACCOUNTING",P.PRODUCTIVITY="PRODUCTIVITY",P.CONTENT_AND_FILES="CONTENT_AND_FILES",P.DEVELOPER_TOOLS="DEVELOPER_TOOLS",P.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",P.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",P.HUMAN_RESOURCES="HUMAN_RESOURCES",P.PAYMENT_PROCESSING="PAYMENT_PROCESSING",P.MARKETING="MARKETING",P.SALES_AND_CRM="SALES_AND_CRM",P))(Le||{});var dt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(dt||{}),Er="both_client_credentials_and_authorization_code";var Re=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Re||{}),mt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(mt||{}),gc=l({strategy:A(mt),paramName:f(a())}),ft=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(ft||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Mo=l({status:f(Q()),body:f(N()),headers:f(D(a(),a()))}),jo=l({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:f(a()),handlerId:f(a()),streamStepProgress:f(A(Lt))}),Lo=l({type:$("WEBHOOK"),requestId:a(),requestIdToReply:f(a()),response:Mo,handlerId:f(a()),streamStepProgress:f(A(Lt))}),yc=U([jo,Lo]);var hc=l({body:N(),rawBody:f(N()),headers:D(a(),a()),queryParams:D(a(),a())});function se(e){return e==null}o(se,"isNil");function gt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(gt,"isEmpty");function Bt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Bt,"assertNotNullOrUndefined");var Sr=Ce(require("crypto"),1);var vc=128,ze,Be,xc=o(e=>{if(e<0)throw new RangeError("Wrong ID size");try{!ze||ze.length<e?(ze=Buffer.allocUnsafe(e*vc),Sr.default.randomFillSync(ze),Be=0):Be+e>ze.length&&(Sr.default.randomFillSync(ze),Be=0)}catch(t){throw ze=void 0,t}Be+=e},"fillPool"),Pc=o(e=>(xc(e|=0),ze.subarray(Be-e,Be)),"random"),_c=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)=>{if(u<=0)return"";let c="";for(;;){let p=r(i),g=i;for(;g--;)if(c+=e[p[g]&n]||"",c.length===u)return c}}},"customRandom"),Fo=o((e,t=21)=>_c(e,t,Pc),"customAlphabet");var bc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Vo=21,Cb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Vo}}$`))),Ic=Fo(bc,Vo);var Oe=Ae($e(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Oe,updated:Oe},q=o(e=>f(ot(e)),"Nullable");function $r(e){return f(ot(A(e)))}o($r,"NullableEnum");var jb=Ae($e(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),f(B())),Ft=o(e=>Ae($e(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),f(O(e))),"OptionalArrayFromQuery");var Fb=D(a(),N());var yt=(x=>(x.OPENAI="openai",x.OPENROUTER="openrouter",x.ANTHROPIC="anthropic",x.AZURE="azure",x.GOOGLE="google",x.ACTIVEPIECES="activepieces",x.CLOUDFLARE_GATEWAY="cloudflare-gateway",x.CUSTOM="custom",x.BEDROCK="bedrock",x.MISTRAL="mistral",x))(yt||{});var eI=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var rI=l({filename:a(),data:N(),type:$("file"),mimetype:f(a())});var Tc=Ce(Ho());var cI=l({...ie,name:a(),permissions:O(a()),platformId:q(a()),type:a(),userCount:f(Q())});var Go=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Go||{}),Ar=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ar||{}),zr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(zr||{});var Or=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Or||{});var kr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(kr||{});var Ec=l({mode:A(Go),value:N()}),Sc=l({auth:f(a()),fields:D(a(),Ec)}),$c=l({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:f(Sc)}),Ac=l({type:$("PIECE"),toolName:a().check(ae(1)),pieceMetadata:$c}),zc=l({type:$("none")}),Oc=l({type:$("access_token"),accessToken:a()}),kc=l({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),Rc=l({type:$("headers"),headers:D(a(),a())}),wc=Se("type",[zc,Oc,kc,Rc]),qo=l({type:$("FLOW"),toolName:a().check(ae(1)),externalFlowId:a(),flowDisplayName:f(a())}),Wo=l({type:$("MCP"),toolName:a().check(ae(1)),serverUrl:$o(),protocol:A(zr),auth:wc}),Ko=l({type:$("KNOWLEDGE_BASE"),toolName:a().check(ae(1)),sourceType:A(Ar),sourceId:a(),sourceName:a()}),Nc=Se("type",[Ac,qo,Wo,Ko]),Dc=l({displayName:a(),description:f(a()),type:A(Or)}),Jo=l({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:q(D(a(),N())),output:f(N()),toolName:a(),status:A(kr),toolCallId:a(),startTime:a(),endTime:f(a())},LI=l(Fe),Xo=Se("toolCallType",[l({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),l({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),l({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),l({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),l({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),Cc=U([Jo,Xo]);var Rr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Rr||{}),xe=l({apiKey:a()}),Uc=xe,Mc=l({apiKey:a(),apiKeyHash:a()}),jc=xe,Lc=xe,Bc=xe,Fc=xe,Vc=xe,Zc=xe,Hc=xe,ri=l({accessKeyId:a().check(ae(1)),secretAccessKey:a().check(ae(1))}),Gc=l({}),qc=l({}),Wc=l({}),Kc=l({}),Jc=l({}),Xc=l({}),ni=l({modelId:a(),modelName:a(),modelType:A(Rr)}),oi=l({apiKeyHeader:a(),baseUrl:a(),models:O(ni),defaultHeaders:f(D(a(),a()))}),ii=l({accountId:a(),gatewayId:a(),models:O(ni),vertexProject:f(a()),vertexRegion:f(a())}),ai=l({resourceName:a(),apiVersion:Ae($e(e=>typeof e=="string"&&e.trim().length===0?void 0:e),f(a()))}),si=l({region:a().check(ae(1))}),Yc=U([Uc,Bc,Fc,Vc,Zc,Lc,jc,Mc,ri,Hc]),ui=U([oi,ii,ai,si,Gc,Wc,Kc,Jc,qc,Xc]),Qc=l({id:a(),name:a(),type:A(Rr)}),ep=l({id:a(),name:a(),provider:A(yt),config:ui,enabledForChat:B()}),tp=l({provider:A(yt),config:ui,auth:Yc,platformId:a()});var ZI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Yo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],rp=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],np=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Qo=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],op=["grok-4.20","grok-4.1-fast"],ip={openai:Yo,anthropic:rp,google:Qo,activepieces:[...np.map(e=>`anthropic/${e}`),...Yo.map(e=>`openai/${e}`),...Qo.map(e=>`google/${e}`),...op.map(e=>`x-ai/${e}`)]};var ei=128e3,ap={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function sp({provider:e}){return e?ap[e]??ei:ei}o(sp,"getMaxContextTokens");var ti={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"},up={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},cp=new Set(["anthropic","mistral"]);function pe(e){return{chatModels:ip[e],maxContextTokens:sp({provider:e}),defaultEmbeddingModel:ti[e],supportsEmbedding:ti[e]!==void 0,supportsImageGeneration:!cp.has(e),webSearch:up[e]}}o(pe,"buildProviderCapabilities");var pp={openai:pe("openai"),anthropic:pe("anthropic"),openrouter:pe("openrouter"),azure:pe("azure"),google:pe("google"),"cloudflare-gateway":pe("cloudflare-gateway"),custom:pe("custom"),bedrock:pe("bedrock"),mistral:pe("mistral"),activepieces:pe("activepieces")};var lp=l({base64Url:a(),fileName:a(),extension:f(a())}),dp=l({mimeType:a(),url:a(),fileName:f(a())}),wr=U([lp,dp]);var mp=U([l({type:$("file"),value:wr}),l({type:$("markdown"),value:a(),files:f(O(wr))})]),fp=l({sessionId:a(),message:a(),files:f(O(a()))});var pi=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(pi||{}),li=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(li||{}),Nr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Nr||{});var gp=U([l({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:l({options:O(l({value:a()}))})}),l({...ie,name:a(),externalId:a(),type:U([$("TEXT"),$("NUMBER"),$("DATE"),$("DATETIME")]),tableId:a(),projectId:a()})]),yp=l({...ie,name:a(),folderId:q(a()),projectId:a(),externalId:a(),status:$r(li),trigger:$r(pi)}),hp=l({...ie,tableId:a(),projectId:a(),cells:D(a(),l({updated:a(),created:a(),value:N(),fieldName:a()}))}),vp=l({events:O(A(Nr)),webhookUrl:a(),flowId:a()}),xp=l({fields:O(l({id:a(),name:a()})),rows:O(D(a(),a())),name:a()}),Pp=l({projectId:a(),limit:f(it.number()),cursor:f(a()),name:f(a()),externalIds:Ft(a()),folderId:f(a()),folderIds:Ft(a())}),_p=l({records:O(O(l({fieldId:a(),value:mi()}))),tableId:a()}),bp=l({cells:f(O(l({fieldId:a(),value:mi()}))),tableId:a(),agentUpdate:f(B())}),di=Se("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),ci("exists"),ci("not_exists")]),Ip=l({tableId:a(),limit:f(it.number()),cursor:f(a()),filters:Ft(di)});function mi(){return Ae($e(e=>e==null?e:String(e)),ot(a()))}o(mi,"coerceToString");function we(e){return l({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function ci(e){return l({fieldId:a(),operator:$(e)})}o(ci,"existenceFilter");var Tp=l({status:f(Q()),body:f(N()),headers:f(D(a(),a()))}),Ep=l({...ie,deleted:q(Oe),ownerId:a(),displayName:a(),platformId:a(),externalId:q(a())});var fi=l({name:a(),description:f(a()),type:a(),required:B()}),Sp=l({pieceName:a(),triggerName:a(),input:l({toolName:a(),toolDescription:a(),inputSchema:O(fi),returnsResponse:B()})});var gi="^[0-9]+\\.[0-9]+\\.[0-9]+$",cT=new RegExp(gi),Ap="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",pT=a().check(Ee(new RegExp(gi))),lT=a().check(Ee(new RegExp(Ap))),zp=l({packageType:$("ARCHIVE"),pieceType:A(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),yi=l({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),hi=l({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),dT=U([yi,hi]),mT=U([zp,yi,hi]);var Op=Se("type",[l({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),l({type:$("INTERVAL"),intervalMs:Ao().check(wt(6e4))})]),fT=l({...ie,type:A(Re),projectId:a(),flowId:a(),triggerName:a(),schedule:q(Op),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:q(a()),simulate:B()}),vi=(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))(vi||{}),xi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(xi||{}),Pi=(r=>(r.S3="S3",r.DB="DB",r))(Pi||{}),gT=l({...ie,projectId:q(a()),platformId:q(a()),type:A(vi),compression:A(xi),data:f(N()),location:A(Pi),size:q(Q()),fileName:q(a()),s3Key:q(a()),metadata:q(D(a(),a()))}),_i=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(_i||{}),bi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(bi||{}),yT=l({id:a(),email:a(),firstName:a(),status:A(bi),externalId:q(a()),platformId:q(a()),platformRole:A(_i),lastName:a(),created:Oe,updated:Oe,lastActiveDate:q(Oe),imageUrl:q(a())});var Dr=l({...L.shape,...C(D(a(),N()),"OBJECT").shape});var Cr=l({...L.shape,formatProperty:f(a()),...C(a(),"RICH_TEXT").shape});var Si=l({...L.shape,...C(a(),"COLOR").shape});var Ur=U([re,ge,Cr,jt,he,ne,ye,br,at,Tr,ve,ct,Dr,pt,ut,Ir,st,Si]),_={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"}},RichText(e){return{...e,valueSchema:void 0,type:"RICH_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"}},DateRange(e){return{...e,valueSchema:void 0,type:"DATE_RANGE"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var le=l({displayName:a(),description:f(a()),hasConnectionIdentifier:f(B())});var $i=l({username:a(),password:a()}),Mr=l({...le.shape,username:l({displayName:a(),description:f(a())}),password:l({displayName:a(),description:f(a())}),...C($i,"BASIC_AUTH").shape});var Np=D(a(),U([re,ge,ve,he,ne])),jr=l({...le.shape,props:Np,...C(N(),"CUSTOM_AUTH").shape});var Ne=l({...le.shape,...C(l({auth:a()}),"SECRET_TEXT").shape});var Dp=D(a(),U([re,ge,Ne,ve,he,ne,ye,jt])),Ai=l({...le.shape,props:Dp,...C(N(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),zi=U([re,Ne,ne]),Oi=D(a(),zi),Cp=l({props:f(D(a(),zi)),authUrl:a(),tokenUrl:a(),scope:O(a()),prompt:f(U([$("none"),$("consent"),$("login"),$("omit")])),pkce:f(B()),pkceMethod:f(U([$("plain"),$("S256")])),authorizationMethod:f(A(Lr)),grantType:f(U([A(dt),$(Er)])),extra:f(D(a(),a()))}),ki=l({access_token:a(),props:f(Oi),data:D(a(),nt())}),Br=l({...le.shape,...Cp.shape,...C(ki,"OAUTH2").shape});var Ve=U([Mr,jr,Ai,Br,Ne]),ht="Connection",Fr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||ht}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||ht,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||ht}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||ht}},None(){}};var QE={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 Up=l({...L.shape,...C(N(),"CUSTOM").shape,code:a()});var Mp=U([Ur,Ve]),Vr=D(a(),Mp),PS=D(a(),Ur);var Ri=U([l({strategy:$("CRON"),cronExpression:a()}),l({strategy:$("NONE")})]);var wi="2",Zt="0.82.0";var Zr=class{constructor(t,r,n,i,u,c,p,g,y=Zt,x,T="",h){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=p;this.auth=g;this.minimumSupportedRelease=y;this.maximumSupportedRelease=x;this.description=T;this.deprecated=h;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:wi}),"getContextInfo");(!Lp(y)||Bp(y,Zt))&&(this.minimumSupportedRelease=Zt),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:jp(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}},Di=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 Zr(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 jp(e){if(e!==void 0)return Array.isArray(e)?e.map(Ni):Ni(e)}o(jp,"withConnectionIdentifierFlag");function Ni(e){return{...e,hasConnectionIdentifier:e.getConnectionIdentifier!==void 0}}o(Ni,"flagConnectionIdentifier");function Lp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Lp,"isValidSimpleSemver");function Bp(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(Bp,"isSemverLessThan");var Fp=f(D(a(),D(a(),a()))),Ci=l({id:f(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:O(a()),platformId:f(a()),directoryPath:f(a()),auth:f(U([Ve,O(Ve)])),version:a(),categories:f(O(A(Le))),minimumSupportedRelease:f(a()),maximumSupportedRelease:f(a()),deprecated:f(B()),i18n:Fp}),Vp=A(["human","ai","both"]),Ui=l({description:f(a()),idempotent:f(B())}),Mi=A(["READ","SEARCH","WRITE","DESTRUCTIVE"]);var Zp=A(["tabs","section","summary","builder","footer"]),ji=l({key:a(),display:Zp,label:f(a()),description:f(a()),icon:f(a()),props:O(a())}),Li=l({name:a(),displayName:a(),description:a(),props:Vr,propertyGroups:f(O(ji)),requireAuth:B(),errorHandlingOptions:f(_r),outputSchema:f(Ut()),audience:f(Vp),aiMetadata:f(Ui),classification:f(Mi)}),Bi=l({name:a(),displayName:a(),description:a(),props:Vr,propertyGroups:f(O(ji)),errorHandlingOptions:f(_r),type:A(Re),sampleData:N(),handshakeConfiguration:f(Ut()),renewConfiguration:f(Ri),testStrategy:A(ft),outputSchema:f(Ut()),aiMetadata:f(Ui),classification:f(Mi)}),Hp=l({...Ci.shape,actions:D(a(),Li),triggers:D(a(),Bi)}),Gp=l({...Ci.shape,actions:Q(),triggers:Q(),suggestedActions:f(O(Li)),suggestedTriggers:f(O(Bi))}),Fi=l({projectUsage:Q(),pieceType:A(je),packageType:A(lt),platformId:f(a()),archiveId:f(a())}),b$=l({...Hp.shape,...Fi.shape}),I$=l({...Gp.shape,...Fi.shape}),T$=l({name:a(),version:a()});var qp=Ce(require("path")),Wp=Ce(require("fs/promises"));var Ze=require("node:stream");var Ht=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};return t.authentication&&this.populateAuthentication(t.authentication,r),t.body&&(t.headers?.["Content-Type"]==="text/csv"?r["Content-Type"]="text/csv":r["Content-Type"]="application/json"),t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Gt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Hr,r=new Gr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Hr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Gr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var vt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Vi({error:e,requestBody:t}){return e instanceof vt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Vi,"toFailsafeOutput");var qr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(qr||{});var qt=class extends Ht{static{o(this,"FetchHttpClient")}constructor(t="",r=new Gt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[j,oe]of Object.entries(c))i.append(j,oe);let p=i.toString(),g=p?`${n}?${p}`:n,y=t.responseType??"json",x=t.followRedirects??!0,T=t.retries??0,{body:h,extraHeaders:s,isStream:d}=Kp(t.method)?Jp(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},v=Yp({...u,...s}),m=await Xp(async()=>{let j=new AbortController,oe=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let de={method:t.method.toString(),headers:v,body:h,redirect:x?"follow":"manual",signal:j.signal};return d&&(de.duplex="half"),r?.dispatcher!==void 0&&(de.dispatcher=r.dispatcher),await fetch(g,de)}finally{oe!==void 0&&clearTimeout(oe)}},d?0:T),P=x?300:400;if(m.status<200||m.status>=P){let j=await Zi(m,y==="stream"?"text":y),oe=new vt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",oe),oe}let b=await Zi(m,y);return{status:m.status,headers:Qp(m.headers),body:b}}};function Kp(e){return e!=="GET"&&e!=="HEAD"}o(Kp,"acceptsRequestBody");function Jp(e,t){if(Gi(e))return{body:void 0,extraHeaders:{},isStream:!1};if(el(e)){let n=new Ze.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return e instanceof Ze.Readable?{body:e,extraHeaders:{},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(Jp,"serializeBody");async function Zi(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"stream":return Gi(e.body)?Ze.Readable.from([]):Ze.Readable.fromWeb(e.body);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(Zi,"parseResponseBody");async function Xp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Hi(n);continue}return i}catch(i){if(r=i,n<t){await Hi(n);continue}throw i}throw r}o(Xp,"sendWithRetries");function Hi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Hi,"backoff");function Yp(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(Yp,"normalizeHeaders");function Qp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Qp,"toHttpHeaders");function el(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(el,"isNodeFormData");function Gi(e){return e==null}o(Gi,"isNil");var Wt=new qt;var Bd=Ce(require("fs")),Ys=Ce(Xs());var Fd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function Vd(e){let t=e.split(";")[0].trim().toLowerCase();return Fd[t]??""}o(Vd,"contentTypeToExtension");var Zd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Hd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function Qs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:p,authLocation:g="headers",classification:y="WRITE"}){return K({audience:"human",name:u||"custom_api_call",classification:y,displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:_.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:x})=>({url:_.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${Hd(t,x)}/resource or /resource`,required:!0,defaultValue:x?t(x):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(qr).map(x=>({label:x,value:x}))},...c?.method??{}}),headers:_.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:_.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:_.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:_.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:x})=>{if(!x)return{};let T=x,h={};switch(T){case"none":break;case"json":h.data=_.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":h.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":h.data=_.Array({displayName:"Form Data",required:!0,properties:{fieldName:_.ShortText({displayName:"Field Name",required:!0}),fieldType:_.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:_.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:_.File({displayName:"File Field Value",required:!1})}});break}return h},"props")}),response_is_binary:_.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:_.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:_.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:_.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...p},run:o(async x=>{let{method:T,url:h,headers:s,queryParams:d,body:v,body_type:m,failsafe:P,timeout:b,response_is_binary:j,followRedirects:oe}=x.propsValue;Bt(T,"Method"),Bt(h,"URL");let de=se(r)?{}:await r(x.auth,x.propsValue),Pe=h.url,pu=Pe.startsWith("http://")||Pe.startsWith("https://")?Pe:Zd({baseUrl:t(x.auth),relativePath:Pe}),_e={method:T,url:pu,headers:{...s??{},...g==="headers"||!se(g)?de:{}},queryParams:{...g==="queryParams"?de:{},...d??{}},timeout:b?b*1e3:0,followRedirects:oe};if(j&&(_e.responseType="arraybuffer"),v)if(m&&m!=="none"){let me=v.data;if(m==="form_data"){let lu=me,bt=new Ys.default;for(let{fieldName:gn,fieldType:yn,textFieldValue:hn,fileFieldValue:ir}of lu)yn==="text"&&!gt(hn)?bt.append(gn,hn):yn==="file"&&!gt(ir)&&bt.append(gn,ir.data,{filename:ir?.filename});_e.body=bt,_e.headers={..._e.headers,...bt.getHeaders()}}else _e.body=me}else m||(_e.body=v);try{let me=await Wt.sendRequest(_e);return await Gd(x.files,me.body,me.status,me.headers,j)}catch(me){if(P)return Vi({error:me,requestBody:_e.body});throw me}},"run")})}o(Qs,"createCustomApiCallAction");var Gd=o(async(e,t,r,n,i)=>{let u;if(i&&qd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],p=Vd(c??"")||"txt",g;t instanceof ArrayBuffer?g=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?g=t:g=Buffer.from(t),u=await e.write({fileName:`output.${p}`,data:g})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),qd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Wd="https://api.bokio.se/v1";async function Z(e,t,r,n){try{return(await Wt.sendRequest({method:t,url:`${Wd}${r}`,headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json"},body:n})).body}catch(i){throw new Error(`Unexpected error: ${i.message||String(i)}`)}}o(Z,"makeRequest");var V=Fr.CustomAuth({displayName:"Bokio API Key",description:"Bokio API Key is required to authenticate requests to Bokio",required:!0,props:{companyId:_.ShortText({displayName:"Company ID",description:"Enter your Bokio Company ID ",required:!0}),api_key:_.ShortText({displayName:"API Key",description:"Enter your Bokio API Key",required:!0})},validate:o(async({auth:e})=>{if(e)try{return await Z(e.api_key,"GET",`/companies/${e.companyId}/journal-entries`),{valid:!0}}catch{return{valid:!1,error:"Invalid Api Key"}}return{valid:!1,error:"Invalid Api Key"}},"validate")});var eu=K({auth:V,name:"createCustomer",classification:"WRITE",displayName:"Create Customer",description:"Creates a new customer in Bokio",audience:"both",aiMetadata:{description:"Creates a new customer record in a Bokio accounting company. Use to register a person or company before invoicing them; only customer name and type (individual/company) are required, with optional VAT/org number, contact, and address details. Not idempotent \u2014 each call creates a separate customer.",idempotent:!1},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer",required:!0}),type:_.StaticDropdown({displayName:"Customer Type",description:"Type of the customer",required:!0,options:{options:[{label:"Individual",value:"private"},{label:"Company",value:"company"}]}}),vatNumber:_.ShortText({displayName:"VAT Number",description:"Customer VAT number",required:!1}),orgNumber:_.ShortText({displayName:"Organization Number",description:"Customer organization number",required:!1}),paymentTerms:_.ShortText({displayName:"Payment Terms",description:"Payment terms for the customer. Payment terms for the invoices. Payment terms can both take free text or days, in digits, until the payment is due.",required:!1}),customerNumber:_.ShortText({displayName:"Customer Number",description:"Customer number (optional)",required:!1}),email:_.ShortText({displayName:"Email",description:"Customer email address",required:!1}),phone:_.ShortText({displayName:"Phone",description:"Customer phone number",required:!1}),lin1:_.ShortText({displayName:"Address line 1",description:"Customer address line 1",required:!1}),line2:_.ShortText({displayName:"Address line 2",description:"Customer address line 2",required:!1}),zipCode:_.ShortText({displayName:"Zip Code",description:"Customer zip code",required:!1}),city:_.ShortText({displayName:"City",description:"Customer city",required:!1}),country:_.ShortText({displayName:"Country",description:"Customer country (ISO 3166-1 alpha-2 country code)",required:!1})},async run(e){let{customerName:t,type:r,vatNumber:n,orgNumber:i,paymentTerms:u,customerNumber:c,email:p,phone:g,lin1:y,line2:x,zipCode:T,city:h,country:s}=e.propsValue,{api_key:d,companyId:v}=e.auth.props,m={name:t,type:r};n&&(m.vat_number=n),i&&(m.org_number=i),c&&(m.customer_number=c),u&&(m.payment_terms=u);let P={};p&&(P.email=p),g&&(P.phone=g),Object.keys(P).length>0&&(m.contactsDetails=P);let b={};return y&&(b.line_1=y),x&&(b.line_2=x),T&&(b.zip_code=T),h&&(b.city=h),s&&(b.country=s),Object.keys(b).length>0&&(m.address=b),await Z(d,"POST",`/companies/${v}/customers`,m)}});var or=_.Dropdown({auth:V,displayName:"Invoice",description:"Select the invoice",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,options:[]};try{return{disabled:!1,options:(await Z(e.props.api_key,"GET",`/companies/${e.props.companyId}/invoices?limit=100`)).items.map(n=>({label:`#${n.invoiceNumber} - ${n.customerRef.customerName}`,value:n.id}))}}catch{return{disabled:!0,options:[]}}},"options")}),Kd=_.StaticDropdown({displayName:"Unit Type",description:"Unit type for the item",required:!1,options:{options:[{label:"Unspecified",value:"unspecified"},{label:"Piece",value:"piece"},{label:"Hour",value:"hour"},{label:"Day",value:"day"},{label:"Month",value:"month"},{label:"Kilogram",value:"kilogram"},{label:"Gram",value:"gram"},{label:"Liter",value:"liter"},{label:"Meter",value:"meter"},{label:"Centimeter",value:"centimeter"},{label:"Millimeter",value:"millimeter"},{label:"Meter Squared",value:"meterSquared"},{label:"Meter Cubic",value:"meterCubic"},{label:"Mile",value:"mile"},{label:"Kilometer",value:"kilometer"},{label:"Gigabyte",value:"gigabyte"},{label:"Hectar",value:"hectar"},{label:"Words",value:"words"},{label:"Year",value:"year"},{label:"Week",value:"week"},{label:"Minute",value:"minute"},{label:"Megabyte",value:"megabyte"},{label:"Ton",value:"ton"}]}}),Je=_.DynamicProperties({auth:V,displayName:"Item Details",description:"Configure item details based on item type",required:!1,refreshers:["itemType"],props:o(async({itemType:e})=>{let t={description:_.ShortText({displayName:"Description",description:"Description of the line item",required:!0})};return e==="salesItem"&&(t.itemRefId=_.ShortText({displayName:"Item Reference ID",description:"UUID of the item reference",required:!1}),t.productType=_.StaticDropdown({displayName:"Product Type",description:"Type of product",required:!0,options:{options:[{label:"Goods",value:"goods"},{label:"Service",value:"service"}]}}),t.unitType=Kd,t.quantity=_.Number({displayName:"Quantity",description:"Quantity of the item",required:!0,defaultValue:1}),t.unitPrice=_.Number({displayName:"Unit Price",description:"Price per unit",required:!0}),t.taxRate=_.Number({displayName:"Tax Rate",description:"Tax rate in percentage (e.g., 25 for 25%)",required:!1})),t},"props")});var tu=K({auth:V,name:"createInvoice",classification:"WRITE",displayName:"Create Invoice",description:"Creates a new draft invoice in Bokio",audience:"both",aiMetadata:{description:"Creates a new draft invoice in a Bokio company with a single line item. Use to start a new customer invoice; invoice date, due date, and item type are required, and the customer is linked by passing the customer UUID. Not idempotent \u2014 each call creates a separate draft invoice.",idempotent:!1},props:{invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate (defaults to 1)",required:!1}),itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the line item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:Je},async run(e){let{invoiceType:t,customerRef:r,invoiceDate:n,dueDate:i,orderNumberReference:u,currency:c,currencyRate:p,itemType:g,dynamicProps:y}=e.propsValue,{api_key:x,companyId:T}=e.auth.props,h={type:t||"invoice",invoiceDate:n,dueDate:i};r&&(h.customerRef={id:r}),u&&(h.orderNumberReference=u),c&&(h.currency=c),p!=null&&(h.currencyRate=p);let s={};return g==="salesItem"&&y&&(s.itemType=g,h.description=y?.description,s.quantity=y.quantity,s.unitPrice=y.unitPrice,y.itemRefId&&(s.itemRef={id:y.itemRefId}),y.productType&&(s.productType=y.productType),y.unitType&&(s.unitType=y.unitType),y.taxRate!==void 0&&y.taxRate!==null&&(s.taxRate=y.taxRate)),h.lineItems=[s],await Z(x,"POST",`/companies/${T}/invoices`,h)}});var ru=K({auth:V,name:"addLineItemToInvoice",classification:"WRITE",displayName:"Add line item to invoice",description:"Adds a line item to an existing draft invoice",audience:"both",aiMetadata:{description:"Appends a single line item to an existing draft invoice in Bokio, identified by invoice ID. Use to add a product, service, or description-only row to an invoice that already exists; pricing fields apply only when item type is a sales item. Not idempotent \u2014 each call appends another line item.",idempotent:!1},props:{invoiceId:or,itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Description Only Item",value:"descriptionOnlyItem"}]}}),dynamicProps:Je},async run(e){let{invoiceId:t,itemType:r,dynamicProps:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={itemType:r,description:n?.description};return r==="salesItem"&&n&&(c.quantity=n.quantity,c.unitPrice=n.unitPrice,n.itemRefId&&(c.itemRef={id:n.itemRefId}),n.productType&&(c.productType=n.productType),n.unitType&&(c.unitType=n.unitType),n.taxRate!==void 0&&n.taxRate!==null&&(c.taxRate=n.taxRate)),await Z(i,"POST",`/companies/${u}/invoices/${t}/line-items`,c)}});var nu=K({auth:V,name:"createAnItem",classification:"WRITE",displayName:"Create an item",description:"Creates a new item in Bokio",audience:"both",aiMetadata:{description:"Creates a new reusable item (a sales item with pricing, or a text item) in a Bokio company catalog. Use to define a product or service that can later be referenced on invoices; item type is required. Not idempotent \u2014 each call creates a separate item.",idempotent:!1},props:{itemType:_.StaticDropdown({displayName:"Item Type",description:"Type of the item",required:!0,options:{options:[{label:"Sales Item",value:"salesItem"},{label:"Text",value:"text"}]}}),dynamicProps:Je},async run(e){let{itemType:t,dynamicProps:r}=e.propsValue,{api_key:n,companyId:i}=e.auth.props,u={itemType:t,description:r?.description};return r?.productType&&(u.productType=r.productType),r?.unitType&&(u.unitType=r.unitType),r?.unitPrice!==void 0&&r?.unitPrice!==null&&(u.unitPrice=r.unitPrice),r?.taxRate!==void 0&&r?.taxRate!==null&&(u.taxRate=r.taxRate),await Z(n,"POST",`/companies/${i}/items`,u)}});var ou=K({auth:V,name:"createAJournalEntry",classification:"WRITE",displayName:"Create a journal entry",description:"Creates a new journal entry in Bokio",audience:"both",aiMetadata:{description:"Records a new bookkeeping journal entry in a Bokio company, posting debit/credit amounts against account numbers. Use for manual double-entry transactions; the entry date is required and items carry the per-account debit/credit lines. Not idempotent \u2014 each call posts a separate journal entry.",idempotent:!1},props:{title:_.ShortText({displayName:"Title",description:"Title of the journal entry",required:!1}),date:_.ShortText({displayName:"Date",description:"Journal entry date (YYYY-MM-DD)",required:!0}),items:_.Array({displayName:"Items (JSON)",description:"Journal entry items as JSON array. Each item should have: account (account number), debit (optional), credit (optional)",required:!1,properties:{account:_.Number({displayName:"Account Number",description:"Account number for the journal entry item",required:!1}),debit:_.Number({displayName:"Debit Amount",description:"Debit amount for the journal entry item",required:!1}),credit:_.Number({displayName:"Credit Amount",description:"Credit amount for the journal entry item",required:!1})}})},async run(e){let{title:t,date:r,items:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c={date:r};return t&&(c.title=t),n&&(c.items=n),await Z(i,"POST",`/companies/${u}/journal-entries`,c)}});var iu=K({auth:V,name:"updateAnInvoice",classification:"WRITE",displayName:"Update an invoice",description:"Updates an existing draft invoice in Bokio",audience:"both",aiMetadata:{description:"Updates an existing draft invoice in Bokio, identified by invoice ID, replacing fields such as type, customer, dates, currency, and the full line-items list (passed as a JSON array). Use to modify an invoice that already exists rather than create one. Idempotent \u2014 repeating the same update yields the same invoice state.",idempotent:!0},props:{invoiceId:or,invoiceType:_.StaticDropdown({displayName:"Invoice Type",description:"Type of invoice",required:!1,options:{options:[{label:"Invoice",value:"invoice"},{label:"Cash Invoice",value:"cashInvoice"}]}}),customerRef:_.ShortText({displayName:"Customer ID",description:"UUID of the customer",required:!1}),invoiceDate:_.ShortText({displayName:"Invoice Date",description:"Invoice date (YYYY-MM-DD)",required:!0}),dueDate:_.ShortText({displayName:"Due Date",description:"Due date (YYYY-MM-DD)",required:!0}),orderNumberReference:_.ShortText({displayName:"Order Number Reference",description:"The order number associated with the invoice",required:!1}),currency:_.ShortText({displayName:"Currency",description:"ISO 4217 currency code (e.g., SEK, EUR, USD)",required:!1}),currencyRate:_.Number({displayName:"Currency Rate",description:"Currency rate",required:!1}),lineItemsJson:_.LongText({displayName:"Line Items (JSON)",description:"Line items as JSON array. Each item should have: itemRef (object with id), description, quantity, unitPrice, unit, itemType (PRODUCT or SERVICE), vat",required:!1})},async run(e){let{invoiceId:t,invoiceType:r,customerRef:n,invoiceDate:i,dueDate:u,orderNumberReference:c,currency:p,currencyRate:g,lineItemsJson:y}=e.propsValue,{api_key:x,companyId:T}=e.auth.props,h={};if(r&&(h.type=r),n&&(h.customerRef={id:n}),i&&(h.invoiceDate=i),u&&(h.dueDate=u),c&&(h.orderNumberReference=c),p&&(h.currency=p),g!=null&&(h.currencyRate=g),y)try{h.lineItems=JSON.parse(y)}catch{throw new Error("Invalid JSON format for line items")}return await Z(x,"PUT",`/companies/${T}/invoices/${t}`,h)}});var au=K({auth:V,name:"findCustomer",classification:"SEARCH",displayName:"Find Customer",description:"Find customers in Bokio by filtering and pagination",audience:"both",aiMetadata:{description:"Lists customers in a Bokio company with pagination, optionally filtered by name, type, VAT number, or organization number. Leaving the filter empty returns all customers; supplying a filter type and value narrows to matching records. Use to look up a customer or their ID. Idempotent read-only lookup.",idempotent:!0},props:{filterType:_.StaticDropdown({displayName:"Filter Type",description:"Type of filter to use",required:!1,options:{options:[{label:"Name",value:"name"},{label:"Type",value:"type"},{label:"VAT Number",value:"vatNumber"},{label:"Organization Number",value:"orgNumber"}]}}),filterValue:_.ShortText({displayName:"Filter Value",description:"Value to filter by",required:!1}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{filterType:t,filterValue:r,page:n,pageSize:i}=e.propsValue,{api_key:u,companyId:c}=e.auth.props,p="";t&&r&&(p=`${t}=='${r}'`);let g=new URLSearchParams;n!=null?g.append("page",String(n)):g.append("page","1"),i!=null?g.append("pageSize",String(i)):g.append("pageSize","25"),p&&g.append("query",p);let y=`/companies/${c}/customers?${g.toString()}`;return await Z(u,"GET",y)}});var su=K({auth:V,name:"getDraftInvoiceByCustomerName",classification:"SEARCH",displayName:"Get Draft Invoice by Customer Name",description:"Get all draft invoices for a customer by customer name",audience:"both",aiMetadata:{description:"Looks up a Bokio customer by exact name and returns their draft invoices with pagination. Use when you have a customer name (not an ID) and want their pending draft invoices; returns an empty result if no customer matches. Idempotent read-only lookup.",idempotent:!0},props:{customerName:_.ShortText({displayName:"Customer Name",description:"Name of the customer to find draft invoices for",required:!0}),page:_.Number({displayName:"Page",description:"Page number (defaults to 1)",required:!1}),pageSize:_.Number({displayName:"Page Size",description:"Number of items per page (max 100, defaults to 25)",required:!1})},async run(e){let{customerName:t,page:r,pageSize:n}=e.propsValue,{api_key:i,companyId:u}=e.auth.props,c=new URLSearchParams;c.append("page","1"),c.append("pageSize","100"),c.append("query",`name=='${t}'`);let p=`/companies/${u}/customers?${c.toString()}`,g=await Z(i,"GET",p);if(!g.items||g.items.length===0)return{message:`No customer found with name: ${t}`,items:[]};let y=g.items[0].id,x=new URLSearchParams;r!=null?x.append("page",String(r)):x.append("page","1"),n!=null?x.append("pageSize",String(n)):x.append("pageSize","25"),x.append("query",`status==draft&&customerRef==${y}`);let T=`/companies/${u}/invoices?${x.toString()}`,h=await Z(i,"GET",T);return{customerName:g.items[0].name,customerId:y,...h}}});var uu=K({auth:V,name:"getAnInvoice",classification:"READ",displayName:"Get an invoice",description:"Retrieve a specific invoice by its ID",audience:"both",aiMetadata:{description:"Retrieves a single invoice from a Bokio company by its invoice ID. Use when you already have the invoice ID and need its full details. Idempotent read-only lookup.",idempotent:!0},props:{invoiceId:_.ShortText({displayName:"Invoice ID",description:"The ID of the invoice to retrieve",required:!0})},async run(e){let{invoiceId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await Z(r,"GET",`/companies/${n}/invoices/${t}`)}});var cu=K({auth:V,name:"getAJournalEntry",classification:"READ",displayName:"Get a journal entry",description:"Retrieve a specific journal entry by its ID",audience:"both",aiMetadata:{description:"Retrieves a single journal entry from a Bokio company by its UUID. Use when you already have the journal entry ID and need its full bookkeeping details. Idempotent read-only lookup.",idempotent:!0},props:{journalEntryId:_.ShortText({displayName:"Journal Entry ID",description:"UUID of the journal entry",required:!0})},async run(e){let{journalEntryId:t}=e.propsValue,{api_key:r,companyId:n}=e.auth.props;return await Z(r,"GET",`/companies/${n}/journal-entries/${t}`)}});var Jd=Di({displayName:"Bokio",auth:V,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/bokio.png",authors:["sanket-a11y"],categories:["ACCOUNTING"],description:"Bokio is an accounting software platform which offers digital bookkeeping, invoicing, and financial management tools to help simplify accounting processes.",actions:[eu,tu,ru,nu,ou,iu,au,su,uu,cu,Qs({auth:V,baseUrl:o(e=>`https://api.bokio.se/v1/companies/${e?.props.companyId}`,"baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e?.props.api_key}`}),"authMapping")})],triggers:[]});0&&(module.exports={bokio});
4
4
  /*! Bundled license information:
5
5
 
6
6
  mime-types/index.js: