@jsdev_ninja/core 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +76 -76
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/entities/Order.d.ts +3 -43
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Order.js +1 -3
- package/dist/entities/Store.d.ts +44 -0
- package/dist/entities/Store.d.ts.map +1 -0
- package/dist/entities/Store.js +15 -0
- package/dist/firebase-api/index.d.ts +2 -0
- package/dist/firebase-api/index.d.ts.map +1 -0
- package/dist/firebase-api/index.js +12 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/lib/entities/Order.ts +1 -4
- package/lib/entities/Store.ts +20 -0
- package/lib/firebase-api/index.ts +13 -0
- package/package.json +1 -1
package/dist/core.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Se;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const h=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),A=r=>{switch(typeof r){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(r)?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(r)?h.array:r===null?h.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?h.promise:typeof Map<"u"&&r instanceof Map?h.map:typeof Set<"u"&&r instanceof Set?h.set:typeof Date<"u"&&r instanceof Date?h.date:h.object;default:return h.unknown}},c=x.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"]),Ye=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,f=0;for(;f<i.path.length;){const u=i.path[f];f===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],f++}}};return s(this),n}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=r=>new T(r);const q=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===h.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let Ae=q;function Je(r){Ae=r}function he(){return Ae}const me=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const f=n.filter(u=>!!u).slice().reverse();for(const u of f)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},He=[];function l(r,e){const t=he(),n=me({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===q?void 0:q].filter(s=>!!s)});r.common.issues.push(n)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return k.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),B=r=>({status:"dirty",value:r}),w=r=>({status:"valid",value:r}),Ze=r=>r.status==="aborted",Ne=r=>r.status==="dirty",Q=r=>r.status==="valid",X=r=>typeof Promise<"u"&&r instanceof Promise;function pe(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Pe(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var H,G;class O{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const je=(r,e)=>{if(Q(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 T(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var f,u;const{message:g}=r;return i.code==="invalid_enum_value"?{message:g??o.defaultError}:typeof o.data>"u"?{message:(f=g??n)!==null&&f!==void 0?f:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=g??t)!==null&&u!==void 0?u:o.defaultError}},description:s}}class _{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return A(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parseSync({data:e,path:s.path,parent:s});return je(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(X(s)?s:Promise.resolve(s));return je(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new C({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return E.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this,this._def)}promise(){return J.create(this,this._def)}or(e){return te.create([this,e],this._def)}and(e){return re.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new oe({...v(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new Ee({typeName:p.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new de({...v(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 ue.create(this,e)}readonly(){return ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Ge=/^c[^\s-]{8,}$/i,Qe=/^[0-9a-z]+$/,Xe=/^[0-9A-HJKMNP-TV-Z]{26}$/,Fe=/^[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,Ke=/^[a-z0-9_-]{21}$/i,et=/^[-+]?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)?)??$/,tt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,rt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let we;const nt=/^(?:(?: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])$/,st=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,at=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Me="((\\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])))",it=new RegExp(`^${Me}$`);function $e(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function ot(r){return new RegExp(`^${$e(r)}$`)}function Ve(r){let e=`${Me}T${$e(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 dt(r,e){return!!((e==="v4"||!e)&&nt.test(r)||(e==="v6"||!e)&&st.test(r))}class Z extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.string,received:a.parsedType}),y}const n=new k;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")tt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")we||(we=new RegExp(rt,"u")),we.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Fe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Ke.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ge.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Qe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Xe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ve(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?it.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?ot(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?et.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?dt(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?at.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...m.errToObj(n)})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...m.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,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...m.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Z.create=r=>{var e;return new Z({checks:[],typeName:p.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function ct(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class P extends _{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 a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.number,received:a.parsedType}),y}let n;const s=new k;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?ct(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.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"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}P.create=r=>new P({checks:[],typeName:p.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class M extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.bigint,received:a.parsedType}),y}let n;const s=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.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}}M.create=r=>{var e;return new M({checks:[],typeName:p.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class F extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.boolean,received:n.parsedType}),y}return w(e.data)}}F.create=r=>new F({typeName:p.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class L extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const n=new k;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.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}}L.create=r=>new L({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:p.ZodDate,...v(r)});class ye extends _{_parse(e){if(this._getType(e)!==h.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.symbol,received:n.parsedType}),y}return w(e.data)}}ye.create=r=>new ye({typeName:p.ZodSymbol,...v(r)});class K extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.undefined,received:n.parsedType}),y}return w(e.data)}}K.create=r=>new K({typeName:p.ZodUndefined,...v(r)});class ee extends _{_parse(e){if(this._getType(e)!==h.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.null,received:n.parsedType}),y}return w(e.data)}}ee.create=r=>new ee({typeName:p.ZodNull,...v(r)});class Y extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}Y.create=r=>new Y({typeName:p.ZodAny,...v(r)});class D extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}D.create=r=>new D({typeName:p.ZodUnknown,...v(r)});class R extends _{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:h.never,received:t.parsedType}),y}}R.create=r=>new R({typeName:p.ZodNever,...v(r)});class ge extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.void,received:n.parsedType}),y}return w(e.data)}}ge.create=r=>new ge({typeName:p.ZodVoid,...v(r)});class N extends _{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==h.array)return l(t,{code:c.invalid_type,expected:h.array,received:t.parsedType}),y;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new O(t,i,t.path,o)))).then(i=>k.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new O(t,i,t.path,o)));return k.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(r,e)=>new N({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...v(e)});function U(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=E.create(U(n))}return new b({...r._def,shape:()=>e})}else return r instanceof N?new N({...r._def,type:U(r.element)}):r instanceof E?E.create(U(r.unwrap())):r instanceof V?V.create(U(r.unwrap())):r instanceof I?I.create(r.items.map(e=>U(e))):r}class b extends _{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=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const u=this._getOrReturnCtx(e);return l(u,{code:c.invalid_type,expected:h.object,received:u.parsedType}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const f=[];for(const u of i){const g=a[u],S=s.data[u];f.push({key:{status:"valid",value:u},value:g._parse(new O(s,S,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof R){const u=this._def.unknownKeys;if(u==="passthrough")for(const g of o)f.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(u==="strict")o.length>0&&(l(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const g of o){const S=s.data[g];f.push({key:{status:"valid",value:g},value:u._parse(new O(s,S,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const g of f){const S=await g.key,Ie=await g.value;u.push({key:S,value:Ie,alwaysSet:g.alwaysSet})}return u}).then(u=>k.mergeObjectSync(n,u)):k.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,i,o;const f=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&i!==void 0?i:n.defaultError;return t.code==="unrecognized_keys"?{message:(o=m.errToObj(e).message)!==null&&o!==void 0?o:f}:{message:f}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({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 b({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}deepPartial(){return U(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof E;)a=a._def.innerType;t[n]=a}}),new b({...this._def,shape:()=>t})}keyof(){return De(x.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:R.create(),typeName:p.ZodObject,...v(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:R.create(),typeName:p.ZodObject,...v(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:R.create(),typeName:p.ZodObject,...v(e)});class te extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new T(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),y}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const f of n){const u={...t,common:{...t.common,issues:[]},parent:null},g=f._parseSync({data:t.data,path:t.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new T(f));return l(t,{code:c.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}}te.create=(r,e)=>new te({options:r,typeName:p.ZodUnion,...v(e)});const j=r=>r instanceof se?j(r.schema):r instanceof C?j(r.innerType()):r instanceof ae?[r.value]:r instanceof $?r.options:r instanceof ie?x.objectValues(r.enum):r instanceof oe?j(r._def.innerType):r instanceof K?[void 0]:r instanceof ee?[null]:r instanceof E?[void 0,...j(r.unwrap())]:r instanceof V?[null,...j(r.unwrap())]:r instanceof Ee||r instanceof ce?j(r.unwrap()):r instanceof de?j(r._def.innerType):[];class xe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return l(t,{code:c.invalid_type,expected:h.object,received:t.parsedType}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const i=j(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new xe({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(n)})}}function Ce(r,e){const t=A(r),n=A(e);if(r===e)return{valid:!0,data:r};if(t===h.object&&n===h.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const f=Ce(r[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===h.array&&n===h.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],f=Ce(i,o);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return t===h.date&&n===h.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class re extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Ze(a)||Ze(i))return y;const o=Ce(a.value,i.value);return o.valid?((Ne(a)||Ne(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:c.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}re.create=(r,e,t)=>new re({left:r,right:e,typeName:p.ZodIntersection,...v(t)});class I extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.array)return l(n,{code:c.invalid_type,expected:h.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new O(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:r,typeName:p.ZodTuple,rest:null,...v(e)})};class ne extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return l(n,{code:c.invalid_type,expected:h.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:a._parse(new O(n,o,n.path,o)),value:i._parse(new O(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?k.mergeObjectAsync(t,s):k.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _?new ne({keyType:e,valueType:t,typeName:p.ZodRecord,...v(n)}):new ne({keyType:Z.create(),valueType:e,typeName:p.ZodRecord,...v(t)})}}class ve extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.map)return l(n,{code:c.invalid_type,expected:h.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,f],u)=>({key:s._parse(new O(n,o,n.path,[u,"key"])),value:a._parse(new O(n,f,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const u=await f.key,g=await f.value;if(u.status==="aborted"||g.status==="aborted")return y;(u.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(u.value,g.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const u=f.key,g=f.value;if(u.status==="aborted"||g.status==="aborted")return y;(u.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(u.value,g.value)}return{status:t.value,value:o}}}}ve.create=(r,e,t)=>new ve({valueType:e,keyType:r,typeName:p.ZodMap,...v(t)});class z extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.set)return l(n,{code:c.invalid_type,expected:h.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const u=new Set;for(const g of f){if(g.status==="aborted")return y;g.status==="dirty"&&t.dirty(),u.add(g.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((f,u)=>a._parse(new O(n,f,n.path,u)));return n.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new z({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new z({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}z.create=(r,e)=>new z({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...v(e)});class W extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return l(t,{code:c.invalid_type,expected:h.function,received:t.parsedType}),y;function n(o,f){return me({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),q].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:f}})}function s(o,f){return me({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),q].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof J){const o=this;return w(async function(...f){const u=new T([]),g=await o._def.args.parseAsync(f,a).catch(ke=>{throw u.addIssue(n(f,ke)),u}),S=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(S,a).catch(ke=>{throw u.addIssue(s(S,ke)),u})})}else{const o=this;return w(function(...f){const u=o._def.args.safeParse(f,a);if(!u.success)throw new T([n(f,u.error)]);const g=Reflect.apply(i,this,u.data),S=o._def.returns.safeParse(g,a);if(!S.success)throw new T([s(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W({...this._def,args:I.create(e).rest(D.create())})}returns(e){return new W({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new W({args:e||I.create([]).rest(D.create()),returns:t||D.create(),typeName:p.ZodFunction,...v(n)})}}class se extends _{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})}}se.create=(r,e)=>new se({getter:r,typeName:p.ZodLazy,...v(e)});class ae extends _{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}ae.create=(r,e)=>new ae({value:r,typeName:p.ZodLiteral,...v(e)});function De(r,e){return new $({values:r,typeName:p.ZodEnum,...v(e)})}class $ extends _{constructor(){super(...arguments),H.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:c.invalid_type}),y}if(pe(this,H)||Pe(this,H,new Set(this._def.values)),!pe(this,H).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),y}return w(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 $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}H=new WeakMap;$.create=De;class ie extends _{constructor(){super(...arguments),G.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.string&&n.parsedType!==h.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:c.invalid_type}),y}if(pe(this,G)||Pe(this,G,new Set(x.getValidEnumValues(this._def.values))),!pe(this,G).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),y}return w(e.data)}get enum(){return this._def.values}}G=new WeakMap;ie.create=(r,e)=>new ie({values:r,typeName:p.ZodNativeEnum,...v(e)});class J extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:h.promise,received:t.parsedType}),y;const n=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return w(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}J.create=(r,e)=>new J({type:r,typeName:p.ZodPromise,...v(e)});class C extends _{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:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?y:f.status==="dirty"||t.value==="dirty"?B(f.value):f});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?B(o.value):o}}if(s.type==="refinement"){const i=o=>{const f=s.refinement(o,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Q(i))return i;const o=s.transform(i.value,a);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:n.data,path:n.path,parent:n}).then(i=>Q(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(s)}}C.create=(r,e,t)=>new C({schema:r,typeName:p.ZodEffects,effect:e,...v(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...v(t)});class E extends _{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}E.create=(r,e)=>new E({innerType:r,typeName:p.ZodOptional,...v(e)});class V extends _{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(r,e)=>new V({innerType:r,typeName:p.ZodNullable,...v(e)});class oe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===h.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class de extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return X(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}de.create=(r,e)=>new de({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class _e extends _{_parse(e){if(this._getType(e)!==h.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}_e.create=r=>new _e({typeName:p.ZodNaN,...v(r)});const ut=Symbol("zod_brand");class Ee extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ue extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),B(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ue({in:e,out:t,typeName:p.ZodPipeline})}}class ce extends _{_parse(e){const t=this._def.innerType._parse(e),n=s=>(Q(s)&&(s.value=Object.freeze(s.value)),s);return X(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}ce.create=(r,e)=>new ce({innerType:r,typeName:p.ZodReadonly,...v(e)});function Le(r,e={},t){return r?Y.create().superRefine((n,s)=>{var a,i;if(!r(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,f=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,u=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...u,fatal:f})}}):Y.create()}const lt={object:b.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={}));const ft=(r,e={message:`Input not instance of ${r.name}`})=>Le(t=>t instanceof r,e),ze=Z.create,Ue=P.create,ht=_e.create,mt=M.create,Be=F.create,pt=L.create,yt=ye.create,gt=K.create,vt=ee.create,_t=Y.create,xt=D.create,bt=R.create,kt=ge.create,wt=N.create,Tt=b.create,St=b.strictCreate,Zt=te.create,Nt=xe.create,Ct=re.create,Et=I.create,Ot=ne.create,It=ve.create,jt=z.create,Rt=W.create,At=se.create,Pt=ae.create,Mt=$.create,$t=ie.create,Vt=J.create,Re=C.create,Dt=E.create,Lt=V.create,zt=C.createWithPreprocess,Ut=ue.create,Bt=()=>ze().optional(),Wt=()=>Ue().optional(),qt=()=>Be().optional(),Yt={string:r=>Z.create({...r,coerce:!0}),number:r=>P.create({...r,coerce:!0}),boolean:r=>F.create({...r,coerce:!0}),bigint:r=>M.create({...r,coerce:!0}),date:r=>L.create({...r,coerce:!0})},Jt=y;var d=Object.freeze({__proto__:null,defaultErrorMap:q,setErrorMap:Je,getErrorMap:he,makeIssue:me,EMPTY_PATH:He,addIssueToContext:l,ParseStatus:k,INVALID:y,DIRTY:B,OK:w,isAborted:Ze,isDirty:Ne,isValid:Q,isAsync:X,get util(){return x},get objectUtil(){return Se},ZodParsedType:h,getParsedType:A,ZodType:_,datetimeRegex:Ve,ZodString:Z,ZodNumber:P,ZodBigInt:M,ZodBoolean:F,ZodDate:L,ZodSymbol:ye,ZodUndefined:K,ZodNull:ee,ZodAny:Y,ZodUnknown:D,ZodNever:R,ZodVoid:ge,ZodArray:N,ZodObject:b,ZodUnion:te,ZodDiscriminatedUnion:xe,ZodIntersection:re,ZodTuple:I,ZodRecord:ne,ZodMap:ve,ZodSet:z,ZodFunction:W,ZodLazy:se,ZodLiteral:ae,ZodEnum:$,ZodNativeEnum:ie,ZodPromise:J,ZodEffects:C,ZodTransformer:C,ZodOptional:E,ZodNullable:V,ZodDefault:oe,ZodCatch:de,ZodNaN:_e,BRAND:ut,ZodBranded:Ee,ZodPipeline:ue,ZodReadonly:ce,custom:Le,Schema:_,ZodSchema:_,late:lt,get ZodFirstPartyTypeKind(){return p},coerce:Yt,any:_t,array:wt,bigint:mt,boolean:Be,date:pt,discriminatedUnion:Nt,effect:Re,enum:Mt,function:Rt,instanceof:ft,intersection:Ct,lazy:At,literal:Pt,map:It,nan:ht,nativeEnum:$t,never:bt,null:vt,nullable:Lt,number:Ue,object:Tt,oboolean:qt,onumber:Wt,optional:Dt,ostring:Bt,pipeline:Ut,preprocess:zt,promise:Vt,record:Ot,set:jt,strictObject:St,string:ze,symbol:yt,transformer:Re,tuple:Et,undefined:gt,union:Zt,unknown:xt,void:kt,NEVER:Jt,ZodIssueCode:c,quotelessJson:Ye,ZodError:T});const We=d.object({country:d.string(),city:d.string(),street:d.string(),streetNumber:d.string(),floor:d.string(),apartmentEnterNumber:d.string(),apartmentNumber:d.string()}),qe=d.object({type:d.literal("Profile"),id:d.string(),companyId:d.string(),storeId:d.string(),tenantId:d.string(),clientType:d.enum(["user","company"]),displayName:d.string().min(1),email:d.string().email(),phoneNumber:d.object({code:d.string(),number:d.string()}),address:We,isAnonymous:d.boolean(),createdDate:d.number(),lastActivityDate:d.number()});function Ht(){return{type:"Profile",id:"",companyId:"",storeId:"",tenantId:"",clientType:"user",displayName:"",email:"",phoneNumber:{code:"+972",number:""},address:{country:"",city:"",street:"",streetNumber:"",floor:"",apartmentEnterNumber:"",apartmentNumber:""},createdDate:0,lastActivityDate:0,isAnonymous:!0}}const fe=d.object({lang:d.string().min(1),value:d.string().min(1)}),Oe=d.object({id:d.string().min(1),companyId:d.string().min(1),storeId:d.string().min(1),parentId:d.string().nullish(),tag:d.string().min(1),locales:d.array(fe),depth:d.number()}),be=Oe.extend({children:d.lazy(()=>be.array())}),Gt=Oe.extend({index:d.number(),depth:d.number(),collapsed:d.boolean().optional(),children:d.array(be)}),Te=d.string(),le=d.object({type:d.literal("Product"),storeId:Te,companyId:Te,id:d.string(),objectID:d.string(),sku:d.string().min(1),name:d.array(fe),description:d.array(fe),isPublished:d.boolean(),vat:d.boolean(),priceType:d.object({type:d.enum(["unit","kg","gram","liter","ml"]),value:d.number()}),price:d.number().positive(),purchasePrice:d.number().optional(),profitPercentage:d.number().optional(),currency:d.literal("ILS"),discount:d.object({type:d.enum(["number","percent","none"]),value:d.number()}),weight:d.object({value:d.number(),unit:d.enum(["kg","gram","none"])}),volume:d.object({value:d.number(),unit:d.enum(["liter","ml","none"])}),images:d.array(d.object({url:d.string().url(),id:d.string()})),manufacturer:Te,brand:d.string(),importer:d.string(),supplier:d.string(),ingredients:d.array(fe),created_at:d.number(),updated_at:d.number(),categoryList:d.array(be),categories:d.object({lvl0:d.array(d.string()),lvl1:d.array(d.string()),lvl2:d.array(d.string()),lvl3:d.array(d.string()),lvl4:d.array(d.string())}),categoryNames:d.array(d.string())}),Qt=le.omit({id:!0,categories:!0,images:!0}).extend({image:d.instanceof(File).optional()}),Xt=le.extend({image:d.instanceof(File).optional()}),Ft=d.object({type:d.literal("Order"),id:d.string(),companyId:d.string(),storeId:d.string(),userId:d.string(),status:d.enum(["pending","processing","delivered","canceled","completed","refunded"]),cart:d.object({id:d.string(),items:d.array(d.object({product:le,amount:d.number()})),cartTotal:d.number(),cartDiscount:d.number(),cartVat:d.number()}),date:d.number(),deliveryDate:d.number().optional(),client:qe,address:We}),Kt=d.object({type:d.literal("FavoriteProduct"),id:d.string().uuid(),companyId:d.string().uuid(),storeId:d.string().uuid(),userId:d.string().uuid(),productId:d.string().uuid()}),er=d.object({type:d.literal("Cart"),id:d.string().uuid(),companyId:d.string().uuid(),storeId:d.string().uuid(),userId:d.string().uuid(),status:d.enum(["active","draft","completed"]),items:d.array(d.object({product:le,amount:d.number().int().positive({message:"Quantity must be a positive integer."})}))});exports.BaseCategorySchema=Oe;exports.CartSchema=er;exports.CategorySchema=be;exports.EditProductSchema=Xt;exports.FavoriteProductSchema=Kt;exports.NewProductSchema=Qt;exports.OrderSchema=Ft;exports.ProductSchema=le;exports.ProfileSchema=qe;exports.TFlattenCategorySchema=Gt;exports.createEmptyProfile=Ht;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var x;(function(r){r.assertEqual=s=>s;function e(s){}r.assertIs=e;function t(s){throw new Error}r.assertNever=t,r.arrayToEnum=s=>{const a={};for(const i of s)a[i]=i;return a},r.getValidEnumValues=s=>{const a=r.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(const o of a)i[o]=s[o];return r.objectValues(i)},r.objectValues=s=>r.objectKeys(s).map(function(a){return s[a]}),r.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const a=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},r.find=(s,a)=>{for(const i of s)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=n,r.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var Se;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(Se||(Se={}));const h=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),A=r=>{switch(typeof r){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(r)?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(r)?h.array:r===null?h.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?h.promise:typeof Map<"u"&&r instanceof Map?h.map:typeof Set<"u"&&r instanceof Set?h.set:typeof Date<"u"&&r instanceof Date?h.date:h.object;default:return h.unknown}},c=x.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"]),qe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:");class T extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(a){return a.message},n={_errors:[]},s=a=>{for(const i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let o=n,f=0;for(;f<i.path.length;){const u=i.path[f];f===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(t(i))):o[u]=o[u]||{_errors:[]},o=o[u],f++}}};return s(this),n}static assert(e){if(!(e instanceof T))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}T.create=r=>new T(r);const q=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===h.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,x.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${x.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${x.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${x.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:x.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,x.assertNever(r)}return{message:t}};let Ae=q;function Ye(r){Ae=r}function he(){return Ae}const me=r=>{const{data:e,path:t,errorMaps:n,issueData:s}=r,a=[...t,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="";const f=n.filter(u=>!!u).slice().reverse();for(const u of f)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},Je=[];function l(r,e){const t=he(),n=me({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===q?void 0:q].filter(s=>!!s)});r.common.issues.push(n)}class k{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const s of t){if(s.status==="aborted")return y;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const s of t){const a=await s.key,i=await s.value;n.push({key:a,value:i})}return k.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const s of t){const{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return y;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}}const y=Object.freeze({status:"aborted"}),B=r=>({status:"dirty",value:r}),w=r=>({status:"valid",value:r}),Ze=r=>r.status==="aborted",Ne=r=>r.status==="dirty",Q=r=>r.status==="valid",X=r=>typeof Promise<"u"&&r instanceof Promise;function pe(r,e,t,n){if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(r)}function Pe(r,e,t,n,s){if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(r,t),t}var m;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(m||(m={}));var H,G;class O{constructor(e,t,n,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const je=(r,e)=>{if(Q(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 T(r.common.issues);return this._error=t,this._error}}};function v(r){if(!r)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:s}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var f,u;const{message:g}=r;return i.code==="invalid_enum_value"?{message:g??o.defaultError}:typeof o.data>"u"?{message:(f=g??n)!==null&&f!==void 0?f:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=g??t)!==null&&u!==void 0?u:o.defaultError}},description:s}}class _{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return A(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:A(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(X(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const s={common:{issues:[],async:(n=t==null?void 0:t.async)!==null&&n!==void 0?n:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},a=this._parseSync({data:e,path:s.path,parent:s});return je(s,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:A(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(X(s)?s:Promise.resolve(s));return je(n,a)}refine(e,t){const n=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,a)=>{const i=e(s),o=()=>a.addIssue({code:c.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof t=="function"?t(n,s):t),!1))}_refinement(e){return new C({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return E.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this,this._def)}promise(){return J.create(this,this._def)}or(e){return te.create([this,e],this._def)}and(e){return re.create(this,e,this._def)}transform(e){return new C({...v(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new oe({...v(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new Ee({typeName:p.ZodBranded,type:this,...v(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new de({...v(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 ue.create(this,e)}readonly(){return ce.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const He=/^c[^\s-]{8,}$/i,Ge=/^[0-9a-z]+$/,Qe=/^[0-9A-HJKMNP-TV-Z]{26}$/,Xe=/^[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,Fe=/^[a-z0-9_-]{21}$/i,Ke=/^[-+]?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)?)??$/,et=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let we;const rt=/^(?:(?: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])$/,nt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,st=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Me="((\\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])))",at=new RegExp(`^${Me}$`);function $e(r){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`),e}function it(r){return new RegExp(`^${$e(r)}$`)}function Ve(r){let e=`${Me}T${$e(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 ot(r,e){return!!((e==="v4"||!e)&&rt.test(r)||(e==="v6"||!e)&&nt.test(r))}class Z extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==h.string){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.string,received:a.parsedType}),y}const n=new k;let s;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){const i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")et.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")we||(we=new RegExp(tt,"u")),we.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Xe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Fe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")He.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Ge.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qe.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:c.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:c.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:c.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ve(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?at.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?it(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:c.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Ke.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?ot(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:c.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?st.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:c.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(s=>e.test(s),{validation:t,code:c.invalid_string,...m.errToObj(n)})}_addCheck(e){return new Z({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...m.errToObj(e)})}url(e){return this._addCheck({kind:"url",...m.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...m.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...m.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...m.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...m.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...m.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...m.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...m.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...m.errToObj(e)})}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(n=e==null?void 0:e.local)!==null&&n!==void 0?n:!1,...m.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,...m.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...m.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...m.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...m.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...m.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...m.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...m.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...m.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...m.errToObj(t)})}nonempty(e){return this.min(1,m.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 isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Z.create=r=>{var e;return new Z({checks:[],typeName:p.ZodString,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};function dt(r,e){const t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=t>n?t:n,a=parseInt(r.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}class P extends _{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 a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.number,received:a.parsedType}),y}let n;const s=new k;for(const a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?dt(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new P({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new P({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:m.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:m.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:m.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:m.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"&&x.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}P.create=r=>new P({checks:[],typeName:p.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class M extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==h.bigint){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.bigint,received:a.parsedType}),y}let n;const s=new k;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,m.toString(t))}gt(e,t){return this.setLimit("min",e,!1,m.toString(t))}lte(e,t){return this.setLimit("max",e,!0,m.toString(t))}lt(e,t){return this.setLimit("max",e,!1,m.toString(t))}setLimit(e,t,n,s){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:m.toString(s)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:m.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:m.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:m.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:m.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:m.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}}M.create=r=>{var e;return new M({checks:[],typeName:p.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!==null&&e!==void 0?e:!1,...v(r)})};class F extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==h.boolean){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.boolean,received:n.parsedType}),y}return w(e.data)}}F.create=r=>new F({typeName:p.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1,...v(r)});class L extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==h.date){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_type,expected:h.date,received:a.parsedType}),y}if(isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return l(a,{code:c.invalid_date}),y}const n=new k;let s;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:m.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:m.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}}L.create=r=>new L({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:p.ZodDate,...v(r)});class ye extends _{_parse(e){if(this._getType(e)!==h.symbol){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.symbol,received:n.parsedType}),y}return w(e.data)}}ye.create=r=>new ye({typeName:p.ZodSymbol,...v(r)});class K extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.undefined,received:n.parsedType}),y}return w(e.data)}}K.create=r=>new K({typeName:p.ZodUndefined,...v(r)});class ee extends _{_parse(e){if(this._getType(e)!==h.null){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.null,received:n.parsedType}),y}return w(e.data)}}ee.create=r=>new ee({typeName:p.ZodNull,...v(r)});class Y extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}}Y.create=r=>new Y({typeName:p.ZodAny,...v(r)});class D extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}}D.create=r=>new D({typeName:p.ZodUnknown,...v(r)});class R extends _{_parse(e){const t=this._getOrReturnCtx(e);return l(t,{code:c.invalid_type,expected:h.never,received:t.parsedType}),y}}R.create=r=>new R({typeName:p.ZodNever,...v(r)});class ge extends _{_parse(e){if(this._getType(e)!==h.undefined){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.void,received:n.parsedType}),y}return w(e.data)}}ge.create=r=>new ge({typeName:p.ZodVoid,...v(r)});class N extends _{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==h.array)return l(t,{code:c.invalid_type,expected:h.array,received:t.parsedType}),y;if(s.exactLength!==null){const i=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(i||o)&&(l(t,{code:i?c.too_big:c.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(l(t,{code:c.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(l(t,{code:c.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>s.type._parseAsync(new O(t,i,t.path,o)))).then(i=>k.mergeArray(n,i));const a=[...t.data].map((i,o)=>s.type._parseSync(new O(t,i,t.path,o)));return k.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new N({...this._def,minLength:{value:e,message:m.toString(t)}})}max(e,t){return new N({...this._def,maxLength:{value:e,message:m.toString(t)}})}length(e,t){return new N({...this._def,exactLength:{value:e,message:m.toString(t)}})}nonempty(e){return this.min(1,e)}}N.create=(r,e)=>new N({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...v(e)});function U(r){if(r instanceof b){const e={};for(const t in r.shape){const n=r.shape[t];e[t]=E.create(U(n))}return new b({...r._def,shape:()=>e})}else return r instanceof N?new N({...r._def,type:U(r.element)}):r instanceof E?E.create(U(r.unwrap())):r instanceof V?V.create(U(r.unwrap())):r instanceof I?I.create(r.items.map(e=>U(e))):r}class b extends _{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=x.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const u=this._getOrReturnCtx(e);return l(u,{code:c.invalid_type,expected:h.object,received:u.parsedType}),y}const{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof R&&this._def.unknownKeys==="strip"))for(const u in s.data)i.includes(u)||o.push(u);const f=[];for(const u of i){const g=a[u],S=s.data[u];f.push({key:{status:"valid",value:u},value:g._parse(new O(s,S,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof R){const u=this._def.unknownKeys;if(u==="passthrough")for(const g of o)f.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(u==="strict")o.length>0&&(l(s,{code:c.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const g of o){const S=s.data[g];f.push({key:{status:"valid",value:g},value:u._parse(new O(s,S,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const g of f){const S=await g.key,Ie=await g.value;u.push({key:S,value:Ie,alwaysSet:g.alwaysSet})}return u}).then(u=>k.mergeObjectSync(n,u)):k.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return m.errToObj,new b({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{var s,a,i,o;const f=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,t,n).message)!==null&&i!==void 0?i:n.defaultError;return t.code==="unrecognized_keys"?{message:(o=m.errToObj(e).message)!==null&&o!==void 0?o:f}:{message:f}}}:{}})}strip(){return new b({...this._def,unknownKeys:"strip"})}passthrough(){return new b({...this._def,unknownKeys:"passthrough"})}extend(e){return new b({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new b({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 b({...this._def,catchall:e})}pick(e){const t={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}omit(e){const t={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new b({...this._def,shape:()=>t})}deepPartial(){return U(this)}partial(e){const t={};return x.objectKeys(this.shape).forEach(n=>{const s=this.shape[n];e&&!e[n]?t[n]=s:t[n]=s.optional()}),new b({...this._def,shape:()=>t})}required(e){const t={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof E;)a=a._def.innerType;t[n]=a}}),new b({...this._def,shape:()=>t})}keyof(){return De(x.objectKeys(this.shape))}}b.create=(r,e)=>new b({shape:()=>r,unknownKeys:"strip",catchall:R.create(),typeName:p.ZodObject,...v(e)});b.strictCreate=(r,e)=>new b({shape:()=>r,unknownKeys:"strict",catchall:R.create(),typeName:p.ZodObject,...v(e)});b.lazycreate=(r,e)=>new b({shape:r,unknownKeys:"strip",catchall:R.create(),typeName:p.ZodObject,...v(e)});class te extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function s(a){for(const o of a)if(o.result.status==="valid")return o.result;for(const o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const i=a.map(o=>new T(o.ctx.common.issues));return l(t,{code:c.invalid_union,unionErrors:i}),y}if(t.common.async)return Promise.all(n.map(async a=>{const i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(s);{let a;const i=[];for(const f of n){const u={...t,common:{...t.common,issues:[]},parent:null},g=f._parseSync({data:t.data,path:t.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(f=>new T(f));return l(t,{code:c.invalid_union,unionErrors:o}),y}}get options(){return this._def.options}}te.create=(r,e)=>new te({options:r,typeName:p.ZodUnion,...v(e)});const j=r=>r instanceof se?j(r.schema):r instanceof C?j(r.innerType()):r instanceof ae?[r.value]:r instanceof $?r.options:r instanceof ie?x.objectValues(r.enum):r instanceof oe?j(r._def.innerType):r instanceof K?[void 0]:r instanceof ee?[null]:r instanceof E?[void 0,...j(r.unwrap())]:r instanceof V?[null,...j(r.unwrap())]:r instanceof Ee||r instanceof ce?j(r.unwrap()):r instanceof de?j(r._def.innerType):[];class xe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return l(t,{code:c.invalid_type,expected:h.object,received:t.parsedType}),y;const n=this.discriminator,s=t.data[n],a=this.optionsMap.get(s);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(l(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const s=new Map;for(const a of t){const i=j(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new xe({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(n)})}}function Ce(r,e){const t=A(r),n=A(e);if(r===e)return{valid:!0,data:r};if(t===h.object&&n===h.object){const s=x.objectKeys(e),a=x.objectKeys(r).filter(o=>s.indexOf(o)!==-1),i={...r,...e};for(const o of a){const f=Ce(r[o],e[o]);if(!f.valid)return{valid:!1};i[o]=f.data}return{valid:!0,data:i}}else if(t===h.array&&n===h.array){if(r.length!==e.length)return{valid:!1};const s=[];for(let a=0;a<r.length;a++){const i=r[a],o=e[a],f=Ce(i,o);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return t===h.date&&n===h.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}class re extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Ze(a)||Ze(i))return y;const o=Ce(a.value,i.value);return o.valid?((Ne(a)||Ne(i))&&t.dirty(),{status:t.value,value:o.data}):(l(n,{code:c.invalid_intersection_types}),y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}re.create=(r,e,t)=>new re({left:r,right:e,typeName:p.ZodIntersection,...v(t)});class I extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.array)return l(n,{code:c.invalid_type,expected:h.array,received:n.parsedType}),y;if(n.data.length<this._def.items.length)return l(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...n.data].map((i,o)=>{const f=this._def.items[o]||this._def.rest;return f?f._parse(new O(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new I({...this._def,rest:e})}}I.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:r,typeName:p.ZodTuple,rest:null,...v(e)})};class ne extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return l(n,{code:c.invalid_type,expected:h.object,received:n.parsedType}),y;const s=[],a=this._def.keyType,i=this._def.valueType;for(const o in n.data)s.push({key:a._parse(new O(n,o,n.path,o)),value:i._parse(new O(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?k.mergeObjectAsync(t,s):k.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof _?new ne({keyType:e,valueType:t,typeName:p.ZodRecord,...v(n)}):new ne({keyType:Z.create(),valueType:e,typeName:p.ZodRecord,...v(t)})}}class ve extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.map)return l(n,{code:c.invalid_type,expected:h.map,received:n.parsedType}),y;const s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,f],u)=>({key:s._parse(new O(n,o,n.path,[u,"key"])),value:a._parse(new O(n,f,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const f of i){const u=await f.key,g=await f.value;if(u.status==="aborted"||g.status==="aborted")return y;(u.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(u.value,g.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const f of i){const u=f.key,g=f.value;if(u.status==="aborted"||g.status==="aborted")return y;(u.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(u.value,g.value)}return{status:t.value,value:o}}}}ve.create=(r,e,t)=>new ve({valueType:e,keyType:r,typeName:p.ZodMap,...v(t)});class z extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.set)return l(n,{code:c.invalid_type,expected:h.set,received:n.parsedType}),y;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:c.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:c.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const a=this._def.valueType;function i(f){const u=new Set;for(const g of f){if(g.status==="aborted")return y;g.status==="dirty"&&t.dirty(),u.add(g.value)}return{status:t.value,value:u}}const o=[...n.data.values()].map((f,u)=>a._parse(new O(n,f,n.path,u)));return n.common.async?Promise.all(o).then(f=>i(f)):i(o)}min(e,t){return new z({...this._def,minSize:{value:e,message:m.toString(t)}})}max(e,t){return new z({...this._def,maxSize:{value:e,message:m.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}z.create=(r,e)=>new z({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...v(e)});class W extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return l(t,{code:c.invalid_type,expected:h.function,received:t.parsedType}),y;function n(o,f){return me({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),q].filter(u=>!!u),issueData:{code:c.invalid_arguments,argumentsError:f}})}function s(o,f){return me({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,he(),q].filter(u=>!!u),issueData:{code:c.invalid_return_type,returnTypeError:f}})}const a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof J){const o=this;return w(async function(...f){const u=new T([]),g=await o._def.args.parseAsync(f,a).catch(ke=>{throw u.addIssue(n(f,ke)),u}),S=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(S,a).catch(ke=>{throw u.addIssue(s(S,ke)),u})})}else{const o=this;return w(function(...f){const u=o._def.args.safeParse(f,a);if(!u.success)throw new T([n(f,u.error)]);const g=Reflect.apply(i,this,u.data),S=o._def.returns.safeParse(g,a);if(!S.success)throw new T([s(g,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W({...this._def,args:I.create(e).rest(D.create())})}returns(e){return new W({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new W({args:e||I.create([]).rest(D.create()),returns:t||D.create(),typeName:p.ZodFunction,...v(n)})}}class se extends _{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})}}se.create=(r,e)=>new se({getter:r,typeName:p.ZodLazy,...v(e)});class ae extends _{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return l(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}ae.create=(r,e)=>new ae({value:r,typeName:p.ZodLiteral,...v(e)});function De(r,e){return new $({values:r,typeName:p.ZodEnum,...v(e)})}class $ extends _{constructor(){super(...arguments),H.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{expected:x.joinValues(n),received:t.parsedType,code:c.invalid_type}),y}if(pe(this,H)||Pe(this,H,new Set(this._def.values)),!pe(this,H).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return l(t,{received:t.data,code:c.invalid_enum_value,options:n}),y}return w(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 $.create(e,{...this._def,...t})}exclude(e,t=this._def){return $.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}H=new WeakMap;$.create=De;class ie extends _{constructor(){super(...arguments),G.set(this,void 0)}_parse(e){const t=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.string&&n.parsedType!==h.number){const s=x.objectValues(t);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:c.invalid_type}),y}if(pe(this,G)||Pe(this,G,new Set(x.getValidEnumValues(this._def.values))),!pe(this,G).has(e.data)){const s=x.objectValues(t);return l(n,{received:n.data,code:c.invalid_enum_value,options:s}),y}return w(e.data)}get enum(){return this._def.values}}G=new WeakMap;ie.create=(r,e)=>new ie({values:r,typeName:p.ZodNativeEnum,...v(e)});class J extends _{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&t.common.async===!1)return l(t,{code:c.invalid_type,expected:h.promise,received:t.parsedType}),y;const n=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return w(n.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}J.create=(r,e)=>new J({type:r,typeName:p.ZodPromise,...v(e)});class C extends _{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:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){const i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(t.value==="aborted")return y;const f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?y:f.status==="dirty"||t.value==="dirty"?B(f.value):f});{if(t.value==="aborted")return y;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?y:o.status==="dirty"||t.value==="dirty"?B(o.value):o}}if(s.type==="refinement"){const i=o=>{const f=s.refinement(o,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?y:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Q(i))return i;const o=s.transform(i.value,a);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:n.data,path:n.path,parent:n}).then(i=>Q(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);x.assertNever(s)}}C.create=(r,e,t)=>new C({schema:r,typeName:p.ZodEffects,effect:e,...v(t)});C.createWithPreprocess=(r,e,t)=>new C({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...v(t)});class E extends _{_parse(e){return this._getType(e)===h.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}E.create=(r,e)=>new E({innerType:r,typeName:p.ZodOptional,...v(e)});class V extends _{_parse(e){return this._getType(e)===h.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}V.create=(r,e)=>new V({innerType:r,typeName:p.ZodNullable,...v(e)});class oe extends _{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===h.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}oe.create=(r,e)=>new oe({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...v(e)});class de extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return X(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new T(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}de.create=(r,e)=>new de({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...v(e)});class _e extends _{_parse(e){if(this._getType(e)!==h.nan){const n=this._getOrReturnCtx(e);return l(n,{code:c.invalid_type,expected:h.nan,received:n.parsedType}),y}return{status:"valid",value:e.data}}}_e.create=r=>new _e({typeName:p.ZodNaN,...v(r)});const ct=Symbol("zod_brand");class Ee extends _{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class ue extends _{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?y:a.status==="dirty"?(t.dirty(),B(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?y:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,t){return new ue({in:e,out:t,typeName:p.ZodPipeline})}}class ce extends _{_parse(e){const t=this._def.innerType._parse(e),n=s=>(Q(s)&&(s.value=Object.freeze(s.value)),s);return X(t)?t.then(s=>n(s)):n(t)}unwrap(){return this._def.innerType}}ce.create=(r,e)=>new ce({innerType:r,typeName:p.ZodReadonly,...v(e)});function Le(r,e={},t){return r?Y.create().superRefine((n,s)=>{var a,i;if(!r(n)){const o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,f=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,u=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...u,fatal:f})}}):Y.create()}const ut={object:b.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={}));const lt=(r,e={message:`Input not instance of ${r.name}`})=>Le(t=>t instanceof r,e),ze=Z.create,Ue=P.create,ft=_e.create,ht=M.create,Be=F.create,mt=L.create,pt=ye.create,yt=K.create,gt=ee.create,vt=Y.create,_t=D.create,xt=R.create,bt=ge.create,kt=N.create,wt=b.create,Tt=b.strictCreate,St=te.create,Zt=xe.create,Nt=re.create,Ct=I.create,Et=ne.create,Ot=ve.create,It=z.create,jt=W.create,Rt=se.create,At=ae.create,Pt=$.create,Mt=ie.create,$t=J.create,Re=C.create,Vt=E.create,Dt=V.create,Lt=C.createWithPreprocess,zt=ue.create,Ut=()=>ze().optional(),Bt=()=>Ue().optional(),Wt=()=>Be().optional(),qt={string:r=>Z.create({...r,coerce:!0}),number:r=>P.create({...r,coerce:!0}),boolean:r=>F.create({...r,coerce:!0}),bigint:r=>M.create({...r,coerce:!0}),date:r=>L.create({...r,coerce:!0})},Yt=y;var d=Object.freeze({__proto__:null,defaultErrorMap:q,setErrorMap:Ye,getErrorMap:he,makeIssue:me,EMPTY_PATH:Je,addIssueToContext:l,ParseStatus:k,INVALID:y,DIRTY:B,OK:w,isAborted:Ze,isDirty:Ne,isValid:Q,isAsync:X,get util(){return x},get objectUtil(){return Se},ZodParsedType:h,getParsedType:A,ZodType:_,datetimeRegex:Ve,ZodString:Z,ZodNumber:P,ZodBigInt:M,ZodBoolean:F,ZodDate:L,ZodSymbol:ye,ZodUndefined:K,ZodNull:ee,ZodAny:Y,ZodUnknown:D,ZodNever:R,ZodVoid:ge,ZodArray:N,ZodObject:b,ZodUnion:te,ZodDiscriminatedUnion:xe,ZodIntersection:re,ZodTuple:I,ZodRecord:ne,ZodMap:ve,ZodSet:z,ZodFunction:W,ZodLazy:se,ZodLiteral:ae,ZodEnum:$,ZodNativeEnum:ie,ZodPromise:J,ZodEffects:C,ZodTransformer:C,ZodOptional:E,ZodNullable:V,ZodDefault:oe,ZodCatch:de,ZodNaN:_e,BRAND:ct,ZodBranded:Ee,ZodPipeline:ue,ZodReadonly:ce,custom:Le,Schema:_,ZodSchema:_,late:ut,get ZodFirstPartyTypeKind(){return p},coerce:qt,any:vt,array:kt,bigint:ht,boolean:Be,date:mt,discriminatedUnion:Zt,effect:Re,enum:Pt,function:jt,instanceof:lt,intersection:Nt,lazy:Rt,literal:At,map:Ot,nan:ft,nativeEnum:Mt,never:xt,null:gt,nullable:Dt,number:Ue,object:wt,oboolean:Wt,onumber:Bt,optional:Vt,ostring:Ut,pipeline:zt,preprocess:Lt,promise:$t,record:Et,set:It,strictObject:Tt,string:ze,symbol:pt,transformer:Re,tuple:Ct,undefined:yt,union:St,unknown:_t,void:bt,NEVER:Yt,ZodIssueCode:c,quotelessJson:qe,ZodError:T});const Jt=d.object({country:d.string(),city:d.string(),street:d.string(),streetNumber:d.string(),floor:d.string(),apartmentEnterNumber:d.string(),apartmentNumber:d.string()}),We=d.object({type:d.literal("Profile"),id:d.string(),companyId:d.string(),storeId:d.string(),tenantId:d.string(),clientType:d.enum(["user","company"]),displayName:d.string().min(1),email:d.string().email(),phoneNumber:d.object({code:d.string(),number:d.string()}),address:Jt,isAnonymous:d.boolean(),createdDate:d.number(),lastActivityDate:d.number()});function Ht(){return{type:"Profile",id:"",companyId:"",storeId:"",tenantId:"",clientType:"user",displayName:"",email:"",phoneNumber:{code:"+972",number:""},address:{country:"",city:"",street:"",streetNumber:"",floor:"",apartmentEnterNumber:"",apartmentNumber:""},createdDate:0,lastActivityDate:0,isAnonymous:!0}}const fe=d.object({lang:d.string().min(1),value:d.string().min(1)}),Oe=d.object({id:d.string().min(1),companyId:d.string().min(1),storeId:d.string().min(1),parentId:d.string().nullish(),tag:d.string().min(1),locales:d.array(fe),depth:d.number()}),be=Oe.extend({children:d.lazy(()=>be.array())}),Gt=Oe.extend({index:d.number(),depth:d.number(),collapsed:d.boolean().optional(),children:d.array(be)}),Te=d.string(),le=d.object({type:d.literal("Product"),storeId:Te,companyId:Te,id:d.string(),objectID:d.string(),sku:d.string().min(1),name:d.array(fe),description:d.array(fe),isPublished:d.boolean(),vat:d.boolean(),priceType:d.object({type:d.enum(["unit","kg","gram","liter","ml"]),value:d.number()}),price:d.number().positive(),purchasePrice:d.number().optional(),profitPercentage:d.number().optional(),currency:d.literal("ILS"),discount:d.object({type:d.enum(["number","percent","none"]),value:d.number()}),weight:d.object({value:d.number(),unit:d.enum(["kg","gram","none"])}),volume:d.object({value:d.number(),unit:d.enum(["liter","ml","none"])}),images:d.array(d.object({url:d.string().url(),id:d.string()})),manufacturer:Te,brand:d.string(),importer:d.string(),supplier:d.string(),ingredients:d.array(fe),created_at:d.number(),updated_at:d.number(),categoryList:d.array(be),categories:d.object({lvl0:d.array(d.string()),lvl1:d.array(d.string()),lvl2:d.array(d.string()),lvl3:d.array(d.string()),lvl4:d.array(d.string())}),categoryNames:d.array(d.string())}),Qt=le.omit({id:!0,categories:!0,images:!0}).extend({image:d.instanceof(File).optional()}),Xt=le.extend({image:d.instanceof(File).optional()}),Ft=d.object({type:d.literal("Order"),id:d.string(),companyId:d.string(),storeId:d.string(),userId:d.string(),status:d.enum(["pending","processing","delivered","canceled","completed","refunded"]),paymentStatus:d.enum(["pending","completed","failed","refunded"]),cart:d.object({id:d.string(),items:d.array(d.object({product:le,amount:d.number()})),cartTotal:d.number(),cartDiscount:d.number(),cartVat:d.number()}),date:d.number(),deliveryDate:d.number().optional(),client:We}),Kt=d.object({type:d.literal("FavoriteProduct"),id:d.string().uuid(),companyId:d.string().uuid(),storeId:d.string().uuid(),userId:d.string().uuid(),productId:d.string().uuid()}),er=d.object({type:d.literal("Cart"),id:d.string().uuid(),companyId:d.string().uuid(),storeId:d.string().uuid(),userId:d.string().uuid(),status:d.enum(["active","draft","completed"]),items:d.array(d.object({product:le,amount:d.number().int().positive({message:"Quantity must be a positive integer."})}))});exports.BaseCategorySchema=Oe;exports.CartSchema=er;exports.CategorySchema=be;exports.EditProductSchema=Xt;exports.FavoriteProductSchema=Kt;exports.NewProductSchema=Qt;exports.OrderSchema=Ft;exports.ProductSchema=le;exports.ProfileSchema=We;exports.TFlattenCategorySchema=Gt;exports.createEmptyProfile=Ht;
|
|
2
2
|
//# sourceMappingURL=core.cjs.js.map
|