@bylqwjc/media-editor-video 1.0.0
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/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/chunk-EK7ODJWE.js +1 -0
- package/dist/index-CX2iAapm.d.ts +51 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +2273 -0
- package/dist/lazy.d.ts +7 -0
- package/dist/lazy.js +1 -0
- package/dist/legacy.js +65 -0
- package/node_modules/@media-editor/client/LICENSE +21 -0
- package/node_modules/@media-editor/client/README.md +27 -0
- package/node_modules/@media-editor/client/dist/index.d.ts +24 -0
- package/node_modules/@media-editor/client/dist/index.js +1 -0
- package/node_modules/@media-editor/client/package.json +22 -0
- package/node_modules/@media-editor/core/LICENSE +21 -0
- package/node_modules/@media-editor/core/README.md +14 -0
- package/node_modules/@media-editor/core/dist/browser.d.ts +100 -0
- package/node_modules/@media-editor/core/dist/browser.js +3 -0
- package/node_modules/@media-editor/core/dist/chunk-MGKYVYOH.js +1 -0
- package/node_modules/@media-editor/core/dist/chunk-USY6UDGL.js +1 -0
- package/node_modules/@media-editor/core/dist/chunk-XCBM7P7N.js +1 -0
- package/node_modules/@media-editor/core/dist/engine.d.ts +359 -0
- package/node_modules/@media-editor/core/dist/engine.js +1 -0
- package/node_modules/@media-editor/core/dist/index.d.ts +264 -0
- package/node_modules/@media-editor/core/dist/index.js +1 -0
- package/node_modules/@media-editor/core/dist/platform-presets-B-o4C6uY.d.ts +80 -0
- package/node_modules/@media-editor/core/dist/state-B85vkf7_.d.ts +1027 -0
- package/node_modules/@media-editor/core/node_modules/zod/LICENSE +21 -0
- package/node_modules/@media-editor/core/node_modules/zod/README.md +208 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/index.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/package.json +74 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/ZodError.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/errors.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/external.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/enumUtil.js +0 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/errorUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/parseUtil.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/partialUtil.js +0 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/typeAliases.js +0 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/helpers/util.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/index.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/locales/en.js +1 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/standard-schema.js +0 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/@media-editor/core/node_modules/zod/v3/types.js +1 -0
- package/node_modules/@media-editor/core/package.json +34 -0
- package/package.json +33 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ZodError as N,ZodIssueCode as d}from"./ZodError.js";import{defaultErrorMap as _e,getErrorMap as ye}from"./errors.js";import{errorUtil as l}from"./helpers/errorUtil.js";import{DIRTY as B,INVALID as m,OK as k,ParseStatus as w,addIssueToContext as c,isAborted as ge,isAsync as Y,isDirty as ve,isValid as z,makeIssue as xe}from"./helpers/parseUtil.js";import{util as v,ZodParsedType as f,getParsedType as I}from"./helpers/util.js";class T{constructor(e,t,s,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const ke=(r,e)=>{if(z(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new N(r.common.issues);return this._error=t,this._error}}};function _(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:a}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,i)=>{const{message:u}=r;return o.code==="invalid_enum_value"?{message:u??i.defaultError}:typeof i.data>"u"?{message:u??s??i.defaultError}:o.code!=="invalid_type"?{message:i.defaultError}:{message:u??t??i.defaultError}},description:a}}class y{get description(){return this._def.description}_getType(e){return I(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new w,ctx:{common:e.parent.common,data:e.data,parsedType:I(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Y(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},a=this._parseSync({data:e,path:s.path,parent:s});return ke(s,a)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return z(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>z(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:I(e)},a=this._parse({data:e,path:s.path,parent:s}),n=await(Y(a)?a:Promise.resolve(a));return ke(s,n)}refine(e,t){const s=a=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,n)=>{const o=e(a),i=()=>n.addIssue({code:d.custom,...s(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,t){return this._refinement((s,a)=>e(s)?!0:(a.addIssue(typeof t=="function"?t(s,a):t),!1))}_refinement(e){return new C({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return R.create(this,this._def)}nullable(){return j.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return A.create(this)}promise(){return W.create(this,this._def)}or(e){return Q.create([this,e],this._def)}and(e){return X.create(this,e,this._def)}transform(e){return new C({..._(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new se({..._(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new Ce({typeName:p.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new re({..._(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ie.create(this,e)}readonly(){return ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ne=/^c[^\s-]{8,}$/i,Ie=/^[0-9a-z]+$/,Ee=/^[0-9A-HJKMNP-TV-Z]{26}$/i,je=/^[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,Me=/^[a-z0-9_-]{21}$/i,Ve=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Le=/^[-+]?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)?)??$/,ze=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Pe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let de;const $e=/^(?:(?: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])$/,De=/^(?:(?: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])$/,Ue=/^(([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]))$/,Be=/^(([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])$/,Fe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,We=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,we="((\\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])))",Je=new RegExp(`^${we}$`);function be(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);const t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Ye(r){return new RegExp(`^${be(r)}$`)}function qe(r){let e=`${we}T${be(r)}`;const t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function He(r,e){return!!((e==="v4"||!e)&&$e.test(r)||(e==="v6"||!e)&&Ue.test(r))}function Ge(r,e){if(!Ve.test(r))return!1;try{const[t]=r.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(s));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Qe(r,e){return!!((e==="v4"||!e)&&De.test(r)||(e==="v6"||!e)&&Be.test(r))}class Z extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==f.string){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:f.string,received:n.parsedType}),m}const s=new w;let a;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){const o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(a=this._getOrReturnCtx(e,a),o?c(a,{code:d.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&c(a,{code:d.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")ze.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"email",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")de||(de=new RegExp(Pe,"u")),de.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"emoji",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")je.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"uuid",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")Me.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"nanoid",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")Ne.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")Ie.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cuid2",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")Ee.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ulid",code:d.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),c(a,{validation:"url",code:d.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"regex",code:d.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?qe(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?Je.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?Ye(n).test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{code:d.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?Le.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"duration",code:d.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?He(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"ip",code:d.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?Ge(e.data,n.alg)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"jwt",code:d.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?Qe(e.data,n.version)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"cidr",code:d.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?Fe.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64",code:d.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?We.test(e.data)||(a=this._getOrReturnCtx(e,a),c(a,{validation:"base64url",code:d.invalid_string,message:n.message}),s.dirty()):v.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(a=>e.test(a),{validation:t,code:d.invalid_string,...l.errToObj(s)})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...l.errToObj(e)})}url(e){return this._addCheck({kind:"url",...l.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...l.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...l.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...l.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...l.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...l.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...l.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...l.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...l.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...l.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...l.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...l.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?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...l.errToObj(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?.precision>"u"?null:e?.precision,...l.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...l.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...l.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...l.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...l.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...l.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...l.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...l.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...l.errToObj(t)})}nonempty(e){return this.min(1,l.errToObj(e))}trim(){return new Z({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Z({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Z.create=r=>new Z({checks:[],typeName:p.ZodString,coerce:r?.coerce??!1,..._(r)});function Xe(r,e){const t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,a=t>s?t:s,n=Number.parseInt(r.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return n%o/10**a}class M extends y{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)!==f.number){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:f.number,received:n.parsedType}),m}let s;const a=new w;for(const n of this._def.checks)n.kind==="int"?v.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),c(s,{code:d.invalid_type,expected:"integer",received:"float",message:n.message}),a.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),a.dirty()):n.kind==="multipleOf"?Xe(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),c(s,{code:d.not_finite,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,s,a){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.toString(a)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:l.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:l.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.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"&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}M.create=r=>new M({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,..._(r)});class V extends y{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)!==f.bigint)return this._getInvalidInput(e);let s;const a=new w;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),a.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),c(s,{code:d.not_multiple_of,multipleOf:n.value,message:n.message}),a.dirty()):v.assertNever(n);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:f.bigint,received:t.parsedType}),m}gte(e,t){return this.setLimit("min",e,!0,l.toString(t))}gt(e,t){return this.setLimit("min",e,!1,l.toString(t))}lte(e,t){return this.setLimit("max",e,!0,l.toString(t))}lt(e,t){return this.setLimit("max",e,!1,l.toString(t))}setLimit(e,t,s,a){return new V({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:l.toString(a)}]})}_addCheck(e){return new V({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:l.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}}V.create=r=>new V({checks:[],typeName:p.ZodBigInt,coerce:r?.coerce??!1,..._(r)});class q extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==f.boolean){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.boolean,received:s.parsedType}),m}return k(e.data)}}q.create=r=>new q({typeName:p.ZodBoolean,coerce:r?.coerce||!1,..._(r)});class D extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==f.date){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_type,expected:f.date,received:n.parsedType}),m}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return c(n,{code:d.invalid_date}),m}const s=new w;let a;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(a=this._getOrReturnCtx(e,a),c(a,{code:d.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):v.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:l.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:l.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}}D.create=r=>new D({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,..._(r)});class ce extends y{_parse(e){if(this._getType(e)!==f.symbol){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.symbol,received:s.parsedType}),m}return k(e.data)}}ce.create=r=>new ce({typeName:p.ZodSymbol,..._(r)});class H extends y{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.undefined,received:s.parsedType}),m}return k(e.data)}}H.create=r=>new H({typeName:p.ZodUndefined,..._(r)});class G extends y{_parse(e){if(this._getType(e)!==f.null){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.null,received:s.parsedType}),m}return k(e.data)}}G.create=r=>new G({typeName:p.ZodNull,..._(r)});class F extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}F.create=r=>new F({typeName:p.ZodAny,..._(r)});class P extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}P.create=r=>new P({typeName:p.ZodUnknown,..._(r)});class E extends y{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:d.invalid_type,expected:f.never,received:t.parsedType}),m}}E.create=r=>new E({typeName:p.ZodNever,..._(r)});class ue extends y{_parse(e){if(this._getType(e)!==f.undefined){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.void,received:s.parsedType}),m}return k(e.data)}}ue.create=r=>new ue({typeName:p.ZodVoid,..._(r)});class A extends y{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),a=this._def;if(t.parsedType!==f.array)return c(t,{code:d.invalid_type,expected:f.array,received:t.parsedType}),m;if(a.exactLength!==null){const o=t.data.length>a.exactLength.value,i=t.data.length<a.exactLength.value;(o||i)&&(c(t,{code:o?d.too_big:d.too_small,minimum:i?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(c(t,{code:d.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(c(t,{code:d.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,i)=>a.type._parseAsync(new T(t,o,t.path,i)))).then(o=>w.mergeArray(s,o));const n=[...t.data].map((o,i)=>a.type._parseSync(new T(t,o,t.path,i)));return w.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:l.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:l.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:l.toString(t)}})}nonempty(e){return this.min(1,e)}}A.create=(r,e)=>new A({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,..._(e)});function $(r){if(r instanceof x){const e={};for(const t in r.shape){const s=r.shape[t];e[t]=R.create($(s))}return new x({...r._def,shape:()=>e})}else return r instanceof A?new A({...r._def,type:$(r.element)}):r instanceof R?R.create($(r.unwrap())):r instanceof j?j.create($(r.unwrap())):r instanceof O?O.create(r.items.map(e=>$(e))):r}class x extends y{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=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==f.object){const h=this._getOrReturnCtx(e);return c(h,{code:d.invalid_type,expected:f.object,received:h.parsedType}),m}const{status:s,ctx:a}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof E&&this._def.unknownKeys==="strip"))for(const h in a.data)o.includes(h)||i.push(h);const u=[];for(const h of o){const g=n[h],b=a.data[h];u.push({key:{status:"valid",value:h},value:g._parse(new T(a,b,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof E){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of i)u.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(h==="strict")i.length>0&&(c(a,{code:d.unrecognized_keys,keys:i}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const g of i){const b=a.data[g];u.push({key:{status:"valid",value:g},value:h._parse(new T(a,b,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const g of u){const b=await g.key,me=await g.value;h.push({key:b,value:me,alwaysSet:g.alwaysSet})}return h}).then(h=>w.mergeObjectSync(s,h)):w.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return l.errToObj,new x({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const a=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:l.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new x({...this._def,unknownKeys:"strip"})}passthrough(){return new x({...this._def,unknownKeys:"passthrough"})}extend(e){return new x({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new x({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new x({...this._def,catchall:e})}pick(e){const t={};for(const s of v.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new x({...this._def,shape:()=>t})}omit(e){const t={};for(const s of v.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new x({...this._def,shape:()=>t})}deepPartial(){return $(this)}partial(e){const t={};for(const s of v.objectKeys(this.shape)){const a=this.shape[s];e&&!e[s]?t[s]=a:t[s]=a.optional()}return new x({...this._def,shape:()=>t})}required(e){const t={};for(const s of v.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof R;)n=n._def.innerType;t[s]=n}return new x({...this._def,shape:()=>t})}keyof(){return Te(v.objectKeys(this.shape))}}x.create=(r,e)=>new x({shape:()=>r,unknownKeys:"strip",catchall:E.create(),typeName:p.ZodObject,..._(e)}),x.strictCreate=(r,e)=>new x({shape:()=>r,unknownKeys:"strict",catchall:E.create(),typeName:p.ZodObject,..._(e)}),x.lazycreate=(r,e)=>new x({shape:r,unknownKeys:"strip",catchall:E.create(),typeName:p.ZodObject,..._(e)});class Q extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function a(n){for(const i of n)if(i.result.status==="valid")return i.result;for(const i of n)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;const o=n.map(i=>new N(i.ctx.common.issues));return c(t,{code:d.invalid_union,unionErrors:o}),m}if(t.common.async)return Promise.all(s.map(async n=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(a);{let n;const o=[];for(const u of s){const h={...t,common:{...t.common,issues:[]},parent:null},g=u._parseSync({data:t.data,path:t.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!n&&(n={result:g,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const i=o.map(u=>new N(u));return c(t,{code:d.invalid_union,unionErrors:i}),m}}get options(){return this._def.options}}Q.create=(r,e)=>new Q({options:r,typeName:p.ZodUnion,..._(e)});const S=r=>r instanceof K?S(r.schema):r instanceof C?S(r.innerType()):r instanceof ee?[r.value]:r instanceof L?r.options:r instanceof te?v.objectValues(r.enum):r instanceof se?S(r._def.innerType):r instanceof H?[void 0]:r instanceof G?[null]:r instanceof R?[void 0,...S(r.unwrap())]:r instanceof j?[null,...S(r.unwrap())]:r instanceof Ce||r instanceof ae?S(r.unwrap()):r instanceof re?S(r._def.innerType):[];class pe extends y{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.object)return c(t,{code:d.invalid_type,expected:f.object,received:t.parsedType}),m;const s=this.discriminator,a=t.data[s],n=this.optionsMap.get(a);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){const a=new Map;for(const n of t){const o=S(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of o){if(a.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);a.set(i,n)}}return new pe({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a,..._(s)})}}function le(r,e){const t=I(r),s=I(e);if(r===e)return{valid:!0,data:r};if(t===f.object&&s===f.object){const a=v.objectKeys(e),n=v.objectKeys(r).filter(i=>a.indexOf(i)!==-1),o={...r,...e};for(const i of n){const u=le(r[i],e[i]);if(!u.valid)return{valid:!1};o[i]=u.data}return{valid:!0,data:o}}else if(t===f.array&&s===f.array){if(r.length!==e.length)return{valid:!1};const a=[];for(let n=0;n<r.length;n++){const o=r[n],i=e[n],u=le(o,i);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return t===f.date&&s===f.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class X extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=(n,o)=>{if(ge(n)||ge(o))return m;const i=le(n.value,o.value);return i.valid?((ve(n)||ve(o))&&t.dirty(),{status:t.value,value:i.data}):(c(s,{code:d.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,o])=>a(n,o)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}X.create=(r,e,t)=>new X({left:r,right:e,typeName:p.ZodIntersection,..._(t)});class O extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.array)return c(s,{code:d.invalid_type,expected:f.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return c(s,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(c(s,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...s.data].map((o,i)=>{const u=this._def.items[i]||this._def.rest;return u?u._parse(new T(s,o,s.path,i)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>w.mergeArray(t,o)):w.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new O({...this._def,rest:e})}}O.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new O({items:r,typeName:p.ZodTuple,rest:null,..._(e)})};class ne extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.object)return c(s,{code:d.invalid_type,expected:f.object,received:s.parsedType}),m;const a=[],n=this._def.keyType,o=this._def.valueType;for(const i in s.data)a.push({key:n._parse(new T(s,i,s.path,i)),value:o._parse(new T(s,s.data[i],s.path,i)),alwaysSet:i in s.data});return s.common.async?w.mergeObjectAsync(t,a):w.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof y?new ne({keyType:e,valueType:t,typeName:p.ZodRecord,..._(s)}):new ne({keyType:Z.create(),valueType:e,typeName:p.ZodRecord,..._(t)})}}class he extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.map)return c(s,{code:d.invalid_type,expected:f.map,received:s.parsedType}),m;const a=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([i,u],h)=>({key:a._parse(new T(s,i,s.path,[h,"key"])),value:n._parse(new T(s,u,s.path,[h,"value"]))}));if(s.common.async){const i=new Map;return Promise.resolve().then(async()=>{for(const u of o){const h=await u.key,g=await u.value;if(h.status==="aborted"||g.status==="aborted")return m;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(h.value,g.value)}return{status:t.value,value:i}})}else{const i=new Map;for(const u of o){const h=u.key,g=u.value;if(h.status==="aborted"||g.status==="aborted")return m;(h.status==="dirty"||g.status==="dirty")&&t.dirty(),i.set(h.value,g.value)}return{status:t.value,value:i}}}}he.create=(r,e,t)=>new he({valueType:e,keyType:r,typeName:p.ZodMap,..._(t)});class U extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==f.set)return c(s,{code:d.invalid_type,expected:f.set,received:s.parsedType}),m;const a=this._def;a.minSize!==null&&s.data.size<a.minSize.value&&(c(s,{code:d.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&s.data.size>a.maxSize.value&&(c(s,{code:d.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const n=this._def.valueType;function o(u){const h=new Set;for(const g of u){if(g.status==="aborted")return m;g.status==="dirty"&&t.dirty(),h.add(g.value)}return{status:t.value,value:h}}const i=[...s.data.values()].map((u,h)=>n._parse(new T(s,u,s.path,h)));return s.common.async?Promise.all(i).then(u=>o(u)):o(i)}min(e,t){return new U({...this._def,minSize:{value:e,message:l.toString(t)}})}max(e,t){return new U({...this._def,maxSize:{value:e,message:l.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}U.create=(r,e)=>new U({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,..._(e)});class J extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.function)return c(t,{code:d.invalid_type,expected:f.function,received:t.parsedType}),m;function s(i,u){return xe({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ye(),_e].filter(h=>!!h),issueData:{code:d.invalid_arguments,argumentsError:u}})}function a(i,u){return xe({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ye(),_e].filter(h=>!!h),issueData:{code:d.invalid_return_type,returnTypeError:u}})}const n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof W){const i=this;return k(async function(...u){const h=new N([]),g=await i._def.args.parseAsync(u,n).catch(oe=>{throw h.addIssue(s(u,oe)),h}),b=await Reflect.apply(o,this,g);return await i._def.returns._def.type.parseAsync(b,n).catch(oe=>{throw h.addIssue(a(b,oe)),h})})}else{const i=this;return k(function(...u){const h=i._def.args.safeParse(u,n);if(!h.success)throw new N([s(u,h.error)]);const g=Reflect.apply(o,this,h.data),b=i._def.returns.safeParse(g,n);if(!b.success)throw new N([a(g,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new J({...this._def,args:O.create(e).rest(P.create())})}returns(e){return new J({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new J({args:e||O.create([]).rest(P.create()),returns:t||P.create(),typeName:p.ZodFunction,..._(s)})}}class K extends y{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})}}K.create=(r,e)=>new K({getter:r,typeName:p.ZodLazy,..._(e)});class ee extends y{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:d.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}}ee.create=(r,e)=>new ee({value:r,typeName:p.ZodLiteral,..._(e)});function Te(r,e){return new L({values:r,typeName:p.ZodEnum,..._(e)})}class L extends y{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return c(t,{expected:v.joinValues(s),received:t.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return c(t,{received:t.data,code:d.invalid_enum_value,options:s}),m}return k(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 L.create(e,{...this._def,...t})}exclude(e,t=this._def){return L.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}L.create=Te;class te extends y{_parse(e){const t=v.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==f.string&&s.parsedType!==f.number){const a=v.objectValues(t);return c(s,{expected:v.joinValues(a),received:s.parsedType,code:d.invalid_type}),m}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=v.objectValues(t);return c(s,{received:s.data,code:d.invalid_enum_value,options:a}),m}return k(e.data)}get enum(){return this._def.values}}te.create=(r,e)=>new te({values:r,typeName:p.ZodNativeEnum,..._(e)});class W extends y{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==f.promise&&t.common.async===!1)return c(t,{code:d.invalid_type,expected:f.promise,received:t.parsedType}),m;const s=t.parsedType===f.promise?t.data:Promise.resolve(t.data);return k(s.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}}W.create=(r,e)=>new W({type:r,typeName:p.ZodPromise,..._(e)});class C extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=this._def.effect||null,n={addIssue:o=>{c(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),a.type==="preprocess"){const o=a.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async i=>{if(t.value==="aborted")return m;const u=await this._def.schema._parseAsync({data:i,path:s.path,parent:s});return u.status==="aborted"?m:u.status==="dirty"?B(u.value):t.value==="dirty"?B(u.value):u});{if(t.value==="aborted")return m;const i=this._def.schema._parseSync({data:o,path:s.path,parent:s});return i.status==="aborted"?m:i.status==="dirty"?B(i.value):t.value==="dirty"?B(i.value):i}}if(a.type==="refinement"){const o=i=>{const u=a.refinement(i,n);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(s.common.async===!1){const i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?m:(i.status==="dirty"&&t.dirty(),o(i.value),{status:t.value,value:i.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>i.status==="aborted"?m:(i.status==="dirty"&&t.dirty(),o(i.value).then(()=>({status:t.value,value:i.value}))))}if(a.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!z(o))return m;const i=a.transform(o.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>z(o)?Promise.resolve(a.transform(o.value,n)).then(i=>({status:t.value,value:i})):m);v.assertNever(a)}}C.create=(r,e,t)=>new C({schema:r,typeName:p.ZodEffects,effect:e,..._(t)}),C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,..._(t)});class R extends y{_parse(e){return this._getType(e)===f.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}R.create=(r,e)=>new R({innerType:r,typeName:p.ZodOptional,..._(e)});class j extends y{_parse(e){return this._getType(e)===f.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}j.create=(r,e)=>new j({innerType:r,typeName:p.ZodNullable,..._(e)});class se extends y{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===f.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}se.create=(r,e)=>new se({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class re extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Y(a)?a.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new N(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}re.create=(r,e)=>new re({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class fe extends y{_parse(e){if(this._getType(e)!==f.nan){const s=this._getOrReturnCtx(e);return c(s,{code:d.invalid_type,expected:f.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}}fe.create=r=>new fe({typeName:p.ZodNaN,..._(r)});const Pt=Symbol("zod_brand");class Ce extends y{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class ie extends y{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),B(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{const a=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:s.path,parent:s})}}static create(e,t){return new ie({in:e,out:t,typeName:p.ZodPipeline})}}class ae extends y{_parse(e){const t=this._def.innerType._parse(e),s=a=>(z(a)&&(a.value=Object.freeze(a.value)),a);return Y(t)?t.then(a=>s(a)):s(t)}unwrap(){return this._def.innerType}}ae.create=(r,e)=>new ae({innerType:r,typeName:p.ZodReadonly,..._(e)});function Ae(r,e){const t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Ke(r,e={},t){return r?F.create().superRefine((s,a)=>{const n=r(s);if(n instanceof Promise)return n.then(o=>{if(!o){const i=Ae(e,s),u=i.fatal??t??!0;a.addIssue({code:"custom",...i,fatal:u})}});if(!n){const o=Ae(e,s),i=o.fatal??t??!0;a.addIssue({code:"custom",...o,fatal:i})}}):F.create()}const $t={object:x.lazycreate};var p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));class Dt{constructor(...e){}}const et=(r,e={message:`Input not instance of ${r.name}`})=>Ke(t=>t instanceof r,e),Ze=Z.create,Se=M.create,tt=fe.create,st=V.create,Re=q.create,rt=D.create,at=ce.create,nt=H.create,it=G.create,ot=F.create,dt=P.create,ct=E.create,ut=ue.create,lt=A.create,ht=x.create,ft=x.strictCreate,pt=Q.create,mt=pe.create,_t=X.create,yt=O.create,gt=ne.create,vt=he.create,xt=U.create,kt=J.create,wt=K.create,bt=ee.create,Tt=L.create,Ct=te.create,At=W.create,Oe=C.create,Zt=R.create,St=j.create,Rt=C.createWithPreprocess,Ot=ie.create,Nt=()=>Ze().optional(),It=()=>Se().optional(),Et=()=>Re().optional(),Ut={string:(r=>Z.create({...r,coerce:!0})),number:(r=>M.create({...r,coerce:!0})),boolean:(r=>q.create({...r,coerce:!0})),bigint:(r=>V.create({...r,coerce:!0})),date:(r=>D.create({...r,coerce:!0}))},Bt=m;export{Pt as BRAND,Bt as NEVER,y as Schema,F as ZodAny,A as ZodArray,V as ZodBigInt,q as ZodBoolean,Ce as ZodBranded,re as ZodCatch,D as ZodDate,se as ZodDefault,pe as ZodDiscriminatedUnion,C as ZodEffects,L as ZodEnum,p as ZodFirstPartyTypeKind,J as ZodFunction,X as ZodIntersection,K as ZodLazy,ee as ZodLiteral,he as ZodMap,fe as ZodNaN,te as ZodNativeEnum,E as ZodNever,G as ZodNull,j as ZodNullable,M as ZodNumber,x as ZodObject,R as ZodOptional,ie as ZodPipeline,W as ZodPromise,ae as ZodReadonly,ne as ZodRecord,y as ZodSchema,U as ZodSet,Z as ZodString,ce as ZodSymbol,C as ZodTransformer,O as ZodTuple,y as ZodType,H as ZodUndefined,Q as ZodUnion,P as ZodUnknown,ue as ZodVoid,ot as any,lt as array,st as bigint,Re as boolean,Ut as coerce,Ke as custom,rt as date,qe as datetimeRegex,mt as discriminatedUnion,Oe as effect,Tt as enum,kt as function,et as instanceof,_t as intersection,$t as late,wt as lazy,bt as literal,vt as map,tt as nan,Ct as nativeEnum,ct as never,it as null,St as nullable,Se as number,ht as object,Et as oboolean,It as onumber,Zt as optional,Nt as ostring,Ot as pipeline,Rt as preprocess,At as promise,gt as record,xt as set,ft as strictObject,Ze as string,at as symbol,Oe as transformer,yt as tuple,nt as undefined,pt as union,dt as unknown,ut as void};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@media-editor/core",
|
|
3
|
+
"version": "1.0.18",
|
|
4
|
+
"description": "媒体编辑器框架无关内核:状态/时间轴/ffmpeg 参数/几何/标注渲染/VideoEditorEngine/图片编辑器纯配置工厂(零 React)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./browser": {
|
|
13
|
+
"types": "./dist/browser.d.ts",
|
|
14
|
+
"import": "./dist/browser.js"
|
|
15
|
+
},
|
|
16
|
+
"./engine": {
|
|
17
|
+
"types": "./dist/engine.d.ts",
|
|
18
|
+
"import": "./dist/engine.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"files": [
|
|
26
|
+
"dist"
|
|
27
|
+
],
|
|
28
|
+
"main": "./dist/index.js",
|
|
29
|
+
"module": "./dist/index.js",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"zod": "3.25.76"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bylqwjc/media-editor-video",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "媒体编辑器框架无关视频运行时:内部打包 React + 完整视频编辑富 UI(时间轴/裁剪/标注/贴纸/滤镜/封面),暴露 mountVideoEditor(el, opts);消费方无需自带 React",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./lazy": {
|
|
13
|
+
"types": "./dist/lazy.d.ts",
|
|
14
|
+
"import": "./dist/lazy.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@media-editor/client": "1.0.18",
|
|
22
|
+
"@media-editor/core": "1.0.18"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"module": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"bundleDependencies": [
|
|
30
|
+
"@media-editor/client",
|
|
31
|
+
"@media-editor/core"
|
|
32
|
+
]
|
|
33
|
+
}
|