ai-props 0.1.2 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +15 -0
  3. package/README.md +345 -352
  4. package/dist/ai.d.ts +125 -0
  5. package/dist/ai.d.ts.map +1 -0
  6. package/dist/ai.js +199 -0
  7. package/dist/ai.js.map +1 -0
  8. package/dist/cache.d.ts +66 -0
  9. package/dist/cache.d.ts.map +1 -0
  10. package/dist/cache.js +183 -0
  11. package/dist/cache.js.map +1 -0
  12. package/dist/generate.d.ts +69 -0
  13. package/dist/generate.d.ts.map +1 -0
  14. package/dist/generate.js +221 -0
  15. package/dist/generate.js.map +1 -0
  16. package/dist/hoc.d.ts +164 -0
  17. package/dist/hoc.d.ts.map +1 -0
  18. package/dist/hoc.js +236 -0
  19. package/dist/hoc.js.map +1 -0
  20. package/dist/index.d.ts +14 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +21 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/types.d.ts +152 -0
  25. package/dist/types.d.ts.map +1 -0
  26. package/dist/types.js +7 -0
  27. package/dist/types.js.map +1 -0
  28. package/dist/validate.d.ts +58 -0
  29. package/dist/validate.d.ts.map +1 -0
  30. package/dist/validate.js +253 -0
  31. package/dist/validate.js.map +1 -0
  32. package/package.json +16 -63
  33. package/src/ai.ts +264 -0
  34. package/src/cache.ts +216 -0
  35. package/src/generate.ts +276 -0
  36. package/src/hoc.ts +309 -0
  37. package/src/index.ts +66 -0
  38. package/src/types.ts +167 -0
  39. package/src/validate.ts +333 -0
  40. package/test/ai.test.ts +327 -0
  41. package/test/cache.test.ts +236 -0
  42. package/test/generate.test.ts +406 -0
  43. package/test/hoc.test.ts +411 -0
  44. package/test/validate.test.ts +324 -0
  45. package/tsconfig.json +9 -0
  46. package/vitest.config.ts +15 -0
  47. package/LICENSE +0 -21
  48. package/dist/AI.d.ts +0 -27
  49. package/dist/AI.d.ts.map +0 -1
  50. package/dist/AI.test.d.ts +0 -2
  51. package/dist/AI.test.d.ts.map +0 -1
  52. package/dist/ai-props.es.js +0 -3697
  53. package/dist/ai-props.umd.js +0 -30
  54. package/dist/components/ErrorBoundary.d.ts +0 -17
  55. package/dist/components/ErrorBoundary.d.ts.map +0 -1
  56. package/dist/examples/BlogList.d.ts +0 -2
  57. package/dist/examples/BlogList.d.ts.map +0 -1
  58. package/dist/examples/BlogList.fixture.d.ts +0 -5
  59. package/dist/examples/BlogList.fixture.d.ts.map +0 -1
  60. package/dist/examples/HeroSection.d.ts +0 -2
  61. package/dist/examples/HeroSection.d.ts.map +0 -1
  62. package/dist/examples/HeroSection.fixture.d.ts +0 -5
  63. package/dist/examples/HeroSection.fixture.d.ts.map +0 -1
  64. package/dist/test/setup.d.ts +0 -2
  65. package/dist/test/setup.d.ts.map +0 -1
  66. package/dist/utils/schema.d.ts +0 -28
  67. package/dist/utils/schema.d.ts.map +0 -1
  68. package/dist/utils/styles.d.ts +0 -3
  69. package/dist/utils/styles.d.ts.map +0 -1
@@ -1,30 +0,0 @@
1
- (function(de,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],H):(de=typeof globalThis<"u"?globalThis:de||self,H(de["ai-props"]={},de.React))})(this,function(de,H){"use strict";var ot={exports:{}},Ee={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var St;function mr(){if(St)return Ee;St=1;var r=H,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(c,l,f){var v,S={},I=null,J=null;f!==void 0&&(I=""+f),l.key!==void 0&&(I=""+l.key),l.ref!==void 0&&(J=l.ref);for(v in l)n.call(l,v)&&!s.hasOwnProperty(v)&&(S[v]=l[v]);if(c&&c.defaultProps)for(v in l=c.defaultProps,l)S[v]===void 0&&(S[v]=l[v]);return{$$typeof:e,type:c,key:I,ref:J,props:S,_owner:a.current}}return Ee.Fragment=t,Ee.jsx=o,Ee.jsxs=o,Ee}var Re={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ct;function vr(){return Ct||(Ct=1,process.env.NODE_ENV!=="production"&&function(){var r=H,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),rt=Symbol.iterator,mt="@@iterator";function Ue(i){if(i===null||typeof i!="object")return null;var u=rt&&i[rt]||i[mt];return typeof u=="function"?u:null}var G=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Z(i){{for(var u=arguments.length,p=new Array(u>1?u-1:0),b=1;b<u;b++)p[b-1]=arguments[b];vt("error",i,p)}}function vt(i,u,p){{var b=G.ReactDebugCurrentFrame,R=b.getStackAddendum();R!==""&&(u+="%s",p=p.concat([R]));var C=p.map(function(E){return String(E)});C.unshift("Warning: "+u),Function.prototype.apply.call(console[i],console,C)}}var te=!1,yt=!1,Yt=!1,re=!1,We=!1,V;V=Symbol.for("react.module.reference");function ce(i){return!!(typeof i=="string"||typeof i=="function"||i===n||i===s||We||i===a||i===f||i===v||re||i===J||te||yt||Yt||typeof i=="object"&&i!==null&&(i.$$typeof===I||i.$$typeof===S||i.$$typeof===o||i.$$typeof===c||i.$$typeof===l||i.$$typeof===V||i.getModuleId!==void 0))}function ne(i,u,p){var b=i.displayName;if(b)return b;var R=u.displayName||u.name||"";return R!==""?p+"("+R+")":p}function ue(i){return i.displayName||"Context"}function L(i){if(i==null)return null;if(typeof i.tag=="number"&&Z("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case n:return"Fragment";case t:return"Portal";case s:return"Profiler";case a:return"StrictMode";case f:return"Suspense";case v:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case c:var u=i;return ue(u)+".Consumer";case o:var p=i;return ue(p._context)+".Provider";case l:return ne(i,i.render,"ForwardRef");case S:var b=i.displayName||null;return b!==null?b:L(i.type)||"Memo";case I:{var R=i,C=R._payload,E=R._init;try{return L(E(C))}catch{return null}}}return null}var me=Object.assign,Be=0,qt,Jt,Gt,Ht,Kt,Xt,Qt;function er(){}er.__reactDisabledLog=!0;function wn(){{if(Be===0){qt=console.log,Jt=console.info,Gt=console.warn,Ht=console.error,Kt=console.group,Xt=console.groupCollapsed,Qt=console.groupEnd;var i={configurable:!0,enumerable:!0,value:er,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}Be++}}function Tn(){{if(Be--,Be===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:me({},i,{value:qt}),info:me({},i,{value:Jt}),warn:me({},i,{value:Gt}),error:me({},i,{value:Ht}),group:me({},i,{value:Kt}),groupCollapsed:me({},i,{value:Xt}),groupEnd:me({},i,{value:Qt})})}Be<0&&Z("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var gt=G.ReactCurrentDispatcher,_t;function nt(i,u,p){{if(_t===void 0)try{throw Error()}catch(R){var b=R.stack.trim().match(/\n( *(at )?)/);_t=b&&b[1]||""}return`
18
- `+_t+i}}var bt=!1,at;{var En=typeof WeakMap=="function"?WeakMap:Map;at=new En}function tr(i,u){if(!i||bt)return"";{var p=at.get(i);if(p!==void 0)return p}var b;bt=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=gt.current,gt.current=null,wn();try{if(u){var E=function(){throw Error()};if(Object.defineProperty(E.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(E,[])}catch($){b=$}Reflect.construct(i,[],E)}else{try{E.call()}catch($){b=$}i.call(E.prototype)}}else{try{throw Error()}catch($){b=$}i()}}catch($){if($&&b&&typeof $.stack=="string"){for(var w=$.stack.split(`
19
- `),D=b.stack.split(`
20
- `),j=w.length-1,A=D.length-1;j>=1&&A>=0&&w[j]!==D[A];)A--;for(;j>=1&&A>=0;j--,A--)if(w[j]!==D[A]){if(j!==1||A!==1)do if(j--,A--,A<0||w[j]!==D[A]){var F=`
21
- `+w[j].replace(" at new "," at ");return i.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",i.displayName)),typeof i=="function"&&at.set(i,F),F}while(j>=1&&A>=0);break}}}finally{bt=!1,gt.current=C,Tn(),Error.prepareStackTrace=R}var Te=i?i.displayName||i.name:"",ve=Te?nt(Te):"";return typeof i=="function"&&at.set(i,ve),ve}function Rn(i,u,p){return tr(i,!1)}function Sn(i){var u=i.prototype;return!!(u&&u.isReactComponent)}function st(i,u,p){if(i==null)return"";if(typeof i=="function")return tr(i,Sn(i));if(typeof i=="string")return nt(i);switch(i){case f:return nt("Suspense");case v:return nt("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case l:return Rn(i.render);case S:return st(i.type,u,p);case I:{var b=i,R=b._payload,C=b._init;try{return st(C(R),u,p)}catch{}}}return""}var Ye=Object.prototype.hasOwnProperty,rr={},nr=G.ReactDebugCurrentFrame;function it(i){if(i){var u=i._owner,p=st(i.type,i._source,u?u.type:null);nr.setExtraStackFrame(p)}else nr.setExtraStackFrame(null)}function Cn(i,u,p,b,R){{var C=Function.call.bind(Ye);for(var E in i)if(C(i,E)){var w=void 0;try{if(typeof i[E]!="function"){var D=Error((b||"React class")+": "+p+" type `"+E+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[E]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}w=i[E](u,E,b,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){w=j}w&&!(w instanceof Error)&&(it(R),Z("%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).",b||"React class",p,E,typeof w),it(null)),w instanceof Error&&!(w.message in rr)&&(rr[w.message]=!0,it(R),Z("Failed %s type: %s",p,w.message),it(null))}}}var On=Array.isArray;function xt(i){return On(i)}function jn(i){{var u=typeof Symbol=="function"&&Symbol.toStringTag,p=u&&i[Symbol.toStringTag]||i.constructor.name||"Object";return p}}function An(i){try{return ar(i),!1}catch{return!0}}function ar(i){return""+i}function sr(i){if(An(i))return Z("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jn(i)),ar(i)}var qe=G.ReactCurrentOwner,Zn={key:!0,ref:!0,__self:!0,__source:!0},ir,or,kt;kt={};function Nn(i){if(Ye.call(i,"ref")){var u=Object.getOwnPropertyDescriptor(i,"ref").get;if(u&&u.isReactWarning)return!1}return i.ref!==void 0}function In(i){if(Ye.call(i,"key")){var u=Object.getOwnPropertyDescriptor(i,"key").get;if(u&&u.isReactWarning)return!1}return i.key!==void 0}function Pn(i,u){if(typeof i.ref=="string"&&qe.current&&u&&qe.current.stateNode!==u){var p=L(qe.current.type);kt[p]||(Z('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',L(qe.current.type),i.ref),kt[p]=!0)}}function Dn(i,u){{var p=function(){ir||(ir=!0,Z("%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)",u))};p.isReactWarning=!0,Object.defineProperty(i,"key",{get:p,configurable:!0})}}function $n(i,u){{var p=function(){or||(or=!0,Z("%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)",u))};p.isReactWarning=!0,Object.defineProperty(i,"ref",{get:p,configurable:!0})}}var Mn=function(i,u,p,b,R,C,E){var w={$$typeof:e,type:i,key:u,ref:p,props:E,_owner:C};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function Vn(i,u,p,b,R){{var C,E={},w=null,D=null;p!==void 0&&(sr(p),w=""+p),In(u)&&(sr(u.key),w=""+u.key),Nn(u)&&(D=u.ref,Pn(u,R));for(C in u)Ye.call(u,C)&&!Zn.hasOwnProperty(C)&&(E[C]=u[C]);if(i&&i.defaultProps){var j=i.defaultProps;for(C in j)E[C]===void 0&&(E[C]=j[C])}if(w||D){var A=typeof i=="function"?i.displayName||i.name||"Unknown":i;w&&Dn(E,A),D&&$n(E,A)}return Mn(i,w,D,R,b,qe.current,E)}}var wt=G.ReactCurrentOwner,cr=G.ReactDebugCurrentFrame;function we(i){if(i){var u=i._owner,p=st(i.type,i._source,u?u.type:null);cr.setExtraStackFrame(p)}else cr.setExtraStackFrame(null)}var Tt;Tt=!1;function Et(i){return typeof i=="object"&&i!==null&&i.$$typeof===e}function ur(){{if(wt.current){var i=L(wt.current.type);if(i)return`
22
-
23
- Check the render method of \``+i+"`."}return""}}function Ln(i){return""}var dr={};function Fn(i){{var u=ur();if(!u){var p=typeof i=="string"?i:i.displayName||i.name;p&&(u=`
24
-
25
- Check the top-level render call using <`+p+">.")}return u}}function lr(i,u){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var p=Fn(u);if(dr[p])return;dr[p]=!0;var b="";i&&i._owner&&i._owner!==wt.current&&(b=" It was passed a child from "+L(i._owner.type)+"."),we(i),Z('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,b),we(null)}}function fr(i,u){{if(typeof i!="object")return;if(xt(i))for(var p=0;p<i.length;p++){var b=i[p];Et(b)&&lr(b,u)}else if(Et(i))i._store&&(i._store.validated=!0);else if(i){var R=Ue(i);if(typeof R=="function"&&R!==i.entries)for(var C=R.call(i),E;!(E=C.next()).done;)Et(E.value)&&lr(E.value,u)}}}function zn(i){{var u=i.type;if(u==null||typeof u=="string")return;var p;if(typeof u=="function")p=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===l||u.$$typeof===S))p=u.propTypes;else return;if(p){var b=L(u);Cn(p,i.props,"prop",b,i)}else if(u.PropTypes!==void 0&&!Tt){Tt=!0;var R=L(u);Z("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&Z("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Un(i){{for(var u=Object.keys(i.props),p=0;p<u.length;p++){var b=u[p];if(b!=="children"&&b!=="key"){we(i),Z("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),we(null);break}}i.ref!==null&&(we(i),Z("Invalid attribute `ref` supplied to `React.Fragment`."),we(null))}}var hr={};function pr(i,u,p,b,R,C){{var E=ce(i);if(!E){var w="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(w+=" 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 D=Ln();D?w+=D:w+=ur();var j;i===null?j="null":xt(i)?j="array":i!==void 0&&i.$$typeof===e?(j="<"+(L(i.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):j=typeof i,Z("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,w)}var A=Vn(i,u,p,R,C);if(A==null)return A;if(E){var F=u.children;if(F!==void 0)if(b)if(xt(F)){for(var Te=0;Te<F.length;Te++)fr(F[Te],i);Object.freeze&&Object.freeze(F)}else Z("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fr(F,i)}if(Ye.call(u,"key")){var ve=L(i),$=Object.keys(u).filter(function(Gn){return Gn!=="key"}),Rt=$.length>0?"{key: someKey, "+$.join(": ..., ")+": ...}":"{key: someKey}";if(!hr[ve+Rt]){var Jn=$.length>0?"{"+$.join(": ..., ")+": ...}":"{}";Z(`A props object containing a "key" prop is being spread into JSX:
26
- let props = %s;
27
- <%s {...props} />
28
- React keys must be passed directly to JSX without using spread:
29
- let props = %s;
30
- <%s key={someKey} {...props} />`,Rt,ve,Jn,ve),hr[ve+Rt]=!0}}return i===n?Un(A):zn(A),A}}function Wn(i,u,p){return pr(i,u,p,!0)}function Bn(i,u,p){return pr(i,u,p,!1)}var Yn=Bn,qn=Wn;Re.Fragment=n,Re.jsx=Yn,Re.jsxs=qn}()),Re}process.env.NODE_ENV==="production"?ot.exports=mr():ot.exports=vr();var Ot=ot.exports;function jt(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=jt(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function At(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=jt(r))&&(n&&(n+=" "),n+=e);return n}var T;(function(r){r.assertEqual=a=>a;function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{const s={};for(const o of a)s[o]=o;return s},r.getValidEnumValues=a=>{const s=r.objectKeys(a).filter(c=>typeof a[a[c]]!="number"),o={};for(const c of s)o[c]=a[c];return r.objectValues(o)},r.objectValues=a=>r.objectKeys(a).map(function(s){return a[s]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&s.push(o);return s},r.find=(a,s)=>{for(const o of a)if(s(o))return o},r.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(o=>typeof o=="string"?`'${o}'`:o).join(s)}r.joinValues=n,r.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(T||(T={}));var ct;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(ct||(ct={}));const m=T.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),K=r=>{switch(typeof r){case"undefined":return m.undefined;case"string":return m.string;case"number":return isNaN(r)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(r)?m.array:r===null?m.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?m.promise:typeof Map<"u"&&r instanceof Map?m.map:typeof Set<"u"&&r instanceof Set?m.set:typeof Date<"u"&&r instanceof Date?m.date:m.object;default:return m.unknown}},d=T.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"]),yr=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class M extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(t(o));else{let c=n,l=0;for(;l<o.path.length;){const f=o.path[l];l===o.path.length-1?(c[f]=c[f]||{_errors:[]},c[f]._errors.push(t(o))):c[f]=c[f]||{_errors:[]},c=c[f],l++}}};return a(this),n}static assert(e){if(!(e instanceof M))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,T.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const a of this.issues)a.path.length>0?(t[a.path[0]]=t[a.path[0]]||[],t[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}M.create=r=>new M(r);const ye=(r,e)=>{let t;switch(r.code){case d.invalid_type:r.received===m.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,T.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${T.joinValues(r.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${T.joinValues(r.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${T.joinValues(r.options)}, received '${r.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:T.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case d.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case d.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,T.assertNever(r)}return{message:t}};let Zt=ye;function gr(r){Zt=r}function Je(){return Zt}const Ge=r=>{const{data:e,path:t,errorMaps:n,issueData:a}=r,s=[...t,...a.path||[]],o={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let c="";const l=n.filter(f=>!!f).slice().reverse();for(const f of l)c=f(o,{data:e,defaultError:c}).message;return{...a,path:s,message:c}},_r=[];function h(r,e){const t=Je(),n=Ge({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===ye?void 0:ye].filter(a=>!!a)});r.common.issues.push(n)}class N{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const a of t){if(a.status==="aborted")return _;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const a of t){const s=await a.key,o=await a.value;n.push({key:s,value:o})}return N.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const a of t){const{key:s,value:o}=a;if(s.status==="aborted"||o.status==="aborted")return _;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),ge=r=>({status:"dirty",value:r}),P=r=>({status:"valid",value:r}),ut=r=>r.status==="aborted",dt=r=>r.status==="dirty",le=r=>r.status==="valid",Se=r=>typeof Promise<"u"&&r instanceof Promise;function He(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Nt(r,e,t,n,a){if(typeof e=="function"?r!==e||!a:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}typeof SuppressedError=="function"&&SuppressedError;var y;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(y||(y={}));var Ce,Oe;class B{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,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}}const It=(r,e)=>{if(le(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new M(r.common.issues);return this._error=t,this._error}}};function x(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||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}:{errorMap:(o,c)=>{var l,f;const{message:v}=r;return o.code==="invalid_enum_value"?{message:v??c.defaultError}:typeof c.data>"u"?{message:(l=v??n)!==null&&l!==void 0?l:c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:(f=v??t)!==null&&f!==void 0?f:c.defaultError}},description:a}}class k{get description(){return this._def.description}_getType(e){return K(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:K(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new N,ctx:{common:e.parent.common,data:e.data,parsedType:K(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Se(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const a={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)},s=this._parseSync({data:e,path:a.path,parent:a});return It(a,s)}"~validate"(e){var t,n;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:a});return le(s)?{value:s.value}:{issues:a.common.issues}}catch(s){!((n=(t=s==null?void 0:s.message)===null||t===void 0?void 0:t.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(s=>le(s)?{value:s.value}:{issues:a.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:K(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(Se(a)?a:Promise.resolve(a));return It(n,s)}refine(e,t){const n=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,s)=>{const o=e(a),c=()=>s.addIssue({code:d.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new W({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}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),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return q.create(this,this._def)}nullable(){return oe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return U.create(this)}promise(){return ke.create(this,this._def)}or(e){return Ne.create([this,e],this._def)}and(e){return Ie.create(this,e,this._def)}transform(e){return new W({...x(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Ve({...x(this._def),innerType:this,defaultValue:t,typeName:g.ZodDefault})}brand(){return new ht({typeName:g.ZodBranded,type:this,...x(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Le({...x(this._def),innerType:this,catchValue:t,typeName:g.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return ze.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const br=/^c[^\s-]{8,}$/i,xr=/^[0-9a-z]+$/,kr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wr=/^[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,Tr=/^[a-z0-9_-]{21}$/i,Er=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Rr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let lt;const Or=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,jr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ar=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Zr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ir=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Pt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Pr=new RegExp(`^${Pt}$`);function Dt(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Dr(r){return new RegExp(`^${Dt(r)}$`)}function $t(r){let e=`${Pt}T${Dt(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function $r(r,e){return!!((e==="v4"||!e)&&Or.test(r)||(e==="v6"||!e)&&Ar.test(r))}function Mr(r,e){if(!Er.test(r))return!1;try{const[t]=r.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||!a.typ||!a.alg||e&&a.alg!==e)}catch{return!1}}function Vr(r,e){return!!((e==="v4"||!e)&&jr.test(r)||(e==="v6"||!e)&&Zr.test(r))}class z extends k{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){const s=this._getOrReturnCtx(e);return h(s,{code:d.invalid_type,expected:m.string,received:s.parsedType}),_}const n=new N;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.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),h(a,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(a=this._getOrReturnCtx(e,a),o?h(a,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&h(a,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Sr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"email",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")lt||(lt=new RegExp(Cr,"u")),lt.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"emoji",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")wr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"uuid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Tr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"nanoid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")br.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")xr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cuid2",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")kr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ulid",code:d.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),h(a,{validation:"url",code:d.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),h(a,{validation:"regex",code:d.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),h(a,{code:d.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),h(a,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?$t(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Pr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Dr(s).test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:d.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Rr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"duration",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?$r(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"ip",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Mr(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"jwt",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Vr(e.data,s.version)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"cidr",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Nr.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64",code:d.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Ir.test(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{validation:"base64url",code:d.invalid_string,message:s.message}),n.dirty()):T.assertNever(s);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),{validation:t,code:d.invalid_string,...y.errToObj(n)})}_addCheck(e){return new z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...y.errToObj(e)})}url(e){return this._addCheck({kind:"url",...y.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...y.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...y.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...y.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...y.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...y.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...y.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...y.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...y.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...y.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...y.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...y.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...y.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...y.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...y.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...y.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...y.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...y.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...y.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...y.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...y.errToObj(t)})}nonempty(e){return this.min(1,y.errToObj(e))}trim(){return new z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new z({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}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 isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}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 isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}z.create=r=>{var e;return new z({checks:[],typeName:g.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...x(r)})};function Lr(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,s=parseInt(r.toFixed(a).replace(".","")),o=parseInt(e.toFixed(a).replace(".",""));return s%o/Math.pow(10,a)}class ae extends k{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)!==m.number){const s=this._getOrReturnCtx(e);return h(s,{code:d.invalid_type,expected:m.number,received:s.parsedType}),_}let n;const a=new N;for(const s of this._def.checks)s.kind==="int"?T.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:d.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),h(n,{code:d.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),h(n,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Lr(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),h(n,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:d.not_finite,message:s.message}),a.dirty()):T.assertNever(s);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,a){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(a)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:y.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:y.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&T.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ae.create=r=>new ae({checks:[],typeName:g.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...x(r)});class se extends k{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==m.bigint)return this._getInvalidInput(e);let n;const a=new N;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),h(n,{code:d.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),h(n,{code:d.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),h(n,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):T.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:d.invalid_type,expected:m.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,y.toString(t))}gt(e,t){return this.setLimit("min",e,!1,y.toString(t))}lte(e,t){return this.setLimit("max",e,!0,y.toString(t))}lt(e,t){return this.setLimit("max",e,!1,y.toString(t))}setLimit(e,t,n,a){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:y.toString(a)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:y.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}se.create=r=>{var e;return new se({checks:[],typeName:g.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...x(r)})};class je extends k{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),_}return P(e.data)}}je.create=r=>new je({typeName:g.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...x(r)});class fe extends k{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){const s=this._getOrReturnCtx(e);return h(s,{code:d.invalid_type,expected:m.date,received:s.parsedType}),_}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return h(s,{code:d.invalid_date}),_}const n=new N;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),h(a,{code:d.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),h(a,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):T.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:y.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:y.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}fe.create=r=>new fe({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:g.ZodDate,...x(r)});class Ke extends k{_parse(e){if(this._getType(e)!==m.symbol){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),_}return P(e.data)}}Ke.create=r=>new Ke({typeName:g.ZodSymbol,...x(r)});class Ae extends k{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),_}return P(e.data)}}Ae.create=r=>new Ae({typeName:g.ZodUndefined,...x(r)});class Ze extends k{_parse(e){if(this._getType(e)!==m.null){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),_}return P(e.data)}}Ze.create=r=>new Ze({typeName:g.ZodNull,...x(r)});class _e extends k{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}}_e.create=r=>new _e({typeName:g.ZodAny,...x(r)});class he extends k{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}}he.create=r=>new he({typeName:g.ZodUnknown,...x(r)});class X extends k{_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:d.invalid_type,expected:m.never,received:t.parsedType}),_}}X.create=r=>new X({typeName:g.ZodNever,...x(r)});class Xe extends k{_parse(e){if(this._getType(e)!==m.undefined){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),_}return P(e.data)}}Xe.create=r=>new Xe({typeName:g.ZodVoid,...x(r)});class U extends k{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==m.array)return h(t,{code:d.invalid_type,expected:m.array,received:t.parsedType}),_;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,c=t.data.length<a.exactLength.value;(o||c)&&(h(t,{code:o?d.too_big:d.too_small,minimum:c?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(h(t,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(h(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>a.type._parseAsync(new B(t,o,t.path,c)))).then(o=>N.mergeArray(n,o));const s=[...t.data].map((o,c)=>a.type._parseSync(new B(t,o,t.path,c)));return N.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new U({...this._def,minLength:{value:e,message:y.toString(t)}})}max(e,t){return new U({...this._def,maxLength:{value:e,message:y.toString(t)}})}length(e,t){return new U({...this._def,exactLength:{value:e,message:y.toString(t)}})}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({type:r,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,...x(e)});function be(r){if(r instanceof O){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=q.create(be(n))}return new O({...r._def,shape:()=>e})}else return r instanceof U?new U({...r._def,type:be(r.element)}):r instanceof q?q.create(be(r.unwrap())):r instanceof oe?oe.create(be(r.unwrap())):r instanceof Y?Y.create(r.items.map(e=>be(e))):r}class O extends k{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=T.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==m.object){const f=this._getOrReturnCtx(e);return h(f,{code:d.invalid_type,expected:m.object,received:f.parsedType}),_}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof X&&this._def.unknownKeys==="strip"))for(const f in a.data)o.includes(f)||c.push(f);const l=[];for(const f of o){const v=s[f],S=a.data[f];l.push({key:{status:"valid",value:f},value:v._parse(new B(a,S,a.path,f)),alwaysSet:f in a.data})}if(this._def.catchall instanceof X){const f=this._def.unknownKeys;if(f==="passthrough")for(const v of c)l.push({key:{status:"valid",value:v},value:{status:"valid",value:a.data[v]}});else if(f==="strict")c.length>0&&(h(a,{code:d.unrecognized_keys,keys:c}),n.dirty());else if(f!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const f=this._def.catchall;for(const v of c){const S=a.data[v];l.push({key:{status:"valid",value:v},value:f._parse(new B(a,S,a.path,v)),alwaysSet:v in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const f=[];for(const v of l){const S=await v.key,I=await v.value;f.push({key:S,value:I,alwaysSet:v.alwaysSet})}return f}).then(f=>N.mergeObjectSync(n,f)):N.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return y.errToObj,new O({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var a,s,o,c;const l=(o=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,t,n).message)!==null&&o!==void 0?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(c=y.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new O({...this._def,unknownKeys:"strip"})}passthrough(){return new O({...this._def,unknownKeys:"passthrough"})}extend(e){return new O({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new O({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:g.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new O({...this._def,catchall:e})}pick(e){const t={};return T.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new O({...this._def,shape:()=>t})}omit(e){const t={};return T.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new O({...this._def,shape:()=>t})}deepPartial(){return be(this)}partial(e){const t={};return T.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}),new O({...this._def,shape:()=>t})}required(e){const t={};return T.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof q;)s=s._def.innerType;t[n]=s}}),new O({...this._def,shape:()=>t})}keyof(){return Mt(T.objectKeys(this.shape))}}O.create=(r,e)=>new O({shape:()=>r,unknownKeys:"strip",catchall:X.create(),typeName:g.ZodObject,...x(e)}),O.strictCreate=(r,e)=>new O({shape:()=>r,unknownKeys:"strict",catchall:X.create(),typeName:g.ZodObject,...x(e)}),O.lazycreate=(r,e)=>new O({shape:r,unknownKeys:"strip",catchall:X.create(),typeName:g.ZodObject,...x(e)});class Ne extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function a(s){for(const c of s)if(c.result.status==="valid")return c.result;for(const c of s)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const o=s.map(c=>new M(c.ctx.common.issues));return h(t,{code:d.invalid_union,unionErrors:o}),_}if(t.common.async)return Promise.all(n.map(async s=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let s;const o=[];for(const l of n){const f={...t,common:{...t.common,issues:[]},parent:null},v=l._parseSync({data:t.data,path:t.path,parent:f});if(v.status==="valid")return v;v.status==="dirty"&&!s&&(s={result:v,ctx:f}),f.common.issues.length&&o.push(f.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const c=o.map(l=>new M(l));return h(t,{code:d.invalid_union,unionErrors:c}),_}}get options(){return this._def.options}}Ne.create=(r,e)=>new Ne({options:r,typeName:g.ZodUnion,...x(e)});const Q=r=>r instanceof De?Q(r.schema):r instanceof W?Q(r.innerType()):r instanceof $e?[r.value]:r instanceof ie?r.options:r instanceof Me?T.objectValues(r.enum):r instanceof Ve?Q(r._def.innerType):r instanceof Ae?[void 0]:r instanceof Ze?[null]:r instanceof q?[void 0,...Q(r.unwrap())]:r instanceof oe?[null,...Q(r.unwrap())]:r instanceof ht||r instanceof ze?Q(r.unwrap()):r instanceof Le?Q(r._def.innerType):[];class Qe extends k{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.object)return h(t,{code:d.invalid_type,expected:m.object,received:t.parsedType}),_;const n=this.discriminator,a=t.data[n],s=this.optionsMap.get(a);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(h(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const a=new Map;for(const s of t){const o=Q(s.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const c of o){if(a.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);a.set(c,s)}}return new Qe({typeName:g.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,...x(n)})}}function ft(r,e){const t=K(r),n=K(e);if(r===e)return{valid:!0,data:r};if(t===m.object&&n===m.object){const a=T.objectKeys(e),s=T.objectKeys(r).filter(c=>a.indexOf(c)!==-1),o={...r,...e};for(const c of s){const l=ft(r[c],e[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(t===m.array&&n===m.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<r.length;s++){const o=r[s],c=e[s],l=ft(o,c);if(!l.valid)return{valid:!1};a.push(l.data)}return{valid:!0,data:a}}else return t===m.date&&n===m.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class Ie extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=(s,o)=>{if(ut(s)||ut(o))return _;const c=ft(s.value,o.value);return c.valid?((dt(s)||dt(o))&&t.dirty(),{status:t.value,value:c.data}):(h(n,{code:d.invalid_intersection_types}),_)};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,o])=>a(s,o)):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}))}}Ie.create=(r,e,t)=>new Ie({left:r,right:e,typeName:g.ZodIntersection,...x(t)});class Y extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return h(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return h(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(h(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map((o,c)=>{const l=this._def.items[c]||this._def.rest;return l?l._parse(new B(n,o,n.path,c)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>N.mergeArray(t,o)):N.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new Y({...this._def,rest:e})}}Y.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Y({items:r,typeName:g.ZodTuple,rest:null,...x(e)})};class Pe extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return h(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),_;const a=[],s=this._def.keyType,o=this._def.valueType;for(const c in n.data)a.push({key:s._parse(new B(n,c,n.path,c)),value:o._parse(new B(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?N.mergeObjectAsync(t,a):N.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof k?new Pe({keyType:e,valueType:t,typeName:g.ZodRecord,...x(n)}):new Pe({keyType:z.create(),valueType:e,typeName:g.ZodRecord,...x(t)})}}class et extends k{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return h(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),_;const a=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([c,l],f)=>({key:a._parse(new B(n,c,n.path,[f,"key"])),value:s._parse(new B(n,l,n.path,[f,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const l of o){const f=await l.key,v=await l.value;if(f.status==="aborted"||v.status==="aborted")return _;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),c.set(f.value,v.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const l of o){const f=l.key,v=l.value;if(f.status==="aborted"||v.status==="aborted")return _;(f.status==="dirty"||v.status==="dirty")&&t.dirty(),c.set(f.value,v.value)}return{status:t.value,value:c}}}}et.create=(r,e,t)=>new et({valueType:e,keyType:r,typeName:g.ZodMap,...x(t)});class pe extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return h(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),_;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(h(n,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(h(n,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const s=this._def.valueType;function o(l){const f=new Set;for(const v of l){if(v.status==="aborted")return _;v.status==="dirty"&&t.dirty(),f.add(v.value)}return{status:t.value,value:f}}const c=[...n.data.values()].map((l,f)=>s._parse(new B(n,l,n.path,f)));return n.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(e,t){return new pe({...this._def,minSize:{value:e,message:y.toString(t)}})}max(e,t){return new pe({...this._def,maxSize:{value:e,message:y.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}pe.create=(r,e)=>new pe({valueType:r,minSize:null,maxSize:null,typeName:g.ZodSet,...x(e)});class xe extends k{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.function)return h(t,{code:d.invalid_type,expected:m.function,received:t.parsedType}),_;function n(c,l){return Ge({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Je(),ye].filter(f=>!!f),issueData:{code:d.invalid_arguments,argumentsError:l}})}function a(c,l){return Ge({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Je(),ye].filter(f=>!!f),issueData:{code:d.invalid_return_type,returnTypeError:l}})}const s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof ke){const c=this;return P(async function(...l){const f=new M([]),v=await c._def.args.parseAsync(l,s).catch(J=>{throw f.addIssue(n(l,J)),f}),S=await Reflect.apply(o,this,v);return await c._def.returns._def.type.parseAsync(S,s).catch(J=>{throw f.addIssue(a(S,J)),f})})}else{const c=this;return P(function(...l){const f=c._def.args.safeParse(l,s);if(!f.success)throw new M([n(l,f.error)]);const v=Reflect.apply(o,this,f.data),S=c._def.returns.safeParse(v,s);if(!S.success)throw new M([a(v,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new xe({...this._def,args:Y.create(e).rest(he.create())})}returns(e){return new xe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new xe({args:e||Y.create([]).rest(he.create()),returns:t||he.create(),typeName:g.ZodFunction,...x(n)})}}class De extends k{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}De.create=(r,e)=>new De({getter:r,typeName:g.ZodLazy,...x(e)});class $e extends k{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}$e.create=(r,e)=>new $e({value:r,typeName:g.ZodLiteral,...x(e)});function Mt(r,e){return new ie({values:r,typeName:g.ZodEnum,...x(e)})}class ie extends k{constructor(){super(...arguments),Ce.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{expected:T.joinValues(n),received:t.parsedType,code:d.invalid_type}),_}if(He(this,Ce)||Nt(this,Ce,new Set(this._def.values)),!He(this,Ce).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return h(t,{received:t.data,code:d.invalid_enum_value,options:n}),_}return P(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ie.create(e,{...this._def,...t})}exclude(e,t=this._def){return ie.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ce=new WeakMap,ie.create=Mt;class Me extends k{constructor(){super(...arguments),Oe.set(this,void 0)}_parse(e){const t=T.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){const a=T.objectValues(t);return h(n,{expected:T.joinValues(a),received:n.parsedType,code:d.invalid_type}),_}if(He(this,Oe)||Nt(this,Oe,new Set(T.getValidEnumValues(this._def.values))),!He(this,Oe).has(e.data)){const a=T.objectValues(t);return h(n,{received:n.data,code:d.invalid_enum_value,options:a}),_}return P(e.data)}get enum(){return this._def.values}}Oe=new WeakMap,Me.create=(r,e)=>new Me({values:r,typeName:g.ZodNativeEnum,...x(e)});class ke extends k{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==m.promise&&t.common.async===!1)return h(t,{code:d.invalid_type,expected:m.promise,received:t.parsedType}),_;const n=t.parsedType===m.promise?t.data:Promise.resolve(t.data);return P(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ke.create=(r,e)=>new ke({type:r,typeName:g.ZodPromise,...x(e)});class W extends k{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:o=>{h(n,o),o.fatal?t.abort():t.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const o=a.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return _;const l=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return l.status==="aborted"?_:l.status==="dirty"||t.value==="dirty"?ge(l.value):l});{if(t.value==="aborted")return _;const c=this._def.schema._parseSync({data:o,path:n.path,parent:n});return c.status==="aborted"?_:c.status==="dirty"||t.value==="dirty"?ge(c.value):c}}if(a.type==="refinement"){const o=c=>{const l=a.refinement(c,s);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?_:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?_:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!le(o))return o;const c=a.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>le(o)?Promise.resolve(a.transform(o.value,s)).then(c=>({status:t.value,value:c})):o);T.assertNever(a)}}W.create=(r,e,t)=>new W({schema:r,typeName:g.ZodEffects,effect:e,...x(t)}),W.createWithPreprocess=(r,e,t)=>new W({schema:e,effect:{type:"preprocess",transform:r},typeName:g.ZodEffects,...x(t)});class q extends k{_parse(e){return this._getType(e)===m.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}q.create=(r,e)=>new q({innerType:r,typeName:g.ZodOptional,...x(e)});class oe extends k{_parse(e){return this._getType(e)===m.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:g.ZodNullable,...x(e)});class Ve extends k{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ve.create=(r,e)=>new Ve({innerType:r,typeName:g.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...x(e)});class Le extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Se(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new M(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new M(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Le.create=(r,e)=>new Le({innerType:r,typeName:g.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...x(e)});class tt extends k{_parse(e){if(this._getType(e)!==m.nan){const n=this._getOrReturnCtx(e);return h(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),_}return{status:"valid",value:e.data}}}tt.create=r=>new tt({typeName:g.ZodNaN,...x(r)});const Fr=Symbol("zod_brand");class ht extends k{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fe extends k{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?_:s.status==="dirty"?(t.dirty(),ge(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?_:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new Fe({in:e,out:t,typeName:g.ZodPipeline})}}class ze extends k{_parse(e){const t=this._def.innerType._parse(e),n=a=>(le(a)&&(a.value=Object.freeze(a.value)),a);return Se(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}}ze.create=(r,e)=>new ze({innerType:r,typeName:g.ZodReadonly,...x(e)});function Vt(r,e={},t){return r?_e.create().superRefine((n,a)=>{var s,o;if(!r(n)){const c=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,l=(o=(s=c.fatal)!==null&&s!==void 0?s:t)!==null&&o!==void 0?o:!0,f=typeof c=="string"?{message:c}:c;a.addIssue({code:"custom",...f,fatal:l})}}):_e.create()}const zr={object:O.lazycreate};var g;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(g||(g={}));const Ur=(r,e={message:`Input not instance of ${r.name}`})=>Vt(t=>t instanceof r,e),Lt=z.create,Ft=ae.create,Wr=tt.create,Br=se.create,zt=je.create,Yr=fe.create,qr=Ke.create,Jr=Ae.create,Gr=Ze.create,Hr=_e.create,Kr=he.create,Xr=X.create,Qr=Xe.create,en=U.create,tn=O.create,rn=O.strictCreate,nn=Ne.create,an=Qe.create,sn=Ie.create,on=Y.create,cn=Pe.create,un=et.create,dn=pe.create,ln=xe.create,fn=De.create,hn=$e.create,pn=ie.create,mn=Me.create,vn=ke.create,Ut=W.create,yn=q.create,gn=oe.create,_n=W.createWithPreprocess,bn=Fe.create;var ee=Object.freeze({__proto__:null,defaultErrorMap:ye,setErrorMap:gr,getErrorMap:Je,makeIssue:Ge,EMPTY_PATH:_r,addIssueToContext:h,ParseStatus:N,INVALID:_,DIRTY:ge,OK:P,isAborted:ut,isDirty:dt,isValid:le,isAsync:Se,get util(){return T},get objectUtil(){return ct},ZodParsedType:m,getParsedType:K,ZodType:k,datetimeRegex:$t,ZodString:z,ZodNumber:ae,ZodBigInt:se,ZodBoolean:je,ZodDate:fe,ZodSymbol:Ke,ZodUndefined:Ae,ZodNull:Ze,ZodAny:_e,ZodUnknown:he,ZodNever:X,ZodVoid:Xe,ZodArray:U,ZodObject:O,ZodUnion:Ne,ZodDiscriminatedUnion:Qe,ZodIntersection:Ie,ZodTuple:Y,ZodRecord:Pe,ZodMap:et,ZodSet:pe,ZodFunction:xe,ZodLazy:De,ZodLiteral:$e,ZodEnum:ie,ZodNativeEnum:Me,ZodPromise:ke,ZodEffects:W,ZodTransformer:W,ZodOptional:q,ZodNullable:oe,ZodDefault:Ve,ZodCatch:Le,ZodNaN:tt,BRAND:Fr,ZodBranded:ht,ZodPipeline:Fe,ZodReadonly:ze,custom:Vt,Schema:k,ZodSchema:k,late:zr,get ZodFirstPartyTypeKind(){return g},coerce:{string:r=>z.create({...r,coerce:!0}),number:r=>ae.create({...r,coerce:!0}),boolean:r=>je.create({...r,coerce:!0}),bigint:r=>se.create({...r,coerce:!0}),date:r=>fe.create({...r,coerce:!0})},any:Hr,array:en,bigint:Br,boolean:zt,date:Yr,discriminatedUnion:an,effect:Ut,enum:pn,function:ln,instanceof:Ur,intersection:sn,lazy:fn,literal:hn,map:un,nan:Wr,nativeEnum:mn,never:Xr,null:Gr,nullable:gn,number:Ft,object:tn,oboolean:()=>zt().optional(),onumber:()=>Ft().optional(),optional:yn,ostring:()=>Lt().optional(),pipeline:bn,preprocess:_n,promise:vn,record:cn,set:dn,strictObject:rn,string:Lt,symbol:qr,transformer:Ut,tuple:on,undefined:Jr,union:nn,unknown:Kr,void:Qr,NEVER:_,ZodIssueCode:d,quotelessJson:yr,ZodError:M});function xn(r){const e={};for(const[t,n]of Object.entries(r))t==="profile"&&typeof n=="object"&&n!==null&&"customer"in n&&"solution"in n?e[t]=ee.object({customer:ee.string().describe(n.customer),solution:ee.string().describe(n.solution)}):Array.isArray(n)?e[t]=ee.array(ee.string()).describe(n.join(", ")):typeof n=="string"&&(e[t]=n.includes("|")?ee.enum(n.split("|").map(a=>a.trim())).describe(n):ee.string().describe(n));return ee.object(e)}function Wt(r){return xn(r)}function pt(r){return r instanceof ee.ZodType}const Bt=(r="gpt-4")=>typeof r=="string"?{provider:"openai",model:r}:r;function kn({children:r,prompt:e,schema:t,model:n="gpt-4",output:a="object",count:s,cols:o,mode:c="json",stream:l=!1,apiEndpoint:f,headers:v,experimental_telemetry:S,experimental_providerMetadata:I,className:J,itemClassName:rt,gap:mt="1rem"}){const[Ue,G]=H.useState([]),[Z,vt]=H.useState(null),te=pt(t)?t:Wt(t),yt=a==="array"?{display:"grid",gridTemplateColumns:`repeat(${o||1}, minmax(0, 1fr))`,gap:mt}:void 0;if(H.useEffect(()=>{(async()=>{try{const re=pt(te)?te.describe(""):te,We=pt(te)?te:Wt(te);if(l){const{streamObject:V}=await import("ai"),ce=V({prompt:e,model:Bt(n),schema:a==="array"?{type:"array",items:re}:re,mode:c||"json",...S&&{experimental_telemetry:S},...I&&{experimental_providerMetadata:I},...f&&{apiEndpoint:f},...v&&{headers:v}});for await(const ne of ce)if(ne.object)try{if(a==="array"){const ue=Array.isArray(ne.object)?ne.object:[ne.object];G(ue.map(L=>We.parse(L)))}else G([We.parse(ne.object)])}catch(ue){console.error("Error parsing chunk:",ue)}}else{const V=await fetch(f||"/api/generate",{method:"POST",headers:{"Content-Type":"application/json",...v||{}},body:JSON.stringify({prompt:e,model:Bt(n),schema:a==="array"?{type:"array",items:re}:re,mode:c||"json",...S&&{experimental_telemetry:S},...I&&{experimental_providerMetadata:I}})});if(!(V!=null&&V.ok))throw new Error(`HTTP error! status: ${V==null?void 0:V.status}`);const ce=await V.json(),ne=a==="array"?Array.isArray(ce.object)?ce.object:[ce.object]:[ce.object];G(ne.map(ue=>We.parse(ue)))}}catch(re){vt(re instanceof Error?re:new Error("Unknown error"))}})()},[e,te,n,a,s,o,c,S,I,l,f,v]),Z)throw Z;return Ue.length?a==="array"?Ot.jsx("div",{style:yt,className:At("ai-grid",J),children:Ot.jsx("div",{className:At("ai-grid-items",rt),children:r(Ue)})}):r(Ue[0]):null}de.AI=kn,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});
@@ -1,17 +0,0 @@
1
- import React, { Component, ReactNode } from 'react';
2
- interface Props {
3
- children: ReactNode;
4
- FallbackComponent: React.ComponentType<{
5
- error: Error;
6
- }>;
7
- }
8
- interface State {
9
- error: Error | null;
10
- }
11
- export declare class ErrorBoundary extends Component<Props, State> {
12
- constructor(props: Props);
13
- static getDerivedStateFromError(error: Error): State;
14
- render(): string | number | boolean | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
15
- }
16
- export {};
17
- //# sourceMappingURL=ErrorBoundary.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEnD,UAAU,KAAK;IACb,QAAQ,EAAE,SAAS,CAAA;IACnB,iBAAiB,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,CAAA;CACzD;AAED,UAAU,KAAK;IACb,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;gBAC5C,KAAK,EAAE,KAAK;IAKxB,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAIpD,MAAM;CAUP"}
@@ -1,2 +0,0 @@
1
- export declare function BlogList(): JSX.Element;
2
- //# sourceMappingURL=BlogList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlogList.d.ts","sourceRoot":"","sources":["../../src/examples/BlogList.tsx"],"names":[],"mappings":"AAyBA,wBAAgB,QAAQ,IAAI,GAAG,CAAC,OAAO,CAkCtC"}
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- 'Editable Blog List': import("react/jsx-runtime").JSX.Element;
3
- };
4
- export default _default;
5
- //# sourceMappingURL=BlogList.fixture.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BlogList.fixture.d.ts","sourceRoot":"","sources":["../../src/examples/BlogList.fixture.tsx"],"names":[],"mappings":";;;AAkEA,wBAEC"}
@@ -1,2 +0,0 @@
1
- export declare function HeroSection(): JSX.Element;
2
- //# sourceMappingURL=HeroSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeroSection.d.ts","sourceRoot":"","sources":["../../src/examples/HeroSection.tsx"],"names":[],"mappings":"AA0BA,wBAAgB,WAAW,IAAI,GAAG,CAAC,OAAO,CA4BzC"}
@@ -1,5 +0,0 @@
1
- declare const _default: {
2
- 'Editable Hero': import("react/jsx-runtime").JSX.Element;
3
- };
4
- export default _default;
5
- //# sourceMappingURL=HeroSection.fixture.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HeroSection.fixture.d.ts","sourceRoot":"","sources":["../../src/examples/HeroSection.fixture.tsx"],"names":[],"mappings":";;;AAuDA,wBAEC"}
@@ -1,2 +0,0 @@
1
- import '@testing-library/jest-dom';
2
- //# sourceMappingURL=setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/test/setup.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA"}
@@ -1,28 +0,0 @@
1
- import { z } from 'zod';
2
- export type ProfileObject = {
3
- customer: string;
4
- solution: string;
5
- };
6
- export type SchemaShape = {
7
- productType: string;
8
- profile: ProfileObject;
9
- description: string;
10
- tags: string[];
11
- [key: string]: unknown;
12
- };
13
- export interface SchemaObject extends SchemaShape {
14
- [key: string]: string | string[] | ProfileObject | Record<string, unknown> | unknown;
15
- }
16
- export type SchemaZodShape = {
17
- productType: z.ZodEnum<[string, ...string[]]> | z.ZodString;
18
- profile: z.ZodObject<{
19
- customer: z.ZodString;
20
- solution: z.ZodString;
21
- }>;
22
- description: z.ZodString;
23
- tags: z.ZodArray<z.ZodString>;
24
- [key: string]: z.ZodTypeAny;
25
- };
26
- export declare function createSchemaFromObject(schema: SchemaObject): z.ZodObject<SchemaZodShape>;
27
- export declare function isZodSchema(value: unknown): value is z.ZodSchema;
28
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/utils/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,aAAa,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAA;CACrF;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC3D,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACnB,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAA;QACrB,QAAQ,EAAE,CAAC,CAAC,SAAS,CAAA;KACtB,CAAC,CAAA;IACF,WAAW,EAAE,CAAC,CAAC,SAAS,CAAA;IACxB,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,CAAA;CAC5B,CAAA;AAqBD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,YAAY,GAAG,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,CAExF;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,SAAS,CAEhE"}
@@ -1,3 +0,0 @@
1
- import { type ClassValue } from 'clsx';
2
- export declare function cn(...inputs: ClassValue[]): string;
3
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/utils/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAA;AAG5C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}