@activepieces/piece-mistral-ai 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var Js=Object.create;var Ye=Object.defineProperty;var Xs=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Qs=Object.getPrototypeOf,eu=Object.prototype.hasOwnProperty;var o=(e,t)=>Ye(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},gn=(e,t)=>{for(var r in t)Ye(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ys(t))!eu.call(e,i)&&i!==r&&Ye(e,i,{get:()=>t[i],enumerable:!(n=Xs(t,i))||n.enumerable});return e};var Re=(e,t,r)=>(r=e!=null?Js(Qs(e)):{},yn(t||!e||!e.__esModule?Ye(r,"default",{value:e,enumerable:!0}):r,e)),tu=e=>yn(Ye({},"__esModule",{value:!0}),e);var Lo=E((jo,Zt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],P,j;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(j=d-g,P=":";j--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ue=[];for(let Xe=0;Xe<re.length;Xe++)ue.push(parseInt(re[Xe],16));return ue})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function y(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=g-m,P<0&&(P=0),s[v]>>P!==d[v]>>P)return!1;m-=g,v+=1}return!0}o(y,"matchCIDR");function _(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(_,"parseIntAuto");function I(s,d){for(;s.length<d;)s=`0${s}`;return s}o(I,"padPart");let x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],g&&j!==0)return null;j!==8&&(g=!0),d+=j}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),P=[];for(let j=0;j<v.length;j++)g=v[j],P.push(_(g));return P})();if(d=s.match(r.longValue)){if(m=_(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],g&&P!==0)return null;P!==16&&(g=!0),d+=P}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,P;for(;P=d.exec(g);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(g[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,P;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),P=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(P[g],10)),g++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,P,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(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<P.length;g++)if(v=P[g],!(0<=v&&v<=255))return null;return d.parts.push(P[0]<<8|P[1]),d.parts.push(P[2]<<8|P[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,P,j;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(P=d[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return g},typeof Zt<"u"&&Zt.exports?Zt.exports=x:e.ipaddr=x})(jo)});var Di=E((lA,Ni)=>{var Ri=require("stream").Stream,Sl=require("util");Ni.exports=le;function le(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(le,"DelayedStream");Sl.inherits(le,Ri);le.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(le.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});le.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};le.prototype.resume=function(){this._released||this.release(),this.source.resume()};le.prototype.pause=function(){this.source.pause()};le.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};le.prototype.pipe=function(){var e=Ri.prototype.pipe.apply(this,arguments);return this.resume(),e};le.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)};le.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 ji=E((dA,Mi)=>{var Al=require("util"),Ui=require("stream").Stream,Ci=Di();Mi.exports=G;function G(){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(G,"CombinedStream");Al.inherits(G,Ui);G.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};G.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};G.prototype.append=function(e){var t=G.isStreamLike(e);if(t){if(!(e instanceof Ci)){var r=Ci.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};G.prototype.pipe=function(e,t){return Ui.prototype.pipe.call(this,e,t),this.resume(),e};G.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}};G.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=G.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};G.prototype._pipeNext=function(e){this._currentStream=e;var t=G.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()};G.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};G.prototype.write=function(e){this.emit("data",e)};G.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};G.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")};G.prototype.end=function(){this._reset(),this.emit("end")};G.prototype.destroy=function(){this._reset(),this.emit("close")};G.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};G.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};G.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)};G.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Fi=E((fA,Li)=>{"use strict";Li.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 Vi=E(te=>{"use strict";var Kt=Fi(),zl=require("path").extname,Bi=/^\s*([^;\s]*)(?:;|\s|$)/,kl=/^text\//i;te.charset=Zi;te.charsets={lookup:Zi};te.contentType=wl;te.extension=Ol;te.extensions=Object.create(null);te.lookup=Rl;te.types=Object.create(null);Nl(te.extensions,te.types);function Zi(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&Kt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&kl.test(t[1])?"UTF-8":!1}o(Zi,"charset");function wl(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(wl,"contentType");function Ol(e){if(!e||typeof e!="string")return!1;var t=Bi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Ol,"extension");function Rl(e){if(!e||typeof e!="string")return!1;var t=zl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Rl,"lookup");function Nl(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 l=0;l<c.length;l++){var f=c[l];if(t[f]){var y=r.indexOf(Kt[t[f]].source),_=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>_||y===_&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Nl,"populateMaps")});var qi=E((hA,Hi)=>{Hi.exports=Dl;function Dl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Dl,"defer")});var Vr=E((xA,Wi)=>{var Gi=qi();Wi.exports=Cl;function Cl(e){var t=!1;return Gi(function(){t=!0}),o(function(n,i){t?e(n,i):Gi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Cl,"async")});var Hr=E((PA,Ki)=>{Ki.exports=Ul;function Ul(e){Object.keys(e.jobs).forEach(Ml.bind(e)),e.jobs={}}o(Ul,"abort");function Ml(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Ml,"clean")});var qr=E((IA,Xi)=>{var Ji=Vr(),jl=Hr();Xi.exports=Ll;function Ll(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Fl(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?jl(r):r.results[i]=c,n(u,r.results))})}o(Ll,"iterate");function Fl(e,t,r,n){var i;return e.length==2?i=e(r,Ji(n)):i=e(r,t,Ji(n)),i}o(Fl,"runJob")});var Gr=E((EA,Yi)=>{Yi.exports=Bl;function Bl(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(Bl,"state")});var Wr=E((SA,Qi)=>{var Zl=Hr(),Vl=Vr();Qi.exports=Hl;function Hl(e){Object.keys(this.jobs).length&&(this.index=this.size,Zl(this),Vl(e)(null,this.results))}o(Hl,"terminator")});var ta=E((zA,ea)=>{var ql=qr(),Gl=Gr(),Wl=Wr();ea.exports=Kl;function Kl(e,t,r){for(var n=Gl(e);n.index<(n.keyedList||e).length;)ql(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 Wl.bind(n,r)}o(Kl,"parallel")});var Kr=E((wA,Jt)=>{var ra=qr(),Jl=Gr(),Xl=Wr();Jt.exports=Yl;Jt.exports.ascending=na;Jt.exports.descending=Ql;function Yl(e,t,r,n){var i=Jl(e,r);return ra(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){ra(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Xl.bind(i,n)}o(Yl,"serialOrdered");function na(e,t){return e<t?-1:e>t?1:0}o(na,"ascending");function Ql(e,t){return-1*na(e,t)}o(Ql,"descending")});var ia=E((RA,oa)=>{var ep=Kr();oa.exports=tp;function tp(e,t,r){return ep(e,t,null,r)}o(tp,"serial")});var sa=E((DA,aa)=>{aa.exports={parallel:ta(),serial:ia(),serialOrdered:Kr()}});var Jr=E((CA,ua)=>{"use strict";ua.exports=Object});var la=E((UA,ca)=>{"use strict";ca.exports=Error});var da=E((MA,pa)=>{"use strict";pa.exports=EvalError});var fa=E((jA,ma)=>{"use strict";ma.exports=RangeError});var ya=E((LA,ga)=>{"use strict";ga.exports=ReferenceError});var va=E((FA,ha)=>{"use strict";ha.exports=SyntaxError});var Xt=E((BA,xa)=>{"use strict";xa.exports=TypeError});var Pa=E((ZA,_a)=>{"use strict";_a.exports=URIError});var Ia=E((VA,ba)=>{"use strict";ba.exports=Math.abs});var Ea=E((HA,Ta)=>{"use strict";Ta.exports=Math.floor});var Sa=E((qA,$a)=>{"use strict";$a.exports=Math.max});var za=E((GA,Aa)=>{"use strict";Aa.exports=Math.min});var wa=E((WA,ka)=>{"use strict";ka.exports=Math.pow});var Ra=E((KA,Oa)=>{"use strict";Oa.exports=Math.round});var Da=E((JA,Na)=>{"use strict";Na.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Ua=E((YA,Ca)=>{"use strict";var rp=Da();Ca.exports=o(function(t){return rp(t)||t===0?t:t<0?-1:1},"sign")});var ja=E((ez,Ma)=>{"use strict";Ma.exports=Object.getOwnPropertyDescriptor});var Xr=E((tz,La)=>{"use strict";var Yt=ja();if(Yt)try{Yt([],"length")}catch{Yt=null}La.exports=Yt});var Ba=E((rz,Fa)=>{"use strict";var Qt=Object.defineProperty||!1;if(Qt)try{Qt({},"a",{value:1})}catch{Qt=!1}Fa.exports=Qt});var Yr=E((nz,Za)=>{"use strict";Za.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 qa=E((iz,Ha)=>{"use strict";var Va=typeof Symbol<"u"&&Symbol,np=Yr();Ha.exports=o(function(){return typeof Va!="function"||typeof Symbol!="function"||typeof Va("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:np()},"hasNativeSymbols")});var Qr=E((sz,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var en=E((uz,Wa)=>{"use strict";var op=Jr();Wa.exports=op.getPrototypeOf||null});var Xa=E((cz,Ja)=>{"use strict";var ip="Function.prototype.bind called on incompatible ",ap=Object.prototype.toString,sp=Math.max,up="[object Function]",Ka=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"),cp=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"),lp=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");Ja.exports=o(function(t){var r=this;if(typeof r!="function"||ap.apply(r)!==up)throw new TypeError(ip+r);for(var n=cp(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ka(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ka(n,arguments))},"binder"),c=sp(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+lp(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var qe=E((pz,Ya)=>{"use strict";var pp=Xa();Ya.exports=Function.prototype.bind||pp});var er=E((dz,Qa)=>{"use strict";Qa.exports=Function.prototype.call});var tn=E((mz,es)=>{"use strict";es.exports=Function.prototype.apply});var rs=E((fz,ts)=>{"use strict";ts.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var os=E((gz,ns)=>{"use strict";var dp=qe(),mp=tn(),fp=er(),gp=rs();ns.exports=gp||dp.call(fp,mp)});var as=E((yz,is)=>{"use strict";var yp=qe(),hp=Xt(),vp=er(),xp=os();is.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new hp("a function is required");return xp(yp,vp,t)},"callBindBasic")});var ds=E((vz,ps)=>{"use strict";var _p=as(),ss=Xr(),cs;try{cs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var rn=!!cs&&ss&&ss(Object.prototype,"__proto__"),ls=Object,us=ls.getPrototypeOf;ps.exports=rn&&typeof rn.get=="function"?_p([rn.get]):typeof us=="function"?o(function(t){return us(t==null?t:ls(t))},"getDunder"):!1});var hs=E((_z,ys)=>{"use strict";var ms=Qr(),fs=en(),gs=ds();ys.exports=ms?o(function(t){return ms(t)},"getProto"):fs?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return fs(t)},"getProto"):gs?o(function(t){return gs(t)},"getProto"):null});var nn=E((bz,vs)=>{"use strict";var Pp=Function.prototype.call,bp=Object.prototype.hasOwnProperty,Ip=qe();vs.exports=Ip.call(Pp,bp)});var Es=E((Iz,Ts)=>{"use strict";var M,Tp=Jr(),Ep=la(),$p=da(),Sp=fa(),Ap=ya(),Je=va(),Ke=Xt(),zp=Pa(),kp=Ia(),wp=Ea(),Op=Sa(),Rp=za(),Np=wa(),Dp=Ra(),Cp=Ua(),bs=Function,on=o(function(e){try{return bs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),xt=Xr(),Up=Ba(),an=o(function(){throw new Ke},"throwTypeError"),Mp=xt?(function(){try{return arguments.callee,an}catch{try{return xt(arguments,"callee").get}catch{return an}}})():an,Ge=qa()(),X=hs(),jp=en(),Lp=Qr(),Is=tn(),_t=er(),We={},Fp=typeof Uint8Array>"u"||!X?M:X(Uint8Array),Me={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ge&&X?X([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":We,"%AsyncGenerator%":We,"%AsyncGeneratorFunction%":We,"%AsyncIteratorPrototype%":We,"%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%":Ep,"%eval%":eval,"%EvalError%":$p,"%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%":bs,"%GeneratorFunction%":We,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ge&&X?X(X([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ge||!X?M:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Tp,"%Object.getOwnPropertyDescriptor%":xt,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Sp,"%ReferenceError%":Ap,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ge||!X?M:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ge&&X?X(""[Symbol.iterator]()):M,"%Symbol%":Ge?Symbol:M,"%SyntaxError%":Je,"%ThrowTypeError%":Mp,"%TypedArray%":Fp,"%TypeError%":Ke,"%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%":zp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":_t,"%Function.prototype.apply%":Is,"%Object.defineProperty%":Up,"%Object.getPrototypeOf%":jp,"%Math.abs%":kp,"%Math.floor%":wp,"%Math.max%":Op,"%Math.min%":Rp,"%Math.pow%":Np,"%Math.round%":Dp,"%Math.sign%":Cp,"%Reflect.getPrototypeOf%":Lp};if(X)try{null.error}catch(e){xs=X(X(e)),Me["%Error.prototype%"]=xs}var xs,Bp=o(function e(t){var r;if(t==="%AsyncFunction%")r=on("async function () {}");else if(t==="%GeneratorFunction%")r=on("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=on("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Me[t]=r,r},"doEval"),_s={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pt=qe(),tr=nn(),Zp=Pt.call(_t,Array.prototype.concat),Vp=Pt.call(Is,Array.prototype.splice),Ps=Pt.call(_t,String.prototype.replace),rr=Pt.call(_t,String.prototype.slice),Hp=Pt.call(_t,RegExp.prototype.exec),qp=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Gp=/\\(\\)?/g,Wp=o(function(t){var r=rr(t,0,1),n=rr(t,-1);if(r==="%"&&n!=="%")throw new Je("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Je("invalid intrinsic syntax, expected opening `%`");var i=[];return Ps(t,qp,function(u,c,l,f){i[i.length]=l?Ps(f,Gp,"$1"):c||u}),i},"stringToPath"),Kp=o(function(t,r){var n=t,i;if(tr(_s,n)&&(i=_s[n],n="%"+i[0]+"%"),tr(Me,n)){var u=Me[n];if(u===We&&(u=Bp(n)),typeof u>"u"&&!r)throw new Ke("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Je("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Ts.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Ke("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ke('"allowMissing" argument must be a boolean');if(Hp(/^%?[^%]*%?$/,t)===null)throw new Je("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Wp(t),i=n.length>0?n[0]:"",u=Kp("%"+i+"%",r),c=u.name,l=u.value,f=!1,y=u.alias;y&&(i=y[0],Vp(n,Zp([0,1],y)));for(var _=1,I=!0;_<n.length;_+=1){var x=n[_],s=rr(x,0,1),d=rr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Je("property names with quotes must have matching quotes");if((x==="constructor"||!I)&&(f=!0),i+="."+x,c="%"+i+"%",tr(Me,c))l=Me[c];else if(l!=null){if(!(x in l)){if(!r)throw new Ke("base intrinsic for "+t+" exists, but the property is not available.");return}if(xt&&_+1>=n.length){var g=xt(l,x);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[x]}else I=tr(l,x),l=l[x];I&&!f&&(Me[c]=l)}}return l},"GetIntrinsic")});var Ss=E((Ez,$s)=>{"use strict";var Jp=Yr();$s.exports=o(function(){return Jp()&&!!Symbol.toStringTag},"hasToStringTagShams")});var ks=E((Sz,zs)=>{"use strict";var Xp=Es(),As=Xp("%Object.defineProperty%",!0),Yp=Ss()(),Qp=nn(),ed=Xt(),nr=Yp?Symbol.toStringTag:null;zs.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 ed("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");nr&&(n||!Qp(t,nr))&&(As?As(t,nr,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[nr]=r)},"setToStringTag")});var Os=E((zz,ws)=>{"use strict";var td=Function.prototype.call,rd=Object.prototype.hasOwnProperty,nd=qe();ws.exports=nd.call(td,rd)});var Ns=E((kz,Rs)=>{"use strict";Rs.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var pn=E((wz,Cs)=>{"use strict";var ln=ji(),od=require("util"),sn=require("path"),id=require("http"),ad=require("https"),sd=require("url").parse,ud=require("fs"),cd=require("stream").Stream,ld=require("crypto"),un=Vi(),pd=sa(),dd=ks(),we=Os(),cn=Ns();function Ds(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Ds,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");od.inherits(L,ln);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=ln.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};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&&we(t,"httpVersion"))&&!(t instanceof cd))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){we(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):ud.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):we(e,"httpVersion")?t(null,Number(e.headers["content-length"])):we(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="'+Ds(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&cn(c,r.header);var l;for(var f in c)if(we(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=sn.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=sn.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&we(e,"httpVersion")&&(r=sn.basename(e.client._httpMessage.path||"")),r)return'filename="'+Ds(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=un.lookup(e.name)),!r&&e&&e.path&&(r=un.lookup(e.path)),!r&&e&&e.readable&&we(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=un.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)we(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="--------------------------"+ld.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}pd.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=sd(e),n=cn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=cn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=ad.request(n):r=id.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(y,_){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,y,_)},"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]"};dd(L.prototype,"FormData");Cs.exports=L});var Rd={};gn(Rd,{mistralAi:()=>Od});module.exports=tu(Rd);var ru=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let y=c.prototype,_=Object.keys(y);for(let I=0;I<_.length;I++){let x=_[I];x in l||(l[x]=y[x].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let y=r?.Parent?new u:this;n(y,l),(f=y._zod).deferred??(f.deferred=[]);for(let _ of y._zod.deferred)_();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var pe=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"}},ir={};function ge(e){return e&&Object.assign(ir,e),ir}o(ge,"config");function sr(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(sr,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function 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 xn(e){return e==null}o(xn,"nullish");function $t(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o($t,"cleanRegex");var hn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var ur="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Qe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Qe,"isObject");var nu=Et(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Qe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Qe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function St(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(St,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var In={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Le(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(Le,"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 Tn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Tn,"getLengthableOrigin");function cr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(cr,"issue");var En=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),$n=b("$ZodError",En),et=b("$ZodError",En,{Parent:Error});var iu=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise)throw new pe;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ge())));throw ur(l,i?.callee),l}return c.value},"_parse"),At=iu(et),au=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},c=t._zod.run({value:r,issues:[]},u);if(c instanceof Promise&&(c=await c),c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ie(f,u,ge())));throw ur(l,i?.callee),l}return c.value},"_parseAsync"),zt=au(et),su=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new pe;return u.issues.length?{success:!1,error:new(e??$n)(u.issues.map(c=>Ie(c,i,ge())))}:{success:!0,data:u.value}},"_safeParse"),tt=su(et),uu=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(c=>Ie(c,i,ge())))}:{success:!0,data:u.value}},"_safeParseAsync"),rt=uu(et);var cu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",lu=new RegExp(`^${cu}$`);var Sn=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),An=/^-?\d+n?$/,zn=/^-?\d+$/,lr=/^-?\d+(?:\.\d+)?$/,kn=/^(?:true|false)$/i;var Te=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),pu={number:"number",bigint:"bigint",object:"date"};var wn=b("$ZodCheckGreaterThan",(e,t)=>{Te.init(e,t);let r=pu[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 On=b("$ZodCheckNumberFormat",(e,t)=>{Te.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=In[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=zn)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Rn=b("$ZodCheckMinLength",(e,t)=>{var r;Te.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let c=Tn(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var pr=b("$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=()=>{})}),Nn=b("$ZodCheckRegex",(e,t)=>{pr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var Cn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Cn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let y=Le(c),_;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new pe;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Le(c,x)))});else{if(c.issues.length===x)continue;y||(y=Le(c,x))}}return _?_.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Le(c))return c.aborted=!0,c;let y=i(l,n,f);if(y instanceof Promise){if(f.async===!1)throw new pe;return y.then(_=>e._zod.parse(_,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return y instanceof Promise?y.then(_=>u(_,c,l)):u(y,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new pe;return f.then(y=>i(y,n,l))}return i(f,n,l)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=tt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return rt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ot=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Sn(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),dr=b("$ZodStringFormat",(e,t)=>{pr.init(e,t),Ot.init(e,t)});var Fn=b("$ZodURL",(e,t)=>{dr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var mr=b("$ZodNumber",(e,t)=>{H.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}}),Bn=b("$ZodNumberFormat",(e,t)=>{On.init(e,t),mr.init(e,t)}),fr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=kn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),Zn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Vn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Hn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var qn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Gn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Un(e,t,r){e.issues.length&&t.issues.push(...be(r,e.issues)),t.value[r]=e.value}o(Un,"handleArrayResult");var Wn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(y=>Un(y,r,c))):Un(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function wt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...be(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(wt,"handlePropertyResult");function du(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(du,"normalizeDef");function mu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,y=f.def.type,_=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(y==="never"){c.push(I);continue}let x=f.run({value:t[I],issues:[]},n);x instanceof Promise?e.push(x.then(s=>wt(s,r,I,t,_))):wt(x,r,I,t,_)}return c.length&&r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(mu,"handleCatchall");var Kn=b("$ZodObject",(e,t)=>{if(H.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=Et(()=>du(t));W(e._zod,"propValues",()=>{let l=t.shape,f={};for(let y in l){let _=l[y]._zod;if(_.values){f[y]??(f[y]=new Set);for(let I of _.values)f[y].add(I)}}return f});let i=Qe,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let y=l.value;if(!i(y))return l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l;l.value={};let _=[],I=c.shape;for(let x of c.keys){let s=I[x],d=s._zod.optout==="optional",g=s._zod.run({value:y[x],issues:[]},f);g instanceof Promise?_.push(g.then(m=>wt(m,l,x,y,d))):wt(g,l,x,y,d)}return u?mu(_,y,l,f,n.value,e):_.length?Promise.all(_).then(()=>l):l}});function Mn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Le(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Ie(c,n,ge())))}),t)}o(Mn,"handleUnionResults");var gr=b("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>$t(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)l.push(y),c=!0;else{if(y.issues.length===0)return y;l.push(y)}}return c?Promise.all(l).then(f=>Mn(f,i,e,u)):Mn(l,i,e,u)}});var Jn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,gr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let y of f)i[l].add(y)}}return i});let n=Et(()=>{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(!Qe(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 Xn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){l.add(typeof y=="number"?y.toString():y);let _=t.valueType._zod.run({value:i[y],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(y,I.issues)),r.value[y]=I.value})):(_.issues.length&&r.issues.push(...be(y,_.issues)),r.value[y]=_.value)}let f;for(let y in i)l.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&lr.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=>Ie(I,n,ge())),input:l,path:[l],inst:e});continue}let _=t.valueType._zod.run({value:i[l],issues:[]},n);_ instanceof Promise?u.push(_.then(I=>{I.issues.length&&r.issues.push(...be(l,I.issues)),r.value[f.value]=I.value})):(_.issues.length&&r.issues.push(...be(l,_.issues)),r.value[f.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Yn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=sr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?je(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=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var eo=b("$ZodTransform",(e,t)=>{H.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 pe;return r.value=i,r}});function jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(jn,"handleOptionalResult");var to=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(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=>jn(u,r.value)):jn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var ro=b("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${$t(r.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var no=b("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>kt(c,t.in,n)):kt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>kt(u,t.out,n)):kt(i,t.out,n)}});function kt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(kt,"handlePipeResult");var oo=b("$ZodCustom",(e,t)=>{Te.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Ln(u,r,n,e));Ln(i,r,n,e)}});function Ln(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(cr(i))}}o(Ln,"handleRefineResult");var ao;var yr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function so(){return new yr}o(so,"registry");(ao=globalThis).__zod_globalRegistry??(ao.__zod_globalRegistry=so());var hr=globalThis.__zod_globalRegistry;function uo(e,t){return new e({type:"string",...Z(t)})}o(uo,"_string");function co(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(co,"_coercedString");function lo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(lo,"_url");function po(e,t){return new e({type:"number",checks:[],...Z(t)})}o(po,"_number");function mo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(mo,"_coercedNumber");function fo(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(fo,"_int");function go(e,t){return new e({type:"boolean",...Z(t)})}o(go,"_boolean");function yo(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(yo,"_coercedBoolean");function ho(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(ho,"_coercedBigint");function vo(e){return new e({type:"any"})}o(vo,"_any");function xo(e){return new e({type:"unknown"})}o(xo,"_unknown");function _o(e,t){return new e({type:"void",...Z(t)})}o(_o,"_void");function Po(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(Po,"_coercedDate");function Rt(e,t){return new wn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Rt,"_gte");function ce(e,t){return new Rn({check:"min_length",...Z(t),minimum:e})}o(ce,"_minLength");function Ee(e,t){return new Nn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Ee,"_regex");function bo(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(bo,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>At(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>tt(e,r,n),e.parseAsync=async(r,n)=>zt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>rt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>St(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Dt=b("ZodMiniString",(e,t)=>{Ot.init(e,t),K.init(e,t)});function a(e){return uo(Dt,e)}o(a,"string");var Io=b("ZodMiniStringFormat",(e,t)=>{dr.init(e,t),Dt.init(e,t)});var $u=b("ZodMiniURL",(e,t)=>{Fn.init(e,t),Io.init(e,t)});function To(e){return lo($u,e)}o(To,"url");var Ct=b("ZodMiniNumber",(e,t)=>{mr.init(e,t),K.init(e,t)});function Y(e){return po(Ct,e)}o(Y,"number");var Su=b("ZodMiniNumberFormat",(e,t)=>{Bn.init(e,t),Ct.init(e,t)});function Eo(e){return fo(Su,e)}o(Eo,"int");var vr=b("ZodMiniBoolean",(e,t)=>{fr.init(e,t),K.init(e,t)});function B(e){return go(vr,e)}o(B,"boolean");var $o=b("ZodMiniBigInt",(e,t)=>{Zn.init(e,t),K.init(e,t)});var Au=b("ZodMiniAny",(e,t)=>{Vn.init(e,t),K.init(e,t)});function ot(){return vo(Au)}o(ot,"any");var zu=b("ZodMiniUnknown",(e,t)=>{Hn.init(e,t),K.init(e,t)});function w(){return xo(zu)}o(w,"unknown");var ku=b("ZodMiniVoid",(e,t)=>{qn.init(e,t),K.init(e,t)});function So(e){return _o(ku,e)}o(So,"_void");var Ao=b("ZodMiniDate",(e,t)=>{Gn.init(e,t),K.init(e,t)});var wu=b("ZodMiniArray",(e,t)=>{Wn.init(e,t),K.init(e,t)});function N(e,t){return new wu({type:"array",element:e,...Z(t)})}o(N,"array");var Ou=b("ZodMiniObject",(e,t)=>{Kn.init(e,t),K.init(e,t),W(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Ou(r)}o(p,"object");var Ru=b("ZodMiniUnion",(e,t)=>{gr.init(e,t),K.init(e,t)});function D(e,t){return new Ru({type:"union",options:e,...Z(t)})}o(D,"union");var Nu=b("ZodMiniDiscriminatedUnion",(e,t)=>{Jn.init(e,t),K.init(e,t)});function $e(e,t,r){return new Nu({type:"union",options:t,discriminator:e,...Z(r)})}o($e,"discriminatedUnion");var Du=b("ZodMiniRecord",(e,t)=>{Xn.init(e,t),K.init(e,t)});function O(e,t,r){return new Du({type:"record",keyType:e,valueType:t,...Z(r)})}o(O,"record");var Cu=b("ZodMiniEnum",(e,t)=>{Yn.init(e,t),K.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 Cu({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var Uu=b("ZodMiniLiteral",(e,t)=>{Qn.init(e,t),K.init(e,t)});function $(e,t){return new Uu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o($,"literal");var Mu=b("ZodMiniTransform",(e,t)=>{eo.init(e,t),K.init(e,t)});function Se(e){return new Mu({type:"transform",transform:e})}o(Se,"transform");var ju=b("ZodMiniOptional",(e,t)=>{to.init(e,t),K.init(e,t)});function h(e){return new ju({type:"optional",innerType:e})}o(h,"optional");var Lu=b("ZodMiniNullable",(e,t)=>{ro.init(e,t),K.init(e,t)});function it(e){return new Lu({type:"nullable",innerType:e})}o(it,"nullable");var Fu=b("ZodMiniPipe",(e,t)=>{no.init(e,t),K.init(e,t)});function Ae(e,t){return new Fu({type:"pipe",in:e,out:t})}o(Ae,"pipe");var Bu=b("ZodMiniCustom",(e,t)=>{oo.init(e,t),K.init(e,t)});function Ut(e,t){return bo(Bu,e??(()=>!0),t)}o(Ut,"custom");var at={};gn(at,{bigint:()=>Wu,boolean:()=>Gu,date:()=>Ku,number:()=>qu,string:()=>Hu});function Hu(e){return co(Dt,e)}o(Hu,"string");function qu(e){return mo(Ct,e)}o(qu,"number");function Gu(e){return yo(vr,e)}o(Gu,"boolean");function Wu(e){return ho($o,e)}o(Wu,"bigint");function Ku(e){return Po(Ao,e)}o(Ku,"date");var _r=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),xr=class{constructor(t,r,n,i,u,c,l,f,y,_,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=y;this.audience=_;this.aiMetadata=I}static{o(this,"IAction")}},ae=o(e=>new xr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:$(t),required:B(),defaultValue:h(ot())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),ye=p({...F.shape,...C(a(),"LONG_TEXT").shape});var ko=p({label:a(),value:w()}),Mt=p({disabled:h(B()),placeholder:h(a()),options:N(ko)});var oe=p({...F.shape,options:Mt,...C(w(),"STATIC_DROPDOWN").shape}),he=p({...F.shape,options:Mt,...C(N(w()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var Pr=p({...F.shape,...C(w(),"DROPDOWN").shape,refreshers:N(a())}),st=p({...F.shape,...C(N(w()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var ve=p({...F.shape,...C(B(),"CHECKBOX").shape});var xe=p({...F.shape,...C(Y(),"NUMBER").shape});var ut=p({...F.shape,...C(w(),"FILE").shape});var ct=p({...F.shape,...C(a(),"DATE_TIME").shape});var wo=O(a(),D([ne,ye,oe,st,he,ve,xe,ut,ct])),lt=p({...F.shape,properties:wo,...C(N(w()),"ARRAY").shape});var pt=p({...F.shape,...C(D([O(a(),w())]),"JSON").shape});var Oo=D([ne,oe,pt,lt,he]),Xu=O(a(),Oo),br=p({refreshers:N(a()),...F.shape,...C(w(),"DYNAMIC").shape});var jt=p({...F.shape,...C(So(),"MARKDOWN").shape});var dt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(dt||{}),Fe=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Fe||{}),Be=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Be||{});var mt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(mt||{}),Ir="both_client_credentials_and_authorization_code";var Ne=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Ne||{}),ft=(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))(ft||{}),Yu=p({strategy:U(ft),paramName:h(a())}),gt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(gt||{});var Lt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Lt||{}),Ro=p({status:h(Y()),body:h(w()),headers:h(O(a(),a()))}),No=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Lt))}),Do=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:Ro,handlerId:h(a()),streamStepProgress:h(U(Lt))}),Qu=D([No,Do]);var ec=p({body:w(),rawBody:h(w()),headers:O(a(),a()),queryParams:O(a(),a())});function _e(e){return e==null}o(_e,"isNil");function yt(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(yt,"isEmpty");function Ft(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ft,"assertNotNullOrUndefined");var Tr=Re(require("crypto"),1);var tc=128,De,Ze,rc=o(e=>{!De||De.length<e?(De=Buffer.allocUnsafe(e*tc),Tr.default.randomFillSync(De),Ze=0):Ze+e>De.length&&(Tr.default.randomFillSync(De),Ze=0),Ze+=e},"fillPool"),nc=o(e=>(rc(e|=0),De.subarray(Ze-e,Ze)),"random"),oc=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"),Uo=o((e,t=21)=>oc(e,t,nc),"customAlphabet");var ic="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Mo=21,fb=a().check(Ee(new RegExp(`^[0-9a-zA-Z]{${Mo}}$`))),ac=Uo(ic,Mo);var ze=Ae(Se(e=>e instanceof Date?e.toISOString():e),a()),se={id:a(),created:ze,updated:ze},V=o(e=>h(it(e)),"Nullable");function Er(e){return h(it(U(e)))}o(Er,"NullableEnum");var hb=Ae(Se(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Bt=o(e=>Ae(Se(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var _b=O(a(),w());var ht=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(ht||{});var Ob=a().check(Ee(/^#[0-9A-Fa-f]{6}$/));var Nb=p({filename:a(),data:w(),type:$("file"),mimetype:h(a())});var sc=Re(Lo());var Fb=p({...se,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:h(Y())});var Fo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Fo||{}),$r=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))($r||{}),Sr=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Sr||{});var Ar=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Ar||{});var zr=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(zr||{});var uc=p({mode:U(Fo),value:w()}),cc=p({auth:h(a()),fields:O(a(),uc)}),lc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(cc)}),pc=p({type:$("PIECE"),toolName:a().check(ce(1)),pieceMetadata:lc}),dc=p({type:$("none")}),mc=p({type:$("access_token"),accessToken:a()}),fc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),gc=p({type:$("headers"),headers:O(a(),a())}),yc=$e("type",[dc,mc,fc,gc]),Bo=p({type:$("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:h(a())}),Zo=p({type:$("MCP"),toolName:a().check(ce(1)),serverUrl:To(),protocol:U(Sr),auth:yc}),Vo=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:U($r),sourceId:a(),sourceName:a()}),hc=$e("type",[pc,Bo,Zo,Vo]),vc=p({displayName:a(),description:h(a()),type:U(Ar)}),Ho=p({type:$("MARKDOWN"),markdown:a()}),Ve={type:$("TOOL_CALL"),input:V(O(a(),w())),output:h(w()),toolName:a(),status:U(zr),toolCallId:a(),startTime:a(),endTime:h(a())},fI=p(Ve),qo=$e("toolCallType",[p({...Ve,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...Ve,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...Ve,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...Ve,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...Ve,toolCallType:$("UNKNOWN"),displayName:a()})]),xc=D([Ho,qo]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),Pe=p({apiKey:a()}),_c=Pe,Pc=p({apiKey:a(),apiKeyHash:a()}),bc=Pe,Ic=Pe,Tc=Pe,Ec=Pe,$c=Pe,Sc=Pe,Ac=Pe,Go=p({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),zc=p({}),kc=p({}),wc=p({}),Oc=p({}),Rc=p({}),Nc=p({}),Wo=p({modelId:a(),modelName:a(),modelType:U(kr)}),Ko=p({apiKeyHeader:a(),baseUrl:a(),models:N(Wo),defaultHeaders:h(O(a(),a()))}),Jo=p({accountId:a(),gatewayId:a(),models:N(Wo),vertexProject:h(a()),vertexRegion:h(a())}),Xo=p({resourceName:a(),apiVersion:Ae(Se(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),Yo=p({region:a().check(ce(1))}),Dc=D([_c,Tc,Ec,$c,Sc,Ic,bc,Pc,Go,Ac]),Qo=D([Ko,Jo,Xo,Yo,zc,wc,Oc,Rc,kc,Nc]),Cc=p({id:a(),name:a(),type:U(kr)}),Uc=p({id:a(),name:a(),provider:U(ht),config:Qo,enabledForChat:B()}),Mc=p({provider:U(ht),config:Qo,auth:Dc,platformId:a()});var vI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var jc=p({base64Url:a(),fileName:a(),extension:h(a())}),Lc=p({mimeType:a(),url:a(),fileName:h(a())}),wr=D([jc,Lc]);var Fc=D([p({type:$("file"),value:wr}),p({type:$("markdown"),value:a(),files:h(N(wr))})]),Bc=p({sessionId:a(),message:a(),files:h(N(a()))});var ti=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ti||{}),ri=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(ri||{}),Or=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Or||{});var Zc=D([p({...se,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...se,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),Vc=p({...se,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:Er(ri),trigger:Er(ti)}),Hc=p({...se,tableId:a(),projectId:a(),cells:O(a(),p({updated:a(),created:a(),value:w(),fieldName:a()}))}),qc=p({events:N(U(Or)),webhookUrl:a(),flowId:a()}),Gc=p({fields:N(p({id:a(),name:a()})),rows:N(O(a(),a())),name:a()}),Wc=p({projectId:a(),limit:h(at.number()),cursor:h(a()),name:h(a()),externalIds:Bt(a()),folderId:h(a()),folderIds:Bt(a())}),Kc=p({records:N(N(p({fieldId:a(),value:oi()}))),tableId:a()}),Jc=p({cells:h(N(p({fieldId:a(),value:oi()}))),tableId:a(),agentUpdate:h(B())}),ni=$e("operator",[Ce("eq"),Ce("neq"),Ce("gt"),Ce("gte"),Ce("lt"),Ce("lte"),Ce("co"),ei("exists"),ei("not_exists")]),Xc=p({tableId:a(),limit:h(at.number()),cursor:h(a()),filters:Bt(ni)});function oi(){return Ae(Se(e=>e==null?e:String(e)),it(a()))}o(oi,"coerceToString");function Ce(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ce,"valueFilter");function ei(e){return p({fieldId:a(),operator:$(e)})}o(ei,"existenceFilter");var Yc=p({status:h(Y()),body:h(w()),headers:h(O(a(),a()))}),Qc=p({...se,deleted:V(ze),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var ii=p({name:a(),description:h(a()),type:a(),required:B()}),el=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(ii),returnsResponse:B()})});var ai="^[0-9]+\\.[0-9]+\\.[0-9]+$",UI=new RegExp(ai),rl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",MI=a().check(Ee(new RegExp(ai))),jI=a().check(Ee(new RegExp(rl))),nl=p({packageType:$("ARCHIVE"),pieceType:U(Fe),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),si=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ui=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),LI=D([si,ui]),FI=D([nl,si,ui]);var ol=$e("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:Eo().check(Rt(6e4))})]),BI=p({...se,type:U(Ne),projectId:a(),flowId:a(),triggerName:a(),schedule:V(ol),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),ci=(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))(ci||{}),li=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(li||{}),pi=(r=>(r.S3="S3",r.DB="DB",r))(pi||{}),ZI=p({...se,projectId:V(a()),platformId:V(a()),type:U(ci),compression:U(li),data:h(w()),location:U(pi),size:V(Y()),fileName:V(a()),s3Key:V(a()),metadata:V(O(a(),a()))}),di=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(di||{}),mi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(mi||{}),VI=p({id:a(),email:a(),firstName:a(),status:U(mi),externalId:V(a()),platformId:V(a()),platformRole:U(di),lastName:a(),created:ze,updated:ze,lastActiveDate:V(ze),imageUrl:V(a())});var Nr=p({...F.shape,...C(O(a(),w()),"OBJECT").shape});var yi=p({...F.shape,...C(a(),"COLOR").shape});var Dr=D([ne,ye,jt,ve,oe,he,Pr,st,br,xe,lt,Nr,pt,ct,ut,yi]),S={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var de=p({displayName:a(),description:h(a())});var hi=p({username:a(),password:a()}),Cr=p({...de.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(hi,"BASIC_AUTH").shape});var ul=O(a(),D([ne,ye,xe,ve,oe])),Ur=p({...de.shape,props:ul,...C(w(),"CUSTOM_AUTH").shape});var Ue=p({...de.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var cl=O(a(),D([ne,ye,Ue,xe,ve,oe,he,jt])),vi=p({...de.shape,props:cl,...C(w(),"OIDC").shape});var Mr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Mr||{}),xi=D([ne,Ue,oe]),_i=O(a(),xi),ll=p({props:h(O(a(),xi)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(B()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(U(Mr)),grantType:h(D([U(mt),$(Ir)])),extra:h(O(a(),a()))}),Pi=p({access_token:a(),props:h(_i),data:O(a(),ot())}),jr=p({...de.shape,...ll.shape,...C(Pi,"OAUTH2").shape});var He=D([Cr,Ur,vi,jr,Ue]),vt="Connection",ke={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||vt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||vt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||vt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||vt}},None(){}};var bE={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 pl=p({...F.shape,...C(w(),"CUSTOM").shape,code:a()});var dl=D([Dr,He]),Lr=O(a(),dl),BE=O(a(),Dr);var bi=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]);var Ii="2",Vt="0.82.0";var Fr=class{constructor(t,r,n,i,u,c,l,f,y=Vt,_,I="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=_;this.description=I;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ii}),"getContextInfo");(!ml(y)||fl(y,Vt))&&(this.minimumSupportedRelease=Vt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},Ti=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 Fr(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 ml(e){return/^\d+\.\d+\.\d+$/.test(e)}o(ml,"isValidSimpleSemver");function fl(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(fl,"isSemverLessThan");var gl=h(O(a(),O(a(),a()))),Ei=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([He,N(He)])),version:a(),categories:h(N(U(Be))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(B()),i18n:gl}),yl=U(["human","ai","both"]),$i=p({description:h(a()),idempotent:h(B())}),Si=p({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:B(),errorHandlingOptions:h(_r),outputSchema:h(Ut()),audience:h(yl),aiMetadata:h($i)}),Ai=p({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:h(_r),type:U(Ne),sampleData:w(),handshakeConfiguration:h(Ut()),renewConfiguration:h(bi),testStrategy:U(gt),outputSchema:h(Ut()),aiMetadata:h($i)}),hl=p({...Ei.shape,actions:O(a(),Si),triggers:O(a(),Ai)}),vl=p({...Ei.shape,actions:Y(),triggers:Y(),suggestedActions:h(N(Ai)),suggestedTriggers:h(N(Si))}),zi=p({projectUsage:Y(),pieceType:U(Fe),packageType:U(dt),platformId:h(a()),archiveId:h(a())}),B$=p({...hl.shape,...zi.shape}),Z$=p({...vl.shape,...zi.shape}),V$=p({name:a(),version:a()});var xl=Re(require("path")),_l=Re(require("fs/promises"));var Oi=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 qt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Br,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Gt=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 Wt=class extends Ht{static{o(this,"FetchHttpClient")}constructor(t="",r=new qt){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,y=t.responseType??"json",_=t.followRedirects??!0,I=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Pl(t.body,u),g=Il({...u,...s}),m=await bl(async()=>{let j=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let ue={method:t.method.toString(),headers:g,body:x,redirect:_?"follow":"manual",signal:j.signal};return d&&(ue.duplex="half"),r?.dispatcher!==void 0&&(ue.dispatcher=r.dispatcher),await fetch(f,ue)}finally{re!==void 0&&clearTimeout(re)}},I),v=_?300:400;if(m.status<200||m.status>=v){let j=await ki(m,y),re=new Gt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await ki(m,y);return{status:m.status,headers:Tl(m.headers),body:P}}};function Pl(e,t){if($l(e))return{body:void 0,extraHeaders:{},isStream:!1};if(El(e)){let n=new Oi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Pl,"serializeBody");async function ki(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(ki,"parseResponseBody");async function bl(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await wi(n);continue}return i}catch(i){if(r=i,n<t){await wi(n);continue}throw i}throw r}o(bl,"sendWithRetries");function wi(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(wi,"backoff");function Il(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(Il,"normalizeHeaders");function Tl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(Tl,"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 $l(e){return e==null}o($l,"isNil");var J=new Wt;var me=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(me||{});var md=Re(require("fs")),Us=Re(pn());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 gd(e){let t=e.split(";")[0].trim().toLowerCase();return fd[t]??""}o(gd,"contentTypeToExtension");var yd=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 Ms({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return ae({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
-
i.e ${hd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(me).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let _=y,I={};switch(_){case"none":break;case"json":I.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async y=>{let{method:_,url:I,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=y.propsValue;Ft(_,"Method"),Ft(I,"URL");let re=_e(r)?{}:await r(y.auth,y.propsValue),ue=I.url,Xe=ue.startsWith("http://")||ue.startsWith("https://")?ue:yd({baseUrl:t(y.auth),relativePath:ue}),Oe={method:_,url:Xe,headers:{...x??{},...f==="headers"||!_e(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(Oe.responseType="arraybuffer"),d)if(g&&g!=="none"){let fe=d.data;if(g==="form_data"){let Ks=fe,bt=new Us.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:or}of Ks)mn==="text"&&!yt(fn)?bt.append(dn,fn):mn==="file"&&!yt(or)&&bt.append(dn,or.data,{filename:or?.filename});Oe.body=bt,Oe.headers={...Oe.headers,...bt.getHeaders()}}else Oe.body=fe}else g||(Oe.body=d);try{let fe=await J.sendRequest(Oe);return await vd(y.files,fe.body,fe.status,fe.headers,P)}catch(fe){if(m)return fe.errorMessage();throw fe}},"run")})}o(Ms,"createCustomApiCallAction");var vd=o(async(e,t,r,n,i)=>{let u;if(i&&xd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=gd(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"),xd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var _d=ke.SecretText({displayName:"API Key",description:"You can obtain your API key from the Mistral AI dashboard. Go to https://console.mistral.ai, generate an API key, and paste it here.",required:!0,validate:o(async({auth:e})=>{try{return await J.sendRequest({method:"GET",url:"https://api.mistral.ai/v1/models",headers:{Authorization:`Bearer ${e}`}}),{valid:!0}}catch(t){return t.response?.status===401?{valid:!1,error:"Invalid API key. Please check your API key and try again."}:t.response?.status===429?{valid:!1,error:"Rate limit exceeded. Please wait and try again."}:t.message?.toLowerCase().includes("network")?{valid:!1,error:"Network error. Please check your internet connection."}:{valid:!1,error:"Authentication failed: "+(t.message||"Unknown error")}}},"validate")}),Pd=ke.CustomAuth({displayName:"Cloudflare AI Gateway",description:"Route Mistral calls through your Cloudflare AI Gateway. Provide a Mistral API key (key-in-request mode) or leave it blank if your gateway has Mistral configured as a stored key (BYOK).",required:!0,props:{accountId:S.ShortText({displayName:"Cloudflare Account ID",description:"Your Cloudflare account ID (visible on the AI Gateway dashboard).",required:!0}),gatewayId:S.ShortText({displayName:"Gateway ID",description:"The slug of your AI Gateway (visible on the gateway settings page).",required:!0}),gatewayAuthToken:ke.SecretText({displayName:"Gateway Auth Token",description:"Optional. Required only if your gateway has authentication enabled. Sent as cf-aig-authorization.",required:!1}),mistralApiKey:ke.SecretText({displayName:"Mistral API Key",description:"Optional. Provide your Mistral key for key-in-request mode. Leave blank if Cloudflare injects the key via stored credentials (BYOK).",required:!1})},validate:o(async({auth:e})=>{let{accountId:t,gatewayId:r,gatewayAuthToken:n,mistralApiKey:i}=e;try{return await J.sendRequest({method:"GET",url:`https://gateway.ai.cloudflare.com/v1/${encodeURIComponent(t)}/${encodeURIComponent(r)}/mistral/v1/models`,headers:bd({gatewayAuthToken:n,mistralApiKey:i})}),{valid:!0}}catch(u){let c=u.response?.status;return c===401||c===403?{valid:!1,error:"Authentication rejected by the gateway. Check your Mistral key and gateway auth token."}:c===404?{valid:!1,error:"Gateway not found. Check your account ID and gateway ID."}:c===429?{valid:!1,error:"Rate limit exceeded at the gateway. Please wait and try again."}:{valid:!1,error:"Gateway validation failed: "+(u.message||"Unknown error")}}},"validate")}),Q=[_d,Pd];function bd({gatewayAuthToken:e,mistralApiKey:t}){let r={};return e&&(r["cf-aig-authorization"]=`Bearer ${e}`),t&&(r.Authorization=`Bearer ${t}`),r}o(bd,"buildGatewayHeaders");function Id(e){return e.type==="CUSTOM_AUTH"}o(Id,"isGatewayAuth");function Td(e){let t=e;if(Id(t)){let{accountId:r,gatewayId:n,gatewayAuthToken:i,mistralApiKey:u}=t.props,c={};return i&&(c["cf-aig-authorization"]=`Bearer ${i}`),u&&(c.Authorization=`Bearer ${u}`),{baseUrl:`https://gateway.ai.cloudflare.com/v1/${encodeURIComponent(r)}/${encodeURIComponent(n)}/mistral/v1`,headers:c}}return{baseUrl:"https://api.mistral.ai/v1",headers:{Authorization:`Bearer ${t.secret_text}`}}}o(Td,"getConfig");var ee={getConfig:Td};var js=S.Dropdown({displayName:"Model",description:"Select a Mistral model. List is fetched live from your account.",required:!0,refreshers:[],auth:Q,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Please connect your account first.",options:[]};try{let{baseUrl:t,headers:r}=ee.getConfig(e),u=((await J.sendRequest({method:"GET",url:`${t}/models`,headers:r})).body.data||[]).map(c=>({label:c.name||c.id,value:c.id}));return u.length===0?{disabled:!0,placeholder:"No models found for your account.",options:[]}:{disabled:!1,options:u}}catch{return{disabled:!0,placeholder:"Failed to load models. Check your API key and network.",options:[]}}},"options")});function ie(e){return e.response?.data?.error?e.response.data.error:e.response?.data?.message?e.response.data.message:e.message?e.message:"Unknown error"}o(ie,"parseMistralError");var Ls=ae({audience:"both",auth:Q,name:"create_chat_completion",displayName:"Ask Mistral",description:"Ask Mistral anything you want!",aiMetadata:{description:"Sends one user prompt to a Mistral chat model through the chat-completions endpoint and returns only the assistant text of the first choice, with optional temperature, top-p, max-token and random-seed controls; it is stateless, with no conversation memory or system message. This is the piece's only text-generation action - prefer Create Embeddings when you need vectors rather than prose, and Run OCR when the text must be pulled out of a PDF or image instead of generated. Requires a model id from the account's live model list and a question; not idempotent: each call bills a fresh completion and the wording varies unless a random seed is pinned.",idempotent:!1},props:{model:js,prompt:S.LongText({displayName:"Question",required:!0}),temperature:S.Number({displayName:"Temperature",required:!1,defaultValue:1,description:"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive."}),top_p:S.Number({displayName:"Top P",required:!1,defaultValue:1,description:"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered."}),max_tokens:S.Number({displayName:"Max Tokens",required:!1}),random_seed:S.Number({displayName:"Random Seed",required:!1}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:3e4})},async run(e){let{model:t,temperature:r,top_p:n,max_tokens:i,random_seed:u,timeout:c,prompt:l}=e.propsValue,{baseUrl:f,headers:y}=ee.getConfig(e.auth),_={model:t,messages:[{content:l,role:"user"}],temperature:r,top_p:n,max_tokens:i,random_seed:u},I;for(let x=0;x<=3;++x)try{return(await J.sendRequest({method:"POST",url:`${f}/chat/completions`,headers:y,body:_,timeout:c??3e4})).body.choices[0].message.content}catch(s){I=s;let d=s.response?.status;if((d===429||d&&d>=500&&d<600)&&x<3){await new Promise(g=>setTimeout(g,1e3*(x+1)));continue}throw new Error(ie(s))}throw new Error(ie(I))}});var Fs=ae({audience:"both",auth:Q,name:"create_embeddings",displayName:"Create Embeddings",description:"Creates new embedding in Mistral AI.",aiMetadata:{description:"Converts an array of text strings into numeric embedding vectors using Mistral's fixed mistral-embed model; the model is not selectable here, unlike the sibling Ask Mistral action, and a whole batch of strings is embedded in one call. Use it for semantic search, similarity, or clustering pipelines, and pick Ask Mistral when you need generated prose rather than numbers. Requires a non-empty array of input strings; idempotent: nothing is created server-side and the same input yields the same vectors.",idempotent:!0},props:{input:S.Array({displayName:"Input",description:"The input text for which to create an embedding.",required:!0}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:3e4})},async run(e){let{input:t,timeout:r}=e.propsValue,{baseUrl:n,headers:i}=ee.getConfig(e.auth),u=[];try{if(typeof t=="string")try{u=JSON.parse(t)}catch{u=t}u=t}catch{throw new Error("Input must be a non-empty string or a JSON array of non-empty strings")}let c={model:"mistral-embed",input:u},l;for(let f=0;f<=3;++f)try{return(await J.sendRequest({method:"POST",url:`${n}/embeddings`,headers:i,body:c,timeout:r??3e4})).body}catch(y){l=y;let _=y.response?.status;if((_===429||_&&_>=500&&_<600)&&f<3){await new Promise(I=>setTimeout(I,1e3*(f+1)));continue}throw new Error(ie(y))}throw new Error(ie(l))}});var Zs=Re(pn());var Bs=["fine-tune","batch","ocr"],Ed=512*1024*1024,$d=["jsonl","txt","csv","pdf","docx","png","jpg","jpeg","mp3","mp4"];function Sd(e){let t=e.split(".");return t.length>1?t.pop().toLowerCase():""}o(Sd,"getFileExtension");var Vs=ae({audience:"both",auth:Q,name:"upload_file",displayName:"Upload File",description:"Upload a file to Mistral AI (e.g., for fine-tuning or context storage).",aiMetadata:{description:"Stores a file in the connected Mistral account and returns its file id, tagged with a purpose of fine-tune, batch, or ocr that decides what the id may later be used for. Run it before Run OCR whenever the document is a step attachment rather than a public URL: upload with purpose=ocr and feed the returned id into that action. Rejects files above 512MB or with an extension outside jsonl, txt, csv, pdf, docx, png, jpg, jpeg, mp3, mp4; not idempotent: each call stores another copy and returns a new id.",idempotent:!1},props:{file:S.File({displayName:"File",description:"The file to upload (max 512MB).For fine tuning purspose provide .jsonl file.",required:!0}),purpose:S.StaticDropdown({displayName:"Purpose",description:"Purpose of the file.",required:!0,options:{options:Bs.map(e=>({label:e,value:e}))}})},async run(e){let{file:t,purpose:r}=e.propsValue;if(!t)throw new Error("File is required");if(!Bs.includes(r))throw new Error("Invalid purpose");if(t.data.byteLength>Ed)throw new Error("File exceeds 512MB limit");let n=Sd(t.filename);if(!$d.includes(n))throw new Error(`File extension .${n} is not allowed`);let{baseUrl:i,headers:u}=ee.getConfig(e.auth),c=new Zs.default;c.append("file",Buffer.from(t.data),t.filename),c.append("purpose",r);try{return(await J.sendRequest({method:"POST",url:`${i}/files`,headers:{...u,...c.getHeaders()},body:c})).body}catch(l){throw new Error(ie(l))}}});var Ad=[{label:"mistral-ocr-latest (Recommended)",value:"mistral-ocr-latest"},{label:"mistral-ocr-2505",value:"mistral-ocr-2505"}],Gs=ae({audience:"both",auth:Q,name:"run_ocr",displayName:"Run OCR",description:"Extract text from PDFs and images using mistral-ocr-latest. To OCR a file from a previous step, run Upload File first (with purpose=ocr) and pass the returned id here.",aiMetadata:{description:"Extracts the text of a PDF or image as Markdown with a Mistral OCR model, taking the document either from a public URL or from a Mistral file id (that mode first resolves a short-lived signed URL); optional zero-based page indices narrow the run and embedded images can come back as base64. Pick this to read text out of a document that already exists, and Ask Mistral when the answer has to be generated or reasoned about rather than transcribed. The file-id mode only works for a file that Upload File stored with purpose=ocr, and the document type must be set to PDF or image to match the source. Read-only extraction that stores nothing, so repeat calls are idempotent.",idempotent:!0},props:{model:S.StaticDropdown({displayName:"Model",required:!0,defaultValue:"mistral-ocr-latest",options:{options:Ad}}),documentSource:S.StaticDropdown({displayName:"Document Source",description:"Where the document or image to OCR comes from.",required:!0,defaultValue:"url",options:{options:[{label:"URL",value:"url"},{label:"Mistral file ID (uploaded earlier with purpose=ocr)",value:"fileId"}]}}),sourceFields:S.DynamicProperties({displayName:"Document",required:!0,refreshers:["documentSource"],auth:ke.None(),props:o(async e=>e.documentSource==="fileId"?{fileId:S.ShortText({displayName:"File ID",description:"A Mistral file ID returned from a prior Upload File step (purpose=ocr).",required:!0}),documentType:Hs()}:{documentUrl:S.ShortText({displayName:"URL",description:"Public URL of the PDF or image to OCR.",required:!0}),documentType:Hs()},"props")}),pages:S.Array({displayName:"Pages",description:"Optional zero-based page indices to process. Leave empty for all pages.",required:!1}),includeImageBase64:S.Checkbox({displayName:"Include Image Base64",description:"Return embedded images encoded as base64 alongside the Markdown.",required:!1,defaultValue:!1}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:12e4})},async run(e){let{model:t,documentSource:r,sourceFields:n,pages:i,includeImageBase64:u,timeout:c}=e.propsValue,l=ee.getConfig(e.auth),f=await zd({source:r,fields:n,config:l,timeout:c??12e4}),y={model:t,document:f},_=wd(i);_&&(y.pages=_),u&&(y.include_image_base64=!0);let I;for(let x=0;x<=3;++x)try{let s=await J.sendRequest({method:"POST",url:`${l.baseUrl}/ocr`,headers:{...l.headers,"Content-Type":"application/json"},body:y,timeout:c??12e4}),d=(s.body.pages??[]).map(g=>g.markdown??"").join(`
|
|
1
|
+
"use strict";var ru=Object.create;var Qe=Object.defineProperty;var nu=Object.getOwnPropertyDescriptor;var ou=Object.getOwnPropertyNames;var iu=Object.getPrototypeOf,au=Object.prototype.hasOwnProperty;var o=(e,t)=>Qe(e,"name",{value:t,configurable:!0});var E=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},yn=(e,t)=>{for(var r in t)Qe(e,r,{get:t[r],enumerable:!0})},hn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ou(t))!au.call(e,i)&&i!==r&&Qe(e,i,{get:()=>t[i],enumerable:!(n=nu(t,i))||n.enumerable});return e};var Ne=(e,t,r)=>(r=e!=null?ru(iu(e)):{},hn(t||!e||!e.__esModule?Qe(r,"default",{value:e,enumerable:!0}):r,e)),su=e=>hn(Qe({},"__esModule",{value:!0}),e);var Fo=E((jo,Ht)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",c="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${c})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${c})|(?:::)(?:${c})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function f(s,d){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let g=0,m=-1,v=(s.match(l.zoneIndex)||[])[0],_,L;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)g++;if(s.substr(0,2)==="::"&&g--,s.substr(-2,2)==="::"&&g--,g>d)return null;for(L=d-g,_=":";L--;)_+="0:";return s=s.replace("::",_),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),d=(function(){let re=s.split(":"),ue=[];for(let Ye=0;Ye<re.length;Ye++)ue.push(parseInt(re[Ye],16));return ue})(),{parts:d,zoneId:v}}o(f,"expandIPv6");function y(s,d,g,m){if(s.length!==d.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,_;for(;m>0;){if(_=g-m,_<0&&(_=0),s[v]>>_!==d[v]>>_)return!1;m-=g,v+=1}return!0}o(y,"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 x={};x.IPv4=(function(){function s(d){if(d.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let g,m;for(g=0;g<d.length;g++)if(m=d[g],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=d}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return y(this.octets,d.octets,8,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,_,L;for(v=3;v>=0;v-=1)if(_=this.octets[v],_ in m){if(L=m[_],g&&L!==0)return null;L!==8&&(g=!0),d+=L}else return null;return 32-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s})(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<4;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let d=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!d?!1:x.IPv4.isValidFourPartDecimal(d[1])},x.IPv4.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<4;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let d=this.parser(s);if(d===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(d)},x.IPv4.parseCIDR=function(s){let d;if(d=s.match(/^(.+)\/(\d+)$/)){let g=parseInt(d[2]);if(g>=0&&g<=32){let m=[this.parse(d[1]),g];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let d,g,m;if(d=s.match(r.fourOctet))return(function(){let v=d.slice(1,6),_=[];for(let L=0;L<v.length;L++)g=v[L],_.push(P(g));return _})();if(d=s.match(r.longValue)){if(m=P(d[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){let v=[],_;for(_=0;_<=24;_+=8)v.push(m>>_&255);return v})().reverse()}else return(d=s.match(r.twoOctet))?(function(){let v=d.slice(1,4),_=[];if(m=P(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(m>>16&255),_.push(m>>8&255),_.push(m&255),_})():(d=s.match(r.threeOctet))?(function(){let v=d.slice(1,5),_=[];if(m=P(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return _.push(P(v[0])),_.push(P(v[1])),_.push(m>>8&255),_.push(m&255),_})():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let d=[0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<4&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.IPv6=(function(){function s(d,g){let m,v;if(d.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(d[m]<<8|d[m+1]);else if(d.length===8)this.parts=d;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");g&&(this.zoneId=g)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(d,g){let m;if(g===void 0&&(m=d,d=m[0],g=m[1]),d.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return y(this.parts,d.parts,16,g)},s.prototype.prefixLengthFromSubnetMask=function(){let d=0,g=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,_;for(let L=7;L>=0;L-=1)if(v=this.parts[L],v in m){if(_=m[v],g&&_!==0)return null;_!==16&&(g=!0),d+=_}else return null;return 128-d},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let d,g=[],m=this.parts;for(let v=0;v<m.length;v++)d=m[v],g.push(d>>8),g.push(d&255);return g},s.prototype.toFixedLengthString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(I(this.parts[v].toString(16),4));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let d=this.parts.slice(-2),g=d[0],m=d[1];return new x.IPv4([g>>8,g&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let d=(function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}).call(this).join(":"),g="";return this.zoneId&&(g=`%${this.zoneId}`),d+g},s.prototype.toRFC5952String=function(){let d=/((^|:)(0(:|$)){2,})/g,g=this.toNormalizedString(),m=0,v=-1,_;for(;_=d.exec(g);)_[0].length>v&&(m=_.index,v=_[0].length);return v<0?g:`${g.substring(0,m)}::${g.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s})(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let d=this.parseCIDR(s),g=d[0].toByteArray(),m=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],_=0;for(;_<16;)v.push(parseInt(g[_],10)|parseInt(m[_],10)^255),_++;return new this(v)}catch(d){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${d})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let d=this.parser(s);return new this(d.parts,d.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let d,g,m,v,_;try{for(d=this.parseCIDR(s),m=d[0].toByteArray(),_=this.subnetMaskFromPrefixLength(d[1]).toByteArray(),v=[],g=0;g<16;)v.push(parseInt(m[g],10)&parseInt(_[g],10)),g++;return new this(v)}catch(L){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${L})`)}},x.IPv6.parse=function(s){let d=this.parser(s);if(d.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(d.parts,d.zoneId)},x.IPv6.parseCIDR=function(s){let d,g,m;if((g=s.match(/^(.+)\/(\d+)$/))&&(d=parseInt(g[2]),d>=0&&d<=128))return m=[this.parse(g[1]),d],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let d,g,m,v,_,L;if(m=s.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(s))return f(s,8);if((m=s.match(l.transitional))&&(L=m[6]||"",d=m[1],m[1].endsWith("::")||(d=d.slice(0,-1)),d=f(d+L,6),d.parts)){for(_=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],g=0;g<_.length;g++)if(v=_[g],!(0<=v&&v<=255))return null;return d.parts.push(_[0]<<8|_[1]),d.parts.push(_[2]<<8|_[3]),{parts:d.parts,zoneId:d.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],g=0,m=Math.floor(s/8);for(;g<m;)d[g]=255,g++;return m<16&&(d[m]=Math.pow(2,s%8)-1<<8-s%8),new this(d)},x.fromByteArray=function(s){let d=s.length;if(d===4)return new x.IPv4(s);if(d===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let d=this.parse(s);return d.kind()==="ipv6"&&d.isIPv4MappedAddress()?d.toIPv4Address():d},x.subnetMatch=function(s,d,g){let m,v,_,L;g==null&&(g="unicast");for(v in d)if(Object.prototype.hasOwnProperty.call(d,v)){for(_=d[v],_[0]&&!(_[0]instanceof Array)&&(_=[_]),m=0;m<_.length;m++)if(L=_[m],s.kind()===L[0].kind()&&s.match.apply(s,L))return v}return g},typeof Ht<"u"&&Ht.exports?Ht.exports=x:e.ipaddr=x})(jo)});var Fi=E((OA,ji)=>{var Li=require("stream").Stream,Zl=require("util");ji.exports=pe;function pe(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(pe,"DelayedStream");Zl.inherits(pe,Li);pe.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(pe.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});pe.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};pe.prototype.resume=function(){this._released||this.release(),this.source.resume()};pe.prototype.pause=function(){this.source.pause()};pe.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};pe.prototype.pipe=function(){var e=Li.prototype.pipe.apply(this,arguments);return this.resume(),e};pe.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)};pe.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Hi=E((wA,Vi)=>{var Vl=require("util"),Zi=require("stream").Stream,Bi=Fi();Vi.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(q,"CombinedStream");Vl.inherits(q,Zi);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Bi)){var r=Bi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};q.prototype.pipe=function(e,t){return Zi.prototype.pipe.call(this,e,t),this.resume(),e};q.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};q.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var qi=E((NA,Gi)=>{"use strict";Gi.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Ji=E(te=>{"use strict";var Jt=qi(),Hl=require("path").extname,Wi=/^\s*([^;\s]*)(?:;|\s|$)/,Gl=/^text\//i;te.charset=Ki;te.charsets={lookup:Ki};te.contentType=ql;te.extension=Wl;te.extensions=Object.create(null);te.lookup=Kl;te.types=Object.create(null);Jl(te.extensions,te.types);function Ki(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&Jt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Gl.test(t[1])?"UTF-8":!1}o(Ki,"charset");function ql(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(ql,"contentType");function Wl(e){if(!e||typeof e!="string")return!1;var t=Wi.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Wl,"extension");function Kl(e){if(!e||typeof e!="string")return!1;var t=Hl("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Kl,"lookup");function Jl(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Jt).forEach(o(function(i){var u=Jt[i],c=u.extensions;if(!(!c||!c.length)){e[i]=c;for(var l=0;l<c.length;l++){var f=c[l];if(t[f]){var y=r.indexOf(Jt[t[f]].source),P=r.indexOf(u.source);if(t[f]!=="application/octet-stream"&&(y>P||y===P&&t[f].substr(0,12)==="application/"))continue}t[f]=i}}},"forEachMimeType"))}o(Jl,"populateMaps")});var Yi=E((UA,Xi)=>{Xi.exports=Xl;function Xl(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Xl,"defer")});var Hr=E((LA,ea)=>{var Qi=Yi();ea.exports=Yl;function Yl(e){var t=!1;return Qi(function(){t=!0}),o(function(n,i){t?e(n,i):Qi(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(Yl,"async")});var Gr=E((FA,ta)=>{ta.exports=Ql;function Ql(e){Object.keys(e.jobs).forEach(ep.bind(e)),e.jobs={}}o(Ql,"abort");function ep(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(ep,"clean")});var qr=E((ZA,na)=>{var ra=Hr(),tp=Gr();na.exports=rp;function rp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=np(t,i,e[i],function(u,c){i in r.jobs&&(delete r.jobs[i],u?tp(r):r.results[i]=c,n(u,r.results))})}o(rp,"iterate");function np(e,t,r,n){var i;return e.length==2?i=e(r,ra(n)):i=e(r,t,ra(n)),i}o(np,"runJob")});var Wr=E((HA,oa)=>{oa.exports=op;function op(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(op,"state")});var Kr=E((qA,ia)=>{var ip=Gr(),ap=Hr();ia.exports=sp;function sp(e){Object.keys(this.jobs).length&&(this.index=this.size,ip(this),ap(e)(null,this.results))}o(sp,"terminator")});var sa=E((KA,aa)=>{var up=qr(),cp=Wr(),lp=Kr();aa.exports=pp;function pp(e,t,r){for(var n=cp(e);n.index<(n.keyedList||e).length;)up(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 lp.bind(n,r)}o(pp,"parallel")});var Jr=E((XA,Xt)=>{var ua=qr(),dp=Wr(),mp=Kr();Xt.exports=fp;Xt.exports.ascending=ca;Xt.exports.descending=gp;function fp(e,t,r,n){var i=dp(e,r);return ua(e,t,i,o(function u(c,l){if(c){n(c,l);return}if(i.index++,i.index<(i.keyedList||e).length){ua(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),mp.bind(i,n)}o(fp,"serialOrdered");function ca(e,t){return e<t?-1:e>t?1:0}o(ca,"ascending");function gp(e,t){return-1*ca(e,t)}o(gp,"descending")});var pa=E((QA,la)=>{var yp=Jr();la.exports=hp;function hp(e,t,r){return yp(e,t,null,r)}o(hp,"serial")});var ma=E((tz,da)=>{da.exports={parallel:sa(),serial:pa(),serialOrdered:Jr()}});var Xr=E((rz,fa)=>{"use strict";fa.exports=Object});var ya=E((nz,ga)=>{"use strict";ga.exports=Error});var va=E((oz,ha)=>{"use strict";ha.exports=EvalError});var Pa=E((iz,xa)=>{"use strict";xa.exports=RangeError});var ba=E((az,_a)=>{"use strict";_a.exports=ReferenceError});var Ta=E((sz,Ia)=>{"use strict";Ia.exports=SyntaxError});var Yt=E((uz,Ea)=>{"use strict";Ea.exports=TypeError});var Sa=E((cz,$a)=>{"use strict";$a.exports=URIError});var za=E((lz,Aa)=>{"use strict";Aa.exports=Math.abs});var ka=E((pz,Oa)=>{"use strict";Oa.exports=Math.floor});var Ra=E((dz,wa)=>{"use strict";wa.exports=Math.max});var Da=E((mz,Na)=>{"use strict";Na.exports=Math.min});var Ua=E((fz,Ca)=>{"use strict";Ca.exports=Math.pow});var La=E((gz,Ma)=>{"use strict";Ma.exports=Math.round});var Fa=E((yz,ja)=>{"use strict";ja.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Za=E((vz,Ba)=>{"use strict";var vp=Fa();Ba.exports=o(function(t){return vp(t)||t===0?t:t<0?-1:1},"sign")});var Ha=E((Pz,Va)=>{"use strict";Va.exports=Object.getOwnPropertyDescriptor});var Yr=E((_z,Ga)=>{"use strict";var Qt=Ha();if(Qt)try{Qt([],"length")}catch{Qt=null}Ga.exports=Qt});var Wa=E((bz,qa)=>{"use strict";var er=Object.defineProperty||!1;if(er)try{er({},"a",{value:1})}catch{er=!1}qa.exports=er});var Qr=E((Iz,Ka)=>{"use strict";Ka.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var c=Object.getOwnPropertySymbols(t);if(c.length!==1||c[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,r);if(l.value!==i||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ya=E((Ez,Xa)=>{"use strict";var Ja=typeof Symbol<"u"&&Symbol,xp=Qr();Xa.exports=o(function(){return typeof Ja!="function"||typeof Symbol!="function"||typeof Ja("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:xp()},"hasNativeSymbols")});var en=E((Sz,Qa)=>{"use strict";Qa.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var tn=E((Az,es)=>{"use strict";var Pp=Xr();es.exports=Pp.getPrototypeOf||null});var ns=E((zz,rs)=>{"use strict";var _p="Function.prototype.bind called on incompatible ",bp=Object.prototype.toString,Ip=Math.max,Tp="[object Function]",ts=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),Ep=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"),$p=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");rs.exports=o(function(t){var r=this;if(typeof r!="function"||bp.apply(r)!==Tp)throw new TypeError(_p+r);for(var n=Ep(arguments,1),i,u=o(function(){if(this instanceof i){var P=r.apply(this,ts(n,arguments));return Object(P)===P?P:this}return r.apply(t,ts(n,arguments))},"binder"),c=Ip(0,r.length-n.length),l=[],f=0;f<c;f++)l[f]="$"+f;if(i=Function("binder","return function ("+$p(l,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var y=o(function(){},"Empty");y.prototype=r.prototype,i.prototype=new y,y.prototype=null}return i},"bind")});var qe=E((kz,os)=>{"use strict";var Sp=ns();os.exports=Function.prototype.bind||Sp});var tr=E((wz,is)=>{"use strict";is.exports=Function.prototype.call});var rn=E((Rz,as)=>{"use strict";as.exports=Function.prototype.apply});var us=E((Nz,ss)=>{"use strict";ss.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ls=E((Dz,cs)=>{"use strict";var Ap=qe(),zp=rn(),Op=tr(),kp=us();cs.exports=kp||Ap.call(Op,zp)});var ds=E((Cz,ps)=>{"use strict";var wp=qe(),Rp=Yt(),Np=tr(),Dp=ls();ps.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new Rp("a function is required");return Dp(wp,Np,t)},"callBindBasic")});var vs=E((Mz,hs)=>{"use strict";var Cp=ds(),ms=Yr(),gs;try{gs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var nn=!!gs&&ms&&ms(Object.prototype,"__proto__"),ys=Object,fs=ys.getPrototypeOf;hs.exports=nn&&typeof nn.get=="function"?Cp([nn.get]):typeof fs=="function"?o(function(t){return fs(t==null?t:ys(t))},"getDunder"):!1});var Is=E((jz,bs)=>{"use strict";var xs=en(),Ps=tn(),_s=vs();bs.exports=xs?o(function(t){return xs(t)},"getProto"):Ps?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Ps(t)},"getProto"):_s?o(function(t){return _s(t)},"getProto"):null});var on=E((Bz,Ts)=>{"use strict";var Up=Function.prototype.call,Mp=Object.prototype.hasOwnProperty,Lp=qe();Ts.exports=Lp.call(Up,Mp)});var ks=E((Zz,Os)=>{"use strict";var M,jp=Xr(),Fp=ya(),Bp=va(),Zp=Pa(),Vp=ba(),Xe=Ta(),Je=Yt(),Hp=Sa(),Gp=za(),qp=ka(),Wp=Ra(),Kp=Da(),Jp=Ua(),Xp=La(),Yp=Za(),As=Function,an=o(function(e){try{return As('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),_t=Yr(),Qp=Wa(),sn=o(function(){throw new Je},"throwTypeError"),ed=_t?(function(){try{return arguments.callee,sn}catch{try{return _t(arguments,"callee").get}catch{return sn}}})():sn,We=Ya()(),X=Is(),td=tn(),rd=en(),zs=rn(),bt=tr(),Ke={},nd=typeof Uint8Array>"u"||!X?M:X(Uint8Array),Le={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":We&&X?X([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":Ke,"%AsyncGenerator%":Ke,"%AsyncGeneratorFunction%":Ke,"%AsyncIteratorPrototype%":Ke,"%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%":Fp,"%eval%":eval,"%EvalError%":Bp,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":As,"%GeneratorFunction%":Ke,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":We&&X?X(X([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!We||!X?M:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":jp,"%Object.getOwnPropertyDescriptor%":_t,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":Zp,"%ReferenceError%":Vp,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!We||!X?M:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":We&&X?X(""[Symbol.iterator]()):M,"%Symbol%":We?Symbol:M,"%SyntaxError%":Xe,"%ThrowTypeError%":ed,"%TypedArray%":nd,"%TypeError%":Je,"%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%":Hp,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":bt,"%Function.prototype.apply%":zs,"%Object.defineProperty%":Qp,"%Object.getPrototypeOf%":td,"%Math.abs%":Gp,"%Math.floor%":qp,"%Math.max%":Wp,"%Math.min%":Kp,"%Math.pow%":Jp,"%Math.round%":Xp,"%Math.sign%":Yp,"%Reflect.getPrototypeOf%":rd};if(X)try{null.error}catch(e){Es=X(X(e)),Le["%Error.prototype%"]=Es}var Es,od=o(function e(t){var r;if(t==="%AsyncFunction%")r=an("async function () {}");else if(t==="%GeneratorFunction%")r=an("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=an("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&X&&(r=X(i.prototype))}return Le[t]=r,r},"doEval"),$s={__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"]},It=qe(),rr=on(),id=It.call(bt,Array.prototype.concat),ad=It.call(zs,Array.prototype.splice),Ss=It.call(bt,String.prototype.replace),nr=It.call(bt,String.prototype.slice),sd=It.call(bt,RegExp.prototype.exec),ud=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cd=/\\(\\)?/g,ld=o(function(t){var r=nr(t,0,1),n=nr(t,-1);if(r==="%"&&n!=="%")throw new Xe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Xe("invalid intrinsic syntax, expected opening `%`");var i=[];return Ss(t,ud,function(u,c,l,f){i[i.length]=l?Ss(f,cd,"$1"):c||u}),i},"stringToPath"),pd=o(function(t,r){var n=t,i;if(rr($s,n)&&(i=$s[n],n="%"+i[0]+"%"),rr(Le,n)){var u=Le[n];if(u===Ke&&(u=od(n)),typeof u>"u"&&!r)throw new Je("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new Xe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");Os.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new Je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Je('"allowMissing" argument must be a boolean');if(sd(/^%?[^%]*%?$/,t)===null)throw new Xe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=ld(t),i=n.length>0?n[0]:"",u=pd("%"+i+"%",r),c=u.name,l=u.value,f=!1,y=u.alias;y&&(i=y[0],ad(n,id([0,1],y)));for(var P=1,I=!0;P<n.length;P+=1){var x=n[P],s=nr(x,0,1),d=nr(x,-1);if((s==='"'||s==="'"||s==="`"||d==='"'||d==="'"||d==="`")&&s!==d)throw new Xe("property names with quotes must have matching quotes");if((x==="constructor"||!I)&&(f=!0),i+="."+x,c="%"+i+"%",rr(Le,c))l=Le[c];else if(l!=null){if(!(x in l)){if(!r)throw new Je("base intrinsic for "+t+" exists, but the property is not available.");return}if(_t&&P+1>=n.length){var g=_t(l,x);I=!!g,I&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[x]}else I=rr(l,x),l=l[x];I&&!f&&(Le[c]=l)}}return l},"GetIntrinsic")});var Rs=E((Hz,ws)=>{"use strict";var dd=Qr();ws.exports=o(function(){return dd()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Cs=E((qz,Ds)=>{"use strict";var md=ks(),Ns=md("%Object.defineProperty%",!0),fd=Rs()(),gd=on(),yd=Yt(),or=fd?Symbol.toStringTag:null;Ds.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new yd("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");or&&(n||!gd(t,or))&&(Ns?Ns(t,or,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[or]=r)},"setToStringTag")});var Ms=E((Kz,Us)=>{"use strict";var hd=Function.prototype.call,vd=Object.prototype.hasOwnProperty,xd=qe();Us.exports=xd.call(hd,vd)});var js=E((Jz,Ls)=>{"use strict";Ls.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var dn=E((Xz,Bs)=>{"use strict";var pn=Hi(),Pd=require("util"),un=require("path"),_d=require("http"),bd=require("https"),Id=require("url").parse,Td=require("fs"),Ed=require("stream").Stream,$d=require("crypto"),cn=Ji(),Sd=ma(),Ad=Cs(),Re=Ms(),ln=js();function Fs(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(Fs,"escapeHeaderParam");function j(e){if(!(this instanceof j))return new j(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],pn.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(j,"FormData");Pd.inherits(j,pn);j.LINE_BREAK=`\r
|
|
2
|
+
`;j.DEFAULT_CONTENT_TYPE="application/octet-stream";j.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=pn.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};j.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+j.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&Re(t,"httpVersion"))&&!(t instanceof Ed))&&(r.knownLength||this._valuesToMeasure.push(t))};j.prototype._lengthRetriever=function(e,t){Re(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):Td.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):Re(e,"httpVersion")?t(null,Number(e.headers["content-length"])):Re(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};j.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",c={"Content-Disposition":["form-data",'name="'+Fs(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&ln(c,r.header);var l;for(var f in c)if(Re(c,f)){if(l=c[f],l==null)continue;Array.isArray(l)||(l=[l]),l.length&&(u+=f+": "+l.join("; ")+j.LINE_BREAK)}return"--"+this.getBoundary()+j.LINE_BREAK+u+j.LINE_BREAK};j.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=un.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=un.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&Re(e,"httpVersion")&&(r=un.basename(e.client._httpMessage.path||"")),r)return'filename="'+Fs(r)+'"'};j.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=cn.lookup(e.name)),!r&&e&&e.path&&(r=cn.lookup(e.path)),!r&&e&&e.readable&&Re(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=cn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=j.DEFAULT_CONTENT_TYPE),r};j.prototype._multiPartFooter=function(){return function(e){var t=j.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};j.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+j.LINE_BREAK};j.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)Re(e,t)&&(r[t.toLowerCase()]=e[t]);return r};j.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};j.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};j.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(j.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};j.prototype._generateBoundary=function(){this._boundary="--------------------------"+$d.randomBytes(12).toString("hex")};j.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};j.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};j.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}Sd.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};j.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=Id(e),n=ln({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=ln(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=bd.request(n):r=_d.request(n),this.getLength(function(u,c){if(u&&u!=="Unknown stream"){this._error(u);return}if(c&&r.setHeader("Content-Length",c),this.pipe(r),t){var l,f=o(function(y,P){return r.removeListener("error",f),r.removeListener("response",l),t.call(this,y,P)},"callback");l=f.bind(this,null),r.on("error",f),r.on("response",l)}}.bind(this)),r};j.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};j.prototype.toString=function(){return"[object FormData]"};Ad(j.prototype,"FormData");Bs.exports=j});var Kd={};yn(Kd,{mistralAi:()=>Wd});module.exports=su(Kd);var uu=Object.freeze({status:"aborted"});function b(e,t,r){function n(l,f){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:f,constr:c,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,f);let y=c.prototype,P=Object.keys(y);for(let I=0;I<P.length;I++){let x=P[I];x in l||(l[x]=y[x].bind(l))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function c(l){var f;let y=r?.Parent?new u:this;n(y,l),(f=y._zod).deferred??(f.deferred=[]);for(let P of y._zod.deferred)P();return y}return o(c,"_"),Object.defineProperty(c,"init",{value:n}),Object.defineProperty(c,Symbol.hasInstance,{value:o(l=>r?.Parent&&l instanceof r.Parent?!0:l?._zod?.traits?.has(e),"value")}),Object.defineProperty(c,"name",{value:e}),c}o(b,"$constructor");var de=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Et=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},ar={};function he(e){return e&&Object.assign(ar,e),ar}o(he,"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 xn(e,t){return typeof t=="bigint"?t.toString():t}o(xn,"jsonStringifyReplacer");function St(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(St,"cached");function Pn(e){return e==null}o(Pn,"nullish");function At(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(At,"cleanRegex");var vn=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==vn)return n===void 0&&(n=vn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(W,"defineLazy");var cr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(et,"isObject");var cu=St(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(et(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var bn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(je,"escapeRegex");function zt(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(zt,"clone");function Z(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(Z,"normalizeParams");function In(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(In,"optionalKeys");var Tn={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 Fe(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(Fe,"aborted");function Te(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(Te,"prefixIssues");function $t(e){return typeof e=="string"?e:e?.message}o($t,"unwrapMessage");function Ee(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(Ee,"finalizeIssue");function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(En,"getLengthableOrigin");function lr(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(lr,"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,xn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),Sn=b("$ZodError",$n),tt=b("$ZodError",$n,{Parent:Error});var pu=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 de;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map(f=>Ee(f,u,he())));throw cr(l,i?.callee),l}return c.value},"_parse"),Ot=pu(tt),du=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=>Ee(f,u,he())));throw cr(l,i?.callee),l}return c.value},"_parseAsync"),kt=du(tt),mu=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 de;return u.issues.length?{success:!1,error:new(e??Sn)(u.issues.map(c=>Ee(c,i,he())))}:{success:!0,data:u.value}},"_safeParse"),rt=mu(tt),fu=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=>Ee(c,i,he())))}:{success:!0,data:u.value}},"_safeParseAsync"),nt=fu(tt);var gu="(?:(?:\\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])))",yu=new RegExp(`^${gu}$`);var An=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),zn=/^-?\d+n?$/,On=/^-?\d+$/,pr=/^-?\d+(?:\.\d+)?$/,kn=/^(?:true|false)$/i;var $e=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),hu={number:"number",bigint:"bigint",object:"date"};var wn=b("$ZodCheckGreaterThan",(e,t)=>{$e.init(e,t);let r=hu[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 Rn=b("$ZodCheckNumberFormat",(e,t)=>{$e.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,u]=Tn[t.format];e._zod.onattach.push(c=>{let l=c._zod.bag;l.format=t.format,l.minimum=i,l.maximum=u,r&&(l.pattern=On)}),e._zod.check=c=>{let l=c.value;if(r){if(!Number.isInteger(l)){c.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?c.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):c.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}l<i&&c.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>u&&c.issues.push({origin:"number",input:l,code:"too_big",maximum:u,inclusive:!0,inst:e,continue:!t.abort})}});var Nn=b("$ZodCheckMinLength",(e,t)=>{var r;$e.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!Pn(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=En(i);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var dr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;$e.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=()=>{})}),Dn=b("$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 Un={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((c,l,f)=>{let y=Fe(c),P;for(let I of l){if(I._zod.def.when){if(!I._zod.def.when(c))continue}else if(y)continue;let x=c.issues.length,s=I._zod.check(c);if(s instanceof Promise&&f?.async===!1)throw new de;if(P||s instanceof Promise)P=(P??Promise.resolve()).then(async()=>{await s,c.issues.length!==x&&(y||(y=Fe(c,x)))});else{if(c.issues.length===x)continue;y||(y=Fe(c,x))}}return P?P.then(()=>c):c},"runChecks"),u=o((c,l,f)=>{if(Fe(c))return c.aborted=!0,c;let y=i(l,n,f);if(y instanceof Promise){if(f.async===!1)throw new de;return y.then(P=>e._zod.parse(P,f))}return e._zod.parse(y,f)},"handleCanaryResult");e._zod.run=(c,l)=>{if(l.skipChecks)return e._zod.parse(c,l);if(l.direction==="backward"){let y=e._zod.parse({value:c.value,issues:[]},{...l,skipChecks:!0});return y instanceof Promise?y.then(P=>u(P,c,l)):u(y,c,l)}let f=e._zod.parse(c,l);if(f instanceof Promise){if(l.async===!1)throw new de;return f.then(y=>i(y,n,l))}return i(f,n,l)}}W(e,"~standard",()=>({validate:o(i=>{try{let u=rt(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return nt(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Nt=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??An(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=b("$ZodStringFormat",(e,t)=>{dr.init(e,t),Nt.init(e,t)});var Bn=b("$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=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??pr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}}),Zn=b("$ZodNumberFormat",(e,t)=>{Rn.init(e,t),fr.init(e,t)}),gr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=kn,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}}),Vn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=zn,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 Hn=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Gn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var qn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Wn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Mn(e,t,r){e.issues.length&&t.issues.push(...Te(r,e.issues)),t.value[r]=e.value}o(Mn,"handleArrayResult");var Kn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let c=0;c<i.length;c++){let l=i[c],f=t.element._zod.run({value:l,issues:[]},n);f instanceof Promise?u.push(f.then(y=>Mn(y,r,c))):Mn(f,r,c)}return u.length?Promise.all(u).then(()=>r):r}});function Rt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...Te(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(Rt,"handlePropertyResult");function vu(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=In(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(vu,"normalizeDef");function xu(e,t,r,n,i,u){let c=[],l=i.keySet,f=i.catchall._zod,y=f.def.type,P=f.optout==="optional";for(let I in t){if(l.has(I))continue;if(y==="never"){c.push(I);continue}let x=f.run({value:t[I],issues:[]},n);x instanceof Promise?e.push(x.then(s=>Rt(s,r,I,t,P))):Rt(x,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(xu,"handleCatchall");var Jn=b("$ZodObject",(e,t)=>{if(H.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=St(()=>vu(t));W(e._zod,"propValues",()=>{let l=t.shape,f={};for(let y in l){let P=l[y]._zod;if(P.values){f[y]??(f[y]=new Set);for(let I of P.values)f[y].add(I)}}return f});let i=et,u=t.catchall,c;e._zod.parse=(l,f)=>{c??(c=n.value);let y=l.value;if(!i(y))return l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l;l.value={};let P=[],I=c.shape;for(let x of c.keys){let s=I[x],d=s._zod.optout==="optional",g=s._zod.run({value:y[x],issues:[]},f);g instanceof Promise?P.push(g.then(m=>Rt(m,l,x,y,d))):Rt(g,l,x,y,d)}return u?xu(P,y,l,f,n.value,e):P.length?Promise.all(P).then(()=>l):l}});function Ln(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=>!Fe(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=>Ee(c,n,he())))}),t)}o(Ln,"handleUnionResults");var yr=b("$ZodUnion",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>At(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let c=!1,l=[];for(let f of t.options){let y=f._zod.run({value:i.value,issues:[]},u);if(y instanceof Promise)l.push(y),c=!0;else{if(y.issues.length===0)return y;l.push(y)}}return c?Promise.all(l).then(f=>Ln(f,i,e,u)):Ln(l,i,e,u)}});var Xn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yr.init(e,t);let r=e._zod.parse;W(e._zod,"propValues",()=>{let i={};for(let u of t.options){let c=u._zod.propValues;if(!c||Object.keys(c).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[l,f]of Object.entries(c)){i[l]||(i[l]=new Set);for(let y of f)i[l].add(y)}}return i});let n=St(()=>{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(!et(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 Yn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],c=t.keyType._zod.values;if(c){r.value={};let l=new Set;for(let y of c)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){l.add(typeof y=="number"?y.toString():y);let P=t.valueType._zod.run({value:i[y],issues:[]},n);P instanceof Promise?u.push(P.then(I=>{I.issues.length&&r.issues.push(...Te(y,I.issues)),r.value[y]=I.value})):(P.issues.length&&r.issues.push(...Te(y,P.issues)),r.value[y]=P.value)}let f;for(let y in i)l.has(y)||(f=f??[],f.push(y));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:f})}else{r.value={};for(let l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let f=t.keyType._zod.run({value:l,issues:[]},n);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&pr.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=>Ee(I,n,he())),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(...Te(l,I.issues)),r.value[f.value]=I.value})):(P.issues.length&&r.issues.push(...Te(l,P.issues)),r.value[f.value]=P.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Qn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=ur(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>bn.has(typeof i)).map(i=>typeof i=="string"?je(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}}),eo=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(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 to=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Et(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 de;return r.value=i,r}});function jn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(jn,"handleOptionalResult");var ro=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(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=>jn(u,r.value)):jn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var no=b("$ZodNullable",(e,t)=>{H.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${At(r.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var oo=b("$ZodPipe",(e,t)=>{H.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(c=>wt(c,t.in,n)):wt(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>wt(u,t.out,n)):wt(i,t.out,n)}});function wt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(wt,"handlePipeResult");var io=b("$ZodCustom",(e,t)=>{$e.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Fn(u,r,n,e));Fn(i,r,n,e)}});function Fn(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(lr(i))}}o(Fn,"handleRefineResult");var so;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 uo(){return new hr}o(uo,"registry");(so=globalThis).__zod_globalRegistry??(so.__zod_globalRegistry=uo());var vr=globalThis.__zod_globalRegistry;function co(e,t){return new e({type:"string",...Z(t)})}o(co,"_string");function lo(e,t){return new e({type:"string",coerce:!0,...Z(t)})}o(lo,"_coercedString");function po(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Z(t)})}o(po,"_url");function mo(e,t){return new e({type:"number",checks:[],...Z(t)})}o(mo,"_number");function fo(e,t){return new e({type:"number",coerce:!0,checks:[],...Z(t)})}o(fo,"_coercedNumber");function go(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Z(t)})}o(go,"_int");function yo(e,t){return new e({type:"boolean",...Z(t)})}o(yo,"_boolean");function ho(e,t){return new e({type:"boolean",coerce:!0,...Z(t)})}o(ho,"_coercedBoolean");function vo(e,t){return new e({type:"bigint",coerce:!0,...Z(t)})}o(vo,"_coercedBigint");function xo(e){return new e({type:"any"})}o(xo,"_any");function Po(e){return new e({type:"unknown"})}o(Po,"_unknown");function _o(e,t){return new e({type:"void",...Z(t)})}o(_o,"_void");function bo(e,t){return new e({type:"date",coerce:!0,...Z(t)})}o(bo,"_coercedDate");function Dt(e,t){return new wn({check:"greater_than",...Z(t),value:e,inclusive:!0})}o(Dt,"_gte");function ce(e,t){return new Nn({check:"min_length",...Z(t),minimum:e})}o(ce,"_minLength");function Se(e,t){return new Dn({check:"string_format",format:"regex",...Z(t),pattern:e})}o(Se,"_regex");function Io(e,t,r){let n=Z(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(Io,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>Ot(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>rt(e,r,n),e.parseAsync=async(r,n)=>kt(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>nt(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>zt(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.apply=r=>r(e)}),Ut=b("ZodMiniString",(e,t)=>{Nt.init(e,t),K.init(e,t)});function a(e){return co(Ut,e)}o(a,"string");var To=b("ZodMiniStringFormat",(e,t)=>{mr.init(e,t),Ut.init(e,t)});var wu=b("ZodMiniURL",(e,t)=>{Bn.init(e,t),To.init(e,t)});function Eo(e){return po(wu,e)}o(Eo,"url");var Mt=b("ZodMiniNumber",(e,t)=>{fr.init(e,t),K.init(e,t)});function Y(e){return mo(Mt,e)}o(Y,"number");var Ru=b("ZodMiniNumberFormat",(e,t)=>{Zn.init(e,t),Mt.init(e,t)});function $o(e){return go(Ru,e)}o($o,"int");var xr=b("ZodMiniBoolean",(e,t)=>{gr.init(e,t),K.init(e,t)});function B(e){return yo(xr,e)}o(B,"boolean");var So=b("ZodMiniBigInt",(e,t)=>{Vn.init(e,t),K.init(e,t)});var Nu=b("ZodMiniAny",(e,t)=>{Hn.init(e,t),K.init(e,t)});function it(){return xo(Nu)}o(it,"any");var Du=b("ZodMiniUnknown",(e,t)=>{Gn.init(e,t),K.init(e,t)});function k(){return Po(Du)}o(k,"unknown");var Cu=b("ZodMiniVoid",(e,t)=>{qn.init(e,t),K.init(e,t)});function Ao(e){return _o(Cu,e)}o(Ao,"_void");var zo=b("ZodMiniDate",(e,t)=>{Wn.init(e,t),K.init(e,t)});var Uu=b("ZodMiniArray",(e,t)=>{Kn.init(e,t),K.init(e,t)});function N(e,t){return new Uu({type:"array",element:e,...Z(t)})}o(N,"array");var Mu=b("ZodMiniObject",(e,t)=>{Jn.init(e,t),K.init(e,t),W(e,"shape",()=>t.shape)});function p(e,t){let r={type:"object",shape:e??{},...Z(t)};return new Mu(r)}o(p,"object");var Lu=b("ZodMiniUnion",(e,t)=>{yr.init(e,t),K.init(e,t)});function D(e,t){return new Lu({type:"union",options:e,...Z(t)})}o(D,"union");var ju=b("ZodMiniDiscriminatedUnion",(e,t)=>{Xn.init(e,t),K.init(e,t)});function Ae(e,t,r){return new ju({type:"union",options:t,discriminator:e,...Z(r)})}o(Ae,"discriminatedUnion");var Fu=b("ZodMiniRecord",(e,t)=>{Yn.init(e,t),K.init(e,t)});function w(e,t,r){return new Fu({type:"record",keyType:e,valueType:t,...Z(r)})}o(w,"record");var Bu=b("ZodMiniEnum",(e,t)=>{Qn.init(e,t),K.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 Bu({type:"enum",entries:r,...Z(t)})}o(U,"_enum");var Zu=b("ZodMiniLiteral",(e,t)=>{eo.init(e,t),K.init(e,t)});function $(e,t){return new Zu({type:"literal",values:Array.isArray(e)?e:[e],...Z(t)})}o($,"literal");var Vu=b("ZodMiniTransform",(e,t)=>{to.init(e,t),K.init(e,t)});function ze(e){return new Vu({type:"transform",transform:e})}o(ze,"transform");var Hu=b("ZodMiniOptional",(e,t)=>{ro.init(e,t),K.init(e,t)});function h(e){return new Hu({type:"optional",innerType:e})}o(h,"optional");var Gu=b("ZodMiniNullable",(e,t)=>{no.init(e,t),K.init(e,t)});function at(e){return new Gu({type:"nullable",innerType:e})}o(at,"nullable");var qu=b("ZodMiniPipe",(e,t)=>{oo.init(e,t),K.init(e,t)});function Oe(e,t){return new qu({type:"pipe",in:e,out:t})}o(Oe,"pipe");var Wu=b("ZodMiniCustom",(e,t)=>{io.init(e,t),K.init(e,t)});function Lt(e,t){return Io(Wu,e??(()=>!0),t)}o(Lt,"custom");var st={};yn(st,{bigint:()=>ec,boolean:()=>Qu,date:()=>tc,number:()=>Yu,string:()=>Xu});function Xu(e){return lo(Ut,e)}o(Xu,"string");function Yu(e){return fo(Mt,e)}o(Yu,"number");function Qu(e){return ho(xr,e)}o(Qu,"boolean");function ec(e){return vo(So,e)}o(ec,"bigint");function tc(e){return bo(zo,e)}o(tc,"date");var _r=p({retryOnFailure:p({defaultValue:h(B()),hide:h(B())}),continueOnFailure:p({defaultValue:h(B()),hide:h(B())})}),Pr=class{constructor(t,r,n,i,u,c,l,f,y,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=y;this.audience=P;this.aiMetadata=I}static{o(this,"IAction")}},ae=o(e=>new Pr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=p({displayName:a(),description:h(a())}),C=o((e,t)=>p({type:$(t),required:B(),defaultValue:h(it())}),"TPropertyValue");var ne=p({...F.shape,...C(a(),"SHORT_TEXT").shape}),ve=p({...F.shape,...C(a(),"LONG_TEXT").shape});var ko=p({label:a(),value:k()}),jt=p({disabled:h(B()),placeholder:h(a()),options:N(ko)});var oe=p({...F.shape,options:jt,...C(k(),"STATIC_DROPDOWN").shape}),xe=p({...F.shape,options:jt,...C(N(k()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var br=p({...F.shape,...C(k(),"DROPDOWN").shape,refreshers:N(a())}),ut=p({...F.shape,...C(N(k()),"MULTI_SELECT_DROPDOWN").shape,refreshers:N(a())});var Pe=p({...F.shape,...C(B(),"CHECKBOX").shape});var _e=p({...F.shape,...C(Y(),"NUMBER").shape});var ct=p({...F.shape,streaming:h(B()),...C(k(),"FILE").shape});var lt=p({...F.shape,...C(a(),"DATE_TIME").shape});var wo=w(a(),D([ne,ve,oe,ut,xe,Pe,_e,ct,lt])),pt=p({...F.shape,properties:wo,...C(N(k()),"ARRAY").shape});var dt=p({...F.shape,...C(D([w(a(),k())]),"JSON").shape});var Ro=D([ne,oe,dt,pt,xe]),nc=w(a(),Ro),Ir=p({refreshers:N(a()),...F.shape,...C(k(),"DYNAMIC").shape});var Ft=p({...F.shape,...C(Ao(),"MARKDOWN").shape});var mt=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(mt||{}),Be=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(Be||{}),Ze=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(Ze||{});var ft=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(ft||{}),Tr="both_client_credentials_and_authorization_code";var De=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(De||{}),gt=(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))(gt||{}),oc=p({strategy:U(gt),paramName:h(a())}),yt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(yt||{});var Bt=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Bt||{}),No=p({status:h(Y()),body:h(k()),headers:h(w(a(),a()))}),Do=p({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:h(a()),handlerId:h(a()),streamStepProgress:h(U(Bt))}),Co=p({type:$("WEBHOOK"),requestId:a(),requestIdToReply:h(a()),response:No,handlerId:h(a()),streamStepProgress:h(U(Bt))}),ic=D([Do,Co]);var ac=p({body:k(),rawBody:h(k()),headers:w(a(),a()),queryParams:w(a(),a())});function le(e){return e==null}o(le,"isNil");function ht(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ht,"isEmpty");function Zt(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Zt,"assertNotNullOrUndefined");var Er=Ne(require("crypto"),1);var sc=128,Ce,Ve,uc=o(e=>{!Ce||Ce.length<e?(Ce=Buffer.allocUnsafe(e*sc),Er.default.randomFillSync(Ce),Ve=0):Ve+e>Ce.length&&(Er.default.randomFillSync(Ce),Ve=0),Ve+=e},"fillPool"),cc=o(e=>(uc(e|=0),Ce.subarray(Ve-e,Ve)),"random"),lc=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let c="";for(;;){let l=r(i),f=i;for(;f--;)if(c+=e[l[f]&n]||"",c.length===u)return c}}},"customRandom"),Mo=o((e,t=21)=>lc(e,t,cc),"customAlphabet");var pc="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Lo=21,Ob=a().check(Se(new RegExp(`^[0-9a-zA-Z]{${Lo}}$`))),dc=Mo(pc,Lo);var ke=Oe(ze(e=>e instanceof Date?e.toISOString():e),a()),se={id:a(),created:ke,updated:ke},V=o(e=>h(at(e)),"Nullable");function $r(e){return h(at(U(e)))}o($r,"NullableEnum");var Rb=Oe(ze(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),h(B())),Vt=o(e=>Oe(ze(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),h(N(e))),"OptionalArrayFromQuery");var Cb=w(a(),k());var vt=(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))(vt||{});var Wb=a().check(Se(/^#[0-9A-Fa-f]{6}$/));var Jb=p({filename:a(),data:k(),type:$("file"),mimetype:h(a())});var mc=Ne(Fo());var nI=p({...se,name:a(),permissions:N(a()),platformId:V(a()),type:a(),userCount:h(Y())});var Bo=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Bo||{}),Sr=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Sr||{}),Ar=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))(Ar||{});var zr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(zr||{});var Or=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Or||{});var fc=p({mode:U(Bo),value:k()}),gc=p({auth:h(a()),fields:w(a(),fc)}),yc=p({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:h(gc)}),hc=p({type:$("PIECE"),toolName:a().check(ce(1)),pieceMetadata:yc}),vc=p({type:$("none")}),xc=p({type:$("access_token"),accessToken:a()}),Pc=p({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),_c=p({type:$("headers"),headers:w(a(),a())}),bc=Ae("type",[vc,xc,Pc,_c]),Zo=p({type:$("FLOW"),toolName:a().check(ce(1)),externalFlowId:a(),flowDisplayName:h(a())}),Vo=p({type:$("MCP"),toolName:a().check(ce(1)),serverUrl:Eo(),protocol:U(Ar),auth:bc}),Ho=p({type:$("KNOWLEDGE_BASE"),toolName:a().check(ce(1)),sourceType:U(Sr),sourceId:a(),sourceName:a()}),Ic=Ae("type",[hc,Zo,Vo,Ho]),Tc=p({displayName:a(),description:h(a()),type:U(zr)}),Go=p({type:$("MARKDOWN"),markdown:a()}),He={type:$("TOOL_CALL"),input:V(w(a(),k())),output:h(k()),toolName:a(),status:U(Or),toolCallId:a(),startTime:a(),endTime:h(a())},NI=p(He),qo=Ae("toolCallType",[p({...He,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),p({...He,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),p({...He,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),p({...He,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),p({...He,toolCallType:$("UNKNOWN"),displayName:a()})]),Ec=D([Go,qo]);var kr=(r=>(r.IMAGE="image",r.TEXT="text",r))(kr||{}),be=p({apiKey:a()}),$c=be,Sc=p({apiKey:a(),apiKeyHash:a()}),Ac=be,zc=be,Oc=be,kc=be,wc=be,Rc=be,Nc=be,Yo=p({accessKeyId:a().check(ce(1)),secretAccessKey:a().check(ce(1))}),Dc=p({}),Cc=p({}),Uc=p({}),Mc=p({}),Lc=p({}),jc=p({}),Qo=p({modelId:a(),modelName:a(),modelType:U(kr)}),ei=p({apiKeyHeader:a(),baseUrl:a(),models:N(Qo),defaultHeaders:h(w(a(),a()))}),ti=p({accountId:a(),gatewayId:a(),models:N(Qo),vertexProject:h(a()),vertexRegion:h(a())}),ri=p({resourceName:a(),apiVersion:Oe(ze(e=>typeof e=="string"&&e.trim().length===0?void 0:e),h(a()))}),ni=p({region:a().check(ce(1))}),Fc=D([$c,Oc,kc,wc,Rc,zc,Ac,Sc,Yo,Nc]),oi=D([ei,ti,ri,ni,Dc,Uc,Mc,Lc,Cc,jc]),Bc=p({id:a(),name:a(),type:U(kr)}),Zc=p({id:a(),name:a(),provider:U(vt),config:oi,enabledForChat:B()}),Vc=p({provider:U(vt),config:oi,auth:Fc,platformId:a()});var MI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"},Wo=["gpt-5.5","gpt-5.4-mini","gpt-5.4-nano","gpt-4.1","gpt-4.1-mini"],Hc=["claude-sonnet-4-6","claude-opus-4-7","claude-haiku-4-5"],Gc=["claude-sonnet-4.6","claude-opus-4.7","claude-haiku-4.5"],Ko=["gemini-2.5-pro","gemini-2.5-flash","gemini-3.1-pro-preview","gemini-3-flash-preview"],qc=["grok-4.20","grok-4.1-fast"],Wc={openai:Wo,anthropic:Hc,google:Ko,activepieces:[...Gc.map(e=>`anthropic/${e}`),...Wo.map(e=>`openai/${e}`),...Ko.map(e=>`google/${e}`),...qc.map(e=>`x-ai/${e}`)]};var Jo=128e3,Kc={openai:128e3,anthropic:2e5,google:1048576,bedrock:2e5,azure:128e3,openrouter:128e3,activepieces:2e5,mistral:128e3};function Jc({provider:e}){return e?Kc[e]??Jo:Jo}o(Jc,"getMaxContextTokens");var Xo={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"},Xc={anthropic:"native",google:"native",openrouter:"plugin",activepieces:"plugin"},Yc=new Set(["anthropic","mistral"]);function me(e){return{chatModels:Wc[e],maxContextTokens:Jc({provider:e}),defaultEmbeddingModel:Xo[e],supportsEmbedding:Xo[e]!==void 0,supportsImageGeneration:!Yc.has(e),webSearch:Xc[e]}}o(me,"buildProviderCapabilities");var Qc={openai:me("openai"),anthropic:me("anthropic"),openrouter:me("openrouter"),azure:me("azure"),google:me("google"),"cloudflare-gateway":me("cloudflare-gateway"),custom:me("custom"),bedrock:me("bedrock"),mistral:me("mistral"),activepieces:me("activepieces")};var el=p({base64Url:a(),fileName:a(),extension:h(a())}),tl=p({mimeType:a(),url:a(),fileName:h(a())}),wr=D([el,tl]);var rl=D([p({type:$("file"),value:wr}),p({type:$("markdown"),value:a(),files:h(N(wr))})]),nl=p({sessionId:a(),message:a(),files:h(N(a()))});var ai=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(ai||{}),si=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(si||{}),Rr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(Rr||{});var ol=D([p({...se,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:p({options:N(p({value:a()}))})}),p({...se,name:a(),externalId:a(),type:D([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),il=p({...se,name:a(),folderId:V(a()),projectId:a(),externalId:a(),status:$r(si),trigger:$r(ai)}),al=p({...se,tableId:a(),projectId:a(),cells:w(a(),p({updated:a(),created:a(),value:k(),fieldName:a()}))}),sl=p({events:N(U(Rr)),webhookUrl:a(),flowId:a()}),ul=p({fields:N(p({id:a(),name:a()})),rows:N(w(a(),a())),name:a()}),cl=p({projectId:a(),limit:h(st.number()),cursor:h(a()),name:h(a()),externalIds:Vt(a()),folderId:h(a()),folderIds:Vt(a())}),ll=p({records:N(N(p({fieldId:a(),value:ci()}))),tableId:a()}),pl=p({cells:h(N(p({fieldId:a(),value:ci()}))),tableId:a(),agentUpdate:h(B())}),ui=Ae("operator",[Ue("eq"),Ue("neq"),Ue("gt"),Ue("gte"),Ue("lt"),Ue("lte"),Ue("co"),ii("exists"),ii("not_exists")]),dl=p({tableId:a(),limit:h(st.number()),cursor:h(a()),filters:Vt(ui)});function ci(){return Oe(ze(e=>e==null?e:String(e)),at(a()))}o(ci,"coerceToString");function Ue(e){return p({fieldId:a(),operator:$(e),value:a()})}o(Ue,"valueFilter");function ii(e){return p({fieldId:a(),operator:$(e)})}o(ii,"existenceFilter");var ml=p({status:h(Y()),body:h(k()),headers:h(w(a(),a()))}),fl=p({...se,deleted:V(ke),ownerId:a(),displayName:a(),platformId:a(),externalId:V(a())});var li=p({name:a(),description:h(a()),type:a(),required:B()}),gl=p({pieceName:a(),triggerName:a(),input:p({toolName:a(),toolDescription:a(),inputSchema:N(li),returnsResponse:B()})});var pi="^[0-9]+\\.[0-9]+\\.[0-9]+$",nT=new RegExp(pi),hl="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",oT=a().check(Se(new RegExp(pi))),iT=a().check(Se(new RegExp(hl))),vl=p({packageType:$("ARCHIVE"),pieceType:U(Be),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),di=p({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),mi=p({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),aT=D([di,mi]),sT=D([vl,di,mi]);var xl=Ae("type",[p({type:$("CRON_EXPRESSION"),cronExpression:a(),timezone:a()}),p({type:$("INTERVAL"),intervalMs:$o().check(Dt(6e4))})]),uT=p({...se,type:U(De),projectId:a(),flowId:a(),triggerName:a(),schedule:V(xl),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:V(a()),simulate:B()}),fi=(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))(fi||{}),gi=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(gi||{}),yi=(r=>(r.S3="S3",r.DB="DB",r))(yi||{}),cT=p({...se,projectId:V(a()),platformId:V(a()),type:U(fi),compression:U(gi),data:h(k()),location:U(yi),size:V(Y()),fileName:V(a()),s3Key:V(a()),metadata:V(w(a(),a()))}),hi=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(hi||{}),vi=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(vi||{}),lT=p({id:a(),email:a(),firstName:a(),status:U(vi),externalId:V(a()),platformId:V(a()),platformRole:U(hi),lastName:a(),created:ke,updated:ke,lastActiveDate:V(ke),imageUrl:V(a())});var Dr=p({...F.shape,...C(w(a(),k()),"OBJECT").shape});var _i=p({...F.shape,...C(a(),"COLOR").shape});var Cr=D([ne,ve,Ft,Pe,oe,xe,br,ut,Ir,_e,pt,Dr,dt,lt,ct,_i]),S={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var fe=p({displayName:a(),description:h(a())});var bi=p({username:a(),password:a()}),Ur=p({...fe.shape,username:p({displayName:a(),description:h(a())}),password:p({displayName:a(),description:h(a())}),...C(bi,"BASIC_AUTH").shape});var Il=w(a(),D([ne,ve,_e,Pe,oe])),Mr=p({...fe.shape,props:Il,...C(k(),"CUSTOM_AUTH").shape});var Me=p({...fe.shape,...C(p({auth:a()}),"SECRET_TEXT").shape});var Tl=w(a(),D([ne,ve,Me,_e,Pe,oe,xe,Ft])),Ii=p({...fe.shape,props:Tl,...C(k(),"OIDC").shape});var Lr=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Lr||{}),Ti=D([ne,Me,oe]),Ei=w(a(),Ti),El=p({props:h(w(a(),Ti)),authUrl:a(),tokenUrl:a(),scope:N(a()),prompt:h(D([$("none"),$("consent"),$("login"),$("omit")])),pkce:h(B()),pkceMethod:h(D([$("plain"),$("S256")])),authorizationMethod:h(U(Lr)),grantType:h(D([U(ft),$(Tr)])),extra:h(w(a(),a()))}),$i=p({access_token:a(),props:h(Ei),data:w(a(),it())}),jr=p({...fe.shape,...El.shape,...C($i,"OAUTH2").shape});var Ge=D([Ur,Mr,Ii,jr,Me]),xt="Connection",we={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||xt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||xt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||xt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||xt}},None(){}};var BE={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 $l=p({...F.shape,...C(k(),"CUSTOM").shape,code:a()});var Sl=D([Cr,Ge]),Fr=w(a(),Sl),u$=w(a(),Cr);var Si=D([p({strategy:$("CRON"),cronExpression:a()}),p({strategy:$("NONE")})]);var Ai="2",Gt="0.82.0";var Br=class{constructor(t,r,n,i,u,c,l,f,y=Gt,P,I="",x){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=l;this.auth=f;this.minimumSupportedRelease=y;this.maximumSupportedRelease=P;this.description=I;this.deprecated=x;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:Ai}),"getContextInfo");(!Al(y)||zl(y,Gt))&&(this.minimumSupportedRelease=Gt),u.forEach(s=>this._actions[s.name]=s),c.forEach(s=>this._triggers[s.name]=s)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,deprecated:this.deprecated,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},zi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Br(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description,e.deprecated)},"createPiece");function Al(e){return/^\d+\.\d+\.\d+$/.test(e)}o(Al,"isValidSimpleSemver");function zl(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(zl,"isSemverLessThan");var Ol=h(w(a(),w(a(),a()))),Oi=p({id:h(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:N(a()),platformId:h(a()),directoryPath:h(a()),auth:h(D([Ge,N(Ge)])),version:a(),categories:h(N(U(Ze))),minimumSupportedRelease:h(a()),maximumSupportedRelease:h(a()),deprecated:h(B()),i18n:Ol}),kl=U(["human","ai","both"]),ki=p({description:h(a()),idempotent:h(B())}),wi=p({name:a(),displayName:a(),description:a(),props:Fr,requireAuth:B(),errorHandlingOptions:h(_r),outputSchema:h(Lt()),audience:h(kl),aiMetadata:h(ki)}),Ri=p({name:a(),displayName:a(),description:a(),props:Fr,errorHandlingOptions:h(_r),type:U(De),sampleData:k(),handshakeConfiguration:h(Lt()),renewConfiguration:h(Si),testStrategy:U(yt),outputSchema:h(Lt()),aiMetadata:h(ki)}),wl=p({...Oi.shape,actions:w(a(),wi),triggers:w(a(),Ri)}),Rl=p({...Oi.shape,actions:Y(),triggers:Y(),suggestedActions:h(N(wi)),suggestedTriggers:h(N(Ri))}),Ni=p({projectUsage:Y(),pieceType:U(Be),packageType:U(mt),platformId:h(a()),archiveId:h(a())}),uS=p({...wl.shape,...Ni.shape}),cS=p({...Rl.shape,...Ni.shape}),lS=p({name:a(),version:a()});var Nl=Ne(require("path")),Dl=Ne(require("fs/promises"));var Mi=require("node:stream");var qt=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 Wt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Zr,r=new Vr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Zr=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Vr=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 Pt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};function Di({error:e,requestBody:t}){return e instanceof Pt?e.errorMessage():{response:{status:0,body:e instanceof Error?e.message:String(e)},request:{body:t}}}o(Di,"toFailsafeOutput");var ge=(c=>(c.GET="GET",c.POST="POST",c.PATCH="PATCH",c.PUT="PUT",c.DELETE="DELETE",c.HEAD="HEAD",c))(ge||{});var Kt=class extends qt{static{o(this,"FetchHttpClient")}constructor(t="",r=new Wt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),c=t.queryParams??{};for(let[L,re]of Object.entries(c))i.append(L,re);let l=i.toString(),f=l?`${n}?${l}`:n,y=t.responseType??"json",P=t.followRedirects??!0,I=t.retries??0,{body:x,extraHeaders:s,isStream:d}=Cl(t.method)?Ul(t.body,u):{body:void 0,extraHeaders:{},isStream:!1},g=Ll({...u,...s}),m=await Ml(async()=>{let L=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>L.abort(),t.timeout):void 0;try{let ue={method:t.method.toString(),headers:g,body:x,redirect:P?"follow":"manual",signal:L.signal};return d&&(ue.duplex="half"),r?.dispatcher!==void 0&&(ue.dispatcher=r.dispatcher),await fetch(f,ue)}finally{re!==void 0&&clearTimeout(re)}},I),v=P?300:400;if(m.status<200||m.status>=v){let L=await Ci(m,y),re=new Pt(t.body,{status:m.status,responseBody:L});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let _=await Ci(m,y);return{status:m.status,headers:jl(m.headers),body:_}}};function Cl(e){return e!=="GET"&&e!=="HEAD"}o(Cl,"acceptsRequestBody");function Ul(e,t){if(Bl(e))return{body:void 0,extraHeaders:{},isStream:!1};if(Fl(e)){let n=new Mi.PassThrough;return e.on("error",i=>n.destroy(i)),e.pipe(n),{body:n,extraHeaders:e.getHeaders(),isStream:!0}}return typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(Ul,"serializeBody");async function Ci(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ci,"parseResponseBody");async function Ml(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await Ui(n);continue}return i}catch(i){if(r=i,n<t){await Ui(n);continue}throw i}throw r}o(Ml,"sendWithRetries");function Ui(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o(Ui,"backoff");function Ll(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(Ll,"normalizeHeaders");function jl(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(jl,"toHttpHeaders");function Fl(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"&&typeof e.on=="function"}o(Fl,"isNodeFormData");function Bl(e){return e==null}o(Bl,"isNil");var J=new Kt;var zd=Ne(require("fs")),Zs=Ne(dn());var Od={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function kd(e){let t=e.split(";")[0].trim().toLowerCase();return Od[t]??""}o(kd,"contentTypeToExtension");var wd=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),Rd=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 Vs({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:c,extraProps:l,authLocation:f="headers"}){return ae({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:S.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:y})=>({url:S.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
|
|
3
|
+
i.e ${Rd(t,y)}/resource or /resource`,required:!0,defaultValue:y?t(y):"",...c?.url??{}})}),"props")}),method:S.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(ge).map(y=>({label:y,value:y}))},...c?.method??{}}),headers:S.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...c?.headers??{}}),queryParams:S.Object({displayName:"Query Parameters",required:!0,...c?.queryParams??{}}),body_type:S.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:S.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:y})=>{if(!y)return{};let P=y,I={};switch(P){case"none":break;case"json":I.data=S.Json({displayName:"JSON Body",required:!0,...c?.body??{}});break;case"raw":I.data=S.LongText({displayName:"Raw Body",required:!0});break;case"form_data":I.data=S.Array({displayName:"Form Data",required:!0,properties:{fieldName:S.ShortText({displayName:"Field Name",required:!0}),fieldType:S.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:S.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:S.File({displayName:"File Field Value",required:!1})}});break}return I},"props")}),response_is_binary:S.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:S.Checkbox({displayName:"No Error on Failure",required:!1,...c?.failsafe??{}}),timeout:S.Number({displayName:"Timeout (in seconds)",required:!1,...c?.timeout??{}}),followRedirects:S.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...l},run:o(async y=>{let{method:P,url:I,headers:x,queryParams:s,body:d,body_type:g,failsafe:m,timeout:v,response_is_binary:_,followRedirects:L}=y.propsValue;Zt(P,"Method"),Zt(I,"URL");let re=le(r)?{}:await r(y.auth,y.propsValue),ue=I.url,Ye=ue.startsWith("http://")||ue.startsWith("https://")?ue:wd({baseUrl:t(y.auth),relativePath:ue}),Ie={method:P,url:Ye,headers:{...x??{},...f==="headers"||!le(f)?re:{}},queryParams:{...f==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:L};if(_&&(Ie.responseType="arraybuffer"),d)if(g&&g!=="none"){let ye=d.data;if(g==="form_data"){let tu=ye,Tt=new Zs.default;for(let{fieldName:mn,fieldType:fn,textFieldValue:gn,fileFieldValue:ir}of tu)fn==="text"&&!ht(gn)?Tt.append(mn,gn):fn==="file"&&!ht(ir)&&Tt.append(mn,ir.data,{filename:ir?.filename});Ie.body=Tt,Ie.headers={...Ie.headers,...Tt.getHeaders()}}else Ie.body=ye}else g||(Ie.body=d);try{let ye=await J.sendRequest(Ie);return await Nd(y.files,ye.body,ye.status,ye.headers,_)}catch(ye){if(m)return Di({error:ye,requestBody:Ie.body});throw ye}},"run")})}o(Vs,"createCustomApiCallAction");var Nd=o(async(e,t,r,n,i)=>{let u;if(i&&Dd(t)){let c=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],l=kd(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"),Dd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Cd=we.SecretText({displayName:"API Key",description:"You can obtain your API key from the Mistral AI dashboard. Go to https://console.mistral.ai, generate an API key, and paste it here.",required:!0,validate:o(async({auth:e})=>{try{return await J.sendRequest({method:"GET",url:"https://api.mistral.ai/v1/models",headers:{Authorization:`Bearer ${e}`}}),{valid:!0}}catch(t){return t.response?.status===401?{valid:!1,error:"Invalid API key. Please check your API key and try again."}:t.response?.status===429?{valid:!1,error:"Rate limit exceeded. Please wait and try again."}:t.message?.toLowerCase().includes("network")?{valid:!1,error:"Network error. Please check your internet connection."}:{valid:!1,error:"Authentication failed: "+(t.message||"Unknown error")}}},"validate")}),Ud=we.CustomAuth({displayName:"Cloudflare AI Gateway",description:"Route Mistral calls through your Cloudflare AI Gateway. Provide a Mistral API key (key-in-request mode) or leave it blank if your gateway has Mistral configured as a stored key (BYOK).",required:!0,props:{accountId:S.ShortText({displayName:"Cloudflare Account ID",description:"Your Cloudflare account ID (visible on the AI Gateway dashboard).",required:!0}),gatewayId:S.ShortText({displayName:"Gateway ID",description:"The slug of your AI Gateway (visible on the gateway settings page).",required:!0}),gatewayAuthToken:we.SecretText({displayName:"Gateway Auth Token",description:"Optional. Required only if your gateway has authentication enabled. Sent as cf-aig-authorization.",required:!1}),mistralApiKey:we.SecretText({displayName:"Mistral API Key",description:"Optional. Provide your Mistral key for key-in-request mode. Leave blank if Cloudflare injects the key via stored credentials (BYOK).",required:!1})},validate:o(async({auth:e})=>{let{accountId:t,gatewayId:r,gatewayAuthToken:n,mistralApiKey:i}=e;try{return await J.sendRequest({method:"GET",url:`https://gateway.ai.cloudflare.com/v1/${encodeURIComponent(t)}/${encodeURIComponent(r)}/mistral/v1/models`,headers:Md({gatewayAuthToken:n,mistralApiKey:i})}),{valid:!0}}catch(u){let c=u.response?.status;return c===401||c===403?{valid:!1,error:"Authentication rejected by the gateway. Check your Mistral key and gateway auth token."}:c===404?{valid:!1,error:"Gateway not found. Check your account ID and gateway ID."}:c===429?{valid:!1,error:"Rate limit exceeded at the gateway. Please wait and try again."}:{valid:!1,error:"Gateway validation failed: "+(u.message||"Unknown error")}}},"validate")}),Q=[Cd,Ud];function Md({gatewayAuthToken:e,mistralApiKey:t}){let r={};return e&&(r["cf-aig-authorization"]=`Bearer ${e}`),t&&(r.Authorization=`Bearer ${t}`),r}o(Md,"buildGatewayHeaders");function Ld(e){return e.type==="CUSTOM_AUTH"}o(Ld,"isGatewayAuth");function jd(e){let t=e;if(Ld(t)){let{accountId:r,gatewayId:n,gatewayAuthToken:i,mistralApiKey:u}=t.props,c={};return i&&(c["cf-aig-authorization"]=`Bearer ${i}`),u&&(c.Authorization=`Bearer ${u}`),{baseUrl:`https://gateway.ai.cloudflare.com/v1/${encodeURIComponent(r)}/${encodeURIComponent(n)}/mistral/v1`,headers:c}}return{baseUrl:"https://api.mistral.ai/v1",headers:{Authorization:`Bearer ${t.secret_text}`}}}o(jd,"getConfig");var ee={getConfig:jd};var Hs=S.Dropdown({displayName:"Model",description:"Select a Mistral model. List is fetched live from your account.",required:!0,refreshers:[],auth:Q,options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Please connect your account first.",options:[]};try{let{baseUrl:t,headers:r}=ee.getConfig(e),u=((await J.sendRequest({method:"GET",url:`${t}/models`,headers:r})).body.data||[]).map(c=>({label:c.name||c.id,value:c.id}));return u.length===0?{disabled:!0,placeholder:"No models found for your account.",options:[]}:{disabled:!1,options:u}}catch{return{disabled:!0,placeholder:"Failed to load models. Check your API key and network.",options:[]}}},"options")});function ie(e){return e.response?.data?.error?e.response.data.error:e.response?.data?.message?e.response.data.message:e.message?e.message:"Unknown error"}o(ie,"parseMistralError");var Gs=ae({audience:"both",auth:Q,name:"create_chat_completion",displayName:"Ask Mistral",description:"Ask Mistral anything you want!",aiMetadata:{description:"Sends one user prompt to a Mistral chat model through the chat-completions endpoint and returns only the assistant text of the first choice, with optional temperature, top-p, max-token and random-seed controls; it is stateless, with no conversation memory or system message. This is the piece's only text-generation action - prefer Create Embeddings when you need vectors rather than prose, and Run OCR when the text must be pulled out of a PDF or image instead of generated. Requires a model id from the account's live model list and a question; not idempotent: each call bills a fresh completion and the wording varies unless a random seed is pinned.",idempotent:!1},props:{model:Hs,prompt:S.LongText({displayName:"Question",required:!0}),temperature:S.Number({displayName:"Temperature",required:!1,defaultValue:1,description:"Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive."}),top_p:S.Number({displayName:"Top P",required:!1,defaultValue:1,description:"An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered."}),max_tokens:S.Number({displayName:"Max Tokens",required:!1}),random_seed:S.Number({displayName:"Random Seed",required:!1}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:3e4})},async run(e){let{model:t,temperature:r,top_p:n,max_tokens:i,random_seed:u,timeout:c,prompt:l}=e.propsValue,{baseUrl:f,headers:y}=ee.getConfig(e.auth),P={model:t,messages:[{content:l,role:"user"}],temperature:r,top_p:n,max_tokens:i,random_seed:u},I;for(let x=0;x<=3;++x)try{return(await J.sendRequest({method:"POST",url:`${f}/chat/completions`,headers:y,body:P,timeout:c??3e4})).body.choices[0].message.content}catch(s){I=s;let d=s.response?.status;if((d===429||d&&d>=500&&d<600)&&x<3){await new Promise(g=>setTimeout(g,1e3*(x+1)));continue}throw new Error(ie(s))}throw new Error(ie(I))}});var qs=ae({audience:"both",auth:Q,name:"create_embeddings",displayName:"Create Embeddings",description:"Creates new embedding in Mistral AI.",aiMetadata:{description:"Converts an array of text strings into numeric embedding vectors using Mistral's fixed mistral-embed model; the model is not selectable here, unlike the sibling Ask Mistral action, and a whole batch of strings is embedded in one call. Use it for semantic search, similarity, or clustering pipelines, and pick Ask Mistral when you need generated prose rather than numbers. Requires a non-empty array of input strings; idempotent: nothing is created server-side and the same input yields the same vectors.",idempotent:!0},props:{input:S.Array({displayName:"Input",description:"The input text for which to create an embedding.",required:!0}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:3e4})},async run(e){let{input:t,timeout:r}=e.propsValue,{baseUrl:n,headers:i}=ee.getConfig(e.auth),u=[];try{if(typeof t=="string")try{u=JSON.parse(t)}catch{u=t}u=t}catch{throw new Error("Input must be a non-empty string or a JSON array of non-empty strings")}let c={model:"mistral-embed",input:u},l;for(let f=0;f<=3;++f)try{return(await J.sendRequest({method:"POST",url:`${n}/embeddings`,headers:i,body:c,timeout:r??3e4})).body}catch(y){l=y;let P=y.response?.status;if((P===429||P&&P>=500&&P<600)&&f<3){await new Promise(I=>setTimeout(I,1e3*(f+1)));continue}throw new Error(ie(y))}throw new Error(ie(l))}});var Ks=Ne(dn());var Ws=["fine-tune","batch","ocr"],Fd=512*1024*1024,Bd=["jsonl","txt","csv","pdf","docx","png","jpg","jpeg","mp3","mp4"];function Zd(e){let t=e.split(".");return t.length>1?t.pop().toLowerCase():""}o(Zd,"getFileExtension");var Js=ae({audience:"both",auth:Q,name:"upload_file",displayName:"Upload File",description:"Upload a file to Mistral AI (e.g., for fine-tuning or context storage).",aiMetadata:{description:"Stores a file in the connected Mistral account and returns its file id, tagged with a purpose of fine-tune, batch, or ocr that decides what the id may later be used for. Run it before Run OCR whenever the document is a step attachment rather than a public URL: upload with purpose=ocr and feed the returned id into that action. Rejects files above 512MB or with an extension outside jsonl, txt, csv, pdf, docx, png, jpg, jpeg, mp3, mp4; not idempotent: each call stores another copy and returns a new id.",idempotent:!1},props:{file:S.File({displayName:"File",description:"The file to upload (max 512MB).For fine tuning purspose provide .jsonl file.",required:!0}),purpose:S.StaticDropdown({displayName:"Purpose",description:"Purpose of the file.",required:!0,options:{options:Ws.map(e=>({label:e,value:e}))}})},async run(e){let{file:t,purpose:r}=e.propsValue;if(!t)throw new Error("File is required");if(!Ws.includes(r))throw new Error("Invalid purpose");if(t.data.byteLength>Fd)throw new Error("File exceeds 512MB limit");let n=Zd(t.filename);if(!Bd.includes(n))throw new Error(`File extension .${n} is not allowed`);let{baseUrl:i,headers:u}=ee.getConfig(e.auth),c=new Ks.default;c.append("file",Buffer.from(t.data),t.filename),c.append("purpose",r);try{return(await J.sendRequest({method:"POST",url:`${i}/files`,headers:{...u,...c.getHeaders()},body:c})).body}catch(l){throw new Error(ie(l))}}});var Vd=[{label:"mistral-ocr-latest (Recommended)",value:"mistral-ocr-latest"},{label:"mistral-ocr-2505",value:"mistral-ocr-2505"}],Qs=ae({audience:"both",auth:Q,name:"run_ocr",displayName:"Run OCR",description:"Extract text from PDFs and images using mistral-ocr-latest. To OCR a file from a previous step, run Upload File first (with purpose=ocr) and pass the returned id here.",aiMetadata:{description:"Extracts the text of a PDF or image as Markdown with a Mistral OCR model, taking the document either from a public URL or from a Mistral file id (that mode first resolves a short-lived signed URL); optional zero-based page indices narrow the run and embedded images can come back as base64. Pick this to read text out of a document that already exists, and Ask Mistral when the answer has to be generated or reasoned about rather than transcribed. The file-id mode only works for a file that Upload File stored with purpose=ocr, and the document type must be set to PDF or image to match the source. Read-only extraction that stores nothing, so repeat calls are idempotent.",idempotent:!0},props:{model:S.StaticDropdown({displayName:"Model",required:!0,defaultValue:"mistral-ocr-latest",options:{options:Vd}}),documentSource:S.StaticDropdown({displayName:"Document Source",description:"Where the document or image to OCR comes from.",required:!0,defaultValue:"url",options:{options:[{label:"URL",value:"url"},{label:"Mistral file ID (uploaded earlier with purpose=ocr)",value:"fileId"}]}}),sourceFields:S.DynamicProperties({displayName:"Document",required:!0,refreshers:["documentSource"],auth:we.None(),props:o(async e=>e.documentSource==="fileId"?{fileId:S.ShortText({displayName:"File ID",description:"A Mistral file ID returned from a prior Upload File step (purpose=ocr).",required:!0}),documentType:Xs()}:{documentUrl:S.ShortText({displayName:"URL",description:"Public URL of the PDF or image to OCR.",required:!0}),documentType:Xs()},"props")}),pages:S.Array({displayName:"Pages",description:"Optional zero-based page indices to process. Leave empty for all pages.",required:!1}),includeImageBase64:S.Checkbox({displayName:"Include Image Base64",description:"Return embedded images encoded as base64 alongside the Markdown.",required:!1,defaultValue:!1}),timeout:S.Number({displayName:"Timeout (ms)",required:!1,defaultValue:12e4})},async run(e){let{model:t,documentSource:r,sourceFields:n,pages:i,includeImageBase64:u,timeout:c}=e.propsValue,l=ee.getConfig(e.auth),f=await Hd({source:r,fields:n,config:l,timeout:c??12e4}),y={model:t,document:f},P=qd(i);P&&(y.pages=P),u&&(y.include_image_base64=!0);let I;for(let x=0;x<=3;++x)try{let s=await J.sendRequest({method:"POST",url:`${l.baseUrl}/ocr`,headers:{...l.headers,"Content-Type":"application/json"},body:y,timeout:c??12e4}),d=(s.body.pages??[]).map(g=>g.markdown??"").join(`
|
|
4
4
|
|
|
5
|
-
`);return{...s.body,markdown:d}}catch(s){I=s;let d=s.response?.status;if((d===429||d&&d>=500&&d<600)&&x<3){await new Promise(g=>setTimeout(g,1e3*(x+1)));continue}throw new Error(ie(s))}throw new Error(ie(I))}});function
|
|
5
|
+
`);return{...s.body,markdown:d}}catch(s){I=s;let d=s.response?.status;if((d===429||d&&d>=500&&d<600)&&x<3){await new Promise(g=>setTimeout(g,1e3*(x+1)));continue}throw new Error(ie(s))}throw new Error(ie(I))}});function Xs(){return S.StaticDropdown({displayName:"Document Type",description:'Pick "Image" for PNG/JPG/WEBP, "Document" for PDFs.',required:!0,defaultValue:"document_url",options:{options:[{label:"Document (PDF)",value:"document_url"},{label:"Image",value:"image_url"}]}})}o(Xs,"documentTypeDropdown");async function Hd({source:e,fields:t,config:r,timeout:n}){let i=t.documentType??"document_url";if(e==="fileId"){let c=t.fileId?.trim();if(!c)throw new Error("A Mistral file ID is required.");let l=await Gd({fileId:c,config:r,timeout:n});return Ys({documentType:i,url:l})}let u=t.documentUrl?.trim();if(!u)throw new Error("A document URL is required.");return Ys({documentType:i,url:u})}o(Hd,"resolveDocument");function Ys({documentType:e,url:t}){return e==="image_url"?{type:"image_url",image_url:t}:{type:"document_url",document_url:t}}o(Ys,"buildUrlDocument");async function Gd({fileId:e,config:t,timeout:r}){let n=await J.sendRequest({method:"GET",url:`${t.baseUrl}/files/${encodeURIComponent(e)}/url?expiry=24`,headers:t.headers,timeout:r});if(!n.body.url)throw new Error(`Could not fetch a signed URL for file ${e}.`);return n.body.url}o(Gd,"fetchSignedUrl");function qd(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{if(typeof r=="number")return r;let n=Number(String(r).trim());return Number.isFinite(n)?n:null}).filter(r=>r!==null&&Number.isInteger(r)&&r>=0);return t.length>0?t:null}o(qd,"parsePageIndices");var eu=ae({audience:"both",auth:Q,name:"list_models",displayName:"List Models",description:"Retrieves a list of available Mistral AI models.",aiMetadata:{description:"Returns every model the connected Mistral key can access, chat, embedding and OCR ids alike, exactly as the models endpoint reports them. Use it to discover a valid model id before calling Ask Mistral or Run OCR, both of which require one; it is the only discovery action here and takes no inputs, so it cannot filter or search. Read-only and idempotent.",idempotent:!0},props:{},async run({auth:e}){try{let{baseUrl:t,headers:r}=ee.getConfig(e);return(await J.sendRequest({method:"GET",url:`${t}/models`,headers:r})).body}catch(t){throw new Error(ie(t))}}});var Wd=zi({displayName:"Mistral AI",description:"Mistral AI provides state-of-the-art open-weight and hosted language models for text generation, embeddings, and reasoning tasks.",auth:Q,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/mistral-ai.png",authors:["sparkybug"],categories:["ARTIFICIAL_INTELLIGENCE"],actions:[Gs,qs,Js,Qs,eu,Vs({auth:Q,baseUrl:o(e=>e?ee.getConfig(e).baseUrl:"https://api.mistral.ai/v1","baseUrl"),authMapping:o(async e=>ee.getConfig(e).headers,"authMapping")})],triggers:[]});0&&(module.exports={mistralAi});
|
|
6
6
|
/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
mime-types/index.js:
|