@etaio/core-types 1.3.0 → 1.3.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/dist/index.d.ts +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export * from './providers';
|
|
|
23
23
|
export * from './storage';
|
|
24
24
|
export * from './genai';
|
|
25
25
|
export * from './validators';
|
|
26
|
-
export declare const VERSION = "1.3.
|
|
26
|
+
export declare const VERSION = "1.3.1";
|
|
27
27
|
export declare const PACKAGE_NAME = "@etaio/core-types";
|
|
28
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.es.js
CHANGED
|
@@ -3114,7 +3114,7 @@ function fr(r) {
|
|
|
3114
3114
|
function pr(r) {
|
|
3115
3115
|
return (e) => r.parse(e);
|
|
3116
3116
|
}
|
|
3117
|
-
const mr = "1.3.
|
|
3117
|
+
const mr = "1.3.1", yr = "@etaio/core-types";
|
|
3118
3118
|
export {
|
|
3119
3119
|
_e as ApiAssetSchema,
|
|
3120
3120
|
Tt as AudioGenerationRequestSchema,
|
package/dist/index.umd.js
CHANGED
|
@@ -4,4 +4,4 @@ Extracted text: ${r.extractedText}`),n}).join(`
|
|
|
4
4
|
`);e=`${e}
|
|
5
5
|
|
|
6
6
|
Attachments:
|
|
7
|
-
${t}`}return e}function _t(a){return!!(a.attachments&&a.attachments.length>0)}function xt(a,e){return a.attachments?e?a.attachments.filter(t=>t.type===e).length:a.attachments.length:0}var b;(function(a){a.assertEqual=n=>{};function e(n){}a.assertIs=e;function t(n){throw new Error}a.assertNever=t,a.arrayToEnum=n=>{const s={};for(const i of n)s[i]=i;return s},a.getValidEnumValues=n=>{const s=a.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of s)i[o]=n[o];return a.objectValues(i)},a.objectValues=n=>a.objectKeys(n).map(function(s){return n[s]}),a.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const s=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},a.find=(n,s)=>{for(const i of n)if(s(i))return i},a.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}a.joinValues=r,a.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(b||(b={}));var Se;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=a=>{switch(typeof a){case"undefined":return h.undefined;case"string":return h.string;case"number":return Number.isNaN(a)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(a)?h.array:a===null?h.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?h.promise:typeof Map<"u"&&a instanceof Map?h.map:typeof Set<"u"&&a instanceof Set?h.set:typeof Date<"u"&&a instanceof Date?h.date:h.object;default:return h.unknown}},d=b.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 O extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},r={_errors:[]},n=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,m=0;for(;m<i.path.length;){const p=i.path[m];m===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(i))):o[p]=o[p]||{_errors:[]},o=o[p],m++}}};return n(this),r}static assert(e){if(!(e instanceof O))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}O.create=a=>new O(a);const he=(a,e)=>{let t;switch(a.code){case d.invalid_type:a.received===h.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(a.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(a.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(a.options)}, received '${a.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:b.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case d.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case d.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,b.assertNever(a)}return{message:t}};let kt=he;function bt(){return kt}const wt=a=>{const{data:e,path:t,errorMaps:r,issueData:n}=a,s=[...t,...n.path||[]],i={...n,path:s};if(n.message!==void 0)return{...n,path:s,message:n.message};let o="";const m=r.filter(p=>!!p).slice().reverse();for(const p of m)o=p(i,{data:e,defaultError:o}).message;return{...n,path:s,message:o}};function u(a,e){const t=bt(),r=wt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===he?void 0:he].filter(n=>!!n)});a.common.issues.push(r)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return g;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const s=await n.key,i=await n.value;r.push({key:s,value:i})}return T.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:s,value:i}=n;if(s.status==="aborted"||i.status==="aborted")return g;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}}const g=Object.freeze({status:"aborted"}),X=a=>({status:"dirty",value:a}),R=a=>({status:"valid",value:a}),Re=a=>a.status==="aborted",Ce=a=>a.status==="dirty",U=a=>a.status==="valid",ae=a=>typeof Promise<"u"&&a instanceof Promise;var f;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(f||(f={}));class E{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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 Ee=(a,e)=>{if(U(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new O(a.common.issues);return this._error=t,this._error}}};function v(a){if(!a)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=a;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:m}=a;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:m??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:m??t??o.defaultError}},description:n}}class x{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ae(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Ee(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return U(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(n=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>U(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(ae(n)?n:Promise.resolve(n));return Ee(r,s)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,s)=>{const i=e(n),o=()=>s.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(m=>m?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new J({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return V.create(this,this._def)}nullable(){return Q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this)}promise(){return ie.create(this,this._def)}or(e){return re.create([this,e],this._def)}and(e){return ne.create(this,e,this._def)}transform(e){return new J({...v(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ve({...v(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new Gt({typeName:y.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({...v(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const At=/^c[^\s-]{8,}$/i,Tt=/^[0-9a-z]+$/,St=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Rt=/^[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,Ct=/^[a-z0-9_-]{21}$/i,Et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,It=/^[-+]?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)?)??$/,Ot=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fe;const Zt=/^(?:(?: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])$/,Pt=/^(?:(?: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])$/,jt=/^(([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]))$/,$t=/^(([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])$/,Mt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\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])))",qt=new RegExp(`^${Ie}$`);function Oe(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);const t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Bt(a){return new RegExp(`^${Oe(a)}$`)}function Dt(a){let e=`${Ie}T${Oe(a)}`;const t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Lt(a,e){return!!((e==="v4"||!e)&&Zt.test(a)||(e==="v6"||!e)&&jt.test(a))}function zt(a,e){if(!Et.test(a))return!1;try{const[t]=a.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ut(a,e){return!!((e==="v4"||!e)&&Pt.test(a)||(e==="v6"||!e)&&$t.test(a))}class N extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.string,received:s.parsedType}),g}const r=new T;let n;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?u(n,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&u(n,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"email",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")fe||(fe=new RegExp(Nt,"u")),fe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"emoji",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Rt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"uuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"nanoid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")At.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cuid2",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")St.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"ulid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),u(n,{validation:"url",code:d.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"regex",code:d.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Dt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?qt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Bt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?It.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"duration",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Lt(e.data,s.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"ip",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?zt(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"jwt",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Ut(e.data,s.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cidr",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Mt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"base64",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Vt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"base64url",code:d.invalid_string,message:s.message}),r.dirty()):b.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...f.errToObj(r)})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...f.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...f.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,...f.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,...f.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...f.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...f.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...f.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...f.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...f.errToObj(t)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new N({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}N.create=a=>new N({checks:[],typeName:y.ZodString,coerce:(a==null?void 0:a.coerce)??!1,...v(a)});function Ft(a,e){const t=(a.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,s=Number.parseInt(a.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return s%i/10**n}class F extends x{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)!==h.number){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.number,received:s.parsedType}),g}let r;const n=new T;for(const s of this._def.checks)s.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?Ft(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_finite,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,r,n){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:f.toString(n)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}F.create=a=>new F({checks:[],typeName:y.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...v(a)});class K extends x{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)!==h.bigint)return this._getInvalidInput(e);let r;const n=new T;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:d.invalid_type,expected:h.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,r,n){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:f.toString(n)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}K.create=a=>new K({checks:[],typeName:y.ZodBigInt,coerce:(a==null?void 0:a.coerce)??!1,...v(a)});class me extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),g}return R(e.data)}}me.create=a=>new me({typeName:y.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...v(a)});class ee extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.date,received:s.parsedType}),g}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_date}),g}const r=new T;let n;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):b.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ee.create=a=>new ee({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:y.ZodDate,...v(a)});class Ne extends x{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),g}return R(e.data)}}Ne.create=a=>new Ne({typeName:y.ZodSymbol,...v(a)});class Ze extends x{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),g}return R(e.data)}}Ze.create=a=>new Ze({typeName:y.ZodUndefined,...v(a)});class Pe extends x{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),g}return R(e.data)}}Pe.create=a=>new Pe({typeName:y.ZodNull,...v(a)});class pe extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}pe.create=a=>new pe({typeName:y.ZodAny,...v(a)});class je extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}je.create=a=>new je({typeName:y.ZodUnknown,...v(a)});class M extends x{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:d.invalid_type,expected:h.never,received:t.parsedType}),g}}M.create=a=>new M({typeName:y.ZodNever,...v(a)});class $e extends x{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),g}return R(e.data)}}$e.create=a=>new $e({typeName:y.ZodVoid,...v(a)});class I extends x{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return u(t,{code:d.invalid_type,expected:h.array,received:t.parsedType}),g;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(u(t,{code:i?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(u(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(u(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new E(t,i,t.path,o)))).then(i=>T.mergeArray(r,i));const s=[...t.data].map((i,o)=>n.type._parseSync(new E(t,i,t.path,o)));return T.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:f.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:f.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:f.toString(t)}})}nonempty(e){return this.min(1,e)}}I.create=(a,e)=>new I({type:a,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...v(e)});function G(a){if(a instanceof A){const e={};for(const t in a.shape){const r=a.shape[t];e[t]=V.create(G(r))}return new A({...a._def,shape:()=>e})}else return a instanceof I?new I({...a._def,type:G(a.element)}):a instanceof V?V.create(G(a.unwrap())):a instanceof Q?Q.create(G(a.unwrap())):a instanceof B?B.create(a.items.map(e=>G(e))):a}class A extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=b.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==h.object){const p=this._getOrReturnCtx(e);return u(p,{code:d.invalid_type,expected:h.object,received:p.parsedType}),g}const{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof M&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const m=[];for(const p of i){const k=s[p],C=n.data[p];m.push({key:{status:"valid",value:p},value:k._parse(new E(n,C,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof M){const p=this._def.unknownKeys;if(p==="passthrough")for(const k of o)m.push({key:{status:"valid",value:k},value:{status:"valid",value:n.data[k]}});else if(p==="strict")o.length>0&&(u(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const k of o){const C=n.data[k];m.push({key:{status:"valid",value:k},value:p._parse(new E(n,C,n.path,k)),alwaysSet:k in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const k of m){const C=await k.key,P=await k.value;p.push({key:C,value:P,alwaysSet:k.alwaysSet})}return p}).then(p=>T.mergeObjectSync(r,p)):T.mergeObjectSync(r,m)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new A({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,i;const n=((i=(s=this._def).errorMap)==null?void 0:i.call(s,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:f.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new A({...this._def,unknownKeys:"strip"})}passthrough(){return new A({...this._def,unknownKeys:"passthrough"})}extend(e){return new A({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new A({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new A({...this._def,catchall:e})}pick(e){const t={};for(const r of b.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new A({...this._def,shape:()=>t})}omit(e){const t={};for(const r of b.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new A({...this._def,shape:()=>t})}deepPartial(){return G(this)}partial(e){const t={};for(const r of b.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new A({...this._def,shape:()=>t})}required(e){const t={};for(const r of b.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof V;)s=s._def.innerType;t[r]=s}return new A({...this._def,shape:()=>t})}keyof(){return qe(b.objectKeys(this.shape))}}A.create=(a,e)=>new A({shape:()=>a,unknownKeys:"strip",catchall:M.create(),typeName:y.ZodObject,...v(e)}),A.strictCreate=(a,e)=>new A({shape:()=>a,unknownKeys:"strict",catchall:M.create(),typeName:y.ZodObject,...v(e)}),A.lazycreate=(a,e)=>new A({shape:a,unknownKeys:"strip",catchall:M.create(),typeName:y.ZodObject,...v(e)});class re extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new O(o.ctx.common.issues));return u(t,{code:d.invalid_union,unionErrors:i}),g}if(t.common.async)return Promise.all(r.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let s;const i=[];for(const m of r){const p={...t,common:{...t.common,issues:[]},parent:null},k=m._parseSync({data:t.data,path:t.path,parent:p});if(k.status==="valid")return k;k.status==="dirty"&&!s&&(s={result:k,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(m=>new O(m));return u(t,{code:d.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}re.create=(a,e)=>new re({options:a,typeName:y.ZodUnion,...v(e)});function ye(a,e){const t=$(a),r=$(e);if(a===e)return{valid:!0,data:a};if(t===h.object&&r===h.object){const n=b.objectKeys(e),s=b.objectKeys(a).filter(o=>n.indexOf(o)!==-1),i={...a,...e};for(const o of s){const m=ye(a[o],e[o]);if(!m.valid)return{valid:!1};i[o]=m.data}return{valid:!0,data:i}}else if(t===h.array&&r===h.array){if(a.length!==e.length)return{valid:!1};const n=[];for(let s=0;s<a.length;s++){const i=a[s],o=e[s],m=ye(i,o);if(!m.valid)return{valid:!1};n.push(m.data)}return{valid:!0,data:n}}else return t===h.date&&r===h.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}class ne extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(s,i)=>{if(Re(s)||Re(i))return g;const o=ye(s.value,i.value);return o.valid?((Ce(s)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(u(r,{code:d.invalid_intersection_types}),g)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>n(s,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ne.create=(a,e,t)=>new ne({left:a,right:e,typeName:y.ZodIntersection,...v(t)});class B extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return u(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),g;if(r.data.length<this._def.items.length)return u(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&r.data.length>this._def.items.length&&(u(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((i,o)=>{const m=this._def.items[o]||this._def.rest;return m?m._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>T.mergeArray(t,i)):T.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new B({...this._def,rest:e})}}B.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new B({items:a,typeName:y.ZodTuple,rest:null,...v(e)})};class se extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return u(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),g;const n=[],s=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:s._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?T.mergeObjectAsync(t,n):T.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof x?new se({keyType:e,valueType:t,typeName:y.ZodRecord,...v(r)}):new se({keyType:N.create(),valueType:e,typeName:y.ZodRecord,...v(t)})}}class Me extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return u(r,{code:d.invalid_type,expected:h.map,received:r.parsedType}),g;const n=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([o,m],p)=>({key:n._parse(new E(r,o,r.path,[p,"key"])),value:s._parse(new E(r,m,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const m of i){const p=await m.key,k=await m.value;if(p.status==="aborted"||k.status==="aborted")return g;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const m of i){const p=m.key,k=m.value;if(p.status==="aborted"||k.status==="aborted")return g;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}}}}Me.create=(a,e,t)=>new Me({valueType:e,keyType:a,typeName:y.ZodMap,...v(t)});class te extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return u(r,{code:d.invalid_type,expected:h.set,received:r.parsedType}),g;const n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(u(r,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(u(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(m){const p=new Set;for(const k of m){if(k.status==="aborted")return g;k.status==="dirty"&&t.dirty(),p.add(k.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((m,p)=>s._parse(new E(r,m,r.path,p)));return r.common.async?Promise.all(o).then(m=>i(m)):i(o)}min(e,t){return new te({...this._def,minSize:{value:e,message:f.toString(t)}})}max(e,t){return new te({...this._def,maxSize:{value:e,message:f.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}te.create=(a,e)=>new te({valueType:a,minSize:null,maxSize:null,typeName:y.ZodSet,...v(e)});class Ve extends x{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ve.create=(a,e)=>new Ve({getter:a,typeName:y.ZodLazy,...v(e)});class ge extends x{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}ge.create=(a,e)=>new ge({value:a,typeName:y.ZodLiteral,...v(e)});function qe(a,e){return new W({values:a,typeName:y.ZodEnum,...v(e)})}class W extends x{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return u(t,{expected:b.joinValues(r),received:t.parsedType,code:d.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return u(t,{received:t.data,code:d.invalid_enum_value,options:r}),g}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return W.create(e,{...this._def,...t})}exclude(e,t=this._def){return W.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}W.create=qe;class Be extends x{_parse(e){const t=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const n=b.objectValues(t);return u(r,{expected:b.joinValues(n),received:r.parsedType,code:d.invalid_type}),g}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=b.objectValues(t);return u(r,{received:r.data,code:d.invalid_enum_value,options:n}),g}return R(e.data)}get enum(){return this._def.values}}Be.create=(a,e)=>new Be({values:a,typeName:y.ZodNativeEnum,...v(e)});class ie extends x{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return u(t,{code:d.invalid_type,expected:h.promise,received:t.parsedType}),g;const r=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return R(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ie.create=(a,e)=>new ie({type:a,typeName:y.ZodPromise,...v(e)});class J extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:i=>{u(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){const i=n.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return g;const m=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return m.status==="aborted"?g:m.status==="dirty"||t.value==="dirty"?X(m.value):m});{if(t.value==="aborted")return g;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?g:o.status==="dirty"||t.value==="dirty"?X(o.value):o}}if(n.type==="refinement"){const i=o=>{const m=n.refinement(o,s);if(r.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return g;const o=n.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,s)).then(o=>({status:t.value,value:o})):g);b.assertNever(n)}}J.create=(a,e,t)=>new J({schema:a,typeName:y.ZodEffects,effect:e,...v(t)}),J.createWithPreprocess=(a,e,t)=>new J({schema:e,effect:{type:"preprocess",transform:a},typeName:y.ZodEffects,...v(t)});class V extends x{_parse(e){return this._getType(e)===h.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(a,e)=>new V({innerType:a,typeName:y.ZodOptional,...v(e)});class Q extends x{_parse(e){return this._getType(e)===h.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Q.create=(a,e)=>new Q({innerType:a,typeName:y.ZodNullable,...v(e)});class ve extends x{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ve.create=(a,e)=>new ve({innerType:a,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class _e extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ae(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_e.create=(a,e)=>new _e({innerType:a,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class De extends x{_parse(e){if(this._getType(e)!==h.nan){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.nan,received:r.parsedType}),g}return{status:"valid",value:e.data}}}De.create=a=>new De({typeName:y.ZodNaN,...v(a)});class Gt extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?g:s.status==="dirty"?(t.dirty(),X(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?g:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new xe({in:e,out:t,typeName:y.ZodPipeline})}}class ke extends x{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return ae(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ke.create=(a,e)=>new ke({innerType:a,typeName:y.ZodReadonly,...v(e)});var y;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(y||(y={}));const l=N.create,_=F.create,oe=me.create,Z=ee.create,D=pe.create;M.create;const L=I.create,w=A.create,Le=re.create;ne.create,B.create;const de=se.create,be=ge.create,H=W.create;ie.create,V.create,Q.create;const ce=w({id:l().min(1,"Asset ID is required"),type:H(["image","video","audio","text","graphics"]),url:l().url("Invalid URL format"),projectId:l().min(1,"Project ID is required"),createdAt:Z().or(l().transform(a=>new Date(a))),updatedAt:Z().or(l().transform(a=>new Date(a))).optional()}),ze=w({prompt:l().optional(),negativePrompt:l().optional(),model:l().optional(),modelVersion:l().optional(),settings:de(D()).optional(),cost:_().min(0).optional(),processingTime:_().min(0).optional(),attempts:_().int().min(1).optional(),jobId:l().optional()}),Ue=w({userId:l(),projectId:l().optional(),uploadedAt:l().optional(),source:H(["direct","url","presigned"]),originalName:l().optional(),originalUrl:l().url().optional(),uploadedUrl:l().url().optional(),contentType:l(),size:_().min(0).optional(),folder:l().optional(),dimensions:w({width:_().int().positive(),height:_().int().positive()}).optional(),duration:_().positive().optional()}),ue=ce.extend({name:l().optional(),sceneId:l().optional(),provider:l().min(1,"Provider is required"),uploadMetadata:Ue.optional(),generationMetadata:ze.optional(),processingMetadata:w({sourceAssetId:l().optional(),transformations:L(w({type:l(),parameters:de(D())})).optional(),compression:w({quality:_().min(0).max(100).optional(),format:l().optional(),bitrate:_().positive().optional()}).optional(),processedAt:Z().optional(),processingTime:_().min(0).optional()}).optional(),dimensions:w({width:_().int().positive(),height:_().int().positive()}).optional(),duration:_().positive().optional(),size:_().min(0).optional(),contentType:l().optional(),tags:L(l()).optional(),rights:w({license:H(["creative-commons","royalty-free","rights-managed","custom"]).optional(),attribution:l().optional(),restrictions:L(l()).optional(),expiresAt:Z().optional(),owner:l().optional()}).optional()});function Wt(a){return ce.parse(a)}function Jt(a){return ce.safeParse(a)}function Qt(a){return ue.parse(a)}function Ht(a){return ue.safeParse(a)}const Fe=ue.partial().required({id:!0});function Yt(a){return Fe.parse(a)}const Ge=w({requestId:l().optional(),clientId:l().optional(),version:l().optional(),timestamp:Z().or(l().transform(a=>new Date(a))).optional(),source:H(["web","mobile","api","internal"]).optional()}).passthrough(),q=w({projectId:l().min(1,"Project ID is required"),userId:l().optional(),metadata:Ge.optional()}),We=w({page:_().int().min(1).optional(),limit:_().int().min(1).max(100).optional(),cursor:l().optional()}),Xt=q.extend({pagination:We.optional()}),Je=w({type:Le([l(),L(l())]).optional(),status:Le([l(),L(l())]).optional(),dateRange:w({from:Z().or(l().transform(a=>new Date(a))),to:Z().or(l().transform(a=>new Date(a)))}).optional()}).passthrough(),Qe=w({field:l().min(1,"Sort field is required"),order:H(["asc","desc"])}),Kt=q.extend({filters:Je.optional(),sort:Qe.optional()}),He=q.extend({assetType:be("image"),prompt:l().min(1,"Prompt is required"),negativePrompt:l().optional(),style:l().optional(),quality:H(["standard","hd"]).optional(),dimensions:w({width:_().int().min(64).max(4096),height:_().int().min(64).max(4096)}).optional(),numberOfImages:_().int().min(1).max(10).optional(),provider:l().optional(),sceneId:l().optional()}),Ye=q.extend({assetType:be("video"),prompt:l().min(1,"Prompt is required"),duration:_().min(1).max(120),style:l().optional(),quality:l().optional(),fps:_().int().min(1).max(120).optional(),provider:l().optional(),sceneId:l().optional()}),Xe=q.extend({assetType:be("audio"),text:l().optional(),prompt:l().optional(),voiceId:l().optional(),duration:_().min(.5).max(300).optional(),settings:de(D()).optional(),provider:l().optional(),sceneId:l().optional()}).refine(a=>a.text||a.prompt,{message:"Either text or prompt is required"});function ea(a){return q.parse(a)}function ta(a){return q.safeParse(a)}function aa(a){return He.parse(a)}function ra(a){return Ye.parse(a)}function na(a){return Xe.parse(a)}function sa(a){return e=>a.parse(e)}const we=w({code:l().min(1,"Error code is required"),message:l().min(1,"Error message is required"),details:de(D()).optional(),stack:l().optional(),timestamp:l().datetime()}),Ke=w({requestId:l().optional(),processingTime:_().min(0).optional(),version:l().optional(),timestamp:Z().or(l().transform(a=>new Date(a))).optional(),rateLimit:w({limit:_().int().positive(),remaining:_().int().min(0),reset:Z().or(l().transform(a=>new Date(a)))}).optional()}).passthrough(),Y=w({success:oe(),data:D().optional(),error:we.optional(),metadata:Ke.optional()}),et=w({page:_().int().min(1),limit:_().int().min(1),total:_().int().min(0),totalPages:_().int().min(0),hasNext:oe(),hasPrevious:oe(),nextCursor:l().optional(),previousCursor:l().optional()}),tt=Y.extend({data:L(D()),pagination:et.optional()}),at=w({index:_().int().min(0),success:oe(),data:D().optional(),error:we.optional()}),rt=Y.omit({data:!0}).extend({results:L(at),summary:w({total:_().int().min(0),succeeded:_().int().min(0),failed:_().int().min(0),skipped:_().int().min(0)})}),nt=Y.extend({provider:l().min(1,"Provider is required"),processingTime:_().min(0).optional(),cost:_().min(0).optional()});function ia(a){return Y.parse(a)}function oa(a){return Y.safeParse(a)}function da(a){return tt.parse(a)}function ca(a){return rt.parse(a)}function ua(a){return nt.parse(a)}function la(a){return e=>a.parse(e)}const ha="1.3.0",fa="@etaio/core-types";c.ApiAssetSchema=ue,c.AudioGenerationRequestSchema=Xe,c.BaseAssetSchema=ce,c.BaseProviderManager=pt,c.BaseRequestSchema=q,c.BaseResponseSchema=Y,c.BatchResponseSchema=rt,c.BatchResultSchema=at,c.ErrorResponseSchema=we,c.FilterParamsSchema=Je,c.FilteredRequestSchema=Kt,c.GenAIException=gt,c.GenerationMetadataSchema=ze,c.GenerationResponseSchema=nt,c.ImageGenerationRequestSchema=He,c.PACKAGE_NAME=fa,c.PaginatedRequestSchema=Xt,c.PaginatedResponseSchema=tt,c.PaginationInfoSchema=et,c.PaginationParamsSchema=We,c.PartialAssetUpdateSchema=Fe,c.ProviderAuthError=Te,c.ProviderError=j,c.ProviderQuotaError=ht,c.ProviderRateLimitError=Ae,c.ProviderRegistry=yt,c.ProviderTimeoutError=ft,c.ProviderValidationError=mt,c.RequestMetadataSchema=Ge,c.ResponseMetadataSchema=Ke,c.SortParamsSchema=Qe,c.UploadMetadataSchema=Ue,c.VERSION=ha,c.VideoGenerationRequestSchema=Ye,c.assetToMediaAttachment=ot,c.createAIContext=vt,c.createRequestValidator=sa,c.createResponseValidator=la,c.formatFileSize=lt,c.getAssetDisplayName=dt,c.getAssetExtension=ct,c.getMediaCount=xt,c.hasAIFeatures=it,c.hasMedia=_t,c.isAsset=S,c.isAssetReady=st,c.isGeneratedAsset=z,c.isMediaAsset=ut,c.safeValidateApiAsset=Ht,c.safeValidateBaseAsset=Jt,c.safeValidateBaseRequest=ta,c.safeValidateBaseResponse=oa,c.validateApiAsset=Qt,c.validateAudioGenerationRequest=na,c.validateBaseAsset=Wt,c.validateBaseRequest=ea,c.validateBaseResponse=ia,c.validateBatchResponse=ca,c.validateGenerationResponse=ua,c.validateImageGenerationRequest=aa,c.validatePaginatedResponse=da,c.validatePartialAssetUpdate=Yt,c.validateVideoGenerationRequest=ra,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|
|
7
|
+
${t}`}return e}function _t(a){return!!(a.attachments&&a.attachments.length>0)}function xt(a,e){return a.attachments?e?a.attachments.filter(t=>t.type===e).length:a.attachments.length:0}var b;(function(a){a.assertEqual=n=>{};function e(n){}a.assertIs=e;function t(n){throw new Error}a.assertNever=t,a.arrayToEnum=n=>{const s={};for(const i of n)s[i]=i;return s},a.getValidEnumValues=n=>{const s=a.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(const o of s)i[o]=n[o];return a.objectValues(i)},a.objectValues=n=>a.objectKeys(n).map(function(s){return n[s]}),a.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const s=[];for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&s.push(i);return s},a.find=(n,s)=>{for(const i of n)if(s(i))return i},a.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function r(n,s=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}a.joinValues=r,a.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(b||(b={}));var Se;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const h=b.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$=a=>{switch(typeof a){case"undefined":return h.undefined;case"string":return h.string;case"number":return Number.isNaN(a)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(a)?h.array:a===null?h.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?h.promise:typeof Map<"u"&&a instanceof Map?h.map:typeof Set<"u"&&a instanceof Set?h.set:typeof Date<"u"&&a instanceof Date?h.date:h.object;default:return h.unknown}},d=b.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 O extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(s){return s.message},r={_errors:[]},n=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)r._errors.push(t(i));else{let o=r,m=0;for(;m<i.path.length;){const p=i.path[m];m===i.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(i))):o[p]=o[p]||{_errors:[]},o=o[p],m++}}};return n(this),r}static assert(e){if(!(e instanceof O))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,b.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}O.create=a=>new O(a);const he=(a,e)=>{let t;switch(a.code){case d.invalid_type:a.received===h.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case d.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,b.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:t=`Unrecognized key(s) in object: ${b.joinValues(a.keys,", ")}`;break;case d.invalid_union:t="Invalid input";break;case d.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${b.joinValues(a.options)}`;break;case d.invalid_enum_value:t=`Invalid enum value. Expected ${b.joinValues(a.options)}, received '${a.received}'`;break;case d.invalid_arguments:t="Invalid function arguments";break;case d.invalid_return_type:t="Invalid function return type";break;case d.invalid_date:t="Invalid date";break;case d.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:b.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case d.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case d.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case d.custom:t="Invalid input";break;case d.invalid_intersection_types:t="Intersection results could not be merged";break;case d.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case d.not_finite:t="Number must be finite";break;default:t=e.defaultError,b.assertNever(a)}return{message:t}};let kt=he;function bt(){return kt}const wt=a=>{const{data:e,path:t,errorMaps:r,issueData:n}=a,s=[...t,...n.path||[]],i={...n,path:s};if(n.message!==void 0)return{...n,path:s,message:n.message};let o="";const m=r.filter(p=>!!p).slice().reverse();for(const p of m)o=p(i,{data:e,defaultError:o}).message;return{...n,path:s,message:o}};function u(a,e){const t=bt(),r=wt({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===he?void 0:he].filter(n=>!!n)});a.common.issues.push(r)}class T{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if(n.status==="aborted")return g;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const s=await n.key,i=await n.value;r.push({key:s,value:i})}return T.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:s,value:i}=n;if(s.status==="aborted"||i.status==="aborted")return g;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}}const g=Object.freeze({status:"aborted"}),X=a=>({status:"dirty",value:a}),R=a=>({status:"valid",value:a}),Re=a=>a.status==="aborted",Ce=a=>a.status==="dirty",U=a=>a.status==="valid",ae=a=>typeof Promise<"u"&&a instanceof Promise;var f;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(f||(f={}));class E{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}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 Ee=(a,e)=>{if(U(e))return{success:!0,data:e.value};if(!a.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new O(a.common.issues);return this._error=t,this._error}}};function v(a){if(!a)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:n}=a;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>{const{message:m}=a;return i.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:m??r??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:m??t??o.defaultError}},description:n}}class x{get description(){return this._def.description}_getType(e){return $(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:$(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ae(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Ee(r,n)}"~validate"(e){var r,n;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return U(s)?{value:s.value}:{issues:t.common.issues}}catch(s){(n=(r=s==null?void 0:s.message)==null?void 0:r.toLowerCase())!=null&&n.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>U(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:$(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(ae(n)?n:Promise.resolve(n));return Ee(r,s)}refine(e,t){const r=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,s)=>{const i=e(n),o=()=>s.addIssue({code:d.custom,...r(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(m=>m?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new J({schema:this,typeName:y.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return V.create(this,this._def)}nullable(){return Q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return I.create(this)}promise(){return ie.create(this,this._def)}or(e){return re.create([this,e],this._def)}and(e){return ne.create(this,e,this._def)}transform(e){return new J({...v(this._def),schema:this,typeName:y.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ve({...v(this._def),innerType:this,defaultValue:t,typeName:y.ZodDefault})}brand(){return new Gt({typeName:y.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new _e({...v(this._def),innerType:this,catchValue:t,typeName:y.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return xe.create(this,e)}readonly(){return ke.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const At=/^c[^\s-]{8,}$/i,Tt=/^[0-9a-z]+$/,St=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Rt=/^[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,Ct=/^[a-z0-9_-]{21}$/i,Et=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,It=/^[-+]?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)?)??$/,Ot=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Nt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let fe;const Zt=/^(?:(?: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])$/,Pt=/^(?:(?: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])$/,jt=/^(([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]))$/,$t=/^(([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])$/,Mt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Vt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ie="((\\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])))",qt=new RegExp(`^${Ie}$`);function Oe(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);const t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Bt(a){return new RegExp(`^${Oe(a)}$`)}function Dt(a){let e=`${Ie}T${Oe(a)}`;const t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Lt(a,e){return!!((e==="v4"||!e)&&Zt.test(a)||(e==="v6"||!e)&&jt.test(a))}function zt(a,e){if(!Et.test(a))return!1;try{const[t]=a.split(".");if(!t)return!1;const r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(r));return!(typeof n!="object"||n===null||"typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Ut(a,e){return!!((e==="v4"||!e)&&Pt.test(a)||(e==="v6"||!e)&&$t.test(a))}class N extends x{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.string,received:s.parsedType}),g}const r=new T;let n;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?u(n,{code:d.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&u(n,{code:d.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ot.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"email",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")fe||(fe=new RegExp(Nt,"u")),fe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"emoji",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")Rt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"uuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")Ct.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"nanoid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")At.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cuid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")Tt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cuid2",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")St.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"ulid",code:d.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),u(n,{validation:"url",code:d.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"regex",code:d.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Dt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?qt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?Bt(s).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:d.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?It.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"duration",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?Lt(e.data,s.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"ip",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?zt(e.data,s.alg)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"jwt",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?Ut(e.data,s.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"cidr",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?Mt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"base64",code:d.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?Vt.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:"base64url",code:d.invalid_string,message:s.message}),r.dirty()):b.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(n=>e.test(n),{validation:t,code:d.invalid_string,...f.errToObj(r)})}_addCheck(e){return new N({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...f.errToObj(e)})}url(e){return this._addCheck({kind:"url",...f.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...f.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...f.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...f.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...f.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...f.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...f.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...f.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...f.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...f.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...f.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...f.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,...f.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,...f.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...f.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...f.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...f.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...f.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...f.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...f.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...f.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...f.errToObj(t)})}nonempty(e){return this.min(1,f.errToObj(e))}trim(){return new N({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new N({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}N.create=a=>new N({checks:[],typeName:y.ZodString,coerce:(a==null?void 0:a.coerce)??!1,...v(a)});function Ft(a,e){const t=(a.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,n=t>r?t:r,s=Number.parseInt(a.toFixed(n).replace(".","")),i=Number.parseInt(e.toFixed(n).replace(".",""));return s%i/10**n}class F extends x{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)!==h.number){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.number,received:s.parsedType}),g}let r;const n=new T;for(const s of this._def.checks)s.kind==="int"?b.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?Ft(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_finite,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,r,n){return new F({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:f.toString(n)}]})}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:f.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:f.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&b.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}F.create=a=>new F({checks:[],typeName:y.ZodNumber,coerce:(a==null?void 0:a.coerce)||!1,...v(a)});class K extends x{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)!==h.bigint)return this._getInvalidInput(e);let r;const n=new T;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),u(r,{code:d.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):b.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:d.invalid_type,expected:h.bigint,received:t.parsedType}),g}gte(e,t){return this.setLimit("min",e,!0,f.toString(t))}gt(e,t){return this.setLimit("min",e,!1,f.toString(t))}lte(e,t){return this.setLimit("max",e,!0,f.toString(t))}lt(e,t){return this.setLimit("max",e,!1,f.toString(t))}setLimit(e,t,r,n){return new K({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:f.toString(n)}]})}_addCheck(e){return new K({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:f.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}K.create=a=>new K({checks:[],typeName:y.ZodBigInt,coerce:(a==null?void 0:a.coerce)??!1,...v(a)});class me extends x{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.boolean,received:r.parsedType}),g}return R(e.data)}}me.create=a=>new me({typeName:y.ZodBoolean,coerce:(a==null?void 0:a.coerce)||!1,...v(a)});class ee extends x{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_type,expected:h.date,received:s.parsedType}),g}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return u(s,{code:d.invalid_date}),g}const r=new T;let n;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:d.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):b.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:f.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:f.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}ee.create=a=>new ee({checks:[],coerce:(a==null?void 0:a.coerce)||!1,typeName:y.ZodDate,...v(a)});class Ne extends x{_parse(e){if(this._getType(e)!==h.symbol){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.symbol,received:r.parsedType}),g}return R(e.data)}}Ne.create=a=>new Ne({typeName:y.ZodSymbol,...v(a)});class Ze extends x{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.undefined,received:r.parsedType}),g}return R(e.data)}}Ze.create=a=>new Ze({typeName:y.ZodUndefined,...v(a)});class Pe extends x{_parse(e){if(this._getType(e)!==h.null){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.null,received:r.parsedType}),g}return R(e.data)}}Pe.create=a=>new Pe({typeName:y.ZodNull,...v(a)});class pe extends x{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}pe.create=a=>new pe({typeName:y.ZodAny,...v(a)});class je extends x{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}je.create=a=>new je({typeName:y.ZodUnknown,...v(a)});class M extends x{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:d.invalid_type,expected:h.never,received:t.parsedType}),g}}M.create=a=>new M({typeName:y.ZodNever,...v(a)});class $e extends x{_parse(e){if(this._getType(e)!==h.undefined){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.void,received:r.parsedType}),g}return R(e.data)}}$e.create=a=>new $e({typeName:y.ZodVoid,...v(a)});class I extends x{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return u(t,{code:d.invalid_type,expected:h.array,received:t.parsedType}),g;if(n.exactLength!==null){const i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(u(t,{code:i?d.too_big:d.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(u(t,{code:d.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(u(t,{code:d.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new E(t,i,t.path,o)))).then(i=>T.mergeArray(r,i));const s=[...t.data].map((i,o)=>n.type._parseSync(new E(t,i,t.path,o)));return T.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new I({...this._def,minLength:{value:e,message:f.toString(t)}})}max(e,t){return new I({...this._def,maxLength:{value:e,message:f.toString(t)}})}length(e,t){return new I({...this._def,exactLength:{value:e,message:f.toString(t)}})}nonempty(e){return this.min(1,e)}}I.create=(a,e)=>new I({type:a,minLength:null,maxLength:null,exactLength:null,typeName:y.ZodArray,...v(e)});function G(a){if(a instanceof A){const e={};for(const t in a.shape){const r=a.shape[t];e[t]=V.create(G(r))}return new A({...a._def,shape:()=>e})}else return a instanceof I?new I({...a._def,type:G(a.element)}):a instanceof V?V.create(G(a.unwrap())):a instanceof Q?Q.create(G(a.unwrap())):a instanceof B?B.create(a.items.map(e=>G(e))):a}class A extends x{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=b.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==h.object){const p=this._getOrReturnCtx(e);return u(p,{code:d.invalid_type,expected:h.object,received:p.parsedType}),g}const{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof M&&this._def.unknownKeys==="strip"))for(const p in n.data)i.includes(p)||o.push(p);const m=[];for(const p of i){const k=s[p],C=n.data[p];m.push({key:{status:"valid",value:p},value:k._parse(new E(n,C,n.path,p)),alwaysSet:p in n.data})}if(this._def.catchall instanceof M){const p=this._def.unknownKeys;if(p==="passthrough")for(const k of o)m.push({key:{status:"valid",value:k},value:{status:"valid",value:n.data[k]}});else if(p==="strict")o.length>0&&(u(n,{code:d.unrecognized_keys,keys:o}),r.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const k of o){const C=n.data[k];m.push({key:{status:"valid",value:k},value:p._parse(new E(n,C,n.path,k)),alwaysSet:k in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const p=[];for(const k of m){const C=await k.key,P=await k.value;p.push({key:C,value:P,alwaysSet:k.alwaysSet})}return p}).then(p=>T.mergeObjectSync(r,p)):T.mergeObjectSync(r,m)}get shape(){return this._def.shape()}strict(e){return f.errToObj,new A({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,i;const n=((i=(s=this._def).errorMap)==null?void 0:i.call(s,t,r).message)??r.defaultError;return t.code==="unrecognized_keys"?{message:f.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new A({...this._def,unknownKeys:"strip"})}passthrough(){return new A({...this._def,unknownKeys:"passthrough"})}extend(e){return new A({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new A({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:y.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new A({...this._def,catchall:e})}pick(e){const t={};for(const r of b.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new A({...this._def,shape:()=>t})}omit(e){const t={};for(const r of b.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new A({...this._def,shape:()=>t})}deepPartial(){return G(this)}partial(e){const t={};for(const r of b.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new A({...this._def,shape:()=>t})}required(e){const t={};for(const r of b.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof V;)s=s._def.innerType;t[r]=s}return new A({...this._def,shape:()=>t})}keyof(){return qe(b.objectKeys(this.shape))}}A.create=(a,e)=>new A({shape:()=>a,unknownKeys:"strip",catchall:M.create(),typeName:y.ZodObject,...v(e)}),A.strictCreate=(a,e)=>new A({shape:()=>a,unknownKeys:"strict",catchall:M.create(),typeName:y.ZodObject,...v(e)}),A.lazycreate=(a,e)=>new A({shape:a,unknownKeys:"strip",catchall:M.create(),typeName:y.ZodObject,...v(e)});class re extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new O(o.ctx.common.issues));return u(t,{code:d.invalid_union,unionErrors:i}),g}if(t.common.async)return Promise.all(r.map(async s=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let s;const i=[];for(const m of r){const p={...t,common:{...t.common,issues:[]},parent:null},k=m._parseSync({data:t.data,path:t.path,parent:p});if(k.status==="valid")return k;k.status==="dirty"&&!s&&(s={result:k,ctx:p}),p.common.issues.length&&i.push(p.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(m=>new O(m));return u(t,{code:d.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}}re.create=(a,e)=>new re({options:a,typeName:y.ZodUnion,...v(e)});function ye(a,e){const t=$(a),r=$(e);if(a===e)return{valid:!0,data:a};if(t===h.object&&r===h.object){const n=b.objectKeys(e),s=b.objectKeys(a).filter(o=>n.indexOf(o)!==-1),i={...a,...e};for(const o of s){const m=ye(a[o],e[o]);if(!m.valid)return{valid:!1};i[o]=m.data}return{valid:!0,data:i}}else if(t===h.array&&r===h.array){if(a.length!==e.length)return{valid:!1};const n=[];for(let s=0;s<a.length;s++){const i=a[s],o=e[s],m=ye(i,o);if(!m.valid)return{valid:!1};n.push(m.data)}return{valid:!0,data:n}}else return t===h.date&&r===h.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}class ne extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(s,i)=>{if(Re(s)||Re(i))return g;const o=ye(s.value,i.value);return o.valid?((Ce(s)||Ce(i))&&t.dirty(),{status:t.value,value:o.data}):(u(r,{code:d.invalid_intersection_types}),g)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>n(s,i)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ne.create=(a,e,t)=>new ne({left:a,right:e,typeName:y.ZodIntersection,...v(t)});class B extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return u(r,{code:d.invalid_type,expected:h.array,received:r.parsedType}),g;if(r.data.length<this._def.items.length)return u(r,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&r.data.length>this._def.items.length&&(u(r,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...r.data].map((i,o)=>{const m=this._def.items[o]||this._def.rest;return m?m._parse(new E(r,i,r.path,o)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>T.mergeArray(t,i)):T.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new B({...this._def,rest:e})}}B.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new B({items:a,typeName:y.ZodTuple,rest:null,...v(e)})};class se extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return u(r,{code:d.invalid_type,expected:h.object,received:r.parsedType}),g;const n=[],s=this._def.keyType,i=this._def.valueType;for(const o in r.data)n.push({key:s._parse(new E(r,o,r.path,o)),value:i._parse(new E(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?T.mergeObjectAsync(t,n):T.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof x?new se({keyType:e,valueType:t,typeName:y.ZodRecord,...v(r)}):new se({keyType:N.create(),valueType:e,typeName:y.ZodRecord,...v(t)})}}class Me extends x{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return u(r,{code:d.invalid_type,expected:h.map,received:r.parsedType}),g;const n=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([o,m],p)=>({key:n._parse(new E(r,o,r.path,[p,"key"])),value:s._parse(new E(r,m,r.path,[p,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const m of i){const p=await m.key,k=await m.value;if(p.status==="aborted"||k.status==="aborted")return g;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const m of i){const p=m.key,k=m.value;if(p.status==="aborted"||k.status==="aborted")return g;(p.status==="dirty"||k.status==="dirty")&&t.dirty(),o.set(p.value,k.value)}return{status:t.value,value:o}}}}Me.create=(a,e,t)=>new Me({valueType:e,keyType:a,typeName:y.ZodMap,...v(t)});class te extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return u(r,{code:d.invalid_type,expected:h.set,received:r.parsedType}),g;const n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(u(r,{code:d.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(u(r,{code:d.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const s=this._def.valueType;function i(m){const p=new Set;for(const k of m){if(k.status==="aborted")return g;k.status==="dirty"&&t.dirty(),p.add(k.value)}return{status:t.value,value:p}}const o=[...r.data.values()].map((m,p)=>s._parse(new E(r,m,r.path,p)));return r.common.async?Promise.all(o).then(m=>i(m)):i(o)}min(e,t){return new te({...this._def,minSize:{value:e,message:f.toString(t)}})}max(e,t){return new te({...this._def,maxSize:{value:e,message:f.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}te.create=(a,e)=>new te({valueType:a,minSize:null,maxSize:null,typeName:y.ZodSet,...v(e)});class Ve extends x{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ve.create=(a,e)=>new Ve({getter:a,typeName:y.ZodLazy,...v(e)});class ge extends x{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}}ge.create=(a,e)=>new ge({value:a,typeName:y.ZodLiteral,...v(e)});function qe(a,e){return new W({values:a,typeName:y.ZodEnum,...v(e)})}class W extends x{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return u(t,{expected:b.joinValues(r),received:t.parsedType,code:d.invalid_type}),g}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return u(t,{received:t.data,code:d.invalid_enum_value,options:r}),g}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return W.create(e,{...this._def,...t})}exclude(e,t=this._def){return W.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}W.create=qe;class Be extends x{_parse(e){const t=b.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const n=b.objectValues(t);return u(r,{expected:b.joinValues(n),received:r.parsedType,code:d.invalid_type}),g}if(this._cache||(this._cache=new Set(b.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=b.objectValues(t);return u(r,{received:r.data,code:d.invalid_enum_value,options:n}),g}return R(e.data)}get enum(){return this._def.values}}Be.create=(a,e)=>new Be({values:a,typeName:y.ZodNativeEnum,...v(e)});class ie extends x{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return u(t,{code:d.invalid_type,expected:h.promise,received:t.parsedType}),g;const r=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return R(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ie.create=(a,e)=>new ie({type:a,typeName:y.ZodPromise,...v(e)});class J extends x{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===y.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:i=>{u(r,i),i.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){const i=n.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return g;const m=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return m.status==="aborted"?g:m.status==="dirty"||t.value==="dirty"?X(m.value):m});{if(t.value==="aborted")return g;const o=this._def.schema._parseSync({data:i,path:r.path,parent:r});return o.status==="aborted"?g:o.status==="dirty"||t.value==="dirty"?X(o.value):o}}if(n.type==="refinement"){const i=o=>{const m=n.refinement(o,s);if(r.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!U(i))return g;const o=n.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>U(i)?Promise.resolve(n.transform(i.value,s)).then(o=>({status:t.value,value:o})):g);b.assertNever(n)}}J.create=(a,e,t)=>new J({schema:a,typeName:y.ZodEffects,effect:e,...v(t)}),J.createWithPreprocess=(a,e,t)=>new J({schema:e,effect:{type:"preprocess",transform:a},typeName:y.ZodEffects,...v(t)});class V extends x{_parse(e){return this._getType(e)===h.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(a,e)=>new V({innerType:a,typeName:y.ZodOptional,...v(e)});class Q extends x{_parse(e){return this._getType(e)===h.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Q.create=(a,e)=>new Q({innerType:a,typeName:y.ZodNullable,...v(e)});class ve extends x{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ve.create=(a,e)=>new ve({innerType:a,typeName:y.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class _e extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ae(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new O(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}_e.create=(a,e)=>new _e({innerType:a,typeName:y.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class De extends x{_parse(e){if(this._getType(e)!==h.nan){const r=this._getOrReturnCtx(e);return u(r,{code:d.invalid_type,expected:h.nan,received:r.parsedType}),g}return{status:"valid",value:e.data}}}De.create=a=>new De({typeName:y.ZodNaN,...v(a)});class Gt extends x{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class xe extends x{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?g:s.status==="dirty"?(t.dirty(),X(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?g:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new xe({in:e,out:t,typeName:y.ZodPipeline})}}class ke extends x{_parse(e){const t=this._def.innerType._parse(e),r=n=>(U(n)&&(n.value=Object.freeze(n.value)),n);return ae(t)?t.then(n=>r(n)):r(t)}unwrap(){return this._def.innerType}}ke.create=(a,e)=>new ke({innerType:a,typeName:y.ZodReadonly,...v(e)});var y;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})(y||(y={}));const l=N.create,_=F.create,oe=me.create,Z=ee.create,D=pe.create;M.create;const L=I.create,w=A.create,Le=re.create;ne.create,B.create;const de=se.create,be=ge.create,H=W.create;ie.create,V.create,Q.create;const ce=w({id:l().min(1,"Asset ID is required"),type:H(["image","video","audio","text","graphics"]),url:l().url("Invalid URL format"),projectId:l().min(1,"Project ID is required"),createdAt:Z().or(l().transform(a=>new Date(a))),updatedAt:Z().or(l().transform(a=>new Date(a))).optional()}),ze=w({prompt:l().optional(),negativePrompt:l().optional(),model:l().optional(),modelVersion:l().optional(),settings:de(D()).optional(),cost:_().min(0).optional(),processingTime:_().min(0).optional(),attempts:_().int().min(1).optional(),jobId:l().optional()}),Ue=w({userId:l(),projectId:l().optional(),uploadedAt:l().optional(),source:H(["direct","url","presigned"]),originalName:l().optional(),originalUrl:l().url().optional(),uploadedUrl:l().url().optional(),contentType:l(),size:_().min(0).optional(),folder:l().optional(),dimensions:w({width:_().int().positive(),height:_().int().positive()}).optional(),duration:_().positive().optional()}),ue=ce.extend({name:l().optional(),sceneId:l().optional(),provider:l().min(1,"Provider is required"),uploadMetadata:Ue.optional(),generationMetadata:ze.optional(),processingMetadata:w({sourceAssetId:l().optional(),transformations:L(w({type:l(),parameters:de(D())})).optional(),compression:w({quality:_().min(0).max(100).optional(),format:l().optional(),bitrate:_().positive().optional()}).optional(),processedAt:Z().optional(),processingTime:_().min(0).optional()}).optional(),dimensions:w({width:_().int().positive(),height:_().int().positive()}).optional(),duration:_().positive().optional(),size:_().min(0).optional(),contentType:l().optional(),tags:L(l()).optional(),rights:w({license:H(["creative-commons","royalty-free","rights-managed","custom"]).optional(),attribution:l().optional(),restrictions:L(l()).optional(),expiresAt:Z().optional(),owner:l().optional()}).optional()});function Wt(a){return ce.parse(a)}function Jt(a){return ce.safeParse(a)}function Qt(a){return ue.parse(a)}function Ht(a){return ue.safeParse(a)}const Fe=ue.partial().required({id:!0});function Yt(a){return Fe.parse(a)}const Ge=w({requestId:l().optional(),clientId:l().optional(),version:l().optional(),timestamp:Z().or(l().transform(a=>new Date(a))).optional(),source:H(["web","mobile","api","internal"]).optional()}).passthrough(),q=w({projectId:l().min(1,"Project ID is required"),userId:l().optional(),metadata:Ge.optional()}),We=w({page:_().int().min(1).optional(),limit:_().int().min(1).max(100).optional(),cursor:l().optional()}),Xt=q.extend({pagination:We.optional()}),Je=w({type:Le([l(),L(l())]).optional(),status:Le([l(),L(l())]).optional(),dateRange:w({from:Z().or(l().transform(a=>new Date(a))),to:Z().or(l().transform(a=>new Date(a)))}).optional()}).passthrough(),Qe=w({field:l().min(1,"Sort field is required"),order:H(["asc","desc"])}),Kt=q.extend({filters:Je.optional(),sort:Qe.optional()}),He=q.extend({assetType:be("image"),prompt:l().min(1,"Prompt is required"),negativePrompt:l().optional(),style:l().optional(),quality:H(["standard","hd"]).optional(),dimensions:w({width:_().int().min(64).max(4096),height:_().int().min(64).max(4096)}).optional(),numberOfImages:_().int().min(1).max(10).optional(),provider:l().optional(),sceneId:l().optional()}),Ye=q.extend({assetType:be("video"),prompt:l().min(1,"Prompt is required"),duration:_().min(1).max(120),style:l().optional(),quality:l().optional(),fps:_().int().min(1).max(120).optional(),provider:l().optional(),sceneId:l().optional()}),Xe=q.extend({assetType:be("audio"),text:l().optional(),prompt:l().optional(),voiceId:l().optional(),duration:_().min(.5).max(300).optional(),settings:de(D()).optional(),provider:l().optional(),sceneId:l().optional()}).refine(a=>a.text||a.prompt,{message:"Either text or prompt is required"});function ea(a){return q.parse(a)}function ta(a){return q.safeParse(a)}function aa(a){return He.parse(a)}function ra(a){return Ye.parse(a)}function na(a){return Xe.parse(a)}function sa(a){return e=>a.parse(e)}const we=w({code:l().min(1,"Error code is required"),message:l().min(1,"Error message is required"),details:de(D()).optional(),stack:l().optional(),timestamp:l().datetime()}),Ke=w({requestId:l().optional(),processingTime:_().min(0).optional(),version:l().optional(),timestamp:Z().or(l().transform(a=>new Date(a))).optional(),rateLimit:w({limit:_().int().positive(),remaining:_().int().min(0),reset:Z().or(l().transform(a=>new Date(a)))}).optional()}).passthrough(),Y=w({success:oe(),data:D().optional(),error:we.optional(),metadata:Ke.optional()}),et=w({page:_().int().min(1),limit:_().int().min(1),total:_().int().min(0),totalPages:_().int().min(0),hasNext:oe(),hasPrevious:oe(),nextCursor:l().optional(),previousCursor:l().optional()}),tt=Y.extend({data:L(D()),pagination:et.optional()}),at=w({index:_().int().min(0),success:oe(),data:D().optional(),error:we.optional()}),rt=Y.omit({data:!0}).extend({results:L(at),summary:w({total:_().int().min(0),succeeded:_().int().min(0),failed:_().int().min(0),skipped:_().int().min(0)})}),nt=Y.extend({provider:l().min(1,"Provider is required"),processingTime:_().min(0).optional(),cost:_().min(0).optional()});function ia(a){return Y.parse(a)}function oa(a){return Y.safeParse(a)}function da(a){return tt.parse(a)}function ca(a){return rt.parse(a)}function ua(a){return nt.parse(a)}function la(a){return e=>a.parse(e)}const ha="1.3.1",fa="@etaio/core-types";c.ApiAssetSchema=ue,c.AudioGenerationRequestSchema=Xe,c.BaseAssetSchema=ce,c.BaseProviderManager=pt,c.BaseRequestSchema=q,c.BaseResponseSchema=Y,c.BatchResponseSchema=rt,c.BatchResultSchema=at,c.ErrorResponseSchema=we,c.FilterParamsSchema=Je,c.FilteredRequestSchema=Kt,c.GenAIException=gt,c.GenerationMetadataSchema=ze,c.GenerationResponseSchema=nt,c.ImageGenerationRequestSchema=He,c.PACKAGE_NAME=fa,c.PaginatedRequestSchema=Xt,c.PaginatedResponseSchema=tt,c.PaginationInfoSchema=et,c.PaginationParamsSchema=We,c.PartialAssetUpdateSchema=Fe,c.ProviderAuthError=Te,c.ProviderError=j,c.ProviderQuotaError=ht,c.ProviderRateLimitError=Ae,c.ProviderRegistry=yt,c.ProviderTimeoutError=ft,c.ProviderValidationError=mt,c.RequestMetadataSchema=Ge,c.ResponseMetadataSchema=Ke,c.SortParamsSchema=Qe,c.UploadMetadataSchema=Ue,c.VERSION=ha,c.VideoGenerationRequestSchema=Ye,c.assetToMediaAttachment=ot,c.createAIContext=vt,c.createRequestValidator=sa,c.createResponseValidator=la,c.formatFileSize=lt,c.getAssetDisplayName=dt,c.getAssetExtension=ct,c.getMediaCount=xt,c.hasAIFeatures=it,c.hasMedia=_t,c.isAsset=S,c.isAssetReady=st,c.isGeneratedAsset=z,c.isMediaAsset=ut,c.safeValidateApiAsset=Ht,c.safeValidateBaseAsset=Jt,c.safeValidateBaseRequest=ta,c.safeValidateBaseResponse=oa,c.validateApiAsset=Qt,c.validateAudioGenerationRequest=na,c.validateBaseAsset=Wt,c.validateBaseRequest=ea,c.validateBaseResponse=ia,c.validateBatchResponse=ca,c.validateGenerationResponse=ua,c.validateImageGenerationRequest=aa,c.validatePaginatedResponse=da,c.validatePartialAssetUpdate=Yt,c.validateVideoGenerationRequest=ra,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
|