@mediquo/elements 0.5.1 → 0.5.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/chunks/api-chat-client-1Vz6ZOwp.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-DxrMPQqB.js → apple-pay-outcomes-0ozxSHyb.js} +1 -1
- package/dist/chunks/{appointment-card-skeleton-CYFfacro.js → appointment-card-skeleton-hglMW7x6.js} +1 -1
- package/dist/chunks/{chunk-GZF3YFSX-BzloXkVp.js → chunk-GZF3YFSX-DM-GTqxg.js} +1 -1
- package/dist/chunks/{chunk-YTQUGGS3-p18naHsk.js → chunk-YTQUGGS3-DmCGIoFy.js} +1 -1
- package/dist/chunks/{documentation-view-CS4Q-UpO.js → documentation-view-geQU8ttU.js} +1 -1
- package/dist/chunks/{external-mrLCXx_f.js → external-CJj32K_p.js} +1 -1
- package/dist/chunks/{index-yd2JNJSr.js → index-BBUiLb3Y.js} +1 -1
- package/dist/chunks/{index-DBMxJ4Dp.js → index-Bx8TWBsk.js} +1 -1
- package/dist/chunks/{price-CdF63nRC.js → price-DIhNpS8n.js} +1 -1
- package/dist/chunks/{refund-cancel-policy-Bl9qE8wD.js → refund-cancel-policy-BQDnePq9.js} +1 -1
- package/dist/chunks/{schemas.d-BEA8Pl6w.d.ts → schemas.d-5CaMrfOq.d.ts} +6 -0
- package/dist/env.js +1 -1
- package/dist/events.d.ts +46 -1
- package/dist/events.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.d.ts +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +1 -1
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-payment-poller.d.ts +61 -0
- package/dist/mq-payment-poller.js +1 -0
- package/dist/mq-professional-presence-sync.js +1 -1
- package/dist/mq-schedule-success.js +1 -1
- package/dist/mq-schedule.d.ts +8 -2
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-socket-provider.js +1 -1
- package/dist/mq-support-chat.d.ts +1 -1
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-unread-count-sync.js +1 -1
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.d.ts +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-payment-poller.d.ts +33 -0
- package/dist/react/mq-payment-poller.js +2 -0
- package/dist/react/mq-professional-presence-sync.js +1 -1
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +1 -1
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-socket-provider.js +1 -1
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-unread-count-sync.js +1 -1
- package/dist/react/mq-videocall.js +1 -1
- package/package.json +5 -1
- package/dist/chunks/api-chat-client-vbjgaIRV.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,t;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const a=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),s=e=>{switch(typeof e){case"undefined":return a.undefined;case"string":return a.string;case"number":return Number.isNaN(e)?a.nan:a.number;case"boolean":return a.boolean;case"function":return a.function;case"bigint":return a.bigint;case"symbol":return a.symbol;case"object":return Array.isArray(e)?a.array:null===e?a.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?a.promise:"undefined"!=typeof Map&&e instanceof Map?a.map:"undefined"!=typeof Set&&e instanceof Set?a.set:"undefined"!=typeof Date&&e instanceof Date?a.date:a.object;default:return a.unknown}},n=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const r=(t,s)=>{let r;switch(t.code){case n.invalid_type:r=t.received===a.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case n.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case n.unrecognized_keys:r=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case n.invalid_union:r="Invalid input";break;case n.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case n.invalid_enum_value:r=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case n.invalid_arguments:r="Invalid function arguments";break;case n.invalid_return_type:r="Invalid function return type";break;case n.invalid_date:r="Invalid date";break;case n.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case n.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case n.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case n.custom:r="Invalid input";break;case n.invalid_intersection_types:r="Intersection results could not be merged";break;case n.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case n.not_finite:r="Number must be finite";break;default:r=s.defaultError,e.assertNever(t)}return{message:r}};let i=r;function o(){return i}const d=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function c(e,t){const a=o(),s=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===r?void 0:r].filter(e=>!!e)});e.common.issues.push(s)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return u;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return ParseStatus.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return u;if("aborted"===n.status)return u;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const u=Object.freeze({status:"aborted"}),l=e=>({status:"dirty",value:e}),p=e=>({status:"valid",value:e}),h=e=>"aborted"===e.status,m=e=>"dirty"===e.status,f=e=>"valid"===e.status,y=e=>"undefined"!=typeof Promise&&e instanceof Promise;var _;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(_||(_={}));class ParseInputLazyPath{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const g=(e,t)=>{if(f(t))return{success:!0,data:t.value};if(!e.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 ZodError(e.common.issues);return this._error=t,this._error}}};function v(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??n.defaultError}:void 0===n.data?{message:r??s??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:r??a??n.defaultError}},description:n}}class ZodType{get description(){return this._def.description}_getType(e){return s(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(y(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parseSync({data:e,path:a.path,parent:a});return g(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return f(a)?{value:a.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>f(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(y(n)?n:Promise.resolve(n));return g(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,s)=>{const r=e(t),i=()=>s.addIssue({code:n.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...v(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...v(this._def),innerType:this,defaultValue:t,typeName:X.ZodDefault})}brand(){return new ZodBranded({typeName:X.ZodBranded,type:this,...v(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...v(this._def),innerType:this,catchValue:t,typeName:X.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,b=/^[0-9a-z]+$/,k=/^[0-9A-HJKMNP-TV-Z]{26}$/i,x=/^[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,w=/^[a-z0-9_-]{21}$/i,T=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?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)?)??$/,O=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let S;const A=/^(?:(?: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])$/,E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,I=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R="((\\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])))",$=new RegExp(`^${R}$`);function L(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function M(e){return new RegExp(`^${L(e)}$`)}function z(e){let t=`${R}T${L(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function D(e,t){return!("v4"!==t&&t||!A.test(e))||!("v6"!==t&&t||!j.test(e))}function F(e,t){if(!T.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(s));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function U(e,t){return!("v4"!==t&&t||!E.test(e))||!("v6"!==t&&t||!C.test(e))}class ZodString extends ZodType{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==a.string){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.string,received:e.parsedType}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("max"===a.kind)t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const e=t.data.length>a.value,i=t.data.length<a.value;(e||i)&&(r=this._getOrReturnCtx(t,r),e?c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if("email"===a.kind)O.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"email",code:n.invalid_string,message:a.message}),s.dirty());else if("emoji"===a.kind)S||(S=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),S.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"emoji",code:n.invalid_string,message:a.message}),s.dirty());else if("uuid"===a.kind)x.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"uuid",code:n.invalid_string,message:a.message}),s.dirty());else if("nanoid"===a.kind)w.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"nanoid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid"===a.kind)Z.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid2"===a.kind)b.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid2",code:n.invalid_string,message:a.message}),s.dirty());else if("ulid"===a.kind)k.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ulid",code:n.invalid_string,message:a.message}),s.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),c(r,{validation:"url",code:n.invalid_string,message:a.message}),s.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"regex",code:n.invalid_string,message:a.message}),s.dirty())}else if("trim"===a.kind)t.data=t.data.trim();else if("includes"===a.kind)t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty());else if("toLowerCase"===a.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===a.kind)t.data=t.data.toUpperCase();else if("startsWith"===a.kind)t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty());else if("endsWith"===a.kind)t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty());else if("datetime"===a.kind){z(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"datetime",message:a.message}),s.dirty())}else if("date"===a.kind){$.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"date",message:a.message}),s.dirty())}else if("time"===a.kind){M(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"time",message:a.message}),s.dirty())}else"duration"===a.kind?N.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"duration",code:n.invalid_string,message:a.message}),s.dirty()):"ip"===a.kind?D(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ip",code:n.invalid_string,message:a.message}),s.dirty()):"jwt"===a.kind?F(t.data,a.alg)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"jwt",code:n.invalid_string,message:a.message}),s.dirty()):"cidr"===a.kind?U(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cidr",code:n.invalid_string,message:a.message}),s.dirty()):"base64"===a.kind?P.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64",code:n.invalid_string,message:a.message}),s.dirty()):"base64url"===a.kind?I.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64url",code:n.invalid_string,message:a.message}),s.dirty()):e.assertNever(a);return{status:s.value,value:t.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:n.invalid_string,..._.errToObj(a)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,..._.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,..._.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function V(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}ZodString.create=e=>new ZodString({checks:[],typeName:X.ZodString,coerce:e?.coerce??!1,...v(e)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==a.number){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.number,received:e.parsedType}),u}let s;const r=new ParseStatus;for(const a of this._def.checks)if("int"===a.kind)e.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty());else if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else"multipleOf"===a.kind?0!==V(t.data,a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_finite,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:X.ZodNumber,coerce:e?.coerce||!1,...v(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==a.bigint)return this._getInvalidInput(t);let s;const r=new ParseStatus;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.bigint,received:t.parsedType}),u}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:X.ZodBigInt,coerce:e?.coerce??!1,...v(e)});class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==a.boolean){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.boolean,received:t.parsedType}),u}return p(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:X.ZodBoolean,coerce:e?.coerce||!1,...v(e)});class ZodDate extends ZodType{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==a.date){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.date,received:e.parsedType}),u}if(Number.isNaN(t.data.getTime())){return c(this._getOrReturnCtx(t),{code:n.invalid_date}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):e.assertNever(a);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:X.ZodDate,...v(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==a.symbol){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.symbol,received:t.parsedType}),u}return p(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:X.ZodSymbol,...v(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.undefined,received:t.parsedType}),u}return p(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:X.ZodUndefined,...v(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==a.null){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.null,received:t.parsedType}),u}return p(e.data)}}ZodNull.create=e=>new ZodNull({typeName:X.ZodNull,...v(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return p(e.data)}}ZodAny.create=e=>new ZodAny({typeName:X.ZodAny,...v(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return p(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:X.ZodUnknown,...v(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.never,received:t.parsedType}),u}}ZodNever.create=e=>new ZodNever({typeName:X.ZodNever,...v(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.void,received:t.parsedType}),u}return p(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:X.ZodVoid,...v(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==a.array)return c(t,{code:n.invalid_type,expected:a.array,received:t.parsedType}),u;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(c(t,{code:e?n.too_big:n.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(c(t,{code:n.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(c(t,{code:n.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new ParseInputLazyPath(t,e,t.path,a)))).then(e=>ParseStatus.mergeArray(s,e));const i=[...t.data].map((e,a)=>r.type._parseSync(new ParseInputLazyPath(t,e,t.path,a)));return ParseStatus.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}}function B(e){if(e instanceof ZodObject){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=ZodOptional.create(B(s))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:B(e.element)}):e instanceof ZodOptional?ZodOptional.create(B(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(B(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(e=>B(e))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...v(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),a=e.objectKeys(t);return this._cached={shape:t,keys:a},this._cached}_parse(e){if(this._getType(e)!==a.object){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in s.data)i.includes(e)||o.push(e);const d=[];for(const e of i){const t=r[e],a=s.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)d.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)o.length>0&&(c(s,{code:n.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const a=s.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(s,a,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of d){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(t,e)):ParseStatus.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const s=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:_.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(t){const a={};for(const s of e.objectKeys(t))t[s]&&this.shape[s]&&(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}omit(t){const a={};for(const s of e.objectKeys(this.shape))t[s]||(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}deepPartial(){return B(this)}partial(t){const a={};for(const s of e.objectKeys(this.shape)){const e=this.shape[s];t&&!t[s]?a[s]=e:a[s]=e.optional()}return new ZodObject({...this._def,shape:()=>a})}required(t){const a={};for(const s of e.objectKeys(this.shape))if(t&&!t[s])a[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ZodOptional;)e=e._def.innerType;a[s]=e}return new ZodObject({...this._def,shape:()=>a})}keyof(){return q(e.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new ZodError(e.ctx.common.issues));return c(t,{code:n.invalid_union,unionErrors:a}),u});{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=s.map(e=>new ZodError(e));return c(t,{code:n.invalid_union,unionErrors:r}),u}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:X.ZodUnion,...v(t)});const K=t=>t instanceof ZodLazy?K(t.schema):t instanceof ZodEffects?K(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?e.objectValues(t.enum):t instanceof ZodDefault?K(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:t instanceof ZodOptional?[void 0,...K(t.unwrap())]:t instanceof ZodNullable?[null,...K(t.unwrap())]:t instanceof ZodBranded||t instanceof ZodReadonly?K(t.unwrap()):t instanceof ZodCatch?K(t._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.object)return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:n.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),u)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=K(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new ZodDiscriminatedUnion({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(a)})}}function W(t,n){const r=s(t),i=s(n);if(t===n)return{valid:!0,data:t};if(r===a.object&&i===a.object){const a=e.objectKeys(n),s=e.objectKeys(t).filter(e=>-1!==a.indexOf(e)),r={...t,...n};for(const e of s){const a=W(t[e],n[e]);if(!a.valid)return{valid:!1};r[e]=a.data}return{valid:!0,data:r}}if(r===a.array&&i===a.array){if(t.length!==n.length)return{valid:!1};const e=[];for(let a=0;a<t.length;a++){const s=W(t[a],n[a]);if(!s.valid)return{valid:!1};e.push(s.data)}return{valid:!0,data:e}}return r===a.date&&i===a.date&&+t===+n?{valid:!0,data:t}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(h(e)||h(s))return u;const r=W(e.value,s.value);return r.valid?((m(e)||m(s))&&t.dirty(),{status:t.value,value:r.data}):(c(a,{code:n.invalid_intersection_types}),u)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ZodIntersection.create=(e,t,a)=>new ZodIntersection({left:e,right:t,typeName:X.ZodIntersection,...v(a)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.array)return c(s,{code:n.invalid_type,expected:a.array,received:s.parsedType}),u;if(s.data.length<this._def.items.length)return c(s,{code:n.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;!this._def.rest&&s.data.length>this._def.items.length&&(c(s,{code:n.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...s.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new ParseInputLazyPath(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(r).then(e=>ParseStatus.mergeArray(t,e)):ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:X.ZodTuple,rest:null,...v(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.object)return c(s,{code:n.invalid_type,expected:a.object,received:s.parsedType}),u;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in s.data)r.push({key:i._parse(new ParseInputLazyPath(s,e,s.path,e)),value:o._parse(new ParseInputLazyPath(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?ParseStatus.mergeObjectAsync(t,r):ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:X.ZodRecord,...v(a)}:{keyType:ZodString.create(),valueType:e,typeName:X.ZodRecord,...v(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.map)return c(s,{code:n.invalid_type,expected:a.map,received:s.parsedType}),u;const r=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([e,t],a)=>({key:r._parse(new ParseInputLazyPath(s,e,s.path,[a,"key"])),value:i._parse(new ParseInputLazyPath(s,t,s.path,[a,"value"]))}));if(s.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of o){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of o){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,a)=>new ZodMap({valueType:t,keyType:e,typeName:X.ZodMap,...v(a)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.set)return c(s,{code:n.invalid_type,expected:a.set,received:s.parsedType}),u;const r=this._def;null!==r.minSize&&s.data.size<r.minSize.value&&(c(s,{code:n.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&s.data.size>r.maxSize.value&&(c(s,{code:n.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const a=new Set;for(const s of e){if("aborted"===s.status)return u;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const d=[...s.data.values()].map((e,t)=>i._parse(new ParseInputLazyPath(s,e,s.path,t)));return s.common.async?Promise.all(d).then(e=>o(e)):o(d)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:X.ZodSet,...v(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.function)return c(t,{code:n.invalid_type,expected:a.function,received:t.parsedType}),u;function s(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_arguments,argumentsError:a}})}function i(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_return_type,returnTypeError:a}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return p(async function(...t){const a=new ZodError([]),n=await e._def.args.parseAsync(t,l).catch(e=>{throw a.addIssue(s(t,e)),a}),r=await Reflect.apply(h,this,n);return await e._def.returns._def.type.parseAsync(r,l).catch(e=>{throw a.addIssue(i(r,e)),a})})}{const e=this;return p(function(...t){const a=e._def.args.safeParse(t,l);if(!a.success)throw new ZodError([s(t,a.error)]);const n=Reflect.apply(h,this,a.data),r=e._def.returns.safeParse(n,l);if(!r.success)throw new ZodError([i(n,r.error)]);return r.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:X.ZodFunction,...v(a)})}}class ZodLazy extends ZodType{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})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:X.ZodLazy,...v(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:n.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:e.data}}get value(){return this._def.value}}function q(e,t){return new ZodEnum({values:e,typeName:X.ZodEnum,...v(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:X.ZodLiteral,...v(t)});class ZodEnum extends ZodType{_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),s=this._def.values;return c(a,{expected:e.joinValues(s),received:a.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),a=this._def.values;return c(e,{received:e.data,code:n.invalid_enum_value,options:a}),u}return p(t.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 ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ZodEnum.create=q;class ZodNativeEnum extends ZodType{_parse(t){const s=e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==a.string&&r.parsedType!==a.number){const t=e.objectValues(s);return c(r,{expected:e.joinValues(t),received:r.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=e.objectValues(s);return c(r,{received:r.data,code:n.invalid_enum_value,options:t}),u}return p(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:X.ZodNativeEnum,...v(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.promise&&!1===t.common.async)return c(t,{code:n.invalid_type,expected:a.promise,received:t.parsedType}),u;const s=t.parsedType===a.promise?t.data:Promise.resolve(t.data);return p(s.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:X.ZodPromise,...v(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:s}=this._processInputParams(t),n=this._def.effect||null,r={addIssue:e=>{c(s,e),e.fatal?a.abort():a.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===a.value)return u;const t=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t});{if("aborted"===a.value)return u;const t=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value),{status:a.value,value:t.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(t=>"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value).then(()=>({status:a.value,value:t.value}))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!f(e))return u;const t=n.transform(e.value,r);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:t}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>f(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:a.value,value:e})):u)}e.assertNever(n)}}ZodEffects.create=(e,t,a)=>new ZodEffects({schema:e,typeName:X.ZodEffects,effect:t,...v(a)}),ZodEffects.createWithPreprocess=(e,t,a)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:X.ZodEffects,...v(a)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===a.undefined?p(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:X.ZodOptional,...v(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===a.null?p(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:X.ZodNullable,...v(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===a.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:X.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...v(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return y(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:X.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...v(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==a.nan){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.nan,received:t.parsedType}),u}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:X.ZodNaN,...v(e)});const J=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),l(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:X.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),a=e=>(f(e)&&(e.value=Object.freeze(e.value)),e);return y(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}function Y(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function H(e,t={},a){return e?ZodAny.create().superRefine((s,n)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}});if(!r){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}}):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:X.ZodReadonly,...v(t)});const G={object:ZodObject.lazycreate};var X;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(X||(X={}));const Q=(e,t={message:`Input not instance of ${e.name}`})=>H(t=>t instanceof e,t),ee=ZodString.create,te=ZodNumber.create,ae=ZodNaN.create,se=ZodBigInt.create,ne=ZodBoolean.create,re=ZodDate.create,ie=ZodSymbol.create,oe=ZodUndefined.create,de=ZodNull.create,ce=ZodAny.create,ue=ZodUnknown.create,le=ZodNever.create,pe=ZodVoid.create,he=ZodArray.create,me=ZodObject.create,fe=ZodObject.strictCreate,ye=ZodUnion.create,_e=ZodDiscriminatedUnion.create,ge=ZodIntersection.create,ve=ZodTuple.create,Ze=ZodRecord.create,be=ZodMap.create,ke=ZodSet.create,xe=ZodFunction.create,we=ZodLazy.create,Te=ZodLiteral.create,Ne=ZodEnum.create,Oe=ZodNativeEnum.create,Se=ZodPromise.create,Ae=ZodEffects.create,Ee=ZodOptional.create,je=ZodNullable.create,Ce=ZodEffects.createWithPreprocess,Pe=ZodPipeline.create,Ie={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},Re=u;var $e=Object.freeze({__proto__:null,BRAND:J,DIRTY:l,EMPTY_PATH:[],INVALID:u,NEVER:Re,OK:p,ParseStatus,Schema:ZodType,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,get ZodFirstPartyTypeKind(){return X},ZodFunction,ZodIntersection,ZodIssueCode:n,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType:a,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSchema:ZodType,ZodSet,ZodString,ZodSymbol,ZodTransformer:ZodEffects,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,addIssueToContext:c,any:ce,array:he,bigint:se,boolean:ne,coerce:Ie,custom:H,date:re,datetimeRegex:z,defaultErrorMap:r,discriminatedUnion:_e,effect:Ae,enum:Ne,function:xe,getErrorMap:o,getParsedType:s,instanceof:Q,intersection:ge,isAborted:h,isAsync:y,isDirty:m,isValid:f,late:G,lazy:we,literal:Te,makeIssue:d,map:be,nan:ae,nativeEnum:Oe,never:le,null:de,nullable:je,number:te,object:me,get objectUtil(){return t},oboolean:()=>ne().optional(),onumber:()=>te().optional(),optional:Ee,ostring:()=>ee().optional(),pipeline:Pe,preprocess:Ce,promise:Se,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:Ze,set:ke,setErrorMap:function(e){i=e},strictObject:fe,string:ee,symbol:ie,transformer:Ae,tuple:ve,undefined:oe,union:ye,unknown:ue,get util(){return e},void:pe});export{he as a,ne as b,Oe as c,ye as d,Ne as e,de as f,ce as g,Q as i,Te as l,te as n,me as o,Ze as r,ee as s,ue as u,$e as z};
|
|
1
|
+
var e,t;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const a=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),s=e=>{switch(typeof e){case"undefined":return a.undefined;case"string":return a.string;case"number":return Number.isNaN(e)?a.nan:a.number;case"boolean":return a.boolean;case"function":return a.function;case"bigint":return a.bigint;case"symbol":return a.symbol;case"object":return Array.isArray(e)?a.array:null===e?a.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?a.promise:"undefined"!=typeof Map&&e instanceof Map?a.map:"undefined"!=typeof Set&&e instanceof Set?a.set:"undefined"!=typeof Date&&e instanceof Date?a.date:a.object;default:return a.unknown}},n=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const r=(t,s)=>{let r;switch(t.code){case n.invalid_type:r=t.received===a.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case n.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case n.unrecognized_keys:r=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case n.invalid_union:r="Invalid input";break;case n.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case n.invalid_enum_value:r=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case n.invalid_arguments:r="Invalid function arguments";break;case n.invalid_return_type:r="Invalid function return type";break;case n.invalid_date:r="Invalid date";break;case n.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case n.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case n.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case n.custom:r="Invalid input";break;case n.invalid_intersection_types:r="Intersection results could not be merged";break;case n.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case n.not_finite:r="Number must be finite";break;default:r=s.defaultError,e.assertNever(t)}return{message:r}};let i=r;function o(){return i}const d=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function c(e,t){const a=o(),s=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===r?void 0:r].filter(e=>!!e)});e.common.issues.push(s)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return u;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return ParseStatus.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return u;if("aborted"===n.status)return u;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const u=Object.freeze({status:"aborted"}),l=e=>({status:"dirty",value:e}),p=e=>({status:"valid",value:e}),h=e=>"aborted"===e.status,m=e=>"dirty"===e.status,f=e=>"valid"===e.status,y=e=>"undefined"!=typeof Promise&&e instanceof Promise;var _;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(_||(_={}));class ParseInputLazyPath{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const g=(e,t)=>{if(f(t))return{success:!0,data:t.value};if(!e.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 ZodError(e.common.issues);return this._error=t,this._error}}};function v(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??n.defaultError}:void 0===n.data?{message:r??s??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:r??a??n.defaultError}},description:n}}class ZodType{get description(){return this._def.description}_getType(e){return s(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(y(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parseSync({data:e,path:a.path,parent:a});return g(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return f(a)?{value:a.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>f(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(y(n)?n:Promise.resolve(n));return g(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,s)=>{const r=e(t),i=()=>s.addIssue({code:n.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...v(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...v(this._def),innerType:this,defaultValue:t,typeName:X.ZodDefault})}brand(){return new ZodBranded({typeName:X.ZodBranded,type:this,...v(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...v(this._def),innerType:this,catchValue:t,typeName:X.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,b=/^[0-9a-z]+$/,k=/^[0-9A-HJKMNP-TV-Z]{26}$/i,x=/^[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,w=/^[a-z0-9_-]{21}$/i,T=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?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)?)??$/,O=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let S;const A=/^(?:(?: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])$/,E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,I=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R="((\\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])))",$=new RegExp(`^${R}$`);function L(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function M(e){return new RegExp(`^${L(e)}$`)}function z(e){let t=`${R}T${L(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function D(e,t){return!("v4"!==t&&t||!A.test(e))||!("v6"!==t&&t||!j.test(e))}function F(e,t){if(!T.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(s));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function U(e,t){return!("v4"!==t&&t||!E.test(e))||!("v6"!==t&&t||!C.test(e))}class ZodString extends ZodType{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==a.string){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.string,received:e.parsedType}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("max"===a.kind)t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const e=t.data.length>a.value,i=t.data.length<a.value;(e||i)&&(r=this._getOrReturnCtx(t,r),e?c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if("email"===a.kind)O.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"email",code:n.invalid_string,message:a.message}),s.dirty());else if("emoji"===a.kind)S||(S=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),S.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"emoji",code:n.invalid_string,message:a.message}),s.dirty());else if("uuid"===a.kind)x.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"uuid",code:n.invalid_string,message:a.message}),s.dirty());else if("nanoid"===a.kind)w.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"nanoid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid"===a.kind)Z.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid2"===a.kind)b.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid2",code:n.invalid_string,message:a.message}),s.dirty());else if("ulid"===a.kind)k.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ulid",code:n.invalid_string,message:a.message}),s.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),c(r,{validation:"url",code:n.invalid_string,message:a.message}),s.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"regex",code:n.invalid_string,message:a.message}),s.dirty())}else if("trim"===a.kind)t.data=t.data.trim();else if("includes"===a.kind)t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty());else if("toLowerCase"===a.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===a.kind)t.data=t.data.toUpperCase();else if("startsWith"===a.kind)t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty());else if("endsWith"===a.kind)t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty());else if("datetime"===a.kind){z(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"datetime",message:a.message}),s.dirty())}else if("date"===a.kind){$.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"date",message:a.message}),s.dirty())}else if("time"===a.kind){M(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"time",message:a.message}),s.dirty())}else"duration"===a.kind?N.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"duration",code:n.invalid_string,message:a.message}),s.dirty()):"ip"===a.kind?D(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ip",code:n.invalid_string,message:a.message}),s.dirty()):"jwt"===a.kind?F(t.data,a.alg)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"jwt",code:n.invalid_string,message:a.message}),s.dirty()):"cidr"===a.kind?U(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cidr",code:n.invalid_string,message:a.message}),s.dirty()):"base64"===a.kind?P.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64",code:n.invalid_string,message:a.message}),s.dirty()):"base64url"===a.kind?I.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64url",code:n.invalid_string,message:a.message}),s.dirty()):e.assertNever(a);return{status:s.value,value:t.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:n.invalid_string,..._.errToObj(a)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,..._.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,..._.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function V(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}ZodString.create=e=>new ZodString({checks:[],typeName:X.ZodString,coerce:e?.coerce??!1,...v(e)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==a.number){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.number,received:e.parsedType}),u}let s;const r=new ParseStatus;for(const a of this._def.checks)if("int"===a.kind)e.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty());else if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else"multipleOf"===a.kind?0!==V(t.data,a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_finite,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:X.ZodNumber,coerce:e?.coerce||!1,...v(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==a.bigint)return this._getInvalidInput(t);let s;const r=new ParseStatus;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.bigint,received:t.parsedType}),u}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:X.ZodBigInt,coerce:e?.coerce??!1,...v(e)});class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==a.boolean){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.boolean,received:t.parsedType}),u}return p(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:X.ZodBoolean,coerce:e?.coerce||!1,...v(e)});class ZodDate extends ZodType{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==a.date){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.date,received:e.parsedType}),u}if(Number.isNaN(t.data.getTime())){return c(this._getOrReturnCtx(t),{code:n.invalid_date}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):e.assertNever(a);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:X.ZodDate,...v(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==a.symbol){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.symbol,received:t.parsedType}),u}return p(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:X.ZodSymbol,...v(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.undefined,received:t.parsedType}),u}return p(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:X.ZodUndefined,...v(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==a.null){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.null,received:t.parsedType}),u}return p(e.data)}}ZodNull.create=e=>new ZodNull({typeName:X.ZodNull,...v(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return p(e.data)}}ZodAny.create=e=>new ZodAny({typeName:X.ZodAny,...v(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return p(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:X.ZodUnknown,...v(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.never,received:t.parsedType}),u}}ZodNever.create=e=>new ZodNever({typeName:X.ZodNever,...v(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.void,received:t.parsedType}),u}return p(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:X.ZodVoid,...v(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==a.array)return c(t,{code:n.invalid_type,expected:a.array,received:t.parsedType}),u;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(c(t,{code:e?n.too_big:n.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(c(t,{code:n.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(c(t,{code:n.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new ParseInputLazyPath(t,e,t.path,a)))).then(e=>ParseStatus.mergeArray(s,e));const i=[...t.data].map((e,a)=>r.type._parseSync(new ParseInputLazyPath(t,e,t.path,a)));return ParseStatus.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}}function B(e){if(e instanceof ZodObject){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=ZodOptional.create(B(s))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:B(e.element)}):e instanceof ZodOptional?ZodOptional.create(B(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(B(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(e=>B(e))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...v(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),a=e.objectKeys(t);return this._cached={shape:t,keys:a},this._cached}_parse(e){if(this._getType(e)!==a.object){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in s.data)i.includes(e)||o.push(e);const d=[];for(const e of i){const t=r[e],a=s.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)d.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)o.length>0&&(c(s,{code:n.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const a=s.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(s,a,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of d){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(t,e)):ParseStatus.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const s=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:_.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(t){const a={};for(const s of e.objectKeys(t))t[s]&&this.shape[s]&&(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}omit(t){const a={};for(const s of e.objectKeys(this.shape))t[s]||(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}deepPartial(){return B(this)}partial(t){const a={};for(const s of e.objectKeys(this.shape)){const e=this.shape[s];t&&!t[s]?a[s]=e:a[s]=e.optional()}return new ZodObject({...this._def,shape:()=>a})}required(t){const a={};for(const s of e.objectKeys(this.shape))if(t&&!t[s])a[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ZodOptional;)e=e._def.innerType;a[s]=e}return new ZodObject({...this._def,shape:()=>a})}keyof(){return q(e.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new ZodError(e.ctx.common.issues));return c(t,{code:n.invalid_union,unionErrors:a}),u});{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=s.map(e=>new ZodError(e));return c(t,{code:n.invalid_union,unionErrors:r}),u}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:X.ZodUnion,...v(t)});const K=t=>t instanceof ZodLazy?K(t.schema):t instanceof ZodEffects?K(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?e.objectValues(t.enum):t instanceof ZodDefault?K(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:t instanceof ZodOptional?[void 0,...K(t.unwrap())]:t instanceof ZodNullable?[null,...K(t.unwrap())]:t instanceof ZodBranded||t instanceof ZodReadonly?K(t.unwrap()):t instanceof ZodCatch?K(t._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.object)return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:n.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),u)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=K(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new ZodDiscriminatedUnion({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(a)})}}function W(t,n){const r=s(t),i=s(n);if(t===n)return{valid:!0,data:t};if(r===a.object&&i===a.object){const a=e.objectKeys(n),s=e.objectKeys(t).filter(e=>-1!==a.indexOf(e)),r={...t,...n};for(const e of s){const a=W(t[e],n[e]);if(!a.valid)return{valid:!1};r[e]=a.data}return{valid:!0,data:r}}if(r===a.array&&i===a.array){if(t.length!==n.length)return{valid:!1};const e=[];for(let a=0;a<t.length;a++){const s=W(t[a],n[a]);if(!s.valid)return{valid:!1};e.push(s.data)}return{valid:!0,data:e}}return r===a.date&&i===a.date&&+t===+n?{valid:!0,data:t}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(h(e)||h(s))return u;const r=W(e.value,s.value);return r.valid?((m(e)||m(s))&&t.dirty(),{status:t.value,value:r.data}):(c(a,{code:n.invalid_intersection_types}),u)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ZodIntersection.create=(e,t,a)=>new ZodIntersection({left:e,right:t,typeName:X.ZodIntersection,...v(a)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.array)return c(s,{code:n.invalid_type,expected:a.array,received:s.parsedType}),u;if(s.data.length<this._def.items.length)return c(s,{code:n.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;!this._def.rest&&s.data.length>this._def.items.length&&(c(s,{code:n.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...s.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new ParseInputLazyPath(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(r).then(e=>ParseStatus.mergeArray(t,e)):ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:X.ZodTuple,rest:null,...v(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.object)return c(s,{code:n.invalid_type,expected:a.object,received:s.parsedType}),u;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in s.data)r.push({key:i._parse(new ParseInputLazyPath(s,e,s.path,e)),value:o._parse(new ParseInputLazyPath(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?ParseStatus.mergeObjectAsync(t,r):ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:X.ZodRecord,...v(a)}:{keyType:ZodString.create(),valueType:e,typeName:X.ZodRecord,...v(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.map)return c(s,{code:n.invalid_type,expected:a.map,received:s.parsedType}),u;const r=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([e,t],a)=>({key:r._parse(new ParseInputLazyPath(s,e,s.path,[a,"key"])),value:i._parse(new ParseInputLazyPath(s,t,s.path,[a,"value"]))}));if(s.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of o){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of o){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,a)=>new ZodMap({valueType:t,keyType:e,typeName:X.ZodMap,...v(a)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.set)return c(s,{code:n.invalid_type,expected:a.set,received:s.parsedType}),u;const r=this._def;null!==r.minSize&&s.data.size<r.minSize.value&&(c(s,{code:n.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&s.data.size>r.maxSize.value&&(c(s,{code:n.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const a=new Set;for(const s of e){if("aborted"===s.status)return u;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const d=[...s.data.values()].map((e,t)=>i._parse(new ParseInputLazyPath(s,e,s.path,t)));return s.common.async?Promise.all(d).then(e=>o(e)):o(d)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:X.ZodSet,...v(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.function)return c(t,{code:n.invalid_type,expected:a.function,received:t.parsedType}),u;function s(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_arguments,argumentsError:a}})}function i(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_return_type,returnTypeError:a}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return p(async function(...t){const a=new ZodError([]),n=await e._def.args.parseAsync(t,l).catch(e=>{throw a.addIssue(s(t,e)),a}),r=await Reflect.apply(h,this,n);return await e._def.returns._def.type.parseAsync(r,l).catch(e=>{throw a.addIssue(i(r,e)),a})})}{const e=this;return p(function(...t){const a=e._def.args.safeParse(t,l);if(!a.success)throw new ZodError([s(t,a.error)]);const n=Reflect.apply(h,this,a.data),r=e._def.returns.safeParse(n,l);if(!r.success)throw new ZodError([i(n,r.error)]);return r.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:X.ZodFunction,...v(a)})}}class ZodLazy extends ZodType{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})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:X.ZodLazy,...v(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:n.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:e.data}}get value(){return this._def.value}}function q(e,t){return new ZodEnum({values:e,typeName:X.ZodEnum,...v(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:X.ZodLiteral,...v(t)});class ZodEnum extends ZodType{_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),s=this._def.values;return c(a,{expected:e.joinValues(s),received:a.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),a=this._def.values;return c(e,{received:e.data,code:n.invalid_enum_value,options:a}),u}return p(t.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 ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ZodEnum.create=q;class ZodNativeEnum extends ZodType{_parse(t){const s=e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==a.string&&r.parsedType!==a.number){const t=e.objectValues(s);return c(r,{expected:e.joinValues(t),received:r.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=e.objectValues(s);return c(r,{received:r.data,code:n.invalid_enum_value,options:t}),u}return p(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:X.ZodNativeEnum,...v(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.promise&&!1===t.common.async)return c(t,{code:n.invalid_type,expected:a.promise,received:t.parsedType}),u;const s=t.parsedType===a.promise?t.data:Promise.resolve(t.data);return p(s.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:X.ZodPromise,...v(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:s}=this._processInputParams(t),n=this._def.effect||null,r={addIssue:e=>{c(s,e),e.fatal?a.abort():a.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===a.value)return u;const t=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t});{if("aborted"===a.value)return u;const t=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value),{status:a.value,value:t.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(t=>"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value).then(()=>({status:a.value,value:t.value}))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!f(e))return u;const t=n.transform(e.value,r);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:t}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>f(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:a.value,value:e})):u)}e.assertNever(n)}}ZodEffects.create=(e,t,a)=>new ZodEffects({schema:e,typeName:X.ZodEffects,effect:t,...v(a)}),ZodEffects.createWithPreprocess=(e,t,a)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:X.ZodEffects,...v(a)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===a.undefined?p(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:X.ZodOptional,...v(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===a.null?p(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:X.ZodNullable,...v(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===a.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:X.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...v(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return y(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:X.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...v(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==a.nan){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.nan,received:t.parsedType}),u}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:X.ZodNaN,...v(e)});const J=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),l(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:X.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),a=e=>(f(e)&&(e.value=Object.freeze(e.value)),e);return y(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}function Y(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function H(e,t={},a){return e?ZodAny.create().superRefine((s,n)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}});if(!r){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}}):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:X.ZodReadonly,...v(t)});const G={object:ZodObject.lazycreate};var X;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(X||(X={}));const Q=(e,t={message:`Input not instance of ${e.name}`})=>H(t=>t instanceof e,t),ee=ZodString.create,te=ZodNumber.create,ae=ZodNaN.create,se=ZodBigInt.create,ne=ZodBoolean.create,re=ZodDate.create,ie=ZodSymbol.create,oe=ZodUndefined.create,de=ZodNull.create,ce=ZodAny.create,ue=ZodUnknown.create,le=ZodNever.create,pe=ZodVoid.create,he=ZodArray.create,me=ZodObject.create,fe=ZodObject.strictCreate,ye=ZodUnion.create,_e=ZodDiscriminatedUnion.create,ge=ZodIntersection.create,ve=ZodTuple.create,Ze=ZodRecord.create,be=ZodMap.create,ke=ZodSet.create,xe=ZodFunction.create,we=ZodLazy.create,Te=ZodLiteral.create,Ne=ZodEnum.create,Oe=ZodNativeEnum.create,Se=ZodPromise.create,Ae=ZodEffects.create,Ee=ZodOptional.create,je=ZodNullable.create,Ce=ZodEffects.createWithPreprocess,Pe=ZodPipeline.create,Ie={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},Re=u;var $e=Object.freeze({__proto__:null,BRAND:J,DIRTY:l,EMPTY_PATH:[],INVALID:u,NEVER:Re,OK:p,ParseStatus,Schema:ZodType,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,get ZodFirstPartyTypeKind(){return X},ZodFunction,ZodIntersection,ZodIssueCode:n,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType:a,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSchema:ZodType,ZodSet,ZodString,ZodSymbol,ZodTransformer:ZodEffects,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,addIssueToContext:c,any:ce,array:he,bigint:se,boolean:ne,coerce:Ie,custom:H,date:re,datetimeRegex:z,defaultErrorMap:r,discriminatedUnion:_e,effect:Ae,enum:Ne,function:xe,getErrorMap:o,getParsedType:s,instanceof:Q,intersection:ge,isAborted:h,isAsync:y,isDirty:m,isValid:f,late:G,lazy:we,literal:Te,makeIssue:d,map:be,nan:ae,nativeEnum:Oe,never:le,null:de,nullable:je,number:te,object:me,get objectUtil(){return t},oboolean:()=>ne().optional(),onumber:()=>te().optional(),optional:Ee,ostring:()=>ee().optional(),pipeline:Pe,preprocess:Ce,promise:Se,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:Ze,set:ke,setErrorMap:function(e){i=e},strictObject:fe,string:ee,symbol:ie,transformer:Ae,tuple:ve,undefined:oe,union:ye,unknown:ue,get util(){return e},void:pe});export{he as a,Oe as b,ne as c,ye as d,Ne as e,de as f,ce as g,Q as i,Te as l,te as n,me as o,Ze as r,ee as s,ue as u,$e as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-
|
|
1
|
+
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-1Vz6ZOwp.js";const c=i`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let d=class MqTermsAndConditions extends o{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.acceptLegalConsentMutation=new r(this,{mutationFn:async t=>h.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=c}willUpdate(t){t.has("env")&&this.env&&l(this.env),t.has("apiKey")&&this.apiKey&&h.setApiKey(this.apiKey),t.has("token")&&this.token&&h.setAuthToken(this.token)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return n`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([a({type:Boolean})],d.prototype,"disabled",void 0),t([a({type:Boolean})],d.prototype,"hasCommercialCommunications",void 0),t([a({type:String,attribute:"api-key"})],d.prototype,"apiKey",void 0),t([a({type:String,attribute:"token"})],d.prototype,"token",void 0),t([a({type:String,attribute:"env"})],d.prototype,"env",void 0),t([s()],d.prototype,"_accepted",void 0),d=t([e("mq-terms-and-conditions")],d);export{d as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-
|
|
1
|
+
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-1Vz6ZOwp.js";import{DownloadFileEvent as m}from"../events.js";import{getLocale as f}from"../i18n.js";const h=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let u=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=f().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,o)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=o,i.readAsDataURL(t)})}(t);this.dispatchEvent(new m({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],u.prototype,"kind",void 0),t([n({type:String})],u.prototype,"filename",void 0),t([n({type:String})],u.prototype,"specialty",void 0),t([n({type:String})],u.prototype,"description",void 0),t([n({type:String})],u.prototype,"date",void 0),t([n({type:String})],u.prototype,"downloadUrl",void 0),t([a()],u.prototype,"isDownloading",void 0),u=t([d(),e("patient-document")],u);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{b as n}from"./api-chat-client-
|
|
1
|
+
import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{b as n}from"./api-chat-client-1Vz6ZOwp.js";import{a as r}from"./telemetry-client-BLJVs9me.js";import{i as a,a as s,E as l,x as m}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),a=r(o,this.duration),s=e.format(o),p=i.format(o),d=i.format(a),v=this.timezone?n(this.timezone,o):"";return m`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${p} - ${d}${v?` (${v})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function x(t){return t/100}function z(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(x(t.amount))}function j(t){return null!=t&&t.amount>0}t([p({type:String})],g.prototype,"startsAt",void 0),t([p({type:Number})],g.prototype,"duration",void 0),t([p({type:String})],g.prototype,"channel",void 0),t([p({type:String})],g.prototype,"variant",void 0),t([p({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([p({type:String})],g.prototype,"timezone",void 0),g=t([o(),e("appointment-details")],g);export{g as A,x as c,z as f,j as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./api-chat-client-
|
|
1
|
+
import{g as e}from"./api-chat-client-1Vz6ZOwp.js";import{t}from"./parseISO-Dj3qSTG8.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
|
|
@@ -40,5 +40,11 @@ declare const CreatePaymentLinkRequestSchema: z.ZodObject<{
|
|
|
40
40
|
discount_code?: string | undefined;
|
|
41
41
|
}>;
|
|
42
42
|
type CreatePaymentLinkRequest = z.infer<typeof CreatePaymentLinkRequestSchema>;
|
|
43
|
+
declare const PaymentProvider: {
|
|
44
|
+
readonly Addon: "addon";
|
|
45
|
+
readonly Stripe: "stripe";
|
|
46
|
+
};
|
|
47
|
+
type PaymentProvider = (typeof PaymentProvider)[keyof typeof PaymentProvider];
|
|
43
48
|
|
|
49
|
+
export { PaymentProvider as P };
|
|
44
50
|
export type { CreatePaymentLinkRequest as C };
|
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.5.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.5.2",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
|
package/dist/events.d.ts
CHANGED
|
@@ -133,8 +133,53 @@ declare class MqViewDocumentsEvent extends Event {
|
|
|
133
133
|
static eventName: string;
|
|
134
134
|
constructor();
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* A payment session was confirmed as paid (emitted by `mq-payment-poller`).
|
|
138
|
+
*
|
|
139
|
+
* The poller only reports the *happy* terminal state: rejected and
|
|
140
|
+
* unconfirmable payments are rendered by the poller itself, because the host
|
|
141
|
+
* has no better screen to show for them and nothing to decide. Success is the
|
|
142
|
+
* one outcome where the host owns the destination, so it is the one event.
|
|
143
|
+
*/
|
|
144
|
+
declare class MqPaymentSucceededEvent extends Event {
|
|
145
|
+
readonly detail: {
|
|
146
|
+
appointmentId: string;
|
|
147
|
+
consultationType: string;
|
|
148
|
+
};
|
|
149
|
+
static eventName: string;
|
|
150
|
+
constructor(detail: {
|
|
151
|
+
appointmentId: string;
|
|
152
|
+
consultationType: string;
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The user is about to be handed over to an off-site payment gateway.
|
|
157
|
+
*
|
|
158
|
+
* Unlike the rest of the contract this event is **cancelable and has a default
|
|
159
|
+
* action**: the emitting component navigates the top-level document to `url`
|
|
160
|
+
* unless a listener calls `preventDefault()`. Hosts that render in a plain
|
|
161
|
+
* browser tab need no listener at all; the escape hatch exists for webviews and
|
|
162
|
+
* in-app shells that must open the gateway some other way — the same reason
|
|
163
|
+
* `apple-pay-opened` / `google-pay-opened` are cancelable.
|
|
164
|
+
*
|
|
165
|
+
* `url` is a single-use gateway checkout URL — treat it as a secret and do not
|
|
166
|
+
* log it.
|
|
167
|
+
*/
|
|
168
|
+
declare class MqPaymentRedirectEvent extends Event {
|
|
169
|
+
readonly detail: {
|
|
170
|
+
url: string;
|
|
171
|
+
sessionId: string;
|
|
172
|
+
};
|
|
173
|
+
static eventName: string;
|
|
174
|
+
constructor(detail: {
|
|
175
|
+
url: string;
|
|
176
|
+
sessionId: string;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
136
179
|
declare global {
|
|
137
180
|
interface HTMLElementEventMap {
|
|
181
|
+
"mq-payment-succeeded": MqPaymentSucceededEvent;
|
|
182
|
+
"mq-payment-redirect": MqPaymentRedirectEvent;
|
|
138
183
|
"mq-back": MqBackEvent;
|
|
139
184
|
"mq-home": MqHomeEvent;
|
|
140
185
|
"mq-view-appointments": MqViewAppointmentsEvent;
|
|
@@ -147,5 +192,5 @@ declare global {
|
|
|
147
192
|
}
|
|
148
193
|
}
|
|
149
194
|
|
|
150
|
-
export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent };
|
|
195
|
+
export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqPaymentRedirectEvent, MqPaymentSucceededEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent };
|
|
151
196
|
export type { MqAppointmentsTab };
|
package/dist/events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqViewDocumentsEvent extends Event{static{this.eventName="mq-view-documents"}constructor(){super(MqViewDocumentsEvent.eventName,{bubbles:!0,composed:!0})}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent};
|
|
1
|
+
class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqViewDocumentsEvent extends Event{static{this.eventName="mq-view-documents"}constructor(){super(MqViewDocumentsEvent.eventName,{bubbles:!0,composed:!0})}}class MqPaymentSucceededEvent extends Event{static{this.eventName="mq-payment-succeeded"}constructor(e){super(MqPaymentSucceededEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqPaymentRedirectEvent extends Event{static{this.eventName="mq-payment-redirect"}constructor(e){super(MqPaymentRedirectEvent.eventName,{bubbles:!0,composed:!0,cancelable:!0}),this.detail=e}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqPaymentRedirectEvent,MqPaymentSucceededEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent};
|
package/dist/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as t}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as n}from"./chunks/external-
|
|
1
|
+
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as t}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as n}from"./chunks/external-CJj32K_p.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=n.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const n=i();if(!n.initialized){n.initialized=!0;try{const{setLocale:t,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-BslWF9nj.js");case"pt_PT":return import("./chunks/pt_PT-CFbbWowX.js");case"de_DE":return import("./chunks/de_DE-CrwfSJnS.js");case"ca_ES":return import("./chunks/ca_ES-nttMFJzr.js")}}});n.setLocale=t,n.getLocale=s}catch(e){t.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:n}=i();if(n)return n(e);t.warn(u)}function _(){const{getLocale:e}=i();return e?e():(t.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { MqThemeProvider, ThemeName } from './mq-theme-provider.js';
|
|
2
|
-
export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent } from './events.js';
|
|
2
|
+
export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqPaymentRedirectEvent, MqPaymentSucceededEvent, MqViewAppointmentsEvent, MqViewDocumentsEvent } from './events.js';
|
|
3
3
|
export { d as defaultTheme } from './chunks/default-IpEn36CA.js';
|
|
4
4
|
import 'lit-html';
|
|
5
5
|
import 'lit';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
|
|
1
|
+
export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqPaymentRedirectEvent,MqPaymentSucceededEvent,MqViewAppointmentsEvent,MqViewDocumentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/localized-decorator-BlOuLhym.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-1Vz6ZOwp.js";import{u as v,s as b,r as k}from"./chunks/apple-pay-outcomes-0ozxSHyb.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function f(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function P(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!f()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!f()}:{available:!1,reason:"unsupported"}}const g={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{u()}catch{}const E=["visa","masterCard","amex"],_=["supports3DS"],S=o`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function A(e,t){n.warn(e,{error:t instanceof Error?t.message:String(t)})}let C=class MqApplePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this._loginTokenTask=new i(this,m,{args:()=>[this.apiKey,this.token],onComplete:e=>{m.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return A("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await m.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(v(a))}catch(t){A("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await m.payments.authorizeApplePay({order_id:this.sessionId,token:b(t.payment.token)}),{status:s,consultation_id:i}=a.data,n=k(s,i,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){A("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){A("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=S}willUpdate(e){if(e.has("env")&&this.env&&h(this.env),e.has("apiKey")&&m.setApiKey(this.apiKey),e.has("locale")){const e=y(this.locale)?this.locale:"es_ES";d(e),m.setLanguage(e)}e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await P(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return y(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...E],merchantCapabilities:[..._],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?p`<p class="state">${a("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:p`<p class="state">${a("Apple Pay no está disponible")}</p>`:p`<p class="state">${a("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>p`<p class="state">${a("Preparando Apple Pay…")}</p>`,error:()=>p`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?p`<p class="state">${a("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():p`${this._showQrHelper?p`<p class="helper">${a("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,g[e]??"es-ES"}" aria-label="${a("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([l({type:String,attribute:"env"})],C.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],C.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],C.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],C.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],C.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],C.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],C.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],C.prototype,"country",void 0),e([l({type:String,attribute:"label"})],C.prototype,"label",void 0),e([c()],C.prototype,"_availabilityPhase",void 0),e([c()],C.prototype,"_showQrHelper",void 0),e([c()],C.prototype,"_paying",void 0),C=e([s(),t("mq-apple-pay-checkout")],C);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,C as MqApplePayCheckout};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { C as CreatePaymentLinkRequest } from './chunks/schemas.d-
|
|
2
|
+
import { C as CreatePaymentLinkRequest } from './chunks/schemas.d-5CaMrfOq.js';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import { Locale } from './i18n.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-
|
|
1
|
+
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-1Vz6ZOwp.js";import"./mq-checkout.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async()=>{const t=await p.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:t.session_id,paymentUrl:t.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return i`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([s({type:String,attribute:"env"})],r.prototype,"env",void 0),t([s({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([s({type:String,attribute:"token"})],r.prototype,"token",void 0),t([s({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([s({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([s({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([s({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([s({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([s({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([s({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
|