ai-speedometer 1.0.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.
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env node
2
+ var Qy=Object.create;var Ua=Object.defineProperty;var eb=Object.getOwnPropertyDescriptor;var tb=Object.getOwnPropertyNames;var rb=Object.getPrototypeOf,nb=Object.prototype.hasOwnProperty;var np=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var op=(e,t)=>()=>(e&&(t=e(e=0)),t);var ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zt=(e,t)=>{for(var n in t)Ua(e,n,{get:t[n],enumerable:!0})},ob=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of tb(t))!nb.call(e,r)&&r!==n&&Ua(e,r,{get:()=>t[r],enumerable:!(o=eb(t,r))||o.enumerable});return e};var ib=(e,t,n)=>(n=e!=null?Qy(rb(e)):{},ob(t||!e||!e.__esModule?Ua(n,"default",{value:e,enumerable:!0}):n,e));import jo from"fs";import Ov from"path";import{homedir as sE}from"os";function uE(){try{jo.existsSync(wd)||jo.mkdirSync(wd,{recursive:!0})}catch(e){console.warn("Warning: Could not create cache directory:",e.message)}}function lE(e){if(!e.timestamp)return!0;let n=Date.now()-e.timestamp,o=3600*1e3;return n>o}function cE(){try{if(jo.existsSync(kd)){let e=jo.readFileSync(kd,"utf8"),t=JSON.parse(e);return lE(t)?null:t}}catch(e){console.warn("Warning: Could not load cache:",e.message)}return null}function dE(e){try{uE();let t={...e,timestamp:Date.now()};jo.writeFileSync(kd,JSON.stringify(t,null,2))}catch(t){console.warn("Warning: Could not save cache:",t.message)}}async function pE(){try{let e=await fetch("https://models.dev/api.json");if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return await e.json()}catch(e){return console.warn("Warning: Could not fetch from models.dev API:",e.message),null}}function mE(e){if(!e)return $d;let t=[];for(let[,n]of Object.entries(e))if(n.id&&n.name&&n.models){let o={id:n.id,name:n.name,baseUrl:n.api||n.baseUrl||"",type:n.npm&&n.npm.includes("anthropic")?"anthropic":"openai-compatible",models:Object.values(n.models).map(r=>({id:r.id,name:r.name}))};t.push(o)}return t.length>0?t:$d}async function dr(){let e=cE();if(e&&e.providers)return e.providers;let t=await pE();if(t){let n=mE(t);return dE({providers:n}),n}return $d}async function Sd(e){let t=await dr(),n=e.toLowerCase();return t.filter(o=>o.name.toLowerCase().includes(n)||o.id.toLowerCase().includes(n))}async function Da(e){let n=(await dr()).find(o=>o.id===e);return n?n.models:[]}var wd,kd,$d,Id=op(()=>{wd=Ov.join(sE(),".cache","ai-speedometer"),kd=Ov.join(wd,"models.json"),$d=[{id:"openai",name:"OpenAI",baseUrl:"https://api.openai.com/v1",type:"openai-compatible",models:[{id:"gpt-4o",name:"GPT-4o"},{id:"gpt-4o-mini",name:"GPT-4o Mini"},{id:"gpt-4-turbo",name:"GPT-4 Turbo"},{id:"gpt-3.5-turbo",name:"GPT-3.5 Turbo"}]},{id:"anthropic",name:"Anthropic",baseUrl:"https://api.anthropic.com",type:"anthropic",models:[{id:"claude-3-5-sonnet-20241022",name:"Claude 3.5 Sonnet"},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku"},{id:"claude-3-opus-20240229",name:"Claude 3 Opus"}]},{id:"openrouter",name:"OpenRouter",baseUrl:"https://openrouter.ai/api/v1",type:"openai-compatible",models:[{id:"anthropic/claude-3.5-sonnet",name:"Claude 3.5 Sonnet"},{id:"openai/gpt-4o",name:"GPT-4o"},{id:"openai/gpt-4o-mini",name:"GPT-4o Mini"}]}]});var No={};Zt(No,{addApiKey:()=>ka,getAllAvailableProviders:()=>Cd,getAuthenticatedProviders:()=>Rv,getCustomProviders:()=>Fv,getDebugInfo:()=>Od,getProviderAuth:()=>hE,isProviderAuthenticated:()=>gE,migrateFromOldConfig:()=>Ad,readAuthJson:()=>pr,readOpencodeConfig:()=>wa,removeApiKey:()=>fE,verifyProvider:()=>Mv,writeAuthJson:()=>Td,writeOpencodeConfig:()=>zv});import lt from"fs";import tn from"path";import{homedir as jv}from"os";import{parse as Pv}from"jsonc-parser";var Ed,Po,Nv,pr,Td,zv,wa,Rv,Fv,Mv,ka,fE,Cd,gE,hE,Ad,Od,rn=op(()=>{Id();Ed=()=>{let e=process.env.XDG_DATA_HOME||tn.join(jv(),".local","share"),t=process.env.XDG_CONFIG_HOME||tn.join(jv(),".config");return{data:tn.join(e,"opencode"),config:tn.join(t,"opencode")}},Po=()=>{let e=Ed();return{authJson:tn.join(e.data,"auth.json"),opencodeJson:tn.join(e.config,"opencode.json")}},Nv=()=>{let e=Ed();[e.data,e.config].forEach(t=>{lt.existsSync(t)||lt.mkdirSync(t,{recursive:!0})})},pr=async()=>{let{authJson:e}=Po();try{if(!lt.existsSync(e))return{};let t=lt.readFileSync(e,"utf8"),n=[],o=Pv(t,n,{allowTrailingComma:!0});return n.length>0?(console.warn("Warning: JSONC parsing errors in auth.json:",n.map(r=>r.error).join(", ")),o||{}):o}catch(t){return console.warn("Warning: Could not read auth.json:",t.message),{}}},Td=async e=>{let{authJson:t}=Po();try{Nv();let n=JSON.stringify(e,null,2);return lt.writeFileSync(t,n),lt.chmodSync(t,384),!0}catch(n){return console.error("Error writing auth.json:",n.message),!1}},zv=async e=>{let{opencodeJson:t}=Po();try{Nv();let n=JSON.stringify(e,null,2);return lt.writeFileSync(t,n),!0}catch(n){return console.error("Error writing opencode.json:",n.message),!1}},wa=async()=>{let{opencodeJson:e}=Po();try{if(!lt.existsSync(e))return{provider:{}};let t=lt.readFileSync(e,"utf8"),n=[],o=Pv(t,n,{allowTrailingComma:!0});return n.length>0?(console.warn("Warning: JSONC parsing errors in opencode.json:",n.map(r=>r.error).join(", ")),o&&typeof o=="object"?(o.provider||(o.provider={}),o):{provider:{}}):(o.provider||(o.provider={}),o)}catch(t){return console.warn("Warning: Could not read opencode.json:",t.message),{provider:{}}}},Rv=async()=>{let e=await pr(),t=await dr(),n=[];for(let[o,r]of Object.entries(e)){let i=t.find(a=>a.id===o);if(i&&r.type==="api"&&r.key){let a=await Da(o);n.push({id:o,name:i.name,type:i.type,baseUrl:i.baseUrl,apiKey:r.key,authType:r.type,models:a.map(u=>({name:u.name,id:`${o}_${u.id}`}))})}}return n},Fv=async()=>{let e=await wa(),t=[];for(let[n,o]of Object.entries(e.provider||{})){if(o.options&&!o.models)continue;let r=[];if(o.models)for(let[c,l]of Object.entries(o.models)){let d=l.name||c;r.push({name:d.trim(),id:`${n}_${c}`})}let i=o.options?.baseURL||o.baseUrl,a=o.options?.apiKey||"",u="openai-compatible";o.npm==="@ai-sdk/anthropic"?u="anthropic":o.npm==="@ai-sdk/google"?u="google":o.npm==="@ai-sdk/openai"&&(u="openai"),(r.length>0||o.options)&&t.push({id:n,name:o.name||n,type:u,baseUrl:i,apiKey:a,models:r})}return t},Mv=async e=>{try{return(await dr()).find(n=>n.id===e)}catch(t){return console.warn("Warning: Could not verify provider:",t.message),null}},ka=async(e,t)=>{let n=await pr();return n[e]={type:"api",key:t},await Td(n)},fE=async e=>{let t=await pr();return t[e]?(delete t[e],await Td(t)):!0},Cd=async()=>{let[e,t]=await Promise.all([Rv(),Fv()]);return[...e,...t]},gE=async e=>{let t=await pr();return t[e]&&t[e].type==="api"},hE=async e=>(await pr())[e]||null,Ad=async e=>{let t={migrated:0,failed:0,errors:[]};try{if(e.verifiedProviders)for(let[n,o]of Object.entries(e.verifiedProviders))await Mv(n)?await ka(n,o)?t.migrated++:(t.failed++,t.errors.push(`Failed to migrate ${n}`)):(t.failed++,t.errors.push(`Provider ${n} not found in models.dev`));if(e.customProviders&&e.customProviders.length>0){let n=await wa();for(let o of e.customProviders)try{n.provider[o.id]={name:o.name,options:{apiKey:o.apiKey,baseURL:o.baseUrl},models:{}};for(let r of o.models)n.provider[o.id].models[r.id.replace(`${o.id}_`,"")]={name:r.name};t.migrated++}catch(r){t.failed++,t.errors.push(`Failed to migrate custom provider ${o.name}: ${r.message}`)}await zv(n)}return t}catch(n){return t.failed++,t.errors.push(`Migration failed: ${n.message}`),t}},Od=async()=>{let e=Po(),[t,n]=await Promise.all([pr(),wa()]),o=lt.existsSync(e.authJson),r=lt.existsSync(e.opencodeJson);return{paths:e,authExists:o,configExists:r,authData:Object.keys(t),configProviders:Object.keys(n.provider||{}),xdgPaths:Ed()}}});var $a=ue((R4,Zv)=>{var jd=[],Uv=0,Ie=(e,t)=>{Uv>=t&&jd.push(e)};Ie.WARN=1;Ie.INFO=2;Ie.DEBUG=3;Ie.reset=()=>{jd=[]};Ie.setDebugLevel=e=>{Uv=e};Ie.warn=e=>Ie(e,Ie.WARN);Ie.info=e=>Ie(e,Ie.INFO);Ie.debug=e=>Ie(e,Ie.DEBUG);Ie.debugMessages=()=>jd;Zv.exports=Ie});var Bv=ue((F4,Lv)=>{"use strict";Lv.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var Vv=ue((M4,qv)=>{"use strict";var vE=Bv();qv.exports=e=>typeof e=="string"?e.replace(vE(),""):e});var Gv=ue((U4,Pd)=>{"use strict";var Jv=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Pd.exports=Jv;Pd.exports.default=Jv});var Kv=ue((Z4,Wv)=>{"use strict";Wv.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Yv=ue((L4,Nd)=>{"use strict";var yE=Vv(),bE=Gv(),_E=Kv(),Hv=e=>{if(typeof e!="string"||e.length===0||(e=yE(e),e.length===0))return 0;e=e.replace(_E()," ");let t=0;for(let n=0;n<e.length;n++){let o=e.codePointAt(n);o<=31||o>=127&&o<=159||o>=768&&o<=879||(o>65535&&n++,t+=bE(o)?2:1)}return t};Nd.exports=Hv;Nd.exports.default=Hv});var zd=ue((B4,ty)=>{var Xv=Yv();function Sa(e){return e?/\u001b\[((?:\d*;){0,5}\d*)m/g:/\u001b\[(?:\d*;){0,5}\d*m/g}function _t(e){let t=Sa();return(""+e).replace(t,"").split(`
3
+ `).reduce(function(r,i){return Xv(i)>r?Xv(i):r},0)}function zo(e,t){return Array(t+1).join(e)}function xE(e,t,n,o){let r=_t(e);if(t+1>=r){let i=t-r;switch(o){case"right":{e=zo(n,i)+e;break}case"center":{let a=Math.ceil(i/2),u=i-a;e=zo(n,u)+e+zo(n,a);break}default:{e=e+zo(n,i);break}}}return e}var nn={};function Ro(e,t,n){t="\x1B["+t+"m",n="\x1B["+n+"m",nn[t]={set:e,to:!0},nn[n]={set:e,to:!1},nn[e]={on:t,off:n}}Ro("bold",1,22);Ro("italics",3,23);Ro("underline",4,24);Ro("inverse",7,27);Ro("strikethrough",9,29);function Qv(e,t){let n=t[1]?parseInt(t[1].split(";")[0]):0;if(n>=30&&n<=39||n>=90&&n<=97){e.lastForegroundAdded=t[0];return}if(n>=40&&n<=49||n>=100&&n<=107){e.lastBackgroundAdded=t[0];return}if(n===0){for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&delete e[r];return}let o=nn[t[0]];o&&(e[o.set]=o.to)}function DE(e){let t=Sa(!0),n=t.exec(e),o={};for(;n!==null;)Qv(o,n),n=t.exec(e);return o}function ey(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t+=nn[r].off)}),n&&n!="\x1B[49m"&&(t+="\x1B[49m"),o&&o!="\x1B[39m"&&(t+="\x1B[39m"),t}function wE(e,t){let n=e.lastBackgroundAdded,o=e.lastForegroundAdded;return delete e.lastBackgroundAdded,delete e.lastForegroundAdded,Object.keys(e).forEach(function(r){e[r]&&(t=nn[r].on+t)}),n&&n!="\x1B[49m"&&(t=n+t),o&&o!="\x1B[39m"&&(t=o+t),t}function kE(e,t){if(e.length===_t(e))return e.substr(0,t);for(;_t(e)>t;)e=e.slice(0,-1);return e}function $E(e,t){let n=Sa(!0),o=e.split(Sa()),r=0,i=0,a="",u,c={};for(;i<t;){u=n.exec(e);let l=o[r];if(r++,i+_t(l)>t&&(l=kE(l,t-i)),a+=l,i+=_t(l),i<t){if(!u)break;a+=u[0],Qv(c,u)}}return ey(c,a)}function SE(e,t,n){if(n=n||"\u2026",_t(e)<=t)return e;t-=_t(n);let r=$E(e,t);r+=n;let i="\x1B]8;;\x07";return e.includes(i)&&!r.includes(i)&&(r+=i),r}function IE(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function EE(e,t){e=e||{},t=t||IE();let n=Object.assign({},t,e);return n.chars=Object.assign({},t.chars,e.chars),n.style=Object.assign({},t.style,e.style),n}function TE(e,t){let n=[],o=t.split(/(\s+)/g),r=[],i=0,a;for(let u=0;u<o.length;u+=2){let c=o[u],l=i+_t(c);i>0&&a&&(l+=a.length),l>e?(i!==0&&n.push(r.join("")),r=[c],i=_t(c)):(r.push(a||"",c),i=l),a=o[u+1]}return i&&n.push(r.join("")),n}function CE(e,t){let n=[],o="";function r(a,u){for(o.length&&u&&(o+=u),o+=a;o.length>e;)n.push(o.slice(0,e)),o=o.slice(e)}let i=t.split(/(\s+)/g);for(let a=0;a<i.length;a+=2)r(i[a],a&&i[a-1]);return o.length&&n.push(o),n}function AE(e,t,n=!0){let o=[];t=t.split(`
4
+ `);let r=n?TE:CE;for(let i=0;i<t.length;i++)o.push.apply(o,r(e,t[i]));return o}function OE(e){let t={},n=[];for(let o=0;o<e.length;o++){let r=wE(t,e[o]);t=DE(r);let i=Object.assign({},t);n.push(ey(i,r))}return n}function jE(e,t){return["\x1B]","8",";",";",e||t,"\x07",t,"\x1B]","8",";",";","\x07"].join("")}ty.exports={strlen:_t,repeat:zo,pad:xE,truncate:SE,mergeOptions:EE,wordWrap:AE,colorizeLines:OE,hyperlink:jE}});var iy=ue((q4,oy)=>{var ny={};oy.exports=ny;var ry={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(ry).forEach(function(e){var t=ry[e],n=ny[e]=[];n.open="\x1B["+t[0]+"m",n.close="\x1B["+t[1]+"m"})});var sy=ue((V4,ay)=>{"use strict";ay.exports=function(e,t){t=t||process.argv;var n=t.indexOf("--"),o=/^-{1,2}/.test(e)?"":"--",r=t.indexOf(o+e);return r!==-1&&(n===-1?!0:r<n)}});var ly=ue((J4,uy)=>{"use strict";var PE=np("os"),ct=sy(),Ne=process.env,on=void 0;ct("no-color")||ct("no-colors")||ct("color=false")?on=!1:(ct("color")||ct("colors")||ct("color=true")||ct("color=always"))&&(on=!0);"FORCE_COLOR"in Ne&&(on=Ne.FORCE_COLOR.length===0||parseInt(Ne.FORCE_COLOR,10)!==0);function NE(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function zE(e){if(on===!1)return 0;if(ct("color=16m")||ct("color=full")||ct("color=truecolor"))return 3;if(ct("color=256"))return 2;if(e&&!e.isTTY&&on!==!0)return 0;var t=on?1:0;if(process.platform==="win32"){var n=PE.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in Ne)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(r){return r in Ne})||Ne.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Ne)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ne.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ne){var o=parseInt((Ne.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ne.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ne.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ne.TERM)||"COLORTERM"in Ne?1:(Ne.TERM==="dumb",t)}function Rd(e){var t=zE(e);return NE(t)}uy.exports={supportsColor:Rd,stdout:Rd(process.stdout),stderr:Rd(process.stderr)}});var dy=ue((G4,cy)=>{cy.exports=function(t,n){var o="";t=t||"Run the trap, drop the bass",t=t.split("");var r={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return t.forEach(function(i){i=i.toLowerCase();var a=r[i]||[" "],u=Math.floor(Math.random()*a.length);typeof r[i]<"u"?o+=r[i][u]:o+=i}),o}});var my=ue((W4,py)=>{py.exports=function(t,n){t=t||" he is here ";var o={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},r=[].concat(o.up,o.down,o.mid);function i(c){var l=Math.floor(Math.random()*c);return l}function a(c){var l=!1;return r.filter(function(d){l=d===c}),l}function u(c,l){var d="",v,y;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",c=c.split("");for(y in c)if(!a(y)){switch(d=d+c[y],v={up:0,down:0,mid:0},l.size){case"mini":v.up=i(8),v.mid=i(2),v.down=i(8);break;case"maxi":v.up=i(16)+3,v.mid=i(4)+1,v.down=i(64)+3;break;default:v.up=i(8)+1,v.mid=i(6)/2,v.down=i(8)+1;break}var p=["up","mid","down"];for(var m in p)for(var f=p[m],g=0;g<=v[f];g++)l[f]&&(d=d+o[f][i(o[f].length)])}return d}return u(t,n)}});var gy=ue((K4,fy)=>{fy.exports=function(e){return function(t,n,o){if(t===" ")return t;switch(n%3){case 0:return e.red(t);case 1:return e.white(t);case 2:return e.blue(t)}}}});var vy=ue((H4,hy)=>{hy.exports=function(e){return function(t,n,o){return n%2===0?t:e.inverse(t)}}});var by=ue((Y4,yy)=>{yy.exports=function(e){var t=["red","yellow","green","blue","magenta"];return function(n,o,r){return n===" "?n:e[t[o++%t.length]](n)}}});var xy=ue((X4,_y)=>{_y.exports=function(e){var t=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(n,o,r){return n===" "?n:e[t[Math.round(Math.random()*(t.length-2))]](n)}}});var Iy=ue((e2,Sy)=>{var K={};Sy.exports=K;K.themes={};var RE=np("util"),mr=K.styles=iy(),wy=Object.defineProperties,FE=new RegExp(/[\r\n]+/g);K.supportsColor=ly().supportsColor;typeof K.enabled>"u"&&(K.enabled=K.supportsColor()!==!1);K.enable=function(){K.enabled=!0};K.disable=function(){K.enabled=!1};K.stripColors=K.strip=function(e){return(""+e).replace(/\x1B\[\d+m/g,"")};var Q4=K.stylize=function(t,n){if(!K.enabled)return t+"";var o=mr[n];return!o&&n in K?K[n](t):o.open+t+o.close},ME=/[|\\{}()[\]^$+*?.]/g,UE=function(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(ME,"\\$&")};function ky(e){var t=function n(){return LE.apply(n,arguments)};return t._styles=e,t.__proto__=ZE,t}var $y=(function(){var e={};return mr.grey=mr.gray,Object.keys(mr).forEach(function(t){mr[t].closeRe=new RegExp(UE(mr[t].close),"g"),e[t]={get:function(){return ky(this._styles.concat(t))}}}),e})(),ZE=wy(function(){},$y);function LE(){var e=Array.prototype.slice.call(arguments),t=e.map(function(a){return a!=null&&a.constructor===String?a:RE.inspect(a)}).join(" ");if(!K.enabled||!t)return t;for(var n=t.indexOf(`
5
+ `)!=-1,o=this._styles,r=o.length;r--;){var i=mr[o[r]];t=i.open+t.replace(i.closeRe,i.open)+i.close,n&&(t=t.replace(FE,function(a){return i.close+a+i.open}))}return t}K.setTheme=function(e){if(typeof e=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var t in e)(function(n){K[n]=function(o){if(typeof e[n]=="object"){var r=o;for(var i in e[n])r=K[e[n][i]](r);return r}return K[e[n]](o)}})(t)};function BE(){var e={};return Object.keys($y).forEach(function(t){e[t]={get:function(){return ky([t])}}}),e}var qE=function(t,n){var o=n.split("");return o=o.map(t),o.join("")};K.trap=dy();K.zalgo=my();K.maps={};K.maps.america=gy()(K);K.maps.zebra=vy()(K);K.maps.rainbow=by()(K);K.maps.random=xy()(K);for(Dy in K.maps)(function(e){K[e]=function(t){return qE(K.maps[e],t)}})(Dy);var Dy;wy(K,BE())});var Ty=ue((t2,Ey)=>{var VE=Iy();Ey.exports=VE});var jy=ue((r2,Ia)=>{var{info:JE,debug:Oy}=$a(),We=zd(),Md=class e{constructor(t){this.setOptions(t),this.x=null,this.y=null}setOptions(t){["boolean","number","bigint","string"].indexOf(typeof t)!==-1&&(t={content:""+t}),t=t||{},this.options=t;let n=t.content;if(["boolean","number","bigint","string"].indexOf(typeof n)!==-1)this.content=String(n);else if(!n)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof n);this.colSpan=t.colSpan||1,this.rowSpan=t.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(t,n){this.cells=n;let o=this.options.chars||{},r=t.chars,i=this.chars={};WE.forEach(function(c){Fd(o,r,c,i)}),this.truncate=this.options.truncate||t.truncate;let a=this.options.style=this.options.style||{},u=t.style;Fd(a,u,"padding-left",this),Fd(a,u,"padding-right",this),this.head=a.head||u.head,this.border=a.border||u.border,this.fixedWidth=t.colWidths[this.x],this.lines=this.computeLines(t),this.desiredWidth=We.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(t){let n=t.wordWrap||t.textWrap,{wordWrap:o=n}=this.options;if(this.fixedWidth&&o){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let a=1;for(;a<this.colSpan;)this.fixedWidth+=t.colWidths[this.x+a],a++}let{wrapOnWordBoundary:r=!0}=t,{wrapOnWordBoundary:i=r}=this.options;return this.wrapLines(We.wordWrap(this.fixedWidth,this.content,i))}return this.wrapLines(this.content.split(`
6
+ `))}wrapLines(t){let n=We.colorizeLines(t);return this.href?n.map(o=>We.hyperlink(this.href,o)):n}init(t){let n=this.x,o=this.y;this.widths=t.colWidths.slice(n,n+this.colSpan),this.heights=t.rowHeights.slice(o,o+this.rowSpan),this.width=this.widths.reduce(Ay,-1),this.height=this.heights.reduce(Ay,-1),this.hAlign=this.options.hAlign||t.colAligns[n],this.vAlign=this.options.vAlign||t.rowAligns[o],this.drawRight=n+this.colSpan==t.colWidths.length}draw(t,n){if(t=="top")return this.drawTop(this.drawRight);if(t=="bottom")return this.drawBottom(this.drawRight);let o=We.truncate(this.content,10,this.truncate);t||JE(`${this.y}-${this.x}: ${this.rowSpan-t}x${this.colSpan} Cell ${o}`);let r=Math.max(this.height-this.lines.length,0),i;switch(this.vAlign){case"center":i=Math.ceil(r/2);break;case"bottom":i=r;break;default:i=0}if(t<i||t>=i+this.lines.length)return this.drawEmpty(this.drawRight,n);let a=this.lines.length>this.height&&t+1>=this.height;return this.drawLine(t-i,this.drawRight,a,n)}drawTop(t){let n=[];return this.cells?this.widths.forEach(function(o,r){n.push(this._topLeftChar(r)),n.push(We.repeat(this.chars[this.y==0?"top":"mid"],o))},this):(n.push(this._topLeftChar(0)),n.push(We.repeat(this.chars[this.y==0?"top":"mid"],this.width))),t&&n.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",n.join(""))}_topLeftChar(t){let n=this.x+t,o;if(this.y==0)o=n==0?"topLeft":t==0?"topMid":"top";else if(n==0)o="leftMid";else if(o=t==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][n]instanceof e.ColSpanCell&&(o=t==0?"topMid":"mid"),t==0)){let i=1;for(;this.cells[this.y][n-i]instanceof e.ColSpanCell;)i++;this.cells[this.y][n-i]instanceof e.RowSpanCell&&(o="leftMid")}return this.chars[o]}wrapWithStyleColors(t,n){if(this[t]&&this[t].length)try{let o=Ty();for(let r=this[t].length-1;r>=0;r--)o=o[this[t][r]];return o(n)}catch{return n}else return n}drawLine(t,n,o,r){let i=this.chars[this.x==0?"left":"middle"];if(this.x&&r&&this.cells){let y=this.cells[this.y+r][this.x-1];for(;y instanceof Fo;)y=this.cells[y.y][y.x-1];y instanceof Mo||(i=this.chars.rightMid)}let a=We.repeat(" ",this.paddingLeft),u=n?this.chars.right:"",c=We.repeat(" ",this.paddingRight),l=this.lines[t],d=this.width-(this.paddingLeft+this.paddingRight);o&&(l+=this.truncate||"\u2026");let v=We.truncate(l,d,this.truncate);return v=We.pad(v,d," ",this.hAlign),v=a+v+c,this.stylizeLine(i,v,u)}stylizeLine(t,n,o){return t=this.wrapWithStyleColors("border",t),o=this.wrapWithStyleColors("border",o),this.y===0&&(n=this.wrapWithStyleColors("head",n)),t+n+o}drawBottom(t){let n=this.chars[this.x==0?"bottomLeft":"bottomMid"],o=We.repeat(this.chars.bottom,this.width),r=t?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",n+o+r)}drawEmpty(t,n){let o=this.chars[this.x==0?"left":"middle"];if(this.x&&n&&this.cells){let a=this.cells[this.y+n][this.x-1];for(;a instanceof Fo;)a=this.cells[a.y][a.x-1];a instanceof Mo||(o=this.chars.rightMid)}let r=t?this.chars.right:"",i=We.repeat(" ",this.width);return this.stylizeLine(o,i,r)}},Fo=class{constructor(){}draw(t){return typeof t=="number"&&Oy(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Mo=class{constructor(t){this.originalCell=t}init(t){let n=this.y,o=this.originalCell.y;this.cellOffset=n-o,this.offset=GE(t.rowHeights,o,this.cellOffset)}draw(t){return t=="top"?this.originalCell.draw(this.offset,this.cellOffset):t=="bottom"?this.originalCell.draw("bottom"):(Oy(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+t))}mergeTableOptions(){}};function Cy(...e){return e.filter(t=>t!=null).shift()}function Fd(e,t,n,o){let r=n.split("-");r.length>1?(r[1]=r[1].charAt(0).toUpperCase()+r[1].substr(1),r=r.join(""),o[r]=Cy(e[r],e[n],t[r],t[n])):o[n]=Cy(e[n],t[n])}function GE(e,t,n){let o=e[t];for(let r=1;r<n;r++)o+=1+e[t+r];return o}function Ay(e,t){return e+t+1}var WE=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];Ia.exports=Md;Ia.exports.ColSpanCell=Fo;Ia.exports.RowSpanCell=Mo});var zy=ue((n2,Ny)=>{var{warn:KE,debug:HE}=$a(),Ud=jy(),{ColSpanCell:YE,RowSpanCell:XE}=Ud;(function(){function e(p,m){return p[m]>0?e(p,m+1):m}function t(p){let m={};p.forEach(function(f,g){let b=0;f.forEach(function(D){D.y=g,D.x=g?e(m,b):b;let $=D.rowSpan||1,_=D.colSpan||1;if($>1)for(let P=0;P<_;P++)m[D.x+P]=$;b=D.x+_}),Object.keys(m).forEach(D=>{m[D]--,m[D]<1&&delete m[D]})})}function n(p){let m=0;return p.forEach(function(f){f.forEach(function(g){m=Math.max(m,g.x+(g.colSpan||1))})}),m}function o(p){return p.length}function r(p,m){let f=p.y,g=p.y-1+(p.rowSpan||1),b=m.y,D=m.y-1+(m.rowSpan||1),$=!(f>D||b>g),_=p.x,P=p.x-1+(p.colSpan||1),O=m.x,S=m.x-1+(m.colSpan||1),k=!(_>S||O>P);return $&&k}function i(p,m,f){let g=Math.min(p.length-1,f),b={x:m,y:f};for(let D=0;D<=g;D++){let $=p[D];for(let _=0;_<$.length;_++)if(r(b,$[_]))return!0}return!1}function a(p,m,f,g){for(let b=f;b<g;b++)if(i(p,b,m))return!1;return!0}function u(p){p.forEach(function(m,f){m.forEach(function(g){for(let b=1;b<g.rowSpan;b++){let D=new XE(g);D.x=g.x,D.y=g.y+b,D.colSpan=g.colSpan,l(D,p[f+b])}})})}function c(p){for(let m=p.length-1;m>=0;m--){let f=p[m];for(let g=0;g<f.length;g++){let b=f[g];for(let D=1;D<b.colSpan;D++){let $=new YE;$.x=b.x+D,$.y=b.y,f.splice(g+1,0,$)}}}}function l(p,m){let f=0;for(;f<m.length&&m[f].x<p.x;)f++;m.splice(f,0,p)}function d(p){let m=o(p),f=n(p);HE(`Max rows: ${m}; Max cols: ${f}`);for(let g=0;g<m;g++)for(let b=0;b<f;b++)if(!i(p,b,g)){let D={x:b,y:g,colSpan:1,rowSpan:1};for(b++;b<f&&!i(p,b,g);)D.colSpan++,b++;let $=g+1;for(;$<m&&a(p,$,D.x,D.x+D.colSpan);)D.rowSpan++,$++;let _=new Ud(D);_.x=D.x,_.y=D.y,KE(`Missing cell at ${_.y}-${_.x}.`),l(_,p[g])}}function v(p){return p.map(function(m){if(!Array.isArray(m)){let f=Object.keys(m)[0];m=m[f],Array.isArray(m)?(m=m.slice(),m.unshift(f)):m=[f,m]}return m.map(function(f){return new Ud(f)})})}function y(p){let m=v(p);return t(m),d(m),u(m),c(m),m}Ny.exports={makeTableLayout:y,layoutTable:t,addRowSpanCells:u,maxWidth:n,fillInTable:d,computeWidths:Py("colSpan","desiredWidth","x",1),computeHeights:Py("rowSpan","desiredHeight","y",1)}})();function Py(e,t,n,o){return function(r,i){let a=[],u=[],c={};i.forEach(function(l){l.forEach(function(d){(d[e]||1)>1?u.push(d):a[d[n]]=Math.max(a[d[n]]||0,d[t]||0,o)})}),r.forEach(function(l,d){typeof l=="number"&&(a[d]=l)});for(let l=u.length-1;l>=0;l--){let d=u[l],v=d[e],y=d[n],p=a[y],m=typeof r[y]=="number"?0:1;if(typeof p=="number")for(let f=1;f<v;f++)p+=1+a[y+f],typeof r[y+f]!="number"&&m++;else p=t==="desiredWidth"?d.desiredWidth-1:1,(!c[y]||c[y]<p)&&(c[y]=p);if(d[t]>p){let f=0;for(;m>0&&d[t]>p;){if(typeof r[y+f]!="number"){let g=Math.round((d[t]-p)/m);p+=g,a[y+f]+=g,m--}f++}}}Object.assign(r,a,c);for(let l=0;l<r.length;l++)r[l]=Math.max(o,r[l]||0)}}});var Fy=ue((o2,Ry)=>{var Ut=$a(),QE=zd(),Zd=zy(),Ea=class extends Array{constructor(t){super();let n=QE.mergeOptions(t);if(Object.defineProperty(this,"options",{value:n,enumerable:n.debug}),n.debug){switch(typeof n.debug){case"boolean":Ut.setDebugLevel(Ut.WARN);break;case"number":Ut.setDebugLevel(n.debug);break;case"string":Ut.setDebugLevel(parseInt(n.debug,10));break;default:Ut.setDebugLevel(Ut.WARN),Ut.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof n.debug}`)}Object.defineProperty(this,"messages",{get(){return Ut.debugMessages()}})}}toString(){let t=this,n=this.options.head&&this.options.head.length;n?(t=[this.options.head],this.length&&t.push.apply(t,this)):this.options.style.head=[];let o=Zd.makeTableLayout(t);o.forEach(function(i){i.forEach(function(a){a.mergeTableOptions(this.options,o)},this)},this),Zd.computeWidths(this.options.colWidths,o),Zd.computeHeights(this.options.rowHeights,o),o.forEach(function(i){i.forEach(function(a){a.init(this.options)},this)},this);let r=[];for(let i=0;i<o.length;i++){let a=o[i],u=this.options.rowHeights[i];(i===0||!this.options.style.compact||i==1&&n)&&Ld(a,"top",r);for(let c=0;c<u;c++)Ld(a,c,r);i+1==o.length&&Ld(a,"bottom",r)}return r.join(`
7
+ `)}get width(){return this.toString().split(`
8
+ `)[0].length}};Ea.reset=()=>Ut.reset();function Ld(e,t,n){let o=[];e.forEach(function(i){o.push(i.draw(t))});let r=o.join("");r.length&&n.push(r)}Ry.exports=Ea});var Uy=ue((i2,My)=>{My.exports=Fy()});import eT from"readline";import Ta from"fs";var ip="vercel.ai.error",ab=Symbol.for(ip),ap,sb=class sp extends Error{constructor({name:t,message:n,cause:o}){super(n),this[ap]=!0,this.name=t,this.cause=o}static isInstance(t){return sp.hasMarker(t,ip)}static hasMarker(t,n){let o=Symbol.for(n);return t!=null&&typeof t=="object"&&o in t&&typeof t[o]=="boolean"&&t[o]===!0}};ap=ab;var M=sb,up="AI_APICallError",lp=`vercel.ai.error.${up}`,ub=Symbol.for(lp),cp,le=class extends M{constructor({message:e,url:t,requestBodyValues:n,statusCode:o,responseHeaders:r,responseBody:i,cause:a,isRetryable:u=o!=null&&(o===408||o===409||o===429||o>=500),data:c}){super({name:up,message:e,cause:a}),this[cp]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=o,this.responseHeaders=r,this.responseBody=i,this.isRetryable=u,this.data=c}static isInstance(e){return M.hasMarker(e,lp)}};cp=ub;var dp="AI_EmptyResponseBodyError",pp=`vercel.ai.error.${dp}`,lb=Symbol.for(pp),mp,fp=class extends M{constructor({message:e="Empty response body"}={}){super({name:dp,message:e}),this[mp]=!0}static isInstance(e){return M.hasMarker(e,pp)}};mp=lb;function ft(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var gp="AI_InvalidArgumentError",hp=`vercel.ai.error.${gp}`,cb=Symbol.for(hp),vp,Bo=class extends M{constructor({message:e,cause:t,argument:n}){super({name:gp,message:e,cause:t}),this[vp]=!0,this.argument=n}static isInstance(e){return M.hasMarker(e,hp)}};vp=cb;var yp="AI_InvalidPromptError",bp=`vercel.ai.error.${yp}`,db=Symbol.for(bp),_p,$t=class extends M{constructor({prompt:e,message:t,cause:n}){super({name:yp,message:`Invalid prompt: ${t}`,cause:n}),this[_p]=!0,this.prompt=e}static isInstance(e){return M.hasMarker(e,bp)}};_p=db;var xp="AI_InvalidResponseDataError",Dp=`vercel.ai.error.${xp}`,pb=Symbol.for(Dp),wp,La=class extends M{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:xp,message:t}),this[wp]=!0,this.data=e}static isInstance(e){return M.hasMarker(e,Dp)}};wp=pb;var kp="AI_JSONParseError",$p=`vercel.ai.error.${kp}`,mb=Symbol.for($p),Sp,mn=class extends M{constructor({text:e,cause:t}){super({name:kp,message:`JSON parsing failed: Text: ${e}.
9
+ Error message: ${ft(t)}`,cause:t}),this[Sp]=!0,this.text=e}static isInstance(e){return M.hasMarker(e,$p)}};Sp=mb;var Ip="AI_LoadAPIKeyError",Ep=`vercel.ai.error.${Ip}`,fb=Symbol.for(Ep),Tp,fn=class extends M{constructor({message:e}){super({name:Ip,message:e}),this[Tp]=!0}static isInstance(e){return M.hasMarker(e,Ep)}};Tp=fb;var gb="AI_LoadSettingError",hb=`vercel.ai.error.${gb}`,vb=Symbol.for(hb),yb;yb=vb;var bb="AI_NoContentGeneratedError",_b=`vercel.ai.error.${bb}`,xb=Symbol.for(_b),Db;Db=xb;var Cp="AI_NoSuchModelError",Ap=`vercel.ai.error.${Cp}`,wb=Symbol.for(Ap),Op,gn=class extends M{constructor({errorName:e=Cp,modelId:t,modelType:n,message:o=`No such ${n}: ${t}`}){super({name:e,message:o}),this[Op]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return M.hasMarker(e,Ap)}};Op=wb;var jp="AI_TooManyEmbeddingValuesForCallError",Pp=`vercel.ai.error.${jp}`,kb=Symbol.for(Pp),Np,zp=class extends M{constructor(e){super({name:jp,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Np]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return M.hasMarker(e,Pp)}};Np=kb;var Rp="AI_TypeValidationError",Fp=`vercel.ai.error.${Rp}`,$b=Symbol.for(Fp),Mp,Sb=class Za extends M{constructor({value:t,cause:n}){super({name:Rp,message:`Type validation failed: Value: ${JSON.stringify(t)}.
10
+ Error message: ${ft(n)}`,cause:n}),this[Mp]=!0,this.value=t}static isInstance(t){return M.hasMarker(t,Fp)}static wrap({value:t,cause:n}){return Za.isInstance(n)&&n.value===t?n:new Za({value:t,cause:n})}};Mp=$b;var Lt=Sb,Up="AI_UnsupportedFunctionalityError",Zp=`vercel.ai.error.${Up}`,Ib=Symbol.for(Zp),Lp,De=class extends M{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:Up,message:t}),this[Lp]=!0,this.functionality=e}static isInstance(e){return M.hasMarker(e,Zp)}};Lp=Ib;var qo=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Ba(e){}function Bp(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=Ba,onError:n=Ba,onRetry:o=Ba,onComment:r}=e,i="",a=!0,u,c="",l="";function d(f){let g=a?f.replace(/^\xEF\xBB\xBF/,""):f,[b,D]=Eb(`${i}${g}`);for(let $ of b)v($);i=D,a=!1}function v(f){if(f===""){p();return}if(f.startsWith(":")){r&&r(f.slice(f.startsWith(": ")?2:1));return}let g=f.indexOf(":");if(g!==-1){let b=f.slice(0,g),D=f[g+1]===" "?2:1,$=f.slice(g+D);y(b,$,f);return}y(f,"",f)}function y(f,g,b){switch(f){case"event":l=g;break;case"data":c=`${c}${g}
11
+ `;break;case"id":u=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?o(parseInt(g,10)):n(new qo(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:b}));break;default:n(new qo(`Unknown field "${f.length>20?`${f.slice(0,20)}\u2026`:f}"`,{type:"unknown-field",field:f,value:g,line:b}));break}}function p(){c.length>0&&t({id:u,event:l||void 0,data:c.endsWith(`
12
+ `)?c.slice(0,-1):c}),u=void 0,c="",l=""}function m(f={}){i&&f.consume&&v(i),a=!0,u=void 0,c="",l="",i=""}return{feed:d,reset:m}}function Eb(e){let t=[],n="",o=0;for(;o<e.length;){let r=e.indexOf("\r",o),i=e.indexOf(`
13
+ `,o),a=-1;if(r!==-1&&i!==-1?a=Math.min(r,i):r!==-1?r===e.length-1?a=-1:a=r:i!==-1&&(a=i),a===-1){n=e.slice(o);break}else{let u=e.slice(o,a);t.push(u),o=a+1,e[o-1]==="\r"&&e[o]===`
14
+ `&&o++}}return[t,n]}var Vo=class extends TransformStream{constructor({onError:t,onRetry:n,onComment:o}={}){let r;super({start(i){r=Bp({onEvent:a=>{i.enqueue(a)},onError(a){t==="terminate"?i.error(a):typeof t=="function"&&t(a)},onRetry:n,onComment:o})},transform(i){r.feed(i)}})}};var s={};Zt(s,{$brand:()=>Jo,$input:()=>sl,$output:()=>al,NEVER:()=>qa,TimePrecision:()=>cl,ZodAny:()=>bf,ZodArray:()=>wf,ZodBase64:()=>$c,ZodBase64URL:()=>Sc,ZodBigInt:()=>ro,ZodBigIntFormat:()=>Tc,ZodBoolean:()=>to,ZodCIDRv4:()=>wc,ZodCIDRv6:()=>kc,ZodCUID:()=>hc,ZodCUID2:()=>vc,ZodCatch:()=>Lf,ZodCodec:()=>Mc,ZodCustom:()=>ea,ZodCustomStringFormat:()=>Qn,ZodDate:()=>Yi,ZodDefault:()=>zf,ZodDiscriminatedUnion:()=>kf,ZodE164:()=>Ic,ZodEmail:()=>mc,ZodEmoji:()=>fc,ZodEnum:()=>Yn,ZodError:()=>tD,ZodFile:()=>jf,ZodFirstPartyTypeKind:()=>Uc,ZodFunction:()=>Yf,ZodGUID:()=>Ji,ZodIPv4:()=>xc,ZodIPv6:()=>Dc,ZodISODate:()=>Li,ZodISODateTime:()=>Zi,ZodISODuration:()=>qi,ZodISOTime:()=>Bi,ZodIntersection:()=>$f,ZodIssueCode:()=>pw,ZodJWT:()=>Ec,ZodKSUID:()=>_c,ZodLazy:()=>Wf,ZodLiteral:()=>Of,ZodMap:()=>Cf,ZodNaN:()=>qf,ZodNanoID:()=>gc,ZodNever:()=>xf,ZodNonOptional:()=>Rc,ZodNull:()=>vf,ZodNullable:()=>Nf,ZodNumber:()=>eo,ZodNumberFormat:()=>Or,ZodObject:()=>Qi,ZodOptional:()=>zc,ZodPipe:()=>Fc,ZodPrefault:()=>Ff,ZodPromise:()=>Hf,ZodReadonly:()=>Vf,ZodRealError:()=>Fe,ZodRecord:()=>jc,ZodSet:()=>Af,ZodString:()=>Xn,ZodStringFormat:()=>oe,ZodSuccess:()=>Zf,ZodSymbol:()=>gf,ZodTemplateLiteral:()=>Gf,ZodTransform:()=>Pf,ZodTuple:()=>If,ZodType:()=>J,ZodULID:()=>yc,ZodURL:()=>Hi,ZodUUID:()=>Ct,ZodUndefined:()=>hf,ZodUnion:()=>Ac,ZodUnknown:()=>_f,ZodVoid:()=>Df,ZodXID:()=>bc,_ZodString:()=>pc,_default:()=>Rf,_function:()=>iw,any:()=>MD,array:()=>Xi,base64:()=>DD,base64url:()=>wD,bigint:()=>PD,boolean:()=>ff,catch:()=>Bf,check:()=>aw,cidrv4:()=>_D,cidrv6:()=>xD,clone:()=>Ce,codec:()=>rw,coerce:()=>Zc,config:()=>ce,core:()=>Tt,cuid:()=>mD,cuid2:()=>fD,custom:()=>sw,date:()=>ZD,decode:()=>nc,decodeAsync:()=>ic,discriminatedUnion:()=>JD,e164:()=>kD,email:()=>nD,emoji:()=>dD,encode:()=>rc,encodeAsync:()=>oc,endsWith:()=>Ln,enum:()=>Pc,file:()=>XD,flattenError:()=>kn,float32:()=>CD,float64:()=>AD,formatError:()=>$n,function:()=>iw,getErrorMap:()=>fw,globalRegistry:()=>ht,gt:()=>It,gte:()=>Re,guid:()=>oD,hash:()=>TD,hex:()=>ED,hostname:()=>ID,httpUrl:()=>cD,includes:()=>Un,instanceof:()=>uw,int:()=>dc,int32:()=>OD,int64:()=>ND,intersection:()=>Sf,ipv4:()=>yD,ipv6:()=>bD,iso:()=>Vi,json:()=>cw,jwt:()=>$D,keyof:()=>LD,ksuid:()=>vD,lazy:()=>Kf,length:()=>Tr,literal:()=>YD,locales:()=>jn,looseObject:()=>VD,lowercase:()=>Fn,lt:()=>St,lte:()=>Ye,map:()=>WD,maxLength:()=>Er,maxSize:()=>Ir,mime:()=>Bn,minLength:()=>Kt,minSize:()=>sr,multipleOf:()=>ar,nan:()=>tw,nanoid:()=>pD,nativeEnum:()=>HD,negative:()=>Ml,never:()=>Cc,nonnegative:()=>Zl,nonoptional:()=>Uf,nonpositive:()=>Ul,normalize:()=>qn,null:()=>yf,nullable:()=>Wi,nullish:()=>QD,number:()=>mf,object:()=>BD,optional:()=>Gi,overwrite:()=>Et,parse:()=>Ql,parseAsync:()=>ec,partialRecord:()=>GD,pipe:()=>Ki,positive:()=>Fl,prefault:()=>Mf,preprocess:()=>dw,prettifyError:()=>ts,promise:()=>ow,property:()=>Ll,readonly:()=>Jf,record:()=>Tf,refine:()=>Xf,regex:()=>Rn,regexes:()=>He,registry:()=>_i,safeDecode:()=>sc,safeDecodeAsync:()=>lc,safeEncode:()=>ac,safeEncodeAsync:()=>uc,safeParse:()=>tc,safeParseAsync:()=>Hn,set:()=>KD,setErrorMap:()=>mw,size:()=>zn,startsWith:()=>Zn,strictObject:()=>qD,string:()=>cc,stringFormat:()=>SD,stringbool:()=>lw,success:()=>ew,superRefine:()=>Qf,symbol:()=>RD,templateLiteral:()=>nw,toJSONSchema:()=>Kn,toLowerCase:()=>Jn,toUpperCase:()=>Gn,transform:()=>Nc,treeifyError:()=>es,trim:()=>Vn,tuple:()=>Ef,uint32:()=>jD,uint64:()=>zD,ulid:()=>gD,undefined:()=>FD,union:()=>Oc,unknown:()=>Ar,uppercase:()=>Mn,url:()=>lD,util:()=>E,uuid:()=>iD,uuidv4:()=>aD,uuidv6:()=>sD,uuidv7:()=>uD,void:()=>UD,xid:()=>hD});var Tt={};Zt(Tt,{$ZodAny:()=>Tu,$ZodArray:()=>Pu,$ZodAsyncError:()=>nt,$ZodBase64:()=>bu,$ZodBase64URL:()=>_u,$ZodBigInt:()=>fi,$ZodBigIntFormat:()=>$u,$ZodBoolean:()=>Tn,$ZodCIDRv4:()=>hu,$ZodCIDRv6:()=>vu,$ZodCUID:()=>iu,$ZodCUID2:()=>au,$ZodCatch:()=>Yu,$ZodCheck:()=>ie,$ZodCheckBigIntFormat:()=>Ns,$ZodCheckEndsWith:()=>Gs,$ZodCheckGreaterThan:()=>si,$ZodCheckIncludes:()=>Vs,$ZodCheckLengthEquals:()=>Zs,$ZodCheckLessThan:()=>ai,$ZodCheckLowerCase:()=>Bs,$ZodCheckMaxLength:()=>Ms,$ZodCheckMaxSize:()=>zs,$ZodCheckMimeType:()=>Ks,$ZodCheckMinLength:()=>Us,$ZodCheckMinSize:()=>Rs,$ZodCheckMultipleOf:()=>js,$ZodCheckNumberFormat:()=>Ps,$ZodCheckOverwrite:()=>Hs,$ZodCheckProperty:()=>Ws,$ZodCheckRegex:()=>Ls,$ZodCheckSizeEquals:()=>Fs,$ZodCheckStartsWith:()=>Js,$ZodCheckStringFormat:()=>$r,$ZodCheckUpperCase:()=>qs,$ZodCodec:()=>Cn,$ZodCustom:()=>il,$ZodCustomStringFormat:()=>wu,$ZodDate:()=>ju,$ZodDefault:()=>Gu,$ZodDiscriminatedUnion:()=>zu,$ZodE164:()=>xu,$ZodEmail:()=>tu,$ZodEmoji:()=>nu,$ZodEncodeError:()=>Bt,$ZodEnum:()=>Zu,$ZodError:()=>wn,$ZodFile:()=>Bu,$ZodFunction:()=>rl,$ZodGUID:()=>Qs,$ZodIPv4:()=>fu,$ZodIPv6:()=>gu,$ZodISODate:()=>du,$ZodISODateTime:()=>cu,$ZodISODuration:()=>mu,$ZodISOTime:()=>pu,$ZodIntersection:()=>Ru,$ZodJWT:()=>Du,$ZodKSUID:()=>lu,$ZodLazy:()=>ol,$ZodLiteral:()=>Lu,$ZodMap:()=>Mu,$ZodNaN:()=>Xu,$ZodNanoID:()=>ou,$ZodNever:()=>Au,$ZodNonOptional:()=>Ku,$ZodNull:()=>Eu,$ZodNullable:()=>Ju,$ZodNumber:()=>mi,$ZodNumberFormat:()=>ku,$ZodObject:()=>gm,$ZodObjectJIT:()=>Nu,$ZodOptional:()=>Vu,$ZodPipe:()=>Qu,$ZodPrefault:()=>Wu,$ZodPromise:()=>nl,$ZodReadonly:()=>el,$ZodRealError:()=>ze,$ZodRecord:()=>Fu,$ZodRegistry:()=>Sr,$ZodSet:()=>Uu,$ZodString:()=>ir,$ZodStringFormat:()=>ne,$ZodSuccess:()=>Hu,$ZodSymbol:()=>Su,$ZodTemplateLiteral:()=>tl,$ZodTransform:()=>qu,$ZodTuple:()=>hi,$ZodType:()=>q,$ZodULID:()=>su,$ZodURL:()=>ru,$ZodUUID:()=>eu,$ZodUndefined:()=>Iu,$ZodUnion:()=>gi,$ZodUnknown:()=>Cu,$ZodVoid:()=>Ou,$ZodXID:()=>uu,$brand:()=>Jo,$constructor:()=>x,$input:()=>sl,$output:()=>al,Doc:()=>En,JSONSchema:()=>cf,JSONSchemaGenerator:()=>Wn,NEVER:()=>qa,TimePrecision:()=>cl,_any:()=>Al,_array:()=>Bl,_base64:()=>Ri,_base64url:()=>Fi,_bigint:()=>kl,_boolean:()=>Dl,_catch:()=>Wx,_check:()=>lf,_cidrv4:()=>Ni,_cidrv6:()=>zi,_coercedBigint:()=>$l,_coercedBoolean:()=>wl,_coercedDate:()=>zl,_coercedNumber:()=>hl,_coercedString:()=>ll,_cuid:()=>Ei,_cuid2:()=>Ti,_custom:()=>Vl,_date:()=>Nl,_decode:()=>Xo,_decodeAsync:()=>ei,_default:()=>Vx,_discriminatedUnion:()=>jx,_e164:()=>Mi,_email:()=>xi,_emoji:()=>Si,_encode:()=>Yo,_encodeAsync:()=>Qo,_endsWith:()=>Ln,_enum:()=>Mx,_file:()=>ql,_float32:()=>yl,_float64:()=>bl,_gt:()=>It,_gte:()=>Re,_guid:()=>Pn,_includes:()=>Un,_int:()=>vl,_int32:()=>_l,_int64:()=>Sl,_intersection:()=>Px,_ipv4:()=>ji,_ipv6:()=>Pi,_isoDate:()=>pl,_isoDateTime:()=>dl,_isoDuration:()=>fl,_isoTime:()=>ml,_jwt:()=>Ui,_ksuid:()=>Oi,_lazy:()=>Xx,_length:()=>Tr,_literal:()=>Zx,_lowercase:()=>Fn,_lt:()=>St,_lte:()=>Ye,_map:()=>Rx,_max:()=>Ye,_maxLength:()=>Er,_maxSize:()=>Ir,_mime:()=>Bn,_min:()=>Re,_minLength:()=>Kt,_minSize:()=>sr,_multipleOf:()=>ar,_nan:()=>Rl,_nanoid:()=>Ii,_nativeEnum:()=>Ux,_negative:()=>Ml,_never:()=>jl,_nonnegative:()=>Zl,_nonoptional:()=>Jx,_nonpositive:()=>Ul,_normalize:()=>qn,_null:()=>Cl,_nullable:()=>qx,_number:()=>gl,_optional:()=>Bx,_overwrite:()=>Et,_parse:()=>xr,_parseAsync:()=>Dr,_pipe:()=>Kx,_positive:()=>Fl,_promise:()=>Qx,_property:()=>Ll,_readonly:()=>Hx,_record:()=>zx,_refine:()=>Jl,_regex:()=>Rn,_safeDecode:()=>ri,_safeDecodeAsync:()=>oi,_safeEncode:()=>ti,_safeEncodeAsync:()=>ni,_safeParse:()=>wr,_safeParseAsync:()=>kr,_set:()=>Fx,_size:()=>zn,_startsWith:()=>Zn,_string:()=>ul,_stringFormat:()=>Cr,_stringbool:()=>Wl,_success:()=>Gx,_superRefine:()=>Gl,_symbol:()=>El,_templateLiteral:()=>Yx,_toLowerCase:()=>Jn,_toUpperCase:()=>Gn,_transform:()=>Lx,_trim:()=>Vn,_tuple:()=>Nx,_uint32:()=>xl,_uint64:()=>Il,_ulid:()=>Ci,_undefined:()=>Tl,_union:()=>Ox,_unknown:()=>Ol,_uppercase:()=>Mn,_url:()=>Nn,_uuid:()=>Di,_uuidv4:()=>wi,_uuidv6:()=>ki,_uuidv7:()=>$i,_void:()=>Pl,_xid:()=>Ai,clone:()=>Ce,config:()=>ce,decode:()=>r_,decodeAsync:()=>o_,encode:()=>t_,encodeAsync:()=>n_,flattenError:()=>kn,formatError:()=>$n,globalConfig:()=>hn,globalRegistry:()=>ht,isValidBase64:()=>yu,isValidBase64URL:()=>dm,isValidJWT:()=>pm,locales:()=>jn,parse:()=>Ko,parseAsync:()=>Ho,prettifyError:()=>ts,regexes:()=>He,registry:()=>_i,safeDecode:()=>a_,safeDecodeAsync:()=>u_,safeEncode:()=>i_,safeEncodeAsync:()=>s_,safeParse:()=>rs,safeParseAsync:()=>ns,toDotPath:()=>Wp,toJSONSchema:()=>Kn,treeifyError:()=>es,util:()=>E,version:()=>Ys});var qa=Object.freeze({status:"aborted"});function x(e,t,n){function o(u,c){var l;Object.defineProperty(u,"_zod",{value:u._zod??{},enumerable:!1}),(l=u._zod).traits??(l.traits=new Set),u._zod.traits.add(e),t(u,c);for(let d in a.prototype)d in u||Object.defineProperty(u,d,{value:a.prototype[d].bind(u)});u._zod.constr=a,u._zod.def=c}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function a(u){var c;let l=n?.Parent?new i:this;o(l,u),(c=l._zod).deferred??(c.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:u=>n?.Parent&&u instanceof n.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var Jo=Symbol("zod_brand"),nt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Bt=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},hn={};function ce(e){return e&&Object.assign(hn,e),hn}var E={};Zt(E,{BIGINT_FORMAT_RANGES:()=>Qa,Class:()=>Ja,NUMBER_FORMAT_RANGES:()=>Xa,aborted:()=>Wt,allowsEval:()=>Wa,assert:()=>jb,assertEqual:()=>Tb,assertIs:()=>Ab,assertNever:()=>Ob,assertNotEqual:()=>Cb,assignProp:()=>Vt,base64ToUint8Array:()=>Vp,base64urlToUint8Array:()=>Hb,cached:()=>br,captureStackTrace:()=>Wo,cleanEnum:()=>Kb,cleanRegex:()=>bn,clone:()=>Ce,cloneDef:()=>Nb,createTransparentProxy:()=>Zb,defineLazy:()=>W,esc:()=>Go,escapeRegex:()=>gt,extend:()=>qb,finalizeIssue:()=>Be,floatSafeRemainder:()=>Ga,getElementAtPath:()=>zb,getEnumValues:()=>yn,getLengthableOrigin:()=>Dn,getParsedType:()=>Ub,getSizableOrigin:()=>xn,hexToUint8Array:()=>Xb,isObject:()=>nr,isPlainObject:()=>Gt,issue:()=>_r,joinValues:()=>w,jsonStringifyReplacer:()=>yr,merge:()=>Jb,mergeDefs:()=>Jt,normalizeParams:()=>A,nullish:()=>qt,numKeys:()=>Mb,objectClone:()=>Pb,omit:()=>Bb,optionalKeys:()=>Ya,partial:()=>Gb,pick:()=>Lb,prefixIssues:()=>Le,primitiveTypes:()=>Ha,promiseAllObject:()=>Rb,propertyKeyTypes:()=>_n,randomString:()=>Fb,required:()=>Wb,safeExtend:()=>Vb,shallowClone:()=>Ka,stringifyPrimitive:()=>C,uint8ArrayToBase64:()=>Jp,uint8ArrayToBase64url:()=>Yb,uint8ArrayToHex:()=>Qb,unwrapMessage:()=>vn});function Tb(e){return e}function Cb(e){return e}function Ab(e){}function Ob(e){throw new Error}function jb(e){}function yn(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function w(e,t="|"){return e.map(n=>C(n)).join(t)}function yr(e,t){return typeof t=="bigint"?t.toString():t}function br(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function qt(e){return e==null}function bn(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Ga(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c?.[1]&&(r=Number.parseInt(c[1]))}let i=n>r?n:r,a=Number.parseInt(e.toFixed(i).replace(".","")),u=Number.parseInt(t.toFixed(i).replace(".",""));return a%u/10**i}var qp=Symbol("evaluating");function W(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==qp)return o===void 0&&(o=qp,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Pb(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Vt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Jt(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function Nb(e){return Jt(e._zod.def)}function zb(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function Rb(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function Fb(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Go(e){return JSON.stringify(e)}var Wo="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function nr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Wa=br(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gt(e){if(nr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(nr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ka(e){return Gt(e)?{...e}:Array.isArray(e)?[...e]:e}function Mb(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Ub=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},_n=new Set(["string","number","symbol"]),Ha=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ce(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function A(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Zb(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function C(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ya(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Xa={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Qa={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Lb(e,t){let n=e._zod.def,o=Jt(e._zod.def,{get shape(){let r={};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(r[i]=n.shape[i])}return Vt(this,"shape",r),r},checks:[]});return Ce(e,o)}function Bb(e,t){let n=e._zod.def,o=Jt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete r[i]}return Vt(this,"shape",r),r},checks:[]});return Ce(e,o)}function qb(e,t){if(!Gt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");let r=Jt(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Vt(this,"shape",i),i},checks:[]});return Ce(e,r)}function Vb(e,t){if(!Gt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return Vt(this,"shape",o),o},checks:e._zod.def.checks};return Ce(e,n)}function Jb(e,t){let n=Jt(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Vt(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return Ce(e,n)}function Gb(e,t,n){let o=Jt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in r))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=e?new e({type:"optional",innerType:r[a]}):r[a])}else for(let a in r)i[a]=e?new e({type:"optional",innerType:r[a]}):r[a];return Vt(this,"shape",i),i},checks:[]});return Ce(t,o)}function Wb(e,t,n){let o=Jt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:r[a]}))}else for(let a in r)i[a]=new e({type:"nonoptional",innerType:r[a]});return Vt(this,"shape",i),i},checks:[]});return Ce(t,o)}function Wt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Le(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function vn(e){return typeof e=="string"?e:e?.message}function Be(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=vn(e.inst?._zod.def?.error?.(e))??vn(t?.error?.(e))??vn(n.customError?.(e))??vn(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function xn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dn(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _r(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function Kb(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Vp(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Jp(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Hb(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return Vp(t+n)}function Yb(e){return Jp(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Xb(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function Qb(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ja=class{constructor(...t){}};var Gp=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},wn=x("$ZodError",Gp),ze=x("$ZodError",Gp,{Parent:Error});function kn(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function $n(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(u=>r({issues:u}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)o._errors.push(n(a));else{let u=o,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(a))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}};return r(e),o}function es(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,a=[])=>{var u,c;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(d=>r({issues:d},l.path));else if(l.code==="invalid_key")r({issues:l.issues},l.path);else if(l.code==="invalid_element")r({issues:l.issues},l.path);else{let d=[...a,...l.path];if(d.length===0){o.errors.push(n(l));continue}let v=o,y=0;for(;y<d.length;){let p=d[y],m=y===d.length-1;typeof p=="string"?(v.properties??(v.properties={}),(u=v.properties)[p]??(u[p]={errors:[]}),v=v.properties[p]):(v.items??(v.items=[]),(c=v.items)[p]??(c[p]={errors:[]}),v=v.items[p]),m&&v.errors.push(n(l)),y++}}};return r(e),o}function Wp(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function ts(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Wp(o.path)}`);return t.join(`
15
+ `)}var xr=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new nt;if(a.issues.length){let u=new(r?.Err??e)(a.issues.map(c=>Be(c,i,ce())));throw Wo(u,r?.callee),u}return a.value},Ko=xr(ze),Dr=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let u=new(r?.Err??e)(a.issues.map(c=>Be(c,i,ce())));throw Wo(u,r?.callee),u}return a.value},Ho=Dr(ze),wr=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new nt;return i.issues.length?{success:!1,error:new(e??wn)(i.issues.map(a=>Be(a,r,ce())))}:{success:!0,data:i.value}},rs=wr(ze),kr=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Be(a,r,ce())))}:{success:!0,data:i.value}},ns=kr(ze),Yo=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return xr(e)(t,n,r)},t_=Yo(ze),Xo=e=>(t,n,o)=>xr(e)(t,n,o),r_=Xo(ze),Qo=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Dr(e)(t,n,r)},n_=Qo(ze),ei=e=>async(t,n,o)=>Dr(e)(t,n,o),o_=ei(ze),ti=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return wr(e)(t,n,r)},i_=ti(ze),ri=e=>(t,n,o)=>wr(e)(t,n,o),a_=ri(ze),ni=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return kr(e)(t,n,r)},s_=ni(ze),oi=e=>async(t,n,o)=>kr(e)(t,n,o),u_=oi(ze);var He={};Zt(He,{base64:()=>ys,base64url:()=>ii,bigint:()=>$s,boolean:()=>Es,browserEmail:()=>h_,cidrv4:()=>hs,cidrv6:()=>vs,cuid:()=>os,cuid2:()=>is,date:()=>xs,datetime:()=>ws,domain:()=>y_,duration:()=>cs,e164:()=>_s,email:()=>ps,emoji:()=>ms,extendedDuration:()=>l_,guid:()=>ds,hex:()=>b_,hostname:()=>bs,html5Email:()=>m_,idnEmail:()=>g_,integer:()=>Ss,ipv4:()=>fs,ipv6:()=>gs,ksuid:()=>us,lowercase:()=>As,md5_base64:()=>x_,md5_base64url:()=>D_,md5_hex:()=>__,nanoid:()=>ls,null:()=>Ts,number:()=>Is,rfc5322Email:()=>f_,sha1_base64:()=>k_,sha1_base64url:()=>$_,sha1_hex:()=>w_,sha256_base64:()=>I_,sha256_base64url:()=>E_,sha256_hex:()=>S_,sha384_base64:()=>C_,sha384_base64url:()=>A_,sha384_hex:()=>T_,sha512_base64:()=>j_,sha512_base64url:()=>P_,sha512_hex:()=>O_,string:()=>ks,time:()=>Ds,ulid:()=>as,undefined:()=>Cs,unicodeEmail:()=>Kp,uppercase:()=>Os,uuid:()=>or,uuid4:()=>c_,uuid6:()=>d_,uuid7:()=>p_,xid:()=>ss});var os=/^[cC][^\s-]{8,}$/,is=/^[0-9a-z]+$/,as=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ss=/^[0-9a-vA-V]{20}$/,us=/^[A-Za-z0-9]{27}$/,ls=/^[a-zA-Z0-9_-]{21}$/,cs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,l_=/^[-+]?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)?)??$/,ds=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,or=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,c_=or(4),d_=or(6),p_=or(7),ps=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,m_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,f_=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Kp=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,g_=Kp,h_=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,v_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ms(){return new RegExp(v_,"u")}var fs=/^(?:(?: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])$/,gs=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,hs=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,vs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ys=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ii=/^[A-Za-z0-9_-]*$/,bs=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,y_=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,_s=/^\+(?:[0-9]){6,14}[0-9]$/,Hp="(?:(?:\\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])))",xs=new RegExp(`^${Hp}$`);function Yp(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Ds(e){return new RegExp(`^${Yp(e)}$`)}function ws(e){let t=Yp({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${Hp}T(?:${o})$`)}var ks=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$s=/^-?\d+n?$/,Ss=/^-?\d+$/,Is=/^-?\d+(?:\.\d+)?/,Es=/^(?:true|false)$/i,Ts=/^null$/i;var Cs=/^undefined$/i;var As=/^[^A-Z]*$/,Os=/^[^a-z]*$/,b_=/^[0-9a-fA-F]*$/;function Sn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function In(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var __=/^[0-9a-fA-F]{32}$/,x_=Sn(22,"=="),D_=In(22),w_=/^[0-9a-fA-F]{40}$/,k_=Sn(27,"="),$_=In(27),S_=/^[0-9a-fA-F]{64}$/,I_=Sn(43,"="),E_=In(43),T_=/^[0-9a-fA-F]{96}$/,C_=Sn(64,""),A_=In(64),O_=/^[0-9a-fA-F]{128}$/,j_=Sn(86,"=="),P_=In(86);var ie=x("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qp={number:"number",bigint:"bigint",object:"date"},ai=x("$ZodCheckLessThan",(e,t)=>{ie.init(e,t);let n=Qp[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),si=x("$ZodCheckGreaterThan",(e,t)=>{ie.init(e,t);let n=Qp[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),js=x("$ZodCheckMultipleOf",(e,t)=>{ie.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Ga(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ps=x("$ZodCheckNumberFormat",(e,t)=>{ie.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=Xa[t.format];e._zod.onattach.push(a=>{let u=a._zod.bag;u.format=t.format,u.minimum=r,u.maximum=i,n&&(u.pattern=Ss)}),e._zod.check=a=>{let u=a.value;if(n){if(!Number.isInteger(u)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?a.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):a.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}u<r&&a.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>i&&a.issues.push({origin:"number",input:u,code:"too_big",maximum:i,inst:e})}}),Ns=x("$ZodCheckBigIntFormat",(e,t)=>{ie.init(e,t);let[n,o]=Qa[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),zs=x("$ZodCheckMaxSize",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:xn(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rs=x("$ZodCheckMinSize",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:xn(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Fs=x("$ZodCheckSizeEquals",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:xn(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Ms=x("$ZodCheckMaxLength",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let a=Dn(r);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Us=x("$ZodCheckMinLength",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let a=Dn(r);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zs=x("$ZodCheckLengthEquals",(e,t)=>{var n;ie.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!qt(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let a=Dn(r),u=i>t.length;o.issues.push({origin:a,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),$r=x("$ZodCheckStringFormat",(e,t)=>{var n,o;ie.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),Ls=x("$ZodCheckRegex",(e,t)=>{$r.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Bs=x("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=As),$r.init(e,t)}),qs=x("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Os),$r.init(e,t)}),Vs=x("$ZodCheckIncludes",(e,t)=>{ie.init(e,t);let n=gt(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Js=x("$ZodCheckStartsWith",(e,t)=>{ie.init(e,t);let n=new RegExp(`^${gt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Gs=x("$ZodCheckEndsWith",(e,t)=>{ie.init(e,t);let n=new RegExp(`.*${gt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});function Xp(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues))}var Ws=x("$ZodCheckProperty",(e,t)=>{ie.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>Xp(r,n,t.property));Xp(o,n,t.property)}}),Ks=x("$ZodCheckMimeType",(e,t)=>{ie.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Hs=x("$ZodCheckOverwrite",(e,t)=>{ie.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var En=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
16
+ `).filter(a=>a),r=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
17
+ `))}};var Ys={major:4,minor:1,patch:8};var q=x("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ys;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(a,u,c)=>{let l=Wt(a),d;for(let v of u){if(v._zod.def.when){if(!v._zod.def.when(a))continue}else if(l)continue;let y=a.issues.length,p=v._zod.check(a);if(p instanceof Promise&&c?.async===!1)throw new nt;if(d||p instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await p,a.issues.length!==y&&(l||(l=Wt(a,y)))});else{if(a.issues.length===y)continue;l||(l=Wt(a,y))}}return d?d.then(()=>a):a},i=(a,u,c)=>{if(Wt(a))return a.aborted=!0,a;let l=r(u,o,c);if(l instanceof Promise){if(c.async===!1)throw new nt;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(a,u)=>{if(u.skipChecks)return e._zod.parse(a,u);if(u.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,u)):i(l,a,u)}let c=e._zod.parse(a,u);if(c instanceof Promise){if(u.async===!1)throw new nt;return c.then(l=>r(l,o,u))}return r(c,o,u)}}e["~standard"]={validate:r=>{try{let i=rs(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return ns(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),ir=x("$ZodString",(e,t)=>{q.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ks(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ne=x("$ZodStringFormat",(e,t)=>{$r.init(e,t),ir.init(e,t)}),Qs=x("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ds),ne.init(e,t)}),eu=x("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=or(o))}else t.pattern??(t.pattern=or());ne.init(e,t)}),tu=x("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ps),ne.init(e,t)}),ru=x("$ZodURL",(e,t)=>{ne.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:bs.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),nu=x("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=ms()),ne.init(e,t)}),ou=x("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ls),ne.init(e,t)}),iu=x("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=os),ne.init(e,t)}),au=x("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=is),ne.init(e,t)}),su=x("$ZodULID",(e,t)=>{t.pattern??(t.pattern=as),ne.init(e,t)}),uu=x("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ss),ne.init(e,t)}),lu=x("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=us),ne.init(e,t)}),cu=x("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ws(t)),ne.init(e,t)}),du=x("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=xs),ne.init(e,t)}),pu=x("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Ds(t)),ne.init(e,t)}),mu=x("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cs),ne.init(e,t)}),fu=x("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fs),ne.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),gu=x("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gs),ne.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),hu=x("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=hs),ne.init(e,t)}),vu=x("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=vs),ne.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function yu(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var bu=x("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ys),ne.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{yu(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function dm(e){if(!ii.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return yu(n)}var _u=x("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ii),ne.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{dm(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),xu=x("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_s),ne.init(e,t)});function pm(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}var Du=x("$ZodJWT",(e,t)=>{ne.init(e,t),e._zod.check=n=>{pm(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),wu=x("$ZodCustomStringFormat",(e,t)=>{ne.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),mi=x("$ZodNumber",(e,t)=>{q.init(e,t),e._zod.pattern=e._zod.bag.pattern??Is,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),ku=x("$ZodNumber",(e,t)=>{Ps.init(e,t),mi.init(e,t)}),Tn=x("$ZodBoolean",(e,t)=>{q.init(e,t),e._zod.pattern=Es,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),fi=x("$ZodBigInt",(e,t)=>{q.init(e,t),e._zod.pattern=$s,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),$u=x("$ZodBigInt",(e,t)=>{Ns.init(e,t),fi.init(e,t)}),Su=x("$ZodSymbol",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Iu=x("$ZodUndefined",(e,t)=>{q.init(e,t),e._zod.pattern=Cs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Eu=x("$ZodNull",(e,t)=>{q.init(e,t),e._zod.pattern=Ts,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Tu=x("$ZodAny",(e,t)=>{q.init(e,t),e._zod.parse=n=>n}),Cu=x("$ZodUnknown",(e,t)=>{q.init(e,t),e._zod.parse=n=>n}),Au=x("$ZodNever",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Ou=x("$ZodVoid",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),ju=x("$ZodDate",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});function tm(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues)),t.value[n]=e.value}var Pu=x("$ZodArray",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let a=0;a<r.length;a++){let u=r[a],c=t.element._zod.run({value:u,issues:[]},o);c instanceof Promise?i.push(c.then(l=>tm(l,n,a))):tm(c,n,a)}return i.length?Promise.all(i).then(()=>n):n}});function pi(e,t,n,o){e.issues.length&&t.issues.push(...Le(n,e.issues)),e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function mm(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=Ya(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function fm(e,t,n,o,r,i){let a=[],u=r.keySet,c=r.catchall._zod,l=c.def.type;for(let d of Object.keys(t)){if(u.has(d))continue;if(l==="never"){a.push(d);continue}let v=c.run({value:t[d],issues:[]},o);v instanceof Promise?e.push(v.then(y=>pi(y,n,d,t))):pi(v,n,d,t)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}var gm=x("$ZodObject",(e,t)=>{q.init(e,t);let n=br(()=>mm(t));W(e._zod,"propValues",()=>{let a=t.shape,u={};for(let c in a){let l=a[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(let d of l.values)u[c].add(d)}}return u});let o=nr,r=t.catchall,i;e._zod.parse=(a,u)=>{i??(i=n.value);let c=a.value;if(!o(c))return a.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),a;a.value={};let l=[],d=i.shape;for(let v of i.keys){let p=d[v]._zod.run({value:c[v],issues:[]},u);p instanceof Promise?l.push(p.then(m=>pi(m,a,v,c))):pi(p,a,v,c)}return r?fm(l,c,a,u,n.value,e):l.length?Promise.all(l).then(()=>a):a}}),Nu=x("$ZodObjectJIT",(e,t)=>{gm.init(e,t);let n=e._zod.parse,o=br(()=>mm(t)),r=y=>{let p=new En(["shape","payload","ctx"]),m=o.value,f=$=>{let _=Go($);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};p.write("const input = payload.value;");let g=Object.create(null),b=0;for(let $ of m.keys)g[$]=`key_${b++}`;p.write("const newResult = {};");for(let $ of m.keys){let _=g[$],P=Go($);p.write(`const ${_} = ${f($)};`),p.write(`
18
+ if (${_}.issues.length) {
19
+ payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
20
+ ...iss,
21
+ path: iss.path ? [${P}, ...iss.path] : [${P}]
22
+ })));
23
+ }
24
+
25
+
26
+ if (${_}.value === undefined) {
27
+ if (${P} in input) {
28
+ newResult[${P}] = undefined;
29
+ }
30
+ } else {
31
+ newResult[${P}] = ${_}.value;
32
+ }
33
+
34
+ `)}p.write("payload.value = newResult;"),p.write("return payload;");let D=p.compile();return($,_)=>D(y,$,_)},i,a=nr,u=!hn.jitless,l=u&&Wa.value,d=t.catchall,v;e._zod.parse=(y,p)=>{v??(v=o.value);let m=y.value;return a(m)?u&&l&&p?.async===!1&&p.jitless!==!0?(i||(i=r(t.shape)),y=i(y,p),d?fm([],m,y,p,v,e):y):n(y,p):(y.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),y)}});function rm(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter(i=>!Wt(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(a=>Be(a,o,ce())))}),t)}var gi=x("$ZodUnion",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),W(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),W(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),W(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>bn(i.source)).join("|")})$`)}});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let a=!1,u=[];for(let c of t.options){let l=c._zod.run({value:r.value,issues:[]},i);if(l instanceof Promise)u.push(l),a=!0;else{if(l.issues.length===0)return l;u.push(l)}}return a?Promise.all(u).then(c=>rm(c,r,e,i)):rm(u,r,e,i)}}),zu=x("$ZodDiscriminatedUnion",(e,t)=>{gi.init(e,t);let n=e._zod.parse;W(e._zod,"propValues",()=>{let r={};for(let i of t.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[u,c]of Object.entries(a)){r[u]||(r[u]=new Set);for(let l of c)r[u].add(l)}}return r});let o=br(()=>{let r=t.options,i=new Map;for(let a of r){let u=a._zod.propValues?.[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of u){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,a)}}return i});e._zod.parse=(r,i)=>{let a=r.value;if(!nr(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let u=o.value.get(a?.[t.discriminator]);return u?u._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),r)}}),Ru=x("$ZodIntersection",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),a=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([c,l])=>nm(n,c,l)):nm(n,i,a)}});function Xs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Gt(e)&&Gt(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let a=Xs(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r[i]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],a=Xs(r,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function nm(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Wt(e))return e;let o=Xs(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hi=x("$ZodTuple",(e,t)=>{q.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let u=[];if(!t.rest){let l=a.length>n.length,d=a.length<o-1;if(l||d)return r.issues.push({...l?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:a,inst:e,origin:"array"}),r}let c=-1;for(let l of n){if(c++,c>=a.length&&c>=o)continue;let d=l._zod.run({value:a[c],issues:[]},i);d instanceof Promise?u.push(d.then(v=>ui(v,r,c))):ui(d,r,c)}if(t.rest){let l=a.slice(n.length);for(let d of l){c++;let v=t.rest._zod.run({value:d,issues:[]},i);v instanceof Promise?u.push(v.then(y=>ui(y,r,c))):ui(v,r,c)}}return u.length?Promise.all(u).then(()=>r):r}});function ui(e,t,n){e.issues.length&&t.issues.push(...Le(n,e.issues)),t.value[n]=e.value}var Fu=x("$ZodRecord",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Gt(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let a=t.keyType._zod.values;n.value={};for(let c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){let l=t.valueType._zod.run({value:r[c],issues:[]},o);l instanceof Promise?i.push(l.then(d=>{d.issues.length&&n.issues.push(...Le(c,d.issues)),n.value[c]=d.value})):(l.issues.length&&n.issues.push(...Le(c,l.issues)),n.value[c]=l.value)}let u;for(let c in r)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:u})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__")continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(l=>Be(l,o,ce())),input:a,path:[a],inst:e}),n.value[u.value]=u.value;continue}let c=t.valueType._zod.run({value:r[a],issues:[]},o);c instanceof Promise?i.push(c.then(l=>{l.issues.length&&n.issues.push(...Le(a,l.issues)),n.value[u.value]=l.value})):(c.issues.length&&n.issues.push(...Le(a,c.issues)),n.value[u.value]=c.value)}}return i.length?Promise.all(i).then(()=>n):n}}),Mu=x("$ZodMap",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[a,u]of r){let c=t.keyType._zod.run({value:a,issues:[]},o),l=t.valueType._zod.run({value:u,issues:[]},o);c instanceof Promise||l instanceof Promise?i.push(Promise.all([c,l]).then(([d,v])=>{om(d,v,n,a,r,e,o)})):om(c,l,n,a,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});function om(e,t,n,o,r,i,a){e.issues.length&&(_n.has(typeof o)?n.issues.push(...Le(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(u=>Be(u,a,ce()))})),t.issues.length&&(_n.has(typeof o)?n.issues.push(...Le(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(u=>Be(u,a,ce()))})),n.value.set(e.value,t.value)}var Uu=x("$ZodSet",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let a of r){let u=t.valueType._zod.run({value:a,issues:[]},o);u instanceof Promise?i.push(u.then(c=>im(c,n))):im(u,n)}return i.length?Promise.all(i).then(()=>n):n}});function im(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Zu=x("$ZodEnum",(e,t)=>{q.init(e,t);let n=yn(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>_n.has(typeof r)).map(r=>typeof r=="string"?gt(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;return o.has(a)||r.issues.push({code:"invalid_value",values:n,input:a,inst:e}),r}}),Lu=x("$ZodLiteral",(e,t)=>{if(q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?gt(n):n?gt(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),Bu=x("$ZodFile",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),qu=x("$ZodTransform",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Bt(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(a=>(n.value=a,n));if(r instanceof Promise)throw new nt;return n.value=r,n}});function am(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Vu=x("$ZodOptional",(e,t)=>{q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${bn(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>am(i,n.value)):am(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),Ju=x("$ZodNullable",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${bn(n.source)}|null)$`):void 0}),W(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),Gu=x("$ZodDefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>sm(i,t)):sm(r,t)}});function sm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Wu=x("$ZodPrefault",(e,t)=>{q.init(e,t),e._zod.optin="optional",W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),Ku=x("$ZodNonOptional",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>um(i,e)):um(r,e)}});function um(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var Hu=x("$ZodSuccess",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Bt("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),Yu=x("$ZodCatch",(e,t)=>{q.init(e,t),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),W(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>Be(a,o,ce()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Be(i,o,ce()))},input:n.value}),n.issues=[]),n)}}),Xu=x("$ZodNaN",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Qu=x("$ZodPipe",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>li(a,t.in,o)):li(i,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>li(i,t.out,o)):li(r,t.out,o)}});function li(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Cn=x("$ZodCodec",(e,t)=>{q.init(e,t),W(e._zod,"values",()=>t.in._zod.values),W(e._zod,"optin",()=>t.in._zod.optin),W(e._zod,"optout",()=>t.out._zod.optout),W(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);return i instanceof Promise?i.then(a=>ci(a,t,o)):ci(i,t,o)}else{let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(a=>ci(a,t,o)):ci(i,t,o)}}});function ci(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>di(e,i,t.out,n)):di(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>di(e,i,t.in,n)):di(e,r,t.in,n)}}function di(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}var el=x("$ZodReadonly",(e,t)=>{q.init(e,t),W(e._zod,"propValues",()=>t.innerType._zod.propValues),W(e._zod,"values",()=>t.innerType._zod.values),W(e._zod,"optin",()=>t.innerType._zod.optin),W(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(lm):lm(r)}});function lm(e){return e.value=Object.freeze(e.value),e}var tl=x("$ZodTemplateLiteral",(e,t)=>{q.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,a=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,a))}else if(o===null||Ha.has(typeof o))n.push(gt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),rl=x("$ZodFunction",(e,t)=>(q.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?Ko(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Ko(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await Ho(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await Ho(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new hi({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),nl=x("$ZodPromise",(e,t)=>{q.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),ol=x("$ZodLazy",(e,t)=>{q.init(e,t),W(e._zod,"innerType",()=>t.getter()),W(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),W(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),W(e._zod,"optin",()=>e._zod.innerType._zod.optin??void 0),W(e._zod,"optout",()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),il=x("$ZodCustom",(e,t)=>{ie.init(e,t),q.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>cm(i,n,o,e));cm(r,n,o,e)}});function cm(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(_r(r))}}var jn={};Zt(jn,{ar:()=>hm,az:()=>vm,be:()=>bm,ca:()=>_m,cs:()=>xm,da:()=>Dm,de:()=>wm,en:()=>vi,eo:()=>km,es:()=>$m,fa:()=>Sm,fi:()=>Im,fr:()=>Em,frCA:()=>Tm,he:()=>Cm,hu:()=>Am,id:()=>Om,is:()=>jm,it:()=>Pm,ja:()=>Nm,ka:()=>zm,kh:()=>Rm,km:()=>yi,ko:()=>Fm,lt:()=>Um,mk:()=>Zm,ms:()=>Lm,nl:()=>Bm,no:()=>qm,ota:()=>Vm,pl:()=>Gm,ps:()=>Jm,pt:()=>Wm,ru:()=>Hm,sl:()=>Ym,sv:()=>Xm,ta:()=>Qm,th:()=>ef,tr:()=>tf,ua:()=>rf,uk:()=>bi,ur:()=>nf,vi:()=>of,yo:()=>uf,zhCN:()=>af,zhTW:()=>sf});var z_=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${C(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function hm(){return{localeError:z_()}}var R_=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${C(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function vm(){return{localeError:R_()}}function ym(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var F_=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${C(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),c=ym(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),c=ym(u,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${r.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function bm(){return{localeError:F_()}}var M_=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${C(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${w(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",a=t(r.origin);return a?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",a=t(r.origin);return a?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}};function _m(){return{localeError:M_()}}var U_=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${C(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${w(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}};function xm(){return{localeError:U_()}}var Z_=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return u},i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${o(a.expected)}, fik ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${C(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);return c?`For stor: forventede ${l??"value"} ${c.verb} ${u} ${a.maximum.toString()} ${c.unit??"elementer"}`:`For stor: forventede ${l??"value"} havde ${u} ${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);return c?`For lille: forventede ${l} ${c.verb} ${u} ${a.minimum.toString()} ${c.unit}`:`For lille: forventede ${l} havde ${u} ${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Ugyldig streng: skal starte med "${u.prefix}"`:u.format==="ends_with"?`Ugyldig streng: skal ende med "${u.suffix}"`:u.format==="includes"?`Ugyldig streng: skal indeholde "${u.includes}"`:u.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${u.pattern}`:`Ugyldig ${i[u.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${w(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function Dm(){return{localeError:Z_()}}var L_=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${C(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}};function wm(){return{localeError:L_()}}var B_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},q_=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${B_(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${C(o.values[0])}`:`Invalid option: expected one of ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function vi(){return{localeError:q_()}}var V_=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},J_=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${V_(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${C(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${w(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}};function km(){return{localeError:J_()}}var G_=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};function n(a){return e[a]??null}function o(a){return t[a]??a}let r=a=>{let u=typeof a;switch(u){case"number":return Number.isNaN(a)?"NaN":"number";case"object":return Array.isArray(a)?"array":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype?a.constructor.name:"object"}return u},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return a=>{switch(a.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o(a.expected)}, recibido ${o(r(a.input))}`;case"invalid_value":return a.values.length===1?`Entrada inv\xE1lida: se esperaba ${C(a.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${w(a.values,"|")}`;case"too_big":{let u=a.inclusive?"<=":"<",c=n(a.origin),l=o(a.origin);return c?`Demasiado grande: se esperaba que ${l??"valor"} tuviera ${u}${a.maximum.toString()} ${c.unit??"elementos"}`:`Demasiado grande: se esperaba que ${l??"valor"} fuera ${u}${a.maximum.toString()}`}case"too_small":{let u=a.inclusive?">=":">",c=n(a.origin),l=o(a.origin);return c?`Demasiado peque\xF1o: se esperaba que ${l} tuviera ${u}${a.minimum.toString()} ${c.unit}`:`Demasiado peque\xF1o: se esperaba que ${l} fuera ${u}${a.minimum.toString()}`}case"invalid_format":{let u=a;return u.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${u.prefix}"`:u.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${u.suffix}"`:u.format==="includes"?`Cadena inv\xE1lida: debe incluir "${u.includes}"`:u.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${u.pattern}`:`Inv\xE1lido ${i[u.format]??a.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${a.divisor}`;case"unrecognized_keys":return`Llave${a.keys.length>1?"s":""} desconocida${a.keys.length>1?"s":""}: ${w(a.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o(a.origin)}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o(a.origin)}`;default:return"Entrada inv\xE1lida"}}};function $m(){return{localeError:G_()}}var W_=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${C(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${w(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${w(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Sm(){return{localeError:W_()}}var K_=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${C(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Im(){return{localeError:K_()}}var H_=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${C(r.values[0])} attendu`:`Option invalide : une valeur parmi ${w(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Trop grand : ${r.origin??"valeur"} doit ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Trop petit : ${r.origin} doit ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Em(){return{localeError:H_()}}var Y_=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${C(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",a=t(r.origin);return a?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",a=t(r.origin);return a?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${w(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}};function Tm(){return{localeError:Y_()}}var X_=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${C(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Cm(){return{localeError:X_()}}var Q_=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${C(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Am(){return{localeError:Q_()}}var ex=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${C(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}};function Om(){return{localeError:ex()}}var tx=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(e))return"fylki";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},rx=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(o){return e[o]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return o=>{switch(o.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${tx(o.input)} \xFEar sem \xE1 a\xF0 vera ${o.expected}`;case"invalid_value":return o.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${C(o.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} hafi ${r}${o.maximum.toString()} ${i.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin??"gildi"} s\xE9 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} hafi ${r}${o.minimum.toString()} ${i.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${o.origin} s\xE9 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${r.prefix}"`:r.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${r.suffix}"`:r.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${r.includes}"`:r.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${r.pattern}`:`Rangt ${n[r.format]??o.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${o.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${o.keys.length>1?"ir lyklar":"ur lykill"}: ${w(o.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${o.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${o.origin}`;default:return"Rangt gildi"}}};function jm(){return{localeError:rx()}}var nx=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${C(r.values[0])}`:`Opzione non valida: atteso uno tra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${w(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}};function Pm(){return{localeError:nx()}}var ox=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${C(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${w(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=t(r.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=t(r.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Nm(){return{localeError:ox()}}var ix=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8";case"object":{if(Array.isArray(e))return"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return{string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",undefined:"undefined",bigint:"bigint",symbol:"symbol",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0"}[t]??t},ax=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(o){return e[o]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"};return o=>{switch(o.code){case"invalid_type":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${ix(o.input)}`;case"invalid_value":return o.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${C(o.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${w(o.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${i.verb} ${r}${o.maximum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} ${i.verb} ${r}${o.minimum.toString()} ${i.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${o.origin} \u10D8\u10E7\u10DD\u10E1 ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.prefix}"-\u10D8\u10D7`:r.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${r.suffix}"-\u10D8\u10D7`:r.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${r.includes}"-\u10E1`:r.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${r.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[r.format]??o.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${o.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${o.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${w(o.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${o.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${o.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function zm(){return{localeError:ax()}}var sx=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${C(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${w(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function yi(){return{localeError:sx()}}function Rm(){return yi()}var ux=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${C(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${w(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),c=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${a}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",u=t(r.origin),c=u?.unit??"\uC694\uC18C";return u?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${i}${a}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${w(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Fm(){return{localeError:ux()}}var lx=e=>On(typeof e,e),On=(e,t=void 0)=>{switch(e){case"number":return Number.isNaN(t)?"NaN":"skai\u010Dius";case"bigint":return"sveikasis skai\u010Dius";case"string":return"eilut\u0117";case"boolean":return"login\u0117 reik\u0161m\u0117";case"undefined":case"void":return"neapibr\u0117\u017Eta reik\u0161m\u0117";case"function":return"funkcija";case"symbol":return"simbolis";case"object":return t===void 0?"ne\u017Einomas objektas":t===null?"nulin\u0117 reik\u0161m\u0117":Array.isArray(t)?"masyvas":Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:"objektas";case"null":return"nulin\u0117 reik\u0161m\u0117"}return e},An=e=>e.charAt(0).toUpperCase()+e.slice(1);function Mm(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}var cx=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(o,r,i,a){let u=e[o]??null;return u===null?u:{unit:u.unit[r],verb:u.verb[a][i?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"};return o=>{switch(o.code){case"invalid_type":return`Gautas tipas ${lx(o.input)}, o tik\u0117tasi - ${On(o.expected)}`;case"invalid_value":return o.values.length===1?`Privalo b\u016Bti ${C(o.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${w(o.values,"|")} pasirinkim\u0173`;case"too_big":{let r=On(o.origin),i=t(o.origin,Mm(Number(o.maximum)),o.inclusive??!1,"smaller");if(i?.verb)return`${An(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.maximum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${An(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.maximum.toString()} ${i?.unit}`}case"too_small":{let r=On(o.origin),i=t(o.origin,Mm(Number(o.minimum)),o.inclusive??!1,"bigger");if(i?.verb)return`${An(r??o.origin??"reik\u0161m\u0117")} ${i.verb} ${o.minimum.toString()} ${i.unit??"element\u0173"}`;let a=o.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${An(r??o.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${o.minimum.toString()} ${i?.unit}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${r.prefix}"`:r.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${r.suffix}"`:r.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${r.includes}"`:r.format==="regex"?`Eilut\u0117 privalo atitikti ${r.pattern}`:`Neteisingas ${n[r.format]??o.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${o.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${o.keys.length>1?"i":"as"} rakt${o.keys.length>1?"ai":"as"}: ${w(o.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let r=On(o.origin);return`${An(r??o.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Um(){return{localeError:cx()}}var dx=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${C(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Zm(){return{localeError:dx()}}var px=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${C(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Terlalu besar: dijangka ${r.origin??"nilai"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Terlalu kecil: dijangka ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}};function Lm(){return{localeError:px()}}var mx=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${C(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}};function Bm(){return{localeError:mx()}}var fx=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${C(r.values[0])}`:`Ugyldig valg: forventet en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}};function qm(){return{localeError:fx()}}var gx=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${C(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Vm(){return{localeError:gx()}}var hx=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${C(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${w(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${w(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Jm(){return{localeError:hx()}}var vx=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${C(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Gm(){return{localeError:vx()}}var yx=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${C(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${w(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}};function Wm(){return{localeError:yx()}}function Km(e,t,n,o){let r=Math.abs(e),i=r%10,a=r%100;return a>=11&&a<=19?o:i===1?t:i>=2&&i<=4?n:o}var bx=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${C(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);if(a){let u=Number(r.maximum),c=Km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);if(a){let u=Number(r.minimum),c=Km(u,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Hm(){return{localeError:bx()}}var _x=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${C(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${w(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}};function Ym(){return{localeError:_x()}}var xx=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${C(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${w(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Xm(){return{localeError:xx()}}var Dx=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${C(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Qm(){return{localeError:Dx()}}var wx=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${C(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=t(r.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${w(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function ef(){return{localeError:wx()}}var kx=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},$x=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${kx(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${C(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${w(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${w(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function tf(){return{localeError:$x()}}var Sx=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${C(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${w(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function bi(){return{localeError:Sx()}}function rf(){return bi()}var Ix=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${C(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${w(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${w(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function nf(){return{localeError:Ix()}}var Ex=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${C(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${r.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${a.verb} ${i}${r.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${w(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function of(){return{localeError:Ex()}}var Tx=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${C(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${w(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function af(){return{localeError:Tx()}}var Cx=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${C(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${w(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function sf(){return{localeError:Cx()}}var Ax=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(r))return"akop\u1ECD";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return r=>{switch(r.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${C(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${w(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",a=t(r.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${a.verb} ${i}${r.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",a=t(r.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${a.verb} ${i}${r.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${o[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${w(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function uf(){return{localeError:Ax()}}var al=Symbol("ZodOutput"),sl=Symbol("ZodInput"),Sr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function _i(){return new Sr}var ht=_i();function ul(e,t){return new e({type:"string",...A(t)})}function ll(e,t){return new e({type:"string",coerce:!0,...A(t)})}function xi(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function Pn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Di(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function wi(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function ki(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function $i(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function Nn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function Si(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function Ii(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function Ei(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function Ti(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function Ci(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function Ai(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function Oi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function ji(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function Pi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function Ni(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function zi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function Ri(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function Fi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function Mi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function Ui(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}var cl={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function dl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function pl(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function ml(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function fl(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function gl(e,t){return new e({type:"number",checks:[],...A(t)})}function hl(e,t){return new e({type:"number",coerce:!0,checks:[],...A(t)})}function vl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function yl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...A(t)})}function bl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...A(t)})}function _l(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...A(t)})}function xl(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...A(t)})}function Dl(e,t){return new e({type:"boolean",...A(t)})}function wl(e,t){return new e({type:"boolean",coerce:!0,...A(t)})}function kl(e,t){return new e({type:"bigint",...A(t)})}function $l(e,t){return new e({type:"bigint",coerce:!0,...A(t)})}function Sl(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(t)})}function Il(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(t)})}function El(e,t){return new e({type:"symbol",...A(t)})}function Tl(e,t){return new e({type:"undefined",...A(t)})}function Cl(e,t){return new e({type:"null",...A(t)})}function Al(e){return new e({type:"any"})}function Ol(e){return new e({type:"unknown"})}function jl(e,t){return new e({type:"never",...A(t)})}function Pl(e,t){return new e({type:"void",...A(t)})}function Nl(e,t){return new e({type:"date",...A(t)})}function zl(e,t){return new e({type:"date",coerce:!0,...A(t)})}function Rl(e,t){return new e({type:"nan",...A(t)})}function St(e,t){return new ai({check:"less_than",...A(t),value:e,inclusive:!1})}function Ye(e,t){return new ai({check:"less_than",...A(t),value:e,inclusive:!0})}function It(e,t){return new si({check:"greater_than",...A(t),value:e,inclusive:!1})}function Re(e,t){return new si({check:"greater_than",...A(t),value:e,inclusive:!0})}function Fl(e){return It(0,e)}function Ml(e){return St(0,e)}function Ul(e){return Ye(0,e)}function Zl(e){return Re(0,e)}function ar(e,t){return new js({check:"multiple_of",...A(t),value:e})}function Ir(e,t){return new zs({check:"max_size",...A(t),maximum:e})}function sr(e,t){return new Rs({check:"min_size",...A(t),minimum:e})}function zn(e,t){return new Fs({check:"size_equals",...A(t),size:e})}function Er(e,t){return new Ms({check:"max_length",...A(t),maximum:e})}function Kt(e,t){return new Us({check:"min_length",...A(t),minimum:e})}function Tr(e,t){return new Zs({check:"length_equals",...A(t),length:e})}function Rn(e,t){return new Ls({check:"string_format",format:"regex",...A(t),pattern:e})}function Fn(e){return new Bs({check:"string_format",format:"lowercase",...A(e)})}function Mn(e){return new qs({check:"string_format",format:"uppercase",...A(e)})}function Un(e,t){return new Vs({check:"string_format",format:"includes",...A(t),includes:e})}function Zn(e,t){return new Js({check:"string_format",format:"starts_with",...A(t),prefix:e})}function Ln(e,t){return new Gs({check:"string_format",format:"ends_with",...A(t),suffix:e})}function Ll(e,t,n){return new Ws({check:"property",property:e,schema:t,...A(n)})}function Bn(e,t){return new Ks({check:"mime_type",mime:e,...A(t)})}function Et(e){return new Hs({check:"overwrite",tx:e})}function qn(e){return Et(t=>t.normalize(e))}function Vn(){return Et(e=>e.trim())}function Jn(){return Et(e=>e.toLowerCase())}function Gn(){return Et(e=>e.toUpperCase())}function Bl(e,t,n){return new e({type:"array",element:t,...A(n)})}function Ox(e,t,n){return new e({type:"union",options:t,...A(n)})}function jx(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...A(o)})}function Px(e,t,n){return new e({type:"intersection",left:t,right:n})}function Nx(e,t,n,o){let r=n instanceof q,i=r?o:n,a=r?n:null;return new e({type:"tuple",items:t,rest:a,...A(i)})}function zx(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...A(o)})}function Rx(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...A(o)})}function Fx(e,t,n){return new e({type:"set",valueType:t,...A(n)})}function Mx(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...A(n)})}function Ux(e,t,n){return new e({type:"enum",entries:t,...A(n)})}function Zx(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...A(n)})}function ql(e,t){return new e({type:"file",...A(t)})}function Lx(e,t){return new e({type:"transform",transform:t})}function Bx(e,t){return new e({type:"optional",innerType:t})}function qx(e,t){return new e({type:"nullable",innerType:t})}function Vx(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():Ka(n)}})}function Jx(e,t,n){return new e({type:"nonoptional",innerType:t,...A(n)})}function Gx(e,t){return new e({type:"success",innerType:t})}function Wx(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function Kx(e,t,n){return new e({type:"pipe",in:t,out:n})}function Hx(e,t){return new e({type:"readonly",innerType:t})}function Yx(e,t,n){return new e({type:"template_literal",parts:t,...A(n)})}function Xx(e,t){return new e({type:"lazy",getter:t})}function Qx(e,t){return new e({type:"promise",innerType:t})}function Vl(e,t,n){let o=A(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Jl(e,t,n){return new e({type:"custom",check:"custom",fn:t,...A(n)})}function Gl(e){let t=lf(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(_r(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(_r(r))}},e(n.value,n)));return t}function lf(e,t){let n=new ie({check:"custom",...A(t)});return n._zod.check=e,n}function Wl(e,t){let n=A(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(o),a=new Set(r),u=e.Codec??Cn,c=e.Boolean??Tn,l=e.String??ir,d=new l({type:"string",error:n.error}),v=new c({type:"boolean",error:n.error}),y=new u({type:"pipe",in:d,out:v,transform:((p,m)=>{let f=p;return n.case!=="sensitive"&&(f=f.toLowerCase()),i.has(f)?!0:a.has(f)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:m.value,inst:y,continue:!1}),{})}),reverseTransform:((p,m)=>p===!0?o[0]||"true":r[0]||"false"),error:n.error});return y}function Cr(e,t,n,o={}){let r=A(o),i={...A(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:u=>n.test(u),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var Wn=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??ht,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(t);if(a)return a.count++,n.schemaPath.includes(t)&&(a.cycle=n.path),a.schema;let u={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,u);let c=t._zod.toJSONSchema?.();if(c)u.schema=c;else{let v={...n,schemaPath:[...n.schemaPath,t],path:n.path},y=t._zod.parent;if(y)u.ref=y,this.process(y,v),this.seen.get(y).isParent=!0;else{let p=u.schema;switch(r.type){case"string":{let m=p;m.type="string";let{minimum:f,maximum:g,format:b,patterns:D,contentEncoding:$}=t._zod.bag;if(typeof f=="number"&&(m.minLength=f),typeof g=="number"&&(m.maxLength=g),b&&(m.format=i[b]??b,m.format===""&&delete m.format),$&&(m.contentEncoding=$),D&&D.size>0){let _=[...D];_.length===1?m.pattern=_[0].source:_.length>1&&(u.schema.allOf=[..._.map(P=>({...this.target==="draft-7"||this.target==="draft-4"||this.target==="openapi-3.0"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{let m=p,{minimum:f,maximum:g,format:b,multipleOf:D,exclusiveMaximum:$,exclusiveMinimum:_}=t._zod.bag;typeof b=="string"&&b.includes("int")?m.type="integer":m.type="number",typeof _=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.minimum=_,m.exclusiveMinimum=!0):m.exclusiveMinimum=_),typeof f=="number"&&(m.minimum=f,typeof _=="number"&&this.target!=="draft-4"&&(_>=f?delete m.minimum:delete m.exclusiveMinimum)),typeof $=="number"&&(this.target==="draft-4"||this.target==="openapi-3.0"?(m.maximum=$,m.exclusiveMaximum=!0):m.exclusiveMaximum=$),typeof g=="number"&&(m.maximum=g,typeof $=="number"&&this.target!=="draft-4"&&($<=g?delete m.maximum:delete m.exclusiveMaximum)),typeof D=="number"&&(m.multipleOf=D);break}case"boolean":{let m=p;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{this.target==="openapi-3.0"?(p.type="string",p.nullable=!0,p.enum=[null]):p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=p,{minimum:f,maximum:g}=t._zod.bag;typeof f=="number"&&(m.minItems=f),typeof g=="number"&&(m.maxItems=g),m.type="array",m.items=this.process(r.element,{...v,path:[...v.path,"items"]});break}case"object":{let m=p;m.type="object",m.properties={};let f=r.shape;for(let D in f)m.properties[D]=this.process(f[D],{...v,path:[...v.path,"properties",D]});let g=new Set(Object.keys(f)),b=new Set([...g].filter(D=>{let $=r.shape[D]._zod;return this.io==="input"?$.optin===void 0:$.optout===void 0}));b.size>0&&(m.required=Array.from(b)),r.catchall?._zod.def.type==="never"?m.additionalProperties=!1:r.catchall?r.catchall&&(m.additionalProperties=this.process(r.catchall,{...v,path:[...v.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=p,f=r.options.map((g,b)=>this.process(g,{...v,path:[...v.path,"anyOf",b]}));m.anyOf=f;break}case"intersection":{let m=p,f=this.process(r.left,{...v,path:[...v.path,"allOf",0]}),g=this.process(r.right,{...v,path:[...v.path,"allOf",1]}),b=$=>"allOf"in $&&Object.keys($).length===1,D=[...b(f)?f.allOf:[f],...b(g)?g.allOf:[g]];m.allOf=D;break}case"tuple":{let m=p;m.type="array";let f=this.target==="draft-2020-12"?"prefixItems":"items",g=this.target==="draft-2020-12"||this.target==="openapi-3.0"?"items":"additionalItems",b=r.items.map((P,O)=>this.process(P,{...v,path:[...v.path,f,O]})),D=r.rest?this.process(r.rest,{...v,path:[...v.path,g,...this.target==="openapi-3.0"?[r.items.length]:[]]}):null;this.target==="draft-2020-12"?(m.prefixItems=b,D&&(m.items=D)):this.target==="openapi-3.0"?(m.items={anyOf:b},D&&m.items.anyOf.push(D),m.minItems=b.length,D||(m.maxItems=b.length)):(m.items=b,D&&(m.additionalItems=D));let{minimum:$,maximum:_}=t._zod.bag;typeof $=="number"&&(m.minItems=$),typeof _=="number"&&(m.maxItems=_);break}case"record":{let m=p;m.type="object",(this.target==="draft-7"||this.target==="draft-2020-12")&&(m.propertyNames=this.process(r.keyType,{...v,path:[...v.path,"propertyNames"]})),m.additionalProperties=this.process(r.valueType,{...v,path:[...v.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=p,f=yn(r.entries);f.every(g=>typeof g=="number")&&(m.type="number"),f.every(g=>typeof g=="string")&&(m.type="string"),m.enum=f;break}case"literal":{let m=p,f=[];for(let g of r.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(g))}else f.push(g);if(f.length!==0)if(f.length===1){let g=f[0];m.type=g===null?"null":typeof g,this.target==="draft-4"||this.target==="openapi-3.0"?m.enum=[g]:m.const=g}else f.every(g=>typeof g=="number")&&(m.type="number"),f.every(g=>typeof g=="string")&&(m.type="string"),f.every(g=>typeof g=="boolean")&&(m.type="string"),f.every(g=>g===null)&&(m.type="null"),m.enum=f;break}case"file":{let m=p,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:b,mime:D}=t._zod.bag;g!==void 0&&(f.minLength=g),b!==void 0&&(f.maxLength=b),D?D.length===1?(f.contentMediaType=D[0],Object.assign(m,f)):m.anyOf=D.map($=>({...f,contentMediaType:$})):Object.assign(m,f);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(r.innerType,v);this.target==="openapi-3.0"?(u.ref=r.innerType,p.nullable=!0):p.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,v),u.ref=r.innerType;break}case"success":{let m=p;m.type="boolean";break}case"default":{this.process(r.innerType,v),u.ref=r.innerType,p.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,v),u.ref=r.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,v),u.ref=r.innerType;let m;try{m=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=p,f=t._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=f.source;break}case"pipe":{let m=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(m,v),u.ref=m;break}case"readonly":{this.process(r.innerType,v),u.ref=r.innerType,p.readOnly=!0;break}case"promise":{this.process(r.innerType,v),u.ref=r.innerType;break}case"optional":{this.process(r.innerType,v),u.ref=r.innerType;break}case"lazy":{let m=t._zod.innerType;this.process(m,v),u.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}case"function":{if(this.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(t);return l&&Object.assign(u.schema,l),this.io==="input"&&ve(t)&&(delete u.schema.examples,delete u.schema.default),this.io==="input"&&u.schema._prefault&&((o=u.schema).default??(o.default=u.schema._prefault)),delete u.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=d=>{let v=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let f=o.external.registry.get(d[0])?.id,g=o.external.uri??(D=>D);if(f)return{ref:g(f)};let b=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=b,{defId:b,ref:`${g("__shared")}#/${v}/${b}`}}if(d[1]===r)return{ref:"#"};let p=`#/${v}/`,m=d[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:p+m}},a=d=>{if(d[1].schema.$ref)return;let v=d[1],{ref:y,defId:p}=i(d);v.def={...v.schema},p&&(v.defId=p);let m=v.schema;for(let f in m)delete m[f];m.$ref=y};if(o.cycles==="throw")for(let d of this.seen.entries()){let v=d[1];if(v.cycle)throw new Error(`Cycle detected: #/${v.cycle?.join("/")}/<root>
35
+
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let v=d[1];if(t===d[0]){a(d);continue}if(o.external){let p=o.external.registry.get(d[0])?.id;if(t!==d[0]&&p){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(v.cycle){a(d);continue}if(v.count>1&&o.reused==="ref"){a(d);continue}}let u=(d,v)=>{let y=this.seen.get(d),p=y.def??y.schema,m={...p};if(y.ref===null)return;let f=y.ref;if(y.ref=null,f){u(f,v);let g=this.seen.get(f).schema;g.$ref&&(v.target==="draft-7"||v.target==="draft-4"||v.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(g)):(Object.assign(p,g),Object.assign(p,m))}y.isParent||this.override({zodSchema:d,jsonSchema:p,path:y.path??[]})};for(let d of[...this.seen.entries()].reverse())u(d[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?c.$schema="http://json-schema.org/draft-04/schema#":this.target==="openapi-3.0"||console.warn(`Invalid target: ${this.target}`),o.external?.uri){let d=o.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");c.$id=o.external.uri(d)}Object.assign(c,r.def);let l=o.external?.defs??{};for(let d of this.seen.entries()){let v=d[1];v.def&&v.defId&&(l[v.defId]=v.def)}o.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?c.$defs=l:c.definitions=l);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}};function Kn(e,t){if(e instanceof Sr){let o=new Wn(t),r={};for(let u of e._idmap.entries()){let[c,l]=u;o.process(l)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let u of e._idmap.entries()){let[c,l]=u;i[c]=o.emit(l,{...t,external:a})}if(Object.keys(r).length>0){let u=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[u]:r}}return{schemas:i}}let n=new Wn(t);return n.process(e),n.emit(e,t)}function ve(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return ve(r.element,n);case"object":{for(let i in r.shape)if(ve(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(ve(i,n))return!0;return!1}case"intersection":return ve(r.left,n)||ve(r.right,n);case"tuple":{for(let i of r.items)if(ve(i,n))return!0;return!!(r.rest&&ve(r.rest,n))}case"record":return ve(r.keyType,n)||ve(r.valueType,n);case"map":return ve(r.keyType,n)||ve(r.valueType,n);case"set":return ve(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return ve(r.innerType,n);case"lazy":return ve(r.getter(),n);case"default":return ve(r.innerType,n);case"prefault":return ve(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return ve(r.in,n)||ve(r.out,n);case"success":return!1;case"catch":return!1;case"function":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var cf={};var Vi={};Zt(Vi,{ZodISODate:()=>Li,ZodISODateTime:()=>Zi,ZodISODuration:()=>qi,ZodISOTime:()=>Bi,date:()=>Hl,datetime:()=>Kl,duration:()=>Xl,time:()=>Yl});var Zi=x("ZodISODateTime",(e,t)=>{cu.init(e,t),oe.init(e,t)});function Kl(e){return dl(Zi,e)}var Li=x("ZodISODate",(e,t)=>{du.init(e,t),oe.init(e,t)});function Hl(e){return pl(Li,e)}var Bi=x("ZodISOTime",(e,t)=>{pu.init(e,t),oe.init(e,t)});function Yl(e){return ml(Bi,e)}var qi=x("ZodISODuration",(e,t)=>{mu.init(e,t),oe.init(e,t)});function Xl(e){return fl(qi,e)}var pf=(e,t)=>{wn.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>$n(e,n)},flatten:{value:n=>kn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,yr,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,yr,2)}},isEmpty:{get(){return e.issues.length===0}}})},tD=x("ZodError",pf),Fe=x("ZodError",pf,{Parent:Error});var Ql=xr(Fe),ec=Dr(Fe),tc=wr(Fe),Hn=kr(Fe),rc=Yo(Fe),nc=Xo(Fe),oc=Qo(Fe),ic=ei(Fe),ac=ti(Fe),sc=ri(Fe),uc=ni(Fe),lc=oi(Fe);var J=x("ZodType",(e,t)=>(q.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Ce(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Ql(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>tc(e,n,o),e.parseAsync=async(n,o)=>ec(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Hn(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>rc(e,n,o),e.decode=(n,o)=>nc(e,n,o),e.encodeAsync=async(n,o)=>oc(e,n,o),e.decodeAsync=async(n,o)=>ic(e,n,o),e.safeEncode=(n,o)=>ac(e,n,o),e.safeDecode=(n,o)=>sc(e,n,o),e.safeEncodeAsync=async(n,o)=>uc(e,n,o),e.safeDecodeAsync=async(n,o)=>lc(e,n,o),e.refine=(n,o)=>e.check(Xf(n,o)),e.superRefine=n=>e.check(Qf(n)),e.overwrite=n=>e.check(Et(n)),e.optional=()=>Gi(e),e.nullable=()=>Wi(e),e.nullish=()=>Gi(Wi(e)),e.nonoptional=n=>Uf(e,n),e.array=()=>Xi(e),e.or=n=>Oc([e,n]),e.and=n=>Sf(e,n),e.transform=n=>Ki(e,Nc(n)),e.default=n=>Rf(e,n),e.prefault=n=>Mf(e,n),e.catch=n=>Bf(e,n),e.pipe=n=>Ki(e,n),e.readonly=()=>Jf(e),e.describe=n=>{let o=e.clone();return ht.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return ht.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ht.get(e);let o=e.clone();return ht.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),pc=x("_ZodString",(e,t)=>{ir.init(e,t),J.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Rn(...o)),e.includes=(...o)=>e.check(Un(...o)),e.startsWith=(...o)=>e.check(Zn(...o)),e.endsWith=(...o)=>e.check(Ln(...o)),e.min=(...o)=>e.check(Kt(...o)),e.max=(...o)=>e.check(Er(...o)),e.length=(...o)=>e.check(Tr(...o)),e.nonempty=(...o)=>e.check(Kt(1,...o)),e.lowercase=o=>e.check(Fn(o)),e.uppercase=o=>e.check(Mn(o)),e.trim=()=>e.check(Vn()),e.normalize=(...o)=>e.check(qn(...o)),e.toLowerCase=()=>e.check(Jn()),e.toUpperCase=()=>e.check(Gn())}),Xn=x("ZodString",(e,t)=>{ir.init(e,t),pc.init(e,t),e.email=n=>e.check(xi(mc,n)),e.url=n=>e.check(Nn(Hi,n)),e.jwt=n=>e.check(Ui(Ec,n)),e.emoji=n=>e.check(Si(fc,n)),e.guid=n=>e.check(Pn(Ji,n)),e.uuid=n=>e.check(Di(Ct,n)),e.uuidv4=n=>e.check(wi(Ct,n)),e.uuidv6=n=>e.check(ki(Ct,n)),e.uuidv7=n=>e.check($i(Ct,n)),e.nanoid=n=>e.check(Ii(gc,n)),e.guid=n=>e.check(Pn(Ji,n)),e.cuid=n=>e.check(Ei(hc,n)),e.cuid2=n=>e.check(Ti(vc,n)),e.ulid=n=>e.check(Ci(yc,n)),e.base64=n=>e.check(Ri($c,n)),e.base64url=n=>e.check(Fi(Sc,n)),e.xid=n=>e.check(Ai(bc,n)),e.ksuid=n=>e.check(Oi(_c,n)),e.ipv4=n=>e.check(ji(xc,n)),e.ipv6=n=>e.check(Pi(Dc,n)),e.cidrv4=n=>e.check(Ni(wc,n)),e.cidrv6=n=>e.check(zi(kc,n)),e.e164=n=>e.check(Mi(Ic,n)),e.datetime=n=>e.check(Kl(n)),e.date=n=>e.check(Hl(n)),e.time=n=>e.check(Yl(n)),e.duration=n=>e.check(Xl(n))});function cc(e){return ul(Xn,e)}var oe=x("ZodStringFormat",(e,t)=>{ne.init(e,t),pc.init(e,t)}),mc=x("ZodEmail",(e,t)=>{tu.init(e,t),oe.init(e,t)});function nD(e){return xi(mc,e)}var Ji=x("ZodGUID",(e,t)=>{Qs.init(e,t),oe.init(e,t)});function oD(e){return Pn(Ji,e)}var Ct=x("ZodUUID",(e,t)=>{eu.init(e,t),oe.init(e,t)});function iD(e){return Di(Ct,e)}function aD(e){return wi(Ct,e)}function sD(e){return ki(Ct,e)}function uD(e){return $i(Ct,e)}var Hi=x("ZodURL",(e,t)=>{ru.init(e,t),oe.init(e,t)});function lD(e){return Nn(Hi,e)}function cD(e){return Nn(Hi,{protocol:/^https?$/,hostname:He.domain,...E.normalizeParams(e)})}var fc=x("ZodEmoji",(e,t)=>{nu.init(e,t),oe.init(e,t)});function dD(e){return Si(fc,e)}var gc=x("ZodNanoID",(e,t)=>{ou.init(e,t),oe.init(e,t)});function pD(e){return Ii(gc,e)}var hc=x("ZodCUID",(e,t)=>{iu.init(e,t),oe.init(e,t)});function mD(e){return Ei(hc,e)}var vc=x("ZodCUID2",(e,t)=>{au.init(e,t),oe.init(e,t)});function fD(e){return Ti(vc,e)}var yc=x("ZodULID",(e,t)=>{su.init(e,t),oe.init(e,t)});function gD(e){return Ci(yc,e)}var bc=x("ZodXID",(e,t)=>{uu.init(e,t),oe.init(e,t)});function hD(e){return Ai(bc,e)}var _c=x("ZodKSUID",(e,t)=>{lu.init(e,t),oe.init(e,t)});function vD(e){return Oi(_c,e)}var xc=x("ZodIPv4",(e,t)=>{fu.init(e,t),oe.init(e,t)});function yD(e){return ji(xc,e)}var Dc=x("ZodIPv6",(e,t)=>{gu.init(e,t),oe.init(e,t)});function bD(e){return Pi(Dc,e)}var wc=x("ZodCIDRv4",(e,t)=>{hu.init(e,t),oe.init(e,t)});function _D(e){return Ni(wc,e)}var kc=x("ZodCIDRv6",(e,t)=>{vu.init(e,t),oe.init(e,t)});function xD(e){return zi(kc,e)}var $c=x("ZodBase64",(e,t)=>{bu.init(e,t),oe.init(e,t)});function DD(e){return Ri($c,e)}var Sc=x("ZodBase64URL",(e,t)=>{_u.init(e,t),oe.init(e,t)});function wD(e){return Fi(Sc,e)}var Ic=x("ZodE164",(e,t)=>{xu.init(e,t),oe.init(e,t)});function kD(e){return Mi(Ic,e)}var Ec=x("ZodJWT",(e,t)=>{Du.init(e,t),oe.init(e,t)});function $D(e){return Ui(Ec,e)}var Qn=x("ZodCustomStringFormat",(e,t)=>{wu.init(e,t),oe.init(e,t)});function SD(e,t,n={}){return Cr(Qn,e,t,n)}function ID(e){return Cr(Qn,"hostname",He.hostname,e)}function ED(e){return Cr(Qn,"hex",He.hex,e)}function TD(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=He[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return Cr(Qn,o,r,t)}var eo=x("ZodNumber",(e,t)=>{mi.init(e,t),J.init(e,t),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Ye(o,r)),e.max=(o,r)=>e.check(Ye(o,r)),e.int=o=>e.check(dc(o)),e.safe=o=>e.check(dc(o)),e.positive=o=>e.check(It(0,o)),e.nonnegative=o=>e.check(Re(0,o)),e.negative=o=>e.check(St(0,o)),e.nonpositive=o=>e.check(Ye(0,o)),e.multipleOf=(o,r)=>e.check(ar(o,r)),e.step=(o,r)=>e.check(ar(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function mf(e){return gl(eo,e)}var Or=x("ZodNumberFormat",(e,t)=>{ku.init(e,t),eo.init(e,t)});function dc(e){return vl(Or,e)}function CD(e){return yl(Or,e)}function AD(e){return bl(Or,e)}function OD(e){return _l(Or,e)}function jD(e){return xl(Or,e)}var to=x("ZodBoolean",(e,t)=>{Tn.init(e,t),J.init(e,t)});function ff(e){return Dl(to,e)}var ro=x("ZodBigInt",(e,t)=>{fi.init(e,t),J.init(e,t),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.gt=(o,r)=>e.check(It(o,r)),e.gte=(o,r)=>e.check(Re(o,r)),e.min=(o,r)=>e.check(Re(o,r)),e.lt=(o,r)=>e.check(St(o,r)),e.lte=(o,r)=>e.check(Ye(o,r)),e.max=(o,r)=>e.check(Ye(o,r)),e.positive=o=>e.check(It(BigInt(0),o)),e.negative=o=>e.check(St(BigInt(0),o)),e.nonpositive=o=>e.check(Ye(BigInt(0),o)),e.nonnegative=o=>e.check(Re(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(ar(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function PD(e){return kl(ro,e)}var Tc=x("ZodBigIntFormat",(e,t)=>{$u.init(e,t),ro.init(e,t)});function ND(e){return Sl(Tc,e)}function zD(e){return Il(Tc,e)}var gf=x("ZodSymbol",(e,t)=>{Su.init(e,t),J.init(e,t)});function RD(e){return El(gf,e)}var hf=x("ZodUndefined",(e,t)=>{Iu.init(e,t),J.init(e,t)});function FD(e){return Tl(hf,e)}var vf=x("ZodNull",(e,t)=>{Eu.init(e,t),J.init(e,t)});function yf(e){return Cl(vf,e)}var bf=x("ZodAny",(e,t)=>{Tu.init(e,t),J.init(e,t)});function MD(){return Al(bf)}var _f=x("ZodUnknown",(e,t)=>{Cu.init(e,t),J.init(e,t)});function Ar(){return Ol(_f)}var xf=x("ZodNever",(e,t)=>{Au.init(e,t),J.init(e,t)});function Cc(e){return jl(xf,e)}var Df=x("ZodVoid",(e,t)=>{Ou.init(e,t),J.init(e,t)});function UD(e){return Pl(Df,e)}var Yi=x("ZodDate",(e,t)=>{ju.init(e,t),J.init(e,t),e.min=(o,r)=>e.check(Re(o,r)),e.max=(o,r)=>e.check(Ye(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function ZD(e){return Nl(Yi,e)}var wf=x("ZodArray",(e,t)=>{Pu.init(e,t),J.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(Kt(n,o)),e.nonempty=n=>e.check(Kt(1,n)),e.max=(n,o)=>e.check(Er(n,o)),e.length=(n,o)=>e.check(Tr(n,o)),e.unwrap=()=>e.element});function Xi(e,t){return Bl(wf,e,t)}function LD(e){let t=e._zod.def.shape;return Pc(Object.keys(t))}var Qi=x("ZodObject",(e,t)=>{Nu.init(e,t),J.init(e,t),E.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Pc(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ar()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ar()}),e.strict=()=>e.clone({...e._zod.def,catchall:Cc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>E.extend(e,n),e.safeExtend=n=>E.safeExtend(e,n),e.merge=n=>E.merge(e,n),e.pick=n=>E.pick(e,n),e.omit=n=>E.omit(e,n),e.partial=(...n)=>E.partial(zc,e,n[0]),e.required=(...n)=>E.required(Rc,e,n[0])});function BD(e,t){let n={type:"object",get shape(){return E.assignProp(this,"shape",e?E.objectClone(e):{}),this.shape},...E.normalizeParams(t)};return new Qi(n)}function qD(e,t){return new Qi({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:Cc(),...E.normalizeParams(t)})}function VD(e,t){return new Qi({type:"object",get shape(){return E.assignProp(this,"shape",E.objectClone(e)),this.shape},catchall:Ar(),...E.normalizeParams(t)})}var Ac=x("ZodUnion",(e,t)=>{gi.init(e,t),J.init(e,t),e.options=t.options});function Oc(e,t){return new Ac({type:"union",options:e,...E.normalizeParams(t)})}var kf=x("ZodDiscriminatedUnion",(e,t)=>{Ac.init(e,t),zu.init(e,t)});function JD(e,t,n){return new kf({type:"union",options:t,discriminator:e,...E.normalizeParams(n)})}var $f=x("ZodIntersection",(e,t)=>{Ru.init(e,t),J.init(e,t)});function Sf(e,t){return new $f({type:"intersection",left:e,right:t})}var If=x("ZodTuple",(e,t)=>{hi.init(e,t),J.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Ef(e,t,n){let o=t instanceof q,r=o?n:t,i=o?t:null;return new If({type:"tuple",items:e,rest:i,...E.normalizeParams(r)})}var jc=x("ZodRecord",(e,t)=>{Fu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Tf(e,t,n){return new jc({type:"record",keyType:e,valueType:t,...E.normalizeParams(n)})}function GD(e,t,n){let o=Ce(e);return o._zod.values=void 0,new jc({type:"record",keyType:o,valueType:t,...E.normalizeParams(n)})}var Cf=x("ZodMap",(e,t)=>{Mu.init(e,t),J.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function WD(e,t,n){return new Cf({type:"map",keyType:e,valueType:t,...E.normalizeParams(n)})}var Af=x("ZodSet",(e,t)=>{Uu.init(e,t),J.init(e,t),e.min=(...n)=>e.check(sr(...n)),e.nonempty=n=>e.check(sr(1,n)),e.max=(...n)=>e.check(Ir(...n)),e.size=(...n)=>e.check(zn(...n))});function KD(e,t){return new Af({type:"set",valueType:e,...E.normalizeParams(t)})}var Yn=x("ZodEnum",(e,t)=>{Zu.init(e,t),J.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let a of o)if(n.has(a))i[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Yn({...t,checks:[],...E.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let a of o)if(n.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Yn({...t,checks:[],...E.normalizeParams(r),entries:i})}});function Pc(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Yn({type:"enum",entries:n,...E.normalizeParams(t)})}function HD(e,t){return new Yn({type:"enum",entries:e,...E.normalizeParams(t)})}var Of=x("ZodLiteral",(e,t)=>{Lu.init(e,t),J.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function YD(e,t){return new Of({type:"literal",values:Array.isArray(e)?e:[e],...E.normalizeParams(t)})}var jf=x("ZodFile",(e,t)=>{Bu.init(e,t),J.init(e,t),e.min=(n,o)=>e.check(sr(n,o)),e.max=(n,o)=>e.check(Ir(n,o)),e.mime=(n,o)=>e.check(Bn(Array.isArray(n)?n:[n],o))});function XD(e){return ql(jf,e)}var Pf=x("ZodTransform",(e,t)=>{qu.init(e,t),J.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new Bt(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(E.issue(i,n.value,t));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),n.issues.push(E.issue(a))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});function Nc(e){return new Pf({type:"transform",transform:e})}var zc=x("ZodOptional",(e,t)=>{Vu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Gi(e){return new zc({type:"optional",innerType:e})}var Nf=x("ZodNullable",(e,t)=>{Ju.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Wi(e){return new Nf({type:"nullable",innerType:e})}function QD(e){return Gi(Wi(e))}var zf=x("ZodDefault",(e,t)=>{Gu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rf(e,t){return new zf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var Ff=x("ZodPrefault",(e,t)=>{Wu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Mf(e,t){return new Ff({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():E.shallowClone(t)}})}var Rc=x("ZodNonOptional",(e,t)=>{Ku.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Uf(e,t){return new Rc({type:"nonoptional",innerType:e,...E.normalizeParams(t)})}var Zf=x("ZodSuccess",(e,t)=>{Hu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ew(e){return new Zf({type:"success",innerType:e})}var Lf=x("ZodCatch",(e,t)=>{Yu.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bf(e,t){return new Lf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var qf=x("ZodNaN",(e,t)=>{Xu.init(e,t),J.init(e,t)});function tw(e){return Rl(qf,e)}var Fc=x("ZodPipe",(e,t)=>{Qu.init(e,t),J.init(e,t),e.in=t.in,e.out=t.out});function Ki(e,t){return new Fc({type:"pipe",in:e,out:t})}var Mc=x("ZodCodec",(e,t)=>{Fc.init(e,t),Cn.init(e,t)});function rw(e,t,n){return new Mc({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}var Vf=x("ZodReadonly",(e,t)=>{el.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Jf(e){return new Vf({type:"readonly",innerType:e})}var Gf=x("ZodTemplateLiteral",(e,t)=>{tl.init(e,t),J.init(e,t)});function nw(e,t){return new Gf({type:"template_literal",parts:e,...E.normalizeParams(t)})}var Wf=x("ZodLazy",(e,t)=>{ol.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Kf(e){return new Wf({type:"lazy",getter:e})}var Hf=x("ZodPromise",(e,t)=>{nl.init(e,t),J.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ow(e){return new Hf({type:"promise",innerType:e})}var Yf=x("ZodFunction",(e,t)=>{rl.init(e,t),J.init(e,t)});function iw(e){return new Yf({type:"function",input:Array.isArray(e?.input)?Ef(e?.input):e?.input??Xi(Ar()),output:e?.output??Ar()})}var ea=x("ZodCustom",(e,t)=>{il.init(e,t),J.init(e,t)});function aw(e){let t=new ie({check:"custom"});return t._zod.check=e,t}function sw(e,t){return Vl(ea,e??(()=>!0),t)}function Xf(e,t={}){return Jl(ea,e,t)}function Qf(e){return Gl(e)}function uw(e,t={error:`Input not instance of ${e.name}`}){let n=new ea({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...E.normalizeParams(t)});return n._zod.bag.Class=e,n}var lw=(...e)=>Wl({Codec:Mc,Boolean:to,String:Xn},...e);function cw(e){let t=Kf(()=>Oc([cc(e),mf(),ff(),yf(),Xi(t),Tf(cc(),t)]));return t}function dw(e,t){return Ki(Nc(e),t)}var pw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function mw(e){ce({customError:e})}function fw(){return ce().customError}var Uc;Uc||(Uc={});var Zc={};Zt(Zc,{bigint:()=>yw,boolean:()=>vw,date:()=>bw,number:()=>hw,string:()=>gw});function gw(e){return ll(Xn,e)}function hw(e){return hl(eo,e)}function vw(e){return wl(to,e)}function yw(e){return $l(ro,e)}function bw(e){return zl(Yi,e)}ce(vi());var eg=s;var Ht=eg;var H;(function(e){e.assertEqual=r=>{};function t(r){}e.assertIs=t;function n(r){throw new Error}e.assertNever=n,e.arrayToEnum=r=>{let i={};for(let a of r)i[a]=a;return i},e.getValidEnumValues=r=>{let i=e.objectKeys(r).filter(u=>typeof r[r[u]]!="number"),a={};for(let u of i)a[u]=r[u];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(i){return r[i]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let i=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.push(a);return i},e.find=(r,i)=>{for(let a of r)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function o(r,i=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=o,e.jsonStringifyReplacer=(r,i)=>typeof i=="bigint"?i.toString():i})(H||(H={}));var tg;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(tg||(tg={}));var N=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),At=e=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":return Array.isArray(e)?N.array:e===null?N.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?N.promise:typeof Map<"u"&&e instanceof Map?N.map:typeof Set<"u"&&e instanceof Set?N.set:typeof Date<"u"&&e instanceof Date?N.date:N.object;default:return N.unknown}};var I=H.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"]);var qe=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)o._errors.push(n(a));else{let u=o,c=0;for(;c<a.path.length;){let l=a.path[c];c===a.path.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(n(a))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}};return r(this),o}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},o=[];for(let r of this.issues)if(r.path.length>0){let i=r.path[0];n[i]=n[i]||[],n[i].push(t(r))}else o.push(t(r));return{formErrors:o,fieldErrors:n}}get formErrors(){return this.flatten()}};qe.create=e=>new qe(e);var xw=(e,t)=>{let n;switch(e.code){case I.invalid_type:e.received===N.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,H.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${H.joinValues(e.keys,", ")}`;break;case I.invalid_union:n="Invalid input";break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${H.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n="Invalid function arguments";break;case I.invalid_return_type:n="Invalid function return type";break;case I.invalid_date:n="Invalid date";break;case I.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:H.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case I.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case I.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case I.custom:n="Invalid input";break;case I.invalid_intersection_types:n="Intersection results could not be merged";break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n="Number must be finite";break;default:n=t.defaultError,H.assertNever(e)}return{message:n}},Yt=xw;var Dw=Yt;function no(){return Dw}var ta=e=>{let{data:t,path:n,errorMaps:o,issueData:r}=e,i=[...n,...r.path||[]],a={...r,path:i};if(r.message!==void 0)return{...r,path:i,message:r.message};let u="",c=o.filter(l=>!!l).slice().reverse();for(let l of c)u=l(a,{data:t,defaultError:u}).message;return{...r,path:i,message:u}};function j(e,t){let n=no(),o=ta({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Yt?void 0:Yt].filter(r=>!!r)});e.common.issues.push(o)}var $e=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let o=[];for(let r of n){if(r.status==="aborted")return B;r.status==="dirty"&&t.dirty(),o.push(r.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,n){let o=[];for(let r of n){let i=await r.key,a=await r.value;o.push({key:i,value:a})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,n){let o={};for(let r of n){let{key:i,value:a}=r;if(i.status==="aborted"||a.status==="aborted")return B;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(o[i.value]=a.value)}return{status:t.value,value:o}}},B=Object.freeze({status:"aborted"}),jr=e=>({status:"dirty",value:e}),Ae=e=>({status:"valid",value:e}),Lc=e=>e.status==="aborted",Bc=e=>e.status==="dirty",ur=e=>e.status==="valid",oo=e=>typeof Promise<"u"&&e instanceof Promise;var F;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(F||(F={}));var Xe=class{constructor(t,n,o,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=o,this._key=r}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}},rg=(e,t)=>{if(ur(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new qe(e.common.issues);return this._error=n,this._error}}};function V(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:o,description:r}=e;if(t&&(n||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:(a,u)=>{let{message:c}=e;return a.code==="invalid_enum_value"?{message:c??u.defaultError}:typeof u.data>"u"?{message:c??o??u.defaultError}:a.code!=="invalid_type"?{message:u.defaultError}:{message:c??n??u.defaultError}},description:r}}var G=class{get description(){return this._def.description}_getType(t){return At(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new $e,ctx:{common:t.parent.common,data:t.data,parsedType:At(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(oo(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let o=this.safeParse(t,n);if(o.success)return o.data;throw o.error}safeParse(t,n){let o={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parseSync({data:t,path:o.path,parent:o});return rg(o,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)};if(!this["~standard"].async)try{let o=this._parseSync({data:t,path:[],parent:n});return ur(o)?{value:o.value}:{issues:n.common.issues}}catch(o){o?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>ur(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){let o=await this.safeParseAsync(t,n);if(o.success)return o.data;throw o.error}async safeParseAsync(t,n){let o={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:At(t)},r=this._parse({data:t,path:o.path,parent:o}),i=await(oo(r)?r:Promise.resolve(r));return rg(o,i)}refine(t,n){let o=r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n;return this._refinement((r,i)=>{let a=t(r),u=()=>i.addIssue({code:I.custom,...o(r)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(u(),!1)):a?!0:(u(),!1)})}refinement(t,n){return this._refinement((o,r)=>t(o)?!0:(r.addIssue(typeof n=="function"?n(o,r):n),!1))}_refinement(t){return new it({schema:this,typeName:T.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ot.create(this,this._def)}nullable(){return Pt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qt.create(this)}promise(){return lr.create(this,this._def)}or(t){return Fr.create([this,t],this._def)}and(t){return Mr.create(this,t,this._def)}transform(t){return new it({...V(this._def),schema:this,typeName:T.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new qr({...V(this._def),innerType:this,defaultValue:n,typeName:T.ZodDefault})}brand(){return new ra({typeName:T.ZodBranded,type:this,...V(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Vr({...V(this._def),innerType:this,catchValue:n,typeName:T.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return na.create(this,t)}readonly(){return Jr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ww=/^c[^\s-]{8,}$/i,kw=/^[0-9a-z]+$/,$w=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Sw=/^[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,Iw=/^[a-z0-9_-]{21}$/i,Ew=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Tw=/^[-+]?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)?)??$/,Cw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Aw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qc,Ow=/^(?:(?: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])$/,jw=/^(?:(?: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])$/,Pw=/^(([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]))$/,Nw=/^(([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])$/,zw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Rw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ng="((\\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])))",Fw=new RegExp(`^${ng}$`);function og(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Mw(e){return new RegExp(`^${og(e)}$`)}function Uw(e){let t=`${ng}T${og(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Zw(e,t){return!!((t==="v4"||!t)&&Ow.test(e)||(t==="v6"||!t)&&Pw.test(e))}function Lw(e,t){if(!Ew.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let o=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(o));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}function Bw(e,t){return!!((t==="v4"||!t)&&jw.test(e)||(t==="v6"||!t)&&Nw.test(e))}var Nr=class e extends G{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==N.string){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:N.string,received:i.parsedType}),B}let o=new $e,r;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),o.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,u=t.data.length<i.value;(a||u)&&(r=this._getOrReturnCtx(t,r),a?j(r,{code:I.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):u&&j(r,{code:I.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),o.dirty())}else if(i.kind==="email")Cw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"email",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="emoji")qc||(qc=new RegExp(Aw,"u")),qc.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"emoji",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="uuid")Sw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"uuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="nanoid")Iw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"nanoid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid")ww.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="cuid2")kw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cuid2",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="ulid")$w.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ulid",code:I.invalid_string,message:i.message}),o.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),j(r,{validation:"url",code:I.invalid_string,message:i.message}),o.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"regex",code:I.invalid_string,message:i.message}),o.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),o.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{startsWith:i.value},message:i.message}),o.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:{endsWith:i.value},message:i.message}),o.dirty()):i.kind==="datetime"?Uw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"datetime",message:i.message}),o.dirty()):i.kind==="date"?Fw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"date",message:i.message}),o.dirty()):i.kind==="time"?Mw(i).test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{code:I.invalid_string,validation:"time",message:i.message}),o.dirty()):i.kind==="duration"?Tw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"duration",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="ip"?Zw(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"ip",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="jwt"?Lw(t.data,i.alg)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"jwt",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="cidr"?Bw(t.data,i.version)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"cidr",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64"?zw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64",code:I.invalid_string,message:i.message}),o.dirty()):i.kind==="base64url"?Rw.test(t.data)||(r=this._getOrReturnCtx(t,r),j(r,{validation:"base64url",code:I.invalid_string,message:i.message}),o.dirty()):H.assertNever(i);return{status:o.value,value:t.data}}_regex(t,n,o){return this.refinement(r=>t.test(r),{validation:n,code:I.invalid_string,...F.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...F.errToObj(t)})}url(t){return this._addCheck({kind:"url",...F.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...F.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...F.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...F.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...F.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...F.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...F.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...F.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...F.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...F.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...F.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...F.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...F.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...F.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...F.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...F.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...F.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...F.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...F.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...F.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...F.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...F.errToObj(n)})}nonempty(t){return this.min(1,F.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Nr.create=e=>new Nr({checks:[],typeName:T.ZodString,coerce:e?.coerce??!1,...V(e)});function qw(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return i%a/10**r}var io=class e extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==N.number){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:N.number,received:i.parsedType}),B}let o,r=new $e;for(let i of this._def.checks)i.kind==="int"?H.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?qw(t.data,i.value)!==0&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_finite,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:F.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:F.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&H.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(n===null||o.value>n)&&(n=o.value):o.kind==="max"&&(t===null||o.value<t)&&(t=o.value)}return Number.isFinite(n)&&Number.isFinite(t)}};io.create=e=>new io({checks:[],typeName:T.ZodNumber,coerce:e?.coerce||!1,...V(e)});var ao=class e extends G{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==N.bigint)return this._getInvalidInput(t);let o,r=new $e;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),j(o,{code:I.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:N.bigint,received:n.parsedType}),B}gte(t,n){return this.setLimit("min",t,!0,F.toString(n))}gt(t,n){return this.setLimit("min",t,!1,F.toString(n))}lte(t,n){return this.setLimit("max",t,!0,F.toString(n))}lt(t,n){return this.setLimit("max",t,!1,F.toString(n))}setLimit(t,n,o,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:o,message:F.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:F.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ao.create=e=>new ao({checks:[],typeName:T.ZodBigInt,coerce:e?.coerce??!1,...V(e)});var so=class extends G{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==N.boolean){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.boolean,received:o.parsedType}),B}return Ae(t.data)}};so.create=e=>new so({typeName:T.ZodBoolean,coerce:e?.coerce||!1,...V(e)});var uo=class e extends G{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==N.date){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_type,expected:N.date,received:i.parsedType}),B}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return j(i,{code:I.invalid_date}),B}let o=new $e,r;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),o.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),j(r,{code:I.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),o.dirty()):H.assertNever(i);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:F.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:F.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};uo.create=e=>new uo({checks:[],coerce:e?.coerce||!1,typeName:T.ZodDate,...V(e)});var lo=class extends G{_parse(t){if(this._getType(t)!==N.symbol){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.symbol,received:o.parsedType}),B}return Ae(t.data)}};lo.create=e=>new lo({typeName:T.ZodSymbol,...V(e)});var zr=class extends G{_parse(t){if(this._getType(t)!==N.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.undefined,received:o.parsedType}),B}return Ae(t.data)}};zr.create=e=>new zr({typeName:T.ZodUndefined,...V(e)});var Rr=class extends G{_parse(t){if(this._getType(t)!==N.null){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.null,received:o.parsedType}),B}return Ae(t.data)}};Rr.create=e=>new Rr({typeName:T.ZodNull,...V(e)});var co=class extends G{constructor(){super(...arguments),this._any=!0}_parse(t){return Ae(t.data)}};co.create=e=>new co({typeName:T.ZodAny,...V(e)});var Xt=class extends G{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ae(t.data)}};Xt.create=e=>new Xt({typeName:T.ZodUnknown,...V(e)});var vt=class extends G{_parse(t){let n=this._getOrReturnCtx(t);return j(n,{code:I.invalid_type,expected:N.never,received:n.parsedType}),B}};vt.create=e=>new vt({typeName:T.ZodNever,...V(e)});var po=class extends G{_parse(t){if(this._getType(t)!==N.undefined){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.void,received:o.parsedType}),B}return Ae(t.data)}};po.create=e=>new po({typeName:T.ZodVoid,...V(e)});var Qt=class e extends G{_parse(t){let{ctx:n,status:o}=this._processInputParams(t),r=this._def;if(n.parsedType!==N.array)return j(n,{code:I.invalid_type,expected:N.array,received:n.parsedType}),B;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,u=n.data.length<r.exactLength.value;(a||u)&&(j(n,{code:a?I.too_big:I.too_small,minimum:u?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),o.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(j(n,{code:I.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),o.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(j(n,{code:I.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((a,u)=>r.type._parseAsync(new Xe(n,a,n.path,u)))).then(a=>$e.mergeArray(o,a));let i=[...n.data].map((a,u)=>r.type._parseSync(new Xe(n,a,n.path,u)));return $e.mergeArray(o,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:F.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:F.toString(n)}})}nonempty(t){return this.min(1,t)}};Qt.create=(e,t)=>new Qt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:T.ZodArray,...V(t)});function Pr(e){if(e instanceof Ve){let t={};for(let n in e.shape){let o=e.shape[n];t[n]=ot.create(Pr(o))}return new Ve({...e._def,shape:()=>t})}else return e instanceof Qt?new Qt({...e._def,type:Pr(e.element)}):e instanceof ot?ot.create(Pr(e.unwrap())):e instanceof Pt?Pt.create(Pr(e.unwrap())):e instanceof jt?jt.create(e.items.map(t=>Pr(t))):e}var Ve=class e extends G{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=H.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==N.object){let l=this._getOrReturnCtx(t);return j(l,{code:I.invalid_type,expected:N.object,received:l.parsedType}),B}let{status:o,ctx:r}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),u=[];if(!(this._def.catchall instanceof vt&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||u.push(l);let c=[];for(let l of a){let d=i[l],v=r.data[l];c.push({key:{status:"valid",value:l},value:d._parse(new Xe(r,v,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof vt){let l=this._def.unknownKeys;if(l==="passthrough")for(let d of u)c.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(l==="strict")u.length>0&&(j(r,{code:I.unrecognized_keys,keys:u}),o.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let d of u){let v=r.data[d];c.push({key:{status:"valid",value:d},value:l._parse(new Xe(r,v,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let d of c){let v=await d.key,y=await d.value;l.push({key:v,value:y,alwaysSet:d.alwaysSet})}return l}).then(l=>$e.mergeObjectSync(o,l)):$e.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(t){return F.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,o)=>{let r=this._def.errorMap?.(n,o).message??o.defaultError;return n.code==="unrecognized_keys"?{message:F.errToObj(t).message??r}:{message:r}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:T.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let o of H.objectKeys(t))t[o]&&this.shape[o]&&(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let o of H.objectKeys(this.shape))t[o]||(n[o]=this.shape[o]);return new e({...this._def,shape:()=>n})}deepPartial(){return Pr(this)}partial(t){let n={};for(let o of H.objectKeys(this.shape)){let r=this.shape[o];t&&!t[o]?n[o]=r:n[o]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let o of H.objectKeys(this.shape))if(t&&!t[o])n[o]=this.shape[o];else{let i=this.shape[o];for(;i instanceof ot;)i=i._def.innerType;n[o]=i}return new e({...this._def,shape:()=>n})}keyof(){return ig(H.objectKeys(this.shape))}};Ve.create=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strip",catchall:vt.create(),typeName:T.ZodObject,...V(t)});Ve.strictCreate=(e,t)=>new Ve({shape:()=>e,unknownKeys:"strict",catchall:vt.create(),typeName:T.ZodObject,...V(t)});Ve.lazycreate=(e,t)=>new Ve({shape:e,unknownKeys:"strip",catchall:vt.create(),typeName:T.ZodObject,...V(t)});var Fr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=this._def.options;function r(i){for(let u of i)if(u.result.status==="valid")return u.result;for(let u of i)if(u.result.status==="dirty")return n.common.issues.push(...u.ctx.common.issues),u.result;let a=i.map(u=>new qe(u.ctx.common.issues));return j(n,{code:I.invalid_union,unionErrors:a}),B}if(n.common.async)return Promise.all(o.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let i,a=[];for(let c of o){let l={...n,common:{...n.common,issues:[]},parent:null},d=c._parseSync({data:n.data,path:n.path,parent:l});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let u=a.map(c=>new qe(c));return j(n,{code:I.invalid_union,unionErrors:u}),B}}get options(){return this._def.options}};Fr.create=(e,t)=>new Fr({options:e,typeName:T.ZodUnion,...V(t)});var Ot=e=>e instanceof Ur?Ot(e.schema):e instanceof it?Ot(e.innerType()):e instanceof Zr?[e.value]:e instanceof Lr?e.options:e instanceof Br?H.objectValues(e.enum):e instanceof qr?Ot(e._def.innerType):e instanceof zr?[void 0]:e instanceof Rr?[null]:e instanceof ot?[void 0,...Ot(e.unwrap())]:e instanceof Pt?[null,...Ot(e.unwrap())]:e instanceof ra||e instanceof Jr?Ot(e.unwrap()):e instanceof Vr?Ot(e._def.innerType):[],Vc=class e extends G{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.object)return j(n,{code:I.invalid_type,expected:N.object,received:n.parsedType}),B;let o=this.discriminator,r=n.data[o],i=this.optionsMap.get(r);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(j(n,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,o){let r=new Map;for(let i of n){let a=Ot(i.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of a){if(r.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);r.set(u,i)}}return new e({typeName:T.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...V(o)})}};function Jc(e,t){let n=At(e),o=At(t);if(e===t)return{valid:!0,data:e};if(n===N.object&&o===N.object){let r=H.objectKeys(t),i=H.objectKeys(e).filter(u=>r.indexOf(u)!==-1),a={...e,...t};for(let u of i){let c=Jc(e[u],t[u]);if(!c.valid)return{valid:!1};a[u]=c.data}return{valid:!0,data:a}}else if(n===N.array&&o===N.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let i=0;i<e.length;i++){let a=e[i],u=t[i],c=Jc(a,u);if(!c.valid)return{valid:!1};r.push(c.data)}return{valid:!0,data:r}}else return n===N.date&&o===N.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Mr=class extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=(i,a)=>{if(Lc(i)||Lc(a))return B;let u=Jc(i.value,a.value);return u.valid?((Bc(i)||Bc(a))&&n.dirty(),{status:n.value,value:u.data}):(j(o,{code:I.invalid_intersection_types}),B)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([i,a])=>r(i,a)):r(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};Mr.create=(e,t,n)=>new Mr({left:e,right:t,typeName:T.ZodIntersection,...V(n)});var jt=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.array)return j(o,{code:I.invalid_type,expected:N.array,received:o.parsedType}),B;if(o.data.length<this._def.items.length)return j(o,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),B;!this._def.rest&&o.data.length>this._def.items.length&&(j(o,{code:I.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...o.data].map((a,u)=>{let c=this._def.items[u]||this._def.rest;return c?c._parse(new Xe(o,a,o.path,u)):null}).filter(a=>!!a);return o.common.async?Promise.all(i).then(a=>$e.mergeArray(n,a)):$e.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};jt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new jt({items:e,typeName:T.ZodTuple,rest:null,...V(t)})};var Gc=class e extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.object)return j(o,{code:I.invalid_type,expected:N.object,received:o.parsedType}),B;let r=[],i=this._def.keyType,a=this._def.valueType;for(let u in o.data)r.push({key:i._parse(new Xe(o,u,o.path,u)),value:a._parse(new Xe(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?$e.mergeObjectAsync(n,r):$e.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,o){return n instanceof G?new e({keyType:t,valueType:n,typeName:T.ZodRecord,...V(o)}):new e({keyType:Nr.create(),valueType:t,typeName:T.ZodRecord,...V(n)})}},mo=class extends G{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.map)return j(o,{code:I.invalid_type,expected:N.map,received:o.parsedType}),B;let r=this._def.keyType,i=this._def.valueType,a=[...o.data.entries()].map(([u,c],l)=>({key:r._parse(new Xe(o,u,o.path,[l,"key"])),value:i._parse(new Xe(o,c,o.path,[l,"value"]))}));if(o.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,d=await c.value;if(l.status==="aborted"||d.status==="aborted")return B;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),u.set(l.value,d.value)}return{status:n.value,value:u}})}else{let u=new Map;for(let c of a){let l=c.key,d=c.value;if(l.status==="aborted"||d.status==="aborted")return B;(l.status==="dirty"||d.status==="dirty")&&n.dirty(),u.set(l.value,d.value)}return{status:n.value,value:u}}}};mo.create=(e,t,n)=>new mo({valueType:t,keyType:e,typeName:T.ZodMap,...V(n)});var fo=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==N.set)return j(o,{code:I.invalid_type,expected:N.set,received:o.parsedType}),B;let r=this._def;r.minSize!==null&&o.data.size<r.minSize.value&&(j(o,{code:I.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&o.data.size>r.maxSize.value&&(j(o,{code:I.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let i=this._def.valueType;function a(c){let l=new Set;for(let d of c){if(d.status==="aborted")return B;d.status==="dirty"&&n.dirty(),l.add(d.value)}return{status:n.value,value:l}}let u=[...o.data.values()].map((c,l)=>i._parse(new Xe(o,c,o.path,l)));return o.common.async?Promise.all(u).then(c=>a(c)):a(u)}min(t,n){return new e({...this._def,minSize:{value:t,message:F.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:F.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};fo.create=(e,t)=>new fo({valueType:e,minSize:null,maxSize:null,typeName:T.ZodSet,...V(t)});var Wc=class e extends G{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.function)return j(n,{code:I.invalid_type,expected:N.function,received:n.parsedType}),B;function o(u,c){return ta({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,no(),Yt].filter(l=>!!l),issueData:{code:I.invalid_arguments,argumentsError:c}})}function r(u,c){return ta({data:u,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,no(),Yt].filter(l=>!!l),issueData:{code:I.invalid_return_type,returnTypeError:c}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof lr){let u=this;return Ae(async function(...c){let l=new qe([]),d=await u._def.args.parseAsync(c,i).catch(p=>{throw l.addIssue(o(c,p)),l}),v=await Reflect.apply(a,this,d);return await u._def.returns._def.type.parseAsync(v,i).catch(p=>{throw l.addIssue(r(v,p)),l})})}else{let u=this;return Ae(function(...c){let l=u._def.args.safeParse(c,i);if(!l.success)throw new qe([o(c,l.error)]);let d=Reflect.apply(a,this,l.data),v=u._def.returns.safeParse(d,i);if(!v.success)throw new qe([r(d,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:jt.create(t).rest(Xt.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,o){return new e({args:t||jt.create([]).rest(Xt.create()),returns:n||Xt.create(),typeName:T.ZodFunction,...V(o)})}},Ur=class extends G{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Ur.create=(e,t)=>new Ur({getter:e,typeName:T.ZodLazy,...V(t)});var Zr=class extends G{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return j(n,{received:n.data,code:I.invalid_literal,expected:this._def.value}),B}return{status:"valid",value:t.data}}get value(){return this._def.value}};Zr.create=(e,t)=>new Zr({value:e,typeName:T.ZodLiteral,...V(t)});function ig(e,t){return new Lr({values:e,typeName:T.ZodEnum,...V(t)})}var Lr=class e extends G{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{expected:H.joinValues(o),received:n.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),o=this._def.values;return j(n,{received:n.data,code:I.invalid_enum_value,options:o}),B}return Ae(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...n})}};Lr.create=ig;var Br=class extends G{_parse(t){let n=H.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==N.string&&o.parsedType!==N.number){let r=H.objectValues(n);return j(o,{expected:H.joinValues(r),received:o.parsedType,code:I.invalid_type}),B}if(this._cache||(this._cache=new Set(H.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=H.objectValues(n);return j(o,{received:o.data,code:I.invalid_enum_value,options:r}),B}return Ae(t.data)}get enum(){return this._def.values}};Br.create=(e,t)=>new Br({values:e,typeName:T.ZodNativeEnum,...V(t)});var lr=class extends G{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==N.promise&&n.common.async===!1)return j(n,{code:I.invalid_type,expected:N.promise,received:n.parsedType}),B;let o=n.parsedType===N.promise?n.data:Promise.resolve(n.data);return Ae(o.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};lr.create=(e,t)=>new lr({type:e,typeName:T.ZodPromise,...V(t)});var it=class extends G{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===T.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:o}=this._processInputParams(t),r=this._def.effect||null,i={addIssue:a=>{j(o,a),a.fatal?n.abort():n.dirty()},get path(){return o.path}};if(i.addIssue=i.addIssue.bind(i),r.type==="preprocess"){let a=r.transform(o.data,i);if(o.common.async)return Promise.resolve(a).then(async u=>{if(n.value==="aborted")return B;let c=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return c.status==="aborted"?B:c.status==="dirty"?jr(c.value):n.value==="dirty"?jr(c.value):c});{if(n.value==="aborted")return B;let u=this._def.schema._parseSync({data:a,path:o.path,parent:o});return u.status==="aborted"?B:u.status==="dirty"?jr(u.value):n.value==="dirty"?jr(u.value):u}}if(r.type==="refinement"){let a=u=>{let c=r.refinement(u,i);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){let u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value),{status:n.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?B:(u.status==="dirty"&&n.dirty(),a(u.value).then(()=>({status:n.value,value:u.value}))))}if(r.type==="transform")if(o.common.async===!1){let a=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!ur(a))return B;let u=r.transform(a.value,i);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(a=>ur(a)?Promise.resolve(r.transform(a.value,i)).then(u=>({status:n.value,value:u})):B);H.assertNever(r)}};it.create=(e,t,n)=>new it({schema:e,typeName:T.ZodEffects,effect:t,...V(n)});it.createWithPreprocess=(e,t,n)=>new it({schema:t,effect:{type:"preprocess",transform:e},typeName:T.ZodEffects,...V(n)});var ot=class extends G{_parse(t){return this._getType(t)===N.undefined?Ae(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ot.create=(e,t)=>new ot({innerType:e,typeName:T.ZodOptional,...V(t)});var Pt=class extends G{_parse(t){return this._getType(t)===N.null?Ae(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pt.create=(e,t)=>new Pt({innerType:e,typeName:T.ZodNullable,...V(t)});var qr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return n.parsedType===N.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};qr.create=(e,t)=>new qr({innerType:e,typeName:T.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});var Vr=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return oo(r)?r.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new qe(o.common.issues)},input:o.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new qe(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Vr.create=(e,t)=>new Vr({innerType:e,typeName:T.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});var go=class extends G{_parse(t){if(this._getType(t)!==N.nan){let o=this._getOrReturnCtx(t);return j(o,{code:I.invalid_type,expected:N.nan,received:o.parsedType}),B}return{status:"valid",value:t.data}}};go.create=e=>new go({typeName:T.ZodNaN,...V(e)});var _O=Symbol("zod_brand"),ra=class extends G{_parse(t){let{ctx:n}=this._processInputParams(t),o=n.data;return this._def.type._parse({data:o,path:n.path,parent:n})}unwrap(){return this._def.type}},na=class e extends G{_parse(t){let{status:n,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return i.status==="aborted"?B:i.status==="dirty"?(n.dirty(),jr(i.value)):this._def.out._parseAsync({data:i.value,path:o.path,parent:o})})();{let r=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return r.status==="aborted"?B:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:o.path,parent:o})}}static create(t,n){return new e({in:t,out:n,typeName:T.ZodPipeline})}},Jr=class extends G{_parse(t){let n=this._def.innerType._parse(t),o=r=>(ur(r)&&(r.value=Object.freeze(r.value)),r);return oo(n)?n.then(r=>o(r)):o(n)}unwrap(){return this._def.innerType}};Jr.create=(e,t)=>new Jr({innerType:e,typeName:T.ZodReadonly,...V(t)});var xO={object:Ve.lazycreate},T;(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"})(T||(T={}));var DO=Nr.create,wO=io.create,kO=go.create,$O=ao.create,SO=so.create,IO=uo.create,EO=lo.create,TO=zr.create,CO=Rr.create,AO=co.create,OO=Xt.create,jO=vt.create,PO=po.create,NO=Qt.create,zO=Ve.create,RO=Ve.strictCreate,FO=Fr.create,MO=Vc.create,UO=Mr.create,ZO=jt.create,LO=Gc.create,BO=mo.create,qO=fo.create,VO=Wc.create,JO=Ur.create,GO=Zr.create,WO=Lr.create,KO=Br.create,HO=lr.create,YO=it.create,XO=ot.create,QO=Pt.create,ej=it.createWithPreprocess,tj=na.create;function we(...e){return e.reduce((t,n)=>({...t,...n??{}}),{})}async function lg(e,t){if(e==null)return Promise.resolve();let n=t?.abortSignal;return new Promise((o,r)=>{if(n?.aborted){r(ag());return}let i=setTimeout(()=>{a(),o()},e),a=()=>{clearTimeout(i),n?.removeEventListener("abort",u)},u=()=>{a(),r(ag())};n?.addEventListener("abort",u)})}function ag(){return new DOMException("Delay was aborted","AbortError")}function ho(e){return Object.fromEntries([...e.headers])}function cg(e=globalThis){var t,n,o;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(o=(n=e.process)==null?void 0:n.versions)!=null&&o.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Jw(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!=null))}function Gr(e,...t){let n=Jw(e??{}),o=new Headers(n),r=o.get("user-agent")||"";return o.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(o)}var zt=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:o="-"}={})=>{let r=()=>{let i=n.length,a=new Array(t);for(let u=0;u<t;u++)a[u]=n[Math.random()*i|0];return a.join("")};if(e==null)return r;if(n.includes(o))throw new Bo({argument:"separator",message:`The separator "${o}" must not be part of the alphabet "${n}".`});return()=>`${e}${o}${r()}`},ut=zt();function vo(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}function Nt(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var Gw=["fetch failed","failed to fetch"];function dg({error:e,url:t,requestBodyValues:n}){if(Nt(e))return e;if(e instanceof TypeError&&Gw.includes(e.message.toLowerCase())){let o=e.cause;if(o!=null)return new le({message:`Cannot connect to API: ${o.message}`,cause:o,url:t,requestBodyValues:n,isRetryable:!0})}return e}var pg="3.0.9",Ww=()=>globalThis.fetch,mg=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:o,abortSignal:r,fetch:i=Ww()})=>{try{let a=await i(e,{method:"GET",headers:Gr(t,`ai-sdk/provider-utils/${pg}`,cg()),signal:r}),u=ho(a);if(!a.ok){let c;try{c=await o({response:a,url:e,requestBodyValues:{}})}catch(l){throw Nt(l)||le.isInstance(l)?l:new le({message:"Failed to process error response",cause:l,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}throw c.value}try{return await n({response:a,url:e,requestBodyValues:{}})}catch(c){throw c instanceof Error&&(Nt(c)||le.isInstance(c))?c:new le({message:"Failed to process successful response",cause:c,statusCode:a.status,url:e,responseHeaders:u,requestBodyValues:{}})}}catch(a){throw dg({error:a,url:e,requestBodyValues:{}})}};function fg({mediaType:e,url:t,supportedUrls:n}){return t=t.toLowerCase(),e=e.toLowerCase(),Object.entries(n).map(([o,r])=>{let i=o.toLowerCase();return i==="*"||i==="*/*"?{mediaTypePrefix:"",regexes:r}:{mediaTypePrefix:i.replace(/\*/,""),regexes:r}}).filter(({mediaTypePrefix:o})=>e.startsWith(o)).flatMap(({regexes:o})=>o).some(o=>o.test(t))}function gg({apiKey:e,environmentVariableName:t,apiKeyParameterName:n="apiKey",description:o}){if(typeof e=="string")return e;if(e!=null)throw new fn({message:`${o} API key must be a string.`});if(typeof process>"u")throw new fn({message:`${o} API key is missing. Pass it using the '${n}' parameter. Environment variables is not supported in this environment.`});if(e=process.env[t],e==null)throw new fn({message:`${o} API key is missing. Pass it using the '${n}' parameter or the ${t} environment variable.`});if(typeof e!="string")throw new fn({message:`${o} API key must be a string. The value of the ${t} environment variable is not a string.`});return e}function yo({settingValue:e,environmentVariableName:t}){if(typeof e=="string")return e;if(!(e!=null||typeof process>"u")&&(e=process.env[t],!(e==null||typeof e!="string")))return e}var Kw=/"__proto__"\s*:/,Hw=/"constructor"\s*:/;function Yw(e){let t=JSON.parse(e);return t===null||typeof t!="object"||Kw.test(e)===!1&&Hw.test(e)===!1?t:Xw(t)}function Xw(e){let t=[e];for(;t.length;){let n=t;t=[];for(let o of n){if(Object.prototype.hasOwnProperty.call(o,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(o,"constructor")&&Object.prototype.hasOwnProperty.call(o.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(let r in o){let i=o[r];i&&typeof i=="object"&&t.push(i)}}}return e}function Qc(e){let{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return Yw(e)}finally{Error.stackTraceLimit=t}}var oa=Symbol.for("vercel.ai.validator");function Qw(e){return{[oa]:!0,validate:e}}function e0(e){return typeof e=="object"&&e!==null&&oa in e&&e[oa]===!0&&"validate"in e}function t0(e){return e0(e)?e:r0(e)}function r0(e){return Qw(async t=>{let n=await e["~standard"].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new Lt({value:t,cause:n.issues})}})}async function ia({value:e,schema:t}){let n=await Rt({value:e,schema:t});if(!n.success)throw Lt.wrap({value:e,cause:n.error});return n.value}async function Rt({value:e,schema:t}){let n=t0(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};let o=await n.validate(e);return o.success?{success:!0,value:o.value,rawValue:e}:{success:!1,error:Lt.wrap({value:e,cause:o.error}),rawValue:e}}catch(o){return{success:!1,error:Lt.wrap({value:e,cause:o}),rawValue:e}}}async function n0({text:e,schema:t}){try{let n=Qc(e);return t==null?n:ia({value:n,schema:t})}catch(n){throw mn.isInstance(n)||Lt.isInstance(n)?n:new mn({text:e,cause:n})}}async function yt({text:e,schema:t}){try{let n=Qc(e);return t==null?{success:!0,value:n,rawValue:n}:await Rt({value:n,schema:t})}catch(n){return{success:!1,error:mn.isInstance(n)?n:new mn({text:e,cause:n}),rawValue:void 0}}}function ed(e){try{return Qc(e),!0}catch{return!1}}function o0({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Vo).pipeThrough(new TransformStream({async transform({data:n},o){n!=="[DONE]"&&o.enqueue(await yt({text:n,schema:t}))}}))}async function Me({provider:e,providerOptions:t,schema:n}){if(t?.[e]==null)return;let o=await Rt({value:t[e],schema:n});if(!o.success)throw new Bo({argument:"providerOptions",message:`invalid ${e} provider options`,cause:o.error});return o.value}var i0=()=>globalThis.fetch,be=async({url:e,headers:t,body:n,failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a})=>a0({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:o,successfulResponseHandler:r,abortSignal:i,fetch:a});var a0=async({url:e,headers:t={},body:n,successfulResponseHandler:o,failedResponseHandler:r,abortSignal:i,fetch:a=i0()})=>{try{let u=await a(e,{method:"POST",headers:Gr(t,`ai-sdk/provider-utils/${pg}`,cg()),body:n.content,signal:i}),c=ho(u);if(!u.ok){let l;try{l=await r({response:u,url:e,requestBodyValues:n.values})}catch(d){throw Nt(d)||le.isInstance(d)?d:new le({message:"Failed to process error response",cause:d,statusCode:u.status,url:e,responseHeaders:c,requestBodyValues:n.values})}throw l.value}try{return await o({response:u,url:e,requestBodyValues:n.values})}catch(l){throw l instanceof Error&&(Nt(l)||le.isInstance(l))?l:new le({message:"Failed to process successful response",cause:l,statusCode:u.status,url:e,responseHeaders:c,requestBodyValues:n.values})}}catch(u){throw dg({error:u,url:e,requestBodyValues:n.values})}};function Ue({id:e,name:t,inputSchema:n}){return({execute:o,outputSchema:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:c,...l})=>({type:"provider-defined",id:e,name:t,args:l,inputSchema:n,outputSchema:r,execute:o,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:c})}function aa({id:e,name:t,inputSchema:n,outputSchema:o}){return({execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:c,...l})=>({type:"provider-defined",id:e,name:t,args:l,inputSchema:n,outputSchema:o,execute:r,toModelOutput:i,onInputStart:a,onInputDelta:u,onInputAvailable:c})}async function Qe(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var ke=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:o,url:r,requestBodyValues:i})=>{let a=await o.text(),u=ho(o);if(a.trim()==="")return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})};try{let c=await n0({text:a,schema:e});return{responseHeaders:u,value:new le({message:t(c),url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,data:c,isRetryable:n?.(o,c)})}}catch{return{responseHeaders:u,value:new le({message:o.statusText,url:r,requestBodyValues:i,statusCode:o.status,responseHeaders:u,responseBody:a,isRetryable:n?.(o)})}}},er=e=>async({response:t})=>{let n=ho(t);if(t.body==null)throw new fp({});return{responseHeaders:n,value:o0({stream:t.body,schema:e})}};var Se=e=>async({response:t,url:n,requestBodyValues:o})=>{let r=await t.text(),i=await yt({text:r,schema:e}),a=ho(t);if(!i.success)throw new le({message:"Invalid JSON response",cause:i.error,statusCode:t.status,responseHeaders:a,responseBody:r,url:n,requestBodyValues:o});return{responseHeaders:a,value:i.value,rawValue:i.rawValue}};var s0=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},u0=Symbol("Let zodToJsonSchema decide on which parser to use"),sg={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},l0=e=>typeof e=="string"?{...sg,name:e}:{...sg,...e};function Je(){return{}}function c0(e,t){var n,o,r;let i={type:"array"};return(n=e.type)!=null&&n._def&&((r=(o=e.type)==null?void 0:o._def)==null?void 0:r.typeName)!==T.ZodAny&&(i.items=ee(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(i.minItems=e.minLength.value),e.maxLength&&(i.maxItems=e.maxLength.value),e.exactLength&&(i.minItems=e.exactLength.value,i.maxItems=e.exactLength.value),i}function d0(e){let t={type:"integer",format:"int64"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function p0(){return{type:"boolean"}}function hg(e,t){return ee(e.type._def,t)}var m0=(e,t)=>ee(e.innerType._def,t);function vg(e,t,n){let o=n??t.dateStrategy;if(Array.isArray(o))return{anyOf:o.map((r,i)=>vg(e,t,r))};switch(o){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return f0(e)}}var f0=e=>{let t={type:"integer",format:"unix-time"};for(let n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function g0(e,t){return{...ee(e.innerType._def,t),default:e.defaultValue()}}function h0(e,t){return t.effectStrategy==="input"?ee(e.schema._def,t):Je()}function v0(e){return{type:"string",enum:Array.from(e.values)}}var y0=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function b0(e,t){let n=[ee(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ee(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(r=>!!r),o=[];return n.forEach(r=>{if(y0(r))o.push(...r.allOf);else{let i=r;if("additionalProperties"in r&&r.additionalProperties===!1){let{additionalProperties:a,...u}=r;i=u}o.push(i)}}),o.length?{allOf:o}:void 0}function _0(e){let t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Kc=void 0,at={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Kc===void 0&&(Kc=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Kc),uuid:/^[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}$/,ipv4:/^(?:(?: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])$/,ipv4Cidr:/^(?:(?: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])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([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])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function yg(e,t){let n={type:"string"};if(e.checks)for(let o of e.checks)switch(o.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"email":switch(t.emailStrategy){case"format:email":st(n,"email",o.message,t);break;case"format:idn-email":st(n,"idn-email",o.message,t);break;case"pattern:zod":Oe(n,at.email,o.message,t);break}break;case"url":st(n,"uri",o.message,t);break;case"uuid":st(n,"uuid",o.message,t);break;case"regex":Oe(n,o.regex,o.message,t);break;case"cuid":Oe(n,at.cuid,o.message,t);break;case"cuid2":Oe(n,at.cuid2,o.message,t);break;case"startsWith":Oe(n,RegExp(`^${Hc(o.value,t)}`),o.message,t);break;case"endsWith":Oe(n,RegExp(`${Hc(o.value,t)}$`),o.message,t);break;case"datetime":st(n,"date-time",o.message,t);break;case"date":st(n,"date",o.message,t);break;case"time":st(n,"time",o.message,t);break;case"duration":st(n,"duration",o.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,o.value):o.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,o.value):o.value;break;case"includes":{Oe(n,RegExp(Hc(o.value,t)),o.message,t);break}case"ip":{o.version!=="v6"&&st(n,"ipv4",o.message,t),o.version!=="v4"&&st(n,"ipv6",o.message,t);break}case"base64url":Oe(n,at.base64url,o.message,t);break;case"jwt":Oe(n,at.jwt,o.message,t);break;case"cidr":{o.version!=="v6"&&Oe(n,at.ipv4Cidr,o.message,t),o.version!=="v4"&&Oe(n,at.ipv6Cidr,o.message,t);break}case"emoji":Oe(n,at.emoji(),o.message,t);break;case"ulid":{Oe(n,at.ulid,o.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{st(n,"binary",o.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{Oe(n,at.base64,o.message,t);break}}break}case"nanoid":Oe(n,at.nanoid,o.message,t);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return n}function Hc(e,t){return t.patternStrategy==="escape"?D0(e):e}var x0=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function D0(e){let t="";for(let n=0;n<e.length;n++)x0.has(e[n])||(t+="\\"),t+=e[n];return t}function st(e,t,n,o){var r;e.format||(r=e.anyOf)!=null&&r.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&o.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function Oe(e,t,n,o){var r;e.pattern||(r=e.allOf)!=null&&r.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:ug(t,o),...n&&o.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=ug(t,o)}function ug(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let o={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=o.i?e.source.toLowerCase():e.source,i="",a=!1,u=!1,c=!1;for(let l=0;l<r.length;l++){if(a){i+=r[l],a=!1;continue}if(o.i){if(u){if(r[l].match(/[a-z]/)){c?(i+=r[l],i+=`${r[l-2]}-${r[l]}`.toUpperCase(),c=!1):r[l+1]==="-"&&((n=r[l+2])!=null&&n.match(/[a-z]/))?(i+=r[l],c=!0):i+=`${r[l]}${r[l].toUpperCase()}`;continue}}else if(r[l].match(/[a-z]/)){i+=`[${r[l]}${r[l].toUpperCase()}]`;continue}}if(o.m){if(r[l]==="^"){i+=`(^|(?<=[\r
37
+ ]))`;continue}else if(r[l]==="$"){i+=`($|(?=[\r
38
+ ]))`;continue}}if(o.s&&r[l]==="."){i+=u?`${r[l]}\r
39
+ `:`[${r[l]}\r
40
+ ]`;continue}i+=r[l],r[l]==="\\"?a=!0:u&&r[l]==="]"?u=!1:!u&&r[l]==="["&&(u=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}function bg(e,t){var n,o,r,i,a,u;let c={type:"object",additionalProperties:(n=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((o=e.keyType)==null?void 0:o._def.typeName)===T.ZodString&&((r=e.keyType._def.checks)!=null&&r.length)){let{type:l,...d}=yg(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((i=e.keyType)==null?void 0:i._def.typeName)===T.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===T.ZodBranded&&e.keyType._def.type._def.typeName===T.ZodString&&((u=e.keyType._def.type._def.checks)!=null&&u.length)){let{type:l,...d}=hg(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function w0(e,t){if(t.mapStrategy==="record")return bg(e,t);let n=ee(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Je(),o=ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Je();return{type:"array",maxItems:125,items:{type:"array",items:[n,o],minItems:2,maxItems:2}}}function k0(e){let t=e.values,o=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),r=Array.from(new Set(o.map(i=>typeof i)));return{type:r.length===1?r[0]==="string"?"string":"number":["string","number"],enum:o}}function $0(){return{not:Je()}}function S0(){return{type:"null"}}var Yc={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function I0(e,t){let n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(o=>o._def.typeName in Yc&&(!o._def.checks||!o._def.checks.length))){let o=n.reduce((r,i)=>{let a=Yc[i._def.typeName];return a&&!r.includes(a)?[...r,a]:r},[]);return{type:o.length>1?o:o[0]}}else if(n.every(o=>o._def.typeName==="ZodLiteral"&&!o.description)){let o=n.reduce((r,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...r,a];case"bigint":return[...r,"integer"];case"object":if(i._def.value===null)return[...r,"null"];case"symbol":case"undefined":case"function":default:return r}},[]);if(o.length===n.length){let r=o.filter((i,a,u)=>u.indexOf(i)===a);return{type:r.length>1?r:r[0],enum:n.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(n.every(o=>o._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((o,r)=>[...o,...r._def.values.filter(i=>!o.includes(i))],[])};return E0(e,t)}var E0=(e,t)=>{let n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((o,r)=>ee(o._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(o=>!!o&&(!t.strictUnions||typeof o=="object"&&Object.keys(o).length>0));return n.length?{anyOf:n}:void 0};function T0(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[Yc[e.innerType._def.typeName],"null"]};let n=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function C0(e){let t={type:"number"};if(!e.checks)return t;for(let n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function A0(e,t){let n={type:"object",properties:{}},o=[],r=e.shape();for(let a in r){let u=r[a];if(u===void 0||u._def===void 0)continue;let c=j0(u),l=ee(u._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});l!==void 0&&(n.properties[a]=l,c||o.push(a))}o.length&&(n.required=o);let i=O0(e,t);return i!==void 0&&(n.additionalProperties=i),n}function O0(e,t){if(e.catchall._def.typeName!=="ZodNever")return ee(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function j0(e){try{return e.isOptional()}catch{return!0}}var P0=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ee(e.innerType._def,t);let o=ee(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return o?{anyOf:[{not:Je()},o]}:Je()},N0=(e,t)=>{if(t.pipeStrategy==="input")return ee(e.in._def,t);if(t.pipeStrategy==="output")return ee(e.out._def,t);let n=ee(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),o=ee(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,o].filter(r=>r!==void 0)}};function z0(e,t){return ee(e.type._def,t)}function R0(e,t){let o={type:"array",uniqueItems:!0,items:ee(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(o.minItems=e.minSize.value),e.maxSize&&(o.maxItems=e.maxSize.value),o}function F0(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[]),additionalItems:ee(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,o)=>ee(n._def,{...t,currentPath:[...t.currentPath,"items",`${o}`]})).reduce((n,o)=>o===void 0?n:[...n,o],[])}}function M0(){return{not:Je()}}function U0(){return Je()}var Z0=(e,t)=>ee(e.innerType._def,t),L0=(e,t,n)=>{switch(t){case T.ZodString:return yg(e,n);case T.ZodNumber:return C0(e);case T.ZodObject:return A0(e,n);case T.ZodBigInt:return d0(e);case T.ZodBoolean:return p0();case T.ZodDate:return vg(e,n);case T.ZodUndefined:return M0();case T.ZodNull:return S0();case T.ZodArray:return c0(e,n);case T.ZodUnion:case T.ZodDiscriminatedUnion:return I0(e,n);case T.ZodIntersection:return b0(e,n);case T.ZodTuple:return F0(e,n);case T.ZodRecord:return bg(e,n);case T.ZodLiteral:return _0(e);case T.ZodEnum:return v0(e);case T.ZodNativeEnum:return k0(e);case T.ZodNullable:return T0(e,n);case T.ZodOptional:return P0(e,n);case T.ZodMap:return w0(e,n);case T.ZodSet:return R0(e,n);case T.ZodLazy:return()=>e.getter()._def;case T.ZodPromise:return z0(e,n);case T.ZodNaN:case T.ZodNever:return $0();case T.ZodEffects:return h0(e,n);case T.ZodAny:return Je();case T.ZodUnknown:return U0();case T.ZodDefault:return g0(e,n);case T.ZodBranded:return hg(e,n);case T.ZodReadonly:return Z0(e,n);case T.ZodCatch:return m0(e,n);case T.ZodPipeline:return N0(e,n);case T.ZodFunction:case T.ZodVoid:case T.ZodSymbol:return;default:return(o=>{})(t)}};function ee(e,t,n=!1){var o;let r=t.seen.get(e);if(t.override){let c=(o=t.override)==null?void 0:o.call(t,e,t,r,n);if(c!==u0)return c}if(r&&!n){let c=B0(r,t);if(c!==void 0)return c}let i={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,i);let a=L0(e,e.typeName,t),u=typeof a=="function"?ee(a(),t):a;if(u&&q0(e,t,u),t.postProcess){let c=t.postProcess(u,e,t);return i.jsonSchema=u,c}return i.jsonSchema=u,u}var B0=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:s0(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,o)=>t.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Je()):t.$refStrategy==="seen"?Je():void 0}},q0=(e,t,n)=>(e.description&&(n.description=e.description),n),V0=e=>{let t=l0(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([o,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,o],jsonSchema:void 0}]))}},J0=(e,t)=>{var n;let o=V0(t),r=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((l,[d,v])=>{var y;return{...l,[d]:(y=ee(v._def,{...o,currentPath:[...o.basePath,o.definitionPath,d]},!0))!=null?y:Je()}},{}):void 0,i=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,a=(n=ee(e._def,i===void 0?o:{...o,currentPath:[...o.basePath,o.definitionPath,i]},!1))!=null?n:Je(),u=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;u!==void 0&&(a.title=u);let c=i===void 0?r?{...a,[o.definitionPath]:r}:a:{$ref:[...o.$refStrategy==="relative"?[]:o.basePath,o.definitionPath,i].join("/"),[o.definitionPath]:{...r,[i]:a}};return c.$schema="http://json-schema.org/draft-07/schema#",c},G0=J0;function W0(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1;return td(G0(e,{$refStrategy:o?"root":"none"}),{validate:async r=>{let i=await e.safeParseAsync(r);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}function K0(e,t){var n;let o=(n=t?.useReferences)!=null?n:!1,r=Kn(e,{target:"draft-7",io:"output",reused:o?"ref":"inline"});return td(r,{validate:async i=>{let a=await Hn(e,i);return a.success?{success:!0,value:a.data}:{success:!1,error:a.error}}})}function H0(e){return"_zod"in e}function Y0(e,t){return H0(e)?K0(e,t):W0(e,t)}var Xc=Symbol.for("vercel.ai.schema");function td(e,{validate:t}={}){return{[Xc]:!0,_type:void 0,[oa]:!0,jsonSchema:e,validate:t}}function X0(e){return typeof e=="object"&&e!==null&&Xc in e&&e[Xc]===!0&&"jsonSchema"in e&&"validate"in e}function cr(e){return e==null?td({properties:{},additionalProperties:!1}):X0(e)?e:Y0(e)}var{btoa:Q0,atob:ek}=globalThis;function bo(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=ek(t);return Uint8Array.from(n,o=>o.codePointAt(0))}function Wr(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return Q0(t)}function _o(e){return e instanceof Uint8Array?Wr(e):e}function Kr(e){return e?.replace(/\/$/,"")}function tk(e){return e!=null&&typeof e[Symbol.asyncIterator]=="function"}async function*rd({execute:e,input:t,options:n}){let o=e(t,n);if(tk(o)){let r;for await(let i of o)r=i,yield{type:"preliminary",output:i};yield{type:"final",output:r}}else yield{type:"final",output:await o}}function xo(e){var t,n;return(n=(t=e?.providerOptions)==null?void 0:t.openaiCompatible)!=null?n:{}}function rk(e){let t=[];for(let{role:n,content:o,...r}of e){let i=xo({...r});switch(n){case"system":{t.push({role:"system",content:o,...i});break}case"user":{if(o.length===1&&o[0].type==="text"){t.push({role:"user",content:o[0].text,...xo(o[0])});break}t.push({role:"user",content:o.map(a=>{let u=xo(a);switch(a.type){case"text":return{type:"text",text:a.text,...u};case"file":if(a.mediaType.startsWith("image/")){let c=a.mediaType==="image/*"?"image/jpeg":a.mediaType;return{type:"image_url",image_url:{url:a.data instanceof URL?a.data.toString():`data:${c};base64,${_o(a.data)}`},...u}}else throw new De({functionality:`file part media type ${a.mediaType}`})}}),...i});break}case"assistant":{let a="",u=[];for(let c of o){let l=xo(c);switch(c.type){case"text":{a+=c.text;break}case"tool-call":{u.push({id:c.toolCallId,type:"function",function:{name:c.toolName,arguments:JSON.stringify(c.input)},...l});break}}}t.push({role:"assistant",content:a,tool_calls:u.length>0?u:void 0,...i});break}case"tool":{for(let a of o){let u=a.output,c;switch(u.type){case"text":case"error-text":c=u.value;break;case"content":case"json":case"error-json":c=JSON.stringify(u.value);break}let l=xo(a);t.push({role:"tool",tool_call_id:a.toolCallId,content:c,...l})}break}default:{let a=n;throw new Error(`Unsupported role: ${a}`)}}}return t}function _g({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function xg(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var nd=s.object({user:s.string().optional(),reasoningEffort:s.string().optional()}),nk=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.any().nullish(),code:s.union([s.string(),s.number()]).nullish()})}),sa={errorSchema:nk,errorToMessage:e=>e.error.message};function ok({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let o=[];for(let i of e)i.type==="provider-defined"?n.push({type:"unsupported-tool",tool:i}):o.push({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema}});if(t==null)return{tools:o,toolChoice:void 0,toolWarnings:n};let r=t.type;switch(r){case"auto":case"none":case"required":return{tools:o,toolChoice:r,toolWarnings:n};case"tool":return{tools:o,toolChoice:{type:"function",function:{name:t.toolName}},toolWarnings:n};default:{let i=r;throw new De({functionality:`tool choice type: ${i}`})}}}var ik=class{constructor(e,t){this.specificationVersion="v2";var n,o;this.modelId=e,this.config=t;let r=(n=t.errorStructure)!=null?n:sa;this.chunkSchema=sk(r.errorSchema),this.failedResponseHandler=ke(r),this.supportsStructuredOutputs=(o=t.supportsStructuredOutputs)!=null?o:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,providerOptions:u,stopSequences:c,responseFormat:l,seed:d,toolChoice:v,tools:y}){var p,m,f,g;let b=[],D=Object.assign((p=await Me({provider:"openai-compatible",providerOptions:u,schema:nd}))!=null?p:{},(m=await Me({provider:this.providerOptionsName,providerOptions:u,schema:nd}))!=null?m:{});r!=null&&b.push({type:"unsupported-setting",setting:"topK"}),l?.type==="json"&&l.schema!=null&&!this.supportsStructuredOutputs&&b.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:$,toolChoice:_,toolWarnings:P}=ok({tools:y,toolChoice:v});return{args:{model:this.modelId,user:D.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,response_format:l?.type==="json"?this.supportsStructuredOutputs===!0&&l.schema!=null?{type:"json_schema",json_schema:{schema:l.schema,name:(f=l.name)!=null?f:"response",description:l.description}}:{type:"json_object"}:void 0,stop:c,seed:d,...Object.fromEntries(Object.entries((g=u?.[this.providerOptionsName])!=null?g:{}).filter(([O])=>!Object.keys(nd.shape).includes(O))),reasoning_effort:D.reasoningEffort,messages:rk(e),tools:$,tool_choice:_},warnings:[...b,...P]}}async doGenerate(e){var t,n,o,r,i,a,u,c,l,d,v,y,p,m,f,g,b;let{args:D,warnings:$}=await this.getArgs({...e}),_=JSON.stringify(D),{responseHeaders:P,value:O,rawValue:S}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:D,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Se(ak),abortSignal:e.abortSignal,fetch:this.config.fetch}),k=O.choices[0],Z=[],z=k.message.content;z!=null&&z.length>0&&Z.push({type:"text",text:z});let U=(t=k.message.reasoning_content)!=null?t:k.message.reasoning;if(U!=null&&U.length>0&&Z.push({type:"reasoning",text:U}),k.message.tool_calls!=null)for(let se of k.message.tool_calls)Z.push({type:"tool-call",toolCallId:(n=se.id)!=null?n:ut(),toolName:se.function.name,input:se.function.arguments});let te={[this.providerOptionsName]:{},...await((r=(o=this.config.metadataExtractor)==null?void 0:o.extractMetadata)==null?void 0:r.call(o,{parsedBody:S}))},ae=(i=O.usage)==null?void 0:i.completion_tokens_details;return ae?.accepted_prediction_tokens!=null&&(te[this.providerOptionsName].acceptedPredictionTokens=ae?.accepted_prediction_tokens),ae?.rejected_prediction_tokens!=null&&(te[this.providerOptionsName].rejectedPredictionTokens=ae?.rejected_prediction_tokens),{content:Z,finishReason:xg(k.finish_reason),usage:{inputTokens:(u=(a=O.usage)==null?void 0:a.prompt_tokens)!=null?u:void 0,outputTokens:(l=(c=O.usage)==null?void 0:c.completion_tokens)!=null?l:void 0,totalTokens:(v=(d=O.usage)==null?void 0:d.total_tokens)!=null?v:void 0,reasoningTokens:(m=(p=(y=O.usage)==null?void 0:y.completion_tokens_details)==null?void 0:p.reasoning_tokens)!=null?m:void 0,cachedInputTokens:(b=(g=(f=O.usage)==null?void 0:f.prompt_tokens_details)==null?void 0:g.cached_tokens)!=null?b:void 0},providerMetadata:te,request:{body:_},response:{..._g(O),headers:P,body:S},warnings:$}}async doStream(e){var t;let{args:n,warnings:o}=await this.getArgs({...e}),r={...n,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},i=(t=this.config.metadataExtractor)==null?void 0:t.createStreamExtractor(),{responseHeaders:a,value:u}=await be({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:r,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:er(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=[],l="unknown",d={completionTokens:void 0,completionTokensDetails:{reasoningTokens:void 0,acceptedPredictionTokens:void 0,rejectedPredictionTokens:void 0},promptTokens:void 0,promptTokensDetails:{cachedTokens:void 0},totalTokens:void 0},v=!0,y=this.providerOptionsName,p=!1,m=!1;return{stream:u.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:o})},transform(f,g){var b,D,$,_,P,O,S,k,Z,z,U,te,ae;if(e.includeRawChunks&&g.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){l="error",g.enqueue({type:"error",error:f.error});return}let se=f.value;if(i?.processChunk(f.rawValue),"error"in se){l="error",g.enqueue({type:"error",error:se.error.message});return}if(v&&(v=!1,g.enqueue({type:"response-metadata",..._g(se)})),se.usage!=null){let{prompt_tokens:fe,completion_tokens:et,total_tokens:re,prompt_tokens_details:de,completion_tokens_details:ye}=se.usage;d.promptTokens=fe??void 0,d.completionTokens=et??void 0,d.totalTokens=re??void 0,ye?.reasoning_tokens!=null&&(d.completionTokensDetails.reasoningTokens=ye?.reasoning_tokens),ye?.accepted_prediction_tokens!=null&&(d.completionTokensDetails.acceptedPredictionTokens=ye?.accepted_prediction_tokens),ye?.rejected_prediction_tokens!=null&&(d.completionTokensDetails.rejectedPredictionTokens=ye?.rejected_prediction_tokens),de?.cached_tokens!=null&&(d.promptTokensDetails.cachedTokens=de?.cached_tokens)}let Dt=se.choices[0];if(Dt?.finish_reason!=null&&(l=xg(Dt.finish_reason)),Dt?.delta==null)return;let dt=Dt.delta,fr=(b=dt.reasoning_content)!=null?b:dt.reasoning;if(fr&&(p||(g.enqueue({type:"reasoning-start",id:"reasoning-0"}),p=!0),g.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:fr})),dt.content&&(m||(g.enqueue({type:"text-start",id:"txt-0"}),m=!0),g.enqueue({type:"text-delta",id:"txt-0",delta:dt.content})),dt.tool_calls!=null)for(let fe of dt.tool_calls){let et=fe.index;if(c[et]==null){if(fe.id==null)throw new La({data:fe,message:"Expected 'id' to be a string."});if(((D=fe.function)==null?void 0:D.name)==null)throw new La({data:fe,message:"Expected 'function.name' to be a string."});g.enqueue({type:"tool-input-start",id:fe.id,toolName:fe.function.name}),c[et]={id:fe.id,type:"function",function:{name:fe.function.name,arguments:($=fe.function.arguments)!=null?$:""},hasFinished:!1};let de=c[et];((_=de.function)==null?void 0:_.name)!=null&&((P=de.function)==null?void 0:P.arguments)!=null&&(de.function.arguments.length>0&&g.enqueue({type:"tool-input-delta",id:de.id,delta:de.function.arguments}),ed(de.function.arguments)&&(g.enqueue({type:"tool-input-end",id:de.id}),g.enqueue({type:"tool-call",toolCallId:(O=de.id)!=null?O:ut(),toolName:de.function.name,input:de.function.arguments}),de.hasFinished=!0));continue}let re=c[et];re.hasFinished||(((S=fe.function)==null?void 0:S.arguments)!=null&&(re.function.arguments+=(Z=(k=fe.function)==null?void 0:k.arguments)!=null?Z:""),g.enqueue({type:"tool-input-delta",id:re.id,delta:(z=fe.function.arguments)!=null?z:""}),((U=re.function)==null?void 0:U.name)!=null&&((te=re.function)==null?void 0:te.arguments)!=null&&ed(re.function.arguments)&&(g.enqueue({type:"tool-input-end",id:re.id}),g.enqueue({type:"tool-call",toolCallId:(ae=re.id)!=null?ae:ut(),toolName:re.function.name,input:re.function.arguments}),re.hasFinished=!0))}},flush(f){var g,b,D,$,_,P;p&&f.enqueue({type:"reasoning-end",id:"reasoning-0"}),m&&f.enqueue({type:"text-end",id:"txt-0"});for(let S of c.filter(k=>!k.hasFinished))f.enqueue({type:"tool-input-end",id:S.id}),f.enqueue({type:"tool-call",toolCallId:(g=S.id)!=null?g:ut(),toolName:S.function.name,input:S.function.arguments});let O={[y]:{},...i?.buildMetadata()};d.completionTokensDetails.acceptedPredictionTokens!=null&&(O[y].acceptedPredictionTokens=d.completionTokensDetails.acceptedPredictionTokens),d.completionTokensDetails.rejectedPredictionTokens!=null&&(O[y].rejectedPredictionTokens=d.completionTokensDetails.rejectedPredictionTokens),f.enqueue({type:"finish",finishReason:l,usage:{inputTokens:(b=d.promptTokens)!=null?b:void 0,outputTokens:(D=d.completionTokens)!=null?D:void 0,totalTokens:($=d.totalTokens)!=null?$:void 0,reasoningTokens:(_=d.completionTokensDetails.reasoningTokens)!=null?_:void 0,cachedInputTokens:(P=d.promptTokensDetails.cachedTokens)!=null?P:void 0},providerMetadata:O})}})),request:{body:r},response:{headers:a}}}},$g=s.object({prompt_tokens:s.number().nullish(),completion_tokens:s.number().nullish(),total_tokens:s.number().nullish(),prompt_tokens_details:s.object({cached_tokens:s.number().nullish()}).nullish(),completion_tokens_details:s.object({reasoning_tokens:s.number().nullish(),accepted_prediction_tokens:s.number().nullish(),rejected_prediction_tokens:s.number().nullish()}).nullish()}).nullish(),ak=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({message:s.object({role:s.literal("assistant").nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({id:s.string().nullish(),function:s.object({name:s.string(),arguments:s.string()})})).nullish()}),finish_reason:s.string().nullish()})),usage:$g}),sk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({delta:s.object({role:s.enum(["assistant"]).nullish(),content:s.string().nullish(),reasoning_content:s.string().nullish(),reasoning:s.string().nullish(),tool_calls:s.array(s.object({index:s.number(),id:s.string().nullish(),function:s.object({name:s.string().nullish(),arguments:s.string().nullish()})})).nullish()}).nullish(),finish_reason:s.string().nullish()})),usage:$g}),e]);function uk({prompt:e,user:t="user",assistant:n="assistant"}){let o="";e[0].role==="system"&&(o+=`${e[0].content}
41
+
42
+ `,e=e.slice(1));for(let{role:r,content:i}of e)switch(r){case"system":throw new $t({message:"Unexpected system message in prompt: ${content}",prompt:e});case"user":{let a=i.map(u=>{switch(u.type){case"text":return u.text}}).filter(Boolean).join("");o+=`${t}:
43
+ ${a}
44
+
45
+ `;break}case"assistant":{let a=i.map(u=>{switch(u.type){case"text":return u.text;case"tool-call":throw new De({functionality:"tool-call messages"})}}).join("");o+=`${n}:
46
+ ${a}
47
+
48
+ `;break}case"tool":throw new De({functionality:"tool messages"});default:{let a=r;throw new Error(`Unsupported role: ${a}`)}}return o+=`${n}:
49
+ `,{prompt:o,stopSequences:[`
50
+ ${t}:`]}}function Dg({id:e,model:t,created:n}){return{id:e??void 0,modelId:t??void 0,timestamp:n!=null?new Date(n*1e3):void 0}}function wg(e){switch(e){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"unknown"}}var lk=s.object({echo:s.boolean().optional(),logitBias:s.record(s.string(),s.number()).optional(),suffix:s.string().optional(),user:s.string().optional()}),ck=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t;let o=(n=t.errorStructure)!=null?n:sa;this.chunkSchema=pk(o.errorSchema),this.failedResponseHandler=ke(o)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:c,seed:l,providerOptions:d,tools:v,toolChoice:y}){var p;let m=[],f=(p=await Me({provider:this.providerOptionsName,providerOptions:d,schema:lk}))!=null?p:{};r!=null&&m.push({type:"unsupported-setting",setting:"topK"}),v?.length&&m.push({type:"unsupported-setting",setting:"tools"}),y!=null&&m.push({type:"unsupported-setting",setting:"toolChoice"}),c!=null&&c.type!=="text"&&m.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format is not supported."});let{prompt:g,stopSequences:b}=uk({prompt:e}),D=[...b??[],...u??[]];return{args:{model:this.modelId,echo:f.echo,logit_bias:f.logitBias,suffix:f.suffix,user:f.user,max_tokens:t,temperature:n,top_p:o,frequency_penalty:i,presence_penalty:a,seed:l,...d?.[this.providerOptionsName],prompt:g,stop:D.length>0?D:void 0},warnings:m}}async doGenerate(e){var t,n,o,r,i,a;let{args:u,warnings:c}=await this.getArgs(e),{responseHeaders:l,value:d,rawValue:v}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:u,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Se(dk),abortSignal:e.abortSignal,fetch:this.config.fetch}),y=d.choices[0],p=[];return y.text!=null&&y.text.length>0&&p.push({type:"text",text:y.text}),{content:p,usage:{inputTokens:(n=(t=d.usage)==null?void 0:t.prompt_tokens)!=null?n:void 0,outputTokens:(r=(o=d.usage)==null?void 0:o.completion_tokens)!=null?r:void 0,totalTokens:(a=(i=d.usage)==null?void 0:i.total_tokens)!=null?a:void 0},finishReason:wg(y.finish_reason),request:{body:u},response:{...Dg(d),headers:l,body:v},warnings:c}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),o={...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:r,value:i}=await be({url:this.config.url({path:"/completions",modelId:this.modelId}),headers:we(this.config.headers(),e.headers),body:o,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:er(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),a="unknown",u={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},c=!0;return{stream:i.pipeThrough(new TransformStream({start(l){l.enqueue({type:"stream-start",warnings:n})},transform(l,d){var v,y,p;if(e.includeRawChunks&&d.enqueue({type:"raw",rawValue:l.rawValue}),!l.success){a="error",d.enqueue({type:"error",error:l.error});return}let m=l.value;if("error"in m){a="error",d.enqueue({type:"error",error:m.error});return}c&&(c=!1,d.enqueue({type:"response-metadata",...Dg(m)}),d.enqueue({type:"text-start",id:"0"})),m.usage!=null&&(u.inputTokens=(v=m.usage.prompt_tokens)!=null?v:void 0,u.outputTokens=(y=m.usage.completion_tokens)!=null?y:void 0,u.totalTokens=(p=m.usage.total_tokens)!=null?p:void 0);let f=m.choices[0];f?.finish_reason!=null&&(a=wg(f.finish_reason)),f?.text!=null&&d.enqueue({type:"text-delta",id:"0",delta:f.text})},flush(l){c||l.enqueue({type:"text-end",id:"0"}),l.enqueue({type:"finish",finishReason:a,usage:u})}})),request:{body:o},response:{headers:r}}}},Sg=s.object({prompt_tokens:s.number(),completion_tokens:s.number(),total_tokens:s.number()}),dk=s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string()})),usage:Sg.nullish()}),pk=e=>s.union([s.object({id:s.string().nullish(),created:s.number().nullish(),model:s.string().nullish(),choices:s.array(s.object({text:s.string(),finish_reason:s.string().nullish(),index:s.number()})),usage:Sg.nullish()}),e]),kg=s.object({dimensions:s.number().optional(),user:s.string().optional()}),mk=class{constructor(e,t){this.specificationVersion="v2",this.modelId=e,this.config=t}get provider(){return this.config.provider}get maxEmbeddingsPerCall(){var e;return(e=this.config.maxEmbeddingsPerCall)!=null?e:2048}get supportsParallelCalls(){var e;return(e=this.config.supportsParallelCalls)!=null?e:!0}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r,i,a;let u=Object.assign((r=await Me({provider:"openai-compatible",providerOptions:o,schema:kg}))!=null?r:{},(i=await Me({provider:this.providerOptionsName,providerOptions:o,schema:kg}))!=null?i:{});if(e.length>this.maxEmbeddingsPerCall)throw new zp({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:c,value:l,rawValue:d}=await be({url:this.config.url({path:"/embeddings",modelId:this.modelId}),headers:we(this.config.headers(),t),body:{model:this.modelId,input:e,encoding_format:"float",dimensions:u.dimensions,user:u.user},failedResponseHandler:ke((a=this.config.errorStructure)!=null?a:sa),successfulResponseHandler:Se(fk),abortSignal:n,fetch:this.config.fetch});return{embeddings:l.data.map(v=>v.embedding),usage:l.usage?{tokens:l.usage.prompt_tokens}:void 0,providerMetadata:l.providerMetadata,response:{headers:c,body:d}}}},fk=s.object({data:s.array(s.object({embedding:s.array(s.number())})),usage:s.object({prompt_tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.any())).optional()}),gk=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxImagesPerCall=10}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:o,seed:r,providerOptions:i,headers:a,abortSignal:u}){var c,l,d,v,y;let p=[];o!=null&&p.push({type:"unsupported-setting",setting:"aspectRatio",details:"This model does not support aspect ratio. Use `size` instead."}),r!=null&&p.push({type:"unsupported-setting",setting:"seed"});let m=(d=(l=(c=this.config._internal)==null?void 0:c.currentDate)==null?void 0:l.call(c))!=null?d:new Date,{value:f,responseHeaders:g}=await be({url:this.config.url({path:"/images/generations",modelId:this.modelId}),headers:we(this.config.headers(),a),body:{model:this.modelId,prompt:e,n:t,size:n,...(v=i.openai)!=null?v:{},response_format:"b64_json"},failedResponseHandler:ke((y=this.config.errorStructure)!=null?y:sa),successfulResponseHandler:Se(hk),abortSignal:u,fetch:this.config.fetch});return{images:f.data.map(b=>b.b64_json),warnings:p,response:{timestamp:m,modelId:this.modelId,headers:g}}}},hk=s.object({data:s.array(s.object({b64_json:s.string()}))}),vk="1.0.17";function Ig(e){let t=Kr(e.baseURL),n=e.name,o={...e.apiKey&&{Authorization:`Bearer ${e.apiKey}`},...e.headers},r=()=>Gr(o,`ai-sdk/openai-compatible/${vk}`),i=y=>({provider:`${n}.${y}`,url:({path:p})=>{let m=new URL(`${t}${p}`);return e.queryParams&&(m.search=new URLSearchParams(e.queryParams).toString()),m.toString()},headers:r,fetch:e.fetch}),a=y=>u(y),u=y=>new ik(y,{...i("chat"),includeUsage:e.includeUsage}),c=y=>new ck(y,{...i("completion"),includeUsage:e.includeUsage}),l=y=>new mk(y,{...i("embedding")}),d=y=>new gk(y,i("image")),v=y=>a(y);return v.languageModel=a,v.chatModel=u,v.completionModel=c,v.textEmbeddingModel=l,v.imageModel=d,v}var yk=s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),Eg=ke({errorSchema:yk,errorToMessage:e=>e.error.message}),Tg=s.object({citations:s.object({enabled:s.boolean()}).optional(),title:s.string().optional(),context:s.string().optional()}),bk=s.object({sendReasoning:s.boolean().optional(),thinking:s.object({type:s.union([s.literal("enabled"),s.literal("disabled")]),budgetTokens:s.number().optional()}).optional(),disableParallelToolUse:s.boolean().optional(),cacheControl:s.object({type:s.literal("ephemeral"),ttl:s.union([s.literal("5m"),s.literal("1h")]).optional()}).optional()});function tr(e){var t;let n=e?.anthropic;return(t=n?.cacheControl)!=null?t:n?.cache_control}var _k=s.object({maxUses:s.number().optional(),allowedDomains:s.array(s.string()).optional(),blockedDomains:s.array(s.string()).optional(),userLocation:s.object({type:s.literal("approximate"),city:s.string().optional(),region:s.string().optional(),country:s.string().optional(),timezone:s.string().optional()}).optional()}),Og=s.array(s.object({url:s.string(),title:s.string(),pageAge:s.string().nullable(),encryptedContent:s.string(),type:s.string()})),xk=aa({id:"anthropic.web_search_20250305",name:"web_search",inputSchema:s.object({query:s.string()}),outputSchema:Og}),Dk=(e={})=>xk(e);function wk(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="web_search_20250305"}function kk({tools:e,toolChoice:t,disableParallelToolUse:n}){e=e?.length?e:void 0;let o=[],r=new Set;if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};let i=[];for(let u of e){if(wk(u)){i.push(u);continue}switch(u.type){case"function":let c=tr(u.providerOptions);i.push({name:u.name,description:u.description,input_schema:u.inputSchema,cache_control:c});break;case"provider-defined":switch(u.id){case"anthropic.computer_20250124":r.add("computer-use-2025-01-24"),i.push({name:"computer",type:"computer_20250124",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.computer_20241022":r.add("computer-use-2024-10-22"),i.push({name:"computer",type:"computer_20241022",display_width_px:u.args.displayWidthPx,display_height_px:u.args.displayHeightPx,display_number:u.args.displayNumber});break;case"anthropic.text_editor_20250124":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_editor",type:"text_editor_20250124"});break;case"anthropic.text_editor_20241022":r.add("computer-use-2024-10-22"),i.push({name:"str_replace_editor",type:"text_editor_20241022"});break;case"anthropic.text_editor_20250429":r.add("computer-use-2025-01-24"),i.push({name:"str_replace_based_edit_tool",type:"text_editor_20250429"});break;case"anthropic.bash_20250124":r.add("computer-use-2025-01-24"),i.push({name:"bash",type:"bash_20250124"});break;case"anthropic.bash_20241022":r.add("computer-use-2024-10-22"),i.push({name:"bash",type:"bash_20241022"});break;case"anthropic.web_search_20250305":{let l=_k.parse(u.args);i.push({type:"web_search_20250305",name:"web_search",max_uses:l.maxUses,allowed_domains:l.allowedDomains,blocked_domains:l.blockedDomains,user_location:l.userLocation});break}case"anthropic.code_execution_20250522":{r.add("code-execution-2025-05-22"),i.push({type:"code_execution_20250522",name:"code_execution"});break}default:o.push({type:"unsupported-tool",tool:u});break}break;default:o.push({type:"unsupported-tool",tool:u});break}}if(t==null)return{tools:i,toolChoice:n?{type:"auto",disable_parallel_tool_use:n}:void 0,toolWarnings:o,betas:r};let a=t.type;switch(a){case"auto":return{tools:i,toolChoice:{type:"auto",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"required":return{tools:i,toolChoice:{type:"any",disable_parallel_tool_use:n},toolWarnings:o,betas:r};case"none":return{tools:void 0,toolChoice:void 0,toolWarnings:o,betas:r};case"tool":return{tools:i,toolChoice:{type:"tool",name:t.toolName,disable_parallel_tool_use:n},toolWarnings:o,betas:r};default:{let u=a;throw new De({functionality:`tool choice type: ${u}`})}}}var jg=s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),$k=aa({id:"anthropic.code_execution_20250522",name:"code_execution",inputSchema:s.object({code:s.string()}),outputSchema:jg}),Sk=(e={})=>$k(e);function Ik(e){if(typeof e=="string")return Buffer.from(e,"base64").toString("utf-8");if(e instanceof Uint8Array)return new TextDecoder().decode(e);throw e instanceof URL?new De({functionality:"URL-based text documents are not supported for citations"}):new De({functionality:`unsupported data type for text documents: ${typeof e}`})}async function Ek({prompt:e,sendReasoning:t,warnings:n}){var o,r,i,a,u;let c=new Set,l=Tk(e),d,v=[];async function y(m){var f,g;let b=await Me({provider:"anthropic",providerOptions:m,schema:Tg});return(g=(f=b?.citations)==null?void 0:f.enabled)!=null?g:!1}async function p(m){let f=await Me({provider:"anthropic",providerOptions:m,schema:Tg});return{title:f?.title,context:f?.context}}for(let m=0;m<l.length;m++){let f=l[m],g=m===l.length-1,b=f.type;switch(b){case"system":{if(d!=null)throw new De({functionality:"Multiple system messages that are separated by user/assistant messages"});d=f.messages.map(({content:D,providerOptions:$})=>({type:"text",text:D,cache_control:tr($)}));break}case"user":{let D=[];for(let $ of f.messages){let{role:_,content:P}=$;switch(_){case"user":{for(let O=0;O<P.length;O++){let S=P[O],k=O===P.length-1,Z=(o=tr(S.providerOptions))!=null?o:k?tr($.providerOptions):void 0;switch(S.type){case"text":{D.push({type:"text",text:S.text,cache_control:Z});break}case"file":{if(S.mediaType.startsWith("image/"))D.push({type:"image",source:S.data instanceof URL?{type:"url",url:S.data.toString()}:{type:"base64",media_type:S.mediaType==="image/*"?"image/jpeg":S.mediaType,data:_o(S.data)},cache_control:Z});else if(S.mediaType==="application/pdf"){c.add("pdfs-2024-09-25");let z=await y(S.providerOptions),U=await p(S.providerOptions);D.push({type:"document",source:S.data instanceof URL?{type:"url",url:S.data.toString()}:{type:"base64",media_type:"application/pdf",data:_o(S.data)},title:(r=U.title)!=null?r:S.filename,...U.context&&{context:U.context},...z&&{citations:{enabled:!0}},cache_control:Z})}else if(S.mediaType==="text/plain"){let z=await y(S.providerOptions),U=await p(S.providerOptions);D.push({type:"document",source:S.data instanceof URL?{type:"url",url:S.data.toString()}:{type:"text",media_type:"text/plain",data:Ik(S.data)},title:(i=U.title)!=null?i:S.filename,...U.context&&{context:U.context},...z&&{citations:{enabled:!0}},cache_control:Z})}else throw new De({functionality:`media type: ${S.mediaType}`});break}}}break}case"tool":{for(let O=0;O<P.length;O++){let S=P[O],k=O===P.length-1,Z=(a=tr(S.providerOptions))!=null?a:k?tr($.providerOptions):void 0,z=S.output,U;switch(z.type){case"content":U=z.value.map(te=>{switch(te.type){case"text":return{type:"text",text:te.text,cache_control:void 0};case"media":{if(te.mediaType.startsWith("image/"))return{type:"image",source:{type:"base64",media_type:te.mediaType,data:te.data},cache_control:void 0};throw new De({functionality:`media type: ${te.mediaType}`})}}});break;case"text":case"error-text":U=z.value;break;case"json":case"error-json":default:U=JSON.stringify(z.value);break}D.push({type:"tool_result",tool_use_id:S.toolCallId,content:U,is_error:z.type==="error-text"||z.type==="error-json"?!0:void 0,cache_control:Z})}break}default:{let O=_;throw new Error(`Unsupported role: ${O}`)}}}v.push({role:"user",content:D});break}case"assistant":{let D=[];for(let $=0;$<f.messages.length;$++){let _=f.messages[$],P=$===f.messages.length-1,{content:O}=_;for(let S=0;S<O.length;S++){let k=O[S],Z=S===O.length-1,z=(u=tr(k.providerOptions))!=null?u:Z?tr(_.providerOptions):void 0;switch(k.type){case"text":{D.push({type:"text",text:g&&P&&Z?k.text.trim():k.text,cache_control:z});break}case"reasoning":{if(t){let U=await Me({provider:"anthropic",providerOptions:k.providerOptions,schema:Pk});U!=null?U.signature!=null?D.push({type:"thinking",thinking:k.text,signature:U.signature,cache_control:z}):U.redactedData!=null?D.push({type:"redacted_thinking",data:U.redactedData,cache_control:z}):n.push({type:"other",message:"unsupported reasoning metadata"}):n.push({type:"other",message:"unsupported reasoning metadata"})}else n.push({type:"other",message:"sending reasoning content is disabled for this model"});break}case"tool-call":{if(k.providerExecuted){if(k.toolName==="web_search"){D.push({type:"server_tool_use",id:k.toolCallId,name:"web_search",input:k.input,cache_control:z});break}if(k.toolName==="code_execution"){D.push({type:"server_tool_use",id:k.toolCallId,name:"code_execution",input:k.input,cache_control:z});break}n.push({type:"other",message:`provider executed tool call for tool ${k.toolName} is not supported`});break}D.push({type:"tool_use",id:k.toolCallId,name:k.toolName,input:k.input,cache_control:z});break}case"tool-result":{if(k.toolName==="web_search"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let te=Og.parse(U.value);D.push({type:"web_search_tool_result",tool_use_id:k.toolCallId,content:te.map(ae=>({url:ae.url,title:ae.title,page_age:ae.pageAge,encrypted_content:ae.encryptedContent,type:ae.type})),cache_control:z});break}if(k.toolName==="code_execution"){let U=k.output;if(U.type!=="json"){n.push({type:"other",message:`provider executed tool result output type ${U.type} for tool ${k.toolName} is not supported`});break}let te=jg.parse(U.value);D.push({type:"code_execution_tool_result",tool_use_id:k.toolCallId,content:{type:te.type,stdout:te.stdout,stderr:te.stderr,return_code:te.return_code},cache_control:z});break}n.push({type:"other",message:`provider executed tool result for tool ${k.toolName} is not supported`});break}}}}v.push({role:"assistant",content:D});break}default:{let D=b;throw new Error(`content type: ${D}`)}}}return{prompt:{system:d,messages:v},betas:c}}function Tk(e){let t=[],n;for(let o of e){let{role:r}=o;switch(r){case"system":{n?.type!=="system"&&(n={type:"system",messages:[]},t.push(n)),n.messages.push(o);break}case"assistant":{n?.type!=="assistant"&&(n={type:"assistant",messages:[]},t.push(n)),n.messages.push(o);break}case"user":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}case"tool":{n?.type!=="user"&&(n={type:"user",messages:[]},t.push(n)),n.messages.push(o);break}default:{let i=r;throw new Error(`Unsupported role: ${i}`)}}}return t}function Cg({finishReason:e,isJsonResponseFromTool:t}){switch(e){case"pause_turn":case"end_turn":case"stop_sequence":return"stop";case"refusal":return"content-filter";case"tool_use":return t?"stop":"tool-calls";case"max_tokens":return"length";default:return"unknown"}}var Do={webSearchResult:s.object({type:s.literal("web_search_result_location"),cited_text:s.string(),url:s.string(),title:s.string(),encrypted_index:s.string()}),pageLocation:s.object({type:s.literal("page_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_page_number:s.number(),end_page_number:s.number()}),charLocation:s.object({type:s.literal("char_location"),cited_text:s.string(),document_index:s.number(),document_title:s.string().nullable(),start_char_index:s.number(),end_char_index:s.number()})},Pg=s.discriminatedUnion("type",[Do.webSearchResult,Do.pageLocation,Do.charLocation]),pP=s.discriminatedUnion("type",[Do.pageLocation,Do.charLocation]);function Ag(e,t,n,o){if(e.type==="page_location"||e.type==="char_location"){let r=Ck(e,t,n);r&&o(r)}}function Ck(e,t,n){var o;let r=t[e.document_index];if(!r)return null;let i=e.type==="page_location"?{citedText:e.cited_text,startPageNumber:e.start_page_number,endPageNumber:e.end_page_number}:{citedText:e.cited_text,startCharIndex:e.start_char_index,endCharIndex:e.end_char_index};return{type:"source",sourceType:"document",id:n(),mediaType:r.mediaType,title:(o=e.document_title)!=null?o:r.title,filename:r.filename,providerMetadata:{anthropic:i}}}var Ak=class{constructor(e,t){this.specificationVersion="v2";var n;this.modelId=e,this.config=t,this.generateId=(n=t.generateId)!=null?n:ut}supportsUrl(e){return e.protocol==="https:"}get provider(){return this.config.provider}get supportedUrls(){var e,t,n;return(n=(t=(e=this.config).supportedUrls)==null?void 0:t.call(e))!=null?n:{}}async getArgs({prompt:e,maxOutputTokens:t=4096,temperature:n,topP:o,topK:r,frequencyPenalty:i,presencePenalty:a,stopSequences:u,responseFormat:c,seed:l,tools:d,toolChoice:v,providerOptions:y}){var p,m,f;let g=[];i!=null&&g.push({type:"unsupported-setting",setting:"frequencyPenalty"}),a!=null&&g.push({type:"unsupported-setting",setting:"presencePenalty"}),l!=null&&g.push({type:"unsupported-setting",setting:"seed"}),c?.type==="json"&&(c.schema==null?g.push({type:"unsupported-setting",setting:"responseFormat",details:"JSON response format requires a schema. The response format is ignored."}):d!=null&&g.push({type:"unsupported-setting",setting:"tools",details:"JSON response format does not support tools. The provided tools are ignored."}));let b=c?.type==="json"&&c.schema!=null?{type:"function",name:"json",description:"Respond with a JSON object.",inputSchema:c.schema}:void 0,D=await Me({provider:"anthropic",providerOptions:y,schema:bk}),{prompt:$,betas:_}=await Ek({prompt:e,sendReasoning:(p=D?.sendReasoning)!=null?p:!0,warnings:g}),P=((m=D?.thinking)==null?void 0:m.type)==="enabled",O=(f=D?.thinking)==null?void 0:f.budgetTokens,S={model:this.modelId,max_tokens:t,temperature:n,top_k:r,top_p:o,stop_sequences:u,...P&&{thinking:{type:"enabled",budget_tokens:O}},system:$.system,messages:$.messages};if(P){if(O==null)throw new De({functionality:"thinking requires a budget"});S.temperature!=null&&(S.temperature=void 0,g.push({type:"unsupported-setting",setting:"temperature",details:"temperature is not supported when thinking is enabled"})),r!=null&&(S.top_k=void 0,g.push({type:"unsupported-setting",setting:"topK",details:"topK is not supported when thinking is enabled"})),o!=null&&(S.top_p=void 0,g.push({type:"unsupported-setting",setting:"topP",details:"topP is not supported when thinking is enabled"})),S.max_tokens=t+O}let{tools:k,toolChoice:Z,toolWarnings:z,betas:U}=kk(b!=null?{tools:[b],toolChoice:{type:"tool",toolName:b.name},disableParallelToolUse:!0}:{tools:d??[],toolChoice:v,disableParallelToolUse:D?.disableParallelToolUse});return{args:{...S,tools:k,tool_choice:Z},warnings:[...g,...z],betas:new Set([..._,...U]),usesJsonResponseTool:b!=null}}async getHeaders({betas:e,headers:t}){return we(await Qe(this.config.headers),e.size>0?{"anthropic-beta":Array.from(e).join(",")}:{},t)}buildRequestUrl(e){var t,n,o;return(o=(n=(t=this.config).buildRequestUrl)==null?void 0:n.call(t,this.config.baseURL,e))!=null?o:`${this.config.baseURL}/messages`}transformRequestBody(e){var t,n,o;return(o=(n=(t=this.config).transformRequestBody)==null?void 0:n.call(t,e))!=null?o:e}extractCitationDocuments(e){let t=n=>{var o,r;if(n.type!=="file"||n.mediaType!=="application/pdf"&&n.mediaType!=="text/plain")return!1;let i=(o=n.providerOptions)==null?void 0:o.anthropic,a=i?.citations;return(r=a?.enabled)!=null?r:!1};return e.filter(n=>n.role==="user").flatMap(n=>n.content).filter(t).map(n=>{var o;let r=n;return{title:(o=r.filename)!=null?o:"Untitled Document",filename:r.filename,mediaType:r.mediaType}})}async doGenerate(e){var t,n,o,r,i;let{args:a,warnings:u,betas:c,usesJsonResponseTool:l}=await this.getArgs(e),d=this.extractCitationDocuments(e.prompt),{responseHeaders:v,value:y,rawValue:p}=await be({url:this.buildRequestUrl(!1),headers:await this.getHeaders({betas:c,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:Eg,successfulResponseHandler:Se(Ok),abortSignal:e.abortSignal,fetch:this.config.fetch}),m=[];for(let f of y.content)switch(f.type){case"text":{if(!l&&(m.push({type:"text",text:f.text}),f.citations))for(let g of f.citations)Ag(g,d,this.generateId,b=>m.push(b));break}case"thinking":{m.push({type:"reasoning",text:f.thinking,providerMetadata:{anthropic:{signature:f.signature}}});break}case"redacted_thinking":{m.push({type:"reasoning",text:"",providerMetadata:{anthropic:{redactedData:f.data}}});break}case"tool_use":{m.push(l?{type:"text",text:JSON.stringify(f.input)}:{type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input)});break}case"server_tool_use":{(f.name==="web_search"||f.name==="code_execution")&&m.push({type:"tool-call",toolCallId:f.id,toolName:f.name,input:JSON.stringify(f.input),providerExecuted:!0});break}case"web_search_tool_result":{if(Array.isArray(f.content)){m.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",result:f.content.map(g=>{var b;return{url:g.url,title:g.title,pageAge:(b=g.page_age)!=null?b:null,encryptedContent:g.encrypted_content,type:g.type}}),providerExecuted:!0});for(let g of f.content)m.push({type:"source",sourceType:"url",id:this.generateId(),url:g.url,title:g.title,providerMetadata:{anthropic:{pageAge:(t=g.page_age)!=null?t:null}}})}else m.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}case"code_execution_tool_result":{f.content.type==="code_execution_result"?m.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",result:{type:f.content.type,stdout:f.content.stdout,stderr:f.content.stderr,return_code:f.content.return_code},providerExecuted:!0}):f.content.type==="code_execution_tool_result_error"&&m.push({type:"tool-result",toolCallId:f.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:f.content.error_code},providerExecuted:!0});break}}return{content:m,finishReason:Cg({finishReason:y.stop_reason,isJsonResponseFromTool:l}),usage:{inputTokens:y.usage.input_tokens,outputTokens:y.usage.output_tokens,totalTokens:y.usage.input_tokens+y.usage.output_tokens,cachedInputTokens:(n=y.usage.cache_read_input_tokens)!=null?n:void 0},request:{body:a},response:{id:(o=y.id)!=null?o:void 0,modelId:(r=y.model)!=null?r:void 0,headers:v,body:p},warnings:u,providerMetadata:{anthropic:{usage:y.usage,cacheCreationInputTokens:(i=y.usage.cache_creation_input_tokens)!=null?i:null}}}}async doStream(e){let{args:t,warnings:n,betas:o,usesJsonResponseTool:r}=await this.getArgs(e),i=this.extractCitationDocuments(e.prompt),a={...t,stream:!0},{responseHeaders:u,value:c}=await be({url:this.buildRequestUrl(!0),headers:await this.getHeaders({betas:o,headers:e.headers}),body:this.transformRequestBody(a),failedResponseHandler:Eg,successfulResponseHandler:er(jk),abortSignal:e.abortSignal,fetch:this.config.fetch}),l="unknown",d={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},v={},y,p,m=this.generateId;return{stream:c.pipeThrough(new TransformStream({start(f){f.enqueue({type:"stream-start",warnings:n})},transform(f,g){var b,D,$,_,P,O,S;if(e.includeRawChunks&&g.enqueue({type:"raw",rawValue:f.rawValue}),!f.success){g.enqueue({type:"error",error:f.error});return}let k=f.value;switch(k.type){case"ping":return;case"content_block_start":{let Z=k.content_block.type;switch(p=Z,Z){case"text":{v[k.index]={type:"text"},g.enqueue({type:"text-start",id:String(k.index)});return}case"thinking":{v[k.index]={type:"reasoning"},g.enqueue({type:"reasoning-start",id:String(k.index)});return}case"redacted_thinking":{v[k.index]={type:"reasoning"},g.enqueue({type:"reasoning-start",id:String(k.index),providerMetadata:{anthropic:{redactedData:k.content_block.data}}});return}case"tool_use":{v[k.index]=r?{type:"text"}:{type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:""},g.enqueue(r?{type:"text-start",id:String(k.index)}:{type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name});return}case"server_tool_use":{(k.content_block.name==="web_search"||k.content_block.name==="code_execution")&&(v[k.index]={type:"tool-call",toolCallId:k.content_block.id,toolName:k.content_block.name,input:"",providerExecuted:!0},g.enqueue({type:"tool-input-start",id:k.content_block.id,toolName:k.content_block.name,providerExecuted:!0}));return}case"web_search_tool_result":{let z=k.content_block;if(Array.isArray(z.content)){g.enqueue({type:"tool-result",toolCallId:z.tool_use_id,toolName:"web_search",result:z.content.map(U=>{var te;return{url:U.url,title:U.title,pageAge:(te=U.page_age)!=null?te:null,encryptedContent:U.encrypted_content,type:U.type}}),providerExecuted:!0});for(let U of z.content)g.enqueue({type:"source",sourceType:"url",id:m(),url:U.url,title:U.title,providerMetadata:{anthropic:{pageAge:(b=U.page_age)!=null?b:null}}})}else g.enqueue({type:"tool-result",toolCallId:z.tool_use_id,toolName:"web_search",isError:!0,result:{type:"web_search_tool_result_error",errorCode:z.content.error_code},providerExecuted:!0});return}case"code_execution_tool_result":{let z=k.content_block;z.content.type==="code_execution_result"?g.enqueue({type:"tool-result",toolCallId:z.tool_use_id,toolName:"code_execution",result:{type:z.content.type,stdout:z.content.stdout,stderr:z.content.stderr,return_code:z.content.return_code},providerExecuted:!0}):z.content.type==="code_execution_tool_result_error"&&g.enqueue({type:"tool-result",toolCallId:z.tool_use_id,toolName:"code_execution",isError:!0,result:{type:"code_execution_tool_result_error",errorCode:z.content.error_code},providerExecuted:!0});return}default:{let z=Z;throw new Error(`Unsupported content block type: ${z}`)}}}case"content_block_stop":{if(v[k.index]!=null){let Z=v[k.index];switch(Z.type){case"text":{g.enqueue({type:"text-end",id:String(k.index)});break}case"reasoning":{g.enqueue({type:"reasoning-end",id:String(k.index)});break}case"tool-call":r||(g.enqueue({type:"tool-input-end",id:Z.toolCallId}),g.enqueue(Z));break}delete v[k.index]}p=void 0;return}case"content_block_delta":{let Z=k.delta.type;switch(Z){case"text_delta":{if(r)return;g.enqueue({type:"text-delta",id:String(k.index),delta:k.delta.text});return}case"thinking_delta":{g.enqueue({type:"reasoning-delta",id:String(k.index),delta:k.delta.thinking});return}case"signature_delta":{p==="thinking"&&g.enqueue({type:"reasoning-delta",id:String(k.index),delta:"",providerMetadata:{anthropic:{signature:k.delta.signature}}});return}case"input_json_delta":{let z=v[k.index],U=k.delta.partial_json;if(r){if(z?.type!=="text")return;g.enqueue({type:"text-delta",id:String(k.index),delta:U})}else{if(z?.type!=="tool-call")return;g.enqueue({type:"tool-input-delta",id:z.toolCallId,delta:U}),z.input+=U}return}case"citations_delta":{let z=k.delta.citation;Ag(z,i,m,U=>g.enqueue(U));return}default:{let z=Z;throw new Error(`Unsupported delta type: ${z}`)}}}case"message_start":{d.inputTokens=k.message.usage.input_tokens,d.cachedInputTokens=(D=k.message.usage.cache_read_input_tokens)!=null?D:void 0,y={anthropic:{usage:k.message.usage,cacheCreationInputTokens:($=k.message.usage.cache_creation_input_tokens)!=null?$:null}},g.enqueue({type:"response-metadata",id:(_=k.message.id)!=null?_:void 0,modelId:(P=k.message.model)!=null?P:void 0});return}case"message_delta":{d.outputTokens=k.usage.output_tokens,d.totalTokens=((O=d.inputTokens)!=null?O:0)+((S=k.usage.output_tokens)!=null?S:0),l=Cg({finishReason:k.delta.stop_reason,isJsonResponseFromTool:r});return}case"message_stop":{g.enqueue({type:"finish",finishReason:l,usage:d,providerMetadata:y});return}case"error":{g.enqueue({type:"error",error:k.error});return}default:{let Z=k;throw new Error(`Unsupported chunk type: ${Z}`)}}}})),request:{body:a},response:{headers:u}}}},Ok=s.object({type:s.literal("message"),id:s.string().nullish(),model:s.string().nullish(),content:s.array(s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string(),citations:s.array(Pg).optional()}),s.object({type:s.literal("thinking"),thinking:s.string(),signature:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string(),input:s.unknown()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])),stop_reason:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})}),jk=s.discriminatedUnion("type",[s.object({type:s.literal("message_start"),message:s.object({id:s.string().nullish(),model:s.string().nullish(),usage:s.looseObject({input_tokens:s.number(),output_tokens:s.number(),cache_creation_input_tokens:s.number().nullish(),cache_read_input_tokens:s.number().nullish()})})}),s.object({type:s.literal("content_block_start"),index:s.number(),content_block:s.discriminatedUnion("type",[s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("thinking"),thinking:s.string()}),s.object({type:s.literal("tool_use"),id:s.string(),name:s.string()}),s.object({type:s.literal("redacted_thinking"),data:s.string()}),s.object({type:s.literal("server_tool_use"),id:s.string(),name:s.string(),input:s.record(s.string(),s.unknown()).nullish()}),s.object({type:s.literal("web_search_tool_result"),tool_use_id:s.string(),content:s.union([s.array(s.object({type:s.literal("web_search_result"),url:s.string(),title:s.string(),encrypted_content:s.string(),page_age:s.string().nullish()})),s.object({type:s.literal("web_search_tool_result_error"),error_code:s.string()})])}),s.object({type:s.literal("code_execution_tool_result"),tool_use_id:s.string(),content:s.union([s.object({type:s.literal("code_execution_result"),stdout:s.string(),stderr:s.string(),return_code:s.number()}),s.object({type:s.literal("code_execution_tool_result_error"),error_code:s.string()})])})])}),s.object({type:s.literal("content_block_delta"),index:s.number(),delta:s.discriminatedUnion("type",[s.object({type:s.literal("input_json_delta"),partial_json:s.string()}),s.object({type:s.literal("text_delta"),text:s.string()}),s.object({type:s.literal("thinking_delta"),thinking:s.string()}),s.object({type:s.literal("signature_delta"),signature:s.string()}),s.object({type:s.literal("citations_delta"),citation:Pg})])}),s.object({type:s.literal("content_block_stop"),index:s.number()}),s.object({type:s.literal("error"),error:s.object({type:s.string(),message:s.string()})}),s.object({type:s.literal("message_delta"),delta:s.object({stop_reason:s.string().nullish()}),usage:s.object({output_tokens:s.number()})}),s.object({type:s.literal("message_stop")}),s.object({type:s.literal("ping")})]),Pk=s.object({signature:s.string().optional(),redactedData:s.string().optional()}),Nk=Ue({id:"anthropic.bash_20241022",name:"bash",inputSchema:Ht.object({command:Ht.string(),restart:Ht.boolean().optional()})}),zk=Ue({id:"anthropic.bash_20250124",name:"bash",inputSchema:Ht.object({command:Ht.string(),restart:Ht.boolean().optional()})}),Rk=Ue({id:"anthropic.computer_20241022",name:"computer",inputSchema:s.object({action:s.enum(["key","type","mouse_move","left_click","left_click_drag","right_click","middle_click","double_click","screenshot","cursor_position"]),coordinate:s.array(s.number().int()).optional(),text:s.string().optional()})}),Fk=Ue({id:"anthropic.computer_20250124",name:"computer",inputSchema:s.object({action:s.enum(["key","hold_key","type","cursor_position","mouse_move","left_mouse_down","left_mouse_up","left_click","left_click_drag","right_click","middle_click","double_click","triple_click","scroll","wait","screenshot"]),coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),duration:s.number().optional(),scroll_amount:s.number().optional(),scroll_direction:s.enum(["up","down","left","right"]).optional(),start_coordinate:s.tuple([s.number().int(),s.number().int()]).optional(),text:s.string().optional()})}),Mk=Ue({id:"anthropic.text_editor_20241022",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Uk=Ue({id:"anthropic.text_editor_20250124",name:"str_replace_editor",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert","undo_edit"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Zk=Ue({id:"anthropic.text_editor_20250429",name:"str_replace_based_edit_tool",inputSchema:s.object({command:s.enum(["view","create","str_replace","insert"]),path:s.string(),file_text:s.string().optional(),insert_line:s.number().int().optional(),new_str:s.string().optional(),old_str:s.string().optional(),view_range:s.array(s.number().int()).optional()})}),Lk={bash_20241022:Nk,bash_20250124:zk,codeExecution_20250522:Sk,computer_20241022:Rk,computer_20250124:Fk,textEditor_20241022:Mk,textEditor_20250124:Uk,textEditor_20250429:Zk,webSearch_20250305:Dk};function od(e={}){var t;let n=(t=Kr(e.baseURL))!=null?t:"https://api.anthropic.com/v1",o=()=>({"anthropic-version":"2023-06-01","x-api-key":gg({apiKey:e.apiKey,environmentVariableName:"ANTHROPIC_API_KEY",description:"Anthropic"}),...e.headers}),r=a=>{var u;return new Ak(a,{provider:"anthropic.messages",baseURL:n,headers:o,fetch:e.fetch,generateId:(u=e.generateId)!=null?u:ut,supportedUrls:()=>({"image/*":[/^https?:\/\/.*$/]})})},i=function(a){if(new.target)throw new Error("The Anthropic model function cannot be called with the new keyword.");return r(a)};return i.languageModel=r,i.chat=r,i.messages=r,i.textEmbeddingModel=a=>{throw new gn({modelId:a,modelType:"textEmbeddingModel"})},i.imageModel=a=>{throw new gn({modelId:a,modelType:"imageModel"})},i.tools=Lk,i}var IP=od();var Bk="vercel.ai.gateway.error",id=Symbol.for(Bk),Ng,zg,Ge=class nh extends(zg=Error,Ng=id,zg){constructor({message:t,statusCode:n=500,cause:o}){super(t),this[Ng]=!0,this.statusCode=n,this.cause=o}static isInstance(t){return nh.hasMarker(t)}static hasMarker(t){return typeof t=="object"&&t!==null&&id in t&&t[id]===!0}},oh="GatewayAuthenticationError",qk=`vercel.ai.gateway.error.${oh}`,Rg=Symbol.for(qk),Fg,Mg,ko=class ih extends(Mg=Ge,Fg=Rg,Mg){constructor({message:t="Authentication failed",statusCode:n=401,cause:o}={}){super({message:t,statusCode:n,cause:o}),this[Fg]=!0,this.name=oh,this.type="authentication_error"}static isInstance(t){return Ge.hasMarker(t)&&Rg in t}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:o="Authentication failed",statusCode:r=401,cause:i}){let a;return t?a=`AI Gateway authentication failed: Invalid API key provided.
51
+
52
+ The token is expected to be provided via the 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:n?a=`AI Gateway authentication failed: Invalid OIDC token provided.
53
+
54
+ The token is expected to be provided via the 'VERCEL_OIDC_TOKEN' environment variable. It expires every 12 hours.
55
+ - make sure your Vercel project settings have OIDC enabled
56
+ - if running locally with 'vercel dev', the token is automatically obtained and refreshed
57
+ - if running locally with your own dev server, run 'vercel env pull' to fetch the token
58
+ - in production/preview, the token is automatically obtained and refreshed
59
+
60
+ Alternative: Provide an API key via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:a=`AI Gateway authentication failed: No authentication provided.
61
+
62
+ Provide either an API key or OIDC token.
63
+
64
+ API key instructions:
65
+
66
+ The token is expected to be provided via the 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.
67
+
68
+ OIDC token instructions:
69
+
70
+ The token is expected to be provided via the 'VERCEL_OIDC_TOKEN' environment variable. It expires every 12 hours.
71
+ - make sure your Vercel project settings have OIDC enabled
72
+ - if running locally with 'vercel dev', the token is automatically obtained and refreshed
73
+ - if running locally with your own dev server, run 'vercel env pull' to fetch the token
74
+ - in production/preview, the token is automatically obtained and refreshed`,new ih({message:a,statusCode:r,cause:i})}},ah="GatewayInvalidRequestError",Vk=`vercel.ai.gateway.error.${ah}`,Ug=Symbol.for(Vk),Zg,Lg,Jk=class extends(Lg=Ge,Zg=Ug,Lg){constructor({message:e="Invalid request",statusCode:t=400,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Zg]=!0,this.name=ah,this.type="invalid_request_error"}static isInstance(e){return Ge.hasMarker(e)&&Ug in e}},sh="GatewayRateLimitError",Gk=`vercel.ai.gateway.error.${sh}`,Bg=Symbol.for(Gk),qg,Vg,Wk=class extends(Vg=Ge,qg=Bg,Vg){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[qg]=!0,this.name=sh,this.type="rate_limit_exceeded"}static isInstance(e){return Ge.hasMarker(e)&&Bg in e}},uh="GatewayModelNotFoundError",Kk=`vercel.ai.gateway.error.${uh}`,Jg=Symbol.for(Kk),Hk=s.object({modelId:s.string()}),Gg,Wg,ad=class extends(Wg=Ge,Gg=Jg,Wg){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:o}={}){super({message:e,statusCode:t,cause:o}),this[Gg]=!0,this.name=uh,this.type="model_not_found",this.modelId=n}static isInstance(e){return Ge.hasMarker(e)&&Jg in e}},lh="GatewayInternalServerError",Yk=`vercel.ai.gateway.error.${lh}`,Kg=Symbol.for(Yk),Hg,Yg,Xg=class extends(Yg=Ge,Hg=Kg,Yg){constructor({message:e="Internal server error",statusCode:t=500,cause:n}={}){super({message:e,statusCode:t,cause:n}),this[Hg]=!0,this.name=lh,this.type="internal_server_error"}static isInstance(e){return Ge.hasMarker(e)&&Kg in e}},ch="GatewayResponseError",Xk=`vercel.ai.gateway.error.${ch}`,Qg=Symbol.for(Xk),eh,th,Qk=class extends(th=Ge,eh=Qg,th){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:o,cause:r}={}){super({message:e,statusCode:t,cause:r}),this[eh]=!0,this.name=ch,this.type="response_error",this.response=n,this.validationError=o}static isInstance(e){return Ge.hasMarker(e)&&Qg in e}};function rh({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:o,authMethod:r}){let i=e$.safeParse(e);if(!i.success)return new Qk({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:i.error,cause:o});let a=i.data,u=a.error.type,c=a.error.message;switch(u){case"authentication_error":return ko.createContextualError({apiKeyProvided:r==="api-key",oidcTokenProvided:r==="oidc",statusCode:t,cause:o});case"invalid_request_error":return new Jk({message:c,statusCode:t,cause:o});case"rate_limit_exceeded":return new Wk({message:c,statusCode:t,cause:o});case"model_not_found":{let l=Hk.safeParse(a.error.param);return new ad({message:c,statusCode:t,modelId:l.success?l.data.modelId:void 0,cause:o})}case"internal_server_error":return new Xg({message:c,statusCode:t,cause:o});default:return new Xg({message:c,statusCode:t,cause:o})}}var e$=s.object({error:s.object({message:s.string(),type:s.string().nullish(),param:s.unknown().nullish(),code:s.union([s.string(),s.number()]).nullish()})});function wo(e,t){var n;return Ge.isInstance(e)?e:le.isInstance(e)?rh({response:t$(e),statusCode:(n=e.statusCode)!=null?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):rh({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}function t$(e){if(e.data!==void 0)return e.data;if(e.responseBody!=null)try{return JSON.parse(e.responseBody)}catch{return e.responseBody}return{}}var dh="ai-gateway-auth-method";function ua(e){let t=r$.safeParse(e[dh]);return t.success?t.data:void 0}var r$=s.union([s.literal("api-key"),s.literal("oidc")]),n$=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await mg({url:`${this.config.baseURL}/config`,headers:await Qe(this.config.headers()),successfulResponseHandler:Se(s$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:t=>t}),fetch:this.config.fetch});return e}catch(e){throw wo(e)}}},o$=s.object({specificationVersion:s.literal("v2"),provider:s.string(),modelId:s.string()}),i$=s.object({input:s.string(),output:s.string(),input_cache_read:s.string().nullish(),input_cache_write:s.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:o})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...o?{cacheCreationInputTokens:o}:{}})),a$=s.object({id:s.string(),name:s.string(),description:s.string().nullish(),pricing:i$.nullish(),specification:o$,modelType:s.enum(["language","embedding","image"]).nullish()}),s$=s.object({models:s.array(a$)}),u$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await Qe(this.config.headers());try{let{responseHeaders:i,value:a,rawValue:u}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!1),await Qe(this.config.o11yHeaders)),body:t,successfulResponseHandler:Se(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:c=>c}),...o&&{abortSignal:o},fetch:this.config.fetch});return{...a,request:{body:t},response:{headers:i,body:u},warnings:n}}catch(i){throw wo(i,ua(r))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:o}=e,r=await Qe(this.config.headers());try{let{value:i,responseHeaders:a}=await be({url:this.getUrl(),headers:we(r,e.headers,this.getModelConfigHeaders(this.modelId,!0),await Qe(this.config.o11yHeaders)),body:t,successfulResponseHandler:er(s.any()),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:u=>u}),...o&&{abortSignal:o},fetch:this.config.fetch});return{stream:i.pipeThrough(new TransformStream({start(u){n.length>0&&u.enqueue({type:"stream-start",warnings:n})},transform(u,c){if(u.success){let l=u.value;if(l.type==="raw"&&!e.includeRawChunks)return;l.type==="response-metadata"&&l.timestamp&&typeof l.timestamp=="string"&&(l.timestamp=new Date(l.timestamp)),c.enqueue(l)}else c.error(u.error)}})),request:{body:t},response:{headers:a}}}catch(i){throw wo(i,ua(r))}}isFilePart(e){return e&&typeof e=="object"&&"type"in e&&e.type==="file"}maybeEncodeFileParts(e){for(let t of e.prompt)for(let n of t.content)if(this.isFilePart(n)){let o=n;if(o.data instanceof Uint8Array){let r=Uint8Array.from(o.data),i=Buffer.from(r).toString("base64");o.data=new URL(`data:${o.mediaType||"application/octet-stream"};base64,${i}`)}}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"2","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},l$=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v2",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:o}){var r;let i=await Qe(this.config.headers());try{let{responseHeaders:a,value:u,rawValue:c}=await be({url:this.getUrl(),headers:we(i,t??{},this.getModelConfigHeaders(),await Qe(this.config.o11yHeaders)),body:{input:e.length===1?e[0]:e,...o?{providerOptions:o}:{}},successfulResponseHandler:Se(c$),failedResponseHandler:ke({errorSchema:s.any(),errorToMessage:l=>l}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:u.embeddings,usage:(r=u.usage)!=null?r:void 0,providerMetadata:u.providerMetadata,response:{headers:a,body:c}}}catch(a){throw wo(a,ua(i))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"2","ai-model-id":this.modelId}}},c$=s.object({embeddings:s.array(s.array(s.number())),usage:s.object({tokens:s.number()}).nullish(),providerMetadata:s.record(s.string(),s.record(s.string(),s.unknown())).optional()});async function d$(){var e,t;let n=(t=(e=ph().headers)==null?void 0:e["x-vercel-oidc-token"])!=null?t:process.env.VERCEL_OIDC_TOKEN;if(!n)throw new ko({message:"OIDC token not available",statusCode:401});return n}async function p$(){var e;return(e=ph().headers)==null?void 0:e["x-vercel-id"]}var m$=Symbol.for("@vercel/request-context");function ph(){var e,t,n;return(n=(t=(e=globalThis[m$])==null?void 0:e.get)==null?void 0:t.call(e))!=null?n:{}}var f$="0.0.1";function g$(e={}){var t,n;let o=null,r=null,i=(t=e.metadataCacheRefreshMillis)!=null?t:1e3*60*5,a=0,u=(n=Kr(e.baseURL))!=null?n:"https://ai-gateway.vercel.sh/v1/ai",c=async()=>{let p=await h$(e);if(p)return{Authorization:`Bearer ${p.token}`,"ai-gateway-protocol-version":f$,[dh]:p.authMethod,...e.headers};throw ko.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401})},l=()=>{let p=yo({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),m=yo({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),f=yo({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{let g=await p$();return{...p&&{"ai-o11y-deployment-id":p},...m&&{"ai-o11y-environment":m},...f&&{"ai-o11y-region":f},...g&&{"ai-o11y-request-id":g}}}},d=p=>new u$(p,{provider:"gateway",baseURL:u,headers:c,fetch:e.fetch,o11yHeaders:l()}),v=async()=>{var p,m,f;let g=(f=(m=(p=e._internal)==null?void 0:p.currentDate)==null?void 0:m.call(p).getTime())!=null?f:Date.now();return(!o||g-a>i)&&(a=g,o=new n$({baseURL:u,headers:c,fetch:e.fetch}).getAvailableModels().then(b=>(r=b,b)).catch(async b=>{throw wo(b,ua(await c()))})),r?Promise.resolve(r):o},y=function(p){if(new.target)throw new Error("The Gateway Provider model function cannot be called with the new keyword.");return d(p)};return y.getAvailableModels=v,y.imageModel=p=>{throw new gn({modelId:p,modelType:"imageModel"})},y.languageModel=d,y.textEmbeddingModel=p=>new l$(p,{provider:"gateway",baseURL:u,headers:c,fetch:e.fetch,o11yHeaders:l()}),y}var mh=g$();async function h$(e){let t=yo({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});if(t)return{token:t,authMethod:"api-key"};try{return{token:await d$(),authMethod:"oidc"}}catch{return null}}var fh=typeof globalThis=="object"?globalThis:global;var Ft="1.9.0";var gh=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function v$(e){var t=new Set([e]),n=new Set,o=e.match(gh);if(!o)return function(){return!1};var r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(c){return c===e};function i(u){return n.add(u),!1}function a(u){return t.add(u),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;var l=c.match(gh);if(!l)return i(c);var d={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return d.prerelease!=null||r.major!==d.major?i(c):r.major===0?r.minor===d.minor&&r.patch<=d.patch?a(c):i(c):r.minor<=d.minor?a(c):i(c)}}var hh=v$(Ft);var y$=Ft.split(".")[0],$o=Symbol.for("opentelemetry.js.api."+y$),So=fh;function Hr(e,t,n,o){var r;o===void 0&&(o=!1);var i=So[$o]=(r=So[$o])!==null&&r!==void 0?r:{version:Ft};if(!o&&i[e]){var a=new Error("@opentelemetry/api: Attempted duplicate registration of API: "+e);return n.error(a.stack||a.message),!1}if(i.version!==Ft){var a=new Error("@opentelemetry/api: Registration of version v"+i.version+" for "+e+" does not match previously registered API v"+Ft);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug("@opentelemetry/api: Registered a global for "+e+" v"+Ft+"."),!0}function Mt(e){var t,n,o=(t=So[$o])===null||t===void 0?void 0:t.version;if(!(!o||!hh(o)))return(n=So[$o])===null||n===void 0?void 0:n[e]}function Yr(e,t){t.debug("@opentelemetry/api: Unregistering a global for "+e+" v"+Ft+".");var n=So[$o];n&&delete n[e]}var b$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},_$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},vh=(function(){function e(t){this._namespace=t.namespace||"DiagComponentLogger"}return e.prototype.debug=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Io("debug",this._namespace,t)},e.prototype.error=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Io("error",this._namespace,t)},e.prototype.info=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Io("info",this._namespace,t)},e.prototype.warn=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Io("warn",this._namespace,t)},e.prototype.verbose=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Io("verbose",this._namespace,t)},e})();function Io(e,t,n){var o=Mt("diag");if(o)return n.unshift(t),o[e].apply(o,_$([],b$(n),!1))}var je;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(je||(je={}));function yh(e,t){e<je.NONE?e=je.NONE:e>je.ALL&&(e=je.ALL),t=t||{};function n(o,r){var i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",je.ERROR),warn:n("warn",je.WARN),info:n("info",je.INFO),debug:n("debug",je.DEBUG),verbose:n("verbose",je.VERBOSE)}}var x$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},D$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},w$="diag",Xr=(function(){function e(){function t(r){return function(){for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var u=Mt("diag");if(u)return u[r].apply(u,D$([],x$(i),!1))}}var n=this,o=function(r,i){var a,u,c;if(i===void 0&&(i={logLevel:je.INFO}),r===n){var l=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=l.stack)!==null&&a!==void 0?a:l.message),!1}typeof i=="number"&&(i={logLevel:i});var d=Mt("diag"),v=yh((u=i.logLevel)!==null&&u!==void 0?u:je.INFO,r);if(d&&!i.suppressOverrideMessage){var y=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";d.warn("Current logger will be overwritten from "+y),v.warn("Current logger will overwrite one already registered from "+y)}return Hr("diag",v,n,!0)};n.setLogger=o,n.disable=function(){Yr(w$,n)},n.createComponentLogger=function(r){return new vh(r)},n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}return e.instance=function(){return this._instance||(this._instance=new e),this._instance},e})();function bh(e){return Symbol.for(e)}var k$=(function(){function e(t){var n=this;n._currentContext=t?new Map(t):new Map,n.getValue=function(o){return n._currentContext.get(o)},n.setValue=function(o,r){var i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=function(o){var r=new e(n._currentContext);return r._currentContext.delete(o),r}}return e})(),_h=new k$;var $$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},S$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},xh=(function(){function e(){}return e.prototype.active=function(){return _h},e.prototype.with=function(t,n,o){for(var r=[],i=3;i<arguments.length;i++)r[i-3]=arguments[i];return n.call.apply(n,S$([o],$$(r),!1))},e.prototype.bind=function(t,n){return n},e.prototype.enable=function(){return this},e.prototype.disable=function(){return this},e})();var I$=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var o=n.call(e),r,i=[],a;try{for(;(t===void 0||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(u){a={error:u}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},E$=function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))},sd="context",T$=new xh,la=(function(){function e(){}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalContextManager=function(t){return Hr(sd,t,Xr.instance())},e.prototype.active=function(){return this._getContextManager().active()},e.prototype.with=function(t,n,o){for(var r,i=[],a=3;a<arguments.length;a++)i[a-3]=arguments[a];return(r=this._getContextManager()).with.apply(r,E$([t,n,o],I$(i),!1))},e.prototype.bind=function(t,n){return this._getContextManager().bind(t,n)},e.prototype._getContextManager=function(){return Mt(sd)||T$},e.prototype.disable=function(){this._getContextManager().disable(),Yr(sd,Xr.instance())},e})();var ca;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ca||(ca={}));var ud="0000000000000000",ld="00000000000000000000000000000000",Dh={traceId:ld,spanId:ud,traceFlags:ca.NONE};var rr=(function(){function e(t){t===void 0&&(t=Dh),this._spanContext=t}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(t,n){return this},e.prototype.setAttributes=function(t){return this},e.prototype.addEvent=function(t,n){return this},e.prototype.addLink=function(t){return this},e.prototype.addLinks=function(t){return this},e.prototype.setStatus=function(t){return this},e.prototype.updateName=function(t){return this},e.prototype.end=function(t){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(t,n){},e})();var cd=bh("OpenTelemetry Context Key SPAN");function da(e){return e.getValue(cd)||void 0}function wh(){return da(la.getInstance().active())}function Eo(e,t){return e.setValue(cd,t)}function kh(e){return e.deleteValue(cd)}function $h(e,t){return Eo(e,new rr(t))}function pa(e){var t;return(t=da(e))===null||t===void 0?void 0:t.spanContext()}var C$=/^([0-9a-f]{32})$/i,A$=/^[0-9a-f]{16}$/i;function O$(e){return C$.test(e)&&e!==ld}function j$(e){return A$.test(e)&&e!==ud}function ma(e){return O$(e.traceId)&&j$(e.spanId)}function Sh(e){return new rr(e)}var dd=la.getInstance(),fa=(function(){function e(){}return e.prototype.startSpan=function(t,n,o){o===void 0&&(o=dd.active());var r=!!n?.root;if(r)return new rr;var i=o&&pa(o);return P$(i)&&ma(i)?new rr(i):new rr},e.prototype.startActiveSpan=function(t,n,o,r){var i,a,u;if(!(arguments.length<2)){arguments.length===2?u=n:arguments.length===3?(i=n,u=o):(i=n,a=o,u=r);var c=a??dd.active(),l=this.startSpan(t,i,c),d=Eo(c,l);return dd.with(d,u,void 0,l)}},e})();function P$(e){return typeof e=="object"&&typeof e.spanId=="string"&&typeof e.traceId=="string"&&typeof e.traceFlags=="number"}var N$=new fa,Ih=(function(){function e(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}return e.prototype.startSpan=function(t,n,o){return this._getTracer().startSpan(t,n,o)},e.prototype.startActiveSpan=function(t,n,o,r){var i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):N$},e})();var Eh=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){return new fa},e})();var z$=new Eh,pd=(function(){function e(){}return e.prototype.getTracer=function(t,n,o){var r;return(r=this.getDelegateTracer(t,n,o))!==null&&r!==void 0?r:new Ih(this,t,n,o)},e.prototype.getDelegate=function(){var t;return(t=this._delegate)!==null&&t!==void 0?t:z$},e.prototype.setDelegate=function(t){this._delegate=t},e.prototype.getDelegateTracer=function(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(t,n,o)},e})();var Qr;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(Qr||(Qr={}));var md="trace",Th=(function(){function e(){this._proxyTracerProvider=new pd,this.wrapSpanContext=Sh,this.isSpanContextValid=ma,this.deleteSpan=kh,this.getSpan=da,this.getActiveSpan=wh,this.getSpanContext=pa,this.setSpan=Eo,this.setSpanContext=$h}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(t){var n=Hr(md,this._proxyTracerProvider,Xr.instance());return n&&this._proxyTracerProvider.setDelegate(t),n},e.prototype.getTracerProvider=function(){return Mt(md)||this._proxyTracerProvider},e.prototype.getTracer=function(t,n){return this.getTracerProvider().getTracer(t,n)},e.prototype.disable=function(){Yr(md,Xr.instance()),this._proxyTracerProvider=new pd},e})();var fd=Th.getInstance();var R$=Object.defineProperty,F$=(e,t)=>{for(var n in t)R$(e,n,{get:t[n],enumerable:!0})},Mh="AI_NoOutputSpecifiedError",Uh=`vercel.ai.error.${Mh}`,M$=Symbol.for(Uh),Zh,U$=class extends M{constructor({message:e="No output specified."}={}){super({name:Mh,message:e}),this[Zh]=!0}static isInstance(e){return M.hasMarker(e,Uh)}};Zh=M$;function Z$(e){let t="AI SDK Warning:";switch(e.type){case"unsupported-setting":{let n=`${t} The "${e.setting}" setting is not supported by this model`;return e.details&&(n+=` - ${e.details}`),n}case"unsupported-tool":{let n="name"in e.tool?e.tool.name:"unknown tool",o=`${t} The tool "${n}" is not supported by this model`;return e.details&&(o+=` - ${e.details}`),o}case"other":return`${t} ${e.message}`;default:return`${t} ${JSON.stringify(e,null,2)}`}}var L$="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",Ch=!1,B$=e=>{if(e.length===0)return;let t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}Ch||(Ch=!0,console.info(L$));for(let n of e)console.warn(Z$(n))}},Lh="AI_InvalidArgumentError",Bh=`vercel.ai.error.${Lh}`,q$=Symbol.for(Bh),qh,bt=class extends M{constructor({parameter:e,value:t,message:n}){super({name:Lh,message:`Invalid argument for parameter ${e}: ${n}`}),this[qh]=!0,this.parameter=e,this.value=t}static isInstance(e){return M.hasMarker(e,Bh)}};qh=q$;var V$="AI_InvalidStreamPartError",J$=`vercel.ai.error.${V$}`,G$=Symbol.for(J$),W$;W$=G$;var Vh="AI_InvalidToolInputError",Jh=`vercel.ai.error.${Vh}`,K$=Symbol.for(Jh),Gh,Wh=class extends M{constructor({toolInput:e,toolName:t,cause:n,message:o=`Invalid input for tool ${t}: ${ft(n)}`}){super({name:Vh,message:o,cause:n}),this[Gh]=!0,this.toolInput=e,this.toolName=t}static isInstance(e){return M.hasMarker(e,Jh)}};Gh=K$;var H$="AI_MCPClientError",Y$=`vercel.ai.error.${H$}`,X$=Symbol.for(Y$),Q$;Q$=X$;var eS="AI_NoImageGeneratedError",tS=`vercel.ai.error.${eS}`,rS=Symbol.for(tS),nS;nS=rS;var Kh="AI_NoObjectGeneratedError",Hh=`vercel.ai.error.${Kh}`,oS=Symbol.for(Hh),Yh,Ah=class extends M{constructor({message:e="No object generated.",cause:t,text:n,response:o,usage:r,finishReason:i}){super({name:Kh,message:e,cause:t}),this[Yh]=!0,this.text=n,this.response=o,this.usage=r,this.finishReason=i}static isInstance(e){return M.hasMarker(e,Hh)}};Yh=oS;var Xh="AI_NoOutputGeneratedError",Qh=`vercel.ai.error.${Xh}`,iS=Symbol.for(Qh),ev,aS=class extends M{constructor({message:e="No output generated.",cause:t}={}){super({name:Xh,message:e,cause:t}),this[ev]=!0}static isInstance(e){return M.hasMarker(e,Qh)}};ev=iS;var tv="AI_NoSuchToolError",rv=`vercel.ai.error.${tv}`,sS=Symbol.for(rv),nv,yd=class extends M{constructor({toolName:e,availableTools:t=void 0,message:n=`Model tried to call unavailable tool '${e}'. ${t===void 0?"No tools are available.":`Available tools: ${t.join(", ")}.`}`}){super({name:tv,message:n}),this[nv]=!0,this.toolName=e,this.availableTools=t}static isInstance(e){return M.hasMarker(e,rv)}};nv=sS;var ov="AI_ToolCallRepairError",iv=`vercel.ai.error.${ov}`,uS=Symbol.for(iv),av,lS=class extends M{constructor({cause:e,originalError:t,message:n=`Error repairing tool call: ${ft(e)}`}){super({name:ov,message:n,cause:e}),this[av]=!0,this.originalError=t}static isInstance(e){return M.hasMarker(e,iv)}};av=uS;var cS=class extends M{constructor(e){super({name:"AI_UnsupportedModelVersionError",message:`Unsupported model version ${e.version} for provider "${e.provider}" and model "${e.modelId}". AI SDK 5 only supports models that implement specification version "v2".`}),this.version=e.version,this.provider=e.provider,this.modelId=e.modelId}},dS="AI_InvalidDataContentError",pS=`vercel.ai.error.${dS}`,mS=Symbol.for(pS),fS;fS=mS;var sv="AI_InvalidMessageRoleError",uv=`vercel.ai.error.${sv}`,gS=Symbol.for(uv),lv,hS=class extends M{constructor({role:e,message:t=`Invalid message role: '${e}'. Must be one of: "system", "user", "assistant", "tool".`}){super({name:sv,message:t}),this[lv]=!0,this.role=e}static isInstance(e){return M.hasMarker(e,uv)}};lv=gS;var vS="AI_MessageConversionError",yS=`vercel.ai.error.${vS}`,bS=Symbol.for(yS),_S;_S=bS;var cv="AI_DownloadError",dv=`vercel.ai.error.${cv}`,xS=Symbol.for(dv),pv,gd=class extends M{constructor({url:e,statusCode:t,statusText:n,cause:o,message:r=o==null?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${o}`}){super({name:cv,message:r,cause:o}),this[pv]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return M.hasMarker(e,dv)}};pv=xS;var mv="AI_RetryError",fv=`vercel.ai.error.${mv}`,DS=Symbol.for(fv),gv,Oh=class extends M{constructor({message:e,reason:t,errors:n}){super({name:mv,message:e}),this[gv]=!0,this.reason=t,this.errors=n,this.lastError=n[n.length-1]}static isInstance(e){return M.hasMarker(e,fv)}};gv=DS;function hv(e){if(typeof e!="string"){if(e.specificationVersion!=="v2")throw new cS({version:e.specificationVersion,provider:e.provider,modelId:e.modelId});return e}return wS().languageModel(e)}function wS(){var e;return(e=globalThis.AI_SDK_DEFAULT_PROVIDER)!=null?e:mh}var kS=[{mediaType:"image/gif",bytesPrefix:[71,73,70],base64Prefix:"R0lG"},{mediaType:"image/png",bytesPrefix:[137,80,78,71],base64Prefix:"iVBORw"},{mediaType:"image/jpeg",bytesPrefix:[255,216],base64Prefix:"/9j/"},{mediaType:"image/webp",bytesPrefix:[82,73,70,70],base64Prefix:"UklGRg"},{mediaType:"image/bmp",bytesPrefix:[66,77],base64Prefix:"Qk"},{mediaType:"image/tiff",bytesPrefix:[73,73,42,0],base64Prefix:"SUkqAA"},{mediaType:"image/tiff",bytesPrefix:[77,77,0,42],base64Prefix:"TU0AKg"},{mediaType:"image/avif",bytesPrefix:[0,0,0,32,102,116,121,112,97,118,105,102],base64Prefix:"AAAAIGZ0eXBhdmlm"},{mediaType:"image/heic",bytesPrefix:[0,0,0,32,102,116,121,112,104,101,105,99],base64Prefix:"AAAAIGZ0eXBoZWlj"}];var $S=e=>{let t=typeof e=="string"?bo(e):e,n=(t[6]&127)<<21|(t[7]&127)<<14|(t[8]&127)<<7|t[9]&127;return t.slice(n+10)};function SS(e){return typeof e=="string"&&e.startsWith("SUQz")||typeof e!="string"&&e.length>10&&e[0]===73&&e[1]===68&&e[2]===51?$S(e):e}function IS({data:e,signatures:t}){let n=SS(e);for(let o of t)if(typeof n=="string"?n.startsWith(o.base64Prefix):n.length>=o.bytesPrefix.length&&o.bytesPrefix.every((r,i)=>n[i]===r))return o.mediaType}var ES=async({url:e})=>{var t;let n=e.toString();try{let o=await fetch(n);if(!o.ok)throw new gd({url:n,statusCode:o.status,statusText:o.statusText});return{data:new Uint8Array(await o.arrayBuffer()),mediaType:(t=o.headers.get("content-type"))!=null?t:void 0}}catch(o){throw gd.isInstance(o)?o:new gd({url:n,cause:o})}},TS=(e=ES)=>t=>Promise.all(t.map(async n=>n.isUrlSupportedByModel?null:e(n)));function CS(e){try{let[t,n]=e.split(",");return{mediaType:t.split(";")[0].split(":")[1],base64Content:n}}catch{return{mediaType:void 0,base64Content:void 0}}}var vv=s.union([s.string(),s.instanceof(Uint8Array),s.instanceof(ArrayBuffer),s.custom(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]);function yv(e){if(e instanceof Uint8Array)return{data:e,mediaType:void 0};if(e instanceof ArrayBuffer)return{data:new Uint8Array(e),mediaType:void 0};if(typeof e=="string")try{e=new URL(e)}catch{}if(e instanceof URL&&e.protocol==="data:"){let{mediaType:t,base64Content:n}=CS(e.toString());if(t==null||n==null)throw new M({name:"InvalidDataContentError",message:`Invalid data URL format in content ${e.toString()}`});return{data:n,mediaType:t}}return{data:e,mediaType:void 0}}function AS(e){return typeof e=="string"?e:e instanceof ArrayBuffer?Wr(new Uint8Array(e)):Wr(e)}async function OS({prompt:e,supportedUrls:t,download:n=TS()}){let o=await PS(e.messages,n,t);return[...e.system!=null?[{role:"system",content:e.system}]:[],...e.messages.map(r=>jS({message:r,downloadedAssets:o}))]}function jS({message:e,downloadedAssets:t}){let n=e.role;switch(n){case"system":return{role:"system",content:e.content,providerOptions:e.providerOptions};case"user":return typeof e.content=="string"?{role:"user",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"user",content:e.content.map(o=>NS(o,t)).filter(o=>o.type!=="text"||o.text!==""),providerOptions:e.providerOptions};case"assistant":return typeof e.content=="string"?{role:"assistant",content:[{type:"text",text:e.content}],providerOptions:e.providerOptions}:{role:"assistant",content:e.content.filter(o=>o.type!=="text"||o.text!=="").map(o=>{let r=o.providerOptions;switch(o.type){case"file":{let{data:i,mediaType:a}=yv(o.data);return{type:"file",data:i,filename:o.filename,mediaType:a??o.mediaType,providerOptions:r}}case"reasoning":return{type:"reasoning",text:o.text,providerOptions:r};case"text":return{type:"text",text:o.text,providerOptions:r};case"tool-call":return{type:"tool-call",toolCallId:o.toolCallId,toolName:o.toolName,input:o.input,providerExecuted:o.providerExecuted,providerOptions:r};case"tool-result":return{type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:r}}}),providerOptions:e.providerOptions};case"tool":return{role:"tool",content:e.content.map(o=>({type:"tool-result",toolCallId:o.toolCallId,toolName:o.toolName,output:o.output,providerOptions:o.providerOptions})),providerOptions:e.providerOptions};default:{let o=n;throw new hS({role:o})}}}async function PS(e,t,n){let o=e.filter(i=>i.role==="user").map(i=>i.content).filter(i=>Array.isArray(i)).flat().filter(i=>i.type==="image"||i.type==="file").map(i=>{var a;let u=(a=i.mediaType)!=null?a:i.type==="image"?"image/*":void 0,c=i.type==="image"?i.image:i.data;if(typeof c=="string")try{c=new URL(c)}catch{}return{mediaType:u,data:c}}).filter(i=>i.data instanceof URL).map(i=>({url:i.data,isUrlSupportedByModel:i.mediaType!=null&&fg({url:i.data.toString(),mediaType:i.mediaType,supportedUrls:n})})),r=await t(o);return Object.fromEntries(r.filter(i=>i?.data!=null).map(({data:i,mediaType:a},u)=>[o[u].url.toString(),{data:i,mediaType:a}]))}function NS(e,t){var n;if(e.type==="text")return{type:"text",text:e.text,providerOptions:e.providerOptions};let o,r=e.type;switch(r){case"image":o=e.image;break;case"file":o=e.data;break;default:throw new Error(`Unsupported part type: ${r}`)}let{data:i,mediaType:a}=yv(o),u=a??e.mediaType,c=i;if(c instanceof URL){let l=t[c.toString()];l&&(c=l.data,u??(u=l.mediaType))}switch(r){case"image":return(c instanceof Uint8Array||typeof c=="string")&&(u=(n=IS({data:c,signatures:kS}))!=null?n:u),{type:"file",mediaType:u??"image/*",filename:void 0,data:c,providerOptions:e.providerOptions};case"file":{if(u==null)throw new Error("Media type is missing for file part");return{type:"file",mediaType:u,filename:e.filename,data:c,providerOptions:e.providerOptions}}}}function zS({maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,seed:a,stopSequences:u}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be an integer"});if(e<1)throw new bt({parameter:"maxOutputTokens",value:e,message:"maxOutputTokens must be >= 1"})}if(t!=null&&typeof t!="number")throw new bt({parameter:"temperature",value:t,message:"temperature must be a number"});if(n!=null&&typeof n!="number")throw new bt({parameter:"topP",value:n,message:"topP must be a number"});if(o!=null&&typeof o!="number")throw new bt({parameter:"topK",value:o,message:"topK must be a number"});if(r!=null&&typeof r!="number")throw new bt({parameter:"presencePenalty",value:r,message:"presencePenalty must be a number"});if(i!=null&&typeof i!="number")throw new bt({parameter:"frequencyPenalty",value:i,message:"frequencyPenalty must be a number"});if(a!=null&&!Number.isInteger(a))throw new bt({parameter:"seed",value:a,message:"seed must be an integer"});return{maxOutputTokens:e,temperature:t,topP:n,topK:o,presencePenalty:r,frequencyPenalty:i,stopSequences:u,seed:a}}function RS(e){return e!=null&&Object.keys(e).length>0}function FS({tools:e,toolChoice:t,activeTools:n}){return RS(e)?{tools:(n!=null?Object.entries(e).filter(([r])=>n.includes(r)):Object.entries(e)).map(([r,i])=>{let a=i.type;switch(a){case void 0:case"dynamic":case"function":return{type:"function",name:r,description:i.description,inputSchema:cr(i.inputSchema).jsonSchema,providerOptions:i.providerOptions};case"provider-defined":return{type:"provider-defined",name:r,id:i.id,args:i.args};default:{let u=a;throw new Error(`Unsupported tool type: ${u}`)}}}),toolChoice:t==null?{type:"auto"}:typeof t=="string"?{type:t}:{type:"tool",toolName:t.toolName}}:{tools:void 0,toolChoice:void 0}}var Co=s.lazy(()=>s.union([s.null(),s.string(),s.number(),s.boolean(),s.record(s.string(),Co),s.array(Co)])),Y=s.record(s.string(),s.record(s.string(),Co)),bv=s.object({type:s.literal("text"),text:s.string(),providerOptions:Y.optional()}),MS=s.object({type:s.literal("image"),image:s.union([vv,s.instanceof(URL)]),mediaType:s.string().optional(),providerOptions:Y.optional()}),_v=s.object({type:s.literal("file"),data:s.union([vv,s.instanceof(URL)]),filename:s.string().optional(),mediaType:s.string(),providerOptions:Y.optional()}),US=s.object({type:s.literal("reasoning"),text:s.string(),providerOptions:Y.optional()}),ZS=s.object({type:s.literal("tool-call"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerOptions:Y.optional(),providerExecuted:s.boolean().optional()}),LS=s.discriminatedUnion("type",[s.object({type:s.literal("text"),value:s.string()}),s.object({type:s.literal("json"),value:Co}),s.object({type:s.literal("error-text"),value:s.string()}),s.object({type:s.literal("error-json"),value:Co}),s.object({type:s.literal("content"),value:s.array(s.union([s.object({type:s.literal("text"),text:s.string()}),s.object({type:s.literal("media"),data:s.string(),mediaType:s.string()})]))})]),xv=s.object({type:s.literal("tool-result"),toolCallId:s.string(),toolName:s.string(),output:LS,providerOptions:Y.optional()}),BS=s.object({role:s.literal("system"),content:s.string(),providerOptions:Y.optional()});var qS=s.object({role:s.literal("user"),content:s.union([s.string(),s.array(s.union([bv,MS,_v]))]),providerOptions:Y.optional()});var VS=s.object({role:s.literal("assistant"),content:s.union([s.string(),s.array(s.union([bv,_v,US,ZS,xv]))]),providerOptions:Y.optional()});var JS=s.object({role:s.literal("tool"),content:s.array(xv),providerOptions:Y.optional()});var GS=s.union([BS,qS,VS,JS]);async function WS(e){if(e.prompt==null&&e.messages==null)throw new $t({prompt:e,message:"prompt or messages must be defined"});if(e.prompt!=null&&e.messages!=null)throw new $t({prompt:e,message:"prompt and messages cannot be defined at the same time"});if(e.system!=null&&typeof e.system!="string")throw new $t({prompt:e,message:"system must be a string"});let t;if(e.prompt!=null&&typeof e.prompt=="string")t=[{role:"user",content:e.prompt}];else if(e.prompt!=null&&Array.isArray(e.prompt))t=e.prompt;else if(e.messages!=null)t=e.messages;else throw new $t({prompt:e,message:"prompt or messages must be defined"});if(t.length===0)throw new $t({prompt:e,message:"messages must not be empty"});let n=await Rt({value:t,schema:s.array(GS)});if(!n.success)throw new $t({prompt:e,message:"The messages must be a ModelMessage[]. If you have passed a UIMessage[], you can use convertToModelMessages to convert them.",cause:n.error});return{messages:t,system:e.system}}function KS(e){return ko.isInstance(e)||ad.isInstance(e)?new M({name:"GatewayError",message:"Vercel AI Gateway access failed. If you want to use AI SDK providers directly, use the providers, e.g. @ai-sdk/openai, or register a different global default provider.",cause:e}):e}function bd({operationId:e,telemetry:t}){return{"operation.name":`${e}${t?.functionId!=null?` ${t.functionId}`:""}`,"resource.name":t?.functionId,"ai.operationId":e,"ai.telemetry.functionId":t?.functionId}}function HS({model:e,settings:t,telemetry:n,headers:o}){var r;return{"ai.model.provider":e.provider,"ai.model.id":e.modelId,...Object.entries(t).reduce((i,[a,u])=>(i[`ai.settings.${a}`]=u,i),{}),...Object.entries((r=n?.metadata)!=null?r:{}).reduce((i,[a,u])=>(i[`ai.telemetry.metadata.${a}`]=u,i),{}),...Object.entries(o??{}).reduce((i,[a,u])=>(u!==void 0&&(i[`ai.request.headers.${a}`]=u),i),{})}}var YS={startSpan(){return ga},startActiveSpan(e,t,n,o){if(typeof t=="function")return t(ga);if(typeof n=="function")return n(ga);if(typeof o=="function")return o(ga)}},ga={spanContext(){return XS},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},addLink(){return this},addLinks(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this}},XS={traceId:"",spanId:"",traceFlags:0};function QS({isEnabled:e=!1,tracer:t}={}){return e?t||fd.getTracer("ai"):YS}function _d({name:e,tracer:t,attributes:n,fn:o,endWhenDone:r=!0}){return t.startActiveSpan(e,{attributes:n},async i=>{try{let a=await o(i);return r&&i.end(),a}catch(a){try{Dv(i,a)}finally{i.end()}throw a}})}function Dv(e,t){t instanceof Error?(e.recordException({name:t.name,message:t.message,stack:t.stack}),e.setStatus({code:Qr.ERROR,message:t.message})):e.setStatus({code:Qr.ERROR})}function en({telemetry:e,attributes:t}){return e?.isEnabled!==!0?{}:Object.entries(t).reduce((n,[o,r])=>{if(r==null)return n;if(typeof r=="object"&&"input"in r&&typeof r.input=="function"){if(e?.recordInputs===!1)return n;let i=r.input();return i==null?n:{...n,[o]:i}}if(typeof r=="object"&&"output"in r&&typeof r.output=="function"){if(e?.recordOutputs===!1)return n;let i=r.output();return i==null?n:{...n,[o]:i}}return{...n,[o]:r}},{})}function eI(e){return JSON.stringify(e.map(t=>({...t,content:typeof t.content=="string"?t.content:t.content.map(n=>n.type==="file"?{...n,data:n.data instanceof Uint8Array?AS(n.data):n.data}:n)})))}function tI(e,t){return{inputTokens:To(e.inputTokens,t.inputTokens),outputTokens:To(e.outputTokens,t.outputTokens),totalTokens:To(e.totalTokens,t.totalTokens),reasoningTokens:To(e.reasoningTokens,t.reasoningTokens),cachedInputTokens:To(e.cachedInputTokens,t.cachedInputTokens)}}function To(e,t){return e==null&&t==null?void 0:(e??0)+(t??0)}function jh(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function rI({error:e,exponentialBackoffDelay:t}){let n=e.responseHeaders;if(!n)return t;let o,r=n["retry-after-ms"];if(r){let a=parseFloat(r);Number.isNaN(a)||(o=a)}let i=n["retry-after"];if(i&&o===void 0){let a=parseFloat(i);Number.isNaN(a)?o=Date.parse(i)-Date.now():o=a*1e3}return o!=null&&!Number.isNaN(o)&&0<=o&&(o<60*1e3||o<t)?o:t}var nI=({maxRetries:e=2,initialDelayInMs:t=2e3,backoffFactor:n=2,abortSignal:o}={})=>async r=>wv(r,{maxRetries:e,delayInMs:t,backoffFactor:n,abortSignal:o});async function wv(e,{maxRetries:t,delayInMs:n,backoffFactor:o,abortSignal:r},i=[]){try{return await e()}catch(a){if(Nt(a)||t===0)throw a;let u=vo(a),c=[...i,a],l=c.length;if(l>t)throw new Oh({message:`Failed after ${l} attempts. Last error: ${u}`,reason:"maxRetriesExceeded",errors:c});if(a instanceof Error&&le.isInstance(a)&&a.isRetryable===!0&&l<=t)return await lg(rI({error:a,exponentialBackoffDelay:n}),{abortSignal:r}),wv(e,{maxRetries:t,delayInMs:o*n,backoffFactor:o,abortSignal:r},c);throw l===1?a:new Oh({message:`Failed after ${l} attempts with non-retryable error: '${u}'`,reason:"errorNotRetryable",errors:c})}}function oI({maxRetries:e,abortSignal:t}){if(e!=null){if(!Number.isInteger(e))throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be an integer"});if(e<0)throw new bt({parameter:"maxRetries",value:e,message:"maxRetries must be >= 0"})}let n=e??2;return{maxRetries:n,retry:nI({maxRetries:n,abortSignal:t})}}var iI=class{constructor({data:e,mediaType:t}){let n=e instanceof Uint8Array;this.base64Data=n?void 0:e,this.uint8ArrayData=n?e:void 0,this.mediaType=t}get base64(){return this.base64Data==null&&(this.base64Data=Wr(this.uint8ArrayData)),this.base64Data}get uint8Array(){return this.uint8ArrayData==null&&(this.uint8ArrayData=bo(this.base64Data)),this.uint8ArrayData}},aI=class extends iI{constructor(e){super(e),this.type="file"}};async function sI({toolCall:e,tools:t,repairToolCall:n,system:o,messages:r}){try{if(t==null)throw new yd({toolName:e.toolName});try{return await Ph({toolCall:e,tools:t})}catch(i){if(n==null||!(yd.isInstance(i)||Wh.isInstance(i)))throw i;let a=null;try{a=await n({toolCall:e,tools:t,inputSchema:({toolName:u})=>{let{inputSchema:c}=t[u];return cr(c).jsonSchema},system:o,messages:r,error:i})}catch(u){throw new lS({cause:u,originalError:i})}if(a==null)throw i;return await Ph({toolCall:a,tools:t})}}catch(i){let a=await yt({text:e.input}),u=a.success?a.value:e.input;return{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:u,dynamic:!0,invalid:!0,error:i}}}async function Ph({toolCall:e,tools:t}){let n=e.toolName,o=t[n];if(o==null)throw new yd({toolName:e.toolName,availableTools:Object.keys(t)});let r=cr(o.inputSchema),i=e.input.trim()===""?await Rt({value:{},schema:r}):await yt({text:e.input,schema:r});if(i.success===!1)throw new Wh({toolName:n,toolInput:e.input,cause:i.error});return o.type==="dynamic"?{type:"tool-call",toolCallId:e.toolCallId,toolName:e.toolName,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,dynamic:!0}:{type:"tool-call",toolCallId:e.toolCallId,toolName:n,input:i.value,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata}}var uI=class{constructor({content:e,finishReason:t,usage:n,warnings:o,request:r,response:i,providerMetadata:a}){this.content=e,this.finishReason=t,this.usage=n,this.warnings=o,this.request=r,this.response=i,this.providerMetadata=a}get text(){return this.content.filter(e=>e.type==="text").map(e=>e.text).join("")}get reasoning(){return this.content.filter(e=>e.type==="reasoning")}get reasoningText(){return this.reasoning.length===0?void 0:this.reasoning.map(e=>e.text).join("")}get files(){return this.content.filter(e=>e.type==="file").map(e=>e.file)}get sources(){return this.content.filter(e=>e.type==="source")}get toolCalls(){return this.content.filter(e=>e.type==="tool-call")}get staticToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!1)}get dynamicToolCalls(){return this.toolCalls.filter(e=>e.dynamic===!0)}get toolResults(){return this.content.filter(e=>e.type==="tool-result")}get staticToolResults(){return this.toolResults.filter(e=>e.dynamic===!1)}get dynamicToolResults(){return this.toolResults.filter(e=>e.dynamic===!0)}};function lI(e){return({steps:t})=>t.length===e}async function cI({stopConditions:e,steps:t}){return(await Promise.all(e.map(n=>n({steps:t})))).some(n=>n)}function hd({output:e,tool:t,errorMode:n}){return n==="text"?{type:"error-text",value:ft(e)}:n==="json"?{type:"error-json",value:Nh(e)}:t?.toModelOutput?t.toModelOutput(e):typeof e=="string"?{type:"text",value:e}:{type:"json",value:Nh(e)}}function Nh(e){return e===void 0?null:e}function zh({content:e,tools:t}){let n=[],o=e.filter(i=>i.type!=="source").filter(i=>(i.type!=="tool-result"||i.providerExecuted)&&(i.type!=="tool-error"||i.providerExecuted)).filter(i=>i.type!=="text"||i.text.length>0).map(i=>{switch(i.type){case"text":return{type:"text",text:i.text,providerOptions:i.providerMetadata};case"reasoning":return{type:"reasoning",text:i.text,providerOptions:i.providerMetadata};case"file":return{type:"file",data:i.file.base64,mediaType:i.file.mediaType,providerOptions:i.providerMetadata};case"tool-call":return{type:"tool-call",toolCallId:i.toolCallId,toolName:i.toolName,input:i.input,providerExecuted:i.providerExecuted,providerOptions:i.providerMetadata};case"tool-result":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:hd({tool:t?.[i.toolName],output:i.output,errorMode:"none"}),providerExecuted:!0,providerOptions:i.providerMetadata};case"tool-error":return{type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:hd({tool:t?.[i.toolName],output:i.error,errorMode:"json"}),providerOptions:i.providerMetadata}}});o.length>0&&n.push({role:"assistant",content:o});let r=e.filter(i=>i.type==="tool-result"||i.type==="tool-error").filter(i=>!i.providerExecuted).map(i=>({type:"tool-result",toolCallId:i.toolCallId,toolName:i.toolName,output:hd({tool:t?.[i.toolName],output:i.type==="tool-result"?i.output:i.error,errorMode:i.type==="tool-error"?"text":"none"})}));return r.length>0&&n.push({role:"tool",content:r}),n}var MN=zt({prefix:"aitxt",size:24});function ya(e,t){let n=new Headers(e??{});for(let[o,r]of Object.entries(t))n.has(o)||n.set(o,r);return n}function dI({status:e,statusText:t,headers:n,textStream:o}){return new Response(o.pipeThrough(new TextEncoderStream),{status:e??200,statusText:t,headers:ya(n,{"content-type":"text/plain; charset=utf-8"})})}function kv({response:e,status:t,statusText:n,headers:o,stream:r}){e.writeHead(t??200,n,o);let i=r.getReader();(async()=>{try{for(;;){let{done:u,value:c}=await i.read();if(u)break;e.write(c)}}catch(u){throw u}finally{e.end()}})()}function pI({response:e,status:t,statusText:n,headers:o,textStream:r}){kv({response:e,status:t,statusText:n,headers:Object.fromEntries(ya(o,{"content-type":"text/plain; charset=utf-8"}).entries()),stream:r.pipeThrough(new TextEncoderStream)})}var $v=class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
75
+
76
+ `)},flush(e){e.enqueue(`data: [DONE]
77
+
78
+ `)}})}},Sv={"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive","x-vercel-ai-ui-message-stream":"v1","x-accel-buffering":"no"};function mI({status:e,statusText:t,headers:n,stream:o,consumeSseStream:r}){let i=o.pipeThrough(new $v);if(r){let[a,u]=i.tee();i=a,r({stream:u})}return new Response(i.pipeThrough(new TextEncoderStream),{status:e,statusText:t,headers:ya(n,Sv)})}function fI({originalMessages:e,responseMessageId:t}){if(e==null)return;let n=e[e.length-1];return n?.role==="assistant"?n.id:typeof t=="function"?t():t}var qN=s.union([s.strictObject({type:s.literal("text-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("text-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("error"),errorText:s.string()}),s.strictObject({type:s.literal("tool-input-start"),toolCallId:s.string(),toolName:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-delta"),toolCallId:s.string(),inputTextDelta:s.string()}),s.strictObject({type:s.literal("tool-input-available"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("tool-input-error"),toolCallId:s.string(),toolName:s.string(),input:s.unknown(),providerExecuted:s.boolean().optional(),providerMetadata:Y.optional(),dynamic:s.boolean().optional(),errorText:s.string()}),s.strictObject({type:s.literal("tool-output-available"),toolCallId:s.string(),output:s.unknown(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional(),preliminary:s.boolean().optional()}),s.strictObject({type:s.literal("tool-output-error"),toolCallId:s.string(),errorText:s.string(),providerExecuted:s.boolean().optional(),dynamic:s.boolean().optional()}),s.strictObject({type:s.literal("reasoning"),text:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-start"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-delta"),id:s.string(),delta:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-end"),id:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("reasoning-part-finish")}),s.strictObject({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),s.strictObject({type:s.literal("file"),url:s.string(),mediaType:s.string(),providerMetadata:Y.optional()}),s.strictObject({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown(),transient:s.boolean().optional()}),s.strictObject({type:s.literal("start-step")}),s.strictObject({type:s.literal("finish-step")}),s.strictObject({type:s.literal("start"),messageId:s.string().optional(),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("finish"),messageMetadata:s.unknown().optional()}),s.strictObject({type:s.literal("abort")}),s.strictObject({type:s.literal("message-metadata"),messageMetadata:s.unknown()})]);function gI(e){return e.type.startsWith("data-")}function Iv(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;let n={...e};for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(r===void 0)continue;let i=o in e?e[o]:void 0,a=r!==null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)&&!(r instanceof RegExp),u=i!=null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp);a&&u?n[o]=Iv(i,r):n[o]=r}return n}function hI(e){let t=["ROOT"],n=-1,o=null;function r(c,l,d){switch(c){case'"':{n=l,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=l,o=l,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=l,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=l,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function i(c,l){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=l,t.pop();break}}}function a(c,l){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}}}for(let c=0;c<e.length;c++){let l=e[c];switch(t[t.length-1]){case"ROOT":r(l,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(l){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(l){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{r(l,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(l,c);break}case"INSIDE_STRING":{switch(l){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{switch(l){case"]":{n=c,t.pop();break}default:{n=c,r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{r(l,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(l){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(l,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(l,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{let v=e.substring(o,c+1);!"false".startsWith(v)&&!"true".startsWith(v)&&!"null".startsWith(v)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(l,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(l,c)):n=c;break}}}let u=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{let d=e.substring(o,e.length);"true".startsWith(d)?u+="true".slice(d.length):"false".startsWith(d)?u+="false".slice(d.length):"null".startsWith(d)&&(u+="null".slice(d.length))}}return u}async function Ev(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await yt({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await yt({text:hI(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function vd(e){return e.type.startsWith("tool-")}function Rh(e){return e.type.split("-").slice(1).join("-")}function vI({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function yI({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:o,onError:r,onToolCall:i,onData:a}){return e.pipeThrough(new TransformStream({async transform(u,c){await o(async({state:l,write:d})=>{var v,y,p,m;function f(_){let O=l.message.parts.filter(vd).find(S=>S.toolCallId===_);if(O==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return O}function g(_){let O=l.message.parts.filter(S=>S.type==="dynamic-tool").find(S=>S.toolCallId===_);if(O==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return O}function b(_){var P;let O=l.message.parts.find(Z=>vd(Z)&&Z.toolCallId===_.toolCallId),S=_,k=O;O!=null?(O.state=_.state,k.input=S.input,k.output=S.output,k.errorText=S.errorText,k.rawInput=S.rawInput,k.preliminary=S.preliminary,k.providerExecuted=(P=S.providerExecuted)!=null?P:O.providerExecuted,S.providerMetadata!=null&&O.state==="input-available"&&(O.callProviderMetadata=S.providerMetadata)):l.message.parts.push({type:`tool-${_.toolName}`,toolCallId:_.toolCallId,state:_.state,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null?{callProviderMetadata:S.providerMetadata}:{}})}function D(_){var P;let O=l.message.parts.find(Z=>Z.type==="dynamic-tool"&&Z.toolCallId===_.toolCallId),S=_,k=O;O!=null?(O.state=_.state,k.toolName=_.toolName,k.input=S.input,k.output=S.output,k.errorText=S.errorText,k.rawInput=(P=S.rawInput)!=null?P:k.rawInput,k.preliminary=S.preliminary,S.providerMetadata!=null&&O.state==="input-available"&&(O.callProviderMetadata=S.providerMetadata)):l.message.parts.push({type:"dynamic-tool",toolName:_.toolName,toolCallId:_.toolCallId,state:_.state,input:S.input,output:S.output,errorText:S.errorText,preliminary:S.preliminary,...S.providerMetadata!=null?{callProviderMetadata:S.providerMetadata}:{}})}async function $(_){if(_!=null){let P=l.message.metadata!=null?Iv(l.message.metadata,_):_;t!=null&&await ia({value:P,schema:t}),l.message.metadata=P}}switch(u.type){case"text-start":{let _={type:"text",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeTextParts[u.id]=_,l.message.parts.push(_),d();break}case"text-delta":{let _=l.activeTextParts[u.id];_.text+=u.delta,_.providerMetadata=(v=u.providerMetadata)!=null?v:_.providerMetadata,d();break}case"text-end":{let _=l.activeTextParts[u.id];_.state="done",_.providerMetadata=(y=u.providerMetadata)!=null?y:_.providerMetadata,delete l.activeTextParts[u.id],d();break}case"reasoning-start":{let _={type:"reasoning",text:"",providerMetadata:u.providerMetadata,state:"streaming"};l.activeReasoningParts[u.id]=_,l.message.parts.push(_),d();break}case"reasoning-delta":{let _=l.activeReasoningParts[u.id];_.text+=u.delta,_.providerMetadata=(p=u.providerMetadata)!=null?p:_.providerMetadata,d();break}case"reasoning-end":{let _=l.activeReasoningParts[u.id];_.providerMetadata=(m=u.providerMetadata)!=null?m:_.providerMetadata,_.state="done",delete l.activeReasoningParts[u.id],d();break}case"file":{l.message.parts.push({type:"file",mediaType:u.mediaType,url:u.url}),d();break}case"source-url":{l.message.parts.push({type:"source-url",sourceId:u.sourceId,url:u.url,title:u.title,providerMetadata:u.providerMetadata}),d();break}case"source-document":{l.message.parts.push({type:"source-document",sourceId:u.sourceId,mediaType:u.mediaType,title:u.title,filename:u.filename,providerMetadata:u.providerMetadata}),d();break}case"tool-input-start":{let _=l.message.parts.filter(vd);l.partialToolCalls[u.toolCallId]={text:"",toolName:u.toolName,index:_.length,dynamic:u.dynamic},u.dynamic?D({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0}):b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-streaming",input:void 0,providerExecuted:u.providerExecuted}),d();break}case"tool-input-delta":{let _=l.partialToolCalls[u.toolCallId];_.text+=u.inputTextDelta;let{value:P}=await Ev(_.text);_.dynamic?D({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:P}):b({toolCallId:u.toolCallId,toolName:_.toolName,state:"input-streaming",input:P}),d();break}case"tool-input-available":{u.dynamic?D({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerMetadata:u.providerMetadata}):b({toolCallId:u.toolCallId,toolName:u.toolName,state:"input-available",input:u.input,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d(),i&&!u.providerExecuted&&await i({toolCall:u});break}case"tool-input-error":{u.dynamic?D({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:u.input,errorText:u.errorText,providerMetadata:u.providerMetadata}):b({toolCallId:u.toolCallId,toolName:u.toolName,state:"output-error",input:void 0,rawInput:u.input,errorText:u.errorText,providerExecuted:u.providerExecuted,providerMetadata:u.providerMetadata}),d();break}case"tool-output-available":{if(u.dynamic){let _=g(u.toolCallId);D({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-available",input:_.input,output:u.output,preliminary:u.preliminary})}else{let _=f(u.toolCallId);b({toolCallId:u.toolCallId,toolName:Rh(_),state:"output-available",input:_.input,output:u.output,providerExecuted:u.providerExecuted,preliminary:u.preliminary})}d();break}case"tool-output-error":{if(u.dynamic){let _=g(u.toolCallId);D({toolCallId:u.toolCallId,toolName:_.toolName,state:"output-error",input:_.input,errorText:u.errorText})}else{let _=f(u.toolCallId);b({toolCallId:u.toolCallId,toolName:Rh(_),state:"output-error",input:_.input,rawInput:_.rawInput,errorText:u.errorText})}d();break}case"start-step":{l.message.parts.push({type:"step-start"});break}case"finish-step":{l.activeTextParts={},l.activeReasoningParts={};break}case"start":{u.messageId!=null&&(l.message.id=u.messageId),await $(u.messageMetadata),(u.messageId!=null||u.messageMetadata!=null)&&d();break}case"finish":{await $(u.messageMetadata),u.messageMetadata!=null&&d();break}case"message-metadata":{await $(u.messageMetadata),u.messageMetadata!=null&&d();break}case"error":{r?.(new Error(u.errorText));break}default:if(gI(u)){n?.[u.type]!=null&&await ia({value:u.data,schema:n[u.type]});let _=u;if(_.transient){a?.(_);break}let P=_.id!=null?l.message.parts.find(O=>_.type===O.type&&_.id===O.id):void 0;P!=null?P.data=_.data:l.message.parts.push(_),a?.(_),d()}}c.enqueue(u)})}}))}function bI({messageId:e,originalMessages:t=[],onFinish:n,onError:o,stream:r}){let i=t?.[t.length-1];i?.role!=="assistant"?i=void 0:e=i.id;let a=!1,u=r.pipeThrough(new TransformStream({transform(y,p){if(y.type==="start"){let m=y;m.messageId==null&&e!=null&&(m.messageId=e)}y.type==="abort"&&(a=!0),p.enqueue(y)}}));if(n==null)return u;let c=vI({lastMessage:i?structuredClone(i):void 0,messageId:e??""}),l=async y=>{await y({state:c,write:()=>{}})},d=!1,v=async()=>{if(d||!n)return;d=!0;let y=c.message.id===i?.id;await n({isAborted:a,isContinuation:y,responseMessage:c.message,messages:[...y?t.slice(0,-1):t,c.message]})};return yI({stream:u,runUpdateMessageJob:l,onError:o}).pipeThrough(new TransformStream({transform(y,p){p.enqueue(y)},async cancel(){await v()},async flush(){await v()}}))}function _I({response:e,status:t,statusText:n,headers:o,stream:r,consumeSseStream:i}){let a=r.pipeThrough(new $v);if(i){let[u,c]=a.tee();a=u,i({stream:c})}kv({response:e,status:t,statusText:n,headers:Object.fromEntries(ya(o,Sv).entries()),stream:a.pipeThrough(new TextEncoderStream)})}function ha(e){let t=e.pipeThrough(new TransformStream);return t[Symbol.asyncIterator]=function(){let n=this.getReader(),o=!1;async function r(i){var a;o=!0;try{i&&await((a=n.cancel)==null?void 0:a.call(n))}finally{try{n.releaseLock()}catch{}}}return{async next(){if(o)return{done:!0,value:void 0};let{done:i,value:a}=await n.read();return i?(await r(!0),{done:!0,value:void 0}):{done:!1,value:a}},async return(){return await r(!0),{done:!0,value:void 0}},async throw(i){throw await r(!0),i}}},t}async function xI({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:o}=await n.read();if(o)break}}catch(o){t?.(o)}finally{n.releaseLock()}}function Fh(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function DI(){let e=[],t=null,n=!1,o=Fh(),r=()=>{n=!0,o.resolve(),e.forEach(a=>a.cancel()),e=[],t?.close()},i=async()=>{if(n&&e.length===0){t?.close();return}if(e.length===0)return o=Fh(),await o.promise,i();try{let{value:a,done:u}=await e[0].read();u?(e.shift(),e.length>0?await i():n&&t?.close()):t?.enqueue(a)}catch(a){t?.error(a),e.shift(),r()}};return{stream:new ReadableStream({start(a){t=a},pull:i,async cancel(){for(let a of e)await a.cancel();e=[],n=!0}}),addStream:a=>{if(n)throw new Error("Cannot add inner stream: outer stream is closed");e.push(a.getReader()),o.resolve()},close:()=>{n=!0,o.resolve(),e.length===0&&t?.close()},terminate:r}}var va=class{constructor(){this.status={type:"pending"},this._resolve=void 0,this._reject=void 0}get promise(){return this._promise?this._promise:(this._promise=new Promise((e,t)=>{this.status.type==="resolved"?e(this.status.value):this.status.type==="rejected"&&t(this.status.error),this._resolve=e,this._reject=t}),this._promise)}resolve(e){var t;this.status={type:"resolved",value:e},this._promise&&((t=this._resolve)==null||t.call(this,e))}reject(e){var t;this.status={type:"rejected",error:e},this._promise&&((t=this._reject)==null||t.call(this,e))}};function wI(){var e,t;return(t=(e=globalThis?.performance)==null?void 0:e.now())!=null?t:Date.now()}function kI({tools:e,generatorStream:t,tracer:n,telemetry:o,system:r,messages:i,abortSignal:a,repairToolCall:u,experimental_context:c}){let l=null,d=new ReadableStream({start(b){l=b}}),v=new Set,y=new Map,p=!1,m;function f(){p&&v.size===0&&(m!=null&&l.enqueue(m),l.close())}let g=new TransformStream({async transform(b,D){let $=b.type;switch($){case"stream-start":case"text-start":case"text-delta":case"text-end":case"reasoning-start":case"reasoning-delta":case"reasoning-end":case"tool-input-start":case"tool-input-delta":case"tool-input-end":case"source":case"response-metadata":case"error":case"raw":{D.enqueue(b);break}case"file":{D.enqueue({type:"file",file:new aI({data:b.data,mediaType:b.mediaType})});break}case"finish":{m={type:"finish",finishReason:b.finishReason,usage:b.usage,providerMetadata:b.providerMetadata};break}case"tool-call":{try{let _=await sI({toolCall:b,tools:e,repairToolCall:u,system:r,messages:i});if(D.enqueue(_),_.invalid){l.enqueue({type:"tool-error",toolCallId:_.toolCallId,toolName:_.toolName,input:_.input,error:vo(_.error),dynamic:!0});break}let P=e[_.toolName];if(y.set(_.toolCallId,_.input),P.onInputAvailable!=null&&await P.onInputAvailable({input:_.input,toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:c}),P.execute!=null&&_.providerExecuted!==!0){let O=ut();v.add(O),_d({name:"ai.toolCall",attributes:en({telemetry:o,attributes:{...bd({operationId:"ai.toolCall",telemetry:o}),"ai.toolCall.name":_.toolName,"ai.toolCall.id":_.toolCallId,"ai.toolCall.args":{output:()=>JSON.stringify(_.input)}}}),tracer:n,fn:async S=>{let k;try{let Z=rd({execute:P.execute.bind(P),input:_.input,options:{toolCallId:_.toolCallId,messages:i,abortSignal:a,experimental_context:c}});for await(let z of Z)l.enqueue({..._,type:"tool-result",output:z.output,...z.type==="preliminary"&&{preliminary:!0}}),z.type==="final"&&(k=z.output)}catch(Z){Dv(S,Z),l.enqueue({..._,type:"tool-error",error:Z}),v.delete(O),f();return}v.delete(O),f();try{S.setAttributes(en({telemetry:o,attributes:{"ai.toolCall.result":{output:()=>JSON.stringify(k)}}}))}catch{}}})}}catch(_){l.enqueue({type:"error",error:_})}break}case"tool-result":{let _=b.toolName;b.isError?l.enqueue({type:"tool-error",toolCallId:b.toolCallId,toolName:_,input:y.get(b.toolCallId),providerExecuted:b.providerExecuted,error:b.result}):D.enqueue({type:"tool-result",toolCallId:b.toolCallId,toolName:_,input:y.get(b.toolCallId),output:b.result,providerExecuted:b.providerExecuted});break}default:{let _=$;throw new Error(`Unhandled chunk type: ${_}`)}}},flush(){p=!0,f()}});return new ReadableStream({async start(b){return Promise.all([t.pipeThrough(g).pipeTo(new WritableStream({write(D){b.enqueue(D)},close(){}})),d.pipeTo(new WritableStream({write(D){b.enqueue(D)},close(){b.close()}}))])}})}var $I=zt({prefix:"aitxt",size:24});function Tv({model:e,tools:t,toolChoice:n,system:o,prompt:r,messages:i,maxRetries:a,abortSignal:u,headers:c,stopWhen:l=lI(1),experimental_output:d,experimental_telemetry:v,prepareStep:y,providerOptions:p,experimental_activeTools:m,activeTools:f=m,experimental_repairToolCall:g,experimental_transform:b,experimental_download:D,includeRawChunks:$=!1,onChunk:_,onError:P=({error:se})=>{console.error(se)},onFinish:O,onAbort:S,onStepFinish:k,experimental_context:Z,_internal:{now:z=wI,generateId:U=$I,currentDate:te=()=>new Date}={},...ae}){return new II({model:hv(e),telemetry:v,headers:c,settings:ae,maxRetries:a,abortSignal:u,system:o,prompt:r,messages:i,tools:t,toolChoice:n,transforms:jh(b),activeTools:f,repairToolCall:g,stopConditions:jh(l),output:d,providerOptions:p,prepareStep:y,includeRawChunks:$,onChunk:_,onError:P,onFinish:O,onAbort:S,onStepFinish:k,now:z,currentDate:te,generateId:U,experimental_context:Z,download:D})}function SI(e){if(!e)return new TransformStream({transform(a,u){u.enqueue({part:a,partialOutput:void 0})}});let t,n="",o="",r="";function i({controller:a,partialOutput:u=void 0}){a.enqueue({part:{type:"text-delta",id:t,text:o},partialOutput:u}),o=""}return new TransformStream({async transform(a,u){if(a.type==="finish-step"&&o.length>0&&i({controller:u}),a.type!=="text-delta"&&a.type!=="text-start"&&a.type!=="text-end"){u.enqueue({part:a,partialOutput:void 0});return}if(t==null)t=a.id;else if(a.id!==t){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-start"){u.enqueue({part:a,partialOutput:void 0});return}if(a.type==="text-end"){o.length>0&&i({controller:u}),u.enqueue({part:a,partialOutput:void 0});return}n+=a.text,o+=a.text;let c=await e.parsePartial({text:n});if(c!=null){let l=JSON.stringify(c.partial);l!==r&&(i({controller:u,partialOutput:c.partial}),r=l)}}})}var II=class{constructor({model:e,telemetry:t,headers:n,settings:o,maxRetries:r,abortSignal:i,system:a,prompt:u,messages:c,tools:l,toolChoice:d,transforms:v,activeTools:y,repairToolCall:p,stopConditions:m,output:f,providerOptions:g,prepareStep:b,includeRawChunks:D,now:$,currentDate:_,generateId:P,onChunk:O,onError:S,onFinish:k,onAbort:Z,onStepFinish:z,experimental_context:U,download:te}){this._totalUsage=new va,this._finishReason=new va,this._steps=new va,this.output=f,this.includeRawChunks=D,this.tools=l;let ae,se=[],Dt=[],dt,fr,fe={},et=[],re=[],de,ye={},gr={},Jy=new TransformStream({async transform(pe,ge){var _e,Q,tt;ge.enqueue(pe);let{part:R}=pe;if((R.type==="text-delta"||R.type==="reasoning-delta"||R.type==="source"||R.type==="tool-call"||R.type==="tool-result"||R.type==="tool-input-start"||R.type==="tool-input-delta"||R.type==="raw")&&await O?.({chunk:R}),R.type==="error"&&await S({error:KS(R.error)}),R.type==="text-start"&&(ye[R.id]={type:"text",text:"",providerMetadata:R.providerMetadata},se.push(ye[R.id])),R.type==="text-delta"){let he=ye[R.id];if(he==null){ge.enqueue({part:{type:"error",error:`text part ${R.id} not found`},partialOutput:void 0});return}he.text+=R.text,he.providerMetadata=(_e=R.providerMetadata)!=null?_e:he.providerMetadata}if(R.type==="text-end"&&delete ye[R.id],R.type==="reasoning-start"&&(gr[R.id]={type:"reasoning",text:"",providerMetadata:R.providerMetadata},se.push(gr[R.id])),R.type==="reasoning-delta"){let he=gr[R.id];if(he==null){ge.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}he.text+=R.text,he.providerMetadata=(Q=R.providerMetadata)!=null?Q:he.providerMetadata}if(R.type==="reasoning-end"){let he=gr[R.id];if(he==null){ge.enqueue({part:{type:"error",error:`reasoning part ${R.id} not found`},partialOutput:void 0});return}he.providerMetadata=(tt=R.providerMetadata)!=null?tt:he.providerMetadata,delete gr[R.id]}if(R.type==="file"&&se.push({type:"file",file:R.file}),R.type==="source"&&se.push(R),R.type==="tool-call"&&se.push(R),R.type==="tool-result"&&!R.preliminary&&se.push(R),R.type==="tool-error"&&se.push(R),R.type==="start-step"&&(fe=R.request,et=R.warnings),R.type==="finish-step"){let he=zh({content:se,tools:l}),un=new uI({content:se,finishReason:R.finishReason,usage:R.usage,warnings:et,request:fe,response:{...R.response,messages:[...Dt,...he]},providerMetadata:R.providerMetadata});await z?.(un),B$(et),re.push(un),se=[],gr={},ye={},Dt.push(...he),ae.resolve()}R.type==="finish"&&(fr=R.totalUsage,dt=R.finishReason)},async flush(pe){try{if(re.length===0){let tt=new aS({message:"No output generated. Check the stream for errors."});Ke._finishReason.reject(tt),Ke._totalUsage.reject(tt),Ke._steps.reject(tt);return}let ge=dt??"unknown",_e=fr??{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0};Ke._finishReason.resolve(ge),Ke._totalUsage.resolve(_e),Ke._steps.resolve(re);let Q=re[re.length-1];await k?.({finishReason:ge,totalUsage:_e,usage:Q.usage,content:Q.content,text:Q.text,reasoningText:Q.reasoningText,reasoning:Q.reasoning,files:Q.files,sources:Q.sources,toolCalls:Q.toolCalls,staticToolCalls:Q.staticToolCalls,dynamicToolCalls:Q.dynamicToolCalls,toolResults:Q.toolResults,staticToolResults:Q.staticToolResults,dynamicToolResults:Q.dynamicToolResults,request:Q.request,response:Q.response,warnings:Q.warnings,providerMetadata:Q.providerMetadata,steps:re}),de.setAttributes(en({telemetry:t,attributes:{"ai.response.finishReason":ge,"ai.response.text":{output:()=>Q.text},"ai.response.toolCalls":{output:()=>{var tt;return(tt=Q.toolCalls)!=null&&tt.length?JSON.stringify(Q.toolCalls):void 0}},"ai.response.providerMetadata":JSON.stringify(Q.providerMetadata),"ai.usage.inputTokens":_e.inputTokens,"ai.usage.outputTokens":_e.outputTokens,"ai.usage.totalTokens":_e.totalTokens,"ai.usage.reasoningTokens":_e.reasoningTokens,"ai.usage.cachedInputTokens":_e.cachedInputTokens}}))}catch(ge){pe.error(ge)}finally{de.end()}}}),sn=DI();this.addStream=sn.addStream,this.closeStream=sn.close;let Gy=sn.stream.getReader(),Aa=new ReadableStream({async start(pe){pe.enqueue({type:"start"})},async pull(pe){function ge(){Z?.({steps:re}),pe.enqueue({type:"abort"}),pe.close()}try{let{done:_e,value:Q}=await Gy.read();if(_e){pe.close();return}if(i?.aborted){ge();return}pe.enqueue(Q)}catch(_e){Nt(_e)&&i?.aborted?ge():pe.error(_e)}},cancel(pe){return sn.stream.cancel(pe)}});for(let pe of v)Aa=Aa.pipeThrough(pe({tools:l,stopStream(){sn.terminate()}}));this.baseStream=Aa.pipeThrough(SI(f)).pipeThrough(Jy);let{maxRetries:Wy,retry:Ky}=oI({maxRetries:r,abortSignal:i}),Oa=QS(t),wt=zS(o),Vd=HS({model:e,telemetry:t,headers:n,settings:{...wt,maxRetries:Wy}}),Ke=this;_d({name:"ai.streamText",attributes:en({telemetry:t,attributes:{...bd({operationId:"ai.streamText",telemetry:t}),...Vd,"ai.prompt":{input:()=>JSON.stringify({system:a,prompt:u,messages:c})}}}),tracer:Oa,endWhenDone:!1,fn:async pe=>{de=pe;async function ge({currentStep:_e,responseMessages:Q,usage:tt}){var R,he,un,Jd,Gd;let Wd=Ke.includeRawChunks;ae=new va;let Kd=await WS({system:a,prompt:u,messages:c}),ln=[...Kd.messages,...Q],pt=await b?.({model:e,steps:re,stepNumber:re.length,messages:ln}),Hd=await OS({prompt:{system:(R=pt?.system)!=null?R:Kd.system,messages:(he=pt?.messages)!=null?he:ln},supportedUrls:await e.supportedUrls,download:te}),cn=hv((un=pt?.model)!=null?un:e),{toolChoice:ja,tools:Pa}=FS({tools:l,toolChoice:(Jd=pt?.toolChoice)!=null?Jd:d,activeTools:(Gd=pt?.activeTools)!=null?Gd:y}),{result:{stream:Hy,response:Yd,request:Xd},doStreamSpan:hr,startTimestampMs:Qd}=await Ky(()=>_d({name:"ai.streamText.doStream",attributes:en({telemetry:t,attributes:{...bd({operationId:"ai.streamText.doStream",telemetry:t}),...Vd,"ai.model.provider":cn.provider,"ai.model.id":cn.modelId,"ai.prompt.messages":{input:()=>eI(Hd)},"ai.prompt.tools":{input:()=>Pa?.map(L=>JSON.stringify(L))},"ai.prompt.toolChoice":{input:()=>ja!=null?JSON.stringify(ja):void 0},"gen_ai.system":cn.provider,"gen_ai.request.model":cn.modelId,"gen_ai.request.frequency_penalty":wt.frequencyPenalty,"gen_ai.request.max_tokens":wt.maxOutputTokens,"gen_ai.request.presence_penalty":wt.presencePenalty,"gen_ai.request.stop_sequences":wt.stopSequences,"gen_ai.request.temperature":wt.temperature,"gen_ai.request.top_k":wt.topK,"gen_ai.request.top_p":wt.topP}}),tracer:Oa,endWhenDone:!1,fn:async L=>({startTimestampMs:$(),doStreamSpan:L,result:await cn.doStream({...wt,tools:Pa,toolChoice:ja,responseFormat:f?.responseFormat,prompt:Hd,providerOptions:g,abortSignal:i,headers:n,includeRawChunks:Wd})})})),Yy=kI({tools:l,generatorStream:Hy,tracer:Oa,telemetry:t,system:a,messages:ln,repairToolCall:p,abortSignal:i,experimental_context:U}),Xy=Xd??{},Zo=[],Na=[],za,Ra={},vr="unknown",rt={inputTokens:void 0,outputTokens:void 0,totalTokens:void 0},Fa,ep=!0,mt={id:P(),timestamp:_(),modelId:e.modelId},tp="";Ke.addStream(Yy.pipeThrough(new TransformStream({async transform(L,xe){var dn,pn,Lo,kt;if(L.type==="stream-start"){za=L.warnings;return}if(ep){let Te=$()-Qd;ep=!1,hr.addEvent("ai.stream.firstChunk",{"ai.response.msToFirstChunk":Te}),hr.setAttributes({"ai.response.msToFirstChunk":Te}),xe.enqueue({type:"start-step",request:Xy,warnings:za??[]})}let rp=L.type;switch(rp){case"text-start":case"text-end":{xe.enqueue(L);break}case"text-delta":{L.delta.length>0&&(xe.enqueue({type:"text-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata}),tp+=L.delta);break}case"reasoning-start":case"reasoning-end":{xe.enqueue(L);break}case"reasoning-delta":{xe.enqueue({type:"reasoning-delta",id:L.id,text:L.delta,providerMetadata:L.providerMetadata});break}case"tool-call":{xe.enqueue(L),Zo.push(L);break}case"tool-result":{xe.enqueue(L),L.preliminary||Na.push(L);break}case"tool-error":{xe.enqueue(L),Na.push(L);break}case"response-metadata":{mt={id:(dn=L.id)!=null?dn:mt.id,timestamp:(pn=L.timestamp)!=null?pn:mt.timestamp,modelId:(Lo=L.modelId)!=null?Lo:mt.modelId};break}case"finish":{rt=L.usage,vr=L.finishReason,Fa=L.providerMetadata;let Te=$()-Qd;hr.addEvent("ai.stream.finish"),hr.setAttributes({"ai.response.msToFinish":Te,"ai.response.avgOutputTokensPerSecond":1e3*((kt=rt.outputTokens)!=null?kt:0)/Te});break}case"file":{xe.enqueue(L);break}case"source":{xe.enqueue(L);break}case"tool-input-start":{Ra[L.id]=L.toolName;let Te=l?.[L.toolName];Te?.onInputStart!=null&&await Te.onInputStart({toolCallId:L.id,messages:ln,abortSignal:i,experimental_context:U}),xe.enqueue({...L,dynamic:Te?.type==="dynamic"});break}case"tool-input-end":{delete Ra[L.id],xe.enqueue(L);break}case"tool-input-delta":{let Te=Ra[L.id],Ma=l?.[Te];Ma?.onInputDelta!=null&&await Ma.onInputDelta({inputTextDelta:L.delta,toolCallId:L.id,messages:ln,abortSignal:i,experimental_context:U}),xe.enqueue(L);break}case"error":{xe.enqueue(L),vr="error";break}case"raw":{Wd&&xe.enqueue(L);break}default:{let Te=rp;throw new Error(`Unknown chunk type: ${Te}`)}}},async flush(L){let xe=Zo.length>0?JSON.stringify(Zo):void 0;try{hr.setAttributes(en({telemetry:t,attributes:{"ai.response.finishReason":vr,"ai.response.text":{output:()=>tp},"ai.response.toolCalls":{output:()=>xe},"ai.response.id":mt.id,"ai.response.model":mt.modelId,"ai.response.timestamp":mt.timestamp.toISOString(),"ai.response.providerMetadata":JSON.stringify(Fa),"ai.usage.inputTokens":rt.inputTokens,"ai.usage.outputTokens":rt.outputTokens,"ai.usage.totalTokens":rt.totalTokens,"ai.usage.reasoningTokens":rt.reasoningTokens,"ai.usage.cachedInputTokens":rt.cachedInputTokens,"gen_ai.response.finish_reasons":[vr],"gen_ai.response.id":mt.id,"gen_ai.response.model":mt.modelId,"gen_ai.usage.input_tokens":rt.inputTokens,"gen_ai.usage.output_tokens":rt.outputTokens}}))}catch{}finally{hr.end()}L.enqueue({type:"finish-step",finishReason:vr,usage:rt,providerMetadata:Fa,response:{...mt,headers:Yd?.headers}});let dn=tI(tt,rt);await ae.promise;let pn=Zo.filter(kt=>kt.providerExecuted!==!0),Lo=Na.filter(kt=>kt.providerExecuted!==!0);if(pn.length>0&&Lo.length===pn.length&&!await cI({stopConditions:m,steps:re})){Q.push(...zh({content:re[re.length-1].content,tools:l}));try{await ge({currentStep:_e+1,responseMessages:Q,usage:dn})}catch(kt){L.enqueue({type:"error",error:kt}),Ke.closeStream()}}else L.enqueue({type:"finish",finishReason:vr,totalUsage:dn}),Ke.closeStream()}})))}await ge({currentStep:0,responseMessages:[],usage:{inputTokens:void 0,outputTokens:void 0,totalTokens:void 0}})}}).catch(pe=>{Ke.addStream(new ReadableStream({start(ge){ge.enqueue({type:"error",error:pe}),ge.close()}})),Ke.closeStream()})}get steps(){return this.consumeStream(),this._steps.promise}get finalStep(){return this.steps.then(e=>e[e.length-1])}get content(){return this.finalStep.then(e=>e.content)}get warnings(){return this.finalStep.then(e=>e.warnings)}get providerMetadata(){return this.finalStep.then(e=>e.providerMetadata)}get text(){return this.finalStep.then(e=>e.text)}get reasoningText(){return this.finalStep.then(e=>e.reasoningText)}get reasoning(){return this.finalStep.then(e=>e.reasoning)}get sources(){return this.finalStep.then(e=>e.sources)}get files(){return this.finalStep.then(e=>e.files)}get toolCalls(){return this.finalStep.then(e=>e.toolCalls)}get staticToolCalls(){return this.finalStep.then(e=>e.staticToolCalls)}get dynamicToolCalls(){return this.finalStep.then(e=>e.dynamicToolCalls)}get toolResults(){return this.finalStep.then(e=>e.toolResults)}get staticToolResults(){return this.finalStep.then(e=>e.staticToolResults)}get dynamicToolResults(){return this.finalStep.then(e=>e.dynamicToolResults)}get usage(){return this.finalStep.then(e=>e.usage)}get request(){return this.finalStep.then(e=>e.request)}get response(){return this.finalStep.then(e=>e.response)}get totalUsage(){return this.consumeStream(),this._totalUsage.promise}get finishReason(){return this.consumeStream(),this._finishReason.promise}teeStream(){let[e,t]=this.baseStream.tee();return this.baseStream=t,e}get textStream(){return ha(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){e.type==="text-delta"&&t.enqueue(e.text)}})))}get fullStream(){return ha(this.teeStream().pipeThrough(new TransformStream({transform({part:e},t){t.enqueue(e)}})))}async consumeStream(e){var t;try{await xI({stream:this.fullStream,onError:e?.onError})}catch(n){(t=e?.onError)==null||t.call(e,n)}}get experimental_partialOutputStream(){if(this.output==null)throw new U$;return ha(this.teeStream().pipeThrough(new TransformStream({transform({partialOutput:e},t){e!=null&&t.enqueue(e)}})))}toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r=!0,sendSources:i=!1,sendStart:a=!0,sendFinish:u=!0,onError:c=ft}={}){let l=t!=null?fI({originalMessages:e,responseMessageId:t}):void 0,d={},v=p=>{var m,f;let g=d[p];return((f=(m=this.tools)==null?void 0:m[g])==null?void 0:f.type)==="dynamic"?!0:void 0},y=this.fullStream.pipeThrough(new TransformStream({transform:async(p,m)=>{let f=o?.({part:p}),g=p.type;switch(g){case"text-start":{m.enqueue({type:"text-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-delta":{m.enqueue({type:"text-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"text-end":{m.enqueue({type:"text-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-start":{m.enqueue({type:"reasoning-start",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-delta":{r&&m.enqueue({type:"reasoning-delta",id:p.id,delta:p.text,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"reasoning-end":{m.enqueue({type:"reasoning-end",id:p.id,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"file":{m.enqueue({type:"file",mediaType:p.file.mediaType,url:`data:${p.file.mediaType};base64,${p.file.base64}`});break}case"source":{i&&p.sourceType==="url"&&m.enqueue({type:"source-url",sourceId:p.id,url:p.url,title:p.title,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}}),i&&p.sourceType==="document"&&m.enqueue({type:"source-document",sourceId:p.id,mediaType:p.mediaType,title:p.title,filename:p.filename,...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{}});break}case"tool-input-start":{d[p.id]=p.toolName;let b=v(p.id);m.enqueue({type:"tool-input-start",toolCallId:p.id,toolName:p.toolName,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...b!=null?{dynamic:b}:{}});break}case"tool-input-delta":{m.enqueue({type:"tool-input-delta",toolCallId:p.id,inputTextDelta:p.delta});break}case"tool-call":{d[p.toolCallId]=p.toolName;let b=v(p.toolCallId);p.invalid?m.enqueue({type:"tool-input-error",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...b!=null?{dynamic:b}:{},errorText:c(p.error)}):m.enqueue({type:"tool-input-available",toolCallId:p.toolCallId,toolName:p.toolName,input:p.input,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.providerMetadata!=null?{providerMetadata:p.providerMetadata}:{},...b!=null?{dynamic:b}:{}});break}case"tool-result":{let b=v(p.toolCallId);m.enqueue({type:"tool-output-available",toolCallId:p.toolCallId,output:p.output,...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...p.preliminary!=null?{preliminary:p.preliminary}:{},...b!=null?{dynamic:b}:{}});break}case"tool-error":{let b=v(p.toolCallId);m.enqueue({type:"tool-output-error",toolCallId:p.toolCallId,errorText:c(p.error),...p.providerExecuted!=null?{providerExecuted:p.providerExecuted}:{},...b!=null?{dynamic:b}:{}});break}case"error":{m.enqueue({type:"error",errorText:c(p.error)});break}case"start-step":{m.enqueue({type:"start-step"});break}case"finish-step":{m.enqueue({type:"finish-step"});break}case"start":{a&&m.enqueue({type:"start",...f!=null?{messageMetadata:f}:{},...l!=null?{messageId:l}:{}});break}case"finish":{u&&m.enqueue({type:"finish",...f!=null?{messageMetadata:f}:{}});break}case"abort":{m.enqueue(p);break}case"tool-input-end":break;case"raw":break;default:{let b=g;throw new Error(`Unknown chunk type: ${b}`)}}f!=null&&g!=="start"&&g!=="finish"&&m.enqueue({type:"message-metadata",messageMetadata:f})}}));return ha(bI({stream:y,messageId:l??t?.(),originalMessages:e,onFinish:n,onError:c}))}pipeUIMessageStreamToResponse(e,{originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:c,onError:l,...d}={}){_I({response:e,stream:this.toUIMessageStream({originalMessages:t,generateMessageId:n,onFinish:o,messageMetadata:r,sendReasoning:i,sendSources:a,sendFinish:u,sendStart:c,onError:l}),...d})}pipeTextStreamToResponse(e,t){pI({response:e,textStream:this.textStream,...t})}toUIMessageStreamResponse({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:c,...l}={}){return mI({stream:this.toUIMessageStream({originalMessages:e,generateMessageId:t,onFinish:n,messageMetadata:o,sendReasoning:r,sendSources:i,sendFinish:a,sendStart:u,onError:c}),...l})}toTextStreamResponse(e){return dI({textStream:this.textStream,...e})}};var WN=zt({prefix:"aiobj",size:24});var HN=zt({prefix:"aiobj",size:24});var EI={};F$(EI,{object:()=>CI,text:()=>TI});var TI=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),CI=({schema:e})=>{let t=cr(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){let o=await Ev(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value};default:{let r=o.state;throw new Error(`Unsupported parse state: ${r}`)}}},async parseOutput({text:n},o){let r=await yt({text:n});if(!r.success)throw new Ah({message:"No object generated: could not parse the response.",cause:r.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});let i=await Rt({value:r.value,schema:t});if(!i.success)throw new Ah({message:"No object generated: response did not match schema.",cause:i.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return i.value}}};var AI="AI_NoSuchProviderError",OI=`vercel.ai.error.${AI}`,jI=Symbol.for(OI),PI;PI=jI;var NI=s.looseObject({name:s.string(),version:s.string()}),xd=s.looseObject({_meta:s.optional(s.object({}).loose())}),Ao=xd,zI=s.object({method:s.string(),params:s.optional(xd)}),RI=s.looseObject({experimental:s.optional(s.object({}).loose()),logging:s.optional(s.object({}).loose()),prompts:s.optional(s.looseObject({listChanged:s.optional(s.boolean())})),resources:s.optional(s.looseObject({subscribe:s.optional(s.boolean()),listChanged:s.optional(s.boolean())})),tools:s.optional(s.looseObject({listChanged:s.optional(s.boolean())}))}),e4=Ao.extend({protocolVersion:s.string(),capabilities:RI,serverInfo:NI,instructions:s.optional(s.string())}),FI=Ao.extend({nextCursor:s.optional(s.string())}),MI=s.object({name:s.string(),description:s.optional(s.string()),inputSchema:s.object({type:s.literal("object"),properties:s.optional(s.object({}).loose())}).loose()}).loose(),t4=FI.extend({tools:s.array(MI)}),UI=s.object({type:s.literal("text"),text:s.string()}).loose(),ZI=s.object({type:s.literal("image"),data:s.base64(),mimeType:s.string()}).loose(),Cv=s.object({uri:s.string(),mimeType:s.optional(s.string())}).loose(),LI=Cv.extend({text:s.string()}),BI=Cv.extend({blob:s.base64()}),qI=s.object({type:s.literal("resource"),resource:s.union([LI,BI])}).loose(),r4=Ao.extend({content:s.array(s.union([UI,ZI,qI])),isError:s.boolean().default(!1).optional()}).or(Ao.extend({toolResult:s.unknown()})),ba="2.0",VI=s.object({jsonrpc:s.literal(ba),id:s.union([s.string(),s.number().int()])}).merge(zI).strict(),JI=s.object({jsonrpc:s.literal(ba),id:s.union([s.string(),s.number().int()]),result:Ao}).strict(),GI=s.object({jsonrpc:s.literal(ba),id:s.union([s.string(),s.number().int()]),error:s.object({code:s.number().int(),message:s.string(),data:s.optional(s.unknown())})}).strict(),WI=s.object({jsonrpc:s.literal(ba)}).merge(s.object({method:s.string(),params:s.optional(xd)})).strict(),n4=s.union([VI,WI,JI,GI]);var KI=s.object({type:s.literal("text"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),HI=s.object({type:s.literal("reasoning"),text:s.string(),state:s.enum(["streaming","done"]).optional(),providerMetadata:Y.optional()}),YI=s.object({type:s.literal("source-url"),sourceId:s.string(),url:s.string(),title:s.string().optional(),providerMetadata:Y.optional()}),XI=s.object({type:s.literal("source-document"),sourceId:s.string(),mediaType:s.string(),title:s.string(),filename:s.string().optional(),providerMetadata:Y.optional()}),QI=s.object({type:s.literal("file"),mediaType:s.string(),filename:s.string().optional(),url:s.string(),providerMetadata:Y.optional()}),eE=s.object({type:s.literal("step-start")}),tE=s.object({type:s.string().startsWith("data-"),id:s.string().optional(),data:s.unknown()}),rE=[s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-streaming"),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("input-available"),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-available"),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.literal("dynamic-tool"),toolName:s.string(),toolCallId:s.string(),state:s.literal("output-error"),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],nE=[s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-streaming"),providerExecuted:s.boolean().optional(),input:s.unknown().optional(),output:s.never().optional(),errorText:s.never().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("input-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.never().optional(),callProviderMetadata:Y.optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-available"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.unknown(),errorText:s.never().optional(),callProviderMetadata:Y.optional(),preliminary:s.boolean().optional()}),s.object({type:s.string().startsWith("tool-"),toolCallId:s.string(),state:s.literal("output-error"),providerExecuted:s.boolean().optional(),input:s.unknown(),output:s.never().optional(),errorText:s.string(),callProviderMetadata:Y.optional()})],i4=s.object({id:s.string(),role:s.enum(["system","user","assistant"]),metadata:s.unknown().optional(),parts:s.array(s.union([KI,HI,YI,XI,QI,eE,tE,...rE,...nE]))});var Ze="make a 300 word story";import Oo from"fs";var Av={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bright:"\x1B[1m",dim:"\x1B[2m"};function Pe(e,t){return`${Av[t]}${e}${Av.reset}`}var _a=class{constructor(t,n){this.providerName=t,this.modelName=n,this.config=this.loadConfig(),this.validateProviderAndModel()}loadConfig(){let t="ai-benchmark-config.json";if(!Oo.existsSync(t))throw new Error("Configuration file ai-benchmark-config.json not found");let n=Oo.readFileSync(t,"utf8");return JSON.parse(n)}validateProviderAndModel(){let t=this.config.providers.find(o=>o.name===this.providerName);if(!t)throw new Error(`Provider '${this.providerName}' not found in configuration`);let n=t.models.find(o=>o.name===this.modelName);if(!n)throw new Error(`Model '${this.modelName}' not found for provider '${this.providerName}'`);this.provider=t,this.model=n}async runBenchmark(){console.log("=== LLM Benchmark ==="),console.log(`Provider: ${this.providerName}`),console.log(`Model: ${this.modelName} (${this.model.name})`),console.log("Starting benchmark..."),this.startTime=new Date,console.log(`Start time: ${this.startTime.toISOString()}`);let t=await this.makeApiCall();this.endTime=new Date,console.log(`End time: ${this.endTime.toISOString()}`),this.calculateAndDisplayMetrics(t)}async makeApiCall(){let t=this.provider.type==="anthropic"?"/v1/messages":"/chat/completions",n=`${this.provider.baseUrl}${t}`,o={"Content-Type":"application/json",Authorization:`Bearer ${this.provider.apiKey}`};this.provider.type==="anthropic"&&(o["x-api-key"]=this.provider.apiKey,o["anthropic-version"]="2023-06-01");let r={model:this.model.name,messages:[{role:"user",content:Ze}],max_tokens:1e3,temperature:.7};this.provider.type==="anthropic"&&(r.model=this.model.name,r.max_tokens=1e3);let i=await fetch(n,{method:"POST",headers:o,body:JSON.stringify(r)});if(!i.ok)throw new Error(`API request failed: ${i.status} ${i.statusText}`);return await i.json()}calculateAndDisplayMetrics(t){let n=(this.endTime-this.startTime)/1e3,o,r;this.provider.type==="anthropic"?(o=t.usage?.input_tokens||this.estimateTokens(Ze),r=t.usage?.output_tokens||this.estimateTokens(t.content?.[0]?.text||"")):(o=t.usage?.prompt_tokens||this.estimateTokens(Ze),r=t.usage?.completion_tokens||this.estimateTokens(t.choices?.[0]?.message?.content||""));let i=o+r,a=n>0?i/n:0;console.log(`
79
+ === Results ===`),console.log(`Duration: ${n.toFixed(3)} seconds`),console.log(`Input tokens: ${o}`),console.log(`Output tokens: ${r}`),console.log(`Total tokens: ${i}`),console.log(`Tokens per second: ${a.toFixed(2)}`)}estimateTokens(t){return Math.round(t.length/4)}async runBenchmarkForResults(){try{this.startTime=new Date;let t=await this.makeApiCall();this.endTime=new Date;let n=(this.endTime-this.startTime)/1e3,o,r;this.provider.type==="anthropic"?(o=t.usage?.input_tokens||this.estimateTokens(Ze),r=t.usage?.output_tokens||this.estimateTokens(t.content?.[0]?.text||"")):(o=t.usage?.prompt_tokens||this.estimateTokens(Ze),r=t.usage?.completion_tokens||this.estimateTokens(t.choices?.[0]?.message?.content||""));let i=o+r,a=n>0?i/n:0;return{provider:this.providerName,model:this.modelName,totalTokens:i,tokensPerSecond:Math.round(a*100)/100,duration:Math.round(n*1e3)/1e3,success:!0}}catch(t){return{provider:this.providerName,model:this.modelName,totalTokens:0,tokensPerSecond:0,duration:0,success:!1,error:t.message}}}},xa=class{constructor(t){this.config=t}async runAll(){console.log("=== LLM Benchmark ==="),console.log("Running benchmarks on all configured models..."),console.log(`Starting at ${new Date().toISOString()}`),console.log("");let t=this.createBenchmarks(),n=await this.runParallel(t);this.displayResultsTable(n),this.displaySummary(n)}async runSilent(){let t=this.createBenchmarks();return await this.runParallel(t)}createBenchmarks(){let t=[];return this.config.providers.forEach(n=>{n.models.forEach(o=>{t.push(new _a(n.name,o.name))})}),t}async runParallel(t){let n=[],o=t.map(i=>i.runBenchmarkForResults()),r=await Promise.all(o);return n.push(...r),n}displayResultsTable(t){let n=t.sort((d,v)=>v.tokensPerSecond-d.tokensPerSecond),o=6,r=Math.max(...n.map(d=>d.provider.length),8),i=Math.max(...n.map(d=>d.model.length),5),a=12,u=15,c=`| ${"Rank".padStart(o)} | ${"Provider".padEnd(r)} | ${"Model".padEnd(i)} | ${"Total Tokens".padStart(a)} | ${"Tokens/sec".padStart(u)} |`,l=`| ${"-".repeat(o)} | ${"-".repeat(r)} | ${"-".repeat(i)} | ${"-".repeat(a)} | ${"-".repeat(u)} |`;console.log(""),console.log(Pe("PERFORMANCE RANKINGS - Fastest at Top","cyan")),console.log(c),console.log(l),n.forEach((d,v)=>{let y=v+1,p=y.toString().padStart(o);if(d.success){let m=d.provider.padEnd(r),f=d.model.padEnd(i),g=d.totalTokens.toString().padStart(a),b=d.tokensPerSecond.toString().padStart(u),D=p;y===1?D=Pe("1st","yellow")+p.slice(3):y===2?D=Pe("2nd","white")+p.slice(3):y===3&&(D=Pe("3rd","bright")+p.slice(3)),console.log(`| ${D} | ${m} | ${f} | ${g} | ${b} |`)}else{let m=d.provider.padEnd(r),f=d.model.padEnd(i),g="ERROR".padStart(a),b="FAILED".padStart(u);console.log(`| ${p} | ${m} | ${f} | ${g} | ${b} |`)}}),console.log("")}displaySummary(t){let n=t.filter(r=>r.success),o=t.filter(r=>!r.success);if(console.log(Pe("=== SUMMARY ===","cyan")),console.log(Pe(`Total benchmarks: ${t.length}`,"white")),console.log(Pe(`Successful: ${n.length}`,"green")),console.log(Pe(`Failed: ${o.length}`,"red")),n.length>0){let r=n.reduce((u,c)=>u+c.tokensPerSecond,0)/n.length,i=n.reduce((u,c)=>c.tokensPerSecond>u.tokensPerSecond?c:u),a=n.reduce((u,c)=>c.tokensPerSecond<u.tokensPerSecond?c:u);console.log(Pe(`Average tokens/sec: ${r.toFixed(2)}`,"yellow")),console.log(Pe(`Fastest: ${i.provider}/${i.model} (${i.tokensPerSecond} tokens/sec)`,"green")),console.log(Pe(`Slowest: ${a.provider}/${a.model} (${a.tokensPerSecond} tokens/sec)`,"red"))}if(o.length>0&&(console.log(Pe(`
80
+ Failed benchmarks:`,"red")),o.forEach(r=>{console.log(Pe(` FAILED ${r.provider}/${r.model}: ${r.error}`,"red"))})),n.length>0){console.log(Pe(`
81
+ === PROVIDER PERFORMANCE ===`,"cyan"));let r={};n.forEach(a=>{r[a.provider]||(r[a.provider]={totalTps:0,count:0,models:[]}),r[a.provider].totalTps+=a.tokensPerSecond,r[a.provider].count+=1,r[a.provider].models.push(a)}),Object.entries(r).map(([a,u])=>({provider:a,avgTps:u.totalTps/u.count,modelCount:u.count,models:u.models})).sort((a,u)=>u.avgTps-a.avgTps).forEach((a,u)=>{let c=u+1,l=c===1?"1st":c===2?"2nd":c===3?"3rd":`${c}th`;console.log(Pe(`${l} ${a.provider}: ${a.avgTps.toFixed(2)} avg tokens/sec (${a.modelCount} models)`,c===1?"yellow":c===2?"white":c===3?"bright":"white"))})}}},Dd=class{constructor(t){this.config=t,this.csvFile=`llm_benchmark_results_${new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5)}.csv`,this.running=!0,this.setupSignalHandlers()}setupSignalHandlers(){process.on("SIGINT",()=>{this.running=!1,console.log(`
82
+ Stopping tracking...`)}),process.on("SIGTERM",()=>{this.running=!1,console.log(`
83
+ Stopping tracking...`)})}async startTracking(){for(console.log("=== LLM Performance Tracker ==="),console.log("Tracking all models every 60 seconds"),console.log(`Results will be saved to: ${this.csvFile}`),console.log("Press Ctrl+C to stop tracking"),console.log(""),this.initializeCsv(),await this.runTrackingCycle();this.running&&(await this.sleep(6e4),!!this.running);)await this.runTrackingCycle();console.log(`
84
+ Tracking stopped by user`),console.log(`Results saved to: ${this.csvFile}`)}initializeCsv(){Oo.writeFileSync(this.csvFile,`timestamp,provider_model,tokens_per_second,total_tokens,duration_seconds
85
+ `)}async runTrackingCycle(){let t=new Date;console.log(`[${t.toISOString()}] Running benchmark cycle...`);let o=await new xa(this.config).runSilent();this.writeResultsToCsv(t,o),this.displayCycleSummary(o)}writeResultsToCsv(t,n){let o=n.filter(r=>r.success).map(r=>{let i=`${r.provider}+${r.model}`;return[t.toISOString(),i,r.tokensPerSecond,r.totalTokens,r.duration].join(",")}).join(`
86
+ `);o&&Oo.appendFileSync(this.csvFile,o+`
87
+ `)}displayCycleSummary(t){let n=t.filter(r=>r.success),o=t.filter(r=>!r.success);if(console.log(` Completed: ${n.length} successful, ${o.length} failed`),n.length>0){let r=n.reduce((i,a)=>i+a.tokensPerSecond,0)/n.length;console.log(` Average tokens/sec: ${r.toFixed(2)}`)}if(o.length>0){let r=o.map(i=>`${i.provider}/${i.model}`).join(", ");console.log(` Failed: ${r}`)}}sleep(t){return new Promise(n=>setTimeout(n,t))}};function oE(){let e=process.argv.slice(2),t={};for(let n=0;n<e.length;n++)switch(e[n]){case"--provider":t.provider=e[++n];break;case"--model":t.model=e[++n];break;case"--all":t.all=!0;break;case"--track":t.track=!0;break;case"--help":iE(),process.exit(0);break}if(t.track&&!t.all&&(console.log("Error: --track requires --all"),console.log("Use --help for usage information"),process.exit(1)),t.all)return t;if(t.provider&&t.model)return t;console.log("Error: Either --provider and --model, or --all is required"),console.log("Use --help for usage information"),process.exit(1)}function iE(){console.log("Usage: node benchmark-rest.js --provider PROVIDER --model MODEL"),console.log(" node benchmark-rest.js --all [--track]"),console.log(""),console.log("Options:"),console.log(" --provider PROVIDER Provider name from ai-benchmark-config.json"),console.log(" --model MODEL Model name from ai-benchmark-config.json"),console.log(" --all Run benchmark on all configured models"),console.log(" --track Enable continuous tracking with CSV output (requires --all)"),console.log(" --help Display this help message")}async function aE(){try{let e=oE();if(e.all){let t=JSON.parse(Oo.readFileSync("ai-benchmark-config.json","utf8"));e.track?await new Dd(t).startTracking():await new xa(t).runAll()}else await new _a(e.provider,e.model).runBenchmark()}catch(e){console.error(`Error: ${e.message}`),process.exit(1)}}process.on("SIGINT",()=>{console.log(`
88
+ Benchmark interrupted by user`),process.exit(0)});import.meta.url===`file://${process.argv[1]}`&&process.argv[1].endsWith("benchmark-rest.js")&&aE();Id();rn();var By=ib(Uy(),1);import"dotenv/config";var Bd=process.argv.includes("--debug"),Uo=null;function me(e){if(!Bd)return;let n=`[${new Date().toISOString()}] ${e}
89
+ `;Uo||(Uo=Ta.createWriteStream("debug.log",{flags:"w"})),Uo.write(n),(e.includes("ERROR")||e.includes("Creating")||e.includes("API Request"))&&console.log(n.trim())}function tT(e,t){me(`Creating Anthropic provider with baseUrl: ${e}`),me(`API Key length: ${t?t.length:0}`);let n=e;e.endsWith("/v1")||(n=e.endsWith("/")?`${e}v1`:`${e}/v1`,me(`Normalized base URL to: ${n}`));let o=od({apiKey:t,baseURL:n,fetch:Bd?async(r,i)=>{me(`API Request to: ${r}`);let a=await fetch(r,i);return me(`Response status: ${a.status}`),a}:void 0});return me(`Provider created successfully: ${o?"yes":"no"}`),o}var Ca=eT.createInterface({input:process.stdin,output:process.stdout}),Zy={reset:"\x1B[0m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bright:"\x1B[1m",dim:"\x1B[2m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m"};function h(e,t){return`${Zy[t]}${e}${Zy.reset}`}try{process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8")}catch{}function X(e){return new Promise(t=>Ca.question(e,t))}function Ee(){console.clear()}function xt(){console.log(h("Ai-speedometer","cyan")),console.log(h("=============================","cyan")),console.log(h("Note: opencode uses ai-sdk","dim")),console.log("")}async function qd(){try{let e="ai-benchmark-config.json";if(Ta.existsSync(e)){console.log(h("Migrating from old config format to opencode format...","yellow"));try{let n=Ta.readFileSync(e,"utf8"),o=JSON.parse(n),r=await Ad(o);console.log(h(`Migration complete: ${r.migrated} items migrated`,"green")),r.failed>0&&(console.log(h(`Migration warnings: ${r.failed} items failed`,"yellow")),r.errors.forEach(i=>{console.log(h(` - ${i}`,"dim"))})),Ta.renameSync(e,`${e}.backup`),console.log(h("Old config backed up as ai-benchmark-config.json.backup","cyan")),await X(h("Press Enter to continue...","yellow"))}catch(n){console.log(h("Migration failed: ","red")+n.message),await X(h("Press Enter to continue with empty config...","yellow"))}}return{providers:await Cd(),verifiedProviders:{}}}catch(e){return console.log(h("Error loading config, starting fresh: ","yellow")+e.message),{providers:[],verifiedProviders:{}}}}async function rT(e){console.log(h("Note: Configuration is now automatically saved to opencode files","cyan"))}function an(){return new Promise(e=>{process.stdin.isRaw?process.stdin.once("data",t=>{t===""&&process.exit(0),e(t)}):Ca.question(h("Press Enter to continue...","yellow"),()=>{e("\r")})})}async function Ly(){Ee(),xt(),console.log(h("Select Models for Benchmark","magenta")),console.log("");let e=await qd();if(e.providers.length===0)return console.log(h("No providers available. Please add a provider first.","red")),await X(h("Press Enter to continue...","yellow")),[];let t=[];e.providers.forEach(l=>{l.models.forEach(d=>{t.push({...d,providerName:l.name,providerType:l.type,providerId:l.id,providerConfig:{...l,apiKey:l.apiKey||"",baseUrl:l.baseUrl||""},selected:!1})})});let n=0,o=0,r="",i=[...t],a=l=>{if(!l.trim())return[...t];let d=l.toLowerCase();return t.filter(v=>{let y=v.name.toLowerCase().includes(d),p=v.providerName.toLowerCase().includes(d),m=v.providerId.toLowerCase().includes(d),f=v.providerType.toLowerCase().includes(d);return y||p||m||f})},u,c=(l,d)=>{clearTimeout(u),u=setTimeout(()=>{d(a(l))},50)};for(;;){let l="";l+=h("Ai-speedometer","cyan")+`
90
+ `,l+=h("=============================","cyan")+`
91
+ `,l+=h("Note: opencode uses ai-sdk","dim")+`
92
+ `,l+=`
93
+ `,l+=h("Select Models for Benchmark","magenta")+`
94
+ `,l+=h("Use \u2191\u2193 arrows to navigate, TAB to select/deselect, ENTER to run benchmark","cyan")+`
95
+ `,l+=h("Type to search (real-time filtering)","cyan")+`
96
+ `,l+=h('Press "A" to select all models, "N" to deselect all',"cyan")+`
97
+ `,l+=h("Circle states: \u25CF=Current+Selected \u25CB=Current+Unselected \u25CF=Selected \u25CB=Unselected","dim")+`
98
+ `,l+=h("Quick run: ENTER on any model | Multi-select: TAB then ENTER","dim")+`
99
+ `,l+=`
100
+ `,l+=h("Search: ","yellow")+h(r+"_","bright")+`
101
+ `,l+=`
102
+ `;let d=Vy(12),v=Math.ceil(i.length/d);o>=v&&(o=v-1),o<0&&(o=0);let y=o*d,p=Math.min(y+d,i.length);l+=h("Available Models:","yellow")+`
103
+ `,l+=`
104
+ `;for(let f=y;f<p;f++){let g=i[f],b=f===n,D=g.selected,$;b&&D?$=h("\u25CF","green"):b&&!D?$=h("\u25CB","green"):!b&&D?$=h("\u25CF","cyan"):$=h("\u25CB","dim");let _=b?h(g.name,"bright"):h(g.name,"white"),P=b?h(`(${g.providerName})`,"cyan"):h(`(${g.providerName})`,"dim");l+=`${$} ${_} ${P}
105
+ `}if(l+=`
106
+ `,l+=h(`Selected: ${t.filter(f=>f.selected).length} models`,"yellow")+`
107
+ `,v>1){let f=h(`Page ${o+1}/${v}`,"cyan"),g=h("Use Page Up/Down to navigate pages","dim");l+=`${f} ${g}
108
+ `,o<v-1&&(l+=h("\u2193 More models below","dim")+`
109
+ `)}Ee(),console.log(l);let m=await an();if(m==="\x1B[A"){let f=o*d,g=Math.min(f+d,i.length);n<=f?n=g-1:n--}else if(m==="\x1B[B"){let f=o*d,g=Math.min(f+d,i.length);n>=g-1?n=f:n++}else if(m==="\x1B[5~")o>0&&(o--,n=o*d);else if(m==="\x1B[6~")o<v-1&&(o++,n=o*d);else if(m===" "){let f=t.indexOf(i[n]);f!==-1&&(t[f].selected=!t[f].selected)}else if(m==="\r"){let f=i[n];if(f){if(!t.some(b=>b.selected)){let b=t.indexOf(f);b!==-1&&(t[b].selected=!0)}break}}else m===""?process.exit(0):m==="\b"||m==="\x7F"?r.length>0&&(r=r.slice(0,-1),c(r,f=>{i=f,n=0,o=0})):m==="A"?r.length===0?i.forEach(f=>{let g=t.indexOf(f);g!==-1&&(t[g].selected=!0)}):(r+=m,c(r,f=>{i=f,n=0,o=0})):m==="N"?r.length===0?i.forEach(f=>{let g=t.indexOf(f);g!==-1&&(t[g].selected=!1)}):(r+=m,c(r,f=>{i=f,n=0,o=0})):m==="a"||m==="n"?(r+=m,c(r,f=>{i=f,n=0,o=0})):(m===" "||m.length===1)&&(r+=m,c(r,f=>{i=f,n=0,o=0}))}return t.filter(l=>l.selected)}async function nT(e){if(e.length===0){console.log(h("No models selected for benchmarking.","red"));return}Ee(),xt(),console.log(h("Running Benchmark...","green")),console.log(h(`Running ${e.length} models in parallel...`,"cyan")),console.log("");let t=async r=>{console.log(h(`Testing ${r.name} (${r.providerName})...`,"yellow"));try{let i=null,a=0,u=Date.now();if(me(`Model provider type: ${r.providerType}`),me(`Model provider config: ${JSON.stringify(r.providerConfig,null,2)}`),!r.providerConfig||!r.providerConfig.apiKey)throw new Error(`Missing API key for provider ${r.providerName}`);if(!r.providerConfig.baseUrl)throw new Error(`Missing base URL for provider ${r.providerName}`);me(`Model provider config baseUrl: ${r.providerConfig.baseUrl}`),me(`Model provider config apiKey: ${r.providerConfig.apiKey?"***"+r.providerConfig.apiKey.slice(-4):"missing"}`);let c=r.name;r.id&&r.id.includes("_")&&(c=r.id.split("_")[1],me(`Using extracted model ID: ${c}`)),c=c.trim(),me(`Using final model ID: "${c}"`);let l;if(r.providerType==="openai-compatible")l={model:Ig({name:r.providerName,apiKey:r.providerConfig.apiKey,baseURL:r.providerConfig.baseUrl})(c),system:""};else if(r.providerType==="anthropic")l={model:tT(r.providerConfig.baseUrl,r.providerConfig.apiKey)(c),system:""};else if(r.providerType==="google"){let{createGoogleGenerativeAI:_}=await import("@ai-sdk/google");l={model:_({apiKey:r.providerConfig.apiKey,baseURL:r.providerConfig.baseUrl})(c),system:""}}else throw new Error(`Unsupported provider type: ${r.providerType}`);let d=Tv({...l,prompt:Ze,maxTokens:500,onChunk:({chunk:_})=>{!i&&_.type==="text-delta"&&(i=Date.now()),_.type==="text-delta"&&a++}}),v="";try{for await(let _ of d.textStream)v+=_,a=Math.round(v.length/4);me(`Stream completed successfully. Total tokens: ${a}`),me(`Full text length: ${v.length} characters`)}catch(_){throw me(`Stream error: ${_.message}`),me(`Error stack: ${_.stack}`),_}Bd&&process.on("exit",()=>{Uo&&Uo.end()});let p=Date.now()-u,m=i?i-u:p,f=a>0&&p>0?a/p*1e3:0,g=null;try{g=await d.usage,me(`Provider usage data: ${JSON.stringify(g,null,2)}`)}catch(_){me(`Usage not available: ${_.message}`)}let b=g?.completionTokens||a,D=g?.promptTokens||Math.round(Ze.length/4),$=g?.totalTokens||b+D;return console.log(h("Completed!","green")),console.log(h(` Total Time: ${(p/1e3).toFixed(2)}s`,"cyan")),console.log(h(` TTFT: ${(m/1e3).toFixed(2)}s`,"cyan")),console.log(h(` Tokens/Sec: ${f.toFixed(1)}`,"cyan")),console.log(h(` Total Tokens: ${$}`,"cyan")),{model:r.name,provider:r.providerName,totalTime:p,timeToFirstToken:m,tokenCount:b,tokensPerSecond:f,promptTokens:D,totalTokens:$,success:!0}}catch(i){return console.log(h("Failed: ","red")+i.message),me(`Benchmark failed: ${i.message}`),me(`Error stack: ${i.stack}`),{model:r.name,provider:r.providerName,totalTime:0,timeToFirstToken:0,tokenCount:0,tokensPerSecond:0,promptTokens:0,totalTokens:0,success:!1,error:i.message}}};console.log(h("Starting parallel benchmark execution...","cyan"));let n=e.map(r=>t(r)),o=await Promise.all(n);console.log(""),console.log(h("All benchmarks completed!","green")),await qy(o,"AI SDK")}async function qy(e,t="AI SDK"){Ee(),xt(),console.log(h("BENCHMARK RESULTS","magenta")),console.log(h("=========================","magenta")),console.log(""),console.log(h("Method: ","cyan")+h(t,"yellow")),console.log("");let n=e.filter(g=>g.success);if(n.length===0){console.log(h("No successful benchmarks to display.","red")),await X(h("Press Enter to continue...","yellow"));return}console.log(h("COMPREHENSIVE PERFORMANCE SUMMARY","yellow")),console.log(h("Note: ","cyan")+h("Benchmark over REST API doesn't utilize streaming, so TTFT is 0. AI SDK utilizes streaming, but","dim")),console.log(h(" ","cyan")+h("if the model is a thinking model, TTFT will be much higher because thinking tokens are not counted as first token.","dim")),console.log("");let o=new By.default({head:[h("Model","cyan"),h("Provider","cyan"),h("Total Time(s)","cyan"),h("TTFT(s)","cyan"),h("Tokens/Sec","cyan"),h("Output Tokens","cyan"),h("Prompt Tokens","cyan"),h("Total Tokens","cyan")],colWidths:[20,15,15,12,15,15,15,15],style:{head:["cyan"],border:["dim"],compact:!1}});[...n].sort((g,b)=>b.tokensPerSecond-g.tokensPerSecond).forEach(g=>{o.push([h(g.model,"white"),h(g.provider,"white"),h((g.totalTime/1e3).toFixed(2),"green"),h((g.timeToFirstToken/1e3).toFixed(2),"yellow"),h(g.tokensPerSecond.toFixed(1),"magenta"),h(g.tokenCount.toString(),"blue"),h(g.promptTokens.toString(),"blue"),h(g.totalTokens.toString(),"bright")])}),console.log(o.toString()),console.log(""),console.log(h("PERFORMANCE COMPARISON CHARTS","yellow")),console.log(h("\u2500".repeat(80),"dim")),console.log("");let i={};n.forEach(g=>{i[g.provider]||(i[g.provider]=[]),i[g.provider].push(g)});let a=Math.max(...n.map(g=>g.model.length)),u=Math.max(...n.map(g=>g.provider.length)),c=8,l=12,d=6;console.log(h("TOTAL TIME RANKING (fastest at top - lower is better)","cyan"));let v=[...n].sort((g,b)=>g.totalTime-b.totalTime),y=Math.max(...n.map(g=>g.totalTime));v.forEach((g,b)=>{let D=b+1,$=Math.floor(g.totalTime/y*25),_=h("\u2588".repeat($),"red")+h("\u2591".repeat(25-$),"dim"),P=(g.totalTime/1e3).toFixed(2)+"s",O=g.tokensPerSecond.toFixed(1)+" tok/s",S=D===1?"1st":D===2?"2nd":D===3?"3rd":`${D}th`;console.log(h(S.padStart(d),D===1?"yellow":D===2?"white":D===3?"bright":"white")+h(" | ","dim")+h(P.padStart(c),"red")+h(" | ","dim")+h(O.padStart(l),"magenta")+h(" | ","dim")+h(g.model.padEnd(a),"white")+h(" | ","dim")+h(g.provider.padEnd(u),"cyan")+h(" | ","dim")+_)}),console.log(""),console.log(h("TOKENS PER SECOND RANKING (fastest at top - higher is better)","cyan"));let p=[...n].sort((g,b)=>b.tokensPerSecond-g.tokensPerSecond),m=Math.max(...n.map(g=>g.tokensPerSecond));p.forEach((g,b)=>{let D=b+1,$=Math.floor(g.tokensPerSecond/m*25),_=h("\u2588".repeat($),"green")+h("\u2591".repeat(25-$),"dim"),P=(g.totalTime/1e3).toFixed(2)+"s",O=g.tokensPerSecond.toFixed(1)+" tok/s",S=D===1?"1st":D===2?"2nd":D===3?"3rd":`${D}.`;console.log(h(S.padStart(d),D===1?"yellow":D===2?"white":D===3?"bright":"white")+h(" | ","dim")+h(O.padStart(l),"green")+h(" | ","dim")+h(P.padStart(c),"red")+h(" | ","dim")+h(g.model.padEnd(a),"white")+h(" | ","dim")+h(g.provider.padEnd(u),"cyan")+h(" | ","dim")+_)}),console.log(""),console.log("");let f=e.filter(g=>!g.success);f.length>0&&(console.log(h("FAILED BENCHMARKS","red")),console.log(h("\u2500".repeat(40),"dim")),f.forEach(g=>{console.log(h(`${g.model} (${g.provider}): ${g.error}`,"red"))}),console.log("")),console.log(h("Benchmark completed!","green")),await X(h("Press Enter to continue...","yellow"))}function Vy(e=8){let t=process.stdout.rows||24;return Math.max(5,t-e)}async function oT(){Ee(),xt(),console.log(h("Add Provider","magenta")),console.log("");let e="",t=[],n=[],o=0,r=0;try{t=await dr(),n=t}catch(i){console.log(h("Error loading providers: ","red")+i.message),await X(h("Press Enter to continue...","yellow"));return}for(;;){let i="";i+=h("Ai-speedometer","cyan")+`
110
+ `,i+=h("=============================","cyan")+`
111
+ `,i+=h("Note: opencode uses ai-sdk","dim")+`
112
+ `,i+=`
113
+ `,i+=h("Add Provider","magenta")+`
114
+ `,i+=h("Use \u2191\u2193 arrows to navigate, ENTER to select","cyan")+`
115
+ `,i+=h("Type to search (real-time filtering)","cyan")+`
116
+ `,i+=h("Navigation is circular","dim")+`
117
+ `,i+=`
118
+ `,i+=h("Search: ","yellow")+h(e+"_","bright")+`
119
+ `,i+=`
120
+ `;let a=Vy(),u=n.length+1,c=Math.ceil(u/a);r>=c&&(r=c-1),r<0&&(r=0);let l=r*a,d=Math.min(l+a,u);i+=h("Available Providers:","cyan")+`
121
+ `,i+=`
122
+ `;for(let p=l;p<d&&p<n.length;p++){let m=n[p],f=p===o,g=f?h("\u25CF","green"):h("\u25CB","dim"),b=f?h(m.name,"bright"):h(m.name,"white"),D=f?h(`(${m.type})`,"cyan"):h(`(${m.type})`,"dim");i+=`${g} ${b} ${D}
123
+ `}let v=n.length;if(v>=l&&v<d){let p=v===o,m=p?h("\u25CF","green"):h("\u25CB","dim"),f=p?h("Add Custom Provider","bright"):h("Add Custom Provider","yellow");i+=`${m} ${f}
124
+ `}if(i+=`
125
+ `,c>1){let p=h(`Page ${r+1}/${c}`,"cyan"),m=h("Use Page Up/Down to navigate pages","dim");i+=`${p} ${m}
126
+ `,r<c-1&&(i+=h("\u2193 More items below","dim")+`
127
+ `)}Ee(),console.log(i);let y=await an();if(y==="\x1B[A"){let p=r*a,m=Math.min(p+a,u);o<=p?o=m-1:o--}else if(y==="\x1B[B"){let p=r*a,m=Math.min(p+a,u);o>=m-1?o=p:o++}else if(y==="\x1B[5~")r>0&&(r--,o=r*a);else if(y==="\x1B[6~")r<c-1&&(r++,o=r*a);else if(y==="\r"){o===n.length?await aT():await iT(n[o]);break}else y===""?process.exit(0):y==="\b"||y==="\x7F"?e.length>0&&(e=e.slice(0,-1),n=await Sd(e),o=0,r=0):y.length===1&&(e+=y,n=await Sd(e),o=0,r=0)}}async function iT(e){Ee(),xt(),console.log(h("Add Verified Provider","magenta")),console.log(""),console.log(h("Provider: ","cyan")+h(e.name,"white")),console.log(h("Type: ","cyan")+h(e.type,"white")),console.log(h("Base URL: ","cyan")+h(e.baseUrl,"white")),console.log("");let t=await Da(e.id);if(t.length===0){console.log(h("No models available for this provider.","red")),await X(h("Press Enter to continue...","yellow"));return}console.log(h(`Found ${t.length} models for ${e.name}`,"cyan")),console.log(h("All models will be automatically added","green")),console.log(""),console.log(h("Models to be added:","yellow"));let n=Math.min(5,t.length);t.slice(0,n).forEach(i=>{console.log(h(` \u2022 ${i.name}`,"white"))}),t.length>n&&console.log(h(` ... and ${t.length-n} more`,"dim")),console.log("");let o=await X(h("Enter API key: ","cyan"));if(!o){console.log(h("API key is required.","red")),await X(h("Press Enter to continue...","yellow"));return}if(!await ka(e.id,o)){console.log(h("Failed to save API key to opencode auth.json","red")),await X(h("Press Enter to continue...","yellow"));return}console.log(""),console.log(h("Provider added successfully!","green")),console.log(h("API key saved to opencode auth.json","cyan")),console.log(h(`Models will be loaded dynamically from ${e.name}`,"cyan")),console.log(h(`Found ${t.length} available models`,"cyan")),await X(h(`
128
+ Press Enter to continue...`,"yellow"))}async function aT(){Ee(),xt(),console.log(h("Add Custom Provider","magenta")),console.log(""),console.log(h("Note: Custom providers are saved to opencode.json","cyan")),console.log("");let e=[{id:1,text:"OpenAI Compatible",type:"openai-compatible"},{id:2,text:"Anthropic",type:"anthropic"},{id:3,text:"Back to provider selection",action:"back"}],t=0,n=null;for(;;){let o="";o+=h("Ai-speedometer","cyan")+`
129
+ `,o+=h("=============================","cyan")+`
130
+ `,o+=h("Note: opencode uses ai-sdk","dim")+`
131
+ `,o+=`
132
+ `,o+=h("Add Custom Provider","magenta")+`
133
+ `,o+=h("Use \u2191\u2193 arrows to navigate, ENTER to select","cyan")+`
134
+ `,o+=h("Navigation is circular","dim")+`
135
+ `,o+=`
136
+ `,o+=h("Select provider type:","cyan")+`
137
+ `,o+=`
138
+ `,e.forEach((i,a)=>{let u=a===t,c=u?h("\u25CF","green"):h("\u25CB","dim"),l=u?h(i.text,"bright"):h(i.text,"yellow");o+=`${c} ${l}
139
+ `}),Ee(),console.log(o);let r=await an();if(r==="\x1B[A")t=(t-1+e.length)%e.length;else if(r==="\x1B[B")t=(t+1)%e.length;else if(r==="\r"){n=e[t];break}else r===""&&process.exit(0)}if(n.action!=="back"){if(n.type==="openai-compatible"){let o=await X(h("Enter provider ID (e.g., my-openai): ","cyan")),r=await X(h("Enter provider name (e.g., MyOpenAI): ","cyan")),i=await X(h("Enter base URL (e.g., https://api.openai.com/v1): ","cyan")),a=await X(h("Enter API key: ","cyan"));console.log(""),console.log(h("Do you want to add multiple models?","cyan")),console.log(h("1. Add single model","yellow")),console.log(h("2. Add multiple models","yellow"));let u=await X(h("Enter choice (1 or 2): ","cyan")),c={};if(u==="2")for(console.log(""),console.log(h("Enter model names (one per line, empty line to finish):","cyan")),console.log(h("Examples: gpt-4, gpt-4-turbo, gpt-3.5-turbo","dim")),console.log("");;){let p=await X(h("Model name: ","cyan"));if(!p.trim())break;let m=p.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");c[m]={name:p.trim()}}else{let p=await X(h("Enter model name (e.g., gpt-4): ","cyan")),m=p.toLowerCase().replace(/[^a-z0-9-]/g,"-");c[m]={name:p}}if(Object.keys(c).length===0){console.log(h("At least one model is required.","red")),await X(h("Press Enter to continue...","yellow"));return}let{readOpencodeConfig:l}=await Promise.resolve().then(()=>(rn(),No)),d=await l();d.provider=d.provider||{},d.provider[o]={name:r,options:{apiKey:a,baseURL:i},models:c};let{writeOpencodeConfig:v}=await Promise.resolve().then(()=>(rn(),No));await v(d)||console.log(h("Warning: Could not save to opencode.json","yellow")),console.log(h("Provider added successfully!","green")),console.log(h(`Added ${Object.keys(c).length} model(s)`,"cyan")),console.log(h("Saved to opencode.json","cyan"))}else if(n.type==="anthropic"){let o=await X(h("Enter provider ID (e.g., my-anthropic): ","cyan")),r=await X(h("Enter provider name (e.g., MyAnthropic): ","cyan")),i=await X(h("Enter base URL (e.g., https://api.anthropic.com): ","cyan")),a=await X(h("Enter Anthropic API key: ","cyan"));console.log(""),console.log(h("Do you want to add multiple models?","cyan")),console.log(h("1. Add single model","yellow")),console.log(h("2. Add multiple models","yellow"));let u=await X(h("Enter choice (1 or 2): ","cyan")),c={};if(u==="2")for(console.log(""),console.log(h("Enter model names (one per line, empty line to finish):","cyan")),console.log(h("Examples: claude-3-sonnet-20240229, claude-3-haiku-20240307","dim")),console.log("");;){let p=await X(h("Model name: ","cyan"));if(!p.trim())break;let m=p.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");c[m]={name:p.trim()}}else{let p=await X(h("Enter model name (e.g., claude-3-sonnet-20240229): ","cyan")),m=p.toLowerCase().replace(/[^a-z0-9-]/g,"-");c[m]={name:p}}if(Object.keys(c).length===0){console.log(h("At least one model is required.","red")),await X(h("Press Enter to continue...","yellow"));return}let{readOpencodeConfig:l}=await Promise.resolve().then(()=>(rn(),No)),d=await l();d.provider=d.provider||{},d.provider[o]={name:r,options:{apiKey:a,baseURL:i},models:c};let{writeOpencodeConfig:v}=await Promise.resolve().then(()=>(rn(),No));await v(d)||console.log(h("Warning: Could not save to opencode.json","yellow")),console.log(h("Provider added successfully!","green")),console.log(h(`Added ${Object.keys(c).length} model(s)`,"cyan")),console.log(h("Saved to opencode.json","cyan"))}await X(h(`
140
+ Press Enter to continue...`,"yellow"))}}async function sT(){Ee(),xt(),console.log(h("OpenCode Integration Debug Info","magenta")),console.log("");let e=await Od();console.log(h("File Paths:","cyan")),console.log(h(` auth.json: ${e.paths.authJson}`,"white")),console.log(h(` opencode.json: ${e.paths.opencodeJson}`,"white")),console.log(""),console.log(h("File Status:","cyan")),console.log(h(` auth.json exists: ${e.authExists?"Yes":"No"}`,"white")),console.log(h(` opencode.json exists: ${e.configExists?"Yes":"No"}`,"white")),console.log(""),console.log(h("Authenticated Providers:","cyan")),e.authData.length===0?console.log(h(" None","dim")):e.authData.forEach(t=>{console.log(h(` - ${t}`,"white"))}),console.log(""),console.log(h("Custom Providers:","cyan")),e.configProviders.length===0?console.log(h(" None","dim")):e.configProviders.forEach(t=>{console.log(h(` - ${t}`,"white"))}),console.log(""),console.log(h("XDG Paths:","cyan")),console.log(h(` Data: ${e.xdgPaths.data}`,"white")),console.log(h(` Config: ${e.xdgPaths.config}`,"white")),console.log(""),await X(h("Press Enter to continue...","yellow"))}async function uT(){Ee(),xt(),console.log(h("Existing Providers","magenta")),console.log("");let e=await qd();e.providers.length===0?console.log(h("No providers configured yet.","yellow")):e.providers.forEach((t,n)=>{console.log(h(`${n+1}. ${t.name} (${t.type})`,"cyan")),t.models.length>0?(console.log(h(" Models:","dim")),t.models.forEach((o,r)=>{console.log(h(` ${r+1}. ${o.name}`,"yellow"))})):console.log(h(" Models: None","dim")),console.log("")}),await X(h("Press Enter to continue...","yellow"))}async function lT(){Ee(),xt(),console.log(h("Add Model to Provider","magenta")),console.log("");let e=await qd();if(e.providers.length===0){console.log(h("No providers available. Please add a provider first.","red")),await X(h("Press Enter to continue...","yellow"));return}let t=0;for(;;){let i="";i+=h("Ai-speedometer","cyan")+`
141
+ `,i+=h("=============================","cyan")+`
142
+ `,i+=h("Note: opencode uses ai-sdk","dim")+`
143
+ `,i+=`
144
+ `,i+=h("Add Model to Provider","magenta")+`
145
+ `,i+=h("Use \u2191\u2193 arrows to navigate, ENTER to select","cyan")+`
146
+ `,i+=h("Navigation is circular","dim")+`
147
+ `,i+=`
148
+ `,i+=h("Select provider:","cyan")+`
149
+ `,i+=`
150
+ `,e.providers.forEach((u,c)=>{let l=c===t,d=l?h("\u25CF","green"):h("\u25CB","dim"),v=l?h(u.name,"bright"):h(u.name,"yellow");i+=`${d} ${v}
151
+ `}),Ee(),console.log(i);let a=await an();if(a==="\x1B[A")t=(t-1+e.providers.length)%e.providers.length;else if(a==="\x1B[B")t=(t+1)%e.providers.length;else{if(a==="\r")break;a===""&&process.exit(0)}}let n=e.providers[t],o=await X(h("Enter new model name: ","cyan")),r=e.customProviders.find(i=>i.id===n.id);r?r.models.push({name:o,id:Date.now().toString()+"_model"}):(n.models.push({name:o,id:Date.now().toString()+"_model"}),e.verifiedProviders&&e.verifiedProviders[n.id]&&delete e.verifiedProviders[n.id],e.customProviders.push(n)),await rT(e),console.log(h("Model added successfully!","green")),await X(h(`
152
+ Press Enter to continue...`,"yellow"))}async function cT(e){if(e.length===0){console.log(h("No models selected for benchmarking.","red"));return}Ee(),xt(),console.log(h("Running REST API Benchmark...","green")),console.log(h(`Running ${e.length} models in parallel...`,"cyan")),console.log(h("Note: This uses direct REST API calls instead of AI SDK","dim")),console.log("");let t=async r=>{console.log(h(`Testing ${r.name} (${r.providerName}) via REST API...`,"yellow"));try{if(!r.providerConfig||!r.providerConfig.apiKey)throw new Error(`Missing API key for provider ${r.providerName}`);if(!r.providerConfig.baseUrl)throw new Error(`Missing base URL for provider ${r.providerName}`);let i=Date.now(),a;r.providerType==="anthropic"?a="/messages":r.providerType==="google"?a="/models/"+l+":generateContent":a="/chat/completions";let c=`${r.providerConfig.baseUrl.replace(/\/$/,"")}${a}`,l=r.name;r.id&&r.id.includes("_")&&(l=r.id.split("_")[1],console.log(h(` Using extracted model ID: ${l}`,"cyan"))),l=l.trim(),console.log(h(` Using final model ID: "${l}"`,"cyan"));let d={"Content-Type":"application/json",Authorization:`Bearer ${r.providerConfig.apiKey}`};r.providerType==="anthropic"?(d["x-api-key"]=r.providerConfig.apiKey,d["anthropic-version"]="2023-06-01"):r.providerType==="google"&&(delete d.Authorization,d["x-goog-api-key"]=r.providerConfig.apiKey);let v={model:l,messages:[{role:"user",content:Ze}],max_tokens:500,temperature:.7};r.providerType==="anthropic"?v.max_tokens=500:r.providerType==="google"&&(v.contents=[{parts:[{text:Ze}]}],v.generationConfig={maxOutputTokens:500,temperature:.7},delete v.messages,delete v.max_tokens),console.log(h(` Making request to: ${c}`,"cyan")),console.log(h(` Using model: ${l}`,"cyan"));let y=await fetch(c,{method:"POST",headers:d,body:JSON.stringify(v)});if(console.log(h(` Response status: ${y.status}`,"cyan")),!y.ok){let _=await y.text();throw console.log(h(` Error: ${_.slice(0,200)}...`,"red")),new Error(`API request failed: ${y.status} ${y.statusText}`)}let p=await y.json(),f=Date.now()-i,g,b;r.providerType==="anthropic"?(g=p.usage?.input_tokens||Math.round(Ze.length/4),b=p.usage?.output_tokens||Math.round(p.content?.[0]?.text?.length/4||0)):r.providerType==="google"?(g=p.usageMetadata?.promptTokenCount||Math.round(Ze.length/4),b=p.usageMetadata?.candidatesTokenCount||Math.round(p.candidates?.[0]?.content?.parts?.[0]?.text?.length/4||0)):(g=p.usage?.prompt_tokens||Math.round(Ze.length/4),b=p.usage?.completion_tokens||Math.round(p.choices?.[0]?.message?.content?.length/4||0));let D=g+b,$=f>0?D/f*1e3:0;return console.log(h("Completed!","green")),console.log(h(` Total Time: ${(f/1e3).toFixed(2)}s`,"cyan")),console.log(h(` Tokens/Sec: ${$.toFixed(1)}`,"cyan")),console.log(h(` Input Tokens: ${g}`,"cyan")),console.log(h(` Output Tokens: ${b}`,"cyan")),console.log(h(` Total Tokens: ${D}`,"cyan")),{model:r.name,provider:r.providerName,totalTime:f,timeToFirstToken:0,tokenCount:b,tokensPerSecond:$,promptTokens:g,totalTokens:D,success:!0}}catch(i){return console.log(h("Failed: ","red")+i.message),{model:r.name,provider:r.providerName,totalTime:0,timeToFirstToken:0,tokenCount:0,tokensPerSecond:0,promptTokens:0,totalTokens:0,success:!1,error:i.message}}};console.log(h("Starting parallel REST API benchmark execution...","cyan"));let n=e.map(r=>t(r)),o=await Promise.all(n);console.log(""),console.log(h("All REST API benchmarks completed!","green")),await qy(o,"REST API")}async function dT(){let e=[{id:1,text:"Set Model",action:()=>pT()},{id:2,text:"Run Benchmark (AI SDK)",action:async()=>{let n=await Ly();n.length>0&&await nT(n)}},{id:3,text:"Run Benchmark (REST API)",action:async()=>{let n=await Ly();n.length>0&&await cT(n)}},{id:4,text:"Exit",action:()=>{console.log(h("Goodbye!","green")),Ca.close(),process.exit(0)}}],t=0;for(;;){let n="";n+=h("Ai-speedometer","cyan")+`
153
+ `,n+=h("=============================","cyan")+`
154
+ `,n+=h("Note: opencode uses ai-sdk","dim")+`
155
+ `,n+=`
156
+ `,n+=h("Main Menu:","cyan")+`
157
+ `,n+=h("Use \u2191\u2193 arrows to navigate, ENTER to select","cyan")+`
158
+ `,n+=h("Navigation is circular","dim")+`
159
+ `,n+=`
160
+ `,e.forEach((r,i)=>{let a=i===t,u=a?h("\u25CF","green"):h("\u25CB","dim"),c=a?h(r.text,"bright"):h(r.text,"yellow");n+=`${u} ${c}
161
+ `}),Ee(),console.log(n);let o=await an();o==="\x1B[A"?t=(t-1+e.length)%e.length:o==="\x1B[B"?t=(t+1)%e.length:o==="\r"?await e[t].action():o===""&&process.exit(0)}}async function pT(){let e=[{id:1,text:"Add Provider",action:()=>oT()},{id:2,text:"List Existing Providers",action:()=>uT()},{id:3,text:"Add Model to Provider",action:()=>lT()},{id:4,text:"Debug Info",action:()=>sT()},{id:5,text:"Back to Main Menu",action:()=>"back"}],t=0;for(;;){let n="";n+=h("Ai-speedometer","cyan")+`
162
+ `,n+=h("=============================","cyan")+`
163
+ `,n+=h("Note: opencode uses ai-sdk","dim")+`
164
+ `,n+=`
165
+ `,n+=h("Model Management:","cyan")+`
166
+ `,n+=h("Use \u2191\u2193 arrows to navigate, ENTER to select","cyan")+`
167
+ `,n+=h("Navigation is circular","dim")+`
168
+ `,n+=`
169
+ `,e.forEach((r,i)=>{let a=i===t,u=a?h("\u25CF","green"):h("\u25CB","dim"),c=a?h(r.text,"bright"):h(r.text,"yellow");n+=`${u} ${c}
170
+ `}),Ee(),console.log(n);let o=await an();if(o==="\x1B[A")t=(t-1+e.length)%e.length;else if(o==="\x1B[B")t=(t+1)%e.length;else if(o==="\r"){if(await e[t].action()==="back")return}else o===""&&process.exit(0)}}process.on("SIGINT",()=>{console.log(h(`
171
+
172
+ CLI interrupted by user`,"yellow")),Ca.close(),process.exit(0)});(import.meta.url===`file://${process.argv[1]}`||process.argv.length===2||process.argv.length===3&&process.argv[2]==="--debug")&&dT();export{oT as addProvider,uT as listProviders,qd as loadConfig,nT as runStreamingBenchmark,rT as saveConfig,Ly as selectModelsCircular,dT as showMainMenu};