@ghentcdh/json-forms-core 0.0.1
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/README.md +11 -0
- package/index.cjs +1 -0
- package/index.d.ts +12 -0
- package/index.js +6844 -0
- package/lib/column.utils.d.ts +0 -0
- package/lib/control.renderer.type.d.ts +0 -0
- package/lib/filter.d.ts +13 -0
- package/lib/layout/builder.d.ts +12 -0
- package/lib/layout/category.builder.d.ts +20 -0
- package/lib/layout/control.builder.d.ts +67 -0
- package/lib/layout/group.builder.d.ts +13 -0
- package/lib/layout/layout.builder.d.ts +19 -0
- package/lib/request.model.d.ts +55 -0
- package/lib/response.model.d.ts +81 -0
- package/lib/schema.model.d.ts +44 -0
- package/lib/schema.utils.d.ts +12 -0
- package/lib/table/builder.d.ts +31 -0
- package/lib/table/utils.d.ts +7 -0
- package/lib/table.renderer.d.ts +0 -0
- package/lib/zod.types.d.ts +3 -0
- package/package.json +17 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# json-forms-core
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
Run `nx build json-forms-core` to build the library.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
Run `nx test json-forms-core` to execute the unit tests via [Vitest](https://vitest.dev/).
|
package/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ee={},$e={},$t={},Dr;function zn(){if(Dr)return $t;Dr=1,Object.defineProperty($t,"__esModule",{value:!0});const t=n=>{if(typeof n=="object"&&n!==null){if(typeof Object.getPrototypeOf=="function"){const a=Object.getPrototypeOf(n);return a===Object.prototype||a===null}return Object.prototype.toString.call(n)==="[object Object]"}return!1},e=(...n)=>n.reduce((a,o)=>{if(Array.isArray(o))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(o).forEach(f=>{["__proto__","constructor","prototype"].includes(f)||(Array.isArray(a[f])&&Array.isArray(o[f])?a[f]=e.options.mergeArrays?e.options.uniqueArrayItems?Array.from(new Set(a[f].concat(o[f]))):[...a[f],...o[f]]:o[f]:t(a[f])&&t(o[f])?a[f]=e(a[f],o[f]):a[f]=o[f]===void 0?e.options.allowUndefinedOverrides?o[f]:a[f]:o[f])}),a},{}),r={allowUndefinedOverrides:!0,mergeArrays:!0,uniqueArrayItems:!0};return e.options=r,e.withOptions=(n,...a)=>{e.options=Object.assign(Object.assign({},r),n);const o=e(...a);return e.options=r,o},$t.default=e,$t}var ue={},Re={},ge={},Rt={},_e={},er={},Mr;function Ft(){return Mr||(Mr=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getParsedType=t.ZodParsedType=t.objectUtil=t.util=void 0;var e;(function(a){a.assertEqual=m=>{};function o(m){}a.assertIs=o;function f(m){throw new Error}a.assertNever=f,a.arrayToEnum=m=>{const y={};for(const k of m)y[k]=k;return y},a.getValidEnumValues=m=>{const y=a.objectKeys(m).filter(F=>typeof m[m[F]]!="number"),k={};for(const F of y)k[F]=m[F];return a.objectValues(k)},a.objectValues=m=>a.objectKeys(m).map(function(y){return m[y]}),a.objectKeys=typeof Object.keys=="function"?m=>Object.keys(m):m=>{const y=[];for(const k in m)Object.prototype.hasOwnProperty.call(m,k)&&y.push(k);return y},a.find=(m,y)=>{for(const k of m)if(y(k))return k},a.isInteger=typeof Number.isInteger=="function"?m=>Number.isInteger(m):m=>typeof m=="number"&&Number.isFinite(m)&&Math.floor(m)===m;function h(m,y=" | "){return m.map(k=>typeof k=="string"?`'${k}'`:k).join(y)}a.joinValues=h,a.jsonStringifyReplacer=(m,y)=>typeof y=="bigint"?y.toString():y})(e||(t.util=e={}));var r;(function(a){a.mergeShapes=(o,f)=>({...o,...f})})(r||(t.objectUtil=r={})),t.ZodParsedType=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=a=>{switch(typeof a){case"undefined":return t.ZodParsedType.undefined;case"string":return t.ZodParsedType.string;case"number":return Number.isNaN(a)?t.ZodParsedType.nan:t.ZodParsedType.number;case"boolean":return t.ZodParsedType.boolean;case"function":return t.ZodParsedType.function;case"bigint":return t.ZodParsedType.bigint;case"symbol":return t.ZodParsedType.symbol;case"object":return Array.isArray(a)?t.ZodParsedType.array:a===null?t.ZodParsedType.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?t.ZodParsedType.promise:typeof Map<"u"&&a instanceof Map?t.ZodParsedType.map:typeof Set<"u"&&a instanceof Set?t.ZodParsedType.set:typeof Date<"u"&&a instanceof Date?t.ZodParsedType.date:t.ZodParsedType.object;default:return t.ZodParsedType.unknown}};t.getParsedType=n})(er)),er}var Lr;function yr(){if(Lr)return _e;Lr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.ZodError=_e.quotelessJson=_e.ZodIssueCode=void 0;const t=Ft();_e.ZodIssueCode=t.util.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"]);const e=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");_e.quotelessJson=e;class r extends Error{get errors(){return this.issues}constructor(a){super(),this.issues=[],this.addIssue=f=>{this.issues=[...this.issues,f]},this.addIssues=(f=[])=>{this.issues=[...this.issues,...f]};const o=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,o):this.__proto__=o,this.name="ZodError",this.issues=a}format(a){const o=a||function(m){return m.message},f={_errors:[]},h=m=>{for(const y of m.issues)if(y.code==="invalid_union")y.unionErrors.map(h);else if(y.code==="invalid_return_type")h(y.returnTypeError);else if(y.code==="invalid_arguments")h(y.argumentsError);else if(y.path.length===0)f._errors.push(o(y));else{let k=f,F=0;for(;F<y.path.length;){const J=y.path[F];F===y.path.length-1?(k[J]=k[J]||{_errors:[]},k[J]._errors.push(o(y))):k[J]=k[J]||{_errors:[]},k=k[J],F++}}};return h(this),f}static assert(a){if(!(a instanceof r))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,t.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=o=>o.message){const o={},f=[];for(const h of this.issues)if(h.path.length>0){const m=h.path[0];o[m]=o[m]||[],o[m].push(a(h))}else f.push(a(h));return{formErrors:f,fieldErrors:o}}get formErrors(){return this.flatten()}}return _e.ZodError=r,r.create=n=>new r(n),_e}var Vr;function Ps(){if(Vr)return Rt;Vr=1,Object.defineProperty(Rt,"__esModule",{value:!0});const t=yr(),e=Ft(),r=(n,a)=>{let o;switch(n.code){case t.ZodIssueCode.invalid_type:n.received===e.ZodParsedType.undefined?o="Required":o=`Expected ${n.expected}, received ${n.received}`;break;case t.ZodIssueCode.invalid_literal:o=`Invalid literal value, expected ${JSON.stringify(n.expected,e.util.jsonStringifyReplacer)}`;break;case t.ZodIssueCode.unrecognized_keys:o=`Unrecognized key(s) in object: ${e.util.joinValues(n.keys,", ")}`;break;case t.ZodIssueCode.invalid_union:o="Invalid input";break;case t.ZodIssueCode.invalid_union_discriminator:o=`Invalid discriminator value. Expected ${e.util.joinValues(n.options)}`;break;case t.ZodIssueCode.invalid_enum_value:o=`Invalid enum value. Expected ${e.util.joinValues(n.options)}, received '${n.received}'`;break;case t.ZodIssueCode.invalid_arguments:o="Invalid function arguments";break;case t.ZodIssueCode.invalid_return_type:o="Invalid function return type";break;case t.ZodIssueCode.invalid_date:o="Invalid date";break;case t.ZodIssueCode.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(o=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(o=`${o} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?o=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?o=`Invalid input: must end with "${n.validation.endsWith}"`:e.util.assertNever(n.validation):n.validation!=="regex"?o=`Invalid ${n.validation}`:o="Invalid";break;case t.ZodIssueCode.too_small:n.type==="array"?o=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?o=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?o=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?o=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:o="Invalid input";break;case t.ZodIssueCode.too_big:n.type==="array"?o=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?o=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?o=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?o=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?o=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:o="Invalid input";break;case t.ZodIssueCode.custom:o="Invalid input";break;case t.ZodIssueCode.invalid_intersection_types:o="Intersection results could not be merged";break;case t.ZodIssueCode.not_multiple_of:o=`Number must be a multiple of ${n.multipleOf}`;break;case t.ZodIssueCode.not_finite:o="Number must be finite";break;default:o=a.defaultError,e.util.assertNever(n)}return{message:o}};return Rt.default=r,Rt}var Ur;function gr(){if(Ur)return ge;Ur=1;var t=ge&&ge.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(ge,"__esModule",{value:!0}),ge.defaultErrorMap=void 0,ge.setErrorMap=n,ge.getErrorMap=a;const e=t(Ps());ge.defaultErrorMap=e.default;let r=e.default;function n(o){r=o}function a(){return r}return ge}var yt={},Br;function Es(){return Br||(Br=1,(function(t){var e=yt&&yt.__importDefault||function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=t.isValid=t.isDirty=t.isAborted=t.OK=t.DIRTY=t.INVALID=t.ParseStatus=t.EMPTY_PATH=t.makeIssue=void 0,t.addIssueToContext=o;const r=gr(),n=e(Ps()),a=$=>{const{data:B,path:ee,errorMaps:X,issueData:W}=$,Q=[...ee,...W.path||[]],ne={...W,path:Q};if(W.message!==void 0)return{...W,path:Q,message:W.message};let ke="";const nt=X.filter(Se=>!!Se).slice().reverse();for(const Se of nt)ke=Se(ne,{data:B,defaultError:ke}).message;return{...W,path:Q,message:ke}};t.makeIssue=a,t.EMPTY_PATH=[];function o($,B){const ee=(0,r.getErrorMap)(),X=(0,t.makeIssue)({issueData:B,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,ee,ee===n.default?void 0:n.default].filter(W=>!!W)});$.common.issues.push(X)}class f{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(B,ee){const X=[];for(const W of ee){if(W.status==="aborted")return t.INVALID;W.status==="dirty"&&B.dirty(),X.push(W.value)}return{status:B.value,value:X}}static async mergeObjectAsync(B,ee){const X=[];for(const W of ee){const Q=await W.key,ne=await W.value;X.push({key:Q,value:ne})}return f.mergeObjectSync(B,X)}static mergeObjectSync(B,ee){const X={};for(const W of ee){const{key:Q,value:ne}=W;if(Q.status==="aborted"||ne.status==="aborted")return t.INVALID;Q.status==="dirty"&&B.dirty(),ne.status==="dirty"&&B.dirty(),Q.value!=="__proto__"&&(typeof ne.value<"u"||W.alwaysSet)&&(X[Q.value]=ne.value)}return{status:B.value,value:X}}}t.ParseStatus=f,t.INVALID=Object.freeze({status:"aborted"});const h=$=>({status:"dirty",value:$});t.DIRTY=h;const m=$=>({status:"valid",value:$});t.OK=m;const y=$=>$.status==="aborted";t.isAborted=y;const k=$=>$.status==="dirty";t.isDirty=k;const F=$=>$.status==="valid";t.isValid=F;const J=$=>typeof Promise<"u"&&$ instanceof Promise;t.isAsync=J})(yt)),yt}var tr={},Fr;function Wn(){return Fr||(Fr=1,Object.defineProperty(tr,"__esModule",{value:!0})),tr}var p={},gt={},qr;function Kn(){if(qr)return gt;qr=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.errorUtil=void 0;var t;return(function(e){e.errToObj=r=>typeof r=="string"?{message:r}:r||{},e.toString=r=>typeof r=="string"?r:r==null?void 0:r.message})(t||(gt.errorUtil=t={})),gt}var zr;function Gn(){if(zr)return p;zr=1,Object.defineProperty(p,"__esModule",{value:!0}),p.discriminatedUnion=p.date=p.boolean=p.bigint=p.array=p.any=p.coerce=p.ZodFirstPartyTypeKind=p.late=p.ZodSchema=p.Schema=p.ZodReadonly=p.ZodPipeline=p.ZodBranded=p.BRAND=p.ZodNaN=p.ZodCatch=p.ZodDefault=p.ZodNullable=p.ZodOptional=p.ZodTransformer=p.ZodEffects=p.ZodPromise=p.ZodNativeEnum=p.ZodEnum=p.ZodLiteral=p.ZodLazy=p.ZodFunction=p.ZodSet=p.ZodMap=p.ZodRecord=p.ZodTuple=p.ZodIntersection=p.ZodDiscriminatedUnion=p.ZodUnion=p.ZodObject=p.ZodArray=p.ZodVoid=p.ZodNever=p.ZodUnknown=p.ZodAny=p.ZodNull=p.ZodUndefined=p.ZodSymbol=p.ZodDate=p.ZodBoolean=p.ZodBigInt=p.ZodNumber=p.ZodString=p.ZodType=void 0,p.NEVER=p.void=p.unknown=p.union=p.undefined=p.tuple=p.transformer=p.symbol=p.string=p.strictObject=p.set=p.record=p.promise=p.preprocess=p.pipeline=p.ostring=p.optional=p.onumber=p.oboolean=p.object=p.number=p.nullable=p.null=p.never=p.nativeEnum=p.nan=p.map=p.literal=p.lazy=p.intersection=p.instanceof=p.function=p.enum=p.effect=void 0,p.datetimeRegex=at,p.custom=Sr;const t=yr(),e=gr(),r=Kn(),n=Es(),a=Ft();class o{constructor(s,i,d,u){this._cachedPath=[],this.parent=s,this.data=i,this._path=d,this._key=u}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const f=(c,s)=>{if((0,n.isValid)(s))return{success:!0,data:s.value};if(!c.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new t.ZodError(c.common.issues);return this._error=i,this._error}}};function h(c){if(!c)return{};const{errorMap:s,invalid_type_error:i,required_error:d,description:u}=c;if(s&&(i||d))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return s?{errorMap:s,description:u}:{errorMap:(v,g)=>{const{message:O}=c;return v.code==="invalid_enum_value"?{message:O??g.defaultError}:typeof g.data>"u"?{message:O??d??g.defaultError}:v.code!=="invalid_type"?{message:g.defaultError}:{message:O??i??g.defaultError}},description:u}}class m{get description(){return this._def.description}_getType(s){return(0,a.getParsedType)(s.data)}_getOrReturnCtx(s,i){return i||{common:s.parent.common,data:s.data,parsedType:(0,a.getParsedType)(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}_processInputParams(s){return{status:new n.ParseStatus,ctx:{common:s.parent.common,data:s.data,parsedType:(0,a.getParsedType)(s.data),schemaErrorMap:this._def.errorMap,path:s.path,parent:s.parent}}}_parseSync(s){const i=this._parse(s);if((0,n.isAsync)(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(s){const i=this._parse(s);return Promise.resolve(i)}parse(s,i){const d=this.safeParse(s,i);if(d.success)return d.data;throw d.error}safeParse(s,i){const d={common:{issues:[],async:(i==null?void 0:i.async)??!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:(0,a.getParsedType)(s)},u=this._parseSync({data:s,path:d.path,parent:d});return f(d,u)}"~validate"(s){var d,u;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:(0,a.getParsedType)(s)};if(!this["~standard"].async)try{const l=this._parseSync({data:s,path:[],parent:i});return(0,n.isValid)(l)?{value:l.value}:{issues:i.common.issues}}catch(l){(u=(d=l==null?void 0:l.message)==null?void 0:d.toLowerCase())!=null&&u.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:s,path:[],parent:i}).then(l=>(0,n.isValid)(l)?{value:l.value}:{issues:i.common.issues})}async parseAsync(s,i){const d=await this.safeParseAsync(s,i);if(d.success)return d.data;throw d.error}async safeParseAsync(s,i){const d={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:s,parsedType:(0,a.getParsedType)(s)},u=this._parse({data:s,path:d.path,parent:d}),l=await((0,n.isAsync)(u)?u:Promise.resolve(u));return f(d,l)}refine(s,i){const d=u=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(u):i;return this._refinement((u,l)=>{const v=s(u),g=()=>l.addIssue({code:t.ZodIssueCode.custom,...d(u)});return typeof Promise<"u"&&v instanceof Promise?v.then(O=>O?!0:(g(),!1)):v?!0:(g(),!1)})}refinement(s,i){return this._refinement((d,u)=>s(d)?!0:(u.addIssue(typeof i=="function"?i(d,u):i),!1))}_refinement(s){return new ce({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:s}})}superRefine(s){return this._refinement(s)}constructor(s){this.spa=this.safeParseAsync,this._def=s,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:i=>this["~validate"](i)}}optional(){return fe.create(this,this._def)}nullable(){return Ze.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ke.create(this,this._def)}or(s){return it.create([this,s],this._def)}and(s){return ot.create(this,s,this._def)}transform(s){return new ce({...h(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:s}})}default(s){const i=typeof s=="function"?s:()=>s;return new ft({...h(this._def),innerType:this,defaultValue:i,typeName:j.ZodDefault})}brand(){return new Xt({typeName:j.ZodBranded,type:this,...h(this._def)})}catch(s){const i=typeof s=="function"?s:()=>s;return new ht({...h(this._def),innerType:this,catchValue:i,typeName:j.ZodCatch})}describe(s){const i=this.constructor;return new i({...this._def,description:s})}pipe(s){return pt.create(this,s)}readonly(){return mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}p.ZodType=m,p.Schema=m,p.ZodSchema=m;const y=/^c[^\s-]{8,}$/i,k=/^[0-9a-z]+$/,F=/^[0-9A-HJKMNP-TV-Z]{26}$/i,J=/^[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,$=/^[a-z0-9_-]{21}$/i,B=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ee=/^[-+]?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)?)??$/,X=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,W="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Q;const ne=/^(?:(?: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])$/,ke=/^(?:(?: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])$/,nt=/^(([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]))$/,Se=/^(([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])$/,Gt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ht=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,At="((\\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])))",re=new RegExp(`^${At}$`);function jt(c){let s="[0-5]\\d";c.precision?s=`${s}\\.\\d{${c.precision}}`:c.precision==null&&(s=`${s}(\\.\\d+)?`);const i=c.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${s})${i}`}function Yt(c){return new RegExp(`^${jt(c)}$`)}function at(c){let s=`${At}T${jt(c)}`;const i=[];return i.push(c.local?"Z?":"Z"),c.offset&&i.push("([+-]\\d{2}:?\\d{2})"),s=`${s}(${i.join("|")})`,new RegExp(`^${s}$`)}function Y(c,s){return!!((s==="v4"||!s)&&ne.test(c)||(s==="v6"||!s)&&nt.test(c))}function _(c,s){if(!B.test(c))return!1;try{const[i]=c.split(".");if(!i)return!1;const d=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),u=JSON.parse(atob(d));return!(typeof u!="object"||u===null||"typ"in u&&(u==null?void 0:u.typ)!=="JWT"||!u.alg||s&&u.alg!==s)}catch{return!1}}function b(c,s){return!!((s==="v4"||!s)&&ke.test(c)||(s==="v6"||!s)&&Se.test(c))}class T extends m{_parse(s){if(this._def.coerce&&(s.data=String(s.data)),this._getType(s)!==a.ZodParsedType.string){const l=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(l,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.string,received:l.parsedType}),n.INVALID}const d=new n.ParseStatus;let u;for(const l of this._def.checks)if(l.kind==="min")s.data.length<l.value&&(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),d.dirty());else if(l.kind==="max")s.data.length>l.value&&(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),d.dirty());else if(l.kind==="length"){const v=s.data.length>l.value,g=s.data.length<l.value;(v||g)&&(u=this._getOrReturnCtx(s,u),v?(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):g&&(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),d.dirty())}else if(l.kind==="email")X.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"email",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="emoji")Q||(Q=new RegExp(W,"u")),Q.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"emoji",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="uuid")J.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"uuid",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="nanoid")$.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"nanoid",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="cuid")y.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"cuid",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="cuid2")k.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"cuid2",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="ulid")F.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"ulid",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty());else if(l.kind==="url")try{new URL(s.data)}catch{u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"url",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"regex",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty())):l.kind==="trim"?s.data=s.data.trim():l.kind==="includes"?s.data.includes(l.value,l.position)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),d.dirty()):l.kind==="toLowerCase"?s.data=s.data.toLowerCase():l.kind==="toUpperCase"?s.data=s.data.toUpperCase():l.kind==="startsWith"?s.data.startsWith(l.value)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:{startsWith:l.value},message:l.message}),d.dirty()):l.kind==="endsWith"?s.data.endsWith(l.value)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:{endsWith:l.value},message:l.message}),d.dirty()):l.kind==="datetime"?at(l).test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:"datetime",message:l.message}),d.dirty()):l.kind==="date"?re.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:"date",message:l.message}),d.dirty()):l.kind==="time"?Yt(l).test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.invalid_string,validation:"time",message:l.message}),d.dirty()):l.kind==="duration"?ee.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"duration",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):l.kind==="ip"?Y(s.data,l.version)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"ip",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):l.kind==="jwt"?_(s.data,l.alg)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"jwt",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):l.kind==="cidr"?b(s.data,l.version)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"cidr",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):l.kind==="base64"?Gt.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"base64",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):l.kind==="base64url"?Ht.test(s.data)||(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{validation:"base64url",code:t.ZodIssueCode.invalid_string,message:l.message}),d.dirty()):a.util.assertNever(l);return{status:d.value,value:s.data}}_regex(s,i,d){return this.refinement(u=>s.test(u),{validation:i,code:t.ZodIssueCode.invalid_string,...r.errorUtil.errToObj(d)})}_addCheck(s){return new T({...this._def,checks:[...this._def.checks,s]})}email(s){return this._addCheck({kind:"email",...r.errorUtil.errToObj(s)})}url(s){return this._addCheck({kind:"url",...r.errorUtil.errToObj(s)})}emoji(s){return this._addCheck({kind:"emoji",...r.errorUtil.errToObj(s)})}uuid(s){return this._addCheck({kind:"uuid",...r.errorUtil.errToObj(s)})}nanoid(s){return this._addCheck({kind:"nanoid",...r.errorUtil.errToObj(s)})}cuid(s){return this._addCheck({kind:"cuid",...r.errorUtil.errToObj(s)})}cuid2(s){return this._addCheck({kind:"cuid2",...r.errorUtil.errToObj(s)})}ulid(s){return this._addCheck({kind:"ulid",...r.errorUtil.errToObj(s)})}base64(s){return this._addCheck({kind:"base64",...r.errorUtil.errToObj(s)})}base64url(s){return this._addCheck({kind:"base64url",...r.errorUtil.errToObj(s)})}jwt(s){return this._addCheck({kind:"jwt",...r.errorUtil.errToObj(s)})}ip(s){return this._addCheck({kind:"ip",...r.errorUtil.errToObj(s)})}cidr(s){return this._addCheck({kind:"cidr",...r.errorUtil.errToObj(s)})}datetime(s){return typeof s=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:s}):this._addCheck({kind:"datetime",precision:typeof(s==null?void 0:s.precision)>"u"?null:s==null?void 0:s.precision,offset:(s==null?void 0:s.offset)??!1,local:(s==null?void 0:s.local)??!1,...r.errorUtil.errToObj(s==null?void 0:s.message)})}date(s){return this._addCheck({kind:"date",message:s})}time(s){return typeof s=="string"?this._addCheck({kind:"time",precision:null,message:s}):this._addCheck({kind:"time",precision:typeof(s==null?void 0:s.precision)>"u"?null:s==null?void 0:s.precision,...r.errorUtil.errToObj(s==null?void 0:s.message)})}duration(s){return this._addCheck({kind:"duration",...r.errorUtil.errToObj(s)})}regex(s,i){return this._addCheck({kind:"regex",regex:s,...r.errorUtil.errToObj(i)})}includes(s,i){return this._addCheck({kind:"includes",value:s,position:i==null?void 0:i.position,...r.errorUtil.errToObj(i==null?void 0:i.message)})}startsWith(s,i){return this._addCheck({kind:"startsWith",value:s,...r.errorUtil.errToObj(i)})}endsWith(s,i){return this._addCheck({kind:"endsWith",value:s,...r.errorUtil.errToObj(i)})}min(s,i){return this._addCheck({kind:"min",value:s,...r.errorUtil.errToObj(i)})}max(s,i){return this._addCheck({kind:"max",value:s,...r.errorUtil.errToObj(i)})}length(s,i){return this._addCheck({kind:"length",value:s,...r.errorUtil.errToObj(i)})}nonempty(s){return this.min(1,r.errorUtil.errToObj(s))}trim(){return new T({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new T({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new T({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(s=>s.kind==="datetime")}get isDate(){return!!this._def.checks.find(s=>s.kind==="date")}get isTime(){return!!this._def.checks.find(s=>s.kind==="time")}get isDuration(){return!!this._def.checks.find(s=>s.kind==="duration")}get isEmail(){return!!this._def.checks.find(s=>s.kind==="email")}get isURL(){return!!this._def.checks.find(s=>s.kind==="url")}get isEmoji(){return!!this._def.checks.find(s=>s.kind==="emoji")}get isUUID(){return!!this._def.checks.find(s=>s.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(s=>s.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(s=>s.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(s=>s.kind==="cuid2")}get isULID(){return!!this._def.checks.find(s=>s.kind==="ulid")}get isIP(){return!!this._def.checks.find(s=>s.kind==="ip")}get isCIDR(){return!!this._def.checks.find(s=>s.kind==="cidr")}get isBase64(){return!!this._def.checks.find(s=>s.kind==="base64")}get isBase64url(){return!!this._def.checks.find(s=>s.kind==="base64url")}get minLength(){let s=null;for(const i of this._def.checks)i.kind==="min"&&(s===null||i.value>s)&&(s=i.value);return s}get maxLength(){let s=null;for(const i of this._def.checks)i.kind==="max"&&(s===null||i.value<s)&&(s=i.value);return s}}p.ZodString=T,T.create=c=>new T({checks:[],typeName:j.ZodString,coerce:(c==null?void 0:c.coerce)??!1,...h(c)});function w(c,s){const i=(c.toString().split(".")[1]||"").length,d=(s.toString().split(".")[1]||"").length,u=i>d?i:d,l=Number.parseInt(c.toFixed(u).replace(".","")),v=Number.parseInt(s.toFixed(u).replace(".",""));return l%v/10**u}class E extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(s){if(this._def.coerce&&(s.data=Number(s.data)),this._getType(s)!==a.ZodParsedType.number){const l=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(l,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.number,received:l.parsedType}),n.INVALID}let d;const u=new n.ParseStatus;for(const l of this._def.checks)l.kind==="int"?a.util.isInteger(s.data)||(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:l.message}),u.dirty()):l.kind==="min"?(l.inclusive?s.data<l.value:s.data<=l.value)&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),u.dirty()):l.kind==="max"?(l.inclusive?s.data>l.value:s.data>=l.value)&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),u.dirty()):l.kind==="multipleOf"?w(s.data,l.value)!==0&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.not_multiple_of,multipleOf:l.value,message:l.message}),u.dirty()):l.kind==="finite"?Number.isFinite(s.data)||(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.not_finite,message:l.message}),u.dirty()):a.util.assertNever(l);return{status:u.value,value:s.data}}gte(s,i){return this.setLimit("min",s,!0,r.errorUtil.toString(i))}gt(s,i){return this.setLimit("min",s,!1,r.errorUtil.toString(i))}lte(s,i){return this.setLimit("max",s,!0,r.errorUtil.toString(i))}lt(s,i){return this.setLimit("max",s,!1,r.errorUtil.toString(i))}setLimit(s,i,d,u){return new E({...this._def,checks:[...this._def.checks,{kind:s,value:i,inclusive:d,message:r.errorUtil.toString(u)}]})}_addCheck(s){return new E({...this._def,checks:[...this._def.checks,s]})}int(s){return this._addCheck({kind:"int",message:r.errorUtil.toString(s)})}positive(s){return this._addCheck({kind:"min",value:0,inclusive:!1,message:r.errorUtil.toString(s)})}negative(s){return this._addCheck({kind:"max",value:0,inclusive:!1,message:r.errorUtil.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:0,inclusive:!0,message:r.errorUtil.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:0,inclusive:!0,message:r.errorUtil.toString(s)})}multipleOf(s,i){return this._addCheck({kind:"multipleOf",value:s,message:r.errorUtil.toString(i)})}finite(s){return this._addCheck({kind:"finite",message:r.errorUtil.toString(s)})}safe(s){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:r.errorUtil.toString(s)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:r.errorUtil.toString(s)})}get minValue(){let s=null;for(const i of this._def.checks)i.kind==="min"&&(s===null||i.value>s)&&(s=i.value);return s}get maxValue(){let s=null;for(const i of this._def.checks)i.kind==="max"&&(s===null||i.value<s)&&(s=i.value);return s}get isInt(){return!!this._def.checks.find(s=>s.kind==="int"||s.kind==="multipleOf"&&a.util.isInteger(s.value))}get isFinite(){let s=null,i=null;for(const d of this._def.checks){if(d.kind==="finite"||d.kind==="int"||d.kind==="multipleOf")return!0;d.kind==="min"?(i===null||d.value>i)&&(i=d.value):d.kind==="max"&&(s===null||d.value<s)&&(s=d.value)}return Number.isFinite(i)&&Number.isFinite(s)}}p.ZodNumber=E,E.create=c=>new E({checks:[],typeName:j.ZodNumber,coerce:(c==null?void 0:c.coerce)||!1,...h(c)});class S extends m{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(s){if(this._def.coerce)try{s.data=BigInt(s.data)}catch{return this._getInvalidInput(s)}if(this._getType(s)!==a.ZodParsedType.bigint)return this._getInvalidInput(s);let d;const u=new n.ParseStatus;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?s.data<l.value:s.data<=l.value)&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),u.dirty()):l.kind==="max"?(l.inclusive?s.data>l.value:s.data>=l.value)&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),u.dirty()):l.kind==="multipleOf"?s.data%l.value!==BigInt(0)&&(d=this._getOrReturnCtx(s,d),(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.not_multiple_of,multipleOf:l.value,message:l.message}),u.dirty()):a.util.assertNever(l);return{status:u.value,value:s.data}}_getInvalidInput(s){const i=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.bigint,received:i.parsedType}),n.INVALID}gte(s,i){return this.setLimit("min",s,!0,r.errorUtil.toString(i))}gt(s,i){return this.setLimit("min",s,!1,r.errorUtil.toString(i))}lte(s,i){return this.setLimit("max",s,!0,r.errorUtil.toString(i))}lt(s,i){return this.setLimit("max",s,!1,r.errorUtil.toString(i))}setLimit(s,i,d,u){return new S({...this._def,checks:[...this._def.checks,{kind:s,value:i,inclusive:d,message:r.errorUtil.toString(u)}]})}_addCheck(s){return new S({...this._def,checks:[...this._def.checks,s]})}positive(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:r.errorUtil.toString(s)})}negative(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:r.errorUtil.toString(s)})}nonpositive(s){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(s)})}nonnegative(s){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:r.errorUtil.toString(s)})}multipleOf(s,i){return this._addCheck({kind:"multipleOf",value:s,message:r.errorUtil.toString(i)})}get minValue(){let s=null;for(const i of this._def.checks)i.kind==="min"&&(s===null||i.value>s)&&(s=i.value);return s}get maxValue(){let s=null;for(const i of this._def.checks)i.kind==="max"&&(s===null||i.value<s)&&(s=i.value);return s}}p.ZodBigInt=S,S.create=c=>new S({checks:[],typeName:j.ZodBigInt,coerce:(c==null?void 0:c.coerce)??!1,...h(c)});class K extends m{_parse(s){if(this._def.coerce&&(s.data=!!s.data),this._getType(s)!==a.ZodParsedType.boolean){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.boolean,received:d.parsedType}),n.INVALID}return(0,n.OK)(s.data)}}p.ZodBoolean=K,K.create=c=>new K({typeName:j.ZodBoolean,coerce:(c==null?void 0:c.coerce)||!1,...h(c)});class q extends m{_parse(s){if(this._def.coerce&&(s.data=new Date(s.data)),this._getType(s)!==a.ZodParsedType.date){const l=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(l,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.date,received:l.parsedType}),n.INVALID}if(Number.isNaN(s.data.getTime())){const l=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(l,{code:t.ZodIssueCode.invalid_date}),n.INVALID}const d=new n.ParseStatus;let u;for(const l of this._def.checks)l.kind==="min"?s.data.getTime()<l.value&&(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),d.dirty()):l.kind==="max"?s.data.getTime()>l.value&&(u=this._getOrReturnCtx(s,u),(0,n.addIssueToContext)(u,{code:t.ZodIssueCode.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),d.dirty()):a.util.assertNever(l);return{status:d.value,value:new Date(s.data.getTime())}}_addCheck(s){return new q({...this._def,checks:[...this._def.checks,s]})}min(s,i){return this._addCheck({kind:"min",value:s.getTime(),message:r.errorUtil.toString(i)})}max(s,i){return this._addCheck({kind:"max",value:s.getTime(),message:r.errorUtil.toString(i)})}get minDate(){let s=null;for(const i of this._def.checks)i.kind==="min"&&(s===null||i.value>s)&&(s=i.value);return s!=null?new Date(s):null}get maxDate(){let s=null;for(const i of this._def.checks)i.kind==="max"&&(s===null||i.value<s)&&(s=i.value);return s!=null?new Date(s):null}}p.ZodDate=q,q.create=c=>new q({checks:[],coerce:(c==null?void 0:c.coerce)||!1,typeName:j.ZodDate,...h(c)});class H extends m{_parse(s){if(this._getType(s)!==a.ZodParsedType.symbol){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.symbol,received:d.parsedType}),n.INVALID}return(0,n.OK)(s.data)}}p.ZodSymbol=H,H.create=c=>new H({typeName:j.ZodSymbol,...h(c)});class ae extends m{_parse(s){if(this._getType(s)!==a.ZodParsedType.undefined){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.undefined,received:d.parsedType}),n.INVALID}return(0,n.OK)(s.data)}}p.ZodUndefined=ae,ae.create=c=>new ae({typeName:j.ZodUndefined,...h(c)});class te extends m{_parse(s){if(this._getType(s)!==a.ZodParsedType.null){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.null,received:d.parsedType}),n.INVALID}return(0,n.OK)(s.data)}}p.ZodNull=te,te.create=c=>new te({typeName:j.ZodNull,...h(c)});class qe extends m{constructor(){super(...arguments),this._any=!0}_parse(s){return(0,n.OK)(s.data)}}p.ZodAny=qe,qe.create=c=>new qe({typeName:j.ZodAny,...h(c)});class Ne extends m{constructor(){super(...arguments),this._unknown=!0}_parse(s){return(0,n.OK)(s.data)}}p.ZodUnknown=Ne,Ne.create=c=>new Ne({typeName:j.ZodUnknown,...h(c)});class me extends m{_parse(s){const i=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.never,received:i.parsedType}),n.INVALID}}p.ZodNever=me,me.create=c=>new me({typeName:j.ZodNever,...h(c)});class St extends m{_parse(s){if(this._getType(s)!==a.ZodParsedType.undefined){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.void,received:d.parsedType}),n.INVALID}return(0,n.OK)(s.data)}}p.ZodVoid=St,St.create=c=>new St({typeName:j.ZodVoid,...h(c)});class de extends m{_parse(s){const{ctx:i,status:d}=this._processInputParams(s),u=this._def;if(i.parsedType!==a.ZodParsedType.array)return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:i.parsedType}),n.INVALID;if(u.exactLength!==null){const v=i.data.length>u.exactLength.value,g=i.data.length<u.exactLength.value;(v||g)&&((0,n.addIssueToContext)(i,{code:v?t.ZodIssueCode.too_big:t.ZodIssueCode.too_small,minimum:g?u.exactLength.value:void 0,maximum:v?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),d.dirty())}if(u.minLength!==null&&i.data.length<u.minLength.value&&((0,n.addIssueToContext)(i,{code:t.ZodIssueCode.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),d.dirty()),u.maxLength!==null&&i.data.length>u.maxLength.value&&((0,n.addIssueToContext)(i,{code:t.ZodIssueCode.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),d.dirty()),i.common.async)return Promise.all([...i.data].map((v,g)=>u.type._parseAsync(new o(i,v,i.path,g)))).then(v=>n.ParseStatus.mergeArray(d,v));const l=[...i.data].map((v,g)=>u.type._parseSync(new o(i,v,i.path,g)));return n.ParseStatus.mergeArray(d,l)}get element(){return this._def.type}min(s,i){return new de({...this._def,minLength:{value:s,message:r.errorUtil.toString(i)}})}max(s,i){return new de({...this._def,maxLength:{value:s,message:r.errorUtil.toString(i)}})}length(s,i){return new de({...this._def,exactLength:{value:s,message:r.errorUtil.toString(i)}})}nonempty(s){return this.min(1,s)}}p.ZodArray=de,de.create=(c,s)=>new de({type:c,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...h(s)});function ze(c){if(c instanceof z){const s={};for(const i in c.shape){const d=c.shape[i];s[i]=fe.create(ze(d))}return new z({...c._def,shape:()=>s})}else return c instanceof de?new de({...c._def,type:ze(c.element)}):c instanceof fe?fe.create(ze(c.unwrap())):c instanceof Ze?Ze.create(ze(c.unwrap())):c instanceof le?le.create(c.items.map(s=>ze(s))):c}class z extends m{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const s=this._def.shape(),i=a.util.objectKeys(s);return this._cached={shape:s,keys:i},this._cached}_parse(s){if(this._getType(s)!==a.ZodParsedType.object){const A=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(A,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:A.parsedType}),n.INVALID}const{status:d,ctx:u}=this._processInputParams(s),{shape:l,keys:v}=this._getCached(),g=[];if(!(this._def.catchall instanceof me&&this._def.unknownKeys==="strip"))for(const A in u.data)v.includes(A)||g.push(A);const O=[];for(const A of v){const D=l[A],ie=u.data[A];O.push({key:{status:"valid",value:A},value:D._parse(new o(u,ie,u.path,A)),alwaysSet:A in u.data})}if(this._def.catchall instanceof me){const A=this._def.unknownKeys;if(A==="passthrough")for(const D of g)O.push({key:{status:"valid",value:D},value:{status:"valid",value:u.data[D]}});else if(A==="strict")g.length>0&&((0,n.addIssueToContext)(u,{code:t.ZodIssueCode.unrecognized_keys,keys:g}),d.dirty());else if(A!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const A=this._def.catchall;for(const D of g){const ie=u.data[D];O.push({key:{status:"valid",value:D},value:A._parse(new o(u,ie,u.path,D)),alwaysSet:D in u.data})}}return u.common.async?Promise.resolve().then(async()=>{const A=[];for(const D of O){const ie=await D.key,Rr=await D.value;A.push({key:ie,value:Rr,alwaysSet:D.alwaysSet})}return A}).then(A=>n.ParseStatus.mergeObjectSync(d,A)):n.ParseStatus.mergeObjectSync(d,O)}get shape(){return this._def.shape()}strict(s){return r.errorUtil.errToObj,new z({...this._def,unknownKeys:"strict",...s!==void 0?{errorMap:(i,d)=>{var l,v;const u=((v=(l=this._def).errorMap)==null?void 0:v.call(l,i,d).message)??d.defaultError;return i.code==="unrecognized_keys"?{message:r.errorUtil.errToObj(s).message??u}:{message:u}}}:{}})}strip(){return new z({...this._def,unknownKeys:"strip"})}passthrough(){return new z({...this._def,unknownKeys:"passthrough"})}extend(s){return new z({...this._def,shape:()=>({...this._def.shape(),...s})})}merge(s){return new z({unknownKeys:s._def.unknownKeys,catchall:s._def.catchall,shape:()=>({...this._def.shape(),...s._def.shape()}),typeName:j.ZodObject})}setKey(s,i){return this.augment({[s]:i})}catchall(s){return new z({...this._def,catchall:s})}pick(s){const i={};for(const d of a.util.objectKeys(s))s[d]&&this.shape[d]&&(i[d]=this.shape[d]);return new z({...this._def,shape:()=>i})}omit(s){const i={};for(const d of a.util.objectKeys(this.shape))s[d]||(i[d]=this.shape[d]);return new z({...this._def,shape:()=>i})}deepPartial(){return ze(this)}partial(s){const i={};for(const d of a.util.objectKeys(this.shape)){const u=this.shape[d];s&&!s[d]?i[d]=u:i[d]=u.optional()}return new z({...this._def,shape:()=>i})}required(s){const i={};for(const d of a.util.objectKeys(this.shape))if(s&&!s[d])i[d]=this.shape[d];else{let l=this.shape[d];for(;l instanceof fe;)l=l._def.innerType;i[d]=l}return new z({...this._def,shape:()=>i})}keyof(){return Ar(a.util.objectKeys(this.shape))}}p.ZodObject=z,z.create=(c,s)=>new z({shape:()=>c,unknownKeys:"strip",catchall:me.create(),typeName:j.ZodObject,...h(s)}),z.strictCreate=(c,s)=>new z({shape:()=>c,unknownKeys:"strict",catchall:me.create(),typeName:j.ZodObject,...h(s)}),z.lazycreate=(c,s)=>new z({shape:c,unknownKeys:"strip",catchall:me.create(),typeName:j.ZodObject,...h(s)});class it extends m{_parse(s){const{ctx:i}=this._processInputParams(s),d=this._def.options;function u(l){for(const g of l)if(g.result.status==="valid")return g.result;for(const g of l)if(g.result.status==="dirty")return i.common.issues.push(...g.ctx.common.issues),g.result;const v=l.map(g=>new t.ZodError(g.ctx.common.issues));return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_union,unionErrors:v}),n.INVALID}if(i.common.async)return Promise.all(d.map(async l=>{const v={...i,common:{...i.common,issues:[]},parent:null};return{result:await l._parseAsync({data:i.data,path:i.path,parent:v}),ctx:v}})).then(u);{let l;const v=[];for(const O of d){const A={...i,common:{...i.common,issues:[]},parent:null},D=O._parseSync({data:i.data,path:i.path,parent:A});if(D.status==="valid")return D;D.status==="dirty"&&!l&&(l={result:D,ctx:A}),A.common.issues.length&&v.push(A.common.issues)}if(l)return i.common.issues.push(...l.ctx.common.issues),l.result;const g=v.map(O=>new t.ZodError(O));return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_union,unionErrors:g}),n.INVALID}}get options(){return this._def.options}}p.ZodUnion=it,it.create=(c,s)=>new it({options:c,typeName:j.ZodUnion,...h(s)});const ye=c=>c instanceof ct?ye(c.schema):c instanceof ce?ye(c.innerType()):c instanceof ut?[c.value]:c instanceof we?c.options:c instanceof lt?a.util.objectValues(c.enum):c instanceof ft?ye(c._def.innerType):c instanceof ae?[void 0]:c instanceof te?[null]:c instanceof fe?[void 0,...ye(c.unwrap())]:c instanceof Ze?[null,...ye(c.unwrap())]:c instanceof Xt||c instanceof mt?ye(c.unwrap()):c instanceof ht?ye(c._def.innerType):[];class Nt extends m{_parse(s){const{ctx:i}=this._processInputParams(s);if(i.parsedType!==a.ZodParsedType.object)return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:i.parsedType}),n.INVALID;const d=this.discriminator,u=i.data[d],l=this.optionsMap.get(u);return l?i.common.async?l._parseAsync({data:i.data,path:i.path,parent:i}):l._parseSync({data:i.data,path:i.path,parent:i}):((0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[d]}),n.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(s,i,d){const u=new Map;for(const l of i){const v=ye(l.shape[s]);if(!v.length)throw new Error(`A discriminator value for key \`${s}\` could not be extracted from all schema options`);for(const g of v){if(u.has(g))throw new Error(`Discriminator property ${String(s)} has duplicate value ${String(g)}`);u.set(g,l)}}return new Nt({typeName:j.ZodDiscriminatedUnion,discriminator:s,options:i,optionsMap:u,...h(d)})}}p.ZodDiscriminatedUnion=Nt;function Jt(c,s){const i=(0,a.getParsedType)(c),d=(0,a.getParsedType)(s);if(c===s)return{valid:!0,data:c};if(i===a.ZodParsedType.object&&d===a.ZodParsedType.object){const u=a.util.objectKeys(s),l=a.util.objectKeys(c).filter(g=>u.indexOf(g)!==-1),v={...c,...s};for(const g of l){const O=Jt(c[g],s[g]);if(!O.valid)return{valid:!1};v[g]=O.data}return{valid:!0,data:v}}else if(i===a.ZodParsedType.array&&d===a.ZodParsedType.array){if(c.length!==s.length)return{valid:!1};const u=[];for(let l=0;l<c.length;l++){const v=c[l],g=s[l],O=Jt(v,g);if(!O.valid)return{valid:!1};u.push(O.data)}return{valid:!0,data:u}}else return i===a.ZodParsedType.date&&d===a.ZodParsedType.date&&+c==+s?{valid:!0,data:c}:{valid:!1}}class ot extends m{_parse(s){const{status:i,ctx:d}=this._processInputParams(s),u=(l,v)=>{if((0,n.isAborted)(l)||(0,n.isAborted)(v))return n.INVALID;const g=Jt(l.value,v.value);return g.valid?(((0,n.isDirty)(l)||(0,n.isDirty)(v))&&i.dirty(),{status:i.value,value:g.data}):((0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_intersection_types}),n.INVALID)};return d.common.async?Promise.all([this._def.left._parseAsync({data:d.data,path:d.path,parent:d}),this._def.right._parseAsync({data:d.data,path:d.path,parent:d})]).then(([l,v])=>u(l,v)):u(this._def.left._parseSync({data:d.data,path:d.path,parent:d}),this._def.right._parseSync({data:d.data,path:d.path,parent:d}))}}p.ZodIntersection=ot,ot.create=(c,s,i)=>new ot({left:c,right:s,typeName:j.ZodIntersection,...h(i)});class le extends m{_parse(s){const{status:i,ctx:d}=this._processInputParams(s);if(d.parsedType!==a.ZodParsedType.array)return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.array,received:d.parsedType}),n.INVALID;if(d.data.length<this._def.items.length)return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.INVALID;!this._def.rest&&d.data.length>this._def.items.length&&((0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const l=[...d.data].map((v,g)=>{const O=this._def.items[g]||this._def.rest;return O?O._parse(new o(d,v,d.path,g)):null}).filter(v=>!!v);return d.common.async?Promise.all(l).then(v=>n.ParseStatus.mergeArray(i,v)):n.ParseStatus.mergeArray(i,l)}get items(){return this._def.items}rest(s){return new le({...this._def,rest:s})}}p.ZodTuple=le,le.create=(c,s)=>{if(!Array.isArray(c))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new le({items:c,typeName:j.ZodTuple,rest:null,...h(s)})};class dt extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){const{status:i,ctx:d}=this._processInputParams(s);if(d.parsedType!==a.ZodParsedType.object)return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.object,received:d.parsedType}),n.INVALID;const u=[],l=this._def.keyType,v=this._def.valueType;for(const g in d.data)u.push({key:l._parse(new o(d,g,d.path,g)),value:v._parse(new o(d,d.data[g],d.path,g)),alwaysSet:g in d.data});return d.common.async?n.ParseStatus.mergeObjectAsync(i,u):n.ParseStatus.mergeObjectSync(i,u)}get element(){return this._def.valueType}static create(s,i,d){return i instanceof m?new dt({keyType:s,valueType:i,typeName:j.ZodRecord,...h(d)}):new dt({keyType:T.create(),valueType:s,typeName:j.ZodRecord,...h(i)})}}p.ZodRecord=dt;class Pt extends m{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(s){const{status:i,ctx:d}=this._processInputParams(s);if(d.parsedType!==a.ZodParsedType.map)return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.map,received:d.parsedType}),n.INVALID;const u=this._def.keyType,l=this._def.valueType,v=[...d.data.entries()].map(([g,O],A)=>({key:u._parse(new o(d,g,d.path,[A,"key"])),value:l._parse(new o(d,O,d.path,[A,"value"]))}));if(d.common.async){const g=new Map;return Promise.resolve().then(async()=>{for(const O of v){const A=await O.key,D=await O.value;if(A.status==="aborted"||D.status==="aborted")return n.INVALID;(A.status==="dirty"||D.status==="dirty")&&i.dirty(),g.set(A.value,D.value)}return{status:i.value,value:g}})}else{const g=new Map;for(const O of v){const A=O.key,D=O.value;if(A.status==="aborted"||D.status==="aborted")return n.INVALID;(A.status==="dirty"||D.status==="dirty")&&i.dirty(),g.set(A.value,D.value)}return{status:i.value,value:g}}}}p.ZodMap=Pt,Pt.create=(c,s,i)=>new Pt({valueType:s,keyType:c,typeName:j.ZodMap,...h(i)});class Pe extends m{_parse(s){const{status:i,ctx:d}=this._processInputParams(s);if(d.parsedType!==a.ZodParsedType.set)return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.set,received:d.parsedType}),n.INVALID;const u=this._def;u.minSize!==null&&d.data.size<u.minSize.value&&((0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),i.dirty()),u.maxSize!==null&&d.data.size>u.maxSize.value&&((0,n.addIssueToContext)(d,{code:t.ZodIssueCode.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),i.dirty());const l=this._def.valueType;function v(O){const A=new Set;for(const D of O){if(D.status==="aborted")return n.INVALID;D.status==="dirty"&&i.dirty(),A.add(D.value)}return{status:i.value,value:A}}const g=[...d.data.values()].map((O,A)=>l._parse(new o(d,O,d.path,A)));return d.common.async?Promise.all(g).then(O=>v(O)):v(g)}min(s,i){return new Pe({...this._def,minSize:{value:s,message:r.errorUtil.toString(i)}})}max(s,i){return new Pe({...this._def,maxSize:{value:s,message:r.errorUtil.toString(i)}})}size(s,i){return this.min(s,i).max(s,i)}nonempty(s){return this.min(1,s)}}p.ZodSet=Pe,Pe.create=(c,s)=>new Pe({valueType:c,minSize:null,maxSize:null,typeName:j.ZodSet,...h(s)});class We extends m{constructor(){super(...arguments),this.validate=this.implement}_parse(s){const{ctx:i}=this._processInputParams(s);if(i.parsedType!==a.ZodParsedType.function)return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.function,received:i.parsedType}),n.INVALID;function d(g,O){return(0,n.makeIssue)({data:g,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,(0,e.getErrorMap)(),e.defaultErrorMap].filter(A=>!!A),issueData:{code:t.ZodIssueCode.invalid_arguments,argumentsError:O}})}function u(g,O){return(0,n.makeIssue)({data:g,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,(0,e.getErrorMap)(),e.defaultErrorMap].filter(A=>!!A),issueData:{code:t.ZodIssueCode.invalid_return_type,returnTypeError:O}})}const l={errorMap:i.common.contextualErrorMap},v=i.data;if(this._def.returns instanceof Ke){const g=this;return(0,n.OK)(async function(...O){const A=new t.ZodError([]),D=await g._def.args.parseAsync(O,l).catch(Qt=>{throw A.addIssue(d(O,Qt)),A}),ie=await Reflect.apply(v,this,D);return await g._def.returns._def.type.parseAsync(ie,l).catch(Qt=>{throw A.addIssue(u(ie,Qt)),A})})}else{const g=this;return(0,n.OK)(function(...O){const A=g._def.args.safeParse(O,l);if(!A.success)throw new t.ZodError([d(O,A.error)]);const D=Reflect.apply(v,this,A.data),ie=g._def.returns.safeParse(D,l);if(!ie.success)throw new t.ZodError([u(D,ie.error)]);return ie.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...s){return new We({...this._def,args:le.create(s).rest(Ne.create())})}returns(s){return new We({...this._def,returns:s})}implement(s){return this.parse(s)}strictImplement(s){return this.parse(s)}static create(s,i,d){return new We({args:s||le.create([]).rest(Ne.create()),returns:i||Ne.create(),typeName:j.ZodFunction,...h(d)})}}p.ZodFunction=We;class ct extends m{get schema(){return this._def.getter()}_parse(s){const{ctx:i}=this._processInputParams(s);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}p.ZodLazy=ct,ct.create=(c,s)=>new ct({getter:c,typeName:j.ZodLazy,...h(s)});class ut extends m{_parse(s){if(s.data!==this._def.value){const i=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(i,{received:i.data,code:t.ZodIssueCode.invalid_literal,expected:this._def.value}),n.INVALID}return{status:"valid",value:s.data}}get value(){return this._def.value}}p.ZodLiteral=ut,ut.create=(c,s)=>new ut({value:c,typeName:j.ZodLiteral,...h(s)});function Ar(c,s){return new we({values:c,typeName:j.ZodEnum,...h(s)})}class we extends m{_parse(s){if(typeof s.data!="string"){const i=this._getOrReturnCtx(s),d=this._def.values;return(0,n.addIssueToContext)(i,{expected:a.util.joinValues(d),received:i.parsedType,code:t.ZodIssueCode.invalid_type}),n.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(s.data)){const i=this._getOrReturnCtx(s),d=this._def.values;return(0,n.addIssueToContext)(i,{received:i.data,code:t.ZodIssueCode.invalid_enum_value,options:d}),n.INVALID}return(0,n.OK)(s.data)}get options(){return this._def.values}get enum(){const s={};for(const i of this._def.values)s[i]=i;return s}get Values(){const s={};for(const i of this._def.values)s[i]=i;return s}get Enum(){const s={};for(const i of this._def.values)s[i]=i;return s}extract(s,i=this._def){return we.create(s,{...this._def,...i})}exclude(s,i=this._def){return we.create(this.options.filter(d=>!s.includes(d)),{...this._def,...i})}}p.ZodEnum=we,we.create=Ar;class lt extends m{_parse(s){const i=a.util.getValidEnumValues(this._def.values),d=this._getOrReturnCtx(s);if(d.parsedType!==a.ZodParsedType.string&&d.parsedType!==a.ZodParsedType.number){const u=a.util.objectValues(i);return(0,n.addIssueToContext)(d,{expected:a.util.joinValues(u),received:d.parsedType,code:t.ZodIssueCode.invalid_type}),n.INVALID}if(this._cache||(this._cache=new Set(a.util.getValidEnumValues(this._def.values))),!this._cache.has(s.data)){const u=a.util.objectValues(i);return(0,n.addIssueToContext)(d,{received:d.data,code:t.ZodIssueCode.invalid_enum_value,options:u}),n.INVALID}return(0,n.OK)(s.data)}get enum(){return this._def.values}}p.ZodNativeEnum=lt,lt.create=(c,s)=>new lt({values:c,typeName:j.ZodNativeEnum,...h(s)});class Ke extends m{unwrap(){return this._def.type}_parse(s){const{ctx:i}=this._processInputParams(s);if(i.parsedType!==a.ZodParsedType.promise&&i.common.async===!1)return(0,n.addIssueToContext)(i,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.promise,received:i.parsedType}),n.INVALID;const d=i.parsedType===a.ZodParsedType.promise?i.data:Promise.resolve(i.data);return(0,n.OK)(d.then(u=>this._def.type.parseAsync(u,{path:i.path,errorMap:i.common.contextualErrorMap})))}}p.ZodPromise=Ke,Ke.create=(c,s)=>new Ke({type:c,typeName:j.ZodPromise,...h(s)});class ce extends m{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(s){const{status:i,ctx:d}=this._processInputParams(s),u=this._def.effect||null,l={addIssue:v=>{(0,n.addIssueToContext)(d,v),v.fatal?i.abort():i.dirty()},get path(){return d.path}};if(l.addIssue=l.addIssue.bind(l),u.type==="preprocess"){const v=u.transform(d.data,l);if(d.common.async)return Promise.resolve(v).then(async g=>{if(i.value==="aborted")return n.INVALID;const O=await this._def.schema._parseAsync({data:g,path:d.path,parent:d});return O.status==="aborted"?n.INVALID:O.status==="dirty"||i.value==="dirty"?(0,n.DIRTY)(O.value):O});{if(i.value==="aborted")return n.INVALID;const g=this._def.schema._parseSync({data:v,path:d.path,parent:d});return g.status==="aborted"?n.INVALID:g.status==="dirty"||i.value==="dirty"?(0,n.DIRTY)(g.value):g}}if(u.type==="refinement"){const v=g=>{const O=u.refinement(g,l);if(d.common.async)return Promise.resolve(O);if(O instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return g};if(d.common.async===!1){const g=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});return g.status==="aborted"?n.INVALID:(g.status==="dirty"&&i.dirty(),v(g.value),{status:i.value,value:g.value})}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(g=>g.status==="aborted"?n.INVALID:(g.status==="dirty"&&i.dirty(),v(g.value).then(()=>({status:i.value,value:g.value}))))}if(u.type==="transform")if(d.common.async===!1){const v=this._def.schema._parseSync({data:d.data,path:d.path,parent:d});if(!(0,n.isValid)(v))return n.INVALID;const g=u.transform(v.value,l);if(g instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:g}}else return this._def.schema._parseAsync({data:d.data,path:d.path,parent:d}).then(v=>(0,n.isValid)(v)?Promise.resolve(u.transform(v.value,l)).then(g=>({status:i.value,value:g})):n.INVALID);a.util.assertNever(u)}}p.ZodEffects=ce,p.ZodTransformer=ce,ce.create=(c,s,i)=>new ce({schema:c,typeName:j.ZodEffects,effect:s,...h(i)}),ce.createWithPreprocess=(c,s,i)=>new ce({schema:s,effect:{type:"preprocess",transform:c},typeName:j.ZodEffects,...h(i)});class fe extends m{_parse(s){return this._getType(s)===a.ZodParsedType.undefined?(0,n.OK)(void 0):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}p.ZodOptional=fe,fe.create=(c,s)=>new fe({innerType:c,typeName:j.ZodOptional,...h(s)});class Ze extends m{_parse(s){return this._getType(s)===a.ZodParsedType.null?(0,n.OK)(null):this._def.innerType._parse(s)}unwrap(){return this._def.innerType}}p.ZodNullable=Ze,Ze.create=(c,s)=>new Ze({innerType:c,typeName:j.ZodNullable,...h(s)});class ft extends m{_parse(s){const{ctx:i}=this._processInputParams(s);let d=i.data;return i.parsedType===a.ZodParsedType.undefined&&(d=this._def.defaultValue()),this._def.innerType._parse({data:d,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}p.ZodDefault=ft,ft.create=(c,s)=>new ft({innerType:c,typeName:j.ZodDefault,defaultValue:typeof s.default=="function"?s.default:()=>s.default,...h(s)});class ht extends m{_parse(s){const{ctx:i}=this._processInputParams(s),d={...i,common:{...i.common,issues:[]}},u=this._def.innerType._parse({data:d.data,path:d.path,parent:{...d}});return(0,n.isAsync)(u)?u.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new t.ZodError(d.common.issues)},input:d.data})})):{status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new t.ZodError(d.common.issues)},input:d.data})}}removeCatch(){return this._def.innerType}}p.ZodCatch=ht,ht.create=(c,s)=>new ht({innerType:c,typeName:j.ZodCatch,catchValue:typeof s.catch=="function"?s.catch:()=>s.catch,...h(s)});class Et extends m{_parse(s){if(this._getType(s)!==a.ZodParsedType.nan){const d=this._getOrReturnCtx(s);return(0,n.addIssueToContext)(d,{code:t.ZodIssueCode.invalid_type,expected:a.ZodParsedType.nan,received:d.parsedType}),n.INVALID}return{status:"valid",value:s.data}}}p.ZodNaN=Et,Et.create=c=>new Et({typeName:j.ZodNaN,...h(c)}),p.BRAND=Symbol("zod_brand");class Xt extends m{_parse(s){const{ctx:i}=this._processInputParams(s),d=i.data;return this._def.type._parse({data:d,path:i.path,parent:i})}unwrap(){return this._def.type}}p.ZodBranded=Xt;class pt extends m{_parse(s){const{status:i,ctx:d}=this._processInputParams(s);if(d.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:d.data,path:d.path,parent:d});return l.status==="aborted"?n.INVALID:l.status==="dirty"?(i.dirty(),(0,n.DIRTY)(l.value)):this._def.out._parseAsync({data:l.value,path:d.path,parent:d})})();{const u=this._def.in._parseSync({data:d.data,path:d.path,parent:d});return u.status==="aborted"?n.INVALID:u.status==="dirty"?(i.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:d.path,parent:d})}}static create(s,i){return new pt({in:s,out:i,typeName:j.ZodPipeline})}}p.ZodPipeline=pt;class mt extends m{_parse(s){const i=this._def.innerType._parse(s),d=u=>((0,n.isValid)(u)&&(u.value=Object.freeze(u.value)),u);return(0,n.isAsync)(i)?i.then(u=>d(u)):d(i)}unwrap(){return this._def.innerType}}p.ZodReadonly=mt,mt.create=(c,s)=>new mt({innerType:c,typeName:j.ZodReadonly,...h(s)});function jr(c,s){const i=typeof c=="function"?c(s):typeof c=="string"?{message:c}:c;return typeof i=="string"?{message:i}:i}function Sr(c,s={},i){return c?qe.create().superRefine((d,u)=>{const l=c(d);if(l instanceof Promise)return l.then(v=>{if(!v){const g=jr(s,d),O=g.fatal??i??!0;u.addIssue({code:"custom",...g,fatal:O})}});if(!l){const v=jr(s,d),g=v.fatal??i??!0;u.addIssue({code:"custom",...v,fatal:g})}}):qe.create()}p.late={object:z.lazycreate};var j;(function(c){c.ZodString="ZodString",c.ZodNumber="ZodNumber",c.ZodNaN="ZodNaN",c.ZodBigInt="ZodBigInt",c.ZodBoolean="ZodBoolean",c.ZodDate="ZodDate",c.ZodSymbol="ZodSymbol",c.ZodUndefined="ZodUndefined",c.ZodNull="ZodNull",c.ZodAny="ZodAny",c.ZodUnknown="ZodUnknown",c.ZodNever="ZodNever",c.ZodVoid="ZodVoid",c.ZodArray="ZodArray",c.ZodObject="ZodObject",c.ZodUnion="ZodUnion",c.ZodDiscriminatedUnion="ZodDiscriminatedUnion",c.ZodIntersection="ZodIntersection",c.ZodTuple="ZodTuple",c.ZodRecord="ZodRecord",c.ZodMap="ZodMap",c.ZodSet="ZodSet",c.ZodFunction="ZodFunction",c.ZodLazy="ZodLazy",c.ZodLiteral="ZodLiteral",c.ZodEnum="ZodEnum",c.ZodEffects="ZodEffects",c.ZodNativeEnum="ZodNativeEnum",c.ZodOptional="ZodOptional",c.ZodNullable="ZodNullable",c.ZodDefault="ZodDefault",c.ZodCatch="ZodCatch",c.ZodPromise="ZodPromise",c.ZodBranded="ZodBranded",c.ZodPipeline="ZodPipeline",c.ZodReadonly="ZodReadonly"})(j||(p.ZodFirstPartyTypeKind=j={}));const ln=(c,s={message:`Input not instance of ${c.name}`})=>Sr(i=>i instanceof c,s);p.instanceof=ln;const Nr=T.create;p.string=Nr;const Pr=E.create;p.number=Pr;const fn=Et.create;p.nan=fn;const hn=S.create;p.bigint=hn;const Er=K.create;p.boolean=Er;const pn=q.create;p.date=pn;const mn=H.create;p.symbol=mn;const yn=ae.create;p.undefined=yn;const gn=te.create;p.null=gn;const _n=qe.create;p.any=_n;const vn=Ne.create;p.unknown=vn;const bn=me.create;p.never=bn;const xn=St.create;p.void=xn;const Tn=de.create;p.array=Tn;const kn=z.create;p.object=kn;const wn=z.strictCreate;p.strictObject=wn;const Zn=it.create;p.union=Zn;const In=Nt.create;p.discriminatedUnion=In;const Cn=ot.create;p.intersection=Cn;const On=le.create;p.tuple=On;const An=dt.create;p.record=An;const jn=Pt.create;p.map=jn;const Sn=Pe.create;p.set=Sn;const Nn=We.create;p.function=Nn;const Pn=ct.create;p.lazy=Pn;const En=ut.create;p.literal=En;const $n=we.create;p.enum=$n;const Rn=lt.create;p.nativeEnum=Rn;const Dn=Ke.create;p.promise=Dn;const $r=ce.create;p.effect=$r,p.transformer=$r;const Mn=fe.create;p.optional=Mn;const Ln=Ze.create;p.nullable=Ln;const Vn=ce.createWithPreprocess;p.preprocess=Vn;const Un=pt.create;p.pipeline=Un;const Bn=()=>Nr().optional();p.ostring=Bn;const Fn=()=>Pr().optional();p.onumber=Fn;const qn=()=>Er().optional();return p.oboolean=qn,p.coerce={string:(c=>T.create({...c,coerce:!0})),number:(c=>E.create({...c,coerce:!0})),boolean:(c=>K.create({...c,coerce:!0})),bigint:(c=>S.create({...c,coerce:!0})),date:(c=>q.create({...c,coerce:!0}))},p.NEVER=n.INVALID,p}var Wr;function Kr(){return Wr||(Wr=1,(function(t){var e=Re&&Re.__createBinding||(Object.create?(function(n,a,o,f){f===void 0&&(f=o);var h=Object.getOwnPropertyDescriptor(a,o);(!h||("get"in h?!a.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(n,f,h)}):(function(n,a,o,f){f===void 0&&(f=o),n[f]=a[o]})),r=Re&&Re.__exportStar||function(n,a){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,n,o)};Object.defineProperty(t,"__esModule",{value:!0}),r(gr(),t),r(Es(),t),r(Wn(),t),r(Ft(),t),r(Gn(),t),r(yr(),t)})(Re)),Re}var Gr;function Hn(){return Gr||(Gr=1,(function(t){var e=ue&&ue.__createBinding||(Object.create?(function(f,h,m,y){y===void 0&&(y=m);var k=Object.getOwnPropertyDescriptor(h,m);(!k||("get"in k?!h.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return h[m]}}),Object.defineProperty(f,y,k)}):(function(f,h,m,y){y===void 0&&(y=m),f[y]=h[m]})),r=ue&&ue.__setModuleDefault||(Object.create?(function(f,h){Object.defineProperty(f,"default",{enumerable:!0,value:h})}):function(f,h){f.default=h}),n=ue&&ue.__importStar||function(f){if(f&&f.__esModule)return f;var h={};if(f!=null)for(var m in f)m!=="default"&&Object.prototype.hasOwnProperty.call(f,m)&&e(h,f,m);return r(h,f),h},a=ue&&ue.__exportStar||function(f,h){for(var m in f)m!=="default"&&!Object.prototype.hasOwnProperty.call(h,m)&&e(h,f,m)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const o=n(Kr());t.z=o,a(Kr(),t),t.default=o})(ue)),ue}var Hr;function $s(){if(Hr)return $e;Hr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.generateSchema=$e.extendApi=void 0;const t=zn(),e=Hn();function r(_,b={}){const T=_.constructor,w=new T(_._def);return w.metaOpenApi=Object.assign({},_.metaOpenApi||{},b),w}$e.extendApi=r;function n({zodRef:_,useOutput:b,hideDefinitions:T,openApiVersion:w}){return Object.keys(_.shape).filter(S=>(T==null?void 0:T.includes(S))===!1).reduce((S,K)=>Object.assign(Object.assign({},S),{[K]:Y(_.shape[K],b,w)}),{})}function a(_,b){return b==="3.0"?_:[_]}function o({zodRef:_,schemas:b,useOutput:T,openApiVersion:w}){const E=Y(_._def.schema,T,w);let S="undefined";if(T&&_._def.effect){const q=_._def.effect.type==="transform"?_._def.effect:null;if(q&&"transform"in q)try{const H=Array.isArray(E.type)?E.type[0]:E.type;S=typeof q.transform(["integer","number"].includes(`${H}`)?0:H==="string"?"":H==="boolean"?!1:H==="object"?{}:H==="null"?null:H==="array"?[]:void 0,{addIssue:()=>{},path:[]})}catch{}}const K=S;return(0,t.default)(Object.assign(Object.assign(Object.assign({},_.description?{description:_.description}:{}),E),["number","string","boolean","null"].includes(S)?{type:a(K,w)}:{}),...b)}function f({zodRef:_,schemas:b,openApiVersion:T}){const w={type:a("string",T)},{checks:E=[]}=_._def;return E.forEach(S=>{switch(S.kind){case"email":w.format="email";break;case"uuid":w.format="uuid";break;case"cuid":w.format="cuid";break;case"url":w.format="uri";break;case"datetime":w.format="date-time";break;case"length":w.minLength=S.value,w.maxLength=S.value;break;case"max":w.maxLength=S.value;break;case"min":w.minLength=S.value;break;case"regex":w.pattern=S.regex.source;break}}),(0,t.default)(w,_.description?{description:_.description}:{},...b)}function h({zodRef:_,schemas:b,openApiVersion:T}){const w={type:a("number",T)},{checks:E=[]}=_._def;return E.forEach(S=>{switch(S.kind){case"max":(S.inclusive||T==="3.0")&&(w.maximum=S.value),S.inclusive||(T==="3.0"?w.exclusiveMaximum=!0:w.exclusiveMaximum=S.value);break;case"min":(S.inclusive||T==="3.0")&&(w.minimum=S.value),S.inclusive||(T==="3.0"?w.exclusiveMinimum=!0:w.exclusiveMinimum=S.value);break;case"int":w.type=a("integer",T);break;case"multipleOf":w.multipleOf=S.value;break}}),(0,t.default)(w,_.description?{description:_.description}:{},...b)}function m(_){const b=[];for(const T of _)Array.isArray(T.hideDefinitions)&&b.push(...T.hideDefinitions);return b}function y({zodRef:_,schemas:b,useOutput:T,hideDefinitions:w,openApiVersion:E}){var S;let K;_._def.catchall instanceof e.z.ZodNever||((S=_._def.catchall)===null||S===void 0?void 0:S._def.typeName)==="ZodNever"?_._def.unknownKeys==="passthrough"?K=!0:_._def.unknownKeys==="strict"&&(K=!1):K=Y(_._def.catchall,T,E),K=K!=null?{additionalProperties:K}:{};const q=Object.keys(_.shape).filter(ae=>{const te=_.shape[ae];return!(te.isOptional()||te instanceof e.z.ZodDefault||te._def.typeName==="ZodDefault")&&!(te instanceof e.z.ZodNever||te._def.typeName==="ZodDefault")}),H=q.length>0?{required:q}:{};return(0,t.default)(Object.assign(Object.assign(Object.assign({type:a("object",E),properties:n({zodRef:_,useOutput:T,hideDefinitions:m(b),openApiVersion:E})},H),K),w),_.description?{description:_.description,hideDefinitions:w}:{},...b)}function k({zodRef:_,schemas:b,useOutput:T,openApiVersion:w}){return(0,t.default)({type:a("object",w),additionalProperties:_._def.valueType instanceof e.z.ZodUnknown?{}:Y(_._def.valueType,T,w)},_.description?{description:_.description}:{},...b)}function F({zodRef:_,schemas:b,openApiVersion:T}){return(0,t.default)({type:a("integer",T),format:"int64"},_.description?{description:_.description}:{},...b)}function J({zodRef:_,schemas:b,openApiVersion:T}){return(0,t.default)({type:a("boolean",T)},_.description?{description:_.description}:{},...b)}function $({zodRef:_,schemas:b,openApiVersion:T}){return(0,t.default)({type:a("string",T),format:"date-time"},_.description?{description:_.description}:{},...b)}function B({zodRef:_,schemas:b,openApiVersion:T}){return(0,t.default)(T==="3.0"?{type:"null"}:{type:["string","null"],enum:["null"]},_.description?{description:_.description}:{},...b)}function ee({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)(Y(b.unwrap(),T,w),b.description?{description:b.description}:{},..._)}function X({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){const E=Y(b.unwrap(),T,w);return(0,t.default)(E,w==="3.0"?{nullable:!0}:{type:a("null",w)},b.description?{description:b.description}:{},..._)}function W({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)(Object.assign({default:b._def.defaultValue()},Y(b._def.innerType,T,w)),b.description?{description:b.description}:{},..._)}function Q({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){const E={};return b._def.exactLength!=null&&(E.minItems=b._def.exactLength.value,E.maxItems=b._def.exactLength.value),b._def.minLength!=null&&(E.minItems=b._def.minLength.value),b._def.maxLength!=null&&(E.maxItems=b._def.maxLength.value),(0,t.default)(Object.assign({type:a("array",w),items:Y(b.element,T,w)},E),b.description?{description:b.description}:{},..._)}function ne({schemas:_,zodRef:b,openApiVersion:T}){const w=typeof b._def.value;return(0,t.default)({type:a(w,T),enum:[b._def.value]},b.description?{description:b.description}:{},..._)}function ke({schemas:_,zodRef:b,openApiVersion:T}){const w=typeof Object.values(b._def.values)[0];return(0,t.default)({type:a(w,T),enum:Object.values(b._def.values)},b.description?{description:b.description}:{},..._)}function nt({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)({allOf:[Y(b._def.left,T,w),Y(b._def.right,T,w)]},b.description?{description:b.description}:{},..._)}function Se({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){const E=b._def.options;if(E.reduce((q,H)=>q&&H._def.typeName==="ZodLiteral",!0)){const q=E,H=q.reduce((ae,te)=>!ae||ae===typeof te._def.value?typeof te._def.value:null,null);if(H)return(0,t.default)({type:a(H,w),enum:q.map(ae=>ae._def.value)},b.description?{description:b.description}:{},..._)}const S=w==="3.0"?E.filter(q=>q._def.typeName!=="ZodNull"):E,K=E.length!=S.length;return(0,t.default)({oneOf:S.map(q=>Y(q,T,w))},K?{nullable:!0}:{},b.description?{description:b.description}:{},..._)}function Gt({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)({discriminator:{propertyName:b._def.discriminator},oneOf:Array.from(b._def.options.values()).map(E=>Y(E,T,w))},b.description?{description:b.description}:{},..._)}function Ht({zodRef:_,schemas:b}){return(0,t.default)({readOnly:!0},_.description?{description:_.description}:{},...b)}function At({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)(Y(b._def.type,T,w),..._)}function re({zodRef:_,schemas:b}){return(0,t.default)(_.description?{description:_.description}:{},...b)}function jt({schemas:_,zodRef:b,useOutput:T,openApiVersion:w}){return(0,t.default)(Y(T?b._def.out:b._def.in,T,w),..._)}function Yt({zodRef:_,useOutput:b,schemas:T,openApiVersion:w}){return(0,t.default)(Y(_._def.innerType,b,w),_.description?{description:_.description}:{},...T)}const at={ZodObject:y,ZodRecord:k,ZodString:f,ZodNumber:h,ZodBigInt:F,ZodBoolean:J,ZodDate:$,ZodNull:B,ZodOptional:ee,ZodNullable:X,ZodDefault:W,ZodArray:Q,ZodLiteral:ne,ZodEnum:ke,ZodNativeEnum:ke,ZodTransformer:o,ZodEffects:o,ZodIntersection:nt,ZodUnion:Se,ZodDiscriminatedUnion:Gt,ZodNever:Ht,ZodBranded:At,ZodUndefined:re,ZodTuple:re,ZodMap:re,ZodFunction:re,ZodLazy:re,ZodPromise:re,ZodAny:re,ZodUnknown:re,ZodVoid:re,ZodPipeline:jt,ZodReadonly:Yt};function Y(_,b=!1,T="3.1"){const{metaOpenApi:w={}}=_,E=[...Array.isArray(w)?w:[w]];try{const S=_._def.typeName;return S in at?at[S]({zodRef:_,schemas:E,useOutput:b,openApiVersion:T}):re({zodRef:_,schemas:E,openApiVersion:T})}catch(S){return console.error(S),re({zodRef:_,schemas:E})}}return $e.generateSchema=Y,$e}var _t={},Yr;function Yn(){if(Yr)return _t;Yr=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.extendZodWithOpenApi=void 0;const t=$s();function e(r,n=!1){!n&&typeof r.ZodSchema.prototype.openapi<"u"||(r.ZodSchema.prototype.openapi=function(a){return(0,t.extendApi)(this,a)})}return _t.extendZodWithOpenApi=e,_t}var Jr;function Jn(){return Jr||(Jr=1,(function(t){var e=Ee&&Ee.__createBinding||(Object.create?(function(n,a,o,f){f===void 0&&(f=o);var h=Object.getOwnPropertyDescriptor(a,o);(!h||("get"in h?!a.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(n,f,h)}):(function(n,a,o,f){f===void 0&&(f=o),n[f]=a[o]})),r=Ee&&Ee.__exportStar||function(n,a){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,n,o)};Object.defineProperty(t,"__esModule",{value:!0}),r($s(),t),r(Yn(),t)})(Ee)),Ee}var Xn=Jn(),Rs=typeof global=="object"&&global&&global.Object===Object&&global,Qn=typeof self=="object"&&self&&self.Object===Object&&self,pe=Rs||Qn||Function("return this")(),He=pe.Symbol,Ds=Object.prototype,ea=Ds.hasOwnProperty,ta=Ds.toString,vt=He?He.toStringTag:void 0;function ra(t){var e=ea.call(t,vt),r=t[vt];try{t[vt]=void 0;var n=!0}catch{}var a=ta.call(t);return n&&(e?t[vt]=r:delete t[vt]),a}var sa=Object.prototype,na=sa.toString;function aa(t){return na.call(t)}var ia="[object Null]",oa="[object Undefined]",Xr=He?He.toStringTag:void 0;function Ct(t){return t==null?t===void 0?oa:ia:Xr&&Xr in Object(t)?ra(t):aa(t)}function Ot(t){return t!=null&&typeof t=="object"}var qt=Array.isArray;function zt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var da="[object AsyncFunction]",ca="[object Function]",ua="[object GeneratorFunction]",la="[object Proxy]";function Ms(t){if(!zt(t))return!1;var e=Ct(t);return e==ca||e==ua||e==da||e==la}var rr=pe["__core-js_shared__"],Qr=(function(){var t=/[^.]+$/.exec(rr&&rr.keys&&rr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function fa(t){return!!Qr&&Qr in t}var ha=Function.prototype,pa=ha.toString;function Be(t){if(t!=null){try{return pa.call(t)}catch{}try{return t+""}catch{}}return""}var ma=/[\\^$.*+?()[\]{}|]/g,ya=/^\[object .+?Constructor\]$/,ga=Function.prototype,_a=Object.prototype,va=ga.toString,ba=_a.hasOwnProperty,xa=RegExp("^"+va.call(ba).replace(ma,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ta(t){if(!zt(t)||fa(t))return!1;var e=Ms(t)?xa:ya;return e.test(Be(t))}function ka(t,e){return t==null?void 0:t[e]}function Fe(t,e){var r=ka(t,e);return Ta(r)?r:void 0}var ar=Fe(pe,"WeakMap"),es=Object.create,wa=(function(){function t(){}return function(e){if(!zt(e))return{};if(es)return es(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),ts=(function(){try{var t=Fe(Object,"defineProperty");return t({},"",{}),t}catch{}})();function Za(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var Ia=9007199254740991,Ca=/^(?:0|[1-9]\d*)$/;function Oa(t,e){var r=typeof t;return e=e??Ia,!!e&&(r=="number"||r!="symbol"&&Ca.test(t))&&t>-1&&t%1==0&&t<e}function Aa(t,e,r){e=="__proto__"&&ts?ts(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Ls(t,e){return t===e||t!==t&&e!==e}var ja=Object.prototype,Sa=ja.hasOwnProperty;function Na(t,e,r){var n=t[e];(!(Sa.call(t,e)&&Ls(n,r))||r===void 0&&!(e in t))&&Aa(t,e,r)}var Pa=9007199254740991;function Vs(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Pa}function Ea(t){return t!=null&&Vs(t.length)&&!Ms(t)}var $a=Object.prototype;function Us(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||$a;return t===r}function Ra(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Da="[object Arguments]";function rs(t){return Ot(t)&&Ct(t)==Da}var Bs=Object.prototype,Ma=Bs.hasOwnProperty,La=Bs.propertyIsEnumerable,Va=rs((function(){return arguments})())?rs:function(t){return Ot(t)&&Ma.call(t,"callee")&&!La.call(t,"callee")};function Ua(){return!1}var Fs=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ss=Fs&&typeof module=="object"&&module&&!module.nodeType&&module,Ba=ss&&ss.exports===Fs,ns=Ba?pe.Buffer:void 0,Fa=ns?ns.isBuffer:void 0,qs=Fa||Ua,qa="[object Arguments]",za="[object Array]",Wa="[object Boolean]",Ka="[object Date]",Ga="[object Error]",Ha="[object Function]",Ya="[object Map]",Ja="[object Number]",Xa="[object Object]",Qa="[object RegExp]",ei="[object Set]",ti="[object String]",ri="[object WeakMap]",si="[object ArrayBuffer]",ni="[object DataView]",ai="[object Float32Array]",ii="[object Float64Array]",oi="[object Int8Array]",di="[object Int16Array]",ci="[object Int32Array]",ui="[object Uint8Array]",li="[object Uint8ClampedArray]",fi="[object Uint16Array]",hi="[object Uint32Array]",U={};U[ai]=U[ii]=U[oi]=U[di]=U[ci]=U[ui]=U[li]=U[fi]=U[hi]=!0;U[qa]=U[za]=U[si]=U[Wa]=U[ni]=U[Ka]=U[Ga]=U[Ha]=U[Ya]=U[Ja]=U[Xa]=U[Qa]=U[ei]=U[ti]=U[ri]=!1;function pi(t){return Ot(t)&&Vs(t.length)&&!!U[Ct(t)]}function _r(t){return function(e){return t(e)}}var zs=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xt=zs&&typeof module=="object"&&module&&!module.nodeType&&module,mi=xt&&xt.exports===zs,sr=mi&&Rs.process,Ye=(function(){try{var t=xt&&xt.require&&xt.require("util").types;return t||sr&&sr.binding&&sr.binding("util")}catch{}})(),as=Ye&&Ye.isTypedArray,yi=as?_r(as):pi,gi=Object.prototype,_i=gi.hasOwnProperty;function vi(t,e){var r=qt(t),n=!r&&Va(t),a=!r&&!n&&qs(t),o=!r&&!n&&!a&&yi(t),f=r||n||a||o,h=f?Ra(t.length,String):[],m=h.length;for(var y in t)_i.call(t,y)&&!(f&&(y=="length"||a&&(y=="offset"||y=="parent")||o&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||Oa(y,m)))&&h.push(y);return h}function Ws(t,e){return function(r){return t(e(r))}}var bi=Ws(Object.keys,Object),xi=Object.prototype,Ti=xi.hasOwnProperty;function ki(t){if(!Us(t))return bi(t);var e=[];for(var r in Object(t))Ti.call(t,r)&&r!="constructor"&&e.push(r);return e}function wi(t){return Ea(t)?vi(t):ki(t)}var kt=Fe(Object,"create");function Zi(){this.__data__=kt?kt(null):{},this.size=0}function Ii(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ci="__lodash_hash_undefined__",Oi=Object.prototype,Ai=Oi.hasOwnProperty;function ji(t){var e=this.__data__;if(kt){var r=e[t];return r===Ci?void 0:r}return Ai.call(e,t)?e[t]:void 0}var Si=Object.prototype,Ni=Si.hasOwnProperty;function Pi(t){var e=this.__data__;return kt?e[t]!==void 0:Ni.call(e,t)}var Ei="__lodash_hash_undefined__";function $i(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kt&&e===void 0?Ei:e,this}function Me(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])}}Me.prototype.clear=Zi;Me.prototype.delete=Ii;Me.prototype.get=ji;Me.prototype.has=Pi;Me.prototype.set=$i;function Ri(){this.__data__=[],this.size=0}function Wt(t,e){for(var r=t.length;r--;)if(Ls(t[r][0],e))return r;return-1}var Di=Array.prototype,Mi=Di.splice;function Li(t){var e=this.__data__,r=Wt(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():Mi.call(e,r,1),--this.size,!0}function Vi(t){var e=this.__data__,r=Wt(e,t);return r<0?void 0:e[r][1]}function Ui(t){return Wt(this.__data__,t)>-1}function Bi(t,e){var r=this.__data__,n=Wt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function Te(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])}}Te.prototype.clear=Ri;Te.prototype.delete=Li;Te.prototype.get=Vi;Te.prototype.has=Ui;Te.prototype.set=Bi;var wt=Fe(pe,"Map");function Fi(){this.size=0,this.__data__={hash:new Me,map:new(wt||Te),string:new Me}}function qi(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Kt(t,e){var r=t.__data__;return qi(e)?r[typeof e=="string"?"string":"hash"]:r.map}function zi(t){var e=Kt(this,t).delete(t);return this.size-=e?1:0,e}function Wi(t){return Kt(this,t).get(t)}function Ki(t){return Kt(this,t).has(t)}function Gi(t,e){var r=Kt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function rt(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])}}rt.prototype.clear=Fi;rt.prototype.delete=zi;rt.prototype.get=Wi;rt.prototype.has=Ki;rt.prototype.set=Gi;function Hi(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}var Yi=Ws(Object.getPrototypeOf,Object);function Ji(){this.__data__=new Te,this.size=0}function Xi(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function Qi(t){return this.__data__.get(t)}function eo(t){return this.__data__.has(t)}var to=200;function ro(t,e){var r=this.__data__;if(r instanceof Te){var n=r.__data__;if(!wt||n.length<to-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new rt(n)}return r.set(t,e),this.size=r.size,this}function st(t){var e=this.__data__=new Te(t);this.size=e.size}st.prototype.clear=Ji;st.prototype.delete=Xi;st.prototype.get=Qi;st.prototype.has=eo;st.prototype.set=ro;var Ks=typeof exports=="object"&&exports&&!exports.nodeType&&exports,is=Ks&&typeof module=="object"&&module&&!module.nodeType&&module,so=is&&is.exports===Ks,os=so?pe.Buffer:void 0;os&&os.allocUnsafe;function no(t,e){return t.slice()}function ao(t,e){for(var r=-1,n=t==null?0:t.length,a=0,o=[];++r<n;){var f=t[r];e(f,r,t)&&(o[a++]=f)}return o}function io(){return[]}var oo=Object.prototype,co=oo.propertyIsEnumerable,ds=Object.getOwnPropertySymbols,uo=ds?function(t){return t==null?[]:(t=Object(t),ao(ds(t),function(e){return co.call(t,e)}))}:io;function lo(t,e,r){var n=e(t);return qt(t)?n:Hi(n,r(t))}function fo(t){return lo(t,wi,uo)}var ir=Fe(pe,"DataView"),or=Fe(pe,"Promise"),dr=Fe(pe,"Set"),cs="[object Map]",ho="[object Object]",us="[object Promise]",ls="[object Set]",fs="[object WeakMap]",hs="[object DataView]",po=Be(ir),mo=Be(wt),yo=Be(or),go=Be(dr),_o=Be(ar),ve=Ct;(ir&&ve(new ir(new ArrayBuffer(1)))!=hs||wt&&ve(new wt)!=cs||or&&ve(or.resolve())!=us||dr&&ve(new dr)!=ls||ar&&ve(new ar)!=fs)&&(ve=function(t){var e=Ct(t),r=e==ho?t.constructor:void 0,n=r?Be(r):"";if(n)switch(n){case po:return hs;case mo:return cs;case yo:return us;case go:return ls;case _o:return fs}return e});var vo=Object.prototype,bo=vo.hasOwnProperty;function xo(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&bo.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var ps=pe.Uint8Array;function vr(t){var e=new t.constructor(t.byteLength);return new ps(e).set(new ps(t)),e}function To(t,e){var r=vr(t.buffer);return new t.constructor(r,t.byteOffset,t.byteLength)}var ko=/\w*$/;function wo(t){var e=new t.constructor(t.source,ko.exec(t));return e.lastIndex=t.lastIndex,e}var ms=He?He.prototype:void 0,ys=ms?ms.valueOf:void 0;function Zo(t){return ys?Object(ys.call(t)):{}}function Io(t,e){var r=vr(t.buffer);return new t.constructor(r,t.byteOffset,t.length)}var Co="[object Boolean]",Oo="[object Date]",Ao="[object Map]",jo="[object Number]",So="[object RegExp]",No="[object Set]",Po="[object String]",Eo="[object Symbol]",$o="[object ArrayBuffer]",Ro="[object DataView]",Do="[object Float32Array]",Mo="[object Float64Array]",Lo="[object Int8Array]",Vo="[object Int16Array]",Uo="[object Int32Array]",Bo="[object Uint8Array]",Fo="[object Uint8ClampedArray]",qo="[object Uint16Array]",zo="[object Uint32Array]";function Wo(t,e,r){var n=t.constructor;switch(e){case $o:return vr(t);case Co:case Oo:return new n(+t);case Ro:return To(t);case Do:case Mo:case Lo:case Vo:case Uo:case Bo:case Fo:case qo:case zo:return Io(t);case Ao:return new n;case jo:case Po:return new n(t);case So:return wo(t);case No:return new n;case Eo:return Zo(t)}}function Ko(t){return typeof t.constructor=="function"&&!Us(t)?wa(Yi(t)):{}}var Go="[object Map]";function Ho(t){return Ot(t)&&ve(t)==Go}var gs=Ye&&Ye.isMap,Yo=gs?_r(gs):Ho,Jo="[object Set]";function Xo(t){return Ot(t)&&ve(t)==Jo}var _s=Ye&&Ye.isSet,Qo=_s?_r(_s):Xo,Gs="[object Arguments]",ed="[object Array]",td="[object Boolean]",rd="[object Date]",sd="[object Error]",Hs="[object Function]",nd="[object GeneratorFunction]",ad="[object Map]",id="[object Number]",Ys="[object Object]",od="[object RegExp]",dd="[object Set]",cd="[object String]",ud="[object Symbol]",ld="[object WeakMap]",fd="[object ArrayBuffer]",hd="[object DataView]",pd="[object Float32Array]",md="[object Float64Array]",yd="[object Int8Array]",gd="[object Int16Array]",_d="[object Int32Array]",vd="[object Uint8Array]",bd="[object Uint8ClampedArray]",xd="[object Uint16Array]",Td="[object Uint32Array]",V={};V[Gs]=V[ed]=V[fd]=V[hd]=V[td]=V[rd]=V[pd]=V[md]=V[yd]=V[gd]=V[_d]=V[ad]=V[id]=V[Ys]=V[od]=V[dd]=V[cd]=V[ud]=V[vd]=V[bd]=V[xd]=V[Td]=!0;V[sd]=V[Hs]=V[ld]=!1;function Dt(t,e,r,n,a,o){var f;if(f!==void 0)return f;if(!zt(t))return t;var h=qt(t);if(h)f=xo(t);else{var m=ve(t),y=m==Hs||m==nd;if(qs(t))return no(t);if(m==Ys||m==Gs||y&&!a)f=y?{}:Ko(t);else{if(!V[m])return a?t:{};f=Wo(t,m)}}o||(o=new st);var k=o.get(t);if(k)return k;o.set(t,f),Qo(t)?t.forEach(function($){f.add(Dt($,e,r,$,t,o))}):Yo(t)&&t.forEach(function($,B){f.set(B,Dt($,e,r,B,t,o))});var F=fo,J=h?void 0:F(t);return Za(J||t,function($,B){J&&(B=$,$=t[B]),Na(f,B,Dt($,e,r,B,t,o))}),f}var kd=1,wd=4;function Zd(t){return Dt(t,kd|wd)}var Js=(t=>(t.xs="xs",t.sm="sm",t.lg="lg",t.xl="xl",t))(Js||{});const Id=t=>{const e=t.dtoSchema,r={...Xn.generateSchema(e),additionalProperties:!0,$schema:"http://json-schema.org/draft-07/schema#"},n=Zd(t.jsonSchema);return n.required=[],{dtoSchema:e,responseSchema:t.responseSchema??e,schema:{form:{uiSchema:t.uiSchema,schema:r,modalSize:t.modalSize??"sm"},table:t.tableSchema?{uiSchema:t.tableSchema,schema:t.jsonSchema}:void 0,filter:t.filterSchema?{uiSchema:t.filterSchema,schema:n}:void 0,uri:t.uri,searchUri:t.searchUri??`${t.uri}?filter=`}}},Xs=(t,e)=>{var a,o;if(!t.scope)return{id:null,property:null};const r=(a=t.scope)==null?void 0:a.substring(13),n=((o=e==null?void 0:e.properties)==null?void 0:o[r])??{};return{id:r,property:n}},Cd=(t,e)=>{const{id:r,property:n}=Xs(t,e);return{...t,id:r,label:r,...n}};class br{constructor(e){this.type=e}}class xr extends br{constructor(){super(...arguments),this.elements=[]}addControl(e){return this.elements.push(e),this}addControls(...e){return this.elements.push(...e),this}buildElements(){return this.elements.map(e=>e.build())}}class De extends xr{constructor(e,r={}){super(e),this.options=r}static horizontal(){return new De("HorizontalLayout")}static stepper(e=!1){return new De("Categorization",{variant:"stepper",showNavButtons:!e})}static table(){return new De("table")}static vertical(){return new De("VerticalLayout")}build(){return{type:this.type,elements:this.buildElements(),options:this.options}}}class Tr extends br{constructor(e,r="TextCell"){super(r),this.scope=e}static properties(e){return new Tr(`#/properties/${e}`)}key(e){return this.options={format:"keyValue",key:e},this}setSortId(e){return this.options={...this.options??{format:"TextCell"},sortId:e},this}build(){return{type:this.type,scope:this.scope,options:this.options}}}class kr{constructor(){this.builder=De.table()}static init(){return new kr}addControl(e){return this.builder.addControls(e),this}addControls(...e){return this.builder.addControls(...e),this}build(){return this.builder.build()}}const Ie={number:"number",string:"string",integer:"Integer",autocomplete:"autocomplete",textArea:"textArea",markdown:"markdown",fixedArray:"fixedArray",array:"array",custom:"custom"};class Tt extends br{constructor(e,r="Control"){super(r),this.scope=e,this.options={format:"Control",styles:{control:{wrapper:"w-full"}}}}static asObject(e){return new Tt(`#/properties/${e}`,"Object")}static properties(e){return new Tt(`#/properties/${e}`)}static asCustom(e,r){const n=new Tt(`#/properties/${e}`);return n.options={format:Ie.custom,type:r},n}detail(e,r){return this._detail=e,this.options={...this.options??{},format:Ie.array,elementLabelProp:r},this}addAction(e){var n;const r=((n=this.options)==null?void 0:n.actions)??[];return r.push(e),this.options={...this.options??{},actions:r},this}detailFixed(e,r){return this._detail=e,this.options={...this.options??{},format:Ie.fixedArray,elementLabelProp:r},this}labelKey(e){return this.options={...this.options??{},labelKey:e},this}readonly(){return this.options={format:Ie.string,readonly:!0},this}markdown(){return this.options={format:Ie.markdown},this}textArea(e){return this.options={format:Ie.textArea,...e??{}},this}autocomplete(e){return this.options={format:Ie.autocomplete,dataField:"data",...e},this}width(e){var n;const r={xs:"w-12",sm:"w-24",md:"w-36",lg:"w-48",xl:"w-64"};return this.options={...this.options,styles:{...(n=this.options)==null?void 0:n.styles,control:{wrapper:r[e]??r.sm}}},this}build(){var e;return{type:this.type,scope:this.scope,options:{...this.options,detail:this._detail?(e=this._detail)==null?void 0:e.build():void 0}}}}class wr extends xr{constructor(e){super(e),this.label=e,this.rule={effect:"SHOW",condition:{}}}static label(e){return new wr(e)}build(){return{type:"Category",label:this.label,rule:this.rule,elements:this.buildElements()}}}class Zr extends xr{constructor(e){super(e),this.label=e}static label(e){return new Zr(e)}build(){return{type:"Group",label:this.label,elements:this.buildElements()}}}var L;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const o={};for(const f of a)o[f]=f;return o},t.getValidEnumValues=a=>{const o=t.objectKeys(a).filter(h=>typeof a[a[h]]!="number"),f={};for(const h of o)f[h]=a[h];return t.objectValues(f)},t.objectValues=a=>t.objectKeys(a).map(function(o){return a[o]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const o=[];for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&o.push(f);return o},t.find=(a,o)=>{for(const f of a)if(o(f))return f},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,o=" | "){return a.map(f=>typeof f=="string"?`'${f}'`:f).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(a,o)=>typeof o=="bigint"?o.toString():o})(L||(L={}));var vs;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(vs||(vs={}));const I=L.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ce=t=>{switch(typeof t){case"undefined":return I.undefined;case"string":return I.string;case"number":return Number.isNaN(t)?I.nan:I.number;case"boolean":return I.boolean;case"function":return I.function;case"bigint":return I.bigint;case"symbol":return I.symbol;case"object":return Array.isArray(t)?I.array:t===null?I.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?I.promise:typeof Map<"u"&&t instanceof Map?I.map:typeof Set<"u"&&t instanceof Set?I.set:typeof Date<"u"&&t instanceof Date?I.date:I.object;default:return I.unknown}},x=L.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"]);class xe 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 r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(o){return o.message},n={_errors:[]},a=o=>{for(const f of o.issues)if(f.code==="invalid_union")f.unionErrors.map(a);else if(f.code==="invalid_return_type")a(f.returnTypeError);else if(f.code==="invalid_arguments")a(f.argumentsError);else if(f.path.length===0)n._errors.push(r(f));else{let h=n,m=0;for(;m<f.path.length;){const y=f.path[m];m===f.path.length-1?(h[y]=h[y]||{_errors:[]},h[y]._errors.push(r(f))):h[y]=h[y]||{_errors:[]},h=h[y],m++}}};return a(this),n}static assert(e){if(!(e instanceof xe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,L.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const o=a.path[0];r[o]=r[o]||[],r[o].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}xe.create=t=>new xe(t);const cr=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===I.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,L.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:r=`Unrecognized key(s) in object: ${L.joinValues(t.keys,", ")}`;break;case x.invalid_union:r="Invalid input";break;case x.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${L.joinValues(t.options)}`;break;case x.invalid_enum_value:r=`Invalid enum value. Expected ${L.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:r="Invalid function arguments";break;case x.invalid_return_type:r="Invalid function return type";break;case x.invalid_date:r="Invalid date";break;case x.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}"`:L.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case x.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==="bigint"?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 x.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 x.custom:r="Invalid input";break;case x.invalid_intersection_types:r="Intersection results could not be merged";break;case x.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:r="Number must be finite";break;default:r=e.defaultError,L.assertNever(t)}return{message:r}};let Od=cr;function Ad(){return Od}const jd=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,o=[...r,...a.path||[]],f={...a,path:o};if(a.message!==void 0)return{...a,path:o,message:a.message};let h="";const m=n.filter(y=>!!y).slice().reverse();for(const y of m)h=y(f,{data:e,defaultError:h}).message;return{...a,path:o,message:h}};function Z(t,e){const r=Ad(),n=jd({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===cr?void 0:cr].filter(a=>!!a)});t.common.issues.push(n)}class se{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return N;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const o=await a.key,f=await a.value;n.push({key:o,value:f})}return se.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:o,value:f}=a;if(o.status==="aborted"||f.status==="aborted")return N;o.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof f.value<"u"||a.alwaysSet)&&(n[o.value]=f.value)}return{status:e.value,value:n}}}const N=Object.freeze({status:"aborted"}),bt=t=>({status:"dirty",value:t}),oe=t=>({status:"valid",value:t}),bs=t=>t.status==="aborted",xs=t=>t.status==="dirty",Je=t=>t.status==="valid",Mt=t=>typeof Promise<"u"&&t instanceof Promise;var C;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(C||(C={}));class Ae{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||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Ts=(t,e)=>{if(Je(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;const r=new xe(t.common.issues);return this._error=r,this._error}}};function R(t){if(!t)return{};const{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}:{errorMap:(f,h)=>{const{message:m}=t;return f.code==="invalid_enum_value"?{message:m??h.defaultError}:typeof h.data>"u"?{message:m??n??h.defaultError}:f.code!=="invalid_type"?{message:h.defaultError}:{message:m??r??h.defaultError}},description:a}}class M{get description(){return this._def.description}_getType(e){return Ce(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new se,ctx:{common:e.parent.common,data:e.data,parsedType:Ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Mt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Ts(n,a)}"~validate"(e){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)};if(!this["~standard"].async)try{const o=this._parseSync({data:e,path:[],parent:r});return Je(o)?{value:o.value}:{issues:r.common.issues}}catch(o){(a=(n=o==null?void 0:o.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(o=>Je(o)?{value:o.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ce(e)},a=this._parse({data:e,path:n.path,parent:n}),o=await(Mt(a)?a:Promise.resolve(a));return Ts(n,o)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,o)=>{const f=e(a),h=()=>o.addIssue({code:x.custom,...n(a)});return typeof Promise<"u"&&f instanceof Promise?f.then(m=>m?!0:(h(),!1)):f?!0:(h(),!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 et({schema:this,typeName:P.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:r=>this["~validate"](r)}}optional(){return Oe.create(this,this._def)}nullable(){return tt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return he.create(this)}promise(){return Bt.create(this,this._def)}or(e){return Vt.create([this,e],this._def)}and(e){return Ut.create(this,e,this._def)}transform(e){return new et({...R(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new fr({...R(this._def),innerType:this,defaultValue:r,typeName:P.ZodDefault})}brand(){return new Qd({typeName:P.ZodBranded,type:this,...R(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new hr({...R(this._def),innerType:this,catchValue:r,typeName:P.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ir.create(this,e)}readonly(){return pr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Sd=/^c[^\s-]{8,}$/i,Nd=/^[0-9a-z]+$/,Pd=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ed=/^[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,$d=/^[a-z0-9_-]{21}$/i,Rd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Dd=/^[-+]?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)?)??$/,Md=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ld="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let nr;const Vd=/^(?:(?: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])$/,Ud=/^(?:(?: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])$/,Bd=/^(([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]))$/,Fd=/^(([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])$/,qd=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,zd=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qs="((\\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])))",Wd=new RegExp(`^${Qs}$`);function en(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Kd(t){return new RegExp(`^${en(t)}$`)}function Gd(t){let e=`${Qs}T${en(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Hd(t,e){return!!((e==="v4"||!e)&&Vd.test(t)||(e==="v6"||!e)&&Bd.test(t))}function Yd(t,e){if(!Rd.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Jd(t,e){return!!((e==="v4"||!e)&&Ud.test(t)||(e==="v6"||!e)&&Fd.test(t))}class be extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){const o=this._getOrReturnCtx(e);return Z(o,{code:x.invalid_type,expected:I.string,received:o.parsedType}),N}const n=new se;let a;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(a=this._getOrReturnCtx(e,a),Z(a,{code:x.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(a=this._getOrReturnCtx(e,a),Z(a,{code:x.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const f=e.data.length>o.value,h=e.data.length<o.value;(f||h)&&(a=this._getOrReturnCtx(e,a),f?Z(a,{code:x.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):h&&Z(a,{code:x.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Md.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"email",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")nr||(nr=new RegExp(Ld,"u")),nr.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"emoji",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Ed.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"uuid",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")$d.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"nanoid",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")Sd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"cuid",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")Nd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"cuid2",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Pd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"ulid",code:x.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Z(a,{validation:"url",code:x.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"regex",code:x.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Gd(o).test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Wd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Kd(o).test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{code:x.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Dd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"duration",code:x.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Hd(e.data,o.version)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"ip",code:x.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Yd(e.data,o.alg)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"jwt",code:x.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Jd(e.data,o.version)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"cidr",code:x.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?qd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"base64",code:x.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?zd.test(e.data)||(a=this._getOrReturnCtx(e,a),Z(a,{validation:"base64url",code:x.invalid_string,message:o.message}),n.dirty()):L.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:x.invalid_string,...C.errToObj(n)})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...C.errToObj(e)})}url(e){return this._addCheck({kind:"url",...C.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...C.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...C.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...C.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...C.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...C.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...C.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...C.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...C.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...C.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...C.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...C.errToObj(e)})}datetime(e){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:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...C.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,...C.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...C.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...C.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...C.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...C.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...C.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...C.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...C.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...C.errToObj(r)})}nonempty(e){return this.min(1,C.errToObj(e))}trim(){return new be({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new be({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new be({...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 r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}be.create=t=>new be({checks:[],typeName:P.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});function Xd(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,o=Number.parseInt(t.toFixed(a).replace(".","")),f=Number.parseInt(e.toFixed(a).replace(".",""));return o%f/10**a}class Le extends M{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)!==I.number){const o=this._getOrReturnCtx(e);return Z(o,{code:x.invalid_type,expected:I.number,received:o.parsedType}),N}let n;const a=new se;for(const o of this._def.checks)o.kind==="int"?L.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:x.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty()):o.kind==="multipleOf"?Xd(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Z(n,{code:x.not_finite,message:o.message}),a.dirty()):L.assertNever(o);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:C.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:C.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:C.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:C.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const 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"&&L.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const 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)}}Le.create=t=>new Le({checks:[],typeName:P.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Ve extends M{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)!==I.bigint)return this._getInvalidInput(e);let n;const a=new se;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Z(n,{code:x.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):L.assertNever(o);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Z(r,{code:x.invalid_type,expected:I.bigint,received:r.parsedType}),N}gte(e,r){return this.setLimit("min",e,!0,C.toString(r))}gt(e,r){return this.setLimit("min",e,!1,C.toString(r))}lte(e,r){return this.setLimit("max",e,!0,C.toString(r))}lt(e,r){return this.setLimit("max",e,!1,C.toString(r))}setLimit(e,r,n,a){return new Ve({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:C.toString(a)}]})}_addCheck(e){return new Ve({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:C.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:C.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:C.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:C.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:C.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Ve.create=t=>new Ve({checks:[],typeName:P.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...R(t)});class Lt extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.boolean,received:n.parsedType}),N}return oe(e.data)}}Lt.create=t=>new Lt({typeName:P.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...R(t)});class Xe extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){const o=this._getOrReturnCtx(e);return Z(o,{code:x.invalid_type,expected:I.date,received:o.parsedType}),N}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return Z(o,{code:x.invalid_date}),N}const n=new se;let a;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(a=this._getOrReturnCtx(e,a),Z(a,{code:x.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(a=this._getOrReturnCtx(e,a),Z(a,{code:x.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):L.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xe({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:C.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:C.toString(r)})}get minDate(){let e=null;for(const 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(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Xe.create=t=>new Xe({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:P.ZodDate,...R(t)});class ks extends M{_parse(e){if(this._getType(e)!==I.symbol){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.symbol,received:n.parsedType}),N}return oe(e.data)}}ks.create=t=>new ks({typeName:P.ZodSymbol,...R(t)});class ws extends M{_parse(e){if(this._getType(e)!==I.undefined){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.undefined,received:n.parsedType}),N}return oe(e.data)}}ws.create=t=>new ws({typeName:P.ZodUndefined,...R(t)});class Zs extends M{_parse(e){if(this._getType(e)!==I.null){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.null,received:n.parsedType}),N}return oe(e.data)}}Zs.create=t=>new Zs({typeName:P.ZodNull,...R(t)});class Is extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return oe(e.data)}}Is.create=t=>new Is({typeName:P.ZodAny,...R(t)});class ur extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oe(e.data)}}ur.create=t=>new ur({typeName:P.ZodUnknown,...R(t)});class je extends M{_parse(e){const r=this._getOrReturnCtx(e);return Z(r,{code:x.invalid_type,expected:I.never,received:r.parsedType}),N}}je.create=t=>new je({typeName:P.ZodNever,...R(t)});class Cs extends M{_parse(e){if(this._getType(e)!==I.undefined){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.void,received:n.parsedType}),N}return oe(e.data)}}Cs.create=t=>new Cs({typeName:P.ZodVoid,...R(t)});class he extends M{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==I.array)return Z(r,{code:x.invalid_type,expected:I.array,received:r.parsedType}),N;if(a.exactLength!==null){const f=r.data.length>a.exactLength.value,h=r.data.length<a.exactLength.value;(f||h)&&(Z(r,{code:f?x.too_big:x.too_small,minimum:h?a.exactLength.value:void 0,maximum:f?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&&(Z(r,{code:x.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&&(Z(r,{code:x.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((f,h)=>a.type._parseAsync(new Ae(r,f,r.path,h)))).then(f=>se.mergeArray(n,f));const o=[...r.data].map((f,h)=>a.type._parseSync(new Ae(r,f,r.path,h)));return se.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new he({...this._def,minLength:{value:e,message:C.toString(r)}})}max(e,r){return new he({...this._def,maxLength:{value:e,message:C.toString(r)}})}length(e,r){return new he({...this._def,exactLength:{value:e,message:C.toString(r)}})}nonempty(e){return this.min(1,e)}}he.create=(t,e)=>new he({type:t,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...R(e)});function Ge(t){if(t instanceof G){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Oe.create(Ge(n))}return new G({...t._def,shape:()=>e})}else return t instanceof he?new he({...t._def,type:Ge(t.element)}):t instanceof Oe?Oe.create(Ge(t.unwrap())):t instanceof tt?tt.create(Ge(t.unwrap())):t instanceof Ue?Ue.create(t.items.map(e=>Ge(e))):t}class G extends M{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(),r=L.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==I.object){const y=this._getOrReturnCtx(e);return Z(y,{code:x.invalid_type,expected:I.object,received:y.parsedType}),N}const{status:n,ctx:a}=this._processInputParams(e),{shape:o,keys:f}=this._getCached(),h=[];if(!(this._def.catchall instanceof je&&this._def.unknownKeys==="strip"))for(const y in a.data)f.includes(y)||h.push(y);const m=[];for(const y of f){const k=o[y],F=a.data[y];m.push({key:{status:"valid",value:y},value:k._parse(new Ae(a,F,a.path,y)),alwaysSet:y in a.data})}if(this._def.catchall instanceof je){const y=this._def.unknownKeys;if(y==="passthrough")for(const k of h)m.push({key:{status:"valid",value:k},value:{status:"valid",value:a.data[k]}});else if(y==="strict")h.length>0&&(Z(a,{code:x.unrecognized_keys,keys:h}),n.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const k of h){const F=a.data[k];m.push({key:{status:"valid",value:k},value:y._parse(new Ae(a,F,a.path,k)),alwaysSet:k in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const y=[];for(const k of m){const F=await k.key,J=await k.value;y.push({key:F,value:J,alwaysSet:k.alwaysSet})}return y}).then(y=>se.mergeObjectSync(n,y)):se.mergeObjectSync(n,m)}get shape(){return this._def.shape()}strict(e){return C.errToObj,new G({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,f;const a=((f=(o=this._def).errorMap)==null?void 0:f.call(o,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:C.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new G({...this._def,unknownKeys:"strip"})}passthrough(){return new G({...this._def,unknownKeys:"passthrough"})}extend(e){return new G({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new G({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new G({...this._def,catchall:e})}pick(e){const r={};for(const n of L.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new G({...this._def,shape:()=>r})}omit(e){const r={};for(const n of L.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new G({...this._def,shape:()=>r})}deepPartial(){return Ge(this)}partial(e){const r={};for(const n of L.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new G({...this._def,shape:()=>r})}required(e){const r={};for(const n of L.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Oe;)o=o._def.innerType;r[n]=o}return new G({...this._def,shape:()=>r})}keyof(){return tn(L.objectKeys(this.shape))}}G.create=(t,e)=>new G({shape:()=>t,unknownKeys:"strip",catchall:je.create(),typeName:P.ZodObject,...R(e)});G.strictCreate=(t,e)=>new G({shape:()=>t,unknownKeys:"strict",catchall:je.create(),typeName:P.ZodObject,...R(e)});G.lazycreate=(t,e)=>new G({shape:t,unknownKeys:"strip",catchall:je.create(),typeName:P.ZodObject,...R(e)});class Vt extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(o){for(const h of o)if(h.result.status==="valid")return h.result;for(const h of o)if(h.result.status==="dirty")return r.common.issues.push(...h.ctx.common.issues),h.result;const f=o.map(h=>new xe(h.ctx.common.issues));return Z(r,{code:x.invalid_union,unionErrors:f}),N}if(r.common.async)return Promise.all(n.map(async o=>{const f={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:f}),ctx:f}})).then(a);{let o;const f=[];for(const m of n){const y={...r,common:{...r.common,issues:[]},parent:null},k=m._parseSync({data:r.data,path:r.path,parent:y});if(k.status==="valid")return k;k.status==="dirty"&&!o&&(o={result:k,ctx:y}),y.common.issues.length&&f.push(y.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;const h=f.map(m=>new xe(m));return Z(r,{code:x.invalid_union,unionErrors:h}),N}}get options(){return this._def.options}}Vt.create=(t,e)=>new Vt({options:t,typeName:P.ZodUnion,...R(e)});function lr(t,e){const r=Ce(t),n=Ce(e);if(t===e)return{valid:!0,data:t};if(r===I.object&&n===I.object){const a=L.objectKeys(e),o=L.objectKeys(t).filter(h=>a.indexOf(h)!==-1),f={...t,...e};for(const h of o){const m=lr(t[h],e[h]);if(!m.valid)return{valid:!1};f[h]=m.data}return{valid:!0,data:f}}else if(r===I.array&&n===I.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let o=0;o<t.length;o++){const f=t[o],h=e[o],m=lr(f,h);if(!m.valid)return{valid:!1};a.push(m.data)}return{valid:!0,data:a}}else return r===I.date&&n===I.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Ut extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(o,f)=>{if(bs(o)||bs(f))return N;const h=lr(o.value,f.value);return h.valid?((xs(o)||xs(f))&&r.dirty(),{status:r.value,value:h.data}):(Z(n,{code:x.invalid_intersection_types}),N)};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(([o,f])=>a(o,f)):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}))}}Ut.create=(t,e,r)=>new Ut({left:t,right:e,typeName:P.ZodIntersection,...R(r)});class Ue extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.array)return Z(n,{code:x.invalid_type,expected:I.array,received:n.parsedType}),N;if(n.data.length<this._def.items.length)return Z(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&n.data.length>this._def.items.length&&(Z(n,{code:x.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const o=[...n.data].map((f,h)=>{const m=this._def.items[h]||this._def.rest;return m?m._parse(new Ae(n,f,n.path,h)):null}).filter(f=>!!f);return n.common.async?Promise.all(o).then(f=>se.mergeArray(r,f)):se.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new Ue({...this._def,rest:e})}}Ue.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ue({items:t,typeName:P.ZodTuple,rest:null,...R(e)})};class Os extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.map)return Z(n,{code:x.invalid_type,expected:I.map,received:n.parsedType}),N;const a=this._def.keyType,o=this._def.valueType,f=[...n.data.entries()].map(([h,m],y)=>({key:a._parse(new Ae(n,h,n.path,[y,"key"])),value:o._parse(new Ae(n,m,n.path,[y,"value"]))}));if(n.common.async){const h=new Map;return Promise.resolve().then(async()=>{for(const m of f){const y=await m.key,k=await m.value;if(y.status==="aborted"||k.status==="aborted")return N;(y.status==="dirty"||k.status==="dirty")&&r.dirty(),h.set(y.value,k.value)}return{status:r.value,value:h}})}else{const h=new Map;for(const m of f){const y=m.key,k=m.value;if(y.status==="aborted"||k.status==="aborted")return N;(y.status==="dirty"||k.status==="dirty")&&r.dirty(),h.set(y.value,k.value)}return{status:r.value,value:h}}}}Os.create=(t,e,r)=>new Os({valueType:e,keyType:t,typeName:P.ZodMap,...R(r)});class Zt extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.set)return Z(n,{code:x.invalid_type,expected:I.set,received:n.parsedType}),N;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(Z(n,{code:x.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&&(Z(n,{code:x.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const o=this._def.valueType;function f(m){const y=new Set;for(const k of m){if(k.status==="aborted")return N;k.status==="dirty"&&r.dirty(),y.add(k.value)}return{status:r.value,value:y}}const h=[...n.data.values()].map((m,y)=>o._parse(new Ae(n,m,n.path,y)));return n.common.async?Promise.all(h).then(m=>f(m)):f(h)}min(e,r){return new Zt({...this._def,minSize:{value:e,message:C.toString(r)}})}max(e,r){return new Zt({...this._def,maxSize:{value:e,message:C.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Zt.create=(t,e)=>new Zt({valueType:t,minSize:null,maxSize:null,typeName:P.ZodSet,...R(e)});class As extends M{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}As.create=(t,e)=>new As({getter:t,typeName:P.ZodLazy,...R(e)});class js extends M{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Z(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}js.create=(t,e)=>new js({value:t,typeName:P.ZodLiteral,...R(e)});function tn(t,e){return new Qe({values:t,typeName:P.ZodEnum,...R(e)})}class Qe extends M{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Z(r,{expected:L.joinValues(n),received:r.parsedType,code:x.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Z(r,{received:r.data,code:x.invalid_enum_value,options:n}),N}return oe(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Qe.create(e,{...this._def,...r})}exclude(e,r=this._def){return Qe.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Qe.create=tn;class Ss extends M{_parse(e){const r=L.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==I.string&&n.parsedType!==I.number){const a=L.objectValues(r);return Z(n,{expected:L.joinValues(a),received:n.parsedType,code:x.invalid_type}),N}if(this._cache||(this._cache=new Set(L.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=L.objectValues(r);return Z(n,{received:n.data,code:x.invalid_enum_value,options:a}),N}return oe(e.data)}get enum(){return this._def.values}}Ss.create=(t,e)=>new Ss({values:t,typeName:P.ZodNativeEnum,...R(e)});class Bt extends M{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==I.promise&&r.common.async===!1)return Z(r,{code:x.invalid_type,expected:I.promise,received:r.parsedType}),N;const n=r.parsedType===I.promise?r.data:Promise.resolve(r.data);return oe(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Bt.create=(t,e)=>new Bt({type:t,typeName:P.ZodPromise,...R(e)});class et extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:f=>{Z(n,f),f.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),a.type==="preprocess"){const f=a.transform(n.data,o);if(n.common.async)return Promise.resolve(f).then(async h=>{if(r.value==="aborted")return N;const m=await this._def.schema._parseAsync({data:h,path:n.path,parent:n});return m.status==="aborted"?N:m.status==="dirty"||r.value==="dirty"?bt(m.value):m});{if(r.value==="aborted")return N;const h=this._def.schema._parseSync({data:f,path:n.path,parent:n});return h.status==="aborted"?N:h.status==="dirty"||r.value==="dirty"?bt(h.value):h}}if(a.type==="refinement"){const f=h=>{const m=a.refinement(h,o);if(n.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return h};if(n.common.async===!1){const h=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return h.status==="aborted"?N:(h.status==="dirty"&&r.dirty(),f(h.value),{status:r.value,value:h.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(h=>h.status==="aborted"?N:(h.status==="dirty"&&r.dirty(),f(h.value).then(()=>({status:r.value,value:h.value}))))}if(a.type==="transform")if(n.common.async===!1){const f=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Je(f))return N;const h=a.transform(f.value,o);if(h instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:h}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(f=>Je(f)?Promise.resolve(a.transform(f.value,o)).then(h=>({status:r.value,value:h})):N);L.assertNever(a)}}et.create=(t,e,r)=>new et({schema:t,typeName:P.ZodEffects,effect:e,...R(r)});et.createWithPreprocess=(t,e,r)=>new et({schema:e,effect:{type:"preprocess",transform:t},typeName:P.ZodEffects,...R(r)});class Oe extends M{_parse(e){return this._getType(e)===I.undefined?oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Oe.create=(t,e)=>new Oe({innerType:t,typeName:P.ZodOptional,...R(e)});class tt extends M{_parse(e){return this._getType(e)===I.null?oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}tt.create=(t,e)=>new tt({innerType:t,typeName:P.ZodNullable,...R(e)});class fr extends M{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}fr.create=(t,e)=>new fr({innerType:t,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class hr extends M{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Mt(a)?a.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new xe(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new xe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}hr.create=(t,e)=>new hr({innerType:t,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Ns extends M{_parse(e){if(this._getType(e)!==I.nan){const n=this._getOrReturnCtx(e);return Z(n,{code:x.invalid_type,expected:I.nan,received:n.parsedType}),N}return{status:"valid",value:e.data}}}Ns.create=t=>new Ns({typeName:P.ZodNaN,...R(t)});class Qd extends M{_parse(e){const{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}}class Ir extends M{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?N:o.status==="dirty"?(r.dirty(),bt(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?N: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 Ir({in:e,out:r,typeName:P.ZodPipeline})}}class pr extends M{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Je(a)&&(a.value=Object.freeze(a.value)),a);return Mt(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}pr.create=(t,e)=>new pr({innerType:t,typeName:P.ZodReadonly,...R(e)});var P;(function(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.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"})(P||(P={}));const mr=be.create;Le.create;Ve.create;Lt.create;Xe.create;const ec=ur.create;je.create;const rn=he.create,sn=G.create;Vt.create;Ut.create;Ue.create;const tc=Qe.create;Bt.create;Oe.create;tt.create;const rc={string:(t=>be.create({...t,coerce:!0})),number:(t=>Le.create({...t,coerce:!0})),boolean:(t=>Lt.create({...t,coerce:!0})),bigint:(t=>Ve.create({...t,coerce:!0})),date:(t=>Xe.create({...t,coerce:!0}))},It=()=>rc.number().int().positive().nonnegative(),nn=()=>mr().or(rn(mr())).transform(t=>qt(t)?t:[t]),an=tc(["asc","desc"]),Cr=sn({page:It().optional().default(1),pageSize:It().optional().default(20),sort:mr().optional().default("id"),sortDir:an.optional().default("asc"),filter:nn().optional().default([])}),sc=Cr.transform(t=>{const{page:e,pageSize:r,sort:n}=t;return{...t,sort:n||"id",offset:(e-1)*r}}),on=Cr.extend({count:It(),totalPages:It()}),nc=sn({data:rn(ec()),request:on}),dn=["contains","equals"],cn=t=>{const[e,r,n]=t.split(":"),a=dn.includes(n)?n:"contains";return{key:e,value:r,operator:a}},un=(t,e)=>{if(t.length===1)return{key:t[0],filterObj:e};const r=t.pop();return un(t,{[r]:e})},ac=(t,e)=>Or(t.split("."),e),Or=(t,e)=>{if(t.length===1)return{[t[0]]:e};const r=t.pop();return Or(t,{[r]:e})},ic=t=>{const e={};return t==null||t.forEach(r=>{const{key:n,value:a,operator:o}=cn(r);if(!n)return;const f=o||"contains",h={[o||"contains"]:a.toLowerCase()};f==="contains"&&(h.mode="insensitive");const m=un(n.split("."),h);e[m.key]=m.filterObj}),e},oc=t=>{const e=[];return t.forEach(r=>{const{key:n,value:a,operator:o}=cn(r);if(!n)return;const f=n;e.push({label:f,key:n,value:a,operator:o})}),e};exports.CategoryBuilder=wr;exports.ControlBuilder=Tt;exports.ControlType=Ie;exports.GroupBuilder=Zr;exports.LayoutBuilder=De;exports.Operator=dn;exports.PositiveRequestNumber=It;exports.RequestSchema=Cr;exports.RequestSchemaWithOffset=sc;exports.ResponseRequestSchema=on;exports.ResponseSchema=nc;exports.Size=Js;exports.SortDirEnum=an;exports.StringOrArray=nn;exports.TableBuilder=kr;exports.TextCellBuilder=Tr;exports.buildFilter=ic;exports.buildSort=ac;exports.buildSortKey=Or;exports.createSchema=Id;exports.extractFilters=oc;exports.findColumnDef=Cd;exports.findProperty=Xs;
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './lib/schema.model';
|
|
2
|
+
export * from './lib/table/utils';
|
|
3
|
+
export * from './lib/table/builder';
|
|
4
|
+
export * from './lib/layout/layout.builder';
|
|
5
|
+
export * from './lib/layout/control.builder';
|
|
6
|
+
export * from './lib/layout/category.builder';
|
|
7
|
+
export * from './lib/layout/group.builder';
|
|
8
|
+
export * from './lib/schema.utils';
|
|
9
|
+
export * from './lib/response.model';
|
|
10
|
+
export * from './lib/request.model';
|
|
11
|
+
export * from './lib/filter';
|
|
12
|
+
export * from './lib/zod.types';
|