@botpress/sdk 3.0.2 → 3.0.3
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/.turbo/turbo-build.log +4 -4
- package/dist/bot/implementation.test.d.ts +1 -0
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +4 -4
- package/dist/index.mjs +26 -26
- package/dist/index.mjs.map +4 -4
- package/dist/plugin/implementation.test.d.ts +1 -0
- package/dist/utils/array-utils.d.ts +1 -0
- package/dist/utils/function-utils.d.ts +2 -0
- package/dist/utils/function-utils.test.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var sg=Object.create;var Ir=Object.defineProperty;var ig=Object.getOwnPropertyDescriptor;var og=Object.getOwnPropertyNames;var ug=Object.getPrototypeOf,cg=Object.prototype.hasOwnProperty;var Ia=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Zr=(t,e)=>{for(var r in e)Ir(t,r,{get:e[r],enumerable:!0})},Hi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of og(e))!cg.call(t,a)&&a!==r&&Ir(t,a,{get:()=>e[a],enumerable:!(n=ig(e,a))||n.enumerable});return t};var et=(t,e,r)=>(r=t!=null?sg(ug(t)):{},Hi(e||!t||!t.__esModule?Ir(r,"default",{value:t,enumerable:!0}):r,t)),lg=t=>Hi(Ir({},"__esModule",{value:!0}),t);var Ji=Ia(N=>{"use strict";var Wt=Symbol.for("react.element"),dg=Symbol.for("react.portal"),fg=Symbol.for("react.fragment"),pg=Symbol.for("react.strict_mode"),gg=Symbol.for("react.profiler"),mg=Symbol.for("react.provider"),hg=Symbol.for("react.context"),yg=Symbol.for("react.forward_ref"),vg=Symbol.for("react.suspense"),_g=Symbol.for("react.memo"),bg=Symbol.for("react.lazy"),Ni=Symbol.iterator;function Tg(t){return t===null||typeof t!="object"?null:(t=Ni&&t[Ni]||t["@@iterator"],typeof t=="function"?t:null)}var Fi={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Li=Object.assign,zi={};function Pt(t,e,r){this.props=t,this.context=e,this.refs=zi,this.updater=r||Fi}Pt.prototype.isReactComponent={};Pt.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Pt.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Ki(){}Ki.prototype=Pt.prototype;function Aa(t,e,r){this.props=t,this.context=e,this.refs=zi,this.updater=r||Fi}var Ra=Aa.prototype=new Ki;Ra.constructor=Aa;Li(Ra,Pt.prototype);Ra.isPureReactComponent=!0;var $i=Array.isArray,Vi=Object.prototype.hasOwnProperty,Ba={current:null},qi={key:!0,ref:!0,__self:!0,__source:!0};function Gi(t,e,r){var n,a={},s=null,i=null;if(e!=null)for(n in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)Vi.call(e,n)&&!qi.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var d=Array(o),p=0;p<o;p++)d[p]=arguments[p+2];a.children=d}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:Wt,type:t,key:s,ref:i,props:a,_owner:Ba.current}}function Pg(t,e){return{$$typeof:Wt,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Da(t){return typeof t=="object"&&t!==null&&t.$$typeof===Wt}function Eg(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Ui=/\/+/g;function Za(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Eg(""+t.key):e.toString(36)}function Rr(t,e,r,n,a){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case Wt:case dg:i=!0}}if(i)return i=t,a=a(i),t=n===""?"."+Za(i,0):n,$i(a)?(r="",t!=null&&(r=t.replace(Ui,"$&/")+"/"),Rr(a,e,r,"",function(p){return p})):a!=null&&(Da(a)&&(a=Pg(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(Ui,"$&/")+"/")+t)),e.push(a)),1;if(i=0,n=n===""?".":n+":",$i(t))for(var o=0;o<t.length;o++){s=t[o];var d=n+Za(s,o);i+=Rr(s,e,r,d,a)}else if(d=Tg(t),typeof d=="function")for(t=d.call(t),o=0;!(s=t.next()).done;)s=s.value,d=n+Za(s,o++),i+=Rr(s,e,r,d,a);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function Ar(t,e,r){if(t==null)return t;var n=[],a=0;return Rr(t,n,"","",function(s){return e.call(r,s,a++)}),n}function xg(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var he={current:null},Br={transition:null},Sg={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:Br,ReactCurrentOwner:Ba};function Wi(){throw Error("act(...) is not supported in production builds of React.")}N.Children={map:Ar,forEach:function(t,e,r){Ar(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ar(t,function(){e++}),e},toArray:function(t){return Ar(t,function(e){return e})||[]},only:function(t){if(!Da(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};N.Component=Pt;N.Fragment=fg;N.Profiler=gg;N.PureComponent=Aa;N.StrictMode=pg;N.Suspense=vg;N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Sg;N.act=Wi;N.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=Li({},t.props),a=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=Ba.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(d in e)Vi.call(e,d)&&!qi.hasOwnProperty(d)&&(n[d]=e[d]===void 0&&o!==void 0?o[d]:e[d])}var d=arguments.length-2;if(d===1)n.children=r;else if(1<d){o=Array(d);for(var p=0;p<d;p++)o[p]=arguments[p+2];n.children=o}return{$$typeof:Wt,type:t.type,key:a,ref:s,props:n,_owner:i}};N.createContext=function(t){return t={$$typeof:hg,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:mg,_context:t},t.Consumer=t};N.createElement=Gi;N.createFactory=function(t){var e=Gi.bind(null,t);return e.type=t,e};N.createRef=function(){return{current:null}};N.forwardRef=function(t){return{$$typeof:yg,render:t}};N.isValidElement=Da;N.lazy=function(t){return{$$typeof:bg,_payload:{_status:-1,_result:t},_init:xg}};N.memo=function(t,e){return{$$typeof:_g,type:t,compare:e===void 0?null:e}};N.startTransition=function(t){var e=Br.transition;Br.transition={};try{t()}finally{Br.transition=e}};N.unstable_act=Wi;N.useCallback=function(t,e){return he.current.useCallback(t,e)};N.useContext=function(t){return he.current.useContext(t)};N.useDebugValue=function(){};N.useDeferredValue=function(t){return he.current.useDeferredValue(t)};N.useEffect=function(t,e){return he.current.useEffect(t,e)};N.useId=function(){return he.current.useId()};N.useImperativeHandle=function(t,e,r){return he.current.useImperativeHandle(t,e,r)};N.useInsertionEffect=function(t,e){return he.current.useInsertionEffect(t,e)};N.useLayoutEffect=function(t,e){return he.current.useLayoutEffect(t,e)};N.useMemo=function(t,e){return he.current.useMemo(t,e)};N.useReducer=function(t,e,r){return he.current.useReducer(t,e,r)};N.useRef=function(t){return he.current.useRef(t)};N.useState=function(t){return he.current.useState(t)};N.useSyncExternalStore=function(t,e,r){return he.current.useSyncExternalStore(t,e,r)};N.useTransition=function(){return he.current.useTransition()};N.version="18.3.1"});var Yi=Ia(($,Dr)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),D=Symbol.iterator,z="@@iterator";function q(c){if(c===null||typeof c!="object")return null;var f=D&&c[D]||c[z];return typeof f=="function"?f:null}var se={current:null},V={transition:null},H={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},W={current:null},ce={},Le=null;function Xe(c){Le=c}ce.setExtraStackFrame=function(c){Le=c},ce.getCurrentStack=null,ce.getStackAddendum=function(){var c="";Le&&(c+=Le);var f=ce.getCurrentStack;return f&&(c+=f()||""),c};var Oe=!1,Te=!1,da=!1,fa=!1,Pe=!1,_e={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:V,ReactCurrentOwner:W};_e.ReactDebugCurrentFrame=ce,_e.ReactCurrentActQueue=H;function Ee(c){{for(var f=arguments.length,g=new Array(f>1?f-1:0),h=1;h<f;h++)g[h-1]=arguments[h];Ce("warn",c,g)}}function j(c){{for(var f=arguments.length,g=new Array(f>1?f-1:0),h=1;h<f;h++)g[h-1]=arguments[h];Ce("error",c,g)}}function Ce(c,f,g){{var h=_e.ReactDebugCurrentFrame,b=h.getStackAddendum();b!==""&&(f+="%s",g=g.concat([b]));var I=g.map(function(w){return String(w)});I.unshift("Warning: "+f),Function.prototype.apply.call(console[c],console,I)}}var ke={};function ze(c,f){{var g=c.constructor,h=g&&(g.displayName||g.name)||"ReactClass",b=h+"."+f;if(ke[b])return;j("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",f,h),ke[b]=!0}}var Qs={isMounted:function(c){return!1},enqueueForceUpdate:function(c,f,g){ze(c,"forceUpdate")},enqueueReplaceState:function(c,f,g,h){ze(c,"replaceState")},enqueueSetState:function(c,f,g,h){ze(c,"setState")}},Re=Object.assign,pa={};Object.freeze(pa);function Qe(c,f,g){this.props=c,this.context=f,this.refs=pa,this.updater=g||Qs}Qe.prototype.isReactComponent={},Qe.prototype.setState=function(c,f){if(typeof c!="object"&&typeof c!="function"&&c!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,c,f,"setState")},Qe.prototype.forceUpdate=function(c){this.updater.enqueueForceUpdate(this,c,"forceUpdate")};{var ga={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Xf=function(c,f){Object.defineProperty(Qe.prototype,c,{get:function(){Ee("%s(...) is deprecated in plain JavaScript React classes. %s",f[0],f[1])}})};for(var ma in ga)ga.hasOwnProperty(ma)&&Xf(ma,ga[ma])}function ei(){}ei.prototype=Qe.prototype;function ha(c,f,g){this.props=c,this.context=f,this.refs=pa,this.updater=g||Qs}var ya=ha.prototype=new ei;ya.constructor=ha,Re(ya,Qe.prototype),ya.isPureReactComponent=!0;function Qf(){var c={current:null};return Object.seal(c),c}var ep=Array.isArray;function _r(c){return ep(c)}function tp(c){{var f=typeof Symbol=="function"&&Symbol.toStringTag,g=f&&c[Symbol.toStringTag]||c.constructor.name||"Object";return g}}function rp(c){try{return ti(c),!1}catch{return!0}}function ti(c){return""+c}function br(c){if(rp(c))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tp(c)),ti(c)}function np(c,f,g){var h=c.displayName;if(h)return h;var b=f.displayName||f.name||"";return b!==""?g+"("+b+")":g}function ri(c){return c.displayName||"Context"}function Ke(c){if(c==null)return null;if(typeof c.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case y:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case o:var f=c;return ri(f)+".Consumer";case i:var g=c;return ri(g._context)+".Provider";case d:return np(c,c.render,"ForwardRef");case T:var h=c.displayName||null;return h!==null?h:Ke(c.type)||"Memo";case k:{var b=c,I=b._payload,w=b._init;try{return Ke(w(I))}catch{return null}}}return null}var Vt=Object.prototype.hasOwnProperty,ni={key:!0,ref:!0,__self:!0,__source:!0},ai,si,va;va={};function ii(c){if(Vt.call(c,"ref")){var f=Object.getOwnPropertyDescriptor(c,"ref").get;if(f&&f.isReactWarning)return!1}return c.ref!==void 0}function oi(c){if(Vt.call(c,"key")){var f=Object.getOwnPropertyDescriptor(c,"key").get;if(f&&f.isReactWarning)return!1}return c.key!==void 0}function ap(c,f){var g=function(){ai||(ai=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(c,"key",{get:g,configurable:!0})}function sp(c,f){var g=function(){si||(si=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(c,"ref",{get:g,configurable:!0})}function ip(c){if(typeof c.ref=="string"&&W.current&&c.__self&&W.current.stateNode!==c.__self){var f=Ke(W.current.type);va[f]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',f,c.ref),va[f]=!0)}}var _a=function(c,f,g,h,b,I,w){var R={$$typeof:e,type:c,key:f,ref:g,props:w,_owner:I};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function op(c,f,g){var h,b={},I=null,w=null,R=null,F=null;if(f!=null){ii(f)&&(w=f.ref,ip(f)),oi(f)&&(br(f.key),I=""+f.key),R=f.__self===void 0?null:f.__self,F=f.__source===void 0?null:f.__source;for(h in f)Vt.call(f,h)&&!ni.hasOwnProperty(h)&&(b[h]=f[h])}var J=arguments.length-2;if(J===1)b.children=g;else if(J>1){for(var Q=Array(J),ee=0;ee<J;ee++)Q[ee]=arguments[ee+2];Object.freeze&&Object.freeze(Q),b.children=Q}if(c&&c.defaultProps){var re=c.defaultProps;for(h in re)b[h]===void 0&&(b[h]=re[h])}if(I||w){var oe=typeof c=="function"?c.displayName||c.name||"Unknown":c;I&&ap(b,oe),w&&sp(b,oe)}return _a(c,I,w,R,F,W.current,b)}function up(c,f){var g=_a(c.type,f,c.ref,c._self,c._source,c._owner,c.props);return g}function cp(c,f,g){if(c==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+c+".");var h,b=Re({},c.props),I=c.key,w=c.ref,R=c._self,F=c._source,J=c._owner;if(f!=null){ii(f)&&(w=f.ref,J=W.current),oi(f)&&(br(f.key),I=""+f.key);var Q;c.type&&c.type.defaultProps&&(Q=c.type.defaultProps);for(h in f)Vt.call(f,h)&&!ni.hasOwnProperty(h)&&(f[h]===void 0&&Q!==void 0?b[h]=Q[h]:b[h]=f[h])}var ee=arguments.length-2;if(ee===1)b.children=g;else if(ee>1){for(var re=Array(ee),oe=0;oe<ee;oe++)re[oe]=arguments[oe+2];b.children=re}return _a(c.type,I,w,R,F,J,b)}function _t(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}var ui=".",lp=":";function dp(c){var f=/[=:]/g,g={"=":"=0",":":"=2"},h=c.replace(f,function(b){return g[b]});return"$"+h}var ci=!1,fp=/\/+/g;function li(c){return c.replace(fp,"$&/")}function ba(c,f){return typeof c=="object"&&c!==null&&c.key!=null?(br(c.key),dp(""+c.key)):f.toString(36)}function Tr(c,f,g,h,b){var I=typeof c;(I==="undefined"||I==="boolean")&&(c=null);var w=!1;if(c===null)w=!0;else switch(I){case"string":case"number":w=!0;break;case"object":switch(c.$$typeof){case e:case r:w=!0}}if(w){var R=c,F=b(R),J=h===""?ui+ba(R,0):h;if(_r(F)){var Q="";J!=null&&(Q=li(J)+"/"),Tr(F,f,Q,"",function(ag){return ag})}else F!=null&&(_t(F)&&(F.key&&(!R||R.key!==F.key)&&br(F.key),F=up(F,g+(F.key&&(!R||R.key!==F.key)?li(""+F.key)+"/":"")+J)),f.push(F));return 1}var ee,re,oe=0,de=h===""?ui:h+lp;if(_r(c))for(var Cr=0;Cr<c.length;Cr++)ee=c[Cr],re=de+ba(ee,Cr),oe+=Tr(ee,f,g,re,b);else{var Ca=q(c);if(typeof Ca=="function"){var Di=c;Ca===Di.entries&&(ci||Ee("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ci=!0);for(var rg=Ca.call(Di),Mi,ng=0;!(Mi=rg.next()).done;)ee=Mi.value,re=de+ba(ee,ng++),oe+=Tr(ee,f,g,re,b)}else if(I==="object"){var ji=String(c);throw new Error("Objects are not valid as a React child (found: "+(ji==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":ji)+"). If you meant to render a collection of children, use an array instead.")}}return oe}function Pr(c,f,g){if(c==null)return c;var h=[],b=0;return Tr(c,h,"","",function(I){return f.call(g,I,b++)}),h}function pp(c){var f=0;return Pr(c,function(){f++}),f}function gp(c,f,g){Pr(c,function(){f.apply(this,arguments)},g)}function mp(c){return Pr(c,function(f){return f})||[]}function hp(c){if(!_t(c))throw new Error("React.Children.only expected to receive a single React element child.");return c}function yp(c){var f={$$typeof:o,_currentValue:c,_currentValue2:c,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};f.Provider={$$typeof:i,_context:f};var g=!1,h=!1,b=!1;{var I={$$typeof:o,_context:f};Object.defineProperties(I,{Provider:{get:function(){return h||(h=!0,j("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),f.Provider},set:function(w){f.Provider=w}},_currentValue:{get:function(){return f._currentValue},set:function(w){f._currentValue=w}},_currentValue2:{get:function(){return f._currentValue2},set:function(w){f._currentValue2=w}},_threadCount:{get:function(){return f._threadCount},set:function(w){f._threadCount=w}},Consumer:{get:function(){return g||(g=!0,j("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),f.Consumer}},displayName:{get:function(){return f.displayName},set:function(w){b||(Ee("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",w),b=!0)}}}),f.Consumer=I}return f._currentRenderer=null,f._currentRenderer2=null,f}var qt=-1,Ta=0,di=1,vp=2;function _p(c){if(c._status===qt){var f=c._result,g=f();if(g.then(function(I){if(c._status===Ta||c._status===qt){var w=c;w._status=di,w._result=I}},function(I){if(c._status===Ta||c._status===qt){var w=c;w._status=vp,w._result=I}}),c._status===qt){var h=c;h._status=Ta,h._result=g}}if(c._status===di){var b=c._result;return b===void 0&&j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
1
|
+
"use strict";var ig=Object.create;var Ar=Object.defineProperty;var og=Object.getOwnPropertyDescriptor;var ug=Object.getOwnPropertyNames;var cg=Object.getPrototypeOf,lg=Object.prototype.hasOwnProperty;var Za=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jt=(t,e)=>{for(var r in e)Ar(t,r,{get:e[r],enumerable:!0})},Ni=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ug(e))!lg.call(t,a)&&a!==r&&Ar(t,a,{get:()=>e[a],enumerable:!(n=og(e,a))||n.enumerable});return t};var et=(t,e,r)=>(r=t!=null?ig(cg(t)):{},Ni(e||!t||!t.__esModule?Ar(r,"default",{value:t,enumerable:!0}):r,t)),dg=t=>Ni(Ar({},"__esModule",{value:!0}),t);var Yi=Za(N=>{"use strict";var Yt=Symbol.for("react.element"),fg=Symbol.for("react.portal"),pg=Symbol.for("react.fragment"),gg=Symbol.for("react.strict_mode"),mg=Symbol.for("react.profiler"),hg=Symbol.for("react.provider"),yg=Symbol.for("react.context"),vg=Symbol.for("react.forward_ref"),_g=Symbol.for("react.suspense"),bg=Symbol.for("react.memo"),Tg=Symbol.for("react.lazy"),$i=Symbol.iterator;function Pg(t){return t===null||typeof t!="object"?null:(t=$i&&t[$i]||t["@@iterator"],typeof t=="function"?t:null)}var Li={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zi=Object.assign,Ki={};function Et(t,e,r){this.props=t,this.context=e,this.refs=Ki,this.updater=r||Li}Et.prototype.isReactComponent={};Et.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Et.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Vi(){}Vi.prototype=Et.prototype;function Ra(t,e,r){this.props=t,this.context=e,this.refs=Ki,this.updater=r||Li}var Ba=Ra.prototype=new Vi;Ba.constructor=Ra;zi(Ba,Et.prototype);Ba.isPureReactComponent=!0;var Ui=Array.isArray,qi=Object.prototype.hasOwnProperty,Da={current:null},Gi={key:!0,ref:!0,__self:!0,__source:!0};function Wi(t,e,r){var n,a={},s=null,i=null;if(e!=null)for(n in e.ref!==void 0&&(i=e.ref),e.key!==void 0&&(s=""+e.key),e)qi.call(e,n)&&!Gi.hasOwnProperty(n)&&(a[n]=e[n]);var o=arguments.length-2;if(o===1)a.children=r;else if(1<o){for(var d=Array(o),p=0;p<o;p++)d[p]=arguments[p+2];a.children=d}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)a[n]===void 0&&(a[n]=o[n]);return{$$typeof:Yt,type:t,key:s,ref:i,props:a,_owner:Da.current}}function Eg(t,e){return{$$typeof:Yt,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Ma(t){return typeof t=="object"&&t!==null&&t.$$typeof===Yt}function xg(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Fi=/\/+/g;function Aa(t,e){return typeof t=="object"&&t!==null&&t.key!=null?xg(""+t.key):e.toString(36)}function Br(t,e,r,n,a){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var i=!1;if(t===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case Yt:case fg:i=!0}}if(i)return i=t,a=a(i),t=n===""?"."+Aa(i,0):n,Ui(a)?(r="",t!=null&&(r=t.replace(Fi,"$&/")+"/"),Br(a,e,r,"",function(p){return p})):a!=null&&(Ma(a)&&(a=Eg(a,r+(!a.key||i&&i.key===a.key?"":(""+a.key).replace(Fi,"$&/")+"/")+t)),e.push(a)),1;if(i=0,n=n===""?".":n+":",Ui(t))for(var o=0;o<t.length;o++){s=t[o];var d=n+Aa(s,o);i+=Br(s,e,r,d,a)}else if(d=Pg(t),typeof d=="function")for(t=d.call(t),o=0;!(s=t.next()).done;)s=s.value,d=n+Aa(s,o++),i+=Br(s,e,r,d,a);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return i}function Rr(t,e,r){if(t==null)return t;var n=[],a=0;return Br(t,n,"","",function(s){return e.call(r,s,a++)}),n}function Sg(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var he={current:null},Dr={transition:null},wg={ReactCurrentDispatcher:he,ReactCurrentBatchConfig:Dr,ReactCurrentOwner:Da};function Ji(){throw Error("act(...) is not supported in production builds of React.")}N.Children={map:Rr,forEach:function(t,e,r){Rr(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Rr(t,function(){e++}),e},toArray:function(t){return Rr(t,function(e){return e})||[]},only:function(t){if(!Ma(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};N.Component=Et;N.Fragment=pg;N.Profiler=mg;N.PureComponent=Ra;N.StrictMode=gg;N.Suspense=_g;N.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wg;N.act=Ji;N.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=zi({},t.props),a=t.key,s=t.ref,i=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,i=Da.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(d in e)qi.call(e,d)&&!Gi.hasOwnProperty(d)&&(n[d]=e[d]===void 0&&o!==void 0?o[d]:e[d])}var d=arguments.length-2;if(d===1)n.children=r;else if(1<d){o=Array(d);for(var p=0;p<d;p++)o[p]=arguments[p+2];n.children=o}return{$$typeof:Yt,type:t.type,key:a,ref:s,props:n,_owner:i}};N.createContext=function(t){return t={$$typeof:yg,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:hg,_context:t},t.Consumer=t};N.createElement=Wi;N.createFactory=function(t){var e=Wi.bind(null,t);return e.type=t,e};N.createRef=function(){return{current:null}};N.forwardRef=function(t){return{$$typeof:vg,render:t}};N.isValidElement=Ma;N.lazy=function(t){return{$$typeof:Tg,_payload:{_status:-1,_result:t},_init:Sg}};N.memo=function(t,e){return{$$typeof:bg,type:t,compare:e===void 0?null:e}};N.startTransition=function(t){var e=Dr.transition;Dr.transition={};try{t()}finally{Dr.transition=e}};N.unstable_act=Ji;N.useCallback=function(t,e){return he.current.useCallback(t,e)};N.useContext=function(t){return he.current.useContext(t)};N.useDebugValue=function(){};N.useDeferredValue=function(t){return he.current.useDeferredValue(t)};N.useEffect=function(t,e){return he.current.useEffect(t,e)};N.useId=function(){return he.current.useId()};N.useImperativeHandle=function(t,e,r){return he.current.useImperativeHandle(t,e,r)};N.useInsertionEffect=function(t,e){return he.current.useInsertionEffect(t,e)};N.useLayoutEffect=function(t,e){return he.current.useLayoutEffect(t,e)};N.useMemo=function(t,e){return he.current.useMemo(t,e)};N.useReducer=function(t,e,r){return he.current.useReducer(t,e,r)};N.useRef=function(t){return he.current.useRef(t)};N.useState=function(t){return he.current.useState(t)};N.useSyncExternalStore=function(t,e,r){return he.current.useSyncExternalStore(t,e,r)};N.useTransition=function(){return he.current.useTransition()};N.version="18.3.1"});var Xi=Za(($,Mr)=>{"use strict";process.env.NODE_ENV!=="production"&&function(){"use strict";typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",e=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),P=Symbol.for("react.offscreen"),D=Symbol.iterator,K="@@iterator";function G(c){if(c===null||typeof c!="object")return null;var f=D&&c[D]||c[K];return typeof f=="function"?f:null}var se={current:null},q={transition:null},H={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},J={current:null},ce={},Le=null;function Xe(c){Le=c}ce.setExtraStackFrame=function(c){Le=c},ce.getCurrentStack=null,ce.getStackAddendum=function(){var c="";Le&&(c+=Le);var f=ce.getCurrentStack;return f&&(c+=f()||""),c};var Oe=!1,Te=!1,fa=!1,pa=!1,Pe=!1,_e={ReactCurrentDispatcher:se,ReactCurrentBatchConfig:q,ReactCurrentOwner:J};_e.ReactDebugCurrentFrame=ce,_e.ReactCurrentActQueue=H;function Ee(c){{for(var f=arguments.length,g=new Array(f>1?f-1:0),h=1;h<f;h++)g[h-1]=arguments[h];Ce("warn",c,g)}}function j(c){{for(var f=arguments.length,g=new Array(f>1?f-1:0),h=1;h<f;h++)g[h-1]=arguments[h];Ce("error",c,g)}}function Ce(c,f,g){{var h=_e.ReactDebugCurrentFrame,b=h.getStackAddendum();b!==""&&(f+="%s",g=g.concat([b]));var I=g.map(function(w){return String(w)});I.unshift("Warning: "+f),Function.prototype.apply.call(console[c],console,I)}}var ke={};function ze(c,f){{var g=c.constructor,h=g&&(g.displayName||g.name)||"ReactClass",b=h+"."+f;if(ke[b])return;j("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",f,h),ke[b]=!0}}var ei={isMounted:function(c){return!1},enqueueForceUpdate:function(c,f,g){ze(c,"forceUpdate")},enqueueReplaceState:function(c,f,g,h){ze(c,"replaceState")},enqueueSetState:function(c,f,g,h){ze(c,"setState")}},Re=Object.assign,ga={};Object.freeze(ga);function Qe(c,f,g){this.props=c,this.context=f,this.refs=ga,this.updater=g||ei}Qe.prototype.isReactComponent={},Qe.prototype.setState=function(c,f){if(typeof c!="object"&&typeof c!="function"&&c!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,c,f,"setState")},Qe.prototype.forceUpdate=function(c){this.updater.enqueueForceUpdate(this,c,"forceUpdate")};{var ma={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Qf=function(c,f){Object.defineProperty(Qe.prototype,c,{get:function(){Ee("%s(...) is deprecated in plain JavaScript React classes. %s",f[0],f[1])}})};for(var ha in ma)ma.hasOwnProperty(ha)&&Qf(ha,ma[ha])}function ti(){}ti.prototype=Qe.prototype;function ya(c,f,g){this.props=c,this.context=f,this.refs=ga,this.updater=g||ei}var va=ya.prototype=new ti;va.constructor=ya,Re(va,Qe.prototype),va.isPureReactComponent=!0;function ep(){var c={current:null};return Object.seal(c),c}var tp=Array.isArray;function Tr(c){return tp(c)}function rp(c){{var f=typeof Symbol=="function"&&Symbol.toStringTag,g=f&&c[Symbol.toStringTag]||c.constructor.name||"Object";return g}}function np(c){try{return ri(c),!1}catch{return!0}}function ri(c){return""+c}function Pr(c){if(np(c))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rp(c)),ri(c)}function ap(c,f,g){var h=c.displayName;if(h)return h;var b=f.displayName||f.name||"";return b!==""?g+"("+b+")":g}function ni(c){return c.displayName||"Context"}function Ke(c){if(c==null)return null;if(typeof c.tag=="number"&&j("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case a:return"StrictMode";case p:return"Suspense";case y:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case o:var f=c;return ni(f)+".Consumer";case i:var g=c;return ni(g._context)+".Provider";case d:return ap(c,c.render,"ForwardRef");case T:var h=c.displayName||null;return h!==null?h:Ke(c.type)||"Memo";case k:{var b=c,I=b._payload,w=b._init;try{return Ke(w(I))}catch{return null}}}return null}var qt=Object.prototype.hasOwnProperty,ai={key:!0,ref:!0,__self:!0,__source:!0},si,ii,_a;_a={};function oi(c){if(qt.call(c,"ref")){var f=Object.getOwnPropertyDescriptor(c,"ref").get;if(f&&f.isReactWarning)return!1}return c.ref!==void 0}function ui(c){if(qt.call(c,"key")){var f=Object.getOwnPropertyDescriptor(c,"key").get;if(f&&f.isReactWarning)return!1}return c.key!==void 0}function sp(c,f){var g=function(){si||(si=!0,j("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(c,"key",{get:g,configurable:!0})}function ip(c,f){var g=function(){ii||(ii=!0,j("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};g.isReactWarning=!0,Object.defineProperty(c,"ref",{get:g,configurable:!0})}function op(c){if(typeof c.ref=="string"&&J.current&&c.__self&&J.current.stateNode!==c.__self){var f=Ke(J.current.type);_a[f]||(j('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',f,c.ref),_a[f]=!0)}}var ba=function(c,f,g,h,b,I,w){var R={$$typeof:e,type:c,key:f,ref:g,props:w,_owner:I};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function up(c,f,g){var h,b={},I=null,w=null,R=null,F=null;if(f!=null){oi(f)&&(w=f.ref,op(f)),ui(f)&&(Pr(f.key),I=""+f.key),R=f.__self===void 0?null:f.__self,F=f.__source===void 0?null:f.__source;for(h in f)qt.call(f,h)&&!ai.hasOwnProperty(h)&&(b[h]=f[h])}var Y=arguments.length-2;if(Y===1)b.children=g;else if(Y>1){for(var Q=Array(Y),ee=0;ee<Y;ee++)Q[ee]=arguments[ee+2];Object.freeze&&Object.freeze(Q),b.children=Q}if(c&&c.defaultProps){var re=c.defaultProps;for(h in re)b[h]===void 0&&(b[h]=re[h])}if(I||w){var oe=typeof c=="function"?c.displayName||c.name||"Unknown":c;I&&sp(b,oe),w&&ip(b,oe)}return ba(c,I,w,R,F,J.current,b)}function cp(c,f){var g=ba(c.type,f,c.ref,c._self,c._source,c._owner,c.props);return g}function lp(c,f,g){if(c==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+c+".");var h,b=Re({},c.props),I=c.key,w=c.ref,R=c._self,F=c._source,Y=c._owner;if(f!=null){oi(f)&&(w=f.ref,Y=J.current),ui(f)&&(Pr(f.key),I=""+f.key);var Q;c.type&&c.type.defaultProps&&(Q=c.type.defaultProps);for(h in f)qt.call(f,h)&&!ai.hasOwnProperty(h)&&(f[h]===void 0&&Q!==void 0?b[h]=Q[h]:b[h]=f[h])}var ee=arguments.length-2;if(ee===1)b.children=g;else if(ee>1){for(var re=Array(ee),oe=0;oe<ee;oe++)re[oe]=arguments[oe+2];b.children=re}return ba(c.type,I,w,R,F,Y,b)}function bt(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}var ci=".",dp=":";function fp(c){var f=/[=:]/g,g={"=":"=0",":":"=2"},h=c.replace(f,function(b){return g[b]});return"$"+h}var li=!1,pp=/\/+/g;function di(c){return c.replace(pp,"$&/")}function Ta(c,f){return typeof c=="object"&&c!==null&&c.key!=null?(Pr(c.key),fp(""+c.key)):f.toString(36)}function Er(c,f,g,h,b){var I=typeof c;(I==="undefined"||I==="boolean")&&(c=null);var w=!1;if(c===null)w=!0;else switch(I){case"string":case"number":w=!0;break;case"object":switch(c.$$typeof){case e:case r:w=!0}}if(w){var R=c,F=b(R),Y=h===""?ci+Ta(R,0):h;if(Tr(F)){var Q="";Y!=null&&(Q=di(Y)+"/"),Er(F,f,Q,"",function(sg){return sg})}else F!=null&&(bt(F)&&(F.key&&(!R||R.key!==F.key)&&Pr(F.key),F=cp(F,g+(F.key&&(!R||R.key!==F.key)?di(""+F.key)+"/":"")+Y)),f.push(F));return 1}var ee,re,oe=0,de=h===""?ci:h+dp;if(Tr(c))for(var Zr=0;Zr<c.length;Zr++)ee=c[Zr],re=de+Ta(ee,Zr),oe+=Er(ee,f,g,re,b);else{var Ia=G(c);if(typeof Ia=="function"){var Mi=c;Ia===Mi.entries&&(li||Ee("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),li=!0);for(var ng=Ia.call(Mi),ji,ag=0;!(ji=ng.next()).done;)ee=ji.value,re=de+Ta(ee,ag++),oe+=Er(ee,f,g,re,b)}else if(I==="object"){var Hi=String(c);throw new Error("Objects are not valid as a React child (found: "+(Hi==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":Hi)+"). If you meant to render a collection of children, use an array instead.")}}return oe}function xr(c,f,g){if(c==null)return c;var h=[],b=0;return Er(c,h,"","",function(I){return f.call(g,I,b++)}),h}function gp(c){var f=0;return xr(c,function(){f++}),f}function mp(c,f,g){xr(c,function(){f.apply(this,arguments)},g)}function hp(c){return xr(c,function(f){return f})||[]}function yp(c){if(!bt(c))throw new Error("React.Children.only expected to receive a single React element child.");return c}function vp(c){var f={$$typeof:o,_currentValue:c,_currentValue2:c,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};f.Provider={$$typeof:i,_context:f};var g=!1,h=!1,b=!1;{var I={$$typeof:o,_context:f};Object.defineProperties(I,{Provider:{get:function(){return h||(h=!0,j("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),f.Provider},set:function(w){f.Provider=w}},_currentValue:{get:function(){return f._currentValue},set:function(w){f._currentValue=w}},_currentValue2:{get:function(){return f._currentValue2},set:function(w){f._currentValue2=w}},_threadCount:{get:function(){return f._threadCount},set:function(w){f._threadCount=w}},Consumer:{get:function(){return g||(g=!0,j("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),f.Consumer}},displayName:{get:function(){return f.displayName},set:function(w){b||(Ee("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",w),b=!0)}}}),f.Consumer=I}return f._currentRenderer=null,f._currentRenderer2=null,f}var Gt=-1,Pa=0,fi=1,_p=2;function bp(c){if(c._status===Gt){var f=c._result,g=f();if(g.then(function(I){if(c._status===Pa||c._status===Gt){var w=c;w._status=fi,w._result=I}},function(I){if(c._status===Pa||c._status===Gt){var w=c;w._status=_p,w._result=I}}),c._status===Gt){var h=c;h._status=Pa,h._result=g}}if(c._status===fi){var b=c._result;return b===void 0&&j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
2
2
|
|
|
3
3
|
Your code should look like:
|
|
4
4
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -6,38 +6,38 @@ Your code should look like:
|
|
|
6
6
|
Did you accidentally put curly braces around the import?`,b),"default"in b||j(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
7
7
|
|
|
8
8
|
Your code should look like:
|
|
9
|
-
const MyComponent = lazy(() => import('./MyComponent'))`,b),b.default}else throw c._result}function
|
|
9
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,b),b.default}else throw c._result}function Tp(c){var f={_status:Gt,_result:c},g={$$typeof:k,_payload:f,_init:bp};{var h,b;Object.defineProperties(g,{defaultProps:{configurable:!0,get:function(){return h},set:function(I){j("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),h=I,Object.defineProperty(g,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return b},set:function(I){j("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),b=I,Object.defineProperty(g,"propTypes",{enumerable:!0})}}})}return g}function Pp(c){c!=null&&c.$$typeof===T?j("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof c!="function"?j("forwardRef requires a render function but was given %s.",c===null?"null":typeof c):c.length!==0&&c.length!==2&&j("forwardRef render functions accept exactly two parameters: props and ref. %s",c.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),c!=null&&(c.defaultProps!=null||c.propTypes!=null)&&j("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");var f={$$typeof:d,render:c};{var g;Object.defineProperty(f,"displayName",{enumerable:!1,configurable:!0,get:function(){return g},set:function(h){g=h,!c.name&&!c.displayName&&(c.displayName=h)}})}return f}var pi;pi=Symbol.for("react.module.reference");function gi(c){return!!(typeof c=="string"||typeof c=="function"||c===n||c===s||Pe||c===a||c===p||c===y||pa||c===P||Oe||Te||fa||typeof c=="object"&&c!==null&&(c.$$typeof===k||c.$$typeof===T||c.$$typeof===i||c.$$typeof===o||c.$$typeof===d||c.$$typeof===pi||c.getModuleId!==void 0))}function Ep(c,f){gi(c)||j("memo: The first argument must be a component. Instead received: %s",c===null?"null":typeof c);var g={$$typeof:T,type:c,compare:f===void 0?null:f};{var h;Object.defineProperty(g,"displayName",{enumerable:!1,configurable:!0,get:function(){return h},set:function(b){h=b,!c.name&&!c.displayName&&(c.displayName=b)}})}return g}function me(){var c=se.current;return c===null&&j(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
10
10
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
11
11
|
2. You might be breaking the Rules of Hooks
|
|
12
12
|
3. You might have more than one copy of React in the same app
|
|
13
|
-
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),c}function
|
|
14
|
-
`+
|
|
13
|
+
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`),c}function xp(c){var f=me();if(c._context!==void 0){var g=c._context;g.Consumer===c?j("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):g.Provider===c&&j("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return f.useContext(c)}function Sp(c){var f=me();return f.useState(c)}function wp(c,f,g){var h=me();return h.useReducer(c,f,g)}function kp(c){var f=me();return f.useRef(c)}function Op(c,f){var g=me();return g.useEffect(c,f)}function Cp(c,f){var g=me();return g.useInsertionEffect(c,f)}function Ip(c,f){var g=me();return g.useLayoutEffect(c,f)}function Zp(c,f){var g=me();return g.useCallback(c,f)}function Ap(c,f){var g=me();return g.useMemo(c,f)}function Rp(c,f,g){var h=me();return h.useImperativeHandle(c,f,g)}function Bp(c,f){{var g=me();return g.useDebugValue(c,f)}}function Dp(){var c=me();return c.useTransition()}function Mp(c){var f=me();return f.useDeferredValue(c)}function jp(){var c=me();return c.useId()}function Hp(c,f,g){var h=me();return h.useSyncExternalStore(c,f,g)}var Wt=0,mi,hi,yi,vi,_i,bi,Ti;function Pi(){}Pi.__reactDisabledLog=!0;function Np(){{if(Wt===0){mi=console.log,hi=console.info,yi=console.warn,vi=console.error,_i=console.group,bi=console.groupCollapsed,Ti=console.groupEnd;var c={configurable:!0,enumerable:!0,value:Pi,writable:!0};Object.defineProperties(console,{info:c,log:c,warn:c,error:c,group:c,groupCollapsed:c,groupEnd:c})}Wt++}}function $p(){{if(Wt--,Wt===0){var c={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Re({},c,{value:mi}),info:Re({},c,{value:hi}),warn:Re({},c,{value:yi}),error:Re({},c,{value:vi}),group:Re({},c,{value:_i}),groupCollapsed:Re({},c,{value:bi}),groupEnd:Re({},c,{value:Ti})})}Wt<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ea=_e.ReactCurrentDispatcher,xa;function Sr(c,f,g){{if(xa===void 0)try{throw Error()}catch(b){var h=b.stack.trim().match(/\n( *(at )?)/);xa=h&&h[1]||""}return`
|
|
14
|
+
`+xa+c}}var Sa=!1,wr;{var Up=typeof WeakMap=="function"?WeakMap:Map;wr=new Up}function Ei(c,f){if(!c||Sa)return"";{var g=wr.get(c);if(g!==void 0)return g}var h;Sa=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var I;I=Ea.current,Ea.current=null,Np();try{if(f){var w=function(){throw Error()};if(Object.defineProperty(w.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(w,[])}catch(de){h=de}Reflect.construct(c,[],w)}else{try{w.call()}catch(de){h=de}c.call(w.prototype)}}else{try{throw Error()}catch(de){h=de}c()}}catch(de){if(de&&h&&typeof de.stack=="string"){for(var R=de.stack.split(`
|
|
15
15
|
`),F=h.stack.split(`
|
|
16
|
-
`),
|
|
17
|
-
`+R[
|
|
16
|
+
`),Y=R.length-1,Q=F.length-1;Y>=1&&Q>=0&&R[Y]!==F[Q];)Q--;for(;Y>=1&&Q>=0;Y--,Q--)if(R[Y]!==F[Q]){if(Y!==1||Q!==1)do if(Y--,Q--,Q<0||R[Y]!==F[Q]){var ee=`
|
|
17
|
+
`+R[Y].replace(" at new "," at ");return c.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",c.displayName)),typeof c=="function"&&wr.set(c,ee),ee}while(Y>=1&&Q>=0);break}}}finally{Sa=!1,Ea.current=I,$p(),Error.prepareStackTrace=b}var re=c?c.displayName||c.name:"",oe=re?Sr(re):"";return typeof c=="function"&&wr.set(c,oe),oe}function Fp(c,f,g){return Ei(c,!1)}function Lp(c){var f=c.prototype;return!!(f&&f.isReactComponent)}function kr(c,f,g){if(c==null)return"";if(typeof c=="function")return Ei(c,Lp(c));if(typeof c=="string")return Sr(c);switch(c){case p:return Sr("Suspense");case y:return Sr("SuspenseList")}if(typeof c=="object")switch(c.$$typeof){case d:return Fp(c.render);case T:return kr(c.type,f,g);case k:{var h=c,b=h._payload,I=h._init;try{return kr(I(b),f,g)}catch{}}}return""}var xi={},Si=_e.ReactDebugCurrentFrame;function Or(c){if(c){var f=c._owner,g=kr(c.type,c._source,f?f.type:null);Si.setExtraStackFrame(g)}else Si.setExtraStackFrame(null)}function zp(c,f,g,h,b){{var I=Function.call.bind(qt);for(var w in c)if(I(c,w)){var R=void 0;try{if(typeof c[w]!="function"){var F=Error((h||"React class")+": "+g+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof c[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw F.name="Invariant Violation",F}R=c[w](f,w,h,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Y){R=Y}R&&!(R instanceof Error)&&(Or(b),j("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",h||"React class",g,w,typeof R),Or(null)),R instanceof Error&&!(R.message in xi)&&(xi[R.message]=!0,Or(b),j("Failed %s type: %s",g,R.message),Or(null))}}}function Tt(c){if(c){var f=c._owner,g=kr(c.type,c._source,f?f.type:null);Xe(g)}else Xe(null)}var wa;wa=!1;function wi(){if(J.current){var c=Ke(J.current.type);if(c)return`
|
|
18
18
|
|
|
19
|
-
Check the render method of \``+c+"`."}return""}function
|
|
19
|
+
Check the render method of \``+c+"`."}return""}function Kp(c){if(c!==void 0){var f=c.fileName.replace(/^.*[\\\/]/,""),g=c.lineNumber;return`
|
|
20
20
|
|
|
21
|
-
Check your code at `+f+":"+g+"."}return""}function
|
|
21
|
+
Check your code at `+f+":"+g+"."}return""}function Vp(c){return c!=null?Kp(c.__source):""}var ki={};function qp(c){var f=wi();if(!f){var g=typeof c=="string"?c:c.displayName||c.name;g&&(f=`
|
|
22
22
|
|
|
23
|
-
Check the top-level render call using <`+g+">.")}return f}function ki(c,f){if(!(!c._store||c._store.validated||c.key!=null)){c._store.validated=!0;var g=Vp(f);if(!wi[g]){wi[g]=!0;var h="";c&&c._owner&&c._owner!==W.current&&(h=" It was passed a child from "+Ke(c._owner.type)+"."),bt(c),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,h),bt(null)}}}function Oi(c,f){if(typeof c=="object"){if(_r(c))for(var g=0;g<c.length;g++){var h=c[g];_t(h)&&ki(h,f)}else if(_t(c))c._store&&(c._store.validated=!0);else if(c){var b=q(c);if(typeof b=="function"&&b!==c.entries)for(var I=b.call(c),w;!(w=I.next()).done;)_t(w.value)&&ki(w.value,f)}}}function Ci(c){{var f=c.type;if(f==null||typeof f=="string")return;var g;if(typeof f=="function")g=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===d||f.$$typeof===T))g=f.propTypes;else return;if(g){var h=Ke(f);Lp(g,c.props,"prop",h,c)}else if(f.PropTypes!==void 0&&!Sa){Sa=!0;var b=Ke(f);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function qp(c){{for(var f=Object.keys(c.props),g=0;g<f.length;g++){var h=f[g];if(h!=="children"&&h!=="key"){bt(c),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),bt(null);break}}c.ref!==null&&(bt(c),j("Invalid attribute `ref` supplied to `React.Fragment`."),bt(null))}}function Ii(c,f,g){var h=pi(c);if(!h){var b="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(b+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=Kp(f);I?b+=I:b+=Si();var w;c===null?w="null":_r(c)?w="array":c!==void 0&&c.$$typeof===e?(w="<"+(Ke(c.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):w=typeof c,j("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,b)}var R=op.apply(this,arguments);if(R==null)return R;if(h)for(var F=2;F<arguments.length;F++)Oi(arguments[F],c);return c===n?qp(R):Ci(R),R}var Zi=!1;function Gp(c){var f=Ii.bind(null,c);return f.type=c,Zi||(Zi=!0,Ee("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(f,"type",{enumerable:!1,get:function(){return Ee("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:c}),c}}),f}function Wp(c,f,g){for(var h=cp.apply(this,arguments),b=2;b<arguments.length;b++)Oi(arguments[b],h.type);return Ci(h),h}function Jp(c,f){var g=V.transition;V.transition={};var h=V.transition;V.transition._updatedFibers=new Set;try{c()}finally{if(V.transition=g,g===null&&h._updatedFibers){var b=h._updatedFibers.size;b>10&&Ee("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),h._updatedFibers.clear()}}}var Ai=!1,kr=null;function Yp(c){if(kr===null)try{var f=("require"+Math.random()).slice(0,7),g=Dr&&Dr[f];kr=g.call(Dr,"timers").setImmediate}catch{kr=function(b){Ai===!1&&(Ai=!0,typeof MessageChannel>"u"&&j("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var I=new MessageChannel;I.port1.onmessage=b,I.port2.postMessage(void 0)}}return kr(c)}var Tt=0,Ri=!1;function Bi(c){{var f=Tt;Tt++,H.current===null&&(H.current=[]);var g=H.isBatchingLegacy,h;try{if(H.isBatchingLegacy=!0,h=c(),!g&&H.didScheduleLegacyUpdate){var b=H.current;b!==null&&(H.didScheduleLegacyUpdate=!1,Oa(b))}}catch(re){throw Or(f),re}finally{H.isBatchingLegacy=g}if(h!==null&&typeof h=="object"&&typeof h.then=="function"){var I=h,w=!1,R={then:function(re,oe){w=!0,I.then(function(de){Or(f),Tt===0?wa(de,re,oe):re(de)},function(de){Or(f),oe(de)})}};return!Ri&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){w||(Ri=!0,j("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),R}else{var F=h;if(Or(f),Tt===0){var J=H.current;J!==null&&(Oa(J),H.current=null);var Q={then:function(re,oe){H.current===null?(H.current=[],wa(F,re,oe)):re(F)}};return Q}else{var ee={then:function(re,oe){re(F)}};return ee}}}}function Or(c){c!==Tt-1&&j("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Tt=c}function wa(c,f,g){{var h=H.current;if(h!==null)try{Oa(h),Yp(function(){h.length===0?(H.current=null,f(c)):wa(c,f,g)})}catch(b){g(b)}else f(c)}}var ka=!1;function Oa(c){if(!ka){ka=!0;var f=0;try{for(;f<c.length;f++){var g=c[f];do g=g(!0);while(g!==null)}c.length=0}catch(h){throw c=c.slice(f+1),h}finally{ka=!1}}}var Xp=Ii,Qp=Wp,eg=Gp,tg={map:Pr,forEach:gp,count:pp,toArray:mp,only:hp};$.Children=tg,$.Component=Qe,$.Fragment=n,$.Profiler=s,$.PureComponent=ha,$.StrictMode=a,$.Suspense=p,$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_e,$.act=Bi,$.cloneElement=Qp,$.createContext=yp,$.createElement=Xp,$.createFactory=eg,$.createRef=Qf,$.forwardRef=Tp,$.isValidElement=_t,$.lazy=bp,$.memo=Pp,$.startTransition=Jp,$.unstable_act=Bi,$.useCallback=Ip,$.useContext=Ep,$.useDebugValue=Rp,$.useDeferredValue=Dp,$.useEffect=kp,$.useId=Mp,$.useImperativeHandle=Ap,$.useInsertionEffect=Op,$.useLayoutEffect=Cp,$.useMemo=Zp,$.useReducer=Sp,$.useRef=wp,$.useState=xp,$.useSyncExternalStore=jp,$.useTransition=Bp,$.version=t,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var Et=Ia((nb,Ma)=>{"use strict";process.env.NODE_ENV==="production"?Ma.exports=Ji():Ma.exports=Yi()});var eb={};Zr(eb,{BRAND:()=>wl,Bot:()=>ia,BotDefinition:()=>sa,BotLogger:()=>Ye,BotSpecificClient:()=>Ze,DIRTY:()=>it,EMPTY_PATH:()=>bl,ErrorBoundary:()=>Zt,INVALID:()=>C,Integration:()=>aa,IntegrationDefinition:()=>ta,IntegrationLogger:()=>Je,IntegrationSpecificClient:()=>zt,InterfaceDefinition:()=>oa,NEVER:()=>_f,OK:()=>pe,ParseInputLazyPath:()=>Se,ParseStatus:()=>ye,Plugin:()=>ca,PluginDefinition:()=>ua,RuntimeError:()=>la.RuntimeError,Schema:()=>B,ZodAny:()=>ur,ZodArray:()=>Dt,ZodBigInt:()=>Nn,ZodBoolean:()=>$n,ZodBranded:()=>Un,ZodCatch:()=>Fn,ZodDate:()=>Ln,ZodDefault:()=>lr,ZodDiscriminatedUnion:()=>bs,ZodEffects:()=>We,ZodEnum:()=>yt,ZodError:()=>Ie,ZodFirstPartyTypeKind:()=>hs,ZodFunction:()=>Ps,ZodIntersection:()=>zn,ZodIssueCode:()=>_,ZodLazy:()=>Kn,ZodLiteral:()=>Vn,ZodMap:()=>Es,ZodNaN:()=>xs,ZodNativeEnum:()=>qn,ZodNever:()=>qe,ZodNull:()=>Gn,ZodNullable:()=>ut,ZodNumber:()=>Wn,ZodObject:()=>ct,ZodOptional:()=>He,ZodParsedType:()=>x,ZodPipeline:()=>Jn,ZodPromise:()=>fr,ZodReadonly:()=>pr,ZodRecord:()=>Ss,ZodRef:()=>ws,ZodSchema:()=>B,ZodSet:()=>ks,ZodString:()=>ge,ZodSymbol:()=>Ms,ZodTransformer:()=>We,ZodTuple:()=>lt,ZodType:()=>B,ZodUndefined:()=>Yn,ZodUnion:()=>Xn,ZodUnknown:()=>It,ZodVoid:()=>js,ZuiForm:()=>T_,addIssueToContext:()=>E,agent:()=>xd,aimodel:()=>Cd,any:()=>$d,array:()=>zd,bigint:()=>Dd,boolean:()=>Ls,botIdHeader:()=>mr,botUserIdHeader:()=>Vs,coerce:()=>vf,configurationHeader:()=>hr,configurationTypeHeader:()=>Ws,conversation:()=>Td,createZodEnum:()=>dr,cuid2Regex:()=>Cs,cuidRegex:()=>Os,custom:()=>_s,datasource:()=>Id,date:()=>Md,datetimeRegex:()=>Ds,defaultComponentDefinitions:()=>P_,discriminatedUnion:()=>Gd,effect:()=>ss,emailRegex:()=>As,enum:()=>sf,errorUtil:()=>O,event:()=>Sd,fromJsonSchema:()=>hf,fromObject:()=>yf,function:()=>rf,getErrorMap:()=>Rt,getParsedType:()=>Me,instanceof:()=>Rd,integrationIdHeader:()=>qs,intent:()=>Od,intersection:()=>Wd,ipv4Regex:()=>Rs,ipv6Regex:()=>Bs,isAborted:()=>Yr,isApiError:()=>la.isApiError,isAsync:()=>or,isDirty:()=>Xr,isEmojiRegex:()=>Ll,isValid:()=>Bt,jsonSchemaToZui:()=>gr,knowledgebase:()=>Zd,late:()=>Ad,lazy:()=>nf,literal:()=>af,makeIssue:()=>ir,map:()=>ef,mergeObjectSchemas:()=>Ut,message:()=>Ed,messages:()=>Ks,nan:()=>Bd,nativeEnum:()=>of,never:()=>Fd,null:()=>Nd,nullable:()=>lf,number:()=>Fs,object:()=>Kd,objectToZui:()=>jt,objectUtil:()=>Wr,oboolean:()=>mf,onumber:()=>gf,operationHeader:()=>yr,optional:()=>cf,ostring:()=>pf,parseBody:()=>we,pipeline:()=>ff,preprocess:()=>df,processCreateParams:()=>A,promise:()=>uf,quotelessJson:()=>yl,readonly:()=>Qd,record:()=>Yd,ref:()=>Xd,serve:()=>vr,set:()=>tf,setErrorMap:()=>vs,strictObject:()=>Vd,string:()=>Us,symbol:()=>jd,table:()=>wd,tablerow:()=>kd,transformer:()=>ss,transforms:()=>E_,tuple:()=>Jd,typeHeader:()=>Js,ulidRegex:()=>Is,undefined:()=>Hd,union:()=>qd,unknown:()=>Ud,user:()=>Pd,util:()=>M,uuidRegex:()=>Zs,variable:()=>bd,void:()=>Ld,webhookIdHeader:()=>Gs,withErrorBoundary:()=>Ef,z:()=>S,zuiToJsonSchema:()=>Qn});module.exports=lg(eb);var Ks={};Zr(Ks,{defaults:()=>O_,markdown:()=>k_});var Zn=et(Et(),1),ne=et(Et(),1),Ne=et(Et(),1),Ht=et(Et(),1),be=et(Et(),1),is=Object.defineProperty,wg=Object.defineProperties,kg=Object.getOwnPropertyDescriptors,Vr=Object.getOwnPropertySymbols,Ro=Object.prototype.hasOwnProperty,Bo=Object.prototype.propertyIsEnumerable,Xi=(t,e,r)=>e in t?is(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l=(t,e)=>{for(var r in e||(e={}))Ro.call(e,r)&&Xi(t,r,e[r]);if(Vr)for(var r of Vr(e))Bo.call(e,r)&&Xi(t,r,e[r]);return t},m=(t,e)=>wg(t,kg(e)),u=(t,e)=>is(t,"name",{value:e,configurable:!0}),Do=(t,e)=>{var r={};for(var n in t)Ro.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&Vr)for(var n of Vr(t))e.indexOf(n)<0&&Bo.call(t,n)&&(r[n]=t[n]);return r},Mo=(t,e)=>{for(var r in e)is(t,r,{get:e[r],enumerable:!0})},S={};Mo(S,{BRAND:()=>wl,DIRTY:()=>it,EMPTY_PATH:()=>bl,INVALID:()=>C,NEVER:()=>_f,OK:()=>pe,ParseInputLazyPath:()=>Se,ParseStatus:()=>ye,Schema:()=>B,ZodAny:()=>ur,ZodArray:()=>Dt,ZodBigInt:()=>Nn,ZodBoolean:()=>$n,ZodBranded:()=>Un,ZodCatch:()=>Fn,ZodDate:()=>Ln,ZodDefault:()=>lr,ZodDiscriminatedUnion:()=>bs,ZodEffects:()=>We,ZodEnum:()=>yt,ZodError:()=>Ie,ZodFirstPartyTypeKind:()=>hs,ZodFunction:()=>Ps,ZodIntersection:()=>zn,ZodIssueCode:()=>_,ZodLazy:()=>Kn,ZodLiteral:()=>Vn,ZodMap:()=>Es,ZodNaN:()=>xs,ZodNativeEnum:()=>qn,ZodNever:()=>qe,ZodNull:()=>Gn,ZodNullable:()=>ut,ZodNumber:()=>Wn,ZodObject:()=>ct,ZodOptional:()=>He,ZodParsedType:()=>x,ZodPipeline:()=>Jn,ZodPromise:()=>fr,ZodReadonly:()=>pr,ZodRecord:()=>Ss,ZodRef:()=>ws,ZodSchema:()=>B,ZodSet:()=>ks,ZodString:()=>ge,ZodSymbol:()=>Ms,ZodTransformer:()=>We,ZodTuple:()=>lt,ZodType:()=>B,ZodUndefined:()=>Yn,ZodUnion:()=>Xn,ZodUnknown:()=>It,ZodVoid:()=>js,addIssueToContext:()=>E,agent:()=>xd,aimodel:()=>Cd,any:()=>$d,array:()=>zd,bigint:()=>Dd,boolean:()=>Ls,coerce:()=>vf,conversation:()=>Td,createZodEnum:()=>dr,cuid2Regex:()=>Cs,cuidRegex:()=>Os,custom:()=>_s,datasource:()=>Id,date:()=>Md,datetimeRegex:()=>Ds,default:()=>Yv,discriminatedUnion:()=>Gd,effect:()=>ss,emailRegex:()=>As,enum:()=>sf,errorUtil:()=>O,event:()=>Sd,fromJsonSchema:()=>hf,fromObject:()=>yf,function:()=>rf,getErrorMap:()=>Rt,getParsedType:()=>Me,instanceof:()=>Rd,intent:()=>Od,intersection:()=>Wd,ipv4Regex:()=>Rs,ipv6Regex:()=>Bs,isAborted:()=>Yr,isAsync:()=>or,isDirty:()=>Xr,isEmojiRegex:()=>Ll,isValid:()=>Bt,jsonSchemaToZui:()=>gr,knowledgebase:()=>Zd,late:()=>Ad,lazy:()=>nf,literal:()=>af,makeIssue:()=>ir,map:()=>ef,message:()=>Ed,nan:()=>Bd,nativeEnum:()=>of,never:()=>Fd,null:()=>Nd,nullable:()=>lf,number:()=>Fs,object:()=>Kd,objectToZui:()=>jt,objectUtil:()=>Wr,oboolean:()=>mf,onumber:()=>gf,optional:()=>cf,ostring:()=>pf,pipeline:()=>ff,preprocess:()=>df,processCreateParams:()=>A,promise:()=>uf,quotelessJson:()=>yl,readonly:()=>Qd,record:()=>Yd,ref:()=>Xd,set:()=>tf,setErrorMap:()=>vs,strictObject:()=>Vd,string:()=>Us,symbol:()=>jd,table:()=>wd,tablerow:()=>kd,transformer:()=>ss,tuple:()=>Jd,ulidRegex:()=>Is,undefined:()=>Hd,union:()=>qd,unknown:()=>Ud,user:()=>Pd,util:()=>M,uuidRegex:()=>Zs,variable:()=>bd,void:()=>Ld,zuiToJsonSchema:()=>Qn});var U="x-zui",jo=(0,ne.createContext)({formData:void 0,formSchema:void 0,setFormData:u(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:u(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:u(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),Qi=u((t,e,r)=>{var n;let a=(n=e[U])==null?void 0:n[t];if(typeof a>"u")return!1;if(typeof a=="boolean")return a;if(typeof a=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+a)()(r);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),Ho=u((t,e)=>{let r=(0,ne.useContext)(jo);if(r===void 0)throw new Error("useFormData must be used within a FormDataProvider");let n=(0,ne.useMemo)(()=>at(r.formData,e),[r.formData,e]),a=(0,ne.useMemo)(()=>{var P;return r.validation.formValid===null?{formValid:null,formErrors:null}:r.validation.formValid===!1?{formValid:!1,formErrors:((P=r.validation.formErrors)==null?void 0:P.filter(D=>Uo(D.path,e)).map(D=>({message:D.message,code:D.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[r.validation.formValid,r.validation.formErrors,e]),s=r.dataTransform?r.dataTransform(n):n,i=(0,ne.useMemo)(()=>Qi("hidden",t,s),[t,s]),o=(0,ne.useMemo)(()=>Qi("disabled",t,s),[t,s]);(0,ne.useEffect)(()=>{r.setHiddenState(P=>xt(P,e,i||{})),r.setDisabledState(P=>xt(P,e,o||{}))},[JSON.stringify({fieldSchema:t,data:n})]);let{disabled:d,hidden:p}=(0,ne.useMemo)(()=>{let P=i===!0||at(r.hiddenState,e),D=o===!0||at(r.disabledState,e);return{hidden:P===!0,disabled:D===!0}},[r.hiddenState,r.disabledState,i,o,e]),y=(0,ne.useCallback)((P,D)=>{r.setFormData(z=>xt(z,P,D))},[r.setFormData]),T=(0,ne.useCallback)((P,D=void 0)=>{let z=Ct(t.items);r.setFormData(q=>{let se=at(q,P)||[];return D===void 0&&(D=z),xt(q,P,Array.isArray(se)?[...se,D]:[D])})},[r.setFormData]),k=(0,ne.useCallback)((P,D)=>{r.setFormData(z=>{let q=at(z,P)||[];return Array.isArray(q)?(q.splice(D,1),xt(z,P,q)):z})},[r.setFormData]);return l(m(l({},r),{data:n,disabled:d,hidden:p,handlePropertyChange:y,addArrayItem:T,removeArrayItem:k}),a)},"useFormData");function xt(t,e,r){if(e.length===0)return r;let n=e.length;return e.reduce((a,s,i)=>(i===n-1?a[s]=r:a[s]||(a[s]=isNaN(Number(s))?{}:[]),a[s]),t??{}),l({},t)}u(xt,"setObjectPath");var Ct=u((t,e)=>{var r,n,a,s;if(Array.isArray(t))return Ct(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((r=t.anyOf)!=null&&r.length)return Ct(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([o,d])=>{var p;i[o]=Ct(d,!((p=t.required)!=null&&p.includes(o))||No(d)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[Ct(t.items)]:[];if(t.type==="string")return(n=t.enum)!=null&&n.length?t.enum[0]:"";if(t.type==="number")return(a=t.enum)!=null&&a.length?t.enum[0]:0;if(t.type==="boolean")return(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),Og=u(({children:t,setFormData:e,formData:r,formSchema:n,disableValidation:a,onValidation:s,dataTransform:i})=>{let[o,d]=(0,ne.useState)({}),[p,y]=(0,ne.useState)({}),T=i?i(r):r,k=(0,ne.useMemo)(()=>{if(a)return{formValid:null,formErrors:null};if(!n)return{formValid:null,formErrors:null};let P=gr(n).safeParse(T);return P.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:P.error.issues}},[JSON.stringify({transformedData:T})]);return(0,ne.useEffect)(()=>{s&&s(k)},[k]),ne.default.createElement(jo.Provider,{value:{formData:r,setFormData:e,formSchema:n,validation:k,hiddenState:o,setHiddenState:d,disabledState:p,setDisabledState:y,dataTransform:i}},t)},"FormDataProvider");function at(t,e){return e.reduce((r,n)=>r?r[n]:null,t)}u(at,"getPathData");function No(t){var e;return((e=t.anyOf)==null?void 0:e.some(r=>r.not&&Object.keys(r.not).length===0))||!1}u(No,"isOptional");function qr(t,e){let r=l({},t);for(let n in e)e.hasOwnProperty(n)&&(typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])?typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?r[n]=qr(r[n],e[n]):r[n]=qr({},e[n]):r[n]=e[n]);return r}u(qr,"deepMerge");var Cg=u((t,e)=>{let{handlePropertyChange:r,data:n}=Ho(t,e),{discriminator:a,value:s,discriminatedSchema:i}=(0,Zn.useMemo)(()=>{let o=$o(t.anyOf),d=o?.key?n?.[o.key]:t.default||null,p=Ig(o?.key||null,d,t.anyOf);return{discriminator:o,value:d,discriminatedSchema:p}},[t.anyOf,n]);return(0,Zn.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(n||{}).length<1&&!t.default&&r(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),$o=u(t=>{let e=t?.map(r=>r.type!=="object"||!r.properties?null:Object.entries(r.properties).map(([n,a])=>{var s;return a.type==="string"&&((s=a.enum)!=null&&s.length)?{key:n,value:a.enum[0]}:null}).filter(n=>!!n)).flat().reduce((r,n)=>{if(!n)return r;let{key:a,value:s}=n;return r.key===null&&(r.key=a),r.key===a&&r.values.push(s),r},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Ig=u((t,e,r)=>{var n,a;if(!r?.length||!t||!e)return null;for(let s of r){if(s.type!=="object")continue;let i=(n=s.properties)==null?void 0:n[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return m(l({},s),{properties:m(l({},s.properties),{[t]:m(l({},i),{[U]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Zg=u(t=>{var e;return(e=t.anyOf)!=null&&e.length?$o(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),Ag=u((t,e)=>{var r,n,a;let s=Zg(e),i=((r=e[U])==null?void 0:r.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let y=(n=t?.[s])==null?void 0:n.default;return y?{Component:y,type:s,id:"default",params:{}}:null}let o=i[0],d=((a=t?.[s])==null?void 0:a[o])||null;if(!d)return console.warn(`Component ${s}.${o} not found`),null;let p=i[1]||{};return{Component:d,type:s,id:o,params:p}},"resolveComponent");function Uo(t,e){return t.length!==e.length?!1:t.every((r,n)=>r===e[n])}u(Uo,"pathMatches");function Ua(t,e){return e||(e=new RegExp("/s|-|_| ","g")),zo(t).split(e).map(Fo).map(Ko).reduce(Lo)}u(Ua,"formatTitle");function Fo(t){return t.charAt(0).toUpperCase()+t.substring(1)}u(Fo,"capitalize");function Lo(t,e){return`${t} ${e}`}u(Lo,"combine");function zo(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}u(zo,"decamelize");function Ko(t,e,r){let n=t.toLowerCase(),a=t.toUpperCase();for(let s of jg)if(s.toLowerCase()===n)return s;return Rg.includes(a)?a:e===0||e===r.length-1||t.length>=4?t:Mg.includes(n)||Dg.includes(n)||Bg.includes(n)?n:t}u(Ko,"handleSpecialWords");var Rg=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],Bg=["a","an","the"],Dg=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],Mg=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],jg=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function Vo(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:je(t)}u(Vo,"primitiveToTypscriptLiteralType");function je(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${je(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}u(je,"primitiveToTypescriptValue");function qo(t){return typeof t>"u"?"undefined":JSON.stringify(t)}u(qo,"unknownToTypescriptValue");var eo=u(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:je(t),"toPropertyKey"),Hg=u(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),Go=u(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Hg).filter(n=>!!n).join("")},"toTypeArgumentName"),Z=u(t=>{let e=(t??"").split(`
|
|
23
|
+
Check the top-level render call using <`+g+">.")}return f}function Oi(c,f){if(!(!c._store||c._store.validated||c.key!=null)){c._store.validated=!0;var g=qp(f);if(!ki[g]){ki[g]=!0;var h="";c&&c._owner&&c._owner!==J.current&&(h=" It was passed a child from "+Ke(c._owner.type)+"."),Tt(c),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,h),Tt(null)}}}function Ci(c,f){if(typeof c=="object"){if(Tr(c))for(var g=0;g<c.length;g++){var h=c[g];bt(h)&&Oi(h,f)}else if(bt(c))c._store&&(c._store.validated=!0);else if(c){var b=G(c);if(typeof b=="function"&&b!==c.entries)for(var I=b.call(c),w;!(w=I.next()).done;)bt(w.value)&&Oi(w.value,f)}}}function Ii(c){{var f=c.type;if(f==null||typeof f=="string")return;var g;if(typeof f=="function")g=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===d||f.$$typeof===T))g=f.propTypes;else return;if(g){var h=Ke(f);zp(g,c.props,"prop",h,c)}else if(f.PropTypes!==void 0&&!wa){wa=!0;var b=Ke(f);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Gp(c){{for(var f=Object.keys(c.props),g=0;g<f.length;g++){var h=f[g];if(h!=="children"&&h!=="key"){Tt(c),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),Tt(null);break}}c.ref!==null&&(Tt(c),j("Invalid attribute `ref` supplied to `React.Fragment`."),Tt(null))}}function Zi(c,f,g){var h=gi(c);if(!h){var b="";(c===void 0||typeof c=="object"&&c!==null&&Object.keys(c).length===0)&&(b+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=Vp(f);I?b+=I:b+=wi();var w;c===null?w="null":Tr(c)?w="array":c!==void 0&&c.$$typeof===e?(w="<"+(Ke(c.type)||"Unknown")+" />",b=" Did you accidentally export a JSX literal instead of a component?"):w=typeof c,j("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",w,b)}var R=up.apply(this,arguments);if(R==null)return R;if(h)for(var F=2;F<arguments.length;F++)Ci(arguments[F],c);return c===n?Gp(R):Ii(R),R}var Ai=!1;function Wp(c){var f=Zi.bind(null,c);return f.type=c,Ai||(Ai=!0,Ee("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(f,"type",{enumerable:!1,get:function(){return Ee("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:c}),c}}),f}function Jp(c,f,g){for(var h=lp.apply(this,arguments),b=2;b<arguments.length;b++)Ci(arguments[b],h.type);return Ii(h),h}function Yp(c,f){var g=q.transition;q.transition={};var h=q.transition;q.transition._updatedFibers=new Set;try{c()}finally{if(q.transition=g,g===null&&h._updatedFibers){var b=h._updatedFibers.size;b>10&&Ee("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),h._updatedFibers.clear()}}}var Ri=!1,Cr=null;function Xp(c){if(Cr===null)try{var f=("require"+Math.random()).slice(0,7),g=Mr&&Mr[f];Cr=g.call(Mr,"timers").setImmediate}catch{Cr=function(b){Ri===!1&&(Ri=!0,typeof MessageChannel>"u"&&j("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var I=new MessageChannel;I.port1.onmessage=b,I.port2.postMessage(void 0)}}return Cr(c)}var Pt=0,Bi=!1;function Di(c){{var f=Pt;Pt++,H.current===null&&(H.current=[]);var g=H.isBatchingLegacy,h;try{if(H.isBatchingLegacy=!0,h=c(),!g&&H.didScheduleLegacyUpdate){var b=H.current;b!==null&&(H.didScheduleLegacyUpdate=!1,Ca(b))}}catch(re){throw Ir(f),re}finally{H.isBatchingLegacy=g}if(h!==null&&typeof h=="object"&&typeof h.then=="function"){var I=h,w=!1,R={then:function(re,oe){w=!0,I.then(function(de){Ir(f),Pt===0?ka(de,re,oe):re(de)},function(de){Ir(f),oe(de)})}};return!Bi&&typeof Promise<"u"&&Promise.resolve().then(function(){}).then(function(){w||(Bi=!0,j("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),R}else{var F=h;if(Ir(f),Pt===0){var Y=H.current;Y!==null&&(Ca(Y),H.current=null);var Q={then:function(re,oe){H.current===null?(H.current=[],ka(F,re,oe)):re(F)}};return Q}else{var ee={then:function(re,oe){re(F)}};return ee}}}}function Ir(c){c!==Pt-1&&j("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Pt=c}function ka(c,f,g){{var h=H.current;if(h!==null)try{Ca(h),Xp(function(){h.length===0?(H.current=null,f(c)):ka(c,f,g)})}catch(b){g(b)}else f(c)}}var Oa=!1;function Ca(c){if(!Oa){Oa=!0;var f=0;try{for(;f<c.length;f++){var g=c[f];do g=g(!0);while(g!==null)}c.length=0}catch(h){throw c=c.slice(f+1),h}finally{Oa=!1}}}var Qp=Zi,eg=Jp,tg=Wp,rg={map:xr,forEach:mp,count:gp,toArray:hp,only:yp};$.Children=rg,$.Component=Qe,$.Fragment=n,$.Profiler=s,$.PureComponent=ya,$.StrictMode=a,$.Suspense=p,$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_e,$.act=Di,$.cloneElement=eg,$.createContext=vp,$.createElement=Qp,$.createFactory=tg,$.createRef=ep,$.forwardRef=Pp,$.isValidElement=bt,$.lazy=Tp,$.memo=Ep,$.startTransition=Yp,$.unstable_act=Di,$.useCallback=Zp,$.useContext=xp,$.useDebugValue=Bp,$.useDeferredValue=Mp,$.useEffect=Op,$.useId=jp,$.useImperativeHandle=Rp,$.useInsertionEffect=Cp,$.useLayoutEffect=Ip,$.useMemo=Ap,$.useReducer=wp,$.useRef=kp,$.useState=Sp,$.useSyncExternalStore=Hp,$.useTransition=Dp,$.version=t,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()});var xt=Za((ib,ja)=>{"use strict";process.env.NODE_ENV==="production"?ja.exports=Yi():ja.exports=Xi()});var nb={};Jt(nb,{BRAND:()=>kl,Bot:()=>oa,BotDefinition:()=>ia,BotLogger:()=>Ye,BotSpecificClient:()=>Ze,DIRTY:()=>it,EMPTY_PATH:()=>Tl,ErrorBoundary:()=>At,INVALID:()=>C,Integration:()=>sa,IntegrationDefinition:()=>ra,IntegrationLogger:()=>Je,IntegrationSpecificClient:()=>Kt,InterfaceDefinition:()=>ua,NEVER:()=>bf,OK:()=>pe,ParseInputLazyPath:()=>Se,ParseStatus:()=>ye,Plugin:()=>la,PluginDefinition:()=>ca,RuntimeError:()=>da.RuntimeError,Schema:()=>B,ZodAny:()=>lr,ZodArray:()=>Mt,ZodBigInt:()=>$n,ZodBoolean:()=>Un,ZodBranded:()=>Fn,ZodCatch:()=>Ln,ZodDate:()=>zn,ZodDefault:()=>fr,ZodDiscriminatedUnion:()=>Ts,ZodEffects:()=>We,ZodEnum:()=>yt,ZodError:()=>Ie,ZodFirstPartyTypeKind:()=>ys,ZodFunction:()=>Es,ZodIntersection:()=>Kn,ZodIssueCode:()=>_,ZodLazy:()=>Vn,ZodLiteral:()=>qn,ZodMap:()=>xs,ZodNaN:()=>Ss,ZodNativeEnum:()=>Gn,ZodNever:()=>qe,ZodNull:()=>Wn,ZodNullable:()=>ut,ZodNumber:()=>Jn,ZodObject:()=>ct,ZodOptional:()=>He,ZodParsedType:()=>x,ZodPipeline:()=>Yn,ZodPromise:()=>gr,ZodReadonly:()=>mr,ZodRecord:()=>ws,ZodRef:()=>ks,ZodSchema:()=>B,ZodSet:()=>Os,ZodString:()=>ge,ZodSymbol:()=>js,ZodTransformer:()=>We,ZodTuple:()=>lt,ZodType:()=>B,ZodUndefined:()=>Xn,ZodUnion:()=>Qn,ZodUnknown:()=>Zt,ZodVoid:()=>Hs,ZuiForm:()=>P_,addIssueToContext:()=>E,agent:()=>Sd,aimodel:()=>Id,any:()=>Ud,array:()=>Kd,bigint:()=>Md,boolean:()=>zs,botIdHeader:()=>yr,botUserIdHeader:()=>qs,coerce:()=>_f,configurationHeader:()=>vr,configurationTypeHeader:()=>Js,conversation:()=>Pd,createZodEnum:()=>pr,cuid2Regex:()=>Is,cuidRegex:()=>Cs,custom:()=>bs,datasource:()=>Zd,date:()=>jd,datetimeRegex:()=>Ms,defaultComponentDefinitions:()=>E_,discriminatedUnion:()=>Wd,effect:()=>is,emailRegex:()=>Rs,enum:()=>of,errorUtil:()=>O,event:()=>wd,fromJsonSchema:()=>yf,fromObject:()=>vf,function:()=>nf,getErrorMap:()=>Bt,getParsedType:()=>Me,instanceof:()=>Bd,integrationIdHeader:()=>Gs,intent:()=>Cd,intersection:()=>Jd,ipv4Regex:()=>Bs,ipv6Regex:()=>Ds,isAborted:()=>Xr,isApiError:()=>da.isApiError,isAsync:()=>cr,isDirty:()=>Qr,isEmojiRegex:()=>zl,isValid:()=>Dt,jsonSchemaToZui:()=>hr,knowledgebase:()=>Ad,late:()=>Rd,lazy:()=>af,literal:()=>sf,makeIssue:()=>ur,map:()=>tf,mergeObjectSchemas:()=>Ft,message:()=>xd,messages:()=>Vs,nan:()=>Dd,nativeEnum:()=>uf,never:()=>Ld,null:()=>$d,nullable:()=>df,number:()=>Ls,object:()=>Vd,objectToZui:()=>Ht,objectUtil:()=>Jr,oboolean:()=>hf,onumber:()=>mf,operationHeader:()=>_r,optional:()=>lf,ostring:()=>gf,parseBody:()=>we,pipeline:()=>pf,preprocess:()=>ff,processCreateParams:()=>A,promise:()=>cf,quotelessJson:()=>vl,readonly:()=>ef,record:()=>Xd,ref:()=>Qd,serve:()=>br,set:()=>rf,setErrorMap:()=>_s,strictObject:()=>qd,string:()=>Fs,symbol:()=>Hd,table:()=>kd,tablerow:()=>Od,transformer:()=>is,transforms:()=>x_,tuple:()=>Yd,typeHeader:()=>Ys,ulidRegex:()=>Zs,undefined:()=>Nd,union:()=>Gd,unknown:()=>Fd,user:()=>Ed,util:()=>M,uuidRegex:()=>As,variable:()=>Td,void:()=>zd,webhookIdHeader:()=>Ws,withErrorBoundary:()=>xf,z:()=>S,zuiToJsonSchema:()=>ea});module.exports=dg(nb);var Vs={};Jt(Vs,{defaults:()=>C_,markdown:()=>O_});var An=et(xt(),1),ne=et(xt(),1),Ne=et(xt(),1),Nt=et(xt(),1),be=et(xt(),1),os=Object.defineProperty,kg=Object.defineProperties,Og=Object.getOwnPropertyDescriptors,qr=Object.getOwnPropertySymbols,Bo=Object.prototype.hasOwnProperty,Do=Object.prototype.propertyIsEnumerable,Qi=(t,e,r)=>e in t?os(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,l=(t,e)=>{for(var r in e||(e={}))Bo.call(e,r)&&Qi(t,r,e[r]);if(qr)for(var r of qr(e))Do.call(e,r)&&Qi(t,r,e[r]);return t},m=(t,e)=>kg(t,Og(e)),u=(t,e)=>os(t,"name",{value:e,configurable:!0}),Mo=(t,e)=>{var r={};for(var n in t)Bo.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&qr)for(var n of qr(t))e.indexOf(n)<0&&Do.call(t,n)&&(r[n]=t[n]);return r},jo=(t,e)=>{for(var r in e)os(t,r,{get:e[r],enumerable:!0})},S={};jo(S,{BRAND:()=>kl,DIRTY:()=>it,EMPTY_PATH:()=>Tl,INVALID:()=>C,NEVER:()=>bf,OK:()=>pe,ParseInputLazyPath:()=>Se,ParseStatus:()=>ye,Schema:()=>B,ZodAny:()=>lr,ZodArray:()=>Mt,ZodBigInt:()=>$n,ZodBoolean:()=>Un,ZodBranded:()=>Fn,ZodCatch:()=>Ln,ZodDate:()=>zn,ZodDefault:()=>fr,ZodDiscriminatedUnion:()=>Ts,ZodEffects:()=>We,ZodEnum:()=>yt,ZodError:()=>Ie,ZodFirstPartyTypeKind:()=>ys,ZodFunction:()=>Es,ZodIntersection:()=>Kn,ZodIssueCode:()=>_,ZodLazy:()=>Vn,ZodLiteral:()=>qn,ZodMap:()=>xs,ZodNaN:()=>Ss,ZodNativeEnum:()=>Gn,ZodNever:()=>qe,ZodNull:()=>Wn,ZodNullable:()=>ut,ZodNumber:()=>Jn,ZodObject:()=>ct,ZodOptional:()=>He,ZodParsedType:()=>x,ZodPipeline:()=>Yn,ZodPromise:()=>gr,ZodReadonly:()=>mr,ZodRecord:()=>ws,ZodRef:()=>ks,ZodSchema:()=>B,ZodSet:()=>Os,ZodString:()=>ge,ZodSymbol:()=>js,ZodTransformer:()=>We,ZodTuple:()=>lt,ZodType:()=>B,ZodUndefined:()=>Xn,ZodUnion:()=>Qn,ZodUnknown:()=>Zt,ZodVoid:()=>Hs,addIssueToContext:()=>E,agent:()=>Sd,aimodel:()=>Id,any:()=>Ud,array:()=>Kd,bigint:()=>Md,boolean:()=>zs,coerce:()=>_f,conversation:()=>Pd,createZodEnum:()=>pr,cuid2Regex:()=>Is,cuidRegex:()=>Cs,custom:()=>bs,datasource:()=>Zd,date:()=>jd,datetimeRegex:()=>Ms,default:()=>Xv,discriminatedUnion:()=>Wd,effect:()=>is,emailRegex:()=>Rs,enum:()=>of,errorUtil:()=>O,event:()=>wd,fromJsonSchema:()=>yf,fromObject:()=>vf,function:()=>nf,getErrorMap:()=>Bt,getParsedType:()=>Me,instanceof:()=>Bd,intent:()=>Cd,intersection:()=>Jd,ipv4Regex:()=>Bs,ipv6Regex:()=>Ds,isAborted:()=>Xr,isAsync:()=>cr,isDirty:()=>Qr,isEmojiRegex:()=>zl,isValid:()=>Dt,jsonSchemaToZui:()=>hr,knowledgebase:()=>Ad,late:()=>Rd,lazy:()=>af,literal:()=>sf,makeIssue:()=>ur,map:()=>tf,message:()=>xd,nan:()=>Dd,nativeEnum:()=>uf,never:()=>Ld,null:()=>$d,nullable:()=>df,number:()=>Ls,object:()=>Vd,objectToZui:()=>Ht,objectUtil:()=>Jr,oboolean:()=>hf,onumber:()=>mf,optional:()=>lf,ostring:()=>gf,pipeline:()=>pf,preprocess:()=>ff,processCreateParams:()=>A,promise:()=>cf,quotelessJson:()=>vl,readonly:()=>ef,record:()=>Xd,ref:()=>Qd,set:()=>rf,setErrorMap:()=>_s,strictObject:()=>qd,string:()=>Fs,symbol:()=>Hd,table:()=>kd,tablerow:()=>Od,transformer:()=>is,tuple:()=>Yd,ulidRegex:()=>Zs,undefined:()=>Nd,union:()=>Gd,unknown:()=>Fd,user:()=>Ed,util:()=>M,uuidRegex:()=>As,variable:()=>Td,void:()=>zd,zuiToJsonSchema:()=>ea});var U="x-zui",Ho=(0,ne.createContext)({formData:void 0,formSchema:void 0,setFormData:u(()=>{throw new Error("Must be within a FormDataProvider")},"setFormData"),setHiddenState:u(()=>{throw new Error("Must be within a FormDataProvider")},"setHiddenState"),setDisabledState:u(()=>{throw new Error("Must be within a FormDataProvider")},"setDisabledState"),hiddenState:{},disabledState:{},validation:{formValid:null,formErrors:null}}),eo=u((t,e,r)=>{var n;let a=(n=e[U])==null?void 0:n[t];if(typeof a>"u")return!1;if(typeof a=="boolean")return a;if(typeof a=="string"){if(typeof window>"u")return console.warn("Function evaluation is not supported in server side rendering"),!1;let i=new Function("return "+a)()(r);switch(typeof i){case"object":case"boolean":return i;default:return!1}}return!1},"parseMaskableField"),No=u((t,e)=>{let r=(0,ne.useContext)(Ho);if(r===void 0)throw new Error("useFormData must be used within a FormDataProvider");let n=(0,ne.useMemo)(()=>at(r.formData,e),[r.formData,e]),a=(0,ne.useMemo)(()=>{var P;return r.validation.formValid===null?{formValid:null,formErrors:null}:r.validation.formValid===!1?{formValid:!1,formErrors:((P=r.validation.formErrors)==null?void 0:P.filter(D=>Fo(D.path,e)).map(D=>({message:D.message,code:D.code,path:e})))||null}:{formValid:!0,formErrors:[]}},[r.validation.formValid,r.validation.formErrors,e]),s=r.dataTransform?r.dataTransform(n):n,i=(0,ne.useMemo)(()=>eo("hidden",t,s),[t,s]),o=(0,ne.useMemo)(()=>eo("disabled",t,s),[t,s]);(0,ne.useEffect)(()=>{r.setHiddenState(P=>St(P,e,i||{})),r.setDisabledState(P=>St(P,e,o||{}))},[JSON.stringify({fieldSchema:t,data:n})]);let{disabled:d,hidden:p}=(0,ne.useMemo)(()=>{let P=i===!0||at(r.hiddenState,e),D=o===!0||at(r.disabledState,e);return{hidden:P===!0,disabled:D===!0}},[r.hiddenState,r.disabledState,i,o,e]),y=(0,ne.useCallback)((P,D)=>{r.setFormData(K=>St(K,P,D))},[r.setFormData]),T=(0,ne.useCallback)((P,D=void 0)=>{let K=It(t.items);r.setFormData(G=>{let se=at(G,P)||[];return D===void 0&&(D=K),St(G,P,Array.isArray(se)?[...se,D]:[D])})},[r.setFormData]),k=(0,ne.useCallback)((P,D)=>{r.setFormData(K=>{let G=at(K,P)||[];return Array.isArray(G)?(G.splice(D,1),St(K,P,G)):K})},[r.setFormData]);return l(m(l({},r),{data:n,disabled:d,hidden:p,handlePropertyChange:y,addArrayItem:T,removeArrayItem:k}),a)},"useFormData");function St(t,e,r){if(e.length===0)return r;let n=e.length;return e.reduce((a,s,i)=>(i===n-1?a[s]=r:a[s]||(a[s]=isNaN(Number(s))?{}:[]),a[s]),t??{}),l({},t)}u(St,"setObjectPath");var It=u((t,e)=>{var r,n,a,s;if(Array.isArray(t))return It(t[0]);if(t.default)return t.default;if(t.nullable)return null;if(!e){if((r=t.anyOf)!=null&&r.length)return It(t.anyOf[0]);if(t.type==="object"&&t.properties){let i={};return Object.entries(t.properties).map(([o,d])=>{var p;i[o]=It(d,!((p=t.required)!=null&&p.includes(o))||$o(d)||!1)}),i}if(t.type==="array")return t.minItems&&t.minItems>0?[It(t.items)]:[];if(t.type==="string")return(n=t.enum)!=null&&n.length?t.enum[0]:"";if(t.type==="number")return(a=t.enum)!=null&&a.length?t.enum[0]:0;if(t.type==="boolean")return(s=t.enum)!=null&&s.length?t.enum[0]:!1}},"getDefaultValues"),Cg=u(({children:t,setFormData:e,formData:r,formSchema:n,disableValidation:a,onValidation:s,dataTransform:i})=>{let[o,d]=(0,ne.useState)({}),[p,y]=(0,ne.useState)({}),T=i?i(r):r,k=(0,ne.useMemo)(()=>{if(a)return{formValid:null,formErrors:null};if(!n)return{formValid:null,formErrors:null};let P=hr(n).safeParse(T);return P.success?{formValid:!0,formErrors:[]}:{formValid:!1,formErrors:P.error.issues}},[JSON.stringify({transformedData:T})]);return(0,ne.useEffect)(()=>{s&&s(k)},[k]),ne.default.createElement(Ho.Provider,{value:{formData:r,setFormData:e,formSchema:n,validation:k,hiddenState:o,setHiddenState:d,disabledState:p,setDisabledState:y,dataTransform:i}},t)},"FormDataProvider");function at(t,e){return e.reduce((r,n)=>r?r[n]:null,t)}u(at,"getPathData");function $o(t){var e;return((e=t.anyOf)==null?void 0:e.some(r=>r.not&&Object.keys(r.not).length===0))||!1}u($o,"isOptional");function Gr(t,e){let r=l({},t);for(let n in e)e.hasOwnProperty(n)&&(typeof e[n]=="object"&&e[n]!==null&&!Array.isArray(e[n])?typeof r[n]=="object"&&r[n]!==null&&!Array.isArray(r[n])?r[n]=Gr(r[n],e[n]):r[n]=Gr({},e[n]):r[n]=e[n]);return r}u(Gr,"deepMerge");var Ig=u((t,e)=>{let{handlePropertyChange:r,data:n}=No(t,e),{discriminator:a,value:s,discriminatedSchema:i}=(0,An.useMemo)(()=>{let o=Uo(t.anyOf),d=o?.key?n?.[o.key]:t.default||null,p=Zg(o?.key||null,d,t.anyOf);return{discriminator:o,value:d,discriminatedSchema:p}},[t.anyOf,n]);return(0,An.useEffect)(()=>{a?.key&&a?.values.length&&Object.keys(n||{}).length<1&&!t.default&&r(e,{[a.key]:a.values[0]})},[]),{discriminator:a,discriminatorValue:s,discriminatedSchema:i}},"useDiscriminator"),Uo=u(t=>{let e=t?.map(r=>r.type!=="object"||!r.properties?null:Object.entries(r.properties).map(([n,a])=>{var s;return a.type==="string"&&((s=a.enum)!=null&&s.length)?{key:n,value:a.enum[0]}:null}).filter(n=>!!n)).flat().reduce((r,n)=>{if(!n)return r;let{key:a,value:s}=n;return r.key===null&&(r.key=a),r.key===a&&r.values.push(s),r},{key:null,values:[]});return e?.key===null||!e?.values.length?null:e},"resolveDiscriminator"),Zg=u((t,e,r)=>{var n,a;if(!r?.length||!t||!e)return null;for(let s of r){if(s.type!=="object")continue;let i=(n=s.properties)==null?void 0:n[t];if(i?.type==="string"&&((a=i.enum)!=null&&a.length)&&i.enum[0]===e)return m(l({},s),{properties:m(l({},s.properties),{[t]:m(l({},i),{[U]:{hidden:!0}})})})}return null},"resolveDiscriminatedSchema"),Ag=u(t=>{var e;return(e=t.anyOf)!=null&&e.length?Uo(t.anyOf)?"discriminatedUnion":"object":t.type==="integer"?"number":t.type},"getSchemaType"),Rg=u((t,e)=>{var r,n,a;let s=Ag(e),i=((r=e[U])==null?void 0:r.displayAs)||null;if(!i||!Array.isArray(i)||i.length<2){let y=(n=t?.[s])==null?void 0:n.default;return y?{Component:y,type:s,id:"default",params:{}}:null}let o=i[0],d=((a=t?.[s])==null?void 0:a[o])||null;if(!d)return console.warn(`Component ${s}.${o} not found`),null;let p=i[1]||{};return{Component:d,type:s,id:o,params:p}},"resolveComponent");function Fo(t,e){return t.length!==e.length?!1:t.every((r,n)=>r===e[n])}u(Fo,"pathMatches");function Fa(t,e){return e||(e=new RegExp("/s|-|_| ","g")),Ko(t).split(e).map(Lo).map(Vo).reduce(zo)}u(Fa,"formatTitle");function Lo(t){return t.charAt(0).toUpperCase()+t.substring(1)}u(Lo,"capitalize");function zo(t,e){return`${t} ${e}`}u(zo,"combine");function Ko(t){return t.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}u(Ko,"decamelize");function Vo(t,e,r){let n=t.toLowerCase(),a=t.toUpperCase();for(let s of Hg)if(s.toLowerCase()===n)return s;return Bg.includes(a)?a:e===0||e===r.length-1||t.length>=4?t:jg.includes(n)||Mg.includes(n)||Dg.includes(n)?n:t}u(Vo,"handleSpecialWords");var Bg=["2D","3D","4WD","A2O","API","BIOS","CCTV","CC","CCV","CD","CD-ROM","COBOL","CIA","CMS","CSS","CSV","CV","DIY","DVD","DB","DNA","E3","EIN","ESPN","FAQ","FAQs","FTP","FPS","FORTRAN","FBI","HTML","HTTP","ID","IP","ISO","JS","JSON","LASER","M2A","M2M","M2MM","M2O","MMORPG","NAFTA","NASA","NDA","O2M","PDF","PHP","POP","RAM","RNGR","ROM","RPG","RTFM","RTS","SCUBA","SITCOM","SKU","SMTP","SQL","SSN","SWAT","TBS","TTL","TV","TNA","UI","URL","USB","UWP","VIP","W3C","WYSIWYG","WWW","WWE","WWF"],Dg=["a","an","the"],Mg=["and","that","but","or","as","if","when","than","because","while","where","after","so","though","since","until","whether","before","although","nor","like","once","unless","now","except"],jg=["about","above","across","after","against","along","among","around","at","because of","before","behind","below","beneath","beside","besides","between","beyond","but","by","concerning","despite","down","during","except","excepting","for","from","in","in front of","inside","in spite of","instead of","into","like","near","of","off","on","onto","out","outside","over","past","regarding","since","through","throughout","to","toward","under","underneath","until","up","upon","up to","with","within","without","with regard to","with respect to"],Hg=["2FA","3D","4K","5K","8K","AGI","BI","ChatGPT","CTA","DateTime","GitHub","GPT","HD","IBMid","ID","IDs","iMac","IMAX","iOS","IP","iPad","iPhone","iPod","LDAP","LinkedIn","LLM","M2M","M2O","macOS","McDonalds","ML","MySQL","NLG","NLP","NLU","O2M","OpenAI","PDFs","PEFT","pH","PostgreSQL","SEO","TTS","UHD","UUID","XSS","YouTube"];function qo(t){return typeof t=="symbol"?"symbol":typeof t=="bigint"?`${t.toString()}n`:je(t)}u(qo,"primitiveToTypscriptLiteralType");function je(t){return typeof t>"u"?"undefined":typeof t=="symbol"?t.description?`Symbol(${je(t.description)})`:"Symbol()":typeof t=="bigint"?`BigInt(${t.toString()})`:JSON.stringify(t)}u(je,"primitiveToTypescriptValue");function Go(t){return typeof t>"u"?"undefined":JSON.stringify(t)}u(Go,"unknownToTypescriptValue");var to=u(t=>/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(t)?t:je(t),"toPropertyKey"),Ng=u(t=>t.charAt(0).toUpperCase()+t.slice(1),"capitalize"),Wo=u(t=>{let e=/[^a-zA-Z0-9_]/g;return t.split(e).map(Ng).filter(n=>!!n).join("")},"toTypeArgumentName"),Z=u(t=>{let e=(t??"").split(`
|
|
24
24
|
`).filter(r=>r.trim().length>0);return e.length===0?"":e.length===1?`/** ${e[0]} */`:`/**
|
|
25
25
|
* ${e.join(`
|
|
26
26
|
* `)}
|
|
27
|
-
*/`},"getMultilineComment"),
|
|
28
|
-
`:"",y=t.value.describe(""),k=t.optional||t.value.isOptional()?"?":"";return`${p}${d}${p}${t.key}${k}: ${L(y,s)}${p}`}if(t instanceof
|
|
27
|
+
*/`},"getMultilineComment"),Jo={};jo(Jo,{JsonSchemaToZuiError:()=>Qo,ObjectToZuiError:()=>La,UnrepresentableGenericError:()=>za,UnsupportedZuiToJsonSchemaError:()=>$g,UnsupportedZuiToTypescriptSchemaError:()=>rt,UnsupportedZuiToTypescriptTypeError:()=>cu,UntitledDeclarationError:()=>du,ZuiToJsonSchemaError:()=>ru,ZuiToTypescriptSchemaError:()=>su,ZuiToTypescriptTypeError:()=>Rn,ZuiTransformError:()=>$t});var Yo=class extends Error{constructor(e,r){super(r),this.transform=e}};u(Yo,"ZuiTransformError");var $t=Yo,Xo=class extends $t{constructor(e){super("json-schema-to-zui",e)}};u(Xo,"JsonSchemaToZuiError");var Qo=Xo,eu=class extends $t{constructor(e){super("object-to-zui",e)}};u(eu,"ObjectToZuiError");var La=eu,tu=class extends $t{constructor(e){super("zui-to-json-schema",e)}};u(tu,"ZuiToJsonSchemaError");var ru=tu,nu=class extends ru{constructor(e){super(`Zod type ${e} cannot be transformed to JSON Schema.`)}};u(nu,"UnsupportedZuiToJsonSchemaError");var $g=nu,au=class extends $t{constructor(e){super("zui-to-typescript-schema",e)}};u(au,"ZuiToTypescriptSchemaError");var su=au,iu=class extends su{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript schema.`)}};u(iu,"UnsupportedZuiToTypescriptSchemaError");var rt=iu,ou=class extends $t{constructor(e){super("zui-to-typescript-type",e)}};u(ou,"ZuiToTypescriptTypeError");var Rn=ou,uu=class extends Rn{constructor(e){super(`Zod type ${e} cannot be transformed to TypeScript type.`)}};u(uu,"UnsupportedZuiToTypescriptTypeError");var cu=uu,lu=class extends Rn{constructor(){super("Schema must have a title to be transformed to a TypeScript type with a declaration.")}};u(lu,"UntitledDeclarationError");var du=lu,fu=class extends Rn{constructor(){super('ZodRef can only be transformed to a TypeScript type with a "type" declaration.')}};u(fu,"UnrepresentableGenericError");var za=fu,pu=["string","number","boolean","unknown","void","any","null","undefined","never","bigint","symbol","object"],Ug=u(t=>pu.includes(t),"isPrimitive"),Fg=u(t=>pu.map(e=>`${e}[]`).includes(t),"isArrayOfPrimitives"),ro=u(t=>t.replace(/ +/g," ").trim(),"stripSpaces"),gu=class{constructor(e,r,n=!1){this.key=e,this.value=r,this.optional=n}};u(gu,"KeyValue");var jr=gu,mu=class{constructor(e){this.schema=e}};u(mu,"FnParameters");var no=mu,hu=class{constructor(e){this.schema=e}};u(hu,"FnReturn");var ao=hu,yu=class{constructor(e){this.props=e}};u(yu,"Declaration");var Nr=yu;function Wr(t,e={}){let r=Kg(t,e),n=L(r,{});return e.formatter&&(n=e.formatter(n)),n}u(Wr,"toTypescript");function L(t,e){var r,n,a;let s=m(l({},e),{parent:t});if(t===null)return"";if(t instanceof Nr)return Lg(t,s);if(t instanceof jr){if(t.value instanceof v.ZodOptional){let P=t.value._def.innerType;return P instanceof v.Schema&&!P.description&&t.value.description&&(P=P?.describe(t.value.description)),L(new jr(t.key,P,!0),s)}let d=Z(t.value._def.description),p=d?.trim().length>0?`
|
|
28
|
+
`:"",y=t.value.describe(""),k=t.optional||t.value.isOptional()?"?":"";return`${p}${d}${p}${t.key}${k}: ${L(y,s)}${p}`}if(t instanceof no){if(t.schema instanceof v.ZodTuple){let y="";for(let T=0;T<t.schema.items.length;T++){let k=(a=(n=(r=t.schema.items[T])==null?void 0:r.ui)==null?void 0:n.title)!=null?a:`arg${T}`,P=t.schema.items[T];y+=`${L(new jr(to(k),P),s)}${T<t.schema.items.length-1?", ":""} `}return y}let d=L(t.schema,s);return d.startsWith("{")&&d.endsWith("}")||d.startsWith("[")&&d.endsWith("]")||d.startsWith("(")&&d.endsWith(")")||d.startsWith("Array<")&&d.endsWith(">")||d.startsWith("Record<")&&d.endsWith(">")||Fg(d)?`args: ${d}`:d}if(t instanceof ao)return t.schema instanceof v.ZodOptional?`${L(t.schema.unwrap(),s)} | undefined`:L(t.schema,s);let o=t._def;switch(o.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${Z(o.description)} string`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:case v.ZodFirstPartyTypeKind.ZodNaN:case v.ZodFirstPartyTypeKind.ZodBigInt:return`${Z(o.description)} number`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${Z(t._def.description)} boolean`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${Z(o.description)} Date`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${Z(o.description)} undefined`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${Z(o.description)} null`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${Z(o.description)} any`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${Z(o.description)} unknown`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${Z(o.description)} never`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${Z(o.description)} void`.trim();case v.ZodFirstPartyTypeKind.ZodArray:let d=L(o.type,s);return Ug(d)?`${d}[]`:`Array<${d}>`;case v.ZodFirstPartyTypeKind.ZodObject:return`{ ${Object.entries(o.shape()).map(([H,J])=>L(new jr(to(H),J),s)).join("; ")} }`;case v.ZodFirstPartyTypeKind.ZodUnion:let y=o.options.map(H=>L(H,s));return`${Z(o.description)}
|
|
29
29
|
${y.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let T=o.options.map(H=>L(H,s));return`${Z(t._def.description)}
|
|
30
|
-
${T.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodIntersection:return`${L(o.left,s)} & ${L(o.right,s)}`;case v.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(H=>L(H,s)).join(", ")}]`;case v.ZodFirstPartyTypeKind.ZodRecord:let P=L(o.keyType,s),D=L(o.valueType,s);return`${Z(o.description)} { [key: ${P}]: ${D} }`;case v.ZodFirstPartyTypeKind.ZodMap:return`Map<${L(o.keyType,s)}, ${L(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodSet:return`Set<${L(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodFunction:let
|
|
31
|
-
(${
|
|
32
|
-
${se}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(je).join(" | ");case v.ZodFirstPartyTypeKind.ZodEffects:return L(o.schema,s);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new uu(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${L(o.innerType,s)} | undefined`;case v.ZodFirstPartyTypeKind.ZodNullable:return`${L(o.innerType,s)} | null`;case v.ZodFirstPartyTypeKind.ZodDefault:return L(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodCatch:return L(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${L(o.type,s)}>`;case v.ZodFirstPartyTypeKind.ZodBranded:return L(o.type,s);case v.ZodFirstPartyTypeKind.ZodPipeline:return L(o.in,s);case v.ZodFirstPartyTypeKind.ZodSymbol:return`${Z(o.description)} symbol`.trim();case v.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${L(o.innerType,s)}>`;case v.ZodFirstPartyTypeKind.ZodRef:return Go(o.uri);default:M.assertNever(o)}}u(L,"sUnwrapZod");var Fg=u((t,e)=>{if(t.props.type==="none")return L(t.props.schema,e);let r=Z(t.props.schema.description),n=t.props.schema.describe(""),a=L(n,e);if(t.props.type==="variable")return to(`${r}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(Go).join(", ")}>`:"";return to(`${r}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),Lg=u(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),zg=u((t,e)=>{let r=Lg(e),n=t.getReferences();if(r==="none"){if(n.length>0)throw new La;return new Hr({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new lu;if(r==="variable"){if(n.length>0)throw new La;return new Hr({type:"variable",identifier:a,schema:t})}return new Hr({type:"type",identifier:a,schema:t,args:n})},"getDeclarationProps"),Kg=typeof global=="object"&&global&&global.Object===Object&&global,yu=Kg,Vg=typeof self=="object"&&self&&self.Object===Object&&self,qg=yu||Vg||Function("return this")(),Ue=qg,Gg=Ue.Symbol,Ve=Gg,vu=Object.prototype,Wg=vu.hasOwnProperty,Jg=vu.toString,Jt=Ve?Ve.toStringTag:void 0;function _u(t){var e=Wg.call(t,Jt),r=t[Jt];try{t[Jt]=void 0;var n=!0}catch{}var a=Jg.call(t);return n&&(e?t[Jt]=r:delete t[Jt]),a}u(_u,"getRawTag");var Yg=_u,Xg=Object.prototype,Qg=Xg.toString;function bu(t){return Qg.call(t)}u(bu,"objectToString");var em=bu,tm="[object Null]",rm="[object Undefined]",ao=Ve?Ve.toStringTag:void 0;function Tu(t){return t==null?t===void 0?rm:tm:ao&&ao in Object(t)?Yg(t):em(t)}u(Tu,"baseGetTag");var $t=Tu;function Pu(t){return t!=null&&typeof t=="object"}u(Pu,"isObjectLike");var At=Pu,nm="[object Symbol]";function Eu(t){return typeof t=="symbol"||At(t)&&$t(t)==nm}u(Eu,"isSymbol");var os=Eu;function xu(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}u(xu,"arrayMap");var am=xu,sm=Array.isArray,$e=sm,im=1/0,so=Ve?Ve.prototype:void 0,io=so?so.toString:void 0;function us(t){if(typeof t=="string")return t;if($e(t))return am(t,us)+"";if(os(t))return io?io.call(t):"";var e=t+"";return e=="0"&&1/t==-im?"-0":e}u(us,"baseToString");var om=us;function Su(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}u(Su,"isObject");var cs=Su;function wu(t){return t}u(wu,"identity");var um=wu,cm="[object AsyncFunction]",lm="[object Function]",dm="[object GeneratorFunction]",fm="[object Proxy]";function ku(t){if(!cs(t))return!1;var e=$t(t);return e==lm||e==dm||e==cm||e==fm}u(ku,"isFunction");var Ou=ku,pm=Ue["__core-js_shared__"],ja=pm,oo=function(){var t=/[^.]+$/.exec(ja&&ja.keys&&ja.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Cu(t){return!!oo&&oo in t}u(Cu,"isMasked");var gm=Cu,mm=Function.prototype,hm=mm.toString;function Iu(t){if(t!=null){try{return hm.call(t)}catch{}try{return t+""}catch{}}return""}u(Iu,"toSource");var dt=Iu,ym=/[\\^$.*+?()[\]{}|]/g,vm=/^\[object .+?Constructor\]$/,_m=Function.prototype,bm=Object.prototype,Tm=_m.toString,Pm=bm.hasOwnProperty,Em=RegExp("^"+Tm.call(Pm).replace(ym,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Zu(t){if(!cs(t)||gm(t))return!1;var e=Ou(t)?Em:vm;return e.test(dt(t))}u(Zu,"baseIsNative");var xm=Zu;function Au(t,e){return t?.[e]}u(Au,"getValue");var Sm=Au;function Ru(t,e){var r=Sm(t,e);return xm(r)?r:void 0}u(Ru,"getNative");var ft=Ru,wm=ft(Ue,"WeakMap"),za=wm,km=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}(),uo=km,Om=9007199254740991,Cm=/^(?:0|[1-9]\d*)$/;function Bu(t,e){var r=typeof t;return e=e??Om,!!e&&(r=="number"||r!="symbol"&&Cm.test(t))&&t>-1&&t%1==0&&t<e}u(Bu,"isIndex");var Du=Bu;function Mu(t,e,r){e=="__proto__"&&uo?uo(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}u(Mu,"baseAssignValue");var Im=Mu;function ju(t,e){return t===e||t!==t&&e!==e}u(ju,"eq");var Hu=ju,Zm=9007199254740991;function Nu(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Zm}u(Nu,"isLength");var ls=Nu;function $u(t){return t!=null&&ls(t.length)&&!Ou(t)}u($u,"isArrayLike");var Am=$u,Rm=Object.prototype;function Uu(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Rm;return t===r}u(Uu,"isPrototype");var Bm=Uu;function Fu(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}u(Fu,"baseTimes");var Dm=Fu,Mm="[object Arguments]";function Lu(t){return At(t)&&$t(t)==Mm}u(Lu,"baseIsArguments");var co=Lu,zu=Object.prototype,jm=zu.hasOwnProperty,Hm=zu.propertyIsEnumerable,Nm=co(function(){return arguments}())?co:function(t){return At(t)&&jm.call(t,"callee")&&!Hm.call(t,"callee")},Ku=Nm;function Vu(){return!1}u(Vu,"stubFalse");var $m=Vu,qu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,lo=qu&&typeof module=="object"&&module&&!module.nodeType&&module,Um=lo&&lo.exports===qu,fo=Um?Ue.Buffer:void 0,Fm=fo?fo.isBuffer:void 0,Lm=Fm||$m,Ka=Lm,zm="[object Arguments]",Km="[object Array]",Vm="[object Boolean]",qm="[object Date]",Gm="[object Error]",Wm="[object Function]",Jm="[object Map]",Ym="[object Number]",Xm="[object Object]",Qm="[object RegExp]",eh="[object Set]",th="[object String]",rh="[object WeakMap]",nh="[object ArrayBuffer]",ah="[object DataView]",sh="[object Float32Array]",ih="[object Float64Array]",oh="[object Int8Array]",uh="[object Int16Array]",ch="[object Int32Array]",lh="[object Uint8Array]",dh="[object Uint8ClampedArray]",fh="[object Uint16Array]",ph="[object Uint32Array]",X={};X[sh]=X[ih]=X[oh]=X[uh]=X[ch]=X[lh]=X[dh]=X[fh]=X[ph]=!0;X[zm]=X[Km]=X[nh]=X[Vm]=X[ah]=X[qm]=X[Gm]=X[Wm]=X[Jm]=X[Ym]=X[Xm]=X[Qm]=X[eh]=X[th]=X[rh]=!1;function Gu(t){return At(t)&&ls(t.length)&&!!X[$t(t)]}u(Gu,"baseIsTypedArray");var gh=Gu;function Wu(t){return function(e){return t(e)}}u(Wu,"baseUnary");var mh=Wu,Ju=typeof exports=="object"&&exports&&!exports.nodeType&&exports,rr=Ju&&typeof module=="object"&&module&&!module.nodeType&&module,hh=rr&&rr.exports===Ju,Ha=hh&&yu.process,yh=function(){try{var t=rr&&rr.require&&rr.require("util").types;return t||Ha&&Ha.binding&&Ha.binding("util")}catch{}}(),po=yh,go=po&&po.isTypedArray,vh=go?mh(go):gh,Yu=vh,_h=Object.prototype,bh=_h.hasOwnProperty;function Xu(t,e){var r=$e(t),n=!r&&Ku(t),a=!r&&!n&&Ka(t),s=!r&&!n&&!a&&Yu(t),i=r||n||a||s,o=i?Dm(t.length,String):[],d=o.length;for(var p in t)(e||bh.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Du(p,d)))&&o.push(p);return o}u(Xu,"arrayLikeKeys");var Th=Xu;function Qu(t,e){return function(r){return t(e(r))}}u(Qu,"overArg");var Ph=Qu,Eh=Ph(Object.keys,Object),xh=Eh,Sh=Object.prototype,wh=Sh.hasOwnProperty;function ec(t){if(!Bm(t))return xh(t);var e=[];for(var r in Object(t))wh.call(t,r)&&r!="constructor"&&e.push(r);return e}u(ec,"baseKeys");var kh=ec;function tc(t){return Am(t)?Th(t):kh(t)}u(tc,"keys");var ds=tc,Oh=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ch=/^\w*$/;function rc(t,e){if($e(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||os(t)?!0:Ch.test(t)||!Oh.test(t)||e!=null&&t in Object(e)}u(rc,"isKey");var fs=rc,Ih=ft(Object,"create"),nr=Ih;function nc(){this.__data__=nr?nr(null):{},this.size=0}u(nc,"hashClear");var Zh=nc;function ac(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}u(ac,"hashDelete");var Ah=ac,Rh="__lodash_hash_undefined__",Bh=Object.prototype,Dh=Bh.hasOwnProperty;function sc(t){var e=this.__data__;if(nr){var r=e[t];return r===Rh?void 0:r}return Dh.call(e,t)?e[t]:void 0}u(sc,"hashGet");var Mh=sc,jh=Object.prototype,Hh=jh.hasOwnProperty;function ic(t){var e=this.__data__;return nr?e[t]!==void 0:Hh.call(e,t)}u(ic,"hashHas");var Nh=ic,$h="__lodash_hash_undefined__";function oc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=nr&&e===void 0?$h:e,this}u(oc,"hashSet");var Uh=oc;function pt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(pt,"Hash");pt.prototype.clear=Zh;pt.prototype.delete=Ah;pt.prototype.get=Mh;pt.prototype.has=Nh;pt.prototype.set=Uh;var mo=pt;function uc(){this.__data__=[],this.size=0}u(uc,"listCacheClear");var Fh=uc;function cc(t,e){for(var r=t.length;r--;)if(Hu(t[r][0],e))return r;return-1}u(cc,"assocIndexOf");var Rn=cc,Lh=Array.prototype,zh=Lh.splice;function lc(t){var e=this.__data__,r=Rn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():zh.call(e,r,1),--this.size,!0}u(lc,"listCacheDelete");var Kh=lc;function dc(t){var e=this.__data__,r=Rn(e,t);return r<0?void 0:e[r][1]}u(dc,"listCacheGet");var Vh=dc;function fc(t){return Rn(this.__data__,t)>-1}u(fc,"listCacheHas");var qh=fc;function pc(t,e){var r=this.__data__,n=Rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}u(pc,"listCacheSet");var Gh=pc;function gt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(gt,"ListCache");gt.prototype.clear=Fh;gt.prototype.delete=Kh;gt.prototype.get=Vh;gt.prototype.has=qh;gt.prototype.set=Gh;var Bn=gt,Wh=ft(Ue,"Map"),ar=Wh;function gc(){this.size=0,this.__data__={hash:new mo,map:new(ar||Bn),string:new mo}}u(gc,"mapCacheClear");var Jh=gc;function mc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}u(mc,"isKeyable");var Yh=mc;function hc(t,e){var r=t.__data__;return Yh(e)?r[typeof e=="string"?"string":"hash"]:r.map}u(hc,"getMapData");var Dn=hc;function yc(t){var e=Dn(this,t).delete(t);return this.size-=e?1:0,e}u(yc,"mapCacheDelete");var Xh=yc;function vc(t){return Dn(this,t).get(t)}u(vc,"mapCacheGet");var Qh=vc;function _c(t){return Dn(this,t).has(t)}u(_c,"mapCacheHas");var ey=_c;function bc(t,e){var r=Dn(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}u(bc,"mapCacheSet");var ty=bc;function mt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(mt,"MapCache");mt.prototype.clear=Jh;mt.prototype.delete=Xh;mt.prototype.get=Qh;mt.prototype.has=ey;mt.prototype.set=ty;var Mn=mt,ry="Expected a function";function jn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ry);var r=u(function(){var n=arguments,a=e?e.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);var i=t.apply(this,n);return r.cache=s.set(a,i)||s,i},"memoized");return r.cache=new(jn.Cache||Mn),r}u(jn,"memoize");jn.Cache=Mn;var ny=jn,ay=500;function Tc(t){var e=ny(t,function(n){return r.size===ay&&r.clear(),n}),r=e.cache;return e}u(Tc,"memoizeCapped");var sy=Tc,iy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oy=/\\(\\)?/g,uy=sy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(iy,function(r,n,a,s){e.push(a?s.replace(oy,"$1"):n||r)}),e}),cy=uy;function Pc(t){return t==null?"":om(t)}u(Pc,"toString");var ly=Pc;function Ec(t,e){return $e(t)?t:fs(t,e)?[t]:cy(ly(t))}u(Ec,"castPath");var xc=Ec,dy=1/0;function Sc(t){if(typeof t=="string"||os(t))return t;var e=t+"";return e=="0"&&1/t==-dy?"-0":e}u(Sc,"toKey");var Hn=Sc;function wc(t,e){e=xc(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Hn(e[r++])];return r&&r==n?t:void 0}u(wc,"baseGet");var kc=wc;function Oc(t,e,r){var n=t==null?void 0:kc(t,e);return n===void 0?r:n}u(Oc,"get");var fy=Oc;function Cc(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}u(Cc,"arrayPush");var py=Cc;function Ic(){this.__data__=new Bn,this.size=0}u(Ic,"stackClear");var gy=Ic;function Zc(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}u(Zc,"stackDelete");var my=Zc;function Ac(t){return this.__data__.get(t)}u(Ac,"stackGet");var hy=Ac;function Rc(t){return this.__data__.has(t)}u(Rc,"stackHas");var yy=Rc,vy=200;function Bc(t,e){var r=this.__data__;if(r instanceof Bn){var n=r.__data__;if(!ar||n.length<vy-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Mn(n)}return r.set(t,e),this.size=r.size,this}u(Bc,"stackSet");var _y=Bc;function ht(t){var e=this.__data__=new Bn(t);this.size=e.size}u(ht,"Stack");ht.prototype.clear=gy;ht.prototype.delete=my;ht.prototype.get=hy;ht.prototype.has=yy;ht.prototype.set=_y;var Nr=ht;function Dc(t,e){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var i=t[r];e(i,r,t)&&(s[a++]=i)}return s}u(Dc,"arrayFilter");var by=Dc;function Mc(){return[]}u(Mc,"stubArray");var Ty=Mc,Py=Object.prototype,Ey=Py.propertyIsEnumerable,ho=Object.getOwnPropertySymbols,xy=ho?function(t){return t==null?[]:(t=Object(t),by(ho(t),function(e){return Ey.call(t,e)}))}:Ty,Sy=xy;function jc(t,e,r){var n=e(t);return $e(t)?n:py(n,r(t))}u(jc,"baseGetAllKeys");var wy=jc;function Hc(t){return wy(t,ds,Sy)}u(Hc,"getAllKeys");var yo=Hc,ky=ft(Ue,"DataView"),Va=ky,Oy=ft(Ue,"Promise"),qa=Oy,Cy=ft(Ue,"Set"),Ga=Cy,vo="[object Map]",Iy="[object Object]",_o="[object Promise]",bo="[object Set]",To="[object WeakMap]",Po="[object DataView]",Zy=dt(Va),Ay=dt(ar),Ry=dt(qa),By=dt(Ga),Dy=dt(za),nt=$t;(Va&&nt(new Va(new ArrayBuffer(1)))!=Po||ar&&nt(new ar)!=vo||qa&&nt(qa.resolve())!=_o||Ga&&nt(new Ga)!=bo||za&&nt(new za)!=To)&&(nt=u(function(t){var e=$t(t),r=e==Iy?t.constructor:void 0,n=r?dt(r):"";if(n)switch(n){case Zy:return Po;case Ay:return vo;case Ry:return _o;case By:return bo;case Dy:return To}return e},"getTag"));var Eo=nt,My=Ue.Uint8Array,xo=My,jy="__lodash_hash_undefined__";function Nc(t){return this.__data__.set(t,jy),this}u(Nc,"setCacheAdd");var Hy=Nc;function $c(t){return this.__data__.has(t)}u($c,"setCacheHas");var Ny=$c;function sr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Mn;++e<r;)this.add(t[e])}u(sr,"SetCache");sr.prototype.add=sr.prototype.push=Hy;sr.prototype.has=Ny;var $y=sr;function Uc(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}u(Uc,"arraySome");var Uy=Uc;function Fc(t,e){return t.has(e)}u(Fc,"cacheHas");var Fy=Fc,Ly=1,zy=2;function Lc(t,e,r,n,a,s){var i=r&Ly,o=t.length,d=e.length;if(o!=d&&!(i&&d>o))return!1;var p=s.get(t),y=s.get(e);if(p&&y)return p==e&&y==t;var T=-1,k=!0,P=r&zy?new $y:void 0;for(s.set(t,e),s.set(e,t);++T<o;){var D=t[T],z=e[T];if(n)var q=i?n(z,D,T,e,t,s):n(D,z,T,t,e,s);if(q!==void 0){if(q)continue;k=!1;break}if(P){if(!Uy(e,function(se,V){if(!Fy(P,V)&&(D===se||a(D,se,r,n,s)))return P.push(V)})){k=!1;break}}else if(!(D===z||a(D,z,r,n,s))){k=!1;break}}return s.delete(t),s.delete(e),k}u(Lc,"equalArrays");var zc=Lc;function Kc(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}u(Kc,"mapToArray");var Ky=Kc;function Vc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}u(Vc,"setToArray");var Vy=Vc,qy=1,Gy=2,Wy="[object Boolean]",Jy="[object Date]",Yy="[object Error]",Xy="[object Map]",Qy="[object Number]",ev="[object RegExp]",tv="[object Set]",rv="[object String]",nv="[object Symbol]",av="[object ArrayBuffer]",sv="[object DataView]",So=Ve?Ve.prototype:void 0,Na=So?So.valueOf:void 0;function qc(t,e,r,n,a,s,i){switch(r){case sv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case av:return!(t.byteLength!=e.byteLength||!s(new xo(t),new xo(e)));case Wy:case Jy:case Qy:return Hu(+t,+e);case Yy:return t.name==e.name&&t.message==e.message;case ev:case rv:return t==e+"";case Xy:var o=Ky;case tv:var d=n&qy;if(o||(o=Vy),t.size!=e.size&&!d)return!1;var p=i.get(t);if(p)return p==e;n|=Gy,i.set(t,e);var y=zc(o(t),o(e),n,a,s,i);return i.delete(t),y;case nv:if(Na)return Na.call(t)==Na.call(e)}return!1}u(qc,"equalByTag");var iv=qc,ov=1,uv=Object.prototype,cv=uv.hasOwnProperty;function Gc(t,e,r,n,a,s){var i=r&ov,o=yo(t),d=o.length,p=yo(e),y=p.length;if(d!=y&&!i)return!1;for(var T=d;T--;){var k=o[T];if(!(i?k in e:cv.call(e,k)))return!1}var P=s.get(t),D=s.get(e);if(P&&D)return P==e&&D==t;var z=!0;s.set(t,e),s.set(e,t);for(var q=i;++T<d;){k=o[T];var se=t[k],V=e[k];if(n)var H=i?n(V,se,k,e,t,s):n(se,V,k,t,e,s);if(!(H===void 0?se===V||a(se,V,r,n,s):H)){z=!1;break}q||(q=k=="constructor")}if(z&&!q){var W=t.constructor,ce=e.constructor;W!=ce&&"constructor"in t&&"constructor"in e&&!(typeof W=="function"&&W instanceof W&&typeof ce=="function"&&ce instanceof ce)&&(z=!1)}return s.delete(t),s.delete(e),z}u(Gc,"equalObjects");var lv=Gc,dv=1,wo="[object Arguments]",ko="[object Array]",jr="[object Object]",fv=Object.prototype,Oo=fv.hasOwnProperty;function Wc(t,e,r,n,a,s){var i=$e(t),o=$e(e),d=i?ko:Eo(t),p=o?ko:Eo(e);d=d==wo?jr:d,p=p==wo?jr:p;var y=d==jr,T=p==jr,k=d==p;if(k&&Ka(t)){if(!Ka(e))return!1;i=!0,y=!1}if(k&&!y)return s||(s=new Nr),i||Yu(t)?zc(t,e,r,n,a,s):iv(t,e,d,r,n,a,s);if(!(r&dv)){var P=y&&Oo.call(t,"__wrapped__"),D=T&&Oo.call(e,"__wrapped__");if(P||D){var z=P?t.value():t,q=D?e.value():e;return s||(s=new Nr),a(z,q,r,n,s)}}return k?(s||(s=new Nr),lv(t,e,r,n,a,s)):!1}u(Wc,"baseIsEqualDeep");var pv=Wc;function ps(t,e,r,n,a){return t===e?!0:t==null||e==null||!At(t)&&!At(e)?t!==t&&e!==e:pv(t,e,r,n,ps,a)}u(ps,"baseIsEqual");var gs=ps,gv=1,mv=2;function Jc(t,e,r,n){var a=r.length,s=a,i=!n;if(t==null)return!s;for(t=Object(t);a--;){var o=r[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=r[a];var d=o[0],p=t[d],y=o[1];if(i&&o[2]){if(p===void 0&&!(d in t))return!1}else{var T=new Nr;if(n)var k=n(p,y,d,t,e,T);if(!(k===void 0?gs(y,p,gv|mv,n,T):k))return!1}}return!0}u(Jc,"baseIsMatch");var hv=Jc;function Yc(t){return t===t&&!cs(t)}u(Yc,"isStrictComparable");var Xc=Yc;function Qc(t){for(var e=ds(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Xc(a)]}return e}u(Qc,"getMatchData");var yv=Qc;function el(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}u(el,"matchesStrictComparable");var tl=el;function rl(t){var e=yv(t);return e.length==1&&e[0][2]?tl(e[0][0],e[0][1]):function(r){return r===t||hv(r,t,e)}}u(rl,"baseMatches");var vv=rl;function nl(t,e){return t!=null&&e in Object(t)}u(nl,"baseHasIn");var _v=nl;function al(t,e,r){e=xc(e,t);for(var n=-1,a=e.length,s=!1;++n<a;){var i=Hn(e[n]);if(!(s=t!=null&&r(t,i)))break;t=t[i]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&ls(a)&&Du(i,a)&&($e(t)||Ku(t)))}u(al,"hasPath");var bv=al;function sl(t,e){return t!=null&&bv(t,e,_v)}u(sl,"hasIn");var Tv=sl,Pv=1,Ev=2;function il(t,e){return fs(t)&&Xc(e)?tl(Hn(t),e):function(r){var n=fy(r,t);return n===void 0&&n===e?Tv(r,t):gs(e,n,Pv|Ev)}}u(il,"baseMatchesProperty");var xv=il;function ol(t){return function(e){return e?.[t]}}u(ol,"baseProperty");var Sv=ol;function ul(t){return function(e){return kc(e,t)}}u(ul,"basePropertyDeep");var wv=ul;function cl(t){return fs(t)?Sv(Hn(t)):wv(t)}u(cl,"property");var kv=cl;function ll(t){return typeof t=="function"?t:t==null?um:typeof t=="object"?$e(t)?xv(t[0],t[1]):vv(t):kv(t)}u(ll,"baseIteratee");var Ov=ll;function dl(t){return function(e,r,n){for(var a=-1,s=Object(e),i=n(e),o=i.length;o--;){var d=i[t?o:++a];if(r(s[d],d,s)===!1)break}return e}}u(dl,"createBaseFor");var Cv=dl,Iv=Cv(),Zv=Iv;function fl(t,e){return t&&Zv(t,e,ds)}u(fl,"baseForOwn");var Av=fl;function pl(t,e){return gs(t,e)}u(pl,"isEqual");var ot=pl;function gl(t,e){var r={};return e=Ov(e,3),Av(t,function(n,a,s){Im(r,a,e(n,a,s))}),r}u(gl,"mapValues");var Rv=gl;function ms(t){return ae(t)}u(ms,"toTypescriptSchema");function ae(t){let r=t._def;switch(r.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${Z(r.description)}z.string()`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:return`${Z(r.description)}z.number()`.trim();case v.ZodFirstPartyTypeKind.ZodNaN:return`${Z(r.description)}z.nan()`.trim();case v.ZodFirstPartyTypeKind.ZodBigInt:return`${Z(r.description)}z.bigint()`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${Z(t._def.description)}z.boolean()`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${Z(r.description)}z.date()`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${Z(r.description)}z.undefined()`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${Z(r.description)}z.null()`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${Z(r.description)}z.any()`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${Z(r.description)}z.unknown()`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${Z(r.description)}z.never()`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${Z(r.description)}z.void()`.trim();case v.ZodFirstPartyTypeKind.ZodArray:return`z.array(${ae(r.type)})`;case v.ZodFirstPartyTypeKind.ZodObject:let n=Rv(r.shape(),ce=>ce instanceof v.Schema?ae(ce):"z.any()");return[`${Z(r.description)}z.object({`,...Object.entries(n).map(([ce,Le])=>` ${ce}: ${Le},`),"})"].join(`
|
|
33
|
-
`).trim();case v.ZodFirstPartyTypeKind.ZodUnion:let a=r.options.map(ae);return`${Z(r.description)}z.union([${a.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=r.options.map(ae),i=je(r.discriminator);return`${Z(r.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodIntersection:let o=ae(r.left),d=ae(r.right);return`${Z(r.description)}z.intersection(${o}, ${d})`.trim();case v.ZodFirstPartyTypeKind.ZodTuple:let p=r.items.map(ae);return`${Z(r.description)}z.tuple([${p.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodRecord:let y=ae(r.keyType),T=ae(r.valueType);return`${Z(r.description)}z.record(${y}, ${T})`.trim();case v.ZodFirstPartyTypeKind.ZodMap:let k=ae(r.keyType),P=ae(r.valueType);return`${Z(r.description)}z.map(${k}, ${P})`.trim();case v.ZodFirstPartyTypeKind.ZodSet:return`${Z(r.description)}z.set(${ae(r.valueType)})`.trim();case v.ZodFirstPartyTypeKind.ZodFunction:let D=r.args.items.map(ae),z=D.length?`.args(${D.join(", ")})`:"",q=ae(r.returns);return`${Z(r.description)}z.function()${z}.returns(${q})`.trim();case v.ZodFirstPartyTypeKind.ZodLazy:return`${Z(r.description)}z.lazy(() => ${ae(r.getter())})`.trim();case v.ZodFirstPartyTypeKind.ZodLiteral:let se=je(r.value);return`${Z(r.description)}z.literal(${se})`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:let V=r.values.map(je);return`${Z(r.description)}z.enum([${V.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodEffects:throw new rt(v.ZodFirstPartyTypeKind.ZodEffects);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new rt(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${Z(r.description)}z.optional(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodNullable:return`${Z(r.description)}z.nullable(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodDefault:let H=qo(r.defaultValue());return`${Z(r.description)}${ae(r.innerType)}.default(${H})`.trim();case v.ZodFirstPartyTypeKind.ZodCatch:throw new rt(v.ZodFirstPartyTypeKind.ZodCatch);case v.ZodFirstPartyTypeKind.ZodPromise:return`${Z(r.description)}z.promise(${ae(r.type)})`.trim();case v.ZodFirstPartyTypeKind.ZodBranded:throw new rt(v.ZodFirstPartyTypeKind.ZodBranded);case v.ZodFirstPartyTypeKind.ZodPipeline:throw new rt(v.ZodFirstPartyTypeKind.ZodPipeline);case v.ZodFirstPartyTypeKind.ZodSymbol:throw new rt(v.ZodFirstPartyTypeKind.ZodSymbol);case v.ZodFirstPartyTypeKind.ZodReadonly:return`${Z(r.description)}z.readonly(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodRef:let W=je(r.uri);return`${Z(r.description)}z.ref(${W})`.trim();default:M.assertNever(r)}}u(ae,"sUnwrapZod");var ml=class{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}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}};u(ml,"ParseInputLazyPath");var Se=ml,Co=u((t,e)=>{if(Bt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ie(t.common.issues);return this._error=r,this._error}}},"handleResult"),hl=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,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}dereference(e){return this}getReferences(){return[]}_getType(e){return Me(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ye,ctx:{common:e.parent.common,data:e.data,parsedType:Me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(or(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let a={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Me(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Co(a,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Me(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(or(a)?a:Promise.resolve(a));return Co(n,s)}refine(e,r){let n=u(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let i=e(a),o=u(()=>s.addIssue(l({code:_.custom},n(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new We({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return He.create(this,this._def)}nullable(){return ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this,this._def)}promise(){return fr.create(this,this._def)}or(e){return Xn.create([this,e],this._def)}and(e){return zn.create(this,e,this._def)}transform(e){return new We(m(l({},A(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new lr(m(l({},A(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new Un(l({typeName:"ZodBranded",type:this},A(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new Fn(m(l({},A(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.constructor;return new r(m(l({},this._def),{description:e}))}pipe(e){return Jn.create(this,e)}readonly(){return pr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[r,n]of Object.entries(e))this._def[U]=m(l({},this._def[U]),{[r]:n});return this}getMetadata(){return l({},this._def[U])}setMetadata(e){this._def[U]=l({},e)}get ui(){let e=this._getMetadataRoot();return l({},e._def[U])}_setZuiMeta(e,r){let n=this._getMetadataRoot();n._def[U]=m(l({},n._def[U]),{[e]:r})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var r,n,a;return(a=(r=this._def)[n=U])!=null||(r[n]={}),this._def[U].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("hidden",r),this}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("disabled",r),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return Qn(this,e)}toTypescript(e){return Gr(this,e)}toTypescriptSchema(){return ms(this)}async toTypescriptAsync(e){let r=Gr(this,m(l({},e),{formatter:void 0}));return e?.formatter&&(r=await e.formatter(r)),r}static fromObject(e,r){return jt(e,r)}static fromJsonSchema(e){return gr(e)}};u(hl,"ZodType");var B=hl,hs=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(hs||{}),M;(t=>{t.assertEqual=u(a=>a,"assertEqual");function e(a){}t.assertIs=e,u(e,"assertIs");function r(a){throw new Error("assertNever called")}t.assertNever=r,u(r,"assertNever"),t.arrayToEnum=u(a=>{let s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=u(a=>{let s=(0,t.objectKeys)(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=u(a=>(0,t.objectKeys)(a).map(function(s){return a[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=u((a,s)=>{for(let i of a)if(s(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,u(n,"joinValues"),t.jsonStringifyReplacer=u((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=u((a,s)=>a.toString()===s.toString(),"compareFunctions")})(M||(M={}));var Wr;(t=>{t.mergeShapes=u((e,r)=>l(l({},e),r),"mergeShapes")})(Wr||(Wr={}));var x=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Me=u(t=>{switch(typeof t){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(t)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(t)?x.array:t===null?x.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?x.promise:typeof Map<"u"&&t instanceof Map?x.map:typeof Set<"u"&&t instanceof Set?x.set:typeof Date<"u"&&t instanceof Date?x.date:x.object;default:return x.unknown}},"getParsedType");function A(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[U]:t?.[U]}:{errorMap:u((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},"customMap"),description:a,[U]:t?.[U]}}u(A,"processCreateParams");var ys=u((t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===x.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;case _.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},"errorMap"),Io=ys,_=M.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","unresolved_reference"]),yl=u(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Jr=class vl extends Error{constructor(e){super(),this.issues=[],this.addIssue=u(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=u((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},a=u(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,d=0;for(;d<i.path.length;){let p=i.path[d];d===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(r(i))):o[p]=o[p]||{_errors:[]},o=o[p],d++}}},"processError");return a(this),n}static assert(e){if(!(e instanceof vl))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};u(Jr,"ZodError");Jr.create=u(t=>new Jr(t),"create");var Ie=Jr,_l=ys;function vs(t){_l=t}u(vs,"setErrorMap");function Rt(){return _l}u(Rt,"getErrorMap");var ir=u(t=>{var e;let{data:r,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o=m(l({},s),{path:i}),d="",p=a.filter(y=>!!y).slice().reverse();for(let y of p)d=y(o,{data:r,defaultError:d}).message;return m(l({},s),{path:i,message:(e=s.message)!=null?e:d})},"makeIssue"),bl=[];function E(t,e){let r=ir({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Rt(),ys].filter(n=>!!n)});t.common.issues.push(r)}u(E,"addIssueToContext");var Tl=class Pl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let a of r){if(a.status==="aborted")return C;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return Pl.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return C;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};u(Tl,"ParseStatus");var ye=Tl,C=Object.freeze({status:"aborted"}),it=u(t=>({status:"dirty",value:t}),"DIRTY"),pe=u(t=>({status:"valid",value:t}),"OK"),Yr=u(t=>t.status==="aborted","isAborted"),Xr=u(t=>t.status==="dirty","isDirty"),Bt=u(t=>t.status==="valid","isValid"),or=u(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),O;(t=>{t.errToObj=u(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=u(e=>typeof e=="string"?e:e?.message,"toString")})(O||(O={}));var Qr=class El extends B{constructor(){super(...arguments),this._any=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof El}};u(Qr,"ZodAny");Qr.create=u(t=>new Qr(l({typeName:"ZodAny"},A(t))),"create");var ur=Qr,en=class St extends B{dereference(e){return new St(m(l({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var r,n,a,s,i,o;return e instanceof St?ot((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&ot((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&ot((i=this._def.minLength)==null?void 0:i.value,(o=e._def.minLength)==null?void 0:o.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==x.array)return E(r,{code:_.invalid_type,expected:x.array,received:r.parsedType}),C;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(E(r,{code:i?_.too_big:_.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(E(r,{code:_.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(E(r,{code:_.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new Se(r,i,r.path,o)))).then(i=>ye.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new Se(r,i,r.path,o)));return ye.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new St(m(l({},this._def),{minLength:{value:e,message:O.toString(r)}}))}max(e,r){return new St(m(l({},this._def),{maxLength:{value:e,message:O.toString(r)}}))}length(e,r){return new St(m(l({},this._def),{exactLength:{value:e,message:O.toString(r)}}))}nonempty(e){return this.min(1,e)}};u(en,"ZodArray");en.create=u((t,e)=>new en(l({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},A(e))),"create");var Dt=en,Bv={compare:ot},xl=class{constructor(e=[],r={}){this._options=l(l({},Bv),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};u(xl,"CustomSet");var ue=xl,tn=class $r extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.bigint,received:s.parsedType}),C}let n,a=new ye;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof $r)||this._def.coerce!==e._def.coerce)return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,a){return new $r(m(l({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(a)}]}))}_addCheck(e){return new $r(m(l({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};u(tn,"ZodBigInt");tn.create=u(t=>{var e;return new tn(l({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},A(t)))},"create");var Nn=tn,rn=class Sl extends B{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.boolean,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Sl?this._def.coerce===e._def.coerce:!1}};u(rn,"ZodBoolean");rn.create=u(t=>new rn(l({typeName:"ZodBoolean",coerce:t?.coerce||!1},A(t))),"create");var $n=rn,wl=Symbol("zod_brand"),kl=class Ol extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof Ol?this._def.type.isEqual(e._def.type):!1}};u(kl,"ZodBranded");var Un=kl,nn=class Cl extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=m(l({},r),{common:m(l({},r.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:l({},n)});return or(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof Cl?this._def.innerType.isEqual(e._def.innerType)&&M.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};u(nn,"ZodCatch");nn.create=u((t,e)=>new nn(l({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},A(e))),"create");var Fn=nn,_s=u((t,e={},r)=>t?ur.create().superRefine((n,a)=>{var s,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(i=(s=o.fatal)!=null?s:r)!=null?i:!0,p=typeof o=="string"?{message:o}:o;a.addIssue(m(l({code:"custom"},p),{fatal:d}))}}):ur.create(),"custom"),an=class Wa extends B{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.date,received:s.parsedType}),C}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_date}),C}let n=new ye,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):M.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Wa(m(l({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof Wa))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};u(an,"ZodDate");an.create=u(t=>new an(l({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},A(t))),"create");var Ln=an,sn=class Ja extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===x.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new Ja(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof Ja?this._def.innerType.isEqual(e._def.innerType)&&ot(this._def.defaultValue(),e._def.defaultValue()):!1}};u(sn,"ZodDefault");sn.create=u((t,e,r)=>new sn(l({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},A(r))),"create");var lr=sn,Fe=u(t=>Array.from(new Set(t)),"unique"),De=u(t=>t instanceof Kn?De(t.schema):t instanceof We?De(t.innerType()):t instanceof Vn?[t.value]:t instanceof yt?t.options:t instanceof qn?M.objectValues(t.enum):t instanceof lr?De(t._def.innerType):t instanceof Yn?[void 0]:t instanceof Gn?[null]:t instanceof He?[void 0,...De(t.unwrap())]:t instanceof ut?[null,...De(t.unwrap())]:t instanceof Un||t instanceof pr?De(t.unwrap()):t instanceof Fn?De(t._def.innerType):[],"getDiscriminator"),Il=class wt extends B{dereference(e){let r=this.options.map(a=>a.dereference(e)),n=wt._getOptionsMap(this.discriminator,r);return new wt(m(l({},this._def),{options:r,optionsMap:n}))}getReferences(){return Fe(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.object)return E(r,{code:_.invalid_type,expected:x.object,received:r.parsedType}),C;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let a=wt._getOptionsMap(e,r);return new wt(l({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:a},A(n)))}static _getOptionsMap(e,r){let n=new Map;for(let a of r){let s=De(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return n}isEqual(e){if(!(e instanceof wt)||this._def.discriminator!==e._def.discriminator)return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue(this._def.options,{compare:r}),a=new ue(e._def.options,{compare:r});return n.isEqual(a)}};u(Il,"ZodDiscriminatedUnion");var bs=Il;function dr(t,e){return new yt(l({values:t,typeName:"ZodEnum"},A(e)))}u(dr,"createZodEnum");var Ts=class Ur extends B{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:M.joinValues(n),received:r.parsedType,code:_.invalid_type}),C}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:_.invalid_enum_value,options:n}),C}return pe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Ur.create(e,l(l({},this._def),r))}exclude(e,r=this._def){return Ur.create(this.options.filter(n=>!e.includes(n)),l(l({},this._def),r))}isEqual(e){if(!(e instanceof Ur))return!1;let r=new ue(this._def.values),n=new ue(e._def.values);return r.isEqual(n)}};u(Ts,"ZodEnum");Ts.create=dr;var yt=Ts,Zl=class kt extends B{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new kt(m(l({},this._def),{args:r,returns:n}))}getReferences(){return Fe([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.function)return E(r,{code:_.invalid_type,expected:x.function,received:r.parsedType}),C;function n(o,d){return ir({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Rt(),Io].filter(p=>!!p),issueData:{code:_.invalid_arguments,argumentsError:d}})}u(n,"makeArgsIssue");function a(o,d){return ir({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Rt(),Io].filter(p=>!!p),issueData:{code:_.invalid_return_type,returnTypeError:d}})}u(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof fr){let o=this;return pe(async function(...d){let p=new Ie([]),y=await o._def.args.parseAsync(d,s).catch(P=>{throw p.addIssue(n(d,P)),p}),T=await Reflect.apply(i,this,y);return await o._def.returns._def.type.parseAsync(T,s).catch(P=>{throw p.addIssue(a(T,P)),p})})}else{let o=this;return pe(function(...d){let p=o._def.args.safeParse(d,s);if(!p.success)throw new Ie([n(d,p.error)]);let y=Reflect.apply(i,this,p.data),T=o._def.returns.safeParse(y,s);if(!T.success)throw new Ie([a(y,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new kt(m(l({},this._def),{args:lt.create(e).rest(It.create())}))}returns(e){return new kt(m(l({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new kt(l({args:e||lt.create([]).rest(It.create()),returns:r||It.create(),typeName:"ZodFunction"},A(n)))}isEqual(e){return e instanceof kt&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};u(Zl,"ZodFunction");var Ps=Zl;function on(t,e){let r=Me(t),n=Me(e);if(t===e)return{valid:!0,data:t};if(r===x.object&&n===x.object){let a=M.objectKeys(e),s=M.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=l(l({},t),e);for(let o of s){let d=on(t[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(r===x.array&&n===x.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=t[s],o=e[s],d=on(i,o);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===x.date&&n===x.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}u(on,"mergeValues");var un=class Ya extends B{dereference(e){return new Ya(m(l({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Fe([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=u((s,i)=>{if(Yr(s)||Yr(i))return C;let o=on(s.value,i.value);return o.valid?((Xr(s)||Xr(i))&&r.dirty(),{status:r.value,value:o.data}):(E(n,{code:_.invalid_intersection_types}),C)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof Ya))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue([this._def.left,this._def.right],{compare:r}),a=new ue([e._def.left,e._def.right],{compare:r});return n.isEqual(a)}};u(un,"ZodIntersection");un.create=u((t,e,r)=>new un(l({left:t,right:e,typeName:"ZodIntersection"},A(r))),"create");var zn=un,cn=class Al extends B{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof Al?this._def.getter().isEqual(e._def.getter()):!1}};u(cn,"ZodLazy");cn.create=u((t,e)=>new cn(l({getter:t,typeName:"ZodLazy"},A(e))),"create");var Kn=cn,ln=class Rl extends B{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Rl?ot(this._def.value,e._def.value):!1}};u(ln,"ZodLiteral");ln.create=u((t,e)=>new ln(l({value:t,typeName:"ZodLiteral"},A(e))),"create");var Vn=ln,dn=class Xa extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new Xa(m(l({},this._def),{keyType:r,valueType:n}))}getReferences(){return Fe([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.map)return E(n,{code:_.invalid_type,expected:x.map,received:n.parsedType}),C;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,d],p)=>({key:a._parse(new Se(n,o,n.path,[p,"key"])),value:s._parse(new Se(n,d,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let d of i){let p=await d.key,y=await d.value;if(p.status==="aborted"||y.status==="aborted")return C;(p.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(p.value,y.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let d of i){let p=d.key,y=d.value;if(p.status==="aborted"||y.status==="aborted")return C;(p.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(p.value,y.value)}return{status:r.value,value:o}}}isEqual(e){return!(!(e instanceof Xa)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};u(dn,"ZodMap");dn.create=u((t,e,r)=>new dn(l({valueType:e,keyType:t,typeName:"ZodMap"},A(r))),"create");var Es=dn,fn=class Bl extends B{_parse(e){if(this._getType(e)!==x.nan){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.nan,received:n.parsedType}),C}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Bl}};u(fn,"ZodNaN");fn.create=u(t=>new fn(l({typeName:"ZodNaN"},A(t))),"create");var xs=fn,pn=class Dl extends B{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==x.string&&n.parsedType!==x.number){let a=M.objectValues(r);return E(n,{expected:M.joinValues(a),received:n.parsedType,code:_.invalid_type}),C}if(r.indexOf(e.data)===-1){let a=M.objectValues(r);return E(n,{received:n.data,code:_.invalid_enum_value,options:a}),C}return pe(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof Dl?ot(this._def.values,e._def.values):!1}};u(pn,"ZodNativeEnum");pn.create=u((t,e)=>new pn(l({values:t,typeName:"ZodNativeEnum"},A(e))),"create");var qn=pn,gn=class Ml extends B{_parse(e){let r=this._getOrReturnCtx(e);return E(r,{code:_.invalid_type,expected:x.never,received:r.parsedType}),C}isEqual(e){return e instanceof Ml}};u(gn,"ZodNever");gn.create=u(t=>new gn(l({typeName:"ZodNever"},A(t))),"create");var qe=gn,mn=class jl extends B{_parse(e){if(this._getType(e)!==x.null){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.null,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof jl}};u(mn,"ZodNull");mn.create=u(t=>new mn(l({typeName:"ZodNull"},A(t))),"create");var Gn=mn,hn=class Qa extends B{dereference(e){return new Qa(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===x.null?pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof Qa?this._def.innerType.isEqual(e._def.innerType):!1}};u(hn,"ZodNullable");hn.create=u((t,e)=>new hn(l({innerType:t,typeName:"ZodNullable"},A(e))),"create");var ut=hn;function Hl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}u(Hl,"floatSafeRemainder");var yn=class Fr extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.number,received:s.parsedType}),C}let n,a=new ye;for(let s of this._def.checks)s.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Hl(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_finite,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,a){return new Fr(m(l({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(a)}]}))}_addCheck(e){return new Fr(m(l({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof Fr))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}};u(yn,"ZodNumber");yn.create=u(t=>new yn(l({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},A(t))),"create");var Wn=yn;function st(t){if(t instanceof ct){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=He.create(st(n))}return new ct(m(l({},t._def),{shape:u(()=>e,"shape")}))}else return t instanceof Dt?new Dt(m(l({},t._def),{type:st(t.element)})):t instanceof He?He.create(st(t.unwrap())):t instanceof ut?ut.create(st(t.unwrap())):t instanceof lt?lt.create(t.items.map(e=>st(e))):t}u(st,"deepPartialify");var Ge=class xe extends B{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=M.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let a in r)n[a]=r[a].dereference(e);return new xe(m(l({},this._def),{shape:u(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return Fe(r)}_parse(e){if(this._getType(e)!==x.object){let p=this._getOrReturnCtx(e);return E(p,{code:_.invalid_type,expected:x.object,received:p.parsedType}),C}let{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof qe&&this._def.unknownKeys==="strip"))for(let p in a.data)i.includes(p)||o.push(p);let d=[];for(let p of i){let y=s[p],T=a.data[p];d.push({key:{status:"valid",value:p},value:y._parse(new Se(a,T,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qe){let p=this._def.unknownKeys;if(p==="passthrough")for(let y of o)d.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(p==="strict")o.length>0&&(E(a,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let y of o){let T=a.data[y];d.push({key:{status:"valid",value:y},value:p._parse(new Se(a,T,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of d){let T=await y.key;p.push({key:T,value:await y.value,alwaysSet:y.alwaysSet})}return p}).then(p=>ye.mergeObjectSync(n,p)):ye.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new xe(l(m(l({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:u((r,n)=>{var a,s,i,o;let d=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)!=null?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=O.errToObj(e).message)!=null?o:d}:{message:d}},"errorMap")}:{}))}strip(){return new xe(m(l({},this._def),{unknownKeys:"strip"}))}passthrough(){return new xe(m(l({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new xe(m(l({},this._def),{shape:u(()=>l(l({},this._def.shape()),e),"shape")}))}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:u(()=>l(l({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new xe(m(l({},this._def),{catchall:e}))}pick(e){let r={};return M.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}omit(e){let r={};return M.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}deepPartial(){return st(this)}partial(e){let r={};return M.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a?.optional()}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}required(e){let r={};return M.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof He;)s=s._def.innerType;r[n]=s}}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}keyof(){return dr(M.objectKeys(this.shape))}isEqual(e){if(!(e instanceof xe)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let r=this._def.shape(),n=e._def.shape(),a=u((o,d)=>o[0]===d[0]&&o[1].isEqual(d[1]),"compare"),s=new ue(Object.entries(r),{compare:a}),i=new ue(Object.entries(n),{compare:a});return s.isEqual(i)}};u(Ge,"ZodObject");Ge.create=u((t,e)=>new Ge(l({shape:u(()=>t,"shape"),unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},A(e))),"create");Ge.strictCreate=u((t,e)=>new Ge(l({shape:u(()=>t,"shape"),unknownKeys:"strict",catchall:qe.create(),typeName:"ZodObject"},A(e))),"strictCreate");Ge.lazycreate=u((t,e)=>new Ge(l({shape:t,unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},A(e))),"lazycreate");var ct=Ge,vn=class es extends B{dereference(e){return new es(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===x.undefined?pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof es?this._def.innerType.isEqual(e._def.innerType):!1}};u(vn,"ZodOptional");vn.create=u((t,e)=>new vn(l({innerType:t,typeName:"ZodOptional"},A(e))),"create");var He=vn,Nl=class Lr extends B{dereference(e){return new Lr(m(l({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Fe([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return u(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?C:s.status==="dirty"?(r.dirty(),it(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?C:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Lr({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof Lr)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};u(Nl,"ZodPipeline");var Jn=Nl,_n=class ts extends B{unwrap(){return this._def.type}dereference(e){return new ts(m(l({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.promise&&r.common.async===!1)return E(r,{code:_.invalid_type,expected:x.promise,received:r.parsedType}),C;let n=r.parsedType===x.promise?r.data:Promise.resolve(r.data);return pe(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof ts?this._def.type.isEqual(e._def.type):!1}};u(_n,"ZodPromise");_n.create=u((t,e)=>new _n(l({type:t,typeName:"ZodPromise"},A(e))),"create");var fr=_n,bn=class rs extends B{dereference(e){return new rs(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let r=this._def.innerType._parse(e);return Bt(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof rs?this._def.innerType.isEqual(e._def.innerType):!1}};u(bn,"ZodReadonly");bn.create=u((t,e)=>new bn(l({innerType:t,typeName:"ZodReadonly"},A(e))),"create");var pr=bn,$l=class Xt extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new Xt(m(l({},this._def),{keyType:r,valueType:n}))}getReferences(){return Fe([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.object)return E(n,{code:_.invalid_type,expected:x.object,received:n.parsedType}),C;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new Se(n,o,n.path,o)),value:i._parse(new Se(n,n.data[o],n.path,o))});return n.common.async?ye.mergeObjectAsync(r,a):ye.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof B?new Xt(l({keyType:e,valueType:r,typeName:"ZodRecord"},A(n))):new Xt(l({keyType:ge.create(),valueType:e,typeName:"ZodRecord"},A(r)))}isEqual(e){return!(!(e instanceof Xt)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};u($l,"ZodRecord");var Ss=$l,Tn=class Ul extends B{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return E(r,{code:_.unresolved_reference}),C}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Ul?this._def.uri===e._def.uri:!1}};u(Tn,"ZodRef");Tn.create=u(t=>new Tn({typeName:"ZodRef",uri:t}),"create");var ws=Tn,Pn=class Qt extends B{dereference(e){return new Qt(m(l({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.set)return E(n,{code:_.invalid_type,expected:x.set,received:n.parsedType}),C;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(E(n,{code:_.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(E(n,{code:_.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(d){let p=new Set;for(let y of d){if(y.status==="aborted")return C;y.status==="dirty"&&r.dirty(),p.add(y.value)}return{status:r.value,value:p}}u(i,"finalizeSet");let o=[...n.data.values()].map((d,p)=>s._parse(new Se(n,d,n.path,p)));return n.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,r){return new Qt(m(l({},this._def),{minSize:{value:e,message:O.toString(r)}}))}max(e,r){return new Qt(m(l({},this._def),{maxSize:{value:e,message:O.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,a,s;if(!(e instanceof Qt))return!1;let i=(r=this._def.minSize)==null?void 0:r.value,o=(n=e._def.minSize)==null?void 0:n.value;if(i!==o)return!1;let d=(a=this._def.maxSize)==null?void 0:a.value,p=(s=e._def.maxSize)==null?void 0:s.value;return d!==p?!1:this._def.valueType.isEqual(e._def.valueType)}};u(Pn,"ZodSet");Pn.create=u((t,e)=>new Pn(l({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},A(e))),"create");var ks=Pn,Os=/^c[^\s-]{8,}$/i,Cs=/^[a-z][a-z0-9]*$/,Is=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zs=/^[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,As=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Fl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ll=u(t=>t===Fl,"isEmojiRegex"),$a,Rs=/^(((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}))$/,Bs=/^(([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})))$/,Ds=u(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function zl(t,e){return!!((e==="v4"||!e)&&Rs.test(t)||(e==="v6"||!e)&&Bs.test(t))}u(zl,"isValidIP");var En=class Ot extends B{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.string,received:s.parsedType}),C}let n=new ye,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?E(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&E(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")As.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")$a||($a=new RegExp(Fl,"u")),$a.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Zs.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Os.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Cs.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Is.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),E(a,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ds(s).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?zl(e.data,s.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):M.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),l({validation:r,code:_.invalid_string},O.errToObj(n)))}_addCheck(e){return new Ot(m(l({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(l({kind:"email"},O.errToObj(e)))}url(e){return this._addCheck(l({kind:"url"},O.errToObj(e)))}emoji(e){return this._addCheck(l({kind:"emoji"},O.errToObj(e)))}uuid(e){return this._addCheck(l({kind:"uuid"},O.errToObj(e)))}cuid(e){return this._addCheck(l({kind:"cuid"},O.errToObj(e)))}cuid2(e){return this._addCheck(l({kind:"cuid2"},O.errToObj(e)))}ulid(e){return this._addCheck(l({kind:"ulid"},O.errToObj(e)))}ip(e){return this._addCheck(l({kind:"ip"},O.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(l({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},O.errToObj(e?.message)))}regex(e,r){return this._addCheck(l({kind:"regex",regex:e},O.errToObj(r)))}includes(e,r){return this._addCheck(l({kind:"includes",value:e,position:r?.position},O.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(l({kind:"startsWith",value:e},O.errToObj(r)))}endsWith(e,r){return this._addCheck(l({kind:"endsWith",value:e},O.errToObj(r)))}min(e,r){return this._addCheck(l({kind:"min",value:e},O.errToObj(r)))}max(e,r){return this._addCheck(l({kind:"max",value:e},O.errToObj(r)))}length(e,r){return this._addCheck(l({kind:"length",value:e},O.errToObj(r)))}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new Ot(m(l({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[U]=m(l({},this._def[U]),{secret:!0}),this}toLowerCase(){return new Ot(m(l({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ot(m(l({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof Ot))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}};u(En,"ZodString");En.create=u(t=>{var e;return new En(l({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},A(t)))},"create");var ge=En,xn=class Kl extends B{_parse(e){if(this._getType(e)!==x.symbol){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.symbol,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Kl}};u(xn,"ZodSymbol");xn.create=u(t=>new xn(l({typeName:"ZodSymbol"},A(t))),"create");var Ms=xn,Mt=class ns extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new ns(m(l({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:u(i=>{E(n,i),i.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return C;let d=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return d.status==="aborted"?C:d.status==="dirty"||r.value==="dirty"?it(d.value):d});{if(r.value==="aborted")return C;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?C:o.status==="dirty"||r.value==="dirty"?it(o.value):o}}if(a.type==="refinement"){let i=u(o=>{let d=a.refinement(o,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?C:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?C:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bt(i))return i;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Bt(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):i);M.assertNever(a)}isEqual(e){return!(e instanceof ns)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:M.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):(M.assertNever(this._def.effect),!1)}};u(Mt,"ZodEffects");Mt.create=u((t,e,r)=>new Mt(l({schema:t,typeName:"ZodEffects",effect:e},A(r))),"create");Mt.createWithPreprocess=u((t,e,r)=>new Mt(l({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},A(r))),"createWithPreprocess");var We=Mt,Sn=class zr extends B{dereference(e){let r=this._def.items.map(a=>a.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new zr(m(l({},this._def),{items:r,rest:n}))}getReferences(){return Fe([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.array)return E(n,{code:_.invalid_type,expected:x.array,received:n.parsedType}),C;if(n.data.length<this._def.items.length)return E(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let d=this._def.items[o]||this._def.rest;return d?d._parse(new Se(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>ye.mergeArray(r,i)):ye.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new zr(m(l({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof zr)||!this._restEquals(e))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue(this._def.items,{compare:r}),a=new ue(e._def.items,{compare:r});return n.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};u(Sn,"ZodTuple");Sn.create=u((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Sn(l({items:t,typeName:"ZodTuple",rest:null},A(e)))},"create");var lt=Sn,wn=class Vl extends B{_parse(e){if(this._getType(e)!==x.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.undefined,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Vl}};u(wn,"ZodUndefined");wn.create=u(t=>new wn(l({typeName:"ZodUndefined"},A(t))),"create");var Yn=wn,kn=class as extends B{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new as(m(l({},this._def),{options:r}))}getReferences(){return Fe(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new Ie(o.ctx.common.issues));return E(r,{code:_.invalid_union,unionErrors:i}),C}if(u(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i=m(l({},r),{common:m(l({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];for(let d of n){let p=m(l({},r),{common:m(l({},r.common),{issues:[]}),parent:null}),y=d._parseSync({data:r.data,path:r.path,parent:p});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(d=>new Ie(d));return E(r,{code:_.invalid_union,unionErrors:o}),C}}get options(){return this._def.options}isEqual(e){if(!(e instanceof as))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue([...this._def.options],{compare:r}),a=new ue([...e._def.options],{compare:r});return n.isEqual(a)}};u(kn,"ZodUnion");kn.create=u((t,e)=>new kn(l({options:t,typeName:"ZodUnion"},A(e))),"create");var Xn=kn,On=class ql extends B{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof ql}};u(On,"ZodUnknown");On.create=u(t=>new On(l({typeName:"ZodUnknown"},A(t))),"create");var It=On,Cn=class Gl extends B{_parse(e){if(this._getType(e)!==x.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.void,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Gl}};u(Cn,"ZodVoid");Cn.create=u(t=>new Cn(l({typeName:"ZodVoid"},A(t))),"create");var js=Cn,Dv=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,jt=u((t,e,r=!0)=>{if(typeof t!="object")throw new Fa("Input must be an object");let n=u(i=>{let o=i;return e?.nullable&&(o=o.nullable()),e?.optional&&(o=o.optional()),e?.passtrough&&typeof o.passthrough=="function"&&(o=o.passthrough()),o},"applyOptions"),a=Object.entries(t).reduce((i,[o,d])=>{if(d===null)i[o]=n(S.null());else switch(typeof d){case"string":i[o]=Dv.test(d)?n(S.string().datetime()):n(S.string());break;case"number":i[o]=n(S.number());break;case"boolean":i[o]=n(S.boolean());break;case"object":Array.isArray(d)?d.length===0?i[o]=n(S.array(S.unknown())):typeof d[0]=="object"?i[o]=n(S.array(jt(d[0],e,!1))):["string","number","boolean"].includes(typeof d[0])&&(i[o]=n(S.array(S[typeof d[0]]()))):i[o]=n(jt(d,e,!1));break;default:throw new Fa(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!r&&!s?S.object(a).passthrough():S.object(a)},"objectToZui");function Wl(){return{}}u(Wl,"parseAnyDef");function Hs(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=m(l({},t.errorMessage),{[e]:r}))}u(Hs,"addErrorMessage");function G(t,e,r,n,a){t[e]=r,Hs(t,e,n,a)}u(G,"setResponseValueAndErrors");function Jl(t,e){var r,n;let a={type:"array"};return((n=(r=t.type)==null?void 0:r._def)==null?void 0:n.typeName)!=="ZodAny"&&(a.items=K(t.type._def,m(l({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&G(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&G(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(G(a,"minItems",t.exactLength.value,t.exactLength.message,e),G(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}u(Jl,"parseArrayDef");function Yl(t,e){let r=l({type:"integer",format:"int64"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}u(Yl,"parseBigintDef");function Xl(t){return l({type:"boolean"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{})}u(Xl,"parseBooleanDef");function Ql(t,e){return K(t.type._def,e)}u(Ql,"parseBrandedDef");var Mv=u((t,e)=>K(t.innerType._def,e),"parseCatchDef");function ed(t,e){return e.dateStrategy=="integer"?jv(t,e):l({type:"string",format:"date-time"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{})}u(ed,"parseDateDef");var jv=u((t,e)=>{let r=l({type:"integer",format:"unix-time"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"&&G(r,"minimum",n.value,n.message,e);break;case"max":e.target==="jsonSchema7"&&G(r,"maximum",n.value,n.message,e);break}return r},"integerDateParser");function td(t,e){return m(l({},K(t.innerType._def,e)),{default:t.defaultValue()})}u(td,"parseDefaultDef");function rd(t,e){return e.effectStrategy==="input"?K(t.schema._def,e):{}}u(rd,"parseEffectsDef");function nd(t){return{type:"string",enum:t.values}}u(nd,"parseEnumDef");var Hv=u(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function ad(t,e){let r=[K(t.left._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","0"]})),K(t.right._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Hv(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:d}=o;i=Do(o,["additionalProperties"])}else n=void 0;a.push(i)}}),a.length?l({allOf:a},n):void 0}u(ad,"parseIntersectionDef");function sd(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}u(sd,"parseLiteralDef");var Yt={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$"};function Ns(t,e){let r=l({type:"string"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});function n(a){return e.patternStrategy==="escape"?Nv(a):a}if(u(n,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e);break;case"max":G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":tt(r,"email",a.message,e);break;case"format:idn-email":tt(r,"idn-email",a.message,e);break;case"pattern:zod":Be(r,Yt.email,a.message,e);break}break;case"url":tt(r,"uri",a.message,e);break;case"uuid":tt(r,"uuid",a.message,e);break;case"regex":Be(r,a.regex.source,a.message,e);break;case"cuid":Be(r,Yt.cuid,a.message,e);break;case"cuid2":Be(r,Yt.cuid2,a.message,e);break;case"startsWith":Be(r,"^"+n(a.value),a.message,e);break;case"endsWith":Be(r,n(a.value)+"$",a.message,e);break;case"datetime":tt(r,"date-time",a.message,e);break;case"length":G(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e),G(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"includes":{Be(r,n(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&tt(r,"ipv4",a.message,e),a.version!=="v4"&&tt(r,"ipv6",a.message,e);break}case"emoji":Be(r,Yt.emoji,a.message,e);break;case"ulid":{Be(r,Yt.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}u(Ns,"parseStringDef");var Nv=u(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),tt=u((t,e,r,n)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(l({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(l({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):G(t,"format",e,r,n)},"addFormat"),Be=u((t,e,r,n)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(l({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(l({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):G(t,"pattern",e,r,n)},"addPattern");function $s(t,e){var r,n,a,s,i;if(e.target==="openApi3"&&((r=t.keyType)==null?void 0:r._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((d,p)=>{var y;return m(l({},d),{[p]:(y=K(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"properties",p]})))!=null?y:{}})},{}),additionalProperties:!1};let o={type:"object",additionalProperties:(n=K(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:{}};if(e.target==="openApi3")return o;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let d=Object.entries(Ns(t.keyType._def,e)).reduce((p,[y,T])=>y==="type"?p:m(l({},p),{[y]:T}),{});return m(l({},o),{propertyNames:d})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return m(l({},o),{propertyNames:{enum:t.keyType._def.values}});return o}u($s,"parseRecordDef");function id(t,e){if(e.mapStrategy==="record")return $s(t,e);let r=K(t.keyType._def,m(l({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},n=K(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}u(id,"parseMapDef");function od(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(n.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n.filter(s=>typeof s=="string"||typeof s=="number")}}u(od,"parseNativeEnumDef");function ud(){return{not:{}}}u(ud,"parseNeverDef");function cd(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}u(cd,"parseNullDef");var In={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function ld(t,e){if(e.target==="openApi3")return Zo(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in In&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((a,s)=>{let i=In[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((a,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){let a=n.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(s=>!n.includes(s))],[])};return Zo(t,e)}u(ld,"parseUnionDef");var Zo=u((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>K(a._def,m(l({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),n=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(r.length)return e.unionStrategy==="anyOf"?l({anyOf:r},n):l({oneOf:r},n)},"asUnionOf");function dd(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:In[t.innerType._def.typeName],nullable:!0}:{type:[In[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=K(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath]}));return n&&m(l({},n),{nullable:!0})}let r=K(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return r&&{anyOf:[r,{type:"null"}]}}u(dd,"parseNullableDef");function fd(t,e){let r=l({type:"number"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Hs(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?G(r,"minimum",n.value,n.message,e):G(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),G(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?G(r,"maximum",n.value,n.message,e):G(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),G(r,"maximum",n.value,n.message,e));break;case"multipleOf":G(r,"multipleOf",n.value,n.message,e);break}return r}u(fd,"parseNumberDef");function pd(t,e){var r;let n=m(l({type:"object"},Object.entries(t.shape()).reduce((a,[s,i])=>{if(i===void 0||i._def===void 0)return a;let o=K(i._def,m(l({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return o===void 0?a:{properties:m(l({},a.properties),{[s]:o}),required:i.isOptional()?a.required:[...a.required,s]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(r=K(t.catchall._def,m(l({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:!0});return n.required.length||delete n.required,n}u(pd,"parseObjectDef");var $v=u((t,e)=>{var r;if(e.currentPath.toString()===((r=e.propertyPath)==null?void 0:r.toString()))return K(t.innerType._def,e);let n=K(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return n?{anyOf:[{not:{}},n]}:{}},"parseOptionalDef"),Uv=u((t,e)=>{if(e.pipeStrategy==="input")return K(t.in._def,e);if(e.pipeStrategy==="output")return K(t.out._def,e);let r=K(t.in._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","0"]})),n=K(t.out._def,m(l({},e),{currentPath:[...e.currentPath,"allOf",r?"1":"0"]}));return{allOf:[r,n].filter(a=>a!==void 0)}},"parsePipelineDef");function gd(t,e){return K(t.type._def,e)}u(gd,"parsePromiseDef");function md(t,e){let n={type:"array",uniqueItems:!0,items:K(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&G(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&G(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}u(md,"parseSetDef");function hd(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>K(r._def,m(l({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:K(t.rest._def,m(l({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>K(r._def,m(l({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[])}}u(hd,"parseTupleDef");function yd(){return{not:{}}}u(yd,"parseUndefinedDef");function vd(){return{}}u(vd,"parseUnknownDef");var Fv=u((t,e)=>K(t.innerType._def,e),"parseReadonlyDef");function _d(t){return{$ref:t.uri}}u(_d,"parseRefDef");function K(t,e,r=!1){let n=e.seen.get(t);if(n&&!r){let i=Lv(n,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=Kv(t,t.typeName,e);return s&&Vv(t,e,s),a.jsonSchema=s,s}u(K,"parseDef");var Lv=u((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:zv(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),zv=u((t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},"getRelativePath"),Kv=u((t,e,r)=>{switch(e){case"ZodString":return Ns(t,r);case"ZodNumber":return fd(t,r);case"ZodObject":return pd(t,r);case"ZodBigInt":return Yl(t,r);case"ZodBoolean":return Xl(t);case"ZodDate":return ed(t,r);case"ZodUndefined":return yd();case"ZodNull":return cd(r);case"ZodArray":return Jl(t,r);case"ZodUnion":case"ZodDiscriminatedUnion":return ld(t,r);case"ZodIntersection":return ad(t,r);case"ZodTuple":return hd(t,r);case"ZodRecord":return $s(t,r);case"ZodRef":return _d(t);case"ZodLiteral":return sd(t,r);case"ZodEnum":return nd(t);case"ZodNativeEnum":return od(t);case"ZodNullable":return dd(t,r);case"ZodOptional":return $v(t,r);case"ZodMap":return id(t,r);case"ZodSet":return md(t,r);case"ZodLazy":return K(t.getter()._def,r);case"ZodPromise":return gd(t,r);case"ZodNaN":case"ZodNever":return ud();case"ZodEffects":return rd(t,r);case"ZodAny":return Wl();case"ZodUnknown":return vd();case"ZodDefault":return td(t,r);case"ZodBranded":return Ql(t,r);case"ZodReadonly":return Fv(t,r);case"ZodCatch":return Mv(t,r);case"ZodPipeline":return Uv(t,r);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(n=>{})(e)}},"selectParser"),Vv=u((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),Object.assign(r,{[U]:l(l({},t[U]),r[U])}),r),"addMeta"),Ao={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},qv=u(t=>typeof t=="string"?m(l({},Ao),{name:t}):l(l({},Ao),t),"getDefaultOptions"),Gv=u(t=>{let e=qv(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return m(l({},e),{currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))})},"getRefs"),Wv=u((t,e)=>{var r;let n=Gv(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((d,[p,y])=>{var T;return m(l({},d),{[p]:(T=K(y._def,m(l({},n),{currentPath:[...n.basePath,n.definitionPath,p]}),!0))!=null?T:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(r=K(t._def,s===void 0?n:m(l({},n),{currentPath:[...n.basePath,n.definitionPath,s]}),!1))!=null?r:{},o=s===void 0?a?m(l({},i),{[n.definitionPath]:a}):i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:m(l({},a),{[s]:i})};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),Qn=u((t,e={target:"openApi3"})=>{let r=Wv(t,e);return e.$schemaUrl===!1?delete r.$schema:typeof e.$schemaUrl=="string"&&(r.$schema=e.$schemaUrl),r},"zuiToJsonSchema"),Jv=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],Pb=yt.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),bd=u(t=>ge.create().displayAs({id:"variable",params:l({type:t?.type||"any"},t?.params)}),"variable"),Td=u(t=>ge.create().displayAs({id:"conversation",params:l({},t?.params)}),"conversation"),Pd=u(t=>ge.create().displayAs({id:"user",params:l({},t?.params)}),"user"),Ed=u(t=>ge.create().displayAs({id:"message",params:l({},t?.params)}),"message"),xd=u(t=>ge.create().displayAs({id:"agent",params:l({},t?.params)}),"agent"),Sd=u(t=>ge.create().displayAs({id:"event",params:l({},t?.params)}),"event"),wd=u(t=>ge.create().displayAs({id:"table",params:l({},t?.params)}),"table"),kd=u(t=>ge.create().displayAs({id:"tablerow",params:l({},t?.params)}),"tablerow"),Od=u(t=>ge.create().displayAs({id:"intent",params:l({},t?.params)}),"intent"),Cd=u(()=>yt.create(Jv).displayAs({id:"dropdown",params:{}}),"aimodel"),Id=u(t=>ge.create().displayAs({id:"datasource",params:l({},t)}),"datasource"),Zd=u(t=>ge.create().displayAs({id:"knowledgebase",params:l({},t)}),"knowledgebase"),Ad={object:ct.lazycreate},Rd=u((t,e={message:`Input not instance of ${t.name}`})=>_s(r=>r instanceof t,e),"instanceOfType"),Us=ge.create,Fs=Wn.create,Bd=xs.create,Dd=Nn.create,Ls=$n.create,Md=Ln.create,jd=Ms.create,Hd=Yn.create,Nd=Gn.create,$d=ur.create,Ud=It.create,Fd=qe.create,Ld=js.create,zd=Dt.create,Kd=ct.create,Vd=ct.strictCreate,qd=Xn.create,Gd=bs.create,Wd=zn.create,Jd=lt.create,Yd=Ss.create,Xd=ws.create,Qd=pr.create,ef=Es.create,tf=ks.create,rf=Ps.create,nf=Kn.create,af=Vn.create,sf=yt.create,of=qn.create,uf=fr.create,ss=We.create,cf=He.create,lf=ut.create,Yv=lr.create,df=We.createWithPreprocess,ff=Jn.create,pf=u(()=>Us().optional(),"ostring"),gf=u(()=>Fs().optional(),"onumber"),mf=u(()=>Ls().optional(),"oboolean"),hf=B.fromJsonSchema,yf=B.fromObject,vf={string:u(t=>ge.create(m(l({},t),{coerce:!0})),"string"),number:u(t=>Wn.create(m(l({},t),{coerce:!0})),"number"),boolean:u(t=>$n.create(m(l({},t),{coerce:!0})),"boolean"),bigint:u(t=>Nn.create(m(l({},t),{coerce:!0})),"bigint"),date:u(t=>Ln.create(m(l({},t),{coerce:!0})),"date")},_f=C,v=S,bf=u((t,e)=>t.anyOf.length?t.anyOf.length===1?le(t.anyOf[0],m(l({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>le(r,m(l({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),Xv=u(t=>{var e;return(e=t[U])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),Qv=u(t=>"z.any()","parseDefault"),e_=u((t,e)=>`z.union([${t.type.map(r=>le(m(l({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),t_=u((t,e)=>`z.any().refine((value) => !${le(t.not,m(l({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),r_=u(t=>"z.null()","parseNull"),n_=u(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),a_=u((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function fe(t,e,r){var n;let a=t[e],s="";if(a!==void 0){let i=r({value:a,json:JSON.stringify(a)});if(i){let o=i[0],d=i.length===3?i[1]:"",p=i.length===3?i[2]:i[1];s+=o,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(s+=d+JSON.stringify(t.errorMessage[e])),s+=p}}return s}u(fe,"withMessage");var er=Symbol("Original index"),s_=u(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[er]:r}:{[er]:r,not:{}});else{if(er in n)return t;e.push(m(l({},n),{[er]:r}))}}return e},"ensureOriginalIndex");function cr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return le(r,m(l({},e),{path:[...e.path,"allOf",r[er]]}))}else{let[r,n]=n_(s_(t.allOf));return`z.intersection(${cr({allOf:r},e)}, ${cr({allOf:n},e)})`}}u(cr,"parseAllOf");var i_=u((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,a)=>le(n,m(l({},e),{path:[...e.path,"items",a]})))}])`;let r=t.items?`z.array(${le(t.items,m(l({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=fe(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),o_=u(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),u_=u(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),c_=u((t,e)=>{let r=le(t.if,m(l({},e),{path:[...e.path,"if"]})),n=le(t.then,m(l({},e),{path:[...e.path,"then"]})),a=le(t.else,m(l({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${a}]).superRefine((value,ctx) => {
|
|
30
|
+
${T.join(" | ")}`;case v.ZodFirstPartyTypeKind.ZodIntersection:return`${L(o.left,s)} & ${L(o.right,s)}`;case v.ZodFirstPartyTypeKind.ZodTuple:return o.items.length===0?"":`[${o.items.map(H=>L(H,s)).join(", ")}]`;case v.ZodFirstPartyTypeKind.ZodRecord:let P=L(o.keyType,s),D=L(o.valueType,s);return`${Z(o.description)} { [key: ${P}]: ${D} }`;case v.ZodFirstPartyTypeKind.ZodMap:return`Map<${L(o.keyType,s)}, ${L(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodSet:return`Set<${L(o.valueType,s)}>`;case v.ZodFirstPartyTypeKind.ZodFunction:let K=L(new no(o.args),s),G=L(new ao(o.returns),s);return`${Z(o.description)}
|
|
31
|
+
(${K}) => ${G}`;case v.ZodFirstPartyTypeKind.ZodLazy:return L(o.getter(),s);case v.ZodFirstPartyTypeKind.ZodLiteral:let se=qo(o.value);return`${Z(o.description)}
|
|
32
|
+
${se}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(je).join(" | ");case v.ZodFirstPartyTypeKind.ZodEffects:return L(o.schema,s);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new cu(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${L(o.innerType,s)} | undefined`;case v.ZodFirstPartyTypeKind.ZodNullable:return`${L(o.innerType,s)} | null`;case v.ZodFirstPartyTypeKind.ZodDefault:return L(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodCatch:return L(o.innerType,s);case v.ZodFirstPartyTypeKind.ZodPromise:return`Promise<${L(o.type,s)}>`;case v.ZodFirstPartyTypeKind.ZodBranded:return L(o.type,s);case v.ZodFirstPartyTypeKind.ZodPipeline:return L(o.in,s);case v.ZodFirstPartyTypeKind.ZodSymbol:return`${Z(o.description)} symbol`.trim();case v.ZodFirstPartyTypeKind.ZodReadonly:return`Readonly<${L(o.innerType,s)}>`;case v.ZodFirstPartyTypeKind.ZodRef:return Wo(o.uri);default:M.assertNever(o)}}u(L,"sUnwrapZod");var Lg=u((t,e)=>{if(t.props.type==="none")return L(t.props.schema,e);let r=Z(t.props.schema.description),n=t.props.schema.describe(""),a=L(n,e);if(t.props.type==="variable")return ro(`${r}declare const ${t.props.identifier}: ${a};`);let s=t.props.args.length>0?`<${t.props.args.map(Wo).join(", ")}>`:"";return ro(`${r}type ${t.props.identifier}${s} = ${a};`)},"unwrapDeclaration"),zg=u(t=>t.declaration?t.declaration===!0?"variable":t.declaration:"none","getDeclarationType"),Kg=u((t,e)=>{let r=zg(e),n=t.getReferences();if(r==="none"){if(n.length>0)throw new za;return new Nr({type:"none",schema:t})}let a="title"in t.ui?t.ui.title:null;if(!a)throw new du;if(r==="variable"){if(n.length>0)throw new za;return new Nr({type:"variable",identifier:a,schema:t})}return new Nr({type:"type",identifier:a,schema:t,args:n})},"getDeclarationProps"),Vg=typeof global=="object"&&global&&global.Object===Object&&global,vu=Vg,qg=typeof self=="object"&&self&&self.Object===Object&&self,Gg=vu||qg||Function("return this")(),Ue=Gg,Wg=Ue.Symbol,Ve=Wg,_u=Object.prototype,Jg=_u.hasOwnProperty,Yg=_u.toString,Xt=Ve?Ve.toStringTag:void 0;function bu(t){var e=Jg.call(t,Xt),r=t[Xt];try{t[Xt]=void 0;var n=!0}catch{}var a=Yg.call(t);return n&&(e?t[Xt]=r:delete t[Xt]),a}u(bu,"getRawTag");var Xg=bu,Qg=Object.prototype,em=Qg.toString;function Tu(t){return em.call(t)}u(Tu,"objectToString");var tm=Tu,rm="[object Null]",nm="[object Undefined]",so=Ve?Ve.toStringTag:void 0;function Pu(t){return t==null?t===void 0?nm:rm:so&&so in Object(t)?Xg(t):tm(t)}u(Pu,"baseGetTag");var Ut=Pu;function Eu(t){return t!=null&&typeof t=="object"}u(Eu,"isObjectLike");var Rt=Eu,am="[object Symbol]";function xu(t){return typeof t=="symbol"||Rt(t)&&Ut(t)==am}u(xu,"isSymbol");var us=xu;function Su(t,e){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}u(Su,"arrayMap");var sm=Su,im=Array.isArray,$e=im,om=1/0,io=Ve?Ve.prototype:void 0,oo=io?io.toString:void 0;function cs(t){if(typeof t=="string")return t;if($e(t))return sm(t,cs)+"";if(us(t))return oo?oo.call(t):"";var e=t+"";return e=="0"&&1/t==-om?"-0":e}u(cs,"baseToString");var um=cs;function wu(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}u(wu,"isObject");var ls=wu;function ku(t){return t}u(ku,"identity");var cm=ku,lm="[object AsyncFunction]",dm="[object Function]",fm="[object GeneratorFunction]",pm="[object Proxy]";function Ou(t){if(!ls(t))return!1;var e=Ut(t);return e==dm||e==fm||e==lm||e==pm}u(Ou,"isFunction");var Cu=Ou,gm=Ue["__core-js_shared__"],Ha=gm,uo=function(){var t=/[^.]+$/.exec(Ha&&Ha.keys&&Ha.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function Iu(t){return!!uo&&uo in t}u(Iu,"isMasked");var mm=Iu,hm=Function.prototype,ym=hm.toString;function Zu(t){if(t!=null){try{return ym.call(t)}catch{}try{return t+""}catch{}}return""}u(Zu,"toSource");var dt=Zu,vm=/[\\^$.*+?()[\]{}|]/g,_m=/^\[object .+?Constructor\]$/,bm=Function.prototype,Tm=Object.prototype,Pm=bm.toString,Em=Tm.hasOwnProperty,xm=RegExp("^"+Pm.call(Em).replace(vm,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Au(t){if(!ls(t)||mm(t))return!1;var e=Cu(t)?xm:_m;return e.test(dt(t))}u(Au,"baseIsNative");var Sm=Au;function Ru(t,e){return t?.[e]}u(Ru,"getValue");var wm=Ru;function Bu(t,e){var r=wm(t,e);return Sm(r)?r:void 0}u(Bu,"getNative");var ft=Bu,km=ft(Ue,"WeakMap"),Ka=km,Om=function(){try{var t=ft(Object,"defineProperty");return t({},"",{}),t}catch{}}(),co=Om,Cm=9007199254740991,Im=/^(?:0|[1-9]\d*)$/;function Du(t,e){var r=typeof t;return e=e??Cm,!!e&&(r=="number"||r!="symbol"&&Im.test(t))&&t>-1&&t%1==0&&t<e}u(Du,"isIndex");var Mu=Du;function ju(t,e,r){e=="__proto__"&&co?co(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}u(ju,"baseAssignValue");var Zm=ju;function Hu(t,e){return t===e||t!==t&&e!==e}u(Hu,"eq");var Nu=Hu,Am=9007199254740991;function $u(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Am}u($u,"isLength");var ds=$u;function Uu(t){return t!=null&&ds(t.length)&&!Cu(t)}u(Uu,"isArrayLike");var Rm=Uu,Bm=Object.prototype;function Fu(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Bm;return t===r}u(Fu,"isPrototype");var Dm=Fu;function Lu(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}u(Lu,"baseTimes");var Mm=Lu,jm="[object Arguments]";function zu(t){return Rt(t)&&Ut(t)==jm}u(zu,"baseIsArguments");var lo=zu,Ku=Object.prototype,Hm=Ku.hasOwnProperty,Nm=Ku.propertyIsEnumerable,$m=lo(function(){return arguments}())?lo:function(t){return Rt(t)&&Hm.call(t,"callee")&&!Nm.call(t,"callee")},Vu=$m;function qu(){return!1}u(qu,"stubFalse");var Um=qu,Gu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,fo=Gu&&typeof module=="object"&&module&&!module.nodeType&&module,Fm=fo&&fo.exports===Gu,po=Fm?Ue.Buffer:void 0,Lm=po?po.isBuffer:void 0,zm=Lm||Um,Va=zm,Km="[object Arguments]",Vm="[object Array]",qm="[object Boolean]",Gm="[object Date]",Wm="[object Error]",Jm="[object Function]",Ym="[object Map]",Xm="[object Number]",Qm="[object Object]",eh="[object RegExp]",th="[object Set]",rh="[object String]",nh="[object WeakMap]",ah="[object ArrayBuffer]",sh="[object DataView]",ih="[object Float32Array]",oh="[object Float64Array]",uh="[object Int8Array]",ch="[object Int16Array]",lh="[object Int32Array]",dh="[object Uint8Array]",fh="[object Uint8ClampedArray]",ph="[object Uint16Array]",gh="[object Uint32Array]",X={};X[ih]=X[oh]=X[uh]=X[ch]=X[lh]=X[dh]=X[fh]=X[ph]=X[gh]=!0;X[Km]=X[Vm]=X[ah]=X[qm]=X[sh]=X[Gm]=X[Wm]=X[Jm]=X[Ym]=X[Xm]=X[Qm]=X[eh]=X[th]=X[rh]=X[nh]=!1;function Wu(t){return Rt(t)&&ds(t.length)&&!!X[Ut(t)]}u(Wu,"baseIsTypedArray");var mh=Wu;function Ju(t){return function(e){return t(e)}}u(Ju,"baseUnary");var hh=Ju,Yu=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ar=Yu&&typeof module=="object"&&module&&!module.nodeType&&module,yh=ar&&ar.exports===Yu,Na=yh&&vu.process,vh=function(){try{var t=ar&&ar.require&&ar.require("util").types;return t||Na&&Na.binding&&Na.binding("util")}catch{}}(),go=vh,mo=go&&go.isTypedArray,_h=mo?hh(mo):mh,Xu=_h,bh=Object.prototype,Th=bh.hasOwnProperty;function Qu(t,e){var r=$e(t),n=!r&&Vu(t),a=!r&&!n&&Va(t),s=!r&&!n&&!a&&Xu(t),i=r||n||a||s,o=i?Mm(t.length,String):[],d=o.length;for(var p in t)(e||Th.call(t,p))&&!(i&&(p=="length"||a&&(p=="offset"||p=="parent")||s&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||Mu(p,d)))&&o.push(p);return o}u(Qu,"arrayLikeKeys");var Ph=Qu;function ec(t,e){return function(r){return t(e(r))}}u(ec,"overArg");var Eh=ec,xh=Eh(Object.keys,Object),Sh=xh,wh=Object.prototype,kh=wh.hasOwnProperty;function tc(t){if(!Dm(t))return Sh(t);var e=[];for(var r in Object(t))kh.call(t,r)&&r!="constructor"&&e.push(r);return e}u(tc,"baseKeys");var Oh=tc;function rc(t){return Rm(t)?Ph(t):Oh(t)}u(rc,"keys");var fs=rc,Ch=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ih=/^\w*$/;function nc(t,e){if($e(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||us(t)?!0:Ih.test(t)||!Ch.test(t)||e!=null&&t in Object(e)}u(nc,"isKey");var ps=nc,Zh=ft(Object,"create"),sr=Zh;function ac(){this.__data__=sr?sr(null):{},this.size=0}u(ac,"hashClear");var Ah=ac;function sc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}u(sc,"hashDelete");var Rh=sc,Bh="__lodash_hash_undefined__",Dh=Object.prototype,Mh=Dh.hasOwnProperty;function ic(t){var e=this.__data__;if(sr){var r=e[t];return r===Bh?void 0:r}return Mh.call(e,t)?e[t]:void 0}u(ic,"hashGet");var jh=ic,Hh=Object.prototype,Nh=Hh.hasOwnProperty;function oc(t){var e=this.__data__;return sr?e[t]!==void 0:Nh.call(e,t)}u(oc,"hashHas");var $h=oc,Uh="__lodash_hash_undefined__";function uc(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=sr&&e===void 0?Uh:e,this}u(uc,"hashSet");var Fh=uc;function pt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(pt,"Hash");pt.prototype.clear=Ah;pt.prototype.delete=Rh;pt.prototype.get=jh;pt.prototype.has=$h;pt.prototype.set=Fh;var ho=pt;function cc(){this.__data__=[],this.size=0}u(cc,"listCacheClear");var Lh=cc;function lc(t,e){for(var r=t.length;r--;)if(Nu(t[r][0],e))return r;return-1}u(lc,"assocIndexOf");var Bn=lc,zh=Array.prototype,Kh=zh.splice;function dc(t){var e=this.__data__,r=Bn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Kh.call(e,r,1),--this.size,!0}u(dc,"listCacheDelete");var Vh=dc;function fc(t){var e=this.__data__,r=Bn(e,t);return r<0?void 0:e[r][1]}u(fc,"listCacheGet");var qh=fc;function pc(t){return Bn(this.__data__,t)>-1}u(pc,"listCacheHas");var Gh=pc;function gc(t,e){var r=this.__data__,n=Bn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}u(gc,"listCacheSet");var Wh=gc;function gt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(gt,"ListCache");gt.prototype.clear=Lh;gt.prototype.delete=Vh;gt.prototype.get=qh;gt.prototype.has=Gh;gt.prototype.set=Wh;var Dn=gt,Jh=ft(Ue,"Map"),ir=Jh;function mc(){this.size=0,this.__data__={hash:new ho,map:new(ir||Dn),string:new ho}}u(mc,"mapCacheClear");var Yh=mc;function hc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}u(hc,"isKeyable");var Xh=hc;function yc(t,e){var r=t.__data__;return Xh(e)?r[typeof e=="string"?"string":"hash"]:r.map}u(yc,"getMapData");var Mn=yc;function vc(t){var e=Mn(this,t).delete(t);return this.size-=e?1:0,e}u(vc,"mapCacheDelete");var Qh=vc;function _c(t){return Mn(this,t).get(t)}u(_c,"mapCacheGet");var ey=_c;function bc(t){return Mn(this,t).has(t)}u(bc,"mapCacheHas");var ty=bc;function Tc(t,e){var r=Mn(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}u(Tc,"mapCacheSet");var ry=Tc;function mt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u(mt,"MapCache");mt.prototype.clear=Yh;mt.prototype.delete=Qh;mt.prototype.get=ey;mt.prototype.has=ty;mt.prototype.set=ry;var jn=mt,ny="Expected a function";function Hn(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(ny);var r=u(function(){var n=arguments,a=e?e.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);var i=t.apply(this,n);return r.cache=s.set(a,i)||s,i},"memoized");return r.cache=new(Hn.Cache||jn),r}u(Hn,"memoize");Hn.Cache=jn;var ay=Hn,sy=500;function Pc(t){var e=ay(t,function(n){return r.size===sy&&r.clear(),n}),r=e.cache;return e}u(Pc,"memoizeCapped");var iy=Pc,oy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,uy=/\\(\\)?/g,cy=iy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(oy,function(r,n,a,s){e.push(a?s.replace(uy,"$1"):n||r)}),e}),ly=cy;function Ec(t){return t==null?"":um(t)}u(Ec,"toString");var dy=Ec;function xc(t,e){return $e(t)?t:ps(t,e)?[t]:ly(dy(t))}u(xc,"castPath");var Sc=xc,fy=1/0;function wc(t){if(typeof t=="string"||us(t))return t;var e=t+"";return e=="0"&&1/t==-fy?"-0":e}u(wc,"toKey");var Nn=wc;function kc(t,e){e=Sc(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nn(e[r++])];return r&&r==n?t:void 0}u(kc,"baseGet");var Oc=kc;function Cc(t,e,r){var n=t==null?void 0:Oc(t,e);return n===void 0?r:n}u(Cc,"get");var py=Cc;function Ic(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}u(Ic,"arrayPush");var gy=Ic;function Zc(){this.__data__=new Dn,this.size=0}u(Zc,"stackClear");var my=Zc;function Ac(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}u(Ac,"stackDelete");var hy=Ac;function Rc(t){return this.__data__.get(t)}u(Rc,"stackGet");var yy=Rc;function Bc(t){return this.__data__.has(t)}u(Bc,"stackHas");var vy=Bc,_y=200;function Dc(t,e){var r=this.__data__;if(r instanceof Dn){var n=r.__data__;if(!ir||n.length<_y-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new jn(n)}return r.set(t,e),this.size=r.size,this}u(Dc,"stackSet");var by=Dc;function ht(t){var e=this.__data__=new Dn(t);this.size=e.size}u(ht,"Stack");ht.prototype.clear=my;ht.prototype.delete=hy;ht.prototype.get=yy;ht.prototype.has=vy;ht.prototype.set=by;var $r=ht;function Mc(t,e){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var i=t[r];e(i,r,t)&&(s[a++]=i)}return s}u(Mc,"arrayFilter");var Ty=Mc;function jc(){return[]}u(jc,"stubArray");var Py=jc,Ey=Object.prototype,xy=Ey.propertyIsEnumerable,yo=Object.getOwnPropertySymbols,Sy=yo?function(t){return t==null?[]:(t=Object(t),Ty(yo(t),function(e){return xy.call(t,e)}))}:Py,wy=Sy;function Hc(t,e,r){var n=e(t);return $e(t)?n:gy(n,r(t))}u(Hc,"baseGetAllKeys");var ky=Hc;function Nc(t){return ky(t,fs,wy)}u(Nc,"getAllKeys");var vo=Nc,Oy=ft(Ue,"DataView"),qa=Oy,Cy=ft(Ue,"Promise"),Ga=Cy,Iy=ft(Ue,"Set"),Wa=Iy,_o="[object Map]",Zy="[object Object]",bo="[object Promise]",To="[object Set]",Po="[object WeakMap]",Eo="[object DataView]",Ay=dt(qa),Ry=dt(ir),By=dt(Ga),Dy=dt(Wa),My=dt(Ka),nt=Ut;(qa&&nt(new qa(new ArrayBuffer(1)))!=Eo||ir&&nt(new ir)!=_o||Ga&&nt(Ga.resolve())!=bo||Wa&&nt(new Wa)!=To||Ka&&nt(new Ka)!=Po)&&(nt=u(function(t){var e=Ut(t),r=e==Zy?t.constructor:void 0,n=r?dt(r):"";if(n)switch(n){case Ay:return Eo;case Ry:return _o;case By:return bo;case Dy:return To;case My:return Po}return e},"getTag"));var xo=nt,jy=Ue.Uint8Array,So=jy,Hy="__lodash_hash_undefined__";function $c(t){return this.__data__.set(t,Hy),this}u($c,"setCacheAdd");var Ny=$c;function Uc(t){return this.__data__.has(t)}u(Uc,"setCacheHas");var $y=Uc;function or(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new jn;++e<r;)this.add(t[e])}u(or,"SetCache");or.prototype.add=or.prototype.push=Ny;or.prototype.has=$y;var Uy=or;function Fc(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}u(Fc,"arraySome");var Fy=Fc;function Lc(t,e){return t.has(e)}u(Lc,"cacheHas");var Ly=Lc,zy=1,Ky=2;function zc(t,e,r,n,a,s){var i=r&zy,o=t.length,d=e.length;if(o!=d&&!(i&&d>o))return!1;var p=s.get(t),y=s.get(e);if(p&&y)return p==e&&y==t;var T=-1,k=!0,P=r&Ky?new Uy:void 0;for(s.set(t,e),s.set(e,t);++T<o;){var D=t[T],K=e[T];if(n)var G=i?n(K,D,T,e,t,s):n(D,K,T,t,e,s);if(G!==void 0){if(G)continue;k=!1;break}if(P){if(!Fy(e,function(se,q){if(!Ly(P,q)&&(D===se||a(D,se,r,n,s)))return P.push(q)})){k=!1;break}}else if(!(D===K||a(D,K,r,n,s))){k=!1;break}}return s.delete(t),s.delete(e),k}u(zc,"equalArrays");var Kc=zc;function Vc(t){var e=-1,r=Array(t.size);return t.forEach(function(n,a){r[++e]=[a,n]}),r}u(Vc,"mapToArray");var Vy=Vc;function qc(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}u(qc,"setToArray");var qy=qc,Gy=1,Wy=2,Jy="[object Boolean]",Yy="[object Date]",Xy="[object Error]",Qy="[object Map]",ev="[object Number]",tv="[object RegExp]",rv="[object Set]",nv="[object String]",av="[object Symbol]",sv="[object ArrayBuffer]",iv="[object DataView]",wo=Ve?Ve.prototype:void 0,$a=wo?wo.valueOf:void 0;function Gc(t,e,r,n,a,s,i){switch(r){case iv:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case sv:return!(t.byteLength!=e.byteLength||!s(new So(t),new So(e)));case Jy:case Yy:case ev:return Nu(+t,+e);case Xy:return t.name==e.name&&t.message==e.message;case tv:case nv:return t==e+"";case Qy:var o=Vy;case rv:var d=n&Gy;if(o||(o=qy),t.size!=e.size&&!d)return!1;var p=i.get(t);if(p)return p==e;n|=Wy,i.set(t,e);var y=Kc(o(t),o(e),n,a,s,i);return i.delete(t),y;case av:if($a)return $a.call(t)==$a.call(e)}return!1}u(Gc,"equalByTag");var ov=Gc,uv=1,cv=Object.prototype,lv=cv.hasOwnProperty;function Wc(t,e,r,n,a,s){var i=r&uv,o=vo(t),d=o.length,p=vo(e),y=p.length;if(d!=y&&!i)return!1;for(var T=d;T--;){var k=o[T];if(!(i?k in e:lv.call(e,k)))return!1}var P=s.get(t),D=s.get(e);if(P&&D)return P==e&&D==t;var K=!0;s.set(t,e),s.set(e,t);for(var G=i;++T<d;){k=o[T];var se=t[k],q=e[k];if(n)var H=i?n(q,se,k,e,t,s):n(se,q,k,t,e,s);if(!(H===void 0?se===q||a(se,q,r,n,s):H)){K=!1;break}G||(G=k=="constructor")}if(K&&!G){var J=t.constructor,ce=e.constructor;J!=ce&&"constructor"in t&&"constructor"in e&&!(typeof J=="function"&&J instanceof J&&typeof ce=="function"&&ce instanceof ce)&&(K=!1)}return s.delete(t),s.delete(e),K}u(Wc,"equalObjects");var dv=Wc,fv=1,ko="[object Arguments]",Oo="[object Array]",Hr="[object Object]",pv=Object.prototype,Co=pv.hasOwnProperty;function Jc(t,e,r,n,a,s){var i=$e(t),o=$e(e),d=i?Oo:xo(t),p=o?Oo:xo(e);d=d==ko?Hr:d,p=p==ko?Hr:p;var y=d==Hr,T=p==Hr,k=d==p;if(k&&Va(t)){if(!Va(e))return!1;i=!0,y=!1}if(k&&!y)return s||(s=new $r),i||Xu(t)?Kc(t,e,r,n,a,s):ov(t,e,d,r,n,a,s);if(!(r&fv)){var P=y&&Co.call(t,"__wrapped__"),D=T&&Co.call(e,"__wrapped__");if(P||D){var K=P?t.value():t,G=D?e.value():e;return s||(s=new $r),a(K,G,r,n,s)}}return k?(s||(s=new $r),dv(t,e,r,n,a,s)):!1}u(Jc,"baseIsEqualDeep");var gv=Jc;function gs(t,e,r,n,a){return t===e?!0:t==null||e==null||!Rt(t)&&!Rt(e)?t!==t&&e!==e:gv(t,e,r,n,gs,a)}u(gs,"baseIsEqual");var ms=gs,mv=1,hv=2;function Yc(t,e,r,n){var a=r.length,s=a,i=!n;if(t==null)return!s;for(t=Object(t);a--;){var o=r[a];if(i&&o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++a<s;){o=r[a];var d=o[0],p=t[d],y=o[1];if(i&&o[2]){if(p===void 0&&!(d in t))return!1}else{var T=new $r;if(n)var k=n(p,y,d,t,e,T);if(!(k===void 0?ms(y,p,mv|hv,n,T):k))return!1}}return!0}u(Yc,"baseIsMatch");var yv=Yc;function Xc(t){return t===t&&!ls(t)}u(Xc,"isStrictComparable");var Qc=Xc;function el(t){for(var e=fs(t),r=e.length;r--;){var n=e[r],a=t[n];e[r]=[n,a,Qc(a)]}return e}u(el,"getMatchData");var vv=el;function tl(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}u(tl,"matchesStrictComparable");var rl=tl;function nl(t){var e=vv(t);return e.length==1&&e[0][2]?rl(e[0][0],e[0][1]):function(r){return r===t||yv(r,t,e)}}u(nl,"baseMatches");var _v=nl;function al(t,e){return t!=null&&e in Object(t)}u(al,"baseHasIn");var bv=al;function sl(t,e,r){e=Sc(e,t);for(var n=-1,a=e.length,s=!1;++n<a;){var i=Nn(e[n]);if(!(s=t!=null&&r(t,i)))break;t=t[i]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&ds(a)&&Mu(i,a)&&($e(t)||Vu(t)))}u(sl,"hasPath");var Tv=sl;function il(t,e){return t!=null&&Tv(t,e,bv)}u(il,"hasIn");var Pv=il,Ev=1,xv=2;function ol(t,e){return ps(t)&&Qc(e)?rl(Nn(t),e):function(r){var n=py(r,t);return n===void 0&&n===e?Pv(r,t):ms(e,n,Ev|xv)}}u(ol,"baseMatchesProperty");var Sv=ol;function ul(t){return function(e){return e?.[t]}}u(ul,"baseProperty");var wv=ul;function cl(t){return function(e){return Oc(e,t)}}u(cl,"basePropertyDeep");var kv=cl;function ll(t){return ps(t)?wv(Nn(t)):kv(t)}u(ll,"property");var Ov=ll;function dl(t){return typeof t=="function"?t:t==null?cm:typeof t=="object"?$e(t)?Sv(t[0],t[1]):_v(t):Ov(t)}u(dl,"baseIteratee");var Cv=dl;function fl(t){return function(e,r,n){for(var a=-1,s=Object(e),i=n(e),o=i.length;o--;){var d=i[t?o:++a];if(r(s[d],d,s)===!1)break}return e}}u(fl,"createBaseFor");var Iv=fl,Zv=Iv(),Av=Zv;function pl(t,e){return t&&Av(t,e,fs)}u(pl,"baseForOwn");var Rv=pl;function gl(t,e){return ms(t,e)}u(gl,"isEqual");var ot=gl;function ml(t,e){var r={};return e=Cv(e,3),Rv(t,function(n,a,s){Zm(r,a,e(n,a,s))}),r}u(ml,"mapValues");var Bv=ml;function hs(t){return ae(t)}u(hs,"toTypescriptSchema");function ae(t){let r=t._def;switch(r.typeName){case v.ZodFirstPartyTypeKind.ZodString:return`${Z(r.description)}z.string()`.trim();case v.ZodFirstPartyTypeKind.ZodNumber:return`${Z(r.description)}z.number()`.trim();case v.ZodFirstPartyTypeKind.ZodNaN:return`${Z(r.description)}z.nan()`.trim();case v.ZodFirstPartyTypeKind.ZodBigInt:return`${Z(r.description)}z.bigint()`.trim();case v.ZodFirstPartyTypeKind.ZodBoolean:return`${Z(t._def.description)}z.boolean()`.trim();case v.ZodFirstPartyTypeKind.ZodDate:return`${Z(r.description)}z.date()`.trim();case v.ZodFirstPartyTypeKind.ZodUndefined:return`${Z(r.description)}z.undefined()`.trim();case v.ZodFirstPartyTypeKind.ZodNull:return`${Z(r.description)}z.null()`.trim();case v.ZodFirstPartyTypeKind.ZodAny:return`${Z(r.description)}z.any()`.trim();case v.ZodFirstPartyTypeKind.ZodUnknown:return`${Z(r.description)}z.unknown()`.trim();case v.ZodFirstPartyTypeKind.ZodNever:return`${Z(r.description)}z.never()`.trim();case v.ZodFirstPartyTypeKind.ZodVoid:return`${Z(r.description)}z.void()`.trim();case v.ZodFirstPartyTypeKind.ZodArray:return`z.array(${ae(r.type)})`;case v.ZodFirstPartyTypeKind.ZodObject:let n=Bv(r.shape(),ce=>ce instanceof v.Schema?ae(ce):"z.any()");return[`${Z(r.description)}z.object({`,...Object.entries(n).map(([ce,Le])=>` ${ce}: ${Le},`),"})"].join(`
|
|
33
|
+
`).trim();case v.ZodFirstPartyTypeKind.ZodUnion:let a=r.options.map(ae);return`${Z(r.description)}z.union([${a.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let s=r.options.map(ae),i=je(r.discriminator);return`${Z(r.description)}z.discriminatedUnion(${i}, [${s.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodIntersection:let o=ae(r.left),d=ae(r.right);return`${Z(r.description)}z.intersection(${o}, ${d})`.trim();case v.ZodFirstPartyTypeKind.ZodTuple:let p=r.items.map(ae);return`${Z(r.description)}z.tuple([${p.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodRecord:let y=ae(r.keyType),T=ae(r.valueType);return`${Z(r.description)}z.record(${y}, ${T})`.trim();case v.ZodFirstPartyTypeKind.ZodMap:let k=ae(r.keyType),P=ae(r.valueType);return`${Z(r.description)}z.map(${k}, ${P})`.trim();case v.ZodFirstPartyTypeKind.ZodSet:return`${Z(r.description)}z.set(${ae(r.valueType)})`.trim();case v.ZodFirstPartyTypeKind.ZodFunction:let D=r.args.items.map(ae),K=D.length?`.args(${D.join(", ")})`:"",G=ae(r.returns);return`${Z(r.description)}z.function()${K}.returns(${G})`.trim();case v.ZodFirstPartyTypeKind.ZodLazy:return`${Z(r.description)}z.lazy(() => ${ae(r.getter())})`.trim();case v.ZodFirstPartyTypeKind.ZodLiteral:let se=je(r.value);return`${Z(r.description)}z.literal(${se})`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:let q=r.values.map(je);return`${Z(r.description)}z.enum([${q.join(", ")}])`.trim();case v.ZodFirstPartyTypeKind.ZodEffects:throw new rt(v.ZodFirstPartyTypeKind.ZodEffects);case v.ZodFirstPartyTypeKind.ZodNativeEnum:throw new rt(v.ZodFirstPartyTypeKind.ZodNativeEnum);case v.ZodFirstPartyTypeKind.ZodOptional:return`${Z(r.description)}z.optional(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodNullable:return`${Z(r.description)}z.nullable(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodDefault:let H=Go(r.defaultValue());return`${Z(r.description)}${ae(r.innerType)}.default(${H})`.trim();case v.ZodFirstPartyTypeKind.ZodCatch:throw new rt(v.ZodFirstPartyTypeKind.ZodCatch);case v.ZodFirstPartyTypeKind.ZodPromise:return`${Z(r.description)}z.promise(${ae(r.type)})`.trim();case v.ZodFirstPartyTypeKind.ZodBranded:throw new rt(v.ZodFirstPartyTypeKind.ZodBranded);case v.ZodFirstPartyTypeKind.ZodPipeline:throw new rt(v.ZodFirstPartyTypeKind.ZodPipeline);case v.ZodFirstPartyTypeKind.ZodSymbol:throw new rt(v.ZodFirstPartyTypeKind.ZodSymbol);case v.ZodFirstPartyTypeKind.ZodReadonly:return`${Z(r.description)}z.readonly(${ae(r.innerType)})`.trim();case v.ZodFirstPartyTypeKind.ZodRef:let J=je(r.uri);return`${Z(r.description)}z.ref(${J})`.trim();default:M.assertNever(r)}}u(ae,"sUnwrapZod");var hl=class{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}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}};u(hl,"ParseInputLazyPath");var Se=hl,Io=u((t,e)=>{if(Dt(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Ie(t.common.issues);return this._error=r,this._error}}},"handleResult"),yl=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,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}dereference(e){return this}getReferences(){return[]}_getType(e){return Me(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ye,ctx:{common:e.parent.common,data:e.data,parsedType:Me(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(cr(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let a={common:{issues:[],async:(n=r?.async)!=null?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Me(e)},s=this._parseSync({data:e,path:a.path,parent:a});return Io(a,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Me(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(cr(a)?a:Promise.resolve(a));return Io(n,s)}refine(e,r){let n=u(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let i=e(a),o=u(()=>s.addIssue(l({code:_.custom},n(a))),"setError");return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new We({schema:this,typeName:"ZodEffects",effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return He.create(this,this._def)}nullable(){return ut.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mt.create(this,this._def)}promise(){return gr.create(this,this._def)}or(e){return Qn.create([this,e],this._def)}and(e){return Kn.create(this,e,this._def)}transform(e){return new We(m(l({},A(this._def)),{schema:this,typeName:"ZodEffects",effect:{type:"transform",transform:e}}))}default(e){let r=typeof e=="function"?e:()=>e;return new fr(m(l({},A(this._def)),{innerType:this,defaultValue:r,typeName:"ZodDefault"}))}brand(){return new Fn(l({typeName:"ZodBranded",type:this},A(this._def)))}catch(e){let r=typeof e=="function"?e:()=>e;return new Ln(m(l({},A(this._def)),{innerType:this,catchValue:r,typeName:"ZodCatch"}))}describe(e){let r=this.constructor;return new r(m(l({},this._def),{description:e}))}pipe(e){return Yn.create(this,e)}readonly(){return mr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}metadata(e){for(let[r,n]of Object.entries(e))this._def[U]=m(l({},this._def[U]),{[r]:n});return this}getMetadata(){return l({},this._def[U])}setMetadata(e){this._def[U]=l({},e)}get ui(){let e=this._getMetadataRoot();return l({},e._def[U])}_setZuiMeta(e,r){let n=this._getMetadataRoot();n._def[U]=m(l({},n._def[U]),{[e]:r})}_getMetadataRoot(){let e=this._def;switch(e.typeName){case"ZodNullable":case"ZodDefault":case"ZodOptional":case"ZodReadonly":return e.innerType;case"ZodEffects":return e.schema;default:return this}}displayAs(e){var r,n,a;return(a=(r=this._def)[n=U])!=null||(r[n]={}),this._def[U].displayAs=[e.id,e.params],this}title(e){return this._setZuiMeta("title",e),this}hidden(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("hidden",r),this}disabled(e){let r;return e===void 0?r=!0:typeof e=="function"?r=e.toString():r=e,this._setZuiMeta("disabled",r),this}placeholder(e){return this._setZuiMeta("placeholder",e),this}toJsonSchema(e){return ea(this,e)}toTypescript(e){return Wr(this,e)}toTypescriptSchema(){return hs(this)}async toTypescriptAsync(e){let r=Wr(this,m(l({},e),{formatter:void 0}));return e?.formatter&&(r=await e.formatter(r)),r}static fromObject(e,r){return Ht(e,r)}static fromJsonSchema(e){return hr(e)}};u(yl,"ZodType");var B=yl,ys=(t=>(t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodRef="ZodRef",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly",t))(ys||{}),M;(t=>{t.assertEqual=u(a=>a,"assertEqual");function e(a){}t.assertIs=e,u(e,"assertIs");function r(a){throw new Error("assertNever called")}t.assertNever=r,u(r,"assertNever"),t.arrayToEnum=u(a=>{let s={};for(let i of a)s[i]=i;return s},"arrayToEnum"),t.getValidEnumValues=u(a=>{let s=(0,t.objectKeys)(a).filter(o=>typeof a[a[o]]!="number"),i={};for(let o of s)i[o]=a[o];return(0,t.objectValues)(i)},"getValidEnumValues"),t.objectValues=u(a=>(0,t.objectKeys)(a).map(function(s){return a[s]}),"objectValues"),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=u((a,s)=>{for(let i of a)if(s(i))return i},"find"),t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,u(n,"joinValues"),t.jsonStringifyReplacer=u((a,s)=>typeof s=="bigint"?s.toString():s,"jsonStringifyReplacer"),t.compareFunctions=u((a,s)=>a.toString()===s.toString(),"compareFunctions")})(M||(M={}));var Jr;(t=>{t.mergeShapes=u((e,r)=>l(l({},e),r),"mergeShapes")})(Jr||(Jr={}));var x=M.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Me=u(t=>{switch(typeof t){case"undefined":return x.undefined;case"string":return x.string;case"number":return isNaN(t)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(t)?x.array:t===null?x.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?x.promise:typeof Map<"u"&&t instanceof Map?x.map:typeof Set<"u"&&t instanceof Set?x.set:typeof Date<"u"&&t instanceof Date?x.date:x.object;default:return x.unknown}},"getParsedType");function A(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a,[U]:t?.[U]}:{errorMap:u((i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:n??o.defaultError}:{message:r??o.defaultError},"customMap"),description:a,[U]:t?.[U]}}u(A,"processCreateParams");var vs=u((t,e)=>{let r;switch(t.code){case _.invalid_type:t.received===x.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case _.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,M.jsonStringifyReplacer)}`;break;case _.unrecognized_keys:r=`Unrecognized key(s) in object: ${M.joinValues(t.keys,", ")}`;break;case _.invalid_union:r="Invalid input";break;case _.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${M.joinValues(t.options)}`;break;case _.invalid_enum_value:r=`Invalid enum value. Expected ${M.joinValues(t.options)}, received '${t.received}'`;break;case _.invalid_arguments:r="Invalid function arguments";break;case _.invalid_return_type:r="Invalid function return type";break;case _.invalid_date:r="Invalid date";break;case _.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:M.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case _.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case _.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case _.custom:r="Invalid input";break;case _.invalid_intersection_types:r="Intersection results could not be merged";break;case _.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case _.not_finite:r="Number must be finite";break;case _.unresolved_reference:r="Unresolved reference";break;default:r=e.defaultError,M.assertNever(t)}return{message:r}},"errorMap"),Zo=vs,_=M.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","unresolved_reference"]),vl=u(t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Yr=class _l extends Error{constructor(e){super(),this.issues=[],this.addIssue=u(n=>{this.issues=[...this.issues,n]},"addIssue"),this.addIssues=u((n=[])=>{this.issues=[...this.issues,...n]},"addIssues");let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},a=u(s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,d=0;for(;d<i.path.length;){let p=i.path[d];d===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(r(i))):o[p]=o[p]||{_errors:[]},o=o[p],d++}}},"processError");return a(this),n}static assert(e){if(!(e instanceof _l))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,M.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};u(Yr,"ZodError");Yr.create=u(t=>new Yr(t),"create");var Ie=Yr,bl=vs;function _s(t){bl=t}u(_s,"setErrorMap");function Bt(){return bl}u(Bt,"getErrorMap");var ur=u(t=>{var e;let{data:r,path:n,errorMaps:a,issueData:s}=t,i=[...n,...s.path||[]],o=m(l({},s),{path:i}),d="",p=a.filter(y=>!!y).slice().reverse();for(let y of p)d=y(o,{data:r,defaultError:d}).message;return m(l({},s),{path:i,message:(e=s.message)!=null?e:d})},"makeIssue"),Tl=[];function E(t,e){let r=ur({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Bt(),vs].filter(n=>!!n)});t.common.issues.push(r)}u(E,"addIssueToContext");var Pl=class El{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let a of r){if(a.status==="aborted")return C;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return El.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let a of r){let{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return C;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};u(Pl,"ParseStatus");var ye=Pl,C=Object.freeze({status:"aborted"}),it=u(t=>({status:"dirty",value:t}),"DIRTY"),pe=u(t=>({status:"valid",value:t}),"OK"),Xr=u(t=>t.status==="aborted","isAborted"),Qr=u(t=>t.status==="dirty","isDirty"),Dt=u(t=>t.status==="valid","isValid"),cr=u(t=>typeof Promise<"u"&&t instanceof Promise,"isAsync"),O;(t=>{t.errToObj=u(e=>typeof e=="string"?{message:e}:e||{},"errToObj"),t.toString=u(e=>typeof e=="string"?e:e?.message,"toString")})(O||(O={}));var en=class xl extends B{constructor(){super(...arguments),this._any=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof xl}};u(en,"ZodAny");en.create=u(t=>new en(l({typeName:"ZodAny"},A(t))),"create");var lr=en,tn=class wt extends B{dereference(e){return new wt(m(l({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}isEqual(e){var r,n,a,s,i,o;return e instanceof wt?ot((r=this._def.exactLength)==null?void 0:r.value,(n=e._def.exactLength)==null?void 0:n.value)&&ot((a=this._def.maxLength)==null?void 0:a.value,(s=e._def.maxLength)==null?void 0:s.value)&&ot((i=this._def.minLength)==null?void 0:i.value,(o=e._def.minLength)==null?void 0:o.value)&&this._def.type.isEqual(e._def.type):!1}_parse(e){let{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==x.array)return E(r,{code:_.invalid_type,expected:x.array,received:r.parsedType}),C;if(a.exactLength!==null){let i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(E(r,{code:i?_.too_big:_.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(E(r,{code:_.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(E(r,{code:_.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new Se(r,i,r.path,o)))).then(i=>ye.mergeArray(n,i));let s=[...r.data].map((i,o)=>a.type._parseSync(new Se(r,i,r.path,o)));return ye.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new wt(m(l({},this._def),{minLength:{value:e,message:O.toString(r)}}))}max(e,r){return new wt(m(l({},this._def),{maxLength:{value:e,message:O.toString(r)}}))}length(e,r){return new wt(m(l({},this._def),{exactLength:{value:e,message:O.toString(r)}}))}nonempty(e){return this.min(1,e)}};u(tn,"ZodArray");tn.create=u((t,e)=>new tn(l({type:t,minLength:null,maxLength:null,exactLength:null,typeName:"ZodArray"},A(e))),"create");var Mt=tn,Dv={compare:ot},Sl=class{constructor(e=[],r={}){this._options=l(l({},Dv),r),this._items=[];for(let n of e)this.add(n)}get items(){return[...this._items]}get size(){return this._items.length}has(e){return this._items.some(r=>this._options.compare(r,e))}add(e){this.has(e)||this._items.push(e)}isEqual(e){return this.size!==e.size?!1:this.isSubsetOf(e)&&e.isSubsetOf(this)}isSubsetOf(e){return this.size>e.size?!1:this._items.every(r=>e.has(r))}};u(Sl,"CustomSet");var ue=Sl,rn=class Ur extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==x.bigint){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.bigint,received:s.parsedType}),C}let n,a=new ye;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}isEqual(e){if(!(e instanceof Ur)||this._def.coerce!==e._def.coerce)return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,a){return new Ur(m(l({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(a)}]}))}_addCheck(e){return new Ur(m(l({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};u(rn,"ZodBigInt");rn.create=u(t=>{var e;return new rn(l({checks:[],typeName:"ZodBigInt",coerce:(e=t?.coerce)!=null?e:!1},A(t)))},"create");var $n=rn,nn=class wl extends B{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==x.boolean){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.boolean,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof wl?this._def.coerce===e._def.coerce:!1}};u(nn,"ZodBoolean");nn.create=u(t=>new nn(l({typeName:"ZodBoolean",coerce:t?.coerce||!1},A(t))),"create");var Un=nn,kl=Symbol("zod_brand"),Ol=class Cl extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}isEqual(e){return e instanceof Cl?this._def.type.isEqual(e._def.type):!1}};u(Ol,"ZodBranded");var Fn=Ol,an=class Il extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=m(l({},r),{common:m(l({},r.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:l({},n)});return cr(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ie(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}isEqual(e){return e instanceof Il?this._def.innerType.isEqual(e._def.innerType)&&M.compareFunctions(this._def.catchValue,e._def.catchValue):!1}};u(an,"ZodCatch");an.create=u((t,e)=>new an(l({innerType:t,typeName:"ZodCatch",catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},A(e))),"create");var Ln=an,bs=u((t,e={},r)=>t?lr.create().superRefine((n,a)=>{var s,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,d=(i=(s=o.fatal)!=null?s:r)!=null?i:!0,p=typeof o=="string"?{message:o}:o;a.addIssue(m(l({code:"custom"},p),{fatal:d}))}}):lr.create(),"custom"),sn=class Ja extends B{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.date,received:s.parsedType}),C}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_date}),C}let n=new ye,a;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):M.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ja(m(l({},this._def),{checks:[...this._def.checks,e]}))}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}isEqual(e){if(!(e instanceof Ja))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)&&this._def.coerce===e._def.coerce}};u(sn,"ZodDate");sn.create=u(t=>new sn(l({checks:[],coerce:t?.coerce||!1,typeName:"ZodDate"},A(t))),"create");var zn=sn,on=class Ya extends B{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===x.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}dereference(e){return new Ya(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}isEqual(e){return e instanceof Ya?this._def.innerType.isEqual(e._def.innerType)&&ot(this._def.defaultValue(),e._def.defaultValue()):!1}};u(on,"ZodDefault");on.create=u((t,e,r)=>new on(l({innerType:t,typeName:"ZodDefault",defaultValue:typeof e=="function"?e:()=>e},A(r))),"create");var fr=on,Fe=u(t=>Array.from(new Set(t)),"unique"),De=u(t=>t instanceof Vn?De(t.schema):t instanceof We?De(t.innerType()):t instanceof qn?[t.value]:t instanceof yt?t.options:t instanceof Gn?M.objectValues(t.enum):t instanceof fr?De(t._def.innerType):t instanceof Xn?[void 0]:t instanceof Wn?[null]:t instanceof He?[void 0,...De(t.unwrap())]:t instanceof ut?[null,...De(t.unwrap())]:t instanceof Fn||t instanceof mr?De(t.unwrap()):t instanceof Ln?De(t._def.innerType):[],"getDiscriminator"),Zl=class kt extends B{dereference(e){let r=this.options.map(a=>a.dereference(e)),n=kt._getOptionsMap(this.discriminator,r);return new kt(m(l({},this._def),{options:r,optionsMap:n}))}getReferences(){return Fe(this.options.flatMap(e=>e.getReferences()))}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.object)return E(r,{code:_.invalid_type,expected:x.object,received:r.parsedType}),C;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(E(r,{code:_.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let a=kt._getOptionsMap(e,r);return new kt(l({typeName:"ZodDiscriminatedUnion",discriminator:e,options:r,optionsMap:a},A(n)))}static _getOptionsMap(e,r){let n=new Map;for(let a of r){let s=De(a.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,a)}}return n}isEqual(e){if(!(e instanceof kt)||this._def.discriminator!==e._def.discriminator)return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue(this._def.options,{compare:r}),a=new ue(e._def.options,{compare:r});return n.isEqual(a)}};u(Zl,"ZodDiscriminatedUnion");var Ts=Zl;function pr(t,e){return new yt(l({values:t,typeName:"ZodEnum"},A(e)))}u(pr,"createZodEnum");var Ps=class Fr extends B{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{expected:M.joinValues(n),received:r.parsedType,code:_.invalid_type}),C}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return E(r,{received:r.data,code:_.invalid_enum_value,options:n}),C}return pe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Fr.create(e,l(l({},this._def),r))}exclude(e,r=this._def){return Fr.create(this.options.filter(n=>!e.includes(n)),l(l({},this._def),r))}isEqual(e){if(!(e instanceof Fr))return!1;let r=new ue(this._def.values),n=new ue(e._def.values);return r.isEqual(n)}};u(Ps,"ZodEnum");Ps.create=pr;var yt=Ps,Al=class Ot extends B{constructor(){super(...arguments),this.validate=this.implement}dereference(e){let r=this._def.args.dereference(e),n=this._def.returns.dereference(e);return new Ot(m(l({},this._def),{args:r,returns:n}))}getReferences(){return Fe([...this._def.args.getReferences(),...this._def.returns.getReferences()])}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.function)return E(r,{code:_.invalid_type,expected:x.function,received:r.parsedType}),C;function n(o,d){return ur({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bt(),Zo].filter(p=>!!p),issueData:{code:_.invalid_arguments,argumentsError:d}})}u(n,"makeArgsIssue");function a(o,d){return ur({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Bt(),Zo].filter(p=>!!p),issueData:{code:_.invalid_return_type,returnTypeError:d}})}u(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof gr){let o=this;return pe(async function(...d){let p=new Ie([]),y=await o._def.args.parseAsync(d,s).catch(P=>{throw p.addIssue(n(d,P)),p}),T=await Reflect.apply(i,this,y);return await o._def.returns._def.type.parseAsync(T,s).catch(P=>{throw p.addIssue(a(T,P)),p})})}else{let o=this;return pe(function(...d){let p=o._def.args.safeParse(d,s);if(!p.success)throw new Ie([n(d,p.error)]);let y=Reflect.apply(i,this,p.data),T=o._def.returns.safeParse(y,s);if(!T.success)throw new Ie([a(y,T.error)]);return T.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ot(m(l({},this._def),{args:lt.create(e).rest(Zt.create())}))}returns(e){return new Ot(m(l({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Ot(l({args:e||lt.create([]).rest(Zt.create()),returns:r||Zt.create(),typeName:"ZodFunction"},A(n)))}isEqual(e){return e instanceof Ot&&this._def.args.isEqual(e._def.args)&&this._def.returns.isEqual(e._def.returns)}};u(Al,"ZodFunction");var Es=Al;function un(t,e){let r=Me(t),n=Me(e);if(t===e)return{valid:!0,data:t};if(r===x.object&&n===x.object){let a=M.objectKeys(e),s=M.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i=l(l({},t),e);for(let o of s){let d=un(t[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(r===x.array&&n===x.array){if(t.length!==e.length)return{valid:!1};let a=[];for(let s=0;s<t.length;s++){let i=t[s],o=e[s],d=un(i,o);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===x.date&&n===x.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}u(un,"mergeValues");var cn=class Xa extends B{dereference(e){return new Xa(m(l({},this._def),{left:this._def.left.dereference(e),right:this._def.right.dereference(e)}))}getReferences(){return Fe([...this._def.left.getReferences(),...this._def.right.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=u((s,i)=>{if(Xr(s)||Xr(i))return C;let o=un(s.value,i.value);return o.valid?((Qr(s)||Qr(i))&&r.dirty(),{status:r.value,value:o.data}):(E(n,{code:_.invalid_intersection_types}),C)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}isEqual(e){if(!(e instanceof Xa))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue([this._def.left,this._def.right],{compare:r}),a=new ue([e._def.left,e._def.right],{compare:r});return n.isEqual(a)}};u(cn,"ZodIntersection");cn.create=u((t,e,r)=>new cn(l({left:t,right:e,typeName:"ZodIntersection"},A(r))),"create");var Kn=cn,ln=class Rl extends B{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}isEqual(e){return e instanceof Rl?this._def.getter().isEqual(e._def.getter()):!1}};u(ln,"ZodLazy");ln.create=u((t,e)=>new ln(l({getter:t,typeName:"ZodLazy"},A(e))),"create");var Vn=ln,dn=class Bl extends B{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return E(r,{received:r.data,code:_.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}isEqual(e){return e instanceof Bl?ot(this._def.value,e._def.value):!1}};u(dn,"ZodLiteral");dn.create=u((t,e)=>new dn(l({value:t,typeName:"ZodLiteral"},A(e))),"create");var qn=dn,fn=class Qa extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new Qa(m(l({},this._def),{keyType:r,valueType:n}))}getReferences(){return Fe([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.map)return E(n,{code:_.invalid_type,expected:x.map,received:n.parsedType}),C;let a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,d],p)=>({key:a._parse(new Se(n,o,n.path,[p,"key"])),value:s._parse(new Se(n,d,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let d of i){let p=await d.key,y=await d.value;if(p.status==="aborted"||y.status==="aborted")return C;(p.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(p.value,y.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let d of i){let p=d.key,y=d.value;if(p.status==="aborted"||y.status==="aborted")return C;(p.status==="dirty"||y.status==="dirty")&&r.dirty(),o.set(p.value,y.value)}return{status:r.value,value:o}}}isEqual(e){return!(!(e instanceof Qa)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};u(fn,"ZodMap");fn.create=u((t,e,r)=>new fn(l({valueType:e,keyType:t,typeName:"ZodMap"},A(r))),"create");var xs=fn,pn=class Dl extends B{_parse(e){if(this._getType(e)!==x.nan){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.nan,received:n.parsedType}),C}return{status:"valid",value:e.data}}isEqual(e){return e instanceof Dl}};u(pn,"ZodNaN");pn.create=u(t=>new pn(l({typeName:"ZodNaN"},A(t))),"create");var Ss=pn,gn=class Ml extends B{_parse(e){let r=M.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==x.string&&n.parsedType!==x.number){let a=M.objectValues(r);return E(n,{expected:M.joinValues(a),received:n.parsedType,code:_.invalid_type}),C}if(r.indexOf(e.data)===-1){let a=M.objectValues(r);return E(n,{received:n.data,code:_.invalid_enum_value,options:a}),C}return pe(e.data)}get enum(){return this._def.values}isEqual(e){return e instanceof Ml?ot(this._def.values,e._def.values):!1}};u(gn,"ZodNativeEnum");gn.create=u((t,e)=>new gn(l({values:t,typeName:"ZodNativeEnum"},A(e))),"create");var Gn=gn,mn=class jl extends B{_parse(e){let r=this._getOrReturnCtx(e);return E(r,{code:_.invalid_type,expected:x.never,received:r.parsedType}),C}isEqual(e){return e instanceof jl}};u(mn,"ZodNever");mn.create=u(t=>new mn(l({typeName:"ZodNever"},A(t))),"create");var qe=mn,hn=class Hl extends B{_parse(e){if(this._getType(e)!==x.null){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.null,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Hl}};u(hn,"ZodNull");hn.create=u(t=>new hn(l({typeName:"ZodNull"},A(t))),"create");var Wn=hn,yn=class es extends B{dereference(e){return new es(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===x.null?pe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof es?this._def.innerType.isEqual(e._def.innerType):!1}};u(yn,"ZodNullable");yn.create=u((t,e)=>new yn(l({innerType:t,typeName:"ZodNullable"},A(e))),"create");var ut=yn;function Nl(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(t.toFixed(a).replace(".","")),i=parseInt(e.toFixed(a).replace(".",""));return s%i/Math.pow(10,a)}u(Nl,"floatSafeRemainder");var vn=class Lr extends B{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.number,received:s.parsedType}),C}let n,a=new ye;for(let s of this._def.checks)s.kind==="int"?M.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:_.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Nl(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),E(n,{code:_.not_finite,message:s.message}),a.dirty()):M.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,O.toString(r))}gt(e,r){return this.setLimit("min",e,!1,O.toString(r))}lte(e,r){return this.setLimit("max",e,!0,O.toString(r))}lt(e,r){return this.setLimit("max",e,!1,O.toString(r))}setLimit(e,r,n,a){return new Lr(m(l({},this._def),{checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:O.toString(a)}]}))}_addCheck(e){return new Lr(m(l({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&M.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}isEqual(e){if(!(e instanceof Lr))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}};u(vn,"ZodNumber");vn.create=u(t=>new vn(l({checks:[],typeName:"ZodNumber",coerce:t?.coerce||!1},A(t))),"create");var Jn=vn;function st(t){if(t instanceof ct){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=He.create(st(n))}return new ct(m(l({},t._def),{shape:u(()=>e,"shape")}))}else return t instanceof Mt?new Mt(m(l({},t._def),{type:st(t.element)})):t instanceof He?He.create(st(t.unwrap())):t instanceof ut?ut.create(st(t.unwrap())):t instanceof lt?lt.create(t.items.map(e=>st(e))):t}u(st,"deepPartialify");var Ge=class xe extends B{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=M.objectKeys(e);return this._cached={shape:e,keys:r}}dereference(e){let r=this._def.shape(),n={};for(let a in r)n[a]=r[a].dereference(e);return new xe(m(l({},this._def),{shape:u(()=>n,"shape")}))}getReferences(){let e=this._def.shape(),r=[];for(let n in e)r.push(...e[n].getReferences());return Fe(r)}_parse(e){if(this._getType(e)!==x.object){let p=this._getOrReturnCtx(e);return E(p,{code:_.invalid_type,expected:x.object,received:p.parsedType}),C}let{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof qe&&this._def.unknownKeys==="strip"))for(let p in a.data)i.includes(p)||o.push(p);let d=[];for(let p of i){let y=s[p],T=a.data[p];d.push({key:{status:"valid",value:p},value:y._parse(new Se(a,T,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof qe){let p=this._def.unknownKeys;if(p==="passthrough")for(let y of o)d.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(p==="strict")o.length>0&&(E(a,{code:_.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let y of o){let T=a.data[y];d.push({key:{status:"valid",value:y},value:p._parse(new Se(a,T,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of d){let T=await y.key;p.push({key:T,value:await y.value,alwaysSet:y.alwaysSet})}return p}).then(p=>ye.mergeObjectSync(n,p)):ye.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new xe(l(m(l({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:u((r,n)=>{var a,s,i,o;let d=(i=(s=(a=this._def).errorMap)==null?void 0:s.call(a,r,n).message)!=null?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=O.errToObj(e).message)!=null?o:d}:{message:d}},"errorMap")}:{}))}strip(){return new xe(m(l({},this._def),{unknownKeys:"strip"}))}passthrough(){return new xe(m(l({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new xe(m(l({},this._def),{shape:u(()=>l(l({},this._def.shape()),e),"shape")}))}merge(e){return new xe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:u(()=>l(l({},this._def.shape()),e._def.shape()),"shape"),typeName:"ZodObject"})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new xe(m(l({},this._def),{catchall:e}))}pick(e){let r={};return M.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}omit(e){let r={};return M.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}deepPartial(){return st(this)}partial(e){let r={};return M.objectKeys(this.shape).forEach(n=>{let a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a?.optional()}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}required(e){let r={};return M.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof He;)s=s._def.innerType;r[n]=s}}),new xe(m(l({},this._def),{shape:u(()=>r,"shape")}))}keyof(){return pr(M.objectKeys(this.shape))}isEqual(e){if(!(e instanceof xe)||!this._def.catchall.isEqual(e._def.catchall)||this._def.unknownKeys!==e._def.unknownKeys)return!1;let r=this._def.shape(),n=e._def.shape(),a=u((o,d)=>o[0]===d[0]&&o[1].isEqual(d[1]),"compare"),s=new ue(Object.entries(r),{compare:a}),i=new ue(Object.entries(n),{compare:a});return s.isEqual(i)}};u(Ge,"ZodObject");Ge.create=u((t,e)=>new Ge(l({shape:u(()=>t,"shape"),unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},A(e))),"create");Ge.strictCreate=u((t,e)=>new Ge(l({shape:u(()=>t,"shape"),unknownKeys:"strict",catchall:qe.create(),typeName:"ZodObject"},A(e))),"strictCreate");Ge.lazycreate=u((t,e)=>new Ge(l({shape:t,unknownKeys:"strip",catchall:qe.create(),typeName:"ZodObject"},A(e))),"lazycreate");var ct=Ge,_n=class ts extends B{dereference(e){return new ts(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){return this._getType(e)===x.undefined?pe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}isEqual(e){return e instanceof ts?this._def.innerType.isEqual(e._def.innerType):!1}};u(_n,"ZodOptional");_n.create=u((t,e)=>new _n(l({innerType:t,typeName:"ZodOptional"},A(e))),"create");var He=_n,$l=class zr extends B{dereference(e){return new zr(m(l({},this._def),{in:this._def.in.dereference(e),out:this._def.out.dereference(e)}))}getReferences(){return Fe([...this._def.in.getReferences(),...this._def.out.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return u(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?C:s.status==="dirty"?(r.dirty(),it(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?C:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new zr({in:e,out:r,typeName:"ZodPipeline"})}isEqual(e){return!(!(e instanceof zr)||!this._def.in.isEqual(e._def.in)||!this._def.out.isEqual(e._def.out))}};u($l,"ZodPipeline");var Yn=$l,bn=class rs extends B{unwrap(){return this._def.type}dereference(e){return new rs(m(l({},this._def),{type:this._def.type.dereference(e)}))}getReferences(){return this._def.type.getReferences()}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.promise&&r.common.async===!1)return E(r,{code:_.invalid_type,expected:x.promise,received:r.parsedType}),C;let n=r.parsedType===x.promise?r.data:Promise.resolve(r.data);return pe(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}isEqual(e){return e instanceof rs?this._def.type.isEqual(e._def.type):!1}};u(bn,"ZodPromise");bn.create=u((t,e)=>new bn(l({type:t,typeName:"ZodPromise"},A(e))),"create");var gr=bn,Tn=class ns extends B{dereference(e){return new ns(m(l({},this._def),{innerType:this._def.innerType.dereference(e)}))}getReferences(){return this._def.innerType.getReferences()}_parse(e){let r=this._def.innerType._parse(e);return Dt(r)&&(r.value=Object.freeze(r.value)),r}unwrap(){return this._def.innerType}isEqual(e){return e instanceof ns?this._def.innerType.isEqual(e._def.innerType):!1}};u(Tn,"ZodReadonly");Tn.create=u((t,e)=>new Tn(l({innerType:t,typeName:"ZodReadonly"},A(e))),"create");var mr=Tn,Ul=class er extends B{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}dereference(e){let r=this._def.keyType.dereference(e),n=this._def.valueType.dereference(e);return new er(m(l({},this._def),{keyType:r,valueType:n}))}getReferences(){return Fe([...this._def.keyType.getReferences(),...this._def.valueType.getReferences()])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.object)return E(n,{code:_.invalid_type,expected:x.object,received:n.parsedType}),C;let a=[],s=this._def.keyType,i=this._def.valueType;for(let o in n.data)a.push({key:s._parse(new Se(n,o,n.path,o)),value:i._parse(new Se(n,n.data[o],n.path,o))});return n.common.async?ye.mergeObjectAsync(r,a):ye.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof B?new er(l({keyType:e,valueType:r,typeName:"ZodRecord"},A(n))):new er(l({keyType:ge.create(),valueType:e,typeName:"ZodRecord"},A(r)))}isEqual(e){return!(!(e instanceof er)||!this._def.keyType.isEqual(e._def.keyType)||!this._def.valueType.isEqual(e._def.valueType))}};u(Ul,"ZodRecord");var ws=Ul,Pn=class Fl extends B{dereference(e){let r=e[this._def.uri];return r||this}getReferences(){return[this._def.uri]}_parse(e){let r=this._getOrReturnCtx(e);return E(r,{code:_.unresolved_reference}),C}isOptional(){return!1}isNullable(){return!1}isEqual(e){return e instanceof Fl?this._def.uri===e._def.uri:!1}};u(Pn,"ZodRef");Pn.create=u(t=>new Pn({typeName:"ZodRef",uri:t}),"create");var ks=Pn,En=class tr extends B{dereference(e){return new tr(m(l({},this._def),{valueType:this._def.valueType.dereference(e)}))}getReferences(){return this._def.valueType.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.set)return E(n,{code:_.invalid_type,expected:x.set,received:n.parsedType}),C;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(E(n,{code:_.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(E(n,{code:_.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function i(d){let p=new Set;for(let y of d){if(y.status==="aborted")return C;y.status==="dirty"&&r.dirty(),p.add(y.value)}return{status:r.value,value:p}}u(i,"finalizeSet");let o=[...n.data.values()].map((d,p)=>s._parse(new Se(n,d,n.path,p)));return n.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,r){return new tr(m(l({},this._def),{minSize:{value:e,message:O.toString(r)}}))}max(e,r){return new tr(m(l({},this._def),{maxSize:{value:e,message:O.toString(r)}}))}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}isEqual(e){var r,n,a,s;if(!(e instanceof tr))return!1;let i=(r=this._def.minSize)==null?void 0:r.value,o=(n=e._def.minSize)==null?void 0:n.value;if(i!==o)return!1;let d=(a=this._def.maxSize)==null?void 0:a.value,p=(s=e._def.maxSize)==null?void 0:s.value;return d!==p?!1:this._def.valueType.isEqual(e._def.valueType)}};u(En,"ZodSet");En.create=u((t,e)=>new En(l({valueType:t,minSize:null,maxSize:null,typeName:"ZodSet"},A(e))),"create");var Os=En,Cs=/^c[^\s-]{8,}$/i,Is=/^[a-z][a-z0-9]*$/,Zs=/^[0-9A-HJKMNP-TV-Z]{26}$/,As=/^[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,Rs=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ll="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",zl=u(t=>t===Ll,"isEmojiRegex"),Ua,Bs=/^(((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}))$/,Ds=/^(([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})))$/,Ms=u(t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex");function Kl(t,e){return!!((e==="v4"||!e)&&Bs.test(t)||(e==="v6"||!e)&&Ds.test(t))}u(Kl,"isValidIP");var xn=class Ct extends B{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){let s=this._getOrReturnCtx(e);return E(s,{code:_.invalid_type,expected:x.string,received:s.parsedType}),C}let n=new ye,a;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),E(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?E(a,{code:_.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&E(a,{code:_.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Rs.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"email",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Ua||(Ua=new RegExp(Ll,"u")),Ua.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"emoji",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")As.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"uuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")Cs.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Is.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"cuid2",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Zs.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ulid",code:_.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),E(a,{validation:"url",code:_.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"regex",code:_.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Ms(s).test(e.data)||(a=this._getOrReturnCtx(e,a),E(a,{code:_.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Kl(e.data,s.version)||(a=this._getOrReturnCtx(e,a),E(a,{validation:"ip",code:_.invalid_string,message:s.message}),n.dirty()):M.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),l({validation:r,code:_.invalid_string},O.errToObj(n)))}_addCheck(e){return new Ct(m(l({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(l({kind:"email"},O.errToObj(e)))}url(e){return this._addCheck(l({kind:"url"},O.errToObj(e)))}emoji(e){return this._addCheck(l({kind:"emoji"},O.errToObj(e)))}uuid(e){return this._addCheck(l({kind:"uuid"},O.errToObj(e)))}cuid(e){return this._addCheck(l({kind:"cuid"},O.errToObj(e)))}cuid2(e){return this._addCheck(l({kind:"cuid2"},O.errToObj(e)))}ulid(e){return this._addCheck(l({kind:"ulid"},O.errToObj(e)))}ip(e){return this._addCheck(l({kind:"ip"},O.errToObj(e)))}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck(l({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!=null?r:!1},O.errToObj(e?.message)))}regex(e,r){return this._addCheck(l({kind:"regex",regex:e},O.errToObj(r)))}includes(e,r){return this._addCheck(l({kind:"includes",value:e,position:r?.position},O.errToObj(r?.message)))}startsWith(e,r){return this._addCheck(l({kind:"startsWith",value:e},O.errToObj(r)))}endsWith(e,r){return this._addCheck(l({kind:"endsWith",value:e},O.errToObj(r)))}min(e,r){return this._addCheck(l({kind:"min",value:e},O.errToObj(r)))}max(e,r){return this._addCheck(l({kind:"max",value:e},O.errToObj(r)))}length(e,r){return this._addCheck(l({kind:"length",value:e},O.errToObj(r)))}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new Ct(m(l({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}secret(){return this._def[U]=m(l({},this._def[U]),{secret:!0}),this}toLowerCase(){return new Ct(m(l({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new Ct(m(l({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}isEqual(e){if(!(e instanceof Ct))return!1;let r=new ue(this._def.checks),n=new ue(e._def.checks);return r.isEqual(n)}};u(xn,"ZodString");xn.create=u(t=>{var e;return new xn(l({checks:[],typeName:"ZodString",coerce:(e=t?.coerce)!=null?e:!1},A(t)))},"create");var ge=xn,Sn=class Vl extends B{_parse(e){if(this._getType(e)!==x.symbol){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.symbol,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Vl}};u(Sn,"ZodSymbol");Sn.create=u(t=>new Sn(l({typeName:"ZodSymbol"},A(t))),"create");var js=Sn,jt=class as extends B{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName==="ZodEffects"?this._def.schema.sourceType():this._def.schema}dereference(e){return new as(m(l({},this._def),{schema:this._def.schema.dereference(e)}))}getReferences(){return this._def.schema.getReferences()}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:u(i=>{E(n,i),i.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){let i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return C;let d=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return d.status==="aborted"?C:d.status==="dirty"||r.value==="dirty"?it(d.value):d});{if(r.value==="aborted")return C;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?C:o.status==="dirty"||r.value==="dirty"?it(o.value):o}}if(a.type==="refinement"){let i=u(o=>{let d=a.refinement(o,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o},"executeRefinement");if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?C:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?C:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Dt(i))return i;let o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Dt(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):i);M.assertNever(a)}isEqual(e){return!(e instanceof as)||!this._def.schema.isEqual(e._def.schema)?!1:this._def.effect.type==="refinement"?e._def.effect.type!=="refinement"?!1:M.compareFunctions(this._def.effect.refinement,e._def.effect.refinement):this._def.effect.type==="transform"?e._def.effect.type!=="transform"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):this._def.effect.type==="preprocess"?e._def.effect.type!=="preprocess"?!1:M.compareFunctions(this._def.effect.transform,e._def.effect.transform):(M.assertNever(this._def.effect),!1)}};u(jt,"ZodEffects");jt.create=u((t,e,r)=>new jt(l({schema:t,typeName:"ZodEffects",effect:e},A(r))),"create");jt.createWithPreprocess=u((t,e,r)=>new jt(l({schema:e,effect:{type:"preprocess",transform:t},typeName:"ZodEffects"},A(r))),"createWithPreprocess");var We=jt,wn=class Kr extends B{dereference(e){let r=this._def.items.map(a=>a.dereference(e)),n=this._def.rest?this._def.rest.dereference(e):null;return new Kr(m(l({},this._def),{items:r,rest:n}))}getReferences(){return Fe([...this._def.items.flatMap(e=>e.getReferences()),...this._def.rest?this._def.rest.getReferences():[]])}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==x.array)return E(n,{code:_.invalid_type,expected:x.array,received:n.parsedType}),C;if(n.data.length<this._def.items.length)return E(n,{code:_.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&n.data.length>this._def.items.length&&(E(n,{code:_.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,o)=>{let d=this._def.items[o]||this._def.rest;return d?d._parse(new Se(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>ye.mergeArray(r,i)):ye.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Kr(m(l({},this._def),{rest:e}))}isEqual(e){if(!(e instanceof Kr)||!this._restEquals(e))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue(this._def.items,{compare:r}),a=new ue(e._def.items,{compare:r});return n.isEqual(a)}_restEquals(e){return this._def.rest===null?e._def.rest===null:e._def.rest!==null&&this._def.rest.isEqual(e._def.rest)}};u(wn,"ZodTuple");wn.create=u((t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new wn(l({items:t,typeName:"ZodTuple",rest:null},A(e)))},"create");var lt=wn,kn=class ql extends B{_parse(e){if(this._getType(e)!==x.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.undefined,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof ql}};u(kn,"ZodUndefined");kn.create=u(t=>new kn(l({typeName:"ZodUndefined"},A(t))),"create");var Xn=kn,On=class ss extends B{dereference(e){let r=this._def.options.map(n=>n.dereference(e));return new ss(m(l({},this._def),{options:r}))}getReferences(){return Fe(this._def.options.reduce((e,r)=>[...e,...r.getReferences()],[]))}_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(let o of s)if(o.result.status==="valid")return o.result;for(let o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map(o=>new Ie(o.ctx.common.issues));return E(r,{code:_.invalid_union,unionErrors:i}),C}if(u(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let i=m(l({},r),{common:m(l({},r.common),{issues:[]}),parent:null});return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s,i=[];for(let d of n){let p=m(l({},r),{common:m(l({},r.common),{issues:[]}),parent:null}),y=d._parseSync({data:r.data,path:r.path,parent:p});if(y.status==="valid")return y;y.status==="dirty"&&!s&&(s={result:y,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let o=i.map(d=>new Ie(d));return E(r,{code:_.invalid_union,unionErrors:o}),C}}get options(){return this._def.options}isEqual(e){if(!(e instanceof ss))return!1;let r=u((s,i)=>s.isEqual(i),"compare"),n=new ue([...this._def.options],{compare:r}),a=new ue([...e._def.options],{compare:r});return n.isEqual(a)}};u(On,"ZodUnion");On.create=u((t,e)=>new On(l({options:t,typeName:"ZodUnion"},A(e))),"create");var Qn=On,Cn=class Gl extends B{constructor(){super(...arguments),this._unknown=!0}_parse(e){return pe(e.data)}isEqual(e){return e instanceof Gl}};u(Cn,"ZodUnknown");Cn.create=u(t=>new Cn(l({typeName:"ZodUnknown"},A(t))),"create");var Zt=Cn,In=class Wl extends B{_parse(e){if(this._getType(e)!==x.undefined){let n=this._getOrReturnCtx(e);return E(n,{code:_.invalid_type,expected:x.void,received:n.parsedType}),C}return pe(e.data)}isEqual(e){return e instanceof Wl}};u(In,"ZodVoid");In.create=u(t=>new In(l({typeName:"ZodVoid"},A(t))),"create");var Hs=In,Mv=/^\d{4}-\d{2}-\d{2}(T|\s)?((\d{2}:\d{2}:\d{2}(\.\d{1,3})?)|(\d{2}:\d{2}))?(\s?([+-]\d{2}:\d{2}|Z))?$/,Ht=u((t,e,r=!0)=>{if(typeof t!="object")throw new La("Input must be an object");let n=u(i=>{let o=i;return e?.nullable&&(o=o.nullable()),e?.optional&&(o=o.optional()),e?.passtrough&&typeof o.passthrough=="function"&&(o=o.passthrough()),o},"applyOptions"),a=Object.entries(t).reduce((i,[o,d])=>{if(d===null)i[o]=n(S.null());else switch(typeof d){case"string":i[o]=Mv.test(d)?n(S.string().datetime()):n(S.string());break;case"number":i[o]=n(S.number());break;case"boolean":i[o]=n(S.boolean());break;case"object":Array.isArray(d)?d.length===0?i[o]=n(S.array(S.unknown())):typeof d[0]=="object"?i[o]=n(S.array(Ht(d[0],e,!1))):["string","number","boolean"].includes(typeof d[0])&&(i[o]=n(S.array(S[typeof d[0]]()))):i[o]=n(Ht(d,e,!1));break;default:throw new La(`Unsupported type for key ${o}`)}return i},{}),s=Object.keys(a).length>0;return e?.passtrough||!r&&!s?S.object(a).passthrough():S.object(a)},"objectToZui");function Jl(){return{}}u(Jl,"parseAnyDef");function Ns(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage=m(l({},t.errorMessage),{[e]:r}))}u(Ns,"addErrorMessage");function W(t,e,r,n,a){t[e]=r,Ns(t,e,n,a)}u(W,"setResponseValueAndErrors");function Yl(t,e){var r,n;let a={type:"array"};return((n=(r=t.type)==null?void 0:r._def)==null?void 0:n.typeName)!=="ZodAny"&&(a.items=V(t.type._def,m(l({},e),{currentPath:[...e.currentPath,"items"]}))),t.minLength&&W(a,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&W(a,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(W(a,"minItems",t.exactLength.value,t.exactLength.message,e),W(a,"maxItems",t.exactLength.value,t.exactLength.message,e)),a}u(Yl,"parseArrayDef");function Xl(t,e){let r=l({type:"integer",format:"int64"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?W(r,"minimum",n.value,n.message,e):W(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),W(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?W(r,"maximum",n.value,n.message,e):W(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),W(r,"maximum",n.value,n.message,e));break;case"multipleOf":W(r,"multipleOf",n.value,n.message,e);break}return r}u(Xl,"parseBigintDef");function Ql(t){return l({type:"boolean"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{})}u(Ql,"parseBooleanDef");function ed(t,e){return V(t.type._def,e)}u(ed,"parseBrandedDef");var jv=u((t,e)=>V(t.innerType._def,e),"parseCatchDef");function td(t,e){return e.dateStrategy=="integer"?Hv(t,e):l({type:"string",format:"date-time"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{})}u(td,"parseDateDef");var Hv=u((t,e)=>{let r=l({type:"integer",format:"unix-time"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"&&W(r,"minimum",n.value,n.message,e);break;case"max":e.target==="jsonSchema7"&&W(r,"maximum",n.value,n.message,e);break}return r},"integerDateParser");function rd(t,e){return m(l({},V(t.innerType._def,e)),{default:t.defaultValue()})}u(rd,"parseDefaultDef");function nd(t,e){return e.effectStrategy==="input"?V(t.schema._def,e):{}}u(nd,"parseEffectsDef");function ad(t){return{type:"string",enum:t.values}}u(ad,"parseEnumDef");var Nv=u(t=>"type"in t&&t.type==="string"?!1:"allOf"in t,"isJsonSchema7AllOfType");function sd(t,e){let r=[V(t.left._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","0"]})),V(t.right._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","1"]}))].filter(s=>!!s),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,a=[];return r.forEach(s=>{if(Nv(s))a.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let i=s;if("additionalProperties"in s&&s.additionalProperties===!1){let o=s,{additionalProperties:d}=o;i=Mo(o,["additionalProperties"])}else n=void 0;a.push(i)}}),a.length?l({allOf:a},n):void 0}u(sd,"parseIntersectionDef");function id(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}u(id,"parseLiteralDef");var Qt={cuid:"^[cC][^\\s-]{8,}$",cuid2:"^[a-z][a-z0-9]*$",ulid:"^[0-9A-HJKMNP-TV-Z]{26}$",email:"^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_+-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$",emoji:"^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uuid:"^[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}$",ipv4:"^(((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}))$",ipv6:"^(([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})))$"};function $s(t,e){let r=l({type:"string"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});function n(a){return e.patternStrategy==="escape"?$v(a):a}if(u(n,"processPattern"),t.checks)for(let a of t.checks)switch(a.kind){case"min":W(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e);break;case"max":W(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"email":switch(e.emailStrategy){case"format:email":tt(r,"email",a.message,e);break;case"format:idn-email":tt(r,"idn-email",a.message,e);break;case"pattern:zod":Be(r,Qt.email,a.message,e);break}break;case"url":tt(r,"uri",a.message,e);break;case"uuid":tt(r,"uuid",a.message,e);break;case"regex":Be(r,a.regex.source,a.message,e);break;case"cuid":Be(r,Qt.cuid,a.message,e);break;case"cuid2":Be(r,Qt.cuid2,a.message,e);break;case"startsWith":Be(r,"^"+n(a.value),a.message,e);break;case"endsWith":Be(r,n(a.value)+"$",a.message,e);break;case"datetime":tt(r,"date-time",a.message,e);break;case"length":W(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,a.value):a.value,a.message,e),W(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,a.value):a.value,a.message,e);break;case"includes":{Be(r,n(a.value),a.message,e);break}case"ip":{a.version!=="v6"&&tt(r,"ipv4",a.message,e),a.version!=="v4"&&tt(r,"ipv6",a.message,e);break}case"emoji":Be(r,Qt.emoji,a.message,e);break;case"ulid":{Be(r,Qt.ulid,a.message,e);break}case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}u($s,"parseStringDef");var $v=u(t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),"escapeNonAlphaNumeric"),tt=u((t,e,r,n)=>{var a;t.format||(a=t.anyOf)!=null&&a.some(s=>s.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push(l({format:t.format},t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}})),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push(l({format:e},r&&n.errorMessages&&{errorMessage:{format:r}}))):W(t,"format",e,r,n)},"addFormat"),Be=u((t,e,r,n)=>{var a;t.pattern||(a=t.allOf)!=null&&a.some(s=>s.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push(l({pattern:t.pattern},t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}})),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push(l({pattern:e},r&&n.errorMessages&&{errorMessage:{pattern:r}}))):W(t,"pattern",e,r,n)},"addPattern");function Us(t,e){var r,n,a,s,i;if(e.target==="openApi3"&&((r=t.keyType)==null?void 0:r._def.typeName)==="ZodEnum")return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((d,p)=>{var y;return m(l({},d),{[p]:(y=V(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"properties",p]})))!=null?y:{}})},{}),additionalProperties:!1};let o={type:"object",additionalProperties:(n=V(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?n:{}};if(e.target==="openApi3")return o;if(((a=t.keyType)==null?void 0:a._def.typeName)==="ZodString"&&((s=t.keyType._def.checks)!=null&&s.length)){let d=Object.entries($s(t.keyType._def,e)).reduce((p,[y,T])=>y==="type"?p:m(l({},p),{[y]:T}),{});return m(l({},o),{propertyNames:d})}else if(((i=t.keyType)==null?void 0:i._def.typeName)==="ZodEnum")return m(l({},o),{propertyNames:{enum:t.keyType._def.values}});return o}u(Us,"parseRecordDef");function od(t,e){if(e.mapStrategy==="record")return Us(t,e);let r=V(t.keyType._def,m(l({},e),{currentPath:[...e.currentPath,"items","items","0"]}))||{},n=V(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"items","items","1"]}))||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}u(od,"parseMapDef");function ud(t){let e=t.values,n=Object.keys(t.values).filter(s=>typeof e[e[s]]!="number").map(s=>e[s]),a=Array.from(new Set(n.map(s=>typeof s)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n.filter(s=>typeof s=="string"||typeof s=="number")}}u(ud,"parseNativeEnumDef");function cd(){return{not:{}}}u(cd,"parseNeverDef");function ld(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}u(ld,"parseNullDef");var Zn={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function dd(t,e){if(e.target==="openApi3")return Ao(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Zn&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((a,s)=>{let i=Zn[s._def.typeName];return i&&!a.includes(i)?[...a,i]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((a,s)=>{let i=typeof s._def.value;switch(i){case"string":case"number":case"boolean":return[...a,i];case"bigint":return[...a,"integer"];case"object":if(s._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){let a=n.filter((s,i,o)=>o.indexOf(s)===i);return{type:a.length>1?a:a[0],enum:r.reduce((s,i)=>s.includes(i._def.value)?s:[...s,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(s=>!n.includes(s))],[])};return Ao(t,e)}u(dd,"parseUnionDef");var Ao=u((t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((a,s)=>V(a._def,m(l({},e),{currentPath:[...e.currentPath,e.unionStrategy,`${s}`]}))).filter(a=>!!a&&(!e.strictUnions||typeof a=="object"&&Object.keys(a).length>0)),n=e.discriminator&&t.typeName==="ZodDiscriminatedUnion"&&typeof t.discriminator=="string"?{discriminator:{propertyName:t.discriminator}}:{};if(r.length)return e.unionStrategy==="anyOf"?l({anyOf:r},n):l({oneOf:r},n)},"asUnionOf");function fd(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:Zn[t.innerType._def.typeName],nullable:!0}:{type:[Zn[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=V(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath]}));return n&&m(l({},n),{nullable:!0})}let r=V(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath,"anyOf","0"]}));return r&&{anyOf:[r,{type:"null"}]}}u(fd,"parseNullableDef");function pd(t,e){let r=l({type:"number"},t.coerce?{[U]:{coerce:t.coerce||void 0}}:{});if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Ns(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?W(r,"minimum",n.value,n.message,e):W(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),W(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?W(r,"maximum",n.value,n.message,e):W(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),W(r,"maximum",n.value,n.message,e));break;case"multipleOf":W(r,"multipleOf",n.value,n.message,e);break}return r}u(pd,"parseNumberDef");function gd(t,e){var r;let n=m(l({type:"object"},Object.entries(t.shape()).reduce((a,[s,i])=>{if(i===void 0||i._def===void 0)return a;let o=V(i._def,m(l({},e),{currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]}));return o===void 0?a:{properties:m(l({},a.properties),{[s]:o}),required:i.isOptional()?a.required:[...a.required,s]}},{properties:{},required:[]})),{additionalProperties:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":(r=V(t.catchall._def,m(l({},e),{currentPath:[...e.currentPath,"additionalProperties"]})))!=null?r:!0});return n.required.length||delete n.required,n}u(gd,"parseObjectDef");var Uv=u((t,e)=>{var r;if(e.currentPath.toString()===((r=e.propertyPath)==null?void 0:r.toString()))return V(t.innerType._def,e);let n=V(t.innerType._def,m(l({},e),{currentPath:[...e.currentPath,"anyOf","1"]}));return n?{anyOf:[{not:{}},n]}:{}},"parseOptionalDef"),Fv=u((t,e)=>{if(e.pipeStrategy==="input")return V(t.in._def,e);if(e.pipeStrategy==="output")return V(t.out._def,e);let r=V(t.in._def,m(l({},e),{currentPath:[...e.currentPath,"allOf","0"]})),n=V(t.out._def,m(l({},e),{currentPath:[...e.currentPath,"allOf",r?"1":"0"]}));return{allOf:[r,n].filter(a=>a!==void 0)}},"parsePipelineDef");function md(t,e){return V(t.type._def,e)}u(md,"parsePromiseDef");function hd(t,e){let n={type:"array",uniqueItems:!0,items:V(t.valueType._def,m(l({},e),{currentPath:[...e.currentPath,"items"]}))};return t.minSize&&W(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&W(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}u(hd,"parseSetDef");function yd(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>V(r._def,m(l({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:V(t.rest._def,m(l({},e),{currentPath:[...e.currentPath,"additionalItems"]}))}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>V(r._def,m(l({},e),{currentPath:[...e.currentPath,"items",`${n}`]}))).reduce((r,n)=>n===void 0?r:[...r,n],[])}}u(yd,"parseTupleDef");function vd(){return{not:{}}}u(vd,"parseUndefinedDef");function _d(){return{}}u(_d,"parseUnknownDef");var Lv=u((t,e)=>V(t.innerType._def,e),"parseReadonlyDef");function bd(t){return{$ref:t.uri}}u(bd,"parseRefDef");function V(t,e,r=!1){let n=e.seen.get(t);if(n&&!r){let i=zv(n,e);if(i!==void 0)return i}let a={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,a);let s=Vv(t,t.typeName,e);return s&&qv(t,e,s),a.jsonSchema=s,s}u(V,"parseDef");var zv=u((t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:Kv(e.currentPath,t.path)};case"none":case"seen":return t.path.length<e.currentPath.length&&t.path.every((r,n)=>e.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},"get$ref"),Kv=u((t,e)=>{let r=0;for(;r<t.length&&r<e.length&&t[r]===e[r];r++);return[(t.length-r).toString(),...e.slice(r)].join("/")},"getRelativePath"),Vv=u((t,e,r)=>{switch(e){case"ZodString":return $s(t,r);case"ZodNumber":return pd(t,r);case"ZodObject":return gd(t,r);case"ZodBigInt":return Xl(t,r);case"ZodBoolean":return Ql(t);case"ZodDate":return td(t,r);case"ZodUndefined":return vd();case"ZodNull":return ld(r);case"ZodArray":return Yl(t,r);case"ZodUnion":case"ZodDiscriminatedUnion":return dd(t,r);case"ZodIntersection":return sd(t,r);case"ZodTuple":return yd(t,r);case"ZodRecord":return Us(t,r);case"ZodRef":return bd(t);case"ZodLiteral":return id(t,r);case"ZodEnum":return ad(t);case"ZodNativeEnum":return ud(t);case"ZodNullable":return fd(t,r);case"ZodOptional":return Uv(t,r);case"ZodMap":return od(t,r);case"ZodSet":return hd(t,r);case"ZodLazy":return V(t.getter()._def,r);case"ZodPromise":return md(t,r);case"ZodNaN":case"ZodNever":return cd();case"ZodEffects":return nd(t,r);case"ZodAny":return Jl();case"ZodUnknown":return _d();case"ZodDefault":return rd(t,r);case"ZodBranded":return ed(t,r);case"ZodReadonly":return Lv(t,r);case"ZodCatch":return jv(t,r);case"ZodPipeline":return Fv(t,r);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(n=>{})(e)}},"selectParser"),qv=u((t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),Object.assign(r,{[U]:l(l({},t[U]),r[U])}),r),"addMeta"),Ro={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"string",mapStrategy:"entries",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",emailStrategy:"format:email",discriminator:!1,unionStrategy:"anyOf"},Gv=u(t=>typeof t=="string"?m(l({},Ro),{name:t}):l(l({},Ro),t),"getDefaultOptions"),Wv=u(t=>{let e=Gv(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return m(l({},e),{currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,a])=>[a._def,{def:a._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))})},"getRefs"),Jv=u((t,e)=>{var r;let n=Wv(e),a=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((d,[p,y])=>{var T;return m(l({},d),{[p]:(T=V(y._def,m(l({},n),{currentPath:[...n.basePath,n.definitionPath,p]}),!0))!=null?T:{}})},{}):void 0,s=typeof e=="string"?e:e?.name,i=(r=V(t._def,s===void 0?n:m(l({},n),{currentPath:[...n.basePath,n.definitionPath,s]}),!1))!=null?r:{},o=s===void 0?a?m(l({},i),{[n.definitionPath]:a}):i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:m(l({},a),{[s]:i})};return n.target==="jsonSchema7"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="jsonSchema2019-09"&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),o},"zodToJsonSchema"),ea=u((t,e={target:"openApi3"})=>{let r=Jv(t,e);return e.$schemaUrl===!1?delete r.$schema:typeof e.$schemaUrl=="string"&&(r.$schema=e.$schemaUrl),r},"zuiToJsonSchema"),Yv=["gpt-3.5-turbo","gpt-3.5-turbo-16k","gpt-4","gpt-4-1106-preview","gpt-4-vision-preview","gpt-4-0125-preview","gpt-4-turbo-preview","gpt-4-turbo","gpt-4o","gpt-3.5-turbo-0125","gpt-3.5-turbo-1106"],Sb=yt.create(["any","string","number","boolean","object","pattern","date","array","target","time","enum"]),Td=u(t=>ge.create().displayAs({id:"variable",params:l({type:t?.type||"any"},t?.params)}),"variable"),Pd=u(t=>ge.create().displayAs({id:"conversation",params:l({},t?.params)}),"conversation"),Ed=u(t=>ge.create().displayAs({id:"user",params:l({},t?.params)}),"user"),xd=u(t=>ge.create().displayAs({id:"message",params:l({},t?.params)}),"message"),Sd=u(t=>ge.create().displayAs({id:"agent",params:l({},t?.params)}),"agent"),wd=u(t=>ge.create().displayAs({id:"event",params:l({},t?.params)}),"event"),kd=u(t=>ge.create().displayAs({id:"table",params:l({},t?.params)}),"table"),Od=u(t=>ge.create().displayAs({id:"tablerow",params:l({},t?.params)}),"tablerow"),Cd=u(t=>ge.create().displayAs({id:"intent",params:l({},t?.params)}),"intent"),Id=u(()=>yt.create(Yv).displayAs({id:"dropdown",params:{}}),"aimodel"),Zd=u(t=>ge.create().displayAs({id:"datasource",params:l({},t)}),"datasource"),Ad=u(t=>ge.create().displayAs({id:"knowledgebase",params:l({},t)}),"knowledgebase"),Rd={object:ct.lazycreate},Bd=u((t,e={message:`Input not instance of ${t.name}`})=>bs(r=>r instanceof t,e),"instanceOfType"),Fs=ge.create,Ls=Jn.create,Dd=Ss.create,Md=$n.create,zs=Un.create,jd=zn.create,Hd=js.create,Nd=Xn.create,$d=Wn.create,Ud=lr.create,Fd=Zt.create,Ld=qe.create,zd=Hs.create,Kd=Mt.create,Vd=ct.create,qd=ct.strictCreate,Gd=Qn.create,Wd=Ts.create,Jd=Kn.create,Yd=lt.create,Xd=ws.create,Qd=ks.create,ef=mr.create,tf=xs.create,rf=Os.create,nf=Es.create,af=Vn.create,sf=qn.create,of=yt.create,uf=Gn.create,cf=gr.create,is=We.create,lf=He.create,df=ut.create,Xv=fr.create,ff=We.createWithPreprocess,pf=Yn.create,gf=u(()=>Fs().optional(),"ostring"),mf=u(()=>Ls().optional(),"onumber"),hf=u(()=>zs().optional(),"oboolean"),yf=B.fromJsonSchema,vf=B.fromObject,_f={string:u(t=>ge.create(m(l({},t),{coerce:!0})),"string"),number:u(t=>Jn.create(m(l({},t),{coerce:!0})),"number"),boolean:u(t=>Un.create(m(l({},t),{coerce:!0})),"boolean"),bigint:u(t=>$n.create(m(l({},t),{coerce:!0})),"bigint"),date:u(t=>zn.create(m(l({},t),{coerce:!0})),"date")},bf=C,v=S,Tf=u((t,e)=>t.anyOf.length?t.anyOf.length===1?le(t.anyOf[0],m(l({},e),{path:[...e.path,"anyOf",0]})):`z.union([${t.anyOf.map((r,n)=>le(r,m(l({},e),{path:[...e.path,"anyOf",n]}))).join(", ")}])`:"z.any()","parseAnyOf"),Qv=u(t=>{var e;return(e=t[U])!=null&&e.coerce?"z.coerce.boolean()":"z.boolean()"},"parseBoolean"),e_=u(t=>"z.any()","parseDefault"),t_=u((t,e)=>`z.union([${t.type.map(r=>le(m(l({},t),{type:r}),e)).join(", ")}])`,"parseMultipleType"),r_=u((t,e)=>`z.any().refine((value) => !${le(t.not,m(l({},e),{path:[...e.path,"not"]}))}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`,"parseNot"),n_=u(t=>"z.null()","parseNull"),a_=u(t=>[t.slice(0,t.length/2),t.slice(t.length/2)],"half"),s_=u((t,...e)=>Object.keys(t).reduce((r,n)=>(e.includes(n)||(r[n]=t[n]),r),{}),"omit");function fe(t,e,r){var n;let a=t[e],s="";if(a!==void 0){let i=r({value:a,json:JSON.stringify(a)});if(i){let o=i[0],d=i.length===3?i[1]:"",p=i.length===3?i[2]:i[1];s+=o,((n=t.errorMessage)==null?void 0:n[e])!==void 0&&(s+=d+JSON.stringify(t.errorMessage[e])),s+=p}}return s}u(fe,"withMessage");var rr=Symbol("Original index"),i_=u(t=>{let e=[];for(let r=0;r<t.length;r++){let n=t[r];if(typeof n=="boolean")e.push(n?{[rr]:r}:{[rr]:r,not:{}});else{if(rr in n)return t;e.push(m(l({},n),{[rr]:r}))}}return e},"ensureOriginalIndex");function dr(t,e){if(t.allOf.length===0)return"z.never()";if(t.allOf.length===1){let r=t.allOf[0];return le(r,m(l({},e),{path:[...e.path,"allOf",r[rr]]}))}else{let[r,n]=a_(i_(t.allOf));return`z.intersection(${dr({allOf:r},e)}, ${dr({allOf:n},e)})`}}u(dr,"parseAllOf");var o_=u((t,e)=>{if(Array.isArray(t.items))return`z.tuple([${t.items.map((n,a)=>le(n,m(l({},e),{path:[...e.path,"items",a]})))}])`;let r=t.items?`z.array(${le(t.items,m(l({},e),{path:[...e.path,"items"]}))})`:"z.array(z.any())";return r+=fe(t,"minItems",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxItems",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseArray"),u_=u(t=>`z.literal(${JSON.stringify(t.const)})`,"parseConst"),c_=u(t=>t.enum.length===0?"z.never()":t.enum.length===1?`z.literal(${JSON.stringify(t.enum[0])})`:t.enum.every(e=>typeof e=="string")?`z.enum([${t.enum.map(e=>JSON.stringify(e))}])`:`z.union([${t.enum.map(e=>`z.literal(${JSON.stringify(e)})`).join(", ")}])`,"parseEnum"),l_=u((t,e)=>{let r=le(t.if,m(l({},e),{path:[...e.path,"if"]})),n=le(t.then,m(l({},e),{path:[...e.path,"then"]})),a=le(t.else,m(l({},e),{path:[...e.path,"else"]}));return`z.union([${n}, ${a}]).superRefine((value,ctx) => {
|
|
34
34
|
const result = ${r}.safeParse(value).success
|
|
35
35
|
? ${n}.safeParse(value)
|
|
36
36
|
: ${a}.safeParse(value);
|
|
37
37
|
if (!result.success) {
|
|
38
38
|
result.error.errors.forEach((error) => ctx.addIssue(error))
|
|
39
39
|
}
|
|
40
|
-
})`},"parseIfThenElse"),
|
|
40
|
+
})`},"parseIfThenElse"),d_=u(t=>{var e;let r="z.number()";return(e=t[U])!=null&&e.coerce&&(r="z.coerce.number()"),t.type==="integer"?r+=fe(t,"type",()=>[".int(",")"]):r+=fe(t,"format",({value:n})=>{if(n==="int64")return[".int(",")"]}),r+=fe(t,"multipleOf",({value:n,json:a})=>n===1?r.startsWith("z.number().int(")?void 0:[".int(",")"]:[`.multipleOf(${a}`,", ",")"]),typeof t.minimum=="number"?t.exclusiveMinimum===!0?r+=fe(t,"minimum",({json:n})=>[`.gt(${n}`,", ",")"]):r+=fe(t,"minimum",({json:n})=>[`.gte(${n}`,", ",")"]):typeof t.exclusiveMinimum=="number"&&(r+=fe(t,"exclusiveMinimum",({json:n})=>[`.gt(${n}`,", ",")"])),typeof t.maximum=="number"?t.exclusiveMaximum===!0?r+=fe(t,"maximum",({json:n})=>[`.lt(${n}`,", ",")"]):r+=fe(t,"maximum",({json:n})=>[`.lte(${n}`,", ",")"]):typeof t.exclusiveMaximum=="number"&&(r+=fe(t,"exclusiveMaximum",({json:n})=>[`.lt(${n}`,", ",")"])),r},"parseNumber"),Ks=u((t,e)=>t.oneOf.length?t.oneOf.length===1?le(t.oneOf[0],m(l({},e),{path:[...e.path,"oneOf",0]})):`z.any().superRefine((x, ctx) => {
|
|
41
41
|
const schemas = [${t.oneOf.map((r,n)=>le(r,m(l({},e),{path:[...e.path,"oneOf",n]}))).join(", ")}];
|
|
42
42
|
const errors = schemas.reduce(
|
|
43
43
|
(errors: z.ZodError[], schema) =>
|
|
@@ -54,7 +54,7 @@ ${se}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(je).join(
|
|
|
54
54
|
message: "Invalid input: Should pass single schema",
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
})`:"z.any()","parseOneOf");function
|
|
57
|
+
})`:"z.any()","parseOneOf");function Pf(t,e){let r;t.properties&&(Object.keys(t.properties).length?(r="z.object({ ",r+=Object.keys(t.properties).map(i=>{let o=t.properties[i],d=`${JSON.stringify(i)}: ${le(o,m(l({},e),{path:[...e.path,"properties",i]}))}`,p=typeof o=="object"&&o.default!==void 0||typeof t.default=="object"&&t.default!==null&&i in t.default,y=Array.isArray(t.required)?t.required.includes(i):typeof o=="object"&&o.required===!0;return!p&&!y?`${d}.optional()`:d}).join(", "),r+=" })"):r="z.object({})");let n=t.additionalProperties!==void 0?le(t.additionalProperties,m(l({},e),{path:[...e.path,"additionalProperties"]})):void 0,a;if(t.patternProperties){let i=Object.fromEntries(Object.entries(t.patternProperties).map(([o,d])=>[o,le(d,m(l({},e),{path:[...e.path,"patternProperties",o]}))],{}));a="",r?n?a+=`.catchall(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`.catchall(z.union([${Object.values(i).join(", ")}]))`:a+=`.catchall(${Object.values(i)})`:n?a+=`z.record(z.union([${[...Object.values(i),n].join(", ")}]))`:Object.keys(i).length>1?a+=`z.record(z.union([${Object.values(i).join(", ")}]))`:a+=`z.record(${Object.values(i)})`,a+=`.superRefine((value, ctx) => {
|
|
58
58
|
`,a+=`for (const key in value) {
|
|
59
59
|
`,n&&(t.properties?a+=`let evaluated = [${Object.keys(t.properties).map(o=>JSON.stringify(o)).join(", ")}].includes(key)
|
|
60
60
|
`:a+=`let evaluated = false
|
|
@@ -86,7 +86,7 @@ ${se}`.trim();case v.ZodFirstPartyTypeKind.ZodEnum:return o.values.map(je).join(
|
|
|
86
86
|
`,a+=`}
|
|
87
87
|
`,a+=`}
|
|
88
88
|
`),a+=`}
|
|
89
|
-
`,a+="})"}let s=r?a?r+a:n?n==="z.never()"?r+".strict()":r+`.catchall(${n})`:r:a||(n?`z.record(${n})`:"z.record(z.any())");return ie.an.anyOf(t)&&(s+=`.and(${bf(m(l({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),ie.a.oneOf(t)&&(s+=`.and(${zs(m(l({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),ie.an.allOf(t)&&(s+=`.and(${cr(m(l({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),s}u(Tf,"parseObject");var d_=u(t=>{var e;let r="z.string()";if((e=t[U])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";r="z.coerce.string()"}return r+=fe(t,"format",({value:n})=>{switch(n){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),r+=fe(t,"pattern",({json:n})=>[`.regex(new RegExp(${n})`,", ",")"]),r+=fe(t,"minLength",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxLength",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseString"),f_=u((t,e)=>`${le(a_(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),p_=u(t=>`z.ref('${t.$ref}')`,"parseRef"),g_=u((t,e)=>{var r,n;if(t.oneOf.length<=1||!((r=t.discriminator)!=null&&r.propertyName))return zs(t,e);let a=t.oneOf.map((s,i)=>le(s,m(l({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(n=t.discriminator)==null?void 0:n.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),le=u((t,e={seen:new Map,path:[]},r)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let s=e.parserOverride(t,e);if(typeof s=="string")return s}let n=e.seen.get(t);if(n){if(n.r!==void 0)return n.r;if(e.depth===void 0||n.n>=e.depth)return"z.any()";n.n+=1}else n={r:void 0,n:0},e.seen.set(t,n);let a=y_(t,e);return r||(a=m_(t,a),e.withoutDefaults||(a=h_(t,a))),n.r=a,a},"parseSchema"),m_=u((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),h_=u((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),y_=u((t,e)=>ie.a.nullable(t)?f_(t,e):ie.an.object(t)?Tf(t,e):ie.an.array(t)?i_(t,e):ie.an.anyOf(t)?bf(t,e):ie.an.allOf(t)?cr(t,e):ie.a.discriminator(t)?g_(t,e):ie.a.oneOf(t)?zs(t,e):ie.a.not(t)?t_(t,e):ie.an.enum(t)?u_(t):ie.a.const(t)?o_(t):ie.a.multipleType(t)?e_(t,e):ie.a.primitive(t,"string")?d_(t):ie.a.primitive(t,"number")||ie.a.primitive(t,"integer")?l_(t):ie.a.primitive(t,"boolean")?Xv(t):ie.a.primitive(t,"null")?r_(t):ie.a.conditional(t)?c_(t,e):ie.a.ref(t)?p_(t):Qv(t),"selectParser"),ie={an:{object:u(t=>t.type==="object","object"),array:u(t=>t.type==="array","array"),anyOf:u(t=>t.anyOf!==void 0,"anyOf"),allOf:u(t=>t.allOf!==void 0,"allOf"),enum:u(t=>t.enum!==void 0,"enum")},a:{nullable:u(t=>t.nullable===!0,"nullable"),multipleType:u(t=>Array.isArray(t.type),"multipleType"),not:u(t=>t.not!==void 0,"not"),const:u(t=>t.const!==void 0,"const"),primitive:u((t,e)=>t.type===e,"primitive"),conditional:u(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:u(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:u(t=>t.oneOf!==void 0,"oneOf"),ref:u(t=>t.$ref!==void 0,"ref")}},v_=u(t=>{let e;try{e=new Function("z",`return ${t}`)(v)}catch(r){return{sucess:!1,error:`Failed to evaluate schema: ${(r instanceof Error?r:new Error(String(r))).message}`}}return e instanceof v.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),__=u(t=>le(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),b_=u(t=>{let e=__(t);e=e.replaceAll("errors: z.ZodError[]","errors");let r=v_(e);if(!r.sucess)throw new Xo(r.error);return r.value},"jsonSchemaToZod"),tr=u((t,e)=>{var r,n;if(e[U]&&t._def&&(t._def[U]=e[U]),((r=t._def)==null?void 0:r.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([a,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&tr(i[a],s)}),((n=t._def)==null?void 0:n.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&tr(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let s=t._def.type;s&&tr(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===S.ZodFirstPartyTypeKind.ZodTuple&&tr(o.items[i],s)})}},"applyZuiPropsRecursively"),gr=u(t=>{let e=b_(t);return tr(e,t),e},"jsonSchemaToZui"),Pf=class extends Ht.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Uncaught error:",e,r)}render(){return this.state.hasError&&this.props.fallback?Ht.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};u(Pf,"ErrorBoundary");var Zt=Pf;function Ef(t,e){return r=>Ht.default.createElement(Zt,{fallback:e,fieldSchema:r.fieldSchema,path:r.path},Ht.default.createElement(t,l({},r)))}u(Ef,"withErrorBoundary");var Kr=u(t=>{var e=t,{components:r,fieldSchema:n,path:a,required:s,fallback:i}=e,o=Do(e,["components","fieldSchema","path","required","fallback"]),d,p;let{formData:y,disabled:T,hidden:k,handlePropertyChange:P,addArrayItem:D,removeArrayItem:z,formErrors:q,formValid:se}=Ho(n,a),V=(0,be.useMemo)(()=>at(y,a),[y,a]),H=(0,be.useMemo)(()=>Ag(r,n),[n,r]),{discriminator:W,discriminatedSchema:ce,discriminatorValue:Le}=Cg(n,a);if(!H||k===!0)return null;let{Component:Xe,type:Oe}=H,Te={type:Oe,componentID:H.id,scope:a.join("."),context:{path:a,readonly:!1,formData:y,formErrors:q,formValid:se,updateForm:P,updateFormData:u(Pe=>P([],Pe),"updateFormData")},onChange:u(Pe=>P(a,Pe),"onChange"),disabled:T,errors:q?.filter(Pe=>Pe.path===a)||[],label:((d=n[U])==null?void 0:d.title)||Ua(((p=a[a.length-1])==null?void 0:p.toString())||""),params:H.params,schema:n,zuiProps:n[U]};if(n.type==="array"&&Oe==="array"){let Pe=Xe,_e=Te.schema,Ee=Array.isArray(V)||typeof V=="object"?V:[],j=l(m(l({},Te),{type:Oe,schema:_e,data:Ee,addItem:u(Ce=>D(a,Ce),"addItem"),removeItem:u(Ce=>z(a,Ce),"removeItem")}),o);return Array.isArray(n.items)?null:be.default.createElement(Pe,m(l({key:Te.scope},j),{isArrayChild:j.isArrayChild}),Array.isArray(j.data)?j.data.map((Ce,ke)=>{let ze=[...a,ke.toString()];return be.default.createElement(Zt,{key:ze.join("."),fallback:i,fieldSchema:n.items,path:ze},be.default.createElement(Kr,{key:ze.join("."),components:r,fieldSchema:n.items,path:ze,required:s,isArrayChild:!0,index:ke,removeSelf:()=>z(a,ke),fallback:i}))}):[])}if(n.type==="object"&&Oe==="object"&&n.properties){let Pe=Xe,_e=l(m(l({},Te),{type:Oe,schema:Te.schema,data:V||{}}),o);return be.default.createElement(Pe,m(l({key:Te.scope},_e),{isArrayChild:_e.isArrayChild}),Object.entries(n.properties).map(([Ee,j])=>{var Ce;let ke=[...a,Ee];return be.default.createElement(Zt,{key:ke.join("."),fallback:i,fieldSchema:j,path:ke},be.default.createElement(Kr,{key:ke.join("."),components:r,fieldSchema:j,path:ke,required:((Ce=n.required)==null?void 0:Ce.includes(Ee))||!1,isArrayChild:!1,fallback:i}))}))}if(Oe==="discriminatedUnion"){let Pe=Xe,_e=l(m(l({},Te),{type:Oe,schema:Te.schema,data:V||{},discriminatorKey:W?.key||null,discriminatorLabel:Ua(W?.key||"Unknown"),discriminatorOptions:W?.values||null,discriminatorValue:Le,setDiscriminator:u(Ee=>{if(!W?.key){console.warn("No discriminator key found, cannot set discriminator");return}P(a,{[W.key]:Ee})},"setDiscriminator")}),o);return be.default.createElement(Pe,m(l({key:Te.scope},_e),{isArrayChild:_e.isArrayChild}),ce&&be.default.createElement(Zt,{key:a.join("."),fallback:i,fieldSchema:ce,path:a},be.default.createElement(Kr,{components:r,fieldSchema:ce,path:a,required:s,isArrayChild:!1,fallback:i})))}let da=Xe,fa=l(m(l({},Te),{type:Oe,schema:Te.schema,config:{},required:s,data:V,description:n.description}),o);return be.default.createElement(da,l({},fa))},"FormElementRenderer"),T_=u(({schema:t,components:e,onChange:r,value:n,disableValidation:a,fallback:s,dataTransform:i,onValidation:o})=>{let[d,p]=(0,Ne.useState)(n);return(0,Ne.useEffect)(()=>{r(d)},[d]),(0,Ne.useEffect)(()=>{let y=Ct(t);p(T=>qr(y,T))},[JSON.stringify(t),p]),Ne.default.createElement(Og,{formData:d,setFormData:p,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:o},Ne.default.createElement(Zt,{fallback:s,fieldSchema:t,path:[]},Ne.default.createElement(Kr,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),P_={string:{},number:{slider:{id:"slider",params:v.object({})}},boolean:{switch:{id:"switch",params:v.object({})}},array:{},object:{},discriminatedUnion:{}},E_={errors:Wo,jsonSchemaToZui:gr,zuiToJsonSchema:Qn,objectToZui:jt,toTypescript:Gr,toTypescriptSchema:ms};var Ut=(t,e)=>{let r=t._def,n=e._def;if(r.typeName===S.ZodFirstPartyTypeKind.ZodObject&&n.typeName===S.ZodFirstPartyTypeKind.ZodObject){let a=r.shape(),s=n.shape();return S.object({...a,...s})}if(r.typeName===S.ZodFirstPartyTypeKind.ZodRecord&&n.typeName===S.ZodFirstPartyTypeKind.ZodRecord)return S.record(S.intersection(r.valueType,n.valueType));throw new Error("Cannot merge object schemas with record schemas")},xf=S;var ve=S.string().min(1),wf=S.object({text:ve}),kf=S.object({markdown:ve}),Of=S.object({imageUrl:ve}),Cf=S.object({audioUrl:ve}),If=S.object({videoUrl:ve}),Zf=S.object({fileUrl:ve,title:ve.optional()}),Af=S.object({latitude:S.number(),longitude:S.number(),address:S.string().optional(),title:S.string().optional()}),Rf=S.object({title:ve,subtitle:ve.optional(),imageUrl:ve.optional(),actions:S.array(S.object({action:S.enum(["postback","url","say"]),label:ve,value:ve}))}),Sf=S.object({text:ve,options:S.array(S.object({label:ve,value:ve}))}),x_=S.object({items:S.array(Rf)}),S_=S.union([S.object({type:S.literal("text"),payload:wf}),S.object({type:S.literal("markdown"),payload:kf}),S.object({type:S.literal("image"),payload:Of}),S.object({type:S.literal("audio"),payload:Cf}),S.object({type:S.literal("video"),payload:If}),S.object({type:S.literal("file"),payload:Zf}),S.object({type:S.literal("location"),payload:Af})]),w_=S.object({items:S.array(S_)}),k_={schema:kf},O_={text:{schema:wf},image:{schema:Of},audio:{schema:Cf},video:{schema:If},file:{schema:Zf},location:{schema:Af},carousel:{schema:x_},card:{schema:Rf},dropdown:{schema:Sf},choice:{schema:Sf},bloc:{schema:w_}};var mr="x-bot-id",Vs="x-bot-user-id",qs="x-integration-id",Gs="x-webhook-id",Ws="x-bp-configuration-type",hr="x-bp-configuration",yr="x-bp-operation",Js="x-bp-type";var Bf=require("browser-or-node");var Ft=console;function we(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function vr(t,e=8072,r=A_){if(!Bf.isNode)throw new Error("This function can only be called in Node.js");let a=require("http").createServer(async(s,i)=>{try{let o=await C_(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let d=await t(o);i.writeHead(d?.status??200,d?.headers??{}).end(d?.body??"{}")}catch(o){Ft.error("Error while handling request",{error:o?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:o?.message??"Internal error occured"}))}});return a.listen(e,()=>r(e)),a}async function C_(t){let e=await Z_(t),r={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];r[s]=i}let n=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:n.pathname,query:I_(n.search,"?"),headers:r,method:t.method?.toUpperCase()??"GET"}}function I_(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function Z_(t){return new Promise((e,r)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let n="";t.on("data",a=>n+=a.toString()),t.on("error",a=>r(a)),t.on("end",()=>e(n))})}function A_(t){Ft.info(`Listening on port ${t}`)}var la=require("@botpress/client");var te={};Zr(te,{mapValues:()=>B_,mergeRecords:()=>M_,pairs:()=>Ys,stripUndefinedProps:()=>D_,values:()=>R_});var Ys=t=>Object.entries(t),R_=t=>Object.values(t),B_=(t,e)=>Object.fromEntries(Ys(t).map(([r,n])=>[r,e(n,r)])),D_=t=>Object.fromEntries(Ys(t).filter(([,e])=>e!==void 0)),M_=(t,e,r)=>{let n=[...Object.keys(t),...Object.keys(e)],a=[...new Set(n)],s={};for(let i of a){let o=t[i],d=e[i];o&&d?s[i]=r(o,d):o?s[i]=o:d&&(s[i]=d)}return s};var Y={};Zr(Y,{safePush:()=>j_});var j_=(t,...e)=>t?[...t,...e]:[...e];var Df=t=>{let{name:e,version:r}=t,n={actions:{},events:{},channels:{}},a={name:e,version:r,entities:te.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=te.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let d=o.input.schema.dereference(s),p=o.output.schema.dereference(s),y=t.actions?.[i]?.name??i;n.actions[y]={...o,...t.actions?.[i]??{},input:{schema:d},output:{schema:p}},a.actions[i]={name:y}}for(let[i,o]of Object.entries(t.definition.events??{})){let d=o.schema.dereference(s),p=t.events?.[i]?.name??i;n.events[p]={...o,...t.events?.[i]??{},schema:d},a.events[i]={name:p}}for(let[i,o]of Object.entries(t.definition.channels??{})){let d={};for(let[y,T]of Object.entries(o.messages)){let k=T.schema.dereference(s);d[y]={...T,schema:k}}let p=t.channels?.[i]?.name??i;n.channels[p]={...o,...t.channels?.[i]??{},message:{...o.message??{},tags:{...o.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...o.conversation??{},tags:{...o.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:d},a.channels[i]={name:p}}return{resolved:n,statement:a}};var ea=Symbol("schemaName"),Mf=t=>t?te.mapValues(t,(r,n)=>({...r,[ea]:n})):{},jf=t=>ea in t&&t[ea]!==void 0,Hf=t=>t[ea];var ta=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;extend(e,r){let{entities:n,actions:a,events:s,channels:i}=this._callBuilder(e,r),o=this;o.interfaces??={};let d=Object.values(n).map(k=>k.name),p=d.length===0?e.name:`${e.name}<${d.join(",")}>`,{resolved:y,statement:T}=Df({...e,entities:n,actions:te.stripUndefinedProps(a),events:te.stripUndefinedProps(s),channels:te.stripUndefinedProps(i)});return o.actions=te.mergeRecords(o.actions??{},y.actions,this._mergeActions),o.channels=te.mergeRecords(o.channels??{},y.channels,this._mergeChannels),o.events=te.mergeRecords(o.events??{},y.events,this._mergeEvents),o.interfaces[p]={id:e.id,...T},this}_callBuilder(e,r){let a={entities:Mf(this.entities)},s=r(a),i=te.pairs(s.entities).find(([d,p])=>!jf(p));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:te.mapValues(s.entities,d=>({name:Hf(d),schema:d.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,r)=>({...e,...r,input:{schema:Ut(e.input.schema,r.input.schema)},output:{schema:Ut(e.input.schema,r.output.schema)}});_mergeEvents=(e,r)=>({...e,...r,schema:Ut(e.schema,r.schema)});_mergeChannels=(e,r)=>{let n=te.mergeRecords(e.messages,r.messages,this._mergeMessage);return{...e,...r,messages:n}};_mergeMessage=(e,r)=>({schema:Ut(e.schema,r.schema)})};var vt=require("@botpress/client");var Nf=require("@botpress/client"),ra={retries:3,retryCondition:t=>Nf.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};var zt=class{constructor(e){this._client=e}createConversation=e=>this._client.createConversation(e);getConversation=e=>this._client.getConversation(e);listConversations=e=>this._client.listConversations(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);updateConversation=e=>this._client.updateConversation(e);deleteConversation=e=>this._client.deleteConversation(e);listParticipants=e=>this._client.listParticipants(e);addParticipant=e=>this._client.addParticipant(e);getParticipant=e=>this._client.getParticipant(e);removeParticipant=e=>this._client.removeParticipant(e);createEvent=e=>this._client.createEvent(e);getEvent=e=>this._client.getEvent(e);listEvents=e=>this._client.listEvents(e);createMessage=e=>this._client.createMessage(e);getOrCreateMessage=e=>this._client.getOrCreateMessage(e);getMessage=e=>this._client.getMessage(e);updateMessage=e=>this._client.updateMessage(e);listMessages=e=>this._client.listMessages(e);deleteMessage=e=>this._client.deleteMessage(e);createUser=e=>this._client.createUser(e);getUser=e=>this._client.getUser(e);listUsers=e=>this._client.listUsers(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);updateUser=e=>this._client.updateUser(e);deleteUser=e=>this._client.deleteUser(e);getState=e=>this._client.getState(e);setState=e=>this._client.setState(e);getOrSetState=e=>this._client.getOrSetState(e);patchState=e=>this._client.patchState(e);configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e)};var na=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};var H_=S.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),$f=t=>{let e=t[mr],r=t[Vs],n=t[qs],a=t[Gs],s=t[Ws],i=t[hr],o=H_.parse(t[yr]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing bot user headers");if(!n)throw new Error("Missing integration headers");if(!a)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,botUserId:r,integrationId:n,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(Buffer.from(i,"base64").toString("utf-8")):{}}};var Uf=et(require("util")),Kt=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,r){this._getConsoleMethod(e)(this._serializeMessage(r))}_serializeMessage(e){let r=Uf.default.format(...e);return process.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(r):r}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var Je=class extends Kt{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Je({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};var Ff=t=>async e=>{let r=$f(e.headers),n=new vt.Client({botId:r.botId,integrationId:r.integrationId,retry:ra}),a=new zt(n),s=new Je,i={ctx:r,req:e,client:a,logger:s,instance:t};try{let o;switch(r.operation){case"webhook_received":o=await $_(i);break;case"register":o=await U_(i);break;case"unregister":o=await F_(i);break;case"message_created":o=await K_(i);break;case"action_triggered":o=await V_(i);break;case"ping":o=await N_(i);break;case"create_user":o=await L_(i);break;case"create_conversation":o=await z_(i);break;default:throw new Error(`Unknown operation ${r.operation}`)}return o?{...o,status:o.status??200}:{status:200}}catch(o){if((0,vt.isApiError)(o)){let p=o.type==="Runtime"?o:new vt.RuntimeError(o.message,o);return s.forBot().error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}console.error(o);let d=new vt.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return s.forBot().error(d.message),{status:d.code,body:JSON.stringify(d.toJSON())}}},N_=async t=>{},$_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{let{req:s}=we(r);return a.webhook({client:t,ctx:e,req:s,logger:n})},U_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=we(r);await a.register({client:t,ctx:e,webhookUrl:s,logger:n})},F_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=we(r);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:n})},L_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createUser)return;let{tags:s}=we(r);return await a.createUser({ctx:e,client:t,tags:s,logger:n})},z_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=we(r);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:n})},K_=async({ctx:t,req:e,client:r,logger:n,instance:a})=>{let{conversation:s,user:i,type:o,payload:d,message:p}=we(e),y=a.channels[s.channel];if(!y)throw new Error(`Channel ${s.channel} not found`);let T=y.messages[o];if(!T)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await T({ctx:t,conversation:s,message:p,user:i,type:o,client:r,payload:d,ack:async({tags:P})=>{await r.updateMessage({id:p.id,tags:P})},logger:n})},V_=async({req:t,ctx:e,client:r,logger:n,instance:a})=>{let{input:s,type:i}=we(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let d=new na,y={output:await o({ctx:e,input:s,client:r,type:i,logger:n,metadata:d}),meta:d.toJSON()};return{body:JSON.stringify(y)}};var aa=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}actions;channels;register;unregister;createUser;createConversation;webhook;handler=Ff(this);start=e=>vr(this.handler,e)};var sa=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;addIntegration(e,r){let n=this;return n.integrations||(n.integrations={}),n.integrations[e.name]={enabled:r.enabled,...e,configurationType:r.configurationType,configuration:r.configuration},this}addPlugin(e,r){let n=this;return n.plugins||(n.plugins={}),n.plugins[e.name]={...e,configuration:r.configuration,interfaces:r.interfaces},n.user=this._mergeUser(n.user,e.definition.user),n.conversation=this._mergeConversation(n.conversation,e.definition.conversation),n.message=this._mergeMessage(n.message,e.definition.message),n.states=this._mergeStates(n.states,e.definition.states),n.events=this._mergeEvents(n.events,e.definition.events),n.recurringEvents=this._mergeRecurringEvents(n.recurringEvents,e.definition.recurringEvents),n.actions=this._mergeActions(n.actions,e.definition.actions),n.tables=this._mergeTables(n.tables,e.definition.tables),this}_mergeUser=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeConversation=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeMessage=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeStates=(e,r)=>({...e,...r});_mergeEvents=(e,r)=>({...e,...r});_mergeRecurringEvents=(e,r)=>({...e,...r});_mergeActions=(e,r)=>({...e,...r});_mergeTables=(e,r)=>({...e,...r})};var zf=et(require("@botpress/client"));var Ye=class extends Kt{constructor(e){super({...e})}with(e){return new Ye({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}};var Ze=class{constructor(e,r={before:{},after:{}}){this._client=e;this._hooks=r}getConversation=e=>this._run("getConversation",e);listConversations=e=>this._run("listConversations",e);updateConversation=e=>this._run("updateConversation",e);deleteConversation=e=>this._run("deleteConversation",e);listParticipants=e=>this._run("listParticipants",e);addParticipant=e=>this._run("addParticipant",e);getParticipant=e=>this._run("getParticipant",e);removeParticipant=e=>this._run("removeParticipant",e);getEvent=e=>this._run("getEvent",e);listEvents=e=>this._run("listEvents",e);createMessage=e=>this._run("createMessage",e);getOrCreateMessage=e=>this._run("getOrCreateMessage",e);getMessage=e=>this._run("getMessage",e);updateMessage=e=>this._run("updateMessage",e);listMessages=e=>this._run("listMessages",e);deleteMessage=e=>this._run("deleteMessage",e);getUser=e=>this._run("getUser",e);listUsers=e=>this._run("listUsers",e);updateUser=e=>this._run("updateUser",e);deleteUser=e=>this._run("deleteUser",e);getState=e=>this._run("getState",e);setState=e=>this._run("setState",e);getOrSetState=e=>this._run("getOrSetState",e);patchState=e=>this._run("patchState",e);callAction=e=>this._run("callAction",e);uploadFile=e=>this._run("uploadFile",e);upsertFile=e=>this._run("upsertFile",e);deleteFile=e=>this._run("deleteFile",e);listFiles=e=>this._run("listFiles",e);getFile=e=>this._run("getFile",e);updateFileMetadata=e=>this._run("updateFileMetadata",e);searchFiles=e=>this._run("searchFiles",e);trackAnalytics=e=>this._run("trackAnalytics",e);getTableRow=e=>this._run("getTableRow",e);createTableRows=e=>this._run("createTableRows",e);findTableRows=e=>this._run("findTableRows",e);deleteTableRows=e=>this._run("deleteTableRows",e);updateTableRows=e=>this._run("updateTableRows",e);upsertTableRows=e=>this._run("upsertTableRows",e);createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,r)=>{let n=this._hooks.before[e];n&&(r=await n(r));let a=await this._client[e](r),s=this._hooks.after[e];return s&&(a=await s(a)),a}};var q_=S.enum(["event_received","register","unregister","ping","action_triggered"]),Lf=t=>{let e=t[mr],r=t[hr],n=t[Js],a=q_.parse(t[yr]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing type headers");if(!r)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:n,configuration:r?JSON.parse(Buffer.from(r,"base64").toString("utf-8")):{}}};var Ae={status:200},Kf=t=>async e=>{let r=Lf(e.headers),n=new Ye,a=new zf.Client({botId:r.botId,retry:ra}),s=new Ze(a,{before:{createMessage:async o=>{let d=t.hookHandlers.before_outgoing_message[o.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o},callAction:async o=>{let d=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o}},after:{createMessage:async o=>{let d=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o},callAction:async o=>{let d=t.hookHandlers.after_outgoing_call_action[o.output.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o}}}),i={req:e,ctx:r,logger:n,client:s,self:t};switch(r.operation){case"action_triggered":return await X_(i);case"event_received":return await Y_(i);case"register":return await W_(i);case"unregister":return await J_(i);case"ping":return await G_(i);default:throw new Error(`Unknown operation ${r.operation}`)}},G_=async({ctx:t})=>(Ft.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),Ae),W_=async t=>Ae,J_=async t=>Ae,Y_=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let s={client:n,ctx:t,logger:e};Ft.debug(`Received event ${t.type}`);let i=we(r);if(t.type==="message_created"){let k=i.event,P=k.payload.message,D=a.hookHandlers.before_incoming_message[P.type]??[];for(let V of D){let H=await V({...s,data:P});if(P=H?.data??P,H?.stop)return Ae}let z={...s,user:k.payload.user,conversation:k.payload.conversation,states:k.payload.states,message:P,event:k},q=a.messageHandlers[P.type]??[];for(let V of q)await V(z);let se=a.hookHandlers.after_incoming_message[P.type]??[];for(let V of se){let H=await V({...s,data:P});if(P=H?.data??P,H?.stop)return Ae}return Ae}if(t.type==="state_expired"){let P=i.event.payload.state,D={...s,state:P},z=a.stateExpiredHandlers["*"]??[];for(let q of z)await q(D);return Ae}let o=i.event,d=a.hookHandlers.before_incoming_event[o.type]??[];for(let k of d){let P=await k({...s,data:o});if(o=P?.data??o,P?.stop)return Ae}let p={...s,event:o},y=a.eventHandlers[o.type]??[];for(let k of y)await k(p);let T=a.hookHandlers.after_incoming_event[o.type]??[];for(let k of T){let P=await k({...s,data:o});if(o=P?.data??o,P?.stop)return Ae}return Ae},X_=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let{input:s,type:i}=we(r);if(!i)throw new Error("Missing action type");let o=a.actionHandlers[i];if(!o)throw new Error(`Action ${i} not found`);let p={output:await o({ctx:t,logger:e,input:s,client:n,type:i})};return{status:200,body:JSON.stringify(p)}};var ia=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};_plugins={};get actionHandlers(){let e=this._actionHandlers,r=Object.values(this._plugins).reduce((n,a)=>({...n,...a.actionHandlers}),{});return{...e,...r}}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.messageHandlers[r]??[]);return[...s,...i]}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._eventHandlers[r]??[],a=this._eventHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.eventHandlers[r]??[]);return[...s,...i]}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[r]??[]);return[...s,...i]}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>new Proxy({},{get:(n,a)=>{let s=r,i=this._hookHandlers[s]??{},o=i[a]??[],d=i["*"]??[],p=[...o,...d],y=Object.values(this._plugins).flatMap(T=>T.hookHandlers[s]?.[a]??[]);return[...p,...y]}})})}on={message:(e,r)=>{this._messageHandlers[e]=Y.safePush(this._messageHandlers[e],r)},event:(e,r)=>{this._eventHandlers[e]=Y.safePush(this._eventHandlers[e],r)},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=Y.safePush(this._stateExpiredHandlers[e],r)},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=Y.safePush(this._hookHandlers.before_incoming_event[e],r)},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=Y.safePush(this._hookHandlers.before_incoming_message[e],r)},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=Y.safePush(this._hookHandlers.before_outgoing_message[e],r)},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=Y.safePush(this._hookHandlers.before_outgoing_call_action[e],r)},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=Y.safePush(this._hookHandlers.after_incoming_event[e],r)},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=Y.safePush(this._hookHandlers.after_incoming_message[e],r)},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=Y.safePush(this._hookHandlers.after_outgoing_message[e],r)},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=Y.safePush(this._hookHandlers.after_outgoing_call_action[e],r)}};handler=Kf(this);start=e=>vr(this.handler,e)};var oa=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.entities=e.entities??{};let r=this._getEntityReference(this.entities),n=e.events===void 0?{}:te.mapValues(e.events,i=>({...i,schema:i.schema(r)})),a=e.actions===void 0?{}:te.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(r)},output:{...i.output,schema:i.output.schema(r)}})),s=e.channels===void 0?{}:te.mapValues(e.channels,i=>({...i,messages:te.mapValues(i.messages,o=>({...o,schema:o.schema(r)}))}));this.events=n,this.actions=a,this.channels=s}name;version;entities;events;actions;channels;_getEntityReference=e=>{let r={};for(let[n,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=xf.ref(n);s&&o.title(s),i&&o.describe(i),r[n]=o}return r}};var ua=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables}name;version;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables};var Xs=":";var Vf=t=>{let[e,r]=t.split(Xs);return!e||!r?null:{namespace:e,eventName:r}},qf=t=>`${t.namespace}${Xs}${t.actionName}`,Gf=t=>`${t.namespace}${Xs}${t.eventName}`,Wf=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.actions[t.actionName]?.name??t.actionName;return{namespace:n,actionName:a}},Jf=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.events[t.eventName]?.name??t.eventName;return{namespace:n,eventName:a}};var Yf=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>i=>Q_({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:s,input:i})})}),Q_=async({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:n,input:a})=>{let s=Wf({namespace:r,actionName:n},e),i=qf(s);return(await t.callAction({type:i,input:a})).output};var ca=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:r,interfaces:n}=this._runtime,a=Yf(e,n);return{configuration:r,interfaces:n,actions:a}}get actionHandlers(){let e=this._actionHandlers,r={};for(let[n,a]of te.pairs(e))r[n]=async s=>a({...s,...this._getTools(s.client)});return r}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[];return[...n,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=Object.entries(this._eventHandlers).filter(([i])=>this._eventResolvesTo(i,r)).flatMap(([,i])=>i??[]),a=this._eventHandlers["*"]??[];return[...n,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[];return[...n,...a].map(i=>o=>i({...o,...this._getTools(o.client)}))}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._hookHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{let i=n[s]??[],o=n["*"]??[];return[...i,...o].map(p=>y=>p({...y,...this._getTools(y.client)}))}})}})}on={message:(e,r)=>{this._messageHandlers[e]=Y.safePush(this._messageHandlers[e],r)},event:(e,r)=>{this._eventHandlers[e]=Y.safePush(this._eventHandlers[e],r)},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=Y.safePush(this._stateExpiredHandlers[e],r)},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=Y.safePush(this._hookHandlers.before_incoming_event[e],r)},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=Y.safePush(this._hookHandlers.before_incoming_message[e],r)},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=Y.safePush(this._hookHandlers.before_outgoing_message[e],r)},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=Y.safePush(this._hookHandlers.before_outgoing_call_action[e],r)},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=Y.safePush(this._hookHandlers.after_incoming_event[e],r)},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=Y.safePush(this._hookHandlers.after_incoming_message[e],r)},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=Y.safePush(this._hookHandlers.after_outgoing_message[e],r)},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=Y.safePush(this._hookHandlers.after_outgoing_call_action[e],r)}};_eventResolvesTo=(e,r)=>{let n=Vf(e);if(!n)return!1;let a=Jf(n,this._runtime.interfaces);return Gf(a)===r}};0&&(module.exports={BRAND,Bot,BotDefinition,BotLogger,BotSpecificClient,DIRTY,EMPTY_PATH,ErrorBoundary,INVALID,Integration,IntegrationDefinition,IntegrationLogger,IntegrationSpecificClient,InterfaceDefinition,NEVER,OK,ParseInputLazyPath,ParseStatus,Plugin,PluginDefinition,RuntimeError,Schema,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodRef,ZodSchema,ZodSet,ZodString,ZodSymbol,ZodTransformer,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,ZuiForm,addIssueToContext,agent,aimodel,any,array,bigint,boolean,botIdHeader,botUserIdHeader,coerce,configurationHeader,configurationTypeHeader,conversation,createZodEnum,cuid2Regex,cuidRegex,custom,datasource,date,datetimeRegex,defaultComponentDefinitions,discriminatedUnion,effect,emailRegex,enum:null,errorUtil,event,fromJsonSchema,fromObject,function:null,getErrorMap,getParsedType,instanceof:null,integrationIdHeader,intent,intersection,ipv4Regex,ipv6Regex,isAborted,isApiError,isAsync,isDirty,isEmojiRegex,isValid,jsonSchemaToZui,knowledgebase,late,lazy,literal,makeIssue,map,mergeObjectSchemas,message,messages,nan,nativeEnum,never,null:null,nullable,number,object,objectToZui,objectUtil,oboolean,onumber,operationHeader,optional,ostring,parseBody,pipeline,preprocess,processCreateParams,promise,quotelessJson,readonly,record,ref,serve,set,setErrorMap,strictObject,string,symbol,table,tablerow,transformer,transforms,tuple,typeHeader,ulidRegex,undefined,union,unknown,user,util,uuidRegex,variable,void:null,webhookIdHeader,withErrorBoundary,z,zuiToJsonSchema});
|
|
89
|
+
`,a+="})"}let s=r?a?r+a:n?n==="z.never()"?r+".strict()":r+`.catchall(${n})`:r:a||(n?`z.record(${n})`:"z.record(z.any())");return ie.an.anyOf(t)&&(s+=`.and(${Tf(m(l({},t),{anyOf:t.anyOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),ie.a.oneOf(t)&&(s+=`.and(${Ks(m(l({},t),{oneOf:t.oneOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),ie.an.allOf(t)&&(s+=`.and(${dr(m(l({},t),{allOf:t.allOf.map(i=>typeof i=="object"&&!i.type&&(i.properties||i.additionalProperties||i.patternProperties)?m(l({},i),{type:"object"}):i)}),e)})`),s}u(Pf,"parseObject");var f_=u(t=>{var e;let r="z.string()";if((e=t[U])!=null&&e.coerce){if(t.format==="date-time")return"z.coerce.date()";r="z.coerce.string()"}return r+=fe(t,"format",({value:n})=>{switch(n){case"email":return[".email(",")"];case"ip":return[".ip(",")"];case"ipv4":return['.ip({ version: "v4"',", message: "," })"];case"ipv6":return['.ip({ version: "v6"',", message: "," })"];case"uri":return[".url(",")"];case"uuid":return[".uuid(",")"];case"date-time":return[".datetime(",")"]}}),r+=fe(t,"pattern",({json:n})=>[`.regex(new RegExp(${n})`,", ",")"]),r+=fe(t,"minLength",({json:n})=>[`.min(${n}`,", ",")"]),r+=fe(t,"maxLength",({json:n})=>[`.max(${n}`,", ",")"]),r},"parseString"),p_=u((t,e)=>`${le(s_(t,"nullable"),e,!0)}.nullable()`,"parseNullable"),g_=u(t=>`z.ref('${t.$ref}')`,"parseRef"),m_=u((t,e)=>{var r,n;if(t.oneOf.length<=1||!((r=t.discriminator)!=null&&r.propertyName))return Ks(t,e);let a=t.oneOf.map((s,i)=>le(s,m(l({},e),{path:[...e.path,"oneOf",i]})));return`z.discriminatedUnion("${(n=t.discriminator)==null?void 0:n.propertyName}", [${a.join(", ")}])`},"parseDiscriminator"),le=u((t,e={seen:new Map,path:[]},r)=>{if(typeof t!="object")return t?"z.any()":"z.never()";if(e.parserOverride){let s=e.parserOverride(t,e);if(typeof s=="string")return s}let n=e.seen.get(t);if(n){if(n.r!==void 0)return n.r;if(e.depth===void 0||n.n>=e.depth)return"z.any()";n.n+=1}else n={r:void 0,n:0},e.seen.set(t,n);let a=v_(t,e);return r||(a=h_(t,a),e.withoutDefaults||(a=y_(t,a))),n.r=a,a},"parseSchema"),h_=u((t,e)=>(t.description&&(e+=`.describe(${JSON.stringify(t.description)})`),e),"addMeta"),y_=u((t,e)=>(t.default!==void 0&&(e+=`.default(${JSON.stringify(t.default)})`),e),"addDefaults"),v_=u((t,e)=>ie.a.nullable(t)?p_(t,e):ie.an.object(t)?Pf(t,e):ie.an.array(t)?o_(t,e):ie.an.anyOf(t)?Tf(t,e):ie.an.allOf(t)?dr(t,e):ie.a.discriminator(t)?m_(t,e):ie.a.oneOf(t)?Ks(t,e):ie.a.not(t)?r_(t,e):ie.an.enum(t)?c_(t):ie.a.const(t)?u_(t):ie.a.multipleType(t)?t_(t,e):ie.a.primitive(t,"string")?f_(t):ie.a.primitive(t,"number")||ie.a.primitive(t,"integer")?d_(t):ie.a.primitive(t,"boolean")?Qv(t):ie.a.primitive(t,"null")?n_(t):ie.a.conditional(t)?l_(t,e):ie.a.ref(t)?g_(t):e_(t),"selectParser"),ie={an:{object:u(t=>t.type==="object","object"),array:u(t=>t.type==="array","array"),anyOf:u(t=>t.anyOf!==void 0,"anyOf"),allOf:u(t=>t.allOf!==void 0,"allOf"),enum:u(t=>t.enum!==void 0,"enum")},a:{nullable:u(t=>t.nullable===!0,"nullable"),multipleType:u(t=>Array.isArray(t.type),"multipleType"),not:u(t=>t.not!==void 0,"not"),const:u(t=>t.const!==void 0,"const"),primitive:u((t,e)=>t.type===e,"primitive"),conditional:u(t=>Boolean("if"in t&&t.if&&"then"in t&&"else"in t&&t.then&&t.else),"conditional"),discriminator:u(t=>{var e;return t.oneOf!==void 0&&((e=t.discriminator)==null?void 0:e.propertyName)!==void 0},"discriminator"),oneOf:u(t=>t.oneOf!==void 0,"oneOf"),ref:u(t=>t.$ref!==void 0,"ref")}},__=u(t=>{let e;try{e=new Function("z",`return ${t}`)(v)}catch(r){return{sucess:!1,error:`Failed to evaluate schema: ${(r instanceof Error?r:new Error(String(r))).message}`}}return e instanceof v.ZodType?{sucess:!0,value:e}:{sucess:!1,error:`String "${t}" does not evaluate to a Zod schema`}},"evalZuiString"),b_=u(t=>le(t,{seen:new Map,path:[]}),"jsonSchemaToZodStr"),T_=u(t=>{let e=b_(t);e=e.replaceAll("errors: z.ZodError[]","errors");let r=__(e);if(!r.sucess)throw new Qo(r.error);return r.value},"jsonSchemaToZod"),nr=u((t,e)=>{var r,n;if(e[U]&&t._def&&(t._def[U]=e[U]),((r=t._def)==null?void 0:r.typeName)==="ZodObject"&&e.type==="object"&&e.properties&&Object.entries(e.properties).forEach(([a,s])=>{let i=typeof t._def.shape=="function"?t._def.shape():t._def.shape;i[a]&&nr(i[a],s)}),((n=t._def)==null?void 0:n.typeName)==="ZodRecord"&&e.type==="object"&&e.additionalProperties&&nr(t._def.valueType,e.additionalProperties),e.type==="array"&&e.items){let a=e.items;if(typeof a=="object"&&!Array.isArray(a)){let s=t._def.type;s&&nr(s,a)}else Array.isArray(a)&&a.forEach((s,i)=>{let o=t._def;o.typeName===S.ZodFirstPartyTypeKind.ZodTuple&&nr(o.items[i],s)})}},"applyZuiPropsRecursively"),hr=u(t=>{let e=T_(t);return nr(e,t),e},"jsonSchemaToZui"),Ef=class extends Nt.Component{constructor(){super(...arguments),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("Uncaught error:",e,r)}render(){return this.state.hasError&&this.props.fallback?Nt.default.createElement(this.props.fallback,{error:this.state.error,schema:this.props.fieldSchema}):this.props.children}};u(Ef,"ErrorBoundary");var At=Ef;function xf(t,e){return r=>Nt.default.createElement(At,{fallback:e,fieldSchema:r.fieldSchema,path:r.path},Nt.default.createElement(t,l({},r)))}u(xf,"withErrorBoundary");var Vr=u(t=>{var e=t,{components:r,fieldSchema:n,path:a,required:s,fallback:i}=e,o=Mo(e,["components","fieldSchema","path","required","fallback"]),d,p;let{formData:y,disabled:T,hidden:k,handlePropertyChange:P,addArrayItem:D,removeArrayItem:K,formErrors:G,formValid:se}=No(n,a),q=(0,be.useMemo)(()=>at(y,a),[y,a]),H=(0,be.useMemo)(()=>Rg(r,n),[n,r]),{discriminator:J,discriminatedSchema:ce,discriminatorValue:Le}=Ig(n,a);if(!H||k===!0)return null;let{Component:Xe,type:Oe}=H,Te={type:Oe,componentID:H.id,scope:a.join("."),context:{path:a,readonly:!1,formData:y,formErrors:G,formValid:se,updateForm:P,updateFormData:u(Pe=>P([],Pe),"updateFormData")},onChange:u(Pe=>P(a,Pe),"onChange"),disabled:T,errors:G?.filter(Pe=>Pe.path===a)||[],label:((d=n[U])==null?void 0:d.title)||Fa(((p=a[a.length-1])==null?void 0:p.toString())||""),params:H.params,schema:n,zuiProps:n[U]};if(n.type==="array"&&Oe==="array"){let Pe=Xe,_e=Te.schema,Ee=Array.isArray(q)||typeof q=="object"?q:[],j=l(m(l({},Te),{type:Oe,schema:_e,data:Ee,addItem:u(Ce=>D(a,Ce),"addItem"),removeItem:u(Ce=>K(a,Ce),"removeItem")}),o);return Array.isArray(n.items)?null:be.default.createElement(Pe,m(l({key:Te.scope},j),{isArrayChild:j.isArrayChild}),Array.isArray(j.data)?j.data.map((Ce,ke)=>{let ze=[...a,ke.toString()];return be.default.createElement(At,{key:ze.join("."),fallback:i,fieldSchema:n.items,path:ze},be.default.createElement(Vr,{key:ze.join("."),components:r,fieldSchema:n.items,path:ze,required:s,isArrayChild:!0,index:ke,removeSelf:()=>K(a,ke),fallback:i}))}):[])}if(n.type==="object"&&Oe==="object"&&n.properties){let Pe=Xe,_e=l(m(l({},Te),{type:Oe,schema:Te.schema,data:q||{}}),o);return be.default.createElement(Pe,m(l({key:Te.scope},_e),{isArrayChild:_e.isArrayChild}),Object.entries(n.properties).map(([Ee,j])=>{var Ce;let ke=[...a,Ee];return be.default.createElement(At,{key:ke.join("."),fallback:i,fieldSchema:j,path:ke},be.default.createElement(Vr,{key:ke.join("."),components:r,fieldSchema:j,path:ke,required:((Ce=n.required)==null?void 0:Ce.includes(Ee))||!1,isArrayChild:!1,fallback:i}))}))}if(Oe==="discriminatedUnion"){let Pe=Xe,_e=l(m(l({},Te),{type:Oe,schema:Te.schema,data:q||{},discriminatorKey:J?.key||null,discriminatorLabel:Fa(J?.key||"Unknown"),discriminatorOptions:J?.values||null,discriminatorValue:Le,setDiscriminator:u(Ee=>{if(!J?.key){console.warn("No discriminator key found, cannot set discriminator");return}P(a,{[J.key]:Ee})},"setDiscriminator")}),o);return be.default.createElement(Pe,m(l({key:Te.scope},_e),{isArrayChild:_e.isArrayChild}),ce&&be.default.createElement(At,{key:a.join("."),fallback:i,fieldSchema:ce,path:a},be.default.createElement(Vr,{components:r,fieldSchema:ce,path:a,required:s,isArrayChild:!1,fallback:i})))}let fa=Xe,pa=l(m(l({},Te),{type:Oe,schema:Te.schema,config:{},required:s,data:q,description:n.description}),o);return be.default.createElement(fa,l({},pa))},"FormElementRenderer"),P_=u(({schema:t,components:e,onChange:r,value:n,disableValidation:a,fallback:s,dataTransform:i,onValidation:o})=>{let[d,p]=(0,Ne.useState)(n);return(0,Ne.useEffect)(()=>{r(d)},[d]),(0,Ne.useEffect)(()=>{let y=It(t);p(T=>Gr(y,T))},[JSON.stringify(t),p]),Ne.default.createElement(Cg,{formData:d,setFormData:p,formSchema:t,disableValidation:a||!1,dataTransform:i,onValidation:o},Ne.default.createElement(At,{fallback:s,fieldSchema:t,path:[]},Ne.default.createElement(Vr,{components:e,fieldSchema:t,path:[],fallback:s,required:!0,isArrayChild:!1})))},"ZuiForm"),E_={string:{},number:{slider:{id:"slider",params:v.object({})}},boolean:{switch:{id:"switch",params:v.object({})}},array:{},object:{},discriminatedUnion:{}},x_={errors:Jo,jsonSchemaToZui:hr,zuiToJsonSchema:ea,objectToZui:Ht,toTypescript:Wr,toTypescriptSchema:hs};var Ft=(t,e)=>{let r=t._def,n=e._def;if(r.typeName===S.ZodFirstPartyTypeKind.ZodObject&&n.typeName===S.ZodFirstPartyTypeKind.ZodObject){let a=r.shape(),s=n.shape();return S.object({...a,...s})}if(r.typeName===S.ZodFirstPartyTypeKind.ZodRecord&&n.typeName===S.ZodFirstPartyTypeKind.ZodRecord)return S.record(S.intersection(r.valueType,n.valueType));throw new Error("Cannot merge object schemas with record schemas")},Sf=S;var ve=S.string().min(1),kf=S.object({text:ve}),Of=S.object({markdown:ve}),Cf=S.object({imageUrl:ve}),If=S.object({audioUrl:ve}),Zf=S.object({videoUrl:ve}),Af=S.object({fileUrl:ve,title:ve.optional()}),Rf=S.object({latitude:S.number(),longitude:S.number(),address:S.string().optional(),title:S.string().optional()}),Bf=S.object({title:ve,subtitle:ve.optional(),imageUrl:ve.optional(),actions:S.array(S.object({action:S.enum(["postback","url","say"]),label:ve,value:ve}))}),wf=S.object({text:ve,options:S.array(S.object({label:ve,value:ve}))}),S_=S.object({items:S.array(Bf)}),w_=S.union([S.object({type:S.literal("text"),payload:kf}),S.object({type:S.literal("markdown"),payload:Of}),S.object({type:S.literal("image"),payload:Cf}),S.object({type:S.literal("audio"),payload:If}),S.object({type:S.literal("video"),payload:Zf}),S.object({type:S.literal("file"),payload:Af}),S.object({type:S.literal("location"),payload:Rf})]),k_=S.object({items:S.array(w_)}),O_={schema:Of},C_={text:{schema:kf},image:{schema:Cf},audio:{schema:If},video:{schema:Zf},file:{schema:Af},location:{schema:Rf},carousel:{schema:S_},card:{schema:Bf},dropdown:{schema:wf},choice:{schema:wf},bloc:{schema:k_}};var yr="x-bot-id",qs="x-bot-user-id",Gs="x-integration-id",Ws="x-webhook-id",Js="x-bp-configuration-type",vr="x-bp-configuration",_r="x-bp-operation",Ys="x-bp-type";var Df=require("browser-or-node");var Lt=console;function we(t){if(!t.body)throw new Error("Missing body");return JSON.parse(t.body)}async function br(t,e=8072,r=R_){if(!Df.isNode)throw new Error("This function can only be called in Node.js");let a=require("http").createServer(async(s,i)=>{try{let o=await I_(s);if(o.path==="/health"){i.writeHead(200).end("ok");return}let d=await t(o);i.writeHead(d?.status??200,d?.headers??{}).end(d?.body??"{}")}catch(o){Lt.error("Error while handling request",{error:o?.message??"Internal error occured"}),i.writeHead(500).end(JSON.stringify({error:o?.message??"Internal error occured"}))}});return a.listen(e,()=>r(e)),a}async function I_(t){let e=await A_(t),r={};for(let a=0;a<t.rawHeaders.length;a+=2){let s=t.rawHeaders[a].toLowerCase(),i=t.rawHeaders[a+1];r[s]=i}let n=new URL(t.url??"",t.headers.host?`http://${t.headers.host}`:"http://botpress.cloud");return{body:e,path:n.pathname,query:Z_(n.search,"?"),headers:r,method:t.method?.toUpperCase()??"GET"}}function Z_(t,e){return t.indexOf(e)===0?t.slice(e.length):t}async function A_(t){return new Promise((e,r)=>{if(t.method!=="POST"&&t.method!=="PUT"&&t.method!=="PATCH")return e(void 0);let n="";t.on("data",a=>n+=a.toString()),t.on("error",a=>r(a)),t.on("end",()=>e(n))})}function R_(t){Lt.info(`Listening on port ${t}`)}var da=require("@botpress/client");var te={};Jt(te,{mapValues:()=>D_,mergeRecords:()=>j_,pairs:()=>Xs,stripUndefinedProps:()=>M_,values:()=>B_});var Xs=t=>Object.entries(t),B_=t=>Object.values(t),D_=(t,e)=>Object.fromEntries(Xs(t).map(([r,n])=>[r,e(n,r)])),M_=t=>Object.fromEntries(Xs(t).filter(([,e])=>e!==void 0)),j_=(t,e,r)=>{let n=[...Object.keys(t),...Object.keys(e)],a=[...new Set(n)],s={};for(let i of a){let o=t[i],d=e[i];o&&d?s[i]=r(o,d):o?s[i]=o:d&&(s[i]=d)}return s};var z={};Jt(z,{safePush:()=>H_,unique:()=>N_});var H_=(t,...e)=>t?[...t,...e]:[...e],N_=t=>Array.from(new Set(t));var vt={};Jt(vt,{setName:()=>$_});var $_=(t,e)=>(Object.defineProperty(t,"name",{value:e}),t);var Mf=t=>{let{name:e,version:r}=t,n={actions:{},events:{},channels:{}},a={name:e,version:r,entities:te.mapValues(t.entities,i=>({name:i.name})),actions:{},events:{},channels:{}},s=te.mapValues(t.entities,i=>i.schema);for(let[i,o]of Object.entries(t.definition.actions??{})){let d=o.input.schema.dereference(s),p=o.output.schema.dereference(s),y=t.actions?.[i]?.name??i;n.actions[y]={...o,...t.actions?.[i]??{},input:{schema:d},output:{schema:p}},a.actions[i]={name:y}}for(let[i,o]of Object.entries(t.definition.events??{})){let d=o.schema.dereference(s),p=t.events?.[i]?.name??i;n.events[p]={...o,...t.events?.[i]??{},schema:d},a.events[i]={name:p}}for(let[i,o]of Object.entries(t.definition.channels??{})){let d={};for(let[y,T]of Object.entries(o.messages)){let k=T.schema.dereference(s);d[y]={...T,schema:k}}let p=t.channels?.[i]?.name??i;n.channels[p]={...o,...t.channels?.[i]??{},message:{...o.message??{},tags:{...o.message?.tags??{},...t.channels?.[i]?.message?.tags??{}}},conversation:{...o.conversation??{},tags:{...o.conversation?.tags??{},...t.channels?.[i]?.conversation?.tags??{}}},messages:d},a.channels[i]={name:p}}return{resolved:n,statement:a}};var ta=Symbol("schemaName"),jf=t=>t?te.mapValues(t,(r,n)=>({...r,[ta]:n})):{},Hf=t=>ta in t&&t[ta]!==void 0,Nf=t=>t[ta];var ra=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.configurations=e.configurations,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities,this.interfaces=e.interfaces,this.__advanced=e.__advanced}name;version;title;description;icon;readme;configuration;configurations;events;actions;channels;states;user;secrets;identifier;entities;interfaces;__advanced;extend(e,r){let{entities:n,actions:a,events:s,channels:i}=this._callBuilder(e,r),o=this;o.interfaces??={};let d=Object.values(n).map(k=>k.name),p=d.length===0?e.name:`${e.name}<${d.join(",")}>`,{resolved:y,statement:T}=Mf({...e,entities:n,actions:te.stripUndefinedProps(a),events:te.stripUndefinedProps(s),channels:te.stripUndefinedProps(i)});return o.actions=te.mergeRecords(o.actions??{},y.actions,this._mergeActions),o.channels=te.mergeRecords(o.channels??{},y.channels,this._mergeChannels),o.events=te.mergeRecords(o.events??{},y.events,this._mergeEvents),o.interfaces[p]={id:e.id,...T},this}_callBuilder(e,r){let a={entities:jf(this.entities)},s=r(a),i=te.pairs(s.entities).find(([d,p])=>!Hf(p));if(i)throw new Error(`Cannot extend interface "${e.name}" with entity "${i[0]}"; the provided schema is not part of the integration's entities.`);return{entities:te.mapValues(s.entities,d=>({name:Nf(d),schema:d.schema})),actions:s.actions??{},events:s.events??{},channels:s.channels??{}}}_mergeActions=(e,r)=>({...e,...r,input:{schema:Ft(e.input.schema,r.input.schema)},output:{schema:Ft(e.input.schema,r.output.schema)}});_mergeEvents=(e,r)=>({...e,...r,schema:Ft(e.schema,r.schema)});_mergeChannels=(e,r)=>{let n=te.mergeRecords(e.messages,r.messages,this._mergeMessage);return{...e,...r,messages:n}};_mergeMessage=(e,r)=>({schema:Ft(e.schema,r.schema)})};var _t=require("@botpress/client");var $f=require("@botpress/client"),na={retries:3,retryCondition:t=>$f.axiosRetry.isNetworkOrIdempotentRequestError(t)||[429,502].includes(t.response?.status??0),retryDelay:t=>t*1e3};var Kt=class{constructor(e){this._client=e}createConversation=e=>this._client.createConversation(e);getConversation=e=>this._client.getConversation(e);listConversations=e=>this._client.listConversations(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);updateConversation=e=>this._client.updateConversation(e);deleteConversation=e=>this._client.deleteConversation(e);listParticipants=e=>this._client.listParticipants(e);addParticipant=e=>this._client.addParticipant(e);getParticipant=e=>this._client.getParticipant(e);removeParticipant=e=>this._client.removeParticipant(e);createEvent=e=>this._client.createEvent(e);getEvent=e=>this._client.getEvent(e);listEvents=e=>this._client.listEvents(e);createMessage=e=>this._client.createMessage(e);getOrCreateMessage=e=>this._client.getOrCreateMessage(e);getMessage=e=>this._client.getMessage(e);updateMessage=e=>this._client.updateMessage(e);listMessages=e=>this._client.listMessages(e);deleteMessage=e=>this._client.deleteMessage(e);createUser=e=>this._client.createUser(e);getUser=e=>this._client.getUser(e);listUsers=e=>this._client.listUsers(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);updateUser=e=>this._client.updateUser(e);deleteUser=e=>this._client.deleteUser(e);getState=e=>this._client.getState(e);setState=e=>this._client.setState(e);getOrSetState=e=>this._client.getOrSetState(e);patchState=e=>this._client.patchState(e);configureIntegration=e=>this._client.configureIntegration(e);uploadFile=e=>this._client.uploadFile(e);upsertFile=e=>this._client.upsertFile(e);deleteFile=e=>this._client.deleteFile(e);listFiles=e=>this._client.listFiles(e);getFile=e=>this._client.getFile(e);updateFileMetadata=e=>this._client.updateFileMetadata(e)};var aa=class{_cost=0;get cost(){return this._cost}setCost(e){this._cost=e}toJSON(){return{cost:this.cost}}};var U_=S.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),Uf=t=>{let e=t[yr],r=t[qs],n=t[Gs],a=t[Ws],s=t[Js],i=t[vr],o=U_.parse(t[_r]);if(!e)throw new Error("Missing bot headers");if(!r)throw new Error("Missing bot user headers");if(!n)throw new Error("Missing integration headers");if(!a)throw new Error("Missing webhook headers");if(!i)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:e,botUserId:r,integrationId:n,webhookId:a,operation:o,configurationType:s??null,configuration:i?JSON.parse(Buffer.from(i,"base64").toString("utf-8")):{}}};var Ff=et(require("util")),Vt=class{defaultOptions;constructor(e){this.defaultOptions=e}info(...e){this._log("info",e)}debug(...e){this._log("debug",e)}warn(...e){this._log("warn",e)}error(...e){this._log("error",e)}_log(e,r){this._getConsoleMethod(e)(this._serializeMessage(r))}_serializeMessage(e){let r=Ff.default.format(...e);return process.env.BP_LOG_FORMAT==="json"?this.getJsonMessage(r):r}getJsonMessage(e){return JSON.stringify({msg:e,options:this.defaultOptions})}_getConsoleMethod(e){switch(e){case"debug":return console.debug;case"warn":return console.warn;case"error":return console.error;default:return console.info}}};var Je=class extends Vt{constructor(e){super({visibleToBotOwners:!0,...e})}with(e){return new Je({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withVisibleToBotOwners(e){return this.with({visibleToBotOwners:e})}forBot(){return this.withVisibleToBotOwners(!0)}getJsonMessage(e){return JSON.stringify({msg:e,visible_to_bot_owner:this.defaultOptions.visibleToBotOwners,options:this.defaultOptions})}};var Lf=t=>async e=>{let r=Uf(e.headers),n=new _t.Client({botId:r.botId,integrationId:r.integrationId,retry:na}),a=new Kt(n),s=new Je,i={ctx:r,req:e,client:a,logger:s,instance:t};try{let o;switch(r.operation){case"webhook_received":o=await L_(i);break;case"register":o=await z_(i);break;case"unregister":o=await K_(i);break;case"message_created":o=await G_(i);break;case"action_triggered":o=await W_(i);break;case"ping":o=await F_(i);break;case"create_user":o=await V_(i);break;case"create_conversation":o=await q_(i);break;default:throw new Error(`Unknown operation ${r.operation}`)}return o?{...o,status:o.status??200}:{status:200}}catch(o){if((0,_t.isApiError)(o)){let p=o.type==="Runtime"?o:new _t.RuntimeError(o.message,o);return s.forBot().error(p.message),{status:p.code,body:JSON.stringify(p.toJSON())}}console.error(o);let d=new _t.RuntimeError("An unexpected error occurred in the integration. Bot owners: Check logs for more informations. Integration owners: throw a RuntimeError to return a custom error message instead.");return s.forBot().error(d.message),{status:d.code,body:JSON.stringify(d.toJSON())}}},F_=async t=>{},L_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{let{req:s}=we(r);return a.webhook({client:t,ctx:e,req:s,logger:n})},z_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.register)return;let{webhookUrl:s}=we(r);await a.register({client:t,ctx:e,webhookUrl:s,logger:n})},K_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.unregister)return;let{webhookUrl:s}=we(r);await a.unregister({ctx:e,webhookUrl:s,client:t,logger:n})},V_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createUser)return;let{tags:s}=we(r);return await a.createUser({ctx:e,client:t,tags:s,logger:n})},q_=async({client:t,ctx:e,req:r,logger:n,instance:a})=>{if(!a.createConversation)return;let{channel:s,tags:i}=we(r);return await a.createConversation({ctx:e,client:t,channel:s,tags:i,logger:n})},G_=async({ctx:t,req:e,client:r,logger:n,instance:a})=>{let{conversation:s,user:i,type:o,payload:d,message:p}=we(e),y=a.channels[s.channel];if(!y)throw new Error(`Channel ${s.channel} not found`);let T=y.messages[o];if(!T)throw new Error(`Message of type ${o} not found in channel ${s.channel}`);await T({ctx:t,conversation:s,message:p,user:i,type:o,client:r,payload:d,ack:async({tags:P})=>{await r.updateMessage({id:p.id,tags:P})},logger:n})},W_=async({req:t,ctx:e,client:r,logger:n,instance:a})=>{let{input:s,type:i}=we(t);if(!i)throw new Error("Missing action type");let o=a.actions[i];if(!o)throw new Error(`Action ${i} not found`);let d=new aa,y={output:await o({ctx:e,input:s,client:r,type:i,logger:n,metadata:d}),meta:d.toJSON()};return{body:JSON.stringify(y)}};var sa=class{constructor(e){this.props=e;this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}actions;channels;register;unregister;createUser;createConversation;webhook;handler=Lf(this);start=e=>br(this.handler,e)};var ia=class{constructor(e){this.props=e;this.integrations=e.integrations,this.plugins=e.plugins,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables}integrations;plugins;user;conversation;message;states;configuration;events;recurringEvents;actions;tables;addIntegration(e,r){let n=this;return n.integrations||(n.integrations={}),n.integrations[e.name]={enabled:r.enabled,...e,configurationType:r.configurationType,configuration:r.configuration},this}addPlugin(e,r){let n=this;return n.plugins||(n.plugins={}),n.plugins[e.name]={...e,configuration:r.configuration,interfaces:r.interfaces},n.user=this._mergeUser(n.user,e.definition.user),n.conversation=this._mergeConversation(n.conversation,e.definition.conversation),n.message=this._mergeMessage(n.message,e.definition.message),n.states=this._mergeStates(n.states,e.definition.states),n.events=this._mergeEvents(n.events,e.definition.events),n.recurringEvents=this._mergeRecurringEvents(n.recurringEvents,e.definition.recurringEvents),n.actions=this._mergeActions(n.actions,e.definition.actions),n.tables=this._mergeTables(n.tables,e.definition.tables),this}_mergeUser=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeConversation=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeMessage=(e,r)=>({tags:{...e?.tags,...r?.tags}});_mergeStates=(e,r)=>({...e,...r});_mergeEvents=(e,r)=>({...e,...r});_mergeRecurringEvents=(e,r)=>({...e,...r});_mergeActions=(e,r)=>({...e,...r});_mergeTables=(e,r)=>({...e,...r})};var Kf=et(require("@botpress/client"));var Ye=class extends Vt{constructor(e){super({...e})}with(e){return new Ye({...this.defaultOptions,...e})}withUserId(e){return this.with({userId:e})}withConversationId(e){return this.with({conversationId:e})}withWorkflowId(e){return this.with({workflowId:e})}};var Ze=class{constructor(e,r={before:{},after:{}}){this._client=e;this._hooks=r}getConversation=e=>this._run("getConversation",e);listConversations=e=>this._run("listConversations",e);updateConversation=e=>this._run("updateConversation",e);deleteConversation=e=>this._run("deleteConversation",e);listParticipants=e=>this._run("listParticipants",e);addParticipant=e=>this._run("addParticipant",e);getParticipant=e=>this._run("getParticipant",e);removeParticipant=e=>this._run("removeParticipant",e);getEvent=e=>this._run("getEvent",e);listEvents=e=>this._run("listEvents",e);createMessage=e=>this._run("createMessage",e);getOrCreateMessage=e=>this._run("getOrCreateMessage",e);getMessage=e=>this._run("getMessage",e);updateMessage=e=>this._run("updateMessage",e);listMessages=e=>this._run("listMessages",e);deleteMessage=e=>this._run("deleteMessage",e);getUser=e=>this._run("getUser",e);listUsers=e=>this._run("listUsers",e);updateUser=e=>this._run("updateUser",e);deleteUser=e=>this._run("deleteUser",e);getState=e=>this._run("getState",e);setState=e=>this._run("setState",e);getOrSetState=e=>this._run("getOrSetState",e);patchState=e=>this._run("patchState",e);callAction=e=>this._run("callAction",e);uploadFile=e=>this._run("uploadFile",e);upsertFile=e=>this._run("upsertFile",e);deleteFile=e=>this._run("deleteFile",e);listFiles=e=>this._run("listFiles",e);getFile=e=>this._run("getFile",e);updateFileMetadata=e=>this._run("updateFileMetadata",e);searchFiles=e=>this._run("searchFiles",e);trackAnalytics=e=>this._run("trackAnalytics",e);getTableRow=e=>this._run("getTableRow",e);createTableRows=e=>this._run("createTableRows",e);findTableRows=e=>this._run("findTableRows",e);deleteTableRows=e=>this._run("deleteTableRows",e);updateTableRows=e=>this._run("updateTableRows",e);upsertTableRows=e=>this._run("upsertTableRows",e);createConversation=e=>this._client.createConversation(e);getOrCreateConversation=e=>this._client.getOrCreateConversation(e);createUser=e=>this._client.createUser(e);getOrCreateUser=e=>this._client.getOrCreateUser(e);_run=async(e,r)=>{let n=this._hooks.before[e];n&&(r=await n(r));let a=await this._client[e](r),s=this._hooks.after[e];return s&&(a=await s(a)),a}};var J_=S.enum(["event_received","register","unregister","ping","action_triggered"]),zf=t=>{let e=t[yr],r=t[vr],n=t[Ys],a=J_.parse(t[_r]);if(!e)throw new Error("Missing bot headers");if(!n)throw new Error("Missing type headers");if(!r)throw new Error("Missing configuration headers");if(!a)throw new Error("Missing operation headers");return{botId:e,operation:a,type:n,configuration:r?JSON.parse(Buffer.from(r,"base64").toString("utf-8")):{}}};var Ae={status:200},Vf=t=>async e=>{let r=zf(e.headers),n=new Ye,a=new Kf.Client({botId:r.botId,retry:na}),s=new Ze(a,{before:{createMessage:async o=>{let d=t.hookHandlers.before_outgoing_message[o.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o},callAction:async o=>{let d=t.hookHandlers.before_outgoing_call_action[o.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o}},after:{createMessage:async o=>{let d=t.hookHandlers.after_outgoing_message[o.message.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o},callAction:async o=>{let d=t.hookHandlers.after_outgoing_call_action[o.output.type]??[];for(let p of d)o=(await p({client:new Ze(a),ctx:r,logger:n,data:o}))?.data??o;return o}}}),i={req:e,ctx:r,logger:n,client:s,self:t};switch(r.operation){case"action_triggered":return await tb(i);case"event_received":return await eb(i);case"register":return await X_(i);case"unregister":return await Q_(i);case"ping":return await Y_(i);default:throw new Error(`Unknown operation ${r.operation}`)}},Y_=async({ctx:t})=>(Lt.info(`Received ${t.operation} operation for bot ${t.botId} of type ${t.type}`),Ae),X_=async t=>Ae,Q_=async t=>Ae,eb=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let s={client:n,ctx:t,logger:e};Lt.debug(`Received event ${t.type}`);let i=we(r);if(t.type==="message_created"){let k=i.event,P=k.payload.message,D=a.hookHandlers.before_incoming_message[P.type]??[];for(let q of D){let H=await q({...s,data:P});if(P=H?.data??P,H?.stop)return Ae}let K={...s,user:k.payload.user,conversation:k.payload.conversation,states:k.payload.states,message:P,event:k},G=a.messageHandlers[P.type]??[];for(let q of G)await q(K);let se=a.hookHandlers.after_incoming_message[P.type]??[];for(let q of se){let H=await q({...s,data:P});if(P=H?.data??P,H?.stop)return Ae}return Ae}if(t.type==="state_expired"){let P=i.event.payload.state,D={...s,state:P},K=a.stateExpiredHandlers["*"]??[];for(let G of K)await G(D);return Ae}let o=i.event,d=a.hookHandlers.before_incoming_event[o.type]??[];for(let k of d){let P=await k({...s,data:o});if(o=P?.data??o,P?.stop)return Ae}let p={...s,event:o},y=a.eventHandlers[o.type]??[];for(let k of y)await k(p);let T=a.hookHandlers.after_incoming_event[o.type]??[];for(let k of T){let P=await k({...s,data:o});if(o=P?.data??o,P?.stop)return Ae}return Ae},tb=async({ctx:t,logger:e,req:r,client:n,self:a})=>{let{input:s,type:i}=we(r);if(!i)throw new Error("Missing action type");let o=a.actionHandlers[i];if(!o)throw new Error(`Action ${i} not found`);let p={output:await o({ctx:t,logger:e,input:s,client:n,type:i})};return{status:200,body:JSON.stringify(p)}};var oa=class{constructor(e){this.props=e;this._actionHandlers=e.actions,this._plugins=e.plugins}_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};_plugins={};get actionHandlers(){let e=this._actionHandlers,r=Object.values(this._plugins).reduce((n,a)=>({...n,...a.actionHandlers}),{});return{...e,...r}}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.messageHandlers[r]??[]);return z.unique([...s,...i])}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._eventHandlers[r]??[],a=this._eventHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.eventHandlers[r]??[]);return z.unique([...s,...i])}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[],s=[...n,...a],i=Object.values(this._plugins).flatMap(o=>o.stateExpiredHandlers[r]??[]);return z.unique([...s,...i])}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>new Proxy({},{get:(n,a)=>{let s=r,i=this._hookHandlers[s]??{},o=i[a]??[],d=i["*"]??[],p=[...o,...d],y=Object.values(this._plugins).flatMap(T=>T.hookHandlers[s]?.[a]??[]);return z.unique([...p,...y])}})})}on={message:(e,r)=>{this._messageHandlers[e]=z.safePush(this._messageHandlers[e],r)},event:(e,r)=>{this._eventHandlers[e]=z.safePush(this._eventHandlers[e],r)},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=z.safePush(this._stateExpiredHandlers[e],r)},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=z.safePush(this._hookHandlers.before_incoming_event[e],r)},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=z.safePush(this._hookHandlers.before_incoming_message[e],r)},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=z.safePush(this._hookHandlers.before_outgoing_message[e],r)},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=z.safePush(this._hookHandlers.before_outgoing_call_action[e],r)},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=z.safePush(this._hookHandlers.after_incoming_event[e],r)},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=z.safePush(this._hookHandlers.after_incoming_message[e],r)},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=z.safePush(this._hookHandlers.after_outgoing_message[e],r)},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=z.safePush(this._hookHandlers.after_outgoing_call_action[e],r)}};handler=Vf(this);start=e=>br(this.handler,e)};var ua=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.entities=e.entities??{};let r=this._getEntityReference(this.entities),n=e.events===void 0?{}:te.mapValues(e.events,i=>({...i,schema:i.schema(r)})),a=e.actions===void 0?{}:te.mapValues(e.actions,i=>({...i,input:{...i.input,schema:i.input.schema(r)},output:{...i.output,schema:i.output.schema(r)}})),s=e.channels===void 0?{}:te.mapValues(e.channels,i=>({...i,messages:te.mapValues(i.messages,o=>({...o,schema:o.schema(r)}))}));this.events=n,this.actions=a,this.channels=s}name;version;entities;events;actions;channels;_getEntityReference=e=>{let r={};for(let[n,a]of Object.entries(e)){let s=a.schema._def["x-zui"]?.title,i=a.schema._def.description,o=Sf.ref(n);s&&o.title(s),i&&o.describe(i),r[n]=o}return r}};var ca=class{constructor(e){this.props=e;this.name=e.name,this.version=e.version,this.integrations=e.integrations,this.interfaces=e.interfaces,this.user=e.user,this.conversation=e.conversation,this.message=e.message,this.states=e.states,this.configuration=e.configuration,this.events=e.events,this.recurringEvents=e.recurringEvents,this.actions=e.actions,this.tables=e.tables}name;version;integrations;interfaces;user;conversation;message;states;configuration;events;recurringEvents;actions;tables};var Qs=":";var qf=t=>{let[e,r]=t.split(Qs);return!e||!r?null:{namespace:e,eventName:r}},Gf=t=>`${t.namespace}${Qs}${t.actionName}`,Wf=t=>`${t.namespace}${Qs}${t.eventName}`,Jf=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.actions[t.actionName]?.name??t.actionName;return{namespace:n,actionName:a}},Yf=(t,e)=>{let r=e[t.namespace]??{name:t.namespace,version:"0.0.0",entities:{},actions:{},events:{},channels:{}},n=r.name,a=r.events[t.eventName]?.name??t.eventName;return{namespace:n,eventName:a}};var Xf=(t,e)=>new Proxy({},{get:(r,n)=>new Proxy({},{get:(a,s)=>i=>rb({client:t,interfaces:e,integrationOrInterfaceName:n,methodName:s,input:i})})}),rb=async({client:t,interfaces:e,integrationOrInterfaceName:r,methodName:n,input:a})=>{let s=Jf({namespace:r,actionName:n},e),i=Gf(s);return(await t.callAction({type:i,input:a})).output};var la=class{constructor(e){this.props=e;this._actionHandlers=e.actions}_runtimeProps;_actionHandlers;_messageHandlers={};_eventHandlers={};_stateExpiredHandlers={};_hookHandlers={before_incoming_event:{},before_incoming_message:{},before_outgoing_message:{},before_outgoing_call_action:{},after_incoming_event:{},after_incoming_message:{},after_outgoing_message:{},after_outgoing_call_action:{}};initialize(e){return this._runtimeProps=e,this}get _runtime(){if(!this._runtimeProps)throw new Error("Plugin not correctly initialized. This is likely because you access your plugin config outside of an handler.");return this._runtimeProps}_getTools(e){let{configuration:r,interfaces:n}=this._runtime,a=Xf(e,n);return{configuration:r,interfaces:n,actions:a}}get actionHandlers(){let e=this._actionHandlers,r={};for(let[n,a]of te.pairs(e))r[n]=async s=>a({...s,...this._getTools(s.client)});return r}get messageHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._messageHandlers[r]??[],a=this._messageHandlers["*"]??[];return z.unique([...n,...a]).map(i=>vt.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get eventHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._eventHandlers[r]??[],a=Object.entries(this._eventHandlers).filter(([o])=>this._eventResolvesTo(o,r)).flatMap(([,o])=>o??[]),s=this._eventHandlers["*"]??[];return z.unique([...n,...a,...s]).map(o=>vt.setName(d=>o({...d,...this._getTools(d.client)}),o.name))}})}get stateExpiredHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._stateExpiredHandlers[r]??[],a=this._stateExpiredHandlers["*"]??[];return z.unique([...n,...a]).map(i=>vt.setName(o=>i({...o,...this._getTools(o.client)}),i.name))}})}get hookHandlers(){return new Proxy({},{get:(e,r)=>{let n=this._hookHandlers[r];if(n)return new Proxy({},{get:(a,s)=>{let i=n[s]??[],o=n["*"]??[];return z.unique([...i,...o]).map(p=>vt.setName(y=>p({...y,...this._getTools(y.client)}),p.name))}})}})}on={message:(e,r)=>{this._messageHandlers[e]=z.safePush(this._messageHandlers[e],r)},event:(e,r)=>{this._eventHandlers[e]=z.safePush(this._eventHandlers[e],r)},stateExpired:(e,r)=>{this._stateExpiredHandlers[e]=z.safePush(this._stateExpiredHandlers[e],r)},beforeIncomingEvent:(e,r)=>{this._hookHandlers.before_incoming_event[e]=z.safePush(this._hookHandlers.before_incoming_event[e],r)},beforeIncomingMessage:(e,r)=>{this._hookHandlers.before_incoming_message[e]=z.safePush(this._hookHandlers.before_incoming_message[e],r)},beforeOutgoingMessage:(e,r)=>{this._hookHandlers.before_outgoing_message[e]=z.safePush(this._hookHandlers.before_outgoing_message[e],r)},beforeOutgoingCallAction:(e,r)=>{this._hookHandlers.before_outgoing_call_action[e]=z.safePush(this._hookHandlers.before_outgoing_call_action[e],r)},afterIncomingEvent:(e,r)=>{this._hookHandlers.after_incoming_event[e]=z.safePush(this._hookHandlers.after_incoming_event[e],r)},afterIncomingMessage:(e,r)=>{this._hookHandlers.after_incoming_message[e]=z.safePush(this._hookHandlers.after_incoming_message[e],r)},afterOutgoingMessage:(e,r)=>{this._hookHandlers.after_outgoing_message[e]=z.safePush(this._hookHandlers.after_outgoing_message[e],r)},afterOutgoingCallAction:(e,r)=>{this._hookHandlers.after_outgoing_call_action[e]=z.safePush(this._hookHandlers.after_outgoing_call_action[e],r)}};_eventResolvesTo=(e,r)=>{let n=qf(e);if(!n)return!1;let a=Yf(n,this._runtime.interfaces);return Wf(a)===r}};0&&(module.exports={BRAND,Bot,BotDefinition,BotLogger,BotSpecificClient,DIRTY,EMPTY_PATH,ErrorBoundary,INVALID,Integration,IntegrationDefinition,IntegrationLogger,IntegrationSpecificClient,InterfaceDefinition,NEVER,OK,ParseInputLazyPath,ParseStatus,Plugin,PluginDefinition,RuntimeError,Schema,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,ZodFirstPartyTypeKind,ZodFunction,ZodIntersection,ZodIssueCode,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodRef,ZodSchema,ZodSet,ZodString,ZodSymbol,ZodTransformer,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,ZuiForm,addIssueToContext,agent,aimodel,any,array,bigint,boolean,botIdHeader,botUserIdHeader,coerce,configurationHeader,configurationTypeHeader,conversation,createZodEnum,cuid2Regex,cuidRegex,custom,datasource,date,datetimeRegex,defaultComponentDefinitions,discriminatedUnion,effect,emailRegex,enum:null,errorUtil,event,fromJsonSchema,fromObject,function:null,getErrorMap,getParsedType,instanceof:null,integrationIdHeader,intent,intersection,ipv4Regex,ipv6Regex,isAborted,isApiError,isAsync,isDirty,isEmojiRegex,isValid,jsonSchemaToZui,knowledgebase,late,lazy,literal,makeIssue,map,mergeObjectSchemas,message,messages,nan,nativeEnum,never,null:null,nullable,number,object,objectToZui,objectUtil,oboolean,onumber,operationHeader,optional,ostring,parseBody,pipeline,preprocess,processCreateParams,promise,quotelessJson,readonly,record,ref,serve,set,setErrorMap,strictObject,string,symbol,table,tablerow,transformer,transforms,tuple,typeHeader,ulidRegex,undefined,union,unknown,user,util,uuidRegex,variable,void:null,webhookIdHeader,withErrorBoundary,z,zuiToJsonSchema});
|
|
90
90
|
/*! Bundled license information:
|
|
91
91
|
|
|
92
92
|
react/cjs/react.production.min.js:
|