@botpress/webchat 2.1.12 → 2.1.13

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @botpress/webchat@2.1.12 build /home/runner/work/echo/echo/packages/webchat-frontend
2
+ > @botpress/webchat@2.1.13 build /home/runner/work/echo/echo/packages/webchat-frontend
3
3
  > vite build
4
4
 
5
5
  vite v4.4.11 building for production...
@@ -12,8 +12,8 @@ rendering chunks...
12
12
  
13
13
  [vite:dts] Start generate declaration files...
14
14
  computing gzip size...
15
- [vite:dts] Declaration files built in 14617ms.
15
+ [vite:dts] Declaration files built in 15367ms.
16
16
  
17
- dist/index.js 1,288.30 kB │ gzip: 316.50 kB
18
- dist/index.umd.cjs 901.98 kB │ gzip: 264.52 kB
19
- ✓ built in 22.43s
17
+ dist/index.js 1,288.37 kB │ gzip: 316.53 kB
18
+ dist/index.umd.cjs 902.01 kB │ gzip: 264.53 kB
19
+ ✓ built in 23.64s
@@ -7,6 +7,8 @@ export type UserCredentials = {
7
7
  export type UserData = Record<string, unknown>;
8
8
  export type User = {
9
9
  data?: UserData;
10
+ name?: string;
11
+ pictureUrl?: string;
10
12
  };
11
13
  export type Message = {
12
14
  id: string;
package/dist/index.js CHANGED
@@ -29904,7 +29904,7 @@ class _6 extends hm {
29904
29904
  }, await this._client.updateUser({
29905
29905
  "x-user-key": n.userToken,
29906
29906
  name: void 0,
29907
- // TODO: allow passing name and pictureUrl
29907
+ // TODO: allow passing name and pictureUrl in WebchatProps
29908
29908
  pictureUrl: void 0,
29909
29909
  userData: r
29910
29910
  })), n;
@@ -29946,6 +29946,8 @@ class _6 extends hm {
29946
29946
  throw new qr(this._state);
29947
29947
  const { user: r } = await this._client.updateUser({
29948
29948
  "x-user-key": this._state.userKey,
29949
+ name: n.name,
29950
+ pictureUrl: n.pictureUrl,
29949
29951
  userData: n.data
29950
29952
  });
29951
29953
  return r;
@@ -141,7 +141,7 @@ Check the top-level render call using <`+ve+">.")}return le}}function Ht(j,le){{
141
141
  `.charCodeAt(0)||zt==="\r".charCodeAt(0))&&(xt=Ht)}var Wt=(xt!==-1?Xe:"")+It.slice(0,xt+1);Xe=(xt===-1?Xe:"")+It.slice(xt+1),It!==""&&(K=Date.now(),ie+=It.length);for(var Pt=0;Pt<Wt.length;Pt+=1){var zt=Wt.charCodeAt(Pt);if(rt===C&&zt===`
142
142
  `.charCodeAt(0))rt=te;else if(rt===C&&(rt=te),zt==="\r".charCodeAt(0)||zt===`
143
143
  `.charCodeAt(0)){if(rt!==te){rt===fe&&(Ye=Pt+1);var fn=Wt.slice(At,Ye-1),pn=Wt.slice(Ye+(Ye<Pt&&Wt.charCodeAt(Ye)===" ".charCodeAt(0)?1:0),Pt);fn==="data"?(Yt+=`
144
- `,Yt+=pn):fn==="id"?z=pn:fn==="event"?J=pn:fn==="retry"?(Se=Fe(pn,Se),Ge=Se):fn==="heartbeatTimeout"&&(Be=Fe(pn,Be),Et!==0&&(i(Et),Et=r(function(){ir()},Be)))}if(rt===te){if(Yt!==""){pt=z,J===""&&(J="message");var Nn=new B(J,{data:Yt.slice(1),lastEventId:z});if(L.dispatchEvent(Nn),J==="open"?he(L,L.onopen,Nn):J==="message"?he(L,L.onmessage,Nn):J==="error"&&he(L,L.onerror,Nn),Nt===Q)return}Yt="",J=""}rt=zt==="\r".charCodeAt(0)?C:te}else rt===te&&(At=Pt,rt=fe),rt===fe?zt===":".charCodeAt(0)&&(Ye=Pt+1,rt=A):rt===A&&(rt=we)}}},Vt=function(It){if(Nt===W||Nt===Z){Nt=M,Et!==0&&(i(Et),Et=0),Et=r(function(){ir()},Ge),Ge=Re(Math.min(Se*16,Ge*2)),L.readyState=Z;var xt=new D("error",{error:It});L.dispatchEvent(xt),he(L,L.onerror,xt),It!=null&&console.error(It)}},_n=function(){Nt=Q,Ot!=null&&(Ot.abort(),Ot=void 0),Et!==0&&(i(Et),Et=0),L.readyState=Q},ir=function(){if(Et=0,Nt!==M){if(!K&&Ot!=null)Vt(new Error("No activity within "+Be+" milliseconds. "+(Nt===Z?"No response received.":ie+" chars received.")+" Reconnecting.")),Ot!=null&&(Ot.abort(),Ot=void 0);else{var It=Math.max((K||Date.now())+Be-Date.now(),1);K=!1,Et=r(function(){ir()},It)}return}K=!1,ie=0,Et=r(function(){ir()},Be),Nt=Z,Yt="",J="",z=pt,Xe="",At=0,Ye=0,rt=te;var xt=oe;if(oe.slice(0,5)!=="data:"&&oe.slice(0,5)!=="blob:"&&pt!==""){var Ht=oe.indexOf("?");xt=Ht===-1?oe:oe.slice(0,Ht+1)+oe.slice(Ht+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(pn,Nn){return Nn===Ne?"":pn}),xt+=(oe.indexOf("?")===-1?"?":"&")+Ne+"="+encodeURIComponent(pt)}var zt=L.withCredentials,Wt={};Wt.Accept="text/event-stream";var Pt=L.headers;if(Pt!=null)for(var fn in Pt)Object.prototype.hasOwnProperty.call(Pt,fn)&&(Wt[fn]=Pt[fn]);try{Ot=Mt.open(Je,cn,Un,Vt,xt,zt,Wt)}catch(pn){throw _n(),pn}};L.url=oe,L.readyState=Z,L.withCredentials=ue,L.headers=ae,L._close=_n,ir()}de.prototype=Object.create(O.prototype),de.prototype.CONNECTING=Z,de.prototype.OPEN=W,de.prototype.CLOSED=Q,de.prototype.close=function(){this._close()},de.CONNECTING=Z,de.OPEN=W,de.CLOSED=Q,de.prototype.withCredentials=void 0;var et=c;o!=null&&(c==null||!("withCredentials"in c.prototype))&&(et=de),function(L){{var oe=L(t);oe!==void 0&&(e.exports=oe)}}(function(L){L.EventSourcePolyfill=de,L.NativeEventSource=c,L.EventSource=et})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:tt:globalThis)})(Hh,Hh.exports);var pz=Hh.exports;const hz=mi(pz),mz=(e,t={})=>{const n=new hz.EventSourcePolyfill(e,{headers:t.headers}),r=new dS;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},yz=async(e,t={})=>{const{emitter:n,source:r}=mz(e,t);return await new Promise((i,o)=>{n.on("open",()=>{i()}),n.on("error",s=>{o(s)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}};var Tt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var Wh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Wh||(Wh={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.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"]),gz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const Ta=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Tt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tt.assertNever(e)}return{message:n}};let fS=Ta;function vz(e){fS=e}function Ru(){return fS}const Pu=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},bz=[];function Ie(e,t){const n=Pu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ru(),Ta].filter(r=>!!r)});e.common.issues.push(n)}class Rn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return st;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Rn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return st;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const st=Object.freeze({status:"aborted"}),pS=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Kh=e=>e.status==="aborted",Jh=e=>e.status==="dirty",Aa=e=>e.status==="valid",$u=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class Fr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hS=(e,t)=>{if(Aa(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 n=new Sr(e.common.issues);return this._error=n,this._error}}};function lt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class ft{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($u(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},o=this._parseSync({data:t,path:i.path,parent:i});return hS(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await($u(i)?i:Promise.resolve(i));return hS(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:ge.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cr({schema:this,typeName:Qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return oi.create(this,this._def)}nullable(){return go.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return ys.create(this,this._def)}or(t){return Pa.create([this,t],this._def)}and(t){return $a.create(this,t,this._def)}transform(t){return new Cr({...lt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new qa({...lt(this._def),innerType:this,defaultValue:n,typeName:Qe.ZodDefault})}brand(){return new yS({typeName:Qe.ZodBranded,type:this,...lt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Lu({...lt(this._def),innerType:this,catchValue:n,typeName:Qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return La.create(this,t)}readonly(){return Uu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wz=/^c[^\s-]{8,}$/i,xz=/^[a-z][a-z0-9]*$/,_z=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sz=/^[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,Ez=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yh;const Cz=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Tz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Az=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Oz(e,t){return!!((t==="v4"||!t)&&Cz.test(e)||(t==="v6"||!t)&&Tz.test(e))}class Er extends ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),st}const r=new Rn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ez.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Yh||(Yh=new RegExp(kz,"u")),Yh.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Sz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")_z.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ie(i,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Az(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Oz(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ge.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new Er({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Er.create=e=>{var t;return new Er({checks:[],typeName:Qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};function Iz(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Ii extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Iz(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_finite,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ii({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ii({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ii.create=e=>new Ii({checks:[],typeName:Qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class Ri extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.bigint,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ri({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:Qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};class Oa extends ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),st}return Fn(t.data)}}Oa.create=e=>new Oa({typeName:Qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class ho extends ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),st}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_date}),st}const r=new Rn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ho.create=e=>new ho({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Qe.ZodDate,...lt(e)});class Du extends ft{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),st}return Fn(t.data)}}Du.create=e=>new Du({typeName:Qe.ZodSymbol,...lt(e)});class Ia extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),st}return Fn(t.data)}}Ia.create=e=>new Ia({typeName:Qe.ZodUndefined,...lt(e)});class Ra extends ft{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),st}return Fn(t.data)}}Ra.create=e=>new Ra({typeName:Qe.ZodNull,...lt(e)});class ps extends ft{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}}ps.create=e=>new ps({typeName:Qe.ZodAny,...lt(e)});class mo extends ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}}mo.create=e=>new mo({typeName:Qe.ZodUnknown,...lt(e)});class ii extends ft{_parse(t){const n=this._getOrReturnCtx(t);return Ie(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),st}}ii.create=e=>new ii({typeName:Qe.ZodNever,...lt(e)});class Nu extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),st}return Fn(t.data)}}Nu.create=e=>new Nu({typeName:Qe.ZodVoid,...lt(e)});class kr extends ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ie(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),st;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ie(n,{code:s?ge.too_big:ge.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ie(n,{code:ge.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ie(n,{code:ge.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Fr(n,s,n.path,a)))).then(s=>Rn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Fr(n,s,n.path,a)));return Rn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...lt(t)});function hs(e){if(e instanceof Bt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(hs(r))}return new Bt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:hs(e.element)}):e instanceof oi?oi.create(hs(e.unwrap())):e instanceof go?go.create(hs(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>hs(t))):e}class Bt extends ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Tt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const l=this._getOrReturnCtx(t);return Ie(l,{code:ge.invalid_type,expected:Oe.object,received:l.parsedType}),st}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ii&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Fr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ii){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Ie(i,{code:ge.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Fr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key;l.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>Rn.mergeObjectSync(r,l)):Rn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const c=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const n={};return Tt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}omit(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}deepPartial(){return hs(this)}partial(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Bt({...this._def,shape:()=>n})}required(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof oi;)o=o._def.innerType;n[r]=o}}),new Bt({...this._def,shape:()=>n})}keyof(){return mS(Tt.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)});class Pa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Sr(a.ctx.common.issues));return Ie(n,{code:ge.invalid_union,unionErrors:s}),st}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new Sr(c));return Ie(n,{code:ge.invalid_union,unionErrors:a}),st}}get options(){return this._def.options}}Pa.create=(e,t)=>new Pa({options:e,typeName:Qe.ZodUnion,...lt(t)});const ju=e=>e instanceof Na?ju(e.schema):e instanceof Cr?ju(e.innerType()):e instanceof ja?[e.value]:e instanceof Pi?e.options:e instanceof Ma?Object.keys(e.enum):e instanceof qa?ju(e._def.innerType):e instanceof Ia?[void 0]:e instanceof Ra?[null]:null;class Mu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ie(n,{code:ge.invalid_type,expected:Oe.object,received:n.parsedType}),st;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ie(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=ju(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Mu({typeName:Qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...lt(r)})}}function Gh(e,t){const n=Oi(e),r=Oi(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=Tt.objectKeys(t),o=Tt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const c=Gh(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],c=Gh(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $a extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Kh(o)||Kh(s))return st;const a=Gh(o.value,s.value);return a.valid?((Jh(o)||Jh(s))&&n.dirty(),{status:n.value,value:a.data}):(Ie(r,{code:ge.invalid_intersection_types}),st)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$a.create=(e,t,n)=>new $a({left:e,right:t,typeName:Qe.ZodIntersection,...lt(n)});class Ur extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ie(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Ie(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Fr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Rn.mergeArray(n,s)):Rn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ur({...this._def,rest:t})}}Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:Qe.ZodTuple,rest:null,...lt(t)})};class Da extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ie(r,{code:ge.invalid_type,expected:Oe.object,received:r.parsedType}),st;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Fr(r,a,r.path,a)),value:s._parse(new Fr(r,r.data[a],r.path,a))});return r.common.async?Rn.mergeObjectAsync(n,i):Rn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ft?new Da({keyType:t,valueType:n,typeName:Qe.ZodRecord,...lt(r)}):new Da({keyType:Er.create(),valueType:t,typeName:Qe.ZodRecord,...lt(n)})}}class qu extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ie(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),st;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Fr(r,a,r.path,[l,"key"])),value:o._parse(new Fr(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}qu.create=(e,t,n)=>new qu({valueType:t,keyType:e,typeName:Qe.ZodMap,...lt(n)});class yo extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ie(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),st;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ie(r,{code:ge.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ie(r,{code:ge.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return st;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>o._parse(new Fr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new yo({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new yo({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:Qe.ZodSet,...lt(t)});class ms extends ft{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ie(n,{code:ge.invalid_type,expected:Oe.function,received:n.parsedType}),st;function r(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_arguments,argumentsError:c}})}function i(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ys){const a=this;return Fn(async function(...c){const l=new Sr([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return Fn(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new Sr([r(c,l.error)]);const u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Sr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ms({...this._def,args:Ur.create(t).rest(mo.create())})}returns(t){return new ms({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ms({args:t||Ur.create([]).rest(mo.create()),returns:n||mo.create(),typeName:Qe.ZodFunction,...lt(r)})}}class Na extends ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Na.create=(e,t)=>new Na({getter:e,typeName:Qe.ZodLazy,...lt(t)});class ja extends ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ie(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:t.data}}get value(){return this._def.value}}ja.create=(e,t)=>new ja({value:e,typeName:Qe.ZodLiteral,...lt(t)});function mS(e,t){return new Pi({values:e,typeName:Qe.ZodEnum,...lt(t)})}class Pi extends ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),st}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{received:n.data,code:ge.invalid_enum_value,options:r}),st}return Fn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Pi.create(t)}exclude(t){return Pi.create(this.options.filter(n=>!t.includes(n)))}}Pi.create=mS;class Ma extends ft{_parse(t){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=Tt.objectValues(n);return Ie(r,{expected:Tt.joinValues(i),received:r.parsedType,code:ge.invalid_type}),st}if(n.indexOf(t.data)===-1){const i=Tt.objectValues(n);return Ie(r,{received:r.data,code:ge.invalid_enum_value,options:i}),st}return Fn(t.data)}get enum(){return this._def.values}}Ma.create=(e,t)=>new Ma({values:e,typeName:Qe.ZodNativeEnum,...lt(t)});class ys extends ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ie(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),st;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Fn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ys.create=(e,t)=>new ys({type:e,typeName:Qe.ZodPromise,...lt(t)});class Cr extends ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Ie(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const c=i.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Aa(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Tt.assertNever(i)}}Cr.create=(e,t,n)=>new Cr({schema:e,typeName:Qe.ZodEffects,effect:t,...lt(n)}),Cr.createWithPreprocess=(e,t,n)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:Qe.ZodEffects,...lt(n)});class oi extends ft{_parse(t){return this._getType(t)===Oe.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:Qe.ZodOptional,...lt(t)});class go extends ft{_parse(t){return this._getType(t)===Oe.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}go.create=(e,t)=>new go({innerType:e,typeName:Qe.ZodNullable,...lt(t)});class qa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:Qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...lt(t)});class Lu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $u(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Lu.create=(e,t)=>new Lu({innerType:e,typeName:Qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...lt(t)});class Fu extends ft{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),st}return{status:"valid",value:t.data}}}Fu.create=e=>new Fu({typeName:Qe.ZodNaN,...lt(e)});const Rz=Symbol("zod_brand");class yS extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class La extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?st:o.status==="dirty"?(n.dirty(),pS(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?st:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new La({in:t,out:n,typeName:Qe.ZodPipeline})}}class Uu extends ft{_parse(t){const n=this._def.innerType._parse(t);return Aa(n)&&(n.value=Object.freeze(n.value)),n}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:Qe.ZodReadonly,...lt(t)});const gS=(e,t={},n)=>e?ps.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):ps.create(),Pz={object:Bt.lazycreate};var Qe;(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"})(Qe||(Qe={}));const $z=(e,t={message:`Input not instance of ${e.name}`})=>gS(n=>n instanceof e,t),vS=Er.create,bS=Ii.create,Dz=Fu.create,Nz=Ri.create,wS=Oa.create,jz=ho.create,Mz=Du.create,qz=Ia.create,Lz=Ra.create,Fz=ps.create,Uz=mo.create,Bz=ii.create,zz=Nu.create,Zz=kr.create,Vz=Bt.create,Hz=Bt.strictCreate,Wz=Pa.create,Kz=Mu.create,Jz=$a.create,Yz=Ur.create,Gz=Da.create,Xz=qu.create,Qz=yo.create,e4=ms.create,t4=Na.create,n4=ja.create,r4=Pi.create,i4=Ma.create,o4=ys.create,xS=Cr.create,s4=oi.create,a4=go.create,c4=Cr.createWithPreprocess,l4=La.create;var V=Object.freeze({__proto__:null,defaultErrorMap:Ta,setErrorMap:vz,getErrorMap:Ru,makeIssue:Pu,EMPTY_PATH:bz,addIssueToContext:Ie,ParseStatus:Rn,INVALID:st,DIRTY:pS,OK:Fn,isAborted:Kh,isDirty:Jh,isValid:Aa,isAsync:$u,get util(){return Tt},get objectUtil(){return Wh},ZodParsedType:Oe,getParsedType:Oi,ZodType:ft,ZodString:Er,ZodNumber:Ii,ZodBigInt:Ri,ZodBoolean:Oa,ZodDate:ho,ZodSymbol:Du,ZodUndefined:Ia,ZodNull:Ra,ZodAny:ps,ZodUnknown:mo,ZodNever:ii,ZodVoid:Nu,ZodArray:kr,ZodObject:Bt,ZodUnion:Pa,ZodDiscriminatedUnion:Mu,ZodIntersection:$a,ZodTuple:Ur,ZodRecord:Da,ZodMap:qu,ZodSet:yo,ZodFunction:ms,ZodLazy:Na,ZodLiteral:ja,ZodEnum:Pi,ZodNativeEnum:Ma,ZodPromise:ys,ZodEffects:Cr,ZodTransformer:Cr,ZodOptional:oi,ZodNullable:go,ZodDefault:qa,ZodCatch:Lu,ZodNaN:Fu,BRAND:Rz,ZodBranded:yS,ZodPipeline:La,ZodReadonly:Uu,custom:gS,Schema:ft,ZodSchema:ft,late:Pz,get ZodFirstPartyTypeKind(){return Qe},coerce:{string:e=>Er.create({...e,coerce:!0}),number:e=>Ii.create({...e,coerce:!0}),boolean:e=>Oa.create({...e,coerce:!0}),bigint:e=>Ri.create({...e,coerce:!0}),date:e=>ho.create({...e,coerce:!0})},any:Fz,array:Zz,bigint:Nz,boolean:wS,date:jz,discriminatedUnion:Kz,effect:xS,enum:r4,function:e4,instanceof:$z,intersection:Jz,lazy:t4,literal:n4,map:Xz,nan:Dz,nativeEnum:i4,never:Bz,null:Lz,nullable:a4,number:bS,object:Vz,oboolean:()=>wS().optional(),onumber:()=>bS().optional(),optional:s4,ostring:()=>vS().optional(),pipeline:l4,preprocess:c4,promise:o4,record:Gz,set:Qz,strictObject:Hz,string:vS,symbol:Mz,transformer:xS,tuple:Yz,undefined:qz,union:Wz,unknown:Uz,void:zz,NEVER:st,ZodIssueCode:ge,quotelessJson:gz,ZodError:Sr});const u4=V.object({type:V.literal("message_created"),data:V.object({id:V.string().describe("Id of the [Message](#schema_message)"),createdAt:V.string().datetime().describe("Creation date of the [Message](#schema_message) in ISO 8601 format"),payload:V.union([V.object({audioUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("audio")}),V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),type:V.literal("card"),className:V.string().describe("CSS className to apply to the message").optional()}),V.object({items:V.array(V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional()})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("carousel")}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("choice"),disableFreeText:V.boolean().optional()}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("dropdown")}),V.object({fileUrl:V.string().min(1),title:V.string().min(1).optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("file")}),V.object({imageUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("image")}),V.object({latitude:V.number(),longitude:V.number(),address:V.string().optional(),title:V.string().optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("location")}),V.object({markdown:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("markdown")}),V.object({text:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("text")}),V.object({videoUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("video")})]).describe("Payload is the content type of the message."),userId:V.string().describe("ID of the [User](#schema_user)"),conversationId:V.string().describe("ID of the [Conversation](#schema_conversation)")}).describe("The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).")}),d4=V.object({type:V.literal("webchat_visibility"),data:V.object({visibility:V.union([V.literal("show"),V.literal("hide"),V.literal("toggle")])})}),f4=V.object({type:V.literal("webchat_config"),data:V.object({config:V.record(V.union([V.any(),V.null()]))})}),p4=V.object({type:V.literal("custom"),data:V.object({event:V.record(V.union([V.any(),V.null()]))})}),h4=V.object({type:V.literal("typing_started"),data:V.object({timeout:V.number().optional()})}),m4=V.object({type:V.literal("typing_stopped"),data:V.record(V.never())}),y4={messageCreated:u4,webchatVisibility:d4,webchatConfig:f4,custom:p4,typingStarted:h4,typingStopped:m4},_S="unknown error",qd=class qd extends dS{constructor(n){super();k(this,"_state",{status:"disconnected"});k(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});k(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});k(this,"_connect",async()=>{const n=await yz(`${this._props.url}/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});k(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});k(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});k(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});k(this,"_parseSignal",n=>{for(const r of Object.values(y4)){const i=this._safeJsonParse(n),o=r.safeParse(i);if(o.success)return o.data}return{type:"unknown",data:n}});k(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});k(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(_S);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(_S)}});this._props=n}get status(){return this._state.status}};k(qd,"listen",async n=>{const r=new qd(n);return await r.connect(),r});let Xh=qd;const SS=100*1024*1024,g4=SS,v4=SS,b4=6e4;class w4{constructor(t){k(this,"_auto");k(this,"createConversation",t=>this._auto.createConversation(t));k(this,"getConversation",t=>this._auto.getConversation(t));k(this,"deleteConversation",t=>this._auto.deleteConversation(t));k(this,"listConversations",t=>this._auto.listConversations(t));k(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));k(this,"addParticipant",t=>this._auto.addParticipant(t));k(this,"removeParticipant",t=>this._auto.removeParticipant(t));k(this,"getParticipant",t=>this._auto.getParticipant(t));k(this,"listParticipants",t=>this._auto.listParticipants(t));k(this,"createMessage",t=>this._auto.createMessage(t));k(this,"getMessage",t=>this._auto.getMessage(t));k(this,"deleteMessage",t=>this._auto.deleteMessage(t));k(this,"createFile",t=>this._auto.createFile(t));k(this,"createUser",t=>this._auto.createUser(t));k(this,"getUser",t=>this._auto.getUser(t));k(this,"updateUser",t=>this._auto.updateUser(t));k(this,"deleteUser",t=>this._auto.deleteUser(t));k(this,"createEvent",t=>this._auto.createEvent(t));k(this,"getEvent",t=>this._auto.getEvent(t));k(this,"listenConversation",async({id:t,"x-user-key":n})=>await Xh.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??b4,o=O1.create({baseURL:n,headers:r,withCredentials:!0,timeout:i,maxBodyLength:g4,maxContentLength:v4});this._auto=new fz(o)}}const Bu={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Vn=(e,t)=>e.status===t,Br=(e,t)=>Bu[e.status]<Bu[t],ES=(e,t)=>Bu[e.status]>=Bu[t];class zr extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}const kS=["audio","file","image","video"],CS=e=>kS.includes(e);class x4 extends sp{constructor(n){super();k(this,"_client");k(this,"_webhookId");k(this,"_apiUrl");k(this,"_state",{status:"disconnected"});k(this,"mode","pushpin");k(this,"_initialConnect",async n=>{if(ES(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Vn(this._state,"user_creating"))return;this._state={status:"user_creating"};const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});k(this,"_reConnect",async(n,r)=>{if(ES(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Vn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},await this._client.updateUser({"x-user-key":n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});k(this,"_mapMessage",n=>{const{payload:r,disableInput:i}=ox(n.payload);return{id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:r,disableInput:i}});const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._apiUrl=r,this._client=new w4({apiUrl:r})}get apiUrl(){return this._apiUrl}get clientId(){return this._webhookId}get userId(){if(!Br(this._state,"user_created"))return this._state.userId}async getUser(){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:n}=await this._client.getUser({"x-user-key":this._state.userKey});return{data:n.data}}async updateUser(n){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:r}=await this._client.updateUser({"x-user-key":this._state.userKey,userData:n.data});return r}get conversationId(){if(!Br(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Vn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Vn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendFile(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state));const{size:i,name:o}=n,a=await(p=>new Promise((m,y)=>{const v=new FileReader;v.onload=g=>{var b;return m((b=g.target)==null?void 0:b.result)},v.onerror=g=>{var b;return y((b=g.target)==null?void 0:b.error)},v.readAsArrayBuffer(p)}))(n),{file:{uploadUrl:c,contentType:l,url:u}}=await this._client.createFile({"x-user-key":r.userKey,size:i,key:o,accessPolicies:["public_content"],index:!1});await fetch(c,{method:"PUT",body:a});const d=l.split("/").shift()??"",h=CS(d)?d:"file",f=h==="image"?{type:h,imageUrl:u}:h==="audio"?{type:h,audioUrl:u}:h==="video"?{type:h,videoUrl:u}:{type:h,fileUrl:u};return await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:f}),this.emit("messageSent",u),{fileUrl:u,name:o,type:h}}async sendMessage(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createEvent({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_created")&&this._state.conversationId===n||Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Br(this._state,"user_created"))return!1;try{return await this._client.getConversation({"x-user-key":this._state.userKey,id:n}),!0}catch(r){if(_h(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({"x-user-key":n}),!0}catch(r){const i=o=>o.code===404||o.code===401;if(_h(r)&&i(r))return!1;throw r}}async newConversation(){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){const{conversation:{id:r}}=await this._client.createConversation({"x-user-key":n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({"x-user-key":n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Vn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let o;do{const s=await this._client.listConversationMessages({id:n,"x-user-key":r,nextToken:o});i.push(...s.messages),o=s.meta.nextToken}while(o);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,"x-user-key":n.userKey});return i.on("unknown",o=>{typeof o=="string"&&o==="ping"||console.debug("unknown event",o)}),i.on("message_created",o=>{o.userId!==n.userId&&this.emit("message",this._mapMessage(o))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",o=>{this.emit("webchatVisibility",o.visibility)}),i.on("webchat_config",o=>{this.emit("webchatConfig",o.config)}),i.on("typing_started",o=>{this.emit("isTyping",{isTyping:!0,timeout:o.timeout??5e3})}),i.on("typing_stopped",()=>{this.emit("isTyping",{isTyping:!1,timeout:0})}),i.on("custom",o=>{this.emit("customEvent",o.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const TS=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>n==="messaging"?new m3({url:t,clientId:e}):new x4({apiUrl:t,clientId:e}),_4=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>{const[r]=w.useState(TS({clientId:e,apiUrl:t,mode:n}));return r};function S4(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>L6({title:n,type:"success"}))}const E4=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let k4={data:""},C4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||k4,T4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,A4=/\/\*[^]*?\*\/| +/g,AS=/\n+/g,$i=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?$i(s,o):o+"{"+$i(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=$i(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=$i.p?$i.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},si={},OS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+OS(e[n]);return t}return e},O4=(e,t,n,r,i)=>{let o=OS(e),s=si[o]||(si[o]=(c=>{let l=0,u=11;for(;l<c.length;)u=101*u+c.charCodeAt(l++)>>>0;return"go"+u})(o));if(!si[s]){let c=o!==e?e:(l=>{let u,d,h=[{}];for(;u=T4.exec(l.replace(A4,""));)u[4]?h.shift():u[3]?(d=u[3].replace(AS," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(AS," ").trim();return h[0]})(e);si[s]=$i(i?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&si.g?si.g:null;return n&&(si.g=si[s]),((c,l,u,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=u?c+l.data:l.data+c)})(si[s],t,r,a),s},I4=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":$i(a,""):a===!1?"":a}return r+i+(s??"")},"");function zu(e){let t=this||{},n=e.call?e(t.p):e;return O4(n.unshift?n.raw?I4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,C4(t.target),t.g,t.o,t.k)}let IS,Qh,em;zu.bind({g:1});let ai=zu.bind({k:1});function R4(e,t,n,r){$i.p=t,IS=e,Qh=n,em=r}function Di(e,t){let n=this||{};return function(){let r=arguments;function i(o,s){let a=Object.assign({},o),c=a.className||i.className;n.p=Object.assign({theme:Qh&&Qh()},a),n.o=/ *go\d+/.test(c),a.className=zu.apply(n,r)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),em&&l[0]&&em(a),IS(l,a)}return t?t(i):i}}var P4=e=>typeof e=="function",Zu=(e,t)=>P4(e)?e(t):e,$4=(()=>{let e=0;return()=>(++e).toString()})(),RS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),D4=20,Vu=new Map,N4=1e3,PS=e=>{if(Vu.has(e))return;let t=setTimeout(()=>{Vu.delete(e),vo({type:4,toastId:e})},N4);Vu.set(e,t)},j4=e=>{let t=Vu.get(e);t&&clearTimeout(t)},tm=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,D4)};case 1:return t.toast.id&&j4(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?tm(e,{type:1,toast:n}):tm(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?PS(r):e.toasts.forEach(o=>{PS(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Hu=[],Wu={toasts:[],pausedAt:void 0},vo=e=>{Wu=tm(Wu,e),Hu.forEach(t=>{t(Wu)})},M4={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},q4=(e={})=>{let[t,n]=w.useState(Wu);w.useEffect(()=>(Hu.push(n),()=>{let i=Hu.indexOf(n);i>-1&&Hu.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,s;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||M4[i.type],style:{...e.style,...(s=e[i.type])==null?void 0:s.style,...i.style}}});return{...t,toasts:r}},L4=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||$4()}),Fa=e=>(t,n)=>{let r=L4(t,e,n);return vo({type:2,toast:r}),r.id},Hn=(e,t)=>Fa("blank")(e,t);Hn.error=Fa("error"),Hn.success=Fa("success"),Hn.loading=Fa("loading"),Hn.custom=Fa("custom"),Hn.dismiss=e=>{vo({type:3,toastId:e})},Hn.remove=e=>vo({type:4,toastId:e}),Hn.promise=(e,t,n)=>{let r=Hn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Hn.success(Zu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Hn.error(Zu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var F4=(e,t)=>{vo({type:1,toast:{id:e,height:t}})},U4=()=>{vo({type:5,time:Date.now()})},B4=e=>{let{toasts:t,pausedAt:n}=q4(e);w.useEffect(()=>{if(n)return;let o=Date.now(),s=t.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(c<0){a.visible&&Hn.dismiss(a.id);return}return setTimeout(()=>Hn.dismiss(a.id),c)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=w.useCallback(()=>{n&&vo({type:6,time:Date.now()})},[n]),i=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:l}=s||{},u=t.filter(f=>(f.position||l)===(o.position||l)&&f.height),d=u.findIndex(f=>f.id===o.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:F4,startPause:U4,endPause:r,calculateOffset:i}}},z4=ai`
144
+ `,Yt+=pn):fn==="id"?z=pn:fn==="event"?J=pn:fn==="retry"?(Se=Fe(pn,Se),Ge=Se):fn==="heartbeatTimeout"&&(Be=Fe(pn,Be),Et!==0&&(i(Et),Et=r(function(){ir()},Be)))}if(rt===te){if(Yt!==""){pt=z,J===""&&(J="message");var Nn=new B(J,{data:Yt.slice(1),lastEventId:z});if(L.dispatchEvent(Nn),J==="open"?he(L,L.onopen,Nn):J==="message"?he(L,L.onmessage,Nn):J==="error"&&he(L,L.onerror,Nn),Nt===Q)return}Yt="",J=""}rt=zt==="\r".charCodeAt(0)?C:te}else rt===te&&(At=Pt,rt=fe),rt===fe?zt===":".charCodeAt(0)&&(Ye=Pt+1,rt=A):rt===A&&(rt=we)}}},Vt=function(It){if(Nt===W||Nt===Z){Nt=M,Et!==0&&(i(Et),Et=0),Et=r(function(){ir()},Ge),Ge=Re(Math.min(Se*16,Ge*2)),L.readyState=Z;var xt=new D("error",{error:It});L.dispatchEvent(xt),he(L,L.onerror,xt),It!=null&&console.error(It)}},_n=function(){Nt=Q,Ot!=null&&(Ot.abort(),Ot=void 0),Et!==0&&(i(Et),Et=0),L.readyState=Q},ir=function(){if(Et=0,Nt!==M){if(!K&&Ot!=null)Vt(new Error("No activity within "+Be+" milliseconds. "+(Nt===Z?"No response received.":ie+" chars received.")+" Reconnecting.")),Ot!=null&&(Ot.abort(),Ot=void 0);else{var It=Math.max((K||Date.now())+Be-Date.now(),1);K=!1,Et=r(function(){ir()},It)}return}K=!1,ie=0,Et=r(function(){ir()},Be),Nt=Z,Yt="",J="",z=pt,Xe="",At=0,Ye=0,rt=te;var xt=oe;if(oe.slice(0,5)!=="data:"&&oe.slice(0,5)!=="blob:"&&pt!==""){var Ht=oe.indexOf("?");xt=Ht===-1?oe:oe.slice(0,Ht+1)+oe.slice(Ht+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(pn,Nn){return Nn===Ne?"":pn}),xt+=(oe.indexOf("?")===-1?"?":"&")+Ne+"="+encodeURIComponent(pt)}var zt=L.withCredentials,Wt={};Wt.Accept="text/event-stream";var Pt=L.headers;if(Pt!=null)for(var fn in Pt)Object.prototype.hasOwnProperty.call(Pt,fn)&&(Wt[fn]=Pt[fn]);try{Ot=Mt.open(Je,cn,Un,Vt,xt,zt,Wt)}catch(pn){throw _n(),pn}};L.url=oe,L.readyState=Z,L.withCredentials=ue,L.headers=ae,L._close=_n,ir()}de.prototype=Object.create(O.prototype),de.prototype.CONNECTING=Z,de.prototype.OPEN=W,de.prototype.CLOSED=Q,de.prototype.close=function(){this._close()},de.CONNECTING=Z,de.OPEN=W,de.CLOSED=Q,de.prototype.withCredentials=void 0;var et=c;o!=null&&(c==null||!("withCredentials"in c.prototype))&&(et=de),function(L){{var oe=L(t);oe!==void 0&&(e.exports=oe)}}(function(L){L.EventSourcePolyfill=de,L.NativeEventSource=c,L.EventSource=et})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:tt:globalThis)})(Hh,Hh.exports);var pz=Hh.exports;const hz=mi(pz),mz=(e,t={})=>{const n=new hz.EventSourcePolyfill(e,{headers:t.headers}),r=new dS;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},yz=async(e,t={})=>{const{emitter:n,source:r}=mz(e,t);return await new Promise((i,o)=>{n.on("open",()=>{i()}),n.on("error",s=>{o(s)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}};var Tt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(const a of o)s[a]=i[a];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Tt||(Tt={}));var Wh;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Wh||(Wh={}));const Oe=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},ge=Tt.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"]),gz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Sr extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;c<s.path.length;){const l=s.path[c];c===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(n(s))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Sr.create=e=>new Sr(e);const Ta=(e,t)=>{let n;switch(e.code){case ge.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case ge.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Tt.jsonStringifyReplacer)}`;break;case ge.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ge.invalid_union:n="Invalid input";break;case ge.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ge.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.joinValues(e.options)}, received '${e.received}'`;break;case ge.invalid_arguments:n="Invalid function arguments";break;case ge.invalid_return_type:n="Invalid function return type";break;case ge.invalid_date:n="Invalid date";break;case ge.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Tt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case ge.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case ge.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case ge.custom:n="Invalid input";break;case ge.invalid_intersection_types:n="Intersection results could not be merged";break;case ge.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ge.not_finite:n="Number must be finite";break;default:n=t.defaultError,Tt.assertNever(e)}return{message:n}};let fS=Ta;function vz(e){fS=e}function Ru(){return fS}const Pu=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};let a="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)a=l(s,{data:t,defaultError:a}).message;return{...i,path:o,message:i.message||a}},bz=[];function Ie(e,t){const n=Pu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ru(),Ta].filter(r=>!!r)});e.common.issues.push(n)}class Rn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return st;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Rn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return st;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const st=Object.freeze({status:"aborted"}),pS=e=>({status:"dirty",value:e}),Fn=e=>({status:"valid",value:e}),Kh=e=>e.status==="aborted",Jh=e=>e.status==="dirty",Aa=e=>e.status==="valid",$u=e=>typeof Promise<"u"&&e instanceof Promise;var Ze;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ze||(Ze={}));class Fr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const hS=(e,t)=>{if(Aa(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 n=new Sr(e.common.issues);return this._error=n,this._error}}};function lt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,a)=>s.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class ft{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Oi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Rn,ctx:{common:t.parent.common,data:t.data,parsedType:Oi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($u(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},o=this._parseSync({data:t,path:i.path,parent:i});return hS(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Oi(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await($u(i)?i:Promise.resolve(i));return hS(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),a=()=>o.addIssue({code:ge.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Cr({schema:this,typeName:Qe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return oi.create(this,this._def)}nullable(){return go.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kr.create(this,this._def)}promise(){return ys.create(this,this._def)}or(t){return Pa.create([this,t],this._def)}and(t){return $a.create(this,t,this._def)}transform(t){return new Cr({...lt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new qa({...lt(this._def),innerType:this,defaultValue:n,typeName:Qe.ZodDefault})}brand(){return new yS({typeName:Qe.ZodBranded,type:this,...lt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Lu({...lt(this._def),innerType:this,catchValue:n,typeName:Qe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return La.create(this,t)}readonly(){return Uu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wz=/^c[^\s-]{8,}$/i,xz=/^[a-z][a-z0-9]*$/,_z=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sz=/^[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,Ez=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Yh;const Cz=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Tz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Az=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Oz(e,t){return!!((t==="v4"||!t)&&Cz.test(e)||(t==="v6"||!t)&&Tz.test(e))}class Er extends ft{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.string,received:o.parsedType}),st}const r=new Rn;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,a=t.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(t,i),s?Ie(i,{code:ge.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&Ie(i,{code:ge.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Ez.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"email",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Yh||(Yh=new RegExp(kz,"u")),Yh.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"emoji",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Sz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"uuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")wz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")xz.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"cuid2",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")_z.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ulid",code:ge.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ie(i,{validation:"url",code:ge.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"regex",code:ge.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Az(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Oz(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Ie(i,{validation:"ip",code:ge.invalid_string,message:o.message}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:ge.invalid_string,...Ze.errToObj(r)})}_addCheck(t){return new Er({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ze.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ze.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ze.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ze.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ze.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ze.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ze.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ze.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ze.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ze.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ze.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ze.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ze.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ze.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ze.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ze.errToObj(n)})}nonempty(t){return this.min(1,Ze.errToObj(t))}trim(){return new Er({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Er({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Er.create=e=>{var t;return new Er({checks:[],typeName:Qe.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};function Iz(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),s=parseInt(t.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}class Ii extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.number,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="int"?Tt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Iz(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_finite,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ii({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ii({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ze.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ze.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ze.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ze.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Tt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Ii.create=e=>new Ii({checks:[],typeName:Qe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class Ri extends ft{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.bigint,received:o.parsedType}),st}let r;const i=new Rn;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ie(r,{code:ge.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Tt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ze.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ze.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ze.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ze.toString(n))}setLimit(t,n,r,i){return new Ri({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ze.toString(i)}]})}_addCheck(t){return new Ri({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ze.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ze.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ze.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ri.create=e=>{var t;return new Ri({checks:[],typeName:Qe.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...lt(e)})};class Oa extends ft{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.boolean,received:r.parsedType}),st}return Fn(t.data)}}Oa.create=e=>new Oa({typeName:Qe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...lt(e)});class ho extends ft{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_type,expected:Oe.date,received:o.parsedType}),st}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Ie(o,{code:ge.invalid_date}),st}const r=new Rn;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Ie(i,{code:ge.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Tt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new ho({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ze.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ze.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}ho.create=e=>new ho({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Qe.ZodDate,...lt(e)});class Du extends ft{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.symbol,received:r.parsedType}),st}return Fn(t.data)}}Du.create=e=>new Du({typeName:Qe.ZodSymbol,...lt(e)});class Ia extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.undefined,received:r.parsedType}),st}return Fn(t.data)}}Ia.create=e=>new Ia({typeName:Qe.ZodUndefined,...lt(e)});class Ra extends ft{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.null,received:r.parsedType}),st}return Fn(t.data)}}Ra.create=e=>new Ra({typeName:Qe.ZodNull,...lt(e)});class ps extends ft{constructor(){super(...arguments),this._any=!0}_parse(t){return Fn(t.data)}}ps.create=e=>new ps({typeName:Qe.ZodAny,...lt(e)});class mo extends ft{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Fn(t.data)}}mo.create=e=>new mo({typeName:Qe.ZodUnknown,...lt(e)});class ii extends ft{_parse(t){const n=this._getOrReturnCtx(t);return Ie(n,{code:ge.invalid_type,expected:Oe.never,received:n.parsedType}),st}}ii.create=e=>new ii({typeName:Qe.ZodNever,...lt(e)});class Nu extends ft{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.void,received:r.parsedType}),st}return Fn(t.data)}}Nu.create=e=>new Nu({typeName:Qe.ZodVoid,...lt(e)});class kr extends ft{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ie(n,{code:ge.invalid_type,expected:Oe.array,received:n.parsedType}),st;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(Ie(n,{code:s?ge.too_big:ge.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ie(n,{code:ge.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ie(n,{code:ge.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Fr(n,s,n.path,a)))).then(s=>Rn.mergeArray(r,s));const o=[...n.data].map((s,a)=>i.type._parseSync(new Fr(n,s,n.path,a)));return Rn.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new kr({...this._def,minLength:{value:t,message:Ze.toString(n)}})}max(t,n){return new kr({...this._def,maxLength:{value:t,message:Ze.toString(n)}})}length(t,n){return new kr({...this._def,exactLength:{value:t,message:Ze.toString(n)}})}nonempty(t){return this.min(1,t)}}kr.create=(e,t)=>new kr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...lt(t)});function hs(e){if(e instanceof Bt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(hs(r))}return new Bt({...e._def,shape:()=>t})}else return e instanceof kr?new kr({...e._def,type:hs(e.element)}):e instanceof oi?oi.create(hs(e.unwrap())):e instanceof go?go.create(hs(e.unwrap())):e instanceof Ur?Ur.create(e.items.map(t=>hs(t))):e}class Bt extends ft{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Tt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const l=this._getOrReturnCtx(t);return Ie(l,{code:ge.invalid_type,expected:Oe.object,received:l.parsedType}),st}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof ii&&this._def.unknownKeys==="strip"))for(const l in i.data)s.includes(l)||a.push(l);const c=[];for(const l of s){const u=o[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Fr(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof ii){const l=this._def.unknownKeys;if(l==="passthrough")for(const u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(Ie(i,{code:ge.unrecognized_keys,keys:a}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const u of a){const d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Fr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const l=[];for(const u of c){const d=await u.key;l.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return l}).then(l=>Rn.mergeObjectSync(r,l)):Rn.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return Ze.errToObj,new Bt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,s,a;const c=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&s!==void 0?s:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ze.errToObj(t).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Bt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Bt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Qe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Bt({...this._def,catchall:t})}pick(t){const n={};return Tt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}omit(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Bt({...this._def,shape:()=>n})}deepPartial(){return hs(this)}partial(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Bt({...this._def,shape:()=>n})}required(t){const n={};return Tt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof oi;)o=o._def.innerType;n[r]=o}}),new Bt({...this._def,shape:()=>n})}keyof(){return mS(Tt.objectKeys(this.shape))}}Bt.create=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.strictCreate=(e,t)=>new Bt({shape:()=>e,unknownKeys:"strict",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)}),Bt.lazycreate=(e,t)=>new Bt({shape:e,unknownKeys:"strip",catchall:ii.create(),typeName:Qe.ZodObject,...lt(t)});class Pa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(a=>new Sr(a.ctx.common.issues));return Ie(n,{code:ge.invalid_union,unionErrors:s}),st}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const c of r){const l={...n,common:{...n.common,issues:[]},parent:null},u=c._parseSync({data:n.data,path:n.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(c=>new Sr(c));return Ie(n,{code:ge.invalid_union,unionErrors:a}),st}}get options(){return this._def.options}}Pa.create=(e,t)=>new Pa({options:e,typeName:Qe.ZodUnion,...lt(t)});const ju=e=>e instanceof Na?ju(e.schema):e instanceof Cr?ju(e.innerType()):e instanceof ja?[e.value]:e instanceof Pi?e.options:e instanceof Ma?Object.keys(e.enum):e instanceof qa?ju(e._def.innerType):e instanceof Ia?[void 0]:e instanceof Ra?[null]:null;class Mu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ie(n,{code:ge.invalid_type,expected:Oe.object,received:n.parsedType}),st;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Ie(n,{code:ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),st)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=ju(o.shape[t]);if(!s)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of s){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,o)}}return new Mu({typeName:Qe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...lt(r)})}}function Gh(e,t){const n=Oi(e),r=Oi(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=Tt.objectKeys(t),o=Tt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),s={...e,...t};for(const a of o){const c=Gh(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],a=t[o],c=Gh(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class $a extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(Kh(o)||Kh(s))return st;const a=Gh(o.value,s.value);return a.valid?((Jh(o)||Jh(s))&&n.dirty(),{status:n.value,value:a.data}):(Ie(r,{code:ge.invalid_intersection_types}),st)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}$a.create=(e,t,n)=>new $a({left:e,right:t,typeName:Qe.ZodIntersection,...lt(n)});class Ur extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ie(r,{code:ge.invalid_type,expected:Oe.array,received:r.parsedType}),st;if(r.data.length<this._def.items.length)return Ie(r,{code:ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),st;!this._def.rest&&r.data.length>this._def.items.length&&(Ie(r,{code:ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,a)=>{const c=this._def.items[a]||this._def.rest;return c?c._parse(new Fr(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>Rn.mergeArray(n,s)):Rn.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ur({...this._def,rest:t})}}Ur.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ur({items:e,typeName:Qe.ZodTuple,rest:null,...lt(t)})};class Da extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ie(r,{code:ge.invalid_type,expected:Oe.object,received:r.parsedType}),st;const i=[],o=this._def.keyType,s=this._def.valueType;for(const a in r.data)i.push({key:o._parse(new Fr(r,a,r.path,a)),value:s._parse(new Fr(r,r.data[a],r.path,a))});return r.common.async?Rn.mergeObjectAsync(n,i):Rn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ft?new Da({keyType:t,valueType:n,typeName:Qe.ZodRecord,...lt(r)}):new Da({keyType:Er.create(),valueType:t,typeName:Qe.ZodRecord,...lt(n)})}}class qu extends ft{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ie(r,{code:ge.invalid_type,expected:Oe.map,received:r.parsedType}),st;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,c],l)=>({key:i._parse(new Fr(r,a,r.path,[l,"key"])),value:o._parse(new Fr(r,c,r.path,[l,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const c of s){const l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const c of s){const l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return st;(l.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(l.value,u.value)}return{status:n.value,value:a}}}}qu.create=(e,t,n)=>new qu({valueType:t,keyType:e,typeName:Qe.ZodMap,...lt(n)});class yo extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ie(r,{code:ge.invalid_type,expected:Oe.set,received:r.parsedType}),st;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ie(r,{code:ge.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ie(r,{code:ge.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(c){const l=new Set;for(const u of c){if(u.status==="aborted")return st;u.status==="dirty"&&n.dirty(),l.add(u.value)}return{status:n.value,value:l}}const a=[...r.data.values()].map((c,l)=>o._parse(new Fr(r,c,r.path,l)));return r.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,n){return new yo({...this._def,minSize:{value:t,message:Ze.toString(n)}})}max(t,n){return new yo({...this._def,maxSize:{value:t,message:Ze.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}yo.create=(e,t)=>new yo({valueType:e,minSize:null,maxSize:null,typeName:Qe.ZodSet,...lt(t)});class ms extends ft{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ie(n,{code:ge.invalid_type,expected:Oe.function,received:n.parsedType}),st;function r(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_arguments,argumentsError:c}})}function i(a,c){return Pu({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ru(),Ta].filter(l=>!!l),issueData:{code:ge.invalid_return_type,returnTypeError:c}})}const o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ys){const a=this;return Fn(async function(...c){const l=new Sr([]),u=await a._def.args.parseAsync(c,o).catch(f=>{throw l.addIssue(r(c,f)),l}),d=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(d,o).catch(f=>{throw l.addIssue(i(d,f)),l})})}else{const a=this;return Fn(function(...c){const l=a._def.args.safeParse(c,o);if(!l.success)throw new Sr([r(c,l.error)]);const u=Reflect.apply(s,this,l.data),d=a._def.returns.safeParse(u,o);if(!d.success)throw new Sr([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ms({...this._def,args:Ur.create(t).rest(mo.create())})}returns(t){return new ms({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ms({args:t||Ur.create([]).rest(mo.create()),returns:n||mo.create(),typeName:Qe.ZodFunction,...lt(r)})}}class Na extends ft{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Na.create=(e,t)=>new Na({getter:e,typeName:Qe.ZodLazy,...lt(t)});class ja extends ft{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ie(n,{received:n.data,code:ge.invalid_literal,expected:this._def.value}),st}return{status:"valid",value:t.data}}get value(){return this._def.value}}ja.create=(e,t)=>new ja({value:e,typeName:Qe.ZodLiteral,...lt(t)});function mS(e,t){return new Pi({values:e,typeName:Qe.ZodEnum,...lt(t)})}class Pi extends ft{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ge.invalid_type}),st}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ie(n,{received:n.data,code:ge.invalid_enum_value,options:r}),st}return Fn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Pi.create(t)}exclude(t){return Pi.create(this.options.filter(n=>!t.includes(n)))}}Pi.create=mS;class Ma extends ft{_parse(t){const n=Tt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=Tt.objectValues(n);return Ie(r,{expected:Tt.joinValues(i),received:r.parsedType,code:ge.invalid_type}),st}if(n.indexOf(t.data)===-1){const i=Tt.objectValues(n);return Ie(r,{received:r.data,code:ge.invalid_enum_value,options:i}),st}return Fn(t.data)}get enum(){return this._def.values}}Ma.create=(e,t)=>new Ma({values:e,typeName:Qe.ZodNativeEnum,...lt(t)});class ys extends ft{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ie(n,{code:ge.invalid_type,expected:Oe.promise,received:n.parsedType}),st;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return Fn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ys.create=(e,t)=>new ys({type:e,typeName:Qe.ZodPromise,...lt(t)});class Cr extends ft{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{Ie(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(s).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}if(i.type==="refinement"){const s=a=>{const c=i.refinement(a,o);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?st:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Aa(s))return s;const a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>Aa(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):s);Tt.assertNever(i)}}Cr.create=(e,t,n)=>new Cr({schema:e,typeName:Qe.ZodEffects,effect:t,...lt(n)}),Cr.createWithPreprocess=(e,t,n)=>new Cr({schema:t,effect:{type:"preprocess",transform:e},typeName:Qe.ZodEffects,...lt(n)});class oi extends ft{_parse(t){return this._getType(t)===Oe.undefined?Fn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:Qe.ZodOptional,...lt(t)});class go extends ft{_parse(t){return this._getType(t)===Oe.null?Fn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}go.create=(e,t)=>new go({innerType:e,typeName:Qe.ZodNullable,...lt(t)});class qa extends ft{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}qa.create=(e,t)=>new qa({innerType:e,typeName:Qe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...lt(t)});class Lu extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $u(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Lu.create=(e,t)=>new Lu({innerType:e,typeName:Qe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...lt(t)});class Fu extends ft{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ie(r,{code:ge.invalid_type,expected:Oe.nan,received:r.parsedType}),st}return{status:"valid",value:t.data}}}Fu.create=e=>new Fu({typeName:Qe.ZodNaN,...lt(e)});const Rz=Symbol("zod_brand");class yS extends ft{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class La extends ft{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?st:o.status==="dirty"?(n.dirty(),pS(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?st:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new La({in:t,out:n,typeName:Qe.ZodPipeline})}}class Uu extends ft{_parse(t){const n=this._def.innerType._parse(t);return Aa(n)&&(n.value=Object.freeze(n.value)),n}}Uu.create=(e,t)=>new Uu({innerType:e,typeName:Qe.ZodReadonly,...lt(t)});const gS=(e,t={},n)=>e?ps.create().superRefine((r,i)=>{var o,s;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,c=(s=(o=a.fatal)!==null&&o!==void 0?o:n)!==null&&s!==void 0?s:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):ps.create(),Pz={object:Bt.lazycreate};var Qe;(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"})(Qe||(Qe={}));const $z=(e,t={message:`Input not instance of ${e.name}`})=>gS(n=>n instanceof e,t),vS=Er.create,bS=Ii.create,Dz=Fu.create,Nz=Ri.create,wS=Oa.create,jz=ho.create,Mz=Du.create,qz=Ia.create,Lz=Ra.create,Fz=ps.create,Uz=mo.create,Bz=ii.create,zz=Nu.create,Zz=kr.create,Vz=Bt.create,Hz=Bt.strictCreate,Wz=Pa.create,Kz=Mu.create,Jz=$a.create,Yz=Ur.create,Gz=Da.create,Xz=qu.create,Qz=yo.create,e4=ms.create,t4=Na.create,n4=ja.create,r4=Pi.create,i4=Ma.create,o4=ys.create,xS=Cr.create,s4=oi.create,a4=go.create,c4=Cr.createWithPreprocess,l4=La.create;var V=Object.freeze({__proto__:null,defaultErrorMap:Ta,setErrorMap:vz,getErrorMap:Ru,makeIssue:Pu,EMPTY_PATH:bz,addIssueToContext:Ie,ParseStatus:Rn,INVALID:st,DIRTY:pS,OK:Fn,isAborted:Kh,isDirty:Jh,isValid:Aa,isAsync:$u,get util(){return Tt},get objectUtil(){return Wh},ZodParsedType:Oe,getParsedType:Oi,ZodType:ft,ZodString:Er,ZodNumber:Ii,ZodBigInt:Ri,ZodBoolean:Oa,ZodDate:ho,ZodSymbol:Du,ZodUndefined:Ia,ZodNull:Ra,ZodAny:ps,ZodUnknown:mo,ZodNever:ii,ZodVoid:Nu,ZodArray:kr,ZodObject:Bt,ZodUnion:Pa,ZodDiscriminatedUnion:Mu,ZodIntersection:$a,ZodTuple:Ur,ZodRecord:Da,ZodMap:qu,ZodSet:yo,ZodFunction:ms,ZodLazy:Na,ZodLiteral:ja,ZodEnum:Pi,ZodNativeEnum:Ma,ZodPromise:ys,ZodEffects:Cr,ZodTransformer:Cr,ZodOptional:oi,ZodNullable:go,ZodDefault:qa,ZodCatch:Lu,ZodNaN:Fu,BRAND:Rz,ZodBranded:yS,ZodPipeline:La,ZodReadonly:Uu,custom:gS,Schema:ft,ZodSchema:ft,late:Pz,get ZodFirstPartyTypeKind(){return Qe},coerce:{string:e=>Er.create({...e,coerce:!0}),number:e=>Ii.create({...e,coerce:!0}),boolean:e=>Oa.create({...e,coerce:!0}),bigint:e=>Ri.create({...e,coerce:!0}),date:e=>ho.create({...e,coerce:!0})},any:Fz,array:Zz,bigint:Nz,boolean:wS,date:jz,discriminatedUnion:Kz,effect:xS,enum:r4,function:e4,instanceof:$z,intersection:Jz,lazy:t4,literal:n4,map:Xz,nan:Dz,nativeEnum:i4,never:Bz,null:Lz,nullable:a4,number:bS,object:Vz,oboolean:()=>wS().optional(),onumber:()=>bS().optional(),optional:s4,ostring:()=>vS().optional(),pipeline:l4,preprocess:c4,promise:o4,record:Gz,set:Qz,strictObject:Hz,string:vS,symbol:Mz,transformer:xS,tuple:Yz,undefined:qz,union:Wz,unknown:Uz,void:zz,NEVER:st,ZodIssueCode:ge,quotelessJson:gz,ZodError:Sr});const u4=V.object({type:V.literal("message_created"),data:V.object({id:V.string().describe("Id of the [Message](#schema_message)"),createdAt:V.string().datetime().describe("Creation date of the [Message](#schema_message) in ISO 8601 format"),payload:V.union([V.object({audioUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("audio")}),V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),type:V.literal("card"),className:V.string().describe("CSS className to apply to the message").optional()}),V.object({items:V.array(V.object({title:V.string().min(1),subtitle:V.string().optional(),imageUrl:V.string().optional(),actions:V.array(V.object({action:V.enum(["postback","url","say"]),label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional()})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("carousel")}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("choice"),disableFreeText:V.boolean().optional()}),V.object({text:V.string(),options:V.array(V.object({label:V.string().min(1),value:V.string().min(1)})),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("dropdown")}),V.object({fileUrl:V.string().min(1),title:V.string().min(1).optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("file")}),V.object({imageUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("image")}),V.object({latitude:V.number(),longitude:V.number(),address:V.string().optional(),title:V.string().optional(),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("location")}),V.object({markdown:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("markdown")}),V.object({text:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("text")}),V.object({videoUrl:V.string().min(1),className:V.string().describe("CSS className to apply to the message").optional(),type:V.literal("video")})]).describe("Payload is the content type of the message."),userId:V.string().describe("ID of the [User](#schema_user)"),conversationId:V.string().describe("ID of the [Conversation](#schema_conversation)")}).describe("The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).")}),d4=V.object({type:V.literal("webchat_visibility"),data:V.object({visibility:V.union([V.literal("show"),V.literal("hide"),V.literal("toggle")])})}),f4=V.object({type:V.literal("webchat_config"),data:V.object({config:V.record(V.union([V.any(),V.null()]))})}),p4=V.object({type:V.literal("custom"),data:V.object({event:V.record(V.union([V.any(),V.null()]))})}),h4=V.object({type:V.literal("typing_started"),data:V.object({timeout:V.number().optional()})}),m4=V.object({type:V.literal("typing_stopped"),data:V.record(V.never())}),y4={messageCreated:u4,webchatVisibility:d4,webchatConfig:f4,custom:p4,typingStarted:h4,typingStopped:m4},_S="unknown error",qd=class qd extends dS{constructor(n){super();k(this,"_state",{status:"disconnected"});k(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});k(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});k(this,"_connect",async()=>{const n=await yz(`${this._props.url}/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});k(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});k(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});k(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});k(this,"_parseSignal",n=>{for(const r of Object.values(y4)){const i=this._safeJsonParse(n),o=r.safeParse(i);if(o.success)return o.data}return{type:"unknown",data:n}});k(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});k(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(_S);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(_S)}});this._props=n}get status(){return this._state.status}};k(qd,"listen",async n=>{const r=new qd(n);return await r.connect(),r});let Xh=qd;const SS=100*1024*1024,g4=SS,v4=SS,b4=6e4;class w4{constructor(t){k(this,"_auto");k(this,"createConversation",t=>this._auto.createConversation(t));k(this,"getConversation",t=>this._auto.getConversation(t));k(this,"deleteConversation",t=>this._auto.deleteConversation(t));k(this,"listConversations",t=>this._auto.listConversations(t));k(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));k(this,"addParticipant",t=>this._auto.addParticipant(t));k(this,"removeParticipant",t=>this._auto.removeParticipant(t));k(this,"getParticipant",t=>this._auto.getParticipant(t));k(this,"listParticipants",t=>this._auto.listParticipants(t));k(this,"createMessage",t=>this._auto.createMessage(t));k(this,"getMessage",t=>this._auto.getMessage(t));k(this,"deleteMessage",t=>this._auto.deleteMessage(t));k(this,"createFile",t=>this._auto.createFile(t));k(this,"createUser",t=>this._auto.createUser(t));k(this,"getUser",t=>this._auto.getUser(t));k(this,"updateUser",t=>this._auto.updateUser(t));k(this,"deleteUser",t=>this._auto.deleteUser(t));k(this,"createEvent",t=>this._auto.createEvent(t));k(this,"getEvent",t=>this._auto.getEvent(t));k(this,"listenConversation",async({id:t,"x-user-key":n})=>await Xh.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??b4,o=O1.create({baseURL:n,headers:r,withCredentials:!0,timeout:i,maxBodyLength:g4,maxContentLength:v4});this._auto=new fz(o)}}const Bu={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Vn=(e,t)=>e.status===t,Br=(e,t)=>Bu[e.status]<Bu[t],ES=(e,t)=>Bu[e.status]>=Bu[t];class zr extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}const kS=["audio","file","image","video"],CS=e=>kS.includes(e);class x4 extends sp{constructor(n){super();k(this,"_client");k(this,"_webhookId");k(this,"_apiUrl");k(this,"_state",{status:"disconnected"});k(this,"mode","pushpin");k(this,"_initialConnect",async n=>{if(ES(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Vn(this._state,"user_creating"))return;this._state={status:"user_creating"};const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});k(this,"_reConnect",async(n,r)=>{if(ES(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Vn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},await this._client.updateUser({"x-user-key":n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});k(this,"_mapMessage",n=>{const{payload:r,disableInput:i}=ox(n.payload);return{id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:r,disableInput:i}});const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._apiUrl=r,this._client=new w4({apiUrl:r})}get apiUrl(){return this._apiUrl}get clientId(){return this._webhookId}get userId(){if(!Br(this._state,"user_created"))return this._state.userId}async getUser(){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:n}=await this._client.getUser({"x-user-key":this._state.userKey});return{data:n.data}}async updateUser(n){if(Br(this._state,"user_created"))throw new zr(this._state);const{user:r}=await this._client.updateUser({"x-user-key":this._state.userKey,name:n.name,pictureUrl:n.pictureUrl,userData:n.data});return r}get conversationId(){if(!Br(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Vn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Vn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendFile(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state));const{size:i,name:o}=n,a=await(p=>new Promise((m,y)=>{const v=new FileReader;v.onload=g=>{var b;return m((b=g.target)==null?void 0:b.result)},v.onerror=g=>{var b;return y((b=g.target)==null?void 0:b.error)},v.readAsArrayBuffer(p)}))(n),{file:{uploadUrl:c,contentType:l,url:u}}=await this._client.createFile({"x-user-key":r.userKey,size:i,key:o,accessPolicies:["public_content"],index:!1});await fetch(c,{method:"PUT",body:a});const d=l.split("/").shift()??"",h=CS(d)?d:"file",f=h==="image"?{type:h,imageUrl:u}:h==="audio"?{type:h,audioUrl:u}:h==="video"?{type:h,videoUrl:u}:{type:h,fileUrl:u};return await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:f}),this.emit("messageSent",u),{fileUrl:u,name:o,type:h}}async sendMessage(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createMessage({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Br(this._state,"user_created"))throw new zr(this._state);if(Vn(this._state,"conversation_creating"))throw new zr(this._state);let r;Vn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),await this._client.createEvent({"x-user-key":r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_created")&&this._state.conversationId===n||Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Br(this._state,"user_created"))return!1;try{return await this._client.getConversation({"x-user-key":this._state.userKey,id:n}),!0}catch(r){if(_h(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({"x-user-key":n}),!0}catch(r){const i=o=>o.code===404||o.code===401;if(_h(r)&&i(r))return!1;throw r}}async newConversation(){if(Br(this._state,"user_created"))throw new zr(this._state);Vn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){const{conversation:{id:r}}=await this._client.createConversation({"x-user-key":n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({"x-user-key":n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Vn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let o;do{const s=await this._client.listConversationMessages({id:n,"x-user-key":r,nextToken:o});i.push(...s.messages),o=s.meta.nextToken}while(o);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,"x-user-key":n.userKey});return i.on("unknown",o=>{typeof o=="string"&&o==="ping"||console.debug("unknown event",o)}),i.on("message_created",o=>{o.userId!==n.userId&&this.emit("message",this._mapMessage(o))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",o=>{this.emit("webchatVisibility",o.visibility)}),i.on("webchat_config",o=>{this.emit("webchatConfig",o.config)}),i.on("typing_started",o=>{this.emit("isTyping",{isTyping:!0,timeout:o.timeout??5e3})}),i.on("typing_stopped",()=>{this.emit("isTyping",{isTyping:!1,timeout:0})}),i.on("custom",o=>{this.emit("customEvent",o.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const TS=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>n==="messaging"?new m3({url:t,clientId:e}):new x4({apiUrl:t,clientId:e}),_4=({clientId:e,apiUrl:t="https://webchat.botpress.cloud",mode:n="pushpin"})=>{const[r]=w.useState(TS({clientId:e,apiUrl:t,mode:n}));return r};function S4(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>L6({title:n,type:"success"}))}const E4=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let k4={data:""},C4=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||k4,T4=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,A4=/\/\*[^]*?\*\/| +/g,AS=/\n+/g,$i=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?$i(s,o):o+"{"+$i(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=$i(s,t?t.replace(/([^,])+/g,a=>o.replace(/(^:.*)|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=$i.p?$i.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},si={},OS=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+OS(e[n]);return t}return e},O4=(e,t,n,r,i)=>{let o=OS(e),s=si[o]||(si[o]=(c=>{let l=0,u=11;for(;l<c.length;)u=101*u+c.charCodeAt(l++)>>>0;return"go"+u})(o));if(!si[s]){let c=o!==e?e:(l=>{let u,d,h=[{}];for(;u=T4.exec(l.replace(A4,""));)u[4]?h.shift():u[3]?(d=u[3].replace(AS," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(AS," ").trim();return h[0]})(e);si[s]=$i(i?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&si.g?si.g:null;return n&&(si.g=si[s]),((c,l,u,d)=>{d?l.data=l.data.replace(d,c):l.data.indexOf(c)===-1&&(l.data=u?c+l.data:l.data+c)})(si[s],t,r,a),s},I4=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":$i(a,""):a===!1?"":a}return r+i+(s??"")},"");function zu(e){let t=this||{},n=e.call?e(t.p):e;return O4(n.unshift?n.raw?I4(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,C4(t.target),t.g,t.o,t.k)}let IS,Qh,em;zu.bind({g:1});let ai=zu.bind({k:1});function R4(e,t,n,r){$i.p=t,IS=e,Qh=n,em=r}function Di(e,t){let n=this||{};return function(){let r=arguments;function i(o,s){let a=Object.assign({},o),c=a.className||i.className;n.p=Object.assign({theme:Qh&&Qh()},a),n.o=/ *go\d+/.test(c),a.className=zu.apply(n,r)+(c?" "+c:""),t&&(a.ref=s);let l=e;return e[0]&&(l=a.as||e,delete a.as),em&&l[0]&&em(a),IS(l,a)}return t?t(i):i}}var P4=e=>typeof e=="function",Zu=(e,t)=>P4(e)?e(t):e,$4=(()=>{let e=0;return()=>(++e).toString()})(),RS=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),D4=20,Vu=new Map,N4=1e3,PS=e=>{if(Vu.has(e))return;let t=setTimeout(()=>{Vu.delete(e),vo({type:4,toastId:e})},N4);Vu.set(e,t)},j4=e=>{let t=Vu.get(e);t&&clearTimeout(t)},tm=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,D4)};case 1:return t.toast.id&&j4(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?tm(e,{type:1,toast:n}):tm(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?PS(r):e.toasts.forEach(o=>{PS(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Hu=[],Wu={toasts:[],pausedAt:void 0},vo=e=>{Wu=tm(Wu,e),Hu.forEach(t=>{t(Wu)})},M4={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},q4=(e={})=>{let[t,n]=w.useState(Wu);w.useEffect(()=>(Hu.push(n),()=>{let i=Hu.indexOf(n);i>-1&&Hu.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,s;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||M4[i.type],style:{...e.style,...(s=e[i.type])==null?void 0:s.style,...i.style}}});return{...t,toasts:r}},L4=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||$4()}),Fa=e=>(t,n)=>{let r=L4(t,e,n);return vo({type:2,toast:r}),r.id},Hn=(e,t)=>Fa("blank")(e,t);Hn.error=Fa("error"),Hn.success=Fa("success"),Hn.loading=Fa("loading"),Hn.custom=Fa("custom"),Hn.dismiss=e=>{vo({type:3,toastId:e})},Hn.remove=e=>vo({type:4,toastId:e}),Hn.promise=(e,t,n)=>{let r=Hn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Hn.success(Zu(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Hn.error(Zu(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var F4=(e,t)=>{vo({type:1,toast:{id:e,height:t}})},U4=()=>{vo({type:5,time:Date.now()})},B4=e=>{let{toasts:t,pausedAt:n}=q4(e);w.useEffect(()=>{if(n)return;let o=Date.now(),s=t.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(c<0){a.visible&&Hn.dismiss(a.id);return}return setTimeout(()=>Hn.dismiss(a.id),c)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=w.useCallback(()=>{n&&vo({type:6,time:Date.now()})},[n]),i=w.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:l}=s||{},u=t.filter(f=>(f.position||l)===(o.position||l)&&f.height),d=u.findIndex(f=>f.id===o.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:F4,startPause:U4,endPause:r,calculateOffset:i}}},z4=ai`
145
145
  from {
146
146
  transform: scale(0) rotate(45deg);
147
147
  opacity: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botpress/webchat",
3
- "version": "2.1.12",
3
+ "version": "2.1.13",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.umd.cjs",