sliccy 1.24.2 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node-server/index.js +5 -1
- package/dist/ui/assets/{___vite-browser-external_commonjs-proxy-BrXJLmR5.js → ___vite-browser-external_commonjs-proxy-CHwSqyaL.js} +1 -1
- package/dist/ui/assets/{anthropic-Co5yczSF.js → anthropic-D8zI8Nff.js} +1 -1
- package/dist/ui/assets/{azure-openai-responses-BmhLV3xP.js → azure-openai-responses-Cn4_jzZn.js} +1 -1
- package/dist/ui/assets/{bsh-watchdog-EvXUkmgJ.js → bsh-watchdog-Xz_nMzv3.js} +1 -1
- package/dist/ui/assets/{google-C4s9ConA.js → google--oqRhLvu.js} +1 -1
- package/dist/ui/assets/{google-gemini-cli-jlzqmHjU.js → google-gemini-cli-B6mB4wL_.js} +1 -1
- package/dist/ui/assets/{google-shared-C2u8GljL.js → google-shared-r_CAb7zy.js} +1 -1
- package/dist/ui/assets/{google-vertex-CzELRrnV.js → google-vertex-CKlcmQCp.js} +1 -1
- package/dist/ui/assets/{index-BcaUwaS0.js → index-BFFYFi3J.js} +1 -1
- package/dist/ui/assets/{index-CoWLq2e5.js → index-CIrAhfog.js} +1 -1
- package/dist/ui/assets/{index-C806HqzC.js → index-CeFIcjS_.js} +1 -1
- package/dist/ui/assets/{index-moXwjkel.js → index-DM18cGzV.js} +1 -1
- package/dist/ui/assets/{index-9S0E3bQQ.js → index-W9ryXG_v.js} +1082 -1075
- package/dist/ui/assets/{json-parse-BPYifSYg.js → json-parse-DYeOImVX.js} +1 -1
- package/dist/ui/assets/{mistral-B2p6u0e_.js → mistral-Bs98_Nne.js} +1 -1
- package/dist/ui/assets/{offscreen-client-3_Ih46w9.js → offscreen-client-Dn63QmN9.js} +1 -1
- package/dist/ui/assets/{openai-codex-responses-D07wKmVX.js → openai-codex-responses-2iZbtSiB.js} +1 -1
- package/dist/ui/assets/{openai-completions-BNodmqJk.js → openai-completions-CbVbaGxp.js} +1 -1
- package/dist/ui/assets/{openai-responses-OdVdJrop.js → openai-responses-3q4QP6Y1.js} +1 -1
- package/dist/ui/assets/{openai-responses-shared-BPHlF6pD.js → openai-responses-shared-Ce1dVnHc.js} +1 -1
- package/dist/ui/assets/pyodide-CZ-fFl8u.js +3 -0
- package/dist/ui/assets/{sql-wasm-DwRqTar6.js → sql-wasm-HmbifZVM.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/ui/packages/webapp/index.html +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as t}from"./index-
|
|
1
|
+
import{e as t}from"./index-W9ryXG_v.js";function u(r){if(!r||r.trim()==="")return{};try{return JSON.parse(r)}catch{try{return t.parse(r)??{}}catch{return{}}}}export{u as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as WO,g as dv,t as QO,b as YO,d as xO,a as kO}from"./index-9S0E3bQQ.js";import{s as eS}from"./hash-DMDecQcg.js";import{p as Hl}from"./json-parse-BPYifSYg.js";import{s as cu}from"./sanitize-unicode-cmozpu7l.js";var we={},xc={},Tc={},Gl;function $(){if(Gl)return Tc;Gl=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.pathToFunc=v;const o=Object.prototype.hasOwnProperty;function v(b,g){const r=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(p={}){return b.replace(r,function(u,a){if(!o.call(p,a))throw new Error(`Parameter '${a}' is required`);const n=p[a];if(typeof n!="string"&&typeof n!="number")throw new Error(`Parameter '${a}' must be a string or number`);return g?.charEncoding==="percent"?encodeURIComponent(`${n}`):`${n}`})}}return Tc}var $l;function il(){return $l||($l=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.SDK_METADATA=o.ServerList=o.ServerEu=void 0,o.serverURLFromOptions=b;const v=$();o.ServerEu="eu",o.ServerList={[o.ServerEu]:"https://api.mistral.ai"};function b(g){let r=g.serverURL;const m={};if(!r){const u=g.server??o.ServerEu;r=o.ServerList[u]||""}const p=(0,v.pathToFunc)(r)(m);return new URL(p)}o.SDK_METADATA={language:"typescript",openapiDocVersion:"1.0.0",sdkVersion:"1.14.1",genVersion:"2.797.1",userAgent:"speakeasy-sdk/typescript 1.14.1 2.797.1 1.0.0 @mistralai/mistralai"}})(xc)),xc}var ss={},Wl;function yc(){if(Wl)return ss;Wl=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.readableStreamToArrayBuffer=o,ss.getContentTypeFromFileName=v;async function o(b){const g=b.getReader(),r=[];let m=0,p=!1;for(;!p;){const{value:n,done:e}=await g.read();e?p=!0:(r.push(n),m+=n.length)}const u=new Uint8Array(m);let a=0;for(const n of r)u.set(n,a),a+=n.length;return u.buffer}function v(b){if(!b)return null;const g=b.toLowerCase().split(".").pop();return g&&{json:"application/json",xml:"application/xml",html:"text/html",htm:"text/html",txt:"text/plain",csv:"text/csv",pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",js:"application/javascript",css:"text/css",zip:"application/zip",tar:"application/x-tar",gz:"application/gzip",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",webp:"image/webp",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf"}[g]||null}return ss}var Te={},Ql;function Fc(){if(Ql)return Te;Ql=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.HTTPClient=void 0,Te.matchContentType=g,Te.matchStatusCode=m,Te.matchResponse=p,Te.isConnectionError=u,Te.isTimeoutError=a,Te.isAbortError=n;const o=(e,t)=>t==null?fetch(e):fetch(e,t);class v{constructor(t={}){this.options=t,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=t.fetcher||o}async request(t){let i=t;for(const s of this.requestHooks){const f=await s(i);f&&(i=f)}try{const s=await this.fetcher(i);for(const f of this.responseHooks)await f(s,i);return s}catch(s){for(const f of this.requestErrorHooks)await f(s,i);throw s}}addHook(...t){if(t[0]==="beforeRequest")this.requestHooks.push(t[1]);else if(t[0]==="requestError")this.requestErrorHooks.push(t[1]);else if(t[0]==="response")this.responseHooks.push(t[1]);else throw new Error(`Invalid hook type: ${t[0]}`);return this}removeHook(...t){let i;if(t[0]==="beforeRequest")i=this.requestHooks;else if(t[0]==="requestError")i=this.requestErrorHooks;else if(t[0]==="response")i=this.responseHooks;else throw new Error(`Invalid hook type: ${t[0]}`);const s=i.findIndex(f=>f===t[1]);return s>=0&&i.splice(s,1),this}clone(){const t=new v(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}}Te.HTTPClient=v;const b=/\s*;\s*/g;function g(e,t){if(t==="*")return!0;let i=e.headers.get("content-type")?.trim()||"application/octet-stream";i=i.toLowerCase();const s=t.toLowerCase().trim().split(b),[f="",...c]=s;if(f.split("/").length!==2)return!1;const l=i.split(b),[d="",..._]=l,[y="",h=""]=d.split("/");if(!y||!h||f!=="*/*"&&d!==f&&`${y}/*`!==f&&`*/${h}`!==f||_.length<c.length)return!1;const j=new Set(_);for(const M of c)if(!j.has(M))return!1;return!0}const r=new RegExp("^[0-9]xx$","i");function m(e,t){const i=`${e.status}`,s=Array.isArray(t)?t:[t];return s.length?s.some(f=>{const c=`${f}`;if(c==="default")return!0;if(!r.test(`${c}`))return c===i;const l=c.charAt(0);if(!l)throw new Error("Invalid status code range");const d=i.charAt(0);if(!d)throw new Error(`Invalid response status code: ${i}`);return d===l}):!1}function p(e,t,i){return m(e,t)&&g(e,i)}function u(e){if(typeof e!="object"||e==null)return!1;const t=e instanceof TypeError&&e.message.toLowerCase().startsWith("failed to fetch"),i=e instanceof TypeError&&e.message.toLowerCase().startsWith("fetch failed"),s="name"in e&&e.name==="ConnectionError",f="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnreset";return t||i||f||s}function a(e){if(typeof e!="object"||e==null)return!1;const t="name"in e&&e.name==="TimeoutError",i="code"in e&&e.code===23,s="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnaborted";return t||i||s}function n(e){if(typeof e!="object"||e==null)return!1;const t="name"in e&&e.name==="AbortError",i="code"in e&&e.code===20,s="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnaborted";return t||i||s}return Te}var cs={},un={},ls={},qc={},fs={},Yl;function tS(){if(Yl)return fs;Yl=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.CustomUserAgentHook=void 0;const o=il();class v{beforeRequest(g,r){const p=`mistral-client-typescript/${o.SDK_METADATA.sdkVersion}`;return r.headers.set("user-agent",p),r.headers.get("user-agent")||r.headers.set("x-mistral-user-agent",p),r}}return fs.CustomUserAgentHook=v,fs}var ds={},xl;function nS(){if(xl)return ds;xl=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.DeprecationWarningHook=void 0;const o="x-model-deprecation-timestamp";class v{afterSuccess(g,r){return r.headers.has(o)&&r.clone().json().then(m=>{const p=m.model;console.warn(`WARNING: The model ${p} is deprecated and will be removed on ${r.headers.get(o)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),r}}return ds.DeprecationWarningHook=v,ds}var kl;function rS(){if(kl)return qc;kl=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.initHooks=b;const o=tS(),v=nS();function b(g){const r=new o.CustomUserAgentHook;g.registerBeforeRequestHook(r);const m=new v.DeprecationWarningHook;g.registerAfterSuccessHook(m)}return qc}var ef;function aS(){if(ef)return ls;ef=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.SDKHooks=void 0;const o=rS();class v{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];const g=[];for(const r of g)"sdkInit"in r&&this.registerSDKInitHook(r),"beforeCreateRequest"in r&&this.registerBeforeCreateRequestHook(r),"beforeRequest"in r&&this.registerBeforeRequestHook(r),"afterSuccess"in r&&this.registerAfterSuccessHook(r),"afterError"in r&&this.registerAfterErrorHook(r);(0,o.initHooks)(this)}registerSDKInitHook(g){this.sdkInitHooks.push(g)}registerBeforeCreateRequestHook(g){this.beforeCreateRequestHooks.push(g)}registerBeforeRequestHook(g){this.beforeRequestHooks.push(g)}registerAfterSuccessHook(g){this.afterSuccessHooks.push(g)}registerAfterErrorHook(g){this.afterErrorHooks.push(g)}sdkInit(g){return this.sdkInitHooks.reduce((r,m)=>m.sdkInit(r),g)}beforeCreateRequest(g,r){let m=r;for(const p of this.beforeCreateRequestHooks)m=p.beforeCreateRequest(g,m);return m}async beforeRequest(g,r){let m=r;for(const p of this.beforeRequestHooks)m=await p.beforeRequest(g,m);return m}async afterSuccess(g,r){let m=r;for(const p of this.afterSuccessHooks)m=await p.afterSuccess(g,m);return m}async afterError(g,r,m){let p=r,u=m;for(const a of this.afterErrorHooks){const n=await a.afterError(g,p,u);p=n.response,u=n.error}return{response:p,error:u}}}return ls.SDKHooks=v,ls}var me={},tf;function _v(){if(tf)return me;tf=1,Object.defineProperty(me,"__esModule",{value:!0}),me.ConnectionError=me.RequestTimeoutError=me.RequestAbortedError=me.InvalidRequestError=me.UnexpectedClientError=me.HTTPClientError=void 0;class o extends Error{constructor(u,a){let n=u;a?.cause&&(n+=`: ${a.cause}`),super(n,a),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=a?.cause)}}me.HTTPClientError=o;class v extends o{constructor(){super(...arguments),this.name="UnexpectedClientError"}}me.UnexpectedClientError=v;class b extends o{constructor(){super(...arguments),this.name="InvalidRequestError"}}me.InvalidRequestError=b;class g extends o{constructor(){super(...arguments),this.name="RequestAbortedError"}}me.RequestAbortedError=g;class r extends o{constructor(){super(...arguments),this.name="RequestTimeoutError"}}me.RequestTimeoutError=r;class m extends o{constructor(){super(...arguments),this.name="ConnectionError"}}return me.ConnectionError=m,me}var yu={},nf;function _e(){if(nf)return yu;nf=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.OK=o,yu.ERR=v,yu.unwrap=b,yu.unwrapAsync=g;function o(r){return{ok:!0,value:r}}function v(r){return{ok:!1,error:r}}function b(r){if(!r.ok)throw r.error;return r.value}async function g(r){const m=await r;if(!m.ok)throw m.error;return m.value}return yu}var de={},qe={},vu={},sn={},Dc={exports:{}},cn={},kc={},rf;function Ic(){return rf||(rf=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.getParsedType=o.ZodParsedType=o.objectUtil=o.util=void 0;var v;(function(r){r.assertEqual=a=>{};function m(a){}r.assertIs=m;function p(a){throw new Error}r.assertNever=p,r.arrayToEnum=a=>{const n={};for(const e of a)n[e]=e;return n},r.getValidEnumValues=a=>{const n=r.objectKeys(a).filter(t=>typeof a[a[t]]!="number"),e={};for(const t of n)e[t]=a[t];return r.objectValues(e)},r.objectValues=a=>r.objectKeys(a).map(function(n){return a[n]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const e in a)Object.prototype.hasOwnProperty.call(a,e)&&n.push(e);return n},r.find=(a,n)=>{for(const e of a)if(n(e))return e},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function u(a,n=" | "){return a.map(e=>typeof e=="string"?`'${e}'`:e).join(n)}r.joinValues=u,r.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(o.util=v={}));var b;(function(r){r.mergeShapes=(m,p)=>({...m,...p})})(b||(o.objectUtil=b={})),o.ZodParsedType=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const g=r=>{switch(typeof r){case"undefined":return o.ZodParsedType.undefined;case"string":return o.ZodParsedType.string;case"number":return Number.isNaN(r)?o.ZodParsedType.nan:o.ZodParsedType.number;case"boolean":return o.ZodParsedType.boolean;case"function":return o.ZodParsedType.function;case"bigint":return o.ZodParsedType.bigint;case"symbol":return o.ZodParsedType.symbol;case"object":return Array.isArray(r)?o.ZodParsedType.array:r===null?o.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?o.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?o.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?o.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?o.ZodParsedType.date:o.ZodParsedType.object;default:return o.ZodParsedType.unknown}};o.getParsedType=g})(kc)),kc}var af;function ul(){if(af)return cn;af=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.ZodError=cn.quotelessJson=cn.ZodIssueCode=void 0;const o=Ic();cn.ZodIssueCode=o.util.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"]);const v=g=>JSON.stringify(g,null,2).replace(/"([^"]+)":/g,"$1:");cn.quotelessJson=v;let b=class pv extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};const m=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,m):this.__proto__=m,this.name="ZodError",this.issues=r}format(r){const m=r||function(a){return a.message},p={_errors:[]},u=a=>{for(const n of a.issues)if(n.code==="invalid_union")n.unionErrors.map(u);else if(n.code==="invalid_return_type")u(n.returnTypeError);else if(n.code==="invalid_arguments")u(n.argumentsError);else if(n.path.length===0)p._errors.push(m(n));else{let e=p,t=0;for(;t<n.path.length;){const i=n.path[t];t===n.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(m(n))):e[i]=e[i]||{_errors:[]},e=e[i],t++}}};return u(this),p}static assert(r){if(!(r instanceof pv))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=m=>m.message){const m=Object.create(null),p=[];for(const u of this.issues)if(u.path.length>0){const a=u.path[0];m[a]=m[a]||[],m[a].push(r(u))}else p.push(r(u));return{formErrors:p,fieldErrors:m}}get formErrors(){return this.flatten()}};return cn.ZodError=b,b.create=g=>new b(g),cn}var of;function bv(){return of||(of=1,(function(o,v){Object.defineProperty(v,"__esModule",{value:!0});const b=ul(),g=Ic(),r=(m,p)=>{let u;switch(m.code){case b.ZodIssueCode.invalid_type:m.received===g.ZodParsedType.undefined?u="Required":u=`Expected ${m.expected}, received ${m.received}`;break;case b.ZodIssueCode.invalid_literal:u=`Invalid literal value, expected ${JSON.stringify(m.expected,g.util.jsonStringifyReplacer)}`;break;case b.ZodIssueCode.unrecognized_keys:u=`Unrecognized key(s) in object: ${g.util.joinValues(m.keys,", ")}`;break;case b.ZodIssueCode.invalid_union:u="Invalid input";break;case b.ZodIssueCode.invalid_union_discriminator:u=`Invalid discriminator value. Expected ${g.util.joinValues(m.options)}`;break;case b.ZodIssueCode.invalid_enum_value:u=`Invalid enum value. Expected ${g.util.joinValues(m.options)}, received '${m.received}'`;break;case b.ZodIssueCode.invalid_arguments:u="Invalid function arguments";break;case b.ZodIssueCode.invalid_return_type:u="Invalid function return type";break;case b.ZodIssueCode.invalid_date:u="Invalid date";break;case b.ZodIssueCode.invalid_string:typeof m.validation=="object"?"includes"in m.validation?(u=`Invalid input: must include "${m.validation.includes}"`,typeof m.validation.position=="number"&&(u=`${u} at one or more positions greater than or equal to ${m.validation.position}`)):"startsWith"in m.validation?u=`Invalid input: must start with "${m.validation.startsWith}"`:"endsWith"in m.validation?u=`Invalid input: must end with "${m.validation.endsWith}"`:g.util.assertNever(m.validation):m.validation!=="regex"?u=`Invalid ${m.validation}`:u="Invalid";break;case b.ZodIssueCode.too_small:m.type==="array"?u=`Array must contain ${m.exact?"exactly":m.inclusive?"at least":"more than"} ${m.minimum} element(s)`:m.type==="string"?u=`String must contain ${m.exact?"exactly":m.inclusive?"at least":"over"} ${m.minimum} character(s)`:m.type==="number"?u=`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:m.type==="bigint"?u=`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:m.type==="date"?u=`Date must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(m.minimum))}`:u="Invalid input";break;case b.ZodIssueCode.too_big:m.type==="array"?u=`Array must contain ${m.exact?"exactly":m.inclusive?"at most":"less than"} ${m.maximum} element(s)`:m.type==="string"?u=`String must contain ${m.exact?"exactly":m.inclusive?"at most":"under"} ${m.maximum} character(s)`:m.type==="number"?u=`Number must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:m.type==="bigint"?u=`BigInt must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:m.type==="date"?u=`Date must be ${m.exact?"exactly":m.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(m.maximum))}`:u="Invalid input";break;case b.ZodIssueCode.custom:u="Invalid input";break;case b.ZodIssueCode.invalid_intersection_types:u="Intersection results could not be merged";break;case b.ZodIssueCode.not_multiple_of:u=`Number must be a multiple of ${m.multipleOf}`;break;case b.ZodIssueCode.not_finite:u="Number must be finite";break;default:u=p.defaultError,g.util.assertNever(m)}return{message:u}};v.default=r,o.exports=v.default})(Dc,Dc.exports)),Dc.exports}var uf;function sl(){if(uf)return sn;uf=1;var o=sn&&sn.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.defaultErrorMap=void 0,sn.setErrorMap=g,sn.getErrorMap=r;const v=o(bv());sn.defaultErrorMap=v.default;let b=v.default;function g(m){b=m}function r(){return b}return sn}var _s={},sf;function mv(){return sf||(sf=1,(function(o){var v=_s&&_s.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(o,"__esModule",{value:!0}),o.isAsync=o.isValid=o.isDirty=o.isAborted=o.OK=o.DIRTY=o.INVALID=o.ParseStatus=o.EMPTY_PATH=o.makeIssue=void 0,o.addIssueToContext=m;const b=sl(),g=v(bv()),r=s=>{const{data:f,path:c,errorMaps:l,issueData:d}=s,_=[...c,...d.path||[]],y={...d,path:_};if(d.message!==void 0)return{...d,path:_,message:d.message};let h="";const j=l.filter(M=>!!M).slice().reverse();for(const M of j)h=M(y,{data:f,defaultError:h}).message;return{...d,path:_,message:h}};o.makeIssue=r,o.EMPTY_PATH=[];function m(s,f){const c=(0,b.getErrorMap)(),l=(0,o.makeIssue)({issueData:f,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,c,c===g.default?void 0:g.default].filter(d=>!!d)});s.common.issues.push(l)}class p{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(f,c){const l=[];for(const d of c){if(d.status==="aborted")return o.INVALID;d.status==="dirty"&&f.dirty(),l.push(d.value)}return{status:f.value,value:l}}static async mergeObjectAsync(f,c){const l=[];for(const d of c){const _=await d.key,y=await d.value;l.push({key:_,value:y})}return p.mergeObjectSync(f,l)}static mergeObjectSync(f,c){const l={};for(const d of c){const{key:_,value:y}=d;if(_.status==="aborted"||y.status==="aborted")return o.INVALID;_.status==="dirty"&&f.dirty(),y.status==="dirty"&&f.dirty(),_.value!=="__proto__"&&(typeof y.value<"u"||d.alwaysSet)&&(l[_.value]=y.value)}return{status:f.value,value:l}}}o.ParseStatus=p,o.INVALID=Object.freeze({status:"aborted"});const u=s=>({status:"dirty",value:s});o.DIRTY=u;const a=s=>({status:"valid",value:s});o.OK=a;const n=s=>s.status==="aborted";o.isAborted=n;const e=s=>s.status==="dirty";o.isDirty=e;const t=s=>s.status==="valid";o.isValid=t;const i=s=>typeof Promise<"u"&&s instanceof Promise;o.isAsync=i})(_s)),_s}var el={},cf;function oS(){return cf||(cf=1,Object.defineProperty(el,"__esModule",{value:!0})),el}var X={},ps={},lf;function iS(){if(lf)return ps;lf=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.errorUtil=void 0;var o;return(function(v){v.errToObj=b=>typeof b=="string"?{message:b}:b||{},v.toString=b=>typeof b=="string"?b:b?.message})(o||(ps.errorUtil=o={})),ps}var ff;function uS(){if(ff)return X;ff=1,Object.defineProperty(X,"__esModule",{value:!0}),X.discriminatedUnion=X.date=X.boolean=X.bigint=X.array=X.any=X.coerce=X.ZodFirstPartyTypeKind=X.late=X.ZodSchema=X.Schema=X.ZodReadonly=X.ZodPipeline=X.ZodBranded=X.BRAND=X.ZodNaN=X.ZodCatch=X.ZodDefault=X.ZodNullable=X.ZodOptional=X.ZodTransformer=X.ZodEffects=X.ZodPromise=X.ZodNativeEnum=X.ZodEnum=X.ZodLiteral=X.ZodLazy=X.ZodFunction=X.ZodSet=X.ZodMap=X.ZodRecord=X.ZodTuple=X.ZodIntersection=X.ZodDiscriminatedUnion=X.ZodUnion=X.ZodObject=X.ZodArray=X.ZodVoid=X.ZodNever=X.ZodUnknown=X.ZodAny=X.ZodNull=X.ZodUndefined=X.ZodSymbol=X.ZodDate=X.ZodBoolean=X.ZodBigInt=X.ZodNumber=X.ZodString=X.ZodType=void 0,X.NEVER=X.void=X.unknown=X.union=X.undefined=X.tuple=X.transformer=X.symbol=X.string=X.strictObject=X.set=X.record=X.promise=X.preprocess=X.pipeline=X.ostring=X.optional=X.onumber=X.oboolean=X.object=X.number=X.nullable=X.null=X.never=X.nativeEnum=X.nan=X.map=X.literal=X.lazy=X.intersection=X.instanceof=X.function=X.enum=X.effect=void 0,X.datetimeRegex=P,X.custom=Ul;const o=ul(),v=sl(),b=iS(),g=mv(),r=Ic();class m{constructor(O,R,J,L){this._cachedPath=[],this.parent=O,this.data=R,this._path=J,this._key=L}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(E,O)=>{if((0,g.isValid)(O))return{success:!0,data:O.value};if(!E.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const R=new o.ZodError(E.common.issues);return this._error=R,this._error}}};function u(E){if(!E)return{};const{errorMap:O,invalid_type_error:R,required_error:J,description:L}=E;if(O&&(R||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return O?{errorMap:O,description:L}:{errorMap:(H,z)=>{const{message:ee}=E;return H.code==="invalid_enum_value"?{message:ee??z.defaultError}:typeof z.data>"u"?{message:ee??J??z.defaultError}:H.code!=="invalid_type"?{message:z.defaultError}:{message:ee??R??z.defaultError}},description:L}}class a{get description(){return this._def.description}_getType(O){return(0,r.getParsedType)(O.data)}_getOrReturnCtx(O,R){return R||{common:O.parent.common,data:O.data,parsedType:(0,r.getParsedType)(O.data),schemaErrorMap:this._def.errorMap,path:O.path,parent:O.parent}}_processInputParams(O){return{status:new g.ParseStatus,ctx:{common:O.parent.common,data:O.data,parsedType:(0,r.getParsedType)(O.data),schemaErrorMap:this._def.errorMap,path:O.path,parent:O.parent}}}_parseSync(O){const R=this._parse(O);if((0,g.isAsync)(R))throw new Error("Synchronous parse encountered promise.");return R}_parseAsync(O){const R=this._parse(O);return Promise.resolve(R)}parse(O,R){const J=this.safeParse(O,R);if(J.success)return J.data;throw J.error}safeParse(O,R){const J={common:{issues:[],async:R?.async??!1,contextualErrorMap:R?.errorMap},path:R?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)},L=this._parseSync({data:O,path:J.path,parent:J});return p(J,L)}"~validate"(O){const R={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)};if(!this["~standard"].async)try{const J=this._parseSync({data:O,path:[],parent:R});return(0,g.isValid)(J)?{value:J.value}:{issues:R.common.issues}}catch(J){J?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),R.common={issues:[],async:!0}}return this._parseAsync({data:O,path:[],parent:R}).then(J=>(0,g.isValid)(J)?{value:J.value}:{issues:R.common.issues})}async parseAsync(O,R){const J=await this.safeParseAsync(O,R);if(J.success)return J.data;throw J.error}async safeParseAsync(O,R){const J={common:{issues:[],contextualErrorMap:R?.errorMap,async:!0},path:R?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)},L=this._parse({data:O,path:J.path,parent:J}),U=await((0,g.isAsync)(L)?L:Promise.resolve(L));return p(J,U)}refine(O,R){const J=L=>typeof R=="string"||typeof R>"u"?{message:R}:typeof R=="function"?R(L):R;return this._refinement((L,U)=>{const H=O(L),z=()=>U.addIssue({code:o.ZodIssueCode.custom,...J(L)});return typeof Promise<"u"&&H instanceof Promise?H.then(ee=>ee?!0:(z(),!1)):H?!0:(z(),!1)})}refinement(O,R){return this._refinement((J,L)=>O(J)?!0:(L.addIssue(typeof R=="function"?R(J,L):R),!1))}_refinement(O){return new Re({schema:this,typeName:oe.ZodEffects,effect:{type:"refinement",refinement:O}})}superRefine(O){return this._refinement(O)}constructor(O){this.spa=this.safeParseAsync,this._def=O,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 Ie.create(this,this._def)}nullable(){return du.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ge.create(this)}promise(){return Xu.create(this,this._def)}or(O){return xu.create([this,O],this._def)}and(O){return ku.create(this,O,this._def)}transform(O){return new Re({...u(this._def),schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:O}})}default(O){const R=typeof O=="function"?O:()=>O;return new as({...u(this._def),innerType:this,defaultValue:R,typeName:oe.ZodDefault})}brand(){return new Qc({typeName:oe.ZodBranded,type:this,...u(this._def)})}catch(O){const R=typeof O=="function"?O:()=>O;return new os({...u(this._def),innerType:this,catchValue:R,typeName:oe.ZodCatch})}describe(O){const R=this.constructor;return new R({...this._def,description:O})}pipe(O){return is.create(this,O)}readonly(){return us.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}X.ZodType=a,X.Schema=a,X.ZodSchema=a;const n=/^c[^\s-]{8,}$/i,e=/^[0-9a-z]+$/,t=/^[0-9A-HJKMNP-TV-Z]{26}$/i,i=/^[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,s=/^[a-z0-9_-]{21}$/i,f=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,c=/^[-+]?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)?)??$/,l=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _;const y=/^(?:(?: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])$/,h=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,M=/^(([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])$/,T=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,A=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,N="((\\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])))",D=new RegExp(`^${N}$`);function S(E){let O="[0-5]\\d";E.precision?O=`${O}\\.\\d{${E.precision}}`:E.precision==null&&(O=`${O}(\\.\\d+)?`);const R=E.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${O})${R}`}function C(E){return new RegExp(`^${S(E)}$`)}function P(E){let O=`${N}T${S(E)}`;const R=[];return R.push(E.local?"Z?":"Z"),E.offset&&R.push("([+-]\\d{2}:?\\d{2})"),O=`${O}(${R.join("|")})`,new RegExp(`^${O}$`)}function w(E,O){return!!((O==="v4"||!O)&&y.test(E)||(O==="v6"||!O)&&j.test(E))}function q(E,O){if(!f.test(E))return!1;try{const[R]=E.split(".");if(!R)return!1;const J=R.replace(/-/g,"+").replace(/_/g,"/").padEnd(R.length+(4-R.length%4)%4,"="),L=JSON.parse(atob(J));return!(typeof L!="object"||L===null||"typ"in L&&L?.typ!=="JWT"||!L.alg||O&&L.alg!==O)}catch{return!1}}function B(E,O){return!!((O==="v4"||!O)&&h.test(E)||(O==="v6"||!O)&&M.test(E))}class V extends a{_parse(O){if(this._def.coerce&&(O.data=String(O.data)),this._getType(O)!==r.ZodParsedType.string){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:U.parsedType}),g.INVALID}const J=new g.ParseStatus;let L;for(const U of this._def.checks)if(U.kind==="min")O.data.length<U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"string",inclusive:!0,exact:!1,message:U.message}),J.dirty());else if(U.kind==="max")O.data.length>U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"string",inclusive:!0,exact:!1,message:U.message}),J.dirty());else if(U.kind==="length"){const H=O.data.length>U.value,z=O.data.length<U.value;(H||z)&&(L=this._getOrReturnCtx(O,L),H?(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"string",inclusive:!0,exact:!0,message:U.message}):z&&(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"string",inclusive:!0,exact:!0,message:U.message}),J.dirty())}else if(U.kind==="email")l.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"email",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="emoji")_||(_=new RegExp(d,"u")),_.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"emoji",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="uuid")i.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"uuid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="nanoid")s.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"nanoid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="cuid")n.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cuid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="cuid2")e.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cuid2",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="ulid")t.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"ulid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="url")try{new URL(O.data)}catch{L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"url",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()}else U.kind==="regex"?(U.regex.lastIndex=0,U.regex.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"regex",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty())):U.kind==="trim"?O.data=O.data.trim():U.kind==="includes"?O.data.includes(U.value,U.position)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{includes:U.value,position:U.position},message:U.message}),J.dirty()):U.kind==="toLowerCase"?O.data=O.data.toLowerCase():U.kind==="toUpperCase"?O.data=O.data.toUpperCase():U.kind==="startsWith"?O.data.startsWith(U.value)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{startsWith:U.value},message:U.message}),J.dirty()):U.kind==="endsWith"?O.data.endsWith(U.value)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{endsWith:U.value},message:U.message}),J.dirty()):U.kind==="datetime"?P(U).test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"datetime",message:U.message}),J.dirty()):U.kind==="date"?D.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"date",message:U.message}),J.dirty()):U.kind==="time"?C(U).test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"time",message:U.message}),J.dirty()):U.kind==="duration"?c.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"duration",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="ip"?w(O.data,U.version)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"ip",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="jwt"?q(O.data,U.alg)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"jwt",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="cidr"?B(O.data,U.version)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cidr",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="base64"?T.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"base64",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="base64url"?A.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"base64url",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):r.util.assertNever(U);return{status:J.value,value:O.data}}_regex(O,R,J){return this.refinement(L=>O.test(L),{validation:R,code:o.ZodIssueCode.invalid_string,...b.errorUtil.errToObj(J)})}_addCheck(O){return new V({...this._def,checks:[...this._def.checks,O]})}email(O){return this._addCheck({kind:"email",...b.errorUtil.errToObj(O)})}url(O){return this._addCheck({kind:"url",...b.errorUtil.errToObj(O)})}emoji(O){return this._addCheck({kind:"emoji",...b.errorUtil.errToObj(O)})}uuid(O){return this._addCheck({kind:"uuid",...b.errorUtil.errToObj(O)})}nanoid(O){return this._addCheck({kind:"nanoid",...b.errorUtil.errToObj(O)})}cuid(O){return this._addCheck({kind:"cuid",...b.errorUtil.errToObj(O)})}cuid2(O){return this._addCheck({kind:"cuid2",...b.errorUtil.errToObj(O)})}ulid(O){return this._addCheck({kind:"ulid",...b.errorUtil.errToObj(O)})}base64(O){return this._addCheck({kind:"base64",...b.errorUtil.errToObj(O)})}base64url(O){return this._addCheck({kind:"base64url",...b.errorUtil.errToObj(O)})}jwt(O){return this._addCheck({kind:"jwt",...b.errorUtil.errToObj(O)})}ip(O){return this._addCheck({kind:"ip",...b.errorUtil.errToObj(O)})}cidr(O){return this._addCheck({kind:"cidr",...b.errorUtil.errToObj(O)})}datetime(O){return typeof O=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:O}):this._addCheck({kind:"datetime",precision:typeof O?.precision>"u"?null:O?.precision,offset:O?.offset??!1,local:O?.local??!1,...b.errorUtil.errToObj(O?.message)})}date(O){return this._addCheck({kind:"date",message:O})}time(O){return typeof O=="string"?this._addCheck({kind:"time",precision:null,message:O}):this._addCheck({kind:"time",precision:typeof O?.precision>"u"?null:O?.precision,...b.errorUtil.errToObj(O?.message)})}duration(O){return this._addCheck({kind:"duration",...b.errorUtil.errToObj(O)})}regex(O,R){return this._addCheck({kind:"regex",regex:O,...b.errorUtil.errToObj(R)})}includes(O,R){return this._addCheck({kind:"includes",value:O,position:R?.position,...b.errorUtil.errToObj(R?.message)})}startsWith(O,R){return this._addCheck({kind:"startsWith",value:O,...b.errorUtil.errToObj(R)})}endsWith(O,R){return this._addCheck({kind:"endsWith",value:O,...b.errorUtil.errToObj(R)})}min(O,R){return this._addCheck({kind:"min",value:O,...b.errorUtil.errToObj(R)})}max(O,R){return this._addCheck({kind:"max",value:O,...b.errorUtil.errToObj(R)})}length(O,R){return this._addCheck({kind:"length",value:O,...b.errorUtil.errToObj(R)})}nonempty(O){return this.min(1,b.errorUtil.errToObj(O))}trim(){return new V({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(O=>O.kind==="datetime")}get isDate(){return!!this._def.checks.find(O=>O.kind==="date")}get isTime(){return!!this._def.checks.find(O=>O.kind==="time")}get isDuration(){return!!this._def.checks.find(O=>O.kind==="duration")}get isEmail(){return!!this._def.checks.find(O=>O.kind==="email")}get isURL(){return!!this._def.checks.find(O=>O.kind==="url")}get isEmoji(){return!!this._def.checks.find(O=>O.kind==="emoji")}get isUUID(){return!!this._def.checks.find(O=>O.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(O=>O.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(O=>O.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(O=>O.kind==="cuid2")}get isULID(){return!!this._def.checks.find(O=>O.kind==="ulid")}get isIP(){return!!this._def.checks.find(O=>O.kind==="ip")}get isCIDR(){return!!this._def.checks.find(O=>O.kind==="cidr")}get isBase64(){return!!this._def.checks.find(O=>O.kind==="base64")}get isBase64url(){return!!this._def.checks.find(O=>O.kind==="base64url")}get minLength(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxLength(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}}X.ZodString=V,V.create=E=>new V({checks:[],typeName:oe.ZodString,coerce:E?.coerce??!1,...u(E)});function Z(E,O){const R=(E.toString().split(".")[1]||"").length,J=(O.toString().split(".")[1]||"").length,L=R>J?R:J,U=Number.parseInt(E.toFixed(L).replace(".","")),H=Number.parseInt(O.toFixed(L).replace(".",""));return U%H/10**L}class k extends a{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(O){if(this._def.coerce&&(O.data=Number(O.data)),this._getType(O)!==r.ZodParsedType.number){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:U.parsedType}),g.INVALID}let J;const L=new g.ParseStatus;for(const U of this._def.checks)U.kind==="int"?r.util.isInteger(O.data)||(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:U.message}),L.dirty()):U.kind==="min"?(U.inclusive?O.data<U.value:O.data<=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"number",inclusive:U.inclusive,exact:!1,message:U.message}),L.dirty()):U.kind==="max"?(U.inclusive?O.data>U.value:O.data>=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"number",inclusive:U.inclusive,exact:!1,message:U.message}),L.dirty()):U.kind==="multipleOf"?Z(O.data,U.value)!==0&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_multiple_of,multipleOf:U.value,message:U.message}),L.dirty()):U.kind==="finite"?Number.isFinite(O.data)||(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_finite,message:U.message}),L.dirty()):r.util.assertNever(U);return{status:L.value,value:O.data}}gte(O,R){return this.setLimit("min",O,!0,b.errorUtil.toString(R))}gt(O,R){return this.setLimit("min",O,!1,b.errorUtil.toString(R))}lte(O,R){return this.setLimit("max",O,!0,b.errorUtil.toString(R))}lt(O,R){return this.setLimit("max",O,!1,b.errorUtil.toString(R))}setLimit(O,R,J,L){return new k({...this._def,checks:[...this._def.checks,{kind:O,value:R,inclusive:J,message:b.errorUtil.toString(L)}]})}_addCheck(O){return new k({...this._def,checks:[...this._def.checks,O]})}int(O){return this._addCheck({kind:"int",message:b.errorUtil.toString(O)})}positive(O){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.errorUtil.toString(O)})}negative(O){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.errorUtil.toString(O)})}nonpositive(O){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.errorUtil.toString(O)})}nonnegative(O){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.errorUtil.toString(O)})}multipleOf(O,R){return this._addCheck({kind:"multipleOf",value:O,message:b.errorUtil.toString(R)})}finite(O){return this._addCheck({kind:"finite",message:b.errorUtil.toString(O)})}safe(O){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.errorUtil.toString(O)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.errorUtil.toString(O)})}get minValue(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxValue(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}get isInt(){return!!this._def.checks.find(O=>O.kind==="int"||O.kind==="multipleOf"&&r.util.isInteger(O.value))}get isFinite(){let O=null,R=null;for(const J of this._def.checks){if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;J.kind==="min"?(R===null||J.value>R)&&(R=J.value):J.kind==="max"&&(O===null||J.value<O)&&(O=J.value)}return Number.isFinite(R)&&Number.isFinite(O)}}X.ZodNumber=k,k.create=E=>new k({checks:[],typeName:oe.ZodNumber,coerce:E?.coerce||!1,...u(E)});class ae extends a{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(O){if(this._def.coerce)try{O.data=BigInt(O.data)}catch{return this._getInvalidInput(O)}if(this._getType(O)!==r.ZodParsedType.bigint)return this._getInvalidInput(O);let J;const L=new g.ParseStatus;for(const U of this._def.checks)U.kind==="min"?(U.inclusive?O.data<U.value:O.data<=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,type:"bigint",minimum:U.value,inclusive:U.inclusive,message:U.message}),L.dirty()):U.kind==="max"?(U.inclusive?O.data>U.value:O.data>=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,type:"bigint",maximum:U.value,inclusive:U.inclusive,message:U.message}),L.dirty()):U.kind==="multipleOf"?O.data%U.value!==BigInt(0)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_multiple_of,multipleOf:U.value,message:U.message}),L.dirty()):r.util.assertNever(U);return{status:L.value,value:O.data}}_getInvalidInput(O){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:R.parsedType}),g.INVALID}gte(O,R){return this.setLimit("min",O,!0,b.errorUtil.toString(R))}gt(O,R){return this.setLimit("min",O,!1,b.errorUtil.toString(R))}lte(O,R){return this.setLimit("max",O,!0,b.errorUtil.toString(R))}lt(O,R){return this.setLimit("max",O,!1,b.errorUtil.toString(R))}setLimit(O,R,J,L){return new ae({...this._def,checks:[...this._def.checks,{kind:O,value:R,inclusive:J,message:b.errorUtil.toString(L)}]})}_addCheck(O){return new ae({...this._def,checks:[...this._def.checks,O]})}positive(O){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(O)})}negative(O){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(O)})}nonpositive(O){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(O)})}nonnegative(O){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(O)})}multipleOf(O,R){return this._addCheck({kind:"multipleOf",value:O,message:b.errorUtil.toString(R)})}get minValue(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxValue(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}}X.ZodBigInt=ae,ae.create=E=>new ae({checks:[],typeName:oe.ZodBigInt,coerce:E?.coerce??!1,...u(E)});class ue extends a{_parse(O){if(this._def.coerce&&(O.data=!!O.data),this._getType(O)!==r.ZodParsedType.boolean){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodBoolean=ue,ue.create=E=>new ue({typeName:oe.ZodBoolean,coerce:E?.coerce||!1,...u(E)});class be extends a{_parse(O){if(this._def.coerce&&(O.data=new Date(O.data)),this._getType(O)!==r.ZodParsedType.date){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:U.parsedType}),g.INVALID}if(Number.isNaN(O.data.getTime())){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_date}),g.INVALID}const J=new g.ParseStatus;let L;for(const U of this._def.checks)U.kind==="min"?O.data.getTime()<U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,message:U.message,inclusive:!0,exact:!1,minimum:U.value,type:"date"}),J.dirty()):U.kind==="max"?O.data.getTime()>U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,message:U.message,inclusive:!0,exact:!1,maximum:U.value,type:"date"}),J.dirty()):r.util.assertNever(U);return{status:J.value,value:new Date(O.data.getTime())}}_addCheck(O){return new be({...this._def,checks:[...this._def.checks,O]})}min(O,R){return this._addCheck({kind:"min",value:O.getTime(),message:b.errorUtil.toString(R)})}max(O,R){return this._addCheck({kind:"max",value:O.getTime(),message:b.errorUtil.toString(R)})}get minDate(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O!=null?new Date(O):null}get maxDate(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O!=null?new Date(O):null}}X.ZodDate=be,be.create=E=>new be({checks:[],coerce:E?.coerce||!1,typeName:oe.ZodDate,...u(E)});class lu extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.symbol){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodSymbol=lu,lu.create=E=>new lu({typeName:oe.ZodSymbol,...u(E)});class he extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.undefined){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodUndefined=he,he.create=E=>new he({typeName:oe.ZodUndefined,...u(E)});class mu extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.null){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodNull=mu,mu.create=E=>new mu({typeName:oe.ZodNull,...u(E)});class Me extends a{constructor(){super(...arguments),this._any=!0}_parse(O){return(0,g.OK)(O.data)}}X.ZodAny=Me,Me.create=E=>new Me({typeName:oe.ZodAny,...u(E)});class Ce extends a{constructor(){super(...arguments),this._unknown=!0}_parse(O){return(0,g.OK)(O.data)}}X.ZodUnknown=Ce,Ce.create=E=>new Ce({typeName:oe.ZodUnknown,...u(E)});class se extends a{_parse(O){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:R.parsedType}),g.INVALID}}X.ZodNever=se,se.create=E=>new se({typeName:oe.ZodNever,...u(E)});class Oe extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.undefined){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodVoid=Oe,Oe.create=E=>new Oe({typeName:oe.ZodVoid,...u(E)});class ge extends a{_parse(O){const{ctx:R,status:J}=this._processInputParams(O),L=this._def;if(R.parsedType!==r.ZodParsedType.array)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:R.parsedType}),g.INVALID;if(L.exactLength!==null){const H=R.data.length>L.exactLength.value,z=R.data.length<L.exactLength.value;(H||z)&&((0,g.addIssueToContext)(R,{code:H?o.ZodIssueCode.too_big:o.ZodIssueCode.too_small,minimum:z?L.exactLength.value:void 0,maximum:H?L.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:L.exactLength.message}),J.dirty())}if(L.minLength!==null&&R.data.length<L.minLength.value&&((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.too_small,minimum:L.minLength.value,type:"array",inclusive:!0,exact:!1,message:L.minLength.message}),J.dirty()),L.maxLength!==null&&R.data.length>L.maxLength.value&&((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),J.dirty()),R.common.async)return Promise.all([...R.data].map((H,z)=>L.type._parseAsync(new m(R,H,R.path,z)))).then(H=>g.ParseStatus.mergeArray(J,H));const U=[...R.data].map((H,z)=>L.type._parseSync(new m(R,H,R.path,z)));return g.ParseStatus.mergeArray(J,U)}get element(){return this._def.type}min(O,R){return new ge({...this._def,minLength:{value:O,message:b.errorUtil.toString(R)}})}max(O,R){return new ge({...this._def,maxLength:{value:O,message:b.errorUtil.toString(R)}})}length(O,R){return new ge({...this._def,exactLength:{value:O,message:b.errorUtil.toString(R)}})}nonempty(O){return this.min(1,O)}}X.ZodArray=ge,ge.create=(E,O)=>new ge({type:E,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray,...u(O)});function Ku(E){if(E instanceof ce){const O={};for(const R in E.shape){const J=E.shape[R];O[R]=Ie.create(Ku(J))}return new ce({...E._def,shape:()=>O})}else return E instanceof ge?new ge({...E._def,type:Ku(E.element)}):E instanceof Ie?Ie.create(Ku(E.unwrap())):E instanceof du?du.create(Ku(E.unwrap())):E instanceof Fe?Fe.create(E.items.map(O=>Ku(O))):E}class ce extends a{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const O=this._def.shape(),R=r.util.objectKeys(O);return this._cached={shape:O,keys:R},this._cached}_parse(O){if(this._getType(O)!==r.ZodParsedType.object){const te=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(te,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:te.parsedType}),g.INVALID}const{status:J,ctx:L}=this._processInputParams(O),{shape:U,keys:H}=this._getCached(),z=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const te in L.data)H.includes(te)||z.push(te);const ee=[];for(const te of H){const ie=U[te],Se=L.data[te];ee.push({key:{status:"valid",value:te},value:ie._parse(new m(L,Se,L.path,te)),alwaysSet:te in L.data})}if(this._def.catchall instanceof se){const te=this._def.unknownKeys;if(te==="passthrough")for(const ie of z)ee.push({key:{status:"valid",value:ie},value:{status:"valid",value:L.data[ie]}});else if(te==="strict")z.length>0&&((0,g.addIssueToContext)(L,{code:o.ZodIssueCode.unrecognized_keys,keys:z}),J.dirty());else if(te!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const te=this._def.catchall;for(const ie of z){const Se=L.data[ie];ee.push({key:{status:"valid",value:ie},value:te._parse(new m(L,Se,L.path,ie)),alwaysSet:ie in L.data})}}return L.common.async?Promise.resolve().then(async()=>{const te=[];for(const ie of ee){const Se=await ie.key,zl=await ie.value;te.push({key:Se,value:zl,alwaysSet:ie.alwaysSet})}return te}).then(te=>g.ParseStatus.mergeObjectSync(J,te)):g.ParseStatus.mergeObjectSync(J,ee)}get shape(){return this._def.shape()}strict(O){return b.errorUtil.errToObj,new ce({...this._def,unknownKeys:"strict",...O!==void 0?{errorMap:(R,J)=>{const L=this._def.errorMap?.(R,J).message??J.defaultError;return R.code==="unrecognized_keys"?{message:b.errorUtil.errToObj(O).message??L}:{message:L}}}:{}})}strip(){return new ce({...this._def,unknownKeys:"strip"})}passthrough(){return new ce({...this._def,unknownKeys:"passthrough"})}extend(O){return new ce({...this._def,shape:()=>({...this._def.shape(),...O})})}merge(O){return new ce({unknownKeys:O._def.unknownKeys,catchall:O._def.catchall,shape:()=>({...this._def.shape(),...O._def.shape()}),typeName:oe.ZodObject})}setKey(O,R){return this.augment({[O]:R})}catchall(O){return new ce({...this._def,catchall:O})}pick(O){const R={};for(const J of r.util.objectKeys(O))O[J]&&this.shape[J]&&(R[J]=this.shape[J]);return new ce({...this._def,shape:()=>R})}omit(O){const R={};for(const J of r.util.objectKeys(this.shape))O[J]||(R[J]=this.shape[J]);return new ce({...this._def,shape:()=>R})}deepPartial(){return Ku(this)}partial(O){const R={};for(const J of r.util.objectKeys(this.shape)){const L=this.shape[J];O&&!O[J]?R[J]=L:R[J]=L.optional()}return new ce({...this._def,shape:()=>R})}required(O){const R={};for(const J of r.util.objectKeys(this.shape))if(O&&!O[J])R[J]=this.shape[J];else{let U=this.shape[J];for(;U instanceof Ie;)U=U._def.innerType;R[J]=U}return new ce({...this._def,shape:()=>R})}keyof(){return Ll(r.util.objectKeys(this.shape))}}X.ZodObject=ce,ce.create=(E,O)=>new ce({shape:()=>E,unknownKeys:"strip",catchall:se.create(),typeName:oe.ZodObject,...u(O)}),ce.strictCreate=(E,O)=>new ce({shape:()=>E,unknownKeys:"strict",catchall:se.create(),typeName:oe.ZodObject,...u(O)}),ce.lazycreate=(E,O)=>new ce({shape:E,unknownKeys:"strip",catchall:se.create(),typeName:oe.ZodObject,...u(O)});class xu extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J=this._def.options;function L(U){for(const z of U)if(z.result.status==="valid")return z.result;for(const z of U)if(z.result.status==="dirty")return R.common.issues.push(...z.ctx.common.issues),z.result;const H=U.map(z=>new o.ZodError(z.ctx.common.issues));return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union,unionErrors:H}),g.INVALID}if(R.common.async)return Promise.all(J.map(async U=>{const H={...R,common:{...R.common,issues:[]},parent:null};return{result:await U._parseAsync({data:R.data,path:R.path,parent:H}),ctx:H}})).then(L);{let U;const H=[];for(const ee of J){const te={...R,common:{...R.common,issues:[]},parent:null},ie=ee._parseSync({data:R.data,path:R.path,parent:te});if(ie.status==="valid")return ie;ie.status==="dirty"&&!U&&(U={result:ie,ctx:te}),te.common.issues.length&&H.push(te.common.issues)}if(U)return R.common.issues.push(...U.ctx.common.issues),U.result;const z=H.map(ee=>new o.ZodError(ee));return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union,unionErrors:z}),g.INVALID}}get options(){return this._def.options}}X.ZodUnion=xu,xu.create=(E,O)=>new xu({options:E,typeName:oe.ZodUnion,...u(O)});const on=E=>E instanceof ts?on(E.schema):E instanceof Re?on(E.innerType()):E instanceof ns?[E.value]:E instanceof fu?E.options:E instanceof rs?r.util.objectValues(E.enum):E instanceof as?on(E._def.innerType):E instanceof he?[void 0]:E instanceof mu?[null]:E instanceof Ie?[void 0,...on(E.unwrap())]:E instanceof du?[null,...on(E.unwrap())]:E instanceof Qc||E instanceof us?on(E.unwrap()):E instanceof os?on(E._def.innerType):[];class Cc extends a{_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.object)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:R.parsedType}),g.INVALID;const J=this.discriminator,L=R.data[J],U=this.optionsMap.get(L);return U?R.common.async?U._parseAsync({data:R.data,path:R.path,parent:R}):U._parseSync({data:R.data,path:R.path,parent:R}):((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),g.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(O,R,J){const L=new Map;for(const U of R){const H=on(U.shape[O]);if(!H.length)throw new Error(`A discriminator value for key \`${O}\` could not be extracted from all schema options`);for(const z of H){if(L.has(z))throw new Error(`Discriminator property ${String(O)} has duplicate value ${String(z)}`);L.set(z,U)}}return new Cc({typeName:oe.ZodDiscriminatedUnion,discriminator:O,options:R,optionsMap:L,...u(J)})}}X.ZodDiscriminatedUnion=Cc;function Wc(E,O){const R=(0,r.getParsedType)(E),J=(0,r.getParsedType)(O);if(E===O)return{valid:!0,data:E};if(R===r.ZodParsedType.object&&J===r.ZodParsedType.object){const L=r.util.objectKeys(O),U=r.util.objectKeys(E).filter(z=>L.indexOf(z)!==-1),H={...E,...O};for(const z of U){const ee=Wc(E[z],O[z]);if(!ee.valid)return{valid:!1};H[z]=ee.data}return{valid:!0,data:H}}else if(R===r.ZodParsedType.array&&J===r.ZodParsedType.array){if(E.length!==O.length)return{valid:!1};const L=[];for(let U=0;U<E.length;U++){const H=E[U],z=O[U],ee=Wc(H,z);if(!ee.valid)return{valid:!1};L.push(ee.data)}return{valid:!0,data:L}}else return R===r.ZodParsedType.date&&J===r.ZodParsedType.date&&+E==+O?{valid:!0,data:E}:{valid:!1}}class ku extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O),L=(U,H)=>{if((0,g.isAborted)(U)||(0,g.isAborted)(H))return g.INVALID;const z=Wc(U.value,H.value);return z.valid?(((0,g.isDirty)(U)||(0,g.isDirty)(H))&&R.dirty(),{status:R.value,value:z.data}):((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_intersection_types}),g.INVALID)};return J.common.async?Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([U,H])=>L(U,H)):L(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}X.ZodIntersection=ku,ku.create=(E,O,R)=>new ku({left:E,right:O,typeName:oe.ZodIntersection,...u(R)});class Fe extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.array)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:J.parsedType}),g.INVALID;if(J.data.length<this._def.items.length)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g.INVALID;!this._def.rest&&J.data.length>this._def.items.length&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R.dirty());const U=[...J.data].map((H,z)=>{const ee=this._def.items[z]||this._def.rest;return ee?ee._parse(new m(J,H,J.path,z)):null}).filter(H=>!!H);return J.common.async?Promise.all(U).then(H=>g.ParseStatus.mergeArray(R,H)):g.ParseStatus.mergeArray(R,U)}get items(){return this._def.items}rest(O){return new Fe({...this._def,rest:O})}}X.ZodTuple=Fe,Fe.create=(E,O)=>{if(!Array.isArray(E))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fe({items:E,typeName:oe.ZodTuple,rest:null,...u(O)})};class es extends a{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.object)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:J.parsedType}),g.INVALID;const L=[],U=this._def.keyType,H=this._def.valueType;for(const z in J.data)L.push({key:U._parse(new m(J,z,J.path,z)),value:H._parse(new m(J,J.data[z],J.path,z)),alwaysSet:z in J.data});return J.common.async?g.ParseStatus.mergeObjectAsync(R,L):g.ParseStatus.mergeObjectSync(R,L)}get element(){return this._def.valueType}static create(O,R,J){return R instanceof a?new es({keyType:O,valueType:R,typeName:oe.ZodRecord,...u(J)}):new es({keyType:V.create(),valueType:O,typeName:oe.ZodRecord,...u(R)})}}X.ZodRecord=es;class Rc extends a{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.map)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:J.parsedType}),g.INVALID;const L=this._def.keyType,U=this._def.valueType,H=[...J.data.entries()].map(([z,ee],te)=>({key:L._parse(new m(J,z,J.path,[te,"key"])),value:U._parse(new m(J,ee,J.path,[te,"value"]))}));if(J.common.async){const z=new Map;return Promise.resolve().then(async()=>{for(const ee of H){const te=await ee.key,ie=await ee.value;if(te.status==="aborted"||ie.status==="aborted")return g.INVALID;(te.status==="dirty"||ie.status==="dirty")&&R.dirty(),z.set(te.value,ie.value)}return{status:R.value,value:z}})}else{const z=new Map;for(const ee of H){const te=ee.key,ie=ee.value;if(te.status==="aborted"||ie.status==="aborted")return g.INVALID;(te.status==="dirty"||ie.status==="dirty")&&R.dirty(),z.set(te.value,ie.value)}return{status:R.value,value:z}}}}X.ZodMap=Rc,Rc.create=(E,O,R)=>new Rc({valueType:O,keyType:E,typeName:oe.ZodMap,...u(R)});class gu extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.set)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:J.parsedType}),g.INVALID;const L=this._def;L.minSize!==null&&J.data.size<L.minSize.value&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:L.minSize.value,type:"set",inclusive:!0,exact:!1,message:L.minSize.message}),R.dirty()),L.maxSize!==null&&J.data.size>L.maxSize.value&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),R.dirty());const U=this._def.valueType;function H(ee){const te=new Set;for(const ie of ee){if(ie.status==="aborted")return g.INVALID;ie.status==="dirty"&&R.dirty(),te.add(ie.value)}return{status:R.value,value:te}}const z=[...J.data.values()].map((ee,te)=>U._parse(new m(J,ee,J.path,te)));return J.common.async?Promise.all(z).then(ee=>H(ee)):H(z)}min(O,R){return new gu({...this._def,minSize:{value:O,message:b.errorUtil.toString(R)}})}max(O,R){return new gu({...this._def,maxSize:{value:O,message:b.errorUtil.toString(R)}})}size(O,R){return this.min(O,R).max(O,R)}nonempty(O){return this.min(1,O)}}X.ZodSet=gu,gu.create=(E,O)=>new gu({valueType:E,minSize:null,maxSize:null,typeName:oe.ZodSet,...u(O)});class Vu extends a{constructor(){super(...arguments),this.validate=this.implement}_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.function)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.function,received:R.parsedType}),g.INVALID;function J(z,ee){return(0,g.makeIssue)({data:z,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,(0,v.getErrorMap)(),v.defaultErrorMap].filter(te=>!!te),issueData:{code:o.ZodIssueCode.invalid_arguments,argumentsError:ee}})}function L(z,ee){return(0,g.makeIssue)({data:z,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,(0,v.getErrorMap)(),v.defaultErrorMap].filter(te=>!!te),issueData:{code:o.ZodIssueCode.invalid_return_type,returnTypeError:ee}})}const U={errorMap:R.common.contextualErrorMap},H=R.data;if(this._def.returns instanceof Xu){const z=this;return(0,g.OK)(async function(...ee){const te=new o.ZodError([]),ie=await z._def.args.parseAsync(ee,U).catch(Yc=>{throw te.addIssue(J(ee,Yc)),te}),Se=await Reflect.apply(H,this,ie);return await z._def.returns._def.type.parseAsync(Se,U).catch(Yc=>{throw te.addIssue(L(Se,Yc)),te})})}else{const z=this;return(0,g.OK)(function(...ee){const te=z._def.args.safeParse(ee,U);if(!te.success)throw new o.ZodError([J(ee,te.error)]);const ie=Reflect.apply(H,this,te.data),Se=z._def.returns.safeParse(ie,U);if(!Se.success)throw new o.ZodError([L(ie,Se.error)]);return Se.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...O){return new Vu({...this._def,args:Fe.create(O).rest(Ce.create())})}returns(O){return new Vu({...this._def,returns:O})}implement(O){return this.parse(O)}strictImplement(O){return this.parse(O)}static create(O,R,J){return new Vu({args:O||Fe.create([]).rest(Ce.create()),returns:R||Ce.create(),typeName:oe.ZodFunction,...u(J)})}}X.ZodFunction=Vu;class ts extends a{get schema(){return this._def.getter()}_parse(O){const{ctx:R}=this._processInputParams(O);return this._def.getter()._parse({data:R.data,path:R.path,parent:R})}}X.ZodLazy=ts,ts.create=(E,O)=>new ts({getter:E,typeName:oe.ZodLazy,...u(O)});class ns extends a{_parse(O){if(O.data!==this._def.value){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{received:R.data,code:o.ZodIssueCode.invalid_literal,expected:this._def.value}),g.INVALID}return{status:"valid",value:O.data}}get value(){return this._def.value}}X.ZodLiteral=ns,ns.create=(E,O)=>new ns({value:E,typeName:oe.ZodLiteral,...u(O)});function Ll(E,O){return new fu({values:E,typeName:oe.ZodEnum,...u(O)})}class fu extends a{_parse(O){if(typeof O.data!="string"){const R=this._getOrReturnCtx(O),J=this._def.values;return(0,g.addIssueToContext)(R,{expected:r.util.joinValues(J),received:R.parsedType,code:o.ZodIssueCode.invalid_type}),g.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(O.data)){const R=this._getOrReturnCtx(O),J=this._def.values;return(0,g.addIssueToContext)(R,{received:R.data,code:o.ZodIssueCode.invalid_enum_value,options:J}),g.INVALID}return(0,g.OK)(O.data)}get options(){return this._def.values}get enum(){const O={};for(const R of this._def.values)O[R]=R;return O}get Values(){const O={};for(const R of this._def.values)O[R]=R;return O}get Enum(){const O={};for(const R of this._def.values)O[R]=R;return O}extract(O,R=this._def){return fu.create(O,{...this._def,...R})}exclude(O,R=this._def){return fu.create(this.options.filter(J=>!O.includes(J)),{...this._def,...R})}}X.ZodEnum=fu,fu.create=Ll;class rs extends a{_parse(O){const R=r.util.getValidEnumValues(this._def.values),J=this._getOrReturnCtx(O);if(J.parsedType!==r.ZodParsedType.string&&J.parsedType!==r.ZodParsedType.number){const L=r.util.objectValues(R);return(0,g.addIssueToContext)(J,{expected:r.util.joinValues(L),received:J.parsedType,code:o.ZodIssueCode.invalid_type}),g.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(O.data)){const L=r.util.objectValues(R);return(0,g.addIssueToContext)(J,{received:J.data,code:o.ZodIssueCode.invalid_enum_value,options:L}),g.INVALID}return(0,g.OK)(O.data)}get enum(){return this._def.values}}X.ZodNativeEnum=rs,rs.create=(E,O)=>new rs({values:E,typeName:oe.ZodNativeEnum,...u(O)});class Xu extends a{unwrap(){return this._def.type}_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.promise&&R.common.async===!1)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:R.parsedType}),g.INVALID;const J=R.parsedType===r.ZodParsedType.promise?R.data:Promise.resolve(R.data);return(0,g.OK)(J.then(L=>this._def.type.parseAsync(L,{path:R.path,errorMap:R.common.contextualErrorMap})))}}X.ZodPromise=Xu,Xu.create=(E,O)=>new Xu({type:E,typeName:oe.ZodPromise,...u(O)});class Re extends a{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(O){const{status:R,ctx:J}=this._processInputParams(O),L=this._def.effect||null,U={addIssue:H=>{(0,g.addIssueToContext)(J,H),H.fatal?R.abort():R.dirty()},get path(){return J.path}};if(U.addIssue=U.addIssue.bind(U),L.type==="preprocess"){const H=L.transform(J.data,U);if(J.common.async)return Promise.resolve(H).then(async z=>{if(R.value==="aborted")return g.INVALID;const ee=await this._def.schema._parseAsync({data:z,path:J.path,parent:J});return ee.status==="aborted"?g.INVALID:ee.status==="dirty"||R.value==="dirty"?(0,g.DIRTY)(ee.value):ee});{if(R.value==="aborted")return g.INVALID;const z=this._def.schema._parseSync({data:H,path:J.path,parent:J});return z.status==="aborted"?g.INVALID:z.status==="dirty"||R.value==="dirty"?(0,g.DIRTY)(z.value):z}}if(L.type==="refinement"){const H=z=>{const ee=L.refinement(z,U);if(J.common.async)return Promise.resolve(ee);if(ee instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return z};if(J.common.async===!1){const z=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});return z.status==="aborted"?g.INVALID:(z.status==="dirty"&&R.dirty(),H(z.value),{status:R.value,value:z.value})}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(z=>z.status==="aborted"?g.INVALID:(z.status==="dirty"&&R.dirty(),H(z.value).then(()=>({status:R.value,value:z.value}))))}if(L.type==="transform")if(J.common.async===!1){const H=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!(0,g.isValid)(H))return g.INVALID;const z=L.transform(H.value,U);if(z instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:R.value,value:z}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(H=>(0,g.isValid)(H)?Promise.resolve(L.transform(H.value,U)).then(z=>({status:R.value,value:z})):g.INVALID);r.util.assertNever(L)}}X.ZodEffects=Re,X.ZodTransformer=Re,Re.create=(E,O,R)=>new Re({schema:E,typeName:oe.ZodEffects,effect:O,...u(R)}),Re.createWithPreprocess=(E,O,R)=>new Re({schema:O,effect:{type:"preprocess",transform:E},typeName:oe.ZodEffects,...u(R)});class Ie extends a{_parse(O){return this._getType(O)===r.ZodParsedType.undefined?(0,g.OK)(void 0):this._def.innerType._parse(O)}unwrap(){return this._def.innerType}}X.ZodOptional=Ie,Ie.create=(E,O)=>new Ie({innerType:E,typeName:oe.ZodOptional,...u(O)});class du extends a{_parse(O){return this._getType(O)===r.ZodParsedType.null?(0,g.OK)(null):this._def.innerType._parse(O)}unwrap(){return this._def.innerType}}X.ZodNullable=du,du.create=(E,O)=>new du({innerType:E,typeName:oe.ZodNullable,...u(O)});class as extends a{_parse(O){const{ctx:R}=this._processInputParams(O);let J=R.data;return R.parsedType===r.ZodParsedType.undefined&&(J=this._def.defaultValue()),this._def.innerType._parse({data:J,path:R.path,parent:R})}removeDefault(){return this._def.innerType}}X.ZodDefault=as,as.create=(E,O)=>new as({innerType:E,typeName:oe.ZodDefault,defaultValue:typeof O.default=="function"?O.default:()=>O.default,...u(O)});class os extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J={...R,common:{...R.common,issues:[]}},L=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});return(0,g.isAsync)(L)?L.then(U=>({status:"valid",value:U.status==="valid"?U.value:this._def.catchValue({get error(){return new o.ZodError(J.common.issues)},input:J.data})})):{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new o.ZodError(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}X.ZodCatch=os,os.create=(E,O)=>new os({innerType:E,typeName:oe.ZodCatch,catchValue:typeof O.catch=="function"?O.catch:()=>O.catch,...u(O)});class wc extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.nan){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:J.parsedType}),g.INVALID}return{status:"valid",value:O.data}}}X.ZodNaN=wc,wc.create=E=>new wc({typeName:oe.ZodNaN,...u(E)}),X.BRAND=Symbol("zod_brand");class Qc extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J=R.data;return this._def.type._parse({data:J,path:R.path,parent:R})}unwrap(){return this._def.type}}X.ZodBranded=Qc;class is extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.common.async)return(async()=>{const U=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});return U.status==="aborted"?g.INVALID:U.status==="dirty"?(R.dirty(),(0,g.DIRTY)(U.value)):this._def.out._parseAsync({data:U.value,path:J.path,parent:J})})();{const L=this._def.in._parseSync({data:J.data,path:J.path,parent:J});return L.status==="aborted"?g.INVALID:L.status==="dirty"?(R.dirty(),{status:"dirty",value:L.value}):this._def.out._parseSync({data:L.value,path:J.path,parent:J})}}static create(O,R){return new is({in:O,out:R,typeName:oe.ZodPipeline})}}X.ZodPipeline=is;class us extends a{_parse(O){const R=this._def.innerType._parse(O),J=L=>((0,g.isValid)(L)&&(L.value=Object.freeze(L.value)),L);return(0,g.isAsync)(R)?R.then(L=>J(L)):J(R)}unwrap(){return this._def.innerType}}X.ZodReadonly=us,us.create=(E,O)=>new us({innerType:E,typeName:oe.ZodReadonly,...u(O)});function Bl(E,O){const R=typeof E=="function"?E(O):typeof E=="string"?{message:E}:E;return typeof R=="string"?{message:R}:R}function Ul(E,O={},R){return E?Me.create().superRefine((J,L)=>{const U=E(J);if(U instanceof Promise)return U.then(H=>{if(!H){const z=Bl(O,J),ee=z.fatal??R??!0;L.addIssue({code:"custom",...z,fatal:ee})}});if(!U){const H=Bl(O,J),z=H.fatal??R??!0;L.addIssue({code:"custom",...H,fatal:z})}}):Me.create()}X.late={object:ce.lazycreate};var oe;(function(E){E.ZodString="ZodString",E.ZodNumber="ZodNumber",E.ZodNaN="ZodNaN",E.ZodBigInt="ZodBigInt",E.ZodBoolean="ZodBoolean",E.ZodDate="ZodDate",E.ZodSymbol="ZodSymbol",E.ZodUndefined="ZodUndefined",E.ZodNull="ZodNull",E.ZodAny="ZodAny",E.ZodUnknown="ZodUnknown",E.ZodNever="ZodNever",E.ZodVoid="ZodVoid",E.ZodArray="ZodArray",E.ZodObject="ZodObject",E.ZodUnion="ZodUnion",E.ZodDiscriminatedUnion="ZodDiscriminatedUnion",E.ZodIntersection="ZodIntersection",E.ZodTuple="ZodTuple",E.ZodRecord="ZodRecord",E.ZodMap="ZodMap",E.ZodSet="ZodSet",E.ZodFunction="ZodFunction",E.ZodLazy="ZodLazy",E.ZodLiteral="ZodLiteral",E.ZodEnum="ZodEnum",E.ZodEffects="ZodEffects",E.ZodNativeEnum="ZodNativeEnum",E.ZodOptional="ZodOptional",E.ZodNullable="ZodNullable",E.ZodDefault="ZodDefault",E.ZodCatch="ZodCatch",E.ZodPromise="ZodPromise",E.ZodBranded="ZodBranded",E.ZodPipeline="ZodPipeline",E.ZodReadonly="ZodReadonly"})(oe||(X.ZodFirstPartyTypeKind=oe={}));const bO=(E,O={message:`Input not instance of ${E.name}`})=>Ul(R=>R instanceof E,O);X.instanceof=bO;const Kl=V.create;X.string=Kl;const Vl=k.create;X.number=Vl;const mO=wc.create;X.nan=mO;const gO=ae.create;X.bigint=gO;const Xl=ue.create;X.boolean=Xl;const yO=be.create;X.date=yO;const vO=lu.create;X.symbol=vO;const hO=he.create;X.undefined=hO;const OO=mu.create;X.null=OO;const SO=Me.create;X.any=SO;const jO=Ce.create;X.unknown=jO;const PO=se.create;X.never=PO;const MO=Oe.create;X.void=MO;const CO=ge.create;X.array=CO;const RO=ce.create;X.object=RO;const wO=ce.strictCreate;X.strictObject=wO;const TO=xu.create;X.union=TO;const qO=Cc.create;X.discriminatedUnion=qO;const DO=ku.create;X.intersection=DO;const AO=Fe.create;X.tuple=AO;const NO=es.create;X.record=NO;const JO=Rc.create;X.map=JO;const FO=gu.create;X.set=FO;const IO=Vu.create;X.function=IO;const EO=ts.create;X.lazy=EO;const LO=ns.create;X.literal=LO;const BO=fu.create;X.enum=BO;const UO=rs.create;X.nativeEnum=UO;const KO=Xu.create;X.promise=KO;const Zl=Re.create;X.effect=Zl,X.transformer=Zl;const VO=Ie.create;X.optional=VO;const XO=du.create;X.nullable=XO;const ZO=Re.createWithPreprocess;X.preprocess=ZO;const zO=is.create;X.pipeline=zO;const HO=()=>Kl().optional();X.ostring=HO;const GO=()=>Vl().optional();X.onumber=GO;const $O=()=>Xl().optional();return X.oboolean=$O,X.coerce={string:(E=>V.create({...E,coerce:!0})),number:(E=>k.create({...E,coerce:!0})),boolean:(E=>ue.create({...E,coerce:!0})),bigint:(E=>ae.create({...E,coerce:!0})),date:(E=>be.create({...E,coerce:!0}))},X.NEVER=g.INVALID,X}var df;function _f(){return df||(df=1,(function(o){var v=vu&&vu.__createBinding||(Object.create?(function(g,r,m,p){p===void 0&&(p=m);var u=Object.getOwnPropertyDescriptor(r,m);(!u||("get"in u?!r.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return r[m]}}),Object.defineProperty(g,p,u)}):(function(g,r,m,p){p===void 0&&(p=m),g[p]=r[m]})),b=vu&&vu.__exportStar||function(g,r){for(var m in g)m!=="default"&&!Object.prototype.hasOwnProperty.call(r,m)&&v(r,g,m)};Object.defineProperty(o,"__esModule",{value:!0}),b(sl(),o),b(mv(),o),b(oS(),o),b(Ic(),o),b(uS(),o),b(ul(),o)})(vu)),vu}var pf;function F(){return pf||(pf=1,(function(o){var v=qe&&qe.__createBinding||(Object.create?(function(p,u,a,n){n===void 0&&(n=a);var e=Object.getOwnPropertyDescriptor(u,a);(!e||("get"in e?!u.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(p,n,e)}):(function(p,u,a,n){n===void 0&&(n=a),p[n]=u[a]})),b=qe&&qe.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),g=qe&&qe.__importStar||function(p){if(p&&p.__esModule)return p;var u={};if(p!=null)for(var a in p)a!=="default"&&Object.prototype.hasOwnProperty.call(p,a)&&v(u,p,a);return b(u,p),u},r=qe&&qe.__exportStar||function(p,u){for(var a in p)a!=="default"&&!Object.prototype.hasOwnProperty.call(u,a)&&v(u,p,a)};Object.defineProperty(o,"__esModule",{value:!0}),o.z=void 0;const m=g(_f());o.z=m,r(_f(),o),o.default=m})(qe)),qe}var bf;function gv(){if(bf)return de;bf=1;var o=de&&de.__createBinding||(Object.create?(function(e,t,i,s){s===void 0&&(s=i);var f=Object.getOwnPropertyDescriptor(t,i);(!f||("get"in f?!t.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,f)}):(function(e,t,i,s){s===void 0&&(s=i),e[s]=t[i]})),v=de&&de.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),b=de&&de.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(s[s.length]=f);return s},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var s=e(t),f=0;f<s.length;f++)s[f]!=="default"&&o(i,t,s[f]);return v(i,t),i}})();Object.defineProperty(de,"__esModule",{value:!0}),de.zodInbound=de.zodOutbound=void 0,de.bytesToBase64=r,de.bytesFromBase64=m,de.stringToBytes=p,de.stringFromBytes=u,de.stringToBase64=a,de.stringFromBase64=n;const g=b(F());function r(e){return btoa(String.fromCodePoint(...e))}function m(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function p(e){return new TextEncoder().encode(e)}function u(e){return new TextDecoder().decode(e)}function a(e){return r(p(e))}function n(e){return u(m(e))}return de.zodOutbound=g.instanceof(Uint8Array).or(g.string().transform(p)),de.zodInbound=g.instanceof(Uint8Array).or(g.string().transform(m)),de}var tl={},Ac={},mf;function yv(){if(mf)return Ac;mf=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.isPlainObject=o;function o(v){if(typeof v!="object"||v===null)return!1;const b=Object.getPrototypeOf(v);return(b===null||b===Object.prototype||Object.getPrototypeOf(b)===null)&&!(Symbol.toStringTag in v)&&!(Symbol.iterator in v)}return Ac}var gf;function x(){return gf||(gf=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.encodeDeepObjectQuery=o.encodePipeDelimitedQuery=o.encodeSpaceDelimitedQuery=o.encodeFormQuery=o.encodeJSONQuery=o.encodeSimple=o.encodePipeDelimited=o.encodeSpaceDelimited=o.encodeForm=o.EncodingError=void 0,o.encodeMatrix=r,o.encodeLabel=m,o.encodeBodyForm=u,o.encodeDeepObject=a,o.encodeDeepObjectObject=n,o.encodeJSON=e,o.queryJoin=d,o.queryEncoder=_,o.appendForm=y;const v=gv(),b=yv();class g extends Error{constructor(j){super(j),this.name="EncodingError"}}o.EncodingError=g;function r(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="",w=null;if(C==null||(Array.isArray(C)?w=c(C,B=>`${D(B)}`)?.join(","):(0,b.isPlainObject)(C)?w=l(Object.entries(C),([V,Z])=>`,${N(V)},${D(Z)}`)?.join("").slice(1):w=`${D(C)}`,w==null))return;const q=N(S);P=`${q}=${w}`,P===`${q}=`&&(P=P.slice(0,-1)),P&&(T+=`;${P}`)}),T}function m(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="";C!=null&&(Array.isArray(C)?P=c(C,w=>`${D(w)}`)?.join("."):(0,b.isPlainObject)(C)?P=l(Object.entries(C),([q,B])=>`.${N(q)}.${D(B)}`)?.join("").slice(1):P=`${M?.explode&&(0,b.isPlainObject)(j)?`${N(S)}=`:""}${D(C)}`,T+=P==null?"":`.${P}`)}),T}function p(h){return(j,M,T)=>{let A="";const N=T?.explode?i(j,M):[[j,M]];if(N.every(([P,w])=>w==null))return;const D=P=>T?.charEncoding==="percent"?encodeURIComponent(P):P,S=P=>D(s(P)),C=D(h);return N.forEach(([P,w])=>{let q="",B=null;w!=null&&(Array.isArray(w)?B=c(w,V=>`${S(V)}`)?.join(C):(0,b.isPlainObject)(w)?B=l(Object.entries(w),([V,Z])=>`${D(V)}${C}${S(Z)}`)?.join(C):B=`${S(w)}`,B!=null&&(q=`${D(P)}=${B}`,!(!q||q==="=")&&(A+=`&${q}`)))}),A.slice(1)}}o.encodeForm=p(","),o.encodeSpaceDelimited=p(" "),o.encodePipeDelimited=p("|");function u(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]],N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="",w="";C!=null&&(Array.isArray(C)||(0,b.isPlainObject)(C)?w=JSON.stringify(C,f):w=`${D(C)}`,P=`${N(S)}=${w}`,!(!P||P==="=")&&(T+=`&${P}`))}),T.slice(1)}function a(h,j,M){if(j!=null){if(!(0,b.isPlainObject)(j))throw new g(`Value of parameter '${h}' which uses deepObject encoding must be an object or null`);return n(h,j,M)}}function n(h,j,M){if(j==null)return;let T="";const A=N=>M?.charEncoding==="percent"?encodeURIComponent(N):N;if(!(0,b.isPlainObject)(j))throw new g(`Expected parameter '${h}' to be an object.`);return Object.entries(j).forEach(([N,D])=>{if(D==null)return;const S=`${h}[${N}]`;if((0,b.isPlainObject)(D)){const w=n(S,D,M);T+=w==null?"":`&${w}`;return}const C=Array.isArray(D)?D:[D],P=c(C,w=>`${A(S)}=${A(s(w))}`)?.join("&");T+=P==null?"":`&${P}`}),T.slice(1)}function e(h,j,M){if(typeof j>"u")return;const T=N=>M?.charEncoding==="percent"?encodeURIComponent(N):N,A=T(JSON.stringify(j,f));return M?.explode?A:`${T(h)}=${A}`}const t=(h,j,M)=>{let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="";C!=null&&(Array.isArray(C)?P=c(C,w=>`${D(w)}`)?.join(","):(0,b.isPlainObject)(C)?P=l(Object.entries(C),([q,B])=>`,${N(q)},${D(B)}`)?.join("").slice(1):P=`${M?.explode&&(0,b.isPlainObject)(j)?`${S}=`:""}${D(C)}`,T+=P?`,${P}`:"")}),T.slice(1)};o.encodeSimple=t;function i(h,j){return Array.isArray(j)?j.map(M=>[h,M]):(0,b.isPlainObject)(j)?Object.entries(j??{}).map(([T,A])=>[T,A]):[[h,j]]}function s(h){return h==null?"":h instanceof Date?h.toISOString():h instanceof Uint8Array?(0,v.bytesToBase64)(h):typeof h=="object"?JSON.stringify(h,f):`${h}`}function f(h,j){return j instanceof Uint8Array?(0,v.bytesToBase64)(j):j}function c(h,j){const M=h.reduce((T,A)=>{if(A==null)return T;const N=j(A);return N==null||T.push(N),T},[]);return M.length?M:null}function l(h,j){const M=[];for(const[T,A]of h){if(A==null)continue;const N=j([T,A]);N!=null&&M.push(N)}return M.length?M:null}function d(...h){return h.filter(Boolean).join("&")}function _(h){return function(M,T){const A={...T,explode:T?.explode??!0,charEncoding:T?.charEncoding??"percent"},N=new Set(T?.allowEmptyValue??[]),D=Object.entries(M).map(([S,C])=>N.has(S)&&(C==null||C===""||Array.isArray(C)&&C.length===0)?`${encodeURIComponent(S)}=`:h(S,C,A));return d(...D)}}o.encodeJSONQuery=_(e),o.encodeFormQuery=_(o.encodeForm),o.encodeSpaceDelimitedQuery=_(o.encodeSpaceDelimited),o.encodePipeDelimitedQuery=_(o.encodePipeDelimited),o.encodeDeepObjectQuery=_(a);function y(h,j,M,T){M!=null&&(M instanceof Blob&&T?h.append(j,M,T):M instanceof Blob?h.append(j,M):h.append(j,String(M)))}})(tl)),tl}var ln={},Nc={},yf;function sS(){if(yf)return Nc;yf=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.dlv=o;function o(v,b,g,r,m){for(b=Array.isArray(b)?b:b.split("."),r=0;r<b.length;r++){const p=b[r];v=p!=null&&v?v[p]:m}return v===m?g:v}return Nc}var vf;function vv(){return vf||(vf=1,(function(o){var v=ln&&ln.__createBinding||(Object.create?(function(e,t,i,s){s===void 0&&(s=i);var f=Object.getOwnPropertyDescriptor(t,i);(!f||("get"in f?!t.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,f)}):(function(e,t,i,s){s===void 0&&(s=i),e[s]=t[i]})),b=ln&&ln.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),g=ln&&ln.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(s[s.length]=f);return s},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var s=e(t),f=0;f<s.length;f++)s[f]!=="default"&&v(i,t,s[f]);return b(i,t),i}})();Object.defineProperty(o,"__esModule",{value:!0}),o.envSchema=void 0,o.env=a,o.resetEnv=n;const r=g(F()),m=sS();o.envSchema=r.object({MISTRAL_API_KEY:r.string().optional(),MISTRAL_DEBUG:r.coerce.boolean().optional()});function p(){return"Deno"in globalThis}let u;function a(){if(u)return u;let e={};return p()?e=globalThis.Deno?.env?.toObject?.()??{}:e=(0,m.dlv)(globalThis,"process.env")??{},u=o.envSchema.parse(e),u}function n(){u=void 0}})(ln)),ln}var _u={},hf;function cS(){if(hf)return _u;hf=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.TemporaryError=_u.PermanentError=void 0,_u.retry=r;const o=Fc(),v={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5};class b extends Error{constructor(i,s){let f=i;s?.cause&&(f+=`: ${s.cause}`),super(f,s),this.name="PermanentError",typeof this.cause>"u"&&(this.cause=s?.cause),Object.setPrototypeOf(this,b.prototype)}}_u.PermanentError=b;class g extends Error{constructor(i,s){super(i),this.response=s,this.name="TemporaryError",Object.setPrototypeOf(this,g.prototype)}}_u.TemporaryError=g;async function r(t,i){switch(i.config.strategy){case"backoff":return a(m(t,{statusCodes:i.statusCodes,retryConnectionErrors:!!i.config.retryConnectionErrors}),i.config.backoff??v);default:return await t()}}function m(t,i){return async()=>{try{const s=await t();if(u(s,i.statusCodes))throw new g("Response failed with retryable status code",s);return s}catch(s){throw s instanceof g||i.retryConnectionErrors&&((0,o.isTimeoutError)(s)||(0,o.isConnectionError)(s))?s:new b("Permanent error",{cause:s})}}}const p=new RegExp("^[0-9]xx$","i");function u(t,i){const s=`${t.status}`;return i.some(f=>{if(!p.test(f))return f===s;const c=f.charAt(0);if(!c)throw new Error("Invalid status code range");const l=s.charAt(0);if(!l)throw new Error(`Invalid response status code: ${s}`);return l===c})}async function a(t,i){const{maxElapsedTime:s,initialInterval:f,exponent:c,maxInterval:l}=i,d=Date.now();let _=0;for(;;)try{return await t()}catch(y){if(y instanceof b)throw y.cause;if(Date.now()-d>s){if(y instanceof g)return y.response;throw y}let j=0;y instanceof g&&(j=n(y.response)),j<=0&&(j=f*Math.pow(_,c)+Math.random()*1e3);const M=Math.min(j,l);await e(M),_++}}function n(t){const i=t.headers.get("retry-after")||"";if(!i)return 0;const s=Number(i);if(Number.isInteger(s))return s*1e3;const f=Date.parse(i);if(Number.isInteger(f)){const c=f-Date.now();return c>0?Math.ceil(c):0}return 0}async function e(t){return new Promise(i=>setTimeout(i,t))}return _u}var Of;function le(){if(Of)return un;Of=1;var o=un&&un.__classPrivateFieldSet||function(M,T,A,N,D){if(N==="m")throw new TypeError("Private method is not writable");if(N==="a"&&!D)throw new TypeError("Private accessor was defined without a setter");if(typeof T=="function"?M!==T||!D:!T.has(M))throw new TypeError("Cannot write private member to an object whose class did not declare it");return N==="a"?D.call(M,A):D?D.value=A:T.set(M,A),A},v=un&&un.__classPrivateFieldGet||function(M,T,A,N){if(A==="a"&&!N)throw new TypeError("Private accessor was defined without a getter");if(typeof T=="function"?M!==T||!N:!T.has(M))throw new TypeError("Cannot read private member from an object whose class did not declare it");return A==="m"?N:A==="a"?N.call(M):N?N.value:T.get(M)},b,g,r;Object.defineProperty(un,"__esModule",{value:!0}),un.ClientSDK=void 0;const m=aS(),p=_v(),u=_e(),a=gv(),n=il(),e=x(),t=vv(),i=Fc(),s=cS(),f=typeof globalThis>"u"?null:globalThis,l=typeof f=="object"&&f!=null&&"importScripts"in f&&typeof f.importScripts=="function"||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u";class d{constructor(T={}){b.set(this,void 0),g.set(this,void 0),r.set(this,void 0);const A=T;typeof A=="object"&&A!=null&&"hooks"in A&&A.hooks instanceof m.SDKHooks?o(this,g,A.hooks,"f"):o(this,g,new m.SDKHooks,"f");const N=(0,n.serverURLFromOptions)(T);N&&(N.pathname=N.pathname.replace(/\/+$/,"")+"/");const{baseURL:D,client:S}=v(this,g,"f").sdkInit({baseURL:N,client:T.httpClient||new i.HTTPClient});this._baseURL=D,o(this,b,S,"f"),this._options={...T,hooks:v(this,g,"f")},o(this,r,this._options.debugLogger,"f"),!v(this,r,"f")&&(0,t.env)().MISTRAL_DEBUG&&o(this,r,console,"f")}_createRequest(T,A,N){const{method:D,path:S,query:C,headers:P,security:w}=A,q=A.baseURL??this._baseURL;if(!q)return(0,u.ERR)(new p.InvalidRequestError("No base URL provided for operation"));const B=new URL(q),V=new URL(S,B);S&&(B.pathname+=B.pathname.endsWith("/")?"":"/",B.pathname+=V.pathname.replace(/^\/+/,""));let Z=C||"";const k=[];for(const[se,Oe]of Object.entries(w?.queryParams||{})){const ge=(0,e.encodeForm)(se,Oe,{charEncoding:"percent"});typeof ge<"u"&&k.push(ge)}if(k.length&&(Z+=`&${k.join("&")}`),Z){const se=Z.startsWith("&")?Z.slice(1):Z;B.search=`?${se}`}const ae=new Headers(P),ue=w?.basic.username,be=w?.basic.password;if(ue!=null||be!=null){const se=(0,a.stringToBase64)([ue||"",be||""].join(":"));ae.set("Authorization",`Basic ${se}`)}const lu=new Headers(w?.headers||{});for(const[se,Oe]of lu)ae.set(se,Oe);let he=ae.get("cookie")||"";for(const[se,Oe]of Object.entries(w?.cookies||{}))he+=`; ${se}=${Oe}`;he=he.startsWith("; ")?he.slice(2):he,ae.set("cookie",he);const mu=new Headers(N?.headers??N?.fetchOptions?.headers);for(const[se,Oe]of mu)ae.set(se,Oe);l||ae.set(A.uaHeader??"user-agent",A.userAgent??n.SDK_METADATA.userAgent);const Me={...N?.fetchOptions,...N};if(!Me?.signal&&A.timeoutMs&&A.timeoutMs>0){const se=AbortSignal.timeout(A.timeoutMs);Me.signal=se}A.body instanceof ReadableStream&&Object.assign(Me,{duplex:"half"});let Ce;try{Ce=v(this,g,"f").beforeCreateRequest(T,{url:B,options:{...Me,body:A.body??null,headers:ae,method:D}})}catch(se){return(0,u.ERR)(new p.UnexpectedClientError("Create request hook failed to execute",{cause:se}))}return(0,u.OK)(new Request(Ce.url,Ce.options))}async _do(T,A){const{context:N,errorCodes:D}=A;return(0,s.retry)(async()=>{const S=await v(this,g,"f").beforeRequest(N,T.clone());await h(v(this,r,"f"),S).catch(P=>v(this,r,"f")?.log("Failed to log request:",P));let C=await v(this,b,"f").request(S);try{if((0,i.matchStatusCode)(C,D)){const P=await v(this,g,"f").afterError(N,C,null);if(P.error)throw P.error;C=P.response||C}else C=await v(this,g,"f").afterSuccess(N,C)}finally{await j(v(this,r,"f"),C,S).catch(P=>v(this,r,"f")?.log("Failed to log response:",P))}return C},{config:A.retryConfig,statusCodes:A.retryCodes}).then(S=>(0,u.OK)(S),S=>{switch(!0){case(0,i.isAbortError)(S):return(0,u.ERR)(new p.RequestAbortedError("Request aborted by client",{cause:S}));case(0,i.isTimeoutError)(S):return(0,u.ERR)(new p.RequestTimeoutError("Request timed out",{cause:S}));case(0,i.isConnectionError)(S):return(0,u.ERR)(new p.ConnectionError("Unable to make request",{cause:S}));default:return(0,u.ERR)(new p.UnexpectedClientError("Unexpected HTTP client error",{cause:S}))}})}}un.ClientSDK=d,b=new WeakMap,g=new WeakMap,r=new WeakMap;const _=/^(application|text)\/([^+]+\+)*json.*/,y=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function h(M,T){if(!M)return;const A=T.headers.get("content-type"),N=A?.split(";")[0]||"";M.group(`> Request: ${T.method} ${T.url}`),M.group("Headers:");for(const[D,S]of T.headers.entries())M.log(`${D}: ${S}`);switch(M.groupEnd(),M.group("Body:"),!0){case _.test(N):M.log(await T.clone().json());break;case N.startsWith("text/"):M.log(await T.clone().text());break;case N==="multipart/form-data":{const D=await T.clone().formData();for(const[S,C]of D){const P=C instanceof Blob?"<Blob>":C;M.log(`${S}: ${P}`)}break}default:M.log(`<${A}>`);break}M.groupEnd(),M.groupEnd()}async function j(M,T,A){if(!M)return;const N=T.headers.get("content-type"),D=N?.split(";")[0]||"";M.group(`< Response: ${A.method} ${A.url}`),M.log("Status Code:",T.status,T.statusText),M.group("Headers:");for(const[S,C]of T.headers.entries())M.log(`${S}: ${C}`);switch(M.groupEnd(),M.group("Body:"),!0){case((0,i.matchContentType)(T,"application/json")||_.test(D)&&!y.test(D)):M.log(await T.clone().json());break;case((0,i.matchContentType)(T,"application/jsonl")||y.test(D)):M.log(await T.clone().text());break;case(0,i.matchContentType)(T,"text/event-stream"):M.log(`<${N}>`);break;case(0,i.matchContentType)(T,"text/*"):M.log(await T.clone().text());break;case(0,i.matchContentType)(T,"multipart/form-data"):{const S=await T.clone().formData();for(const[C,P]of S){const w=P instanceof Blob?"<Blob>":P;M.log(`${C}: ${w}`)}break}default:M.log(`<${N}>`);break}M.groupEnd(),M.groupEnd()}return un}var bs={},Ee={},fe={},De={},ms={},Sf;function Ec(){if(Sf)return ms;Sf=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.MistralError=void 0;class o extends Error{constructor(b,g){super(b),this.statusCode=g.response.status,this.body=g.body,this.headers=g.response.headers,this.contentType=g.response.headers.get("content-type")||"",this.rawResponse=g.response,this.name="MistralError"}}return ms.MistralError=o,ms}var je={},jf;function cl(){if(jf)return je;jf=1;var o=je&&je.__createBinding||(Object.create?(function(p,u,a,n){n===void 0&&(n=a);var e=Object.getOwnPropertyDescriptor(u,a);(!e||("get"in e?!u.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(p,n,e)}):(function(p,u,a,n){n===void 0&&(n=a),p[n]=u[a]})),v=je&&je.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),b=je&&je.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(a){var n=[];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(n[n.length]=e);return n},p(u)};return function(u){if(u&&u.__esModule)return u;var a={};if(u!=null)for(var n=p(u),e=0;e<n.length;e++)n[e]!=="default"&&o(a,u,n[e]);return v(a,u),a}})();Object.defineProperty(je,"__esModule",{value:!0}),je.SDKValidationError=void 0,je.formatZodError=m;const g=b(F());class r extends Error{static[Symbol.hasInstance](u){return!(!(u instanceof Error)||!("rawValue"in u)||!("rawMessage"in u)||!("pretty"in u)||typeof u.pretty!="function")}constructor(u,a,n){super(`${u}: ${a}`),this.name="SDKValidationError",this.cause=a,this.rawValue=n,this.rawMessage=u}pretty(){return this.cause instanceof g.ZodError?`${this.rawMessage}
|
|
1
|
+
import{A as WO,g as dv,t as QO,b as YO,d as xO,a as kO}from"./index-W9ryXG_v.js";import{s as eS}from"./hash-DMDecQcg.js";import{p as Hl}from"./json-parse-DYeOImVX.js";import{s as cu}from"./sanitize-unicode-cmozpu7l.js";var we={},xc={},Tc={},Gl;function $(){if(Gl)return Tc;Gl=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.pathToFunc=v;const o=Object.prototype.hasOwnProperty;function v(b,g){const r=/\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;return function(p={}){return b.replace(r,function(u,a){if(!o.call(p,a))throw new Error(`Parameter '${a}' is required`);const n=p[a];if(typeof n!="string"&&typeof n!="number")throw new Error(`Parameter '${a}' must be a string or number`);return g?.charEncoding==="percent"?encodeURIComponent(`${n}`):`${n}`})}}return Tc}var $l;function il(){return $l||($l=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.SDK_METADATA=o.ServerList=o.ServerEu=void 0,o.serverURLFromOptions=b;const v=$();o.ServerEu="eu",o.ServerList={[o.ServerEu]:"https://api.mistral.ai"};function b(g){let r=g.serverURL;const m={};if(!r){const u=g.server??o.ServerEu;r=o.ServerList[u]||""}const p=(0,v.pathToFunc)(r)(m);return new URL(p)}o.SDK_METADATA={language:"typescript",openapiDocVersion:"1.0.0",sdkVersion:"1.14.1",genVersion:"2.797.1",userAgent:"speakeasy-sdk/typescript 1.14.1 2.797.1 1.0.0 @mistralai/mistralai"}})(xc)),xc}var ss={},Wl;function yc(){if(Wl)return ss;Wl=1,Object.defineProperty(ss,"__esModule",{value:!0}),ss.readableStreamToArrayBuffer=o,ss.getContentTypeFromFileName=v;async function o(b){const g=b.getReader(),r=[];let m=0,p=!1;for(;!p;){const{value:n,done:e}=await g.read();e?p=!0:(r.push(n),m+=n.length)}const u=new Uint8Array(m);let a=0;for(const n of r)u.set(n,a),a+=n.length;return u.buffer}function v(b){if(!b)return null;const g=b.toLowerCase().split(".").pop();return g&&{json:"application/json",xml:"application/xml",html:"text/html",htm:"text/html",txt:"text/plain",csv:"text/csv",pdf:"application/pdf",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",svg:"image/svg+xml",js:"application/javascript",css:"text/css",zip:"application/zip",tar:"application/x-tar",gz:"application/gzip",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",webp:"image/webp",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",ttf:"font/ttf",otf:"font/otf"}[g]||null}return ss}var Te={},Ql;function Fc(){if(Ql)return Te;Ql=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.HTTPClient=void 0,Te.matchContentType=g,Te.matchStatusCode=m,Te.matchResponse=p,Te.isConnectionError=u,Te.isTimeoutError=a,Te.isAbortError=n;const o=(e,t)=>t==null?fetch(e):fetch(e,t);class v{constructor(t={}){this.options=t,this.requestHooks=[],this.requestErrorHooks=[],this.responseHooks=[],this.fetcher=t.fetcher||o}async request(t){let i=t;for(const s of this.requestHooks){const f=await s(i);f&&(i=f)}try{const s=await this.fetcher(i);for(const f of this.responseHooks)await f(s,i);return s}catch(s){for(const f of this.requestErrorHooks)await f(s,i);throw s}}addHook(...t){if(t[0]==="beforeRequest")this.requestHooks.push(t[1]);else if(t[0]==="requestError")this.requestErrorHooks.push(t[1]);else if(t[0]==="response")this.responseHooks.push(t[1]);else throw new Error(`Invalid hook type: ${t[0]}`);return this}removeHook(...t){let i;if(t[0]==="beforeRequest")i=this.requestHooks;else if(t[0]==="requestError")i=this.requestErrorHooks;else if(t[0]==="response")i=this.responseHooks;else throw new Error(`Invalid hook type: ${t[0]}`);const s=i.findIndex(f=>f===t[1]);return s>=0&&i.splice(s,1),this}clone(){const t=new v(this.options);return t.requestHooks=this.requestHooks.slice(),t.requestErrorHooks=this.requestErrorHooks.slice(),t.responseHooks=this.responseHooks.slice(),t}}Te.HTTPClient=v;const b=/\s*;\s*/g;function g(e,t){if(t==="*")return!0;let i=e.headers.get("content-type")?.trim()||"application/octet-stream";i=i.toLowerCase();const s=t.toLowerCase().trim().split(b),[f="",...c]=s;if(f.split("/").length!==2)return!1;const l=i.split(b),[d="",..._]=l,[y="",h=""]=d.split("/");if(!y||!h||f!=="*/*"&&d!==f&&`${y}/*`!==f&&`*/${h}`!==f||_.length<c.length)return!1;const j=new Set(_);for(const M of c)if(!j.has(M))return!1;return!0}const r=new RegExp("^[0-9]xx$","i");function m(e,t){const i=`${e.status}`,s=Array.isArray(t)?t:[t];return s.length?s.some(f=>{const c=`${f}`;if(c==="default")return!0;if(!r.test(`${c}`))return c===i;const l=c.charAt(0);if(!l)throw new Error("Invalid status code range");const d=i.charAt(0);if(!d)throw new Error(`Invalid response status code: ${i}`);return d===l}):!1}function p(e,t,i){return m(e,t)&&g(e,i)}function u(e){if(typeof e!="object"||e==null)return!1;const t=e instanceof TypeError&&e.message.toLowerCase().startsWith("failed to fetch"),i=e instanceof TypeError&&e.message.toLowerCase().startsWith("fetch failed"),s="name"in e&&e.name==="ConnectionError",f="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnreset";return t||i||f||s}function a(e){if(typeof e!="object"||e==null)return!1;const t="name"in e&&e.name==="TimeoutError",i="code"in e&&e.code===23,s="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnaborted";return t||i||s}function n(e){if(typeof e!="object"||e==null)return!1;const t="name"in e&&e.name==="AbortError",i="code"in e&&e.code===20,s="code"in e&&typeof e.code=="string"&&e.code.toLowerCase()==="econnaborted";return t||i||s}return Te}var cs={},un={},ls={},qc={},fs={},Yl;function tS(){if(Yl)return fs;Yl=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.CustomUserAgentHook=void 0;const o=il();class v{beforeRequest(g,r){const p=`mistral-client-typescript/${o.SDK_METADATA.sdkVersion}`;return r.headers.set("user-agent",p),r.headers.get("user-agent")||r.headers.set("x-mistral-user-agent",p),r}}return fs.CustomUserAgentHook=v,fs}var ds={},xl;function nS(){if(xl)return ds;xl=1,Object.defineProperty(ds,"__esModule",{value:!0}),ds.DeprecationWarningHook=void 0;const o="x-model-deprecation-timestamp";class v{afterSuccess(g,r){return r.headers.has(o)&&r.clone().json().then(m=>{const p=m.model;console.warn(`WARNING: The model ${p} is deprecated and will be removed on ${r.headers.get(o)}. Please refer to https://docs.mistral.ai/getting-started/models/#api-versioning for more information.`)}),r}}return ds.DeprecationWarningHook=v,ds}var kl;function rS(){if(kl)return qc;kl=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.initHooks=b;const o=tS(),v=nS();function b(g){const r=new o.CustomUserAgentHook;g.registerBeforeRequestHook(r);const m=new v.DeprecationWarningHook;g.registerAfterSuccessHook(m)}return qc}var ef;function aS(){if(ef)return ls;ef=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.SDKHooks=void 0;const o=rS();class v{constructor(){this.sdkInitHooks=[],this.beforeCreateRequestHooks=[],this.beforeRequestHooks=[],this.afterSuccessHooks=[],this.afterErrorHooks=[];const g=[];for(const r of g)"sdkInit"in r&&this.registerSDKInitHook(r),"beforeCreateRequest"in r&&this.registerBeforeCreateRequestHook(r),"beforeRequest"in r&&this.registerBeforeRequestHook(r),"afterSuccess"in r&&this.registerAfterSuccessHook(r),"afterError"in r&&this.registerAfterErrorHook(r);(0,o.initHooks)(this)}registerSDKInitHook(g){this.sdkInitHooks.push(g)}registerBeforeCreateRequestHook(g){this.beforeCreateRequestHooks.push(g)}registerBeforeRequestHook(g){this.beforeRequestHooks.push(g)}registerAfterSuccessHook(g){this.afterSuccessHooks.push(g)}registerAfterErrorHook(g){this.afterErrorHooks.push(g)}sdkInit(g){return this.sdkInitHooks.reduce((r,m)=>m.sdkInit(r),g)}beforeCreateRequest(g,r){let m=r;for(const p of this.beforeCreateRequestHooks)m=p.beforeCreateRequest(g,m);return m}async beforeRequest(g,r){let m=r;for(const p of this.beforeRequestHooks)m=await p.beforeRequest(g,m);return m}async afterSuccess(g,r){let m=r;for(const p of this.afterSuccessHooks)m=await p.afterSuccess(g,m);return m}async afterError(g,r,m){let p=r,u=m;for(const a of this.afterErrorHooks){const n=await a.afterError(g,p,u);p=n.response,u=n.error}return{response:p,error:u}}}return ls.SDKHooks=v,ls}var me={},tf;function _v(){if(tf)return me;tf=1,Object.defineProperty(me,"__esModule",{value:!0}),me.ConnectionError=me.RequestTimeoutError=me.RequestAbortedError=me.InvalidRequestError=me.UnexpectedClientError=me.HTTPClientError=void 0;class o extends Error{constructor(u,a){let n=u;a?.cause&&(n+=`: ${a.cause}`),super(n,a),this.name="HTTPClientError",typeof this.cause>"u"&&(this.cause=a?.cause)}}me.HTTPClientError=o;class v extends o{constructor(){super(...arguments),this.name="UnexpectedClientError"}}me.UnexpectedClientError=v;class b extends o{constructor(){super(...arguments),this.name="InvalidRequestError"}}me.InvalidRequestError=b;class g extends o{constructor(){super(...arguments),this.name="RequestAbortedError"}}me.RequestAbortedError=g;class r extends o{constructor(){super(...arguments),this.name="RequestTimeoutError"}}me.RequestTimeoutError=r;class m extends o{constructor(){super(...arguments),this.name="ConnectionError"}}return me.ConnectionError=m,me}var yu={},nf;function _e(){if(nf)return yu;nf=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.OK=o,yu.ERR=v,yu.unwrap=b,yu.unwrapAsync=g;function o(r){return{ok:!0,value:r}}function v(r){return{ok:!1,error:r}}function b(r){if(!r.ok)throw r.error;return r.value}async function g(r){const m=await r;if(!m.ok)throw m.error;return m.value}return yu}var de={},qe={},vu={},sn={},Dc={exports:{}},cn={},kc={},rf;function Ic(){return rf||(rf=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.getParsedType=o.ZodParsedType=o.objectUtil=o.util=void 0;var v;(function(r){r.assertEqual=a=>{};function m(a){}r.assertIs=m;function p(a){throw new Error}r.assertNever=p,r.arrayToEnum=a=>{const n={};for(const e of a)n[e]=e;return n},r.getValidEnumValues=a=>{const n=r.objectKeys(a).filter(t=>typeof a[a[t]]!="number"),e={};for(const t of n)e[t]=a[t];return r.objectValues(e)},r.objectValues=a=>r.objectKeys(a).map(function(n){return a[n]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const n=[];for(const e in a)Object.prototype.hasOwnProperty.call(a,e)&&n.push(e);return n},r.find=(a,n)=>{for(const e of a)if(n(e))return e},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function u(a,n=" | "){return a.map(e=>typeof e=="string"?`'${e}'`:e).join(n)}r.joinValues=u,r.jsonStringifyReplacer=(a,n)=>typeof n=="bigint"?n.toString():n})(v||(o.util=v={}));var b;(function(r){r.mergeShapes=(m,p)=>({...m,...p})})(b||(o.objectUtil=b={})),o.ZodParsedType=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const g=r=>{switch(typeof r){case"undefined":return o.ZodParsedType.undefined;case"string":return o.ZodParsedType.string;case"number":return Number.isNaN(r)?o.ZodParsedType.nan:o.ZodParsedType.number;case"boolean":return o.ZodParsedType.boolean;case"function":return o.ZodParsedType.function;case"bigint":return o.ZodParsedType.bigint;case"symbol":return o.ZodParsedType.symbol;case"object":return Array.isArray(r)?o.ZodParsedType.array:r===null?o.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?o.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?o.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?o.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?o.ZodParsedType.date:o.ZodParsedType.object;default:return o.ZodParsedType.unknown}};o.getParsedType=g})(kc)),kc}var af;function ul(){if(af)return cn;af=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.ZodError=cn.quotelessJson=cn.ZodIssueCode=void 0;const o=Ic();cn.ZodIssueCode=o.util.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"]);const v=g=>JSON.stringify(g,null,2).replace(/"([^"]+)":/g,"$1:");cn.quotelessJson=v;let b=class pv extends Error{get errors(){return this.issues}constructor(r){super(),this.issues=[],this.addIssue=p=>{this.issues=[...this.issues,p]},this.addIssues=(p=[])=>{this.issues=[...this.issues,...p]};const m=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,m):this.__proto__=m,this.name="ZodError",this.issues=r}format(r){const m=r||function(a){return a.message},p={_errors:[]},u=a=>{for(const n of a.issues)if(n.code==="invalid_union")n.unionErrors.map(u);else if(n.code==="invalid_return_type")u(n.returnTypeError);else if(n.code==="invalid_arguments")u(n.argumentsError);else if(n.path.length===0)p._errors.push(m(n));else{let e=p,t=0;for(;t<n.path.length;){const i=n.path[t];t===n.path.length-1?(e[i]=e[i]||{_errors:[]},e[i]._errors.push(m(n))):e[i]=e[i]||{_errors:[]},e=e[i],t++}}};return u(this),p}static assert(r){if(!(r instanceof pv))throw new Error(`Not a ZodError: ${r}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(r=m=>m.message){const m=Object.create(null),p=[];for(const u of this.issues)if(u.path.length>0){const a=u.path[0];m[a]=m[a]||[],m[a].push(r(u))}else p.push(r(u));return{formErrors:p,fieldErrors:m}}get formErrors(){return this.flatten()}};return cn.ZodError=b,b.create=g=>new b(g),cn}var of;function bv(){return of||(of=1,(function(o,v){Object.defineProperty(v,"__esModule",{value:!0});const b=ul(),g=Ic(),r=(m,p)=>{let u;switch(m.code){case b.ZodIssueCode.invalid_type:m.received===g.ZodParsedType.undefined?u="Required":u=`Expected ${m.expected}, received ${m.received}`;break;case b.ZodIssueCode.invalid_literal:u=`Invalid literal value, expected ${JSON.stringify(m.expected,g.util.jsonStringifyReplacer)}`;break;case b.ZodIssueCode.unrecognized_keys:u=`Unrecognized key(s) in object: ${g.util.joinValues(m.keys,", ")}`;break;case b.ZodIssueCode.invalid_union:u="Invalid input";break;case b.ZodIssueCode.invalid_union_discriminator:u=`Invalid discriminator value. Expected ${g.util.joinValues(m.options)}`;break;case b.ZodIssueCode.invalid_enum_value:u=`Invalid enum value. Expected ${g.util.joinValues(m.options)}, received '${m.received}'`;break;case b.ZodIssueCode.invalid_arguments:u="Invalid function arguments";break;case b.ZodIssueCode.invalid_return_type:u="Invalid function return type";break;case b.ZodIssueCode.invalid_date:u="Invalid date";break;case b.ZodIssueCode.invalid_string:typeof m.validation=="object"?"includes"in m.validation?(u=`Invalid input: must include "${m.validation.includes}"`,typeof m.validation.position=="number"&&(u=`${u} at one or more positions greater than or equal to ${m.validation.position}`)):"startsWith"in m.validation?u=`Invalid input: must start with "${m.validation.startsWith}"`:"endsWith"in m.validation?u=`Invalid input: must end with "${m.validation.endsWith}"`:g.util.assertNever(m.validation):m.validation!=="regex"?u=`Invalid ${m.validation}`:u="Invalid";break;case b.ZodIssueCode.too_small:m.type==="array"?u=`Array must contain ${m.exact?"exactly":m.inclusive?"at least":"more than"} ${m.minimum} element(s)`:m.type==="string"?u=`String must contain ${m.exact?"exactly":m.inclusive?"at least":"over"} ${m.minimum} character(s)`:m.type==="number"?u=`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:m.type==="bigint"?u=`Number must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${m.minimum}`:m.type==="date"?u=`Date must be ${m.exact?"exactly equal to ":m.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(m.minimum))}`:u="Invalid input";break;case b.ZodIssueCode.too_big:m.type==="array"?u=`Array must contain ${m.exact?"exactly":m.inclusive?"at most":"less than"} ${m.maximum} element(s)`:m.type==="string"?u=`String must contain ${m.exact?"exactly":m.inclusive?"at most":"under"} ${m.maximum} character(s)`:m.type==="number"?u=`Number must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:m.type==="bigint"?u=`BigInt must be ${m.exact?"exactly":m.inclusive?"less than or equal to":"less than"} ${m.maximum}`:m.type==="date"?u=`Date must be ${m.exact?"exactly":m.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(m.maximum))}`:u="Invalid input";break;case b.ZodIssueCode.custom:u="Invalid input";break;case b.ZodIssueCode.invalid_intersection_types:u="Intersection results could not be merged";break;case b.ZodIssueCode.not_multiple_of:u=`Number must be a multiple of ${m.multipleOf}`;break;case b.ZodIssueCode.not_finite:u="Number must be finite";break;default:u=p.defaultError,g.util.assertNever(m)}return{message:u}};v.default=r,o.exports=v.default})(Dc,Dc.exports)),Dc.exports}var uf;function sl(){if(uf)return sn;uf=1;var o=sn&&sn.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.defaultErrorMap=void 0,sn.setErrorMap=g,sn.getErrorMap=r;const v=o(bv());sn.defaultErrorMap=v.default;let b=v.default;function g(m){b=m}function r(){return b}return sn}var _s={},sf;function mv(){return sf||(sf=1,(function(o){var v=_s&&_s.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(o,"__esModule",{value:!0}),o.isAsync=o.isValid=o.isDirty=o.isAborted=o.OK=o.DIRTY=o.INVALID=o.ParseStatus=o.EMPTY_PATH=o.makeIssue=void 0,o.addIssueToContext=m;const b=sl(),g=v(bv()),r=s=>{const{data:f,path:c,errorMaps:l,issueData:d}=s,_=[...c,...d.path||[]],y={...d,path:_};if(d.message!==void 0)return{...d,path:_,message:d.message};let h="";const j=l.filter(M=>!!M).slice().reverse();for(const M of j)h=M(y,{data:f,defaultError:h}).message;return{...d,path:_,message:h}};o.makeIssue=r,o.EMPTY_PATH=[];function m(s,f){const c=(0,b.getErrorMap)(),l=(0,o.makeIssue)({issueData:f,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,c,c===g.default?void 0:g.default].filter(d=>!!d)});s.common.issues.push(l)}class p{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(f,c){const l=[];for(const d of c){if(d.status==="aborted")return o.INVALID;d.status==="dirty"&&f.dirty(),l.push(d.value)}return{status:f.value,value:l}}static async mergeObjectAsync(f,c){const l=[];for(const d of c){const _=await d.key,y=await d.value;l.push({key:_,value:y})}return p.mergeObjectSync(f,l)}static mergeObjectSync(f,c){const l={};for(const d of c){const{key:_,value:y}=d;if(_.status==="aborted"||y.status==="aborted")return o.INVALID;_.status==="dirty"&&f.dirty(),y.status==="dirty"&&f.dirty(),_.value!=="__proto__"&&(typeof y.value<"u"||d.alwaysSet)&&(l[_.value]=y.value)}return{status:f.value,value:l}}}o.ParseStatus=p,o.INVALID=Object.freeze({status:"aborted"});const u=s=>({status:"dirty",value:s});o.DIRTY=u;const a=s=>({status:"valid",value:s});o.OK=a;const n=s=>s.status==="aborted";o.isAborted=n;const e=s=>s.status==="dirty";o.isDirty=e;const t=s=>s.status==="valid";o.isValid=t;const i=s=>typeof Promise<"u"&&s instanceof Promise;o.isAsync=i})(_s)),_s}var el={},cf;function oS(){return cf||(cf=1,Object.defineProperty(el,"__esModule",{value:!0})),el}var X={},ps={},lf;function iS(){if(lf)return ps;lf=1,Object.defineProperty(ps,"__esModule",{value:!0}),ps.errorUtil=void 0;var o;return(function(v){v.errToObj=b=>typeof b=="string"?{message:b}:b||{},v.toString=b=>typeof b=="string"?b:b?.message})(o||(ps.errorUtil=o={})),ps}var ff;function uS(){if(ff)return X;ff=1,Object.defineProperty(X,"__esModule",{value:!0}),X.discriminatedUnion=X.date=X.boolean=X.bigint=X.array=X.any=X.coerce=X.ZodFirstPartyTypeKind=X.late=X.ZodSchema=X.Schema=X.ZodReadonly=X.ZodPipeline=X.ZodBranded=X.BRAND=X.ZodNaN=X.ZodCatch=X.ZodDefault=X.ZodNullable=X.ZodOptional=X.ZodTransformer=X.ZodEffects=X.ZodPromise=X.ZodNativeEnum=X.ZodEnum=X.ZodLiteral=X.ZodLazy=X.ZodFunction=X.ZodSet=X.ZodMap=X.ZodRecord=X.ZodTuple=X.ZodIntersection=X.ZodDiscriminatedUnion=X.ZodUnion=X.ZodObject=X.ZodArray=X.ZodVoid=X.ZodNever=X.ZodUnknown=X.ZodAny=X.ZodNull=X.ZodUndefined=X.ZodSymbol=X.ZodDate=X.ZodBoolean=X.ZodBigInt=X.ZodNumber=X.ZodString=X.ZodType=void 0,X.NEVER=X.void=X.unknown=X.union=X.undefined=X.tuple=X.transformer=X.symbol=X.string=X.strictObject=X.set=X.record=X.promise=X.preprocess=X.pipeline=X.ostring=X.optional=X.onumber=X.oboolean=X.object=X.number=X.nullable=X.null=X.never=X.nativeEnum=X.nan=X.map=X.literal=X.lazy=X.intersection=X.instanceof=X.function=X.enum=X.effect=void 0,X.datetimeRegex=P,X.custom=Ul;const o=ul(),v=sl(),b=iS(),g=mv(),r=Ic();class m{constructor(O,R,J,L){this._cachedPath=[],this.parent=O,this.data=R,this._path=J,this._key=L}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(E,O)=>{if((0,g.isValid)(O))return{success:!0,data:O.value};if(!E.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const R=new o.ZodError(E.common.issues);return this._error=R,this._error}}};function u(E){if(!E)return{};const{errorMap:O,invalid_type_error:R,required_error:J,description:L}=E;if(O&&(R||J))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return O?{errorMap:O,description:L}:{errorMap:(H,z)=>{const{message:ee}=E;return H.code==="invalid_enum_value"?{message:ee??z.defaultError}:typeof z.data>"u"?{message:ee??J??z.defaultError}:H.code!=="invalid_type"?{message:z.defaultError}:{message:ee??R??z.defaultError}},description:L}}class a{get description(){return this._def.description}_getType(O){return(0,r.getParsedType)(O.data)}_getOrReturnCtx(O,R){return R||{common:O.parent.common,data:O.data,parsedType:(0,r.getParsedType)(O.data),schemaErrorMap:this._def.errorMap,path:O.path,parent:O.parent}}_processInputParams(O){return{status:new g.ParseStatus,ctx:{common:O.parent.common,data:O.data,parsedType:(0,r.getParsedType)(O.data),schemaErrorMap:this._def.errorMap,path:O.path,parent:O.parent}}}_parseSync(O){const R=this._parse(O);if((0,g.isAsync)(R))throw new Error("Synchronous parse encountered promise.");return R}_parseAsync(O){const R=this._parse(O);return Promise.resolve(R)}parse(O,R){const J=this.safeParse(O,R);if(J.success)return J.data;throw J.error}safeParse(O,R){const J={common:{issues:[],async:R?.async??!1,contextualErrorMap:R?.errorMap},path:R?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)},L=this._parseSync({data:O,path:J.path,parent:J});return p(J,L)}"~validate"(O){const R={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)};if(!this["~standard"].async)try{const J=this._parseSync({data:O,path:[],parent:R});return(0,g.isValid)(J)?{value:J.value}:{issues:R.common.issues}}catch(J){J?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),R.common={issues:[],async:!0}}return this._parseAsync({data:O,path:[],parent:R}).then(J=>(0,g.isValid)(J)?{value:J.value}:{issues:R.common.issues})}async parseAsync(O,R){const J=await this.safeParseAsync(O,R);if(J.success)return J.data;throw J.error}async safeParseAsync(O,R){const J={common:{issues:[],contextualErrorMap:R?.errorMap,async:!0},path:R?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:O,parsedType:(0,r.getParsedType)(O)},L=this._parse({data:O,path:J.path,parent:J}),U=await((0,g.isAsync)(L)?L:Promise.resolve(L));return p(J,U)}refine(O,R){const J=L=>typeof R=="string"||typeof R>"u"?{message:R}:typeof R=="function"?R(L):R;return this._refinement((L,U)=>{const H=O(L),z=()=>U.addIssue({code:o.ZodIssueCode.custom,...J(L)});return typeof Promise<"u"&&H instanceof Promise?H.then(ee=>ee?!0:(z(),!1)):H?!0:(z(),!1)})}refinement(O,R){return this._refinement((J,L)=>O(J)?!0:(L.addIssue(typeof R=="function"?R(J,L):R),!1))}_refinement(O){return new Re({schema:this,typeName:oe.ZodEffects,effect:{type:"refinement",refinement:O}})}superRefine(O){return this._refinement(O)}constructor(O){this.spa=this.safeParseAsync,this._def=O,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 Ie.create(this,this._def)}nullable(){return du.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ge.create(this)}promise(){return Xu.create(this,this._def)}or(O){return xu.create([this,O],this._def)}and(O){return ku.create(this,O,this._def)}transform(O){return new Re({...u(this._def),schema:this,typeName:oe.ZodEffects,effect:{type:"transform",transform:O}})}default(O){const R=typeof O=="function"?O:()=>O;return new as({...u(this._def),innerType:this,defaultValue:R,typeName:oe.ZodDefault})}brand(){return new Qc({typeName:oe.ZodBranded,type:this,...u(this._def)})}catch(O){const R=typeof O=="function"?O:()=>O;return new os({...u(this._def),innerType:this,catchValue:R,typeName:oe.ZodCatch})}describe(O){const R=this.constructor;return new R({...this._def,description:O})}pipe(O){return is.create(this,O)}readonly(){return us.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}X.ZodType=a,X.Schema=a,X.ZodSchema=a;const n=/^c[^\s-]{8,}$/i,e=/^[0-9a-z]+$/,t=/^[0-9A-HJKMNP-TV-Z]{26}$/i,i=/^[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,s=/^[a-z0-9_-]{21}$/i,f=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,c=/^[-+]?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)?)??$/,l=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,d="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let _;const y=/^(?:(?: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])$/,h=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,M=/^(([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])$/,T=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,A=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,N="((\\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])))",D=new RegExp(`^${N}$`);function S(E){let O="[0-5]\\d";E.precision?O=`${O}\\.\\d{${E.precision}}`:E.precision==null&&(O=`${O}(\\.\\d+)?`);const R=E.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${O})${R}`}function C(E){return new RegExp(`^${S(E)}$`)}function P(E){let O=`${N}T${S(E)}`;const R=[];return R.push(E.local?"Z?":"Z"),E.offset&&R.push("([+-]\\d{2}:?\\d{2})"),O=`${O}(${R.join("|")})`,new RegExp(`^${O}$`)}function w(E,O){return!!((O==="v4"||!O)&&y.test(E)||(O==="v6"||!O)&&j.test(E))}function q(E,O){if(!f.test(E))return!1;try{const[R]=E.split(".");if(!R)return!1;const J=R.replace(/-/g,"+").replace(/_/g,"/").padEnd(R.length+(4-R.length%4)%4,"="),L=JSON.parse(atob(J));return!(typeof L!="object"||L===null||"typ"in L&&L?.typ!=="JWT"||!L.alg||O&&L.alg!==O)}catch{return!1}}function B(E,O){return!!((O==="v4"||!O)&&h.test(E)||(O==="v6"||!O)&&M.test(E))}class V extends a{_parse(O){if(this._def.coerce&&(O.data=String(O.data)),this._getType(O)!==r.ZodParsedType.string){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:U.parsedType}),g.INVALID}const J=new g.ParseStatus;let L;for(const U of this._def.checks)if(U.kind==="min")O.data.length<U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"string",inclusive:!0,exact:!1,message:U.message}),J.dirty());else if(U.kind==="max")O.data.length>U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"string",inclusive:!0,exact:!1,message:U.message}),J.dirty());else if(U.kind==="length"){const H=O.data.length>U.value,z=O.data.length<U.value;(H||z)&&(L=this._getOrReturnCtx(O,L),H?(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"string",inclusive:!0,exact:!0,message:U.message}):z&&(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"string",inclusive:!0,exact:!0,message:U.message}),J.dirty())}else if(U.kind==="email")l.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"email",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="emoji")_||(_=new RegExp(d,"u")),_.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"emoji",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="uuid")i.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"uuid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="nanoid")s.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"nanoid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="cuid")n.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cuid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="cuid2")e.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cuid2",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="ulid")t.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"ulid",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty());else if(U.kind==="url")try{new URL(O.data)}catch{L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"url",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()}else U.kind==="regex"?(U.regex.lastIndex=0,U.regex.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"regex",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty())):U.kind==="trim"?O.data=O.data.trim():U.kind==="includes"?O.data.includes(U.value,U.position)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{includes:U.value,position:U.position},message:U.message}),J.dirty()):U.kind==="toLowerCase"?O.data=O.data.toLowerCase():U.kind==="toUpperCase"?O.data=O.data.toUpperCase():U.kind==="startsWith"?O.data.startsWith(U.value)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{startsWith:U.value},message:U.message}),J.dirty()):U.kind==="endsWith"?O.data.endsWith(U.value)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:{endsWith:U.value},message:U.message}),J.dirty()):U.kind==="datetime"?P(U).test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"datetime",message:U.message}),J.dirty()):U.kind==="date"?D.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"date",message:U.message}),J.dirty()):U.kind==="time"?C(U).test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.invalid_string,validation:"time",message:U.message}),J.dirty()):U.kind==="duration"?c.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"duration",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="ip"?w(O.data,U.version)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"ip",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="jwt"?q(O.data,U.alg)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"jwt",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="cidr"?B(O.data,U.version)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"cidr",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="base64"?T.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"base64",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):U.kind==="base64url"?A.test(O.data)||(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{validation:"base64url",code:o.ZodIssueCode.invalid_string,message:U.message}),J.dirty()):r.util.assertNever(U);return{status:J.value,value:O.data}}_regex(O,R,J){return this.refinement(L=>O.test(L),{validation:R,code:o.ZodIssueCode.invalid_string,...b.errorUtil.errToObj(J)})}_addCheck(O){return new V({...this._def,checks:[...this._def.checks,O]})}email(O){return this._addCheck({kind:"email",...b.errorUtil.errToObj(O)})}url(O){return this._addCheck({kind:"url",...b.errorUtil.errToObj(O)})}emoji(O){return this._addCheck({kind:"emoji",...b.errorUtil.errToObj(O)})}uuid(O){return this._addCheck({kind:"uuid",...b.errorUtil.errToObj(O)})}nanoid(O){return this._addCheck({kind:"nanoid",...b.errorUtil.errToObj(O)})}cuid(O){return this._addCheck({kind:"cuid",...b.errorUtil.errToObj(O)})}cuid2(O){return this._addCheck({kind:"cuid2",...b.errorUtil.errToObj(O)})}ulid(O){return this._addCheck({kind:"ulid",...b.errorUtil.errToObj(O)})}base64(O){return this._addCheck({kind:"base64",...b.errorUtil.errToObj(O)})}base64url(O){return this._addCheck({kind:"base64url",...b.errorUtil.errToObj(O)})}jwt(O){return this._addCheck({kind:"jwt",...b.errorUtil.errToObj(O)})}ip(O){return this._addCheck({kind:"ip",...b.errorUtil.errToObj(O)})}cidr(O){return this._addCheck({kind:"cidr",...b.errorUtil.errToObj(O)})}datetime(O){return typeof O=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:O}):this._addCheck({kind:"datetime",precision:typeof O?.precision>"u"?null:O?.precision,offset:O?.offset??!1,local:O?.local??!1,...b.errorUtil.errToObj(O?.message)})}date(O){return this._addCheck({kind:"date",message:O})}time(O){return typeof O=="string"?this._addCheck({kind:"time",precision:null,message:O}):this._addCheck({kind:"time",precision:typeof O?.precision>"u"?null:O?.precision,...b.errorUtil.errToObj(O?.message)})}duration(O){return this._addCheck({kind:"duration",...b.errorUtil.errToObj(O)})}regex(O,R){return this._addCheck({kind:"regex",regex:O,...b.errorUtil.errToObj(R)})}includes(O,R){return this._addCheck({kind:"includes",value:O,position:R?.position,...b.errorUtil.errToObj(R?.message)})}startsWith(O,R){return this._addCheck({kind:"startsWith",value:O,...b.errorUtil.errToObj(R)})}endsWith(O,R){return this._addCheck({kind:"endsWith",value:O,...b.errorUtil.errToObj(R)})}min(O,R){return this._addCheck({kind:"min",value:O,...b.errorUtil.errToObj(R)})}max(O,R){return this._addCheck({kind:"max",value:O,...b.errorUtil.errToObj(R)})}length(O,R){return this._addCheck({kind:"length",value:O,...b.errorUtil.errToObj(R)})}nonempty(O){return this.min(1,b.errorUtil.errToObj(O))}trim(){return new V({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new V({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(O=>O.kind==="datetime")}get isDate(){return!!this._def.checks.find(O=>O.kind==="date")}get isTime(){return!!this._def.checks.find(O=>O.kind==="time")}get isDuration(){return!!this._def.checks.find(O=>O.kind==="duration")}get isEmail(){return!!this._def.checks.find(O=>O.kind==="email")}get isURL(){return!!this._def.checks.find(O=>O.kind==="url")}get isEmoji(){return!!this._def.checks.find(O=>O.kind==="emoji")}get isUUID(){return!!this._def.checks.find(O=>O.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(O=>O.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(O=>O.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(O=>O.kind==="cuid2")}get isULID(){return!!this._def.checks.find(O=>O.kind==="ulid")}get isIP(){return!!this._def.checks.find(O=>O.kind==="ip")}get isCIDR(){return!!this._def.checks.find(O=>O.kind==="cidr")}get isBase64(){return!!this._def.checks.find(O=>O.kind==="base64")}get isBase64url(){return!!this._def.checks.find(O=>O.kind==="base64url")}get minLength(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxLength(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}}X.ZodString=V,V.create=E=>new V({checks:[],typeName:oe.ZodString,coerce:E?.coerce??!1,...u(E)});function Z(E,O){const R=(E.toString().split(".")[1]||"").length,J=(O.toString().split(".")[1]||"").length,L=R>J?R:J,U=Number.parseInt(E.toFixed(L).replace(".","")),H=Number.parseInt(O.toFixed(L).replace(".",""));return U%H/10**L}class k extends a{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(O){if(this._def.coerce&&(O.data=Number(O.data)),this._getType(O)!==r.ZodParsedType.number){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:U.parsedType}),g.INVALID}let J;const L=new g.ParseStatus;for(const U of this._def.checks)U.kind==="int"?r.util.isInteger(O.data)||(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:U.message}),L.dirty()):U.kind==="min"?(U.inclusive?O.data<U.value:O.data<=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:U.value,type:"number",inclusive:U.inclusive,exact:!1,message:U.message}),L.dirty()):U.kind==="max"?(U.inclusive?O.data>U.value:O.data>=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:U.value,type:"number",inclusive:U.inclusive,exact:!1,message:U.message}),L.dirty()):U.kind==="multipleOf"?Z(O.data,U.value)!==0&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_multiple_of,multipleOf:U.value,message:U.message}),L.dirty()):U.kind==="finite"?Number.isFinite(O.data)||(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_finite,message:U.message}),L.dirty()):r.util.assertNever(U);return{status:L.value,value:O.data}}gte(O,R){return this.setLimit("min",O,!0,b.errorUtil.toString(R))}gt(O,R){return this.setLimit("min",O,!1,b.errorUtil.toString(R))}lte(O,R){return this.setLimit("max",O,!0,b.errorUtil.toString(R))}lt(O,R){return this.setLimit("max",O,!1,b.errorUtil.toString(R))}setLimit(O,R,J,L){return new k({...this._def,checks:[...this._def.checks,{kind:O,value:R,inclusive:J,message:b.errorUtil.toString(L)}]})}_addCheck(O){return new k({...this._def,checks:[...this._def.checks,O]})}int(O){return this._addCheck({kind:"int",message:b.errorUtil.toString(O)})}positive(O){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.errorUtil.toString(O)})}negative(O){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.errorUtil.toString(O)})}nonpositive(O){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.errorUtil.toString(O)})}nonnegative(O){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.errorUtil.toString(O)})}multipleOf(O,R){return this._addCheck({kind:"multipleOf",value:O,message:b.errorUtil.toString(R)})}finite(O){return this._addCheck({kind:"finite",message:b.errorUtil.toString(O)})}safe(O){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.errorUtil.toString(O)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.errorUtil.toString(O)})}get minValue(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxValue(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}get isInt(){return!!this._def.checks.find(O=>O.kind==="int"||O.kind==="multipleOf"&&r.util.isInteger(O.value))}get isFinite(){let O=null,R=null;for(const J of this._def.checks){if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;J.kind==="min"?(R===null||J.value>R)&&(R=J.value):J.kind==="max"&&(O===null||J.value<O)&&(O=J.value)}return Number.isFinite(R)&&Number.isFinite(O)}}X.ZodNumber=k,k.create=E=>new k({checks:[],typeName:oe.ZodNumber,coerce:E?.coerce||!1,...u(E)});class ae extends a{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(O){if(this._def.coerce)try{O.data=BigInt(O.data)}catch{return this._getInvalidInput(O)}if(this._getType(O)!==r.ZodParsedType.bigint)return this._getInvalidInput(O);let J;const L=new g.ParseStatus;for(const U of this._def.checks)U.kind==="min"?(U.inclusive?O.data<U.value:O.data<=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,type:"bigint",minimum:U.value,inclusive:U.inclusive,message:U.message}),L.dirty()):U.kind==="max"?(U.inclusive?O.data>U.value:O.data>=U.value)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,type:"bigint",maximum:U.value,inclusive:U.inclusive,message:U.message}),L.dirty()):U.kind==="multipleOf"?O.data%U.value!==BigInt(0)&&(J=this._getOrReturnCtx(O,J),(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.not_multiple_of,multipleOf:U.value,message:U.message}),L.dirty()):r.util.assertNever(U);return{status:L.value,value:O.data}}_getInvalidInput(O){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:R.parsedType}),g.INVALID}gte(O,R){return this.setLimit("min",O,!0,b.errorUtil.toString(R))}gt(O,R){return this.setLimit("min",O,!1,b.errorUtil.toString(R))}lte(O,R){return this.setLimit("max",O,!0,b.errorUtil.toString(R))}lt(O,R){return this.setLimit("max",O,!1,b.errorUtil.toString(R))}setLimit(O,R,J,L){return new ae({...this._def,checks:[...this._def.checks,{kind:O,value:R,inclusive:J,message:b.errorUtil.toString(L)}]})}_addCheck(O){return new ae({...this._def,checks:[...this._def.checks,O]})}positive(O){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(O)})}negative(O){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.errorUtil.toString(O)})}nonpositive(O){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(O)})}nonnegative(O){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.errorUtil.toString(O)})}multipleOf(O,R){return this._addCheck({kind:"multipleOf",value:O,message:b.errorUtil.toString(R)})}get minValue(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O}get maxValue(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O}}X.ZodBigInt=ae,ae.create=E=>new ae({checks:[],typeName:oe.ZodBigInt,coerce:E?.coerce??!1,...u(E)});class ue extends a{_parse(O){if(this._def.coerce&&(O.data=!!O.data),this._getType(O)!==r.ZodParsedType.boolean){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodBoolean=ue,ue.create=E=>new ue({typeName:oe.ZodBoolean,coerce:E?.coerce||!1,...u(E)});class be extends a{_parse(O){if(this._def.coerce&&(O.data=new Date(O.data)),this._getType(O)!==r.ZodParsedType.date){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:U.parsedType}),g.INVALID}if(Number.isNaN(O.data.getTime())){const U=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(U,{code:o.ZodIssueCode.invalid_date}),g.INVALID}const J=new g.ParseStatus;let L;for(const U of this._def.checks)U.kind==="min"?O.data.getTime()<U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_small,message:U.message,inclusive:!0,exact:!1,minimum:U.value,type:"date"}),J.dirty()):U.kind==="max"?O.data.getTime()>U.value&&(L=this._getOrReturnCtx(O,L),(0,g.addIssueToContext)(L,{code:o.ZodIssueCode.too_big,message:U.message,inclusive:!0,exact:!1,maximum:U.value,type:"date"}),J.dirty()):r.util.assertNever(U);return{status:J.value,value:new Date(O.data.getTime())}}_addCheck(O){return new be({...this._def,checks:[...this._def.checks,O]})}min(O,R){return this._addCheck({kind:"min",value:O.getTime(),message:b.errorUtil.toString(R)})}max(O,R){return this._addCheck({kind:"max",value:O.getTime(),message:b.errorUtil.toString(R)})}get minDate(){let O=null;for(const R of this._def.checks)R.kind==="min"&&(O===null||R.value>O)&&(O=R.value);return O!=null?new Date(O):null}get maxDate(){let O=null;for(const R of this._def.checks)R.kind==="max"&&(O===null||R.value<O)&&(O=R.value);return O!=null?new Date(O):null}}X.ZodDate=be,be.create=E=>new be({checks:[],coerce:E?.coerce||!1,typeName:oe.ZodDate,...u(E)});class lu extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.symbol){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodSymbol=lu,lu.create=E=>new lu({typeName:oe.ZodSymbol,...u(E)});class he extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.undefined){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodUndefined=he,he.create=E=>new he({typeName:oe.ZodUndefined,...u(E)});class mu extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.null){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodNull=mu,mu.create=E=>new mu({typeName:oe.ZodNull,...u(E)});class Me extends a{constructor(){super(...arguments),this._any=!0}_parse(O){return(0,g.OK)(O.data)}}X.ZodAny=Me,Me.create=E=>new Me({typeName:oe.ZodAny,...u(E)});class Ce extends a{constructor(){super(...arguments),this._unknown=!0}_parse(O){return(0,g.OK)(O.data)}}X.ZodUnknown=Ce,Ce.create=E=>new Ce({typeName:oe.ZodUnknown,...u(E)});class se extends a{_parse(O){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:R.parsedType}),g.INVALID}}X.ZodNever=se,se.create=E=>new se({typeName:oe.ZodNever,...u(E)});class Oe extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.undefined){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:J.parsedType}),g.INVALID}return(0,g.OK)(O.data)}}X.ZodVoid=Oe,Oe.create=E=>new Oe({typeName:oe.ZodVoid,...u(E)});class ge extends a{_parse(O){const{ctx:R,status:J}=this._processInputParams(O),L=this._def;if(R.parsedType!==r.ZodParsedType.array)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:R.parsedType}),g.INVALID;if(L.exactLength!==null){const H=R.data.length>L.exactLength.value,z=R.data.length<L.exactLength.value;(H||z)&&((0,g.addIssueToContext)(R,{code:H?o.ZodIssueCode.too_big:o.ZodIssueCode.too_small,minimum:z?L.exactLength.value:void 0,maximum:H?L.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:L.exactLength.message}),J.dirty())}if(L.minLength!==null&&R.data.length<L.minLength.value&&((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.too_small,minimum:L.minLength.value,type:"array",inclusive:!0,exact:!1,message:L.minLength.message}),J.dirty()),L.maxLength!==null&&R.data.length>L.maxLength.value&&((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),J.dirty()),R.common.async)return Promise.all([...R.data].map((H,z)=>L.type._parseAsync(new m(R,H,R.path,z)))).then(H=>g.ParseStatus.mergeArray(J,H));const U=[...R.data].map((H,z)=>L.type._parseSync(new m(R,H,R.path,z)));return g.ParseStatus.mergeArray(J,U)}get element(){return this._def.type}min(O,R){return new ge({...this._def,minLength:{value:O,message:b.errorUtil.toString(R)}})}max(O,R){return new ge({...this._def,maxLength:{value:O,message:b.errorUtil.toString(R)}})}length(O,R){return new ge({...this._def,exactLength:{value:O,message:b.errorUtil.toString(R)}})}nonempty(O){return this.min(1,O)}}X.ZodArray=ge,ge.create=(E,O)=>new ge({type:E,minLength:null,maxLength:null,exactLength:null,typeName:oe.ZodArray,...u(O)});function Ku(E){if(E instanceof ce){const O={};for(const R in E.shape){const J=E.shape[R];O[R]=Ie.create(Ku(J))}return new ce({...E._def,shape:()=>O})}else return E instanceof ge?new ge({...E._def,type:Ku(E.element)}):E instanceof Ie?Ie.create(Ku(E.unwrap())):E instanceof du?du.create(Ku(E.unwrap())):E instanceof Fe?Fe.create(E.items.map(O=>Ku(O))):E}class ce extends a{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const O=this._def.shape(),R=r.util.objectKeys(O);return this._cached={shape:O,keys:R},this._cached}_parse(O){if(this._getType(O)!==r.ZodParsedType.object){const te=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(te,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:te.parsedType}),g.INVALID}const{status:J,ctx:L}=this._processInputParams(O),{shape:U,keys:H}=this._getCached(),z=[];if(!(this._def.catchall instanceof se&&this._def.unknownKeys==="strip"))for(const te in L.data)H.includes(te)||z.push(te);const ee=[];for(const te of H){const ie=U[te],Se=L.data[te];ee.push({key:{status:"valid",value:te},value:ie._parse(new m(L,Se,L.path,te)),alwaysSet:te in L.data})}if(this._def.catchall instanceof se){const te=this._def.unknownKeys;if(te==="passthrough")for(const ie of z)ee.push({key:{status:"valid",value:ie},value:{status:"valid",value:L.data[ie]}});else if(te==="strict")z.length>0&&((0,g.addIssueToContext)(L,{code:o.ZodIssueCode.unrecognized_keys,keys:z}),J.dirty());else if(te!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const te=this._def.catchall;for(const ie of z){const Se=L.data[ie];ee.push({key:{status:"valid",value:ie},value:te._parse(new m(L,Se,L.path,ie)),alwaysSet:ie in L.data})}}return L.common.async?Promise.resolve().then(async()=>{const te=[];for(const ie of ee){const Se=await ie.key,zl=await ie.value;te.push({key:Se,value:zl,alwaysSet:ie.alwaysSet})}return te}).then(te=>g.ParseStatus.mergeObjectSync(J,te)):g.ParseStatus.mergeObjectSync(J,ee)}get shape(){return this._def.shape()}strict(O){return b.errorUtil.errToObj,new ce({...this._def,unknownKeys:"strict",...O!==void 0?{errorMap:(R,J)=>{const L=this._def.errorMap?.(R,J).message??J.defaultError;return R.code==="unrecognized_keys"?{message:b.errorUtil.errToObj(O).message??L}:{message:L}}}:{}})}strip(){return new ce({...this._def,unknownKeys:"strip"})}passthrough(){return new ce({...this._def,unknownKeys:"passthrough"})}extend(O){return new ce({...this._def,shape:()=>({...this._def.shape(),...O})})}merge(O){return new ce({unknownKeys:O._def.unknownKeys,catchall:O._def.catchall,shape:()=>({...this._def.shape(),...O._def.shape()}),typeName:oe.ZodObject})}setKey(O,R){return this.augment({[O]:R})}catchall(O){return new ce({...this._def,catchall:O})}pick(O){const R={};for(const J of r.util.objectKeys(O))O[J]&&this.shape[J]&&(R[J]=this.shape[J]);return new ce({...this._def,shape:()=>R})}omit(O){const R={};for(const J of r.util.objectKeys(this.shape))O[J]||(R[J]=this.shape[J]);return new ce({...this._def,shape:()=>R})}deepPartial(){return Ku(this)}partial(O){const R={};for(const J of r.util.objectKeys(this.shape)){const L=this.shape[J];O&&!O[J]?R[J]=L:R[J]=L.optional()}return new ce({...this._def,shape:()=>R})}required(O){const R={};for(const J of r.util.objectKeys(this.shape))if(O&&!O[J])R[J]=this.shape[J];else{let U=this.shape[J];for(;U instanceof Ie;)U=U._def.innerType;R[J]=U}return new ce({...this._def,shape:()=>R})}keyof(){return Ll(r.util.objectKeys(this.shape))}}X.ZodObject=ce,ce.create=(E,O)=>new ce({shape:()=>E,unknownKeys:"strip",catchall:se.create(),typeName:oe.ZodObject,...u(O)}),ce.strictCreate=(E,O)=>new ce({shape:()=>E,unknownKeys:"strict",catchall:se.create(),typeName:oe.ZodObject,...u(O)}),ce.lazycreate=(E,O)=>new ce({shape:E,unknownKeys:"strip",catchall:se.create(),typeName:oe.ZodObject,...u(O)});class xu extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J=this._def.options;function L(U){for(const z of U)if(z.result.status==="valid")return z.result;for(const z of U)if(z.result.status==="dirty")return R.common.issues.push(...z.ctx.common.issues),z.result;const H=U.map(z=>new o.ZodError(z.ctx.common.issues));return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union,unionErrors:H}),g.INVALID}if(R.common.async)return Promise.all(J.map(async U=>{const H={...R,common:{...R.common,issues:[]},parent:null};return{result:await U._parseAsync({data:R.data,path:R.path,parent:H}),ctx:H}})).then(L);{let U;const H=[];for(const ee of J){const te={...R,common:{...R.common,issues:[]},parent:null},ie=ee._parseSync({data:R.data,path:R.path,parent:te});if(ie.status==="valid")return ie;ie.status==="dirty"&&!U&&(U={result:ie,ctx:te}),te.common.issues.length&&H.push(te.common.issues)}if(U)return R.common.issues.push(...U.ctx.common.issues),U.result;const z=H.map(ee=>new o.ZodError(ee));return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union,unionErrors:z}),g.INVALID}}get options(){return this._def.options}}X.ZodUnion=xu,xu.create=(E,O)=>new xu({options:E,typeName:oe.ZodUnion,...u(O)});const on=E=>E instanceof ts?on(E.schema):E instanceof Re?on(E.innerType()):E instanceof ns?[E.value]:E instanceof fu?E.options:E instanceof rs?r.util.objectValues(E.enum):E instanceof as?on(E._def.innerType):E instanceof he?[void 0]:E instanceof mu?[null]:E instanceof Ie?[void 0,...on(E.unwrap())]:E instanceof du?[null,...on(E.unwrap())]:E instanceof Qc||E instanceof us?on(E.unwrap()):E instanceof os?on(E._def.innerType):[];class Cc extends a{_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.object)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:R.parsedType}),g.INVALID;const J=this.discriminator,L=R.data[J],U=this.optionsMap.get(L);return U?R.common.async?U._parseAsync({data:R.data,path:R.path,parent:R}):U._parseSync({data:R.data,path:R.path,parent:R}):((0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),g.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(O,R,J){const L=new Map;for(const U of R){const H=on(U.shape[O]);if(!H.length)throw new Error(`A discriminator value for key \`${O}\` could not be extracted from all schema options`);for(const z of H){if(L.has(z))throw new Error(`Discriminator property ${String(O)} has duplicate value ${String(z)}`);L.set(z,U)}}return new Cc({typeName:oe.ZodDiscriminatedUnion,discriminator:O,options:R,optionsMap:L,...u(J)})}}X.ZodDiscriminatedUnion=Cc;function Wc(E,O){const R=(0,r.getParsedType)(E),J=(0,r.getParsedType)(O);if(E===O)return{valid:!0,data:E};if(R===r.ZodParsedType.object&&J===r.ZodParsedType.object){const L=r.util.objectKeys(O),U=r.util.objectKeys(E).filter(z=>L.indexOf(z)!==-1),H={...E,...O};for(const z of U){const ee=Wc(E[z],O[z]);if(!ee.valid)return{valid:!1};H[z]=ee.data}return{valid:!0,data:H}}else if(R===r.ZodParsedType.array&&J===r.ZodParsedType.array){if(E.length!==O.length)return{valid:!1};const L=[];for(let U=0;U<E.length;U++){const H=E[U],z=O[U],ee=Wc(H,z);if(!ee.valid)return{valid:!1};L.push(ee.data)}return{valid:!0,data:L}}else return R===r.ZodParsedType.date&&J===r.ZodParsedType.date&&+E==+O?{valid:!0,data:E}:{valid:!1}}class ku extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O),L=(U,H)=>{if((0,g.isAborted)(U)||(0,g.isAborted)(H))return g.INVALID;const z=Wc(U.value,H.value);return z.valid?(((0,g.isDirty)(U)||(0,g.isDirty)(H))&&R.dirty(),{status:R.value,value:z.data}):((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_intersection_types}),g.INVALID)};return J.common.async?Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([U,H])=>L(U,H)):L(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}X.ZodIntersection=ku,ku.create=(E,O,R)=>new ku({left:E,right:O,typeName:oe.ZodIntersection,...u(R)});class Fe extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.array)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:J.parsedType}),g.INVALID;if(J.data.length<this._def.items.length)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),g.INVALID;!this._def.rest&&J.data.length>this._def.items.length&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R.dirty());const U=[...J.data].map((H,z)=>{const ee=this._def.items[z]||this._def.rest;return ee?ee._parse(new m(J,H,J.path,z)):null}).filter(H=>!!H);return J.common.async?Promise.all(U).then(H=>g.ParseStatus.mergeArray(R,H)):g.ParseStatus.mergeArray(R,U)}get items(){return this._def.items}rest(O){return new Fe({...this._def,rest:O})}}X.ZodTuple=Fe,Fe.create=(E,O)=>{if(!Array.isArray(E))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fe({items:E,typeName:oe.ZodTuple,rest:null,...u(O)})};class es extends a{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.object)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:J.parsedType}),g.INVALID;const L=[],U=this._def.keyType,H=this._def.valueType;for(const z in J.data)L.push({key:U._parse(new m(J,z,J.path,z)),value:H._parse(new m(J,J.data[z],J.path,z)),alwaysSet:z in J.data});return J.common.async?g.ParseStatus.mergeObjectAsync(R,L):g.ParseStatus.mergeObjectSync(R,L)}get element(){return this._def.valueType}static create(O,R,J){return R instanceof a?new es({keyType:O,valueType:R,typeName:oe.ZodRecord,...u(J)}):new es({keyType:V.create(),valueType:O,typeName:oe.ZodRecord,...u(R)})}}X.ZodRecord=es;class Rc extends a{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.map)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:J.parsedType}),g.INVALID;const L=this._def.keyType,U=this._def.valueType,H=[...J.data.entries()].map(([z,ee],te)=>({key:L._parse(new m(J,z,J.path,[te,"key"])),value:U._parse(new m(J,ee,J.path,[te,"value"]))}));if(J.common.async){const z=new Map;return Promise.resolve().then(async()=>{for(const ee of H){const te=await ee.key,ie=await ee.value;if(te.status==="aborted"||ie.status==="aborted")return g.INVALID;(te.status==="dirty"||ie.status==="dirty")&&R.dirty(),z.set(te.value,ie.value)}return{status:R.value,value:z}})}else{const z=new Map;for(const ee of H){const te=ee.key,ie=ee.value;if(te.status==="aborted"||ie.status==="aborted")return g.INVALID;(te.status==="dirty"||ie.status==="dirty")&&R.dirty(),z.set(te.value,ie.value)}return{status:R.value,value:z}}}}X.ZodMap=Rc,Rc.create=(E,O,R)=>new Rc({valueType:O,keyType:E,typeName:oe.ZodMap,...u(R)});class gu extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.parsedType!==r.ZodParsedType.set)return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:J.parsedType}),g.INVALID;const L=this._def;L.minSize!==null&&J.data.size<L.minSize.value&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_small,minimum:L.minSize.value,type:"set",inclusive:!0,exact:!1,message:L.minSize.message}),R.dirty()),L.maxSize!==null&&J.data.size>L.maxSize.value&&((0,g.addIssueToContext)(J,{code:o.ZodIssueCode.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),R.dirty());const U=this._def.valueType;function H(ee){const te=new Set;for(const ie of ee){if(ie.status==="aborted")return g.INVALID;ie.status==="dirty"&&R.dirty(),te.add(ie.value)}return{status:R.value,value:te}}const z=[...J.data.values()].map((ee,te)=>U._parse(new m(J,ee,J.path,te)));return J.common.async?Promise.all(z).then(ee=>H(ee)):H(z)}min(O,R){return new gu({...this._def,minSize:{value:O,message:b.errorUtil.toString(R)}})}max(O,R){return new gu({...this._def,maxSize:{value:O,message:b.errorUtil.toString(R)}})}size(O,R){return this.min(O,R).max(O,R)}nonempty(O){return this.min(1,O)}}X.ZodSet=gu,gu.create=(E,O)=>new gu({valueType:E,minSize:null,maxSize:null,typeName:oe.ZodSet,...u(O)});class Vu extends a{constructor(){super(...arguments),this.validate=this.implement}_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.function)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.function,received:R.parsedType}),g.INVALID;function J(z,ee){return(0,g.makeIssue)({data:z,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,(0,v.getErrorMap)(),v.defaultErrorMap].filter(te=>!!te),issueData:{code:o.ZodIssueCode.invalid_arguments,argumentsError:ee}})}function L(z,ee){return(0,g.makeIssue)({data:z,path:R.path,errorMaps:[R.common.contextualErrorMap,R.schemaErrorMap,(0,v.getErrorMap)(),v.defaultErrorMap].filter(te=>!!te),issueData:{code:o.ZodIssueCode.invalid_return_type,returnTypeError:ee}})}const U={errorMap:R.common.contextualErrorMap},H=R.data;if(this._def.returns instanceof Xu){const z=this;return(0,g.OK)(async function(...ee){const te=new o.ZodError([]),ie=await z._def.args.parseAsync(ee,U).catch(Yc=>{throw te.addIssue(J(ee,Yc)),te}),Se=await Reflect.apply(H,this,ie);return await z._def.returns._def.type.parseAsync(Se,U).catch(Yc=>{throw te.addIssue(L(Se,Yc)),te})})}else{const z=this;return(0,g.OK)(function(...ee){const te=z._def.args.safeParse(ee,U);if(!te.success)throw new o.ZodError([J(ee,te.error)]);const ie=Reflect.apply(H,this,te.data),Se=z._def.returns.safeParse(ie,U);if(!Se.success)throw new o.ZodError([L(ie,Se.error)]);return Se.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...O){return new Vu({...this._def,args:Fe.create(O).rest(Ce.create())})}returns(O){return new Vu({...this._def,returns:O})}implement(O){return this.parse(O)}strictImplement(O){return this.parse(O)}static create(O,R,J){return new Vu({args:O||Fe.create([]).rest(Ce.create()),returns:R||Ce.create(),typeName:oe.ZodFunction,...u(J)})}}X.ZodFunction=Vu;class ts extends a{get schema(){return this._def.getter()}_parse(O){const{ctx:R}=this._processInputParams(O);return this._def.getter()._parse({data:R.data,path:R.path,parent:R})}}X.ZodLazy=ts,ts.create=(E,O)=>new ts({getter:E,typeName:oe.ZodLazy,...u(O)});class ns extends a{_parse(O){if(O.data!==this._def.value){const R=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(R,{received:R.data,code:o.ZodIssueCode.invalid_literal,expected:this._def.value}),g.INVALID}return{status:"valid",value:O.data}}get value(){return this._def.value}}X.ZodLiteral=ns,ns.create=(E,O)=>new ns({value:E,typeName:oe.ZodLiteral,...u(O)});function Ll(E,O){return new fu({values:E,typeName:oe.ZodEnum,...u(O)})}class fu extends a{_parse(O){if(typeof O.data!="string"){const R=this._getOrReturnCtx(O),J=this._def.values;return(0,g.addIssueToContext)(R,{expected:r.util.joinValues(J),received:R.parsedType,code:o.ZodIssueCode.invalid_type}),g.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(O.data)){const R=this._getOrReturnCtx(O),J=this._def.values;return(0,g.addIssueToContext)(R,{received:R.data,code:o.ZodIssueCode.invalid_enum_value,options:J}),g.INVALID}return(0,g.OK)(O.data)}get options(){return this._def.values}get enum(){const O={};for(const R of this._def.values)O[R]=R;return O}get Values(){const O={};for(const R of this._def.values)O[R]=R;return O}get Enum(){const O={};for(const R of this._def.values)O[R]=R;return O}extract(O,R=this._def){return fu.create(O,{...this._def,...R})}exclude(O,R=this._def){return fu.create(this.options.filter(J=>!O.includes(J)),{...this._def,...R})}}X.ZodEnum=fu,fu.create=Ll;class rs extends a{_parse(O){const R=r.util.getValidEnumValues(this._def.values),J=this._getOrReturnCtx(O);if(J.parsedType!==r.ZodParsedType.string&&J.parsedType!==r.ZodParsedType.number){const L=r.util.objectValues(R);return(0,g.addIssueToContext)(J,{expected:r.util.joinValues(L),received:J.parsedType,code:o.ZodIssueCode.invalid_type}),g.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(O.data)){const L=r.util.objectValues(R);return(0,g.addIssueToContext)(J,{received:J.data,code:o.ZodIssueCode.invalid_enum_value,options:L}),g.INVALID}return(0,g.OK)(O.data)}get enum(){return this._def.values}}X.ZodNativeEnum=rs,rs.create=(E,O)=>new rs({values:E,typeName:oe.ZodNativeEnum,...u(O)});class Xu extends a{unwrap(){return this._def.type}_parse(O){const{ctx:R}=this._processInputParams(O);if(R.parsedType!==r.ZodParsedType.promise&&R.common.async===!1)return(0,g.addIssueToContext)(R,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:R.parsedType}),g.INVALID;const J=R.parsedType===r.ZodParsedType.promise?R.data:Promise.resolve(R.data);return(0,g.OK)(J.then(L=>this._def.type.parseAsync(L,{path:R.path,errorMap:R.common.contextualErrorMap})))}}X.ZodPromise=Xu,Xu.create=(E,O)=>new Xu({type:E,typeName:oe.ZodPromise,...u(O)});class Re extends a{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===oe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(O){const{status:R,ctx:J}=this._processInputParams(O),L=this._def.effect||null,U={addIssue:H=>{(0,g.addIssueToContext)(J,H),H.fatal?R.abort():R.dirty()},get path(){return J.path}};if(U.addIssue=U.addIssue.bind(U),L.type==="preprocess"){const H=L.transform(J.data,U);if(J.common.async)return Promise.resolve(H).then(async z=>{if(R.value==="aborted")return g.INVALID;const ee=await this._def.schema._parseAsync({data:z,path:J.path,parent:J});return ee.status==="aborted"?g.INVALID:ee.status==="dirty"||R.value==="dirty"?(0,g.DIRTY)(ee.value):ee});{if(R.value==="aborted")return g.INVALID;const z=this._def.schema._parseSync({data:H,path:J.path,parent:J});return z.status==="aborted"?g.INVALID:z.status==="dirty"||R.value==="dirty"?(0,g.DIRTY)(z.value):z}}if(L.type==="refinement"){const H=z=>{const ee=L.refinement(z,U);if(J.common.async)return Promise.resolve(ee);if(ee instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return z};if(J.common.async===!1){const z=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});return z.status==="aborted"?g.INVALID:(z.status==="dirty"&&R.dirty(),H(z.value),{status:R.value,value:z.value})}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(z=>z.status==="aborted"?g.INVALID:(z.status==="dirty"&&R.dirty(),H(z.value).then(()=>({status:R.value,value:z.value}))))}if(L.type==="transform")if(J.common.async===!1){const H=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!(0,g.isValid)(H))return g.INVALID;const z=L.transform(H.value,U);if(z instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:R.value,value:z}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then(H=>(0,g.isValid)(H)?Promise.resolve(L.transform(H.value,U)).then(z=>({status:R.value,value:z})):g.INVALID);r.util.assertNever(L)}}X.ZodEffects=Re,X.ZodTransformer=Re,Re.create=(E,O,R)=>new Re({schema:E,typeName:oe.ZodEffects,effect:O,...u(R)}),Re.createWithPreprocess=(E,O,R)=>new Re({schema:O,effect:{type:"preprocess",transform:E},typeName:oe.ZodEffects,...u(R)});class Ie extends a{_parse(O){return this._getType(O)===r.ZodParsedType.undefined?(0,g.OK)(void 0):this._def.innerType._parse(O)}unwrap(){return this._def.innerType}}X.ZodOptional=Ie,Ie.create=(E,O)=>new Ie({innerType:E,typeName:oe.ZodOptional,...u(O)});class du extends a{_parse(O){return this._getType(O)===r.ZodParsedType.null?(0,g.OK)(null):this._def.innerType._parse(O)}unwrap(){return this._def.innerType}}X.ZodNullable=du,du.create=(E,O)=>new du({innerType:E,typeName:oe.ZodNullable,...u(O)});class as extends a{_parse(O){const{ctx:R}=this._processInputParams(O);let J=R.data;return R.parsedType===r.ZodParsedType.undefined&&(J=this._def.defaultValue()),this._def.innerType._parse({data:J,path:R.path,parent:R})}removeDefault(){return this._def.innerType}}X.ZodDefault=as,as.create=(E,O)=>new as({innerType:E,typeName:oe.ZodDefault,defaultValue:typeof O.default=="function"?O.default:()=>O.default,...u(O)});class os extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J={...R,common:{...R.common,issues:[]}},L=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});return(0,g.isAsync)(L)?L.then(U=>({status:"valid",value:U.status==="valid"?U.value:this._def.catchValue({get error(){return new o.ZodError(J.common.issues)},input:J.data})})):{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new o.ZodError(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}X.ZodCatch=os,os.create=(E,O)=>new os({innerType:E,typeName:oe.ZodCatch,catchValue:typeof O.catch=="function"?O.catch:()=>O.catch,...u(O)});class wc extends a{_parse(O){if(this._getType(O)!==r.ZodParsedType.nan){const J=this._getOrReturnCtx(O);return(0,g.addIssueToContext)(J,{code:o.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:J.parsedType}),g.INVALID}return{status:"valid",value:O.data}}}X.ZodNaN=wc,wc.create=E=>new wc({typeName:oe.ZodNaN,...u(E)}),X.BRAND=Symbol("zod_brand");class Qc extends a{_parse(O){const{ctx:R}=this._processInputParams(O),J=R.data;return this._def.type._parse({data:J,path:R.path,parent:R})}unwrap(){return this._def.type}}X.ZodBranded=Qc;class is extends a{_parse(O){const{status:R,ctx:J}=this._processInputParams(O);if(J.common.async)return(async()=>{const U=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});return U.status==="aborted"?g.INVALID:U.status==="dirty"?(R.dirty(),(0,g.DIRTY)(U.value)):this._def.out._parseAsync({data:U.value,path:J.path,parent:J})})();{const L=this._def.in._parseSync({data:J.data,path:J.path,parent:J});return L.status==="aborted"?g.INVALID:L.status==="dirty"?(R.dirty(),{status:"dirty",value:L.value}):this._def.out._parseSync({data:L.value,path:J.path,parent:J})}}static create(O,R){return new is({in:O,out:R,typeName:oe.ZodPipeline})}}X.ZodPipeline=is;class us extends a{_parse(O){const R=this._def.innerType._parse(O),J=L=>((0,g.isValid)(L)&&(L.value=Object.freeze(L.value)),L);return(0,g.isAsync)(R)?R.then(L=>J(L)):J(R)}unwrap(){return this._def.innerType}}X.ZodReadonly=us,us.create=(E,O)=>new us({innerType:E,typeName:oe.ZodReadonly,...u(O)});function Bl(E,O){const R=typeof E=="function"?E(O):typeof E=="string"?{message:E}:E;return typeof R=="string"?{message:R}:R}function Ul(E,O={},R){return E?Me.create().superRefine((J,L)=>{const U=E(J);if(U instanceof Promise)return U.then(H=>{if(!H){const z=Bl(O,J),ee=z.fatal??R??!0;L.addIssue({code:"custom",...z,fatal:ee})}});if(!U){const H=Bl(O,J),z=H.fatal??R??!0;L.addIssue({code:"custom",...H,fatal:z})}}):Me.create()}X.late={object:ce.lazycreate};var oe;(function(E){E.ZodString="ZodString",E.ZodNumber="ZodNumber",E.ZodNaN="ZodNaN",E.ZodBigInt="ZodBigInt",E.ZodBoolean="ZodBoolean",E.ZodDate="ZodDate",E.ZodSymbol="ZodSymbol",E.ZodUndefined="ZodUndefined",E.ZodNull="ZodNull",E.ZodAny="ZodAny",E.ZodUnknown="ZodUnknown",E.ZodNever="ZodNever",E.ZodVoid="ZodVoid",E.ZodArray="ZodArray",E.ZodObject="ZodObject",E.ZodUnion="ZodUnion",E.ZodDiscriminatedUnion="ZodDiscriminatedUnion",E.ZodIntersection="ZodIntersection",E.ZodTuple="ZodTuple",E.ZodRecord="ZodRecord",E.ZodMap="ZodMap",E.ZodSet="ZodSet",E.ZodFunction="ZodFunction",E.ZodLazy="ZodLazy",E.ZodLiteral="ZodLiteral",E.ZodEnum="ZodEnum",E.ZodEffects="ZodEffects",E.ZodNativeEnum="ZodNativeEnum",E.ZodOptional="ZodOptional",E.ZodNullable="ZodNullable",E.ZodDefault="ZodDefault",E.ZodCatch="ZodCatch",E.ZodPromise="ZodPromise",E.ZodBranded="ZodBranded",E.ZodPipeline="ZodPipeline",E.ZodReadonly="ZodReadonly"})(oe||(X.ZodFirstPartyTypeKind=oe={}));const bO=(E,O={message:`Input not instance of ${E.name}`})=>Ul(R=>R instanceof E,O);X.instanceof=bO;const Kl=V.create;X.string=Kl;const Vl=k.create;X.number=Vl;const mO=wc.create;X.nan=mO;const gO=ae.create;X.bigint=gO;const Xl=ue.create;X.boolean=Xl;const yO=be.create;X.date=yO;const vO=lu.create;X.symbol=vO;const hO=he.create;X.undefined=hO;const OO=mu.create;X.null=OO;const SO=Me.create;X.any=SO;const jO=Ce.create;X.unknown=jO;const PO=se.create;X.never=PO;const MO=Oe.create;X.void=MO;const CO=ge.create;X.array=CO;const RO=ce.create;X.object=RO;const wO=ce.strictCreate;X.strictObject=wO;const TO=xu.create;X.union=TO;const qO=Cc.create;X.discriminatedUnion=qO;const DO=ku.create;X.intersection=DO;const AO=Fe.create;X.tuple=AO;const NO=es.create;X.record=NO;const JO=Rc.create;X.map=JO;const FO=gu.create;X.set=FO;const IO=Vu.create;X.function=IO;const EO=ts.create;X.lazy=EO;const LO=ns.create;X.literal=LO;const BO=fu.create;X.enum=BO;const UO=rs.create;X.nativeEnum=UO;const KO=Xu.create;X.promise=KO;const Zl=Re.create;X.effect=Zl,X.transformer=Zl;const VO=Ie.create;X.optional=VO;const XO=du.create;X.nullable=XO;const ZO=Re.createWithPreprocess;X.preprocess=ZO;const zO=is.create;X.pipeline=zO;const HO=()=>Kl().optional();X.ostring=HO;const GO=()=>Vl().optional();X.onumber=GO;const $O=()=>Xl().optional();return X.oboolean=$O,X.coerce={string:(E=>V.create({...E,coerce:!0})),number:(E=>k.create({...E,coerce:!0})),boolean:(E=>ue.create({...E,coerce:!0})),bigint:(E=>ae.create({...E,coerce:!0})),date:(E=>be.create({...E,coerce:!0}))},X.NEVER=g.INVALID,X}var df;function _f(){return df||(df=1,(function(o){var v=vu&&vu.__createBinding||(Object.create?(function(g,r,m,p){p===void 0&&(p=m);var u=Object.getOwnPropertyDescriptor(r,m);(!u||("get"in u?!r.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return r[m]}}),Object.defineProperty(g,p,u)}):(function(g,r,m,p){p===void 0&&(p=m),g[p]=r[m]})),b=vu&&vu.__exportStar||function(g,r){for(var m in g)m!=="default"&&!Object.prototype.hasOwnProperty.call(r,m)&&v(r,g,m)};Object.defineProperty(o,"__esModule",{value:!0}),b(sl(),o),b(mv(),o),b(oS(),o),b(Ic(),o),b(uS(),o),b(ul(),o)})(vu)),vu}var pf;function F(){return pf||(pf=1,(function(o){var v=qe&&qe.__createBinding||(Object.create?(function(p,u,a,n){n===void 0&&(n=a);var e=Object.getOwnPropertyDescriptor(u,a);(!e||("get"in e?!u.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(p,n,e)}):(function(p,u,a,n){n===void 0&&(n=a),p[n]=u[a]})),b=qe&&qe.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),g=qe&&qe.__importStar||function(p){if(p&&p.__esModule)return p;var u={};if(p!=null)for(var a in p)a!=="default"&&Object.prototype.hasOwnProperty.call(p,a)&&v(u,p,a);return b(u,p),u},r=qe&&qe.__exportStar||function(p,u){for(var a in p)a!=="default"&&!Object.prototype.hasOwnProperty.call(u,a)&&v(u,p,a)};Object.defineProperty(o,"__esModule",{value:!0}),o.z=void 0;const m=g(_f());o.z=m,r(_f(),o),o.default=m})(qe)),qe}var bf;function gv(){if(bf)return de;bf=1;var o=de&&de.__createBinding||(Object.create?(function(e,t,i,s){s===void 0&&(s=i);var f=Object.getOwnPropertyDescriptor(t,i);(!f||("get"in f?!t.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,f)}):(function(e,t,i,s){s===void 0&&(s=i),e[s]=t[i]})),v=de&&de.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),b=de&&de.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(s[s.length]=f);return s},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var s=e(t),f=0;f<s.length;f++)s[f]!=="default"&&o(i,t,s[f]);return v(i,t),i}})();Object.defineProperty(de,"__esModule",{value:!0}),de.zodInbound=de.zodOutbound=void 0,de.bytesToBase64=r,de.bytesFromBase64=m,de.stringToBytes=p,de.stringFromBytes=u,de.stringToBase64=a,de.stringFromBase64=n;const g=b(F());function r(e){return btoa(String.fromCodePoint(...e))}function m(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}function p(e){return new TextEncoder().encode(e)}function u(e){return new TextDecoder().decode(e)}function a(e){return r(p(e))}function n(e){return u(m(e))}return de.zodOutbound=g.instanceof(Uint8Array).or(g.string().transform(p)),de.zodInbound=g.instanceof(Uint8Array).or(g.string().transform(m)),de}var tl={},Ac={},mf;function yv(){if(mf)return Ac;mf=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.isPlainObject=o;function o(v){if(typeof v!="object"||v===null)return!1;const b=Object.getPrototypeOf(v);return(b===null||b===Object.prototype||Object.getPrototypeOf(b)===null)&&!(Symbol.toStringTag in v)&&!(Symbol.iterator in v)}return Ac}var gf;function x(){return gf||(gf=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.encodeDeepObjectQuery=o.encodePipeDelimitedQuery=o.encodeSpaceDelimitedQuery=o.encodeFormQuery=o.encodeJSONQuery=o.encodeSimple=o.encodePipeDelimited=o.encodeSpaceDelimited=o.encodeForm=o.EncodingError=void 0,o.encodeMatrix=r,o.encodeLabel=m,o.encodeBodyForm=u,o.encodeDeepObject=a,o.encodeDeepObjectObject=n,o.encodeJSON=e,o.queryJoin=d,o.queryEncoder=_,o.appendForm=y;const v=gv(),b=yv();class g extends Error{constructor(j){super(j),this.name="EncodingError"}}o.EncodingError=g;function r(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="",w=null;if(C==null||(Array.isArray(C)?w=c(C,B=>`${D(B)}`)?.join(","):(0,b.isPlainObject)(C)?w=l(Object.entries(C),([V,Z])=>`,${N(V)},${D(Z)}`)?.join("").slice(1):w=`${D(C)}`,w==null))return;const q=N(S);P=`${q}=${w}`,P===`${q}=`&&(P=P.slice(0,-1)),P&&(T+=`;${P}`)}),T}function m(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="";C!=null&&(Array.isArray(C)?P=c(C,w=>`${D(w)}`)?.join("."):(0,b.isPlainObject)(C)?P=l(Object.entries(C),([q,B])=>`.${N(q)}.${D(B)}`)?.join("").slice(1):P=`${M?.explode&&(0,b.isPlainObject)(j)?`${N(S)}=`:""}${D(C)}`,T+=P==null?"":`.${P}`)}),T}function p(h){return(j,M,T)=>{let A="";const N=T?.explode?i(j,M):[[j,M]];if(N.every(([P,w])=>w==null))return;const D=P=>T?.charEncoding==="percent"?encodeURIComponent(P):P,S=P=>D(s(P)),C=D(h);return N.forEach(([P,w])=>{let q="",B=null;w!=null&&(Array.isArray(w)?B=c(w,V=>`${S(V)}`)?.join(C):(0,b.isPlainObject)(w)?B=l(Object.entries(w),([V,Z])=>`${D(V)}${C}${S(Z)}`)?.join(C):B=`${S(w)}`,B!=null&&(q=`${D(P)}=${B}`,!(!q||q==="=")&&(A+=`&${q}`)))}),A.slice(1)}}o.encodeForm=p(","),o.encodeSpaceDelimited=p(" "),o.encodePipeDelimited=p("|");function u(h,j,M){let T="";const A=M?.explode?i(h,j):[[h,j]],N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="",w="";C!=null&&(Array.isArray(C)||(0,b.isPlainObject)(C)?w=JSON.stringify(C,f):w=`${D(C)}`,P=`${N(S)}=${w}`,!(!P||P==="=")&&(T+=`&${P}`))}),T.slice(1)}function a(h,j,M){if(j!=null){if(!(0,b.isPlainObject)(j))throw new g(`Value of parameter '${h}' which uses deepObject encoding must be an object or null`);return n(h,j,M)}}function n(h,j,M){if(j==null)return;let T="";const A=N=>M?.charEncoding==="percent"?encodeURIComponent(N):N;if(!(0,b.isPlainObject)(j))throw new g(`Expected parameter '${h}' to be an object.`);return Object.entries(j).forEach(([N,D])=>{if(D==null)return;const S=`${h}[${N}]`;if((0,b.isPlainObject)(D)){const w=n(S,D,M);T+=w==null?"":`&${w}`;return}const C=Array.isArray(D)?D:[D],P=c(C,w=>`${A(S)}=${A(s(w))}`)?.join("&");T+=P==null?"":`&${P}`}),T.slice(1)}function e(h,j,M){if(typeof j>"u")return;const T=N=>M?.charEncoding==="percent"?encodeURIComponent(N):N,A=T(JSON.stringify(j,f));return M?.explode?A:`${T(h)}=${A}`}const t=(h,j,M)=>{let T="";const A=M?.explode?i(h,j):[[h,j]];if(A.every(([S,C])=>C==null))return;const N=S=>M?.charEncoding==="percent"?encodeURIComponent(S):S,D=S=>N(s(S));return A.forEach(([S,C])=>{let P="";C!=null&&(Array.isArray(C)?P=c(C,w=>`${D(w)}`)?.join(","):(0,b.isPlainObject)(C)?P=l(Object.entries(C),([q,B])=>`,${N(q)},${D(B)}`)?.join("").slice(1):P=`${M?.explode&&(0,b.isPlainObject)(j)?`${S}=`:""}${D(C)}`,T+=P?`,${P}`:"")}),T.slice(1)};o.encodeSimple=t;function i(h,j){return Array.isArray(j)?j.map(M=>[h,M]):(0,b.isPlainObject)(j)?Object.entries(j??{}).map(([T,A])=>[T,A]):[[h,j]]}function s(h){return h==null?"":h instanceof Date?h.toISOString():h instanceof Uint8Array?(0,v.bytesToBase64)(h):typeof h=="object"?JSON.stringify(h,f):`${h}`}function f(h,j){return j instanceof Uint8Array?(0,v.bytesToBase64)(j):j}function c(h,j){const M=h.reduce((T,A)=>{if(A==null)return T;const N=j(A);return N==null||T.push(N),T},[]);return M.length?M:null}function l(h,j){const M=[];for(const[T,A]of h){if(A==null)continue;const N=j([T,A]);N!=null&&M.push(N)}return M.length?M:null}function d(...h){return h.filter(Boolean).join("&")}function _(h){return function(M,T){const A={...T,explode:T?.explode??!0,charEncoding:T?.charEncoding??"percent"},N=new Set(T?.allowEmptyValue??[]),D=Object.entries(M).map(([S,C])=>N.has(S)&&(C==null||C===""||Array.isArray(C)&&C.length===0)?`${encodeURIComponent(S)}=`:h(S,C,A));return d(...D)}}o.encodeJSONQuery=_(e),o.encodeFormQuery=_(o.encodeForm),o.encodeSpaceDelimitedQuery=_(o.encodeSpaceDelimited),o.encodePipeDelimitedQuery=_(o.encodePipeDelimited),o.encodeDeepObjectQuery=_(a);function y(h,j,M,T){M!=null&&(M instanceof Blob&&T?h.append(j,M,T):M instanceof Blob?h.append(j,M):h.append(j,String(M)))}})(tl)),tl}var ln={},Nc={},yf;function sS(){if(yf)return Nc;yf=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.dlv=o;function o(v,b,g,r,m){for(b=Array.isArray(b)?b:b.split("."),r=0;r<b.length;r++){const p=b[r];v=p!=null&&v?v[p]:m}return v===m?g:v}return Nc}var vf;function vv(){return vf||(vf=1,(function(o){var v=ln&&ln.__createBinding||(Object.create?(function(e,t,i,s){s===void 0&&(s=i);var f=Object.getOwnPropertyDescriptor(t,i);(!f||("get"in f?!t.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,s,f)}):(function(e,t,i,s){s===void 0&&(s=i),e[s]=t[i]})),b=ln&&ln.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),g=ln&&ln.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(i){var s=[];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(s[s.length]=f);return s},e(t)};return function(t){if(t&&t.__esModule)return t;var i={};if(t!=null)for(var s=e(t),f=0;f<s.length;f++)s[f]!=="default"&&v(i,t,s[f]);return b(i,t),i}})();Object.defineProperty(o,"__esModule",{value:!0}),o.envSchema=void 0,o.env=a,o.resetEnv=n;const r=g(F()),m=sS();o.envSchema=r.object({MISTRAL_API_KEY:r.string().optional(),MISTRAL_DEBUG:r.coerce.boolean().optional()});function p(){return"Deno"in globalThis}let u;function a(){if(u)return u;let e={};return p()?e=globalThis.Deno?.env?.toObject?.()??{}:e=(0,m.dlv)(globalThis,"process.env")??{},u=o.envSchema.parse(e),u}function n(){u=void 0}})(ln)),ln}var _u={},hf;function cS(){if(hf)return _u;hf=1,Object.defineProperty(_u,"__esModule",{value:!0}),_u.TemporaryError=_u.PermanentError=void 0,_u.retry=r;const o=Fc(),v={initialInterval:500,maxInterval:6e4,exponent:1.5,maxElapsedTime:36e5};class b extends Error{constructor(i,s){let f=i;s?.cause&&(f+=`: ${s.cause}`),super(f,s),this.name="PermanentError",typeof this.cause>"u"&&(this.cause=s?.cause),Object.setPrototypeOf(this,b.prototype)}}_u.PermanentError=b;class g extends Error{constructor(i,s){super(i),this.response=s,this.name="TemporaryError",Object.setPrototypeOf(this,g.prototype)}}_u.TemporaryError=g;async function r(t,i){switch(i.config.strategy){case"backoff":return a(m(t,{statusCodes:i.statusCodes,retryConnectionErrors:!!i.config.retryConnectionErrors}),i.config.backoff??v);default:return await t()}}function m(t,i){return async()=>{try{const s=await t();if(u(s,i.statusCodes))throw new g("Response failed with retryable status code",s);return s}catch(s){throw s instanceof g||i.retryConnectionErrors&&((0,o.isTimeoutError)(s)||(0,o.isConnectionError)(s))?s:new b("Permanent error",{cause:s})}}}const p=new RegExp("^[0-9]xx$","i");function u(t,i){const s=`${t.status}`;return i.some(f=>{if(!p.test(f))return f===s;const c=f.charAt(0);if(!c)throw new Error("Invalid status code range");const l=s.charAt(0);if(!l)throw new Error(`Invalid response status code: ${s}`);return l===c})}async function a(t,i){const{maxElapsedTime:s,initialInterval:f,exponent:c,maxInterval:l}=i,d=Date.now();let _=0;for(;;)try{return await t()}catch(y){if(y instanceof b)throw y.cause;if(Date.now()-d>s){if(y instanceof g)return y.response;throw y}let j=0;y instanceof g&&(j=n(y.response)),j<=0&&(j=f*Math.pow(_,c)+Math.random()*1e3);const M=Math.min(j,l);await e(M),_++}}function n(t){const i=t.headers.get("retry-after")||"";if(!i)return 0;const s=Number(i);if(Number.isInteger(s))return s*1e3;const f=Date.parse(i);if(Number.isInteger(f)){const c=f-Date.now();return c>0?Math.ceil(c):0}return 0}async function e(t){return new Promise(i=>setTimeout(i,t))}return _u}var Of;function le(){if(Of)return un;Of=1;var o=un&&un.__classPrivateFieldSet||function(M,T,A,N,D){if(N==="m")throw new TypeError("Private method is not writable");if(N==="a"&&!D)throw new TypeError("Private accessor was defined without a setter");if(typeof T=="function"?M!==T||!D:!T.has(M))throw new TypeError("Cannot write private member to an object whose class did not declare it");return N==="a"?D.call(M,A):D?D.value=A:T.set(M,A),A},v=un&&un.__classPrivateFieldGet||function(M,T,A,N){if(A==="a"&&!N)throw new TypeError("Private accessor was defined without a getter");if(typeof T=="function"?M!==T||!N:!T.has(M))throw new TypeError("Cannot read private member from an object whose class did not declare it");return A==="m"?N:A==="a"?N.call(M):N?N.value:T.get(M)},b,g,r;Object.defineProperty(un,"__esModule",{value:!0}),un.ClientSDK=void 0;const m=aS(),p=_v(),u=_e(),a=gv(),n=il(),e=x(),t=vv(),i=Fc(),s=cS(),f=typeof globalThis>"u"?null:globalThis,l=typeof f=="object"&&f!=null&&"importScripts"in f&&typeof f.importScripts=="function"||typeof navigator<"u"&&"serviceWorker"in navigator||typeof window=="object"&&typeof window.document<"u";class d{constructor(T={}){b.set(this,void 0),g.set(this,void 0),r.set(this,void 0);const A=T;typeof A=="object"&&A!=null&&"hooks"in A&&A.hooks instanceof m.SDKHooks?o(this,g,A.hooks,"f"):o(this,g,new m.SDKHooks,"f");const N=(0,n.serverURLFromOptions)(T);N&&(N.pathname=N.pathname.replace(/\/+$/,"")+"/");const{baseURL:D,client:S}=v(this,g,"f").sdkInit({baseURL:N,client:T.httpClient||new i.HTTPClient});this._baseURL=D,o(this,b,S,"f"),this._options={...T,hooks:v(this,g,"f")},o(this,r,this._options.debugLogger,"f"),!v(this,r,"f")&&(0,t.env)().MISTRAL_DEBUG&&o(this,r,console,"f")}_createRequest(T,A,N){const{method:D,path:S,query:C,headers:P,security:w}=A,q=A.baseURL??this._baseURL;if(!q)return(0,u.ERR)(new p.InvalidRequestError("No base URL provided for operation"));const B=new URL(q),V=new URL(S,B);S&&(B.pathname+=B.pathname.endsWith("/")?"":"/",B.pathname+=V.pathname.replace(/^\/+/,""));let Z=C||"";const k=[];for(const[se,Oe]of Object.entries(w?.queryParams||{})){const ge=(0,e.encodeForm)(se,Oe,{charEncoding:"percent"});typeof ge<"u"&&k.push(ge)}if(k.length&&(Z+=`&${k.join("&")}`),Z){const se=Z.startsWith("&")?Z.slice(1):Z;B.search=`?${se}`}const ae=new Headers(P),ue=w?.basic.username,be=w?.basic.password;if(ue!=null||be!=null){const se=(0,a.stringToBase64)([ue||"",be||""].join(":"));ae.set("Authorization",`Basic ${se}`)}const lu=new Headers(w?.headers||{});for(const[se,Oe]of lu)ae.set(se,Oe);let he=ae.get("cookie")||"";for(const[se,Oe]of Object.entries(w?.cookies||{}))he+=`; ${se}=${Oe}`;he=he.startsWith("; ")?he.slice(2):he,ae.set("cookie",he);const mu=new Headers(N?.headers??N?.fetchOptions?.headers);for(const[se,Oe]of mu)ae.set(se,Oe);l||ae.set(A.uaHeader??"user-agent",A.userAgent??n.SDK_METADATA.userAgent);const Me={...N?.fetchOptions,...N};if(!Me?.signal&&A.timeoutMs&&A.timeoutMs>0){const se=AbortSignal.timeout(A.timeoutMs);Me.signal=se}A.body instanceof ReadableStream&&Object.assign(Me,{duplex:"half"});let Ce;try{Ce=v(this,g,"f").beforeCreateRequest(T,{url:B,options:{...Me,body:A.body??null,headers:ae,method:D}})}catch(se){return(0,u.ERR)(new p.UnexpectedClientError("Create request hook failed to execute",{cause:se}))}return(0,u.OK)(new Request(Ce.url,Ce.options))}async _do(T,A){const{context:N,errorCodes:D}=A;return(0,s.retry)(async()=>{const S=await v(this,g,"f").beforeRequest(N,T.clone());await h(v(this,r,"f"),S).catch(P=>v(this,r,"f")?.log("Failed to log request:",P));let C=await v(this,b,"f").request(S);try{if((0,i.matchStatusCode)(C,D)){const P=await v(this,g,"f").afterError(N,C,null);if(P.error)throw P.error;C=P.response||C}else C=await v(this,g,"f").afterSuccess(N,C)}finally{await j(v(this,r,"f"),C,S).catch(P=>v(this,r,"f")?.log("Failed to log response:",P))}return C},{config:A.retryConfig,statusCodes:A.retryCodes}).then(S=>(0,u.OK)(S),S=>{switch(!0){case(0,i.isAbortError)(S):return(0,u.ERR)(new p.RequestAbortedError("Request aborted by client",{cause:S}));case(0,i.isTimeoutError)(S):return(0,u.ERR)(new p.RequestTimeoutError("Request timed out",{cause:S}));case(0,i.isConnectionError)(S):return(0,u.ERR)(new p.ConnectionError("Unable to make request",{cause:S}));default:return(0,u.ERR)(new p.UnexpectedClientError("Unexpected HTTP client error",{cause:S}))}})}}un.ClientSDK=d,b=new WeakMap,g=new WeakMap,r=new WeakMap;const _=/^(application|text)\/([^+]+\+)*json.*/,y=/^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;async function h(M,T){if(!M)return;const A=T.headers.get("content-type"),N=A?.split(";")[0]||"";M.group(`> Request: ${T.method} ${T.url}`),M.group("Headers:");for(const[D,S]of T.headers.entries())M.log(`${D}: ${S}`);switch(M.groupEnd(),M.group("Body:"),!0){case _.test(N):M.log(await T.clone().json());break;case N.startsWith("text/"):M.log(await T.clone().text());break;case N==="multipart/form-data":{const D=await T.clone().formData();for(const[S,C]of D){const P=C instanceof Blob?"<Blob>":C;M.log(`${S}: ${P}`)}break}default:M.log(`<${A}>`);break}M.groupEnd(),M.groupEnd()}async function j(M,T,A){if(!M)return;const N=T.headers.get("content-type"),D=N?.split(";")[0]||"";M.group(`< Response: ${A.method} ${A.url}`),M.log("Status Code:",T.status,T.statusText),M.group("Headers:");for(const[S,C]of T.headers.entries())M.log(`${S}: ${C}`);switch(M.groupEnd(),M.group("Body:"),!0){case((0,i.matchContentType)(T,"application/json")||_.test(D)&&!y.test(D)):M.log(await T.clone().json());break;case((0,i.matchContentType)(T,"application/jsonl")||y.test(D)):M.log(await T.clone().text());break;case(0,i.matchContentType)(T,"text/event-stream"):M.log(`<${N}>`);break;case(0,i.matchContentType)(T,"text/*"):M.log(await T.clone().text());break;case(0,i.matchContentType)(T,"multipart/form-data"):{const S=await T.clone().formData();for(const[C,P]of S){const w=P instanceof Blob?"<Blob>":P;M.log(`${C}: ${w}`)}break}default:M.log(`<${N}>`);break}M.groupEnd(),M.groupEnd()}return un}var bs={},Ee={},fe={},De={},ms={},Sf;function Ec(){if(Sf)return ms;Sf=1,Object.defineProperty(ms,"__esModule",{value:!0}),ms.MistralError=void 0;class o extends Error{constructor(b,g){super(b),this.statusCode=g.response.status,this.body=g.body,this.headers=g.response.headers,this.contentType=g.response.headers.get("content-type")||"",this.rawResponse=g.response,this.name="MistralError"}}return ms.MistralError=o,ms}var je={},jf;function cl(){if(jf)return je;jf=1;var o=je&&je.__createBinding||(Object.create?(function(p,u,a,n){n===void 0&&(n=a);var e=Object.getOwnPropertyDescriptor(u,a);(!e||("get"in e?!u.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:function(){return u[a]}}),Object.defineProperty(p,n,e)}):(function(p,u,a,n){n===void 0&&(n=a),p[n]=u[a]})),v=je&&je.__setModuleDefault||(Object.create?(function(p,u){Object.defineProperty(p,"default",{enumerable:!0,value:u})}):function(p,u){p.default=u}),b=je&&je.__importStar||(function(){var p=function(u){return p=Object.getOwnPropertyNames||function(a){var n=[];for(var e in a)Object.prototype.hasOwnProperty.call(a,e)&&(n[n.length]=e);return n},p(u)};return function(u){if(u&&u.__esModule)return u;var a={};if(u!=null)for(var n=p(u),e=0;e<n.length;e++)n[e]!=="default"&&o(a,u,n[e]);return v(a,u),a}})();Object.defineProperty(je,"__esModule",{value:!0}),je.SDKValidationError=void 0,je.formatZodError=m;const g=b(F());class r extends Error{static[Symbol.hasInstance](u){return!(!(u instanceof Error)||!("rawValue"in u)||!("rawMessage"in u)||!("pretty"in u)||typeof u.pretty!="function")}constructor(u,a,n){super(`${u}: ${a}`),this.name="SDKValidationError",this.cause=a,this.rawValue=n,this.rawMessage=u}pretty(){return this.cause instanceof g.ZodError?`${this.rawMessage}
|
|
2
2
|
${m(this.cause)}`:this.toString()}}je.SDKValidationError=r;function m(p,u=0){let a=" ".repeat(u);a=u>0?`│${a}`:a,a+=" ".repeat(u);let n="";const e=s=>n+=`
|
|
3
3
|
${a}${s}`,t=p.issues.length,i=t===1?`${t} issue found`:`${t} issues found`;t&&e(`┌ ${i}:`);for(const s of p.issues){let f=s.path.join(".");switch(f=f?`<root>.${f}`:"<root>",e(`│ • [${f}]: ${s.message} (${s.code})`),s.code){case"invalid_literal":case"invalid_type":{e(`│ Want: ${s.expected}`),e(`│ Got: ${s.received}`);break}case"unrecognized_keys":{e(`│ Keys: ${s.keys.join(", ")}`);break}case"invalid_enum_value":{e(`│ Allowed: ${s.options.join(", ")}`),e(`│ Got: ${s.received}`);break}case"invalid_union_discriminator":{e(`│ Allowed: ${s.options.join(", ")}`);break}case"invalid_union":{const c=s.unionErrors.length;e(`│ ✖︎ Attemped to deserialize into one of ${c} union members:`),s.unionErrors.forEach((l,d)=>{e(`│ ✖︎ Member ${d+1} of ${c}`),e(`${m(l,u+1)}`)})}}}return p.issues.length&&e("└─*"),n.slice(1)}return je}var Pf;function hv(){if(Pf)return De;Pf=1;var o=De&&De.__createBinding||(Object.create?(function(u,a,n,e){e===void 0&&(e=n);var t=Object.getOwnPropertyDescriptor(a,n);(!t||("get"in t?!a.__esModule:t.writable||t.configurable))&&(t={enumerable:!0,get:function(){return a[n]}}),Object.defineProperty(u,e,t)}):(function(u,a,n,e){e===void 0&&(e=n),u[e]=a[n]})),v=De&&De.__setModuleDefault||(Object.create?(function(u,a){Object.defineProperty(u,"default",{enumerable:!0,value:a})}):function(u,a){u.default=a}),b=De&&De.__importStar||(function(){var u=function(a){return u=Object.getOwnPropertyNames||function(n){var e=[];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[e.length]=t);return e},u(a)};return function(a){if(a&&a.__esModule)return a;var n={};if(a!=null)for(var e=u(a),t=0;t<e.length;t++)e[t]!=="default"&&o(n,a,e[t]);return v(n,a),n}})();Object.defineProperty(De,"__esModule",{value:!0}),De.ResponseValidationError=void 0;const g=b(F()),r=Ec(),m=cl();class p extends r.MistralError{constructor(a,n){super(a,n),this.name="ResponseValidationError",this.cause=n.cause,this.rawValue=n.rawValue,this.rawMessage=n.rawMessage}pretty(){return this.cause instanceof g.ZodError?`${this.rawMessage}
|
|
4
4
|
${(0,m.formatZodError)(this.cause)}`:this.toString()}}return De.ResponseValidationError=p,De}var gs={},Mf;function Ov(){if(Mf)return gs;Mf=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.SDKError=void 0;const o=Ec();class v extends o.MistralError{constructor(g,r){g&&(g+=": "),g+=`Status ${r.response.status}`;const m=r.response.headers.get("content-type")||'""';m!=="application/json"&&(g+=` Content-Type ${m.includes(" ")?`"${m}"`:m}`);const p=r.body||'""';g+=p.length>100?`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as d}from"./index-
|
|
1
|
+
import{c as d}from"./index-W9ryXG_v.js";const i=d("offscreen-client");class h{eventListeners=new Set;callbacks;scoops=[];scoopStatuses=new Map;currentMessageId=new Map;ready=!1;stateRetryTimer=null;localFs=null;selectedScoopJid=null;constructor(e){this.callbacks=e,this.setupMessageListener()}setLocalFS(e){this.localFs=e}createAgentHandle(){return{sendMessage:(e,s)=>{if(!this.selectedScoopJid){this.emitToUI({type:"error",error:"No scoop selected"});return}this.send({type:"user-message",scoopJid:this.selectedScoopJid,text:e,messageId:s??`msg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`})},onEvent:e=>(this.eventListeners.add(e),()=>this.eventListeners.delete(e)),stop:()=>{this.selectedScoopJid&&this.send({type:"abort",scoopJid:this.selectedScoopJid})}}}getScoops(){return this.scoops}getScoop(e){return this.scoops.find(s=>s.jid===e)}isProcessing(e){return this.scoopStatuses.get(e)==="processing"}async registerScoop(e){this.scoops.find(s=>s.name===e.name)||(this.scoops.push(e),this.scoopStatuses.set(e.jid,"initializing")),this.send({type:"scoop-create",name:e.name,isCone:e.isCone})}async unregisterScoop(e){this.send({type:"scoop-drop",scoopJid:e}),this.scoops=this.scoops.filter(s=>s.jid!==e),this.scoopStatuses.delete(e)}createScoopTab(e){}async getGlobalMemory(){if(!this.localFs)return"";try{const e=await this.localFs.readFile("/shared/CLAUDE.md",{encoding:"utf-8"});return typeof e=="string"?e:new TextDecoder().decode(e)}catch{return""}}getScoopContext(e){if(this.localFs)return{getFS:()=>this.localFs}}getSharedFS(){return this.localFs}stopScoop(e){this.send({type:"abort",scoopJid:e})}async clearQueuedMessages(e){}async deleteQueuedMessage(e,s){}updateModel(){this.send({type:"refresh-model"})}async clearAllMessages(){this.send({type:"clear-chat"})}clearFilesystem(){this.send({type:"clear-filesystem"})}requestState(){this.send({type:"request-state"});let e=0;this.stateRetryTimer=setInterval(()=>{if(e++,this.ready||e>20){this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null);return}i.debug("Retrying request-state",{attempt:e}),this.send({type:"request-state"})},500)}isReady(){return this.ready}sprinkleOpHandler=null;sendSprinkleLick(e,s){this.send({type:"sprinkle-lick",sprinkleName:e,body:s})}setSprinkleOpHandler(e){this.sprinkleOpHandler=e}setupMessageListener(){chrome.runtime.onMessage.addListener((e,s,t)=>{if(!p(e))return!1;const a=e;if(a.source==="offscreen"){const r=a.payload;if(r?.type==="debug-tabs"){const c=window.__slicc_debug_tabs;c?.(!!r.show)}else r?.type==="sprinkle-op"&&this.sprinkleOpHandler?this.sprinkleOpHandler(r):this.handleOffscreenMessage(a.payload)}return!1})}handleOffscreenMessage(e){switch(e.type){case"offscreen-ready":i.info("Offscreen engine ready"),this.ready||this.send({type:"request-state"});break;case"agent-event":this.handleAgentEvent(e);break;case"scoop-status":this.handleScoopStatus(e);break;case"scoop-created":this.handleScoopCreated(e);break;case"scoop-list":this.handleScoopList(e);break;case"state-snapshot":this.handleStateSnapshot(e);break;case"error":this.handleError(e);break;case"incoming-message":this.handleIncomingMessage(e);break}}handleAgentEvent(e){if(e.scoopJid===this.selectedScoopJid)switch(e.eventType){case"text_delta":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"content_delta",messageId:s,text:e.text??""});break}case"tool_start":{let s=this.currentMessageId.get(e.scoopJid);s||(s=`scoop-${e.scoopJid}-${n()}`,this.currentMessageId.set(e.scoopJid,s),this.emitToUI({type:"message_start",messageId:s})),this.emitToUI({type:"tool_use_start",messageId:s,toolName:e.toolName??"",toolInput:e.toolInput});break}case"tool_end":{const s=this.currentMessageId.get(e.scoopJid);s&&this.emitToUI({type:"tool_result",messageId:s,toolName:e.toolName??"",result:e.toolResult??"",isError:e.isError});break}case"response_done":{const s=this.currentMessageId.get(e.scoopJid);s&&(this.emitToUI({type:"content_done",messageId:s}),this.currentMessageId.delete(e.scoopJid));break}case"turn_end":{const s=this.currentMessageId.get(e.scoopJid)??`done-${e.scoopJid}-${n()}`;this.currentMessageId.delete(e.scoopJid),this.emitToUI({type:"turn_end",messageId:s});break}}}handleScoopStatus(e){this.scoopStatuses.set(e.scoopJid,e.status),this.callbacks.onStatusChange(e.scoopJid,e.status)}handleScoopCreated(e){const s=this.msgScoopToRegistered(e.scoop);this.scoops=this.scoops.filter(t=>t.name!==s.name||t.jid===s.jid),this.scoops.find(t=>t.jid===s.jid)||this.scoops.push(s),this.scoopStatuses.set(s.jid,e.scoop.status),this.callbacks.onScoopCreated(s)}handleScoopList(e){this.scoops=e.scoops.map(s=>this.msgScoopToRegistered(s));for(const s of e.scoops)this.scoopStatuses.set(s.jid,s.status);this.callbacks.onScoopListUpdate(e.scoops)}handleStateSnapshot(e){i.info("Received state snapshot",{scoopCount:e.scoops.length}),this.scoops=e.scoops.map(t=>this.msgScoopToRegistered(t));for(const t of e.scoops)this.scoopStatuses.set(t.jid,t.status);const s=!this.ready;s&&(this.ready=!0,this.stateRetryTimer&&(clearInterval(this.stateRetryTimer),this.stateRetryTimer=null)),this.callbacks.onScoopListUpdate(e.scoops),s&&this.callbacks.onReady?.()}handleError(e){e.scoopJid===this.selectedScoopJid&&this.emitToUI({type:"error",error:e.error})}handleIncomingMessage(e){this.callbacks.onIncomingMessage(e.scoopJid,e.message)}msgScoopToRegistered(e){return{jid:e.jid,name:e.name,folder:e.folder,isCone:e.isCone,type:e.isCone?"cone":"scoop",requiresTrigger:!e.isCone,assistantLabel:e.assistantLabel,addedAt:new Date().toISOString()}}emitToUI(e){for(const s of this.eventListeners)try{s(e)}catch(t){i.error("Listener error",{error:t instanceof Error?t.message:String(t)})}}send(e){chrome.runtime.sendMessage({source:"panel",payload:e}).catch(s=>{i.error("Failed to send to offscreen",{error:s instanceof Error?s.message:String(s)})})}}function n(){return Date.now().toString(36)+Math.random().toString(36).slice(2,8)}function p(o){return typeof o=="object"&&o!==null&&"source"in o&&"payload"in o}export{h as OffscreenClient};
|
package/dist/ui/assets/{openai-codex-responses-D07wKmVX.js → openai-codex-responses-2iZbtSiB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as q,g as O,b as N,s as M,d as P}from"./index-
|
|
1
|
+
import{A as q,g as O,b as N,s as M,d as P}from"./index-W9ryXG_v.js";import{c as U,a as H,p as L}from"./openai-responses-shared-Ce1dVnHc.js";import"./hash-DMDecQcg.js";import"./json-parse-DYeOImVX.js";import"./sanitize-unicode-cmozpu7l.js";let E=null;const J=e=>import(e),K="node:os";typeof process<"u"&&(process.versions?.node||process.versions?.bun)&&J(K).then(e=>{E=e});const X="https://chatgpt.com/backend-api",z="https://api.openai.com/auth",v=3,R=1e3,F=new Set(["openai","openai-codex","opencode"]),j=new Set(["completed","incomplete","failed","cancelled","queued","in_progress"]);function V(e,t){return e===429||e===500||e===502||e===503||e===504?!0:/rate.?limit|overloaded|service.?unavailable|upstream.?connect|connection.?refused/i.test(t)}function T(e,t){return new Promise((r,n)=>{if(t?.aborted){n(new Error("Request was aborted"));return}const o=setTimeout(r,e);t?.addEventListener("abort",()=>{clearTimeout(o),n(new Error("Request was aborted"))})})}const Y=(e,t,r)=>{const n=new q;return(async()=>{const o={role:"assistant",content:[],api:"openai-codex-responses",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"stop",timestamp:Date.now()};try{const s=r?.apiKey||O(e.provider)||"";if(!s)throw new Error(`No API key for provider: ${e.provider}`);const i=pe(s);let a=G(e,t,r);const c=await r?.onPayload?.(a,e);c!==void 0&&(a=c);const d=r?.sessionId||ye(),p=we(e.headers,r?.headers,i,s,r?.sessionId),m=me(e.headers,r?.headers,i,s,d),l=JSON.stringify(a),w=r?.transport||"sse";if(w!=="sse"){let h=!1;try{if(await le(Z(e.baseUrl),a,m,o,n,e,()=>{h=!0},r),r?.signal?.aborted)throw new Error("Request was aborted");n.push({type:"done",reason:o.stopReason,message:o}),n.end();return}catch(y){if(w==="websocket"||h)throw y}}let u,f;for(let h=0;h<=v;h++){if(r?.signal?.aborted)throw new Error("Request was aborted");try{if(u=await fetch(W(e.baseUrl),{method:"POST",headers:p,body:l,signal:r?.signal}),u.ok)break;const y=await u.text();if(h<v&&V(u.status,y)){const I=R*2**h;await T(I,r?.signal);continue}const k=new Response(y,{status:u.status,statusText:u.statusText}),x=await fe(k);throw new Error(x.friendlyMessage||x.message)}catch(y){if(y instanceof Error&&(y.name==="AbortError"||y.message==="Request was aborted"))throw new Error("Request was aborted");if(f=y instanceof Error?y:new Error(String(y)),h<v&&!f.message.includes("usage limit")){const k=R*2**h;await T(k,r?.signal);continue}throw f}}if(!u?.ok)throw f??new Error("Failed after retries");if(!u.body)throw new Error("No response body");if(n.push({type:"start",partial:o}),await ee(u,o,n,e),r?.signal?.aborted)throw new Error("Request was aborted");n.push({type:"done",reason:o.stopReason,message:o}),n.end()}catch(s){o.stopReason=r?.signal?.aborted?"aborted":"error",o.errorMessage=s instanceof Error?s.message:String(s),n.push({type:"error",reason:o.stopReason,error:o}),n.end()}})(),n},ke=(e,t,r)=>{const n=r?.apiKey||O(e.provider);if(!n)throw new Error(`No API key for provider: ${e.provider}`);const o=N(e,r,n),s=M(e)?r?.reasoning:P(r?.reasoning);return Y(e,t,{...o,reasoningEffort:s})};function G(e,t,r){const n=U(e,t,F,{includeSystemPrompt:!1}),o={model:e.id,store:!1,stream:!0,instructions:t.systemPrompt,input:n,text:{verbosity:r?.textVerbosity||"medium"},include:["reasoning.encrypted_content"],prompt_cache_key:r?.sessionId,tool_choice:"auto",parallel_tool_calls:!0};return r?.temperature!==void 0&&(o.temperature=r.temperature),t.tools&&(o.tools=H(t.tools,{strict:null})),r?.reasoningEffort!==void 0&&(o.reasoning={effort:Q(e.id,r.reasoningEffort),summary:r.reasoningSummary??"auto"}),o}function Q(e,t){const r=e.includes("/")?e.split("/").pop():e;return(r.startsWith("gpt-5.2")||r.startsWith("gpt-5.3")||r.startsWith("gpt-5.4"))&&t==="minimal"?"low":r==="gpt-5.1"&&t==="xhigh"?"high":r==="gpt-5.1-codex-mini"?t==="high"||t==="xhigh"?"high":"medium":t}function W(e){const r=(e&&e.trim().length>0?e:X).replace(/\/+$/,"");return r.endsWith("/codex/responses")?r:r.endsWith("/codex")?`${r}/responses`:`${r}/codex/responses`}function Z(e){const t=new URL(W(e));return t.protocol==="https:"&&(t.protocol="wss:"),t.protocol==="http:"&&(t.protocol="ws:"),t.toString()}async function ee(e,t,r,n){await L(C(re(e)),t,r,n)}async function*C(e){for await(const t of e){const r=typeof t.type=="string"?t.type:void 0;if(r){if(r==="error"){const n=t.code||"",o=t.message||"";throw new Error(`Codex error: ${o||n||JSON.stringify(t)}`)}if(r==="response.failed"){const n=t.response?.error?.message;throw new Error(n||"Codex response failed")}if(r==="response.done"||r==="response.completed"||r==="response.incomplete"){const n=t.response,o=n&&{...n,status:te(n.status)};yield{...t,type:"response.completed",response:o};return}yield t}}}function te(e){if(typeof e=="string")return j.has(e)?e:void 0}async function*re(e){if(!e.body)return;const t=e.body.getReader(),r=new TextDecoder;let n="";try{for(;;){const{done:o,value:s}=await t.read();if(o)break;n+=r.decode(s,{stream:!0});let i=n.indexOf(`
|
|
2
2
|
|
|
3
3
|
`);for(;i!==-1;){const a=n.slice(0,i);n=n.slice(i+2);const c=a.split(`
|
|
4
4
|
`).filter(d=>d.startsWith("data:")).map(d=>d.slice(5).trim());if(c.length>0){const d=c.join(`
|