@activepieces/piece-bokio 0.0.7 → 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 +2 -4
  2. package/src/index.js +3 -3
package/package.json CHANGED
@@ -1,11 +1,9 @@
1
1
  {
2
2
  "name": "@activepieces/piece-bokio",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
- "dependencies": {
7
- "i18next": "23.13.0"
8
- },
6
+ "dependencies": {},
9
7
  "files": [
10
8
  "src/index.js",
11
9
  "package.json",
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";var Zs=Object.create;var Ke=Object.defineProperty;var Vs=Object.getOwnPropertyDescriptor;var Hs=Object.getOwnPropertyNames;var qs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty;var o=(e,t)=>Ke(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),dn=(e,t)=>{for(var r in t)Ke(e,r,{get:t[r],enumerable:!0})},mn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Hs(t))!Ws.call(e,i)&&i!==r&&Ke(e,i,{get:()=>t[i],enumerable:!(n=Vs(t,i))||n.enumerable});return e};var we=(e,t,r)=>(r=e!=null?Zs(qs(e)):{},mn(t||!e||!e.__esModule?Ke(r,"default",{value:e,enumerable:!0}):r,e)),Gs=e=>mn(Ke({},"__esModule",{value:!0}),e);var Oo=E((ko,Mt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let y=0,m=-1,x=(s.match(l.zoneIndex)||[])[0],b,j;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(j=d-y,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 re=s.split(":"),ae=[];for(let Ge=0;Ge<re.length;Ge++)ae.push(parseInt(re[Ge],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 I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let h={};h.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,j;for(x=3;x>=0;x-=1)if(b=this.octets[x],b in m){if(j=m[b],y&&j!==0)return null;j!==8&&(y=!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),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")}},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,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")}},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 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")},h.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 j=0;j<x.length;j++)y=x[j],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},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],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)},h.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 j=7;j>=0;j-=1)if(x=this.parts[j],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 h.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(I(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 h.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}(),h.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})`)}},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,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(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,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")},h.IPv6.parser=function(s){let d,y,m,x,b,j;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(j=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+j,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},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],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)},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,y){let m,x,b,j;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(j=b[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return x}return y},typeof Mt<"u"&&Mt.exports?Mt.exports=h:e.ipaddr=h})(ko)});var Si=E((JS,Ei)=>{var $i=require("stream").Stream,Ip=require("util");Ei.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");Ip.inherits(ue,$i);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=$i.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 Oi=E((YS,ki)=>{var Tp=require("util"),zi=require("stream").Stream,Ai=Si();ki.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");Tp.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 Ai)){var r=Ai.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 Ri=E((eA,wi)=>{"use strict";wi.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Ci=E(te=>{"use strict";var Ht=Ri(),$p=require("path").extname,Ni=/^\s*([^;\s]*)(?:;|\s|$)/,Ep=/^text\//i;te.charset=Di;te.charsets={lookup:Di};te.contentType=Sp;te.extension=Ap;te.extensions=Object.create(null);te.lookup=zp;te.types=Object.create(null);kp(te.extensions,te.types);function Di(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&Ht[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Ep.test(t[1])?"UTF-8":!1}o(Di,"charset");function Sp(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(Sp,"contentType");function Ap(e){if(!e||typeof e!="string")return!1;var t=Ni.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ap,"extension");function zp(e){if(!e||typeof e!="string")return!1;var t=$p("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(zp,"lookup");function kp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Ht).forEach(o(function(i){var u=Ht[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var g=r.indexOf(Ht[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(kp,"populateMaps")});var Mi=E((nA,Ui)=>{Ui.exports=Op;function Op(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Op,"defer")});var Br=E((iA,Li)=>{var ji=Mi();Li.exports=wp;function wp(e){var t=!1;return ji(function(){t=!0}),o(function(n,i){t?e(n,i):ji(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(wp,"async")});var Zr=E((sA,Fi)=>{Fi.exports=Rp;function Rp(e){Object.keys(e.jobs).forEach(Np.bind(e)),e.jobs={}}o(Rp,"abort");function Np(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Np,"clean")});var Vr=E((cA,Zi)=>{var Bi=Br(),Dp=Zr();Zi.exports=Cp;function Cp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Up(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?Dp(r):r.results[i]=c,n(u,r.results))})}o(Cp,"iterate");function Up(e,t,r,n){var i;return e.length==2?i=e(r,Bi(n)):i=e(r,t,Bi(n)),i}o(Up,"runJob")});var Hr=E((lA,Vi)=>{Vi.exports=Mp;function Mp(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(Mp,"state")});var qr=E((mA,Hi)=>{var jp=Zr(),Lp=Br();Hi.exports=Fp;function Fp(e){Object.keys(this.jobs).length&&(this.index=this.size,jp(this),Lp(e)(null,this.results))}o(Fp,"terminator")});var Wi=E((gA,qi)=>{var Bp=Vr(),Zp=Hr(),Vp=qr();qi.exports=Hp;function Hp(e,t,r){for(var n=Zp(e);n.index<(n.keyedList||e).length;)Bp(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 Vp.bind(n,r)}o(Hp,"parallel")});var Wr=E((hA,qt)=>{var Gi=Vr(),qp=Hr(),Wp=qr();qt.exports=Gp;qt.exports.ascending=Ki;qt.exports.descending=Kp;function Gp(e,t,r,n){var i=qp(e,r);return Gi(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){Gi(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Wp.bind(i,n)}o(Gp,"serialOrdered");function Ki(e,t){return e<t?-1:e>t?1:0}o(Ki,"ascending");function Kp(e,t){return-1*Ki(e,t)}o(Kp,"descending")});var Xi=E((xA,Ji)=>{var Jp=Wr();Ji.exports=Xp;function Xp(e,t,r){return Jp(e,t,null,r)}o(Xp,"serial")});var Qi=E((_A,Yi)=>{Yi.exports={parallel:Wi(),serial:Xi(),serialOrdered:Wr()}});var Gr=E((bA,ea)=>{"use strict";ea.exports=Object});var ra=E((IA,ta)=>{"use strict";ta.exports=Error});var oa=E((TA,na)=>{"use strict";na.exports=EvalError});var aa=E(($A,ia)=>{"use strict";ia.exports=RangeError});var ua=E((EA,sa)=>{"use strict";sa.exports=ReferenceError});var pa=E((SA,ca)=>{"use strict";ca.exports=SyntaxError});var Wt=E((AA,la)=>{"use strict";la.exports=TypeError});var ma=E((zA,da)=>{"use strict";da.exports=URIError});var ga=E((kA,fa)=>{"use strict";fa.exports=Math.abs});var ha=E((OA,ya)=>{"use strict";ya.exports=Math.floor});var xa=E((wA,va)=>{"use strict";va.exports=Math.max});var _a=E((RA,Pa)=>{"use strict";Pa.exports=Math.min});var Ia=E((NA,ba)=>{"use strict";ba.exports=Math.pow});var $a=E((DA,Ta)=>{"use strict";Ta.exports=Math.round});var Sa=E((CA,Ea)=>{"use strict";Ea.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var za=E((MA,Aa)=>{"use strict";var Yp=Sa();Aa.exports=o(function(t){return Yp(t)||t===0?t:t<0?-1:1},"sign")});var Oa=E((LA,ka)=>{"use strict";ka.exports=Object.getOwnPropertyDescriptor});var Kr=E((FA,wa)=>{"use strict";var Gt=Oa();if(Gt)try{Gt([],"length")}catch{Gt=null}wa.exports=Gt});var Na=E((BA,Ra)=>{"use strict";var Kt=Object.defineProperty||!1;if(Kt)try{Kt({},"a",{value:1})}catch{Kt=!1}Ra.exports=Kt});var Jr=E((ZA,Da)=>{"use strict";Da.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ma=E((HA,Ua)=>{"use strict";var Ca=typeof Symbol<"u"&&Symbol,Qp=Jr();Ua.exports=o(function(){return typeof Ca!="function"||typeof Symbol!="function"||typeof Ca("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Qp()},"hasNativeSymbols")});var Xr=E((WA,ja)=>{"use strict";ja.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Yr=E((GA,La)=>{"use strict";var el=Gr();La.exports=el.getPrototypeOf||null});var Za=E((KA,Ba)=>{"use strict";var tl="Function.prototype.bind called on incompatible ",rl=Object.prototype.toString,nl=Math.max,ol="[object Function]",Fa=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),il=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"),al=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Ba.exports=o(function(t){var r=this;if(typeof r!="function"||rl.apply(r)!==ol)throw new TypeError(tl+r);for(var n=il(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,Fa(n,arguments));return Object(P)===P?P:this}return r.apply(t,Fa(n,arguments))},"binder"),c=nl(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+al(l,",")+"){ 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 Be=E((XA,Va)=>{"use strict";var sl=Za();Va.exports=Function.prototype.bind||sl});var Jt=E((YA,Ha)=>{"use strict";Ha.exports=Function.prototype.call});var Qr=E((QA,qa)=>{"use strict";qa.exports=Function.prototype.apply});var Ga=E((ez,Wa)=>{"use strict";Wa.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ja=E((tz,Ka)=>{"use strict";var ul=Be(),cl=Qr(),pl=Jt(),ll=Ga();Ka.exports=ll||ul.call(pl,cl)});var Ya=E((rz,Xa)=>{"use strict";var dl=Be(),ml=Wt(),fl=Jt(),gl=Ja();Xa.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new ml("a function is required");return gl(dl,fl,t)},"callBindBasic")});var os=E((oz,ns)=>{"use strict";var yl=Ya(),Qa=Kr(),ts;try{ts=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var en=!!ts&&Qa&&Qa(Object.prototype,"__proto__"),rs=Object,es=rs.getPrototypeOf;ns.exports=en&&typeof en.get=="function"?yl([en.get]):typeof es=="function"?o(function(t){return es(t==null?t:rs(t))},"getDunder"):!1});var cs=E((az,us)=>{"use strict";var is=Xr(),as=Yr(),ss=os();us.exports=is?o(function(t){return is(t)},"getProto"):as?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return as(t)},"getProto"):ss?o(function(t){return ss(t)},"getProto"):null});var tn=E((uz,ps)=>{"use strict";var hl=Function.prototype.call,vl=Object.prototype.hasOwnProperty,xl=Be();ps.exports=xl.call(hl,vl)});var hs=E((cz,ys)=>{"use strict";var M,Pl=Gr(),_l=ra(),bl=oa(),Il=aa(),Tl=ua(),qe=pa(),He=Wt(),$l=ma(),El=ga(),Sl=ha(),Al=xa(),zl=_a(),kl=Ia(),Ol=$a(),wl=za(),fs=Function,rn=o(function(e){try{return fs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),yt=Kr(),Rl=Na(),nn=o(function(){throw new He},"throwTypeError"),Nl=yt?function(){try{return arguments.callee,nn}catch{try{return yt(arguments,"callee").get}catch{return nn}}}():nn,Ze=Ma()(),Q=cs(),Dl=Yr(),Cl=Xr(),gs=Qr(),ht=Jt(),Ve={},Ul=typeof Uint8Array>"u"||!Q?M:Q(Uint8Array),Oe={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ze&&Q?Q([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ve,"%AsyncGenerator%":Ve,"%AsyncGeneratorFunction%":Ve,"%AsyncIteratorPrototype%":Ve,"%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%":_l,"%eval%":eval,"%EvalError%":bl,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":fs,"%GeneratorFunction%":Ve,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ze&&Q?Q(Q([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ze||!Q?M:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Pl,"%Object.getOwnPropertyDescriptor%":yt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Il,"%ReferenceError%":Tl,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ze||!Q?M:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ze&&Q?Q(""[Symbol.iterator]()):M,"%Symbol%":Ze?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":Nl,"%TypedArray%":Ul,"%TypeError%":He,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":$l,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":ht,"%Function.prototype.apply%":gs,"%Object.defineProperty%":Rl,"%Object.getPrototypeOf%":Dl,"%Math.abs%":El,"%Math.floor%":Sl,"%Math.max%":Al,"%Math.min%":zl,"%Math.pow%":kl,"%Math.round%":Ol,"%Math.sign%":wl,"%Reflect.getPrototypeOf%":Cl};if(Q)try{null.error}catch(e){ls=Q(Q(e)),Oe["%Error.prototype%"]=ls}var ls,Ml=o(function e(t){var r;if(t==="%AsyncFunction%")r=rn("async function () {}");else if(t==="%GeneratorFunction%")r=rn("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=rn("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Q&&(r=Q(i.prototype))}return Oe[t]=r,r},"doEval"),ds={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vt=Be(),Xt=tn(),jl=vt.call(ht,Array.prototype.concat),Ll=vt.call(gs,Array.prototype.splice),ms=vt.call(ht,String.prototype.replace),Yt=vt.call(ht,String.prototype.slice),Fl=vt.call(ht,RegExp.prototype.exec),Bl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Zl=/\\(\\)?/g,Vl=o(function(t){var r=Yt(t,0,1),n=Yt(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return ms(t,Bl,function(u,c,l,f){i[i.length]=l?ms(f,Zl,"$1"):c||u}),i},"stringToPath"),Hl=o(function(t,r){var n=t,i;if(Xt(ds,n)&&(i=ds[n],n="%"+i[0]+"%"),Xt(Oe,n)){var u=Oe[n];if(u===Ve&&(u=Ml(n)),typeof u>"u"&&!r)throw new He("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");ys.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new He("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new He('"allowMissing" argument must be a boolean');if(Fl(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Vl(t),i=n.length>0?n[0]:"",u=Hl("%"+i+"%",r),c=u.name,l=u.value,f=!1,g=u.alias;g&&(i=g[0],Ll(n,jl([0,1],g)));for(var P=1,I=!0;P<n.length;P+=1){var h=n[P],s=Yt(h,0,1),d=Yt(h,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new qe("property names with quotes must have matching quotes");if((h==="constructor"||!I)&&(f=!0),i+="."+h,c="%"+i+"%",Xt(Oe,c))l=Oe[c];else if(l!=null){if(!(h in l)){if(!r)throw new He("base intrinsic for "+t+" exists, but the property is not available.");return}if(yt&&P+1>=n.length){var y=yt(l,h);I=!!y,I&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[h]}else I=Xt(l,h),l=l[h];I&&!f&&(Oe[c]=l)}}return l},"GetIntrinsic")});var xs=E((lz,vs)=>{"use strict";var ql=Jr();vs.exports=o(function(){return ql()&&!!Symbol.toStringTag},"hasToStringTagShams")});var bs=E((mz,_s)=>{"use strict";var Wl=hs(),Ps=Wl("%Object.defineProperty%",!0),Gl=xs()(),Kl=tn(),Jl=Wt(),Qt=Gl?Symbol.toStringTag:null;_s.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 Jl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Qt&&(n||!Kl(t,Qt))&&(Ps?Ps(t,Qt,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[Qt]=r)},"setToStringTag")});var Ts=E((gz,Is)=>{"use strict";var Xl=Function.prototype.call,Yl=Object.prototype.hasOwnProperty,Ql=Be();Is.exports=Ql.call(Xl,Yl)});var Es=E((yz,$s)=>{"use strict";$s.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var zs=E((hz,As)=>{"use strict";var un=Oi(),ed=require("util"),on=require("path"),td=require("http"),rd=require("https"),nd=require("url").parse,od=require("fs"),id=require("stream").Stream,ad=require("crypto"),an=Ci(),sd=Qi(),ud=bs(),$e=Ts(),sn=Es();function Ss(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ss,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],un.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");ed.inherits(L,un);L.LINE_BREAK=`\r
2
- `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=un.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof id))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):od.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Ss(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&sn(c,r.header);var l;for(var f in c)if($e(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=on.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=on.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=on.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ss(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=an.lookup(e.name)),!r&&e&&e.path&&(r=an.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=an.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+ad.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}sd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=nd(e),n=sn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=sn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=rd.request(n):r=td.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(g,P){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,g,P)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};ud(L.prototype,"FormData");As.exports=L});var xd={};dn(xd,{bokio:()=>vd});module.exports=Gs(xd);var Ks=Object.freeze({status:"aborted"});function T(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let g=c.prototype,P=Object.keys(g);for(let I=0;I<P.length;I++){let h=P[I];h in l||(l[h]=g[h].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let g=r?.Parent?new u:this;n(g,l),(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(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(T,"$constructor");var Js=Symbol("zod_brand"),ce=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},rr={};function de(e){return e&&Object.assign(rr,e),rr}o(de,"config");function or(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(or,"getEnumValues");function gn(e,t){return typeof t=="bigint"?t.toString():t}o(gn,"jsonStringifyReplacer");function bt(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(bt,"cached");function yn(e){return e==null}o(yn,"nullish");function It(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(It,"cleanRegex");var fn=Symbol("evaluating");function X(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==fn)return n===void 0&&(n=fn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(X,"defineLazy");var ir="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Je,"isObject");var Xs=bt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function hn(e){if(Je(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Je(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(hn,"isPlainObject");var vn=new Set(["string","number","symbol"]);function Re(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Re,"escapeRegex");function Tt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Tt,"clone");function q(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(q,"normalizeParams");function xn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(xn,"optionalKeys");var Ys={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 Ne(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(Ne,"aborted");function xe(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(xe,"prefixIssues");function _t(e){return typeof e=="string"?e:e?.message}o(_t,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=_t(e.inst?._zod.def?.error?.(e))??_t(t?.error?.(e))??_t(r.customError?.(e))??_t(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function Pn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Pn,"getLengthableOrigin");function ar(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ar,"issue");var _n=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),bn=T("$ZodError",_n),Xe=T("$ZodError",_n,{Parent:Error});var eu=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 l=new(i?.Err??e)(c.issues.map(f=>Pe(f,u,de())));throw ir(l,i?.callee),l}return c.value},"_parse"),$t=eu(Xe),tu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Pe(f,u,de())));throw ir(l,i?.callee),l}return c.value},"_parseAsync"),Et=tu(Xe),ru=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??bn)(u.issues.map(c=>Pe(c,i,de())))}:{success:!0,data:u.value}},"_safeParse"),Ye=ru(Xe),nu=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=>Pe(c,i,de())))}:{success:!0,data:u.value}},"_safeParseAsync"),Qe=nu(Xe);var ou="(?:(?:\\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])))",iu=new RegExp(`^${ou}$`);var In=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Tn=/^-?\d+n?$/;var sr=/^-?\d+(?:\.\d+)?$/,$n=/^(?:true|false)$/i;var De=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var En=T("$ZodCheckMinLength",(e,t)=>{var r;De.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!yn(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=Pn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var ur=T("$ZodCheckStringFormat",(e,t)=>{var r,n;De.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Sn=T("$ZodCheckRegex",(e,t)=>{ur.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var zn={major:4,minor:3,patch:6};var W=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let g=Ne(c),P;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(g)continue;let h=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new ce;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==h&&(g||(g=Ne(c,h)))});else{if(c.issues.length===h)continue;g||(g=Ne(c,h))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Ne(c))return c.aborted=!0,c;let g=i(l,n,f);if(g instanceof Promise){if(f.async===!1)throw new ce;return g.then(P=>e._zod.parse(P,f))}return e._zod.parse(g,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let g=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return g instanceof Promise?g.then(P=>u(P,c,l)):u(g,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new ce;return f.then(g=>i(g,n,l))}return i(f,n,l)}}X(e,"~standard",()=>({validate:o(i=>{try{let u=Ye(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Qe(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),zt=T("$ZodString",(e,t)=>{W.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??In(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}}),cr=T("$ZodStringFormat",(e,t)=>{ur.init(e,t),zt.init(e,t)});var Nn=T("$ZodURL",(e,t)=>{cr.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 Dn=T("$ZodNumber",(e,t)=>{W.init(e,t),e._zod.pattern=e._zod.bag.pattern??sr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var pr=T("$ZodBoolean",(e,t)=>{W.init(e,t),e._zod.pattern=$n,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Cn=T("$ZodBigInt",(e,t)=>{W.init(e,t),e._zod.pattern=Tn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Un=T("$ZodAny",(e,t)=>{W.init(e,t),e._zod.parse=r=>r}),Mn=T("$ZodUnknown",(e,t)=>{W.init(e,t),e._zod.parse=r=>r});var jn=T("$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}}),Ln=T("$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 kn(e,t,r){e.issues.length&&t.issues.push(...xe(r,e.issues)),t.value[r]=e.value}o(kn,"handleArrayResult");var Fn=T("$ZodArray",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(g=>kn(g,r,c))):kn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function At(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...xe(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(At,"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=xn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(au,"normalizeDef");function su(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,g=f.def.type,P=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(g==="never"){c.push(I);continue}let h=f.run({value:t[I],issues:[]},n);h instanceof Promise?e.push(h.then(s=>At(s,r,I,t,P))):At(h,r,I,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(su,"handleCatchall");var Bn=T("$ZodObject",(e,t)=>{if(W.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let l=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let f={...l};return Object.defineProperty(t,"shape",{value:f}),f},"get")})}let n=bt(()=>au(t));X(e._zod,"propValues",()=>{let l=t.shape,f={};for(let g in l){let P=l[g]._zod;if(P.values){f[g]??(f[g]=new Set);for(let I of P.values)f[g].add(I)}}return f});let i=Je,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let g=l.value;if(!i(g))return l.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),l;l.value={};let P=[],I=c.shape;for(let h of c.keys){let s=I[h],d=s._zod.optout==="optional",y=s._zod.run({value:g[h],issues:[]},f);y instanceof Promise?P.push(y.then(m=>At(m,l,h,g,d))):At(y,l,h,g,d)}return u?su(P,g,l,f,n.value,e):P.length?Promise.all(P).then(()=>l):l}});function On(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=>!Ne(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=>Pe(c,n,de())))}),t)}o(On,"handleUnionResults");var lr=T("$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=>It(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let g=f._zod.run({value:i.value,issues:[]},u);if(g instanceof Promise)l.push(g),c=!0;else{if(g.issues.length===0)return g;l.push(g)}}return c?Promise.all(l).then(f=>On(f,i,e,u)):On(l,i,e,u)}});var Zn=T("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lr.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[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let g of f)i[l].add(g)}}return i});let n=bt(()=>{let i=t.options,u=new Map;for(let c of i){let l=c._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(c)}"`);for(let f of l){if(u.has(f))throw new Error(`Duplicate discriminator value "${String(f)}"`);u.set(f,c)}}return u});e._zod.parse=(i,u)=>{let c=i.value;if(!Je(c))return i.issues.push({code:"invalid_type",expected:"object",input:c,inst:e}),i;let l=n.value.get(c?.[t.discriminator]);return l?l._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:c,path:[t.discriminator],inst:e}),i)}});var Vn=T("$ZodRecord",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!hn(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let g of c)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){l.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(I=>{I.issues.length&&r.issues.push(...xe(g,I.issues)),r.value[g]=I.value})):(P.issues.length&&r.issues.push(...xe(g,P.issues)),r.value[g]=P.value)}let f;for(let g in i)l.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 l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&sr.test(l)&&f.issues.length){let I=t.keyType._zod.run({value:Number(l),issues:[]},n);if(I instanceof Promise)throw new Error("Async schemas not supported in object keys currently");I.issues.length===0&&(f=I)}if(f.issues.length){t.mode==="loose"?r.value[l]=i[l]:r.issues.push({code:"invalid_key",origin:"record",issues:f.issues.map(I=>Pe(I,n,de())),input:l,path:[l],inst:e});continue}let P=t.valueType._zod.run({value:i[l],issues:[]},n);P instanceof Promise?u.push(P.then(I=>{I.issues.length&&r.issues.push(...xe(l,I.issues)),r.value[f.value]=I.value})):(P.issues.length&&r.issues.push(...xe(l,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Hn=T("$ZodEnum",(e,t)=>{W.init(e,t);let r=or(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>vn.has(typeof i)).map(i=>typeof i=="string"?Re(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=T("$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"?Re(n):n?Re(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Wn=T("$ZodTransform",(e,t)=>{W.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(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 wn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(wn,"handleOptionalResult");var Gn=T("$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(`^(${It(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=>wn(u,r.value)):wn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Kn=T("$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(`^(${It(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 Jn=T("$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=>St(c,t.in,n)):St(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>St(u,t.out,n)):St(i,t.out,n)}});function St(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(St,"handlePipeResult");var Xn=T("$ZodCustom",(e,t)=>{De.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=>Rn(u,r,n,e));Rn(i,r,n,e)}});function Rn(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(ar(i))}}o(Rn,"handleRefineResult");var Qn,lu=Symbol("ZodOutput"),du=Symbol("ZodInput"),dr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function eo(){return new dr}o(eo,"registry");(Qn=globalThis).__zod_globalRegistry??(Qn.__zod_globalRegistry=eo());var mr=globalThis.__zod_globalRegistry;function to(e,t){return new e({type:"string",...q(t)})}o(to,"_string");function ro(e,t){return new e({type:"string",coerce:!0,...q(t)})}o(ro,"_coercedString");function no(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...q(t)})}o(no,"_url");function oo(e,t){return new e({type:"number",checks:[],...q(t)})}o(oo,"_number");function io(e,t){return new e({type:"number",coerce:!0,checks:[],...q(t)})}o(io,"_coercedNumber");function ao(e,t){return new e({type:"boolean",...q(t)})}o(ao,"_boolean");function so(e,t){return new e({type:"boolean",coerce:!0,...q(t)})}o(so,"_coercedBoolean");function uo(e,t){return new e({type:"bigint",coerce:!0,...q(t)})}o(uo,"_coercedBigint");function co(e){return new e({type:"any"})}o(co,"_any");function po(e){return new e({type:"unknown"})}o(po,"_unknown");function lo(e,t){return new e({type:"void",...q(t)})}o(lo,"_void");function mo(e,t){return new e({type:"date",coerce:!0,...q(t)})}o(mo,"_coercedDate");function se(e,t){return new En({check:"min_length",...q(t),minimum:e})}o(se,"_minLength");function _e(e,t){return new Sn({check:"string_format",format:"regex",...q(t),pattern:e})}o(_e,"_regex");function fo(e,t,r){let n=q(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(fo,"_custom");var Y=T("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)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ye(e,r,n),e.parseAsync=async(r,n)=>Et(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qe(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Tt(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),Ot=T("ZodMiniString",(e,t)=>{zt.init(e,t),Y.init(e,t)});function a(e){return to(Ot,e)}o(a,"string");var go=T("ZodMiniStringFormat",(e,t)=>{cr.init(e,t),Ot.init(e,t)});var bu=T("ZodMiniURL",(e,t)=>{Nn.init(e,t),go.init(e,t)});function yo(e){return no(bu,e)}o(yo,"url");var fr=T("ZodMiniNumber",(e,t)=>{Dn.init(e,t),Y.init(e,t)});function ee(e){return oo(fr,e)}o(ee,"number");var gr=T("ZodMiniBoolean",(e,t)=>{pr.init(e,t),Y.init(e,t)});function B(e){return ao(gr,e)}o(B,"boolean");var ho=T("ZodMiniBigInt",(e,t)=>{Cn.init(e,t),Y.init(e,t)});var Iu=T("ZodMiniAny",(e,t)=>{Un.init(e,t),Y.init(e,t)});function tt(){return co(Iu)}o(tt,"any");var Tu=T("ZodMiniUnknown",(e,t)=>{Mn.init(e,t),Y.init(e,t)});function O(){return po(Tu)}o(O,"unknown");var $u=T("ZodMiniVoid",(e,t)=>{jn.init(e,t),Y.init(e,t)});function vo(e){return lo($u,e)}o(vo,"_void");var xo=T("ZodMiniDate",(e,t)=>{Ln.init(e,t),Y.init(e,t)});var Eu=T("ZodMiniArray",(e,t)=>{Fn.init(e,t),Y.init(e,t)});function N(e,t){return new Eu({type:"array",element:e,...q(t)})}o(N,"array");var Su=T("ZodMiniObject",(e,t)=>{Bn.init(e,t),Y.init(e,t),X(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...q(t)};return new Su(r)}o(p,"object");var Au=T("ZodMiniUnion",(e,t)=>{lr.init(e,t),Y.init(e,t)});function D(e,t){return new Au({type:"union",options:e,...q(t)})}o(D,"union");var zu=T("ZodMiniDiscriminatedUnion",(e,t)=>{Zn.init(e,t),Y.init(e,t)});function Ce(e,t,r){return new zu({type:"union",options:t,discriminator:e,...q(r)})}o(Ce,"discriminatedUnion");var ku=T("ZodMiniRecord",(e,t)=>{Vn.init(e,t),Y.init(e,t)});function w(e,t,r){return new ku({type:"record",keyType:e,valueType:t,...q(r)})}o(w,"record");var Ou=T("ZodMiniEnum",(e,t)=>{Hn.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 Ou({type:"enum",entries:r,...q(t)})}o(U,"_enum");var wu=T("ZodMiniLiteral",(e,t)=>{qn.init(e,t),Y.init(e,t)});function S(e,t){return new wu({type:"literal",values:Array.isArray(e)?e:[e],...q(t)})}o(S,"literal");var Ru=T("ZodMiniTransform",(e,t)=>{Wn.init(e,t),Y.init(e,t)});function be(e){return new Ru({type:"transform",transform:e})}o(be,"transform");var Nu=T("ZodMiniOptional",(e,t)=>{Gn.init(e,t),Y.init(e,t)});function v(e){return new Nu({type:"optional",innerType:e})}o(v,"optional");var Du=T("ZodMiniNullable",(e,t)=>{Kn.init(e,t),Y.init(e,t)});function rt(e){return new Du({type:"nullable",innerType:e})}o(rt,"nullable");var Cu=T("ZodMiniPipe",(e,t)=>{Jn.init(e,t),Y.init(e,t)});function Ie(e,t){return new Cu({type:"pipe",in:e,out:t})}o(Ie,"pipe");var Uu=T("ZodMiniCustom",(e,t)=>{Xn.init(e,t),Y.init(e,t)});function wt(e,t){return fo(Uu,e??(()=>!0),t)}o(wt,"custom");var nt={};dn(nt,{bigint:()=>Vu,boolean:()=>Zu,date:()=>Hu,number:()=>Bu,string:()=>Fu});function Fu(e){return ro(Ot,e)}o(Fu,"string");function Bu(e){return io(fr,e)}o(Bu,"number");function Zu(e){return so(gr,e)}o(Zu,"boolean");function Vu(e){return uo(ho,e)}o(Vu,"bigint");function Hu(e){return mo(xo,e)}o(Hu,"date");var hr=p({retryOnFailure:p({defaultValue:v(B()),hide:v(B())}),continueOnFailure:p({defaultValue:v(B()),hide:v(B())})}),yr=class{constructor(t,r,n,i,u,c,l,f,g,P,I){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=c;this.requireAuth=l;this.errorHandlingOptions=f;this.outputSchema=g;this.audience=P;this.aiMetadata=I}static{o(this,"IAction")}},G=o(e=>new yr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:v(a())}),C=o((e,t)=>p({type:S(t),required:B(),defaultValue:v(tt())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),me=p({...F.shape,...C(a(),"LONG_TEXT").shape});var _o=p({label:a(),value:O()}),Rt=p({disabled:v(B()),placeholder:v(a()),options:N(_o)});var oe=p({...F.shape,options:Rt,...C(O(),"STATIC_DROPDOWN").shape}),fe=p({...F.shape,options:Rt,...C(N(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var vr=p({...F.shape,...C(O(),"DROPDOWN").shape,refreshers:N(a())}),ot=p({...F.shape,...C(N(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ge=p({...F.shape,...C(B(),"CHECKBOX").shape});var ye=p({...F.shape,...C(ee(),"NUMBER").shape});var it=p({...F.shape,...C(O(),"FILE").shape});var at=p({...F.shape,...C(a(),"DATE_TIME").shape});var bo=w(a(),D([ne,me,oe,ot,fe,ge,ye,it,at])),st=p({...F.shape,properties:bo,...C(N(O()),"ARRAY").shape});var ut=p({...F.shape,...C(D([w(a(),O())]),"JSON").shape});var Io=D([ne,oe,ut,st,fe]),Wu=w(a(),Io),xr=p({refreshers:N(a()),...F.shape,...C(O(),"DYNAMIC").shape});var Nt=p({...F.shape,...C(vo(),"MARKDOWN").shape});var ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ct||{}),Ue=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Ue||{}),Me=(x=>(x.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",x.COMMUNICATION="COMMUNICATION",x.COMMERCE="COMMERCE",x.CORE="CORE",x.UNIVERSAL_AI="UNIVERSAL_AI",x.FLOW_CONTROL="FLOW_CONTROL",x.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",x.ACCOUNTING="ACCOUNTING",x.PRODUCTIVITY="PRODUCTIVITY",x.CONTENT_AND_FILES="CONTENT_AND_FILES",x.DEVELOPER_TOOLS="DEVELOPER_TOOLS",x.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",x.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",x.HUMAN_RESOURCES="HUMAN_RESOURCES",x.PAYMENT_PROCESSING="PAYMENT_PROCESSING",x.MARKETING="MARKETING",x.SALES_AND_CRM="SALES_AND_CRM",x))(Me||{});var pt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(pt||{}),Pr="both_client_credentials_and_authorization_code";var Se=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Se||{}),lt=(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))(lt||{}),Gu=p({strategy:U(lt),paramName:v(a())}),dt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(dt||{});var Dt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Dt||{}),To=p({status:v(ee()),body:v(O()),headers:v(w(a(),a()))}),$o=p({type:S("DELAY"),resumeDateTime:a(),requestIdToReply:v(a()),handlerId:v(a()),streamStepProgress:v(U(Dt))}),Eo=p({type:S("WEBHOOK"),requestId:a(),requestIdToReply:v(a()),response:To,handlerId:v(a()),streamStepProgress:v(U(Dt))}),Ku=D([$o,Eo]);var Ju=p({body:O(),rawBody:v(O()),headers:w(a(),a()),queryParams:w(a(),a())});function he(e){return e==null}o(he,"isNil");function mt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(mt,"isEmpty");function Ct(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ct,"assertNotNullOrUndefined");var _r=we(require("crypto"),1);var Xu=128,Ae,je,Yu=o(e=>{!Ae||Ae.length<e?(Ae=Buffer.allocUnsafe(e*Xu),_r.default.randomFillSync(Ae),je=0):je+e>Ae.length&&(_r.default.randomFillSync(Ae),je=0),je+=e},"fillPool"),Qu=o(e=>(Yu(e|=0),Ae.subarray(je-e,je)),"random"),ec=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),Ao=o((e,t=21)=>ec(e,t,Qu),"customAlphabet");var tc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",zo=21,rb=a().check(_e(new RegExp(`^[0-9a-zA-Z]{${zo}}$`))),rc=Ao(tc,zo);var Te=Ie(be(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Te,updated:Te},H=o(e=>v(rt(e)),"Nullable");function br(e){return v(rt(U(e)))}o(br,"NullableEnum");var ib=Ie(be(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),v(B())),Ut=o(e=>Ie(be(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),v(N(e))),"OptionalArrayFromQuery");var ub=w(a(),O());var ft=(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))(ft||{});var Pb=a().check(_e(/^#[0-9A-Fa-f]{6}$/));var bb=p({filename:a(),data:O(),type:S("file"),mimetype:v(a())});var nc=we(Oo());var zb=p({...ie,name:a(),permissions:N(a()),platformId:H(a()),type:a(),userCount:v(ee())});var wo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(wo||{}),Ir=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Ir||{}),Tr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Tr||{});var $r=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))($r||{});var Er=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Er||{});var oc=p({mode:U(wo),value:O()}),ic=p({auth:v(a()),fields:w(a(),oc)}),ac=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:v(ic)}),sc=p({type:S("PIECE"),toolName:a().check(se(1)),pieceMetadata:ac}),uc=p({type:S("none")}),cc=p({type:S("access_token"),accessToken:a()}),pc=p({type:S("api_key"),apiKey:a(),apiKeyHeader:a()}),lc=p({type:S("headers"),headers:w(a(),a())}),dc=Ce("type",[uc,cc,pc,lc]),Ro=p({type:S("FLOW"),toolName:a().check(se(1)),externalFlowId:a(),flowDisplayName:v(a())}),No=p({type:S("MCP"),toolName:a().check(se(1)),serverUrl:yo(),protocol:U(Tr),auth:dc}),Do=p({type:S("KNOWLEDGE_BASE"),toolName:a().check(se(1)),sourceType:U(Ir),sourceId:a(),sourceName:a()}),mc=Ce("type",[sc,Ro,No,Do]),fc=p({displayName:a(),description:v(a()),type:U($r)}),Co=p({type:S("MARKDOWN"),markdown:a()}),Le={type:S("TOOL_CALL"),input:H(w(a(),O())),output:v(O()),toolName:a(),status:U(Er),toolCallId:a(),startTime:a(),endTime:v(a())},rI=p(Le),Uo=Ce("toolCallType",[p({...Le,toolCallType:S("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Le,toolCallType:S("FLOW"),displayName:a(),externalFlowId:a()}),p({...Le,toolCallType:S("MCP"),displayName:a(),serverUrl:a()}),p({...Le,toolCallType:S("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Le,toolCallType:S("UNKNOWN"),displayName:a()})]),gc=D([Co,Uo]);var Sr=(r=>(r.IMAGE="image",r.TEXT="text",r))(Sr||{}),ve=p({apiKey:a()}),yc=ve,hc=p({apiKey:a(),apiKeyHash:a()}),vc=ve,xc=ve,Pc=ve,_c=ve,bc=ve,Ic=ve,Tc=ve,Mo=p({accessKeyId:a().check(se(1)),secretAccessKey:a().check(se(1))}),$c=p({}),Ec=p({}),Sc=p({}),Ac=p({}),zc=p({}),kc=p({}),jo=p({modelId:a(),modelName:a(),modelType:U(Sr)}),Lo=p({apiKeyHeader:a(),baseUrl:a(),models:N(jo),defaultHeaders:v(w(a(),a()))}),Fo=p({accountId:a(),gatewayId:a(),models:N(jo),vertexProject:v(a()),vertexRegion:v(a())}),Bo=p({resourceName:a(),apiVersion:Ie(be(e=>typeof e=="string"&&e.trim().length===0?void 0:e),v(a()))}),Zo=p({region:a().check(se(1))}),Oc=D([yc,Pc,_c,bc,Ic,xc,vc,hc,Mo,Tc]),Vo=D([Lo,Fo,Bo,Zo,$c,Sc,Ac,zc,Ec,kc]),wc=p({id:a(),name:a(),type:U(Sr)}),Rc=p({id:a(),name:a(),provider:U(ft),config:Vo,enabledForChat:B()}),Nc=p({provider:U(ft),config:Vo,auth:Oc,platformId:a()});var aI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Dc=p({base64Url:a(),fileName:a(),extension:v(a())}),Cc=p({mimeType:a(),url:a(),fileName:v(a())}),Ar=D([Dc,Cc]);var Uc=D([p({type:S("file"),value:Ar}),p({type:S("markdown"),value:a(),files:v(N(Ar))})]),Mc=p({sessionId:a(),message:a(),files:v(N(a()))});var qo=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(qo||{}),Wo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Wo||{}),zr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(zr||{});var jc=D([p({...ie,name:a(),externalId:a(),type:S("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...ie,name:a(),externalId:a(),type:D([S("TEXT"),S("NUMBER"),S("DATE")]),tableId:a(),projectId:a()})]),Lc=p({...ie,name:a(),folderId:H(a()),projectId:a(),externalId:a(),status:br(Wo),trigger:br(qo)}),Fc=p({...ie,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:O(),fieldName:a()}))}),Bc=p({events:N(U(zr)),webhookUrl:a(),flowId:a()}),Zc=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),Vc=p({projectId:a(),limit:v(nt.number()),cursor:v(a()),name:v(a()),externalIds:Ut(a()),folderId:v(a()),folderIds:Ut(a())}),Hc=p({records:N(N(p({fieldId:a(),value:Ko()}))),tableId:a()}),qc=p({cells:v(N(p({fieldId:a(),value:Ko()}))),tableId:a(),agentUpdate:v(B())}),Go=Ce("operator",[ze("eq"),ze("neq"),ze("gt"),ze("gte"),ze("lt"),ze("lte"),ze("co"),Ho("exists"),Ho("not_exists")]),Wc=p({tableId:a(),limit:v(nt.number()),cursor:v(a()),filters:Ut(Go)});function Ko(){return Ie(be(e=>e==null?e:String(e)),rt(a()))}o(Ko,"coerceToString");function ze(e){return p({fieldId:a(),operator:S(e),value:a()})}o(ze,"valueFilter");function Ho(e){return p({fieldId:a(),operator:S(e)})}o(Ho,"existenceFilter");var Gc=p({status:v(ee()),body:v(O()),headers:v(w(a(),a()))}),Kc=p({...ie,deleted:H(Te),ownerId:a(),displayName:a(),platformId:a(),externalId:H(a())});var Jo=p({name:a(),description:v(a()),type:a(),required:B()}),Jc=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(Jo),returnsResponse:B()})});var Xo="^[0-9]+\\.[0-9]+\\.[0-9]+$",$I=new RegExp(Xo),Yc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",EI=a().check(_e(new RegExp(Xo))),SI=a().check(_e(new RegExp(Yc))),Qc=p({packageType:S("ARCHIVE"),pieceType:U(Ue),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),Yo=p({packageType:S("REGISTRY"),pieceType:S("OFFICIAL"),pieceName:a(),pieceVersion:a()}),Qo=p({packageType:S("REGISTRY"),pieceType:S("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),AI=D([Yo,Qo]),zI=D([Qc,Yo,Qo]),ei=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ei||{}),ep=p({type:U(ei),cronExpression:a(),timezone:a()}),kI=p({...ie,type:U(Se),projectId:a(),flowId:a(),triggerName:a(),schedule:H(ep),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:H(a()),simulate:B()}),ti=(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))(ti||{}),ri=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ri||{}),ni=(r=>(r.S3="S3",r.DB="DB",r))(ni||{}),OI=p({...ie,projectId:H(a()),platformId:H(a()),type:U(ti),compression:U(ri),data:v(O()),location:U(ni),size:H(ee()),fileName:H(a()),s3Key:H(a()),metadata:H(w(a(),a()))}),oi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(oi||{}),ii=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ii||{}),wI=p({id:a(),email:a(),firstName:a(),status:U(ii),externalId:H(a()),platformId:H(a()),platformRole:U(oi),lastName:a(),created:Te,updated:Te,lastActiveDate:H(Te),imageUrl:H(a())});var kr=p({...F.shape,...C(w(a(),O()),"OBJECT").shape});var ci=p({...F.shape,...C(a(),"COLOR").shape});var Or=D([ne,me,Nt,ge,oe,fe,vr,ot,xr,ye,st,kr,ut,at,it,ci]),_={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 pe=p({displayName:a(),description:v(a())});var pi=p({username:a(),password:a()}),wr=p({...pe.shape,username:p({displayName:a(),description:v(a())}),password:p({displayName:a(),description:v(a())}),...C(pi,"BASIC_AUTH").shape});var op=w(a(),D([ne,me,ye,ge,oe])),Rr=p({...pe.shape,props:op,...C(O(),"CUSTOM_AUTH").shape});var ke=p({...pe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var ip=w(a(),D([ne,me,ke,ye,ge,oe,fe,Nt])),li=p({...pe.shape,props:ip,...C(O(),"OIDC").shape});var Nr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Nr||{}),di=D([ne,ke,oe]),mi=w(a(),di),ap=p({props:v(w(a(),di)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:v(D([S("none"),S("consent"),S("login"),S("omit")])),pkce:v(B()),pkceMethod:v(D([S("plain"),S("S256")])),authorizationMethod:v(U(Nr)),grantType:v(D([U(pt),S(Pr)])),extra:v(w(a(),a()))}),fi=p({access_token:a(),props:v(mi),data:w(a(),tt())}),Dr=p({...pe.shape,...ap.shape,...C(fi,"OAUTH2").shape});var Fe=D([wr,Rr,li,Dr,ke]),gt="Connection",Cr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||gt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||gt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||gt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||gt}},None(){}};var p$={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 sp=p({...F.shape,...C(O(),"CUSTOM").shape,code:a()});var up=D([Or,Fe]),Ur=w(a(),up),k$=w(a(),Or);var gi=D([p({strategy:S("CRON"),cronExpression:a()}),p({strategy:S("NONE")})]);var yi="2",jt="0.82.0";var Mr=class{constructor(t,r,n,i,u,c,l,f,g=jt,P,I=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=g;this.maximumSupportedRelease=P;this.description=I;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:yi}),"getContextInfo");(!cp(g)||pp(g,jt))&&(this.minimumSupportedRelease=jt),u.forEach(h=>this._actions[h.name]=h),c.forEach(h=>this._triggers[h.name]=h)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},hi=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 Mr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function cp(e){return/^\d+\.\d+\.\d+$/.test(e)}o(cp,"isValidSimpleSemver");function pp(e,t){let[r,n,i]=e.split(".").map(Number),[u,c,l]=t.split(".").map(Number);return r!==u?r<u:n!==c?n<c:i<l}o(pp,"isSemverLessThan");var lp=v(w(a(),w(a(),a()))),vi=p({id:v(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:v(a()),directoryPath:v(a()),auth:v(D([Fe,N(Fe)])),version:a(),categories:v(N(U(Me))),minimumSupportedRelease:v(a()),maximumSupportedRelease:v(a()),i18n:lp}),dp=U(["human","ai","both"]),xi=p({description:v(a()),idempotent:v(B())}),Pi=p({name:a(),displayName:a(),description:a(),props:Ur,requireAuth:B(),errorHandlingOptions:v(hr),outputSchema:v(wt()),audience:v(dp),aiMetadata:v(xi)}),_i=p({name:a(),displayName:a(),description:a(),props:Ur,errorHandlingOptions:v(hr),type:U(Se),sampleData:O(),handshakeConfiguration:v(wt()),renewConfiguration:v(gi),testStrategy:U(dt),outputSchema:v(wt()),aiMetadata:v(xi)}),mp=p({...vi.shape,actions:w(a(),Pi),triggers:w(a(),_i)}),fp=p({...vi.shape,actions:ee(),triggers:ee(),suggestedActions:v(N(_i)),suggestedTriggers:v(N(Pi))}),bi=p({projectUsage:ee(),tags:v(N(a())),pieceType:U(Ue),packageType:U(ct),platformId:v(a()),archiveId:v(a())}),kE=p({...mp.shape,...bi.shape}),OE=p({...fp.shape,...bi.shape}),wE=p({name:a(),version:a()});var gp=we(require("path")),yp=we(require("fs/promises"));var Lt=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,c)=>{i.append(c,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Ft=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new jr,r=new Lr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},jr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Lr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Bt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Zt=class extends Lt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Ft){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[j,re]of Object.entries(c))i.append(j,re);let l=i.toString(),f=l?`${n}?${l}`:n,g=t.responseType??"json",P=t.followRedirects??!0,I=t.retries??0,{body:h,extraHeaders:s,isStream:d}=hp(t.body,u),y=xp({...u,...s}),m=await vp(async()=>{let j=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ae={method:t.method.toString(),headers:y,body:h,redirect:P?"follow":"manual",signal:j.signal};return d&&(ae.duplex="half"),r?.dispatcher!==void 0&&(ae.dispatcher=r.dispatcher),await fetch(f,ae)}finally{re!==void 0&&clearTimeout(re)}},I),x=P?300:400;if(m.status<200||m.status>=x){let j=await Ii(m,g),re=new Bt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let b=await Ii(m,g);return{status:m.status,headers:Pp(m.headers),body:b}}};function hp(e,t){return bp(e)?{body:void 0,extraHeaders:{},isStream:!1}:_p(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(hp,"serializeBody");async function Ii(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ii,"parseResponseBody");async function vp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ti(n);continue}return i}catch(i){if(r=i,n<t){await Ti(n);continue}throw i}throw r}o(vp,"sendWithRetries");function Ti(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ti,"backoff");function xp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(xp,"normalizeHeaders");function Pp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Pp,"toHttpHeaders");function _p(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(_p,"isNodeFormData");function bp(e){return e==null}o(bp,"isNil");var Vt=new Zt;var Fr=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(Fr||{});var cd=we(require("fs")),ks=we(zs());var pd={"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 ld(e){let t=e.split(";")[0].trim().toLowerCase();return pd[t]??""}o(ld,"contentTypeToExtension");var dd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),md=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 Os({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return G({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 ${md(t,g)}/resource or /resource`,required:!0,defaultValue:g?t(g):"",...c?.url??{}})}),"props")}),method:_.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Fr).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,I={};switch(P){case"none":break;case"json":I.data=_.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=_.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.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 I},"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}),...l},run:o(async g=>{let{method:P,url:I,headers:h,queryParams:s,body:d,body_type:y,failsafe:m,timeout:x,response_is_binary:b,followRedirects:j}=g.propsValue;Ct(P,"Method"),Ct(I,"URL");let re=he(r)?{}:await r(g.auth,g.propsValue),ae=I.url,Ge=ae.startsWith("http://")||ae.startsWith("https://")?ae:dd({baseUrl:t(g.auth),relativePath:ae}),Ee={method:P,url:Ge,headers:{...h??{},...f==="headers"||!he(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...s??{}},timeout:x?x*1e3:0,followRedirects:j};if(b&&(Ee.responseType="arraybuffer"),d)if(y&&y!=="none"){let le=d.data;if(y==="form_data"){let Bs=le,xt=new ks.default;for(let{fieldName:cn,fieldType:pn,textFieldValue:ln,fileFieldValue:tr}of Bs)pn==="text"&&!mt(ln)?xt.append(cn,ln):pn==="file"&&!mt(tr)&&xt.append(cn,tr.data,{filename:tr?.filename});Ee.body=xt,Ee.headers={...Ee.headers,...xt.getHeaders()}}else Ee.body=le}else y||(Ee.body=d);try{let le=await Vt.sendRequest(Ee);return await fd(g.files,le.body,le.status,le.headers,b)}catch(le){if(m)return le.errorMessage();throw le}},"run")})}o(Os,"createCustomApiCallAction");var fd=o(async(e,t,r,n,i)=>{let u;if(i&&gd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=ld(c??"")||"txt",f;t instanceof ArrayBuffer?f=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?f=t:f=Buffer.from(t),u=await e.write({fileName:`output.${l}`,data:f})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),gd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var yd="https://api.bokio.se/v1";async function V(e,t,r,n){try{return(await Vt.sendRequest({method:t,url:`${yd}${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=Cr.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 ws=G({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:l,phone:f,lin1:g,line2:P,zipCode:I,city:h,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={};l&&(x.email=l),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),I&&(b.zip_code=I),h&&(b.city=h),s&&(b.country=s),Object.keys(b).length>0&&(m.address=b),await V(d,"POST",`/companies/${y}/customers`,m)}});var er=_.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")}),hd=_.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=hd,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 Rs=G({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:l,itemType:f,dynamicProps:g}=e.propsValue,{api_key:P,companyId:I}=e.auth.props,h={type:t||"invoice",invoiceDate:n,dueDate:i};r&&(h.customerRef={id:r}),u&&(h.orderNumberReference=u),c&&(h.currency=c),l!=null&&(h.currencyRate=l);let s={};return f==="salesItem"&&g&&(s.itemType=f,h.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)),h.lineItems=[s],await V(P,"POST",`/companies/${I}/invoices`,h)}});var Ns=G({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:er,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 Ds=G({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 Cs=G({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 Us=G({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:er,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:l,currencyRate:f,lineItemsJson:g}=e.propsValue,{api_key:P,companyId:I}=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),l&&(h.currency=l),f!=null&&(h.currencyRate=f),g)try{h.lineItems=JSON.parse(g)}catch{throw new Error("Invalid JSON format for line items")}return await V(P,"PUT",`/companies/${I}/invoices/${t}`,h)}});var Ms=G({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,l="";t&&r&&(l=`${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"),l&&f.append("query",l);let g=`/companies/${c}/customers?${f.toString()}`;return await V(u,"GET",g)}});var js=G({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 l=`/companies/${u}/customers?${c.toString()}`,f=await V(i,"GET",l);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 I=`/companies/${u}/invoices?${P.toString()}`,h=await V(i,"GET",I);return{customerName:f.items[0].name,customerId:g,...h}}});var Ls=G({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 Fs=G({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 vd=hi({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:[ws,Rs,Ns,Ds,Cs,Us,Ms,js,Ls,Fs,Os({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: