@budibase/shared-core 3.7.2 → 3.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ __p += '`),K&&(I+=`' +
|
|
|
37
37
|
function print() { __p += __j.call(arguments, '') }
|
|
38
38
|
`:`;
|
|
39
39
|
`)+I+`return __p
|
|
40
|
-
}`;var G=ld(function(){return ii(m,N+"return "+I).apply(O,T)});if(G.source=I,Qc(G))throw G;return G}function kg(e){return qe(e).toLowerCase()}function Bg(e){return qe(e).toUpperCase()}function Gg(e,t,n){if(e=qe(e),e&&(n||t===O))return de(e);if(!e||!(t=jt(t)))return e;var s=Pe(e),u=Pe(t);return Xn(s,H(s,u),Te(s,u)+1).join("")}function Wg(e,t,n){if(e=qe(e),e&&(n||t===O))return e.slice(0,Lt(e)+1);if(!e||!(t=jt(t)))return e;var s=Pe(e);return Xn(s,0,Te(s,Pe(t))+1).join("")}function Vg(e,t,n){if(e=qe(e),e&&(n||t===O))return e.replace(Wu,"");if(!e||!(t=jt(t)))return e;var s=Pe(e);return Xn(s,H(s,Pe(t))).join("")}function qg(e,t){var n=Xd,s=eh;if(dt(t)){var u="separator"in t?t.separator:u;n="length"in t?xe(t.length):n,s="omission"in t?jt(t.omission):s}e=qe(e);var l=e.length;if(Qe(e)){var h=Pe(e);l=h.length}if(n>=l)return e;var m=n-pt(s);if(m<1)return s;var T=h?Xn(h,0,m).join(""):e.slice(0,m);if(u===O)return T+s;if(h&&(m+=T.length-m),ml(u)){if(e.slice(m).search(u)){var x,v=T;for(u.global||(u=Ht(u.source,qe(cf.exec(u))+"g")),u.lastIndex=0;x=u.exec(v);)var I=x.index;T=T.slice(0,I===O?m:I)}}else if(e.indexOf(jt(u),m)!=m){var b=T.lastIndexOf(u);b>-1&&(T=T.slice(0,b))}return T+s}function $g(e){return e=qe(e),e&&ku.test(e)?e.replace(rf,kh):e}function Lp(e,t,n){return e=qe(e),t=n?O:t,t===O?ie(e)?Kl(e):Z(e):e.match(t)||[]}function Ha(e){var t=e==null?0:e.length,n=fe();return e=t?E(e,function(s){if(typeof s[1]!="function")throw new Cr(Zt);return[n(s[0]),s[1]]}):[],be(function(s){for(var u=-1;++u<t;){var l=e[u];if(i(l[0],this,s))return i(l[1],this,s)}})}function Hg(e){return zh(gr(e,fr))}function za(e){return function(){return e}}function Up(e,t){return e==null||e!==e?t:e}function $t(e){return e}function Za(e){return Bf(typeof e=="function"?e:gr(e,fr))}function Mp(e){return Gf(gr(e,fr))}function Pp(e,t){return Wf(e,gr(t,fr))}function Ya(e,t,n){var s=Nt(t),u=pa(t,s);n!=null||dt(t)&&(u.length||!s.length)||(n=t,t=e,e=this,u=pa(t,Nt(t)));var l=!(dt(n)&&"chain"in n&&!n.chain),h=Ln(e);return o(u,function(m){var T=t[m];e[m]=T,h&&(e.prototype[m]=function(){var x=this.__chain__;if(l||x){var v=e(this.__wrapped__);return(v.__actions__=Wt(this.__actions__)).push({func:T,args:arguments,thisArg:e}),v.__chain__=x,v}return T.apply(e,A([this.value()],arguments))})}),e}function zg(){return bt._===this&&(bt._=Xa),this}function Xc(){}function Zg(e){return e=xe(e),be(function(t){return Vf(t,e)})}function is(e){return ba(e)?q(dn(e)):Vr(e)}function Qa(e){return function(t){return e==null?O:gi(e,t)}}function el(){return[]}function tl(){return!1}function rl(){return{}}function Fp(){return""}function Yg(){return!0}function Qg(e,t){if(e=xe(e),e<1||e>tn)return[];var n=rn,s=ue(e,rn);t=fe(t),e-=rn;for(var u=ot(s,t);++n<e;)t(n);return u}function jg(e){return Se(e)?E(e,dn):_r(e)?[e]:Wt(Jp(qe(e)))}function Kg(e){var t=++il;return qe(e)+t}function Jg(e){return e&&e.length?Kn(e,$t,yi):O}function Xg(e,t){return e&&e.length?Kn(e,fe(t,2),yi):O}function ey(e){return Me(e,$t)}function ty(e,t){return Me(e,fe(t,2))}function ry(e){return e&&e.length?Kn(e,$t,fc):O}function ny(e,t){return e&&e.length?Kn(e,fe(t,2),fc):O}function iy(e){return e&&e.length?le(e,$t):0}function oy(e,t){return e&&e.length?le(e,fe(t,2)):0}S=S==null?bt:Qt.defaults(bt.Object(),S,Qt.pick(bt,Ef));var ze=S.Array,ja=S.Date,nl=S.Error,ii=S.Function,ge=S.Math,ut=S.Object,Ht=S.RegExp,Tt=S.String,Cr=S.TypeError,Hr=ze.prototype,sy=ii.prototype,oo=ut.prototype,Ka=S["__core-js_shared__"],Ja=sy.toString,Ze=oo.hasOwnProperty,il=0,kp=function(){var e=/[^.]+$/.exec(Ka&&Ka.keys&&Ka.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Dr=oo.toString,Bp=Ja.call(ut),Xa=bt._,ht=Ht("^"+Ja.call(Ze).replace(js,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=ic?S.Buffer:O,Mn=S.Symbol,eu=S.Uint8Array,Gp=ct?ct.allocUnsafe:O,tu=ne(ut.getPrototypeOf,ut),Wp=ut.create,Vp=oo.propertyIsEnumerable,ru=Hr.splice,ol=Mn?Mn.isConcatSpreadable:O,Pn=Mn?Mn.iterator:O,Fn=Mn?Mn.toStringTag:O,nu=function(){try{var e=ei(ut,"defineProperty");return e({},"",{}),e}catch{}}(),qp=S.clearTimeout!==bt.clearTimeout&&S.clearTimeout,iu=ja&&ja.now!==bt.Date.now&&ja.now,Tr=S.setTimeout!==bt.setTimeout&&S.setTimeout,kn=ge.ceil,ou=ge.floor,sl=ut.getOwnPropertySymbols,ay=ct?ct.isBuffer:O,$p=S.isFinite,uy=Hr.join,Hp=ne(ut.keys,ut),et=ge.max,ue=ge.min,zp=ja.now,Lr=S.parseInt,al=ge.random,cy=Hr.reverse,Be=ei(S,"DataView"),os=ei(S,"Map"),su=ei(S,"Promise"),Bn=ei(S,"Set"),ss=ei(S,"WeakMap"),as=ei(ut,"create"),au=ss&&new ss,so={},ly=ni(Be),fy=ni(os),py=ni(su),dy=ni(Bn),hy=ni(ss),uu=Mn?Mn.prototype:O,us=uu?uu.valueOf:O,Zp=uu?uu.toString:O,ao=function(){function e(){}return function(t){if(!dt(t))return{};if(Wp)return Wp(t);e.prototype=t;var n=new e;return e.prototype=O,n}}();p.templateSettings={escape:Gi,evaluate:nf,interpolate:Gu,variable:"",imports:{_:p}},p.prototype=w.prototype,p.prototype.constructor=p,L.prototype=ao(w.prototype),L.prototype.constructor=L,U.prototype=ao(w.prototype),U.prototype.constructor=U,pi.prototype.clear=xr,pi.prototype.delete=na,pi.prototype.get=Gh,pi.prototype.has=qi,pi.prototype.set=ia,Ir.prototype.clear=He,Ir.prototype.delete=Wh,Ir.prototype.get=Rf,Ir.prototype.has=oa,Ir.prototype.set=Vh,In.prototype.clear=qh,In.prototype.delete=sa,In.prototype.get=jn,In.prototype.has=aa,In.prototype.set=bf,on.prototype.add=on.prototype.push=wf,on.prototype.has=Nf,or.prototype.clear=Cf,or.prototype.delete=Po,or.prototype.get=di,or.prototype.has=ua,or.prototype.set=$h;var mn=ji(sn),Yp=ji(uc,!0),cs=Ac(),Qp=Ac(!0),jp=au?function(e,t){return au.set(e,t),e}:$t,my=nu?function(e,t){return nu(e,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:$t,Ct=be,rr=qp||function(e){return bt.clearTimeout(e)},gy=Bn&&1/z(new Bn([,-0]))[1]==ci?function(e){return new Bn(e)}:Xc,ul=au?function(e){return au.get(e)}:Xc,cl=sl?function(e){return e==null?[]:(e=ut(e),f(sl(e),function(t){return Vp.call(e,t)}))}:el,ll=sl?function(e){for(var t=[];e;)A(t,cl(e)),e=tu(e);return t}:el,zt=wt;(Be&&zt(new Be(new ArrayBuffer(1)))!=ki||os&&zt(new os)!=Br||su&&zt(su.resolve())!=Ro||Bn&&zt(new Bn)!=Gr||ss&&zt(new ss)!=No)&&(zt=function(e){var t=wt(e),n=t==vn?e.constructor:O,s=n?ni(n):"";if(s)switch(s){case ly:return ki;case fy:return Br;case py:return Ro;case dy:return Gr;case hy:return No}return t});var yy=Ka?Ln:tl,Kp=Dc(jp),uo=Tr||function(e,t){return bt.setTimeout(e,t)},fl=Dc(my),Jp=ti(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sf,function(n,s,u,l){t.push(u?l.replace(Th,"$1"):s||n)}),t}),_y=be(function(e,t){return _t(e)?mi(e,mt(t,1,_t,!0)):[]}),Xp=be(function(e,t){var n=Jt(t);return _t(n)&&(n=O),_t(e)?mi(e,mt(t,1,_t,!0),fe(n,2)):[]}),ed=be(function(e,t){var n=Jt(t);return _t(n)&&(n=O),_t(e)?mi(e,mt(t,1,_t,!0),O,n):[]}),Ty=be(function(e){var t=E(e,ya);return t.length&&t[0]===e[0]?Zi(t):[]}),Ey=be(function(e){var t=Jt(e),n=E(e,ya);return t===Jt(n)?t=O:n.pop(),n.length&&n[0]===e[0]?Zi(n,fe(t,2)):[]}),Ay=be(function(e){var t=Jt(e),n=E(e,ya);return t=typeof t=="function"?t:O,t&&n.pop(),n.length&&n[0]===e[0]?Zi(n,O,t):[]}),Sy=be(Ko),co=pn(function(e,t){var n=e==null?0:e.length,s=ac(e,t);return $f(e,E(t,function(u){return Vt(u,n)?+u:u}).sort($o)),s}),Oy=be(function(e){return sr(mt(e,1,_t,!0))}),vy=be(function(e){var t=Jt(e);return _t(t)&&(t=O),sr(mt(e,1,_t,!0),fe(t,2))}),xy=be(function(e){var t=Jt(e);return t=typeof t=="function"?t:O,sr(mt(e,1,_t,!0),O,t)}),Iy=be(function(e,t){return _t(e)?mi(e,t):[]}),Ry=be(function(e){return _i(f(e,_t))}),td=be(function(e){var t=Jt(e);return _t(t)&&(t=O),_i(f(e,_t),fe(t,2))}),rd=be(function(e){var t=Jt(e);return t=typeof t=="function"?t:O,_i(f(e,_t),O,t)}),by=be(Gc),wy=be(function(e){var t=e.length,n=t>1?e[t-1]:O;return n=typeof n=="function"?(e.pop(),n):O,Ba(e,n)}),Ny=pn(function(e){var t=e.length,n=t?e[0]:0,s=this.__wrapped__,u=function(l){return ac(l,e)};return!(t>1||this.__actions__.length)&&s instanceof U&&Vt(n)?(s=s.slice(n,+n+(t?1:0)),s.__actions__.push({func:Jo,args:[u],thisArg:O}),new L(s,this.__chain__).thru(function(l){return t&&!l.length&&l.push(O),l})):this.thru(u)}),Cy=Yi(function(e,t,n){Ze.call(e,n)?++e[n]:lt(e,n,1)}),Dy=Ta(Lc),Ly=Ta(Ai),Uy=Yi(function(e,t,n){Ze.call(e,n)?e[n].push(t):lt(e,n,[t])}),My=be(function(e,t,n){var s=-1,u=typeof t=="function",l=er(e)?ze(e.length):[];return mn(e,function(h){l[++s]=u?i(t,h,n):Re(h,t,n)}),l}),Py=Yi(function(e,t,n){lt(e,n,t)}),Fy=Yi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ky=be(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ut(e,t[0],t[1])?t=[]:n>2&&Ut(t[0],t[1],t[2])&&(t=[t[0]]),Jn(e,mt(t,1),[])}),cu=iu||function(){return bt.Date.now()},pl=be(function(e,t,n){var s=nr;if(n.length){var u=F(n,Ae(pl));s|=en}return wn(e,s,t,n,u)}),nd=be(function(e,t,n){var s=nr|Sn;if(n.length){var u=F(n,Ae(nd));s|=en}return wn(t,s,e,n,u)}),By=be(function(e,t){return $i(e,1,t)}),Gy=be(function(e,t,n){return $i(e,Nr(t)||0,n)});Wa.Cache=In;var Wy=Ct(function(e,t){t=t.length==1&&Se(t[0])?E(t[0],W(fe())):E(mt(t,1),W(fe()));var n=t.length;return be(function(s){for(var u=-1,l=ue(s.length,n);++u<l;)s[u]=t[u].call(this,s[u]);return i(e,this,s)})}),dl=be(function(e,t){return wn(e,en,O,t,F(t,Ae(dl)))}),id=be(function(e,t){return wn(e,Di,O,t,F(t,Ae(id)))}),Vy=pn(function(e,t){return wn(e,Li,O,O,O,t)}),qy=zo(yi),$y=zo(function(e,t){return e>=t}),vi=Ff(function(){return arguments}())?Ff:function(e){return gt(e)&&Ze.call(e,"callee")&&!Vp.call(e,"callee")},Se=ze.isArray,Hy=vf?W(vf):Zh,gn=ay||tl,od=xf?W(xf):Yh,hl=If?W(If):jh,ml=fi?W(fi):Kh,sd=vr?W(vr):Rn,lo=oc?W(oc):Jh,gl=zo(fc),zy=zo(function(e,t){return e<=t}),Zy=Qi(function(e,t){if(Xi(t)||er(t))return ln(t,Nt(t),e),O;for(var n in t)Ze.call(t,n)&&ko(e,n,t[n])}),ad=Qi(function(e,t){ln(t,ur(t),e)}),Mt=Qi(function(e,t,n,s){ln(t,ur(t),e,s)}),yl=Qi(function(e,t,n,s){ln(t,Nt(t),e,s)}),Yy=pn(ac),Qy=be(function(e,t){e=ut(e);var n=-1,s=t.length,u=s>2?t[2]:O;for(u&&Ut(t[0],t[1],u)&&(s=1);++n<s;)for(var l=t[n],h=ur(l),m=-1,T=h.length;++m<T;){var x=h[m],v=e[x];(v===O||wr(v,oo[x])&&!Ze.call(e,x))&&(e[x]=l[x])}return e}),jy=be(function(e){return e.push(O,xc),i(ud,O,e)}),Ky=jf(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Dr.call(t)),e[t]=n},za($t)),_l=jf(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Dr.call(t)),Ze.call(e,t)?e[t].push(n):e[t]=[n]},fe),Jy=be(Re),Tl=Qi(function(e,t,n){da(e,t,n)}),ud=Qi(function(e,t,n,s){da(e,t,n,s)}),Xy=pn(function(e,t){var n={};if(e==null)return n;var s=!1;t=E(t,function(l){return l=qr(l,e),s||(s=l.length>1),l}),ln(e,bc(e),n),s&&(n=gr(n,fr|ks|zn,cm));for(var u=t.length;u--;)ar(n,t[u]);return n}),e_=pn(function(e,t){return e==null?{}:tm(e,t)}),cd=Zo(Nt),El=Zo(ur),t_=fn(function(e,t,n){return t=t.toLowerCase(),e+(n?wp(t):t)}),r_=fn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),n_=fn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Al=Qf("toLowerCase"),Sl=fn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),i_=fn(function(e,t,n){return e+(n?" ":"")+Ol(t)}),o_=fn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ol=Qf("toUpperCase"),ld=be(function(e,t){try{return i(e,O,t)}catch(n){return Qc(n)?n:new nl(n)}}),s_=pn(function(e,t){return o(t,function(n){n=dn(n),lt(e,n,pl(e[n],e))}),e}),a_=Sc(),u_=Sc(!0),c_=be(function(e,t){return function(n){return Re(n,e,t)}}),l_=be(function(e,t){return function(n){return Re(e,n,t)}}),f_=Sa(E),p_=Sa(c),d_=Sa(B),h_=Oa(),m_=Oa(!0),g_=Aa(function(e,t){return e+t},0),y_=va("ceil"),__=Aa(function(e,t){return e/t},1),T_=va("floor"),E_=Aa(function(e,t){return e*t},1),A_=va("round"),S_=Aa(function(e,t){return e-t},0);return p.after=Hc,p.ary=zc,p.assign=Zy,p.assignIn=ad,p.assignInWith=Mt,p.assignWith=yl,p.at=Yy,p.before=Zc,p.bind=pl,p.bindAll=s_,p.bindKey=nd,p.castArray=Vm,p.chain=hp,p.chunk=hn,p.compact=mm,p.concat=gm,p.cond=Ha,p.conforms=Hg,p.constant=za,p.countBy=Cy,p.create=ug,p.curry=es,p.curryRight=Yc,p.debounce=$r,p.defaults=Qy,p.defaultsDeep=jy,p.defer=By,p.delay=Gy,p.difference=_y,p.differenceBy=Xp,p.differenceWith=ed,p.drop=Ua,p.dropRight=eo,p.dropRightWhile=np,p.dropWhile=ip,p.fill=ym,p.filter=wm,p.flatMap=Vc,p.flatMapDeep=Nm,p.flatMapDepth=Cm,p.flatten=to,p.flattenDeep=_m,p.flattenDepth=op,p.flip=Oi,p.flow=a_,p.flowRight=u_,p.fromPairs=sp,p.functions=dg,p.functionsIn=hg,p.groupBy=Uy,p.initial=Ma,p.intersection=Ty,p.intersectionBy=Ey,p.intersectionWith=Ay,p.invert=Ky,p.invertBy=_l,p.invokeMap=My,p.iteratee=Za,p.keyBy=Py,p.keys=Nt,p.keysIn=ur,p.map=Ga,p.mapKeys=gg,p.mapValues=bp,p.matches=Mp,p.matchesProperty=Pp,p.memoize=Wa,p.merge=Tl,p.mergeWith=ud,p.method=c_,p.methodOf=l_,p.mixin=Ya,p.negate=ts,p.nthArg=Zg,p.omit=Xy,p.omitBy=yg,p.once=Pm,p.orderBy=Dm,p.over=f_,p.overArgs=Wy,p.overEvery=p_,p.overSome=d_,p.partial=dl,p.partialRight=id,p.partition=Fy,p.pick=e_,p.pickBy=ns,p.property=is,p.propertyOf=Qa,p.pull=Sy,p.pullAll=Ko,p.pullAllBy=cp,p.pullAllWith=Mc,p.pullAt=co,p.range=h_,p.rangeRight=m_,p.rearg=Vy,p.reject=yp,p.remove=Em,p.rest=Fm,p.reverse=Pa,p.sampleSize=Mm,p.set=Tg,p.setWith=Eg,p.shuffle=$c,p.slice=Nn,p.sortBy=ky,p.sortedUniq=Cn,p.sortedUniqBy=Pc,p.split=Mg,p.spread=km,p.tail=Fc,p.take=kc,p.takeRight=Fa,p.takeRightWhile=ro,p.takeWhile=pe,p.tap=vm,p.throttle=Bm,p.thru=Jo,p.toArray=vp,p.toPairs=cd,p.toPairsIn=El,p.toPath=jg,p.toPlainObject=Ip,p.transform=Ag,p.unary=Gm,p.union=Oy,p.unionBy=vy,p.unionWith=xy,p.uniq=ka,p.uniqBy=Bc,p.uniqWith=Si,p.unset=Sg,p.unzip=Gc,p.unzipWith=Ba,p.update=Og,p.updateWith=vg,p.values=io,p.valuesIn=xg,p.without=Iy,p.words=Lp,p.wrap=Wm,p.xor=Ry,p.xorBy=td,p.xorWith=rd,p.zip=by,p.zipObject=dp,p.zipObjectDeep=qt,p.zipWith=wy,p.entries=cd,p.entriesIn=El,p.extend=ad,p.extendWith=Mt,Ya(p,p),p.add=g_,p.attempt=ld,p.camelCase=t_,p.capitalize=wp,p.ceil=y_,p.clamp=Ig,p.clone=qm,p.cloneDeep=Hm,p.cloneDeepWith=zm,p.cloneWith=$m,p.conformsTo=Ep,p.deburr=Np,p.defaultTo=Up,p.divide=__,p.endsWith=wg,p.eq=wr,p.escape=Ng,p.escapeRegExp=Cp,p.every=Wc,p.find=Dy,p.findIndex=Lc,p.findKey=cg,p.findLast=Ly,p.findLastIndex=Ai,p.findLastKey=lg,p.floor=T_,p.forEach=no,p.forEachRight=qc,p.forIn=fg,p.forInRight=pg,p.forOwn=jc,p.forOwnRight=Rp,p.get=Kc,p.gt=qy,p.gte=$y,p.has=mg,p.hasIn=Jc,p.head=jo,p.identity=$t,p.includes=gp,p.indexOf=ap,p.inRange=Rg,p.invoke=Jy,p.isArguments=vi,p.isArray=Se,p.isArrayBuffer=Hy,p.isArrayLike=er,p.isArrayLikeObject=_t,p.isBoolean=Zm,p.isBuffer=gn,p.isDate=od,p.isElement=Ym,p.isEmpty=Ap,p.isEqual=Qm,p.isEqualWith=jm,p.isError=Qc,p.isFinite=Km,p.isFunction=Ln,p.isInteger=Sp,p.isLength=tr,p.isMap=hl,p.isMatch=Jm,p.isMatchWith=Op,p.isNaN=Xm,p.isNative=eg,p.isNil=rg,p.isNull=tg,p.isNumber=Va,p.isObject=dt,p.isObjectLike=gt,p.isPlainObject=rs,p.isRegExp=ml,p.isSafeInteger=ng,p.isSet=sd,p.isString=qa,p.isSymbol=_r,p.isTypedArray=lo,p.isUndefined=ig,p.isWeakMap=og,p.isWeakSet=sg,p.join=Uc,p.kebabCase=r_,p.last=Jt,p.lastIndexOf=Tm,p.lowerCase=n_,p.lowerFirst=Al,p.lt=gl,p.lte=zy,p.max=Jg,p.maxBy=Xg,p.mean=ey,p.meanBy=ty,p.min=ry,p.minBy=ny,p.stubArray=el,p.stubFalse=tl,p.stubObject=rl,p.stubString=Fp,p.stubTrue=Yg,p.multiply=E_,p.nth=up,p.noConflict=zg,p.noop=Xc,p.now=cu,p.pad=Dp,p.padEnd=Cg,p.padStart=Dg,p.parseInt=Lg,p.random=bg,p.reduce=Lm,p.reduceRight=Um,p.repeat=Ug,p.replace=$a,p.result=_g,p.round=A_,p.runInContext=y,p.sample=_p,p.size=Tp,p.snakeCase=Sl,p.some=Xo,p.sortedIndex=lp,p.sortedIndexBy=fp,p.sortedIndexOf=Am,p.sortedLastIndex=pp,p.sortedLastIndexBy=Sm,p.sortedLastIndexOf=Om,p.startCase=i_,p.startsWith=Pg,p.subtract=S_,p.sum=iy,p.sumBy=oy,p.template=Fg,p.times=Qg,p.toFinite=Un,p.toInteger=xe,p.toLength=xp,p.toLower=kg,p.toNumber=Nr,p.toSafeInteger=ag,p.toString=qe,p.toUpper=Bg,p.trim=Gg,p.trimEnd=Wg,p.trimStart=Vg,p.truncate=qg,p.unescape=$g,p.uniqueId=Kg,p.upperCase=o_,p.upperFirst=Ol,p.each=no,p.eachRight=qc,p.first=jo,Ya(p,function(){var e={};return sn(p,function(t,n){Ze.call(p.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),p.VERSION=Oo,o(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),o(["drop","take"],function(e,t){U.prototype[e]=function(n){n=n===O?1:et(xe(n),0);var s=this.__filtered__&&!t?new U(this):this.clone();return s.__filtered__?s.__takeCount__=ue(n,s.__takeCount__):s.__views__.push({size:ue(n,rn),type:e+(s.__dir__<0?"Right":"")}),s},U.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),o(["filter","map","takeWhile"],function(e,t){var n=t+1,s=n==Lu||n==ih;U.prototype[e]=function(u){var l=this.clone();return l.__iteratees__.push({iteratee:fe(u,3),type:n}),l.__filtered__=l.__filtered__||s,l}}),o(["head","last"],function(e,t){var n="take"+(t?"Right":"");U.prototype[e]=function(){return this[n](1).value()[0]}}),o(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");U.prototype[e]=function(){return this.__filtered__?new U(this):this[n](1)}}),U.prototype.compact=function(){return this.filter($t)},U.prototype.find=function(e){return this.filter(e).head()},U.prototype.findLast=function(e){return this.reverse().find(e)},U.prototype.invokeMap=be(function(e,t){return typeof e=="function"?new U(this):this.map(function(n){return Re(n,e,t)})}),U.prototype.reject=function(e){return this.filter(ts(fe(e)))},U.prototype.slice=function(e,t){e=xe(e);var n=this;return n.__filtered__&&(e>0||t<0)?new U(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==O&&(t=xe(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},U.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},U.prototype.toArray=function(){return this.take(rn)},sn(U.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),u=p[s?"take"+(t=="last"?"Right":""):t],l=s||/^find/.test(t);u&&(p.prototype[t]=function(){var h=this.__wrapped__,m=s?[1]:arguments,T=h instanceof U,x=m[0],v=T||Se(h),I=function(Y){var K=u.apply(p,A([Y],m));return s&&b?K[0]:K};v&&n&&typeof x=="function"&&x.length!=1&&(T=v=!1);var b=this.__chain__,N=!!this.__actions__.length,C=l&&!b,G=T&&!N;if(!l&&v){h=G?h:new U(this);var D=e.apply(h,m);return D.__actions__.push({func:Jo,args:[I],thisArg:O}),new L(D,b)}return C&&G?e.apply(this,m):(D=this.thru(I),C?s?D.value()[0]:D.value():D)})}),o(["pop","push","shift","sort","splice","unshift"],function(e){var t=Hr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",s=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var u=arguments;if(s&&!this.__chain__){var l=this.value();return t.apply(Se(l)?l:[],u)}return this[n](function(h){return t.apply(Se(h)?h:[],u)})}}),sn(U.prototype,function(e,t){var n=p[t];if(n){var s=n.name+"";Ze.call(so,s)||(so[s]=[]),so[s].push({name:t,func:n})}}),so[Ea(O,Sn).name]=[{name:"wrapper",func:O}],U.prototype.clone=ke,U.prototype.reverse=$e,U.prototype.value=sc,p.prototype.at=Ny,p.prototype.chain=xm,p.prototype.commit=mp,p.prototype.next=Im,p.prototype.plant=bm,p.prototype.reverse=Dn,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xt,p.prototype.first=p.prototype.head,Pn&&(p.prototype[Pn]=Rm),p},Qt=Bh();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(bt._=Qt,define(function(){return Qt})):xn?((xn.exports=Qt)._=Qt,nc._=Qt):bt._=Qt}).call(Cu)});var kS=zr(Fr=>{"use strict";Fr.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"};Fr.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]};Fr.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]};Fr.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2};Fr.iterateeRearg={mapKeys:[1],reduceRight:[1,0]};Fr.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]};Fr.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}};Fr.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}};Fr.realToAlias=function(){var i=Object.prototype.hasOwnProperty,r=Fr.aliasToReal,o={};for(var a in r){var c=r[a];i.call(o,c)?o[c].push(a):o[c]=[a]}return o}();Fr.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"};Fr.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0};Fr.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}});var GS=zr((XL,BS)=>{"use strict";BS.exports={}});var $S=zr((eU,qS)=>{"use strict";var Ft=kS(),yR=GS(),WS=Array.prototype.push;function _R(i,r){return r==2?function(o,a){return i.apply(void 0,arguments)}:function(o){return i.apply(void 0,arguments)}}function NT(i,r){return r==2?function(o,a){return i(o,a)}:function(o){return i(o)}}function VS(i){for(var r=i?i.length:0,o=Array(r);r--;)o[r]=i[r];return o}function TR(i){return function(r){return i({},r)}}function ER(i,r){return function(){for(var o=arguments.length,a=o-1,c=Array(o);o--;)c[o]=arguments[o];var f=c[r],d=c.slice(0,r);return f&&WS.apply(d,f),r!=a&&WS.apply(d,c.slice(r+1)),i.apply(this,d)}}function CT(i,r){return function(){var o=arguments.length;if(o){for(var a=Array(o);o--;)a[o]=arguments[o];var c=a[0]=r.apply(void 0,a);return i.apply(void 0,a),c}}}function DT(i,r,o,a){var c=typeof r=="function",f=r===Object(r);if(f&&(a=o,o=r,r=void 0),o==null)throw new TypeError;a||(a={});var d={cap:"cap"in a?a.cap:!0,curry:"curry"in a?a.curry:!0,fixed:"fixed"in a?a.fixed:!0,immutable:"immutable"in a?a.immutable:!0,rearg:"rearg"in a?a.rearg:!0},g=c?o:yR,E="curry"in a&&a.curry,A="fixed"in a&&a.fixed,R="rearg"in a&&a.rearg,V=c?o.runInContext():void 0,B=c?o:{ary:i.ary,assign:i.assign,clone:i.clone,curry:i.curry,forEach:i.forEach,isArray:i.isArray,isError:i.isError,isFunction:i.isFunction,isWeakMap:i.isWeakMap,iteratee:i.iteratee,keys:i.keys,rearg:i.rearg,toInteger:i.toInteger,toPath:i.toPath},P=B.ary,Z=B.assign,_e=B.clone,Ce=B.curry,J=B.forEach,ae=B.isArray,Ie=B.isError,Me=B.isFunction,q=B.isWeakMap,k=B.keys,j=B.rearg,se=B.toInteger,le=B.toPath,ot=k(Ft.aryMethod),An={castArray:function(ne){return function(){var F=arguments[0];return ae(F)?ne(VS(F)):ne.apply(void 0,arguments)}},iteratee:function(ne){return function(){var F=arguments[0],z=arguments[1],oe=ne(F,z),me=oe.length;return d.cap&&typeof z=="number"?(z=z>2?z-2:1,me&&me<=z?oe:NT(oe,z)):oe}},mixin:function(ne){return function(F){var z=this;if(!Me(z))return ne(z,Object(F));var oe=[];return J(k(F),function(me){Me(F[me])&&oe.push([me,z.prototype[me]])}),ne(z,Object(F)),J(oe,function(me){var rt=me[1];Me(rt)?z.prototype[me[0]]=rt:delete z.prototype[me[0]]}),z}},nthArg:function(ne){return function(F){var z=F<0?1:se(F)+1;return Ce(ne(F),z)}},rearg:function(ne){return function(F,z){var oe=z?z.length:0;return Ce(ne(F,z),oe)}},runInContext:function(ne){return function(F){return DT(i,ne(F),a)}}};function de(ne,F){if(d.cap){var z=Ft.iterateeRearg[ne];if(z)return st(F,z);var oe=!c&&Ft.iterateeAry[ne];if(oe)return De(F,oe)}return F}function W(ne,F,z){return E||d.curry&&z>1?Ce(F,z):F}function $(ne,F,z){if(d.fixed&&(A||!Ft.skipFixed[ne])){var oe=Ft.methodSpread[ne],me=oe&&oe.start;return me===void 0?P(F,z):ER(F,me)}return F}function te(ne,F,z){return d.rearg&&z>1&&(R||!Ft.skipRearg[ne])?j(F,Ft.methodRearg[ne]||Ft.aryRearg[z]):F}function H(ne,F){F=le(F);for(var z=-1,oe=F.length,me=oe-1,rt=_e(Object(ne)),pt=rt;pt!=null&&++z<oe;){var Pe=F[z],Lt=pt[Pe];Lt!=null&&!(Me(Lt)||Ie(Lt)||q(Lt))&&(pt[Pe]=_e(z==me?Lt:Object(Lt))),pt=pt[Pe]}return rt}function Te(ne){return Fe.runInContext.convert(ne)(void 0)}function he(ne,F){var z=Ft.aliasToReal[ne]||ne,oe=Ft.remap[z]||z,me=a;return function(rt){var pt=c?V:B,Pe=c?V[oe]:F,Lt=Z(Z({},me),rt);return DT(pt,z,Pe,Lt)}}function De(ne,F){return Qe(ne,function(z){return typeof z=="function"?NT(z,F):z})}function st(ne,F){return Qe(ne,function(z){var oe=F.length;return _R(j(NT(z,oe),F),oe)})}function Qe(ne,F){return function(){var z=arguments.length;if(!z)return ne();for(var oe=Array(z);z--;)oe[z]=arguments[z];var me=d.rearg?0:z-1;return oe[me]=F(oe[me]),ne.apply(void 0,oe)}}function ie(ne,F,z){var oe,me=Ft.aliasToReal[ne]||ne,rt=F,pt=An[me];return pt?rt=pt(F):d.immutable&&(Ft.mutate.array[me]?rt=CT(F,VS):Ft.mutate.object[me]?rt=CT(F,TR(F)):Ft.mutate.set[me]&&(rt=CT(F,H))),J(ot,function(Pe){return J(Ft.aryMethod[Pe],function(Lt){if(me==Lt){var Fs=Ft.methodSpread[me],kr=Fs&&Fs.afterRearg;return oe=kr?$(me,te(me,rt,Pe),Pe):te(me,$(me,rt,Pe),Pe),oe=de(me,oe),oe=W(me,oe,Pe),!1}}),!oe}),oe||(oe=rt),oe==F&&(oe=E?Ce(oe,1):function(){return F.apply(this,arguments)}),oe.convert=he(me,F),oe.placeholder=F.placeholder=z,oe}if(!f)return ie(r,o,g);var Fe=o,vt=[];return J(ot,function(ne){J(Ft.aryMethod[ne],function(F){var z=Fe[Ft.remap[F]||F];z&&vt.push([F,ie(F,z,Fe)])})}),J(k(Fe),function(ne){var F=Fe[ne];if(typeof F=="function"){for(var z=vt.length;z--;)if(vt[z][0]==ne)return;F.convert=he(ne,F),vt.push([ne,F])}}),J(vt,function(ne){Fe[ne[0]]=ne[1]}),Fe.convert=Te,Fe.placeholder=Fe,J(k(Fe),function(ne){J(Ft.realToAlias[ne]||[],function(F){Fe[F]=Fe[ne]})}),Fe}qS.exports=DT});var ZS=zr((tU,zS)=>{"use strict";var HS=FS().runInContext();zS.exports=$S()(HS,HS)});var y0={};Le(y0,{AIOperations:()=>gv,BpmCorrelationKey:()=>FE,BpmInstanceKey:()=>kE,BpmStatusKey:()=>BE,BpmStatusValue:()=>GE,BuilderSocketEvent:()=>PE,DEFAULT_BB_DATASOURCE_ID:()=>Cv,DefaultAppTheme:()=>vv,DefaultBuilderTheme:()=>Ov,GridSocketEvent:()=>ME,Header:()=>CE,InvalidFileExtensions:()=>Nv,OperationFieldTypes:()=>yv,OperationFields:()=>_v,OperatorOptions:()=>Mr,PROTECTED_EXTERNAL_COLUMNS:()=>DE,PROTECTED_INTERNAL_COLUMNS:()=>xd,REBOOT_CRON:()=>wv,RoleColor:()=>LE,SWITCHABLE_TYPES:()=>Tv,SocketEvent:()=>UE,SocketSessionTTL:()=>xv,SqlNumberTypeRangeMap:()=>D_,ThemeClassPrefix:()=>Au,ThemeOptions:()=>Id,ValidColumnNameRegex:()=>Rv,ValidQueryNameRegex:()=>Iv,ValidSnippetNameRegex:()=>bv,automations:()=>lE,canBeDisplayColumn:()=>UR,canBeSortColumn:()=>MR,canHaveDefaultColumn:()=>PR,dataFilters:()=>IT,ensureValidTheme:()=>QS,findDuplicateInternalColumns:()=>FR,getThemeClassNames:()=>kR,helpers:()=>TT,isExternalColumnName:()=>Av,isInternalColumnName:()=>Ev,sdk:()=>kT,utils:()=>P_});module.exports=fO(y0);var pO=["user:created","user:updated","user:deleted","user:admin:assigned","user:admin:removed","user:builder:assigned","user:builder:removed","user_group:created","user_group:updated","user_group:deleted","user_group:user_added","user_group:users_deleted","user_group:permissions_edited"],A0=[...pO];var dO=fo(Il()),fu=(d=>(d.EQUAL="equal",d.NOT_EQUAL="notEqual",d.EMPTY="empty",d.NOT_EMPTY="notEmpty",d.FUZZY="fuzzy",d.STRING="string",d))(fu||{}),ls=(c=>(c.CONTAINS="contains",c.NOT_CONTAINS="notContains",c.CONTAINS_ANY="containsAny",c.ONE_OF="oneOf",c))(ls||{}),Rl=(r=>(r.RANGE="range",r))(Rl||{}),bl=(o=>(o.AND="$and",o.OR="$or",o))(bl||{});function pd(i){return Object.values(bl).includes(i)}function pE(i){return Object.values(fu).includes(i)}function dE(i){return Object.values(ls).includes(i)}function O_(i){return Object.values(Rl).includes(i)}var wl=(o=>(o.RETURN_ALL="all",o.RETURN_NONE="none",o))(wl||{});var Eb={OptOut:"analytics:opt:out",OptIn:"analytics:opt:in",SelfHostInit:"hosting:init",PluginInit:"plugin:init"};var fs="_";var v_=i=>`${i}${fs}`,Nl=(ie=>(ie.USER="us",ie.GROUP="gr",ie.WORKSPACE="workspace",ie.CONFIG="config",ie.TEMPLATE="template",ie.APP="app",ie.DEV="dev",ie.APP_DEV="app_dev",ie.APP_METADATA="app_metadata",ie.ROLE="role",ie.MIGRATIONS="migrations",ie.DEV_INFO="devinfo",ie.AUTOMATION_LOG="log_au",ie.ACCOUNT_METADATA="acc_metadata",ie.PLUGIN="plg",ie.DATASOURCE="datasource",ie.DATASOURCE_PLUS="datasource_plus",ie.APP_BACKUP="backup",ie.TABLE="ta",ie.ROW="ro",ie.AUTOMATION="au",ie.LINK="li",ie.WEBHOOK="wh",ie.INSTANCE="inst",ie.LAYOUT="layout",ie.SCREEN="screen",ie.QUERY="query",ie.DEPLOYMENTS="deployments",ie.METADATA="metadata",ie.MEM_VIEW="view",ie.USER_FLAG="flag",ie.AUTOMATION_METADATA="meta_au",ie.AUDIT_LOG="al",ie.APP_MIGRATION_METADATA="_design/migrations",ie.SCIM_LOG="scimlog",ie.ROW_ACTIONS="ra",ie.OAUTH2_CONFIG="oauth2",ie.OAUTH2_CONFIG_LOG="oauth2log",ie))(Nl||{}),uw=Object.values(Nl).sort((i,r)=>r.length-i.length);var hE=(o=>(o.VIEW="view",o.ROW_ACTION="row_action",o))(hE||{}),cw=Object.values(hE).sort((i,r)=>r.length-i.length);var Gn=(g=>(g.ROW_SAVED="ROW_SAVED",g.ROW_UPDATED="ROW_UPDATED",g.ROW_DELETED="ROW_DELETED",g.WEBHOOK="WEBHOOK",g.APP="APP",g.CRON="CRON",g.ROW_ACTION="ROW_ACTION",g))(Gn||{});var ft=(j=>(j.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",j.CREATE_ROW="CREATE_ROW",j.UPDATE_ROW="UPDATE_ROW",j.DELETE_ROW="DELETE_ROW",j.EXECUTE_BASH="EXECUTE_BASH",j.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",j.EXECUTE_SCRIPT="EXECUTE_SCRIPT",j.EXECUTE_SCRIPT_V2="EXECUTE_SCRIPT_V2",j.EXECUTE_QUERY="EXECUTE_QUERY",j.SERVER_LOG="SERVER_LOG",j.DELAY="DELAY",j.FILTER="FILTER",j.QUERY_ROWS="QUERY_ROWS",j.LOOP="LOOP",j.COLLECT="COLLECT",j.OPENAI="OPENAI",j.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",j.BRANCH="BRANCH",j.discord="discord",j.slack="slack",j.zapier="zapier",j.integromat="integromat",j.n8n="n8n",j))(ft||{}),fw=[...Object.values(ft),...Object.values(Gn)];var x_=(c=>(c.EQUAL="EQUAL",c.NOT_EQUAL="NOT_EQUAL",c.GREATER_THAN="GREATER_THAN",c.LESS_THAN="LESS_THAN",c))(x_||{});var I_=(d=>(d.GET="GET",d.POST="POST",d.PATCH="PATCH",d.PUT="PUT",d.HEAD="HEAD",d.DELETE="DELETE",d))(I_||{});var mE=(a=>(a.DATASOURCE="datasource",a.COMPONENT="component",a.AUTOMATION="automation",a))(mE||{});var ON=Object.values(mE);var bN=["rows","queries","automations"],wN=["queries","automations"];var pu=(o=>(o.ASCENDING="ascending",o.DESCENDING="descending",o))(pu||{}),hd=(o=>(o.STRING="string",o.NUMBER="number",o))(hd||{});var Ge;(function(i){i.assertEqual=c=>c;function r(c){}i.assertIs=r;function o(c){throw new Error}i.assertNever=o,i.arrayToEnum=c=>{let f={};for(let d of c)f[d]=d;return f},i.getValidEnumValues=c=>{let f=i.objectKeys(c).filter(g=>typeof c[c[g]]!="number"),d={};for(let g of f)d[g]=c[g];return i.objectValues(d)},i.objectValues=c=>i.objectKeys(c).map(function(f){return c[f]}),i.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let f=[];for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&f.push(d);return f},i.find=(c,f)=>{for(let d of c)if(f(d))return d},i.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function a(c,f=" | "){return c.map(d=>typeof d=="string"?`'${d}'`:d).join(f)}i.joinValues=a,i.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Ge||(Ge={}));var b_;(function(i){i.mergeShapes=(r,o)=>({...r,...o})})(b_||(b_={}));var re=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),po=i=>{switch(typeof i){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(i)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(i)?re.array:i===null?re.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?re.promise:typeof Map<"u"&&i instanceof Map?re.map:typeof Set<"u"&&i instanceof Set?re.set:typeof Date<"u"&&i instanceof Date?re.date:re.object;default:return re.unknown}},M=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hO=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),Zr=class i extends Error{constructor(r){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let o=r||function(f){return f.message},a={_errors:[]},c=f=>{for(let d of f.issues)if(d.code==="invalid_union")d.unionErrors.map(c);else if(d.code==="invalid_return_type")c(d.returnTypeError);else if(d.code==="invalid_arguments")c(d.argumentsError);else if(d.path.length===0)a._errors.push(o(d));else{let g=a,E=0;for(;E<d.path.length;){let A=d.path[E];E===d.path.length-1?(g[A]=g[A]||{_errors:[]},g[A]._errors.push(o(d))):g[A]=g[A]||{_errors:[]},g=g[A],E++}}};return c(this),a}static assert(r){if(!(r instanceof i))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=o=>o.message){let o={},a=[];for(let c of this.issues)c.path.length>0?(o[c.path[0]]=o[c.path[0]]||[],o[c.path[0]].push(r(c))):a.push(r(c));return{formErrors:a,fieldErrors:o}}get formErrors(){return this.flatten()}};Zr.create=i=>new Zr(i);var mu=(i,r)=>{let o;switch(i.code){case M.invalid_type:i.received===re.undefined?o="Required":o=`Expected ${i.expected}, received ${i.received}`;break;case M.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(i.expected,Ge.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:o=`Unrecognized key(s) in object: ${Ge.joinValues(i.keys,", ")}`;break;case M.invalid_union:o="Invalid input";break;case M.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Ge.joinValues(i.options)}`;break;case M.invalid_enum_value:o=`Invalid enum value. Expected ${Ge.joinValues(i.options)}, received '${i.received}'`;break;case M.invalid_arguments:o="Invalid function arguments";break;case M.invalid_return_type:o="Invalid function return type";break;case M.invalid_date:o="Invalid date";break;case M.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(o=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?o=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?o=`Invalid input: must end with "${i.validation.endsWith}"`:Ge.assertNever(i.validation):i.validation!=="regex"?o=`Invalid ${i.validation}`:o="Invalid";break;case M.too_small:i.type==="array"?o=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?o=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?o=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?o=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:o="Invalid input";break;case M.too_big:i.type==="array"?o=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?o=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?o=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?o=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?o=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:o="Invalid input";break;case M.custom:o="Invalid input";break;case M.invalid_intersection_types:o="Intersection results could not be merged";break;case M.not_multiple_of:o=`Number must be a multiple of ${i.multipleOf}`;break;case M.not_finite:o="Number must be finite";break;default:o=r.defaultError,Ge.assertNever(i)}return{message:o}},_E=mu;function mO(i){_E=i}function md(){return _E}var gd=i=>{let{data:r,path:o,errorMaps:a,issueData:c}=i,f=[...o,...c.path||[]],d={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let g="",E=a.filter(A=>!!A).slice().reverse();for(let A of E)g=A(d,{data:r,defaultError:g}).message;return{...c,path:f,message:g}},gO=[];function X(i,r){let o=md(),a=gd({issueData:r,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,o,o===mu?void 0:mu].filter(c=>!!c)});i.common.issues.push(a)}var cr=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,o){let a=[];for(let c of o){if(c.status==="aborted")return Ee;c.status==="dirty"&&r.dirty(),a.push(c.value)}return{status:r.value,value:a}}static async mergeObjectAsync(r,o){let a=[];for(let c of o){let f=await c.key,d=await c.value;a.push({key:f,value:d})}return i.mergeObjectSync(r,a)}static mergeObjectSync(r,o){let a={};for(let c of o){let{key:f,value:d}=c;if(f.status==="aborted"||d.status==="aborted")return Ee;f.status==="dirty"&&r.dirty(),d.status==="dirty"&&r.dirty(),f.value!=="__proto__"&&(typeof d.value<"u"||c.alwaysSet)&&(a[f.value]=d.value)}return{status:r.value,value:a}}},Ee=Object.freeze({status:"aborted"}),hu=i=>({status:"dirty",value:i}),Ar=i=>({status:"valid",value:i}),w_=i=>i.status==="aborted",N_=i=>i.status==="dirty",Ll=i=>i.status==="valid",Ul=i=>typeof Promise<"u"&&i instanceof Promise;function yd(i,r,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?i!==r||!a:!r.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(i):a?a.value:r.get(i)}function TE(i,r,o,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?i!==r||!c:!r.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(i,o):c?c.value=o:r.set(i,o),o}var ce;(function(i){i.errToObj=r=>typeof r=="string"?{message:r}:r||{},i.toString=r=>typeof r=="string"?r:r?.message})(ce||(ce={}));var Cl,Dl,_n=class{constructor(r,o,a,c){this._cachedPath=[],this.parent=r,this.data=o,this._path=a,this._key=c}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},gE=(i,r)=>{if(Ll(r))return{success:!0,data:r.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new Zr(i.common.issues);return this._error=o,this._error}}};function we(i){if(!i)return{};let{errorMap:r,invalid_type_error:o,required_error:a,description:c}=i;if(r&&(o||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:c}:{errorMap:(d,g)=>{var E,A;let{message:R}=i;return d.code==="invalid_enum_value"?{message:R??g.defaultError}:typeof g.data>"u"?{message:(E=R??a)!==null&&E!==void 0?E:g.defaultError}:d.code!=="invalid_type"?{message:g.defaultError}:{message:(A=R??o)!==null&&A!==void 0?A:g.defaultError}},description:c}}var Ne=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return po(r.data)}_getOrReturnCtx(r,o){return o||{common:r.parent.common,data:r.data,parsedType:po(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new cr,ctx:{common:r.parent.common,data:r.data,parsedType:po(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let o=this._parse(r);if(Ul(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(r){let o=this._parse(r);return Promise.resolve(o)}parse(r,o){let a=this.safeParse(r,o);if(a.success)return a.data;throw a.error}safeParse(r,o){var a;let c={common:{issues:[],async:(a=o?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:o?.errorMap},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:po(r)},f=this._parseSync({data:r,path:c.path,parent:c});return gE(c,f)}async parseAsync(r,o){let a=await this.safeParseAsync(r,o);if(a.success)return a.data;throw a.error}async safeParseAsync(r,o){let a={common:{issues:[],contextualErrorMap:o?.errorMap,async:!0},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:po(r)},c=this._parse({data:r,path:a.path,parent:a}),f=await(Ul(c)?c:Promise.resolve(c));return gE(a,f)}refine(r,o){let a=c=>typeof o=="string"||typeof o>"u"?{message:o}:typeof o=="function"?o(c):o;return this._refinement((c,f)=>{let d=r(c),g=()=>f.addIssue({code:M.custom,...a(c)});return typeof Promise<"u"&&d instanceof Promise?d.then(E=>E?!0:(g(),!1)):d?!0:(g(),!1)})}refinement(r,o){return this._refinement((a,c)=>r(a)?!0:(c.addIssue(typeof o=="function"?o(a,c):o),!1))}_refinement(r){return new Yr({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return yn.create(this,this._def)}nullable(){return si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ri.create(this,this._def)}promise(){return go.create(this,this._def)}or(r){return _s.create([this,r],this._def)}and(r){return Ts.create(this,r,this._def)}transform(r){return new Yr({...we(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let o=typeof r=="function"?r:()=>r;return new vs({...we(this._def),innerType:this,defaultValue:o,typeName:ye.ZodDefault})}brand(){return new Ml({typeName:ye.ZodBranded,type:this,...we(this._def)})}catch(r){let o=typeof r=="function"?r:()=>r;return new xs({...we(this._def),innerType:this,catchValue:o,typeName:ye.ZodCatch})}describe(r){let o=this.constructor;return new o({...this._def,description:r})}pipe(r){return Pl.create(this,r)}readonly(){return Is.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yO=/^c[^\s-]{8,}$/i,_O=/^[0-9a-z]+$/,TO=/^[0-9A-HJKMNP-TV-Z]{26}$/,EO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AO=/^[a-z0-9_-]{21}$/i,SO=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",R_,xO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IO=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RO=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,EE="((\\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])))",bO=new RegExp(`^${EE}$`);function AE(i){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?r=`${r}\\.\\d{${i.precision}}`:i.precision==null&&(r=`${r}(\\.\\d+)?`),r}function wO(i){return new RegExp(`^${AE(i)}$`)}function SE(i){let r=`${EE}T${AE(i)}`,o=[];return o.push(i.local?"Z?":"Z"),i.offset&&o.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${o.join("|")})`,new RegExp(`^${r}$`)}function NO(i,r){return!!((r==="v4"||!r)&&xO.test(i)||(r==="v6"||!r)&&IO.test(i))}var ho=class i extends Ne{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==re.string){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.string,received:f.parsedType}),Ee}let a=new cr,c;for(let f of this._def.checks)if(f.kind==="min")r.data.length<f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),a.dirty());else if(f.kind==="max")r.data.length>f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),a.dirty());else if(f.kind==="length"){let d=r.data.length>f.value,g=r.data.length<f.value;(d||g)&&(c=this._getOrReturnCtx(r,c),d?X(c,{code:M.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):g&&X(c,{code:M.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),a.dirty())}else if(f.kind==="email")OO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"email",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="emoji")R_||(R_=new RegExp(vO,"u")),R_.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"emoji",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="uuid")EO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"uuid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="nanoid")AO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"nanoid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="cuid")yO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"cuid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="cuid2")_O.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"cuid2",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="ulid")TO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"ulid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="url")try{new URL(r.data)}catch{c=this._getOrReturnCtx(r,c),X(c,{validation:"url",code:M.invalid_string,message:f.message}),a.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"regex",code:M.invalid_string,message:f.message}),a.dirty())):f.kind==="trim"?r.data=r.data.trim():f.kind==="includes"?r.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),a.dirty()):f.kind==="toLowerCase"?r.data=r.data.toLowerCase():f.kind==="toUpperCase"?r.data=r.data.toUpperCase():f.kind==="startsWith"?r.data.startsWith(f.value)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{startsWith:f.value},message:f.message}),a.dirty()):f.kind==="endsWith"?r.data.endsWith(f.value)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{endsWith:f.value},message:f.message}),a.dirty()):f.kind==="datetime"?SE(f).test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"datetime",message:f.message}),a.dirty()):f.kind==="date"?bO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"date",message:f.message}),a.dirty()):f.kind==="time"?wO(f).test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"time",message:f.message}),a.dirty()):f.kind==="duration"?SO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"duration",code:M.invalid_string,message:f.message}),a.dirty()):f.kind==="ip"?NO(r.data,f.version)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"ip",code:M.invalid_string,message:f.message}),a.dirty()):f.kind==="base64"?RO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"base64",code:M.invalid_string,message:f.message}),a.dirty()):Ge.assertNever(f);return{status:a.value,value:r.data}}_regex(r,o,a){return this.refinement(c=>r.test(c),{validation:o,code:M.invalid_string,...ce.errToObj(a)})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...ce.errToObj(r)})}url(r){return this._addCheck({kind:"url",...ce.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...ce.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...ce.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...ce.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...ce.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...ce.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...ce.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...ce.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...ce.errToObj(r)})}datetime(r){var o,a;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(o=r?.offset)!==null&&o!==void 0?o:!1,local:(a=r?.local)!==null&&a!==void 0?a:!1,...ce.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...ce.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...ce.errToObj(r)})}regex(r,o){return this._addCheck({kind:"regex",regex:r,...ce.errToObj(o)})}includes(r,o){return this._addCheck({kind:"includes",value:r,position:o?.position,...ce.errToObj(o?.message)})}startsWith(r,o){return this._addCheck({kind:"startsWith",value:r,...ce.errToObj(o)})}endsWith(r,o){return this._addCheck({kind:"endsWith",value:r,...ce.errToObj(o)})}min(r,o){return this._addCheck({kind:"min",value:r,...ce.errToObj(o)})}max(r,o){return this._addCheck({kind:"max",value:r,...ce.errToObj(o)})}length(r,o){return this._addCheck({kind:"length",value:r,...ce.errToObj(o)})}nonempty(r){return this.min(1,ce.errToObj(r))}trim(){return new i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxLength(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}};ho.create=i=>{var r;return new ho({checks:[],typeName:ye.ZodString,coerce:(r=i?.coerce)!==null&&r!==void 0?r:!1,...we(i)})};function CO(i,r){let o=(i.toString().split(".")[1]||"").length,a=(r.toString().split(".")[1]||"").length,c=o>a?o:a,f=parseInt(i.toFixed(c).replace(".","")),d=parseInt(r.toFixed(c).replace(".",""));return f%d/Math.pow(10,c)}var ps=class i extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==re.number){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.number,received:f.parsedType}),Ee}let a,c=new cr;for(let f of this._def.checks)f.kind==="int"?Ge.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),X(a,{code:M.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?CO(r.data,f.value)!==0&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_finite,message:f.message}),c.dirty()):Ge.assertNever(f);return{status:c.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,ce.toString(o))}gt(r,o){return this.setLimit("min",r,!1,ce.toString(o))}lte(r,o){return this.setLimit("max",r,!0,ce.toString(o))}lt(r,o){return this.setLimit("max",r,!1,ce.toString(o))}setLimit(r,o,a,c){return new i({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:a,message:ce.toString(c)}]})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:ce.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:ce.toString(o)})}finite(r){return this._addCheck({kind:"finite",message:ce.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(r)})}get minValue(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Ge.isInteger(r.value))}get isFinite(){let r=null,o=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(o===null||a.value>o)&&(o=a.value):a.kind==="max"&&(r===null||a.value<r)&&(r=a.value)}return Number.isFinite(o)&&Number.isFinite(r)}};ps.create=i=>new ps({checks:[],typeName:ye.ZodNumber,coerce:i?.coerce||!1,...we(i)});var ds=class i extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==re.bigint){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.bigint,received:f.parsedType}),Ee}let a,c=new cr;for(let f of this._def.checks)f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?r.data%f.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Ge.assertNever(f);return{status:c.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,ce.toString(o))}gt(r,o){return this.setLimit("min",r,!1,ce.toString(o))}lte(r,o){return this.setLimit("max",r,!0,ce.toString(o))}lt(r,o){return this.setLimit("max",r,!1,ce.toString(o))}setLimit(r,o,a,c){return new i({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:a,message:ce.toString(c)}]})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:ce.toString(o)})}get minValue(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}};ds.create=i=>{var r;return new ds({checks:[],typeName:ye.ZodBigInt,coerce:(r=i?.coerce)!==null&&r!==void 0?r:!1,...we(i)})};var hs=class extends Ne{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==re.boolean){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.boolean,received:a.parsedType}),Ee}return Ar(r.data)}};hs.create=i=>new hs({typeName:ye.ZodBoolean,coerce:i?.coerce||!1,...we(i)});var ms=class i extends Ne{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==re.date){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.date,received:f.parsedType}),Ee}if(isNaN(r.data.getTime())){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_date}),Ee}let a=new cr,c;for(let f of this._def.checks)f.kind==="min"?r.data.getTime()<f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),a.dirty()):f.kind==="max"?r.data.getTime()>f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),a.dirty()):Ge.assertNever(f);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}min(r,o){return this._addCheck({kind:"min",value:r.getTime(),message:ce.toString(o)})}max(r,o){return this._addCheck({kind:"max",value:r.getTime(),message:ce.toString(o)})}get minDate(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r!=null?new Date(r):null}};ms.create=i=>new ms({checks:[],coerce:i?.coerce||!1,typeName:ye.ZodDate,...we(i)});var gu=class extends Ne{_parse(r){if(this._getType(r)!==re.symbol){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.symbol,received:a.parsedType}),Ee}return Ar(r.data)}};gu.create=i=>new gu({typeName:ye.ZodSymbol,...we(i)});var gs=class extends Ne{_parse(r){if(this._getType(r)!==re.undefined){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.undefined,received:a.parsedType}),Ee}return Ar(r.data)}};gs.create=i=>new gs({typeName:ye.ZodUndefined,...we(i)});var ys=class extends Ne{_parse(r){if(this._getType(r)!==re.null){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.null,received:a.parsedType}),Ee}return Ar(r.data)}};ys.create=i=>new ys({typeName:ye.ZodNull,...we(i)});var mo=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(r){return Ar(r.data)}};mo.create=i=>new mo({typeName:ye.ZodAny,...we(i)});var Ii=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Ar(r.data)}};Ii.create=i=>new Ii({typeName:ye.ZodUnknown,...we(i)});var Wn=class extends Ne{_parse(r){let o=this._getOrReturnCtx(r);return X(o,{code:M.invalid_type,expected:re.never,received:o.parsedType}),Ee}};Wn.create=i=>new Wn({typeName:ye.ZodNever,...we(i)});var yu=class extends Ne{_parse(r){if(this._getType(r)!==re.undefined){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.void,received:a.parsedType}),Ee}return Ar(r.data)}};yu.create=i=>new yu({typeName:ye.ZodVoid,...we(i)});var Ri=class i extends Ne{_parse(r){let{ctx:o,status:a}=this._processInputParams(r),c=this._def;if(o.parsedType!==re.array)return X(o,{code:M.invalid_type,expected:re.array,received:o.parsedType}),Ee;if(c.exactLength!==null){let d=o.data.length>c.exactLength.value,g=o.data.length<c.exactLength.value;(d||g)&&(X(o,{code:d?M.too_big:M.too_small,minimum:g?c.exactLength.value:void 0,maximum:d?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),a.dirty())}if(c.minLength!==null&&o.data.length<c.minLength.value&&(X(o,{code:M.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),a.dirty()),c.maxLength!==null&&o.data.length>c.maxLength.value&&(X(o,{code:M.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),a.dirty()),o.common.async)return Promise.all([...o.data].map((d,g)=>c.type._parseAsync(new _n(o,d,o.path,g)))).then(d=>cr.mergeArray(a,d));let f=[...o.data].map((d,g)=>c.type._parseSync(new _n(o,d,o.path,g)));return cr.mergeArray(a,f)}get element(){return this._def.type}min(r,o){return new i({...this._def,minLength:{value:r,message:ce.toString(o)}})}max(r,o){return new i({...this._def,maxLength:{value:r,message:ce.toString(o)}})}length(r,o){return new i({...this._def,exactLength:{value:r,message:ce.toString(o)}})}nonempty(r){return this.min(1,r)}};Ri.create=(i,r)=>new Ri({type:i,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...we(r)});function du(i){if(i instanceof Ur){let r={};for(let o in i.shape){let a=i.shape[o];r[o]=yn.create(du(a))}return new Ur({...i._def,shape:()=>r})}else return i instanceof Ri?new Ri({...i._def,type:du(i.element)}):i instanceof yn?yn.create(du(i.unwrap())):i instanceof si?si.create(du(i.unwrap())):i instanceof oi?oi.create(i.items.map(r=>du(r))):i}var Ur=class i extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),o=Ge.objectKeys(r);return this._cached={shape:r,keys:o}}_parse(r){if(this._getType(r)!==re.object){let A=this._getOrReturnCtx(r);return X(A,{code:M.invalid_type,expected:re.object,received:A.parsedType}),Ee}let{status:a,ctx:c}=this._processInputParams(r),{shape:f,keys:d}=this._getCached(),g=[];if(!(this._def.catchall instanceof Wn&&this._def.unknownKeys==="strip"))for(let A in c.data)d.includes(A)||g.push(A);let E=[];for(let A of d){let R=f[A],V=c.data[A];E.push({key:{status:"valid",value:A},value:R._parse(new _n(c,V,c.path,A)),alwaysSet:A in c.data})}if(this._def.catchall instanceof Wn){let A=this._def.unknownKeys;if(A==="passthrough")for(let R of g)E.push({key:{status:"valid",value:R},value:{status:"valid",value:c.data[R]}});else if(A==="strict")g.length>0&&(X(c,{code:M.unrecognized_keys,keys:g}),a.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let R of g){let V=c.data[R];E.push({key:{status:"valid",value:R},value:A._parse(new _n(c,V,c.path,R)),alwaysSet:R in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let A=[];for(let R of E){let V=await R.key,B=await R.value;A.push({key:V,value:B,alwaysSet:R.alwaysSet})}return A}).then(A=>cr.mergeObjectSync(a,A)):cr.mergeObjectSync(a,E)}get shape(){return this._def.shape()}strict(r){return ce.errToObj,new i({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(o,a)=>{var c,f,d,g;let E=(d=(f=(c=this._def).errorMap)===null||f===void 0?void 0:f.call(c,o,a).message)!==null&&d!==void 0?d:a.defaultError;return o.code==="unrecognized_keys"?{message:(g=ce.errToObj(r).message)!==null&&g!==void 0?g:E}:{message:E}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(r){return new i({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new i({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ye.ZodObject})}setKey(r,o){return this.augment({[r]:o})}catchall(r){return new i({...this._def,catchall:r})}pick(r){let o={};return Ge.objectKeys(r).forEach(a=>{r[a]&&this.shape[a]&&(o[a]=this.shape[a])}),new i({...this._def,shape:()=>o})}omit(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{r[a]||(o[a]=this.shape[a])}),new i({...this._def,shape:()=>o})}deepPartial(){return du(this)}partial(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{let c=this.shape[a];r&&!r[a]?o[a]=c:o[a]=c.optional()}),new i({...this._def,shape:()=>o})}required(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{if(r&&!r[a])o[a]=this.shape[a];else{let f=this.shape[a];for(;f instanceof yn;)f=f._def.innerType;o[a]=f}}),new i({...this._def,shape:()=>o})}keyof(){return OE(Ge.objectKeys(this.shape))}};Ur.create=(i,r)=>new Ur({shape:()=>i,unknownKeys:"strip",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});Ur.strictCreate=(i,r)=>new Ur({shape:()=>i,unknownKeys:"strict",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});Ur.lazycreate=(i,r)=>new Ur({shape:i,unknownKeys:"strip",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});var _s=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=this._def.options;function c(f){for(let g of f)if(g.result.status==="valid")return g.result;for(let g of f)if(g.result.status==="dirty")return o.common.issues.push(...g.ctx.common.issues),g.result;let d=f.map(g=>new Zr(g.ctx.common.issues));return X(o,{code:M.invalid_union,unionErrors:d}),Ee}if(o.common.async)return Promise.all(a.map(async f=>{let d={...o,common:{...o.common,issues:[]},parent:null};return{result:await f._parseAsync({data:o.data,path:o.path,parent:d}),ctx:d}})).then(c);{let f,d=[];for(let E of a){let A={...o,common:{...o.common,issues:[]},parent:null},R=E._parseSync({data:o.data,path:o.path,parent:A});if(R.status==="valid")return R;R.status==="dirty"&&!f&&(f={result:R,ctx:A}),A.common.issues.length&&d.push(A.common.issues)}if(f)return o.common.issues.push(...f.ctx.common.issues),f.result;let g=d.map(E=>new Zr(E));return X(o,{code:M.invalid_union,unionErrors:g}),Ee}}get options(){return this._def.options}};_s.create=(i,r)=>new _s({options:i,typeName:ye.ZodUnion,...we(r)});var xi=i=>i instanceof Es?xi(i.schema):i instanceof Yr?xi(i.innerType()):i instanceof As?[i.value]:i instanceof Ss?i.options:i instanceof Os?Ge.objectValues(i.enum):i instanceof vs?xi(i._def.innerType):i instanceof gs?[void 0]:i instanceof ys?[null]:i instanceof yn?[void 0,...xi(i.unwrap())]:i instanceof si?[null,...xi(i.unwrap())]:i instanceof Ml||i instanceof Is?xi(i.unwrap()):i instanceof xs?xi(i._def.innerType):[],_d=class i extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.object)return X(o,{code:M.invalid_type,expected:re.object,received:o.parsedType}),Ee;let a=this.discriminator,c=o.data[a],f=this.optionsMap.get(c);return f?o.common.async?f._parseAsync({data:o.data,path:o.path,parent:o}):f._parseSync({data:o.data,path:o.path,parent:o}):(X(o,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,o,a){let c=new Map;for(let f of o){let d=xi(f.shape[r]);if(!d.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let g of d){if(c.has(g))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(g)}`);c.set(g,f)}}return new i({typeName:ye.ZodDiscriminatedUnion,discriminator:r,options:o,optionsMap:c,...we(a)})}};function C_(i,r){let o=po(i),a=po(r);if(i===r)return{valid:!0,data:i};if(o===re.object&&a===re.object){let c=Ge.objectKeys(r),f=Ge.objectKeys(i).filter(g=>c.indexOf(g)!==-1),d={...i,...r};for(let g of f){let E=C_(i[g],r[g]);if(!E.valid)return{valid:!1};d[g]=E.data}return{valid:!0,data:d}}else if(o===re.array&&a===re.array){if(i.length!==r.length)return{valid:!1};let c=[];for(let f=0;f<i.length;f++){let d=i[f],g=r[f],E=C_(d,g);if(!E.valid)return{valid:!1};c.push(E.data)}return{valid:!0,data:c}}else return o===re.date&&a===re.date&&+i==+r?{valid:!0,data:i}:{valid:!1}}var Ts=class extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r),c=(f,d)=>{if(w_(f)||w_(d))return Ee;let g=C_(f.value,d.value);return g.valid?((N_(f)||N_(d))&&o.dirty(),{status:o.value,value:g.data}):(X(a,{code:M.invalid_intersection_types}),Ee)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([f,d])=>c(f,d)):c(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Ts.create=(i,r,o)=>new Ts({left:i,right:r,typeName:ye.ZodIntersection,...we(o)});var oi=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.array)return X(a,{code:M.invalid_type,expected:re.array,received:a.parsedType}),Ee;if(a.data.length<this._def.items.length)return X(a,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&a.data.length>this._def.items.length&&(X(a,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());let f=[...a.data].map((d,g)=>{let E=this._def.items[g]||this._def.rest;return E?E._parse(new _n(a,d,a.path,g)):null}).filter(d=>!!d);return a.common.async?Promise.all(f).then(d=>cr.mergeArray(o,d)):cr.mergeArray(o,f)}get items(){return this._def.items}rest(r){return new i({...this._def,rest:r})}};oi.create=(i,r)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oi({items:i,typeName:ye.ZodTuple,rest:null,...we(r)})};var Td=class i extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.object)return X(a,{code:M.invalid_type,expected:re.object,received:a.parsedType}),Ee;let c=[],f=this._def.keyType,d=this._def.valueType;for(let g in a.data)c.push({key:f._parse(new _n(a,g,a.path,g)),value:d._parse(new _n(a,a.data[g],a.path,g)),alwaysSet:g in a.data});return a.common.async?cr.mergeObjectAsync(o,c):cr.mergeObjectSync(o,c)}get element(){return this._def.valueType}static create(r,o,a){return o instanceof Ne?new i({keyType:r,valueType:o,typeName:ye.ZodRecord,...we(a)}):new i({keyType:ho.create(),valueType:r,typeName:ye.ZodRecord,...we(o)})}},_u=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.map)return X(a,{code:M.invalid_type,expected:re.map,received:a.parsedType}),Ee;let c=this._def.keyType,f=this._def.valueType,d=[...a.data.entries()].map(([g,E],A)=>({key:c._parse(new _n(a,g,a.path,[A,"key"])),value:f._parse(new _n(a,E,a.path,[A,"value"]))}));if(a.common.async){let g=new Map;return Promise.resolve().then(async()=>{for(let E of d){let A=await E.key,R=await E.value;if(A.status==="aborted"||R.status==="aborted")return Ee;(A.status==="dirty"||R.status==="dirty")&&o.dirty(),g.set(A.value,R.value)}return{status:o.value,value:g}})}else{let g=new Map;for(let E of d){let A=E.key,R=E.value;if(A.status==="aborted"||R.status==="aborted")return Ee;(A.status==="dirty"||R.status==="dirty")&&o.dirty(),g.set(A.value,R.value)}return{status:o.value,value:g}}}};_u.create=(i,r,o)=>new _u({valueType:r,keyType:i,typeName:ye.ZodMap,...we(o)});var Tu=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.set)return X(a,{code:M.invalid_type,expected:re.set,received:a.parsedType}),Ee;let c=this._def;c.minSize!==null&&a.data.size<c.minSize.value&&(X(a,{code:M.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),o.dirty()),c.maxSize!==null&&a.data.size>c.maxSize.value&&(X(a,{code:M.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),o.dirty());let f=this._def.valueType;function d(E){let A=new Set;for(let R of E){if(R.status==="aborted")return Ee;R.status==="dirty"&&o.dirty(),A.add(R.value)}return{status:o.value,value:A}}let g=[...a.data.values()].map((E,A)=>f._parse(new _n(a,E,a.path,A)));return a.common.async?Promise.all(g).then(E=>d(E)):d(g)}min(r,o){return new i({...this._def,minSize:{value:r,message:ce.toString(o)}})}max(r,o){return new i({...this._def,maxSize:{value:r,message:ce.toString(o)}})}size(r,o){return this.min(r,o).max(r,o)}nonempty(r){return this.min(1,r)}};Tu.create=(i,r)=>new Tu({valueType:i,minSize:null,maxSize:null,typeName:ye.ZodSet,...we(r)});var Ed=class i extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.function)return X(o,{code:M.invalid_type,expected:re.function,received:o.parsedType}),Ee;function a(g,E){return gd({data:g,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,md(),mu].filter(A=>!!A),issueData:{code:M.invalid_arguments,argumentsError:E}})}function c(g,E){return gd({data:g,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,md(),mu].filter(A=>!!A),issueData:{code:M.invalid_return_type,returnTypeError:E}})}let f={errorMap:o.common.contextualErrorMap},d=o.data;if(this._def.returns instanceof go){let g=this;return Ar(async function(...E){let A=new Zr([]),R=await g._def.args.parseAsync(E,f).catch(P=>{throw A.addIssue(a(E,P)),A}),V=await Reflect.apply(d,this,R);return await g._def.returns._def.type.parseAsync(V,f).catch(P=>{throw A.addIssue(c(V,P)),A})})}else{let g=this;return Ar(function(...E){let A=g._def.args.safeParse(E,f);if(!A.success)throw new Zr([a(E,A.error)]);let R=Reflect.apply(d,this,A.data),V=g._def.returns.safeParse(R,f);if(!V.success)throw new Zr([c(R,V.error)]);return V.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new i({...this._def,args:oi.create(r).rest(Ii.create())})}returns(r){return new i({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,o,a){return new i({args:r||oi.create([]).rest(Ii.create()),returns:o||Ii.create(),typeName:ye.ZodFunction,...we(a)})}},Es=class extends Ne{get schema(){return this._def.getter()}_parse(r){let{ctx:o}=this._processInputParams(r);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}};Es.create=(i,r)=>new Es({getter:i,typeName:ye.ZodLazy,...we(r)});var As=class extends Ne{_parse(r){if(r.data!==this._def.value){let o=this._getOrReturnCtx(r);return X(o,{received:o.data,code:M.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:r.data}}get value(){return this._def.value}};As.create=(i,r)=>new As({value:i,typeName:ye.ZodLiteral,...we(r)});function OE(i,r){return new Ss({values:i,typeName:ye.ZodEnum,...we(r)})}var Ss=class i extends Ne{constructor(){super(...arguments),Cl.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let o=this._getOrReturnCtx(r),a=this._def.values;return X(o,{expected:Ge.joinValues(a),received:o.parsedType,code:M.invalid_type}),Ee}if(yd(this,Cl,"f")||TE(this,Cl,new Set(this._def.values),"f"),!yd(this,Cl,"f").has(r.data)){let o=this._getOrReturnCtx(r),a=this._def.values;return X(o,{received:o.data,code:M.invalid_enum_value,options:a}),Ee}return Ar(r.data)}get options(){return this._def.values}get enum(){let r={};for(let o of this._def.values)r[o]=o;return r}get Values(){let r={};for(let o of this._def.values)r[o]=o;return r}get Enum(){let r={};for(let o of this._def.values)r[o]=o;return r}extract(r,o=this._def){return i.create(r,{...this._def,...o})}exclude(r,o=this._def){return i.create(this.options.filter(a=>!r.includes(a)),{...this._def,...o})}};Cl=new WeakMap;Ss.create=OE;var Os=class extends Ne{constructor(){super(...arguments),Dl.set(this,void 0)}_parse(r){let o=Ge.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(r);if(a.parsedType!==re.string&&a.parsedType!==re.number){let c=Ge.objectValues(o);return X(a,{expected:Ge.joinValues(c),received:a.parsedType,code:M.invalid_type}),Ee}if(yd(this,Dl,"f")||TE(this,Dl,new Set(Ge.getValidEnumValues(this._def.values)),"f"),!yd(this,Dl,"f").has(r.data)){let c=Ge.objectValues(o);return X(a,{received:a.data,code:M.invalid_enum_value,options:c}),Ee}return Ar(r.data)}get enum(){return this._def.values}};Dl=new WeakMap;Os.create=(i,r)=>new Os({values:i,typeName:ye.ZodNativeEnum,...we(r)});var go=class extends Ne{unwrap(){return this._def.type}_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.promise&&o.common.async===!1)return X(o,{code:M.invalid_type,expected:re.promise,received:o.parsedType}),Ee;let a=o.parsedType===re.promise?o.data:Promise.resolve(o.data);return Ar(a.then(c=>this._def.type.parseAsync(c,{path:o.path,errorMap:o.common.contextualErrorMap})))}};go.create=(i,r)=>new go({type:i,typeName:ye.ZodPromise,...we(r)});var Yr=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:o,ctx:a}=this._processInputParams(r),c=this._def.effect||null,f={addIssue:d=>{X(a,d),d.fatal?o.abort():o.dirty()},get path(){return a.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){let d=c.transform(a.data,f);if(a.common.async)return Promise.resolve(d).then(async g=>{if(o.value==="aborted")return Ee;let E=await this._def.schema._parseAsync({data:g,path:a.path,parent:a});return E.status==="aborted"?Ee:E.status==="dirty"||o.value==="dirty"?hu(E.value):E});{if(o.value==="aborted")return Ee;let g=this._def.schema._parseSync({data:d,path:a.path,parent:a});return g.status==="aborted"?Ee:g.status==="dirty"||o.value==="dirty"?hu(g.value):g}}if(c.type==="refinement"){let d=g=>{let E=c.refinement(g,f);if(a.common.async)return Promise.resolve(E);if(E instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return g};if(a.common.async===!1){let g=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return g.status==="aborted"?Ee:(g.status==="dirty"&&o.dirty(),d(g.value),{status:o.value,value:g.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(g=>g.status==="aborted"?Ee:(g.status==="dirty"&&o.dirty(),d(g.value).then(()=>({status:o.value,value:g.value}))))}if(c.type==="transform")if(a.common.async===!1){let d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ll(d))return d;let g=c.transform(d.value,f);if(g instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:g}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Ll(d)?Promise.resolve(c.transform(d.value,f)).then(g=>({status:o.value,value:g})):d);Ge.assertNever(c)}};Yr.create=(i,r,o)=>new Yr({schema:i,typeName:ye.ZodEffects,effect:r,...we(o)});Yr.createWithPreprocess=(i,r,o)=>new Yr({schema:r,effect:{type:"preprocess",transform:i},typeName:ye.ZodEffects,...we(o)});var yn=class extends Ne{_parse(r){return this._getType(r)===re.undefined?Ar(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};yn.create=(i,r)=>new yn({innerType:i,typeName:ye.ZodOptional,...we(r)});var si=class extends Ne{_parse(r){return this._getType(r)===re.null?Ar(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};si.create=(i,r)=>new si({innerType:i,typeName:ye.ZodNullable,...we(r)});var vs=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=o.data;return o.parsedType===re.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:o.path,parent:o})}removeDefault(){return this._def.innerType}};vs.create=(i,r)=>new vs({innerType:i,typeName:ye.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...we(r)});var xs=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a={...o,common:{...o.common,issues:[]}},c=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ul(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new Zr(a.common.issues)},input:a.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Zr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};xs.create=(i,r)=>new xs({innerType:i,typeName:ye.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...we(r)});var Eu=class extends Ne{_parse(r){if(this._getType(r)!==re.nan){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.nan,received:a.parsedType}),Ee}return{status:"valid",value:r.data}}};Eu.create=i=>new Eu({typeName:ye.ZodNaN,...we(i)});var DO=Symbol("zod_brand"),Ml=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=o.data;return this._def.type._parse({data:a,path:o.path,parent:o})}unwrap(){return this._def.type}},Pl=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.common.async)return(async()=>{let f=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?Ee:f.status==="dirty"?(o.dirty(),hu(f.value)):this._def.out._parseAsync({data:f.value,path:a.path,parent:a})})();{let c=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?Ee:c.status==="dirty"?(o.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:a.path,parent:a})}}static create(r,o){return new i({in:r,out:o,typeName:ye.ZodPipeline})}},Is=class extends Ne{_parse(r){let o=this._def.innerType._parse(r),a=c=>(Ll(c)&&(c.value=Object.freeze(c.value)),c);return Ul(o)?o.then(c=>a(c)):a(o)}unwrap(){return this._def.innerType}};Is.create=(i,r)=>new Is({innerType:i,typeName:ye.ZodReadonly,...we(r)});function vE(i,r={},o){return i?mo.create().superRefine((a,c)=>{var f,d;if(!i(a)){let g=typeof r=="function"?r(a):typeof r=="string"?{message:r}:r,E=(d=(f=g.fatal)!==null&&f!==void 0?f:o)!==null&&d!==void 0?d:!0,A=typeof g=="string"?{message:g}:g;c.addIssue({code:"custom",...A,fatal:E})}}):mo.create()}var LO={object:Ur.lazycreate},ye;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(ye||(ye={}));var UO=(i,r={message:`Input not instance of ${i.name}`})=>vE(o=>o instanceof i,r),xE=ho.create,IE=ps.create,MO=Eu.create,PO=ds.create,RE=hs.create,FO=ms.create,kO=gu.create,BO=gs.create,GO=ys.create,WO=mo.create,VO=Ii.create,qO=Wn.create,$O=yu.create,HO=Ri.create,zO=Ur.create,ZO=Ur.strictCreate,YO=_s.create,QO=_d.create,jO=Ts.create,KO=oi.create,JO=Td.create,XO=_u.create,ev=Tu.create,tv=Ed.create,rv=Es.create,nv=As.create,iv=Ss.create,ov=Os.create,sv=go.create,yE=Yr.create,av=yn.create,uv=si.create,cv=Yr.createWithPreprocess,lv=Pl.create,fv=()=>xE().optional(),pv=()=>IE().optional(),dv=()=>RE().optional(),hv={string:i=>ho.create({...i,coerce:!0}),number:i=>ps.create({...i,coerce:!0}),boolean:i=>hs.create({...i,coerce:!0}),bigint:i=>ds.create({...i,coerce:!0}),date:i=>ms.create({...i,coerce:!0})},mv=Ee,Ue=Object.freeze({__proto__:null,defaultErrorMap:mu,setErrorMap:mO,getErrorMap:md,makeIssue:gd,EMPTY_PATH:gO,addIssueToContext:X,ParseStatus:cr,INVALID:Ee,DIRTY:hu,OK:Ar,isAborted:w_,isDirty:N_,isValid:Ll,isAsync:Ul,get util(){return Ge},get objectUtil(){return b_},ZodParsedType:re,getParsedType:po,ZodType:Ne,datetimeRegex:SE,ZodString:ho,ZodNumber:ps,ZodBigInt:ds,ZodBoolean:hs,ZodDate:ms,ZodSymbol:gu,ZodUndefined:gs,ZodNull:ys,ZodAny:mo,ZodUnknown:Ii,ZodNever:Wn,ZodVoid:yu,ZodArray:Ri,ZodObject:Ur,ZodUnion:_s,ZodDiscriminatedUnion:_d,ZodIntersection:Ts,ZodTuple:oi,ZodRecord:Td,ZodMap:_u,ZodSet:Tu,ZodFunction:Ed,ZodLazy:Es,ZodLiteral:As,ZodEnum:Ss,ZodNativeEnum:Os,ZodPromise:go,ZodEffects:Yr,ZodTransformer:Yr,ZodOptional:yn,ZodNullable:si,ZodDefault:vs,ZodCatch:xs,ZodNaN:Eu,BRAND:DO,ZodBranded:Ml,ZodPipeline:Pl,ZodReadonly:Is,custom:vE,Schema:Ne,ZodSchema:Ne,late:LO,get ZodFirstPartyTypeKind(){return ye},coerce:hv,any:WO,array:HO,bigint:PO,boolean:RE,date:FO,discriminatedUnion:QO,effect:yE,enum:iv,function:tv,instanceof:UO,intersection:jO,lazy:rv,literal:nv,map:XO,nan:MO,nativeEnum:ov,never:qO,null:GO,nullable:uv,number:IE,object:zO,oboolean:dv,onumber:pv,optional:av,ostring:fv,pipeline:lv,preprocess:cv,promise:sv,record:JO,set:ev,strictObject:ZO,string:xE,symbol:kO,transformer:yE,tuple:KO,undefined:BO,union:YO,unknown:VO,void:$O,NEVER:mv,ZodIssueCode:M,quotelessJson:hO,ZodError:Zr});var vd=Ue.string().refine(i=>i!=="_complexIdOperator",{message:"Key '_complexIdOperator' is not allowed"}),bE=Ue.record(vd,Ue.string()),Ad=Ue.record(vd,Ue.any()),Sd=Ue.record(vd,Ue.union([Ue.any().array(),Ue.string()])),wE=Ue.lazy(()=>Ue.object({conditions:Ue.array(Ue.object(NE))})),Od=Ue.union([Ue.string(),Ue.number()]),NE={string:bE.optional(),fuzzy:bE.optional(),range:Ue.record(vd,Ue.union([Ue.object({high:Od,low:Od}),Ue.object({high:Od}),Ue.object({low:Od})])).optional(),equal:Ad.optional(),notEqual:Ad.optional(),empty:Ad.optional(),notEmpty:Ad.optional(),oneOf:Sd.optional(),contains:Sd.optional(),notContains:Sd.optional(),containsAny:Sd.optional(),$and:wE.optional(),$or:wE.optional()},SC=Ue.object({query:Ue.object({allOr:Ue.boolean().optional(),onEmptyFilter:Ue.nativeEnum(wl).optional(),...NE}).optional(),paginate:Ue.boolean().optional(),bookmark:Ue.union([Ue.string(),Ue.number()]).nullish(),limit:Ue.number().optional(),sort:Ue.string().nullish(),sortOrder:Ue.nativeEnum(pu).optional(),sortType:Ue.nativeEnum(hd).nullish(),version:Ue.string().optional(),disableEscaping:Ue.boolean().optional(),countRows:Ue.boolean().optional()});var gv={SUMMARISE_TEXT:{label:"Summarise Text",value:"SUMMARISE_TEXT"},CLEAN_DATA:{label:"Clean Data",value:"CLEAN_DATA"},TRANSLATE:{label:"Translate",value:"TRANSLATE"},CATEGORISE_TEXT:{label:"Categorise Text",value:"CATEGORISE_TEXT"},SENTIMENT_ANALYSIS:{label:"Sentiment Analysis",value:"SENTIMENT_ANALYSIS"},PROMPT:{label:"Prompt",value:"PROMPT"},SEARCH_WEB:{label:"Search Web",value:"SEARCH_WEB"}},yv={MULTI_COLUMN:"columns",COLUMN:"column",BINDABLE_TEXT:"prompt"},_v={SUMMARISE_TEXT:{columns:"columns"},CLEAN_DATA:{column:"column"},TRANSLATE:{column:"column",language:"prompt"},CATEGORISE_TEXT:{columns:"columns",categories:"prompt"},SENTIMENT_ANALYSIS:{column:"column"},PROMPT:{prompt:"prompt"},SEARCH_WEB:{columns:"columns"}};var CE=(ae=>(ae.API_KEY="x-budibase-api-key",ae.LICENSE_KEY="x-budibase-license-key",ae.API_VER="x-budibase-api-version",ae.APP_ID="x-budibase-app-id",ae.SESSION_ID="x-budibase-session-id",ae.TYPE="x-budibase-type",ae.PREVIEW_ROLE="x-budibase-role",ae.TENANT_ID="x-budibase-tenant-id",ae.VERIFICATION_CODE="x-budibase-verification-code",ae.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",ae.RESET_PASSWORD_CODE="x-budibase-reset-password-code",ae.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",ae.TOKEN="x-budibase-token",ae.CSRF_TOKEN="x-csrf-token",ae.CORRELATION_ID="x-budibase-correlation-id",ae.AUTHORIZATION="authorization",ae.MIGRATING_APP="x-budibase-migrating-app",ae.COOKIE="cookie",ae))(CE||{});var Tv={string:["string","options","longform","barcodeqr"],options:["options","string","longform","barcodeqr"],longform:["longform","string","options","barcodeqr"],barcodeqr:["barcodeqr","string","options","longform"],number:["number","boolean"]};var xd=["_id","_rev","type","createdAt","updatedAt","tableId"],DE=["_id","_rev","tableId"];function Ev(i){return xd.includes(i)}function Av(i){return DE.includes(i)}var LE=(d=>(d.ADMIN="var(--spectrum-global-color-static-red-400)",d.POWER="var(--spectrum-global-color-static-orange-400)",d.BASIC="var(--spectrum-global-color-static-green-400)",d.PUBLIC="var(--spectrum-global-color-static-blue-400)",d.BUILDER="var(--spectrum-global-color-static-magenta-600)",d.DEFAULT_CUSTOM="var(--spectrum-global-color-static-magenta-400)",d))(LE||{});var Au="spectrum--",Ov="darkest",vv="light",Id=[{id:"light",name:"Light"},{id:"darkest",name:"Dark"},{id:"nord",name:"Nord",base:"darkest"},{id:"midnight",name:"Midnight",base:"darkest"}];var Mr={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than or equal to"},LessThan:{value:"rangeHigh",label:"Less than or equal to"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},D_={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}},UE=(a=>(a.UserUpdate="UserUpdate",a.UserDisconnect="UserDisconnect",a.Heartbeat="Heartbeat",a))(UE||{}),ME=(c=>(c.RowChange="RowChange",c.DatasourceChange="DatasourceChange",c.SelectDatasource="SelectDatasource",c.SelectCell="SelectCell",c))(ME||{}),PE=(R=>(R.SelectApp="SelectApp",R.TableChange="TableChange",R.DatasourceChange="DatasourceChange",R.LockTransfer="LockTransfer",R.ScreenChange="ScreenChange",R.AppMetadataChange="AppMetadataChange",R.SelectResource="SelectResource",R.AppPublishChange="AppPublishChange",R.AutomationChange="AutomationChange",R.RoleChange="RoleChange",R))(PE||{}),xv=60,Iv=/^[^()]*$/,Rv=/^[_a-zA-Z0-9\s]*$/g,bv=/^[a-z_][a-z0-9_]*$/i,wv="@reboot",Nv=["7z","action","apk","app","bat","bin","cab","cmd","com","command","cpl","csh","ex_","exe","gadget","inf1","ins","inx","ipa","isu","job","js","jse","ksh","lnk","msc","msi","msp","mst","osx","out","paf","php","pif","prg","ps1","reg","rgs","run","scr","sct","shb","shs","tar","u3p","vb","vbe","vbs","vbscript","wasm","workflow","ws","wsf","wsh","zip"],FE=(o=>(o.ONBOARDING="budibase:onboarding:correlationkey",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",o))(FE||{}),kE=(o=>(o.ONBOARDING="budibase:onboarding:instancekey",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:instancekey",o))(kE||{}),BE=(o=>(o.ONBOARDING="budibase:onboarding:status",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:status",o))(BE||{}),GE=(f=>(f.STARTED="started",f.COMPLETING_ACCOUNT_INFO="completing_account_info",f.VERIFYING_EMAIL="verifying_email",f.COMPLETED="completed",f.FAILED="failed",f))(GE||{}),Cv="datasource_internal_bb_default";var IT={};Le(IT,{ColumnSplitter:()=>ET,NoEmptyFilterStrings:()=>LS,buildQuery:()=>US,cleanupQuery:()=>OT,fixupFilterArrays:()=>xT,getKeyNumbering:()=>vT,getValidOperatorsForType:()=>cR,hasFilters:()=>AT,limit:()=>PS,recurseLogicalOperators:()=>ST,removeKeyNumbering:()=>Rd,runQuery:()=>Hd,search:()=>pR,sort:()=>MS,splitFiltersArray:()=>bd});var Nu=fo(WE());var P_={};Le(P_,{filterValueToLabel:()=>Fv,hasSchema:()=>kv,isSupportedUserSearch:()=>qE,parallelForeach:()=>Pv,processSearchFilters:()=>M_,trimOtherProps:()=>Bv,unreachable:()=>Mv});var VE=fo(Il()),Uv=["field","operator","value","type","externalType","valueType","noValue","formulaType"];function Mv(i,r){let o=r?.message||`No such case in exhaustive switch: ${i}`;if(!!!r?.doNotThrow)throw new Error(o)}async function Pv(i,r,o){let a=[],c=0,f=async g=>{try{await r(g)}finally{d()}},d=()=>{if(c>=i.length)return;let g=i[c];c++;let E=f(g);a.push(E),a.length>=o?Promise.race(a).then(d):d()};d(),await Promise.all(a)}function Fv(){return Object.keys(Mr).reduce((i,r)=>{let a=Mr[r];return i[a.value]=a.label,i},{})}function kv(i){return typeof i=="object"&&!Array.isArray(i)&&i!==null&&!(i instanceof Date)&&Object.keys(i).length>0}function Bv(i,r){return Object.keys(i).filter(a=>r.includes(a)).reduce((a,c)=>({...a,[c]:i[c]}),{})}function qE(i){let r=[{op:"string",key:"email"},{op:"equal",key:"_id"},{op:"oneOf",key:"_id"}],{allOr:o,onEmptyFilter:a,...c}=i;for(let[f,d]of Object.entries(c)){if(typeof d!="object")return!1;if(pd(f)){for(let A of i[f].conditions)if(!qE(A))return!1;return!0}let g=Object.keys(d||{});if(g.length===0)continue;if(!r.find(A=>A.op===f&&g.length===1&&g[0]===A.key))return!1}return!0}function M_(i){if(!i||i.length===0)return;let{allOr:r,onEmptyFilter:o,filters:a}=bd(i);return{logicalOperator:"all",onEmptyFilter:o||"all",groups:[{logicalOperator:r?"any":"all",filters:a.map(c=>{let f=VE.default.pick(c,Uv);return f.field=Rd(f.field),f})}]}}var TT={};Le(TT,{cancelableTimeout:()=>$E,cron:()=>dT,deepGet:()=>F_,getUserColor:()=>Wv,getUserInitials:()=>Gv,getUserLabel:()=>Vv,isGoogleSheets:()=>$v,isSQL:()=>Hv,lists:()=>_T,retry:()=>zv,roles:()=>yT,schema:()=>Zl,views:()=>gT,wait:()=>k_,withTimeout:()=>qv});var F_=(i,r)=>{if(!i||!r)return null;if(Object.prototype.hasOwnProperty.call(i,r))return i[r];let o=r.split(".");for(let a=0;a<o.length;a++)i=i?.[o[a]];return i},Gv=i=>{if(!i)return"?";let r="";return r+=i.firstName?i.firstName[0]:"",r+=i.lastName?i.lastName[0]:"",r!==""?r:i.email?.[0]||"U"},Wv=i=>{let r=i?._id;if(!r)return"var(--spectrum-global-color-blue-400)";r=r.replace("ro_ta_users_","");let o=1;for(let a=0;a<r.length;a++)o+=r.charCodeAt(a),o=o%36;return`hsl(${o*10}, 50%, 40%)`},Vv=i=>{if(!i)return"";let{firstName:r,lastName:o,email:a}=i;return r&&o?`${r} ${o}`:r||o||a};function $E(i){let r;return[new Promise((o,a)=>{r=setTimeout(()=>{a({status:301,errno:"ETIME"})},i)}),()=>{clearTimeout(r)}]}async function qv(i,r){let[o,a]=$E(i),c=await Promise.race([r(),o]);return a(),c}function $v(i){return i==="GOOGLE_SHEETS"}function Hv(i){return!i||!i.source?!1:["POSTGRES","SQL_SERVER","MYSQL","ORACLE"].indexOf(i.source)!==-1||i.isSQL===!0}async function k_(i){return new Promise(r=>setTimeout(r,i))}async function zv(i,r){let{times:o=3}=r||{};if(o<1)throw new Error(`invalid retry count: ${o}`);let a;for(let c=0;c<o;c++){let f=1.5**c*1e3*(Math.random()+.5);await k_(f);try{return await i()}catch(d){a=d}}throw a}var dT={};Le(dT,{getNextExecutionDates:()=>zI,validate:()=>ZI});var bS=fo(require("cron-validate")),wS=fo(IS()),RS="(Input cron: ",$I={"smaller than lower limit":"less than","bigger than upper limit":"greater than",daysOfMonth:"'days of the month'",daysOfWeek:"'days of the week'",years:"'years'",months:"'months'",hours:"'hours'",minutes:"'minutes'",seconds:"'seconds'"};function HI(i){let r=[];for(let o of i){o.includes(RS)&&(o=o.split(RS)[0].trim());for(let[a,c]of Object.entries($I))o.includes(a)&&(o=o.replace(new RegExp(a,"g"),c));r.push(o)}return r}function zI(i,r=4){let o=wS.default.parseExpression(i),a=[];for(let c=0;c<r;c++)a.push(o.next().toString());return a}function ZI(i){let r=(0,bS.default)(i,{preset:"npm-cron-schedule",override:{useSeconds:!1}});return r.isValid()?{valid:!0}:{valid:!1,err:HI(r.getError())}}var Zl={};Le(Zl,{decodeNonAscii:()=>hT,encodeNonAscii:()=>jI,isDeprecatedSingleUserColumn:()=>YI,isNumeric:()=>KI,isRequired:()=>QI});function YI(i){return i.type==="bb_reference"&&i.subtype==="user"&&i.constraints?.type!=="array"}function QI(i){return!!i&&(typeof i.presence!="boolean"&&i.presence?.allowEmpty===!1||i.presence===!0)}function jI(i){return i.split("").map(r=>r.charCodeAt(0)>127?"\\u"+r.charCodeAt(0).toString(16).padStart(4,"0"):r).join("")}function hT(i){return i.replace(/\\u([0-9a-fA-F]{4})/g,(r,o)=>String.fromCharCode(parseInt(o,16)))}function KI(i){return i.type==="number"||i.type==="bigint"}var gT={};Le(gT,{basicFields:()=>rR,calculationFields:()=>tR,hasCalculationFields:()=>eR,isBasicViewField:()=>JI,isCalculationField:()=>Yl,isCalculationView:()=>XI,isV2:()=>nR,isVisible:()=>NS});var mT=fo(Il());function Yl(i){return"calculationType"in i}function JI(i){return!Yl(i)}function XI(i){return i.type==="calculation"}function eR(i){return Object.values(i.schema||{}).some(Yl)}function tR(i){return(0,mT.pickBy)(i.schema||{},Yl)}function NS(i){return i.visible!==!1}function rR(i,r){let{visible:o=!0}=r||{};return(0,mT.pickBy)(i.schema||{},a=>!Yl(a)&&(!o||NS(a)))}function nR(i){return i.version===2}var yT={};Le(yT,{checkForRoleInheritanceLoops:()=>oR});function iR(i){return`role${fs}${i}`}function oR(i){let r=new Map;i.forEach(f=>{r.set(f._id,f)});let o=new Set,a=new Set;function c(f){let d=iR(f);if(a.has(f)||a.has(d))return!0;if(o.has(f)||o.has(d))return!1;a.add(f);let g=r.get(d)||r.get(f);if(!g)return a.delete(f),!1;let E=Array.isArray(g.inherits)?g.inherits:[g.inherits];for(let A of E)if(A&&c(A))return!0;return a.delete(f),o.add(f),!1}return!!i.find(f=>c(f._id))}var _T={};Le(_T,{punctuateList:()=>sR});function sR(i){return i.length===0?"":i.length===1?i[0]:i.length===2?i.join(" and "):i.slice(0,-1).join(", ")+" and "+i[i.length-1]}var Ps=fo(Il());var aR=/{{([^{].*?)}}/g,DS=Object.values(bl),uR=[...Object.values(fu),...Object.values(ls),...Object.values(Rl)],cR=(i,r,o)=>{let a=Mr,c=[a.Equals,a.NotEquals,a.StartsWith,a.Like,a.Empty,a.NotEmpty,a.In],f=[a.Equals,a.NotEquals,a.MoreThan,a.LessThan,a.Empty,a.NotEmpty,a.In],d=[],{type:g,formulaType:E}=i;g==="string"?d=c:g==="number"||g==="bigint"?d=f:g==="options"?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty,a.In]:g==="array"?d=[a.Contains,a.NotContains,a.Empty,a.NotEmpty,a.ContainsAny]:g==="boolean"?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty]:g==="longform"?d=c:g==="datetime"?d=f:g==="formula"&&E==="static"?d=c.concat([a.MoreThan,a.LessThan]):g==="ai"?d=c.concat([a.MoreThan,a.LessThan]):g==="bb_reference_single"||Zl.isDeprecatedSingleUserColumn(i)?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty,a.In]:g==="bb_reference"&&(d=[a.Contains,a.NotContains,a.ContainsAny,a.Empty,a.NotEmpty]);let A=o?.tableId?.includes("datasource_plus");return r==="_id"&&A&&(d=[a.Equals,a.NotEquals,a.In]),d},LS=[Mr.StartsWith.value,Mr.Like.value,Mr.Equals.value,Mr.NotEquals.value,Mr.Contains.value,Mr.NotContains.value,Mr.ContainsAny.value,Mr.In.value];function ST(i,r){for(let o of DS)i[o]&&(i[o].conditions=i[o].conditions.map(a=>r(a)));return i}var OT=i=>{for(let r of LS)if(i[r])for(let o of Object.keys(i)){if(o!==r)continue;if(typeof i[o]=="object")for(let[c,f]of Object.entries(i[o]))(f==null||f===""||lR(f))&&delete i[r][c]}return i=ST(i,OT),i};function lR(i){return Array.isArray(i)&&i.length===0}var Rd=i=>vT(i).key,vT=i=>{if(typeof i=="string"&&i.match(/\d[0-9]*:/g)!=null){let r=i.split(":");return{prefix:`${r.shift()}:`,key:r.join(":")}}else return{key:i}},ET=class{constructor(r,o){if(this.tableNames=r.map(a=>a.name),this.tableIds=r.map(a=>a._id),this.relationshipColumnNames=r.flatMap(a=>Object.keys(a.schema).filter(c=>a.schema[c].type==="link")),this.relationships=this.tableNames.concat(this.tableIds).concat(this.relationshipColumnNames).sort((a,c)=>c.length-a.length),o?.aliases){this.aliases={};for(let[a,c]of Object.entries(o.aliases))this.aliases[c]=a}this.columnPrefix=o?.columnPrefix}run(r){let{prefix:o,key:a}=vT(r),c;if(this.aliases)for(let d of Object.keys(this.aliases||{})){let g=`${d}.`;a.startsWith(g)&&(c=this.aliases[d],a=a.slice(g.length))}let f;for(let d of this.relationships){let g=`${d}.`;if(a.startsWith(g)){let E=a.split(g);E.shift(),f=g,a=E.join(".");break}}return this.columnPrefix&&a.startsWith(this.columnPrefix)&&(a=hT(a.slice(this.columnPrefix.length))),{tableName:c,numberPrefix:o,relationshipPrefix:f,column:a}}};function fR(i){if(!i||!i?.operator||!i?.field)return;let r={},{operator:o,field:a,type:c,externalType:f}=i,{value:d}=i;(o==="empty"||o==="notEmpty")&&(d=null);let g=typeof d=="string"&&(d.match(aR)||[]).length>0;switch(c){case"datetime":if(!g&&o!=="empty"&&o!=="notEmpty"){if(!d)return;d=new Date(d).toISOString()}break;case"number":typeof d=="string"&&!g&&(o==="oneOf"?d=d.split(",").map(parseFloat):d=parseFloat(d));break;case"boolean":d=`${d}`.toLowerCase()==="true";break;case"array":["contains","notContains","containsAny"].includes(o.toLocaleString())&&typeof d=="string"&&(d=d.split(","));break}if(O_(o)){let A=D_[f]||{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER};r[o]??={},r[o][a]={low:c==="number"?A.min:"0000-00-00T00:00:00.000Z",high:c==="number"?A.max:"9999-00-00T00:00:00.000Z"}}else if(o==="rangeHigh"&&d!=null&&d!=="")r.range??={},r.range[a]={...r.range[a],high:d};else if(o==="rangeLow"&&d!=null&&d!=="")r.range??={},r.range[a]={...r.range[a],low:d};else if(pE(o)||dE(o)||O_(o))c==="boolean"?o==="equal"&&d===!1?(r.notEqual=r.notEqual||{},r.notEqual[a]=!0):o==="notEqual"&&d===!1?(r.equal=r.equal||{},r.equal[a]=!0):(r[o]??={},r[o][a]=d):(r[o]??={},r[o][a]=d);else throw new Error(`Unsupported operator: ${o}`);return r}function bd(i){let r={filters:[]};for(let o of i)"operator"in o&&o.operator==="allOr"?r.allOr=!0:"onEmptyFilter"in o?r.onEmptyFilter=o.onEmptyFilter:r.filters.push(o);return r}function US(i){if(!i)return{};if(Array.isArray(i)&&(i=M_(i),!i))return{};let r={};i.onEmptyFilter?r.onEmptyFilter=i.onEmptyFilter:r.onEmptyFilter="all";let o=CS(i.logicalOperator||"all");return r[o]={conditions:(i.groups||[]).map(a=>{if(a.groups){let E=US(a);return delete E.onEmptyFilter,E}let{allOr:c,onEmptyFilter:f,filters:d}=bd(a.filters||[]);f&&(r.onEmptyFilter=f);let g=c?"$or":"$and";return a.logicalOperator&&(g=CS(a.logicalOperator)),{[g]:{conditions:d.map(fR).filter(E=>E)}}})},r}function CS(i){return i==="all"?"$and":"$or"}function xT(i){if(!i)return i;for(let r of Object.values(ls)){let o=i[r];if(!(o==null||!(0,Ps.isPlainObject)(o)))for(let a of Object.keys(o)){if(Array.isArray(o[a]))continue;let c=o[a];typeof c=="string"?o[a]=c.split(",").map(f=>f.trim()):o[a]=[c]}}return ST(i,xT),i}function pR(i,r){let o=Hd(i,r.query);r.sort&&(o=MS(o,r.sort,r.sortOrder||"ascending",r.sortType));let a=o.length;r.limit&&(o=PS(o,r.limit.toString()));let c={rows:o};return r.countRows&&(c.totalRows=a),c}function Hd(i,r){if(!i||!Array.isArray(i))return[];if(!r)return i;if(r=OT(r),r=xT(r),!AT(r)&&r.onEmptyFilter==="none")return[];let o=(q,k)=>j=>{for(let[se,le]of Object.entries(r[q]||{})){let ot=pd(q)?j:F_(j,Rd(se)),An=k(ot,le);if(r.allOr&&An)return!0;if(!r.allOr&&!An)return!1}return!r.allOr},a=o("string",(q,k)=>typeof q!="string"||typeof k!="string"?!1:q.toLowerCase().startsWith(k.toLowerCase())),c=o("fuzzy",(q,k)=>typeof q!="string"||typeof k!="string"?!1:q.toLowerCase().includes(k.toLowerCase())),f=o("range",(q,k)=>{if(q==null||q===""||((0,Ps.isPlainObject)(k.low)&&(0,Ps.isEmpty)(k.low)&&(k.low=void 0),(0,Ps.isPlainObject)(k.high)&&(0,Ps.isEmpty)(k.high)&&(k.high=void 0),k.low==null&&k.high==null))return!1;let j=+q;if(!isNaN(j)){let le=+k.low,ot=+k.high;if(!isNaN(le)&&!isNaN(ot))return j>=le&&j<=ot;if(isNaN(le)){if(!isNaN(ot))return j<=ot}else return j>=le}let se=(0,Nu.default)(q);if(se.isValid()){let le=(0,Nu.default)(k.low||"0000-00-00T00:00:00.000Z"),ot=(0,Nu.default)(k.high||"9999-00-00T00:00:00.000Z");if(le.isValid()&&ot.isValid())return se.isAfter(le)&&se.isBefore(ot)||se.isSame(le)||se.isSame(ot);if(le.isValid())return se.isAfter(le)||se.isSame(le);if(ot.isValid())return se.isBefore(ot)||se.isSame(ot)}return k.low!=null&&k.high!=null?q>=k.low&&q<=k.high:k.low!=null?q>=k.low:k.high!=null?q<=k.high:!1}),d=(q,k)=>{if(Array.isArray(q)){for(let se of q)if(d(se,k))return!0;return!1}if(q&&typeof q=="object"&&typeof k=="string")return q._id===k;if(q===k)return!0;if(q==null&&k!=null||q!=null&&k==null)return!1;let j=(0,Nu.default)(q);if(j.isValid()){let se=(0,Nu.default)(k);if(se.isValid())return j.isSame(se)}return!1},g=q=>(...k)=>!q(...k),E=o("equal",d),A=o("notEqual",g(d)),R=q=>typeof q=="string"?q==="":Array.isArray(q)?q.length===0:q&&typeof q=="object"?Object.keys(q).length===0:q==null,V=o("empty",R),B=o("notEmpty",g(R)),P=o("oneOf",(q,k)=>(typeof k=="string"&&(k=k.split(",")),typeof q=="number"&&(k=k.map(j=>parseFloat(j))),Array.isArray(k)?k.some(j=>d(q,j)):!1)),Z=q=>(k,j)=>!Array.isArray(k)||(typeof j=="string"&&(j=j.split(","),typeof k[0]=="number"&&(j=j.map(se=>parseFloat(se)))),!Array.isArray(j))?!1:j.length===0?!0:j[q](se=>d(k,se)),_e=o("contains",(q,k)=>Array.isArray(k)&&k.length===0?!0:Z("every")(q,k)),Ce=o("notContains",(q,k)=>Array.isArray(k)&&k.length===0?!0:g(Z("every"))(q,k)),J=o("containsAny",Z("some")),ae=o("$and",(q,k)=>{if(!k.length)return!1;for(let j of k)if(!Hd([q],j).length)return!1;return!0}),Ie=o("$or",(q,k)=>{if(!k.length)return!1;for(let j of k)if(Hd([q],{...j,allOr:!0}).length)return!0;return!1}),Me=q=>{let k={string:a,fuzzy:c,range:f,equal:E,notEqual:A,empty:V,notEmpty:B,oneOf:P,contains:_e,containsAny:J,notContains:Ce,$and:ae,$or:Ie},j=Object.entries(r||{}).filter(([se,le])=>!["allOr","onEmptyFilter"].includes(se)&&le&&Object.keys(le).length>0).map(([se])=>k[se]?.(q)??!1);return AT(r)?r.allOr?j.some(se=>se===!0):j.every(se=>se===!0):!0};return i.filter(Me)}function MS(i,r,o,a="string"){if(!r||!o||!a)return i;let c=f=>f==null?f:a==="string"?`${f}`:parseFloat(f);return i.slice().sort((f,d)=>{let g=c(f[r]),E=c(d[r]),A=E==null||g>E?1:-1;return o.toLowerCase()==="descending"?A*-1:A})}function PS(i,r){let o=typeof r=="number"?r:parseFloat(r);return isNaN(o)?i:i.slice(0,o)}var AT=i=>{if(!i)return!1;let r=o=>{for(let a of DS)if(o[a])for(let c of o[a]?.conditions||[]){let f=r(c);if(f)return f}for(let a of uR){let c=o[a];if(!c||typeof c!="object")continue;if(Object.entries(c).filter(d=>{let g=d[1]!==void 0||d[1]!==null||d[1]!=="";return a==="notEmpty"||g}).length!==0)return!0}return!1};return r(i)};var kT={};Le(kT,{applications:()=>bT,automations:()=>wT,screens:()=>FT,users:()=>PT});var bT={};Le(bT,{getDevAppID:()=>dR,getProdAppID:()=>zd});var RT=v_("app"),Ql=v_("app_dev");function dR(i){if(!i)throw new Error("No app ID provided");if(i.startsWith(Ql))return i;let r=i.split(RT);r.shift();let o=r.join(RT);return`${Ql}${o}`}function zd(i){if(!i)throw new Error("No app ID provided");if(!i.startsWith(Ql))return i;let r=i.split(Ql);r.shift();let o=r.join(Ql);return`${RT}${o}`}var wT={};Le(wT,{isAppAction:()=>gR,isRowAction:()=>hR,isWebhookAction:()=>mR});function hR(i){return i.definition.trigger?.stepId==="ROW_ACTION"}function mR(i){return i.definition.trigger?.stepId==="WEBHOOK"}function gR(i){return i.definition.trigger?.stepId==="APP"}var PT={};Le(PT,{canCreateApps:()=>AR,containsUserID:()=>RR,getGlobalUserID:()=>IR,getUserAppGroups:()=>bR,getUserGroups:()=>MT,hasAdminPermissions:()=>UT,hasAppBuilderPermissions:()=>Qd,hasAppCreatorPermissions:()=>YS,hasBuilderPermissions:()=>vR,hasCreatorPermissions:()=>jd,isAdmin:()=>Yd,isAdminOrBuilder:()=>SR,isAdminOrGlobalBuilder:()=>OR,isBuilder:()=>LT,isCreator:()=>xR,isGlobalBuilder:()=>Zd,userAppAccessList:()=>wR});var So=fo(ZS());function LT(i,r){return i?i.builder?.global?!0:!!(r&&i.builder?.apps?.includes(zd(r))):!1}function Zd(i){return LT(i)&&!Qd(i)||Yd(i)}function AR(i){return Zd(i)||jd(i)}function Yd(i){return i?UT(i):!1}function SR(i,r){return LT(i,r)||Yd(i)}function OR(i){return Zd(i)||Yd(i)}function Qd(i){if(!i)return!1;let r=i.builder?.apps?.length;return!!!i.builder?.global&&r!=null&&r>0}function YS(i){return i?So.flow(So.get("roles"),So.values,So.find(r=>["CREATOR","ADMIN"].includes(r)),r=>!!r)(i):!1}function vR(i){return i?i.builder?.global||Qd(i)||jd(i):!1}function UT(i){return i?!!i.admin?.global:!1}function jd(i){return i?!!i.builder?.creator:!1}function xR(i){return i?Zd(i)||UT(i)||jd(i)||Qd(i)||YS(i):!1}function IR(i){if(typeof i!="string")return i;let r=`ro${fs}ta_users${fs}`;return i.startsWith(r)?i.split(r)[1]:i}function RR(i){return typeof i!="string"?!1:i.includes(`us${fs}`)}function MT(i,r){return r?.filter(o=>o.users?.find(a=>a._id===i._id))||[]}function bR(i,r,o){let a=zd(i);return MT(r,o).filter(f=>Object.keys(f.roles||{}).find(d=>d===a))}function wR(i,r){let a=MT(i,r).flatMap(f=>Object.keys(f.roles||{})),c=[...Object.keys(i.roles),...a];return[...new Set(c)]}var FT={};Le(FT,{findInSettings:()=>NR});function NR(i,r){let o=[];function a(c,f=""){for(let[d,g]of Object.entries(c))g&&(typeof g=="string"&&g.includes(r)?o.push({setting:f?`${f}.${d}`:d,value:g}):typeof g=="object"&&a(g,d))}return a(i.props),o}var CR={string:!0,longform:!0,options:!0,number:!0,datetime:!0,formula:!0,ai:!0,auto:!0,internal:!0,barcodeqr:!0,bigint:!0,boolean:!1,array:!1,attachment:!1,attachment_single:!1,signature_single:!1,link:!1,json:!1,bb_reference:!1,bb_reference_single:!1},DR={string:!0,longform:!0,options:!0,number:!0,datetime:!0,auto:!0,internal:!0,barcodeqr:!0,bigint:!0,boolean:!0,json:!0,formula:!1,ai:!1,attachment:!1,attachment_single:!1,signature_single:!1,array:!1,link:!1,bb_reference:!1,bb_reference_single:!1},LR={number:!0,json:!0,datetime:!0,longform:!0,string:!0,options:!0,array:!0,bigint:!0,boolean:!0,auto:!1,internal:!1,barcodeqr:!1,formula:!1,ai:!1,attachment:!1,attachment_single:!1,signature_single:!1,link:!1,bb_reference:!0,bb_reference_single:!0};function UR(i){return!!CR[i]}function MR(i){return!!DR[i]}function PR(i){return!!LR[i]}function FR(i){let r=Object.keys(i.schema),o=r.map(f=>f.toLowerCase()),a=new Set(o),c=[];if(a.size!==o.length)for(let f of a.keys())o.filter(g=>g===f).length>1&&c.push(f);for(let f of xd)r.find(d=>d===f)&&c.push(f);return c}var kR=i=>{i=QS(i);let r=`${Au}${i}`,o=Id.find(a=>a.id===i)?.base;return o&&(r=`${Au}${o} ${r}`),r},QS=(i,r="darkest")=>i?(i.startsWith(Au)&&(i=i.split(Au)[1]),Id.some(o=>o.id===i)?i:i==="lightest"?"light":i==="dark"?"darkest":r):r;var lE={};Le(lE,{steps:()=>uE,triggers:()=>cE});var uE={};Le(uE,{bash:()=>BT,branch:()=>GT,collect:()=>WT,createRow:()=>VT,delay:()=>qT,deleteRow:()=>$T,discord:()=>HT,executeQuery:()=>zT,executeScript:()=>ZT,executeScriptV2:()=>YT,filter:()=>QT,loop:()=>jT,make:()=>KT,n8n:()=>JT,openai:()=>XT,outgoingWebhook:()=>eE,queryRows:()=>tE,sendSmtpEmail:()=>rE,serverLog:()=>nE,slack:()=>iE,triggerAutomationRun:()=>oE,updateRow:()=>sE,zapier:()=>aE});var BT={};Le(BT,{definition:()=>BR});var BR={name:"Bash Scripting",tagline:"Execute a bash command",icon:"JourneyEvent",description:"Run a bash script",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"EXECUTE_BASH",inputs:{},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{stdout:{type:"string",description:"Standard output of your bash command or script"},success:{type:"boolean",description:"Whether the command was successful"}},required:["stdout"]}}};var GT={};Le(GT,{definition:()=>GR});var GR={name:"Branch",icon:"Branch3",tagline:"Branch from this step",description:"Branching",stepId:"BRANCH",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{branches:{properties:{name:{type:"string"},condition:{customType:"filters"}}},children:{type:"array"}},required:["conditions"]},outputs:{properties:{branchName:{type:"string"},status:{type:"string",description:"Branch result"},branchId:{type:"string",description:"Branch ID"},success:{type:"boolean",description:"Branch success"}},required:["output"]}},type:"LOGIC"};var WT={};Le(WT,{definition:()=>WR});var WR={name:"Collect Data",tagline:"Collect data to be sent to design",icon:"Collection",description:"Collects specified data so it can be provided to the design section",type:"ACTION",internal:!0,features:{},stepId:"COLLECT",inputs:{},schema:{inputs:{properties:{collection:{type:"string",title:"What to Collect"}},required:["collection"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},value:{type:"string",description:"Collected data"}},required:["success","value"]}}};var VT={};Le(VT,{definition:()=>VR});var VR={name:"Create Row",tagline:"Create a {{inputs.enriched.table.name}} row",icon:"TableRowAddBottom",description:"Add a row to your database",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"CREATE_ROW",inputs:{},schema:{inputs:{properties:{row:{type:"object",properties:{tableId:{type:"string",customType:"table"}},customType:"row",title:"Table",required:["tableId"]}},required:["row"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The new row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the row creation was successful"},id:{type:"string",description:"The identifier of the new row"},revision:{type:"string",description:"The revision of the new row"}},required:["success","id","revision"]}}};var qT={};Le(qT,{definition:()=>qR});var qR={name:"Delay",icon:"Clock",tagline:"Delay for {{inputs.time}} milliseconds",description:"Delay the automation until an amount of time has passed",stepId:"DELAY",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{time:{type:"number",title:"Delay in milliseconds"}},required:["time"]},outputs:{properties:{success:{type:"boolean",description:"Whether the delay was successful"}},required:["success"]}},type:"LOGIC"};var $T={};Le($T,{definition:()=>$R});var $R={description:"Delete a row from your database",icon:"TableRowRemoveCenter",name:"Delete Row",tagline:"Delete a {{inputs.enriched.table.name}} row",type:"ACTION",stepId:"DELETE_ROW",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},id:{type:"string",title:"Row ID"}},required:["tableId","id"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The deleted row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the deletion was successful"}},required:["row","success"]}}};var HT={};Le(HT,{definition:()=>HR});var HR={name:"Discord Message",tagline:"Send a message to a Discord server",description:"Send a message to a Discord server",icon:"ri-discord-line",stepId:"discord",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Discord Webhook URL"},username:{type:"string",title:"Bot Name"},avatar_url:{type:"string",title:"Bot Avatar URL"},content:{type:"string",title:"Message"}},required:["url","content"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},response:{type:"string",description:"The response from the Discord Webhook"},success:{type:"boolean",description:"Whether the message sent successfully"}}}}};var zT={};Le(zT,{definition:()=>zR});var zR={name:"External Data Connector",tagline:"Execute Data Connector",icon:"Data",description:"Execute a query in an external data connector",type:"ACTION",stepId:"EXECUTE_QUERY",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{query:{type:"object",properties:{queryId:{type:"string",customType:"query"}},customType:"queryParams",title:"Parameters",required:["queryId"]}},required:["query"]},outputs:{properties:{response:{type:"object",description:"The response from the datasource execution"},info:{type:"object",description:"Some query types may return extra data, like headers from a REST query"},success:{type:"boolean",description:"Whether the action was successful"}},required:["response","success"]}}};var ZT={};Le(ZT,{definition:()=>ZR});var ZR={name:"JS Scripting",tagline:"Execute JavaScript Code",deprecated:!0,icon:"Code",description:"Run a piece of JavaScript code in your automation",type:"ACTION",internal:!0,stepId:"EXECUTE_SCRIPT",inputs:{},features:{LOOPING:!0},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{value:{type:"string",description:"The result of the return statement"},success:{type:"boolean",description:"Whether the action was successful"}},required:["success"]}}};var YT={};Le(YT,{definition:()=>YR});var YR={name:"JavaScript",tagline:"Execute JavaScript Code",icon:"Brackets",description:"Run a piece of JavaScript code in your automation",type:"ACTION",internal:!0,new:!0,stepId:"EXECUTE_SCRIPT_V2",inputs:{},features:{LOOPING:!0},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{value:{type:"string",description:"The result of the return statement"},success:{type:"boolean",description:"Whether the action was successful"}},required:["success"]}}};var QT={};Le(QT,{PrettyFilterConditions:()=>jS,definition:()=>QR});var jS={EQUAL:"Equals",NOT_EQUAL:"Not equals",GREATER_THAN:"Greater than",LESS_THAN:"Less than"},QR={name:"Condition",tagline:"{{inputs.field}} {{inputs.condition}} {{inputs.value}}",icon:"Branch2",description:"Conditionally halt automations which do not meet certain conditions",type:"LOGIC",internal:!0,features:{},stepId:"FILTER",inputs:{condition:"EQUAL"},schema:{inputs:{properties:{field:{type:"string",title:"Reference Value"},condition:{type:"string",title:"Condition",enum:Object.values(x_),pretty:Object.values(jS)},value:{type:"string",title:"Comparison Value"}},required:["field","condition","value"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},result:{type:"boolean",description:"Whether the logic block passed"}},required:["success","result"]}}};var jT={};Le(jT,{definition:()=>jR});var jR={name:"Looping",icon:"Reuse",tagline:"Loop the block",description:"Loop",stepId:"LOOP",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{option:{customType:"loopOption",title:"Input type"},binding:{type:"string",title:"Binding / Value"},iterations:{type:"number",title:"Max loop iterations"},failure:{type:"string",title:"Failure Condition"}},required:["type","value","iterations","failure"]},outputs:{properties:{items:{customType:"item",description:"The item currently being executed"},success:{type:"boolean",description:"Whether the message loop was successfully"},iterations:{type:"number",description:"The amount of times the block ran"}},required:["success","items","iterations"]}},type:"LOGIC"};var KT={};Le(KT,{definition:()=>KR});var KR={name:"Make Integration",stepTitle:"Make",tagline:"Trigger a Make scenario",description:"Performs a webhook call to Make and gets the response (if configured)",icon:"ri-shut-down-line",stepId:"integromat",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},body:{type:"json",title:"Payload"}},required:["url","body"]},outputs:{properties:{success:{type:"boolean",description:"Whether call was successful"},httpStatus:{type:"number",description:"The HTTP status code returned"},response:{type:"object",description:"The webhook response - this can have properties"}},required:["success","response"]}}};var JT={};Le(JT,{definition:()=>JR});var JR={name:"n8n Integration",stepTitle:"n8n",tagline:"Trigger an n8n workflow",description:"Performs a webhook call to n8n and gets the response (if configured)",icon:"ri-shut-down-line",stepId:"n8n",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},method:{type:"string",title:"Method",enum:Object.values(I_)},authorization:{type:"string",title:"Authorization"},body:{type:"json",title:"Payload"}},required:["url","method"]},outputs:{properties:{success:{type:"boolean",description:"Whether call was successful"},httpStatus:{type:"number",description:"The HTTP status code returned"},response:{type:"object",description:"The webhook response - this can have properties"}},required:["success","response"]}}};var XT={};Le(XT,{definition:()=>XR});var KS=(c=>(c.GPT_4O_MINI="gpt-4o-mini",c.GPT_4O="gpt-4o",c.GPT_4="gpt-4",c.GPT_35_TURBO="gpt-3.5-turbo",c))(KS||{}),XR={name:"OpenAI",tagline:"Send prompts to ChatGPT",icon:"Algorithm",description:"Interact with the OpenAI ChatGPT API.",type:"ACTION",internal:!0,features:{},stepId:"OPENAI",inputs:{prompt:""},schema:{inputs:{properties:{prompt:{type:"string",title:"Prompt"},model:{type:"string",title:"Model",enum:Object.values(KS)}},required:["prompt","model"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},response:{type:"string",description:"What was output"}},required:["success","response"]}}};var eE={};Le(eE,{definition:()=>e0});var JS=(f=>(f.POST="POST",f.GET="GET",f.PUT="PUT",f.DELETE="DELETE",f.PATCH="PATCH",f))(JS||{}),e0={deprecated:!0,name:"Outgoing webhook",tagline:"Send a {{inputs.requestMethod}} request",icon:"Send",description:"Send a request of specified method to a URL",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"OUTGOING_WEBHOOK",inputs:{requestMethod:"POST",url:"http://",requestBody:"{}",headers:"{}"},schema:{inputs:{properties:{requestMethod:{type:"string",enum:Object.values(JS),title:"Request method"},url:{type:"string",title:"URL"},requestBody:{type:"string",title:"JSON Body",customType:"wide"},headers:{type:"string",title:"Headers",customType:"wide"}},required:["requestMethod","url"]},outputs:{properties:{response:{type:"object",description:"The response from the webhook"},httpStatus:{type:"number",description:"The HTTP status code returned"},success:{type:"boolean",description:"Whether the action was successful"}},required:["response","success"]}}};var tE={};Le(tE,{definition:()=>r0});var t0={ascending:"Ascending",descending:"Descending"},r0={description:"Query rows from the database",icon:"Search",name:"Query rows",tagline:"Query rows from {{inputs.enriched.table.name}} table",type:"ACTION",stepId:"QUERY_ROWS",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"filters",title:"Filtering"},sortColumn:{type:"string",title:"Sort Column",customType:"column"},sortOrder:{type:"string",title:"Sort Order",enum:Object.values(pu),pretty:Object.values(t0)},limit:{type:"number",title:"Limit",customType:"queryLimit"}},required:["tableId"]},outputs:{properties:{rows:{type:"array",customType:"rows",description:"The rows that were found"},success:{type:"boolean",description:"Whether the query was successful"}},required:["rows","success"]}}};var rE={};Le(rE,{definition:()=>n0});var n0={description:"Send an email using SMTP",tagline:"Send SMTP email to {{inputs.to}}",icon:"Email",name:"Send Email (SMTP)",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"SEND_EMAIL_SMTP",inputs:{},schema:{inputs:{properties:{to:{type:"string",title:"Send To"},from:{type:"string",title:"Send From"},cc:{type:"string",title:"CC"},bcc:{type:"string",title:"BCC"},subject:{type:"string",title:"Email Subject"},contents:{type:"string",title:"HTML Contents"},addInvite:{type:"boolean",title:"Add calendar invite"},startTime:{type:"date",title:"Start Time",dependsOn:"addInvite"},endTime:{type:"date",title:"End Time",dependsOn:"addInvite"},summary:{type:"string",title:"Meeting Summary",dependsOn:"addInvite"},location:{type:"string",title:"Location",dependsOn:"addInvite"},attachments:{type:"attachment",customType:"multi_attachments",title:"Attachments"}},required:["to","from","subject","contents"]},outputs:{properties:{success:{type:"boolean",description:"Whether the email was sent"},response:{type:"object",description:"A response from the email client, this may be an error"}},required:["success"]}}};var nE={};Le(nE,{definition:()=>i0});var i0={name:"Backend log",tagline:"Console log a value in the backend",icon:"Monitoring",description:"Logs the given text to the server (using console.log)",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"SERVER_LOG",inputs:{text:""},schema:{inputs:{properties:{text:{type:"string",title:"Log"}},required:["text"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},message:{type:"string",description:"What was output"}},required:["success","message"]}}};var iE={};Le(iE,{definition:()=>o0});var o0={name:"Slack Message",tagline:"Send a message to Slack",description:"Send a message to Slack",icon:"ri-slack-line",stepId:"slack",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Incoming Webhook URL"},text:{type:"string",title:"Message"}},required:["url","text"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},success:{type:"boolean",description:"Whether the message sent successfully"},response:{type:"string",description:"The response from the Slack Webhook"}}}}};var oE={};Le(oE,{definition:()=>s0});var s0={name:"Trigger an automation",tagline:"Triggers an automation synchronously",icon:"Sync",description:"Triggers an automation synchronously",type:"ACTION",internal:!0,features:{},stepId:"TRIGGER_AUTOMATION_RUN",inputs:{},schema:{inputs:{properties:{automation:{type:"object",properties:{automationId:{type:"string",customType:"automation"}},customType:"automationFields",title:"automatioFields",required:["automationId"]},timeout:{type:"number",title:"Timeout (ms)"}},required:["automationId"]},outputs:{properties:{success:{type:"boolean",description:"Whether the automation was successful"},value:{type:"object",description:"Automation Result"}},required:["success","value"]}}};var sE={};Le(sE,{definition:()=>a0});var a0={name:"Update Row",tagline:"Update a {{inputs.enriched.table.name}} row",icon:"Refresh",description:"Update a row in your database",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"UPDATE_ROW",inputs:{},schema:{inputs:{properties:{meta:{type:"object",title:"Field settings"},row:{type:"object",customType:"row",title:"Table"},rowId:{type:"string",title:"Row ID"}},required:["row","rowId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The updated row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the action was successful"},id:{type:"string",description:"The identifier of the updated row"},revision:{type:"string",description:"The revision of the updated row"}},required:["success","id","revision"]}}};var aE={};Le(aE,{definition:()=>u0});var u0={name:"Zapier Webhook",stepId:"zapier",type:"ACTION",internal:!1,features:{LOOPING:!0},description:"Trigger a Zapier Zap via webhooks",tagline:"Trigger a Zapier Zap",icon:"ri-flashlight-line",inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},body:{type:"json",title:"Payload"}},required:["url"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},response:{type:"string",description:"The response from Zapier"}}}}};var cE={};Le(cE,{definitions:()=>g0});var XS={name:"App Action",event:"app:trigger",icon:"Apps",tagline:"Automation fired from the frontend",description:"Trigger an automation from an action inside your app",stepId:"APP",inputs:{},schema:{inputs:{properties:{fields:{type:"object",customType:"triggerSchema",title:"Fields"}},required:[]},outputs:{properties:{fields:{type:"object",description:"Fields submitted from the app frontend",customType:"triggerSchema"}},required:["fields"]}},type:"TRIGGER"};var eO={name:"Cron Trigger",event:"cron:trigger",icon:"Clock",tagline:"Cron Trigger (<b>{{inputs.cron}}</b>)",description:"Triggers automation on a cron schedule.",stepId:"CRON",inputs:{},schema:{inputs:{properties:{cron:{type:"string",customType:"cron",title:"Expression"}},required:["cron"]},outputs:{properties:{timestamp:{type:"number",description:"Timestamp the cron was executed"}},required:["timestamp"]}},type:"TRIGGER"};var tO={name:"Row Deleted",event:"row:delete",icon:"TableRowRemoveCenter",tagline:"Row is deleted from {{inputs.enriched.table.name}}",description:"Fired when a row is deleted from your database",stepId:"ROW_DELETED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"}},required:["tableId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The row that was deleted"}},required:["row"]}},type:"TRIGGER"};var rO={name:"Row Created",event:"row:save",icon:"TableRowAddBottom",tagline:"Row is added to {{inputs.enriched.table.name}}",description:"Fired when a row is added to your database",stepId:"ROW_SAVED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"trigger_filter",title:"Filtering"}},required:["tableId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The new row that was created"},id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"}},required:["row","id"]}},type:"TRIGGER"};var nO={name:"Row Updated",event:"row:update",icon:"Refresh",tagline:"Row is updated in {{inputs.enriched.table.name}}",description:"Fired when a row is updated in your database",stepId:"ROW_UPDATED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"trigger_filter",title:"Filtering"}},required:["tableId"]},outputs:{properties:{oldRow:{type:"object",customType:"row",description:"The row that was updated",title:"Old Row"},row:{type:"object",customType:"row",description:"The row before it was updated",title:"Row"},id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"}},required:["row","id"]}},type:"TRIGGER"};var iO={name:"Webhook",event:"web:trigger",icon:"Send",tagline:"Webhook endpoint is hit",description:"Trigger an automation when a HTTP POST webhook is hit",stepId:"WEBHOOK",inputs:{},schema:{inputs:{properties:{schemaUrl:{type:"string",customType:"webhookUrl",title:"Schema URL"},triggerUrl:{type:"string",customType:"webhookUrl",title:"Trigger URL"}},required:["schemaUrl","triggerUrl"]},outputs:{properties:{body:{type:"object",description:"Body of the request which hit the webhook"}},required:["body"]}},type:"TRIGGER"};var oO={type:"TRIGGER",name:"Row Action",event:"row:action",icon:"Workflow",tagline:"Row action triggered in {{inputs.enriched.table.name}} by {{inputs.enriched.row._id}}",description:"TODO description",stepId:"ROW_ACTION",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table",readonly:!0}},required:["tableId"]},outputs:{properties:{id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"},table:{type:"object",customType:"table",title:"The table linked to the row action"},row:{type:"object",customType:"row",description:"The row linked to the row action"}}}}};var g0={ROW_SAVED:rO,ROW_UPDATED:nO,ROW_DELETED:tO,WEBHOOK:iO,APP:XS,CRON:eO,ROW_ACTION:oO};0&&(module.exports={AIOperations,BpmCorrelationKey,BpmInstanceKey,BpmStatusKey,BpmStatusValue,BuilderSocketEvent,DEFAULT_BB_DATASOURCE_ID,DefaultAppTheme,DefaultBuilderTheme,GridSocketEvent,Header,InvalidFileExtensions,OperationFieldTypes,OperationFields,OperatorOptions,PROTECTED_EXTERNAL_COLUMNS,PROTECTED_INTERNAL_COLUMNS,REBOOT_CRON,RoleColor,SWITCHABLE_TYPES,SocketEvent,SocketSessionTTL,SqlNumberTypeRangeMap,ThemeClassPrefix,ThemeOptions,ValidColumnNameRegex,ValidQueryNameRegex,ValidSnippetNameRegex,automations,canBeDisplayColumn,canBeSortColumn,canHaveDefaultColumn,dataFilters,ensureValidTheme,findDuplicateInternalColumns,getThemeClassNames,helpers,isExternalColumnName,isInternalColumnName,sdk,utils});
|
|
40
|
+
}`;var G=ld(function(){return ii(m,N+"return "+I).apply(O,T)});if(G.source=I,Qc(G))throw G;return G}function kg(e){return qe(e).toLowerCase()}function Bg(e){return qe(e).toUpperCase()}function Gg(e,t,n){if(e=qe(e),e&&(n||t===O))return de(e);if(!e||!(t=jt(t)))return e;var s=Pe(e),u=Pe(t);return Xn(s,H(s,u),Te(s,u)+1).join("")}function Wg(e,t,n){if(e=qe(e),e&&(n||t===O))return e.slice(0,Lt(e)+1);if(!e||!(t=jt(t)))return e;var s=Pe(e);return Xn(s,0,Te(s,Pe(t))+1).join("")}function Vg(e,t,n){if(e=qe(e),e&&(n||t===O))return e.replace(Wu,"");if(!e||!(t=jt(t)))return e;var s=Pe(e);return Xn(s,H(s,Pe(t))).join("")}function qg(e,t){var n=Xd,s=eh;if(dt(t)){var u="separator"in t?t.separator:u;n="length"in t?xe(t.length):n,s="omission"in t?jt(t.omission):s}e=qe(e);var l=e.length;if(Qe(e)){var h=Pe(e);l=h.length}if(n>=l)return e;var m=n-pt(s);if(m<1)return s;var T=h?Xn(h,0,m).join(""):e.slice(0,m);if(u===O)return T+s;if(h&&(m+=T.length-m),ml(u)){if(e.slice(m).search(u)){var x,v=T;for(u.global||(u=Ht(u.source,qe(cf.exec(u))+"g")),u.lastIndex=0;x=u.exec(v);)var I=x.index;T=T.slice(0,I===O?m:I)}}else if(e.indexOf(jt(u),m)!=m){var b=T.lastIndexOf(u);b>-1&&(T=T.slice(0,b))}return T+s}function $g(e){return e=qe(e),e&&ku.test(e)?e.replace(rf,kh):e}function Lp(e,t,n){return e=qe(e),t=n?O:t,t===O?ie(e)?Kl(e):Z(e):e.match(t)||[]}function Ha(e){var t=e==null?0:e.length,n=fe();return e=t?E(e,function(s){if(typeof s[1]!="function")throw new Cr(Zt);return[n(s[0]),s[1]]}):[],be(function(s){for(var u=-1;++u<t;){var l=e[u];if(i(l[0],this,s))return i(l[1],this,s)}})}function Hg(e){return zh(gr(e,fr))}function za(e){return function(){return e}}function Up(e,t){return e==null||e!==e?t:e}function $t(e){return e}function Za(e){return Bf(typeof e=="function"?e:gr(e,fr))}function Mp(e){return Gf(gr(e,fr))}function Pp(e,t){return Wf(e,gr(t,fr))}function Ya(e,t,n){var s=Nt(t),u=pa(t,s);n!=null||dt(t)&&(u.length||!s.length)||(n=t,t=e,e=this,u=pa(t,Nt(t)));var l=!(dt(n)&&"chain"in n&&!n.chain),h=Ln(e);return o(u,function(m){var T=t[m];e[m]=T,h&&(e.prototype[m]=function(){var x=this.__chain__;if(l||x){var v=e(this.__wrapped__);return(v.__actions__=Wt(this.__actions__)).push({func:T,args:arguments,thisArg:e}),v.__chain__=x,v}return T.apply(e,A([this.value()],arguments))})}),e}function zg(){return bt._===this&&(bt._=Xa),this}function Xc(){}function Zg(e){return e=xe(e),be(function(t){return Vf(t,e)})}function is(e){return ba(e)?q(dn(e)):Vr(e)}function Qa(e){return function(t){return e==null?O:gi(e,t)}}function el(){return[]}function tl(){return!1}function rl(){return{}}function Fp(){return""}function Yg(){return!0}function Qg(e,t){if(e=xe(e),e<1||e>tn)return[];var n=rn,s=ue(e,rn);t=fe(t),e-=rn;for(var u=ot(s,t);++n<e;)t(n);return u}function jg(e){return Se(e)?E(e,dn):_r(e)?[e]:Wt(Jp(qe(e)))}function Kg(e){var t=++il;return qe(e)+t}function Jg(e){return e&&e.length?Kn(e,$t,yi):O}function Xg(e,t){return e&&e.length?Kn(e,fe(t,2),yi):O}function ey(e){return Me(e,$t)}function ty(e,t){return Me(e,fe(t,2))}function ry(e){return e&&e.length?Kn(e,$t,fc):O}function ny(e,t){return e&&e.length?Kn(e,fe(t,2),fc):O}function iy(e){return e&&e.length?le(e,$t):0}function oy(e,t){return e&&e.length?le(e,fe(t,2)):0}S=S==null?bt:Qt.defaults(bt.Object(),S,Qt.pick(bt,Ef));var ze=S.Array,ja=S.Date,nl=S.Error,ii=S.Function,ge=S.Math,ut=S.Object,Ht=S.RegExp,Tt=S.String,Cr=S.TypeError,Hr=ze.prototype,sy=ii.prototype,oo=ut.prototype,Ka=S["__core-js_shared__"],Ja=sy.toString,Ze=oo.hasOwnProperty,il=0,kp=function(){var e=/[^.]+$/.exec(Ka&&Ka.keys&&Ka.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Dr=oo.toString,Bp=Ja.call(ut),Xa=bt._,ht=Ht("^"+Ja.call(Ze).replace(js,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ct=ic?S.Buffer:O,Mn=S.Symbol,eu=S.Uint8Array,Gp=ct?ct.allocUnsafe:O,tu=ne(ut.getPrototypeOf,ut),Wp=ut.create,Vp=oo.propertyIsEnumerable,ru=Hr.splice,ol=Mn?Mn.isConcatSpreadable:O,Pn=Mn?Mn.iterator:O,Fn=Mn?Mn.toStringTag:O,nu=function(){try{var e=ei(ut,"defineProperty");return e({},"",{}),e}catch{}}(),qp=S.clearTimeout!==bt.clearTimeout&&S.clearTimeout,iu=ja&&ja.now!==bt.Date.now&&ja.now,Tr=S.setTimeout!==bt.setTimeout&&S.setTimeout,kn=ge.ceil,ou=ge.floor,sl=ut.getOwnPropertySymbols,ay=ct?ct.isBuffer:O,$p=S.isFinite,uy=Hr.join,Hp=ne(ut.keys,ut),et=ge.max,ue=ge.min,zp=ja.now,Lr=S.parseInt,al=ge.random,cy=Hr.reverse,Be=ei(S,"DataView"),os=ei(S,"Map"),su=ei(S,"Promise"),Bn=ei(S,"Set"),ss=ei(S,"WeakMap"),as=ei(ut,"create"),au=ss&&new ss,so={},ly=ni(Be),fy=ni(os),py=ni(su),dy=ni(Bn),hy=ni(ss),uu=Mn?Mn.prototype:O,us=uu?uu.valueOf:O,Zp=uu?uu.toString:O,ao=function(){function e(){}return function(t){if(!dt(t))return{};if(Wp)return Wp(t);e.prototype=t;var n=new e;return e.prototype=O,n}}();p.templateSettings={escape:Gi,evaluate:nf,interpolate:Gu,variable:"",imports:{_:p}},p.prototype=w.prototype,p.prototype.constructor=p,L.prototype=ao(w.prototype),L.prototype.constructor=L,U.prototype=ao(w.prototype),U.prototype.constructor=U,pi.prototype.clear=xr,pi.prototype.delete=na,pi.prototype.get=Gh,pi.prototype.has=qi,pi.prototype.set=ia,Ir.prototype.clear=He,Ir.prototype.delete=Wh,Ir.prototype.get=Rf,Ir.prototype.has=oa,Ir.prototype.set=Vh,In.prototype.clear=qh,In.prototype.delete=sa,In.prototype.get=jn,In.prototype.has=aa,In.prototype.set=bf,on.prototype.add=on.prototype.push=wf,on.prototype.has=Nf,or.prototype.clear=Cf,or.prototype.delete=Po,or.prototype.get=di,or.prototype.has=ua,or.prototype.set=$h;var mn=ji(sn),Yp=ji(uc,!0),cs=Ac(),Qp=Ac(!0),jp=au?function(e,t){return au.set(e,t),e}:$t,my=nu?function(e,t){return nu(e,"toString",{configurable:!0,enumerable:!1,value:za(t),writable:!0})}:$t,Ct=be,rr=qp||function(e){return bt.clearTimeout(e)},gy=Bn&&1/z(new Bn([,-0]))[1]==ci?function(e){return new Bn(e)}:Xc,ul=au?function(e){return au.get(e)}:Xc,cl=sl?function(e){return e==null?[]:(e=ut(e),f(sl(e),function(t){return Vp.call(e,t)}))}:el,ll=sl?function(e){for(var t=[];e;)A(t,cl(e)),e=tu(e);return t}:el,zt=wt;(Be&&zt(new Be(new ArrayBuffer(1)))!=ki||os&&zt(new os)!=Br||su&&zt(su.resolve())!=Ro||Bn&&zt(new Bn)!=Gr||ss&&zt(new ss)!=No)&&(zt=function(e){var t=wt(e),n=t==vn?e.constructor:O,s=n?ni(n):"";if(s)switch(s){case ly:return ki;case fy:return Br;case py:return Ro;case dy:return Gr;case hy:return No}return t});var yy=Ka?Ln:tl,Kp=Dc(jp),uo=Tr||function(e,t){return bt.setTimeout(e,t)},fl=Dc(my),Jp=ti(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(sf,function(n,s,u,l){t.push(u?l.replace(Th,"$1"):s||n)}),t}),_y=be(function(e,t){return _t(e)?mi(e,mt(t,1,_t,!0)):[]}),Xp=be(function(e,t){var n=Jt(t);return _t(n)&&(n=O),_t(e)?mi(e,mt(t,1,_t,!0),fe(n,2)):[]}),ed=be(function(e,t){var n=Jt(t);return _t(n)&&(n=O),_t(e)?mi(e,mt(t,1,_t,!0),O,n):[]}),Ty=be(function(e){var t=E(e,ya);return t.length&&t[0]===e[0]?Zi(t):[]}),Ey=be(function(e){var t=Jt(e),n=E(e,ya);return t===Jt(n)?t=O:n.pop(),n.length&&n[0]===e[0]?Zi(n,fe(t,2)):[]}),Ay=be(function(e){var t=Jt(e),n=E(e,ya);return t=typeof t=="function"?t:O,t&&n.pop(),n.length&&n[0]===e[0]?Zi(n,O,t):[]}),Sy=be(Ko),co=pn(function(e,t){var n=e==null?0:e.length,s=ac(e,t);return $f(e,E(t,function(u){return Vt(u,n)?+u:u}).sort($o)),s}),Oy=be(function(e){return sr(mt(e,1,_t,!0))}),vy=be(function(e){var t=Jt(e);return _t(t)&&(t=O),sr(mt(e,1,_t,!0),fe(t,2))}),xy=be(function(e){var t=Jt(e);return t=typeof t=="function"?t:O,sr(mt(e,1,_t,!0),O,t)}),Iy=be(function(e,t){return _t(e)?mi(e,t):[]}),Ry=be(function(e){return _i(f(e,_t))}),td=be(function(e){var t=Jt(e);return _t(t)&&(t=O),_i(f(e,_t),fe(t,2))}),rd=be(function(e){var t=Jt(e);return t=typeof t=="function"?t:O,_i(f(e,_t),O,t)}),by=be(Gc),wy=be(function(e){var t=e.length,n=t>1?e[t-1]:O;return n=typeof n=="function"?(e.pop(),n):O,Ba(e,n)}),Ny=pn(function(e){var t=e.length,n=t?e[0]:0,s=this.__wrapped__,u=function(l){return ac(l,e)};return!(t>1||this.__actions__.length)&&s instanceof U&&Vt(n)?(s=s.slice(n,+n+(t?1:0)),s.__actions__.push({func:Jo,args:[u],thisArg:O}),new L(s,this.__chain__).thru(function(l){return t&&!l.length&&l.push(O),l})):this.thru(u)}),Cy=Yi(function(e,t,n){Ze.call(e,n)?++e[n]:lt(e,n,1)}),Dy=Ta(Lc),Ly=Ta(Ai),Uy=Yi(function(e,t,n){Ze.call(e,n)?e[n].push(t):lt(e,n,[t])}),My=be(function(e,t,n){var s=-1,u=typeof t=="function",l=er(e)?ze(e.length):[];return mn(e,function(h){l[++s]=u?i(t,h,n):Re(h,t,n)}),l}),Py=Yi(function(e,t,n){lt(e,n,t)}),Fy=Yi(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ky=be(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Ut(e,t[0],t[1])?t=[]:n>2&&Ut(t[0],t[1],t[2])&&(t=[t[0]]),Jn(e,mt(t,1),[])}),cu=iu||function(){return bt.Date.now()},pl=be(function(e,t,n){var s=nr;if(n.length){var u=F(n,Ae(pl));s|=en}return wn(e,s,t,n,u)}),nd=be(function(e,t,n){var s=nr|Sn;if(n.length){var u=F(n,Ae(nd));s|=en}return wn(t,s,e,n,u)}),By=be(function(e,t){return $i(e,1,t)}),Gy=be(function(e,t,n){return $i(e,Nr(t)||0,n)});Wa.Cache=In;var Wy=Ct(function(e,t){t=t.length==1&&Se(t[0])?E(t[0],W(fe())):E(mt(t,1),W(fe()));var n=t.length;return be(function(s){for(var u=-1,l=ue(s.length,n);++u<l;)s[u]=t[u].call(this,s[u]);return i(e,this,s)})}),dl=be(function(e,t){return wn(e,en,O,t,F(t,Ae(dl)))}),id=be(function(e,t){return wn(e,Di,O,t,F(t,Ae(id)))}),Vy=pn(function(e,t){return wn(e,Li,O,O,O,t)}),qy=zo(yi),$y=zo(function(e,t){return e>=t}),vi=Ff(function(){return arguments}())?Ff:function(e){return gt(e)&&Ze.call(e,"callee")&&!Vp.call(e,"callee")},Se=ze.isArray,Hy=vf?W(vf):Zh,gn=ay||tl,od=xf?W(xf):Yh,hl=If?W(If):jh,ml=fi?W(fi):Kh,sd=vr?W(vr):Rn,lo=oc?W(oc):Jh,gl=zo(fc),zy=zo(function(e,t){return e<=t}),Zy=Qi(function(e,t){if(Xi(t)||er(t))return ln(t,Nt(t),e),O;for(var n in t)Ze.call(t,n)&&ko(e,n,t[n])}),ad=Qi(function(e,t){ln(t,ur(t),e)}),Mt=Qi(function(e,t,n,s){ln(t,ur(t),e,s)}),yl=Qi(function(e,t,n,s){ln(t,Nt(t),e,s)}),Yy=pn(ac),Qy=be(function(e,t){e=ut(e);var n=-1,s=t.length,u=s>2?t[2]:O;for(u&&Ut(t[0],t[1],u)&&(s=1);++n<s;)for(var l=t[n],h=ur(l),m=-1,T=h.length;++m<T;){var x=h[m],v=e[x];(v===O||wr(v,oo[x])&&!Ze.call(e,x))&&(e[x]=l[x])}return e}),jy=be(function(e){return e.push(O,xc),i(ud,O,e)}),Ky=jf(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Dr.call(t)),e[t]=n},za($t)),_l=jf(function(e,t,n){t!=null&&typeof t.toString!="function"&&(t=Dr.call(t)),Ze.call(e,t)?e[t].push(n):e[t]=[n]},fe),Jy=be(Re),Tl=Qi(function(e,t,n){da(e,t,n)}),ud=Qi(function(e,t,n,s){da(e,t,n,s)}),Xy=pn(function(e,t){var n={};if(e==null)return n;var s=!1;t=E(t,function(l){return l=qr(l,e),s||(s=l.length>1),l}),ln(e,bc(e),n),s&&(n=gr(n,fr|ks|zn,cm));for(var u=t.length;u--;)ar(n,t[u]);return n}),e_=pn(function(e,t){return e==null?{}:tm(e,t)}),cd=Zo(Nt),El=Zo(ur),t_=fn(function(e,t,n){return t=t.toLowerCase(),e+(n?wp(t):t)}),r_=fn(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),n_=fn(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Al=Qf("toLowerCase"),Sl=fn(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),i_=fn(function(e,t,n){return e+(n?" ":"")+Ol(t)}),o_=fn(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Ol=Qf("toUpperCase"),ld=be(function(e,t){try{return i(e,O,t)}catch(n){return Qc(n)?n:new nl(n)}}),s_=pn(function(e,t){return o(t,function(n){n=dn(n),lt(e,n,pl(e[n],e))}),e}),a_=Sc(),u_=Sc(!0),c_=be(function(e,t){return function(n){return Re(n,e,t)}}),l_=be(function(e,t){return function(n){return Re(e,n,t)}}),f_=Sa(E),p_=Sa(c),d_=Sa(B),h_=Oa(),m_=Oa(!0),g_=Aa(function(e,t){return e+t},0),y_=va("ceil"),__=Aa(function(e,t){return e/t},1),T_=va("floor"),E_=Aa(function(e,t){return e*t},1),A_=va("round"),S_=Aa(function(e,t){return e-t},0);return p.after=Hc,p.ary=zc,p.assign=Zy,p.assignIn=ad,p.assignInWith=Mt,p.assignWith=yl,p.at=Yy,p.before=Zc,p.bind=pl,p.bindAll=s_,p.bindKey=nd,p.castArray=Vm,p.chain=hp,p.chunk=hn,p.compact=mm,p.concat=gm,p.cond=Ha,p.conforms=Hg,p.constant=za,p.countBy=Cy,p.create=ug,p.curry=es,p.curryRight=Yc,p.debounce=$r,p.defaults=Qy,p.defaultsDeep=jy,p.defer=By,p.delay=Gy,p.difference=_y,p.differenceBy=Xp,p.differenceWith=ed,p.drop=Ua,p.dropRight=eo,p.dropRightWhile=np,p.dropWhile=ip,p.fill=ym,p.filter=wm,p.flatMap=Vc,p.flatMapDeep=Nm,p.flatMapDepth=Cm,p.flatten=to,p.flattenDeep=_m,p.flattenDepth=op,p.flip=Oi,p.flow=a_,p.flowRight=u_,p.fromPairs=sp,p.functions=dg,p.functionsIn=hg,p.groupBy=Uy,p.initial=Ma,p.intersection=Ty,p.intersectionBy=Ey,p.intersectionWith=Ay,p.invert=Ky,p.invertBy=_l,p.invokeMap=My,p.iteratee=Za,p.keyBy=Py,p.keys=Nt,p.keysIn=ur,p.map=Ga,p.mapKeys=gg,p.mapValues=bp,p.matches=Mp,p.matchesProperty=Pp,p.memoize=Wa,p.merge=Tl,p.mergeWith=ud,p.method=c_,p.methodOf=l_,p.mixin=Ya,p.negate=ts,p.nthArg=Zg,p.omit=Xy,p.omitBy=yg,p.once=Pm,p.orderBy=Dm,p.over=f_,p.overArgs=Wy,p.overEvery=p_,p.overSome=d_,p.partial=dl,p.partialRight=id,p.partition=Fy,p.pick=e_,p.pickBy=ns,p.property=is,p.propertyOf=Qa,p.pull=Sy,p.pullAll=Ko,p.pullAllBy=cp,p.pullAllWith=Mc,p.pullAt=co,p.range=h_,p.rangeRight=m_,p.rearg=Vy,p.reject=yp,p.remove=Em,p.rest=Fm,p.reverse=Pa,p.sampleSize=Mm,p.set=Tg,p.setWith=Eg,p.shuffle=$c,p.slice=Nn,p.sortBy=ky,p.sortedUniq=Cn,p.sortedUniqBy=Pc,p.split=Mg,p.spread=km,p.tail=Fc,p.take=kc,p.takeRight=Fa,p.takeRightWhile=ro,p.takeWhile=pe,p.tap=vm,p.throttle=Bm,p.thru=Jo,p.toArray=vp,p.toPairs=cd,p.toPairsIn=El,p.toPath=jg,p.toPlainObject=Ip,p.transform=Ag,p.unary=Gm,p.union=Oy,p.unionBy=vy,p.unionWith=xy,p.uniq=ka,p.uniqBy=Bc,p.uniqWith=Si,p.unset=Sg,p.unzip=Gc,p.unzipWith=Ba,p.update=Og,p.updateWith=vg,p.values=io,p.valuesIn=xg,p.without=Iy,p.words=Lp,p.wrap=Wm,p.xor=Ry,p.xorBy=td,p.xorWith=rd,p.zip=by,p.zipObject=dp,p.zipObjectDeep=qt,p.zipWith=wy,p.entries=cd,p.entriesIn=El,p.extend=ad,p.extendWith=Mt,Ya(p,p),p.add=g_,p.attempt=ld,p.camelCase=t_,p.capitalize=wp,p.ceil=y_,p.clamp=Ig,p.clone=qm,p.cloneDeep=Hm,p.cloneDeepWith=zm,p.cloneWith=$m,p.conformsTo=Ep,p.deburr=Np,p.defaultTo=Up,p.divide=__,p.endsWith=wg,p.eq=wr,p.escape=Ng,p.escapeRegExp=Cp,p.every=Wc,p.find=Dy,p.findIndex=Lc,p.findKey=cg,p.findLast=Ly,p.findLastIndex=Ai,p.findLastKey=lg,p.floor=T_,p.forEach=no,p.forEachRight=qc,p.forIn=fg,p.forInRight=pg,p.forOwn=jc,p.forOwnRight=Rp,p.get=Kc,p.gt=qy,p.gte=$y,p.has=mg,p.hasIn=Jc,p.head=jo,p.identity=$t,p.includes=gp,p.indexOf=ap,p.inRange=Rg,p.invoke=Jy,p.isArguments=vi,p.isArray=Se,p.isArrayBuffer=Hy,p.isArrayLike=er,p.isArrayLikeObject=_t,p.isBoolean=Zm,p.isBuffer=gn,p.isDate=od,p.isElement=Ym,p.isEmpty=Ap,p.isEqual=Qm,p.isEqualWith=jm,p.isError=Qc,p.isFinite=Km,p.isFunction=Ln,p.isInteger=Sp,p.isLength=tr,p.isMap=hl,p.isMatch=Jm,p.isMatchWith=Op,p.isNaN=Xm,p.isNative=eg,p.isNil=rg,p.isNull=tg,p.isNumber=Va,p.isObject=dt,p.isObjectLike=gt,p.isPlainObject=rs,p.isRegExp=ml,p.isSafeInteger=ng,p.isSet=sd,p.isString=qa,p.isSymbol=_r,p.isTypedArray=lo,p.isUndefined=ig,p.isWeakMap=og,p.isWeakSet=sg,p.join=Uc,p.kebabCase=r_,p.last=Jt,p.lastIndexOf=Tm,p.lowerCase=n_,p.lowerFirst=Al,p.lt=gl,p.lte=zy,p.max=Jg,p.maxBy=Xg,p.mean=ey,p.meanBy=ty,p.min=ry,p.minBy=ny,p.stubArray=el,p.stubFalse=tl,p.stubObject=rl,p.stubString=Fp,p.stubTrue=Yg,p.multiply=E_,p.nth=up,p.noConflict=zg,p.noop=Xc,p.now=cu,p.pad=Dp,p.padEnd=Cg,p.padStart=Dg,p.parseInt=Lg,p.random=bg,p.reduce=Lm,p.reduceRight=Um,p.repeat=Ug,p.replace=$a,p.result=_g,p.round=A_,p.runInContext=y,p.sample=_p,p.size=Tp,p.snakeCase=Sl,p.some=Xo,p.sortedIndex=lp,p.sortedIndexBy=fp,p.sortedIndexOf=Am,p.sortedLastIndex=pp,p.sortedLastIndexBy=Sm,p.sortedLastIndexOf=Om,p.startCase=i_,p.startsWith=Pg,p.subtract=S_,p.sum=iy,p.sumBy=oy,p.template=Fg,p.times=Qg,p.toFinite=Un,p.toInteger=xe,p.toLength=xp,p.toLower=kg,p.toNumber=Nr,p.toSafeInteger=ag,p.toString=qe,p.toUpper=Bg,p.trim=Gg,p.trimEnd=Wg,p.trimStart=Vg,p.truncate=qg,p.unescape=$g,p.uniqueId=Kg,p.upperCase=o_,p.upperFirst=Ol,p.each=no,p.eachRight=qc,p.first=jo,Ya(p,function(){var e={};return sn(p,function(t,n){Ze.call(p.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),p.VERSION=Oo,o(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){p[e].placeholder=p}),o(["drop","take"],function(e,t){U.prototype[e]=function(n){n=n===O?1:et(xe(n),0);var s=this.__filtered__&&!t?new U(this):this.clone();return s.__filtered__?s.__takeCount__=ue(n,s.__takeCount__):s.__views__.push({size:ue(n,rn),type:e+(s.__dir__<0?"Right":"")}),s},U.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),o(["filter","map","takeWhile"],function(e,t){var n=t+1,s=n==Lu||n==ih;U.prototype[e]=function(u){var l=this.clone();return l.__iteratees__.push({iteratee:fe(u,3),type:n}),l.__filtered__=l.__filtered__||s,l}}),o(["head","last"],function(e,t){var n="take"+(t?"Right":"");U.prototype[e]=function(){return this[n](1).value()[0]}}),o(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");U.prototype[e]=function(){return this.__filtered__?new U(this):this[n](1)}}),U.prototype.compact=function(){return this.filter($t)},U.prototype.find=function(e){return this.filter(e).head()},U.prototype.findLast=function(e){return this.reverse().find(e)},U.prototype.invokeMap=be(function(e,t){return typeof e=="function"?new U(this):this.map(function(n){return Re(n,e,t)})}),U.prototype.reject=function(e){return this.filter(ts(fe(e)))},U.prototype.slice=function(e,t){e=xe(e);var n=this;return n.__filtered__&&(e>0||t<0)?new U(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==O&&(t=xe(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},U.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},U.prototype.toArray=function(){return this.take(rn)},sn(U.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),s=/^(?:head|last)$/.test(t),u=p[s?"take"+(t=="last"?"Right":""):t],l=s||/^find/.test(t);u&&(p.prototype[t]=function(){var h=this.__wrapped__,m=s?[1]:arguments,T=h instanceof U,x=m[0],v=T||Se(h),I=function(Y){var K=u.apply(p,A([Y],m));return s&&b?K[0]:K};v&&n&&typeof x=="function"&&x.length!=1&&(T=v=!1);var b=this.__chain__,N=!!this.__actions__.length,C=l&&!b,G=T&&!N;if(!l&&v){h=G?h:new U(this);var D=e.apply(h,m);return D.__actions__.push({func:Jo,args:[I],thisArg:O}),new L(D,b)}return C&&G?e.apply(this,m):(D=this.thru(I),C?s?D.value()[0]:D.value():D)})}),o(["pop","push","shift","sort","splice","unshift"],function(e){var t=Hr[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",s=/^(?:pop|shift)$/.test(e);p.prototype[e]=function(){var u=arguments;if(s&&!this.__chain__){var l=this.value();return t.apply(Se(l)?l:[],u)}return this[n](function(h){return t.apply(Se(h)?h:[],u)})}}),sn(U.prototype,function(e,t){var n=p[t];if(n){var s=n.name+"";Ze.call(so,s)||(so[s]=[]),so[s].push({name:t,func:n})}}),so[Ea(O,Sn).name]=[{name:"wrapper",func:O}],U.prototype.clone=ke,U.prototype.reverse=$e,U.prototype.value=sc,p.prototype.at=Ny,p.prototype.chain=xm,p.prototype.commit=mp,p.prototype.next=Im,p.prototype.plant=bm,p.prototype.reverse=Dn,p.prototype.toJSON=p.prototype.valueOf=p.prototype.value=Xt,p.prototype.first=p.prototype.head,Pn&&(p.prototype[Pn]=Rm),p},Qt=Bh();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(bt._=Qt,define(function(){return Qt})):xn?((xn.exports=Qt)._=Qt,nc._=Qt):bt._=Qt}).call(Cu)});var kS=zr(Fr=>{"use strict";Fr.aliasToReal={each:"forEach",eachRight:"forEachRight",entries:"toPairs",entriesIn:"toPairsIn",extend:"assignIn",extendAll:"assignInAll",extendAllWith:"assignInAllWith",extendWith:"assignInWith",first:"head",conforms:"conformsTo",matches:"isMatch",property:"get",__:"placeholder",F:"stubFalse",T:"stubTrue",all:"every",allPass:"overEvery",always:"constant",any:"some",anyPass:"overSome",apply:"spread",assoc:"set",assocPath:"set",complement:"negate",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",dropLast:"dropRight",dropLastWhile:"dropRightWhile",equals:"isEqual",identical:"eq",indexBy:"keyBy",init:"initial",invertObj:"invert",juxt:"over",omitAll:"omit",nAry:"ary",path:"get",pathEq:"matchesProperty",pathOr:"getOr",paths:"at",pickAll:"pick",pipe:"flow",pluck:"map",prop:"get",propEq:"matchesProperty",propOr:"getOr",props:"at",symmetricDifference:"xor",symmetricDifferenceBy:"xorBy",symmetricDifferenceWith:"xorWith",takeLast:"takeRight",takeLastWhile:"takeRightWhile",unapply:"rest",unnest:"flatten",useWith:"overArgs",where:"conformsTo",whereEq:"isMatch",zipObj:"zipObject"};Fr.aryMethod={1:["assignAll","assignInAll","attempt","castArray","ceil","create","curry","curryRight","defaultsAll","defaultsDeepAll","floor","flow","flowRight","fromPairs","invert","iteratee","memoize","method","mergeAll","methodOf","mixin","nthArg","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words","zipAll"],2:["add","after","ary","assign","assignAllWith","assignIn","assignInAllWith","at","before","bind","bindAll","bindKey","chunk","cloneDeepWith","cloneWith","concat","conformsTo","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","defaultTo","delay","difference","divide","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flatMapDeep","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","meanBy","merge","mergeAllWith","minBy","multiply","nth","omit","omitBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","propertyOf","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","restFrom","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","spreadFrom","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","findFrom","findIndexFrom","findLastFrom","findLastIndexFrom","getOr","includesFrom","indexOfFrom","inRange","intersectionBy","intersectionWith","invokeArgs","invokeArgsMap","isEqualWith","isMatchWith","flatMapDepth","lastIndexOfFrom","mergeWith","orderBy","padChars","padCharsEnd","padCharsStart","pullAllBy","pullAllWith","rangeStep","rangeStepRight","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","update","xorBy","xorWith","zipWith"],4:["fill","setWith","updateWith"]};Fr.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]};Fr.iterateeAry={dropRightWhile:1,dropWhile:1,every:1,filter:1,find:1,findFrom:1,findIndex:1,findIndexFrom:1,findKey:1,findLast:1,findLastFrom:1,findLastIndex:1,findLastIndexFrom:1,findLastKey:1,flatMap:1,flatMapDeep:1,flatMapDepth:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2};Fr.iterateeRearg={mapKeys:[1],reduceRight:[1,0]};Fr.methodRearg={assignInAllWith:[1,0],assignInWith:[1,2,0],assignAllWith:[1,0],assignWith:[1,2,0],differenceBy:[1,2,0],differenceWith:[1,2,0],getOr:[2,1,0],intersectionBy:[1,2,0],intersectionWith:[1,2,0],isEqualWith:[1,2,0],isMatchWith:[2,1,0],mergeAllWith:[1,0],mergeWith:[1,2,0],padChars:[2,1,0],padCharsEnd:[2,1,0],padCharsStart:[2,1,0],pullAllBy:[2,1,0],pullAllWith:[2,1,0],rangeStep:[1,2,0],rangeStepRight:[1,2,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],unionBy:[1,2,0],unionWith:[1,2,0],updateWith:[3,1,2,0],xorBy:[1,2,0],xorWith:[1,2,0],zipWith:[1,2,0]};Fr.methodSpread={assignAll:{start:0},assignAllWith:{start:0},assignInAll:{start:0},assignInAllWith:{start:0},defaultsAll:{start:0},defaultsDeepAll:{start:0},invokeArgs:{start:2},invokeArgsMap:{start:2},mergeAll:{start:0},mergeAllWith:{start:0},partial:{start:1},partialRight:{start:1},without:{start:1},zipAll:{start:0}};Fr.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAllWith:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignAll:!0,assignAllWith:!0,assignIn:!0,assignInAll:!0,assignInAllWith:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsAll:!0,defaultsDeep:!0,defaultsDeepAll:!0,merge:!0,mergeAll:!0,mergeAllWith:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0,update:!0,updateWith:!0}};Fr.realToAlias=function(){var i=Object.prototype.hasOwnProperty,r=Fr.aliasToReal,o={};for(var a in r){var c=r[a];i.call(o,c)?o[c].push(a):o[c]=[a]}return o}();Fr.remap={assignAll:"assign",assignAllWith:"assignWith",assignInAll:"assignIn",assignInAllWith:"assignInWith",curryN:"curry",curryRightN:"curryRight",defaultsAll:"defaults",defaultsDeepAll:"defaultsDeep",findFrom:"find",findIndexFrom:"findIndex",findLastFrom:"findLast",findLastIndexFrom:"findLastIndex",getOr:"get",includesFrom:"includes",indexOfFrom:"indexOf",invokeArgs:"invoke",invokeArgsMap:"invokeMap",lastIndexOfFrom:"lastIndexOf",mergeAll:"merge",mergeAllWith:"mergeWith",padChars:"pad",padCharsEnd:"padEnd",padCharsStart:"padStart",propertyOf:"get",rangeStep:"range",rangeStepRight:"rangeRight",restFrom:"rest",spreadFrom:"spread",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart",zipAll:"zip"};Fr.skipFixed={castArray:!0,flow:!0,flowRight:!0,iteratee:!0,mixin:!0,rearg:!0,runInContext:!0};Fr.skipRearg={add:!0,assign:!0,assignIn:!0,bind:!0,bindKey:!0,concat:!0,difference:!0,divide:!0,eq:!0,gt:!0,gte:!0,isEqual:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,multiply:!0,overArgs:!0,partial:!0,partialRight:!0,propertyOf:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0,zipObjectDeep:!0}});var GS=zr((XL,BS)=>{"use strict";BS.exports={}});var $S=zr((eU,qS)=>{"use strict";var Ft=kS(),yR=GS(),WS=Array.prototype.push;function _R(i,r){return r==2?function(o,a){return i.apply(void 0,arguments)}:function(o){return i.apply(void 0,arguments)}}function NT(i,r){return r==2?function(o,a){return i(o,a)}:function(o){return i(o)}}function VS(i){for(var r=i?i.length:0,o=Array(r);r--;)o[r]=i[r];return o}function TR(i){return function(r){return i({},r)}}function ER(i,r){return function(){for(var o=arguments.length,a=o-1,c=Array(o);o--;)c[o]=arguments[o];var f=c[r],d=c.slice(0,r);return f&&WS.apply(d,f),r!=a&&WS.apply(d,c.slice(r+1)),i.apply(this,d)}}function CT(i,r){return function(){var o=arguments.length;if(o){for(var a=Array(o);o--;)a[o]=arguments[o];var c=a[0]=r.apply(void 0,a);return i.apply(void 0,a),c}}}function DT(i,r,o,a){var c=typeof r=="function",f=r===Object(r);if(f&&(a=o,o=r,r=void 0),o==null)throw new TypeError;a||(a={});var d={cap:"cap"in a?a.cap:!0,curry:"curry"in a?a.curry:!0,fixed:"fixed"in a?a.fixed:!0,immutable:"immutable"in a?a.immutable:!0,rearg:"rearg"in a?a.rearg:!0},g=c?o:yR,E="curry"in a&&a.curry,A="fixed"in a&&a.fixed,R="rearg"in a&&a.rearg,V=c?o.runInContext():void 0,B=c?o:{ary:i.ary,assign:i.assign,clone:i.clone,curry:i.curry,forEach:i.forEach,isArray:i.isArray,isError:i.isError,isFunction:i.isFunction,isWeakMap:i.isWeakMap,iteratee:i.iteratee,keys:i.keys,rearg:i.rearg,toInteger:i.toInteger,toPath:i.toPath},P=B.ary,Z=B.assign,_e=B.clone,Ce=B.curry,J=B.forEach,ae=B.isArray,Ie=B.isError,Me=B.isFunction,q=B.isWeakMap,k=B.keys,j=B.rearg,se=B.toInteger,le=B.toPath,ot=k(Ft.aryMethod),An={castArray:function(ne){return function(){var F=arguments[0];return ae(F)?ne(VS(F)):ne.apply(void 0,arguments)}},iteratee:function(ne){return function(){var F=arguments[0],z=arguments[1],oe=ne(F,z),me=oe.length;return d.cap&&typeof z=="number"?(z=z>2?z-2:1,me&&me<=z?oe:NT(oe,z)):oe}},mixin:function(ne){return function(F){var z=this;if(!Me(z))return ne(z,Object(F));var oe=[];return J(k(F),function(me){Me(F[me])&&oe.push([me,z.prototype[me]])}),ne(z,Object(F)),J(oe,function(me){var rt=me[1];Me(rt)?z.prototype[me[0]]=rt:delete z.prototype[me[0]]}),z}},nthArg:function(ne){return function(F){var z=F<0?1:se(F)+1;return Ce(ne(F),z)}},rearg:function(ne){return function(F,z){var oe=z?z.length:0;return Ce(ne(F,z),oe)}},runInContext:function(ne){return function(F){return DT(i,ne(F),a)}}};function de(ne,F){if(d.cap){var z=Ft.iterateeRearg[ne];if(z)return st(F,z);var oe=!c&&Ft.iterateeAry[ne];if(oe)return De(F,oe)}return F}function W(ne,F,z){return E||d.curry&&z>1?Ce(F,z):F}function $(ne,F,z){if(d.fixed&&(A||!Ft.skipFixed[ne])){var oe=Ft.methodSpread[ne],me=oe&&oe.start;return me===void 0?P(F,z):ER(F,me)}return F}function te(ne,F,z){return d.rearg&&z>1&&(R||!Ft.skipRearg[ne])?j(F,Ft.methodRearg[ne]||Ft.aryRearg[z]):F}function H(ne,F){F=le(F);for(var z=-1,oe=F.length,me=oe-1,rt=_e(Object(ne)),pt=rt;pt!=null&&++z<oe;){var Pe=F[z],Lt=pt[Pe];Lt!=null&&!(Me(Lt)||Ie(Lt)||q(Lt))&&(pt[Pe]=_e(z==me?Lt:Object(Lt))),pt=pt[Pe]}return rt}function Te(ne){return Fe.runInContext.convert(ne)(void 0)}function he(ne,F){var z=Ft.aliasToReal[ne]||ne,oe=Ft.remap[z]||z,me=a;return function(rt){var pt=c?V:B,Pe=c?V[oe]:F,Lt=Z(Z({},me),rt);return DT(pt,z,Pe,Lt)}}function De(ne,F){return Qe(ne,function(z){return typeof z=="function"?NT(z,F):z})}function st(ne,F){return Qe(ne,function(z){var oe=F.length;return _R(j(NT(z,oe),F),oe)})}function Qe(ne,F){return function(){var z=arguments.length;if(!z)return ne();for(var oe=Array(z);z--;)oe[z]=arguments[z];var me=d.rearg?0:z-1;return oe[me]=F(oe[me]),ne.apply(void 0,oe)}}function ie(ne,F,z){var oe,me=Ft.aliasToReal[ne]||ne,rt=F,pt=An[me];return pt?rt=pt(F):d.immutable&&(Ft.mutate.array[me]?rt=CT(F,VS):Ft.mutate.object[me]?rt=CT(F,TR(F)):Ft.mutate.set[me]&&(rt=CT(F,H))),J(ot,function(Pe){return J(Ft.aryMethod[Pe],function(Lt){if(me==Lt){var Fs=Ft.methodSpread[me],kr=Fs&&Fs.afterRearg;return oe=kr?$(me,te(me,rt,Pe),Pe):te(me,$(me,rt,Pe),Pe),oe=de(me,oe),oe=W(me,oe,Pe),!1}}),!oe}),oe||(oe=rt),oe==F&&(oe=E?Ce(oe,1):function(){return F.apply(this,arguments)}),oe.convert=he(me,F),oe.placeholder=F.placeholder=z,oe}if(!f)return ie(r,o,g);var Fe=o,vt=[];return J(ot,function(ne){J(Ft.aryMethod[ne],function(F){var z=Fe[Ft.remap[F]||F];z&&vt.push([F,ie(F,z,Fe)])})}),J(k(Fe),function(ne){var F=Fe[ne];if(typeof F=="function"){for(var z=vt.length;z--;)if(vt[z][0]==ne)return;F.convert=he(ne,F),vt.push([ne,F])}}),J(vt,function(ne){Fe[ne[0]]=ne[1]}),Fe.convert=Te,Fe.placeholder=Fe,J(k(Fe),function(ne){J(Ft.realToAlias[ne]||[],function(F){Fe[F]=Fe[ne]})}),Fe}qS.exports=DT});var ZS=zr((tU,zS)=>{"use strict";var HS=FS().runInContext();zS.exports=$S()(HS,HS)});var y0={};Le(y0,{AIOperations:()=>gv,BpmCorrelationKey:()=>FE,BpmInstanceKey:()=>kE,BpmStatusKey:()=>BE,BpmStatusValue:()=>GE,BuilderSocketEvent:()=>PE,DEFAULT_BB_DATASOURCE_ID:()=>Cv,DefaultAppTheme:()=>vv,DefaultBuilderTheme:()=>Ov,GridSocketEvent:()=>ME,Header:()=>CE,InvalidFileExtensions:()=>Nv,OperationFieldTypes:()=>yv,OperationFields:()=>_v,OperatorOptions:()=>Mr,PROTECTED_EXTERNAL_COLUMNS:()=>DE,PROTECTED_INTERNAL_COLUMNS:()=>xd,REBOOT_CRON:()=>wv,RoleColor:()=>LE,SWITCHABLE_TYPES:()=>Tv,SocketEvent:()=>UE,SocketSessionTTL:()=>xv,SqlNumberTypeRangeMap:()=>D_,ThemeClassPrefix:()=>Au,ThemeOptions:()=>Id,ValidColumnNameRegex:()=>Rv,ValidQueryNameRegex:()=>Iv,ValidSnippetNameRegex:()=>bv,automations:()=>lE,canBeDisplayColumn:()=>UR,canBeSortColumn:()=>MR,canHaveDefaultColumn:()=>PR,dataFilters:()=>IT,ensureValidTheme:()=>QS,findDuplicateInternalColumns:()=>FR,getThemeClassNames:()=>kR,helpers:()=>TT,isExternalColumnName:()=>Av,isInternalColumnName:()=>Ev,sdk:()=>kT,utils:()=>P_});module.exports=fO(y0);var pO=["user:created","user:updated","user:deleted","user:admin:assigned","user:admin:removed","user:builder:assigned","user:builder:removed","user_group:created","user_group:updated","user_group:deleted","user_group:user_added","user_group:users_deleted","user_group:permissions_edited"],A0=[...pO];var dO=fo(Il()),fu=(d=>(d.EQUAL="equal",d.NOT_EQUAL="notEqual",d.EMPTY="empty",d.NOT_EMPTY="notEmpty",d.FUZZY="fuzzy",d.STRING="string",d))(fu||{}),ls=(c=>(c.CONTAINS="contains",c.NOT_CONTAINS="notContains",c.CONTAINS_ANY="containsAny",c.ONE_OF="oneOf",c))(ls||{}),Rl=(r=>(r.RANGE="range",r))(Rl||{}),bl=(o=>(o.AND="$and",o.OR="$or",o))(bl||{});function pd(i){return Object.values(bl).includes(i)}function pE(i){return Object.values(fu).includes(i)}function dE(i){return Object.values(ls).includes(i)}function O_(i){return Object.values(Rl).includes(i)}var wl=(o=>(o.RETURN_ALL="all",o.RETURN_NONE="none",o))(wl||{});var Eb={OptOut:"analytics:opt:out",OptIn:"analytics:opt:in",SelfHostInit:"hosting:init",PluginInit:"plugin:init"};var fs="_";var v_=i=>`${i}${fs}`,Nl=(ie=>(ie.USER="us",ie.GROUP="gr",ie.WORKSPACE="workspace",ie.CONFIG="config",ie.TEMPLATE="template",ie.APP="app",ie.DEV="dev",ie.APP_DEV="app_dev",ie.APP_METADATA="app_metadata",ie.ROLE="role",ie.MIGRATIONS="migrations",ie.DEV_INFO="devinfo",ie.AUTOMATION_LOG="log_au",ie.ACCOUNT_METADATA="acc_metadata",ie.PLUGIN="plg",ie.DATASOURCE="datasource",ie.DATASOURCE_PLUS="datasource_plus",ie.APP_BACKUP="backup",ie.TABLE="ta",ie.ROW="ro",ie.AUTOMATION="au",ie.LINK="li",ie.WEBHOOK="wh",ie.INSTANCE="inst",ie.LAYOUT="layout",ie.SCREEN="screen",ie.QUERY="query",ie.DEPLOYMENTS="deployments",ie.METADATA="metadata",ie.MEM_VIEW="view",ie.USER_FLAG="flag",ie.AUTOMATION_METADATA="meta_au",ie.AUDIT_LOG="al",ie.APP_MIGRATION_METADATA="_design/migrations",ie.SCIM_LOG="scimlog",ie.ROW_ACTIONS="ra",ie.OAUTH2_CONFIG="oauth2",ie.OAUTH2_CONFIG_LOG="oauth2log",ie))(Nl||{}),uw=Object.values(Nl).sort((i,r)=>r.length-i.length);var hE=(o=>(o.VIEW="view",o.ROW_ACTION="row_action",o))(hE||{}),cw=Object.values(hE).sort((i,r)=>r.length-i.length);var Gn=(g=>(g.ROW_SAVED="ROW_SAVED",g.ROW_UPDATED="ROW_UPDATED",g.ROW_DELETED="ROW_DELETED",g.WEBHOOK="WEBHOOK",g.APP="APP",g.CRON="CRON",g.ROW_ACTION="ROW_ACTION",g))(Gn||{});var ft=(j=>(j.SEND_EMAIL_SMTP="SEND_EMAIL_SMTP",j.CREATE_ROW="CREATE_ROW",j.UPDATE_ROW="UPDATE_ROW",j.DELETE_ROW="DELETE_ROW",j.EXECUTE_BASH="EXECUTE_BASH",j.OUTGOING_WEBHOOK="OUTGOING_WEBHOOK",j.EXECUTE_SCRIPT="EXECUTE_SCRIPT",j.EXECUTE_SCRIPT_V2="EXECUTE_SCRIPT_V2",j.EXECUTE_QUERY="EXECUTE_QUERY",j.SERVER_LOG="SERVER_LOG",j.DELAY="DELAY",j.FILTER="FILTER",j.QUERY_ROWS="QUERY_ROWS",j.LOOP="LOOP",j.COLLECT="COLLECT",j.OPENAI="OPENAI",j.TRIGGER_AUTOMATION_RUN="TRIGGER_AUTOMATION_RUN",j.BRANCH="BRANCH",j.discord="discord",j.slack="slack",j.zapier="zapier",j.integromat="integromat",j.n8n="n8n",j))(ft||{}),fw=[...Object.values(ft),...Object.values(Gn)];var x_=(c=>(c.EQUAL="EQUAL",c.NOT_EQUAL="NOT_EQUAL",c.GREATER_THAN="GREATER_THAN",c.LESS_THAN="LESS_THAN",c))(x_||{});var I_=(d=>(d.GET="GET",d.POST="POST",d.PATCH="PATCH",d.PUT="PUT",d.HEAD="HEAD",d.DELETE="DELETE",d))(I_||{});var mE=(a=>(a.DATASOURCE="datasource",a.COMPONENT="component",a.AUTOMATION="automation",a))(mE||{});var ON=Object.values(mE);var bN=["rows","queries","automations"],wN=["queries","automations"];var pu=(o=>(o.ASCENDING="ascending",o.DESCENDING="descending",o))(pu||{}),hd=(o=>(o.STRING="string",o.NUMBER="number",o))(hd||{});var Ge;(function(i){i.assertEqual=c=>c;function r(c){}i.assertIs=r;function o(c){throw new Error}i.assertNever=o,i.arrayToEnum=c=>{let f={};for(let d of c)f[d]=d;return f},i.getValidEnumValues=c=>{let f=i.objectKeys(c).filter(g=>typeof c[c[g]]!="number"),d={};for(let g of f)d[g]=c[g];return i.objectValues(d)},i.objectValues=c=>i.objectKeys(c).map(function(f){return c[f]}),i.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{let f=[];for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&f.push(d);return f},i.find=(c,f)=>{for(let d of c)if(f(d))return d},i.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function a(c,f=" | "){return c.map(d=>typeof d=="string"?`'${d}'`:d).join(f)}i.joinValues=a,i.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Ge||(Ge={}));var b_;(function(i){i.mergeShapes=(r,o)=>({...r,...o})})(b_||(b_={}));var re=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),po=i=>{switch(typeof i){case"undefined":return re.undefined;case"string":return re.string;case"number":return isNaN(i)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(i)?re.array:i===null?re.null:i.then&&typeof i.then=="function"&&i.catch&&typeof i.catch=="function"?re.promise:typeof Map<"u"&&i instanceof Map?re.map:typeof Set<"u"&&i instanceof Set?re.set:typeof Date<"u"&&i instanceof Date?re.date:re.object;default:return re.unknown}},M=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hO=i=>JSON.stringify(i,null,2).replace(/"([^"]+)":/g,"$1:"),Zr=class i extends Error{constructor(r){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=r}get errors(){return this.issues}format(r){let o=r||function(f){return f.message},a={_errors:[]},c=f=>{for(let d of f.issues)if(d.code==="invalid_union")d.unionErrors.map(c);else if(d.code==="invalid_return_type")c(d.returnTypeError);else if(d.code==="invalid_arguments")c(d.argumentsError);else if(d.path.length===0)a._errors.push(o(d));else{let g=a,E=0;for(;E<d.path.length;){let A=d.path[E];E===d.path.length-1?(g[A]=g[A]||{_errors:[]},g[A]._errors.push(o(d))):g[A]=g[A]||{_errors:[]},g=g[A],E++}}};return c(this),a}static assert(r){if(!(r instanceof i))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=o=>o.message){let o={},a=[];for(let c of this.issues)c.path.length>0?(o[c.path[0]]=o[c.path[0]]||[],o[c.path[0]].push(r(c))):a.push(r(c));return{formErrors:a,fieldErrors:o}}get formErrors(){return this.flatten()}};Zr.create=i=>new Zr(i);var mu=(i,r)=>{let o;switch(i.code){case M.invalid_type:i.received===re.undefined?o="Required":o=`Expected ${i.expected}, received ${i.received}`;break;case M.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(i.expected,Ge.jsonStringifyReplacer)}`;break;case M.unrecognized_keys:o=`Unrecognized key(s) in object: ${Ge.joinValues(i.keys,", ")}`;break;case M.invalid_union:o="Invalid input";break;case M.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${Ge.joinValues(i.options)}`;break;case M.invalid_enum_value:o=`Invalid enum value. Expected ${Ge.joinValues(i.options)}, received '${i.received}'`;break;case M.invalid_arguments:o="Invalid function arguments";break;case M.invalid_return_type:o="Invalid function return type";break;case M.invalid_date:o="Invalid date";break;case M.invalid_string:typeof i.validation=="object"?"includes"in i.validation?(o=`Invalid input: must include "${i.validation.includes}"`,typeof i.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${i.validation.position}`)):"startsWith"in i.validation?o=`Invalid input: must start with "${i.validation.startsWith}"`:"endsWith"in i.validation?o=`Invalid input: must end with "${i.validation.endsWith}"`:Ge.assertNever(i.validation):i.validation!=="regex"?o=`Invalid ${i.validation}`:o="Invalid";break;case M.too_small:i.type==="array"?o=`Array must contain ${i.exact?"exactly":i.inclusive?"at least":"more than"} ${i.minimum} element(s)`:i.type==="string"?o=`String must contain ${i.exact?"exactly":i.inclusive?"at least":"over"} ${i.minimum} character(s)`:i.type==="number"?o=`Number must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${i.minimum}`:i.type==="date"?o=`Date must be ${i.exact?"exactly equal to ":i.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(i.minimum))}`:o="Invalid input";break;case M.too_big:i.type==="array"?o=`Array must contain ${i.exact?"exactly":i.inclusive?"at most":"less than"} ${i.maximum} element(s)`:i.type==="string"?o=`String must contain ${i.exact?"exactly":i.inclusive?"at most":"under"} ${i.maximum} character(s)`:i.type==="number"?o=`Number must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="bigint"?o=`BigInt must be ${i.exact?"exactly":i.inclusive?"less than or equal to":"less than"} ${i.maximum}`:i.type==="date"?o=`Date must be ${i.exact?"exactly":i.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(i.maximum))}`:o="Invalid input";break;case M.custom:o="Invalid input";break;case M.invalid_intersection_types:o="Intersection results could not be merged";break;case M.not_multiple_of:o=`Number must be a multiple of ${i.multipleOf}`;break;case M.not_finite:o="Number must be finite";break;default:o=r.defaultError,Ge.assertNever(i)}return{message:o}},_E=mu;function mO(i){_E=i}function md(){return _E}var gd=i=>{let{data:r,path:o,errorMaps:a,issueData:c}=i,f=[...o,...c.path||[]],d={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let g="",E=a.filter(A=>!!A).slice().reverse();for(let A of E)g=A(d,{data:r,defaultError:g}).message;return{...c,path:f,message:g}},gO=[];function X(i,r){let o=md(),a=gd({issueData:r,data:i.data,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,o,o===mu?void 0:mu].filter(c=>!!c)});i.common.issues.push(a)}var cr=class i{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(r,o){let a=[];for(let c of o){if(c.status==="aborted")return Ee;c.status==="dirty"&&r.dirty(),a.push(c.value)}return{status:r.value,value:a}}static async mergeObjectAsync(r,o){let a=[];for(let c of o){let f=await c.key,d=await c.value;a.push({key:f,value:d})}return i.mergeObjectSync(r,a)}static mergeObjectSync(r,o){let a={};for(let c of o){let{key:f,value:d}=c;if(f.status==="aborted"||d.status==="aborted")return Ee;f.status==="dirty"&&r.dirty(),d.status==="dirty"&&r.dirty(),f.value!=="__proto__"&&(typeof d.value<"u"||c.alwaysSet)&&(a[f.value]=d.value)}return{status:r.value,value:a}}},Ee=Object.freeze({status:"aborted"}),hu=i=>({status:"dirty",value:i}),Ar=i=>({status:"valid",value:i}),w_=i=>i.status==="aborted",N_=i=>i.status==="dirty",Ll=i=>i.status==="valid",Ul=i=>typeof Promise<"u"&&i instanceof Promise;function yd(i,r,o,a){if(o==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?i!==r||!a:!r.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?a:o==="a"?a.call(i):a?a.value:r.get(i)}function TE(i,r,o,a,c){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?i!==r||!c:!r.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?c.call(i,o):c?c.value=o:r.set(i,o),o}var ce;(function(i){i.errToObj=r=>typeof r=="string"?{message:r}:r||{},i.toString=r=>typeof r=="string"?r:r?.message})(ce||(ce={}));var Cl,Dl,_n=class{constructor(r,o,a,c){this._cachedPath=[],this.parent=r,this.data=o,this._path=a,this._key=c}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},gE=(i,r)=>{if(Ll(r))return{success:!0,data:r.value};if(!i.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let o=new Zr(i.common.issues);return this._error=o,this._error}}};function we(i){if(!i)return{};let{errorMap:r,invalid_type_error:o,required_error:a,description:c}=i;if(r&&(o||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return r?{errorMap:r,description:c}:{errorMap:(d,g)=>{var E,A;let{message:R}=i;return d.code==="invalid_enum_value"?{message:R??g.defaultError}:typeof g.data>"u"?{message:(E=R??a)!==null&&E!==void 0?E:g.defaultError}:d.code!=="invalid_type"?{message:g.defaultError}:{message:(A=R??o)!==null&&A!==void 0?A:g.defaultError}},description:c}}var Ne=class{constructor(r){this.spa=this.safeParseAsync,this._def=r,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(r){return po(r.data)}_getOrReturnCtx(r,o){return o||{common:r.parent.common,data:r.data,parsedType:po(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}_processInputParams(r){return{status:new cr,ctx:{common:r.parent.common,data:r.data,parsedType:po(r.data),schemaErrorMap:this._def.errorMap,path:r.path,parent:r.parent}}}_parseSync(r){let o=this._parse(r);if(Ul(o))throw new Error("Synchronous parse encountered promise.");return o}_parseAsync(r){let o=this._parse(r);return Promise.resolve(o)}parse(r,o){let a=this.safeParse(r,o);if(a.success)return a.data;throw a.error}safeParse(r,o){var a;let c={common:{issues:[],async:(a=o?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:o?.errorMap},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:po(r)},f=this._parseSync({data:r,path:c.path,parent:c});return gE(c,f)}async parseAsync(r,o){let a=await this.safeParseAsync(r,o);if(a.success)return a.data;throw a.error}async safeParseAsync(r,o){let a={common:{issues:[],contextualErrorMap:o?.errorMap,async:!0},path:o?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:r,parsedType:po(r)},c=this._parse({data:r,path:a.path,parent:a}),f=await(Ul(c)?c:Promise.resolve(c));return gE(a,f)}refine(r,o){let a=c=>typeof o=="string"||typeof o>"u"?{message:o}:typeof o=="function"?o(c):o;return this._refinement((c,f)=>{let d=r(c),g=()=>f.addIssue({code:M.custom,...a(c)});return typeof Promise<"u"&&d instanceof Promise?d.then(E=>E?!0:(g(),!1)):d?!0:(g(),!1)})}refinement(r,o){return this._refinement((a,c)=>r(a)?!0:(c.addIssue(typeof o=="function"?o(a,c):o),!1))}_refinement(r){return new Yr({schema:this,typeName:ye.ZodEffects,effect:{type:"refinement",refinement:r}})}superRefine(r){return this._refinement(r)}optional(){return yn.create(this,this._def)}nullable(){return si.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ri.create(this,this._def)}promise(){return go.create(this,this._def)}or(r){return _s.create([this,r],this._def)}and(r){return Ts.create(this,r,this._def)}transform(r){return new Yr({...we(this._def),schema:this,typeName:ye.ZodEffects,effect:{type:"transform",transform:r}})}default(r){let o=typeof r=="function"?r:()=>r;return new vs({...we(this._def),innerType:this,defaultValue:o,typeName:ye.ZodDefault})}brand(){return new Ml({typeName:ye.ZodBranded,type:this,...we(this._def)})}catch(r){let o=typeof r=="function"?r:()=>r;return new xs({...we(this._def),innerType:this,catchValue:o,typeName:ye.ZodCatch})}describe(r){let o=this.constructor;return new o({...this._def,description:r})}pipe(r){return Pl.create(this,r)}readonly(){return Is.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yO=/^c[^\s-]{8,}$/i,_O=/^[0-9a-z]+$/,TO=/^[0-9A-HJKMNP-TV-Z]{26}$/,EO=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,AO=/^[a-z0-9_-]{21}$/i,SO=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OO=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vO="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",R_,xO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IO=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RO=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,EE="((\\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])))",bO=new RegExp(`^${EE}$`);function AE(i){let r="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return i.precision?r=`${r}\\.\\d{${i.precision}}`:i.precision==null&&(r=`${r}(\\.\\d+)?`),r}function wO(i){return new RegExp(`^${AE(i)}$`)}function SE(i){let r=`${EE}T${AE(i)}`,o=[];return o.push(i.local?"Z?":"Z"),i.offset&&o.push("([+-]\\d{2}:?\\d{2})"),r=`${r}(${o.join("|")})`,new RegExp(`^${r}$`)}function NO(i,r){return!!((r==="v4"||!r)&&xO.test(i)||(r==="v6"||!r)&&IO.test(i))}var ho=class i extends Ne{_parse(r){if(this._def.coerce&&(r.data=String(r.data)),this._getType(r)!==re.string){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.string,received:f.parsedType}),Ee}let a=new cr,c;for(let f of this._def.checks)if(f.kind==="min")r.data.length<f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),a.dirty());else if(f.kind==="max")r.data.length>f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),a.dirty());else if(f.kind==="length"){let d=r.data.length>f.value,g=r.data.length<f.value;(d||g)&&(c=this._getOrReturnCtx(r,c),d?X(c,{code:M.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):g&&X(c,{code:M.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),a.dirty())}else if(f.kind==="email")OO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"email",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="emoji")R_||(R_=new RegExp(vO,"u")),R_.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"emoji",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="uuid")EO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"uuid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="nanoid")AO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"nanoid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="cuid")yO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"cuid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="cuid2")_O.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"cuid2",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="ulid")TO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"ulid",code:M.invalid_string,message:f.message}),a.dirty());else if(f.kind==="url")try{new URL(r.data)}catch{c=this._getOrReturnCtx(r,c),X(c,{validation:"url",code:M.invalid_string,message:f.message}),a.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"regex",code:M.invalid_string,message:f.message}),a.dirty())):f.kind==="trim"?r.data=r.data.trim():f.kind==="includes"?r.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),a.dirty()):f.kind==="toLowerCase"?r.data=r.data.toLowerCase():f.kind==="toUpperCase"?r.data=r.data.toUpperCase():f.kind==="startsWith"?r.data.startsWith(f.value)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{startsWith:f.value},message:f.message}),a.dirty()):f.kind==="endsWith"?r.data.endsWith(f.value)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:{endsWith:f.value},message:f.message}),a.dirty()):f.kind==="datetime"?SE(f).test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"datetime",message:f.message}),a.dirty()):f.kind==="date"?bO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"date",message:f.message}),a.dirty()):f.kind==="time"?wO(f).test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{code:M.invalid_string,validation:"time",message:f.message}),a.dirty()):f.kind==="duration"?SO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"duration",code:M.invalid_string,message:f.message}),a.dirty()):f.kind==="ip"?NO(r.data,f.version)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"ip",code:M.invalid_string,message:f.message}),a.dirty()):f.kind==="base64"?RO.test(r.data)||(c=this._getOrReturnCtx(r,c),X(c,{validation:"base64",code:M.invalid_string,message:f.message}),a.dirty()):Ge.assertNever(f);return{status:a.value,value:r.data}}_regex(r,o,a){return this.refinement(c=>r.test(c),{validation:o,code:M.invalid_string,...ce.errToObj(a)})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}email(r){return this._addCheck({kind:"email",...ce.errToObj(r)})}url(r){return this._addCheck({kind:"url",...ce.errToObj(r)})}emoji(r){return this._addCheck({kind:"emoji",...ce.errToObj(r)})}uuid(r){return this._addCheck({kind:"uuid",...ce.errToObj(r)})}nanoid(r){return this._addCheck({kind:"nanoid",...ce.errToObj(r)})}cuid(r){return this._addCheck({kind:"cuid",...ce.errToObj(r)})}cuid2(r){return this._addCheck({kind:"cuid2",...ce.errToObj(r)})}ulid(r){return this._addCheck({kind:"ulid",...ce.errToObj(r)})}base64(r){return this._addCheck({kind:"base64",...ce.errToObj(r)})}ip(r){return this._addCheck({kind:"ip",...ce.errToObj(r)})}datetime(r){var o,a;return typeof r=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:r}):this._addCheck({kind:"datetime",precision:typeof r?.precision>"u"?null:r?.precision,offset:(o=r?.offset)!==null&&o!==void 0?o:!1,local:(a=r?.local)!==null&&a!==void 0?a:!1,...ce.errToObj(r?.message)})}date(r){return this._addCheck({kind:"date",message:r})}time(r){return typeof r=="string"?this._addCheck({kind:"time",precision:null,message:r}):this._addCheck({kind:"time",precision:typeof r?.precision>"u"?null:r?.precision,...ce.errToObj(r?.message)})}duration(r){return this._addCheck({kind:"duration",...ce.errToObj(r)})}regex(r,o){return this._addCheck({kind:"regex",regex:r,...ce.errToObj(o)})}includes(r,o){return this._addCheck({kind:"includes",value:r,position:o?.position,...ce.errToObj(o?.message)})}startsWith(r,o){return this._addCheck({kind:"startsWith",value:r,...ce.errToObj(o)})}endsWith(r,o){return this._addCheck({kind:"endsWith",value:r,...ce.errToObj(o)})}min(r,o){return this._addCheck({kind:"min",value:r,...ce.errToObj(o)})}max(r,o){return this._addCheck({kind:"max",value:r,...ce.errToObj(o)})}length(r,o){return this._addCheck({kind:"length",value:r,...ce.errToObj(o)})}nonempty(r){return this.min(1,ce.errToObj(r))}trim(){return new i({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new i({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(r=>r.kind==="datetime")}get isDate(){return!!this._def.checks.find(r=>r.kind==="date")}get isTime(){return!!this._def.checks.find(r=>r.kind==="time")}get isDuration(){return!!this._def.checks.find(r=>r.kind==="duration")}get isEmail(){return!!this._def.checks.find(r=>r.kind==="email")}get isURL(){return!!this._def.checks.find(r=>r.kind==="url")}get isEmoji(){return!!this._def.checks.find(r=>r.kind==="emoji")}get isUUID(){return!!this._def.checks.find(r=>r.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(r=>r.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(r=>r.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(r=>r.kind==="cuid2")}get isULID(){return!!this._def.checks.find(r=>r.kind==="ulid")}get isIP(){return!!this._def.checks.find(r=>r.kind==="ip")}get isBase64(){return!!this._def.checks.find(r=>r.kind==="base64")}get minLength(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxLength(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}};ho.create=i=>{var r;return new ho({checks:[],typeName:ye.ZodString,coerce:(r=i?.coerce)!==null&&r!==void 0?r:!1,...we(i)})};function CO(i,r){let o=(i.toString().split(".")[1]||"").length,a=(r.toString().split(".")[1]||"").length,c=o>a?o:a,f=parseInt(i.toFixed(c).replace(".","")),d=parseInt(r.toFixed(c).replace(".",""));return f%d/Math.pow(10,c)}var ps=class i extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(r){if(this._def.coerce&&(r.data=Number(r.data)),this._getType(r)!==re.number){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.number,received:f.parsedType}),Ee}let a,c=new cr;for(let f of this._def.checks)f.kind==="int"?Ge.isInteger(r.data)||(a=this._getOrReturnCtx(r,a),X(a,{code:M.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?CO(r.data,f.value)!==0&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(r.data)||(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_finite,message:f.message}),c.dirty()):Ge.assertNever(f);return{status:c.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,ce.toString(o))}gt(r,o){return this.setLimit("min",r,!1,ce.toString(o))}lte(r,o){return this.setLimit("max",r,!0,ce.toString(o))}lt(r,o){return this.setLimit("max",r,!1,ce.toString(o))}setLimit(r,o,a,c){return new i({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:a,message:ce.toString(c)}]})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}int(r){return this._addCheck({kind:"int",message:ce.toString(r)})}positive(r){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(r)})}negative(r){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:ce.toString(o)})}finite(r){return this._addCheck({kind:"finite",message:ce.toString(r)})}safe(r){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(r)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(r)})}get minValue(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}get isInt(){return!!this._def.checks.find(r=>r.kind==="int"||r.kind==="multipleOf"&&Ge.isInteger(r.value))}get isFinite(){let r=null,o=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(o===null||a.value>o)&&(o=a.value):a.kind==="max"&&(r===null||a.value<r)&&(r=a.value)}return Number.isFinite(o)&&Number.isFinite(r)}};ps.create=i=>new ps({checks:[],typeName:ye.ZodNumber,coerce:i?.coerce||!1,...we(i)});var ds=class i extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(r){if(this._def.coerce&&(r.data=BigInt(r.data)),this._getType(r)!==re.bigint){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.bigint,received:f.parsedType}),Ee}let a,c=new cr;for(let f of this._def.checks)f.kind==="min"?(f.inclusive?r.data<f.value:r.data<=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?r.data>f.value:r.data>=f.value)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?r.data%f.value!==BigInt(0)&&(a=this._getOrReturnCtx(r,a),X(a,{code:M.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Ge.assertNever(f);return{status:c.value,value:r.data}}gte(r,o){return this.setLimit("min",r,!0,ce.toString(o))}gt(r,o){return this.setLimit("min",r,!1,ce.toString(o))}lte(r,o){return this.setLimit("max",r,!0,ce.toString(o))}lt(r,o){return this.setLimit("max",r,!1,ce.toString(o))}setLimit(r,o,a,c){return new i({...this._def,checks:[...this._def.checks,{kind:r,value:o,inclusive:a,message:ce.toString(c)}]})}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}positive(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(r)})}negative(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(r)})}nonpositive(r){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(r)})}nonnegative(r){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(r)})}multipleOf(r,o){return this._addCheck({kind:"multipleOf",value:r,message:ce.toString(o)})}get minValue(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r}get maxValue(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r}};ds.create=i=>{var r;return new ds({checks:[],typeName:ye.ZodBigInt,coerce:(r=i?.coerce)!==null&&r!==void 0?r:!1,...we(i)})};var hs=class extends Ne{_parse(r){if(this._def.coerce&&(r.data=!!r.data),this._getType(r)!==re.boolean){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.boolean,received:a.parsedType}),Ee}return Ar(r.data)}};hs.create=i=>new hs({typeName:ye.ZodBoolean,coerce:i?.coerce||!1,...we(i)});var ms=class i extends Ne{_parse(r){if(this._def.coerce&&(r.data=new Date(r.data)),this._getType(r)!==re.date){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_type,expected:re.date,received:f.parsedType}),Ee}if(isNaN(r.data.getTime())){let f=this._getOrReturnCtx(r);return X(f,{code:M.invalid_date}),Ee}let a=new cr,c;for(let f of this._def.checks)f.kind==="min"?r.data.getTime()<f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),a.dirty()):f.kind==="max"?r.data.getTime()>f.value&&(c=this._getOrReturnCtx(r,c),X(c,{code:M.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),a.dirty()):Ge.assertNever(f);return{status:a.value,value:new Date(r.data.getTime())}}_addCheck(r){return new i({...this._def,checks:[...this._def.checks,r]})}min(r,o){return this._addCheck({kind:"min",value:r.getTime(),message:ce.toString(o)})}max(r,o){return this._addCheck({kind:"max",value:r.getTime(),message:ce.toString(o)})}get minDate(){let r=null;for(let o of this._def.checks)o.kind==="min"&&(r===null||o.value>r)&&(r=o.value);return r!=null?new Date(r):null}get maxDate(){let r=null;for(let o of this._def.checks)o.kind==="max"&&(r===null||o.value<r)&&(r=o.value);return r!=null?new Date(r):null}};ms.create=i=>new ms({checks:[],coerce:i?.coerce||!1,typeName:ye.ZodDate,...we(i)});var gu=class extends Ne{_parse(r){if(this._getType(r)!==re.symbol){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.symbol,received:a.parsedType}),Ee}return Ar(r.data)}};gu.create=i=>new gu({typeName:ye.ZodSymbol,...we(i)});var gs=class extends Ne{_parse(r){if(this._getType(r)!==re.undefined){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.undefined,received:a.parsedType}),Ee}return Ar(r.data)}};gs.create=i=>new gs({typeName:ye.ZodUndefined,...we(i)});var ys=class extends Ne{_parse(r){if(this._getType(r)!==re.null){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.null,received:a.parsedType}),Ee}return Ar(r.data)}};ys.create=i=>new ys({typeName:ye.ZodNull,...we(i)});var mo=class extends Ne{constructor(){super(...arguments),this._any=!0}_parse(r){return Ar(r.data)}};mo.create=i=>new mo({typeName:ye.ZodAny,...we(i)});var Ii=class extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(r){return Ar(r.data)}};Ii.create=i=>new Ii({typeName:ye.ZodUnknown,...we(i)});var Wn=class extends Ne{_parse(r){let o=this._getOrReturnCtx(r);return X(o,{code:M.invalid_type,expected:re.never,received:o.parsedType}),Ee}};Wn.create=i=>new Wn({typeName:ye.ZodNever,...we(i)});var yu=class extends Ne{_parse(r){if(this._getType(r)!==re.undefined){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.void,received:a.parsedType}),Ee}return Ar(r.data)}};yu.create=i=>new yu({typeName:ye.ZodVoid,...we(i)});var Ri=class i extends Ne{_parse(r){let{ctx:o,status:a}=this._processInputParams(r),c=this._def;if(o.parsedType!==re.array)return X(o,{code:M.invalid_type,expected:re.array,received:o.parsedType}),Ee;if(c.exactLength!==null){let d=o.data.length>c.exactLength.value,g=o.data.length<c.exactLength.value;(d||g)&&(X(o,{code:d?M.too_big:M.too_small,minimum:g?c.exactLength.value:void 0,maximum:d?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),a.dirty())}if(c.minLength!==null&&o.data.length<c.minLength.value&&(X(o,{code:M.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),a.dirty()),c.maxLength!==null&&o.data.length>c.maxLength.value&&(X(o,{code:M.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),a.dirty()),o.common.async)return Promise.all([...o.data].map((d,g)=>c.type._parseAsync(new _n(o,d,o.path,g)))).then(d=>cr.mergeArray(a,d));let f=[...o.data].map((d,g)=>c.type._parseSync(new _n(o,d,o.path,g)));return cr.mergeArray(a,f)}get element(){return this._def.type}min(r,o){return new i({...this._def,minLength:{value:r,message:ce.toString(o)}})}max(r,o){return new i({...this._def,maxLength:{value:r,message:ce.toString(o)}})}length(r,o){return new i({...this._def,exactLength:{value:r,message:ce.toString(o)}})}nonempty(r){return this.min(1,r)}};Ri.create=(i,r)=>new Ri({type:i,minLength:null,maxLength:null,exactLength:null,typeName:ye.ZodArray,...we(r)});function du(i){if(i instanceof Ur){let r={};for(let o in i.shape){let a=i.shape[o];r[o]=yn.create(du(a))}return new Ur({...i._def,shape:()=>r})}else return i instanceof Ri?new Ri({...i._def,type:du(i.element)}):i instanceof yn?yn.create(du(i.unwrap())):i instanceof si?si.create(du(i.unwrap())):i instanceof oi?oi.create(i.items.map(r=>du(r))):i}var Ur=class i extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let r=this._def.shape(),o=Ge.objectKeys(r);return this._cached={shape:r,keys:o}}_parse(r){if(this._getType(r)!==re.object){let A=this._getOrReturnCtx(r);return X(A,{code:M.invalid_type,expected:re.object,received:A.parsedType}),Ee}let{status:a,ctx:c}=this._processInputParams(r),{shape:f,keys:d}=this._getCached(),g=[];if(!(this._def.catchall instanceof Wn&&this._def.unknownKeys==="strip"))for(let A in c.data)d.includes(A)||g.push(A);let E=[];for(let A of d){let R=f[A],V=c.data[A];E.push({key:{status:"valid",value:A},value:R._parse(new _n(c,V,c.path,A)),alwaysSet:A in c.data})}if(this._def.catchall instanceof Wn){let A=this._def.unknownKeys;if(A==="passthrough")for(let R of g)E.push({key:{status:"valid",value:R},value:{status:"valid",value:c.data[R]}});else if(A==="strict")g.length>0&&(X(c,{code:M.unrecognized_keys,keys:g}),a.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let A=this._def.catchall;for(let R of g){let V=c.data[R];E.push({key:{status:"valid",value:R},value:A._parse(new _n(c,V,c.path,R)),alwaysSet:R in c.data})}}return c.common.async?Promise.resolve().then(async()=>{let A=[];for(let R of E){let V=await R.key,B=await R.value;A.push({key:V,value:B,alwaysSet:R.alwaysSet})}return A}).then(A=>cr.mergeObjectSync(a,A)):cr.mergeObjectSync(a,E)}get shape(){return this._def.shape()}strict(r){return ce.errToObj,new i({...this._def,unknownKeys:"strict",...r!==void 0?{errorMap:(o,a)=>{var c,f,d,g;let E=(d=(f=(c=this._def).errorMap)===null||f===void 0?void 0:f.call(c,o,a).message)!==null&&d!==void 0?d:a.defaultError;return o.code==="unrecognized_keys"?{message:(g=ce.errToObj(r).message)!==null&&g!==void 0?g:E}:{message:E}}}:{}})}strip(){return new i({...this._def,unknownKeys:"strip"})}passthrough(){return new i({...this._def,unknownKeys:"passthrough"})}extend(r){return new i({...this._def,shape:()=>({...this._def.shape(),...r})})}merge(r){return new i({unknownKeys:r._def.unknownKeys,catchall:r._def.catchall,shape:()=>({...this._def.shape(),...r._def.shape()}),typeName:ye.ZodObject})}setKey(r,o){return this.augment({[r]:o})}catchall(r){return new i({...this._def,catchall:r})}pick(r){let o={};return Ge.objectKeys(r).forEach(a=>{r[a]&&this.shape[a]&&(o[a]=this.shape[a])}),new i({...this._def,shape:()=>o})}omit(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{r[a]||(o[a]=this.shape[a])}),new i({...this._def,shape:()=>o})}deepPartial(){return du(this)}partial(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{let c=this.shape[a];r&&!r[a]?o[a]=c:o[a]=c.optional()}),new i({...this._def,shape:()=>o})}required(r){let o={};return Ge.objectKeys(this.shape).forEach(a=>{if(r&&!r[a])o[a]=this.shape[a];else{let f=this.shape[a];for(;f instanceof yn;)f=f._def.innerType;o[a]=f}}),new i({...this._def,shape:()=>o})}keyof(){return OE(Ge.objectKeys(this.shape))}};Ur.create=(i,r)=>new Ur({shape:()=>i,unknownKeys:"strip",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});Ur.strictCreate=(i,r)=>new Ur({shape:()=>i,unknownKeys:"strict",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});Ur.lazycreate=(i,r)=>new Ur({shape:i,unknownKeys:"strip",catchall:Wn.create(),typeName:ye.ZodObject,...we(r)});var _s=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=this._def.options;function c(f){for(let g of f)if(g.result.status==="valid")return g.result;for(let g of f)if(g.result.status==="dirty")return o.common.issues.push(...g.ctx.common.issues),g.result;let d=f.map(g=>new Zr(g.ctx.common.issues));return X(o,{code:M.invalid_union,unionErrors:d}),Ee}if(o.common.async)return Promise.all(a.map(async f=>{let d={...o,common:{...o.common,issues:[]},parent:null};return{result:await f._parseAsync({data:o.data,path:o.path,parent:d}),ctx:d}})).then(c);{let f,d=[];for(let E of a){let A={...o,common:{...o.common,issues:[]},parent:null},R=E._parseSync({data:o.data,path:o.path,parent:A});if(R.status==="valid")return R;R.status==="dirty"&&!f&&(f={result:R,ctx:A}),A.common.issues.length&&d.push(A.common.issues)}if(f)return o.common.issues.push(...f.ctx.common.issues),f.result;let g=d.map(E=>new Zr(E));return X(o,{code:M.invalid_union,unionErrors:g}),Ee}}get options(){return this._def.options}};_s.create=(i,r)=>new _s({options:i,typeName:ye.ZodUnion,...we(r)});var xi=i=>i instanceof Es?xi(i.schema):i instanceof Yr?xi(i.innerType()):i instanceof As?[i.value]:i instanceof Ss?i.options:i instanceof Os?Ge.objectValues(i.enum):i instanceof vs?xi(i._def.innerType):i instanceof gs?[void 0]:i instanceof ys?[null]:i instanceof yn?[void 0,...xi(i.unwrap())]:i instanceof si?[null,...xi(i.unwrap())]:i instanceof Ml||i instanceof Is?xi(i.unwrap()):i instanceof xs?xi(i._def.innerType):[],_d=class i extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.object)return X(o,{code:M.invalid_type,expected:re.object,received:o.parsedType}),Ee;let a=this.discriminator,c=o.data[a],f=this.optionsMap.get(c);return f?o.common.async?f._parseAsync({data:o.data,path:o.path,parent:o}):f._parseSync({data:o.data,path:o.path,parent:o}):(X(o,{code:M.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(r,o,a){let c=new Map;for(let f of o){let d=xi(f.shape[r]);if(!d.length)throw new Error(`A discriminator value for key \`${r}\` could not be extracted from all schema options`);for(let g of d){if(c.has(g))throw new Error(`Discriminator property ${String(r)} has duplicate value ${String(g)}`);c.set(g,f)}}return new i({typeName:ye.ZodDiscriminatedUnion,discriminator:r,options:o,optionsMap:c,...we(a)})}};function C_(i,r){let o=po(i),a=po(r);if(i===r)return{valid:!0,data:i};if(o===re.object&&a===re.object){let c=Ge.objectKeys(r),f=Ge.objectKeys(i).filter(g=>c.indexOf(g)!==-1),d={...i,...r};for(let g of f){let E=C_(i[g],r[g]);if(!E.valid)return{valid:!1};d[g]=E.data}return{valid:!0,data:d}}else if(o===re.array&&a===re.array){if(i.length!==r.length)return{valid:!1};let c=[];for(let f=0;f<i.length;f++){let d=i[f],g=r[f],E=C_(d,g);if(!E.valid)return{valid:!1};c.push(E.data)}return{valid:!0,data:c}}else return o===re.date&&a===re.date&&+i==+r?{valid:!0,data:i}:{valid:!1}}var Ts=class extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r),c=(f,d)=>{if(w_(f)||w_(d))return Ee;let g=C_(f.value,d.value);return g.valid?((N_(f)||N_(d))&&o.dirty(),{status:o.value,value:g.data}):(X(a,{code:M.invalid_intersection_types}),Ee)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([f,d])=>c(f,d)):c(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};Ts.create=(i,r,o)=>new Ts({left:i,right:r,typeName:ye.ZodIntersection,...we(o)});var oi=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.array)return X(a,{code:M.invalid_type,expected:re.array,received:a.parsedType}),Ee;if(a.data.length<this._def.items.length)return X(a,{code:M.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&a.data.length>this._def.items.length&&(X(a,{code:M.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),o.dirty());let f=[...a.data].map((d,g)=>{let E=this._def.items[g]||this._def.rest;return E?E._parse(new _n(a,d,a.path,g)):null}).filter(d=>!!d);return a.common.async?Promise.all(f).then(d=>cr.mergeArray(o,d)):cr.mergeArray(o,f)}get items(){return this._def.items}rest(r){return new i({...this._def,rest:r})}};oi.create=(i,r)=>{if(!Array.isArray(i))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new oi({items:i,typeName:ye.ZodTuple,rest:null,...we(r)})};var Td=class i extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.object)return X(a,{code:M.invalid_type,expected:re.object,received:a.parsedType}),Ee;let c=[],f=this._def.keyType,d=this._def.valueType;for(let g in a.data)c.push({key:f._parse(new _n(a,g,a.path,g)),value:d._parse(new _n(a,a.data[g],a.path,g)),alwaysSet:g in a.data});return a.common.async?cr.mergeObjectAsync(o,c):cr.mergeObjectSync(o,c)}get element(){return this._def.valueType}static create(r,o,a){return o instanceof Ne?new i({keyType:r,valueType:o,typeName:ye.ZodRecord,...we(a)}):new i({keyType:ho.create(),valueType:r,typeName:ye.ZodRecord,...we(o)})}},_u=class extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.map)return X(a,{code:M.invalid_type,expected:re.map,received:a.parsedType}),Ee;let c=this._def.keyType,f=this._def.valueType,d=[...a.data.entries()].map(([g,E],A)=>({key:c._parse(new _n(a,g,a.path,[A,"key"])),value:f._parse(new _n(a,E,a.path,[A,"value"]))}));if(a.common.async){let g=new Map;return Promise.resolve().then(async()=>{for(let E of d){let A=await E.key,R=await E.value;if(A.status==="aborted"||R.status==="aborted")return Ee;(A.status==="dirty"||R.status==="dirty")&&o.dirty(),g.set(A.value,R.value)}return{status:o.value,value:g}})}else{let g=new Map;for(let E of d){let A=E.key,R=E.value;if(A.status==="aborted"||R.status==="aborted")return Ee;(A.status==="dirty"||R.status==="dirty")&&o.dirty(),g.set(A.value,R.value)}return{status:o.value,value:g}}}};_u.create=(i,r,o)=>new _u({valueType:r,keyType:i,typeName:ye.ZodMap,...we(o)});var Tu=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.parsedType!==re.set)return X(a,{code:M.invalid_type,expected:re.set,received:a.parsedType}),Ee;let c=this._def;c.minSize!==null&&a.data.size<c.minSize.value&&(X(a,{code:M.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),o.dirty()),c.maxSize!==null&&a.data.size>c.maxSize.value&&(X(a,{code:M.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),o.dirty());let f=this._def.valueType;function d(E){let A=new Set;for(let R of E){if(R.status==="aborted")return Ee;R.status==="dirty"&&o.dirty(),A.add(R.value)}return{status:o.value,value:A}}let g=[...a.data.values()].map((E,A)=>f._parse(new _n(a,E,a.path,A)));return a.common.async?Promise.all(g).then(E=>d(E)):d(g)}min(r,o){return new i({...this._def,minSize:{value:r,message:ce.toString(o)}})}max(r,o){return new i({...this._def,maxSize:{value:r,message:ce.toString(o)}})}size(r,o){return this.min(r,o).max(r,o)}nonempty(r){return this.min(1,r)}};Tu.create=(i,r)=>new Tu({valueType:i,minSize:null,maxSize:null,typeName:ye.ZodSet,...we(r)});var Ed=class i extends Ne{constructor(){super(...arguments),this.validate=this.implement}_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.function)return X(o,{code:M.invalid_type,expected:re.function,received:o.parsedType}),Ee;function a(g,E){return gd({data:g,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,md(),mu].filter(A=>!!A),issueData:{code:M.invalid_arguments,argumentsError:E}})}function c(g,E){return gd({data:g,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,md(),mu].filter(A=>!!A),issueData:{code:M.invalid_return_type,returnTypeError:E}})}let f={errorMap:o.common.contextualErrorMap},d=o.data;if(this._def.returns instanceof go){let g=this;return Ar(async function(...E){let A=new Zr([]),R=await g._def.args.parseAsync(E,f).catch(P=>{throw A.addIssue(a(E,P)),A}),V=await Reflect.apply(d,this,R);return await g._def.returns._def.type.parseAsync(V,f).catch(P=>{throw A.addIssue(c(V,P)),A})})}else{let g=this;return Ar(function(...E){let A=g._def.args.safeParse(E,f);if(!A.success)throw new Zr([a(E,A.error)]);let R=Reflect.apply(d,this,A.data),V=g._def.returns.safeParse(R,f);if(!V.success)throw new Zr([c(R,V.error)]);return V.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...r){return new i({...this._def,args:oi.create(r).rest(Ii.create())})}returns(r){return new i({...this._def,returns:r})}implement(r){return this.parse(r)}strictImplement(r){return this.parse(r)}static create(r,o,a){return new i({args:r||oi.create([]).rest(Ii.create()),returns:o||Ii.create(),typeName:ye.ZodFunction,...we(a)})}},Es=class extends Ne{get schema(){return this._def.getter()}_parse(r){let{ctx:o}=this._processInputParams(r);return this._def.getter()._parse({data:o.data,path:o.path,parent:o})}};Es.create=(i,r)=>new Es({getter:i,typeName:ye.ZodLazy,...we(r)});var As=class extends Ne{_parse(r){if(r.data!==this._def.value){let o=this._getOrReturnCtx(r);return X(o,{received:o.data,code:M.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:r.data}}get value(){return this._def.value}};As.create=(i,r)=>new As({value:i,typeName:ye.ZodLiteral,...we(r)});function OE(i,r){return new Ss({values:i,typeName:ye.ZodEnum,...we(r)})}var Ss=class i extends Ne{constructor(){super(...arguments),Cl.set(this,void 0)}_parse(r){if(typeof r.data!="string"){let o=this._getOrReturnCtx(r),a=this._def.values;return X(o,{expected:Ge.joinValues(a),received:o.parsedType,code:M.invalid_type}),Ee}if(yd(this,Cl,"f")||TE(this,Cl,new Set(this._def.values),"f"),!yd(this,Cl,"f").has(r.data)){let o=this._getOrReturnCtx(r),a=this._def.values;return X(o,{received:o.data,code:M.invalid_enum_value,options:a}),Ee}return Ar(r.data)}get options(){return this._def.values}get enum(){let r={};for(let o of this._def.values)r[o]=o;return r}get Values(){let r={};for(let o of this._def.values)r[o]=o;return r}get Enum(){let r={};for(let o of this._def.values)r[o]=o;return r}extract(r,o=this._def){return i.create(r,{...this._def,...o})}exclude(r,o=this._def){return i.create(this.options.filter(a=>!r.includes(a)),{...this._def,...o})}};Cl=new WeakMap;Ss.create=OE;var Os=class extends Ne{constructor(){super(...arguments),Dl.set(this,void 0)}_parse(r){let o=Ge.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(r);if(a.parsedType!==re.string&&a.parsedType!==re.number){let c=Ge.objectValues(o);return X(a,{expected:Ge.joinValues(c),received:a.parsedType,code:M.invalid_type}),Ee}if(yd(this,Dl,"f")||TE(this,Dl,new Set(Ge.getValidEnumValues(this._def.values)),"f"),!yd(this,Dl,"f").has(r.data)){let c=Ge.objectValues(o);return X(a,{received:a.data,code:M.invalid_enum_value,options:c}),Ee}return Ar(r.data)}get enum(){return this._def.values}};Dl=new WeakMap;Os.create=(i,r)=>new Os({values:i,typeName:ye.ZodNativeEnum,...we(r)});var go=class extends Ne{unwrap(){return this._def.type}_parse(r){let{ctx:o}=this._processInputParams(r);if(o.parsedType!==re.promise&&o.common.async===!1)return X(o,{code:M.invalid_type,expected:re.promise,received:o.parsedType}),Ee;let a=o.parsedType===re.promise?o.data:Promise.resolve(o.data);return Ar(a.then(c=>this._def.type.parseAsync(c,{path:o.path,errorMap:o.common.contextualErrorMap})))}};go.create=(i,r)=>new go({type:i,typeName:ye.ZodPromise,...we(r)});var Yr=class extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ye.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(r){let{status:o,ctx:a}=this._processInputParams(r),c=this._def.effect||null,f={addIssue:d=>{X(a,d),d.fatal?o.abort():o.dirty()},get path(){return a.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){let d=c.transform(a.data,f);if(a.common.async)return Promise.resolve(d).then(async g=>{if(o.value==="aborted")return Ee;let E=await this._def.schema._parseAsync({data:g,path:a.path,parent:a});return E.status==="aborted"?Ee:E.status==="dirty"||o.value==="dirty"?hu(E.value):E});{if(o.value==="aborted")return Ee;let g=this._def.schema._parseSync({data:d,path:a.path,parent:a});return g.status==="aborted"?Ee:g.status==="dirty"||o.value==="dirty"?hu(g.value):g}}if(c.type==="refinement"){let d=g=>{let E=c.refinement(g,f);if(a.common.async)return Promise.resolve(E);if(E instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return g};if(a.common.async===!1){let g=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return g.status==="aborted"?Ee:(g.status==="dirty"&&o.dirty(),d(g.value),{status:o.value,value:g.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(g=>g.status==="aborted"?Ee:(g.status==="dirty"&&o.dirty(),d(g.value).then(()=>({status:o.value,value:g.value}))))}if(c.type==="transform")if(a.common.async===!1){let d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ll(d))return d;let g=c.transform(d.value,f);if(g instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:o.value,value:g}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Ll(d)?Promise.resolve(c.transform(d.value,f)).then(g=>({status:o.value,value:g})):d);Ge.assertNever(c)}};Yr.create=(i,r,o)=>new Yr({schema:i,typeName:ye.ZodEffects,effect:r,...we(o)});Yr.createWithPreprocess=(i,r,o)=>new Yr({schema:r,effect:{type:"preprocess",transform:i},typeName:ye.ZodEffects,...we(o)});var yn=class extends Ne{_parse(r){return this._getType(r)===re.undefined?Ar(void 0):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};yn.create=(i,r)=>new yn({innerType:i,typeName:ye.ZodOptional,...we(r)});var si=class extends Ne{_parse(r){return this._getType(r)===re.null?Ar(null):this._def.innerType._parse(r)}unwrap(){return this._def.innerType}};si.create=(i,r)=>new si({innerType:i,typeName:ye.ZodNullable,...we(r)});var vs=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=o.data;return o.parsedType===re.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:o.path,parent:o})}removeDefault(){return this._def.innerType}};vs.create=(i,r)=>new vs({innerType:i,typeName:ye.ZodDefault,defaultValue:typeof r.default=="function"?r.default:()=>r.default,...we(r)});var xs=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a={...o,common:{...o.common,issues:[]}},c=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Ul(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new Zr(a.common.issues)},input:a.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new Zr(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};xs.create=(i,r)=>new xs({innerType:i,typeName:ye.ZodCatch,catchValue:typeof r.catch=="function"?r.catch:()=>r.catch,...we(r)});var Eu=class extends Ne{_parse(r){if(this._getType(r)!==re.nan){let a=this._getOrReturnCtx(r);return X(a,{code:M.invalid_type,expected:re.nan,received:a.parsedType}),Ee}return{status:"valid",value:r.data}}};Eu.create=i=>new Eu({typeName:ye.ZodNaN,...we(i)});var DO=Symbol("zod_brand"),Ml=class extends Ne{_parse(r){let{ctx:o}=this._processInputParams(r),a=o.data;return this._def.type._parse({data:a,path:o.path,parent:o})}unwrap(){return this._def.type}},Pl=class i extends Ne{_parse(r){let{status:o,ctx:a}=this._processInputParams(r);if(a.common.async)return(async()=>{let f=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return f.status==="aborted"?Ee:f.status==="dirty"?(o.dirty(),hu(f.value)):this._def.out._parseAsync({data:f.value,path:a.path,parent:a})})();{let c=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?Ee:c.status==="dirty"?(o.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:a.path,parent:a})}}static create(r,o){return new i({in:r,out:o,typeName:ye.ZodPipeline})}},Is=class extends Ne{_parse(r){let o=this._def.innerType._parse(r),a=c=>(Ll(c)&&(c.value=Object.freeze(c.value)),c);return Ul(o)?o.then(c=>a(c)):a(o)}unwrap(){return this._def.innerType}};Is.create=(i,r)=>new Is({innerType:i,typeName:ye.ZodReadonly,...we(r)});function vE(i,r={},o){return i?mo.create().superRefine((a,c)=>{var f,d;if(!i(a)){let g=typeof r=="function"?r(a):typeof r=="string"?{message:r}:r,E=(d=(f=g.fatal)!==null&&f!==void 0?f:o)!==null&&d!==void 0?d:!0,A=typeof g=="string"?{message:g}:g;c.addIssue({code:"custom",...A,fatal:E})}}):mo.create()}var LO={object:Ur.lazycreate},ye;(function(i){i.ZodString="ZodString",i.ZodNumber="ZodNumber",i.ZodNaN="ZodNaN",i.ZodBigInt="ZodBigInt",i.ZodBoolean="ZodBoolean",i.ZodDate="ZodDate",i.ZodSymbol="ZodSymbol",i.ZodUndefined="ZodUndefined",i.ZodNull="ZodNull",i.ZodAny="ZodAny",i.ZodUnknown="ZodUnknown",i.ZodNever="ZodNever",i.ZodVoid="ZodVoid",i.ZodArray="ZodArray",i.ZodObject="ZodObject",i.ZodUnion="ZodUnion",i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",i.ZodIntersection="ZodIntersection",i.ZodTuple="ZodTuple",i.ZodRecord="ZodRecord",i.ZodMap="ZodMap",i.ZodSet="ZodSet",i.ZodFunction="ZodFunction",i.ZodLazy="ZodLazy",i.ZodLiteral="ZodLiteral",i.ZodEnum="ZodEnum",i.ZodEffects="ZodEffects",i.ZodNativeEnum="ZodNativeEnum",i.ZodOptional="ZodOptional",i.ZodNullable="ZodNullable",i.ZodDefault="ZodDefault",i.ZodCatch="ZodCatch",i.ZodPromise="ZodPromise",i.ZodBranded="ZodBranded",i.ZodPipeline="ZodPipeline",i.ZodReadonly="ZodReadonly"})(ye||(ye={}));var UO=(i,r={message:`Input not instance of ${i.name}`})=>vE(o=>o instanceof i,r),xE=ho.create,IE=ps.create,MO=Eu.create,PO=ds.create,RE=hs.create,FO=ms.create,kO=gu.create,BO=gs.create,GO=ys.create,WO=mo.create,VO=Ii.create,qO=Wn.create,$O=yu.create,HO=Ri.create,zO=Ur.create,ZO=Ur.strictCreate,YO=_s.create,QO=_d.create,jO=Ts.create,KO=oi.create,JO=Td.create,XO=_u.create,ev=Tu.create,tv=Ed.create,rv=Es.create,nv=As.create,iv=Ss.create,ov=Os.create,sv=go.create,yE=Yr.create,av=yn.create,uv=si.create,cv=Yr.createWithPreprocess,lv=Pl.create,fv=()=>xE().optional(),pv=()=>IE().optional(),dv=()=>RE().optional(),hv={string:i=>ho.create({...i,coerce:!0}),number:i=>ps.create({...i,coerce:!0}),boolean:i=>hs.create({...i,coerce:!0}),bigint:i=>ds.create({...i,coerce:!0}),date:i=>ms.create({...i,coerce:!0})},mv=Ee,Ue=Object.freeze({__proto__:null,defaultErrorMap:mu,setErrorMap:mO,getErrorMap:md,makeIssue:gd,EMPTY_PATH:gO,addIssueToContext:X,ParseStatus:cr,INVALID:Ee,DIRTY:hu,OK:Ar,isAborted:w_,isDirty:N_,isValid:Ll,isAsync:Ul,get util(){return Ge},get objectUtil(){return b_},ZodParsedType:re,getParsedType:po,ZodType:Ne,datetimeRegex:SE,ZodString:ho,ZodNumber:ps,ZodBigInt:ds,ZodBoolean:hs,ZodDate:ms,ZodSymbol:gu,ZodUndefined:gs,ZodNull:ys,ZodAny:mo,ZodUnknown:Ii,ZodNever:Wn,ZodVoid:yu,ZodArray:Ri,ZodObject:Ur,ZodUnion:_s,ZodDiscriminatedUnion:_d,ZodIntersection:Ts,ZodTuple:oi,ZodRecord:Td,ZodMap:_u,ZodSet:Tu,ZodFunction:Ed,ZodLazy:Es,ZodLiteral:As,ZodEnum:Ss,ZodNativeEnum:Os,ZodPromise:go,ZodEffects:Yr,ZodTransformer:Yr,ZodOptional:yn,ZodNullable:si,ZodDefault:vs,ZodCatch:xs,ZodNaN:Eu,BRAND:DO,ZodBranded:Ml,ZodPipeline:Pl,ZodReadonly:Is,custom:vE,Schema:Ne,ZodSchema:Ne,late:LO,get ZodFirstPartyTypeKind(){return ye},coerce:hv,any:WO,array:HO,bigint:PO,boolean:RE,date:FO,discriminatedUnion:QO,effect:yE,enum:iv,function:tv,instanceof:UO,intersection:jO,lazy:rv,literal:nv,map:XO,nan:MO,nativeEnum:ov,never:qO,null:GO,nullable:uv,number:IE,object:zO,oboolean:dv,onumber:pv,optional:av,ostring:fv,pipeline:lv,preprocess:cv,promise:sv,record:JO,set:ev,strictObject:ZO,string:xE,symbol:kO,transformer:yE,tuple:KO,undefined:BO,union:YO,unknown:VO,void:$O,NEVER:mv,ZodIssueCode:M,quotelessJson:hO,ZodError:Zr});var vd=Ue.string().refine(i=>i!=="_complexIdOperator",{message:"Key '_complexIdOperator' is not allowed"}),bE=Ue.record(vd,Ue.string()),Ad=Ue.record(vd,Ue.any()),Sd=Ue.record(vd,Ue.union([Ue.any().array(),Ue.string()])),wE=Ue.lazy(()=>Ue.object({conditions:Ue.array(Ue.object(NE))})),Od=Ue.union([Ue.string(),Ue.number()]),NE={string:bE.optional(),fuzzy:bE.optional(),range:Ue.record(vd,Ue.union([Ue.object({high:Od,low:Od}),Ue.object({high:Od}),Ue.object({low:Od})])).optional(),equal:Ad.optional(),notEqual:Ad.optional(),empty:Ad.optional(),notEmpty:Ad.optional(),oneOf:Sd.optional(),contains:Sd.optional(),notContains:Sd.optional(),containsAny:Sd.optional(),$and:wE.optional(),$or:wE.optional()},SC=Ue.object({query:Ue.object({allOr:Ue.boolean().optional(),onEmptyFilter:Ue.nativeEnum(wl).optional(),...NE}).optional(),paginate:Ue.boolean().optional(),bookmark:Ue.union([Ue.string(),Ue.number()]).nullish(),limit:Ue.number().optional(),sort:Ue.string().nullish(),sortOrder:Ue.nativeEnum(pu).optional(),sortType:Ue.nativeEnum(hd).nullish(),version:Ue.string().optional(),disableEscaping:Ue.boolean().optional(),countRows:Ue.boolean().optional()});var gv={SUMMARISE_TEXT:{label:"Summarise Text",value:"SUMMARISE_TEXT"},CLEAN_DATA:{label:"Clean Data",value:"CLEAN_DATA"},TRANSLATE:{label:"Translate",value:"TRANSLATE"},CATEGORISE_TEXT:{label:"Categorise Text",value:"CATEGORISE_TEXT"},SENTIMENT_ANALYSIS:{label:"Sentiment Analysis",value:"SENTIMENT_ANALYSIS"},PROMPT:{label:"Prompt",value:"PROMPT"},SEARCH_WEB:{label:"Search Web",value:"SEARCH_WEB"}},yv={MULTI_COLUMN:"columns",COLUMN:"column",BINDABLE_TEXT:"prompt"},_v={SUMMARISE_TEXT:{columns:"columns"},CLEAN_DATA:{column:"column"},TRANSLATE:{column:"column",language:"prompt"},CATEGORISE_TEXT:{columns:"columns",categories:"prompt"},SENTIMENT_ANALYSIS:{column:"column"},PROMPT:{prompt:"prompt"},SEARCH_WEB:{columns:"columns"}};var CE=(ae=>(ae.API_KEY="x-budibase-api-key",ae.LICENSE_KEY="x-budibase-license-key",ae.API_VER="x-budibase-api-version",ae.APP_ID="x-budibase-app-id",ae.SESSION_ID="x-budibase-session-id",ae.TYPE="x-budibase-type",ae.PREVIEW_ROLE="x-budibase-role",ae.TENANT_ID="x-budibase-tenant-id",ae.VERIFICATION_CODE="x-budibase-verification-code",ae.RETURN_VERIFICATION_CODE="x-budibase-return-verification-code",ae.RESET_PASSWORD_CODE="x-budibase-reset-password-code",ae.RETURN_RESET_PASSWORD_CODE="x-budibase-return-reset-password-code",ae.TOKEN="x-budibase-token",ae.CSRF_TOKEN="x-csrf-token",ae.CORRELATION_ID="x-budibase-correlation-id",ae.AUTHORIZATION="authorization",ae.MIGRATING_APP="x-budibase-migrating-app",ae.COOKIE="cookie",ae))(CE||{});var Tv={string:["string","options","longform","barcodeqr"],options:["options","string","longform","barcodeqr"],longform:["longform","string","options","barcodeqr"],barcodeqr:["barcodeqr","string","options","longform"],number:["number","boolean"],json:["json","array","attachment","attachment_single","bb_reference","signature_single"]};var xd=["_id","_rev","type","createdAt","updatedAt","tableId"],DE=["_id","_rev","tableId"];function Ev(i){return xd.includes(i)}function Av(i){return DE.includes(i)}var LE=(d=>(d.ADMIN="var(--spectrum-global-color-static-red-400)",d.POWER="var(--spectrum-global-color-static-orange-400)",d.BASIC="var(--spectrum-global-color-static-green-400)",d.PUBLIC="var(--spectrum-global-color-static-blue-400)",d.BUILDER="var(--spectrum-global-color-static-magenta-600)",d.DEFAULT_CUSTOM="var(--spectrum-global-color-static-magenta-400)",d))(LE||{});var Au="spectrum--",Ov="darkest",vv="light",Id=[{id:"light",name:"Light"},{id:"darkest",name:"Dark"},{id:"nord",name:"Nord",base:"darkest"},{id:"midnight",name:"Midnight",base:"darkest"}];var Mr={Equals:{value:"equal",label:"Equals"},NotEquals:{value:"notEqual",label:"Not equals"},Empty:{value:"empty",label:"Is empty"},NotEmpty:{value:"notEmpty",label:"Is not empty"},StartsWith:{value:"string",label:"Starts with"},Like:{value:"fuzzy",label:"Like"},MoreThan:{value:"rangeLow",label:"More than or equal to"},LessThan:{value:"rangeHigh",label:"Less than or equal to"},Contains:{value:"contains",label:"Contains"},NotContains:{value:"notContains",label:"Does not contain"},In:{value:"oneOf",label:"Is in"},ContainsAny:{value:"containsAny",label:"Has any"}},D_={integer:{max:2147483647,min:-2147483648},int:{max:2147483647,min:-2147483648},smallint:{max:32767,min:-32768},mediumint:{max:8388607,min:-8388608}},UE=(a=>(a.UserUpdate="UserUpdate",a.UserDisconnect="UserDisconnect",a.Heartbeat="Heartbeat",a))(UE||{}),ME=(c=>(c.RowChange="RowChange",c.DatasourceChange="DatasourceChange",c.SelectDatasource="SelectDatasource",c.SelectCell="SelectCell",c))(ME||{}),PE=(R=>(R.SelectApp="SelectApp",R.TableChange="TableChange",R.DatasourceChange="DatasourceChange",R.LockTransfer="LockTransfer",R.ScreenChange="ScreenChange",R.AppMetadataChange="AppMetadataChange",R.SelectResource="SelectResource",R.AppPublishChange="AppPublishChange",R.AutomationChange="AutomationChange",R.RoleChange="RoleChange",R))(PE||{}),xv=60,Iv=/^[^()]*$/,Rv=/^[_a-zA-Z0-9\s]*$/g,bv=/^[a-z_][a-z0-9_]*$/i,wv="@reboot",Nv=["7z","action","apk","app","bat","bin","cab","cmd","com","command","cpl","csh","ex_","exe","gadget","inf1","ins","inx","ipa","isu","job","js","jse","ksh","lnk","msc","msi","msp","mst","osx","out","paf","php","pif","prg","ps1","reg","rgs","run","scr","sct","shb","shs","tar","u3p","vb","vbe","vbs","vbscript","wasm","workflow","ws","wsf","wsh","zip"],FE=(o=>(o.ONBOARDING="budibase:onboarding:correlationkey",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:correlationkey",o))(FE||{}),kE=(o=>(o.ONBOARDING="budibase:onboarding:instancekey",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:instancekey",o))(kE||{}),BE=(o=>(o.ONBOARDING="budibase:onboarding:status",o.VERIFY_SSO_LOGIN="budibase:verify_sso_login:status",o))(BE||{}),GE=(f=>(f.STARTED="started",f.COMPLETING_ACCOUNT_INFO="completing_account_info",f.VERIFYING_EMAIL="verifying_email",f.COMPLETED="completed",f.FAILED="failed",f))(GE||{}),Cv="datasource_internal_bb_default";var IT={};Le(IT,{ColumnSplitter:()=>ET,NoEmptyFilterStrings:()=>LS,buildQuery:()=>US,cleanupQuery:()=>OT,fixupFilterArrays:()=>xT,getKeyNumbering:()=>vT,getValidOperatorsForType:()=>cR,hasFilters:()=>AT,limit:()=>PS,recurseLogicalOperators:()=>ST,removeKeyNumbering:()=>Rd,runQuery:()=>Hd,search:()=>pR,sort:()=>MS,splitFiltersArray:()=>bd});var Nu=fo(WE());var P_={};Le(P_,{filterValueToLabel:()=>Fv,hasSchema:()=>kv,isSupportedUserSearch:()=>qE,parallelForeach:()=>Pv,processSearchFilters:()=>M_,trimOtherProps:()=>Bv,unreachable:()=>Mv});var VE=fo(Il()),Uv=["field","operator","value","type","externalType","valueType","noValue","formulaType"];function Mv(i,r){let o=r?.message||`No such case in exhaustive switch: ${i}`;if(!!!r?.doNotThrow)throw new Error(o)}async function Pv(i,r,o){let a=[],c=0,f=async g=>{try{await r(g)}finally{d()}},d=()=>{if(c>=i.length)return;let g=i[c];c++;let E=f(g);a.push(E),a.length>=o?Promise.race(a).then(d):d()};d(),await Promise.all(a)}function Fv(){return Object.keys(Mr).reduce((i,r)=>{let a=Mr[r];return i[a.value]=a.label,i},{})}function kv(i){return typeof i=="object"&&!Array.isArray(i)&&i!==null&&!(i instanceof Date)&&Object.keys(i).length>0}function Bv(i,r){return Object.keys(i).filter(a=>r.includes(a)).reduce((a,c)=>({...a,[c]:i[c]}),{})}function qE(i){let r=[{op:"string",key:"email"},{op:"equal",key:"_id"},{op:"oneOf",key:"_id"}],{allOr:o,onEmptyFilter:a,...c}=i;for(let[f,d]of Object.entries(c)){if(typeof d!="object")return!1;if(pd(f)){for(let A of i[f].conditions)if(!qE(A))return!1;return!0}let g=Object.keys(d||{});if(g.length===0)continue;if(!r.find(A=>A.op===f&&g.length===1&&g[0]===A.key))return!1}return!0}function M_(i){if(!i||i.length===0)return;let{allOr:r,onEmptyFilter:o,filters:a}=bd(i);return{logicalOperator:"all",onEmptyFilter:o||"all",groups:[{logicalOperator:r?"any":"all",filters:a.map(c=>{let f=VE.default.pick(c,Uv);return f.field=Rd(f.field),f})}]}}var TT={};Le(TT,{cancelableTimeout:()=>$E,cron:()=>dT,deepGet:()=>F_,getUserColor:()=>Wv,getUserInitials:()=>Gv,getUserLabel:()=>Vv,isGoogleSheets:()=>$v,isSQL:()=>Hv,lists:()=>_T,retry:()=>zv,roles:()=>yT,schema:()=>Zl,views:()=>gT,wait:()=>k_,withTimeout:()=>qv});var F_=(i,r)=>{if(!i||!r)return null;if(Object.prototype.hasOwnProperty.call(i,r))return i[r];let o=r.split(".");for(let a=0;a<o.length;a++)i=i?.[o[a]];return i},Gv=i=>{if(!i)return"?";let r="";return r+=i.firstName?i.firstName[0]:"",r+=i.lastName?i.lastName[0]:"",r!==""?r:i.email?.[0]||"U"},Wv=i=>{let r=i?._id;if(!r)return"var(--spectrum-global-color-blue-400)";r=r.replace("ro_ta_users_","");let o=1;for(let a=0;a<r.length;a++)o+=r.charCodeAt(a),o=o%36;return`hsl(${o*10}, 50%, 40%)`},Vv=i=>{if(!i)return"";let{firstName:r,lastName:o,email:a}=i;return r&&o?`${r} ${o}`:r||o||a};function $E(i){let r;return[new Promise((o,a)=>{r=setTimeout(()=>{a({status:301,errno:"ETIME"})},i)}),()=>{clearTimeout(r)}]}async function qv(i,r){let[o,a]=$E(i),c=await Promise.race([r(),o]);return a(),c}function $v(i){return i==="GOOGLE_SHEETS"}function Hv(i){return!i||!i.source?!1:["POSTGRES","SQL_SERVER","MYSQL","ORACLE"].indexOf(i.source)!==-1||i.isSQL===!0}async function k_(i){return new Promise(r=>setTimeout(r,i))}async function zv(i,r){let{times:o=3}=r||{};if(o<1)throw new Error(`invalid retry count: ${o}`);let a;for(let c=0;c<o;c++){let f=1.5**c*1e3*(Math.random()+.5);await k_(f);try{return await i()}catch(d){a=d}}throw a}var dT={};Le(dT,{getNextExecutionDates:()=>zI,validate:()=>ZI});var bS=fo(require("cron-validate")),wS=fo(IS()),RS="(Input cron: ",$I={"smaller than lower limit":"less than","bigger than upper limit":"greater than",daysOfMonth:"'days of the month'",daysOfWeek:"'days of the week'",years:"'years'",months:"'months'",hours:"'hours'",minutes:"'minutes'",seconds:"'seconds'"};function HI(i){let r=[];for(let o of i){o.includes(RS)&&(o=o.split(RS)[0].trim());for(let[a,c]of Object.entries($I))o.includes(a)&&(o=o.replace(new RegExp(a,"g"),c));r.push(o)}return r}function zI(i,r=4){let o=wS.default.parseExpression(i),a=[];for(let c=0;c<r;c++)a.push(o.next().toString());return a}function ZI(i){let r=(0,bS.default)(i,{preset:"npm-cron-schedule",override:{useSeconds:!1}});return r.isValid()?{valid:!0}:{valid:!1,err:HI(r.getError())}}var Zl={};Le(Zl,{decodeNonAscii:()=>hT,encodeNonAscii:()=>jI,isDeprecatedSingleUserColumn:()=>YI,isNumeric:()=>KI,isRequired:()=>QI});function YI(i){return i.type==="bb_reference"&&i.subtype==="user"&&i.constraints?.type!=="array"}function QI(i){return!!i&&(typeof i.presence!="boolean"&&i.presence?.allowEmpty===!1||i.presence===!0)}function jI(i){return i.split("").map(r=>r.charCodeAt(0)>127?"\\u"+r.charCodeAt(0).toString(16).padStart(4,"0"):r).join("")}function hT(i){return i.replace(/\\u([0-9a-fA-F]{4})/g,(r,o)=>String.fromCharCode(parseInt(o,16)))}function KI(i){return i.type==="number"||i.type==="bigint"}var gT={};Le(gT,{basicFields:()=>rR,calculationFields:()=>tR,hasCalculationFields:()=>eR,isBasicViewField:()=>JI,isCalculationField:()=>Yl,isCalculationView:()=>XI,isV2:()=>nR,isVisible:()=>NS});var mT=fo(Il());function Yl(i){return"calculationType"in i}function JI(i){return!Yl(i)}function XI(i){return i.type==="calculation"}function eR(i){return Object.values(i.schema||{}).some(Yl)}function tR(i){return(0,mT.pickBy)(i.schema||{},Yl)}function NS(i){return i.visible!==!1}function rR(i,r){let{visible:o=!0}=r||{};return(0,mT.pickBy)(i.schema||{},a=>!Yl(a)&&(!o||NS(a)))}function nR(i){return i.version===2}var yT={};Le(yT,{checkForRoleInheritanceLoops:()=>oR});function iR(i){return`role${fs}${i}`}function oR(i){let r=new Map;i.forEach(f=>{r.set(f._id,f)});let o=new Set,a=new Set;function c(f){let d=iR(f);if(a.has(f)||a.has(d))return!0;if(o.has(f)||o.has(d))return!1;a.add(f);let g=r.get(d)||r.get(f);if(!g)return a.delete(f),!1;let E=Array.isArray(g.inherits)?g.inherits:[g.inherits];for(let A of E)if(A&&c(A))return!0;return a.delete(f),o.add(f),!1}return!!i.find(f=>c(f._id))}var _T={};Le(_T,{punctuateList:()=>sR});function sR(i){return i.length===0?"":i.length===1?i[0]:i.length===2?i.join(" and "):i.slice(0,-1).join(", ")+" and "+i[i.length-1]}var Ps=fo(Il());var aR=/{{([^{].*?)}}/g,DS=Object.values(bl),uR=[...Object.values(fu),...Object.values(ls),...Object.values(Rl)],cR=(i,r,o)=>{let a=Mr,c=[a.Equals,a.NotEquals,a.StartsWith,a.Like,a.Empty,a.NotEmpty,a.In],f=[a.Equals,a.NotEquals,a.MoreThan,a.LessThan,a.Empty,a.NotEmpty,a.In],d=[],{type:g,formulaType:E}=i;g==="string"?d=c:g==="number"||g==="bigint"?d=f:g==="options"?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty,a.In]:g==="array"?d=[a.Contains,a.NotContains,a.Empty,a.NotEmpty,a.ContainsAny]:g==="boolean"?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty]:g==="longform"?d=c:g==="datetime"?d=f:g==="formula"&&E==="static"?d=c.concat([a.MoreThan,a.LessThan]):g==="ai"?d=c.concat([a.MoreThan,a.LessThan]):g==="bb_reference_single"||Zl.isDeprecatedSingleUserColumn(i)?d=[a.Equals,a.NotEquals,a.Empty,a.NotEmpty,a.In]:g==="bb_reference"&&(d=[a.Contains,a.NotContains,a.ContainsAny,a.Empty,a.NotEmpty]);let A=o?.tableId?.includes("datasource_plus");return r==="_id"&&A&&(d=[a.Equals,a.NotEquals,a.In]),d},LS=[Mr.StartsWith.value,Mr.Like.value,Mr.Equals.value,Mr.NotEquals.value,Mr.Contains.value,Mr.NotContains.value,Mr.ContainsAny.value,Mr.In.value];function ST(i,r){for(let o of DS)i[o]&&(i[o].conditions=i[o].conditions.map(a=>r(a)));return i}var OT=i=>{for(let r of LS)if(i[r])for(let o of Object.keys(i)){if(o!==r)continue;if(typeof i[o]=="object")for(let[c,f]of Object.entries(i[o]))(f==null||f===""||lR(f))&&delete i[r][c]}return i=ST(i,OT),i};function lR(i){return Array.isArray(i)&&i.length===0}var Rd=i=>vT(i).key,vT=i=>{if(typeof i=="string"&&i.match(/\d[0-9]*:/g)!=null){let r=i.split(":");return{prefix:`${r.shift()}:`,key:r.join(":")}}else return{key:i}},ET=class{constructor(r,o){if(this.tableNames=r.map(a=>a.name),this.tableIds=r.map(a=>a._id),this.relationshipColumnNames=r.flatMap(a=>Object.keys(a.schema).filter(c=>a.schema[c].type==="link")),this.relationships=this.tableNames.concat(this.tableIds).concat(this.relationshipColumnNames).sort((a,c)=>c.length-a.length),o?.aliases){this.aliases={};for(let[a,c]of Object.entries(o.aliases))this.aliases[c]=a}this.columnPrefix=o?.columnPrefix}run(r){let{prefix:o,key:a}=vT(r),c;if(this.aliases)for(let d of Object.keys(this.aliases||{})){let g=`${d}.`;a.startsWith(g)&&(c=this.aliases[d],a=a.slice(g.length))}let f;for(let d of this.relationships){let g=`${d}.`;if(a.startsWith(g)){let E=a.split(g);E.shift(),f=g,a=E.join(".");break}}return this.columnPrefix&&a.startsWith(this.columnPrefix)&&(a=hT(a.slice(this.columnPrefix.length))),{tableName:c,numberPrefix:o,relationshipPrefix:f,column:a}}};function fR(i){if(!i||!i?.operator||!i?.field)return;let r={},{operator:o,field:a,type:c,externalType:f}=i,{value:d}=i;(o==="empty"||o==="notEmpty")&&(d=null);let g=typeof d=="string"&&(d.match(aR)||[]).length>0;switch(c){case"datetime":if(!g&&o!=="empty"&&o!=="notEmpty"){if(!d)return;d=new Date(d).toISOString()}break;case"number":typeof d=="string"&&!g&&(o==="oneOf"?d=d.split(",").map(parseFloat):d=parseFloat(d));break;case"boolean":d=`${d}`.toLowerCase()==="true";break;case"array":["contains","notContains","containsAny"].includes(o.toLocaleString())&&typeof d=="string"&&(d=d.split(","));break}if(O_(o)){let A=D_[f]||{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER};r[o]??={},r[o][a]={low:c==="number"?A.min:"0000-00-00T00:00:00.000Z",high:c==="number"?A.max:"9999-00-00T00:00:00.000Z"}}else if(o==="rangeHigh"&&d!=null&&d!=="")r.range??={},r.range[a]={...r.range[a],high:d};else if(o==="rangeLow"&&d!=null&&d!=="")r.range??={},r.range[a]={...r.range[a],low:d};else if(pE(o)||dE(o)||O_(o))c==="boolean"?o==="equal"&&d===!1?(r.notEqual=r.notEqual||{},r.notEqual[a]=!0):o==="notEqual"&&d===!1?(r.equal=r.equal||{},r.equal[a]=!0):(r[o]??={},r[o][a]=d):(r[o]??={},r[o][a]=d);else throw new Error(`Unsupported operator: ${o}`);return r}function bd(i){let r={filters:[]};for(let o of i)"operator"in o&&o.operator==="allOr"?r.allOr=!0:"onEmptyFilter"in o?r.onEmptyFilter=o.onEmptyFilter:r.filters.push(o);return r}function US(i){if(!i)return{};if(Array.isArray(i)&&(i=M_(i),!i))return{};let r={};i.onEmptyFilter?r.onEmptyFilter=i.onEmptyFilter:r.onEmptyFilter="all";let o=CS(i.logicalOperator||"all");return r[o]={conditions:(i.groups||[]).map(a=>{if(a.groups){let E=US(a);return delete E.onEmptyFilter,E}let{allOr:c,onEmptyFilter:f,filters:d}=bd(a.filters||[]);f&&(r.onEmptyFilter=f);let g=c?"$or":"$and";return a.logicalOperator&&(g=CS(a.logicalOperator)),{[g]:{conditions:d.map(fR).filter(E=>E)}}})},r}function CS(i){return i==="all"?"$and":"$or"}function xT(i){if(!i)return i;for(let r of Object.values(ls)){let o=i[r];if(!(o==null||!(0,Ps.isPlainObject)(o)))for(let a of Object.keys(o)){if(Array.isArray(o[a]))continue;let c=o[a];typeof c=="string"?o[a]=c.split(",").map(f=>f.trim()):o[a]=[c]}}return ST(i,xT),i}function pR(i,r){let o=Hd(i,r.query);r.sort&&(o=MS(o,r.sort,r.sortOrder||"ascending",r.sortType));let a=o.length;r.limit&&(o=PS(o,r.limit.toString()));let c={rows:o};return r.countRows&&(c.totalRows=a),c}function Hd(i,r){if(!i||!Array.isArray(i))return[];if(!r)return i;if(r=OT(r),r=xT(r),!AT(r)&&r.onEmptyFilter==="none")return[];let o=(q,k)=>j=>{for(let[se,le]of Object.entries(r[q]||{})){let ot=pd(q)?j:F_(j,Rd(se)),An=k(ot,le);if(r.allOr&&An)return!0;if(!r.allOr&&!An)return!1}return!r.allOr},a=o("string",(q,k)=>typeof q!="string"||typeof k!="string"?!1:q.toLowerCase().startsWith(k.toLowerCase())),c=o("fuzzy",(q,k)=>typeof q!="string"||typeof k!="string"?!1:q.toLowerCase().includes(k.toLowerCase())),f=o("range",(q,k)=>{if(q==null||q===""||((0,Ps.isPlainObject)(k.low)&&(0,Ps.isEmpty)(k.low)&&(k.low=void 0),(0,Ps.isPlainObject)(k.high)&&(0,Ps.isEmpty)(k.high)&&(k.high=void 0),k.low==null&&k.high==null))return!1;let j=+q;if(!isNaN(j)){let le=+k.low,ot=+k.high;if(!isNaN(le)&&!isNaN(ot))return j>=le&&j<=ot;if(isNaN(le)){if(!isNaN(ot))return j<=ot}else return j>=le}let se=(0,Nu.default)(q);if(se.isValid()){let le=(0,Nu.default)(k.low||"0000-00-00T00:00:00.000Z"),ot=(0,Nu.default)(k.high||"9999-00-00T00:00:00.000Z");if(le.isValid()&&ot.isValid())return se.isAfter(le)&&se.isBefore(ot)||se.isSame(le)||se.isSame(ot);if(le.isValid())return se.isAfter(le)||se.isSame(le);if(ot.isValid())return se.isBefore(ot)||se.isSame(ot)}return k.low!=null&&k.high!=null?q>=k.low&&q<=k.high:k.low!=null?q>=k.low:k.high!=null?q<=k.high:!1}),d=(q,k)=>{if(Array.isArray(q)){for(let se of q)if(d(se,k))return!0;return!1}if(q&&typeof q=="object"&&typeof k=="string")return q._id===k;if(q===k)return!0;if(q==null&&k!=null||q!=null&&k==null)return!1;let j=(0,Nu.default)(q);if(j.isValid()){let se=(0,Nu.default)(k);if(se.isValid())return j.isSame(se)}return!1},g=q=>(...k)=>!q(...k),E=o("equal",d),A=o("notEqual",g(d)),R=q=>typeof q=="string"?q==="":Array.isArray(q)?q.length===0:q&&typeof q=="object"?Object.keys(q).length===0:q==null,V=o("empty",R),B=o("notEmpty",g(R)),P=o("oneOf",(q,k)=>(typeof k=="string"&&(k=k.split(",")),typeof q=="number"&&(k=k.map(j=>parseFloat(j))),Array.isArray(k)?k.some(j=>d(q,j)):!1)),Z=q=>(k,j)=>!Array.isArray(k)||(typeof j=="string"&&(j=j.split(","),typeof k[0]=="number"&&(j=j.map(se=>parseFloat(se)))),!Array.isArray(j))?!1:j.length===0?!0:j[q](se=>d(k,se)),_e=o("contains",(q,k)=>Array.isArray(k)&&k.length===0?!0:Z("every")(q,k)),Ce=o("notContains",(q,k)=>Array.isArray(k)&&k.length===0?!0:g(Z("every"))(q,k)),J=o("containsAny",Z("some")),ae=o("$and",(q,k)=>{if(!k.length)return!1;for(let j of k)if(!Hd([q],j).length)return!1;return!0}),Ie=o("$or",(q,k)=>{if(!k.length)return!1;for(let j of k)if(Hd([q],{...j,allOr:!0}).length)return!0;return!1}),Me=q=>{let k={string:a,fuzzy:c,range:f,equal:E,notEqual:A,empty:V,notEmpty:B,oneOf:P,contains:_e,containsAny:J,notContains:Ce,$and:ae,$or:Ie},j=Object.entries(r||{}).filter(([se,le])=>!["allOr","onEmptyFilter"].includes(se)&&le&&Object.keys(le).length>0).map(([se])=>k[se]?.(q)??!1);return AT(r)?r.allOr?j.some(se=>se===!0):j.every(se=>se===!0):!0};return i.filter(Me)}function MS(i,r,o,a="string"){if(!r||!o||!a)return i;let c=f=>f==null?f:a==="string"?`${f}`:parseFloat(f);return i.slice().sort((f,d)=>{let g=c(f[r]),E=c(d[r]),A=E==null||g>E?1:-1;return o.toLowerCase()==="descending"?A*-1:A})}function PS(i,r){let o=typeof r=="number"?r:parseFloat(r);return isNaN(o)?i:i.slice(0,o)}var AT=i=>{if(!i)return!1;let r=o=>{for(let a of DS)if(o[a])for(let c of o[a]?.conditions||[]){let f=r(c);if(f)return f}for(let a of uR){let c=o[a];if(!c||typeof c!="object")continue;if(Object.entries(c).filter(d=>{let g=d[1]!==void 0||d[1]!==null||d[1]!=="";return a==="notEmpty"||g}).length!==0)return!0}return!1};return r(i)};var kT={};Le(kT,{applications:()=>bT,automations:()=>wT,screens:()=>FT,users:()=>PT});var bT={};Le(bT,{getDevAppID:()=>dR,getProdAppID:()=>zd});var RT=v_("app"),Ql=v_("app_dev");function dR(i){if(!i)throw new Error("No app ID provided");if(i.startsWith(Ql))return i;let r=i.split(RT);r.shift();let o=r.join(RT);return`${Ql}${o}`}function zd(i){if(!i)throw new Error("No app ID provided");if(!i.startsWith(Ql))return i;let r=i.split(Ql);r.shift();let o=r.join(Ql);return`${RT}${o}`}var wT={};Le(wT,{isAppAction:()=>gR,isRowAction:()=>hR,isWebhookAction:()=>mR});function hR(i){return i.definition.trigger?.stepId==="ROW_ACTION"}function mR(i){return i.definition.trigger?.stepId==="WEBHOOK"}function gR(i){return i.definition.trigger?.stepId==="APP"}var PT={};Le(PT,{canCreateApps:()=>AR,containsUserID:()=>RR,getGlobalUserID:()=>IR,getUserAppGroups:()=>bR,getUserGroups:()=>MT,hasAdminPermissions:()=>UT,hasAppBuilderPermissions:()=>Qd,hasAppCreatorPermissions:()=>YS,hasBuilderPermissions:()=>vR,hasCreatorPermissions:()=>jd,isAdmin:()=>Yd,isAdminOrBuilder:()=>SR,isAdminOrGlobalBuilder:()=>OR,isBuilder:()=>LT,isCreator:()=>xR,isGlobalBuilder:()=>Zd,userAppAccessList:()=>wR});var So=fo(ZS());function LT(i,r){return i?i.builder?.global?!0:!!(r&&i.builder?.apps?.includes(zd(r))):!1}function Zd(i){return LT(i)&&!Qd(i)||Yd(i)}function AR(i){return Zd(i)||jd(i)}function Yd(i){return i?UT(i):!1}function SR(i,r){return LT(i,r)||Yd(i)}function OR(i){return Zd(i)||Yd(i)}function Qd(i){if(!i)return!1;let r=i.builder?.apps?.length;return!!!i.builder?.global&&r!=null&&r>0}function YS(i){return i?So.flow(So.get("roles"),So.values,So.find(r=>["CREATOR","ADMIN"].includes(r)),r=>!!r)(i):!1}function vR(i){return i?i.builder?.global||Qd(i)||jd(i):!1}function UT(i){return i?!!i.admin?.global:!1}function jd(i){return i?!!i.builder?.creator:!1}function xR(i){return i?Zd(i)||UT(i)||jd(i)||Qd(i)||YS(i):!1}function IR(i){if(typeof i!="string")return i;let r=`ro${fs}ta_users${fs}`;return i.startsWith(r)?i.split(r)[1]:i}function RR(i){return typeof i!="string"?!1:i.includes(`us${fs}`)}function MT(i,r){return r?.filter(o=>o.users?.find(a=>a._id===i._id))||[]}function bR(i,r,o){let a=zd(i);return MT(r,o).filter(f=>Object.keys(f.roles||{}).find(d=>d===a))}function wR(i,r){let a=MT(i,r).flatMap(f=>Object.keys(f.roles||{})),c=[...Object.keys(i.roles),...a];return[...new Set(c)]}var FT={};Le(FT,{findInSettings:()=>NR});function NR(i,r){let o=[];function a(c,f=""){for(let[d,g]of Object.entries(c))g&&(typeof g=="string"&&g.includes(r)?o.push({setting:f?`${f}.${d}`:d,value:g}):typeof g=="object"&&a(g,d))}return a(i.props),o}var CR={string:!0,longform:!0,options:!0,number:!0,datetime:!0,formula:!0,ai:!0,auto:!0,internal:!0,barcodeqr:!0,bigint:!0,boolean:!1,array:!1,attachment:!1,attachment_single:!1,signature_single:!1,link:!1,json:!1,bb_reference:!1,bb_reference_single:!1},DR={string:!0,longform:!0,options:!0,number:!0,datetime:!0,auto:!0,internal:!0,barcodeqr:!0,bigint:!0,boolean:!0,json:!0,formula:!1,ai:!1,attachment:!1,attachment_single:!1,signature_single:!1,array:!1,link:!1,bb_reference:!1,bb_reference_single:!1},LR={number:!0,json:!0,datetime:!0,longform:!0,string:!0,options:!0,array:!0,bigint:!0,boolean:!0,auto:!1,internal:!1,barcodeqr:!1,formula:!1,ai:!1,attachment:!1,attachment_single:!1,signature_single:!1,link:!1,bb_reference:!0,bb_reference_single:!0};function UR(i){return!!CR[i]}function MR(i){return!!DR[i]}function PR(i){return!!LR[i]}function FR(i){let r=Object.keys(i.schema),o=r.map(f=>f.toLowerCase()),a=new Set(o),c=[];if(a.size!==o.length)for(let f of a.keys())o.filter(g=>g===f).length>1&&c.push(f);for(let f of xd)r.find(d=>d===f)&&c.push(f);return c}var kR=i=>{i=QS(i);let r=`${Au}${i}`,o=Id.find(a=>a.id===i)?.base;return o&&(r=`${Au}${o} ${r}`),r},QS=(i,r="darkest")=>i?(i.startsWith(Au)&&(i=i.split(Au)[1]),Id.some(o=>o.id===i)?i:i==="lightest"?"light":i==="dark"?"darkest":r):r;var lE={};Le(lE,{steps:()=>uE,triggers:()=>cE});var uE={};Le(uE,{bash:()=>BT,branch:()=>GT,collect:()=>WT,createRow:()=>VT,delay:()=>qT,deleteRow:()=>$T,discord:()=>HT,executeQuery:()=>zT,executeScript:()=>ZT,executeScriptV2:()=>YT,filter:()=>QT,loop:()=>jT,make:()=>KT,n8n:()=>JT,openai:()=>XT,outgoingWebhook:()=>eE,queryRows:()=>tE,sendSmtpEmail:()=>rE,serverLog:()=>nE,slack:()=>iE,triggerAutomationRun:()=>oE,updateRow:()=>sE,zapier:()=>aE});var BT={};Le(BT,{definition:()=>BR});var BR={name:"Bash Scripting",tagline:"Execute a bash command",icon:"JourneyEvent",description:"Run a bash script",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"EXECUTE_BASH",inputs:{},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{stdout:{type:"string",description:"Standard output of your bash command or script"},success:{type:"boolean",description:"Whether the command was successful"}},required:["stdout"]}}};var GT={};Le(GT,{definition:()=>GR});var GR={name:"Branch",icon:"Branch3",tagline:"Branch from this step",description:"Branching",stepId:"BRANCH",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{branches:{properties:{name:{type:"string"},condition:{customType:"filters"}}},children:{type:"array"}},required:["conditions"]},outputs:{properties:{branchName:{type:"string"},status:{type:"string",description:"Branch result"},branchId:{type:"string",description:"Branch ID"},success:{type:"boolean",description:"Branch success"}},required:["output"]}},type:"LOGIC"};var WT={};Le(WT,{definition:()=>WR});var WR={name:"Collect Data",tagline:"Collect data to be sent to design",icon:"Collection",description:"Collects specified data so it can be provided to the design section",type:"ACTION",internal:!0,features:{},stepId:"COLLECT",inputs:{},schema:{inputs:{properties:{collection:{type:"string",title:"What to Collect"}},required:["collection"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},value:{type:"string",description:"Collected data"}},required:["success","value"]}}};var VT={};Le(VT,{definition:()=>VR});var VR={name:"Create Row",tagline:"Create a {{inputs.enriched.table.name}} row",icon:"TableRowAddBottom",description:"Add a row to your database",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"CREATE_ROW",inputs:{},schema:{inputs:{properties:{row:{type:"object",properties:{tableId:{type:"string",customType:"table"}},customType:"row",title:"Table",required:["tableId"]}},required:["row"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The new row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the row creation was successful"},id:{type:"string",description:"The identifier of the new row"},revision:{type:"string",description:"The revision of the new row"}},required:["success","id","revision"]}}};var qT={};Le(qT,{definition:()=>qR});var qR={name:"Delay",icon:"Clock",tagline:"Delay for {{inputs.time}} milliseconds",description:"Delay the automation until an amount of time has passed",stepId:"DELAY",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{time:{type:"number",title:"Delay in milliseconds"}},required:["time"]},outputs:{properties:{success:{type:"boolean",description:"Whether the delay was successful"}},required:["success"]}},type:"LOGIC"};var $T={};Le($T,{definition:()=>$R});var $R={description:"Delete a row from your database",icon:"TableRowRemoveCenter",name:"Delete Row",tagline:"Delete a {{inputs.enriched.table.name}} row",type:"ACTION",stepId:"DELETE_ROW",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},id:{type:"string",title:"Row ID"}},required:["tableId","id"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The deleted row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the deletion was successful"}},required:["row","success"]}}};var HT={};Le(HT,{definition:()=>HR});var HR={name:"Discord Message",tagline:"Send a message to a Discord server",description:"Send a message to a Discord server",icon:"ri-discord-line",stepId:"discord",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Discord Webhook URL"},username:{type:"string",title:"Bot Name"},avatar_url:{type:"string",title:"Bot Avatar URL"},content:{type:"string",title:"Message"}},required:["url","content"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},response:{type:"string",description:"The response from the Discord Webhook"},success:{type:"boolean",description:"Whether the message sent successfully"}}}}};var zT={};Le(zT,{definition:()=>zR});var zR={name:"External Data Connector",tagline:"Execute Data Connector",icon:"Data",description:"Execute a query in an external data connector",type:"ACTION",stepId:"EXECUTE_QUERY",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{query:{type:"object",properties:{queryId:{type:"string",customType:"query"}},customType:"queryParams",title:"Parameters",required:["queryId"]}},required:["query"]},outputs:{properties:{response:{type:"object",description:"The response from the datasource execution"},info:{type:"object",description:"Some query types may return extra data, like headers from a REST query"},success:{type:"boolean",description:"Whether the action was successful"}},required:["response","success"]}}};var ZT={};Le(ZT,{definition:()=>ZR});var ZR={name:"JS Scripting",tagline:"Execute JavaScript Code",deprecated:!0,icon:"Code",description:"Run a piece of JavaScript code in your automation",type:"ACTION",internal:!0,stepId:"EXECUTE_SCRIPT",inputs:{},features:{LOOPING:!0},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{value:{type:"string",description:"The result of the return statement"},success:{type:"boolean",description:"Whether the action was successful"}},required:["success"]}}};var YT={};Le(YT,{definition:()=>YR});var YR={name:"JavaScript",tagline:"Execute JavaScript Code",icon:"Brackets",description:"Run a piece of JavaScript code in your automation",type:"ACTION",internal:!0,new:!0,stepId:"EXECUTE_SCRIPT_V2",inputs:{},features:{LOOPING:!0},schema:{inputs:{properties:{code:{type:"string",customType:"code",title:"Code"}},required:["code"]},outputs:{properties:{value:{type:"string",description:"The result of the return statement"},success:{type:"boolean",description:"Whether the action was successful"}},required:["success"]}}};var QT={};Le(QT,{PrettyFilterConditions:()=>jS,definition:()=>QR});var jS={EQUAL:"Equals",NOT_EQUAL:"Not equals",GREATER_THAN:"Greater than",LESS_THAN:"Less than"},QR={name:"Condition",tagline:"{{inputs.field}} {{inputs.condition}} {{inputs.value}}",icon:"Branch2",description:"Conditionally halt automations which do not meet certain conditions",type:"LOGIC",internal:!0,features:{},stepId:"FILTER",inputs:{condition:"EQUAL"},schema:{inputs:{properties:{field:{type:"string",title:"Reference Value"},condition:{type:"string",title:"Condition",enum:Object.values(x_),pretty:Object.values(jS)},value:{type:"string",title:"Comparison Value"}},required:["field","condition","value"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},result:{type:"boolean",description:"Whether the logic block passed"}},required:["success","result"]}}};var jT={};Le(jT,{definition:()=>jR});var jR={name:"Looping",icon:"Reuse",tagline:"Loop the block",description:"Loop",stepId:"LOOP",internal:!0,features:{},inputs:{},schema:{inputs:{properties:{option:{customType:"loopOption",title:"Input type"},binding:{type:"string",title:"Binding / Value"},iterations:{type:"number",title:"Max loop iterations"},failure:{type:"string",title:"Failure Condition"}},required:["type","value","iterations","failure"]},outputs:{properties:{items:{customType:"item",description:"The item currently being executed"},success:{type:"boolean",description:"Whether the message loop was successfully"},iterations:{type:"number",description:"The amount of times the block ran"}},required:["success","items","iterations"]}},type:"LOGIC"};var KT={};Le(KT,{definition:()=>KR});var KR={name:"Make Integration",stepTitle:"Make",tagline:"Trigger a Make scenario",description:"Performs a webhook call to Make and gets the response (if configured)",icon:"ri-shut-down-line",stepId:"integromat",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},body:{type:"json",title:"Payload"}},required:["url","body"]},outputs:{properties:{success:{type:"boolean",description:"Whether call was successful"},httpStatus:{type:"number",description:"The HTTP status code returned"},response:{type:"object",description:"The webhook response - this can have properties"}},required:["success","response"]}}};var JT={};Le(JT,{definition:()=>JR});var JR={name:"n8n Integration",stepTitle:"n8n",tagline:"Trigger an n8n workflow",description:"Performs a webhook call to n8n and gets the response (if configured)",icon:"ri-shut-down-line",stepId:"n8n",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},method:{type:"string",title:"Method",enum:Object.values(I_)},authorization:{type:"string",title:"Authorization"},body:{type:"json",title:"Payload"}},required:["url","method"]},outputs:{properties:{success:{type:"boolean",description:"Whether call was successful"},httpStatus:{type:"number",description:"The HTTP status code returned"},response:{type:"object",description:"The webhook response - this can have properties"}},required:["success","response"]}}};var XT={};Le(XT,{definition:()=>XR});var KS=(c=>(c.GPT_4O_MINI="gpt-4o-mini",c.GPT_4O="gpt-4o",c.GPT_4="gpt-4",c.GPT_35_TURBO="gpt-3.5-turbo",c))(KS||{}),XR={name:"OpenAI",tagline:"Send prompts to ChatGPT",icon:"Algorithm",description:"Interact with the OpenAI ChatGPT API.",type:"ACTION",internal:!0,features:{},stepId:"OPENAI",inputs:{prompt:""},schema:{inputs:{properties:{prompt:{type:"string",title:"Prompt"},model:{type:"string",title:"Model",enum:Object.values(KS)}},required:["prompt","model"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},response:{type:"string",description:"What was output"}},required:["success","response"]}}};var eE={};Le(eE,{definition:()=>e0});var JS=(f=>(f.POST="POST",f.GET="GET",f.PUT="PUT",f.DELETE="DELETE",f.PATCH="PATCH",f))(JS||{}),e0={deprecated:!0,name:"Outgoing webhook",tagline:"Send a {{inputs.requestMethod}} request",icon:"Send",description:"Send a request of specified method to a URL",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"OUTGOING_WEBHOOK",inputs:{requestMethod:"POST",url:"http://",requestBody:"{}",headers:"{}"},schema:{inputs:{properties:{requestMethod:{type:"string",enum:Object.values(JS),title:"Request method"},url:{type:"string",title:"URL"},requestBody:{type:"string",title:"JSON Body",customType:"wide"},headers:{type:"string",title:"Headers",customType:"wide"}},required:["requestMethod","url"]},outputs:{properties:{response:{type:"object",description:"The response from the webhook"},httpStatus:{type:"number",description:"The HTTP status code returned"},success:{type:"boolean",description:"Whether the action was successful"}},required:["response","success"]}}};var tE={};Le(tE,{definition:()=>r0});var t0={ascending:"Ascending",descending:"Descending"},r0={description:"Query rows from the database",icon:"Search",name:"Query rows",tagline:"Query rows from {{inputs.enriched.table.name}} table",type:"ACTION",stepId:"QUERY_ROWS",internal:!0,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"filters",title:"Filtering"},sortColumn:{type:"string",title:"Sort Column",customType:"column"},sortOrder:{type:"string",title:"Sort Order",enum:Object.values(pu),pretty:Object.values(t0)},limit:{type:"number",title:"Limit",customType:"queryLimit"}},required:["tableId"]},outputs:{properties:{rows:{type:"array",customType:"rows",description:"The rows that were found"},success:{type:"boolean",description:"Whether the query was successful"}},required:["rows","success"]}}};var rE={};Le(rE,{definition:()=>n0});var n0={description:"Send an email using SMTP",tagline:"Send SMTP email to {{inputs.to}}",icon:"Email",name:"Send Email (SMTP)",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"SEND_EMAIL_SMTP",inputs:{},schema:{inputs:{properties:{to:{type:"string",title:"Send To"},from:{type:"string",title:"Send From"},cc:{type:"string",title:"CC"},bcc:{type:"string",title:"BCC"},subject:{type:"string",title:"Email Subject"},contents:{type:"string",title:"HTML Contents"},addInvite:{type:"boolean",title:"Add calendar invite"},startTime:{type:"date",title:"Start Time",dependsOn:"addInvite"},endTime:{type:"date",title:"End Time",dependsOn:"addInvite"},summary:{type:"string",title:"Meeting Summary",dependsOn:"addInvite"},location:{type:"string",title:"Location",dependsOn:"addInvite"},attachments:{type:"attachment",customType:"multi_attachments",title:"Attachments"}},required:["to","from","subject","contents"]},outputs:{properties:{success:{type:"boolean",description:"Whether the email was sent"},response:{type:"object",description:"A response from the email client, this may be an error"}},required:["success"]}}};var nE={};Le(nE,{definition:()=>i0});var i0={name:"Backend log",tagline:"Console log a value in the backend",icon:"Monitoring",description:"Logs the given text to the server (using console.log)",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"SERVER_LOG",inputs:{text:""},schema:{inputs:{properties:{text:{type:"string",title:"Log"}},required:["text"]},outputs:{properties:{success:{type:"boolean",description:"Whether the action was successful"},message:{type:"string",description:"What was output"}},required:["success","message"]}}};var iE={};Le(iE,{definition:()=>o0});var o0={name:"Slack Message",tagline:"Send a message to Slack",description:"Send a message to Slack",icon:"ri-slack-line",stepId:"slack",type:"ACTION",internal:!1,features:{LOOPING:!0},inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Incoming Webhook URL"},text:{type:"string",title:"Message"}},required:["url","text"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},success:{type:"boolean",description:"Whether the message sent successfully"},response:{type:"string",description:"The response from the Slack Webhook"}}}}};var oE={};Le(oE,{definition:()=>s0});var s0={name:"Trigger an automation",tagline:"Triggers an automation synchronously",icon:"Sync",description:"Triggers an automation synchronously",type:"ACTION",internal:!0,features:{},stepId:"TRIGGER_AUTOMATION_RUN",inputs:{},schema:{inputs:{properties:{automation:{type:"object",properties:{automationId:{type:"string",customType:"automation"}},customType:"automationFields",title:"automatioFields",required:["automationId"]},timeout:{type:"number",title:"Timeout (ms)"}},required:["automationId"]},outputs:{properties:{success:{type:"boolean",description:"Whether the automation was successful"},value:{type:"object",description:"Automation Result"}},required:["success","value"]}}};var sE={};Le(sE,{definition:()=>a0});var a0={name:"Update Row",tagline:"Update a {{inputs.enriched.table.name}} row",icon:"Refresh",description:"Update a row in your database",type:"ACTION",internal:!0,features:{LOOPING:!0},stepId:"UPDATE_ROW",inputs:{},schema:{inputs:{properties:{meta:{type:"object",title:"Field settings"},row:{type:"object",customType:"row",title:"Table"},rowId:{type:"string",title:"Row ID"}},required:["row","rowId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The updated row"},response:{type:"object",description:"The response from the table"},success:{type:"boolean",description:"Whether the action was successful"},id:{type:"string",description:"The identifier of the updated row"},revision:{type:"string",description:"The revision of the updated row"}},required:["success","id","revision"]}}};var aE={};Le(aE,{definition:()=>u0});var u0={name:"Zapier Webhook",stepId:"zapier",type:"ACTION",internal:!1,features:{LOOPING:!0},description:"Trigger a Zapier Zap via webhooks",tagline:"Trigger a Zapier Zap",icon:"ri-flashlight-line",inputs:{},schema:{inputs:{properties:{url:{type:"string",title:"Webhook URL"},body:{type:"json",title:"Payload"}},required:["url"]},outputs:{properties:{httpStatus:{type:"number",description:"The HTTP status code of the request"},response:{type:"string",description:"The response from Zapier"}}}}};var cE={};Le(cE,{definitions:()=>g0});var XS={name:"App Action",event:"app:trigger",icon:"Apps",tagline:"Automation fired from the frontend",description:"Trigger an automation from an action inside your app",stepId:"APP",inputs:{},schema:{inputs:{properties:{fields:{type:"object",customType:"triggerSchema",title:"Fields"}},required:[]},outputs:{properties:{fields:{type:"object",description:"Fields submitted from the app frontend",customType:"triggerSchema"}},required:["fields"]}},type:"TRIGGER"};var eO={name:"Cron Trigger",event:"cron:trigger",icon:"Clock",tagline:"Cron Trigger (<b>{{inputs.cron}}</b>)",description:"Triggers automation on a cron schedule.",stepId:"CRON",inputs:{},schema:{inputs:{properties:{cron:{type:"string",customType:"cron",title:"Expression"}},required:["cron"]},outputs:{properties:{timestamp:{type:"number",description:"Timestamp the cron was executed"}},required:["timestamp"]}},type:"TRIGGER"};var tO={name:"Row Deleted",event:"row:delete",icon:"TableRowRemoveCenter",tagline:"Row is deleted from {{inputs.enriched.table.name}}",description:"Fired when a row is deleted from your database",stepId:"ROW_DELETED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"}},required:["tableId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The row that was deleted"}},required:["row"]}},type:"TRIGGER"};var rO={name:"Row Created",event:"row:save",icon:"TableRowAddBottom",tagline:"Row is added to {{inputs.enriched.table.name}}",description:"Fired when a row is added to your database",stepId:"ROW_SAVED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"trigger_filter",title:"Filtering"}},required:["tableId"]},outputs:{properties:{row:{type:"object",customType:"row",description:"The new row that was created"},id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"}},required:["row","id"]}},type:"TRIGGER"};var nO={name:"Row Updated",event:"row:update",icon:"Refresh",tagline:"Row is updated in {{inputs.enriched.table.name}}",description:"Fired when a row is updated in your database",stepId:"ROW_UPDATED",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table"},filters:{type:"object",customType:"trigger_filter",title:"Filtering"}},required:["tableId"]},outputs:{properties:{oldRow:{type:"object",customType:"row",description:"The row that was updated",title:"Old Row"},row:{type:"object",customType:"row",description:"The row before it was updated",title:"Row"},id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"}},required:["row","id"]}},type:"TRIGGER"};var iO={name:"Webhook",event:"web:trigger",icon:"Send",tagline:"Webhook endpoint is hit",description:"Trigger an automation when a HTTP POST webhook is hit",stepId:"WEBHOOK",inputs:{},schema:{inputs:{properties:{schemaUrl:{type:"string",customType:"webhookUrl",title:"Schema URL"},triggerUrl:{type:"string",customType:"webhookUrl",title:"Trigger URL"}},required:["schemaUrl","triggerUrl"]},outputs:{properties:{body:{type:"object",description:"Body of the request which hit the webhook"}},required:["body"]}},type:"TRIGGER"};var oO={type:"TRIGGER",name:"Row Action",event:"row:action",icon:"Workflow",tagline:"Row action triggered in {{inputs.enriched.table.name}} by {{inputs.enriched.row._id}}",description:"TODO description",stepId:"ROW_ACTION",inputs:{},schema:{inputs:{properties:{tableId:{type:"string",customType:"table",title:"Table",readonly:!0}},required:["tableId"]},outputs:{properties:{id:{type:"string",description:"Row ID - can be used for updating"},revision:{type:"string",description:"Revision of row"},table:{type:"object",customType:"table",title:"The table linked to the row action"},row:{type:"object",customType:"row",description:"The row linked to the row action"}}}}};var g0={ROW_SAVED:rO,ROW_UPDATED:nO,ROW_DELETED:tO,WEBHOOK:iO,APP:XS,CRON:eO,ROW_ACTION:oO};0&&(module.exports={AIOperations,BpmCorrelationKey,BpmInstanceKey,BpmStatusKey,BpmStatusValue,BuilderSocketEvent,DEFAULT_BB_DATASOURCE_ID,DefaultAppTheme,DefaultBuilderTheme,GridSocketEvent,Header,InvalidFileExtensions,OperationFieldTypes,OperationFields,OperatorOptions,PROTECTED_EXTERNAL_COLUMNS,PROTECTED_INTERNAL_COLUMNS,REBOOT_CRON,RoleColor,SWITCHABLE_TYPES,SocketEvent,SocketSessionTTL,SqlNumberTypeRangeMap,ThemeClassPrefix,ThemeOptions,ValidColumnNameRegex,ValidQueryNameRegex,ValidSnippetNameRegex,automations,canBeDisplayColumn,canBeSortColumn,canHaveDefaultColumn,dataFilters,ensureValidTheme,findDuplicateInternalColumns,getThemeClassNames,helpers,isExternalColumnName,isInternalColumnName,sdk,utils});
|
|
41
41
|
/*! Bundled license information:
|
|
42
42
|
|
|
43
43
|
lodash/lodash.js:
|