@farcaster/frame-sdk 0.0.22 → 0.0.24

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,2 +1,2 @@
1
- import { type Endpoint } from "comlink";
1
+ import { type Endpoint } from 'comlink';
2
2
  export declare const endpoint: Endpoint;
package/dist/endpoint.js CHANGED
@@ -1,4 +1,4 @@
1
- import { windowEndpoint } from "comlink";
1
+ import { windowEndpoint } from 'comlink';
2
2
  const mockEndpoint = {
3
3
  postMessage() {
4
4
  // noop
@@ -12,19 +12,19 @@ const mockEndpoint = {
12
12
  };
13
13
  const webViewEndpoint = {
14
14
  postMessage: (data) => {
15
- console.debug("[webview:req]", data);
15
+ console.debug('[webview:req]', data);
16
16
  window.ReactNativeWebView.postMessage(JSON.stringify(data));
17
17
  },
18
18
  addEventListener: (_, listener, ...args) => {
19
- document.addEventListener("FarcasterFrameCallback", listener, ...args);
19
+ document.addEventListener('FarcasterFrameCallback', listener, ...args);
20
20
  },
21
21
  removeEventListener: (_, listener) => {
22
- document.removeEventListener("FarcasterFrameCallback", listener);
22
+ document.removeEventListener('FarcasterFrameCallback', listener);
23
23
  },
24
24
  };
25
25
  export const endpoint = (() => {
26
26
  // No actions are actually gonna take place during SSR, thus it's safe to return mocked endpoint
27
- if (typeof window === "undefined")
27
+ if (typeof window === 'undefined')
28
28
  return mockEndpoint;
29
29
  return window?.ReactNativeWebView
30
30
  ? webViewEndpoint
@@ -1,2 +1,2 @@
1
- import { WireFrameHost } from "@farcaster/frame-core";
1
+ import type { WireFrameHost } from '@farcaster/frame-core';
2
2
  export declare const frameHost: import("comlink").Remote<WireFrameHost>;
package/dist/frameHost.js CHANGED
@@ -1,3 +1,3 @@
1
- import { wrap } from "comlink";
2
- import { endpoint } from "./endpoint";
1
+ import { wrap } from 'comlink';
2
+ import { endpoint } from './endpoint';
3
3
  export const frameHost = wrap(endpoint);
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { sdk } from "./sdk";
2
- export * from "./sdk";
3
- export * from "@farcaster/frame-core";
1
+ import { sdk } from './sdk';
2
+ export * from './sdk';
3
+ export * from '@farcaster/frame-core';
4
4
  export default sdk;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { sdk } from "./sdk";
2
- export * from "./sdk";
3
- export * from "@farcaster/frame-core";
1
+ import { sdk } from './sdk';
2
+ export * from './sdk';
3
+ export * from '@farcaster/frame-core';
4
4
  export default sdk;
package/dist/index.min.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var frame=(()=>{var vr=Object.create;var qe=Object.defineProperty;var gr=Object.getOwnPropertyDescriptor;var yr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,_r=Object.prototype.hasOwnProperty;var xr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ie=(t,e)=>{for(var r in e)qe(t,r,{get:e[r],enumerable:!0})},Rt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of yr(e))!_r.call(t,s)&&s!==r&&qe(t,s,{get:()=>e[s],enumerable:!(n=gr(e,s))||n.enumerable});return t};var wr=(t,e,r)=>(r=t!=null?vr(br(t)):{},Rt(e||!t||!t.__esModule?qe(r,"default",{value:t,enumerable:!0}):r,t)),kr=t=>Rt(qe({},"__esModule",{value:!0}),t);var Ct=xr((fs,ht)=>{"use strict";var Er=Object.prototype.hasOwnProperty,j="~";function Ze(){}Object.create&&(Ze.prototype=Object.create(null),new Ze().__proto__||(j=!1));function Tr(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Pt(t,e,r,n,s){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new Tr(r,n||t,s),i=j?j+e:e;return t._events[i]?t._events[i].fn?t._events[i]=[t._events[i],a]:t._events[i].push(a):(t._events[i]=a,t._eventsCount++),t}function He(t,e){--t._eventsCount===0?t._events=new Ze:delete t._events[e]}function k(){this._events=new Ze,this._eventsCount=0}k.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)Er.call(r,n)&&e.push(j?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};k.prototype.listeners=function(e){var r=j?j+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,a=n.length,i=new Array(a);s<a;s++)i[s]=n[s].fn;return i};k.prototype.listenerCount=function(e){var r=j?j+e:e,n=this._events[r];return n?n.fn?1:n.length:0};k.prototype.emit=function(e,r,n,s,a,i){var o=j?j+e:e;if(!this._events[o])return!1;var c=this._events[o],u=arguments.length,f,y;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,s),!0;case 5:return c.fn.call(c.context,r,n,s,a),!0;case 6:return c.fn.call(c.context,r,n,s,a,i),!0}for(y=1,f=new Array(u-1);y<u;y++)f[y-1]=arguments[y];c.fn.apply(c.context,f)}else{var w=c.length,O;for(y=0;y<w;y++)switch(c[y].once&&this.removeListener(e,c[y].fn,void 0,!0),u){case 1:c[y].fn.call(c[y].context);break;case 2:c[y].fn.call(c[y].context,r);break;case 3:c[y].fn.call(c[y].context,r,n);break;case 4:c[y].fn.call(c[y].context,r,n,s);break;default:if(!f)for(O=1,f=new Array(u-1);O<u;O++)f[O-1]=arguments[O];c[y].fn.apply(c[y].context,f)}}return!0};k.prototype.on=function(e,r,n){return Pt(this,e,r,n,!1)};k.prototype.once=function(e,r,n){return Pt(this,e,r,n,!0)};k.prototype.removeListener=function(e,r,n,s){var a=j?j+e:e;if(!this._events[a])return this;if(!r)return He(this,a),this;var i=this._events[a];if(i.fn)i.fn===r&&(!s||i.once)&&(!n||i.context===n)&&He(this,a);else{for(var o=0,c=[],u=i.length;o<u;o++)(i[o].fn!==r||s&&!i[o].once||n&&i[o].context!==n)&&c.push(i[o]);c.length?this._events[a]=c.length===1?c[0]:c:He(this,a)}return this};k.prototype.removeAllListeners=function(e){var r;return e?(r=j?j+e:e,this._events[r]&&He(this,r)):(this._events=new Ze,this._eventsCount=0),this};k.prototype.off=k.prototype.removeListener;k.prototype.addListener=k.prototype.on;k.prefixed=j;k.EventEmitter=k;typeof ht<"u"&&(ht.exports=k)});var ds={};Ie(ds,{DEFAULT_READY_OPTIONS:()=>Hr,SignIn:()=>Le,actionLaunchFrameSchema:()=>ir,actionSchema:()=>or,buttonSchema:()=>cr,buttonTitleSchema:()=>Be,createEmitter:()=>hr,default:()=>us,domainFrameConfigSchema:()=>pr,domainManifestSchema:()=>cs,encodedJsonFarcasterSignatureSchema:()=>jt,eventFrameAddedSchema:()=>dr,eventFrameRemovedSchema:()=>lr,eventNotificationsEnabledSchema:()=>fr,frameEmbedNextSchema:()=>ur,frameNameSchema:()=>Ue,hexColorSchema:()=>We,jsonFarcasterSignatureHeaderSchema:()=>ns,notificationDetailsSchema:()=>pt,notificationsDisabledSchema:()=>mr,safeParseFrameEmbed:()=>ss,sdk:()=>St,secureUrlSchema:()=>N,sendNotificationRequestSchema:()=>as,sendNotificationResponseSchema:()=>is,serverEventSchema:()=>os});var Me=wr(Ct(),1);var Nt=Symbol("Comlink.proxy"),Or=Symbol("Comlink.endpoint"),jr=Symbol("Comlink.releaseProxy"),vt=Symbol("Comlink.finalizer"),Ge=Symbol("Comlink.thrown"),It=t=>typeof t=="object"&&t!==null||typeof t=="function",Sr={canHandle:t=>It(t)&&t[Nt],serialize(t){let{port1:e,port2:r}=new MessageChannel;return Mt(t,e),[r,[r]]},deserialize(t){return t.start(),yt(t)}},Rr={canHandle:t=>It(t)&&Ge in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},Zt=new Map([["proxy",Sr],["throw",Rr]]);function Pr(t,e){for(let r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function Mt(t,e=globalThis,r=["*"]){e.addEventListener("message",function n(s){if(!s||!s.data)return;if(!Pr(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}let{id:a,type:i,path:o}=Object.assign({path:[]},s.data),c=(s.data.argumentList||[]).map(G),u;try{let f=o.slice(0,-1).reduce((w,O)=>w[O],t),y=o.reduce((w,O)=>w[O],t);switch(i){case"GET":u=y;break;case"SET":f[o.slice(-1)[0]]=G(s.data.value),u=!0;break;case"APPLY":u=y.apply(f,c);break;case"CONSTRUCT":{let w=new y(...c);u=Mr(w)}break;case"ENDPOINT":{let{port1:w,port2:O}=new MessageChannel;Mt(t,O),u=Zr(w,[w])}break;case"RELEASE":u=void 0;break;default:return}}catch(f){u={value:f,[Ge]:0}}Promise.resolve(u).catch(f=>({value:f,[Ge]:0})).then(f=>{let[y,w]=Xe(f);e.postMessage(Object.assign(Object.assign({},y),{id:a}),w),i==="RELEASE"&&(e.removeEventListener("message",n),Lt(e),vt in t&&typeof t[vt]=="function"&&t[vt]())}).catch(f=>{let[y,w]=Xe({value:new TypeError("Unserializable return value"),[Ge]:0});e.postMessage(Object.assign(Object.assign({},y),{id:a}),w)})}),e.start&&e.start()}function Cr(t){return t.constructor.name==="MessagePort"}function Lt(t){Cr(t)&&t.close()}function yt(t,e){let r=new Map;return t.addEventListener("message",function(s){let{data:a}=s;if(!a||!a.id)return;let i=r.get(a.id);if(i)try{i(a)}finally{r.delete(a.id)}}),gt(t,r,[],e)}function Je(t){if(t)throw new Error("Proxy has been released and is not useable")}function $t(t){return me(t,new Map,{type:"RELEASE"}).then(()=>{Lt(t)})}var Ye=new WeakMap,Ke="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{let e=(Ye.get(t)||0)-1;Ye.set(t,e),e===0&&$t(t)});function Ar(t,e){let r=(Ye.get(e)||0)+1;Ye.set(e,r),Ke&&Ke.register(t,e,t)}function Nr(t){Ke&&Ke.unregister(t)}function gt(t,e,r=[],n=function(){}){let s=!1,a=new Proxy(n,{get(i,o){if(Je(s),o===jr)return()=>{Nr(a),$t(t),e.clear(),s=!0};if(o==="then"){if(r.length===0)return{then:()=>a};let c=me(t,e,{type:"GET",path:r.map(u=>u.toString())}).then(G);return c.then.bind(c)}return gt(t,e,[...r,o])},set(i,o,c){Je(s);let[u,f]=Xe(c);return me(t,e,{type:"SET",path:[...r,o].map(y=>y.toString()),value:u},f).then(G)},apply(i,o,c){Je(s);let u=r[r.length-1];if(u===Or)return me(t,e,{type:"ENDPOINT"}).then(G);if(u==="bind")return gt(t,e,r.slice(0,-1));let[f,y]=At(c);return me(t,e,{type:"APPLY",path:r.map(w=>w.toString()),argumentList:f},y).then(G)},construct(i,o){Je(s);let[c,u]=At(o);return me(t,e,{type:"CONSTRUCT",path:r.map(f=>f.toString()),argumentList:c},u).then(G)}});return Ar(a,t),a}function Ir(t){return Array.prototype.concat.apply([],t)}function At(t){let e=t.map(Xe);return[e.map(r=>r[0]),Ir(e.map(r=>r[1]))]}var Dt=new WeakMap;function Zr(t,e){return Dt.set(t,e),t}function Mr(t){return Object.assign(t,{[Nt]:!0})}function Vt(t,e=globalThis,r="*"){return{postMessage:(n,s)=>t.postMessage(n,r,s),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function Xe(t){for(let[e,r]of Zt)if(r.canHandle(t)){let[n,s]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},s]}return[{type:"RAW",value:t},Dt.get(t)||[]]}function G(t){switch(t.type){case"HANDLER":return Zt.get(t.name).deserialize(t.value);case"RAW":return t.value}}function me(t,e,r,n){return new Promise(s=>{let a=Lr();e.set(a,s),t.start&&t.start(),t.postMessage(Object.assign({id:a},r),n)})}function Lr(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var $r={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},Dr={postMessage:t=>{console.debug("[webview:req]",t),window.ReactNativeWebView.postMessage(JSON.stringify(t))},addEventListener:(t,e,...r)=>{document.addEventListener("FarcasterFrameCallback",e,...r)},removeEventListener:(t,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},zt=typeof window>"u"?$r:window?.ReactNativeWebView?Dr:Vt(window?.parent??window);var S=yt(zt);var Ft="0.1.1";function Ut(){return Ft}var Qe=class t extends Error{constructor(e,r={}){let n=(()=>{if(r.cause instanceof t){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause?.message?r.cause.message:r.details})(),s=r.cause instanceof t&&r.cause.docsPath||r.docsPath,i=`https://oxlib.sh${s??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||s?["",n?`Details: ${n}`:void 0,s?`See: ${i}`:void 0]:[]].filter(c=>typeof c=="string").join(`
2
- `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Ut()}`}),this.cause=r.cause,this.details=n,this.docs=i,this.docsPath=s,this.shortMessage=e}walk(e){return Bt(this,e)}};function Bt(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?Bt(t.cause,e):e?null:t}var Z={};Ie(Z,{ChainDisconnectedError:()=>st,DisconnectedError:()=>nt,IsUndefinedError:()=>at,ProviderRpcError:()=>W,UnauthorizedError:()=>tt,UnsupportedMethodError:()=>rt,UserRejectedRequestError:()=>et,createEmitter:()=>zr,from:()=>Fr});var Y={};Ie(Y,{BaseError:()=>E,InternalError:()=>Ee,InvalidInputError:()=>pe,InvalidParamsError:()=>ke,InvalidRequestError:()=>xe,LimitExceededError:()=>be,MethodNotFoundError:()=>we,MethodNotSupportedError:()=>ye,ParseError:()=>Te,ResourceNotFoundError:()=>he,ResourceUnavailableError:()=>ve,TransactionRejectedError:()=>ge,VersionNotSupportedError:()=>_e,from:()=>Vr,parse:()=>bt});function Vr(t,e={}){let{request:r}=e;return{...t,id:t.id??r?.id,jsonrpc:t.jsonrpc??r.jsonrpc}}function bt(t,e={}){let{raw:r=!1}=e,n=t;if(r)return t;if(n.error){let{code:s}=n.error,a=s===Ee.code?Ee:s===pe.code?pe:s===ke.code?ke:s===xe.code?xe:s===be.code?be:s===we.code?we:s===ye.code?ye:s===Te.code?Te:s===he.code?he:s===ve.code?ve:s===ge.code?ge:s===_e.code?_e:E;throw new a(n.error)}return n.result}var E=class extends Error{constructor(e){let{code:r,message:n,data:s}=e;super(n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r,this.data=s}},pe=class t extends E{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}};Object.defineProperty(pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var he=class t extends E{constructor(e={}){super({message:"Requested resource not found.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}};Object.defineProperty(he,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var ve=class t extends E{constructor(e={}){super({message:"Requested resource not available.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}};Object.defineProperty(ve,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var ge=class t extends E{constructor(e={}){super({message:"Transaction creation failed.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}};Object.defineProperty(ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var ye=class t extends E{constructor(e={}){super({message:"Method is not implemented.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}};Object.defineProperty(ye,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var be=class t extends E{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}};Object.defineProperty(be,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var _e=class t extends E{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}};Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var xe=class t extends E{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}};Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var we=class t extends E{constructor(e={}){super({message:"Method does not exist.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}};Object.defineProperty(we,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var ke=class t extends E{constructor(e={}){super({message:"Invalid method parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}};Object.defineProperty(ke,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var Ee=class t extends E{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalErrorError"})}};Object.defineProperty(Ee,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var Te=class t extends E{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}};Object.defineProperty(Te,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var W=class extends Error{constructor(e,r){super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=r}},et=class extends W{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(et,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var tt=class extends W{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}};Object.defineProperty(tt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var rt=class extends W{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}};Object.defineProperty(rt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var nt=class extends W{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}};Object.defineProperty(nt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var st=class extends W{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(st,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});function zr(){let t=new Me.default;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}function Fr(t,e={}){let{includeEvents:r=!0}=e;if(!t)throw new at;return{...r?{on:t.on?.bind(t),removeListener:t.removeListener?.bind(t)}:{},async request(n){let s=await t.request(n);return s&&typeof s=="object"&&"jsonrpc"in s?bt(s):s}}}var at=class extends Qe{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}};var it={};Ie(it,{createStore:()=>Ur,from:()=>qt});function Ur(t={}){let e=t.id??0;return{prepare(r){return qt({id:e++,...r})},get id(){return e}}}function qt(t){return{...t,jsonrpc:"2.0"}}var _t=Z.createEmitter(),Br=it.createStore();function Wr({code:t,details:e}){switch(t){case 4001:return new Z.UserRejectedRequestError;case 4100:return new Z.UnauthorizedError;case 4200:return new Z.UnsupportedMethodError;case 4900:return new Z.DisconnectedError;case 4901:return new Z.ChainDisconnectedError;default:return new Z.ProviderRpcError(t,e??"Unknown provider RPC error")}}var Ht=Z.from({..._t,async request(t){let e=Br.prepare(t);try{let r=await S.ethProviderRequestV2(e).then(n=>Y.parse(n,{request:e,raw:!0}));if(r.error)throw Wr(r.error);return r.result}catch(r){if(r instanceof Error&&r.message.match(/cannot read property 'apply'/i))return await S.ethProviderRequest(e);throw r instanceof Z.ProviderRpcError||r instanceof Y.BaseError?r:new Y.InternalError({message:r instanceof Error?r.message:void 0})}}});typeof document<"u"&&document.addEventListener("FarcasterFrameEthProviderEvent",t=>{if(t instanceof MessageEvent){let e=t.data;_t.emit(e.event,...e.params)}});typeof window<"u"&&window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEthProviderEvent"){let e=t.data;_t.emit(e.event,...e.params)}});var Le={};Ie(Le,{RejectedByUser:()=>xt});var ot=class extends Error{name="BaseError";cause;constructor(e,r={}){super(e,r.cause?{cause:r.cause}:void 0),this.cause=r.cause}};var xt=class extends ot{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}};var Hr={disableNativeGestures:!1};var x;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let a={};for(let i of s)a[i]=i;return a},t.getValidEnumValues=s=>{let a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(let o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(let i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var kt;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(kt||(kt={}));var m=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),F=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}},d=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Jr=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),C=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};C.create=t=>new C(t);var Se=(t,e)=>{let r;switch(t.code){case d.invalid_type:t.received===m.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,x.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${x.joinValues(t.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${x.joinValues(t.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:x.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case d.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case d.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=e.defaultError,x.assertNever(t)}return{message:r}},Yt=Se;function Gr(t){Yt=t}function ct(){return Yt}var ut=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},Yr=[];function l(t,e){let r=ct(),n=ut({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Se?void 0:Se].filter(s=>!!s)});t.common.issues.push(n)}var T=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return g;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let a=await s.key,i=await s.value;n.push({key:a,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return g;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}},g=Object.freeze({status:"aborted"}),je=t=>({status:"dirty",value:t}),R=t=>({status:"valid",value:t}),Et=t=>t.status==="aborted",Tt=t=>t.status==="dirty",K=t=>t.status==="valid",Ve=t=>typeof Promise<"u"&&t instanceof Promise;function dt(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Kt(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}var p;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));var $e,De,L=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Jt=(t,e)=>{if(K(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new C(t.common.issues);return this._error=r,this._error}}};function b(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var c,u;let{message:f}=t;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=f??r)!==null&&u!==void 0?u:o.defaultError}},description:s}}var _=class{get description(){return this._def.description}_getType(e){return F(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:F(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new T,ctx:{common:e.parent.common,data:e.data,parsedType:F(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ve(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:F(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Jt(s,a)}"~validate"(e){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:F(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:s});return K(a)?{value:a.value}:{issues:s.common.issues}}catch(a){!((n=(r=a?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(a=>K(a)?{value:a.value}:{issues:s.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:F(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ve(s)?s:Promise.resolve(s));return Jt(n,a)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let i=e(s),o=()=>a.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new A({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return M.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return J.create(this,this._def)}or(e){return se.create([this,e],this._def)}and(e){return ae.create(this,e,this._def)}transform(e){return new A({...b(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new de({...b(this._def),innerType:this,defaultValue:r,typeName:v.ZodDefault})}brand(){return new ze({typeName:v.ZodBranded,type:this,...b(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new le({...b(this._def),innerType:this,catchValue:r,typeName:v.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Kr=/^c[^\s-]{8,}$/i,Xr=/^[0-9a-z]+$/,Qr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,en=/^[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,tn=/^[a-z0-9_-]{21}$/i,rn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,an="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wt,on=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,un=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,dn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ln=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Xt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",mn=new RegExp(`^${Xt}$`);function Qt(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function pn(t){return new RegExp(`^${Qt(t)}$`)}function er(t){let e=`${Xt}T${Qt(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function hn(t,e){return!!((e==="v4"||!e)&&on.test(t)||(e==="v6"||!e)&&un.test(t))}function vn(t,e){if(!rn.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch{return!1}}function gn(t,e){return!!((e==="v4"||!e)&&cn.test(t)||(e==="v6"||!e)&&dn.test(t))}var q=class t extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.string,received:a.parsedType}),g}let n=new T,s;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")sn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")wt||(wt=new RegExp(an,"u")),wt.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")en.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")tn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Kr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Xr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Qr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?er(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?mn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?pn(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?nn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?hn(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?vn(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?gn(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?ln.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?fn.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:d.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:d.invalid_string,...p.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...p.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...p.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...p.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...p.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...p.errToObj(r)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};q.create=t=>{var e;return new q({checks:[],typeName:v.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...b(t)})};function yn(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}var X=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==m.number){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.number,received:a.parsedType}),g}let n,s=new T;for(let a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?yn(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};X.create=t=>new X({checks:[],typeName:v.ZodNumber,coerce:t?.coerce||!1,...b(t)});var Q=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==m.bigint)return this._getInvalidInput(e);let n,s=new T;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.bigint,received:r.parsedType}),g}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Q.create=t=>{var e;return new Q({checks:[],typeName:v.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...b(t)})};var ee=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),g}return R(e.data)}};ee.create=t=>new ee({typeName:v.ZodBoolean,coerce:t?.coerce||!1,...b(t)});var te=class t extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.date,received:a.parsedType}),g}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),g}let n=new T,s;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};te.create=t=>new te({checks:[],coerce:t?.coerce||!1,typeName:v.ZodDate,...b(t)});var Re=class extends _{_parse(e){if(this._getType(e)!==m.symbol){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),g}return R(e.data)}};Re.create=t=>new Re({typeName:v.ZodSymbol,...b(t)});var re=class extends _{_parse(e){if(this._getType(e)!==m.undefined){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),g}return R(e.data)}};re.create=t=>new re({typeName:v.ZodUndefined,...b(t)});var ne=class extends _{_parse(e){if(this._getType(e)!==m.null){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),g}return R(e.data)}};ne.create=t=>new ne({typeName:v.ZodNull,...b(t)});var H=class extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}};H.create=t=>new H({typeName:v.ZodAny,...b(t)});var U=class extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}};U.create=t=>new U({typeName:v.ZodUnknown,...b(t)});var $=class extends _{_parse(e){let r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.never,received:r.parsedType}),g}};$.create=t=>new $({typeName:v.ZodNever,...b(t)});var Pe=class extends _{_parse(e){if(this._getType(e)!==m.undefined){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),g}return R(e.data)}};Pe.create=t=>new Pe({typeName:v.ZodVoid,...b(t)});var B=class t extends _{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==m.array)return l(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),g;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(l(r,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(l(r,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(l(r,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new L(r,i,r.path,o)))).then(i=>T.mergeArray(n,i));let a=[...r.data].map((i,o)=>s.type._parseSync(new L(r,i,r.path,o)));return T.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:p.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:p.toString(r)}})}nonempty(e){return this.min(1,e)}};B.create=(t,e)=>new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...b(e)});function Oe(t){if(t instanceof P){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=M.create(Oe(n))}return new P({...t._def,shape:()=>e})}else return t instanceof B?new B({...t._def,type:Oe(t.element)}):t instanceof M?M.create(Oe(t.unwrap())):t instanceof V?V.create(Oe(t.unwrap())):t instanceof D?D.create(t.items.map(e=>Oe(e))):t}var P=class t extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=x.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return l(u,{code:d.invalid_type,expected:m.object,received:u.parsedType}),g}let{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||o.push(u);let c=[];for(let u of i){let f=a[u],y=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new L(s,y,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof $){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of o){let y=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new L(s,y,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of c){let y=await f.key,w=await f.value;u.push({key:y,value:w,alwaysSet:f.alwaysSet})}return u}).then(u=>T.mergeObjectSync(n,u)):T.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,a,i,o;let c=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=p.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Oe(this)}partial(e){let r={};return x.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof M;)a=a._def.innerType;r[n]=a}}),new t({...this._def,shape:()=>r})}keyof(){return tr(x.objectKeys(this.shape))}};P.create=(t,e)=>new P({shape:()=>t,unknownKeys:"strip",catchall:$.create(),typeName:v.ZodObject,...b(e)});P.strictCreate=(t,e)=>new P({shape:()=>t,unknownKeys:"strict",catchall:$.create(),typeName:v.ZodObject,...b(e)});P.lazycreate=(t,e)=>new P({shape:t,unknownKeys:"strip",catchall:$.create(),typeName:v.ZodObject,...b(e)});var se=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new C(o.ctx.common.issues));return l(r,{code:d.invalid_union,unionErrors:i}),g}if(r.common.async)return Promise.all(n.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(c=>new C(c));return l(r,{code:d.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}};se.create=(t,e)=>new se({options:t,typeName:v.ZodUnion,...b(e)});var z=t=>t instanceof ie?z(t.schema):t instanceof A?z(t.innerType()):t instanceof oe?[t.value]:t instanceof ce?t.options:t instanceof ue?x.objectValues(t.enum):t instanceof de?z(t._def.innerType):t instanceof re?[void 0]:t instanceof ne?[null]:t instanceof M?[void 0,...z(t.unwrap())]:t instanceof V?[null,...z(t.unwrap())]:t instanceof ze||t instanceof fe?z(t.unwrap()):t instanceof le?z(t._def.innerType):[],lt=class t extends _{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.object)return l(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),g;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(l(r,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let a of r){let i=z(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new t({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...b(n)})}};function Ot(t,e){let r=F(t),n=F(e);if(t===e)return{valid:!0,data:t};if(r===m.object&&n===m.object){let s=x.objectKeys(e),a=x.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(let o of a){let c=Ot(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===m.array&&n===m.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],c=Ot(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===m.date&&n===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ae=class extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(Et(a)||Et(i))return g;let o=Ot(a.value,i.value);return o.valid?((Tt(a)||Tt(i))&&r.dirty(),{status:r.value,value:o.data}):(l(n,{code:d.invalid_intersection_types}),g)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ae.create=(t,e,r)=>new ae({left:t,right:e,typeName:v.ZodIntersection,...b(r)});var D=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return l(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),g;if(n.data.length<this._def.items.length)return l(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new L(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>T.mergeArray(r,i)):T.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};D.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new D({items:t,typeName:v.ZodTuple,rest:null,...b(e)})};var ft=class t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return l(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),g;let s=[],a=this._def.keyType,i=this._def.valueType;for(let o in n.data)s.push({key:a._parse(new L(n,o,n.path,o)),value:i._parse(new L(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?T.mergeObjectAsync(r,s):T.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof _?new t({keyType:e,valueType:r,typeName:v.ZodRecord,...b(n)}):new t({keyType:q.create(),valueType:e,typeName:v.ZodRecord,...b(r)})}},Ce=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return l(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),g;let s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new L(n,o,n.path,[u,"key"])),value:a._parse(new L(n,c,n.path,[u,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return g;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return g;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}};Ce.create=(t,e,r)=>new Ce({valueType:e,keyType:t,typeName:v.ZodMap,...b(r)});var Ae=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return l(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),g;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function i(c){let u=new Set;for(let f of c){if(f.status==="aborted")return g;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let o=[...n.data.values()].map((c,u)=>a._parse(new L(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:p.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Ae.create=(t,e)=>new Ae({valueType:t,minSize:null,maxSize:null,typeName:v.ZodSet,...b(e)});var mt=class t extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.function)return l(r,{code:d.invalid_type,expected:m.function,received:r.parsedType}),g;function n(o,c){return ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ct(),Se].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:c}})}function s(o,c){return ut({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,ct(),Se].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof J){let o=this;return R(async function(...c){let u=new C([]),f=await o._def.args.parseAsync(c,a).catch(O=>{throw u.addIssue(n(c,O)),u}),y=await Reflect.apply(i,this,f);return await o._def.returns._def.type.parseAsync(y,a).catch(O=>{throw u.addIssue(s(y,O)),u})})}else{let o=this;return R(function(...c){let u=o._def.args.safeParse(c,a);if(!u.success)throw new C([n(c,u.error)]);let f=Reflect.apply(i,this,u.data),y=o._def.returns.safeParse(f,a);if(!y.success)throw new C([s(f,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:D.create(e).rest(U.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||D.create([]).rest(U.create()),returns:r||U.create(),typeName:v.ZodFunction,...b(n)})}},ie=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ie.create=(t,e)=>new ie({getter:t,typeName:v.ZodLazy,...b(e)});var oe=class extends _{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return l(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}};oe.create=(t,e)=>new oe({value:t,typeName:v.ZodLiteral,...b(e)});function tr(t,e){return new ce({values:t,typeName:v.ZodEnum,...b(e)})}var ce=class t extends _{constructor(){super(...arguments),$e.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return l(r,{expected:x.joinValues(n),received:r.parsedType,code:d.invalid_type}),g}if(dt(this,$e,"f")||Kt(this,$e,new Set(this._def.values),"f"),!dt(this,$e,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return l(r,{received:r.data,code:d.invalid_enum_value,options:n}),g}return R(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};$e=new WeakMap;ce.create=tr;var ue=class extends _{constructor(){super(...arguments),De.set(this,void 0)}_parse(e){let r=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){let s=x.objectValues(r);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:d.invalid_type}),g}if(dt(this,De,"f")||Kt(this,De,new Set(x.getValidEnumValues(this._def.values)),"f"),!dt(this,De,"f").has(e.data)){let s=x.objectValues(r);return l(n,{received:n.data,code:d.invalid_enum_value,options:s}),g}return R(e.data)}get enum(){return this._def.values}};De=new WeakMap;ue.create=(t,e)=>new ue({values:t,typeName:v.ZodNativeEnum,...b(e)});var J=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.promise&&r.common.async===!1)return l(r,{code:d.invalid_type,expected:m.promise,received:r.parsedType}),g;let n=r.parsedType===m.promise?r.data:Promise.resolve(r.data);return R(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};J.create=(t,e)=>new J({type:t,typeName:v.ZodPromise,...b(e)});var A=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return g;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?g:c.status==="dirty"||r.value==="dirty"?je(c.value):c});{if(r.value==="aborted")return g;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?g:o.status==="dirty"||r.value==="dirty"?je(o.value):o}}if(s.type==="refinement"){let i=o=>{let c=s.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?g:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!K(i))return i;let o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>K(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):i);x.assertNever(s)}};A.create=(t,e,r)=>new A({schema:t,typeName:v.ZodEffects,effect:e,...b(r)});A.createWithPreprocess=(t,e,r)=>new A({schema:e,effect:{type:"preprocess",transform:t},typeName:v.ZodEffects,...b(r)});var M=class extends _{_parse(e){return this._getType(e)===m.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M.create=(t,e)=>new M({innerType:t,typeName:v.ZodOptional,...b(e)});var V=class extends _{_parse(e){return this._getType(e)===m.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};V.create=(t,e)=>new V({innerType:t,typeName:v.ZodNullable,...b(e)});var de=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};de.create=(t,e)=>new de({innerType:t,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...b(e)});var le=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ve(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};le.create=(t,e)=>new le({innerType:t,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...b(e)});var Ne=class extends _{_parse(e){if(this._getType(e)!==m.nan){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),g}return{status:"valid",value:e.data}}};Ne.create=t=>new Ne({typeName:v.ZodNaN,...b(t)});var bn=Symbol("zod_brand"),ze=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fe=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?g:a.status==="dirty"?(r.dirty(),je(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?g:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:v.ZodPipeline})}},fe=class extends _{_parse(e){let r=this._def.innerType._parse(e),n=s=>(K(s)&&(s.value=Object.freeze(s.value)),s);return Ve(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};fe.create=(t,e)=>new fe({innerType:t,typeName:v.ZodReadonly,...b(e)});function rr(t,e={},r){return t?H.create().superRefine((n,s)=>{var a,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&i!==void 0?i:!0,u=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...u,fatal:c})}}):H.create()}var _n={object:P.lazycreate},v;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(v||(v={}));var xn=(t,e={message:`Input not instance of ${t.name}`})=>rr(r=>r instanceof t,e),nr=q.create,sr=X.create,wn=Ne.create,kn=Q.create,ar=ee.create,En=te.create,Tn=Re.create,On=re.create,jn=ne.create,Sn=H.create,Rn=U.create,Pn=$.create,Cn=Pe.create,An=B.create,Nn=P.create,In=P.strictCreate,Zn=se.create,Mn=lt.create,Ln=ae.create,$n=D.create,Dn=ft.create,Vn=Ce.create,zn=Ae.create,Fn=mt.create,Un=ie.create,Bn=oe.create,Wn=ce.create,qn=ue.create,Hn=J.create,Gt=A.create,Jn=M.create,Gn=V.create,Yn=A.createWithPreprocess,Kn=Fe.create,Xn=()=>nr().optional(),Qn=()=>sr().optional(),es=()=>ar().optional(),ts={string:t=>q.create({...t,coerce:!0}),number:t=>X.create({...t,coerce:!0}),boolean:t=>ee.create({...t,coerce:!0}),bigint:t=>Q.create({...t,coerce:!0}),date:t=>te.create({...t,coerce:!0})},rs=g,h=Object.freeze({__proto__:null,defaultErrorMap:Se,setErrorMap:Gr,getErrorMap:ct,makeIssue:ut,EMPTY_PATH:Yr,addIssueToContext:l,ParseStatus:T,INVALID:g,DIRTY:je,OK:R,isAborted:Et,isDirty:Tt,isValid:K,isAsync:Ve,get util(){return x},get objectUtil(){return kt},ZodParsedType:m,getParsedType:F,ZodType:_,datetimeRegex:er,ZodString:q,ZodNumber:X,ZodBigInt:Q,ZodBoolean:ee,ZodDate:te,ZodSymbol:Re,ZodUndefined:re,ZodNull:ne,ZodAny:H,ZodUnknown:U,ZodNever:$,ZodVoid:Pe,ZodArray:B,ZodObject:P,ZodUnion:se,ZodDiscriminatedUnion:lt,ZodIntersection:ae,ZodTuple:D,ZodRecord:ft,ZodMap:Ce,ZodSet:Ae,ZodFunction:mt,ZodLazy:ie,ZodLiteral:oe,ZodEnum:ce,ZodNativeEnum:ue,ZodPromise:J,ZodEffects:A,ZodTransformer:A,ZodOptional:M,ZodNullable:V,ZodDefault:de,ZodCatch:le,ZodNaN:Ne,BRAND:bn,ZodBranded:ze,ZodPipeline:Fe,ZodReadonly:fe,custom:rr,Schema:_,ZodSchema:_,late:_n,get ZodFirstPartyTypeKind(){return v},coerce:ts,any:Sn,array:An,bigint:kn,boolean:ar,date:En,discriminatedUnion:Mn,effect:Gt,enum:Wn,function:Fn,instanceof:xn,intersection:Ln,lazy:Un,literal:Bn,map:Vn,nan:wn,nativeEnum:qn,never:Pn,null:jn,nullable:Gn,number:sr,object:Nn,oboolean:es,onumber:Qn,optional:Jn,ostring:Xn,pipeline:Kn,preprocess:Yn,promise:Hn,record:Dn,set:zn,strictObject:In,string:nr,symbol:Tn,transformer:Gt,tuple:$n,undefined:On,union:Zn,unknown:Rn,void:Cn,NEVER:rs,ZodIssueCode:d,quotelessJson:Jr,ZodError:C});var N=h.string().url().startsWith("https://",{message:"Must be an https url"}).max(512),Ue=h.string().max(32),Be=h.string().max(32),We=h.string().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),jt=h.object({header:h.string(),payload:h.string(),signature:h.string()}),ns=h.object({fid:h.number(),type:h.literal("app_key"),key:h.string().startsWith("0x")});var ir=h.object({type:h.literal("launch_frame"),name:Ue,url:N,splashImageUrl:N.optional(),splashBackgroundColor:We.optional()}),or=h.discriminatedUnion("type",[ir]),cr=h.object({title:Be,action:or}),ur=h.object({version:h.literal("next"),imageUrl:N,button:cr}),ss=t=>ur.safeParse(t);var pt=h.object({url:h.string(),token:h.string()}),as=h.object({notificationId:h.string().max(128),title:h.string().max(32),body:h.string().max(128),targetUrl:N,tokens:h.string().array().max(100)}),is=h.object({result:h.object({successfulTokens:h.array(h.string()),invalidTokens:h.array(h.string()),rateLimitedTokens:h.array(h.string())})});var dr=h.object({event:h.literal("frame_added"),notificationDetails:pt.optional()}),lr=h.object({event:h.literal("frame_removed")}),fr=h.object({event:h.literal("notifications_enabled"),notificationDetails:pt.required()}),mr=h.object({event:h.literal("notifications_disabled")}),os=h.discriminatedUnion("event",[dr,lr,fr,mr]);var pr=h.object({version:h.union([h.literal("0.0.0"),h.literal("0.0.1"),h.literal("1"),h.literal("next")]),name:Ue,iconUrl:N,homeUrl:N,imageUrl:N.optional(),buttonTitle:Be.optional(),splashImageUrl:N.optional(),splashBackgroundColor:We.optional(),webhookUrl:N.optional()}),cs=h.object({accountAssociation:jt,frame:pr.optional()});function hr(){let t=new Me.default;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}var I=hr(),St={...I,context:S.context,actions:{setPrimaryButton:S.setPrimaryButton.bind(S),ready:S.ready.bind(S),close:S.close.bind(S),signIn:async t=>{let e=await S.signIn(t);if(console.log(e),e.result)return e.result;throw e.error.type==="rejected_by_user"?new Le.RejectedByUser:new Error("Unreachable")},openUrl:t=>S.openUrl(t.trim()),addFrame:S.addFrame.bind(S)},wallet:{ethProvider:Ht}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="primary_button_clicked"?I.emit("primaryButtonClicked"):e.event==="frame_added"?I.emit("frameAdded",{notificationDetails:e.notificationDetails}):e.event==="frame_add_rejected"?I.emit("frameAddRejected",{reason:e.reason}):e.event==="frame_removed"?I.emit("frameRemoved"):e.event==="notifications_enabled"?I.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"&&I.emit("notificationsDisabled")}});typeof window<"u"&&window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){let e=t.data.event;e.event==="primary_button_clicked"?I.emit("primaryButtonClicked"):e.event==="frame_added"?I.emit("frameAdded",{notificationDetails:e.notificationDetails}):e.event==="frame_add_rejected"?I.emit("frameAddRejected",{reason:e.reason}):e.event==="frame_removed"?I.emit("frameRemoved"):e.event==="notifications_enabled"?I.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"&&I.emit("notificationsDisabled")}});var us=St;return kr(ds);})();
1
+ "use strict";var frame=(()=>{var xr=Object.create;var Je=Object.defineProperty;var wr=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Er=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty;var Or=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),pe=(t,e)=>{for(var r in e)Je(t,r,{get:e[r],enumerable:!0})},Nt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of kr(e))!Tr.call(t,s)&&s!==r&&Je(t,s,{get:()=>e[s],enumerable:!(n=wr(e,s))||n.enumerable});return t};var jr=(t,e,r)=>(r=t!=null?xr(Er(t)):{},Nt(e||!t||!t.__esModule?Je(r,"default",{value:t,enumerable:!0}):r,t)),Pr=t=>Nt(Je({},"__esModule",{value:!0}),t);var nr=Or((Us,Ot)=>{"use strict";var qn=Object.prototype.hasOwnProperty,R="~";function We(){}Object.create&&(We.prototype=Object.create(null),new We().__proto__||(R=!1));function Wn(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function rr(t,e,r,n,s){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new Wn(r,n||t,s),i=R?R+e:e;return t._events[i]?t._events[i].fn?t._events[i]=[t._events[i],a]:t._events[i].push(a):(t._events[i]=a,t._eventsCount++),t}function rt(t,e){--t._eventsCount===0?t._events=new We:delete t._events[e]}function E(){this._events=new We,this._eventsCount=0}E.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)qn.call(r,n)&&e.push(R?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};E.prototype.listeners=function(e){var r=R?R+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var s=0,a=n.length,i=new Array(a);s<a;s++)i[s]=n[s].fn;return i};E.prototype.listenerCount=function(e){var r=R?R+e:e,n=this._events[r];return n?n.fn?1:n.length:0};E.prototype.emit=function(e,r,n,s,a,i){var o=R?R+e:e;if(!this._events[o])return!1;var c=this._events[o],u=arguments.length,f,y;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,s),!0;case 5:return c.fn.call(c.context,r,n,s,a),!0;case 6:return c.fn.call(c.context,r,n,s,a,i),!0}for(y=1,f=new Array(u-1);y<u;y++)f[y-1]=arguments[y];c.fn.apply(c.context,f)}else{var w=c.length,j;for(y=0;y<w;y++)switch(c[y].once&&this.removeListener(e,c[y].fn,void 0,!0),u){case 1:c[y].fn.call(c[y].context);break;case 2:c[y].fn.call(c[y].context,r);break;case 3:c[y].fn.call(c[y].context,r,n);break;case 4:c[y].fn.call(c[y].context,r,n,s);break;default:if(!f)for(j=1,f=new Array(u-1);j<u;j++)f[j-1]=arguments[j];c[y].fn.apply(c[y].context,f)}}return!0};E.prototype.on=function(e,r,n){return rr(this,e,r,n,!1)};E.prototype.once=function(e,r,n){return rr(this,e,r,n,!0)};E.prototype.removeListener=function(e,r,n,s){var a=R?R+e:e;if(!this._events[a])return this;if(!r)return rt(this,a),this;var i=this._events[a];if(i.fn)i.fn===r&&(!s||i.once)&&(!n||i.context===n)&&rt(this,a);else{for(var o=0,c=[],u=i.length;o<u;o++)(i[o].fn!==r||s&&!i[o].once||n&&i[o].context!==n)&&c.push(i[o]);c.length?this._events[a]=c.length===1?c[0]:c:rt(this,a)}return this};E.prototype.removeAllListeners=function(e){var r;return e?(r=R?R+e:e,this._events[r]&&rt(this,r)):(this._events=new We,this._eventsCount=0),this};E.prototype.off=E.prototype.removeListener;E.prototype.addListener=E.prototype.on;E.prefixed=R;E.EventEmitter=E;typeof Ot<"u"&&(Ot.exports=E)});var ps={};pe(ps,{AddFrame:()=>he,DEFAULT_READY_OPTIONS:()=>Bn,SignIn:()=>Le,actionLaunchFrameSchema:()=>Ht,actionSchema:()=>Jt,buttonSchema:()=>Gt,buttonTitleSchema:()=>Be,createEmitter:()=>_r,default:()=>ms,domainFrameConfigSchema:()=>tr,domainManifestSchema:()=>Un,encodedJsonFarcasterSignatureSchema:()=>Tt,eventFrameAddedSchema:()=>Kt,eventFrameRemovedSchema:()=>Xt,eventNotificationsEnabledSchema:()=>Qt,frameEmbedNextSchema:()=>Yt,frameNameSchema:()=>Ue,hexColorSchema:()=>qe,jsonFarcasterSignatureHeaderSchema:()=>$n,notificationDetailsSchema:()=>tt,notificationsDisabledSchema:()=>er,safeParseFrameEmbed:()=>Dn,sdk:()=>At,secureUrlSchema:()=>N,sendNotificationRequestSchema:()=>Vn,sendNotificationResponseSchema:()=>Fn,serverEventSchema:()=>zn});var he={};pe(he,{InvalidDomainManifest:()=>gt,RejectedByUser:()=>yt});var G=class extends Error{name="BaseError";cause;constructor(e,r={}){super(e,r.cause?{cause:r.cause}:void 0),this.cause=r.cause}};var gt=class extends G{name="AddFrame.InvalidDomainManifest";constructor(){super("Invalid domain manifest")}},yt=class extends G{name="AddFrame.RejectedByUser";constructor(){super("Add frame rejected by user")}};var Le={};pe(Le,{RejectedByUser:()=>bt});var bt=class extends G{name="SignIn.RejectedByUser";constructor(){super("Sign in rejected by user")}};var x;(function(t){t.assertEqual=s=>s;function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{let a={};for(let i of s)a[i]=i;return a},t.getValidEnumValues=s=>{let a=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),i={};for(let o of a)i[o]=s[o];return t.objectValues(i)},t.objectValues=s=>t.objectKeys(s).map(function(a){return s[a]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let a=[];for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&a.push(i);return a},t.find=(s,a)=>{for(let i of s)if(a(i))return i},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,a=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(s,a)=>typeof a=="bigint"?a.toString():a})(x||(x={}));var xt;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(xt||(xt={}));var m=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),z=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}},d=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Rr=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),C=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},s=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],c++}}};return s(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(e(s))):n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};C.create=t=>new C(t);var ye=(t,e)=>{let r;switch(t.code){case d.invalid_type:t.received===m.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case d.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,x.jsonStringifyReplacer)}`;break;case d.unrecognized_keys:r=`Unrecognized key(s) in object: ${x.joinValues(t.keys,", ")}`;break;case d.invalid_union:r="Invalid input";break;case d.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${x.joinValues(t.options)}`;break;case d.invalid_enum_value:r=`Invalid enum value. Expected ${x.joinValues(t.options)}, received '${t.received}'`;break;case d.invalid_arguments:r="Invalid function arguments";break;case d.invalid_return_type:r="Invalid function return type";break;case d.invalid_date:r="Invalid date";break;case d.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:x.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case d.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case d.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case d.custom:r="Invalid input";break;case d.invalid_intersection_types:r="Intersection results could not be merged";break;case d.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case d.not_finite:r="Number must be finite";break;default:r=e.defaultError,x.assertNever(t)}return{message:r}},Lt=ye;function Sr(t){Lt=t}function Ge(){return Lt}var Ye=t=>{let{data:e,path:r,errorMaps:n,issueData:s}=t,a=[...r,...s.path||[]],i={...s,path:a};if(s.message!==void 0)return{...s,path:a,message:s.message};let o="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)o=u(i,{data:e,defaultError:o}).message;return{...s,path:a,message:o}},Cr=[];function l(t,e){let r=Ge(),n=Ye({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ye?void 0:ye].filter(s=>!!s)});t.common.issues.push(n)}var k=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let s of r){if(s.status==="aborted")return g;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let s of r){let a=await s.key,i=await s.value;n.push({key:a,value:i})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let s of r){let{key:a,value:i}=s;if(a.status==="aborted"||i.status==="aborted")return g;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(n[a.value]=i.value)}return{status:e.value,value:n}}},g=Object.freeze({status:"aborted"}),ge=t=>({status:"dirty",value:t}),P=t=>({status:"valid",value:t}),wt=t=>t.status==="aborted",kt=t=>t.status==="dirty",Y=t=>t.status==="valid",Ve=t=>typeof Promise<"u"&&t instanceof Promise;function Ke(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function $t(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}var p;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(p||(p={}));var $e,De,Z=class{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Mt=(t,e)=>{if(Y(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new C(t.common.issues);return this._error=r,this._error}}};function b(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(i,o)=>{var c,u;let{message:f}=t;return i.code==="invalid_enum_value"?{message:f??o.defaultError}:typeof o.data>"u"?{message:(c=f??n)!==null&&c!==void 0?c:o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:(u=f??r)!==null&&u!==void 0?u:o.defaultError}},description:s}}var _=class{get description(){return this._def.description}_getType(e){return z(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ve(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},a=this._parseSync({data:e,path:s.path,parent:s});return Mt(s,a)}"~validate"(e){var r,n;let s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)};if(!this["~standard"].async)try{let a=this._parseSync({data:e,path:[],parent:s});return Y(a)?{value:a.value}:{issues:s.common.issues}}catch(a){!((n=(r=a?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(a=>Y(a)?{value:a.value}:{issues:s.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:z(e)},s=this._parse({data:e,path:n.path,parent:n}),a=await(Ve(s)?s:Promise.resolve(s));return Mt(n,a)}refine(e,r){let n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,a)=>{let i=e(s),o=()=>a.addIssue({code:d.custom,...n(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new A({schema:this,typeName:v.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return M.create(this,this._def)}nullable(){return V.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return B.create(this)}promise(){return H.create(this,this._def)}or(e){return ne.create([this,e],this._def)}and(e){return se.create(this,e,this._def)}transform(e){return new A({...b(this._def),schema:this,typeName:v.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new ue({...b(this._def),innerType:this,defaultValue:r,typeName:v.ZodDefault})}brand(){return new Fe({typeName:v.ZodBranded,type:this,...b(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new de({...b(this._def),innerType:this,catchValue:r,typeName:v.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ze.create(this,e)}readonly(){return le.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Ar=/^c[^\s-]{8,}$/i,Nr=/^[0-9a-z]+$/,Ir=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mr=/^[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,Zr=/^[a-z0-9_-]{21}$/i,Lr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$r=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Dr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_t,Fr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ur=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Br=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Hr=new RegExp(`^${Dt}$`);function Vt(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function Jr(t){return new RegExp(`^${Vt(t)}$`)}function Ft(t){let e=`${Dt}T${Vt(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Gr(t,e){return!!((e==="v4"||!e)&&Fr.test(t)||(e==="v6"||!e)&&Ur.test(t))}function Yr(t,e){if(!Lr.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch{return!1}}function Kr(t,e){return!!((e==="v4"||!e)&&zr.test(t)||(e==="v6"||!e)&&Br.test(t))}var q=class t extends _{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.string,received:a.parsedType}),g}let n=new k,s;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(s=this._getOrReturnCtx(e,s),i?l(s,{code:d.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&l(s,{code:d.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Dr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"email",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")_t||(_t=new RegExp(Vr,"u")),_t.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"emoji",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Mr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"uuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Zr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"nanoid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Ar.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Nr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cuid2",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Ir.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ulid",code:d.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),l(s,{validation:"url",code:d.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"regex",code:d.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Ft(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Hr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Jr(a).test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{code:d.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?$r.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"duration",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Gr(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"ip",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?Yr(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"jwt",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?Kr(e.data,a.version)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"cidr",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?qr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64",code:d.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Wr.test(e.data)||(s=this._getOrReturnCtx(e,s),l(s,{validation:"base64url",code:d.invalid_string,message:a.message}),n.dirty()):x.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:d.invalid_string,...p.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...p.errToObj(e)})}url(e){return this._addCheck({kind:"url",...p.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...p.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...p.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...p.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...p.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...p.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...p.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...p.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...p.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...p.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...p.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...p.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...p.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...p.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...p.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...p.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...p.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...p.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...p.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...p.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...p.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...p.errToObj(r)})}nonempty(e){return this.min(1,p.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};q.create=t=>{var e;return new q({checks:[],typeName:v.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...b(t)})};function Xr(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,a=parseInt(t.toFixed(s).replace(".","")),i=parseInt(e.toFixed(s).replace(".",""));return a%i/Math.pow(10,s)}var K=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==m.number){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.number,received:a.parsedType}),g}let n,s=new k;for(let a of this._def.checks)a.kind==="int"?x.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):a.kind==="multipleOf"?Xr(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_finite,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:p.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:p.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:p.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:p.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&x.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};K.create=t=>new K({checks:[],typeName:v.ZodNumber,coerce:t?.coerce||!1,...b(t)});var X=class t extends _{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==m.bigint)return this._getInvalidInput(e);let n,s=new k;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),l(n,{code:d.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):x.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.bigint,received:r.parsedType}),g}gte(e,r){return this.setLimit("min",e,!0,p.toString(r))}gt(e,r){return this.setLimit("min",e,!1,p.toString(r))}lte(e,r){return this.setLimit("max",e,!0,p.toString(r))}lt(e,r){return this.setLimit("max",e,!1,p.toString(r))}setLimit(e,r,n,s){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:p.toString(s)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:p.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:p.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:p.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:p.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:p.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};X.create=t=>{var e;return new X({checks:[],typeName:v.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...b(t)})};var Q=class extends _{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.boolean,received:n.parsedType}),g}return P(e.data)}};Q.create=t=>new Q({typeName:v.ZodBoolean,coerce:t?.coerce||!1,...b(t)});var ee=class t extends _{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_type,expected:m.date,received:a.parsedType}),g}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return l(a,{code:d.invalid_date}),g}let n=new k,s;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),l(s,{code:d.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):x.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:p.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:p.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ee.create=t=>new ee({checks:[],coerce:t?.coerce||!1,typeName:v.ZodDate,...b(t)});var be=class extends _{_parse(e){if(this._getType(e)!==m.symbol){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.symbol,received:n.parsedType}),g}return P(e.data)}};be.create=t=>new be({typeName:v.ZodSymbol,...b(t)});var te=class extends _{_parse(e){if(this._getType(e)!==m.undefined){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.undefined,received:n.parsedType}),g}return P(e.data)}};te.create=t=>new te({typeName:v.ZodUndefined,...b(t)});var re=class extends _{_parse(e){if(this._getType(e)!==m.null){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.null,received:n.parsedType}),g}return P(e.data)}};re.create=t=>new re({typeName:v.ZodNull,...b(t)});var W=class extends _{constructor(){super(...arguments),this._any=!0}_parse(e){return P(e.data)}};W.create=t=>new W({typeName:v.ZodAny,...b(t)});var U=class extends _{constructor(){super(...arguments),this._unknown=!0}_parse(e){return P(e.data)}};U.create=t=>new U({typeName:v.ZodUnknown,...b(t)});var $=class extends _{_parse(e){let r=this._getOrReturnCtx(e);return l(r,{code:d.invalid_type,expected:m.never,received:r.parsedType}),g}};$.create=t=>new $({typeName:v.ZodNever,...b(t)});var _e=class extends _{_parse(e){if(this._getType(e)!==m.undefined){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.void,received:n.parsedType}),g}return P(e.data)}};_e.create=t=>new _e({typeName:v.ZodVoid,...b(t)});var B=class t extends _{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==m.array)return l(r,{code:d.invalid_type,expected:m.array,received:r.parsedType}),g;if(s.exactLength!==null){let i=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(i||o)&&(l(r,{code:i?d.too_big:d.too_small,minimum:o?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(l(r,{code:d.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(l(r,{code:d.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>s.type._parseAsync(new Z(r,i,r.path,o)))).then(i=>k.mergeArray(n,i));let a=[...r.data].map((i,o)=>s.type._parseSync(new Z(r,i,r.path,o)));return k.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:p.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:p.toString(r)}})}nonempty(e){return this.min(1,e)}};B.create=(t,e)=>new B({type:t,minLength:null,maxLength:null,exactLength:null,typeName:v.ZodArray,...b(e)});function ve(t){if(t instanceof S){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=M.create(ve(n))}return new S({...t._def,shape:()=>e})}else return t instanceof B?new B({...t._def,type:ve(t.element)}):t instanceof M?M.create(ve(t.unwrap())):t instanceof V?V.create(ve(t.unwrap())):t instanceof D?D.create(t.items.map(e=>ve(e))):t}var S=class t extends _{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=x.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return l(u,{code:d.invalid_type,expected:m.object,received:u.parsedType}),g}let{status:n,ctx:s}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof $&&this._def.unknownKeys==="strip"))for(let u in s.data)i.includes(u)||o.push(u);let c=[];for(let u of i){let f=a[u],y=s.data[u];c.push({key:{status:"valid",value:u},value:f._parse(new Z(s,y,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof $){let u=this._def.unknownKeys;if(u==="passthrough")for(let f of o)c.push({key:{status:"valid",value:f},value:{status:"valid",value:s.data[f]}});else if(u==="strict")o.length>0&&(l(s,{code:d.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let f of o){let y=s.data[f];c.push({key:{status:"valid",value:f},value:u._parse(new Z(s,y,s.path,f)),alwaysSet:f in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let u=[];for(let f of c){let y=await f.key,w=await f.value;u.push({key:y,value:w,alwaysSet:f.alwaysSet})}return u}).then(u=>k.mergeObjectSync(n,u)):k.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return p.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var s,a,i,o;let c=(i=(a=(s=this._def).errorMap)===null||a===void 0?void 0:a.call(s,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=p.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:v.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return x.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return x.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return ve(this)}partial(e){let r={};return x.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return x.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof M;)a=a._def.innerType;r[n]=a}}),new t({...this._def,shape:()=>r})}keyof(){return zt(x.objectKeys(this.shape))}};S.create=(t,e)=>new S({shape:()=>t,unknownKeys:"strip",catchall:$.create(),typeName:v.ZodObject,...b(e)});S.strictCreate=(t,e)=>new S({shape:()=>t,unknownKeys:"strict",catchall:$.create(),typeName:v.ZodObject,...b(e)});S.lazycreate=(t,e)=>new S({shape:t,unknownKeys:"strip",catchall:$.create(),typeName:v.ZodObject,...b(e)});var ne=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function s(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new C(o.ctx.common.issues));return l(r,{code:d.invalid_union,unionErrors:i}),g}if(r.common.async)return Promise.all(n.map(async a=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(s);{let a,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!a&&(a={result:f,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(c=>new C(c));return l(r,{code:d.invalid_union,unionErrors:o}),g}}get options(){return this._def.options}};ne.create=(t,e)=>new ne({options:t,typeName:v.ZodUnion,...b(e)});var F=t=>t instanceof ae?F(t.schema):t instanceof A?F(t.innerType()):t instanceof ie?[t.value]:t instanceof oe?t.options:t instanceof ce?x.objectValues(t.enum):t instanceof ue?F(t._def.innerType):t instanceof te?[void 0]:t instanceof re?[null]:t instanceof M?[void 0,...F(t.unwrap())]:t instanceof V?[null,...F(t.unwrap())]:t instanceof Fe||t instanceof le?F(t.unwrap()):t instanceof de?F(t._def.innerType):[],Xe=class t extends _{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.object)return l(r,{code:d.invalid_type,expected:m.object,received:r.parsedType}),g;let n=this.discriminator,s=r.data[n],a=this.optionsMap.get(s);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(l(r,{code:d.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),g)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let s=new Map;for(let a of r){let i=F(a.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,a)}}return new t({typeName:v.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:s,...b(n)})}};function Et(t,e){let r=z(t),n=z(e);if(t===e)return{valid:!0,data:t};if(r===m.object&&n===m.object){let s=x.objectKeys(e),a=x.objectKeys(t).filter(o=>s.indexOf(o)!==-1),i={...t,...e};for(let o of a){let c=Et(t[o],e[o]);if(!c.valid)return{valid:!1};i[o]=c.data}return{valid:!0,data:i}}else if(r===m.array&&n===m.array){if(t.length!==e.length)return{valid:!1};let s=[];for(let a=0;a<t.length;a++){let i=t[a],o=e[a],c=Et(i,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return r===m.date&&n===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var se=class extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=(a,i)=>{if(wt(a)||wt(i))return g;let o=Et(a.value,i.value);return o.valid?((kt(a)||kt(i))&&r.dirty(),{status:r.value,value:o.data}):(l(n,{code:d.invalid_intersection_types}),g)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>s(a,i)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};se.create=(t,e,r)=>new se({left:t,right:e,typeName:v.ZodIntersection,...b(r)});var D=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.array)return l(n,{code:d.invalid_type,expected:m.array,received:n.parsedType}),g;if(n.data.length<this._def.items.length)return l(n,{code:d.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g;!this._def.rest&&n.data.length>this._def.items.length&&(l(n,{code:d.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,o)=>{let c=this._def.items[o]||this._def.rest;return c?c._parse(new Z(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>k.mergeArray(r,i)):k.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};D.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new D({items:t,typeName:v.ZodTuple,rest:null,...b(e)})};var Qe=class t extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.object)return l(n,{code:d.invalid_type,expected:m.object,received:n.parsedType}),g;let s=[],a=this._def.keyType,i=this._def.valueType;for(let o in n.data)s.push({key:a._parse(new Z(n,o,n.path,o)),value:i._parse(new Z(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?k.mergeObjectAsync(r,s):k.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof _?new t({keyType:e,valueType:r,typeName:v.ZodRecord,...b(n)}):new t({keyType:q.create(),valueType:e,typeName:v.ZodRecord,...b(r)})}},xe=class extends _{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.map)return l(n,{code:d.invalid_type,expected:m.map,received:n.parsedType}),g;let s=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([o,c],u)=>({key:s._parse(new Z(n,o,n.path,[u,"key"])),value:a._parse(new Z(n,c,n.path,[u,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,f=await c.value;if(u.status==="aborted"||f.status==="aborted")return g;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}})}else{let o=new Map;for(let c of i){let u=c.key,f=c.value;if(u.status==="aborted"||f.status==="aborted")return g;(u.status==="dirty"||f.status==="dirty")&&r.dirty(),o.set(u.value,f.value)}return{status:r.value,value:o}}}};xe.create=(t,e,r)=>new xe({valueType:e,keyType:t,typeName:v.ZodMap,...b(r)});var we=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==m.set)return l(n,{code:d.invalid_type,expected:m.set,received:n.parsedType}),g;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(l(n,{code:d.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(l(n,{code:d.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let a=this._def.valueType;function i(c){let u=new Set;for(let f of c){if(f.status==="aborted")return g;f.status==="dirty"&&r.dirty(),u.add(f.value)}return{status:r.value,value:u}}let o=[...n.data.values()].map((c,u)=>a._parse(new Z(n,c,n.path,u)));return n.common.async?Promise.all(o).then(c=>i(c)):i(o)}min(e,r){return new t({...this._def,minSize:{value:e,message:p.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:p.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};we.create=(t,e)=>new we({valueType:t,minSize:null,maxSize:null,typeName:v.ZodSet,...b(e)});var et=class t extends _{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.function)return l(r,{code:d.invalid_type,expected:m.function,received:r.parsedType}),g;function n(o,c){return Ye({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ge(),ye].filter(u=>!!u),issueData:{code:d.invalid_arguments,argumentsError:c}})}function s(o,c){return Ye({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Ge(),ye].filter(u=>!!u),issueData:{code:d.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof H){let o=this;return P(async function(...c){let u=new C([]),f=await o._def.args.parseAsync(c,a).catch(j=>{throw u.addIssue(n(c,j)),u}),y=await Reflect.apply(i,this,f);return await o._def.returns._def.type.parseAsync(y,a).catch(j=>{throw u.addIssue(s(y,j)),u})})}else{let o=this;return P(function(...c){let u=o._def.args.safeParse(c,a);if(!u.success)throw new C([n(c,u.error)]);let f=Reflect.apply(i,this,u.data),y=o._def.returns.safeParse(f,a);if(!y.success)throw new C([s(f,y.error)]);return y.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:D.create(e).rest(U.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||D.create([]).rest(U.create()),returns:r||U.create(),typeName:v.ZodFunction,...b(n)})}},ae=class extends _{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ae.create=(t,e)=>new ae({getter:t,typeName:v.ZodLazy,...b(e)});var ie=class extends _{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return l(r,{received:r.data,code:d.invalid_literal,expected:this._def.value}),g}return{status:"valid",value:e.data}}get value(){return this._def.value}};ie.create=(t,e)=>new ie({value:t,typeName:v.ZodLiteral,...b(e)});function zt(t,e){return new oe({values:t,typeName:v.ZodEnum,...b(e)})}var oe=class t extends _{constructor(){super(...arguments),$e.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return l(r,{expected:x.joinValues(n),received:r.parsedType,code:d.invalid_type}),g}if(Ke(this,$e,"f")||$t(this,$e,new Set(this._def.values),"f"),!Ke(this,$e,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return l(r,{received:r.data,code:d.invalid_enum_value,options:n}),g}return P(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};$e=new WeakMap;oe.create=zt;var ce=class extends _{constructor(){super(...arguments),De.set(this,void 0)}_parse(e){let r=x.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==m.string&&n.parsedType!==m.number){let s=x.objectValues(r);return l(n,{expected:x.joinValues(s),received:n.parsedType,code:d.invalid_type}),g}if(Ke(this,De,"f")||$t(this,De,new Set(x.getValidEnumValues(this._def.values)),"f"),!Ke(this,De,"f").has(e.data)){let s=x.objectValues(r);return l(n,{received:n.data,code:d.invalid_enum_value,options:s}),g}return P(e.data)}get enum(){return this._def.values}};De=new WeakMap;ce.create=(t,e)=>new ce({values:t,typeName:v.ZodNativeEnum,...b(e)});var H=class extends _{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==m.promise&&r.common.async===!1)return l(r,{code:d.invalid_type,expected:m.promise,received:r.parsedType}),g;let n=r.parsedType===m.promise?r.data:Promise.resolve(r.data);return P(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};H.create=(t,e)=>new H({type:t,typeName:v.ZodPromise,...b(e)});var A=class extends _{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===v.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:i=>{l(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),s.type==="preprocess"){let i=s.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return g;let c=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return c.status==="aborted"?g:c.status==="dirty"||r.value==="dirty"?ge(c.value):c});{if(r.value==="aborted")return g;let o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?g:o.status==="dirty"||r.value==="dirty"?ge(o.value):o}}if(s.type==="refinement"){let i=o=>{let c=s.refinement(o,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?g:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?g:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Y(i))return i;let o=s.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Y(i)?Promise.resolve(s.transform(i.value,a)).then(o=>({status:r.value,value:o})):i);x.assertNever(s)}};A.create=(t,e,r)=>new A({schema:t,typeName:v.ZodEffects,effect:e,...b(r)});A.createWithPreprocess=(t,e,r)=>new A({schema:e,effect:{type:"preprocess",transform:t},typeName:v.ZodEffects,...b(r)});var M=class extends _{_parse(e){return this._getType(e)===m.undefined?P(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};M.create=(t,e)=>new M({innerType:t,typeName:v.ZodOptional,...b(e)});var V=class extends _{_parse(e){return this._getType(e)===m.null?P(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};V.create=(t,e)=>new V({innerType:t,typeName:v.ZodNullable,...b(e)});var ue=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===m.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};ue.create=(t,e)=>new ue({innerType:t,typeName:v.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...b(e)});var de=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ve(s)?s.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new C(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};de.create=(t,e)=>new de({innerType:t,typeName:v.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...b(e)});var ke=class extends _{_parse(e){if(this._getType(e)!==m.nan){let n=this._getOrReturnCtx(e);return l(n,{code:d.invalid_type,expected:m.nan,received:n.parsedType}),g}return{status:"valid",value:e.data}}};ke.create=t=>new ke({typeName:v.ZodNaN,...b(t)});var Qr=Symbol("zod_brand"),Fe=class extends _{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ze=class t extends _{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?g:a.status==="dirty"?(r.dirty(),ge(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?g:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:v.ZodPipeline})}},le=class extends _{_parse(e){let r=this._def.innerType._parse(e),n=s=>(Y(s)&&(s.value=Object.freeze(s.value)),s);return Ve(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}};le.create=(t,e)=>new le({innerType:t,typeName:v.ZodReadonly,...b(e)});function Ut(t,e={},r){return t?W.create().superRefine((n,s)=>{var a,i;if(!t(n)){let o=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(a=o.fatal)!==null&&a!==void 0?a:r)!==null&&i!==void 0?i:!0,u=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...u,fatal:c})}}):W.create()}var en={object:S.lazycreate},v;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(v||(v={}));var tn=(t,e={message:`Input not instance of ${t.name}`})=>Ut(r=>r instanceof t,e),Bt=q.create,qt=K.create,rn=ke.create,nn=X.create,Wt=Q.create,sn=ee.create,an=be.create,on=te.create,cn=re.create,un=W.create,dn=U.create,ln=$.create,fn=_e.create,mn=B.create,pn=S.create,hn=S.strictCreate,vn=ne.create,gn=Xe.create,yn=se.create,bn=D.create,_n=Qe.create,xn=xe.create,wn=we.create,kn=et.create,En=ae.create,Tn=ie.create,On=oe.create,jn=ce.create,Pn=H.create,Zt=A.create,Rn=M.create,Sn=V.create,Cn=A.createWithPreprocess,An=ze.create,Nn=()=>Bt().optional(),In=()=>qt().optional(),Mn=()=>Wt().optional(),Zn={string:t=>q.create({...t,coerce:!0}),number:t=>K.create({...t,coerce:!0}),boolean:t=>Q.create({...t,coerce:!0}),bigint:t=>X.create({...t,coerce:!0}),date:t=>ee.create({...t,coerce:!0})},Ln=g,h=Object.freeze({__proto__:null,defaultErrorMap:ye,setErrorMap:Sr,getErrorMap:Ge,makeIssue:Ye,EMPTY_PATH:Cr,addIssueToContext:l,ParseStatus:k,INVALID:g,DIRTY:ge,OK:P,isAborted:wt,isDirty:kt,isValid:Y,isAsync:Ve,get util(){return x},get objectUtil(){return xt},ZodParsedType:m,getParsedType:z,ZodType:_,datetimeRegex:Ft,ZodString:q,ZodNumber:K,ZodBigInt:X,ZodBoolean:Q,ZodDate:ee,ZodSymbol:be,ZodUndefined:te,ZodNull:re,ZodAny:W,ZodUnknown:U,ZodNever:$,ZodVoid:_e,ZodArray:B,ZodObject:S,ZodUnion:ne,ZodDiscriminatedUnion:Xe,ZodIntersection:se,ZodTuple:D,ZodRecord:Qe,ZodMap:xe,ZodSet:we,ZodFunction:et,ZodLazy:ae,ZodLiteral:ie,ZodEnum:oe,ZodNativeEnum:ce,ZodPromise:H,ZodEffects:A,ZodTransformer:A,ZodOptional:M,ZodNullable:V,ZodDefault:ue,ZodCatch:de,ZodNaN:ke,BRAND:Qr,ZodBranded:Fe,ZodPipeline:ze,ZodReadonly:le,custom:Ut,Schema:_,ZodSchema:_,late:en,get ZodFirstPartyTypeKind(){return v},coerce:Zn,any:un,array:mn,bigint:nn,boolean:Wt,date:sn,discriminatedUnion:gn,effect:Zt,enum:On,function:kn,instanceof:tn,intersection:yn,lazy:En,literal:Tn,map:xn,nan:rn,nativeEnum:jn,never:ln,null:cn,nullable:Sn,number:qt,object:pn,oboolean:Mn,onumber:In,optional:Rn,ostring:Nn,pipeline:An,preprocess:Cn,promise:Pn,record:_n,set:wn,strictObject:hn,string:Bt,symbol:an,transformer:Zt,tuple:bn,undefined:on,union:vn,unknown:dn,void:fn,NEVER:Ln,ZodIssueCode:d,quotelessJson:Rr,ZodError:C});var N=h.string().url().startsWith("https://",{message:"Must be an https url"}).max(512),Ue=h.string().max(32),Be=h.string().max(32),qe=h.string().regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i,{message:"Invalid hex color code. It should be in the format #RRGGBB or #RGB."}),Tt=h.object({header:h.string(),payload:h.string(),signature:h.string()}),$n=h.object({fid:h.number(),type:h.literal("app_key"),key:h.string().startsWith("0x")});var Ht=h.object({type:h.literal("launch_frame"),name:Ue,url:N,splashImageUrl:N.optional(),splashBackgroundColor:qe.optional()}),Jt=h.discriminatedUnion("type",[Ht]),Gt=h.object({title:Be,action:Jt}),Yt=h.object({version:h.literal("next"),imageUrl:N,button:Gt}),Dn=t=>Yt.safeParse(t);var tt=h.object({url:h.string(),token:h.string()}),Vn=h.object({notificationId:h.string().max(128),title:h.string().max(32),body:h.string().max(128),targetUrl:N,tokens:h.string().array().max(100)}),Fn=h.object({result:h.object({successfulTokens:h.array(h.string()),invalidTokens:h.array(h.string()),rateLimitedTokens:h.array(h.string())})});var Kt=h.object({event:h.literal("frame_added"),notificationDetails:tt.optional()}),Xt=h.object({event:h.literal("frame_removed")}),Qt=h.object({event:h.literal("notifications_enabled"),notificationDetails:tt.required()}),er=h.object({event:h.literal("notifications_disabled")}),zn=h.discriminatedUnion("event",[Kt,Xt,Qt,er]);var tr=h.object({version:h.union([h.literal("0.0.0"),h.literal("0.0.1"),h.literal("1"),h.literal("next")]),name:Ue,iconUrl:N,homeUrl:N,imageUrl:N.optional(),buttonTitle:Be.optional(),splashImageUrl:N.optional(),splashBackgroundColor:qe.optional(),webhookUrl:N.optional()}),Un=h.object({accountAssociation:Tt,frame:tr.optional()});var Bn={disableNativeGestures:!1};var He=jr(nr(),1);var ar=Symbol("Comlink.proxy"),Hn=Symbol("Comlink.endpoint"),Jn=Symbol("Comlink.releaseProxy"),jt=Symbol("Comlink.finalizer"),st=Symbol("Comlink.thrown"),ir=t=>typeof t=="object"&&t!==null||typeof t=="function",Gn={canHandle:t=>ir(t)&&t[ar],serialize(t){let{port1:e,port2:r}=new MessageChannel;return cr(t,e),[r,[r]]},deserialize(t){return t.start(),Rt(t)}},Yn={canHandle:t=>ir(t)&&st in t,serialize({value:t}){let e;return t instanceof Error?e={isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:e={isError:!1,value:t},[e,[]]},deserialize(t){throw t.isError?Object.assign(new Error(t.value.message),t.value):t.value}},or=new Map([["proxy",Gn],["throw",Yn]]);function Kn(t,e){for(let r of t)if(e===r||r==="*"||r instanceof RegExp&&r.test(e))return!0;return!1}function cr(t,e=globalThis,r=["*"]){e.addEventListener("message",function n(s){if(!s||!s.data)return;if(!Kn(r,s.origin)){console.warn(`Invalid origin '${s.origin}' for comlink proxy`);return}let{id:a,type:i,path:o}=Object.assign({path:[]},s.data),c=(s.data.argumentList||[]).map(fe),u;try{let f=o.slice(0,-1).reduce((w,j)=>w[j],t),y=o.reduce((w,j)=>w[j],t);switch(i){case"GET":u=y;break;case"SET":f[o.slice(-1)[0]]=fe(s.data.value),u=!0;break;case"APPLY":u=y.apply(f,c);break;case"CONSTRUCT":{let w=new y(...c);u=ns(w)}break;case"ENDPOINT":{let{port1:w,port2:j}=new MessageChannel;cr(t,j),u=rs(w,[w])}break;case"RELEASE":u=void 0;break;default:return}}catch(f){u={value:f,[st]:0}}Promise.resolve(u).catch(f=>({value:f,[st]:0})).then(f=>{let[y,w]=ot(f);e.postMessage(Object.assign(Object.assign({},y),{id:a}),w),i==="RELEASE"&&(e.removeEventListener("message",n),ur(e),jt in t&&typeof t[jt]=="function"&&t[jt]())}).catch(f=>{let[y,w]=ot({value:new TypeError("Unserializable return value"),[st]:0});e.postMessage(Object.assign(Object.assign({},y),{id:a}),w)})}),e.start&&e.start()}function Xn(t){return t.constructor.name==="MessagePort"}function ur(t){Xn(t)&&t.close()}function Rt(t,e){let r=new Map;return t.addEventListener("message",function(s){let{data:a}=s;if(!a||!a.id)return;let i=r.get(a.id);if(i)try{i(a)}finally{r.delete(a.id)}}),Pt(t,r,[],e)}function nt(t){if(t)throw new Error("Proxy has been released and is not useable")}function dr(t){return Ee(t,new Map,{type:"RELEASE"}).then(()=>{ur(t)})}var at=new WeakMap,it="FinalizationRegistry"in globalThis&&new FinalizationRegistry(t=>{let e=(at.get(t)||0)-1;at.set(t,e),e===0&&dr(t)});function Qn(t,e){let r=(at.get(e)||0)+1;at.set(e,r),it&&it.register(t,e,t)}function es(t){it&&it.unregister(t)}function Pt(t,e,r=[],n=function(){}){let s=!1,a=new Proxy(n,{get(i,o){if(nt(s),o===Jn)return()=>{es(a),dr(t),e.clear(),s=!0};if(o==="then"){if(r.length===0)return{then:()=>a};let c=Ee(t,e,{type:"GET",path:r.map(u=>u.toString())}).then(fe);return c.then.bind(c)}return Pt(t,e,[...r,o])},set(i,o,c){nt(s);let[u,f]=ot(c);return Ee(t,e,{type:"SET",path:[...r,o].map(y=>y.toString()),value:u},f).then(fe)},apply(i,o,c){nt(s);let u=r[r.length-1];if(u===Hn)return Ee(t,e,{type:"ENDPOINT"}).then(fe);if(u==="bind")return Pt(t,e,r.slice(0,-1));let[f,y]=sr(c);return Ee(t,e,{type:"APPLY",path:r.map(w=>w.toString()),argumentList:f},y).then(fe)},construct(i,o){nt(s);let[c,u]=sr(o);return Ee(t,e,{type:"CONSTRUCT",path:r.map(f=>f.toString()),argumentList:c},u).then(fe)}});return Qn(a,t),a}function ts(t){return Array.prototype.concat.apply([],t)}function sr(t){let e=t.map(ot);return[e.map(r=>r[0]),ts(e.map(r=>r[1]))]}var lr=new WeakMap;function rs(t,e){return lr.set(t,e),t}function ns(t){return Object.assign(t,{[ar]:!0})}function fr(t,e=globalThis,r="*"){return{postMessage:(n,s)=>t.postMessage(n,r,s),addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}function ot(t){for(let[e,r]of or)if(r.canHandle(t)){let[n,s]=r.serialize(t);return[{type:"HANDLER",name:e,value:n},s]}return[{type:"RAW",value:t},lr.get(t)||[]]}function fe(t){switch(t.type){case"HANDLER":return or.get(t.name).deserialize(t.value);case"RAW":return t.value}}function Ee(t,e,r,n){return new Promise(s=>{let a=ss();e.set(a,s),t.start&&t.start(),t.postMessage(Object.assign({id:a},r),n)})}function ss(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var as={postMessage(){},addEventListener:()=>{},removeEventListener:()=>{}},is={postMessage:t=>{console.debug("[webview:req]",t),window.ReactNativeWebView.postMessage(JSON.stringify(t))},addEventListener:(t,e,...r)=>{document.addEventListener("FarcasterFrameCallback",e,...r)},removeEventListener:(t,e)=>{document.removeEventListener("FarcasterFrameCallback",e)}},mr=typeof window>"u"?as:window?.ReactNativeWebView?is:fr(window?.parent??window);var T=Rt(mr);var pr="0.1.1";function hr(){return pr}var ct=class t extends Error{constructor(e,r={}){let n=(()=>{if(r.cause instanceof t){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause?.message?r.cause.message:r.details})(),s=r.cause instanceof t&&r.cause.docsPath||r.docsPath,i=`https://oxlib.sh${s??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||s?["",n?`Details: ${n}`:void 0,s?`See: ${i}`:void 0]:[]].filter(c=>typeof c=="string").join(`
2
+ `);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${hr()}`}),this.cause=r.cause,this.details=n,this.docs=i,this.docsPath=s,this.shortMessage=e}walk(e){return vr(this,e)}};function vr(t,e){return e?.(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?vr(t.cause,e):e?null:t}var L={};pe(L,{ChainDisconnectedError:()=>mt,DisconnectedError:()=>ft,IsUndefinedError:()=>pt,ProviderRpcError:()=>J,UnauthorizedError:()=>dt,UnsupportedMethodError:()=>lt,UserRejectedRequestError:()=>ut,createEmitter:()=>cs,from:()=>us});var me={};pe(me,{BaseError:()=>O,InternalError:()=>Me,InvalidInputError:()=>Te,InvalidParamsError:()=>Ie,InvalidRequestError:()=>Ae,LimitExceededError:()=>Se,MethodNotFoundError:()=>Ne,MethodNotSupportedError:()=>Re,ParseError:()=>Ze,ResourceNotFoundError:()=>Oe,ResourceUnavailableError:()=>je,TransactionRejectedError:()=>Pe,VersionNotSupportedError:()=>Ce,from:()=>os,parse:()=>St});function os(t,e={}){let{request:r}=e;return{...t,id:t.id??r?.id,jsonrpc:t.jsonrpc??r.jsonrpc}}function St(t,e={}){let{raw:r=!1}=e,n=t;if(r)return t;if(n.error){let{code:s}=n.error,a=s===Me.code?Me:s===Te.code?Te:s===Ie.code?Ie:s===Ae.code?Ae:s===Se.code?Se:s===Ne.code?Ne:s===Re.code?Re:s===Ze.code?Ze:s===Oe.code?Oe:s===je.code?je:s===Pe.code?Pe:s===Ce.code?Ce:O;throw new a(n.error)}return n.result}var O=class extends Error{constructor(e){let{code:r,message:n,data:s}=e;super(n),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r,this.data=s}},Te=class t extends O{constructor(e={}){super({message:"Missing or invalid parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}};Object.defineProperty(Te,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});var Oe=class t extends O{constructor(e={}){super({message:"Requested resource not found.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}};Object.defineProperty(Oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});var je=class t extends O{constructor(e={}){super({message:"Requested resource not available.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}};Object.defineProperty(je,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});var Pe=class t extends O{constructor(e={}){super({message:"Transaction creation failed.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}};Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});var Re=class t extends O{constructor(e={}){super({message:"Method is not implemented.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}};Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});var Se=class t extends O{constructor(e={}){super({message:"Rate limit exceeded.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}};Object.defineProperty(Se,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});var Ce=class t extends O{constructor(e={}){super({message:"JSON-RPC version not supported.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}};Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});var Ae=class t extends O{constructor(e={}){super({message:"Input is not a valid JSON-RPC request.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}};Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});var Ne=class t extends O{constructor(e={}){super({message:"Method does not exist.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}};Object.defineProperty(Ne,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});var Ie=class t extends O{constructor(e={}){super({message:"Invalid method parameters.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}};Object.defineProperty(Ie,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});var Me=class t extends O{constructor(e={}){super({message:"Internal JSON-RPC error.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalErrorError"})}};Object.defineProperty(Me,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});var Ze=class t extends O{constructor(e={}){super({message:"Failed to parse JSON-RPC response.",...e,code:t.code}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}};Object.defineProperty(Ze,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});var J=class extends Error{constructor(e,r){super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=e,this.details=r}},ut=class extends J{constructor({message:e="The user rejected the request."}={}){super(4001,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});var dt=class extends J{constructor({message:e="The requested method and/or account has not been authorized by the user."}={}){super(4100,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}};Object.defineProperty(dt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});var lt=class extends J{constructor({message:e="The provider does not support the requested method."}={}){super(4200,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}};Object.defineProperty(lt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});var ft=class extends J{constructor({message:e="The provider is disconnected from all chains."}={}){super(4900,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}};Object.defineProperty(ft,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});var mt=class extends J{constructor({message:e="The provider is not connected to the requested chain."}={}){super(4901,e),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(mt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});function cs(){let t=new He.default;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}function us(t,e={}){let{includeEvents:r=!0}=e;if(!t)throw new pt;return{...r?{on:t.on?.bind(t),removeListener:t.removeListener?.bind(t)}:{},async request(n){let s=await t.request(n);return s&&typeof s=="object"&&"jsonrpc"in s?St(s):s}}}var pt=class extends ct{constructor(){super("`provider` is undefined."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.IsUndefinedError"})}};var ht={};pe(ht,{createStore:()=>ds,from:()=>yr});function ds(t={}){let e=t.id??0;return{prepare(r){return yr({id:e++,...r})},get id(){return e}}}function yr(t){return{...t,jsonrpc:"2.0"}}var Ct=L.createEmitter(),ls=ht.createStore();function fs({code:t,details:e}){switch(t){case 4001:return new L.UserRejectedRequestError;case 4100:return new L.UnauthorizedError;case 4200:return new L.UnsupportedMethodError;case 4900:return new L.DisconnectedError;case 4901:return new L.ChainDisconnectedError;default:return new L.ProviderRpcError(t,e??"Unknown provider RPC error")}}var vt=L.from({...Ct,async request(t){let e=ls.prepare(t);try{let r=await T.ethProviderRequestV2(e).then(n=>me.parse(n,{request:e,raw:!0}));if(r.error)throw fs(r.error);return r.result}catch(r){if(r instanceof Error&&r.message.match(/cannot read property 'apply'/i))return await T.ethProviderRequest(e);throw r instanceof L.ProviderRpcError||r instanceof me.BaseError?r:new me.InternalError({message:r instanceof Error?r.message:void 0})}}});function br(t){let e=new CustomEvent("eip6963:announceProvider",{detail:Object.freeze(t)});window.dispatchEvent(e);let r=()=>window.dispatchEvent(e);return window.addEventListener("eip6963:requestProvider",r),()=>window.removeEventListener("eip6963:requestProvider",r)}typeof document<"u"&&(document.addEventListener("eip6963:requestProvider",()=>{T.eip6963RequestProvider()}),document.addEventListener("FarcasterFrameEthProviderEvent",t=>{if(t instanceof MessageEvent){let e=t.data;Ct.emit(e.event,...e.params)}}),document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="eip6963:announceProvider"&&br({info:e.info,provider:vt})}}));typeof window<"u"&&(window.addEventListener("eip6963:requestProvider",()=>{T.eip6963RequestProvider()}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEthProviderEvent"){let e=t.data;Ct.emit(e.event,...e.params)}}),window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){let e=t.data.event;e.event==="eip6963:announceProvider"&&br({info:e.info,provider:vt})}}));function _r(){let t=new He.default;return{get eventNames(){return t.eventNames.bind(t)},get listenerCount(){return t.listenerCount.bind(t)},get listeners(){return t.listeners.bind(t)},addListener:t.addListener.bind(t),emit:t.emit.bind(t),off:t.off.bind(t),on:t.on.bind(t),once:t.once.bind(t),removeAllListeners:t.removeAllListeners.bind(t),removeListener:t.removeListener.bind(t)}}var I=_r(),At={...I,context:T.context,actions:{setPrimaryButton:T.setPrimaryButton.bind(T),ready:T.ready.bind(T),close:T.close.bind(T),signIn:async t=>{let e=await T.signIn(t);if(e.result)return e.result;throw e.error.type==="rejected_by_user"?new Le.RejectedByUser:new Error("Unreachable")},openUrl:t=>T.openUrl(t.trim()),addFrame:async()=>{let t=await T.addFrame();if(t.result)return t.result;throw t.error.type==="invalid_domain_manifest"?new he.InvalidDomainManifest:t.error.type==="rejected_by_user"?new he.RejectedByUser:new Error("Unreachable")}},wallet:{ethProvider:vt}};typeof document<"u"&&document.addEventListener("FarcasterFrameEvent",t=>{if(t instanceof MessageEvent){let e=t.data;e.event==="primary_button_clicked"?I.emit("primaryButtonClicked"):e.event==="frame_added"?I.emit("frameAdded",{notificationDetails:e.notificationDetails}):e.event==="frame_add_rejected"?I.emit("frameAddRejected",{reason:e.reason}):e.event==="frame_removed"?I.emit("frameRemoved"):e.event==="notifications_enabled"?I.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"&&I.emit("notificationsDisabled")}});typeof window<"u"&&window.addEventListener("message",t=>{if(t instanceof MessageEvent&&t.data.type==="frameEvent"){let e=t.data.event;e.event==="primary_button_clicked"?I.emit("primaryButtonClicked"):e.event==="frame_added"?I.emit("frameAdded",{notificationDetails:e.notificationDetails}):e.event==="frame_add_rejected"?I.emit("frameAddRejected",{reason:e.reason}):e.event==="frame_removed"?I.emit("frameRemoved"):e.event==="notifications_enabled"?I.emit("notificationsEnabled",{notificationDetails:e.notificationDetails}):e.event==="notifications_disabled"&&I.emit("notificationsDisabled")}});var ms=At;return Pr(ps);})();
3
3
  /*! Bundled license information:
4
4
 
5
5
  comlink/dist/esm/comlink.mjs: