@proofkit/cli 2.0.0-beta.6 → 2.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,60 +1,54 @@
1
1
  #!/usr/bin/env node --no-warnings
2
- import*as e from"@clack/prompts";import{cancel as t,isCancel as n}from"@clack/prompts";import r from"chalk";import{Command as i,Option as a}from"commander";import o from"path";import{execa as s}from"execa";import c from"fs-extra";import{fileURLToPath as l}from"url";import u,{readFileSync as d,writeFileSync as f}from"fs";import{glob as p}from"glob";import m from"ora";import{Node as h,Project as g,StructureKind as ee,SyntaxKind as _}from"ts-morph";import te from"sort-package-json";import{execSync as ne}from"child_process";import{format as re,getFileInfo as ie}from"prettier";import ae,{config as oe}from"dotenv";import se,{OttoAdapter as ce}from"@proofkit/fmdapi";import{generateTypedClients as le}from"@proofkit/typegen";import{applyEdits as ue,modify as de,parse as fe}from"jsonc-parser";import pe from"os";import*as me from"semver";import he,{SemVer as ge}from"semver";import _e,{AxiosError as ve}from"axios";import ye from"open";import be from"randomstring";import xe from"https";import Se from"gradient-string";import{capitalize as Ce,groupBy as we,uniq as Te}from"es-toolkit";import{registryItemSchema as Ee}from"shadcn/registry";import"jiti";import"fast-glob";import{createFetch as De,createSchema as Oe}from"@better-fetch/fetch";import ke from"handlebars";var Ae=Object.defineProperty,je=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t&&Ae(n,Symbol.toStringTag,{value:`Module`}),n};const Me=()=>{let e=o.join(v,`package.json`);return c.readJSONSync(e).version??`1.0.0`},Ne=()=>`5.0.3-beta.0`,Pe=()=>{try{return process.versions.node.split(`.`)[0]??`22`}catch{return`22`}},Fe=()=>`0.3.0`,Ie=l(import.meta.url),Le=o.dirname(Ie),v=o.join(Le,`../`),Re=`@proofkit/cli`,ze=`https://proofkit.dev`,Be=Me(),Ve=Be.length,He=`
2
+ import*as e from"@clack/prompts";import{cancel as t,confirm as n,intro as r,isCancel as i,log as a,select as o,text as s}from"@clack/prompts";import c from"chalk";import{Command as l,Option as u}from"commander";import d from"node:path";import{execa as f}from"execa";import p from"fs-extra";import{fileURLToPath as m}from"node:url";import h,{readFileSync as ee,writeFileSync as te}from"node:fs";import{glob as ne}from"glob";import re from"ora";import{Node as ie,Project as ae,StructureKind as oe,SyntaxKind as g}from"ts-morph";import se from"sort-package-json";import{execSync as ce}from"node:child_process";import le,{config as ue}from"dotenv";import de,{OttoAdapter as fe}from"@proofkit/fmdapi";import{generateTypedClients as pe}from"@proofkit/typegen";import{applyEdits as me,modify as he,parse as ge}from"jsonc-parser";import _e from"node:os";import*as ve from"semver";import ye,{SemVer as be}from"semver";import xe,{AxiosError as Se}from"axios";import Ce from"open";import we from"randomstring";import Te from"node:https";import Ee from"gradient-string";import{capitalize as De,groupBy as Oe,uniq as ke}from"es-toolkit";import{registryItemSchema as Ae}from"shadcn/registry";import"jiti";import"fast-glob";import{createFetch as je,createSchema as Me}from"@better-fetch/fetch";import Ne from"handlebars";var Pe=Object.defineProperty,Fe=(e,t)=>{let n={};for(var r in e)Pe(n,r,{get:e[r],enumerable:!0});return t&&Pe(n,Symbol.toStringTag,{value:`Module`}),n};const Ie=()=>{let e=d.join(_,`package.json`);return p.readJSONSync(e).version??`1.0.0`},Le=()=>`5.0.3-beta.1`,Re=()=>{try{return process.versions.node.split(`.`)[0]??`22`}catch{return`22`}},ze=()=>`0.3.1-beta.0`,Be=m(import.meta.url),Ve=d.dirname(Be),_=d.join(Ve,`../`),He=`@proofkit/cli`,Ue=`https://proofkit.dev`,We=Ie(),Ge=We.length,Ke=`
3
3
  _______ ___ ___ ____ _ _
4
4
  |_ __ \\ .' ..]|_ ||_ _| (_) / |_
5
5
  | |__) |_ .--. .--. .--. _| |_ | |_/ / __ \`| |-'
6
6
  | ___/[ \`/'\`\\]/ .'\`\\ \\/ .'\`\\ \\'-| |-' | __'. [ | | |
7
7
  _| |_ | | | \\__. || \\__. | | | _| | \\ \\_ | | | |,
8
8
  |_____| [___] '.__.' '.__.' [___] |____||____|[___]\\__/
9
- ${` `.repeat(61-Ve)}v${Be}
10
- `,Ue=`my-proofkit-app`,We=`https://proofkit.dev`;function y(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const Ge=Symbol(`zod_brand`);var Ke=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const qe={};function b(e){return e&&Object.assign(qe,e),qe}var Je=je({BIGINT_FORMAT_RANGES:()=>wt,Class:()=>zt,NUMBER_FORMAT_RANGES:()=>Ct,aborted:()=>jt,allowsEval:()=>pt,assert:()=>$e,assertEqual:()=>Ye,assertIs:()=>Ze,assertNever:()=>Qe,assertNotEqual:()=>Xe,assignProp:()=>ot,cached:()=>nt,captureStackTrace:()=>dt,cleanEnum:()=>Rt,cleanRegex:()=>it,clone:()=>bt,createTransparentProxy:()=>xt,defineLazy:()=>S,esc:()=>ut,escapeRegex:()=>yt,extend:()=>Dt,finalizeIssue:()=>Pt,floatSafeRemainder:()=>at,getElementAtPath:()=>st,getEnumValues:()=>et,getLengthableOrigin:()=>It,getParsedType:()=>gt,getSizableOrigin:()=>Ft,isObject:()=>ft,isPlainObject:()=>mt,issue:()=>Lt,joinValues:()=>x,jsonStringifyReplacer:()=>tt,merge:()=>Ot,normalizeParams:()=>C,nullish:()=>rt,numKeys:()=>ht,omit:()=>Et,optionalKeys:()=>St,partial:()=>kt,pick:()=>Tt,prefixIssues:()=>Mt,primitiveTypes:()=>vt,promiseAllObject:()=>ct,propertyKeyTypes:()=>_t,randomString:()=>lt,required:()=>At,stringifyPrimitive:()=>w,unwrapMessage:()=>Nt});function Ye(e){return e}function Xe(e){return e}function Ze(e){}function Qe(e){throw Error()}function $e(e){}function et(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function x(e,t=`|`){return e.map(e=>w(e)).join(t)}function tt(e,t){return typeof t==`bigint`?t.toString():t}function nt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function rt(e){return e==null}function it(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function at(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function S(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function st(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ct(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function lt(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ut(e){return JSON.stringify(e)}const dt=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const pt=nt(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function mt(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(ft(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ht(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const gt=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 Error(`Unknown data type: ${t}`)}},_t=new Set([`string`,`number`,`symbol`]),vt=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function bt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(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 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 xt(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function w(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function St(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ct={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wt={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Tt(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Et(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Dt(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ot(this,`shape`,n),n},checks:[]})}function Ot(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ot(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function kt(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return bt(t,{...t._zod.def,shape:i,checks:[]})}function At(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return bt(t,{...t._zod.def,shape:i,checks:[]})}function jt(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n].continue!==!0)return!0;return!1}function Mt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Nt(e){return typeof e==`string`?e:e?.message}function Pt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Nt(e.inst?._zod.def?.error?.(e))??Nt(t?.error?.(e))??Nt(n.customError?.(e))??Nt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ft(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function It(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var zt=class{constructor(...e){}};const Bt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,tt,2)},enumerable:!0})},Vt=y(`$ZodError`,Bt),Ht=y(`$ZodError`,Bt,{Parent:Error});function Ut(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Wt(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function Gt(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??={},(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??=[],(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function Kt(e){let t=[];for(let n of e)typeof n==`number`?t.push(`[${n}]`):typeof n==`symbol`?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push(`.`),t.push(n));return t.join(``)}function qt(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Kt(e.path)}`);return t.join(`
11
- `)}const Jt=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Ke;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pt(e,a,b())));throw dt(t,i?.callee),t}return o.value},Yt=Jt(Ht),Xt=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pt(e,a,b())));throw dt(t,i?.callee),t}return o.value},Zt=Xt(Ht),Qt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ke;return a.issues.length?{success:!1,error:new(e??Vt)(a.issues.map(e=>Pt(e,i,b())))}:{success:!0,data:a.value}},$t=Qt(Ht),en=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Pt(e,i,b())))}:{success:!0,data:a.value}},tn=en(Ht);var nn=je({_emoji:()=>Sn,base64:()=>On,base64url:()=>kn,bigint:()=>zn,boolean:()=>Hn,browserEmail:()=>xn,cidrv4:()=>En,cidrv6:()=>Dn,cuid:()=>rn,cuid2:()=>an,date:()=>Pn,datetime:()=>Ln,domain:()=>jn,duration:()=>un,e164:()=>Mn,email:()=>_n,emoji:()=>Cn,extendedDuration:()=>dn,guid:()=>fn,hostname:()=>An,html5Email:()=>vn,integer:()=>Bn,ipv4:()=>wn,ipv6:()=>Tn,ksuid:()=>cn,lowercase:()=>Gn,nanoid:()=>ln,null:()=>Un,number:()=>Vn,rfc5322Email:()=>yn,string:()=>Rn,time:()=>In,ulid:()=>on,undefined:()=>Wn,unicodeEmail:()=>bn,uppercase:()=>Kn,uuid:()=>pn,uuid4:()=>mn,uuid6:()=>hn,uuid7:()=>gn,xid:()=>sn});const rn=/^[cC][^\s-]{8,}$/,an=/^[0-9a-z]+$/,on=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sn=/^[0-9a-vA-V]{20}$/,cn=/^[A-Za-z0-9]{27}$/,ln=/^[a-zA-Z0-9_-]{21}$/,un=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dn=/^[-+]?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)?)??$/,fn=/^([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})$/,pn=e=>e?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)$/,mn=pn(4),hn=pn(6),gn=pn(7),_n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vn=/^[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])?)*$/,yn=/^(([^<>()\[\]\\.,;:\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,}))$/,bn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xn=/^[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])?)*$/,Sn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Cn(){return new RegExp(Sn,`u`)}const wn=/^(?:(?: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])$/,Tn=/^(([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})$/,En=/^((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])$/,Dn=/^(([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])$/,On=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kn=/^[A-Za-z0-9_-]*$/,An=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,jn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mn=/^\+(?:[0-9]){6,14}[0-9]$/,Nn=`(?:(?:\\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])))`,Pn=RegExp(`^${Nn}$`);function Fn(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 In(e){return RegExp(`^${Fn(e)}$`)}function Ln(e){let t=Fn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\d{2}:\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Nn}T(?:${r})$`)}const Rn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},zn=/^\d+n?$/,Bn=/^\d+$/,Vn=/^-?\d+(?:\.\d+)?/i,Hn=/true|false/i,Un=/null/i,Wn=/undefined/i,Gn=/^[^A-Z]*$/,Kn=/^[^a-z]*$/,T=y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qn={number:`number`,bigint:`bigint`,object:`date`},Jn=y(`$ZodCheckLessThan`,(e,t)=>{T.init(e,t);let n=qn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yn=y(`$ZodCheckGreaterThan`,(e,t)=>{T.init(e,t);let n=qn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xn=y(`$ZodCheckMultipleOf`,(e,t)=>{T.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):at(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})}}),Zn=y(`$ZodCheckNumberFormat`,(e,t)=>{T.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ct[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Bn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Qn=y(`$ZodCheckBigIntFormat`,(e,t)=>{T.init(e,t);let[n,r]=wt[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),$n=y(`$ZodCheckMaxSize`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Ft(r),code:`too_big`,maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),er=y(`$ZodCheckMinSize`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Ft(r),code:`too_small`,minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),tr=y(`$ZodCheckSizeEquals`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Ft(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},input:n.value,inst:e,continue:!t.abort})}}),nr=y(`$ZodCheckMaxLength`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=It(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rr=y(`$ZodCheckMinLength`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=It(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=y(`$ZodCheckLengthEquals`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=It(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},input:n.value,inst:e,continue:!t.abort})}}),ar=y(`$ZodCheckStringFormat`,(e,t)=>{var n;T.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),(n=e._zod).check??(n.check=n=>{if(!t.pattern)throw Error(`Not implemented.`);t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),or=y(`$ZodCheckRegex`,(e,t)=>{ar.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})}}),sr=y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Gn,ar.init(e,t)}),cr=y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Kn,ar.init(e,t)}),lr=y(`$ZodCheckIncludes`,(e,t)=>{T.init(e,t);let n=yt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ur=y(`$ZodCheckStartsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`^${yt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dr=y(`$ZodCheckEndsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`.*${yt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function fr(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues))}const pr=y(`$ZodCheckProperty`,(e,t)=>{T.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>fr(n,e,t.property));fr(n,e,t.property)}}),mr=y(`$ZodCheckMimeType`,(e,t)=>{T.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e})}}),hr=y(`$ZodCheckOverwrite`,(e,t)=>{T.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var gr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
9
+ ${` `.repeat(61-Ge)}v${We}
10
+ `,qe=`my-proofkit-app`,Je=`https://proofkit.dev`,Ye=Object.freeze({status:`aborted`});function v(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const Xe=Symbol(`zod_brand`);var Ze=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Qe=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};const $e={};function y(e){return e&&Object.assign($e,e),$e}var et=Fe({BIGINT_FORMAT_RANGES:()=>It,Class:()=>an,NUMBER_FORMAT_RANGES:()=>Ft,aborted:()=>Wt,allowsEval:()=>wt,assert:()=>at,assertEqual:()=>tt,assertIs:()=>rt,assertNever:()=>it,assertNotEqual:()=>nt,assignProp:()=>mt,base64ToUint8Array:()=>Qt,base64urlToUint8Array:()=>en,cached:()=>ct,captureStackTrace:()=>St,cleanEnum:()=>Zt,cleanRegex:()=>ut,clone:()=>Mt,cloneDef:()=>gt,createTransparentProxy:()=>Nt,defineLazy:()=>x,esc:()=>bt,escapeRegex:()=>jt,extend:()=>zt,finalizeIssue:()=>qt,floatSafeRemainder:()=>dt,getElementAtPath:()=>_t,getEnumValues:()=>ot,getLengthableOrigin:()=>Yt,getParsedType:()=>Ot,getSizableOrigin:()=>Jt,hexToUint8Array:()=>nn,isObject:()=>Ct,isPlainObject:()=>Tt,issue:()=>Xt,joinValues:()=>b,jsonStringifyReplacer:()=>st,merge:()=>Vt,mergeDefs:()=>ht,normalizeParams:()=>S,nullish:()=>lt,numKeys:()=>Dt,objectClone:()=>pt,omit:()=>Rt,optionalKeys:()=>Pt,partial:()=>Ht,pick:()=>Lt,prefixIssues:()=>Gt,primitiveTypes:()=>At,promiseAllObject:()=>vt,propertyKeyTypes:()=>kt,randomString:()=>yt,required:()=>Ut,safeExtend:()=>Bt,shallowClone:()=>Et,slugify:()=>xt,stringifyPrimitive:()=>C,uint8ArrayToBase64:()=>$t,uint8ArrayToBase64url:()=>tn,uint8ArrayToHex:()=>rn,unwrapMessage:()=>Kt});function tt(e){return e}function nt(e){return e}function rt(e){}function it(e){throw Error()}function at(e){}function ot(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function b(e,t=`|`){return e.map(e=>C(e)).join(t)}function st(e,t){return typeof t==`bigint`?t.toString():t}function ct(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function lt(e){return e==null}function ut(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function dt(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}const ft=Symbol(`evaluating`);function x(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ft)return r===void 0&&(r=ft,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function pt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function mt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ht(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function gt(e){return ht(e._zod.def)}function _t(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function vt(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function yt(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function bt(e){return JSON.stringify(e)}function xt(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const St=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Ct(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const wt=ct(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Tt(e){if(Ct(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(Ct(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function Et(e){return Tt(e)?{...e}:Array.isArray(e)?[...e]:e}function Dt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const Ot=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 Error(`Unknown data type: ${t}`)}},kt=new Set([`string`,`number`,`symbol`]),At=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Mt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(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 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 Nt(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function C(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Pt(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ft={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},It={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Lt(e,t){let n=e._zod.def;return Mt(e,ht(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return mt(this,`shape`,e),e},checks:[]}))}function Rt(e,t){let n=e._zod.def;return Mt(e,ht(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return mt(this,`shape`,r),r},checks:[]}))}function zt(e,t){if(!Tt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return Mt(e,ht(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return mt(this,`shape`,n),n},checks:[]}))}function Bt(e,t){if(!Tt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Mt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return mt(this,`shape`,n),n},checks:e._zod.def.checks})}function Vt(e,t){return Mt(e,ht(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return mt(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function Ht(e,t,n){return Mt(t,ht(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return mt(this,`shape`,i),i},checks:[]}))}function Ut(e,t,n){return Mt(t,ht(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return mt(this,`shape`,i),i},checks:[]}))}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 Gt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Kt(e){return typeof e==`string`?e:e?.message}function qt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Kt(e.inst?._zod.def?.error?.(e))??Kt(t?.error?.(e))??Kt(n.customError?.(e))??Kt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Jt(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function Yt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Xt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Zt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Qt(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function $t(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function en(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return Qt(t+`=`.repeat((4-t.length%4)%4))}function tn(e){return $t(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function nn(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function rn(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}var an=class{constructor(...e){}};const on=(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,st,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},sn=v(`$ZodError`,on),w=v(`$ZodError`,on,{Parent:Error});function cn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function ln(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}function un(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>r({issues:e},s.path));else if(s.code===`invalid_key`)r({issues:s.issues},s.path);else if(s.code===`invalid_element`)r({issues:s.issues},s.path);else{let e=[...i,...s.path];if(e.length===0){n.errors.push(t(s));continue}let r=n,c=0;for(;c<e.length;){let n=e[c],i=c===e.length-1;typeof n==`string`?(r.properties??={},(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??=[],(o=r.items)[n]??(o[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(s)),c++}}};return r(e),n}function dn(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function fn(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${dn(e.path)}`);return t.join(`
11
+ `)}const pn=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Ze;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>qt(e,a,y())));throw St(t,i?.callee),t}return o.value},mn=pn(w),hn=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>qt(e,a,y())));throw St(t,i?.callee),t}return o.value},gn=hn(w),_n=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ze;return a.issues.length?{success:!1,error:new(e??sn)(a.issues.map(e=>qt(e,i,y())))}:{success:!0,data:a.value}},vn=_n(w),yn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>qt(e,i,y())))}:{success:!0,data:a.value}},bn=yn(w),xn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return pn(e)(t,n,i)},Sn=xn(w),Cn=e=>(t,n,r)=>pn(e)(t,n,r),wn=Cn(w),Tn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return hn(e)(t,n,i)},En=Tn(w),Dn=e=>async(t,n,r)=>hn(e)(t,n,r),On=Dn(w),kn=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return _n(e)(t,n,i)},An=kn(w),jn=e=>(t,n,r)=>_n(e)(t,n,r),Mn=jn(w),Nn=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return yn(e)(t,n,i)},Pn=Nn(w),Fn=e=>async(t,n,r)=>yn(e)(t,n,r),In=Fn(w);var Ln=Fe({base64:()=>lr,base64url:()=>ur,bigint:()=>br,boolean:()=>Cr,browserEmail:()=>nr,cidrv4:()=>sr,cidrv6:()=>cr,cuid:()=>Rn,cuid2:()=>zn,date:()=>hr,datetime:()=>vr,domain:()=>fr,duration:()=>Wn,e164:()=>pr,email:()=>Zn,emoji:()=>rr,extendedDuration:()=>Gn,guid:()=>Kn,hex:()=>Or,hostname:()=>dr,html5Email:()=>Qn,idnEmail:()=>tr,integer:()=>xr,ipv4:()=>ir,ipv6:()=>ar,ksuid:()=>Hn,lowercase:()=>Er,mac:()=>or,md5_base64:()=>Mr,md5_base64url:()=>Nr,md5_hex:()=>jr,nanoid:()=>Un,null:()=>wr,number:()=>Sr,rfc5322Email:()=>$n,sha1_base64:()=>Fr,sha1_base64url:()=>Ir,sha1_hex:()=>Pr,sha256_base64:()=>Rr,sha256_base64url:()=>zr,sha256_hex:()=>Lr,sha384_base64:()=>Vr,sha384_base64url:()=>Hr,sha384_hex:()=>Br,sha512_base64:()=>Wr,sha512_base64url:()=>Gr,sha512_hex:()=>Ur,string:()=>yr,time:()=>_r,ulid:()=>Bn,undefined:()=>Tr,unicodeEmail:()=>er,uppercase:()=>Dr,uuid:()=>qn,uuid4:()=>Jn,uuid6:()=>Yn,uuid7:()=>Xn,xid:()=>Vn});const Rn=/^[cC][^\s-]{8,}$/,zn=/^[0-9a-z]+$/,Bn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vn=/^[0-9a-vA-V]{20}$/,Hn=/^[A-Za-z0-9]{27}$/,Un=/^[a-zA-Z0-9_-]{21}$/,Wn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gn=/^[-+]?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)?)??$/,Kn=/^([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})$/,qn=e=>e?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)$/,Jn=qn(4),Yn=qn(6),Xn=qn(7),Zn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qn=/^[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])?)*$/,$n=/^(([^<>()\[\]\\.,;:\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,}))$/,er=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,tr=er,nr=/^[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])?)*$/;function rr(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const ir=/^(?:(?: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])$/,ar=/^(([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}|:))$/,or=e=>{let t=jt(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},sr=/^((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])$/,cr=/^(([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])$/,lr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ur=/^[A-Za-z0-9_-]*$/,dr=/^(?=.{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])?)*\.?$/,fr=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,pr=/^\+(?:[0-9]){6,14}[0-9]$/,mr=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,hr=RegExp(`^${mr}$`);function gr(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 _r(e){return RegExp(`^${gr(e)}$`)}function vr(e){let t=gr({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${mr}T(?:${r})$`)}const yr=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},br=/^-?\d+n?$/,xr=/^-?\d+$/,Sr=/^-?\d+(?:\.\d+)?/,Cr=/^(?:true|false)$/i,wr=/^null$/i,Tr=/^undefined$/i,Er=/^[^A-Z]*$/,Dr=/^[^a-z]*$/,Or=/^[0-9a-fA-F]*$/;function kr(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ar(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const jr=/^[0-9a-fA-F]{32}$/,Mr=kr(22,`==`),Nr=Ar(22),Pr=/^[0-9a-fA-F]{40}$/,Fr=kr(27,`=`),Ir=Ar(27),Lr=/^[0-9a-fA-F]{64}$/,Rr=kr(43,`=`),zr=Ar(43),Br=/^[0-9a-fA-F]{96}$/,Vr=kr(64,``),Hr=Ar(64),Ur=/^[0-9a-fA-F]{128}$/,Wr=kr(86,`==`),Gr=Ar(86),T=v(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Kr={number:`number`,bigint:`bigint`,object:`date`},qr=v(`$ZodCheckLessThan`,(e,t)=>{T.init(e,t);let n=Kr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jr=v(`$ZodCheckGreaterThan`,(e,t)=>{T.init(e,t);let n=Kr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yr=v(`$ZodCheckMultipleOf`,(e,t)=>{T.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):dt(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})}}),Xr=v(`$ZodCheckNumberFormat`,(e,t)=>{T.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ft[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=xr)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Zr=v(`$ZodCheckBigIntFormat`,(e,t)=>{T.init(e,t);let[n,r]=It[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),Qr=v(`$ZodCheckMaxSize`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Jt(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$r=v(`$ZodCheckMinSize`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Jt(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ei=v(`$ZodCheckSizeEquals`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.size!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Jt(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ti=v(`$ZodCheckMaxLength`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Yt(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ni=v(`$ZodCheckMinLength`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Yt(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ri=v(`$ZodCheckLengthEquals`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!lt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Yt(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ii=v(`$ZodCheckStringFormat`,(e,t)=>{var n,r;T.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ai=v(`$ZodCheckRegex`,(e,t)=>{ii.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})}}),oi=v(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Er,ii.init(e,t)}),si=v(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Dr,ii.init(e,t)}),ci=v(`$ZodCheckIncludes`,(e,t)=>{T.init(e,t);let n=jt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),li=v(`$ZodCheckStartsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`^${jt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ui=v(`$ZodCheckEndsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`.*${jt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function di(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues))}const fi=v(`$ZodCheckProperty`,(e,t)=>{T.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>di(n,e,t.property));di(n,e,t.property)}}),pi=v(`$ZodCheckMimeType`,(e,t)=>{T.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),mi=v(`$ZodCheckOverwrite`,(e,t)=>{T.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var hi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
12
12
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
13
- `))}};const _r={major:4,minor:0,patch:0},E=y(`$ZodType`,(e,t)=>{var n;e??={},S(e._zod,`id`,()=>t.type+`_`+lt(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_r;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=jt(e),i;for(let a of t){if(a._zod.when){if(!a._zod.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Ke;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=jt(e,t))});else{if(e.issues.length===t)continue;r||=jt(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new Ke;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=$t(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return tn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),vr=y(`$ZodString`,(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(e._zod.bag),e._zod.parse=(n,r)=>{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}}),D=y(`$ZodStringFormat`,(e,t)=>{ar.init(e,t),vr.init(e,t)}),yr=y(`$ZodGUID`,(e,t)=>{t.pattern??=fn,D.init(e,t)}),br=y(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=pn(e)}else t.pattern??=pn();D.init(e,t)}),xr=y(`$ZodEmail`,(e,t)=>{t.pattern??=_n,D.init(e,t)}),Sr=y(`$ZodURL`,(e,t)=>{D.init(e,t),e._zod.check=n=>{try{let r=new URL(n.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:An.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}));return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Cr=y(`$ZodEmoji`,(e,t)=>{t.pattern??=Cn(),D.init(e,t)}),wr=y(`$ZodNanoID`,(e,t)=>{t.pattern??=ln,D.init(e,t)}),Tr=y(`$ZodCUID`,(e,t)=>{t.pattern??=rn,D.init(e,t)}),Er=y(`$ZodCUID2`,(e,t)=>{t.pattern??=an,D.init(e,t)}),Dr=y(`$ZodULID`,(e,t)=>{t.pattern??=on,D.init(e,t)}),Or=y(`$ZodXID`,(e,t)=>{t.pattern??=sn,D.init(e,t)}),kr=y(`$ZodKSUID`,(e,t)=>{t.pattern??=cn,D.init(e,t)}),Ar=y(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ln(t),D.init(e,t),e._zod.check}),jr=y(`$ZodISODate`,(e,t)=>{t.pattern??=Pn,D.init(e,t)}),Mr=y(`$ZodISOTime`,(e,t)=>{t.pattern??=In(t),D.init(e,t),e._zod.check}),Nr=y(`$ZodISODuration`,(e,t)=>{t.pattern??=un,D.init(e,t)}),Pr=y(`$ZodIPv4`,(e,t)=>{t.pattern??=wn,D.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),Fr=y(`$ZodIPv6`,(e,t)=>{t.pattern??=Tn,D.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.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})}}}),Ir=y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=En,D.init(e,t)}),Lr=y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Dn,D.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Rr(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const zr=y(`$ZodBase64`,(e,t)=>{t.pattern??=On,D.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Br(e){if(!kn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Rr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Vr=y(`$ZodBase64URL`,(e,t)=>{t.pattern??=kn,D.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{Br(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hr=y(`$ZodE164`,(e,t)=>{t.pattern??=Mn,D.init(e,t)});function Ur(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n,i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Wr=y(`$ZodJWT`,(e,t)=>{D.init(e,t),e._zod.check=n=>{Ur(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gr=y(`$ZodNumber`,(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Vn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Kr=y(`$ZodNumber`,(e,t)=>{Zn.init(e,t),Gr.init(e,t)}),qr=y(`$ZodBoolean`,(e,t)=>{E.init(e,t),e._zod.pattern=Hn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Jr=y(`$ZodBigInt`,(e,t)=>{E.init(e,t),e._zod.pattern=zn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}let{value:i}=n;return typeof i==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:i,inst:e}),n}}),Yr=y(`$ZodBigInt`,(e,t)=>{Qn.init(e,t),Jr.init(e,t)}),Xr=y(`$ZodSymbol`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let{value:r}=t;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Zr=y(`$ZodUndefined`,(e,t)=>{E.init(e,t),e._zod.pattern=Wn,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let{value:r}=t;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Qr=y(`$ZodNull`,(e,t)=>{E.init(e,t),e._zod.pattern=Un,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let{value:r}=t;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),$r=y(`$ZodAny`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),ei=y(`$ZodUnknown`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),ti=y(`$ZodNever`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ni=y(`$ZodVoid`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let{value:r}=t;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),ri=y(`$ZodDate`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function ii(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues)),t.value[n]=e.value}const ai=y(`$ZodArray`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ii(t,n,e))):ii(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function oi(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues)),t.value[n]=e.value}function si(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Mt(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const ci=y(`$ZodObject`,(e,t)=>{E.init(e,t);let n=nt(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof E))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=St(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});S(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new gr([`shape`,`payload`,`ctx`]),{keys:r,optionalKeys:i}=n.value,a=e=>{let t=ut(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let o=Object.create(null);for(let e of r)o[e]=lt(15);t.write(`const newResult = {}`);for(let e of r)if(i.has(e)){let n=o[e];t.write(`const ${n} = ${a(e)};`);let r=ut(e);t.write(`
13
+ `))}};const gi={major:4,minor:1,patch:13},E=v(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gi;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Wt(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Ze;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Wt(e,t))});else{if(e.issues.length===t)continue;r||=Wt(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Wt(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Ze;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Ze;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=vn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return bn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),_i=v(`$ZodString`,(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??yr(e._zod.bag),e._zod.parse=(n,r)=>{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}}),D=v(`$ZodStringFormat`,(e,t)=>{ii.init(e,t),_i.init(e,t)}),vi=v(`$ZodGUID`,(e,t)=>{t.pattern??=Kn,D.init(e,t)}),yi=v(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=qn(e)}else t.pattern??=qn();D.init(e,t)}),bi=v(`$ZodEmail`,(e,t)=>{t.pattern??=Zn,D.init(e,t)}),xi=v(`$ZodURL`,(e,t)=>{D.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.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=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Si=v(`$ZodEmoji`,(e,t)=>{t.pattern??=rr(),D.init(e,t)}),Ci=v(`$ZodNanoID`,(e,t)=>{t.pattern??=Un,D.init(e,t)}),wi=v(`$ZodCUID`,(e,t)=>{t.pattern??=Rn,D.init(e,t)}),Ti=v(`$ZodCUID2`,(e,t)=>{t.pattern??=zn,D.init(e,t)}),Ei=v(`$ZodULID`,(e,t)=>{t.pattern??=Bn,D.init(e,t)}),Di=v(`$ZodXID`,(e,t)=>{t.pattern??=Vn,D.init(e,t)}),Oi=v(`$ZodKSUID`,(e,t)=>{t.pattern??=Hn,D.init(e,t)}),ki=v(`$ZodISODateTime`,(e,t)=>{t.pattern??=vr(t),D.init(e,t)}),Ai=v(`$ZodISODate`,(e,t)=>{t.pattern??=hr,D.init(e,t)}),ji=v(`$ZodISOTime`,(e,t)=>{t.pattern??=_r(t),D.init(e,t)}),Mi=v(`$ZodISODuration`,(e,t)=>{t.pattern??=Wn,D.init(e,t)}),Ni=v(`$ZodIPv4`,(e,t)=>{t.pattern??=ir,D.init(e,t),e._zod.bag.format=`ipv4`}),Pi=v(`$ZodIPv6`,(e,t)=>{t.pattern??=ar,D.init(e,t),e._zod.bag.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})}}}),Fi=v(`$ZodMAC`,(e,t)=>{t.pattern??=or(t.delimiter),D.init(e,t),e._zod.bag.format=`mac`}),Ii=v(`$ZodCIDRv4`,(e,t)=>{t.pattern??=sr,D.init(e,t)}),Li=v(`$ZodCIDRv6`,(e,t)=>{t.pattern??=cr,D.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Ri(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const zi=v(`$ZodBase64`,(e,t)=>{t.pattern??=lr,D.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Ri(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Bi(e){if(!ur.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Ri(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Vi=v(`$ZodBase64URL`,(e,t)=>{t.pattern??=ur,D.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Bi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hi=v(`$ZodE164`,(e,t)=>{t.pattern??=pr,D.init(e,t)});function Ui(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Wi=v(`$ZodJWT`,(e,t)=>{D.init(e,t),e._zod.check=n=>{Ui(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gi=v(`$ZodCustomStringFormat`,(e,t)=>{D.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})}}),Ki=v(`$ZodNumber`,(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),qi=v(`$ZodNumberFormat`,(e,t)=>{Xr.init(e,t),Ki.init(e,t)}),Ji=v(`$ZodBoolean`,(e,t)=>{E.init(e,t),e._zod.pattern=Cr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Yi=v(`$ZodBigInt`,(e,t)=>{E.init(e,t),e._zod.pattern=br,e._zod.parse=(n,r)=>{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}}),Xi=v(`$ZodBigIntFormat`,(e,t)=>{Zr.init(e,t),Yi.init(e,t)}),Zi=v(`$ZodSymbol`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Qi=v(`$ZodUndefined`,(e,t)=>{E.init(e,t),e._zod.pattern=Tr,e._zod.values=new Set([void 0]),e._zod.optin=`optional`,e._zod.optout=`optional`,e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),$i=v(`$ZodNull`,(e,t)=>{E.init(e,t),e._zod.pattern=wr,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),ea=v(`$ZodAny`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),ta=v(`$ZodUnknown`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),na=v(`$ZodNever`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ra=v(`$ZodVoid`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),ia=v(`$ZodDate`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function aa(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues)),t.value[n]=e.value}const oa=v(`$ZodArray`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>aa(t,n,e))):aa(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function sa(e,t,n,r){e.issues.length&&t.issues.push(...Gt(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function ca(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Pt(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function la(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>sa(e,n,i,t))):sa(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const ua=v(`$ZodObject`,(e,t)=>{if(E.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=ct(()=>ca(t));x(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=Ct,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>sa(n,t,e,s))):sa(n,t,e,s)}return i?la(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),da=v(`$ZodObjectJIT`,(e,t)=>{ua.init(e,t);let n=e._zod.parse,r=ct(()=>ca(t)),i=e=>{let t=new hi([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=bt(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=bt(e);t.write(`const ${n} = ${i(e)};`),t.write(`
14
14
  if (${n}.issues.length) {
15
- if (input[${r}] === undefined) {
16
- if (${r} in input) {
17
- newResult[${r}] = undefined;
18
- }
19
- } else {
20
- payload.issues = payload.issues.concat(
21
- ${n}.issues.map((iss) => ({
22
- ...iss,
23
- path: iss.path ? [${r}, ...iss.path] : [${r}],
24
- }))
25
- );
15
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
16
+ ...iss,
17
+ path: iss.path ? [${r}, ...iss.path] : [${r}]
18
+ })));
19
+ }
20
+
21
+
22
+ if (${n}.value === undefined) {
23
+ if (${r} in input) {
24
+ newResult[${r}] = undefined;
26
25
  }
27
- } else if (${n}.value === undefined) {
28
- if (${r} in input) newResult[${r}] = undefined;
29
26
  } else {
30
27
  newResult[${r}] = ${n}.value;
31
28
  }
32
- `)}else{let n=o[e];t.write(`const ${n} = ${a(e)};`),t.write(`
33
- if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
34
- ...iss,
35
- path: iss.path ? [${ut(e)}, ...iss.path] : [${ut(e)}]
36
- })));`),t.write(`newResult[${ut(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=ft,o=!qe.jitless,s=o&&pt.value,{catchall:c}=t,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?si(e,u,t,f):oi(e,u,t))):i?si(r,u,t,f):oi(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,ee=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(ee===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>oi(t,u,e))):oi(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function li(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Pt(e,r,b())))}),t}const ui=y(`$ZodUnion`,(e,t)=>{E.init(e,t),S(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),S(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>it(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>li(t,n,e,r)):li(a,n,e,r)}}),di=y(`$ZodDiscriminatedUnion`,(e,t)=>{ui.init(e,t);let n=e._zod.parse;S(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=nt(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ft(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,input:o,path:[t.discriminator],inst:e}),i)}}),fi=y(`$ZodIntersection`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let{value:r}=e,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mi(e,t,n)):mi(e,i,a)}});function pi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(mt(e)&&mt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pi(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pi(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mi(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),jt(e))return e;let r=pi(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const hi=y(`$ZodTuple`,(e,t)=>{E.init(e,t);let n=t.items,r=n.length-[...n].reverse().findIndex(e=>e._zod.optin!==`optional`);e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=[];let s=[];if(!t.rest){let t=o.length>n.length,a=o.length<r-1;if(t||a)return i.issues.push({input:o,inst:e,origin:`array`,...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length}}),i}let c=-1;for(let e of n){if(c++,c>=o.length&&c>=r)continue;let t=e._zod.run({value:o[c],issues:[]},a);t instanceof Promise?s.push(t.then(e=>gi(e,i,c))):gi(t,i,c)}if(t.rest){let e=o.slice(n.length);for(let n of e){c++;let e=t.rest._zod.run({value:n,issues:[]},a);e instanceof Promise?s.push(e.then(e=>gi(e,i,c))):gi(e,i,c)}}return s.length?Promise.all(s).then(()=>i):i}});function gi(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues)),t.value[n]=e.value}const _i=y(`$ZodRecord`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!mt(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Mt(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Mt(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>Pt(e,r,b())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Mt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Mt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),vi=y(`$ZodMap`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{yi(t,a,n,o,i,e,r)})):yi(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function yi(e,t,n,r,i,a,o){e.issues.length&&(_t.has(typeof r)?n.issues.push(...Mt(r,e.issues)):n.issues.push({origin:`map`,code:`invalid_key`,input:i,inst:a,issues:e.issues.map(e=>Pt(e,o,b()))})),t.issues.length&&(_t.has(typeof r)?n.issues.push(...Mt(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>Pt(e,o,b()))})),n.value.set(e.value,t.value)}const bi=y(`$ZodSet`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>xi(e,n))):xi(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function xi(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Si=y(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=et(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>_t.has(typeof e)).map(e=>typeof e==`string`?yt(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Ci=y(`$ZodLiteral`,(e,t)=>{E.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?yt(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),wi=y(`$ZodFile`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Ti=y(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new Ke;return e.value=r,e}}),Ei=y(`$ZodOptional`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,S(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),S(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${it(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>e.value===void 0?e:t.innerType._zod.run(e,n)}),Di=y(`$ZodNullable`,(e,t)=>{E.init(e,t),S(e._zod,`optin`,()=>t.innerType._zod.optin),S(e._zod,`optout`,()=>t.innerType._zod.optout),S(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${it(e.source)}|null)$`):void 0}),S(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Oi=y(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ki(e,t)):ki(r,t)}});function ki(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ai=y(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ji=y(`$ZodNonOptional`,(e,t)=>{E.init(e,t),S(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Mi(t,e)):Mi(i,e)}});function Mi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const Ni=y(`$ZodSuccess`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Pi=y(`$ZodCatch`,(e,t)=>{E.init(e,t),S(e._zod,`optin`,()=>t.innerType._zod.optin),S(e._zod,`optout`,()=>t.innerType._zod.optout),S(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Pt(e,n,b()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Pt(e,n,b()))},input:e.value}),e.issues=[]),e)}}),Fi=y(`$ZodNaN`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Ii=y(`$ZodPipe`,(e,t)=>{E.init(e,t),S(e._zod,`values`,()=>t.in._zod.values),S(e._zod,`optin`,()=>t.in._zod.optin),S(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Li(e,t,n)):Li(r,t,n)}});function Li(e,t,n){return jt(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Ri=y(`$ZodReadonly`,(e,t)=>{E.init(e,t),S(e._zod,`propValues`,()=>t.innerType._zod.propValues),S(e._zod,`optin`,()=>t.innerType._zod.optin),S(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(zi):zi(r)}});function zi(e){return e.value=Object.freeze(e.value),e}const Bi=y(`$ZodTemplateLiteral`,(e,t)=>{E.init(e,t);let n=[];for(let e of t.parts)if(e instanceof E){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=t.startsWith(`^`)?1:0,i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||vt.has(typeof e))n.push(yt(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(t,n)=>typeof t.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:`invalid_format`,format:`template_literal`,pattern:e._zod.pattern.source}),t):(t.issues.push({input:t.value,inst:e,expected:`template_literal`,code:`invalid_type`}),t)}),Vi=y(`$ZodPromise`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Hi=y(`$ZodLazy`,(e,t)=>{E.init(e,t),S(e._zod,`innerType`,()=>t.getter()),S(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),S(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),S(e._zod,`optin`,()=>e._zod.innerType._zod.optin),S(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ui=y(`$ZodCustom`,(e,t)=>{T.init(e,t),E.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wi(t,n,r,e));Wi(i,n,r,e)}});function Wi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Lt(e))}}const Gi=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=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},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${w(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${x(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function Ki(){return{localeError:Gi()}}const qi=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=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},r={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 e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${w(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function Ji(){return{localeError:qi()}}function Yi(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Xi=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${w(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Yi(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Yi(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function Zi(){return{localeError:Xi()}}const Qi=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=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},r={regex:`entrada`,email:`adreça electrònica`,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ça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${w(e.values[0])}`:`Opció invàlida: s'esperava una de ${x(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function $i(){return{localeError:Qi()}}const ea=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;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(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová 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 čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${w(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${x(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function ta(){return{localeError:ea()}}const na=()=>{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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${w(e.values[0])}`:`Ungültige Option: erwartet eine von ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function ra(){return{localeError:na()}}const ia=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},aa=()=>{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(t){return e[t]??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 e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${ia(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${w(e.values[0])}`:`Invalid option: expected one of ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function oa(){return{localeError:aa()}}const sa=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`arreglo`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t},r={regex:`entrada`,email:`dirección de correo electrónico`,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ón ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${e.expected}, recibido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${w(e.values[0])}`:`Opción inválida: se esperaba una de ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: se esperaba que ${e.origin??`valor`} tuviera ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: se esperaba que ${e.origin??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeño: se esperaba que ${e.origin} tuviera ${n}${e.minimum.toString()} ${r.unit}`:`Demasiado pequeño: se esperaba que ${e.origin} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${e.origin}`;default:return`Entrada inválida`}}};function ca(){return{localeError:sa()}}const la=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: می‌بایست ${e.expected} می‌بود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${w(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${x(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${x(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function ua(){return{localeError:la()}}const da=()=>{let e={string:{unit:`merkkiä`,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äivämäärän`}};function t(t){return e[t]??null}let n=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},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,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äivämäärä`,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 e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${w(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${x(e.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öte`}}};function fa(){return{localeError:da()}}const pa=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,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ée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${w(e.values[0])} attendu`:`Option invalide : une valeur parmi ${x(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${x(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ma(){return{localeError:pa()}}const ha=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=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},r={regex:`entrée`,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ée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${w(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${x(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function ga(){return{localeError:ha()}}const _a=()=>{let e={string:{unit:`אותיות`,verb:`לכלול`},file:{unit:`בייטים`,verb:`לכלול`},array:{unit:`פריטים`,verb:`לכלול`},set:{unit:`פריטים`,verb:`לכלול`}};function t(t){return e[t]??null}let n=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},r={regex:`קלט`,email:`כתובת אימייל`,url:`כתובת רשת`,emoji:`אימוג'י`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`תאריך וזמן ISO`,date:`תאריך ISO`,time:`זמן ISO`,duration:`משך זמן ISO`,ipv4:`כתובת IPv4`,ipv6:`כתובת IPv6`,cidrv4:`טווח IPv4`,cidrv6:`טווח IPv6`,base64:`מחרוזת בבסיס 64`,base64url:`מחרוזת בבסיס 64 לכתובות רשת`,json_string:`מחרוזת JSON`,e164:`מספר E.164`,jwt:`JWT`,template_literal:`קלט`};return e=>{switch(e.code){case`invalid_type`:return`קלט לא תקין: צריך ${e.expected}, התקבל ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`קלט לא תקין: צריך ${w(e.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`גדול מדי: ${e.origin??`value`} צריך להיות ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()} ${r.unit}`:`קטן מדי: ${e.origin} צריך להיות ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`מחרוזת לא תקינה: חייבת להתחיל ב"${t.prefix}"`:t.format===`ends_with`?`מחרוזת לא תקינה: חייבת להסתיים ב "${t.suffix}"`:t.format===`includes`?`מחרוזת לא תקינה: חייבת לכלול "${t.includes}"`:t.format===`regex`?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${t.pattern}`:`${r[t.format]??e.format} לא תקין`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${e.divisor}`;case`unrecognized_keys`:return`מפתח${e.keys.length>1?`ות`:``} לא מזוה${e.keys.length>1?`ים`:`ה`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`מפתח לא תקין ב${e.origin}`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${e.origin}`;default:return`קלט לא תקין`}}};function va(){return{localeError:_a()}}const ya=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,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őbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${w(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function ba(){return{localeError:ya()}}const xa=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=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},r={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 e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${w(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function Sa(){return{localeError:xa()}}const Ca=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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 e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${w(e.values[0])}`:`Opzione non valida: atteso uno tra ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function wa(){return{localeError:Ca()}}const Ta=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${w(e.values[0])}が期待されました`:`無効な選択: ${x(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${x(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function Ea(){return{localeError:Ta()}}const Da=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;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},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${w(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${x(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Oa(){return{localeError:Da()}}const ka=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=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},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${w(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${x(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${x(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function Aa(){return{localeError:ka()}}const ja=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${w(e.values[0])}`:`Грешана опција: се очекува една ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function Ma(){return{localeError:ja()}}const Na=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${w(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${x(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function Pa(){return{localeError:Na()}}const Fa=()=>{let e={string:{unit:`tekens`},file:{unit:`bytes`},array:{unit:`elementen`},set:{unit:`elementen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${w(e.values[0])}`:`Ongeldige optie: verwacht één van ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} bevat`:`Te lang: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} bevat`:`Te kort: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function Ia(){return{localeError:Fa()}}const La=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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åde`,ipv6:`IPv6-område`,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 e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${w(e.values[0])}`:`Ugyldig valg: forventet en av ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function Ra(){return{localeError:La()}}const za=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,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âmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${w(e.values[0])}`:`Fâsit tercih: mûteberler ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function Ba(){return{localeError:za()}}const Va=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${w(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${x(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function Ha(){return{localeError:Va()}}const Ua=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,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ąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${w(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function Wa(){return{localeError:Ua()}}const Ga=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço 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ção ISO`,ipv4:`endereço IPv4`,ipv6:`endereço 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úmero E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${w(e.values[0])}`:`Opção inválida: esperada uma das ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Ka(){return{localeError:Ga()}}function qa(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const Ja=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${w(e.values[0])}`:`Неверный вариант: ожидалось одно из ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=qa(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=qa(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Ya(){return{localeError:Ja()}}const Xa=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni 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 čas`,date:`ISO datum`,time:`ISO čas`,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 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${w(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function Za(){return{localeError:Xa()}}const Qa=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt 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äng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${w(e.values[0])}`:`Ogiltigt val: förväntade en av ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function $a(){return{localeError:Qa()}}const eo=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,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:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${w(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${x(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function to(){return{localeError:eo()}}const no=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;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},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${w(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${x(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function ro(){return{localeError:no()}}const io=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},ao=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??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üre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${io(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${w(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function oo(){return{localeError:ao()}}const so=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${w(e.values[0])}`:`Неправильна опція: очікується одне з ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${x(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function co(){return{localeError:so()}}const lo=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${w(e.values[0])} متوقع تھا`:`غلط آپشن: ${x(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${x(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function uo(){return{localeError:lo()}}const fo=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ 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ày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${w(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${x(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function po(){return{localeError:fo()}}const mo=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${w(e.values[0])}`:`无效选项:期望以下之一 ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${x(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function ho(){return{localeError:mo()}}const go=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=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},r={regex:`輸入`,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:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${w(e.values[0])}`:`無效的選項:預期為以下其中之一 ${x(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${x(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function _o(){return{localeError:go()}}var vo=je({ar:()=>Ki,az:()=>Ji,be:()=>Zi,ca:()=>$i,cs:()=>ta,de:()=>ra,en:()=>oa,es:()=>ca,fa:()=>ua,fi:()=>fa,fr:()=>ma,frCA:()=>ga,he:()=>va,hu:()=>ba,id:()=>Sa,it:()=>wa,ja:()=>Ea,kh:()=>Oa,ko:()=>Aa,mk:()=>Ma,ms:()=>Pa,nl:()=>Ia,no:()=>Ra,ota:()=>Ba,pl:()=>Wa,ps:()=>Ha,pt:()=>Ka,ru:()=>Ya,sl:()=>Za,sv:()=>$a,ta:()=>to,th:()=>ro,tr:()=>oo,ua:()=>co,ur:()=>uo,vi:()=>po,zhCN:()=>ho,zhTW:()=>_o});const yo=Symbol(`ZodOutput`),bo=Symbol(`ZodInput`);var xo=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}remove(e){return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function So(){return new xo}const Co=So();function wo(e,t){return new e({type:`string`,...C(t)})}function To(e,t){return new e({type:`string`,coerce:!0,...C(t)})}function Eo(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...C(t)})}function Do(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...C(t)})}function Oo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...C(t)})}function ko(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...C(t)})}function Ao(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...C(t)})}function jo(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...C(t)})}function Mo(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...C(t)})}function No(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...C(t)})}function Po(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...C(t)})}function Fo(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...C(t)})}function Io(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...C(t)})}function Lo(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...C(t)})}function Ro(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...C(t)})}function zo(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...C(t)})}function Bo(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...C(t)})}function Vo(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...C(t)})}function Ho(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...C(t)})}function Uo(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...C(t)})}function Wo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...C(t)})}function Go(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...C(t)})}function Ko(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...C(t)})}function qo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...C(t)})}const Jo={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Yo(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...C(t)})}function Xo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...C(t)})}function Zo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...C(t)})}function Qo(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...C(t)})}function $o(e,t){return new e({type:`number`,checks:[],...C(t)})}function es(e,t){return new e({type:`number`,coerce:!0,checks:[],...C(t)})}function ts(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...C(t)})}function ns(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...C(t)})}function rs(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...C(t)})}function is(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...C(t)})}function as(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...C(t)})}function os(e,t){return new e({type:`boolean`,...C(t)})}function ss(e,t){return new e({type:`boolean`,coerce:!0,...C(t)})}function cs(e,t){return new e({type:`bigint`,...C(t)})}function ls(e,t){return new e({type:`bigint`,coerce:!0,...C(t)})}function us(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...C(t)})}function ds(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...C(t)})}function fs(e,t){return new e({type:`symbol`,...C(t)})}function ps(e,t){return new e({type:`undefined`,...C(t)})}function ms(e,t){return new e({type:`null`,...C(t)})}function hs(e){return new e({type:`any`})}function gs(e){return new e({type:`unknown`})}function _s(e,t){return new e({type:`never`,...C(t)})}function vs(e,t){return new e({type:`void`,...C(t)})}function ys(e,t){return new e({type:`date`,...C(t)})}function bs(e,t){return new e({type:`date`,coerce:!0,...C(t)})}function xs(e,t){return new e({type:`nan`,...C(t)})}function Ss(e,t){return new Jn({check:`less_than`,...C(t),value:e,inclusive:!1})}function Cs(e,t){return new Jn({check:`less_than`,...C(t),value:e,inclusive:!0})}function ws(e,t){return new Yn({check:`greater_than`,...C(t),value:e,inclusive:!1})}function O(e,t){return new Yn({check:`greater_than`,...C(t),value:e,inclusive:!0})}function Ts(e){return ws(0,e)}function Es(e){return Ss(0,e)}function Ds(e){return Cs(0,e)}function Os(e){return O(0,e)}function ks(e,t){return new Xn({check:`multiple_of`,...C(t),value:e})}function As(e,t){return new $n({check:`max_size`,...C(t),maximum:e})}function js(e,t){return new er({check:`min_size`,...C(t),minimum:e})}function Ms(e,t){return new tr({check:`size_equals`,...C(t),size:e})}function Ns(e,t){return new nr({check:`max_length`,...C(t),maximum:e})}function Ps(e,t){return new rr({check:`min_length`,...C(t),minimum:e})}function Fs(e,t){return new ir({check:`length_equals`,...C(t),length:e})}function Is(e,t){return new or({check:`string_format`,format:`regex`,...C(t),pattern:e})}function Ls(e){return new sr({check:`string_format`,format:`lowercase`,...C(e)})}function Rs(e){return new cr({check:`string_format`,format:`uppercase`,...C(e)})}function zs(e,t){return new lr({check:`string_format`,format:`includes`,...C(t),includes:e})}function Bs(e,t){return new ur({check:`string_format`,format:`starts_with`,...C(t),prefix:e})}function Vs(e,t){return new dr({check:`string_format`,format:`ends_with`,...C(t),suffix:e})}function Hs(e,t,n){return new pr({check:`property`,property:e,schema:t,...C(n)})}function Us(e,t){return new mr({check:`mime_type`,mime:e,...C(t)})}function Ws(e){return new hr({check:`overwrite`,tx:e})}function Gs(e){return Ws(t=>t.normalize(e))}function Ks(){return Ws(e=>e.trim())}function qs(){return Ws(e=>e.toLowerCase())}function Js(){return Ws(e=>e.toUpperCase())}function Ys(e,t,n){return new e({type:`array`,element:t,...C(n)})}function Xs(e,t,n){return new e({type:`union`,options:t,...C(n)})}function Zs(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...C(r)})}function Qs(e,t,n){return new e({type:`intersection`,left:t,right:n})}function $s(e,t,n,r){let i=n instanceof E;return new e({type:`tuple`,items:t,rest:i?n:null,...C(i?r:n)})}function ec(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...C(r)})}function tc(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...C(r)})}function nc(e,t,n){return new e({type:`set`,valueType:t,...C(n)})}function rc(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...C(n)})}function ic(e,t,n){return new e({type:`enum`,entries:t,...C(n)})}function ac(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...C(n)})}function oc(e,t){return new e({type:`file`,...C(t)})}function sc(e,t){return new e({type:`transform`,transform:t})}function cc(e,t){return new e({type:`optional`,innerType:t})}function lc(e,t){return new e({type:`nullable`,innerType:t})}function uc(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():n}})}function dc(e,t,n){return new e({type:`nonoptional`,innerType:t,...C(n)})}function fc(e,t){return new e({type:`success`,innerType:t})}function pc(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function mc(e,t,n){return new e({type:`pipe`,in:t,out:n})}function hc(e,t){return new e({type:`readonly`,innerType:t})}function gc(e,t,n){return new e({type:`template_literal`,parts:t,...C(n)})}function _c(e,t){return new e({type:`lazy`,getter:t})}function vc(e,t){return new e({type:`promise`,innerType:t})}function yc(e,t,n){let r=C(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function bc(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...C(n)})}function xc(e,t){let{case:n,error:r,truthy:i,falsy:a}=C(t),o=i??[`true`,`1`,`yes`,`on`,`y`,`enabled`],s=a??[`false`,`0`,`no`,`off`,`n`,`disabled`];n!==`sensitive`&&(o=o.map(e=>typeof e==`string`?e.toLowerCase():e),s=s.map(e=>typeof e==`string`?e.toLowerCase():e));let c=new Set(o),l=new Set(s),u=e.Pipe??Ii,d=e.Boolean??qr,f=e.String??vr,p=new(e.Transform??Ti)({type:`transform`,transform:(e,t)=>{let r=e;return n!==`sensitive`&&(r=r.toLowerCase()),c.has(r)?!0:l.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...c,...l],input:t.value,inst:p}),{})},error:r});return new u({type:`pipe`,in:new u({type:`pipe`,in:new f({type:`string`,error:r}),out:p,error:r}),out:new d({type:`boolean`,error:r}),error:r})}var Sc=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=((...n)=>{let r=this._def.input?Yt(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=e(...r);return this._def.output?Yt(this._def.output,i,void 0,{callee:t}):i});return t}implementAsync(e){if(typeof e!=`function`)throw Error(`implement() must be called with a function`);let t=(async(...n)=>{let r=this._def.input?await Zt(this._def.input,n,void 0,{callee:t}):n;if(!Array.isArray(r))throw Error(`Invalid arguments schema: not an array or tuple schema.`);let i=await e(...r);return this._def.output?Zt(this._def.output,i,void 0,{callee:t}):i});return t}input(...e){let t=this.constructor;return Array.isArray(e[0])?new t({type:`function`,input:new hi({type:`tuple`,items:e[0],rest:e[1]}),output:this._def.output}):new t({type:`function`,input:e[0],output:this._def.output})}output(e){let t=this.constructor;return new t({type:`function`,input:this._def.input,output:e})}};function Cc(e){return new Sc({type:`function`,input:Array.isArray(e?.input)?$s(hi,e?.input):e?.input??Ys(ai,gs(ei)),output:e?.output??gs(ei)})}var wc=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Co,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`undefined`:{let e=t;e.type=`null`;break}case`null`:t.type=`null`;break;case`any`:break;case`unknown`:break;case`never`:t.not={};break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t;e.anyOf=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,`anyOf`,t]}));break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,`prefixItems`,t]}));if(this.target===`draft-2020-12`?i.prefixItems=a:i.items=a,r.rest){let e=this.process(r.rest,{...n,path:[...n.path,`items`]});this.target===`draft-2020-12`?i.items=e:i.additionalItems=e}r.rest&&(i.items=this.process(r.rest,{...n,path:[...n.path,`items`]}));let{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s);break}case`record`:{let e=t;e.type=`object`,e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]}),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=et(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:t.anyOf=[this.process(r.innerType,n),{type:`null`}];break;case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&k(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id;if(r)return{ref:n.external.uri(r)};let i=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=i,{defId:i,ref:`${n.external.uri(`__shared`)}#/${t}/${i}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){if(n.cycles===`throw`)throw Error(`Cycle detected: #/${r.cycle?.join(`/`)}/<root>
29
+
30
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=Ct,s=!$e.jitless,c=s&&wt.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?la([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function fa(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Wt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>qt(e,r,y())))}),t)}const pa=v(`$ZodUnion`,(e,t)=>{E.init(e,t),x(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),x(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),x(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),x(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ut(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>fa(t,i,e,a)):fa(s,i,e,a)}}),ma=v(`$ZodDiscriminatedUnion`,(e,t)=>{pa.init(e,t);let n=e._zod.parse;x(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ct(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!Ct(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),ha=v(`$ZodIntersection`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>_a(e,t,n)):_a(e,i,a)}});function ga(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Tt(e)&&Tt(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=ga(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=ga(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _a(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 r=ga(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const va=v(`$ZodTuple`,(e,t)=>{E.init(e,t);let n=t.items;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 o=[],s=[...n].reverse().findIndex(e=>e._zod.optin!==`optional`),c=s===-1?0:n.length-s;if(!t.rest){let t=a.length>n.length,i=a.length<c-1;if(t||i)return r.issues.push({...t?{code:`too_big`,maximum:n.length}:{code:`too_small`,minimum:n.length},input:a,inst:e,origin:`array`}),r}let l=-1;for(let e of n){if(l++,l>=a.length&&l>=c)continue;let t=e._zod.run({value:a[l],issues:[]},i);t instanceof Promise?o.push(t.then(e=>ya(e,r,l))):ya(t,r,l)}if(t.rest){let e=a.slice(n.length);for(let n of e){l++;let e=t.rest._zod.run({value:n,issues:[]},i);e instanceof Promise?o.push(e.then(e=>ya(e,r,l))):ya(e,r,l)}}return o.length?Promise.all(o).then(()=>r):r}});function ya(e,t,n){e.issues.length&&t.issues.push(...Gt(n,e.issues)),t.value[n]=e.value}const ba=v(`$ZodRecord`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Tt(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...Gt(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...Gt(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>qt(e,r,y())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...Gt(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Gt(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),xa=v(`$ZodMap`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:`map`,code:`invalid_type`,input:i,inst:e}),n;let a=[];n.value=new Map;for(let[o,s]of i){let c=t.keyType._zod.run({value:o,issues:[]},r),l=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise||l instanceof Promise?a.push(Promise.all([c,l]).then(([t,a])=>{Sa(t,a,n,o,i,e,r)})):Sa(c,l,n,o,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function Sa(e,t,n,r,i,a,o){e.issues.length&&(kt.has(typeof r)?n.issues.push(...Gt(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>qt(e,o,y()))})),t.issues.length&&(kt.has(typeof r)?n.issues.push(...Gt(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>qt(e,o,y()))})),n.value.set(e.value,t.value)}const Ca=v(`$ZodSet`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:`set`,code:`invalid_type`}),n;let a=[];n.value=new Set;for(let e of i){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>wa(e,n))):wa(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function wa(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}const Ta=v(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=ot(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>kt.has(typeof e)).map(e=>typeof e==`string`?jt(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Ea=v(`$ZodLiteral`,(e,t)=>{if(E.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?jt(e):e?jt(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Da=v(`$ZodFile`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),Oa=v(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qe(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Ze;return n.value=i,n}});function ka(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Aa=v(`$ZodOptional`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ut(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>ka(t,e.value)):ka(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ja=v(`$ZodNullable`,(e,t)=>{E.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ut(e.source)}|null)$`):void 0}),x(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Ma=v(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Na(e,t)):Na(r,t)}});function Na(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Pa=v(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fa=v(`$ZodNonOptional`,(e,t)=>{E.init(e,t),x(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ia(t,e)):Ia(i,e)}});function Ia(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const La=v(`$ZodSuccess`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new Qe(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Ra=v(`$ZodCatch`,(e,t)=>{E.init(e,t),x(e._zod,`optin`,()=>t.innerType._zod.optin),x(e._zod,`optout`,()=>t.innerType._zod.optout),x(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>qt(e,n,y()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>qt(e,n,y()))},input:e.value}),e.issues=[]),e)}}),za=v(`$ZodNaN`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Ba=v(`$ZodPipe`,(e,t)=>{E.init(e,t),x(e._zod,`values`,()=>t.in._zod.values),x(e._zod,`optin`,()=>t.in._zod.optin),x(e._zod,`optout`,()=>t.out._zod.optout),x(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Va(e,t.in,n)):Va(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Va(e,t.out,n)):Va(r,t.out,n)}});function Va(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Ha=v(`$ZodCodec`,(e,t)=>{E.init(e,t),x(e._zod,`values`,()=>t.in._zod.values),x(e._zod,`optin`,()=>t.in._zod.optin),x(e._zod,`optout`,()=>t.out._zod.optout),x(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ua(e,t,n)):Ua(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ua(e,t,n)):Ua(r,t,n)}}});function Ua(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(r=>Wa(e,r,t.out,n)):Wa(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Wa(e,r,t.in,n)):Wa(e,r,t.in,n)}}function Wa(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}const Ga=v(`$ZodReadonly`,(e,t)=>{E.init(e,t),x(e._zod,`propValues`,()=>t.innerType._zod.propValues),x(e._zod,`values`,()=>t.innerType._zod.values),x(e._zod,`optin`,()=>t.innerType?._zod?.optin),x(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Ka):Ka(r)}});function Ka(e){return e.value=Object.freeze(e.value),e}const qa=v(`$ZodTemplateLiteral`,(e,t)=>{E.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=t.startsWith(`^`)?1:0,i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||At.has(typeof e))n.push(jt(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`template_literal`,code:`invalid_type`}),n)}),Ja=v(`$ZodFunction`,(e,t)=>(E.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?mn(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?mn(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await gn(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await gn(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new va({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Ya=v(`$ZodPromise`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Xa=v(`$ZodLazy`,(e,t)=>{E.init(e,t),x(e._zod,`innerType`,()=>t.getter()),x(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),x(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),x(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),x(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Za=v(`$ZodCustom`,(e,t)=>{T.init(e,t),E.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qa(t,n,r,e));Qa(i,n,r,e)}});function Qa(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Xt(e))}}const $a=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n=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},r={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,jwt:`JWT`,template_literal:`مدخل`};return e=>{switch(e.code){case`invalid_type`:return`مدخلات غير مقبولة: يفترض إدخال ${e.expected}، ولكن تم إدخال ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${C(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${r[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${b(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}};function eo(){return{localeError:$a()}}const to=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=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},r={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 e=>{switch(e.code){case`invalid_type`:return`Yanlış dəyər: gözlənilən ${e.expected}, daxil olan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${C(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${r[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}};function no(){return{localeError:to()}}function ro(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const io=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`лік`;case`object`:if(Array.isArray(e))return`масіў`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,jwt:`JWT`,template_literal:`увод`};return e=>{switch(e.code){case`invalid_type`:return`Няправільны ўвод: чакаўся ${e.expected}, атрымана ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${C(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=ro(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=ro(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${r[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}};function ao(){return{localeError:io()}}const oo=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},so=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,jwt:`JWT`,template_literal:`вход`};return e=>{switch(e.code){case`invalid_type`:return`Невалиден вход: очакван ${e.expected}, получен ${oo(e.input)}`;case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${C(e.values[0])}`:`Невалидна опция: очаквано едно от ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}};function co(){return{localeError:so()}}const lo=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n=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},r={regex:`entrada`,email:`adreça electrònica`,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ça IPv4`,ipv6:`adreça IPv6`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipus invàlid: s'esperava ${e.expected}, s'ha rebut ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${C(e.values[0])}`:`Opció invàlida: s'esperava una de ${b(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${r[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}};function uo(){return{localeError:lo()}}const fo=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`číslo`;case`string`:return`řetězec`;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(e))return`pole`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`regulární výraz`,email:`e-mailová 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 čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,jwt:`JWT`,template_literal:`vstup`};return e=>{switch(e.code){case`invalid_type`:return`Neplatný vstup: očekáváno ${e.expected}, obdrženo ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${C(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${b(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}};function po(){return{localeError:fo()}}const mo=()=>{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æt`,file:`fil`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tal`;case`object`:return Array.isArray(e)?`liste`:e===null?`null`:Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:`objekt`}return t},a={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æt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-område`,ipv6:`IPv6-område`,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 e=>{switch(e.code){case`invalid_type`:return`Ugyldigt input: forventede ${r(e.expected)}, fik ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${C(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${b(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`For stor: forventede ${a??`value`} ${i.verb} ${t} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${t} ${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`For lille: forventede ${a} ${i.verb} ${t} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${t} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${a[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}};function ho(){return{localeError:mo()}}const go=()=>{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(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`Zahl`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Ungültige Eingabe: erwartet ${e.expected}, erhalten ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${C(e.values[0])}`:`Ungültige Option: erwartet eine von ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}};function _o(){return{localeError:go()}}const vo=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},yo=()=>{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(t){return e[t]??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`,mac:`MAC 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 e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${e.expected}, received ${vo(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${C(e.values[0])}`:`Invalid option: expected one of ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function bo(){return{localeError:yo()}}const xo=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},So=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,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ŭro`,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 e=>{switch(e.code){case`invalid_type`:return`Nevalida enigo: atendiĝis ${e.expected}, riceviĝis ${xo(e.input)}`;case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${C(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}};function Co(){return{localeError:So()}}const wo=()=>{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úmero`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};function n(t){return e[t]??null}function r(e){return t[e]??e}let i=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:Object.getPrototypeOf(e)===Object.prototype?`object`:e.constructor.name}return t},a={regex:`entrada`,email:`dirección de correo electrónico`,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ón ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: se esperaba ${r(e.expected)}, recibido ${r(i(e.input))}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${C(e.values[0])}`:`Opción inválida: se esperaba una de ${b(e.values,`|`)}`;case`too_big`:{let t=e.inclusive?`<=`:`<`,i=n(e.origin),a=r(e.origin);return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${t}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${t}${e.maximum.toString()}`}case`too_small`:{let t=e.inclusive?`>=`:`>`,i=n(e.origin),a=r(e.origin);return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${t}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${t}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${a[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r(e.origin)}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r(e.origin)}`;default:return`Entrada inválida`}}};function To(){return{localeError:wo()}}const Eo=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`آرایه`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,jwt:`JWT`,template_literal:`ورودی`};return e=>{switch(e.code){case`invalid_type`:return`ورودی نامعتبر: می‌بایست ${e.expected} می‌بود، ${n(e.input)} دریافت شد`;case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: می‌بایست ${C(e.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${b(e.values,`|`)} می‌بود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${r[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${b(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}};function Do(){return{localeError:Eo()}}const Oo=()=>{let e={string:{unit:`merkkiä`,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äivämäärän`}};function t(t){return e[t]??null}let n=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},r={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,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äivämäärä`,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 e=>{switch(e.code){case`invalid_type`:return`Virheellinen tyyppi: odotettiin ${e.expected}, oli ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${C(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${b(e.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öte`}}};function ko(){return{localeError:Oo()}}const Ao=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombre`;case`object`:if(Array.isArray(e))return`tableau`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`entrée`,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ée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : ${e.expected} attendu, ${n(e.input)} reçu`;case`invalid_value`:return e.values.length===1?`Entrée invalide : ${C(e.values[0])} attendu`:`Option invalide : une valeur parmi ${b(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Trop grand : ${e.origin??`valeur`} doit ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`élément(s)`}`:`Trop grand : ${e.origin??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Trop petit : ${e.origin} doit ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : ${e.origin} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au modèle ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${b(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function jo(){return{localeError:Ao()}}const Mo=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n=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},r={regex:`entrée`,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ée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,jwt:`JWT`,template_literal:`entrée`};return e=>{switch(e.code){case`invalid_type`:return`Entrée invalide : attendu ${e.expected}, reçu ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${C(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${r[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${b(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}};function No(){return{localeError:Mo()}}const Po=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`number`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:Object.getPrototypeOf(e)!==Object.prototype&&e.constructor?e.constructor.name:`object`;default:return t}},c={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},jwt:{label:`JWT`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=r(n),a=s(t.input);return`קלט לא תקין: צריך להיות ${i}, התקבל ${e[a]?.label??a}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${C(t.values[0])}`;let e=t.values.map(e=>C(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=c[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${b(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}};function Fo(){return{localeError:Po()}}const Io=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`szám`;case`object`:if(Array.isArray(e))return`tömb`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`bemenet`,email:`email cím`,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őbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,jwt:`JWT`,template_literal:`bemenet`};return e=>{switch(e.code){case`invalid_type`:return`Érvénytelen bemenet: a várt érték ${e.expected}, a kapott érték ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${C(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${r[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}};function Lo(){return{localeError:Io()}}const Ro=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n=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},r={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 e=>{switch(e.code){case`invalid_type`:return`Input tidak valid: diharapkan ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${C(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${r[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}};function zo(){return{localeError:Ro()}}const Bo=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`númer`;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},Vo=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,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ími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,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ölugildi`,jwt:`JWT`,template_literal:`gildi`};return e=>{switch(e.code){case`invalid_type`:return`Rangt gildi: Þú slóst inn ${Bo(e.input)} þar sem á að vera ${e.expected}`;case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${C(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}};function Ho(){return{localeError:Vo()}}const Uo=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numero`;case`object`:if(Array.isArray(e))return`vettore`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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 e=>{switch(e.code){case`invalid_type`:return`Input non valido: atteso ${e.expected}, ricevuto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${C(e.values[0])}`:`Opzione non valida: atteso uno tra ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}};function Wo(){return{localeError:Uo()}}const Go=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`数値`;case`object`:if(Array.isArray(e))return`配列`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,jwt:`JWT`,template_literal:`入力値`};return e=>{switch(e.code){case`invalid_type`:return`無効な入力: ${e.expected}が期待されましたが、${n(e.input)}が入力されました`;case`invalid_value`:return e.values.length===1?`無効な入力: ${C(e.values[0])}が期待されました`:`無効な選択: ${b(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${r[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${b(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}};function Ko(){return{localeError:Go()}}const qo=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`რიცხვი`;case`object`:if(Array.isArray(e))return`მასივი`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return{string:`სტრინგი`,boolean:`ბულეანი`,undefined:`undefined`,bigint:`bigint`,symbol:`symbol`,function:`ფუნქცია`}[t]??t},Jo=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული სტრინგი`,base64url:`base64url-კოდირებული სტრინგი`,json_string:`JSON სტრინგი`,e164:`E.164 ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`};return e=>{switch(e.code){case`invalid_type`:return`არასწორი შეყვანა: მოსალოდნელი ${e.expected}, მიღებული ${qo(e.input)}`;case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${C(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${b(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი სტრინგი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი სტრინგი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}};function Yo(){return{localeError:Jo()}}const Xo=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`មិនមែនជាលេខ (NaN)`:`លេខ`;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},r={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`};return e=>{switch(e.code){case`invalid_type`:return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e.expected} ប៉ុន្តែទទួលបាន ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${C(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${r[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${b(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}};function Zo(){return{localeError:Xo()}}function Qo(){return Zo()}const $o=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n=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},r={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,jwt:`JWT`,template_literal:`입력`};return e=>{switch(e.code){case`invalid_type`:return`잘못된 입력: 예상 타입은 ${e.expected}, 받은 타입은 ${n(e.input)}입니다`;case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${C(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${b(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${r[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${b(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}};function es(){return{localeError:$o()}}const ts=e=>ns(typeof e,e),ns=(e,t=void 0)=>{switch(e){case`number`:return Number.isNaN(t)?`NaN`:`skaičius`;case`bigint`:return`sveikasis skaičius`;case`string`:return`eilutė`;case`boolean`:return`loginė reikšmė`;case`undefined`:case`void`:return`neapibrėžta reikšmė`;case`function`:return`funkcija`;case`symbol`:return`simbolis`;case`object`:return t===void 0?`nežinomas objektas`:t===null?`nulinė reikšmė`:Array.isArray(t)?`masyvas`:Object.getPrototypeOf(t)!==Object.prototype&&t.constructor?t.constructor.name:`objektas`;case`null`:return`nulinė reikšmė`}return e},rs=e=>e.charAt(0).toUpperCase()+e.slice(1);function is(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}const as=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto 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ė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,jwt:`JWT`,template_literal:`įvestis`};return e=>{switch(e.code){case`invalid_type`:return`Gautas tipas ${ts(e.input)}, o tikėtasi - ${ns(e.expected)}`;case`invalid_value`:return e.values.length===1?`Privalo būti ${C(e.values[0])}`:`Privalo būti vienas iš ${b(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=ns(e.origin),r=t(e.origin,is(Number(e.maximum)),e.inclusive??!1,`smaller`);if(r?.verb)return`${rs(n??e.origin??`reikšmė`)} ${r.verb} ${e.maximum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${rs(n??e.origin??`reikšmė`)} turi būti ${i} ${e.maximum.toString()} ${r?.unit}`}case`too_small`:{let n=ns(e.origin),r=t(e.origin,is(Number(e.minimum)),e.inclusive??!1,`bigger`);if(r?.verb)return`${rs(n??e.origin??`reikšmė`)} ${r.verb} ${e.minimum.toString()} ${r.unit??`elementų`}`;let i=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${rs(n??e.origin??`reikšmė`)} turi būti ${i} ${e.minimum.toString()} ${r?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:return`${rs(ns(e.origin)??e.origin??`reikšmė`)} turi klaidingą įvestį`;default:return`Klaidinga įvestis`}}};function os(){return{localeError:as()}}const ss=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`број`;case`object`:if(Array.isArray(e))return`низа`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,jwt:`JWT`,template_literal:`внес`};return e=>{switch(e.code){case`invalid_type`:return`Грешен внес: се очекува ${e.expected}, примено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${C(e.values[0])}`:`Грешана опција: се очекува една ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${r[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}};function cs(){return{localeError:ss()}}const ls=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nombor`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Input tidak sah: dijangka ${e.expected}, diterima ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${C(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${r[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${b(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}};function us(){return{localeError:ls()}}const ds=()=>{let e={string:{unit:`tekens`,verb:`te hebben`},file:{unit:`bytes`,verb:`te hebben`},array:{unit:`elementen`,verb:`te hebben`},set:{unit:`elementen`,verb:`te hebben`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`getal`;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},r={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 e=>{switch(e.code){case`invalid_type`:return`Ongeldige invoer: verwacht ${e.expected}, ontving ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${C(e.values[0])}`:`Ongeldige optie: verwacht één van ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Te groot: verwacht dat ${e.origin??`waarde`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elementen`}`:`Te groot: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Te klein: verwacht dat ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Te klein: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}};function fs(){return{localeError:ds()}}const ps=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`tall`;case`object`:if(Array.isArray(e))return`liste`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={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åde`,ipv6:`IPv6-område`,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 e=>{switch(e.code){case`invalid_type`:return`Ugyldig input: forventet ${e.expected}, fikk ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${C(e.values[0])}`:`Ugyldig valg: forventet en av ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}};function ms(){return{localeError:ps()}}const hs=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`numara`;case`object`:if(Array.isArray(e))return`saf`;if(e===null)return`gayb`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`giren`,email:`epostagâh`,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âmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`giren`};return e=>{switch(e.code){case`invalid_type`:return`Fâsit giren: umulan ${e.expected}, alınan ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${C(e.values[0])}`:`Fâsit tercih: mûteberler ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${r[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}};function gs(){return{localeError:hs()}}const _s=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`عدد`;case`object`:if(Array.isArray(e))return`ارې`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,jwt:`JWT`,template_literal:`ورودي`};return e=>{switch(e.code){case`invalid_type`:return`ناسم ورودي: باید ${e.expected} وای, مګر ${n(e.input)} ترلاسه شو`;case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${C(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${b(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${r[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}};function vs(){return{localeError:_s()}}const ys=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`liczba`;case`object`:if(Array.isArray(e))return`tablica`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`wyrażenie`,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ąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,jwt:`JWT`,template_literal:`wejście`};return e=>{switch(e.code){case`invalid_type`:return`Nieprawidłowe dane wejściowe: oczekiwano ${e.expected}, otrzymano ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${C(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}};function bs(){return{localeError:ys()}}const xs=()=>{let e={string:{unit:`caracteres`,verb:`ter`},file:{unit:`bytes`,verb:`ter`},array:{unit:`itens`,verb:`ter`},set:{unit:`itens`,verb:`ter`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`número`;case`object`:if(Array.isArray(e))return`array`;if(e===null)return`nulo`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`padrão`,email:`endereço 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ção ISO`,ipv4:`endereço IPv4`,ipv6:`endereço 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úmero E.164`,jwt:`JWT`,template_literal:`entrada`};return e=>{switch(e.code){case`invalid_type`:return`Tipo inválido: esperado ${e.expected}, recebido ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperado ${C(e.values[0])}`:`Opção inválida: esperada uma das ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Muito grande: esperado que ${e.origin??`valor`} tivesse ${n}${e.maximum.toString()} ${r.unit??`elementos`}`:`Muito grande: esperado que ${e.origin??`valor`} fosse ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Muito pequeno: esperado que ${e.origin} tivesse ${n}${e.minimum.toString()} ${r.unit}`:`Muito pequeno: esperado que ${e.origin} fosse ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`${r[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Chave${e.keys.length>1?`s`:``} desconhecida${e.keys.length>1?`s`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Chave inválida em ${e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido em ${e.origin}`;default:return`Campo inválido`}}};function Ss(){return{localeError:xs()}}function Cs(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}const ws=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`массив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,jwt:`JWT`,template_literal:`ввод`};return e=>{switch(e.code){case`invalid_type`:return`Неверный ввод: ожидалось ${e.expected}, получено ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${C(e.values[0])}`:`Неверный вариант: ожидалось одно из ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Cs(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Cs(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}};function Ts(){return{localeError:ws()}}const Es=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`število`;case`object`:if(Array.isArray(e))return`tabela`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`vnos`,email:`e-poštni 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 čas`,date:`ISO datum`,time:`ISO čas`,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 številka`,jwt:`JWT`,template_literal:`vnos`};return e=>{switch(e.code){case`invalid_type`:return`Neveljaven vnos: pričakovano ${e.expected}, prejeto ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${C(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${r[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}};function Ds(){return{localeError:Es()}}const Os=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`antal`;case`object`:if(Array.isArray(e))return`lista`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`reguljärt 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äng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,jwt:`JWT`,template_literal:`mall-literal`};return e=>{switch(e.code){case`invalid_type`:return`Ogiltig inmatning: förväntat ${e.expected}, fick ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${C(e.values[0])}`:`Ogiltigt val: förväntade en av ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${r[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}};function ks(){return{localeError:Os()}}const As=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`எண் அல்லாதது`:`எண்`;case`object`:if(Array.isArray(e))return`அணி`;if(e===null)return`வெறுமை`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`உள்ளீடு`,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:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,jwt:`JWT`,template_literal:`input`};return e=>{switch(e.code){case`invalid_type`:return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e.expected}, பெறப்பட்டது ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${C(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${b(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${r[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}};function js(){return{localeError:As()}}const Ms=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`ไม่ใช่ตัวเลข (NaN)`:`ตัวเลข`;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},r={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`};return e=>{switch(e.code){case`invalid_type`:return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e.expected} แต่ได้รับ ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${C(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${r[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${b(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}};function Ns(){return{localeError:Ms()}}const Ps=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},Fs=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??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üre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,jwt:`JWT`,template_literal:`Şablon dizesi`};return e=>{switch(e.code){case`invalid_type`:return`Geçersiz değer: beklenen ${e.expected}, alınan ${Ps(e.input)}`;case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${C(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}};function Is(){return{localeError:Fs()}}const Ls=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`число`;case`object`:if(Array.isArray(e))return`масив`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,jwt:`JWT`,template_literal:`вхідні дані`};return e=>{switch(e.code){case`invalid_type`:return`Неправильні вхідні дані: очікується ${e.expected}, отримано ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${C(e.values[0])}`:`Неправильна опція: очікується одне з ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${r[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${b(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}};function Rs(){return{localeError:Ls()}}function zs(){return Rs()}const Bs=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`نمبر`;case`object`:if(Array.isArray(e))return`آرے`;if(e===null)return`نل`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`};return e=>{switch(e.code){case`invalid_type`:return`غلط ان پٹ: ${e.expected} متوقع تھا، ${n(e.input)} موصول ہوا`;case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${C(e.values[0])} متوقع تھا`:`غلط آپشن: ${b(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${r[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${b(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}};function Vs(){return{localeError:Bs()}}const Hs=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`số`;case`object`:if(Array.isArray(e))return`mảng`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`đầu vào`,email:`địa chỉ 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ày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,jwt:`JWT`,template_literal:`đầu vào`};return e=>{switch(e.code){case`invalid_type`:return`Đầu vào không hợp lệ: mong đợi ${e.expected}, nhận được ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${C(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${r[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${b(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}};function Us(){return{localeError:Hs()}}const Ws=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`非数字(NaN)`:`数字`;case`object`:if(Array.isArray(e))return`数组`;if(e===null)return`空值(null)`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,jwt:`JWT`,template_literal:`输入`};return e=>{switch(e.code){case`invalid_type`:return`无效输入:期望 ${e.expected},实际接收 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`无效输入:期望 ${C(e.values[0])}`:`无效选项:期望以下之一 ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${r[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${b(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}};function Gs(){return{localeError:Ws()}}const Ks=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n=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},r={regex:`輸入`,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:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,jwt:`JWT`,template_literal:`輸入`};return e=>{switch(e.code){case`invalid_type`:return`無效的輸入值:預期為 ${e.expected},但收到 ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${C(e.values[0])}`:`無效的選項:預期為以下其中之一 ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${r[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${b(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}};function qs(){return{localeError:Ks()}}const Js=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n=e=>{let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`NaN`:`nọ́mbà`;case`object`:if(Array.isArray(e))return`akopọ`;if(e===null)return`null`;if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t},r={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,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:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`};return e=>{switch(e.code){case`invalid_type`:return`Ìbáwọlé aṣìṣe: a ní láti fi ${e.expected}, àmọ̀ a rí ${n(e.input)}`;case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${C(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${b(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${r[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${b(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}};function Ys(){return{localeError:Js()}}var Xs=Fe({ar:()=>eo,az:()=>no,be:()=>ao,bg:()=>co,ca:()=>uo,cs:()=>po,da:()=>ho,de:()=>_o,en:()=>bo,eo:()=>Co,es:()=>To,fa:()=>Do,fi:()=>ko,fr:()=>jo,frCA:()=>No,he:()=>Fo,hu:()=>Lo,id:()=>zo,is:()=>Ho,it:()=>Wo,ja:()=>Ko,ka:()=>Yo,kh:()=>Qo,km:()=>Zo,ko:()=>es,lt:()=>os,mk:()=>cs,ms:()=>us,nl:()=>fs,no:()=>ms,ota:()=>gs,pl:()=>bs,ps:()=>vs,pt:()=>Ss,ru:()=>Ts,sl:()=>Ds,sv:()=>ks,ta:()=>js,th:()=>Ns,tr:()=>Is,ua:()=>zs,uk:()=>Rs,ur:()=>Vs,vi:()=>Us,yo:()=>Ys,zhCN:()=>Gs,zhTW:()=>qs}),Zs;const Qs=Symbol(`ZodOutput`),$s=Symbol(`ZodInput`);var ec=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function tc(){return new ec}(Zs=globalThis).__zod_globalRegistry??(Zs.__zod_globalRegistry=tc());const nc=globalThis.__zod_globalRegistry;function rc(e,t){return new e({type:`string`,...S(t)})}function ic(e,t){return new e({type:`string`,coerce:!0,...S(t)})}function ac(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...S(t)})}function oc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...S(t)})}function sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...S(t)})}function cc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...S(t)})}function lc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...S(t)})}function uc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...S(t)})}function dc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...S(t)})}function fc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...S(t)})}function pc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...S(t)})}function mc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...S(t)})}function hc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...S(t)})}function gc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...S(t)})}function _c(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...S(t)})}function vc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...S(t)})}function yc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...S(t)})}function bc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...S(t)})}function xc(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...S(t)})}function Sc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...S(t)})}function Cc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...S(t)})}function wc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...S(t)})}function Tc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...S(t)})}function Ec(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...S(t)})}function Dc(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...S(t)})}const Oc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function kc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...S(t)})}function Ac(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...S(t)})}function jc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...S(t)})}function Mc(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...S(t)})}function Nc(e,t){return new e({type:`number`,checks:[],...S(t)})}function Pc(e,t){return new e({type:`number`,coerce:!0,checks:[],...S(t)})}function Fc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...S(t)})}function Ic(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...S(t)})}function Lc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...S(t)})}function Rc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...S(t)})}function zc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...S(t)})}function Bc(e,t){return new e({type:`boolean`,...S(t)})}function Vc(e,t){return new e({type:`boolean`,coerce:!0,...S(t)})}function Hc(e,t){return new e({type:`bigint`,...S(t)})}function Uc(e,t){return new e({type:`bigint`,coerce:!0,...S(t)})}function Wc(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...S(t)})}function Gc(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...S(t)})}function Kc(e,t){return new e({type:`symbol`,...S(t)})}function qc(e,t){return new e({type:`undefined`,...S(t)})}function Jc(e,t){return new e({type:`null`,...S(t)})}function Yc(e){return new e({type:`any`})}function Xc(e){return new e({type:`unknown`})}function Zc(e,t){return new e({type:`never`,...S(t)})}function Qc(e,t){return new e({type:`void`,...S(t)})}function $c(e,t){return new e({type:`date`,...S(t)})}function el(e,t){return new e({type:`date`,coerce:!0,...S(t)})}function tl(e,t){return new e({type:`nan`,...S(t)})}function nl(e,t){return new qr({check:`less_than`,...S(t),value:e,inclusive:!1})}function rl(e,t){return new qr({check:`less_than`,...S(t),value:e,inclusive:!0})}function il(e,t){return new Jr({check:`greater_than`,...S(t),value:e,inclusive:!1})}function O(e,t){return new Jr({check:`greater_than`,...S(t),value:e,inclusive:!0})}function al(e){return il(0,e)}function ol(e){return nl(0,e)}function sl(e){return rl(0,e)}function cl(e){return O(0,e)}function ll(e,t){return new Yr({check:`multiple_of`,...S(t),value:e})}function ul(e,t){return new Qr({check:`max_size`,...S(t),maximum:e})}function dl(e,t){return new $r({check:`min_size`,...S(t),minimum:e})}function fl(e,t){return new ei({check:`size_equals`,...S(t),size:e})}function pl(e,t){return new ti({check:`max_length`,...S(t),maximum:e})}function ml(e,t){return new ni({check:`min_length`,...S(t),minimum:e})}function hl(e,t){return new ri({check:`length_equals`,...S(t),length:e})}function gl(e,t){return new ai({check:`string_format`,format:`regex`,...S(t),pattern:e})}function _l(e){return new oi({check:`string_format`,format:`lowercase`,...S(e)})}function vl(e){return new si({check:`string_format`,format:`uppercase`,...S(e)})}function yl(e,t){return new ci({check:`string_format`,format:`includes`,...S(t),includes:e})}function bl(e,t){return new li({check:`string_format`,format:`starts_with`,...S(t),prefix:e})}function xl(e,t){return new ui({check:`string_format`,format:`ends_with`,...S(t),suffix:e})}function Sl(e,t,n){return new fi({check:`property`,property:e,schema:t,...S(n)})}function Cl(e,t){return new pi({check:`mime_type`,mime:e,...S(t)})}function wl(e){return new mi({check:`overwrite`,tx:e})}function Tl(e){return wl(t=>t.normalize(e))}function El(){return wl(e=>e.trim())}function Dl(){return wl(e=>e.toLowerCase())}function Ol(){return wl(e=>e.toUpperCase())}function kl(){return wl(e=>xt(e))}function Al(e,t,n){return new e({type:`array`,element:t,...S(n)})}function jl(e,t,n){return new e({type:`union`,options:t,...S(n)})}function Ml(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...S(r)})}function Nl(e,t,n){return new e({type:`intersection`,left:t,right:n})}function Pl(e,t,n,r){let i=n instanceof E;return new e({type:`tuple`,items:t,rest:i?n:null,...S(i?r:n)})}function Fl(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...S(r)})}function Il(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...S(r)})}function Ll(e,t,n){return new e({type:`set`,valueType:t,...S(n)})}function Rl(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...S(n)})}function zl(e,t,n){return new e({type:`enum`,entries:t,...S(n)})}function Bl(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...S(n)})}function Vl(e,t){return new e({type:`file`,...S(t)})}function Hl(e,t){return new e({type:`transform`,transform:t})}function Ul(e,t){return new e({type:`optional`,innerType:t})}function Wl(e,t){return new e({type:`nullable`,innerType:t})}function Gl(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():Et(n)}})}function Kl(e,t,n){return new e({type:`nonoptional`,innerType:t,...S(n)})}function ql(e,t){return new e({type:`success`,innerType:t})}function Jl(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:()=>n})}function Yl(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Xl(e,t){return new e({type:`readonly`,innerType:t})}function Zl(e,t,n){return new e({type:`template_literal`,parts:t,...S(n)})}function Ql(e,t){return new e({type:`lazy`,getter:t})}function $l(e,t){return new e({type:`promise`,innerType:t})}function eu(e,t,n){let r=S(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function tu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...S(n)})}function nu(e){let t=ru(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(Xt(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(Xt(r))}},e(n.value,n)));return t}function ru(e,t){let n=new T({check:`custom`,...S(t)});return n._zod.check=e,n}function iu(e){let t=new T({check:`describe`});return t._zod.onattach=[t=>{let n=nc.get(t)??{};nc.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function au(e){let t=new T({check:`meta`});return t._zod.onattach=[t=>{let n=nc.get(t)??{};nc.add(t,{...n,...e})}],t._zod.check=()=>{},t}function ou(e,t){let n=S(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??Ha,c=e.Boolean??Ji,l=new s({type:`pipe`,in:new(e.String??_i)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}function su(e,t,n,r={}){let i=S(r),a={...S(r),check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var cu=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??nc,this.target=e?.target??`draft-2020-12`,this.unrepresentable=e?.unrepresentable??`throw`,this.override=e?.override??(()=>{}),this.io=e?.io??`output`,this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var n;let r=e._zod.def,i={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let n={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)o.ref=a,this.process(a,n),this.seen.get(a).isParent=!0;else{let t=o.schema;switch(r.type){case`string`:{let n=t;n.type=`string`;let{minimum:r,maximum:a,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof r==`number`&&(n.minLength=r),typeof a==`number`&&(n.maxLength=a),s&&(n.format=i[s]??s,n.format===``&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?n.pattern=e[0].source:e.length>1&&(o.schema.allOf=[...e.map(e=>({...this.target===`draft-7`||this.target===`draft-4`||this.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}break}case`number`:{let n=t,{minimum:r,maximum:i,format:a,multipleOf:o,exclusiveMaximum:s,exclusiveMinimum:c}=e._zod.bag;typeof a==`string`&&a.includes(`int`)?n.type=`integer`:n.type=`number`,typeof c==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof r==`number`&&(n.minimum=r,typeof c==`number`&&this.target!==`draft-4`&&(c>=r?delete n.minimum:delete n.exclusiveMinimum)),typeof s==`number`&&(this.target===`draft-4`||this.target===`openapi-3.0`?(n.maximum=s,n.exclusiveMaximum=!0):n.exclusiveMaximum=s),typeof i==`number`&&(n.maximum=i,typeof s==`number`&&this.target!==`draft-4`&&(s<=i?delete n.maximum:delete n.exclusiveMaximum)),typeof o==`number`&&(n.multipleOf=o);break}case`boolean`:{let e=t;e.type=`boolean`;break}case`bigint`:if(this.unrepresentable===`throw`)throw Error(`BigInt cannot be represented in JSON Schema`);break;case`symbol`:if(this.unrepresentable===`throw`)throw Error(`Symbols cannot be represented in JSON Schema`);break;case`null`:this.target===`openapi-3.0`?(t.type=`string`,t.nullable=!0,t.enum=[null]):t.type=`null`;break;case`any`:break;case`unknown`:break;case`undefined`:if(this.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`);break;case`void`:if(this.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`);break;case`never`:t.not={};break;case`date`:if(this.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`);break;case`array`:{let i=t,{minimum:a,maximum:o}=e._zod.bag;typeof a==`number`&&(i.minItems=a),typeof o==`number`&&(i.maxItems=o),i.type=`array`,i.items=this.process(r.element,{...n,path:[...n.path,`items`]});break}case`object`:{let e=t;e.type=`object`,e.properties={};let i=r.shape;for(let t in i)e.properties[t]=this.process(i[t],{...n,path:[...n.path,`properties`,t]});let a=new Set(Object.keys(i)),o=new Set([...a].filter(e=>{let t=r.shape[e]._zod;return this.io===`input`?t.optin===void 0:t.optout===void 0}));o.size>0&&(e.required=Array.from(o)),r.catchall?._zod.def.type===`never`?e.additionalProperties=!1:r.catchall?r.catchall&&(e.additionalProperties=this.process(r.catchall,{...n,path:[...n.path,`additionalProperties`]})):this.io===`output`&&(e.additionalProperties=!1);break}case`union`:{let e=t,i=r.discriminator!==void 0,a=r.options.map((e,t)=>this.process(e,{...n,path:[...n.path,i?`oneOf`:`anyOf`,t]}));i?e.oneOf=a:e.anyOf=a;break}case`intersection`:{let e=t,i=this.process(r.left,{...n,path:[...n.path,`allOf`,0]}),a=this.process(r.right,{...n,path:[...n.path,`allOf`,1]}),o=e=>`allOf`in e&&Object.keys(e).length===1;e.allOf=[...o(i)?i.allOf:[i],...o(a)?a.allOf:[a]];break}case`tuple`:{let i=t;i.type=`array`;let a=this.target===`draft-2020-12`?`prefixItems`:`items`,o=this.target===`draft-2020-12`||this.target===`openapi-3.0`?`items`:`additionalItems`,s=r.items.map((e,t)=>this.process(e,{...n,path:[...n.path,a,t]})),c=r.rest?this.process(r.rest,{...n,path:[...n.path,o,...this.target===`openapi-3.0`?[r.items.length]:[]]}):null;this.target===`draft-2020-12`?(i.prefixItems=s,c&&(i.items=c)):this.target===`openapi-3.0`?(i.items={anyOf:s},c&&i.items.anyOf.push(c),i.minItems=s.length,c||(i.maxItems=s.length)):(i.items=s,c&&(i.additionalItems=c));let{minimum:l,maximum:u}=e._zod.bag;typeof l==`number`&&(i.minItems=l),typeof u==`number`&&(i.maxItems=u);break}case`record`:{let e=t;e.type=`object`,(this.target===`draft-7`||this.target===`draft-2020-12`)&&(e.propertyNames=this.process(r.keyType,{...n,path:[...n.path,`propertyNames`]})),e.additionalProperties=this.process(r.valueType,{...n,path:[...n.path,`additionalProperties`]});break}case`map`:if(this.unrepresentable===`throw`)throw Error(`Map cannot be represented in JSON Schema`);break;case`set`:if(this.unrepresentable===`throw`)throw Error(`Set cannot be represented in JSON Schema`);break;case`enum`:{let e=t,n=ot(r.entries);n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),e.enum=n;break}case`literal`:{let e=t,n=[];for(let e of r.values)if(e===void 0){if(this.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(this.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);n.push(Number(e))}else n.push(e);if(n.length!==0)if(n.length===1){let t=n[0];e.type=t===null?`null`:typeof t,this.target===`draft-4`||this.target===`openapi-3.0`?e.enum=[t]:e.const=t}else n.every(e=>typeof e==`number`)&&(e.type=`number`),n.every(e=>typeof e==`string`)&&(e.type=`string`),n.every(e=>typeof e==`boolean`)&&(e.type=`string`),n.every(e=>e===null)&&(e.type=`null`),e.enum=n;break}case`file`:{let n=t,r={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:i,maximum:a,mime:o}=e._zod.bag;i!==void 0&&(r.minLength=i),a!==void 0&&(r.maxLength=a),o?o.length===1?(r.contentMediaType=o[0],Object.assign(n,r)):n.anyOf=o.map(e=>({...r,contentMediaType:e})):Object.assign(n,r);break}case`transform`:if(this.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`);break;case`nullable`:{let e=this.process(r.innerType,n);this.target===`openapi-3.0`?(o.ref=r.innerType,t.nullable=!0):t.anyOf=[e,{type:`null`}];break}case`nonoptional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`success`:{let e=t;e.type=`boolean`;break}case`default`:this.process(r.innerType,n),o.ref=r.innerType,t.default=JSON.parse(JSON.stringify(r.defaultValue));break;case`prefault`:this.process(r.innerType,n),o.ref=r.innerType,this.io===`input`&&(t._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break;case`catch`:{this.process(r.innerType,n),o.ref=r.innerType;let e;try{e=r.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}t.default=e;break}case`nan`:if(this.unrepresentable===`throw`)throw Error(`NaN cannot be represented in JSON Schema`);break;case`template_literal`:{let n=t,r=e._zod.pattern;if(!r)throw Error(`Pattern not found in template literal`);n.type=`string`,n.pattern=r.source;break}case`pipe`:{let e=this.io===`input`?r.in._zod.def.type===`transform`?r.out:r.in:r.out;this.process(e,n),o.ref=e;break}case`readonly`:this.process(r.innerType,n),o.ref=r.innerType,t.readOnly=!0;break;case`promise`:this.process(r.innerType,n),o.ref=r.innerType;break;case`optional`:this.process(r.innerType,n),o.ref=r.innerType;break;case`lazy`:{let t=e._zod.innerType;this.process(t,n),o.ref=t;break}case`custom`:if(this.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`);break;case`function`:if(this.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`);break;default:}}}let c=this.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),this.io===`input`&&k(e)&&(delete o.schema.examples,delete o.schema.default),this.io===`input`&&o.schema._prefault&&((n=o.schema).default??(n.default=o.schema._prefault)),delete o.schema._prefault,this.seen.get(e).schema}emit(e,t){let n={cycles:t?.cycles??`ref`,reused:t?.reused??`inline`,external:t?.external??void 0},r=this.seen.get(e);if(!r)throw Error(`Unprocessed schema. This is a bug in Zod.`);let i=e=>{let t=this.target===`draft-2020-12`?`$defs`:`definitions`;if(n.external){let r=n.external.registry.get(e[0])?.id,i=n.external.uri??(e=>e);if(r)return{ref:i(r)};let a=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${t}/${a}`}}if(e[1]===r)return{ref:`#`};let i=`#/${t}/`,a=e[1].schema.id??`__schema${this.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(n.cycles===`throw`)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join(`/`)}/<root>
37
31
 
38
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);n.cycles===`ref`&&a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&t.target===`draft-7`?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:console.warn(`Invalid target: ${this.target}`),Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}!n.external&&Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function Tc(e,t){if(e instanceof xo){let n=new wc(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri||(e=>e),defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new wc(t);return n.process(e),n.emit(e,t)}function k(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 k(r.element,n);case`object`:for(let e in r.shape)if(k(r.shape[e],n))return!0;return!1;case`union`:for(let e of r.options)if(k(e,n))return!0;return!1;case`intersection`:return k(r.left,n)||k(r.right,n);case`tuple`:for(let e of r.items)if(k(e,n))return!0;return!!(r.rest&&k(r.rest,n));case`record`:return k(r.keyType,n)||k(r.valueType,n);case`map`:return k(r.keyType,n)||k(r.valueType,n);case`set`:return k(r.valueType,n);case`promise`:case`optional`:case`nonoptional`:case`nullable`:case`readonly`:return k(r.innerType,n);case`lazy`:return k(r.getter(),n);case`default`:return k(r.innerType,n);case`prefault`:return k(r.innerType,n);case`custom`:return!1;case`transform`:return!0;case`pipe`:return k(r.in,n)||k(r.out,n);case`success`:return!1;case`catch`:return!1;default:}throw Error(`Unknown schema type: ${r.type}`)}var Ec={},Dc=je({$ZodAny:()=>$r,$ZodArray:()=>ai,$ZodAsyncError:()=>Ke,$ZodBase64:()=>zr,$ZodBase64URL:()=>Vr,$ZodBigInt:()=>Jr,$ZodBigIntFormat:()=>Yr,$ZodBoolean:()=>qr,$ZodCIDRv4:()=>Ir,$ZodCIDRv6:()=>Lr,$ZodCUID:()=>Tr,$ZodCUID2:()=>Er,$ZodCatch:()=>Pi,$ZodCheck:()=>T,$ZodCheckBigIntFormat:()=>Qn,$ZodCheckEndsWith:()=>dr,$ZodCheckGreaterThan:()=>Yn,$ZodCheckIncludes:()=>lr,$ZodCheckLengthEquals:()=>ir,$ZodCheckLessThan:()=>Jn,$ZodCheckLowerCase:()=>sr,$ZodCheckMaxLength:()=>nr,$ZodCheckMaxSize:()=>$n,$ZodCheckMimeType:()=>mr,$ZodCheckMinLength:()=>rr,$ZodCheckMinSize:()=>er,$ZodCheckMultipleOf:()=>Xn,$ZodCheckNumberFormat:()=>Zn,$ZodCheckOverwrite:()=>hr,$ZodCheckProperty:()=>pr,$ZodCheckRegex:()=>or,$ZodCheckSizeEquals:()=>tr,$ZodCheckStartsWith:()=>ur,$ZodCheckStringFormat:()=>ar,$ZodCheckUpperCase:()=>cr,$ZodCustom:()=>Ui,$ZodDate:()=>ri,$ZodDefault:()=>Oi,$ZodDiscriminatedUnion:()=>di,$ZodE164:()=>Hr,$ZodEmail:()=>xr,$ZodEmoji:()=>Cr,$ZodEnum:()=>Si,$ZodError:()=>Vt,$ZodFile:()=>wi,$ZodFunction:()=>Sc,$ZodGUID:()=>yr,$ZodIPv4:()=>Pr,$ZodIPv6:()=>Fr,$ZodISODate:()=>jr,$ZodISODateTime:()=>Ar,$ZodISODuration:()=>Nr,$ZodISOTime:()=>Mr,$ZodIntersection:()=>fi,$ZodJWT:()=>Wr,$ZodKSUID:()=>kr,$ZodLazy:()=>Hi,$ZodLiteral:()=>Ci,$ZodMap:()=>vi,$ZodNaN:()=>Fi,$ZodNanoID:()=>wr,$ZodNever:()=>ti,$ZodNonOptional:()=>ji,$ZodNull:()=>Qr,$ZodNullable:()=>Di,$ZodNumber:()=>Gr,$ZodNumberFormat:()=>Kr,$ZodObject:()=>ci,$ZodOptional:()=>Ei,$ZodPipe:()=>Ii,$ZodPrefault:()=>Ai,$ZodPromise:()=>Vi,$ZodReadonly:()=>Ri,$ZodRealError:()=>Ht,$ZodRecord:()=>_i,$ZodRegistry:()=>xo,$ZodSet:()=>bi,$ZodString:()=>vr,$ZodStringFormat:()=>D,$ZodSuccess:()=>Ni,$ZodSymbol:()=>Xr,$ZodTemplateLiteral:()=>Bi,$ZodTransform:()=>Ti,$ZodTuple:()=>hi,$ZodType:()=>E,$ZodULID:()=>Dr,$ZodURL:()=>Sr,$ZodUUID:()=>br,$ZodUndefined:()=>Zr,$ZodUnion:()=>ui,$ZodUnknown:()=>ei,$ZodVoid:()=>ni,$ZodXID:()=>Or,$brand:()=>Ge,$constructor:()=>y,$input:()=>bo,$output:()=>yo,Doc:()=>gr,JSONSchema:()=>Ec,JSONSchemaGenerator:()=>wc,TimePrecision:()=>Jo,_any:()=>hs,_array:()=>Ys,_base64:()=>Wo,_base64url:()=>Go,_bigint:()=>cs,_boolean:()=>os,_catch:()=>pc,_cidrv4:()=>Ho,_cidrv6:()=>Uo,_coercedBigint:()=>ls,_coercedBoolean:()=>ss,_coercedDate:()=>bs,_coercedNumber:()=>es,_coercedString:()=>To,_cuid:()=>Fo,_cuid2:()=>Io,_custom:()=>yc,_date:()=>ys,_default:()=>uc,_discriminatedUnion:()=>Zs,_e164:()=>Ko,_email:()=>Eo,_emoji:()=>No,_endsWith:()=>Vs,_enum:()=>rc,_file:()=>oc,_float32:()=>ns,_float64:()=>rs,_gt:()=>ws,_gte:()=>O,_guid:()=>Do,_includes:()=>zs,_int:()=>ts,_int32:()=>is,_int64:()=>us,_intersection:()=>Qs,_ipv4:()=>Bo,_ipv6:()=>Vo,_isoDate:()=>Xo,_isoDateTime:()=>Yo,_isoDuration:()=>Qo,_isoTime:()=>Zo,_jwt:()=>qo,_ksuid:()=>zo,_lazy:()=>_c,_length:()=>Fs,_literal:()=>ac,_lowercase:()=>Ls,_lt:()=>Ss,_lte:()=>Cs,_map:()=>tc,_max:()=>Cs,_maxLength:()=>Ns,_maxSize:()=>As,_mime:()=>Us,_min:()=>O,_minLength:()=>Ps,_minSize:()=>js,_multipleOf:()=>ks,_nan:()=>xs,_nanoid:()=>Po,_nativeEnum:()=>ic,_negative:()=>Es,_never:()=>_s,_nonnegative:()=>Os,_nonoptional:()=>dc,_nonpositive:()=>Ds,_normalize:()=>Gs,_null:()=>ms,_nullable:()=>lc,_number:()=>$o,_optional:()=>cc,_overwrite:()=>Ws,_parse:()=>Jt,_parseAsync:()=>Xt,_pipe:()=>mc,_positive:()=>Ts,_promise:()=>vc,_property:()=>Hs,_readonly:()=>hc,_record:()=>ec,_refine:()=>bc,_regex:()=>Is,_safeParse:()=>Qt,_safeParseAsync:()=>en,_set:()=>nc,_size:()=>Ms,_startsWith:()=>Bs,_string:()=>wo,_stringbool:()=>xc,_success:()=>fc,_symbol:()=>fs,_templateLiteral:()=>gc,_toLowerCase:()=>qs,_toUpperCase:()=>Js,_transform:()=>sc,_trim:()=>Ks,_tuple:()=>$s,_uint32:()=>as,_uint64:()=>ds,_ulid:()=>Lo,_undefined:()=>ps,_union:()=>Xs,_unknown:()=>gs,_uppercase:()=>Rs,_url:()=>Mo,_uuid:()=>Oo,_uuidv4:()=>ko,_uuidv6:()=>Ao,_uuidv7:()=>jo,_void:()=>vs,_xid:()=>Ro,clone:()=>bt,config:()=>b,flattenError:()=>Ut,formatError:()=>Wt,function:()=>Cc,globalConfig:()=>qe,globalRegistry:()=>Co,isValidBase64:()=>Rr,isValidBase64URL:()=>Br,isValidJWT:()=>Ur,locales:()=>vo,parse:()=>Yt,parseAsync:()=>Zt,prettifyError:()=>qt,regexes:()=>nn,registry:()=>So,safeParse:()=>$t,safeParseAsync:()=>tn,toDotPath:()=>Kt,toJSONSchema:()=>Tc,treeifyError:()=>Gt,util:()=>Je,version:()=>_r}),Oc=je({ZodISODate:()=>jc,ZodISODateTime:()=>kc,ZodISODuration:()=>Fc,ZodISOTime:()=>Nc,date:()=>Mc,datetime:()=>Ac,duration:()=>Ic,time:()=>Pc});const kc=y(`ZodISODateTime`,(e,t)=>{Ar.init(e,t),M.init(e,t)});function Ac(e){return Yo(kc,e)}const jc=y(`ZodISODate`,(e,t)=>{jr.init(e,t),M.init(e,t)});function Mc(e){return Xo(jc,e)}const Nc=y(`ZodISOTime`,(e,t)=>{Mr.init(e,t),M.init(e,t)});function Pc(e){return Zo(Nc,e)}const Fc=y(`ZodISODuration`,(e,t)=>{Nr.init(e,t),M.init(e,t)});function Ic(e){return Qo(Fc,e)}const Lc=(e,t)=>{Vt.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Wt(e,t)},flatten:{value:t=>Ut(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})},Rc=y(`ZodError`,Lc),zc=y(`ZodError`,Lc,{Parent:Error}),Bc=Jt(zc),Vc=Xt(zc),Hc=Qt(zc),Uc=en(zc),A=y(`ZodType`,(e,t)=>(E.init(e,t),e.def=t,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>bt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Bc(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Hc(e,t,n),e.parseAsync=async(t,n)=>Vc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Uc(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(hd(t,n)),e.superRefine=t=>e.check(gd(t)),e.overwrite=t=>e.check(Ws(t)),e.optional=()=>Bu(e),e.nullable=()=>Hu(e),e.nullish=()=>Bu(Hu(e)),e.nonoptional=t=>Yu(e,t),e.array=()=>du(e),e.or=t=>_u([e,t]),e.and=t=>xu(e,t),e.transform=t=>rd(e,Ru(t)),e.default=t=>Gu(e,t),e.prefault=t=>qu(e,t),e.catch=t=>$u(e,t),e.pipe=t=>rd(e,t),e.readonly=()=>ad(e),e.describe=t=>{let n=e.clone();return Co.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return Co.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return Co.get(e);let n=e.clone();return Co.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Wc=y(`_ZodString`,(e,t)=>{vr.init(e,t),A.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=(...t)=>e.check(Is(...t)),e.includes=(...t)=>e.check(zs(...t)),e.startsWith=(...t)=>e.check(Bs(...t)),e.endsWith=(...t)=>e.check(Vs(...t)),e.min=(...t)=>e.check(Ps(...t)),e.max=(...t)=>e.check(Ns(...t)),e.length=(...t)=>e.check(Fs(...t)),e.nonempty=(...t)=>e.check(Ps(1,...t)),e.lowercase=t=>e.check(Ls(t)),e.uppercase=t=>e.check(Rs(t)),e.trim=()=>e.check(Ks()),e.normalize=(...t)=>e.check(Gs(...t)),e.toLowerCase=()=>e.check(qs()),e.toUpperCase=()=>e.check(Js())}),Gc=y(`ZodString`,(e,t)=>{vr.init(e,t),Wc.init(e,t),e.email=t=>e.check(Eo(Kc,t)),e.url=t=>e.check(Mo(tl,t)),e.jwt=t=>e.check(qo(jl,t)),e.emoji=t=>e.check(No(rl,t)),e.guid=t=>e.check(Do(Jc,t)),e.uuid=t=>e.check(Oo(Xc,t)),e.uuidv4=t=>e.check(ko(Xc,t)),e.uuidv6=t=>e.check(Ao(Xc,t)),e.uuidv7=t=>e.check(jo(Xc,t)),e.nanoid=t=>e.check(Po(al,t)),e.guid=t=>e.check(Do(Jc,t)),e.cuid=t=>e.check(Fo(sl,t)),e.cuid2=t=>e.check(Io(ll,t)),e.ulid=t=>e.check(Lo(dl,t)),e.base64=t=>e.check(Wo(Tl,t)),e.base64url=t=>e.check(Go(Dl,t)),e.xid=t=>e.check(Ro(pl,t)),e.ksuid=t=>e.check(zo(hl,t)),e.ipv4=t=>e.check(Bo(_l,t)),e.ipv6=t=>e.check(Vo(yl,t)),e.cidrv4=t=>e.check(Ho(xl,t)),e.cidrv6=t=>e.check(Uo(Cl,t)),e.e164=t=>e.check(Ko(kl,t)),e.datetime=t=>e.check(Ac(t)),e.date=t=>e.check(Mc(t)),e.time=t=>e.check(Pc(t)),e.duration=t=>e.check(Ic(t))});function j(e){return wo(Gc,e)}const M=y(`ZodStringFormat`,(e,t)=>{D.init(e,t),Wc.init(e,t)}),Kc=y(`ZodEmail`,(e,t)=>{xr.init(e,t),M.init(e,t)});function qc(e){return Eo(Kc,e)}const Jc=y(`ZodGUID`,(e,t)=>{yr.init(e,t),M.init(e,t)});function Yc(e){return Do(Jc,e)}const Xc=y(`ZodUUID`,(e,t)=>{br.init(e,t),M.init(e,t)});function Zc(e){return Oo(Xc,e)}function Qc(e){return ko(Xc,e)}function $c(e){return Ao(Xc,e)}function el(e){return jo(Xc,e)}const tl=y(`ZodURL`,(e,t)=>{Sr.init(e,t),M.init(e,t)});function nl(e){return Mo(tl,e)}const rl=y(`ZodEmoji`,(e,t)=>{Cr.init(e,t),M.init(e,t)});function il(e){return No(rl,e)}const al=y(`ZodNanoID`,(e,t)=>{wr.init(e,t),M.init(e,t)});function ol(e){return Po(al,e)}const sl=y(`ZodCUID`,(e,t)=>{Tr.init(e,t),M.init(e,t)});function cl(e){return Fo(sl,e)}const ll=y(`ZodCUID2`,(e,t)=>{Er.init(e,t),M.init(e,t)});function ul(e){return Io(ll,e)}const dl=y(`ZodULID`,(e,t)=>{Dr.init(e,t),M.init(e,t)});function fl(e){return Lo(dl,e)}const pl=y(`ZodXID`,(e,t)=>{Or.init(e,t),M.init(e,t)});function ml(e){return Ro(pl,e)}const hl=y(`ZodKSUID`,(e,t)=>{kr.init(e,t),M.init(e,t)});function gl(e){return zo(hl,e)}const _l=y(`ZodIPv4`,(e,t)=>{Pr.init(e,t),M.init(e,t)});function vl(e){return Bo(_l,e)}const yl=y(`ZodIPv6`,(e,t)=>{Fr.init(e,t),M.init(e,t)});function bl(e){return Vo(yl,e)}const xl=y(`ZodCIDRv4`,(e,t)=>{Ir.init(e,t),M.init(e,t)});function Sl(e){return Ho(xl,e)}const Cl=y(`ZodCIDRv6`,(e,t)=>{Lr.init(e,t),M.init(e,t)});function wl(e){return Uo(Cl,e)}const Tl=y(`ZodBase64`,(e,t)=>{zr.init(e,t),M.init(e,t)});function El(e){return Wo(Tl,e)}const Dl=y(`ZodBase64URL`,(e,t)=>{Vr.init(e,t),M.init(e,t)});function Ol(e){return Go(Dl,e)}const kl=y(`ZodE164`,(e,t)=>{Hr.init(e,t),M.init(e,t)});function Al(e){return Ko(kl,e)}const jl=y(`ZodJWT`,(e,t)=>{Wr.init(e,t),M.init(e,t)});function Ml(e){return qo(jl,e)}const Nl=y(`ZodNumber`,(e,t)=>{Gr.init(e,t),A.init(e,t),e.gt=(t,n)=>e.check(ws(t,n)),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.lt=(t,n)=>e.check(Ss(t,n)),e.lte=(t,n)=>e.check(Cs(t,n)),e.max=(t,n)=>e.check(Cs(t,n)),e.int=t=>e.check(Il(t)),e.safe=t=>e.check(Il(t)),e.positive=t=>e.check(ws(0,t)),e.nonnegative=t=>e.check(O(0,t)),e.negative=t=>e.check(Ss(0,t)),e.nonpositive=t=>e.check(Cs(0,t)),e.multipleOf=(t,n)=>e.check(ks(t,n)),e.step=(t,n)=>e.check(ks(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Pl(e){return $o(Nl,e)}const Fl=y(`ZodNumberFormat`,(e,t)=>{Kr.init(e,t),Nl.init(e,t)});function Il(e){return ts(Fl,e)}function Ll(e){return ns(Fl,e)}function Rl(e){return rs(Fl,e)}function zl(e){return is(Fl,e)}function Bl(e){return as(Fl,e)}const Vl=y(`ZodBoolean`,(e,t)=>{qr.init(e,t),A.init(e,t)});function Hl(e){return os(Vl,e)}const Ul=y(`ZodBigInt`,(e,t)=>{Jr.init(e,t),A.init(e,t),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.gt=(t,n)=>e.check(ws(t,n)),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.lt=(t,n)=>e.check(Ss(t,n)),e.lte=(t,n)=>e.check(Cs(t,n)),e.max=(t,n)=>e.check(Cs(t,n)),e.positive=t=>e.check(ws(BigInt(0),t)),e.negative=t=>e.check(Ss(BigInt(0),t)),e.nonpositive=t=>e.check(Cs(BigInt(0),t)),e.nonnegative=t=>e.check(O(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(ks(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Wl(e){return cs(Ul,e)}const Gl=y(`ZodBigIntFormat`,(e,t)=>{Yr.init(e,t),Ul.init(e,t)});function Kl(e){return us(Gl,e)}function ql(e){return ds(Gl,e)}const Jl=y(`ZodSymbol`,(e,t)=>{Xr.init(e,t),A.init(e,t)});function Yl(e){return fs(Jl,e)}const Xl=y(`ZodUndefined`,(e,t)=>{Zr.init(e,t),A.init(e,t)});function Zl(e){return ps(Xl,e)}const Ql=y(`ZodNull`,(e,t)=>{Qr.init(e,t),A.init(e,t)});function $l(e){return ms(Ql,e)}const eu=y(`ZodAny`,(e,t)=>{$r.init(e,t),A.init(e,t)});function tu(){return hs(eu)}const nu=y(`ZodUnknown`,(e,t)=>{ei.init(e,t),A.init(e,t)});function ru(){return gs(nu)}const iu=y(`ZodNever`,(e,t)=>{ti.init(e,t),A.init(e,t)});function au(e){return _s(iu,e)}const ou=y(`ZodVoid`,(e,t)=>{ni.init(e,t),A.init(e,t)});function su(e){return vs(ou,e)}const cu=y(`ZodDate`,(e,t)=>{ri.init(e,t),A.init(e,t),e.min=(t,n)=>e.check(O(t,n)),e.max=(t,n)=>e.check(Cs(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function lu(e){return ys(cu,e)}const uu=y(`ZodArray`,(e,t)=>{ai.init(e,t),A.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(Ps(t,n)),e.nonempty=t=>e.check(Ps(1,t)),e.max=(t,n)=>e.check(Ns(t,n)),e.length=(t,n)=>e.check(Fs(t,n)),e.unwrap=()=>e.element});function du(e,t){return Ys(uu,e,t)}function fu(e){let t=e._zod.def.shape;return Pu(Object.keys(t))}const pu=y(`ZodObject`,(e,t)=>{ci.init(e,t),A.init(e,t),S(e,`shape`,()=>Object.fromEntries(Object.entries(e._zod.def.shape))),e.keyof=()=>P(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ru()}),e.loose=()=>e.clone({...e._zod.def,catchall:ru()}),e.strict=()=>e.clone({...e._zod.def,catchall:au()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>Dt(e,t),e.merge=t=>Ot(e,t),e.pick=t=>Tt(e,t),e.omit=t=>Et(e,t),e.partial=(...t)=>kt(zu,e,t[0]),e.required=(...t)=>At(Ju,e,t[0])});function N(e,t){return new pu({type:`object`,get shape(){return ot(this,`shape`,{...e}),this.shape},...C(t)})}function mu(e,t){return new pu({type:`object`,get shape(){return ot(this,`shape`,{...e}),this.shape},catchall:au(),...C(t)})}function hu(e,t){return new pu({type:`object`,get shape(){return ot(this,`shape`,{...e}),this.shape},catchall:ru(),...C(t)})}const gu=y(`ZodUnion`,(e,t)=>{ui.init(e,t),A.init(e,t),e.options=t.options});function _u(e,t){return new gu({type:`union`,options:e,...C(t)})}const vu=y(`ZodDiscriminatedUnion`,(e,t)=>{gu.init(e,t),di.init(e,t)});function yu(e,t,n){return new vu({type:`union`,options:t,discriminator:e,...C(n)})}const bu=y(`ZodIntersection`,(e,t)=>{fi.init(e,t),A.init(e,t)});function xu(e,t){return new bu({type:`intersection`,left:e,right:t})}const Su=y(`ZodTuple`,(e,t)=>{hi.init(e,t),A.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Cu(e,t,n){let r=t instanceof E;return new Su({type:`tuple`,items:e,rest:r?t:null,...C(r?n:t)})}const wu=y(`ZodRecord`,(e,t)=>{_i.init(e,t),A.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Tu(e,t,n){return new wu({type:`record`,keyType:e,valueType:t,...C(n)})}function Eu(e,t,n){return new wu({type:`record`,keyType:_u([e,au()]),valueType:t,...C(n)})}const Du=y(`ZodMap`,(e,t)=>{vi.init(e,t),A.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ou(e,t,n){return new Du({type:`map`,keyType:e,valueType:t,...C(n)})}const ku=y(`ZodSet`,(e,t)=>{bi.init(e,t),A.init(e,t),e.min=(...t)=>e.check(js(...t)),e.nonempty=t=>e.check(js(1,t)),e.max=(...t)=>e.check(As(...t)),e.size=(...t)=>e.check(Ms(...t))});function Au(e,t){return new ku({type:`set`,valueType:e,...C(t)})}const ju=y(`ZodEnum`,(e,t)=>{Si.init(e,t),A.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ju({...t,checks:[],...C(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ju({...t,checks:[],...C(r),entries:i})}});function P(e,t){return new ju({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...C(t)})}function Mu(e,t){return new ju({type:`enum`,entries:e,...C(t)})}const Nu=y(`ZodLiteral`,(e,t)=>{Ci.init(e,t),A.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Pu(e,t){return new Nu({type:`literal`,values:Array.isArray(e)?e:[e],...C(t)})}const Fu=y(`ZodFile`,(e,t)=>{wi.init(e,t),A.init(e,t),e.min=(t,n)=>e.check(js(t,n)),e.max=(t,n)=>e.check(As(t,n)),e.mime=(t,n)=>e.check(Us(Array.isArray(t)?t:[t],n))});function Iu(e){return oc(Fu,e)}const Lu=y(`ZodTransform`,(e,t)=>{Ti.init(e,t),A.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Lt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(Lt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ru(e){return new Lu({type:`transform`,transform:e})}const zu=y(`ZodOptional`,(e,t)=>{Ei.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bu(e){return new zu({type:`optional`,innerType:e})}const Vu=y(`ZodNullable`,(e,t)=>{Di.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hu(e){return new Vu({type:`nullable`,innerType:e})}function Uu(e){return Bu(Hu(e))}const Wu=y(`ZodDefault`,(e,t)=>{Oi.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Gu(e,t){return new Wu({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const Ku=y(`ZodPrefault`,(e,t)=>{Ai.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qu(e,t){return new Ku({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}const Ju=y(`ZodNonOptional`,(e,t)=>{ji.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yu(e,t){return new Ju({type:`nonoptional`,innerType:e,...C(t)})}const Xu=y(`ZodSuccess`,(e,t)=>{Ni.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zu(e){return new Xu({type:`success`,innerType:e})}const Qu=y(`ZodCatch`,(e,t)=>{Pi.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $u(e,t){return new Qu({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const ed=y(`ZodNaN`,(e,t)=>{Fi.init(e,t),A.init(e,t)});function td(e){return xs(ed,e)}const nd=y(`ZodPipe`,(e,t)=>{Ii.init(e,t),A.init(e,t),e.in=t.in,e.out=t.out});function rd(e,t){return new nd({type:`pipe`,in:e,out:t})}const id=y(`ZodReadonly`,(e,t)=>{Ri.init(e,t),A.init(e,t)});function ad(e){return new id({type:`readonly`,innerType:e})}const od=y(`ZodTemplateLiteral`,(e,t)=>{Bi.init(e,t),A.init(e,t)});function sd(e,t){return new od({type:`template_literal`,parts:e,...C(t)})}const cd=y(`ZodLazy`,(e,t)=>{Hi.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.getter()});function ld(e){return new cd({type:`lazy`,getter:e})}const ud=y(`ZodPromise`,(e,t)=>{Vi.init(e,t),A.init(e,t),e.unwrap=()=>e._zod.def.innerType});function dd(e){return new ud({type:`promise`,innerType:e})}const fd=y(`ZodCustom`,(e,t)=>{Ui.init(e,t),A.init(e,t)});function pd(e,t){let n=new T({check:`custom`,...C(t)});return n._zod.check=e,n}function md(e,t){return yc(fd,e??(()=>!0),t)}function hd(e,t={}){return bc(fd,e,t)}function gd(e,t){let n=pd(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Lt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Lt(r))}},e(t.value,t)),t);return n}function _d(e,t={error:`Input not instance of ${e.name}`}){let n=new fd({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...C(t)});return n._zod.bag.Class=e,n}const vd=(...e)=>xc({Pipe:nd,Boolean:Vl,String:Gc,Transform:Lu},...e);function yd(e){let t=ld(()=>_u([j(e),Pl(),Hl(),$l(),du(t),Tu(j(),t)]));return t}function bd(e,t){return rd(Ru(e),t)}const xd={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`},Sd=Object.freeze({status:`aborted`});function Cd(e){b({customError:e})}function wd(){return b().customError}var Td=je({bigint:()=>kd,boolean:()=>Od,date:()=>Ad,number:()=>Dd,string:()=>Ed});function Ed(e){return To(Gc,e)}function Dd(e){return es(Nl,e)}function Od(e){return ss(Vl,e)}function kd(e){return ls(Ul,e)}function Ad(e){return bs(cu,e)}var jd=je({$brand:()=>Ge,$input:()=>bo,$output:()=>yo,NEVER:()=>Sd,TimePrecision:()=>Jo,ZodAny:()=>eu,ZodArray:()=>uu,ZodBase64:()=>Tl,ZodBase64URL:()=>Dl,ZodBigInt:()=>Ul,ZodBigIntFormat:()=>Gl,ZodBoolean:()=>Vl,ZodCIDRv4:()=>xl,ZodCIDRv6:()=>Cl,ZodCUID:()=>sl,ZodCUID2:()=>ll,ZodCatch:()=>Qu,ZodCustom:()=>fd,ZodDate:()=>cu,ZodDefault:()=>Wu,ZodDiscriminatedUnion:()=>vu,ZodE164:()=>kl,ZodEmail:()=>Kc,ZodEmoji:()=>rl,ZodEnum:()=>ju,ZodError:()=>Rc,ZodFile:()=>Fu,ZodGUID:()=>Jc,ZodIPv4:()=>_l,ZodIPv6:()=>yl,ZodISODate:()=>jc,ZodISODateTime:()=>kc,ZodISODuration:()=>Fc,ZodISOTime:()=>Nc,ZodIntersection:()=>bu,ZodIssueCode:()=>xd,ZodJWT:()=>jl,ZodKSUID:()=>hl,ZodLazy:()=>cd,ZodLiteral:()=>Nu,ZodMap:()=>Du,ZodNaN:()=>ed,ZodNanoID:()=>al,ZodNever:()=>iu,ZodNonOptional:()=>Ju,ZodNull:()=>Ql,ZodNullable:()=>Vu,ZodNumber:()=>Nl,ZodNumberFormat:()=>Fl,ZodObject:()=>pu,ZodOptional:()=>zu,ZodPipe:()=>nd,ZodPrefault:()=>Ku,ZodPromise:()=>ud,ZodReadonly:()=>id,ZodRealError:()=>zc,ZodRecord:()=>wu,ZodSet:()=>ku,ZodString:()=>Gc,ZodStringFormat:()=>M,ZodSuccess:()=>Xu,ZodSymbol:()=>Jl,ZodTemplateLiteral:()=>od,ZodTransform:()=>Lu,ZodTuple:()=>Su,ZodType:()=>A,ZodULID:()=>dl,ZodURL:()=>tl,ZodUUID:()=>Xc,ZodUndefined:()=>Xl,ZodUnion:()=>gu,ZodUnknown:()=>nu,ZodVoid:()=>ou,ZodXID:()=>pl,_ZodString:()=>Wc,_default:()=>Gu,any:()=>tu,array:()=>du,base64:()=>El,base64url:()=>Ol,bigint:()=>Wl,boolean:()=>Hl,catch:()=>$u,check:()=>pd,cidrv4:()=>Sl,cidrv6:()=>wl,clone:()=>bt,coerce:()=>Td,config:()=>b,core:()=>Dc,cuid:()=>cl,cuid2:()=>ul,custom:()=>md,date:()=>lu,discriminatedUnion:()=>yu,e164:()=>Al,email:()=>qc,emoji:()=>il,endsWith:()=>Vs,enum:()=>P,file:()=>Iu,flattenError:()=>Ut,float32:()=>Ll,float64:()=>Rl,formatError:()=>Wt,function:()=>Cc,getErrorMap:()=>wd,globalRegistry:()=>Co,gt:()=>ws,gte:()=>O,guid:()=>Yc,includes:()=>zs,instanceof:()=>_d,int:()=>Il,int32:()=>zl,int64:()=>Kl,intersection:()=>xu,ipv4:()=>vl,ipv6:()=>bl,iso:()=>Oc,json:()=>yd,jwt:()=>Ml,keyof:()=>fu,ksuid:()=>gl,lazy:()=>ld,length:()=>Fs,literal:()=>Pu,locales:()=>vo,looseObject:()=>hu,lowercase:()=>Ls,lt:()=>Ss,lte:()=>Cs,map:()=>Ou,maxLength:()=>Ns,maxSize:()=>As,mime:()=>Us,minLength:()=>Ps,minSize:()=>js,multipleOf:()=>ks,nan:()=>td,nanoid:()=>ol,nativeEnum:()=>Mu,negative:()=>Es,never:()=>au,nonnegative:()=>Os,nonoptional:()=>Yu,nonpositive:()=>Ds,normalize:()=>Gs,null:()=>$l,nullable:()=>Hu,nullish:()=>Uu,number:()=>Pl,object:()=>N,optional:()=>Bu,overwrite:()=>Ws,parse:()=>Bc,parseAsync:()=>Vc,partialRecord:()=>Eu,pipe:()=>rd,positive:()=>Ts,prefault:()=>qu,preprocess:()=>bd,prettifyError:()=>qt,promise:()=>dd,property:()=>Hs,readonly:()=>ad,record:()=>Tu,refine:()=>hd,regex:()=>Is,regexes:()=>nn,registry:()=>So,safeParse:()=>Hc,safeParseAsync:()=>Uc,set:()=>Au,setErrorMap:()=>Cd,size:()=>Ms,startsWith:()=>Bs,strictObject:()=>mu,string:()=>j,stringbool:()=>vd,success:()=>Zu,superRefine:()=>gd,symbol:()=>Yl,templateLiteral:()=>sd,toJSONSchema:()=>Tc,toLowerCase:()=>qs,toUpperCase:()=>Js,transform:()=>Ru,treeifyError:()=>Gt,trim:()=>Ks,tuple:()=>Cu,uint32:()=>Bl,uint64:()=>ql,ulid:()=>fl,undefined:()=>Zl,union:()=>_u,unknown:()=>ru,uppercase:()=>Rs,url:()=>nl,uuid:()=>Zc,uuidv4:()=>Qc,uuidv6:()=>$c,uuidv7:()=>el,void:()=>su,xid:()=>ml});b(oa());var F=jd;const Md=N({ci:Hl().default(!1),debug:Hl().default(!1),localBuild:Hl().default(!1),baseCommand:P([`add`,`init`,`deploy`,`upgrade`,`remove`]).optional().catch(void 0),appType:P([`browser`,`webviewer`]).optional().catch(void 0),ui:P([`shadcn`,`mantine`]).optional().catch(`mantine`),projectDir:j().default(process.cwd()),authType:P([`clerk`,`fmaddon`]).optional(),emailProvider:P([`plunk`,`resend`,`none`]).optional(),dataSource:P([`filemaker`,`none`]).optional()}).passthrough();let I=Md.parse({});function L(e){let t=Md.safeParse(e);t.success&&(I={...I,...t.data})}const Nd=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith(`yarn`)?`yarn`:e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`bun`)?`bun`:`npm`:`pnpm`},R={error(...e){console.log(r.red(...e))},warn(...e){console.log(r.yellow(...e))},info(...e){console.log(r.cyan(...e))},success(...e){console.log(r.green(...e))},dim(...e){console.log(r.dim(...e))}},Pd=async(e,t,n)=>{let{onDataHandle:r,args:i=[`install`],stdout:a=`pipe`}=n;process.env.PROOFKIT_ENV===`development`&&i.push(`--prefer-offline`);let o=m(n.loadingMessage??`Running ${t} ${i.join(` `)} ...`).start(),c=s(t,i,{cwd:e,stdout:a,stderr:`pipe`});return await new Promise((e,n)=>{let a=``,s=``;r?c.stdout?.on(`data`,r(o)):c.stdout?.on(`data`,e=>{a+=e.toString()}),c.stderr?.on(`data`,e=>{s+=e.toString()}),c.on(`error`,e=>n(e)),c.on(`close`,r=>{if(r===0)e();else{let e=[a,s].filter(e=>e.trim()).join(`
39
- `).trim().replace(/^- Checking registry\.$/gm,``).replace(/^\s*$/gm,``).trim()||`Command failed with exit code ${r}: ${t} ${i.join(` `)}`;n(Error(e))}})}),o},Fd=async(e,t)=>{switch(e){case`npm`:return await s(e,[`install`],{cwd:t,stderr:`inherit`}),null;case`pnpm`:return Pd(t,e,{onDataHandle:e=>t=>{let n=t.toString();n.includes(`Progress`)&&(e.text=n.includes(`|`)?n.split(` | `)[1]??``:n)}});case`yarn`:return Pd(t,e,{onDataHandle:e=>t=>{e.text=t.toString()}});case`bun`:return Pd(t,e,{stdout:`ignore`})}},Id=async e=>{let{projectDir:t=I.projectDir}=e??{};R.info(`Installing dependencies...`),(await Fd(Nd(),t)??m()).succeed(r.green(`Successfully installed dependencies!
40
- `))},Ld={"next-auth":`beta`,"next-auth-adapter-filemaker":`beta`,"@auth/prisma-adapter":`^1.6.0`,"@auth/drizzle-adapter":`^1.1.0`,prisma:`^5.14.0`,"@prisma/client":`^5.14.0`,"@prisma/adapter-planetscale":`^5.14.0`,"drizzle-orm":`^0.30.10`,"drizzle-kit":`^0.21.4`,"eslint-plugin-drizzle":`^0.2.3`,mysql2:`^3.9.7`,"@planetscale/database":`^1.18.0`,postgres:`^3.4.4`,"@libsql/client":`^0.6.0`,tailwindcss:`^4.1.10`,postcss:`^8.4.41`,prettier:`^3.5.3`,"prettier-plugin-tailwindcss":`^0.6.12`,"@tailwindcss/postcss":`^4.1.10`,"class-variance-authority":`^0.7.1`,clsx:`^2.1.1`,"tailwind-merge":`^3.3.1`,"tw-animate-css":`^1.3.4`,"@trpc/client":`^11.0.0-rc.446`,"@trpc/server":`^11.0.0-rc.446`,"@trpc/react-query":`^11.0.0-rc.446`,"@trpc/next":`^11.0.0-rc.446`,superjson:`^2.2.1`,"server-only":`^0.0.1`,"@clerk/nextjs":`^6.3.1`,"@clerk/themes":`^2.1.33`,"@proofkit/fmdapi":`^${Ne()}`,"@proofkit/cli":`^${Me()}`,"@tanstack/react-query":`^5.59.0`,"@tanstack/react-query-devtools":`^5.59.0`,"@tanstack/eslint-plugin-query":`^5.59.1`,"@node-rs/argon2":`^2.0.2`,"@oslojs/binary":`^1.0.0`,"@oslojs/crypto":`^1.0.1`,"@oslojs/encoding":`^1.1.0`,"js-cookie":`^3.0.5`,"@types/js-cookie":`^3.0.6`,"@react-email/components":`^0.5.0`,"@react-email/render":`1.2.0`,"@react-email/preview-server":`^4.2.8`,"@plunk/node":`^3.0.3`,"react-email":`^4.2.8`,resend:`^4.0.0`,"@sendgrid/mail":`^8.1.4`,"@types/node":`^${Pe()}`,"@radix-ui/react-slot":`^1.2.3`,"lucide-react":`^0.518.0`,"better-auth":`^1.3.4`,"@proofkit/better-auth":`${Fe()}`,"@daveyplate/better-auth-ui":`^2.1.3`,"@mantine/core":`^7.15.0`,"@mantine/dates":`^7.15.0`,"@mantine/hooks":`^7.15.0`,"@mantine/modals":`^7.15.0`,"@mantine/notifications":`^7.15.0`,"mantine-react-table":`^2.0.0`,"next-themes":`^0.4.6`,zod:`^4`},z=e=>{let{dependencies:t,devMode:n,projectDir:r=I.projectDir}=e,i=c.readJSONSync(o.join(r,`package.json`));t.forEach(e=>{let t=Ld[e];n&&i.devDependencies?i.devDependencies[e]=t:i.dependencies&&(i.dependencies[e]=t)});let a=te(i);c.writeJSONSync(o.join(r,`package.json`),a,{spaces:2})},Rd=()=>{let e=`
41
- # When adding additional environment variables, the schema in "${zd(!1)??`./src/config/env.ts`}"
32
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let r=t[1];if(e===t[0]){a(t);continue}if(n.external){let r=n.external.registry.get(t[0])?.id;if(e!==t[0]&&r){a(t);continue}}if(this.metadataRegistry.get(t[0])?.id){a(t);continue}if(r.cycle){a(t);continue}if(r.count>1&&n.reused===`ref`){a(t);continue}}let o=(e,t)=>{let n=this.seen.get(e),r=n.def??n.schema,i={...r};if(n.ref===null)return;let a=n.ref;if(n.ref=null,a){o(a,t);let e=this.seen.get(a).schema;e.$ref&&(t.target===`draft-7`||t.target===`draft-4`||t.target===`openapi-3.0`)?(r.allOf=r.allOf??[],r.allOf.push(e)):(Object.assign(r,e),Object.assign(r,i))}n.isParent||this.override({zodSchema:e,jsonSchema:r,path:n.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if(this.target===`draft-2020-12`?s.$schema=`https://json-schema.org/draft/2020-12/schema`:this.target===`draft-7`?s.$schema=`http://json-schema.org/draft-07/schema#`:this.target===`draft-4`?s.$schema=`http://json-schema.org/draft-04/schema#`:this.target===`openapi-3.0`||console.warn(`Invalid target: ${this.target}`),n.external?.uri){let t=n.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=n.external.uri(t)}Object.assign(s,r.def);let c=n.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(c[t.defId]=t.def)}n.external||Object.keys(c).length>0&&(this.target===`draft-2020-12`?s.$defs=c:s.definitions=c);try{return JSON.parse(JSON.stringify(s))}catch{throw Error(`Error converting schema to JSON.`)}}};function lu(e,t){if(e instanceof ec){let n=new cu(t),r={};for(let t of e._idmap.entries()){let[e,r]=t;n.process(r)}let i={},a={registry:e,uri:t?.uri,defs:r};for(let r of e._idmap.entries()){let[e,o]=r;i[e]=n.emit(o,{...t,external:a})}return Object.keys(r).length>0&&(i.__shared={[n.target===`draft-2020-12`?`$defs`:`definitions`]:r}),{schemas:i}}let n=new cu(t);return n.process(e),n.emit(e,t)}function k(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return k(r.element,n);if(r.type===`set`)return k(r.valueType,n);if(r.type===`lazy`)return k(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return k(r.innerType,n);if(r.type===`intersection`)return k(r.left,n)||k(r.right,n);if(r.type===`record`||r.type===`map`)return k(r.keyType,n)||k(r.valueType,n);if(r.type===`pipe`)return k(r.in,n)||k(r.out,n);if(r.type===`object`){for(let e in r.shape)if(k(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(k(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(k(e,n))return!0;return!!(r.rest&&k(r.rest,n))}return!1}var uu={},du=Fe({$ZodAny:()=>ea,$ZodArray:()=>oa,$ZodAsyncError:()=>Ze,$ZodBase64:()=>zi,$ZodBase64URL:()=>Vi,$ZodBigInt:()=>Yi,$ZodBigIntFormat:()=>Xi,$ZodBoolean:()=>Ji,$ZodCIDRv4:()=>Ii,$ZodCIDRv6:()=>Li,$ZodCUID:()=>wi,$ZodCUID2:()=>Ti,$ZodCatch:()=>Ra,$ZodCheck:()=>T,$ZodCheckBigIntFormat:()=>Zr,$ZodCheckEndsWith:()=>ui,$ZodCheckGreaterThan:()=>Jr,$ZodCheckIncludes:()=>ci,$ZodCheckLengthEquals:()=>ri,$ZodCheckLessThan:()=>qr,$ZodCheckLowerCase:()=>oi,$ZodCheckMaxLength:()=>ti,$ZodCheckMaxSize:()=>Qr,$ZodCheckMimeType:()=>pi,$ZodCheckMinLength:()=>ni,$ZodCheckMinSize:()=>$r,$ZodCheckMultipleOf:()=>Yr,$ZodCheckNumberFormat:()=>Xr,$ZodCheckOverwrite:()=>mi,$ZodCheckProperty:()=>fi,$ZodCheckRegex:()=>ai,$ZodCheckSizeEquals:()=>ei,$ZodCheckStartsWith:()=>li,$ZodCheckStringFormat:()=>ii,$ZodCheckUpperCase:()=>si,$ZodCodec:()=>Ha,$ZodCustom:()=>Za,$ZodCustomStringFormat:()=>Gi,$ZodDate:()=>ia,$ZodDefault:()=>Ma,$ZodDiscriminatedUnion:()=>ma,$ZodE164:()=>Hi,$ZodEmail:()=>bi,$ZodEmoji:()=>Si,$ZodEncodeError:()=>Qe,$ZodEnum:()=>Ta,$ZodError:()=>sn,$ZodFile:()=>Da,$ZodFunction:()=>Ja,$ZodGUID:()=>vi,$ZodIPv4:()=>Ni,$ZodIPv6:()=>Pi,$ZodISODate:()=>Ai,$ZodISODateTime:()=>ki,$ZodISODuration:()=>Mi,$ZodISOTime:()=>ji,$ZodIntersection:()=>ha,$ZodJWT:()=>Wi,$ZodKSUID:()=>Oi,$ZodLazy:()=>Xa,$ZodLiteral:()=>Ea,$ZodMAC:()=>Fi,$ZodMap:()=>xa,$ZodNaN:()=>za,$ZodNanoID:()=>Ci,$ZodNever:()=>na,$ZodNonOptional:()=>Fa,$ZodNull:()=>$i,$ZodNullable:()=>ja,$ZodNumber:()=>Ki,$ZodNumberFormat:()=>qi,$ZodObject:()=>ua,$ZodObjectJIT:()=>da,$ZodOptional:()=>Aa,$ZodPipe:()=>Ba,$ZodPrefault:()=>Pa,$ZodPromise:()=>Ya,$ZodReadonly:()=>Ga,$ZodRealError:()=>w,$ZodRecord:()=>ba,$ZodRegistry:()=>ec,$ZodSet:()=>Ca,$ZodString:()=>_i,$ZodStringFormat:()=>D,$ZodSuccess:()=>La,$ZodSymbol:()=>Zi,$ZodTemplateLiteral:()=>qa,$ZodTransform:()=>Oa,$ZodTuple:()=>va,$ZodType:()=>E,$ZodULID:()=>Ei,$ZodURL:()=>xi,$ZodUUID:()=>yi,$ZodUndefined:()=>Qi,$ZodUnion:()=>pa,$ZodUnknown:()=>ta,$ZodVoid:()=>ra,$ZodXID:()=>Di,$brand:()=>Xe,$constructor:()=>v,$input:()=>$s,$output:()=>Qs,Doc:()=>hi,JSONSchema:()=>uu,JSONSchemaGenerator:()=>cu,NEVER:()=>Ye,TimePrecision:()=>Oc,_any:()=>Yc,_array:()=>Al,_base64:()=>wc,_base64url:()=>Tc,_bigint:()=>Hc,_boolean:()=>Bc,_catch:()=>Jl,_check:()=>ru,_cidrv4:()=>Sc,_cidrv6:()=>Cc,_coercedBigint:()=>Uc,_coercedBoolean:()=>Vc,_coercedDate:()=>el,_coercedNumber:()=>Pc,_coercedString:()=>ic,_cuid:()=>mc,_cuid2:()=>hc,_custom:()=>eu,_date:()=>$c,_decode:()=>Cn,_decodeAsync:()=>Dn,_default:()=>Gl,_discriminatedUnion:()=>Ml,_e164:()=>Ec,_email:()=>ac,_emoji:()=>fc,_encode:()=>xn,_encodeAsync:()=>Tn,_endsWith:()=>xl,_enum:()=>Rl,_file:()=>Vl,_float32:()=>Ic,_float64:()=>Lc,_gt:()=>il,_gte:()=>O,_guid:()=>oc,_includes:()=>yl,_int:()=>Fc,_int32:()=>Rc,_int64:()=>Wc,_intersection:()=>Nl,_ipv4:()=>yc,_ipv6:()=>bc,_isoDate:()=>Ac,_isoDateTime:()=>kc,_isoDuration:()=>Mc,_isoTime:()=>jc,_jwt:()=>Dc,_ksuid:()=>vc,_lazy:()=>Ql,_length:()=>hl,_literal:()=>Bl,_lowercase:()=>_l,_lt:()=>nl,_lte:()=>rl,_mac:()=>xc,_map:()=>Il,_max:()=>rl,_maxLength:()=>pl,_maxSize:()=>ul,_mime:()=>Cl,_min:()=>O,_minLength:()=>ml,_minSize:()=>dl,_multipleOf:()=>ll,_nan:()=>tl,_nanoid:()=>pc,_nativeEnum:()=>zl,_negative:()=>ol,_never:()=>Zc,_nonnegative:()=>cl,_nonoptional:()=>Kl,_nonpositive:()=>sl,_normalize:()=>Tl,_null:()=>Jc,_nullable:()=>Wl,_number:()=>Nc,_optional:()=>Ul,_overwrite:()=>wl,_parse:()=>pn,_parseAsync:()=>hn,_pipe:()=>Yl,_positive:()=>al,_promise:()=>$l,_property:()=>Sl,_readonly:()=>Xl,_record:()=>Fl,_refine:()=>tu,_regex:()=>gl,_safeDecode:()=>jn,_safeDecodeAsync:()=>Fn,_safeEncode:()=>kn,_safeEncodeAsync:()=>Nn,_safeParse:()=>_n,_safeParseAsync:()=>yn,_set:()=>Ll,_size:()=>fl,_slugify:()=>kl,_startsWith:()=>bl,_string:()=>rc,_stringFormat:()=>su,_stringbool:()=>ou,_success:()=>ql,_superRefine:()=>nu,_symbol:()=>Kc,_templateLiteral:()=>Zl,_toLowerCase:()=>Dl,_toUpperCase:()=>Ol,_transform:()=>Hl,_trim:()=>El,_tuple:()=>Pl,_uint32:()=>zc,_uint64:()=>Gc,_ulid:()=>gc,_undefined:()=>qc,_union:()=>jl,_unknown:()=>Xc,_uppercase:()=>vl,_url:()=>dc,_uuid:()=>sc,_uuidv4:()=>cc,_uuidv6:()=>lc,_uuidv7:()=>uc,_void:()=>Qc,_xid:()=>_c,clone:()=>Mt,config:()=>y,decode:()=>wn,decodeAsync:()=>On,describe:()=>iu,encode:()=>Sn,encodeAsync:()=>En,flattenError:()=>cn,formatError:()=>ln,globalConfig:()=>$e,globalRegistry:()=>nc,isValidBase64:()=>Ri,isValidBase64URL:()=>Bi,isValidJWT:()=>Ui,locales:()=>Xs,meta:()=>au,parse:()=>mn,parseAsync:()=>gn,prettifyError:()=>fn,regexes:()=>Ln,registry:()=>tc,safeDecode:()=>Mn,safeDecodeAsync:()=>In,safeEncode:()=>An,safeEncodeAsync:()=>Pn,safeParse:()=>vn,safeParseAsync:()=>bn,toDotPath:()=>dn,toJSONSchema:()=>lu,treeifyError:()=>un,util:()=>et,version:()=>gi}),fu=Fe({ZodISODate:()=>hu,ZodISODateTime:()=>pu,ZodISODuration:()=>yu,ZodISOTime:()=>_u,date:()=>gu,datetime:()=>mu,duration:()=>bu,time:()=>vu});const pu=v(`ZodISODateTime`,(e,t)=>{ki.init(e,t),N.init(e,t)});function mu(e){return kc(pu,e)}const hu=v(`ZodISODate`,(e,t)=>{Ai.init(e,t),N.init(e,t)});function gu(e){return Ac(hu,e)}const _u=v(`ZodISOTime`,(e,t)=>{ji.init(e,t),N.init(e,t)});function vu(e){return jc(_u,e)}const yu=v(`ZodISODuration`,(e,t)=>{Mi.init(e,t),N.init(e,t)});function bu(e){return Mc(yu,e)}const xu=(e,t)=>{sn.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ln(e,t)},flatten:{value:t=>cn(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,st,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,st,2)}},isEmpty:{get(){return e.issues.length===0}}})},Su=v(`ZodError`,xu),A=v(`ZodError`,xu,{Parent:Error}),Cu=pn(A),wu=hn(A),Tu=_n(A),Eu=yn(A),Du=xn(A),Ou=Cn(A),ku=Tn(A),Au=Dn(A),ju=kn(A),Mu=jn(A),Nu=Nn(A),Pu=Fn(A),j=v(`ZodType`,(e,t)=>(E.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(ht(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>Mt(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>Cu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Tu(e,t,n),e.parseAsync=async(t,n)=>wu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Eu(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Du(e,t,n),e.decode=(t,n)=>Ou(e,t,n),e.encodeAsync=async(t,n)=>ku(e,t,n),e.decodeAsync=async(t,n)=>Au(e,t,n),e.safeEncode=(t,n)=>ju(e,t,n),e.safeDecode=(t,n)=>Mu(e,t,n),e.safeEncodeAsync=async(t,n)=>Nu(e,t,n),e.safeDecodeAsync=async(t,n)=>Pu(e,t,n),e.refine=(t,n)=>e.check(yp(t,n)),e.superRefine=t=>e.check(bp(t)),e.overwrite=t=>e.check(wl(t)),e.optional=()=>Bf(e),e.nullable=()=>Hf(e),e.nullish=()=>Bf(Hf(e)),e.nonoptional=t=>Yf(e,t),e.array=()=>df(e),e.or=t=>_f([e,t]),e.and=t=>xf(e,t),e.transform=t=>rp(e,Rf(t)),e.default=t=>Gf(e,t),e.prefault=t=>qf(e,t),e.catch=t=>$f(e,t),e.pipe=t=>rp(e,t),e.readonly=()=>sp(e),e.describe=t=>{let n=e.clone();return nc.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return nc.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return nc.get(e);let n=e.clone();return nc.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Fu=v(`_ZodString`,(e,t)=>{_i.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=(...t)=>e.check(gl(...t)),e.includes=(...t)=>e.check(yl(...t)),e.startsWith=(...t)=>e.check(bl(...t)),e.endsWith=(...t)=>e.check(xl(...t)),e.min=(...t)=>e.check(ml(...t)),e.max=(...t)=>e.check(pl(...t)),e.length=(...t)=>e.check(hl(...t)),e.nonempty=(...t)=>e.check(ml(1,...t)),e.lowercase=t=>e.check(_l(t)),e.uppercase=t=>e.check(vl(t)),e.trim=()=>e.check(El()),e.normalize=(...t)=>e.check(Tl(...t)),e.toLowerCase=()=>e.check(Dl()),e.toUpperCase=()=>e.check(Ol()),e.slugify=()=>e.check(kl())}),Iu=v(`ZodString`,(e,t)=>{_i.init(e,t),Fu.init(e,t),e.email=t=>e.check(ac(Lu,t)),e.url=t=>e.check(dc(Ku,t)),e.jwt=t=>e.check(Dc(Td,t)),e.emoji=t=>e.check(fc(Yu,t)),e.guid=t=>e.check(oc(zu,t)),e.uuid=t=>e.check(sc(Vu,t)),e.uuidv4=t=>e.check(cc(Vu,t)),e.uuidv6=t=>e.check(lc(Vu,t)),e.uuidv7=t=>e.check(uc(Vu,t)),e.nanoid=t=>e.check(pc(Zu,t)),e.guid=t=>e.check(oc(zu,t)),e.cuid=t=>e.check(mc($u,t)),e.cuid2=t=>e.check(hc(td,t)),e.ulid=t=>e.check(gc(rd,t)),e.base64=t=>e.check(wc(yd,t)),e.base64url=t=>e.check(Tc(xd,t)),e.xid=t=>e.check(_c(ad,t)),e.ksuid=t=>e.check(vc(sd,t)),e.ipv4=t=>e.check(yc(ld,t)),e.ipv6=t=>e.check(bc(pd,t)),e.cidrv4=t=>e.check(Sc(hd,t)),e.cidrv6=t=>e.check(Cc(_d,t)),e.e164=t=>e.check(Ec(Cd,t)),e.datetime=t=>e.check(mu(t)),e.date=t=>e.check(gu(t)),e.time=t=>e.check(vu(t)),e.duration=t=>e.check(bu(t))});function M(e){return rc(Iu,e)}const N=v(`ZodStringFormat`,(e,t)=>{D.init(e,t),Fu.init(e,t)}),Lu=v(`ZodEmail`,(e,t)=>{bi.init(e,t),N.init(e,t)});function Ru(e){return ac(Lu,e)}const zu=v(`ZodGUID`,(e,t)=>{vi.init(e,t),N.init(e,t)});function Bu(e){return oc(zu,e)}const Vu=v(`ZodUUID`,(e,t)=>{yi.init(e,t),N.init(e,t)});function Hu(e){return sc(Vu,e)}function Uu(e){return cc(Vu,e)}function Wu(e){return lc(Vu,e)}function Gu(e){return uc(Vu,e)}const Ku=v(`ZodURL`,(e,t)=>{xi.init(e,t),N.init(e,t)});function qu(e){return dc(Ku,e)}function Ju(e){return dc(Ku,{protocol:/^https?$/,hostname:fr,...S(e)})}const Yu=v(`ZodEmoji`,(e,t)=>{Si.init(e,t),N.init(e,t)});function Xu(e){return fc(Yu,e)}const Zu=v(`ZodNanoID`,(e,t)=>{Ci.init(e,t),N.init(e,t)});function Qu(e){return pc(Zu,e)}const $u=v(`ZodCUID`,(e,t)=>{wi.init(e,t),N.init(e,t)});function ed(e){return mc($u,e)}const td=v(`ZodCUID2`,(e,t)=>{Ti.init(e,t),N.init(e,t)});function nd(e){return hc(td,e)}const rd=v(`ZodULID`,(e,t)=>{Ei.init(e,t),N.init(e,t)});function id(e){return gc(rd,e)}const ad=v(`ZodXID`,(e,t)=>{Di.init(e,t),N.init(e,t)});function od(e){return _c(ad,e)}const sd=v(`ZodKSUID`,(e,t)=>{Oi.init(e,t),N.init(e,t)});function cd(e){return vc(sd,e)}const ld=v(`ZodIPv4`,(e,t)=>{Ni.init(e,t),N.init(e,t)});function ud(e){return yc(ld,e)}const dd=v(`ZodMAC`,(e,t)=>{Fi.init(e,t),N.init(e,t)});function fd(e){return xc(dd,e)}const pd=v(`ZodIPv6`,(e,t)=>{Pi.init(e,t),N.init(e,t)});function md(e){return bc(pd,e)}const hd=v(`ZodCIDRv4`,(e,t)=>{Ii.init(e,t),N.init(e,t)});function gd(e){return Sc(hd,e)}const _d=v(`ZodCIDRv6`,(e,t)=>{Li.init(e,t),N.init(e,t)});function vd(e){return Cc(_d,e)}const yd=v(`ZodBase64`,(e,t)=>{zi.init(e,t),N.init(e,t)});function bd(e){return wc(yd,e)}const xd=v(`ZodBase64URL`,(e,t)=>{Vi.init(e,t),N.init(e,t)});function Sd(e){return Tc(xd,e)}const Cd=v(`ZodE164`,(e,t)=>{Hi.init(e,t),N.init(e,t)});function wd(e){return Ec(Cd,e)}const Td=v(`ZodJWT`,(e,t)=>{Wi.init(e,t),N.init(e,t)});function Ed(e){return Dc(Td,e)}const Dd=v(`ZodCustomStringFormat`,(e,t)=>{Gi.init(e,t),N.init(e,t)});function Od(e,t,n={}){return su(Dd,e,t,n)}function kd(e){return su(Dd,`hostname`,dr,e)}function Ad(e){return su(Dd,`hex`,Or,e)}function jd(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Ln[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return su(Dd,n,r,t)}const Md=v(`ZodNumber`,(e,t)=>{Ki.init(e,t),j.init(e,t),e.gt=(t,n)=>e.check(il(t,n)),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.lt=(t,n)=>e.check(nl(t,n)),e.lte=(t,n)=>e.check(rl(t,n)),e.max=(t,n)=>e.check(rl(t,n)),e.int=t=>e.check(Fd(t)),e.safe=t=>e.check(Fd(t)),e.positive=t=>e.check(il(0,t)),e.nonnegative=t=>e.check(O(0,t)),e.negative=t=>e.check(nl(0,t)),e.nonpositive=t=>e.check(rl(0,t)),e.multipleOf=(t,n)=>e.check(ll(t,n)),e.step=(t,n)=>e.check(ll(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Nd(e){return Nc(Md,e)}const Pd=v(`ZodNumberFormat`,(e,t)=>{qi.init(e,t),Md.init(e,t)});function Fd(e){return Fc(Pd,e)}function Id(e){return Ic(Pd,e)}function Ld(e){return Lc(Pd,e)}function Rd(e){return Rc(Pd,e)}function zd(e){return zc(Pd,e)}const Bd=v(`ZodBoolean`,(e,t)=>{Ji.init(e,t),j.init(e,t)});function Vd(e){return Bc(Bd,e)}const Hd=v(`ZodBigInt`,(e,t)=>{Yi.init(e,t),j.init(e,t),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.gt=(t,n)=>e.check(il(t,n)),e.gte=(t,n)=>e.check(O(t,n)),e.min=(t,n)=>e.check(O(t,n)),e.lt=(t,n)=>e.check(nl(t,n)),e.lte=(t,n)=>e.check(rl(t,n)),e.max=(t,n)=>e.check(rl(t,n)),e.positive=t=>e.check(il(BigInt(0),t)),e.negative=t=>e.check(nl(BigInt(0),t)),e.nonpositive=t=>e.check(rl(BigInt(0),t)),e.nonnegative=t=>e.check(O(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(ll(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Ud(e){return Hc(Hd,e)}const Wd=v(`ZodBigIntFormat`,(e,t)=>{Xi.init(e,t),Hd.init(e,t)});function Gd(e){return Wc(Wd,e)}function Kd(e){return Gc(Wd,e)}const qd=v(`ZodSymbol`,(e,t)=>{Zi.init(e,t),j.init(e,t)});function Jd(e){return Kc(qd,e)}const Yd=v(`ZodUndefined`,(e,t)=>{Qi.init(e,t),j.init(e,t)});function Xd(e){return qc(Yd,e)}const Zd=v(`ZodNull`,(e,t)=>{$i.init(e,t),j.init(e,t)});function Qd(e){return Jc(Zd,e)}const $d=v(`ZodAny`,(e,t)=>{ea.init(e,t),j.init(e,t)});function ef(){return Yc($d)}const tf=v(`ZodUnknown`,(e,t)=>{ta.init(e,t),j.init(e,t)});function nf(){return Xc(tf)}const rf=v(`ZodNever`,(e,t)=>{na.init(e,t),j.init(e,t)});function af(e){return Zc(rf,e)}const of=v(`ZodVoid`,(e,t)=>{ra.init(e,t),j.init(e,t)});function sf(e){return Qc(of,e)}const cf=v(`ZodDate`,(e,t)=>{ia.init(e,t),j.init(e,t),e.min=(t,n)=>e.check(O(t,n)),e.max=(t,n)=>e.check(rl(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function lf(e){return $c(cf,e)}const uf=v(`ZodArray`,(e,t)=>{oa.init(e,t),j.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(ml(t,n)),e.nonempty=t=>e.check(ml(1,t)),e.max=(t,n)=>e.check(pl(t,n)),e.length=(t,n)=>e.check(hl(t,n)),e.unwrap=()=>e.element});function df(e,t){return Al(uf,e,t)}function ff(e){let t=e._zod.def.shape;return F(Object.keys(t))}const pf=v(`ZodObject`,(e,t)=>{da.init(e,t),j.init(e,t),x(e,`shape`,()=>t.shape),e.keyof=()=>F(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:nf()}),e.loose=()=>e.clone({...e._zod.def,catchall:nf()}),e.strict=()=>e.clone({...e._zod.def,catchall:af()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>zt(e,t),e.safeExtend=t=>Bt(e,t),e.merge=t=>Vt(e,t),e.pick=t=>Lt(e,t),e.omit=t=>Rt(e,t),e.partial=(...t)=>Ht(zf,e,t[0]),e.required=(...t)=>Ut(Jf,e,t[0])});function P(e,t){return new pf({type:`object`,shape:e??{},...S(t)})}function mf(e,t){return new pf({type:`object`,shape:e,catchall:af(),...S(t)})}function hf(e,t){return new pf({type:`object`,shape:e,catchall:nf(),...S(t)})}const gf=v(`ZodUnion`,(e,t)=>{pa.init(e,t),j.init(e,t),e.options=t.options});function _f(e,t){return new gf({type:`union`,options:e,...S(t)})}const vf=v(`ZodDiscriminatedUnion`,(e,t)=>{gf.init(e,t),ma.init(e,t)});function yf(e,t,n){return new vf({type:`union`,options:t,discriminator:e,...S(n)})}const bf=v(`ZodIntersection`,(e,t)=>{ha.init(e,t),j.init(e,t)});function xf(e,t){return new bf({type:`intersection`,left:e,right:t})}const Sf=v(`ZodTuple`,(e,t)=>{va.init(e,t),j.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Cf(e,t,n){let r=t instanceof E;return new Sf({type:`tuple`,items:e,rest:r?t:null,...S(r?n:t)})}const wf=v(`ZodRecord`,(e,t)=>{ba.init(e,t),j.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Tf(e,t,n){return new wf({type:`record`,keyType:e,valueType:t,...S(n)})}function Ef(e,t,n){let r=Mt(e);return r._zod.values=void 0,new wf({type:`record`,keyType:r,valueType:t,...S(n)})}const Df=v(`ZodMap`,(e,t)=>{xa.init(e,t),j.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Of(e,t,n){return new Df({type:`map`,keyType:e,valueType:t,...S(n)})}const kf=v(`ZodSet`,(e,t)=>{Ca.init(e,t),j.init(e,t),e.min=(...t)=>e.check(dl(...t)),e.nonempty=t=>e.check(dl(1,t)),e.max=(...t)=>e.check(ul(...t)),e.size=(...t)=>e.check(fl(...t))});function Af(e,t){return new kf({type:`set`,valueType:e,...S(t)})}const jf=v(`ZodEnum`,(e,t)=>{Ta.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=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new jf({...t,checks:[],...S(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new jf({...t,checks:[],...S(r),entries:i})}});function F(e,t){return new jf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...S(t)})}function Mf(e,t){return new jf({type:`enum`,entries:e,...S(t)})}const Nf=v(`ZodLiteral`,(e,t)=>{Ea.init(e,t),j.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Pf(e,t){return new Nf({type:`literal`,values:Array.isArray(e)?e:[e],...S(t)})}const Ff=v(`ZodFile`,(e,t)=>{Da.init(e,t),j.init(e,t),e.min=(t,n)=>e.check(dl(t,n)),e.max=(t,n)=>e.check(ul(t,n)),e.mime=(t,n)=>e.check(Cl(Array.isArray(t)?t:[t],n))});function If(e){return Vl(Ff,e)}const Lf=v(`ZodTransform`,(e,t)=>{Oa.init(e,t),j.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Qe(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Xt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Xt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Rf(e){return new Lf({type:`transform`,transform:e})}const zf=v(`ZodOptional`,(e,t)=>{Aa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bf(e){return new zf({type:`optional`,innerType:e})}const Vf=v(`ZodNullable`,(e,t)=>{ja.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Hf(e){return new Vf({type:`nullable`,innerType:e})}function Uf(e){return Bf(Hf(e))}const Wf=v(`ZodDefault`,(e,t)=>{Ma.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Gf(e,t){return new Wf({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Et(t)}})}const Kf=v(`ZodPrefault`,(e,t)=>{Pa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function qf(e,t){return new Kf({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Et(t)}})}const Jf=v(`ZodNonOptional`,(e,t)=>{Fa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Yf(e,t){return new Jf({type:`nonoptional`,innerType:e,...S(t)})}const Xf=v(`ZodSuccess`,(e,t)=>{La.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zf(e){return new Xf({type:`success`,innerType:e})}const Qf=v(`ZodCatch`,(e,t)=>{Ra.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $f(e,t){return new Qf({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const ep=v(`ZodNaN`,(e,t)=>{za.init(e,t),j.init(e,t)});function tp(e){return tl(ep,e)}const np=v(`ZodPipe`,(e,t)=>{Ba.init(e,t),j.init(e,t),e.in=t.in,e.out=t.out});function rp(e,t){return new np({type:`pipe`,in:e,out:t})}const ip=v(`ZodCodec`,(e,t)=>{np.init(e,t),Ha.init(e,t)});function ap(e,t,n){return new ip({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}const op=v(`ZodReadonly`,(e,t)=>{Ga.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function sp(e){return new op({type:`readonly`,innerType:e})}const cp=v(`ZodTemplateLiteral`,(e,t)=>{qa.init(e,t),j.init(e,t)});function lp(e,t){return new cp({type:`template_literal`,parts:e,...S(t)})}const up=v(`ZodLazy`,(e,t)=>{Xa.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.getter()});function dp(e){return new up({type:`lazy`,getter:e})}const fp=v(`ZodPromise`,(e,t)=>{Ya.init(e,t),j.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pp(e){return new fp({type:`promise`,innerType:e})}const mp=v(`ZodFunction`,(e,t)=>{Ja.init(e,t),j.init(e,t)});function hp(e){return new mp({type:`function`,input:Array.isArray(e?.input)?Cf(e?.input):e?.input??df(nf()),output:e?.output??nf()})}const gp=v(`ZodCustom`,(e,t)=>{Za.init(e,t),j.init(e,t)});function _p(e){let t=new T({check:`custom`});return t._zod.check=e,t}function vp(e,t){return eu(gp,e??(()=>!0),t)}function yp(e,t={}){return tu(gp,e,t)}function bp(e){return nu(e)}const xp=iu,Sp=au;function Cp(e,t={error:`Input not instance of ${e.name}`}){let n=new gp({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...S(t)});return n._zod.bag.Class=e,n}const wp=(...e)=>ou({Codec:ip,Boolean:Bd,String:Iu},...e);function Tp(e){let t=dp(()=>_f([M(e),Nd(),Vd(),Qd(),df(t),Tf(M(),t)]));return t}function Ep(e,t){return rp(Rf(e),t)}const Dp={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 Op(e){y({customError:e})}function kp(){return y().customError}var Ap;(function(e){})(Ap||={});var jp=Fe({bigint:()=>Fp,boolean:()=>Pp,date:()=>Ip,number:()=>Np,string:()=>Mp});function Mp(e){return ic(Iu,e)}function Np(e){return Pc(Md,e)}function Pp(e){return Vc(Bd,e)}function Fp(e){return Uc(Hd,e)}function Ip(e){return el(cf,e)}var Lp=Fe({$brand:()=>Xe,$input:()=>$s,$output:()=>Qs,NEVER:()=>Ye,TimePrecision:()=>Oc,ZodAny:()=>$d,ZodArray:()=>uf,ZodBase64:()=>yd,ZodBase64URL:()=>xd,ZodBigInt:()=>Hd,ZodBigIntFormat:()=>Wd,ZodBoolean:()=>Bd,ZodCIDRv4:()=>hd,ZodCIDRv6:()=>_d,ZodCUID:()=>$u,ZodCUID2:()=>td,ZodCatch:()=>Qf,ZodCodec:()=>ip,ZodCustom:()=>gp,ZodCustomStringFormat:()=>Dd,ZodDate:()=>cf,ZodDefault:()=>Wf,ZodDiscriminatedUnion:()=>vf,ZodE164:()=>Cd,ZodEmail:()=>Lu,ZodEmoji:()=>Yu,ZodEnum:()=>jf,ZodError:()=>Su,ZodFile:()=>Ff,ZodFirstPartyTypeKind:()=>Ap,ZodFunction:()=>mp,ZodGUID:()=>zu,ZodIPv4:()=>ld,ZodIPv6:()=>pd,ZodISODate:()=>hu,ZodISODateTime:()=>pu,ZodISODuration:()=>yu,ZodISOTime:()=>_u,ZodIntersection:()=>bf,ZodIssueCode:()=>Dp,ZodJWT:()=>Td,ZodKSUID:()=>sd,ZodLazy:()=>up,ZodLiteral:()=>Nf,ZodMAC:()=>dd,ZodMap:()=>Df,ZodNaN:()=>ep,ZodNanoID:()=>Zu,ZodNever:()=>rf,ZodNonOptional:()=>Jf,ZodNull:()=>Zd,ZodNullable:()=>Vf,ZodNumber:()=>Md,ZodNumberFormat:()=>Pd,ZodObject:()=>pf,ZodOptional:()=>zf,ZodPipe:()=>np,ZodPrefault:()=>Kf,ZodPromise:()=>fp,ZodReadonly:()=>op,ZodRealError:()=>A,ZodRecord:()=>wf,ZodSet:()=>kf,ZodString:()=>Iu,ZodStringFormat:()=>N,ZodSuccess:()=>Xf,ZodSymbol:()=>qd,ZodTemplateLiteral:()=>cp,ZodTransform:()=>Lf,ZodTuple:()=>Sf,ZodType:()=>j,ZodULID:()=>rd,ZodURL:()=>Ku,ZodUUID:()=>Vu,ZodUndefined:()=>Yd,ZodUnion:()=>gf,ZodUnknown:()=>tf,ZodVoid:()=>of,ZodXID:()=>ad,_ZodString:()=>Fu,_default:()=>Gf,_function:()=>hp,any:()=>ef,array:()=>df,base64:()=>bd,base64url:()=>Sd,bigint:()=>Ud,boolean:()=>Vd,catch:()=>$f,check:()=>_p,cidrv4:()=>gd,cidrv6:()=>vd,clone:()=>Mt,codec:()=>ap,coerce:()=>jp,config:()=>y,core:()=>du,cuid:()=>ed,cuid2:()=>nd,custom:()=>vp,date:()=>lf,decode:()=>Ou,decodeAsync:()=>Au,describe:()=>xp,discriminatedUnion:()=>yf,e164:()=>wd,email:()=>Ru,emoji:()=>Xu,encode:()=>Du,encodeAsync:()=>ku,endsWith:()=>xl,enum:()=>F,file:()=>If,flattenError:()=>cn,float32:()=>Id,float64:()=>Ld,formatError:()=>ln,function:()=>hp,getErrorMap:()=>kp,globalRegistry:()=>nc,gt:()=>il,gte:()=>O,guid:()=>Bu,hash:()=>jd,hex:()=>Ad,hostname:()=>kd,httpUrl:()=>Ju,includes:()=>yl,instanceof:()=>Cp,int:()=>Fd,int32:()=>Rd,int64:()=>Gd,intersection:()=>xf,ipv4:()=>ud,ipv6:()=>md,iso:()=>fu,json:()=>Tp,jwt:()=>Ed,keyof:()=>ff,ksuid:()=>cd,lazy:()=>dp,length:()=>hl,literal:()=>Pf,locales:()=>Xs,looseObject:()=>hf,lowercase:()=>_l,lt:()=>nl,lte:()=>rl,mac:()=>fd,map:()=>Of,maxLength:()=>pl,maxSize:()=>ul,meta:()=>Sp,mime:()=>Cl,minLength:()=>ml,minSize:()=>dl,multipleOf:()=>ll,nan:()=>tp,nanoid:()=>Qu,nativeEnum:()=>Mf,negative:()=>ol,never:()=>af,nonnegative:()=>cl,nonoptional:()=>Yf,nonpositive:()=>sl,normalize:()=>Tl,null:()=>Qd,nullable:()=>Hf,nullish:()=>Uf,number:()=>Nd,object:()=>P,optional:()=>Bf,overwrite:()=>wl,parse:()=>Cu,parseAsync:()=>wu,partialRecord:()=>Ef,pipe:()=>rp,positive:()=>al,prefault:()=>qf,preprocess:()=>Ep,prettifyError:()=>fn,promise:()=>pp,property:()=>Sl,readonly:()=>sp,record:()=>Tf,refine:()=>yp,regex:()=>gl,regexes:()=>Ln,registry:()=>tc,safeDecode:()=>Mu,safeDecodeAsync:()=>Pu,safeEncode:()=>ju,safeEncodeAsync:()=>Nu,safeParse:()=>Tu,safeParseAsync:()=>Eu,set:()=>Af,setErrorMap:()=>Op,size:()=>fl,slugify:()=>kl,startsWith:()=>bl,strictObject:()=>mf,string:()=>M,stringFormat:()=>Od,stringbool:()=>wp,success:()=>Zf,superRefine:()=>bp,symbol:()=>Jd,templateLiteral:()=>lp,toJSONSchema:()=>lu,toLowerCase:()=>Dl,toUpperCase:()=>Ol,transform:()=>Rf,treeifyError:()=>un,trim:()=>El,tuple:()=>Cf,uint32:()=>zd,uint64:()=>Kd,ulid:()=>id,undefined:()=>Xd,union:()=>_f,unknown:()=>nf,uppercase:()=>vl,url:()=>qu,util:()=>et,uuid:()=>Hu,uuidv4:()=>Uu,uuidv6:()=>Wu,uuidv7:()=>Gu,void:()=>sf,xid:()=>od});y(bo());var I=Lp;const Rp=P({ci:Vd().default(!1),debug:Vd().default(!1),localBuild:Vd().default(!1),baseCommand:F([`add`,`init`,`deploy`,`upgrade`,`remove`]).optional().catch(void 0),appType:F([`browser`,`webviewer`]).optional().catch(void 0),ui:F([`shadcn`,`mantine`]).optional().catch(`mantine`),projectDir:M().default(process.cwd()),authType:F([`clerk`,`fmaddon`]).optional(),emailProvider:F([`plunk`,`resend`,`none`]).optional(),dataSource:F([`filemaker`,`none`]).optional()}).passthrough();let L=Rp.parse({});function R(e){let t=Rp.safeParse(e);t.success&&(L={...L,...t.data})}const zp=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith(`yarn`)?`yarn`:e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`bun`)?`bun`:`npm`:`pnpm`},z={error(...e){console.log(c.red(...e))},warn(...e){console.log(c.yellow(...e))},info(...e){console.log(c.cyan(...e))},success(...e){console.log(c.green(...e))},dim(...e){console.log(c.dim(...e))}},Bp=async(e,t,n)=>{let{onDataHandle:r,args:i=[`install`],stdout:a=`pipe`}=n;process.env.PROOFKIT_ENV===`development`&&i.push(`--prefer-offline`);let o=re(n.loadingMessage??`Running ${t} ${i.join(` `)} ...`).start(),s=f(t,i,{cwd:e,stdout:a,stderr:`pipe`});return await new Promise((e,n)=>{let a=``,c=``;r?s.stdout?.on(`data`,r(o)):s.stdout?.on(`data`,e=>{a+=e.toString()}),s.stderr?.on(`data`,e=>{c+=e.toString()}),s.on(`error`,e=>n(e)),s.on(`close`,r=>{if(r===0)e();else{let e=[a,c].filter(e=>e.trim()).join(`
33
+ `).trim().replace(/^- Checking registry\.$/gm,``).replace(/^\s*$/gm,``).trim()||`Command failed with exit code ${r}: ${t} ${i.join(` `)}`;n(Error(e))}})}),o},Vp=async(e,t)=>{switch(e){case`npm`:return await f(e,[`install`],{cwd:t,stderr:`inherit`}),null;case`pnpm`:return Bp(t,e,{onDataHandle:e=>t=>{let n=t.toString();n.includes(`Progress`)&&(e.text=n.includes(`|`)?n.split(` | `)[1]??``:n)}});case`yarn`:return Bp(t,e,{onDataHandle:e=>t=>{e.text=t.toString()}});case`bun`:return Bp(t,e,{stdout:`ignore`});default:throw Error(`Unknown package manager: ${e}`)}},Hp=async e=>{let{projectDir:t=L.projectDir}=e??{};z.info(`Installing dependencies...`),(await Vp(zp(),t)??re()).succeed(c.green(`Successfully installed dependencies!
34
+ `))},Up={"next-auth":`beta`,"next-auth-adapter-filemaker":`beta`,"@auth/prisma-adapter":`^1.6.0`,"@auth/drizzle-adapter":`^1.1.0`,prisma:`^5.14.0`,"@prisma/client":`^5.14.0`,"@prisma/adapter-planetscale":`^5.14.0`,"drizzle-orm":`^0.30.10`,"drizzle-kit":`^0.21.4`,mysql2:`^3.9.7`,"@planetscale/database":`^1.18.0`,postgres:`^3.4.4`,"@libsql/client":`^0.6.0`,tailwindcss:`^4.1.10`,postcss:`^8.4.41`,"@tailwindcss/postcss":`^4.1.10`,"class-variance-authority":`^0.7.1`,clsx:`^2.1.1`,"tailwind-merge":`^3.3.1`,"tw-animate-css":`^1.3.4`,"@trpc/client":`^11.0.0-rc.446`,"@trpc/server":`^11.0.0-rc.446`,"@trpc/react-query":`^11.0.0-rc.446`,"@trpc/next":`^11.0.0-rc.446`,superjson:`^2.2.1`,"server-only":`^0.0.1`,"@clerk/nextjs":`^6.3.1`,"@clerk/themes":`^2.1.33`,"@proofkit/fmdapi":`^${Le()}`,"@proofkit/cli":`^${Ie()}`,"@tanstack/react-query":`^5.59.0`,"@tanstack/react-query-devtools":`^5.59.0`,"@node-rs/argon2":`^2.0.2`,"@oslojs/binary":`^1.0.0`,"@oslojs/crypto":`^1.0.1`,"@oslojs/encoding":`^1.1.0`,"js-cookie":`^3.0.5`,"@types/js-cookie":`^3.0.6`,"@react-email/components":`^0.5.0`,"@react-email/render":`1.2.0`,"@react-email/preview-server":`^4.2.8`,"@plunk/node":`^3.0.3`,"react-email":`^4.2.8`,resend:`^4.0.0`,"@sendgrid/mail":`^8.1.4`,"@types/node":`^${Re()}`,"@radix-ui/react-slot":`^1.2.3`,"lucide-react":`^0.518.0`,"better-auth":`^1.3.4`,"@proofkit/better-auth":`${ze()}`,"@daveyplate/better-auth-ui":`^2.1.3`,"@mantine/core":`^7.15.0`,"@mantine/dates":`^7.15.0`,"@mantine/hooks":`^7.15.0`,"@mantine/modals":`^7.15.0`,"@mantine/notifications":`^7.15.0`,"mantine-react-table":`^2.0.0`,"next-themes":`^0.4.6`,zod:`^4`},B=e=>{let{dependencies:t,devMode:n,projectDir:r=L.projectDir}=e,i=p.readJSONSync(d.join(r,`package.json`));for(let e of t){let t=Up[e];n&&i.devDependencies?i.devDependencies[e]=t:i.dependencies&&(i.dependencies[e]=t)}let a=se(i);p.writeJSONSync(d.join(r,`package.json`),a,{spaces:2})},Wp=()=>{let e=`
35
+ # When adding additional environment variables, the schema in "${Gp(!1)??`./src/config/env.ts`}"
42
36
  # should be updated accordingly.
43
37
 
44
38
  `.trim().concat(`
45
- `),t=o.join(I.projectDir,`.env`);c.writeFileSync(t,e,`utf-8`)};function zd(e){for(let e of[`src/config/env.ts`,`src/lib/env.ts`,`src/env.ts`,`lib/env.ts`,`env.ts`,`config/env.ts`]){let t=o.join(I.projectDir,e);if(c.existsSync(t))return t}if(e===!1)return null;throw R.warn(`Could not find T3 env files. Run "proofkit add utils/t3-env" to initialize them.`),Error(`T3 env file not found`)}async function Bd(e){e.saveSync();try{let t=e.getSourceFiles();for await(let e of t){let t=e.getFilePath();if((await ie(t)).ignored)continue;let n=await re(e.getFullText(),{filepath:t});e.replaceWithText(n)}}catch(e){I.debug&&(console.log(`Error formatting files`),console.error(e))}finally{await e.save()}}function Vd(e){let t=e?.getExpressionIfKind(_.ParenthesizedExpression)?.getExpression()??e?.getExpression();return t?.isKind(_.JsxFragment)||e?.replaceWithText(`return <>${t}</>;`),e}function Hd(e){return new g({tsConfigFilePath:o.join(e??process.cwd(),`tsconfig.json`)})}async function Ud({projectDir:e=I.projectDir,envs:t,envFileDescription:n,...r}){let i=zd(),a=r.project??Hd(e),s=a.addSourceFileAtPath(i);if(!s)throw Error(`Schema file not found`);let l=s.getDescendantsOfKind(_.CallExpression).find(e=>e.getExpression().getText()===`createEnv`);if(!l)throw Error(`Could not find createEnv call in schema file. Make sure you have a valid env.ts file with createEnv setup.`);let u=l.getArguments()[0];if(!u)throw Error(`createEnv call is missing options argument`);let d=u.getDescendantsOfKind(_.PropertyAssignment).find(e=>e.getName()===`server`)?.getFirstDescendantByKind(_.ObjectLiteralExpression),f=u.getDescendantsOfKind(_.PropertyAssignment).find(e=>e.getName()===`client`)?.getFirstDescendantByKind(_.ObjectLiteralExpression),p=u.getDescendantsOfKind(_.PropertyAssignment).find(e=>e.getName()===`experimental__runtimeEnv`)?.getFirstDescendantByKind(_.ObjectLiteralExpression),m=t.filter(e=>e.type===`server`),h=t.filter(e=>e.type===`client`);for(let e of m)d?.addPropertyAssignment({name:e.name,initializer:e.zodValue});for(let e of h)f?.addPropertyAssignment({name:e.name,initializer:e.zodValue}),p?.addPropertyAssignment({name:e.name,initializer:`process.env.${e.name}`});let g=t.filter(e=>e.addToRuntimeEnv??!0).map(e=>`${e.name}=${e.defaultValue??``}`).join(`
46
- `),ee=o.join(e,`.env`);if(c.existsSync(ee)){let t=c.readFileSync(ee,`utf-8`),r=o.join(e,`.gitignore`);try{let t=``;c.existsSync(r)&&(t=c.readFileSync(r,`utf-8`)),t.includes(`.env`)||ne(`echo ".env" >> "${r}"`,{cwd:e})}catch{}let i=`${t}
47
- ${n?`# ${n}\n${g}`:g}
48
- `;c.writeFileSync(ee,i)}return r.project||await Bd(a),s}function Wd(e,t){e.addImportDeclaration({defaultImport:`UserMenu`,moduleSpecifier:t});let n=e.getImportDeclaration(e=>e.getModuleSpecifierValue()===`@mantine/core`);n?n.getNamedImports().find(e=>e.getName()===`Group`)||n.addNamedImport({name:`Group`}):e.addImportDeclaration({namedImports:[{name:`Group`}],moduleSpecifier:`@mantine/core`});let r=Vd(e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(_.ReturnStatement)),i=r?.getFirstDescendantByKind(_.JsxOpeningFragment)?.getParentIfKind(_.JsxFragment)?.getFirstDescendantByKind(_.SyntaxList)?.getText();if(!i){console.log(`Failed to inject into header slot at ${e.getFilePath()}`);return}r?.replaceWithText(`return (<><Group>${i}<UserMenu /></Group></>)`),r?.formatText(),e.saveSync()}const Gd=async({projectDir:e})=>{z({projectDir:e,dependencies:[`@clerk/nextjs`,`@clerk/themes`],devMode:!1});let t=o.join(v,`template/extras`),n=o.join(e,`src/middleware.ts`);if(c.existsSync(n))console.log(r.yellow(`Middleware already exists. To require auth for your app, be sure to follow the guide to setup Clerk middleware. https://clerk.com/docs/references/nextjs/clerk-middleware#clerk-middleware-next-js`));else{let e=o.join(t,`src/middleware/clerk.ts`);c.copySync(e,n)}c.copySync(o.join(t,`src/app/clerk-auth`),o.join(e,`src/app/auth`)),c.copySync(o.join(t,`src/components/clerk-auth`),o.join(e,`src/components/clerk-auth`));let i=o.join(e,`src/app/layout.tsx`),a=Hd(e);Kd(a.addSourceFileAtPath(i)),Wd(a.addSourceFileAtPath(o.join(e,`src/components/AppShell/slot-header-right.tsx`)),`@/components/clerk-auth/user-menu`),Wd(a.addSourceFileAtPath(o.join(e,`src/components/AppShell/slot-header-mobile-content.tsx`)),`@/components/clerk-auth/user-menu-mobile`),qd(a.addSourceFileAtPathIfExists(o.join(e,`src/server/safe-action.ts`))),await Ud({projectDir:e,project:a,envs:[{name:`NEXT_PUBLIC_CLERK_SIGN_IN_URL`,zodValue:`z.string()`,defaultValue:`/auth/signin`,type:`client`},{name:`NEXT_PUBLIC_CLERK_SIGN_UP_URL`,zodValue:`z.string()`,defaultValue:`/auth/signup`,type:`client`},{name:`CLERK_SECRET_KEY`,zodValue:`z.string().startsWith('sk_').min(1, {
39
+ `),t=d.join(L.projectDir,`.env`);p.writeFileSync(t,e,`utf-8`)};function Gp(e){for(let e of[`src/config/env.ts`,`src/lib/env.ts`,`src/env.ts`,`lib/env.ts`,`env.ts`,`config/env.ts`]){let t=d.join(L.projectDir,e);if(p.existsSync(t))return t}if(e===!1)return null;throw z.warn(`Could not find T3 env files. Run "proofkit add utils/t3-env" to initialize them.`),Error(`T3 env file not found`)}async function Kp(e){await e.save();try{await f(`npx`,[`@biomejs/biome`,`format`,`--write`,L.projectDir],{cwd:L.projectDir})}catch(e){L.debug&&(console.log(`Error formatting files with biome`),console.error(e))}}function qp(e){let t=e?.getExpressionIfKind(g.ParenthesizedExpression)?.getExpression()??e?.getExpression();return t?.isKind(g.JsxFragment)||e?.replaceWithText(`return <>${t}</>;`),e}function Jp(e){return new ae({tsConfigFilePath:d.join(e??process.cwd(),`tsconfig.json`)})}async function Yp({projectDir:e=L.projectDir,envs:t,envFileDescription:n,...r}){let i=Gp(),a=r.project??Jp(e),o=a.addSourceFileAtPath(i);if(!o)throw Error(`Schema file not found`);let s=o.getDescendantsOfKind(g.CallExpression).find(e=>e.getExpression().getText()===`createEnv`);if(!s)throw Error(`Could not find createEnv call in schema file. Make sure you have a valid env.ts file with createEnv setup.`);let c=s.getArguments()[0];if(!c)throw Error(`createEnv call is missing options argument`);let l=c.getDescendantsOfKind(g.PropertyAssignment).find(e=>e.getName()===`server`)?.getFirstDescendantByKind(g.ObjectLiteralExpression),u=c.getDescendantsOfKind(g.PropertyAssignment).find(e=>e.getName()===`client`)?.getFirstDescendantByKind(g.ObjectLiteralExpression),f=c.getDescendantsOfKind(g.PropertyAssignment).find(e=>e.getName()===`experimental__runtimeEnv`)?.getFirstDescendantByKind(g.ObjectLiteralExpression),m=t.filter(e=>e.type===`server`),h=t.filter(e=>e.type===`client`);for(let e of m)l?.addPropertyAssignment({name:e.name,initializer:e.zodValue});for(let e of h)u?.addPropertyAssignment({name:e.name,initializer:e.zodValue}),f?.addPropertyAssignment({name:e.name,initializer:`process.env.${e.name}`});let ee=t.filter(e=>e.addToRuntimeEnv??!0).map(e=>`${e.name}=${e.defaultValue??``}`).join(`
40
+ `),te=d.join(e,`.env`);if(p.existsSync(te)){let t=p.readFileSync(te,`utf-8`),r=d.join(e,`.gitignore`);try{let t=``;p.existsSync(r)&&(t=p.readFileSync(r,`utf-8`)),t.includes(`.env`)||ce(`echo ".env" >> "${r}"`,{cwd:e})}catch{}let i=`${t}
41
+ ${n?`# ${n}\n${ee}`:ee}
42
+ `;p.writeFileSync(te,i)}return r.project||await Kp(a),o}function Xp(e,t){e.addImportDeclaration({defaultImport:`UserMenu`,moduleSpecifier:t});let n=e.getImportDeclaration(e=>e.getModuleSpecifierValue()===`@mantine/core`);n?n.getNamedImports().find(e=>e.getName()===`Group`)||n.addNamedImport({name:`Group`}):e.addImportDeclaration({namedImports:[{name:`Group`}],moduleSpecifier:`@mantine/core`});let r=qp(e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(g.ReturnStatement)),i=r?.getFirstDescendantByKind(g.JsxOpeningFragment)?.getParentIfKind(g.JsxFragment)?.getFirstDescendantByKind(g.SyntaxList)?.getText();if(!i){console.log(`Failed to inject into header slot at ${e.getFilePath()}`);return}r?.replaceWithText(`return (<><Group>${i}<UserMenu /></Group></>)`),r?.formatText(),e.saveSync()}const Zp=async({projectDir:e})=>{B({projectDir:e,dependencies:[`@clerk/nextjs`,`@clerk/themes`],devMode:!1});let t=d.join(_,`template/extras`),n=d.join(e,`src/middleware.ts`);if(p.existsSync(n))console.log(c.yellow(`Middleware already exists. To require auth for your app, be sure to follow the guide to setup Clerk middleware. https://clerk.com/docs/references/nextjs/clerk-middleware#clerk-middleware-next-js`));else{let e=d.join(t,`src/middleware/clerk.ts`);p.copySync(e,n)}p.copySync(d.join(t,`src/app/clerk-auth`),d.join(e,`src/app/auth`)),p.copySync(d.join(t,`src/components/clerk-auth`),d.join(e,`src/components/clerk-auth`));let r=d.join(e,`src/app/layout.tsx`),i=Jp(e);Qp(i.addSourceFileAtPath(r)),Xp(i.addSourceFileAtPath(d.join(e,`src/components/AppShell/slot-header-right.tsx`)),`@/components/clerk-auth/user-menu`),Xp(i.addSourceFileAtPath(d.join(e,`src/components/AppShell/slot-header-mobile-content.tsx`)),`@/components/clerk-auth/user-menu-mobile`),$p(i.addSourceFileAtPathIfExists(d.join(e,`src/server/safe-action.ts`))),await Yp({projectDir:e,project:i,envs:[{name:`NEXT_PUBLIC_CLERK_SIGN_IN_URL`,zodValue:`z.string()`,defaultValue:`/auth/signin`,type:`client`},{name:`NEXT_PUBLIC_CLERK_SIGN_UP_URL`,zodValue:`z.string()`,defaultValue:`/auth/signup`,type:`client`},{name:`CLERK_SECRET_KEY`,zodValue:`z.string().startsWith('sk_').min(1, {
49
43
  message:
50
44
  "No Clerk Secret Key found. Did you create your Clerk app and copy the environment variables to you .env file?",
51
45
  })`,type:`server`},{name:`NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`,zodValue:`z.string().startsWith('pk_').min(1, {
52
46
  message:
53
47
  "No Clerk Public Key found. Did you create your Clerk app and copy the environment variables to you .env file?",
54
- })`,type:`client`}],envFileDescription:`Hosted auth with Clerk. Set up a new app at https://dashboard.clerk.com/apps/new to get these values.`}),await Bd(a)};function Kd(e){e.addImportDeclaration({namedImports:[{name:`ClerkAuthProvider`}],moduleSpecifier:`@/components/clerk-auth/clerk-provider`});let t=e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(_.ReturnStatement)?.getDescendantsOfKind(_.JsxOpeningElement).find(e=>e.getTagNameNode().getText()===`MantineProvider`)?.getParentIfKind(_.JsxElement),n=t?.getJsxChildren().map(e=>e.getText()).filter(Boolean).join(`
48
+ })`,type:`client`}],envFileDescription:`Hosted auth with Clerk. Set up a new app at https://dashboard.clerk.com/apps/new to get these values.`}),await Kp(i)};function Qp(e){e.addImportDeclaration({namedImports:[{name:`ClerkAuthProvider`}],moduleSpecifier:`@/components/clerk-auth/clerk-provider`});let t=e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(g.ReturnStatement)?.getDescendantsOfKind(g.JsxOpeningElement).find(e=>e.getTagNameNode().getText()===`MantineProvider`)?.getParentIfKind(g.JsxElement),n=t?.getJsxChildren().map(e=>e.getText()).filter(Boolean).join(`
55
49
  `);t?.getChildSyntaxList()?.replaceWithText(`<ClerkAuthProvider>
56
50
  ${n}
57
- </ClerkAuthProvider>`)}function qd(e){if(!e){console.log(r.yellow(`Failed to inject into safe-action-client. Did you move the safe-action.ts file?`));return}e.addImportDeclaration({namedImports:[{name:`auth`,alias:`getAuth`}],moduleSpecifier:`@clerk/nextjs/server`}),e.addStatements(e=>e.writeLine(`export const authedActionClient = actionClient.use(async ({ next, ctx }) => {
51
+ </ClerkAuthProvider>`)}function $p(e){if(!e){console.log(c.yellow(`Failed to inject into safe-action-client. Did you move the safe-action.ts file?`));return}e.addImportDeclaration({namedImports:[{name:`auth`,alias:`getAuth`}],moduleSpecifier:`@clerk/nextjs/server`}),e.addStatements(e=>e.writeLine(`export const authedActionClient = actionClient.use(async ({ next, ctx }) => {
58
52
  const auth = getAuth();
59
53
  if (!auth.userId) {
60
54
  throw new Error("Unauthorized");
@@ -62,14 +56,14 @@ ${n?`# ${n}\n${g}`:g}
62
56
  return next({ ctx: { ...ctx, auth } });
63
57
  });
64
58
 
65
- `))}async function Jd({dataApiKey:e,fmFile:t,server:n}){return Zd((await se({adapter:new ce({auth:{apiKey:e},db:t,server:n}),layout:``}).layouts()).layouts)}function Yd(e){return`isFolder`in e?(e.folderLayoutNames??[]).flatMap(Yd):[e.name]}const Xd=[`API_`,`API `,`dapi_`,`dapi`];function Zd(e){return e.flatMap(Yd).sort((e,t)=>{let n=Xd.find(t=>e.startsWith(t)),r=Xd.find(e=>t.startsWith(e));return n&&r?e.localeCompare(t):n?-1:r?1:e.localeCompare(t)})}const Qd=yu(`type`,[N({type:Pu(`clerk`)}),N({type:Pu(`next-auth`)}),N({type:Pu(`proofkit`).transform(()=>`fmaddon`)}),N({type:Pu(`fmaddon`)}),N({type:Pu(`better-auth`)}),N({type:Pu(`none`)})]).default({type:`none`}),$d=N({database:j().default(`FM_DATABASE`),server:j().default(`FM_SERVER`),apiKey:j().default(`OTTO_API_KEY`)}),ef=yu(`type`,[N({type:Pu(`fm`),name:j(),envNames:$d}),N({type:Pu(`supabase`),name:j()})]),tf=[`browser`,`webviewer`],nf=yu(`ui`,[N({ui:Pu(`mantine`),appType:P(tf).default(`browser`),auth:Qd,envFile:j().optional(),dataSources:du(ef).default([]),tanstackQuery:Hl().catch(!1),replacedMainPage:Hl().catch(!1),reactEmail:Hl().catch(!1),reactEmailServer:Hl().catch(!1),appliedUpgrades:du(j()).default([]),registryUrl:nl().optional(),registryTemplates:du(j()).default([])}),N({ui:Pu(`shadcn`),appType:P(tf).default(`browser`),envFile:j().optional(),dataSources:du(ef).default([]),replacedMainPage:Hl().catch(!1),registryUrl:nl().optional(),registryTemplates:du(j()).default([])})]),rf=nf.parse({auth:{type:`none`},ui:`shadcn`,appType:`browser`,dataSources:[],replacedMainPage:!1,registryTemplates:[]});let af;const B=()=>{if(af)return af;let e=o.join(I.projectDir,`proofkit.json`);if(!c.existsSync(e))throw Error(`ProofKit settings file not found at: ${e}`);let t=c.readJSONSync(e);typeof t==`object`&&t&&!(`ui`in t)&&(t={...t,ui:`mantine`});let n=nf.parse(t);return I.appType=n.appType,n};function of(e){let t={...B(),...e};sf(nf.parse(t))}function sf(e){return c.writeJSONSync(o.join(I.projectDir,`proofkit.json`),e,{spaces:2}),af=e,af}function cf(e=`.env`){let t=B(),n=o.join(I.projectDir,e);if(c.existsSync(n))return sf({...t,envFile:e}),e;if(t.envFile){let{envFile:e,...n}=t;sf(n)}}const lf=({commandName:e})=>{c.existsSync(o.join(process.cwd(),`proofkit.json`))||(console.log(r.yellow(`The "${e}" command requires an existing ProofKit project.
66
- Please run " ${Re} init" first, or try this command again when inside a ProofKit project.`)),process.exit(1));try{return B()}catch(e){console.log(r.red(`Error parsing ProofKit settings file:`)),e instanceof Rc?console.log(F.prettifyError(e)):console.log(e),process.exit(1)}};var uf=class extends Error{};function V(e){if(n(e))throw t(),new uf;return e}async function df(e){if(!c.existsSync(e))return null;try{return fe(await c.readFile(e,`utf8`))}catch(t){return console.error(`Error reading or parsing JSONC config at ${e}:`,t),{$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[]}}}async function ff(e,t){if(c.existsSync(e)){let n=await c.readFile(e,`utf8`),r=ue(n,de(n,[`config`],t.config,{formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
67
- `}}));await c.writeFile(e,r,`utf8`)}else await c.writeJson(e,t,{spaces:2})}async function pf({projectDir:e=process.cwd(),schemas:t,runCodegen:n=!0,dataSourceName:r}){let i=o.join(e,`proofkit-typegen.config.jsonc`),a=await df(i);a||={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[]};let s=a.config,c;Array.isArray(s)?c=s:(c=[s],a.config=c);let l=t.map(e=>({layoutName:e.layoutName,schemaName:e.schemaName,valueLists:e.valueLists,generateClient:e.generateClient,strictNumbers:e.strictNumbers})),u=c.find(e=>e.path?.endsWith(r)||e.path?.endsWith(r+`/`)||e.path===r);u?u.layouts=u.layouts||[]:(u={layouts:[],path:`./src/config/schemas/${r}`},c.push(u)),u.layouts.push(...l),await ff(i,a),n&&await hf()}async function mf({config:e,projectDir:t,runCodegen:n=!0}){let r=o.join(t,`proofkit-typegen.config.jsonc`),i=await df(r),a=Array.isArray(e)?e:[e];i?Array.isArray(i.config)?i.config.push(...a):i.config=[i.config,...a]:i={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:a},await ff(r,i),n&&await hf()}async function hf(){let e=I.projectDir,t=B();if(t.dataSources.length===0){console.log(`no data sources found, skipping typegen`);return}if(t.dataSources.some(e=>e.type===`fm`)){let t=await df(o.join(e,`proofkit-typegen.config.jsonc`));if(!t)throw Error(`proofkit-typegen.config.jsonc not found`);oe({path:o.join(e,`.env`)}),await le(t.config,{cwd:e})}}function gf({projectDir:e=process.cwd(),dataSourceName:t}){let n=o.join(e,`proofkit-typegen.config.jsonc`);if(!c.existsSync(n))return`Client`;try{let e=fe(c.readFileSync(n,`utf8`)),r;return r=(Array.isArray(e.config)?e.config:[e.config]).find(e=>e.path?.endsWith(t)||e.path?.endsWith(t+`/`)||e.path===t),r?.clientSuffix??`Client`}catch(e){return console.error(`Error reading or parsing JSONC config for getClientSuffix: ${n}`,e),`Client`}}function _f({projectDir:e=process.cwd(),dataSourceName:t}){let n=o.join(e,`proofkit-typegen.config.jsonc`);if(!c.existsSync(n))return[];try{let e=fe(c.readFileSync(n,`utf8`)),r;return r=(Array.isArray(e.config)?e.config:[e.config]).find(e=>e.path?.endsWith(t)||e.path?.endsWith(t+`/`)||e.path===t),r?.layouts?r.layouts.map(e=>({layout:e.layoutName,schemaName:e.schemaName})):[]}catch(e){return console.error(`Error reading or parsing JSONC config for getExistingSchemas: ${n}`,e),[]}}async function vf({dataSourceName:e,envNames:t}){let n=I.projectDir,r=o.join(n,`proofkit-typegen.config.jsonc`),i=await df(r),a={layouts:[],path:`./src/config/schemas/${e}`,clearOldFiles:!0,clientSuffix:`Layout`};if(t&&(a.envNames={server:t.server,db:t.database,auth:{apiKey:t.apiKey}}),I.appType===`webviewer`&&(a.webviewerScriptName=`ExecuteDataApi`),!i)i={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[a]};else{let e;Array.isArray(i.config)?e=i.config:(e=[i.config],i.config=e);let t=e.findIndex(e=>e.path===a.path);t===-1?e.push(a):e[t]={...e[t],...a,layouts:a.layouts.length>0?a.layouts:e[t]?.layouts||[]}}await ff(r,i)}function yf({schemaName:e,dataSourceName:t}){let n=I.projectDir,r=Hd(n),i=o.join(n,`src/config/schemas/${t}/generated/${e}.ts`),a=o.join(n,`src/config/schemas/${t}/${e}.ts`),s=i;if(!c.existsSync(i))if(c.existsSync(a))s=a;else return[];let l=r.addSourceFileAtPath(s),u=l.getVariableDeclaration(`Z${e}`);return u?(u.getInitializer()?.getFirstDescendantByKind(_.ObjectLiteralExpression)?.getProperties())?.map(e=>e.asKind(_.PropertyAssignment)?.getName()?.replace(/"/g,``)).filter(Boolean)??[]:(l.getTypeAlias(`T${e}`)?.getFirstDescendantByKind(_.TypeLiteral)?.getProperties())?.map(e=>e.asKind(_.PropertySignature)?.getName()?.replace(/"/g,``)).filter(Boolean)??[]}async function bf({dataSourceName:e}){let t=I.projectDir,n=o.join(t,`proofkit-typegen.config.jsonc`),r=await df(n);if(!r)return;let i=`./src/config/schemas/${e}`;Array.isArray(r.config)?r.config=r.config.filter(e=>e.path!==i):r.config.path===i&&(r.config=[]),await ff(n,r)}async function xf({projectDir:e=I.projectDir,schemaName:t,dataSourceName:n,runCodegen:r=!0}){let i=o.join(e,`proofkit-typegen.config.jsonc`),a=await df(i);if(!a)throw Error(`proofkit-typegen.config.jsonc not found, cannot remove layout.`);let s=!1,l=`./src/config/schemas/${n}`,u;Array.isArray(a.config)?u=a.config:(u=[a.config],a.config=u);let d=u.find(e=>e.path===l);if(d?.layouts){let e=d.layouts.length;d.layouts=d.layouts.filter(e=>e.schemaName!==t),d.layouts.length<e&&(s=!0)}s&&await ff(i,a);let f=o.join(e,`src`,`config`,`schemas`,n,`${t}.ts`);c.existsSync(f)&&c.removeSync(f),r&&s&&await hf()}async function Sf(e){let t=I.projectDir,n=B();if(n.ui===`shadcn`||n.tanstackQuery)return!1;z({projectDir:t,dependencies:[`@tanstack/react-query`],devMode:!1}),z({projectDir:t,dependencies:[`@tanstack/react-query-devtools`,`@tanstack/eslint-plugin-query`],devMode:!0});let r=o.join(v,`template`,`extras`);I.appType===`browser`?(c.copySync(o.join(r,`config`,`get-query-client.ts`),o.join(t,`src/config/get-query-client.ts`)),c.copySync(o.join(r,`config`,`query-provider.tsx`),o.join(t,`src/config/query-provider.tsx`))):I.appType===`webviewer`&&c.copySync(o.join(r,`config`,`query-provider-vite.tsx`),o.join(t,`src/config/query-provider.tsx`));let i=e?.project??Hd(t),a=i.addSourceFileAtPath(o.join(t,I.appType===`browser`?`src/app/layout.tsx`:`src/main.tsx`));if(a.addImportDeclaration({moduleSpecifier:`@/config/query-provider`,defaultImport:`QueryProvider`}),I.appType===`browser`){let e=a.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(_.ReturnStatement)?.getDescendantsOfKind(_.JsxOpeningElement).find(e=>e.getTagNameNode().getText()===`body`)?.getParentIfKind(_.JsxElement),t=e?.getJsxChildren().map(e=>e.getText()).filter(Boolean).join(`
59
+ `))}async function em({dataApiKey:e,fmFile:t,server:n}){return rm((await de({adapter:new fe({auth:{apiKey:e},db:t,server:n}),layout:``}).layouts()).layouts)}function tm(e){return`isFolder`in e?(e.folderLayoutNames??[]).flatMap(tm):[e.name]}const nm=[`API_`,`API `,`dapi_`,`dapi`];function rm(e){return e.flatMap(tm).sort((e,t)=>{let n=nm.find(t=>e.startsWith(t)),r=nm.find(e=>t.startsWith(e));return n&&r?e.localeCompare(t):n?-1:r?1:e.localeCompare(t)})}const im=yf(`type`,[P({type:Pf(`clerk`)}),P({type:Pf(`next-auth`)}),P({type:Pf(`proofkit`).transform(()=>`fmaddon`)}),P({type:Pf(`fmaddon`)}),P({type:Pf(`better-auth`)}),P({type:Pf(`none`)})]).default({type:`none`}),am=P({database:M().default(`FM_DATABASE`),server:M().default(`FM_SERVER`),apiKey:M().default(`OTTO_API_KEY`)}),om=yf(`type`,[P({type:Pf(`fm`),name:M(),envNames:am}),P({type:Pf(`supabase`),name:M()})]),sm=[`browser`,`webviewer`],cm=yf(`ui`,[P({ui:Pf(`mantine`),appType:F(sm).default(`browser`),auth:im,envFile:M().optional(),dataSources:df(om).default([]),tanstackQuery:Vd().catch(!1),replacedMainPage:Vd().catch(!1),reactEmail:Vd().catch(!1),reactEmailServer:Vd().catch(!1),appliedUpgrades:df(M()).default([]),registryUrl:qu().optional(),registryTemplates:df(M()).default([])}),P({ui:Pf(`shadcn`),appType:F(sm).default(`browser`),envFile:M().optional(),dataSources:df(om).default([]),replacedMainPage:Vd().catch(!1),registryUrl:qu().optional(),registryTemplates:df(M()).default([])})]),lm=cm.parse({auth:{type:`none`},ui:`shadcn`,appType:`browser`,dataSources:[],replacedMainPage:!1,registryTemplates:[]});let um;const V=()=>{if(um)return um;let e=d.join(L.projectDir,`proofkit.json`);if(!p.existsSync(e))throw Error(`ProofKit settings file not found at: ${e}`);let t=p.readJSONSync(e);typeof t==`object`&&t&&!(`ui`in t)&&(t={...t,ui:`mantine`});let n=cm.parse(t);return L.appType=n.appType,n};function dm(e){let t={...V(),...e};fm(cm.parse(t))}function fm(e){return p.writeJSONSync(d.join(L.projectDir,`proofkit.json`),e,{spaces:2}),um=e,um}function pm(e=`.env`){let t=V(),n=d.join(L.projectDir,e);if(p.existsSync(n))return fm({...t,envFile:e}),e;if(t.envFile){let{envFile:e,...n}=t;fm(n)}}const mm=({commandName:e})=>{p.existsSync(d.join(process.cwd(),`proofkit.json`))||(console.log(c.yellow(`The "${e}" command requires an existing ProofKit project.
60
+ Please run " ${He} init" first, or try this command again when inside a ProofKit project.`)),process.exit(1));try{return V()}catch(e){console.log(c.red(`Error parsing ProofKit settings file:`)),e instanceof Su?console.log(I.prettifyError(e)):console.log(e),process.exit(1)}};var hm=class extends Error{};function H(e){if(i(e))throw t(),new hm;return e}async function gm(e){if(!p.existsSync(e))return null;try{return ge(await p.readFile(e,`utf8`))}catch(t){return console.error(`Error reading or parsing JSONC config at ${e}:`,t),{$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[]}}}async function _m(e,t){if(p.existsSync(e)){let n=await p.readFile(e,`utf8`),r=me(n,he(n,[`config`],t.config,{formattingOptions:{tabSize:2,insertSpaces:!0,eol:`
61
+ `}}));await p.writeFile(e,r,`utf8`)}else await p.writeJson(e,t,{spaces:2})}async function vm({projectDir:e=process.cwd(),schemas:t,runCodegen:n=!0,dataSourceName:r}){let i=d.join(e,`proofkit-typegen.config.jsonc`),a=await gm(i);a||={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[]};let o=a.config,s;Array.isArray(o)?s=o:(s=[o],a.config=s);let c=t.map(e=>({layoutName:e.layoutName,schemaName:e.schemaName,valueLists:e.valueLists,generateClient:e.generateClient,strictNumbers:e.strictNumbers})),l=s.find(e=>e.path?.endsWith(r)||e.path?.endsWith(`${r}/`)||e.path===r);l?l.layouts=l.layouts||[]:(l={layouts:[],path:`./src/config/schemas/${r}`},s.push(l)),l.layouts.push(...c),await _m(i,a),n&&await bm()}async function ym({config:e,projectDir:t,runCodegen:n=!0}){let r=d.join(t,`proofkit-typegen.config.jsonc`),i=await gm(r),a=Array.isArray(e)?e:[e];i?Array.isArray(i.config)?i.config.push(...a):i.config=[i.config,...a]:i={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:a},await _m(r,i),n&&await bm()}async function bm(){let e=L.projectDir,t=V();if(t.dataSources.length===0){console.log(`no data sources found, skipping typegen`);return}if(t.dataSources.some(e=>e.type===`fm`)){let t=await gm(d.join(e,`proofkit-typegen.config.jsonc`));if(!t)throw Error(`proofkit-typegen.config.jsonc not found`);ue({path:d.join(e,`.env`)}),await pe(t.config,{cwd:e})}}function xm({projectDir:e=process.cwd(),dataSourceName:t}){let n=d.join(e,`proofkit-typegen.config.jsonc`);if(!p.existsSync(n))return`Client`;try{let e=ge(p.readFileSync(n,`utf8`));return(Array.isArray(e.config)?e.config:[e.config]).find(e=>e.path?.endsWith(t)||e.path?.endsWith(`${t}/`)||e.path===t)?.clientSuffix??`Client`}catch(e){return console.error(`Error reading or parsing JSONC config for getClientSuffix: ${n}`,e),`Client`}}function Sm({projectDir:e=process.cwd(),dataSourceName:t}){let n=d.join(e,`proofkit-typegen.config.jsonc`);if(!p.existsSync(n))return[];try{let e=ge(p.readFileSync(n,`utf8`)),r;return r=(Array.isArray(e.config)?e.config:[e.config]).find(e=>e.path?.endsWith(t)||e.path?.endsWith(`${t}/`)||e.path===t),r?.layouts?r.layouts.map(e=>({layout:e.layoutName,schemaName:e.schemaName})):[]}catch(e){return console.error(`Error reading or parsing JSONC config for getExistingSchemas: ${n}`,e),[]}}async function Cm({dataSourceName:e,envNames:t}){let n=L.projectDir,r=d.join(n,`proofkit-typegen.config.jsonc`),i=await gm(r),a={layouts:[],path:`./src/config/schemas/${e}`,clearOldFiles:!0,clientSuffix:`Layout`};if(t&&(a.envNames={server:t.server,db:t.database,auth:{apiKey:t.apiKey}}),L.appType===`webviewer`&&(a.webviewerScriptName=`ExecuteDataApi`),i){let e;Array.isArray(i.config)?e=i.config:(e=[i.config],i.config=e);let t=e.findIndex(e=>e.path===a.path);t===-1?e.push(a):e[t]={...e[t],...a,layouts:a.layouts.length>0?a.layouts:e[t]?.layouts||[]}}else i={$schema:`https://proofkit.dev/typegen-config-schema.json`,config:[a]};await _m(r,i)}function wm({schemaName:e,dataSourceName:t}){let n=L.projectDir,r=Jp(n),i=d.join(n,`src/config/schemas/${t}/generated/${e}.ts`),a=d.join(n,`src/config/schemas/${t}/${e}.ts`),o=i;if(!p.existsSync(i))if(p.existsSync(a))o=a;else return[];let s=r.addSourceFileAtPath(o),c=s.getVariableDeclaration(`Z${e}`);return c?(c.getInitializer()?.getFirstDescendantByKind(g.ObjectLiteralExpression)?.getProperties())?.map(e=>e.asKind(g.PropertyAssignment)?.getName()?.replace(/"/g,``)).filter(Boolean)??[]:(s.getTypeAlias(`T${e}`)?.getFirstDescendantByKind(g.TypeLiteral)?.getProperties())?.map(e=>e.asKind(g.PropertySignature)?.getName()?.replace(/"/g,``)).filter(Boolean)??[]}async function Tm({dataSourceName:e}){let t=L.projectDir,n=d.join(t,`proofkit-typegen.config.jsonc`),r=await gm(n);if(!r)return;let i=`./src/config/schemas/${e}`;Array.isArray(r.config)?r.config=r.config.filter(e=>e.path!==i):r.config.path===i&&(r.config=[]),await _m(n,r)}async function Em({projectDir:e=L.projectDir,schemaName:t,dataSourceName:n,runCodegen:r=!0}){let i=d.join(e,`proofkit-typegen.config.jsonc`),a=await gm(i);if(!a)throw Error(`proofkit-typegen.config.jsonc not found, cannot remove layout.`);let o=!1,s=`./src/config/schemas/${n}`,c;Array.isArray(a.config)?c=a.config:(c=[a.config],a.config=c);let l=c.find(e=>e.path===s);if(l?.layouts){let e=l.layouts.length;l.layouts=l.layouts.filter(e=>e.schemaName!==t),l.layouts.length<e&&(o=!0)}o&&await _m(i,a);let u=d.join(e,`src`,`config`,`schemas`,n,`${t}.ts`);p.existsSync(u)&&p.removeSync(u),r&&o&&await bm()}async function Dm(e){let t=L.projectDir,n=V();if(n.ui===`shadcn`||n.tanstackQuery)return!1;B({projectDir:t,dependencies:[`@tanstack/react-query`],devMode:!1}),B({projectDir:t,dependencies:[`@tanstack/react-query-devtools`],devMode:!0});let r=d.join(_,`template`,`extras`);L.appType===`browser`?(p.copySync(d.join(r,`config`,`get-query-client.ts`),d.join(t,`src/config/get-query-client.ts`)),p.copySync(d.join(r,`config`,`query-provider.tsx`),d.join(t,`src/config/query-provider.tsx`))):L.appType===`webviewer`&&p.copySync(d.join(r,`config`,`query-provider-vite.tsx`),d.join(t,`src/config/query-provider.tsx`));let i=e?.project??Jp(t),a=i.addSourceFileAtPath(d.join(t,L.appType===`browser`?`src/app/layout.tsx`:`src/main.tsx`));if(a.addImportDeclaration({moduleSpecifier:`@/config/query-provider`,defaultImport:`QueryProvider`}),L.appType===`browser`){let e=a.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(g.ReturnStatement)?.getDescendantsOfKind(g.JsxOpeningElement).find(e=>e.getTagNameNode().getText()===`body`)?.getParentIfKind(g.JsxElement),t=e?.getJsxChildren().map(e=>e.getText()).filter(Boolean).join(`
68
62
  `);e?.getChildSyntaxList()?.replaceWithText(`<QueryProvider>
69
63
  ${t}
70
- </QueryProvider>`)}else if(I.appType===`webviewer`){let e=a.getDescendantsOfKind(_.JsxElement).find(e=>e.getOpeningElement().getTagNameNode().getText()===`MantineProvider`);e?.replaceWithText(`<QueryProvider>
64
+ </QueryProvider>`)}else if(L.appType===`webviewer`){let e=a.getDescendantsOfKind(g.JsxElement).find(e=>e.getOpeningElement().getTagNameNode().getText()===`MantineProvider`);e?.replaceWithText(`<QueryProvider>
71
65
  ${e.getText()}
72
- </QueryProvider>`)}return e?.project||await Bd(i),sf({...n,tanstackQuery:!0}),!0}async function Cf({addonName:e}){let t=e===`auth`?`FM Auth Add-on`:`ProofKit WebViewer`,n=null;if(process.platform===`win32`?n=o.join(pe.homedir(),`AppData`,`Local`,`FileMaker`,`Extensions`,`AddonModules`):process.platform===`darwin`&&(n=o.join(pe.homedir(),`Library`,`Application Support`,`FileMaker`,`Extensions`,`AddonModules`)),!n){R.warn(`Could not install the ${t} addon. You will need to do this manually.`);return}let i=e===`auth`?`ProofKitAuth`:`ProofKitWV`;await c.copy(o.join(v,`template/fm-addon/${i}`),o.join(n,i),{overwrite:!0}),console.log(``),console.log(r.bgYellow(` ACTION REQUIRED: `)),e===`auth`?console.log(`${r.yellowBright(`You must install the FM Auth addon in your FileMaker file to continue.`)} ${r.dim(`(Learn more: https://proofkit.dev/auth/fm-addon)`)}`):console.log(`${r.yellowBright(`You must install the ProofKit WebViewer addon in your FileMaker file to continue.`)} ${r.dim(`(Learn more: https://proofkit.dev/webviewer)`)}`),[`Restart FileMaker Pro (if it's currently running)`,`Open your FileMaker file, go to layout mode, and install the ${t} addon to the file`,`Come back here to continue the installation`].forEach((e,t)=>{console.log(`${t+1}. ${e}`)})}async function wf({...e}){let t=I.projectDir,n=B();if(n.ui===`shadcn`||n.reactEmail)return!1;c.ensureDirSync(o.join(t,`src/emails`)),z({dependencies:[`@react-email/components`,`@react-email/render`],devMode:!1,projectDir:t}),z({dependencies:[`react-email`,`@react-email/preview-server`],devMode:!0,projectDir:t});let r=c.readJSONSync(o.join(t,`package.json`));r.scripts[`email:preview`]=`email dev --port 3010 --dir=src/emails`,c.writeJSONSync(o.join(t,`package.json`),r,{spaces:2});let i=e.project??Hd(t);if(e.installServerFiles){let e=I.emailProvider;e===`plunk`?await Tf({project:i}):e===`resend`?await Ef({project:i}):await c.copy(o.join(v,`template/extras/emailProviders/none/email.tsx`),o.join(t,`src/server/auth/email.tsx`))}return await c.copy(o.join(v,`template/extras/emailTemplates/generic.tsx`),o.join(t,`src/emails/generic.tsx`)),e.installServerFiles&&await c.copy(o.join(v,`template/extras/emailTemplates/auth-code.tsx`),o.join(t,`src/emails/auth-code.tsx`)),e.project||await Bd(i),sf({...n,reactEmail:!0,reactEmailServer:!!e.installServerFiles||n.reactEmailServer}),e.noInstall||await Id({projectDir:t}),!0}async function Tf({project:t}){let n=I.projectDir;z({dependencies:[`@plunk/node`],devMode:!1,projectDir:n});let i=typeof I.apiKey==`string`?I.apiKey:I.ci?``:V(await e.text({message:`Enter your Plunk API key\n${r.dim(`Enter your Secret API Key from https://app.useplunk.com/settings/api`)}`,placeholder:`...or leave blank to do this later`}));i||R.warn(`You will need to add your Plunk API key to the .env file manually for your app to run.`),console.log(``),await Ud({projectDir:n,project:t,envs:[{name:`PLUNK_API_KEY`,zodValue:`z.string().startsWith("sk_")`,type:`server`,defaultValue:i}]}),await c.copy(o.join(v,`template/extras/emailProviders/plunk/service.ts`),o.join(n,`src/server/services/plunk.ts`)),await c.copy(o.join(v,`template/extras/emailProviders/plunk/email.tsx`),o.join(n,`src/server/auth/email.tsx`))}async function Ef({project:t}){let n=I.projectDir;z({dependencies:[`resend`],devMode:!1,projectDir:n});let i=typeof I.apiKey==`string`?I.apiKey:I.ci?``:V(await e.text({message:`Enter your Resend API key\n${r.dim(`Only "Sending Access" permission required: https://resend.com/api-keys`)}`,placeholder:`...or leave blank to do this later`}));i||R.warn(`You will need to add your Resend API key to the .env file manually for your app to run.`),console.log(``),await Ud({projectDir:n,project:t,envs:[{name:`RESEND_API_KEY`,zodValue:`z.string().startsWith("re_")`,type:`server`,defaultValue:i}]}),await c.copy(o.join(v,`template/extras/emailProviders/resend/service.ts`),o.join(n,`src/server/services/resend.ts`)),await c.copy(o.join(v,`template/extras/emailProviders/resend/email.tsx`),o.join(n,`src/server/auth/email.tsx`))}const Df=async()=>{let t=m(`Installing files for auth...`).start(),n=I.projectDir;z({projectDir:n,dependencies:[`@node-rs/argon2`,`@oslojs/binary`,`@oslojs/crypto`,`@oslojs/encoding`,`js-cookie`],devMode:!1}),z({projectDir:n,dependencies:[`@types/js-cookie`],devMode:!0}),await c.copy(o.join(v,`template/extras/fmaddon-auth`),o.join(n,`src`));let r=Hd(n);await Sf({project:r}),Wd(r.addSourceFileAtPath(o.join(n,`src/components/AppShell/slot-header-right.tsx`)),`@/components/auth/user-menu`),Of(r.addSourceFileAtPathIfExists(o.join(n,`src/server/safe-action.ts`))),await mf({config:{clientSuffix:`Layout`,layouts:[{layoutName:`proofkit_auth_sessions`,schemaName:`sessions`,strictNumbers:!0},{layoutName:`proofkit_auth_users`,schemaName:`users`,strictNumbers:!0},{layoutName:`proofkit_auth_email_verification`,schemaName:`emailVerification`,strictNumbers:!0},{layoutName:`proofkit_auth_password_reset`,schemaName:`passwordReset`,strictNumbers:!0}],clearOldFiles:!0,validator:!1,path:`./src/server/auth/db`},projectDir:n,runCodegen:!1}),await wf({project:r,installServerFiles:!0}),kf(r.addSourceFileAtPath(o.join(n,`src/app/(main)/layout.tsx`))),await Bd(r);let i=!1;for(;!i;)if(i=await Af(n,t),i)t.text=`Successfully detected all required layouts in your FileMaker file.`;else if(!V(await e.confirm({message:`I have followed the above instructions, continue installing`,initialValue:!0,active:`Continue`,inactive:`Abort`})))throw new uf;await hf(),t.succeed(`Auth installed successfully`)};function Of(e){if(!e){console.log(r.yellow(`Failed to inject into safe-action-client. Did you move the safe-action.ts file?`));return}e.addImportDeclaration({namedImports:[{name:`getCurrentSession`}],moduleSpecifier:`./auth/utils/session`}),e.addStatements(e=>e.writeLine(`export const authedActionClient = actionClient.use(async ({ next, ctx }) => {
66
+ </QueryProvider>`)}return e?.project||await Kp(i),fm({...n,tanstackQuery:!0}),!0}async function Om({addonName:e}){let t=e===`auth`?`FM Auth Add-on`:`ProofKit WebViewer`,n=null;if(process.platform===`win32`?n=d.join(_e.homedir(),`AppData`,`Local`,`FileMaker`,`Extensions`,`AddonModules`):process.platform===`darwin`&&(n=d.join(_e.homedir(),`Library`,`Application Support`,`FileMaker`,`Extensions`,`AddonModules`)),!n){z.warn(`Could not install the ${t} addon. You will need to do this manually.`);return}let r=e===`auth`?`ProofKitAuth`:`ProofKitWV`;await p.copy(d.join(_,`template/fm-addon/${r}`),d.join(n,r),{overwrite:!0}),console.log(``),console.log(c.bgYellow(` ACTION REQUIRED: `)),e===`auth`?console.log(`${c.yellowBright(`You must install the FM Auth addon in your FileMaker file to continue.`)} ${c.dim(`(Learn more: https://proofkit.dev/auth/fm-addon)`)}`):console.log(`${c.yellowBright(`You must install the ProofKit WebViewer addon in your FileMaker file to continue.`)} ${c.dim(`(Learn more: https://proofkit.dev/webviewer)`)}`),[`Restart FileMaker Pro (if it's currently running)`,`Open your FileMaker file, go to layout mode, and install the ${t} addon to the file`,`Come back here to continue the installation`].forEach((e,t)=>{console.log(`${t+1}. ${e}`)})}async function km({...e}){let t=L.projectDir,n=V();if(n.ui===`shadcn`||n.reactEmail)return!1;p.ensureDirSync(d.join(t,`src/emails`)),B({dependencies:[`@react-email/components`,`@react-email/render`],devMode:!1,projectDir:t}),B({dependencies:[`react-email`,`@react-email/preview-server`],devMode:!0,projectDir:t});let r=p.readJSONSync(d.join(t,`package.json`));r.scripts||={},r.scripts[`email:preview`]=`email dev --port 3010 --dir=src/emails`,p.writeJSONSync(d.join(t,`package.json`),r,{spaces:2});let i=e.project??Jp(t);if(e.installServerFiles){let e=L.emailProvider;e===`plunk`?await Am({project:i}):e===`resend`?await jm({project:i}):await p.copy(d.join(_,`template/extras/emailProviders/none/email.tsx`),d.join(t,`src/server/auth/email.tsx`))}return await p.copy(d.join(_,`template/extras/emailTemplates/generic.tsx`),d.join(t,`src/emails/generic.tsx`)),e.installServerFiles&&await p.copy(d.join(_,`template/extras/emailTemplates/auth-code.tsx`),d.join(t,`src/emails/auth-code.tsx`)),e.project||await Kp(i),fm({...n,reactEmail:!0,reactEmailServer:!!e.installServerFiles||n.reactEmailServer}),e.noInstall||await Hp({projectDir:t}),!0}async function Am({project:t}){let n=L.projectDir;B({dependencies:[`@plunk/node`],devMode:!1,projectDir:n});let r;r=typeof L.apiKey==`string`?L.apiKey:L.ci?``:H(await e.text({message:`Enter your Plunk API key\n${c.dim(`Enter your Secret API Key from https://app.useplunk.com/settings/api`)}`,placeholder:`...or leave blank to do this later`})),r||z.warn(`You will need to add your Plunk API key to the .env file manually for your app to run.`),console.log(``),await Yp({projectDir:n,project:t,envs:[{name:`PLUNK_API_KEY`,zodValue:`z.string().startsWith("sk_")`,type:`server`,defaultValue:r}]}),await p.copy(d.join(_,`template/extras/emailProviders/plunk/service.ts`),d.join(n,`src/server/services/plunk.ts`)),await p.copy(d.join(_,`template/extras/emailProviders/plunk/email.tsx`),d.join(n,`src/server/auth/email.tsx`))}async function jm({project:t}){let n=L.projectDir;B({dependencies:[`resend`],devMode:!1,projectDir:n});let r;r=typeof L.apiKey==`string`?L.apiKey:L.ci?``:H(await e.text({message:`Enter your Resend API key\n${c.dim(`Only "Sending Access" permission required: https://resend.com/api-keys`)}`,placeholder:`...or leave blank to do this later`})),r||z.warn(`You will need to add your Resend API key to the .env file manually for your app to run.`),console.log(``),await Yp({projectDir:n,project:t,envs:[{name:`RESEND_API_KEY`,zodValue:`z.string().startsWith("re_")`,type:`server`,defaultValue:r}]}),await p.copy(d.join(_,`template/extras/emailProviders/resend/service.ts`),d.join(n,`src/server/services/resend.ts`)),await p.copy(d.join(_,`template/extras/emailProviders/resend/email.tsx`),d.join(n,`src/server/auth/email.tsx`))}const Mm=async()=>{let t=re(`Installing files for auth...`).start(),n=L.projectDir;B({projectDir:n,dependencies:[`@node-rs/argon2`,`@oslojs/binary`,`@oslojs/crypto`,`@oslojs/encoding`,`js-cookie`],devMode:!1}),B({projectDir:n,dependencies:[`@types/js-cookie`],devMode:!0}),await p.copy(d.join(_,`template/extras/fmaddon-auth`),d.join(n,`src`));let r=Jp(n);await Dm({project:r}),Xp(r.addSourceFileAtPath(d.join(n,`src/components/AppShell/slot-header-right.tsx`)),`@/components/auth/user-menu`),Nm(r.addSourceFileAtPathIfExists(d.join(n,`src/server/safe-action.ts`))),await ym({config:{clientSuffix:`Layout`,layouts:[{layoutName:`proofkit_auth_sessions`,schemaName:`sessions`,strictNumbers:!0},{layoutName:`proofkit_auth_users`,schemaName:`users`,strictNumbers:!0},{layoutName:`proofkit_auth_email_verification`,schemaName:`emailVerification`,strictNumbers:!0},{layoutName:`proofkit_auth_password_reset`,schemaName:`passwordReset`,strictNumbers:!0}],clearOldFiles:!0,validator:!1,path:`./src/server/auth/db`},projectDir:n,runCodegen:!1}),await km({project:r,installServerFiles:!0}),Pm(r.addSourceFileAtPath(d.join(n,`src/app/(main)/layout.tsx`))),await Kp(r);let i=!1;for(;!i;)if(i=await Fm(n,t),i)t.text=`Successfully detected all required layouts in your FileMaker file.`;else if(!H(await e.confirm({message:`I have followed the above instructions, continue installing`,initialValue:!0,active:`Continue`,inactive:`Abort`})))throw new hm;await bm(),t.succeed(`Auth installed successfully`)};function Nm(e){if(!e){console.log(c.yellow(`Failed to inject into safe-action-client. Did you move the safe-action.ts file?`));return}e.addImportDeclaration({namedImports:[{name:`getCurrentSession`}],moduleSpecifier:`./auth/utils/session`}),e.addStatements(e=>e.writeLine(`export const authedActionClient = actionClient.use(async ({ next, ctx }) => {
73
67
  const { session, user } = await getCurrentSession();
74
68
  if (session === null) {
75
69
  throw new Error("Unauthorized");
@@ -77,71 +71,70 @@ Please run " ${Re} init" first, or try this command again when inside a ProofKit
77
71
 
78
72
  return next({ ctx: { ...ctx, session, user } });
79
73
  });
80
- `))}function kf(e){e.addImportDeclaration({defaultImport:`Protect`,moduleSpecifier:`@/components/auth/protect`});let t=e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(_.ReturnStatement)?.getFirstDescendantByKind(_.JsxElement);t?.replaceWithText(`<Protect>
74
+ `))}function Pm(e){e.addImportDeclaration({defaultImport:`Protect`,moduleSpecifier:`@/components/auth/protect`});let t=e.getFunction(e=>e.isDefaultExport())?.getBody()?.getFirstDescendantByKind(g.ReturnStatement)?.getFirstDescendantByKind(g.JsxElement);t?.replaceWithText(`<Protect>
81
75
  ${t?.getText()}
82
- </Protect>`)}async function Af(e,t){let n=B(),r=n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===`filemaker`);if(!r)return!1;n.envFile&&ae.config({path:o.join(e,n.envFile)});let i=process.env[r.envNames.apiKey],a=process.env[r.envNames.database],s=process.env[r.envNames.server],c=await Jd({dataApiKey:i,fmFile:a,server:s});return[`proofkit_auth_sessions`,`proofkit_auth_users`,`proofkit_auth_email_verification`,`proofkit_auth_password_reset`].every(e=>c.some(t=>t===e))?!0:(t.warn(`Required layouts not found`),await Cf({addonName:`auth`}),!1)}async function jf({options:e,noInstall:t=!1,projectDir:n=process.cwd()}){let r=B();if(r.ui===`shadcn`)throw Error(`Shadcn projects should add auth using the template registry`);if(r.auth.type!==`none`)throw Error(`Auth already exists`);if(!r.dataSources.some(e=>e.type===`fm`)&&e.type===`fmaddon`)throw Error(`A FileMaker data source is required to use the FM Add-on Auth`);if(!r.dataSources.some(e=>e.type===`fm`)&&e.type===`better-auth`)throw Error(`A FileMaker data source is required to use the Better-Auth`);e.type===`clerk`?await Mf({projectDir:n}):e.type===`fmaddon`&&await Nf(),await Pf(),t||await Id({projectDir:n})}async function Mf({projectDir:e=process.cwd()}){await Gd({projectDir:e}),of({auth:{type:`clerk`}})}async function Nf(){await Df(),of({auth:{type:`fmaddon`}})}async function Pf(){let e=I.projectDir,t=await p(`src/app/(main)/**/actions.ts`,{cwd:e});for(let n of t){let t=o.join(e,n);f(t,d(t,`utf-8`).replace(/actionClient/g,`authedActionClient`))}}const Ff=new a(`--ci`,`Run in CI mode`).default(!1),If=new a(`--debug`,`Run in debug mode`).default(!1),Lf=e=>{let{packages:t}=e;R.info(`Adding boilerplate...`);for(let[n,r]of Object.entries(t))r.inUse&&r.installer(e);R.info(``)};async function Rf(){let e=I.projectDir,t=o.join(v,`template/extras`),n=o.join(t,`_cursor/rules`),r=o.join(e,`.cursor/rules`);if(!c.existsSync(n))return;let i=Nd();await c.ensureDir(r),await c.copy(n,r);let a=o.join(t,`_cursor/conditional-rules`),s={pnpm:`pnpm.mdc`,npm:`npm.mdc`,yarn:`yarn.mdc`}[i];if(s){let e=o.join(a,s),t=o.join(r,`package-manager.mdc`);c.existsSync(e)&&await c.copy(e,t,{overwrite:!0})}}const zf=async({projectName:t,pkgManager:n,noInstall:i})=>{let a=I.projectDir,s=o.join(v,I.appType===`browser`?`template/${I.ui===`mantine`?`nextjs-mantine`:`nextjs-shadcn`}`:`template/vite-wv`);i?R.info(``):R.info(`\nUsing: ${r.cyan.bold(n)}\n`);let l=m(`Scaffolding in: ${a}...\n`).start();if(c.existsSync(a))if(c.readdirSync(a).length===0)t!==`.`&&l.info(`${r.cyan.bold(t)} exists but is empty, continuing...\n`);else{l.stopAndPersist();let n=await e.select({message:`${r.redBright.bold(`Warning:`)} ${r.cyan.bold(t)} already exists and isn't empty. How would you like to proceed?`,options:[{label:`Abort installation (recommended)`,value:`abort`},{label:`Clear the directory and continue installation`,value:`clear`},{label:`Continue installation and overwrite conflicting files`,value:`overwrite`}],initialValue:`abort`});n===`abort`&&(l.fail(`Aborting installation...`),process.exit(1));let i=n===`clear`?`clear the directory`:`overwrite conflicting files`;await e.confirm({message:`Are you sure you want to ${i}?`,initialValue:!1})||(l.fail(`Aborting installation...`),process.exit(1)),n===`clear`&&(l.info(`Emptying ${r.cyan.bold(t)} and creating new ProofKit app..\n`),c.emptyDirSync(a))}l.start(),c.copySync(s,a),Rf(),c.renameSync(o.join(a,`_gitignore`),o.join(a,`.gitignore`));let u=t===`.`?`App`:r.cyan.bold(t);l.succeed(`${u} ${r.green(`scaffolded successfully!`)}\n`)};function Bf(e,t,n){u.readdirSync(e).forEach(r=>{let i=o.join(e,r);if(u.statSync(i).isDirectory())Bf(i,t,n);else{let e=u.readFileSync(i,`utf8`).replace(new RegExp(t,`g`),n);u.writeFileSync(i,e,`utf8`)}})}const Vf=async({projectName:e,scopedAppName:t,packages:n,noInstall:r})=>{let i=Nd();I.projectDir=o.resolve(process.cwd(),e),await zf({projectName:e,pkgManager:i,scopedAppName:t,noInstall:r}),z({dependencies:[`@proofkit/cli`,`@types/node`],devMode:!0});let a=[`@radix-ui/react-slot`,`@tailwindcss/postcss`,`class-variance-authority`,`clsx`,`lucide-react`,`tailwind-merge`,`tailwindcss`,`tw-animate-css`,`next-themes`],s=[`prettier`,`prettier-plugin-tailwindcss`],c=[`@mantine/core`,`@mantine/dates`,`@mantine/hooks`,`@mantine/modals`,`@mantine/notifications`,`mantine-react-table`],l=[`postcss`,`postcss-preset-mantine`,`postcss-simple-vars`];if(I.ui===`mantine`)z({dependencies:c,devMode:!1}),z({dependencies:l,devMode:!0});else if(I.ui===`shadcn`)z({dependencies:a,devMode:!1}),z({dependencies:s,devMode:!0}),z({dependencies:[`zod`],devMode:!1});else throw Error(`Unsupported UI library: ${I.ui}`);return Lf({projectName:e,scopedAppName:t,pkgManager:i,packages:n,noInstall:r}),Bf(I.projectDir,`__PNPM_COMMAND__`,i===`pnpm`?`pnpm`:i===`bun`?`bun`:i===`yarn`?`yarn`:`npm run`),I.projectDir},Hf=e=>{try{return ne(`git --version`,{cwd:e}),!0}catch{return!1}},Uf=e=>c.existsSync(o.join(e,`.git`)),Wf=async e=>{try{return await s(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:e,stdout:`ignore`}),!0}catch{return!1}},Gf=()=>{let e=ne(`git --version`).toString().trim().split(` `)[2],t=e?.split(`.`)[0],n=e?.split(`.`)[1];return{major:Number(t),minor:Number(n)}},Kf=()=>ne(`git config --global init.defaultBranch || echo main`).toString().trim(),qf=async t=>{if(R.info(`Initializing Git...`),!Hf(t)){R.warn(`Git is not installed. Skipping Git initialization.`);return}let n=m(`Creating a new git repo...
83
- `).start(),i=Uf(t),a=await Wf(t),l=o.parse(t).name;if(a&&i){if(n.stop(),!await e.confirm({message:`${r.redBright.bold(`Warning:`)} Git is already initialized in "${l}". Initializing a new git repository would delete the previous history. Would you like to continue anyways?`,initialValue:!1})){n.info(`Skipping Git initialization.`);return}c.removeSync(o.join(t,`.git`))}else if(a&&!i&&(n.stop(),!await e.confirm({message:`${r.redBright.bold(`Warning:`)} "${l}" is already in a git worktree. Would you still like to initialize a new git repository in this directory?`,initialValue:!1}))){n.info(`Skipping Git initialization.`);return}try{let e=Kf(),{major:i,minor:a}=Gf();i<2||i==2&&a<28?(await s(`git`,[`init`],{cwd:t}),await s(`git`,[`symbolic-ref`,`HEAD`,`refs/heads/${e}`],{cwd:t})):await s(`git`,[`init`,`--initial-branch=${e}`],{cwd:t}),await s(`git`,[`add`,`.`],{cwd:t}),await s(`git`,[`commit`,`-m`,`Initial commit`],{cwd:t}),n.succeed(`${r.green(`Successfully initialized and staged`)} ${r.green.bold(`git`)}\n`)}catch{n.fail(`${r.bold.red(`Failed:`)} could not initialize git. Update git to the latest version!\n`)}},Jf=({projectName:e=Ue,noInstall:t})=>{let n=Nd();R.info(r.bold(`Next steps:`)),R.dim(`
84
- Navigate to the project directory:`),e!==`.`&&R.info(` cd ${e}`),R.dim(`(or open in your code editor, and run the rest of these commands from there)`),t&&(R.dim(`
85
- Install dependencies:`),n===`yarn`?R.info(` ${n}`):R.info(` ${n} install`)),R.dim(`
86
- Start the dev server to view your app in a browser:`),[`npm`,`bun`].includes(n)?R.info(` ${n} run dev`):R.info(` ${n} dev`),R.dim(`
87
- Or, run the ProofKit command again to add more to your project:`),[`npm`,`bun`].includes(n)?R.info(` ${n} run proofkit`):R.info(` ${n} proofkit`),R.dim(`(Must be inside the project directory)`)},Yf=(e,t)=>{Bf(e,`~/`,t.replace(/\*/g,``).replace(/[^\/]$/,`$&/`))};async function Xf(e,t){let n=[`shadcn@latest`,`add`,...Array.isArray(e)?e:[e]];try{await s(`pnpm`,[`dlx`,...n],{stdio:`inherit`,cwd:I.projectDir??process.cwd()})}catch(e){throw R.error(`Failed to run shadcn add: ${e}`),e}}function Zf(){let e;try{e=B().registryUrl??We}catch{e=We}return e.endsWith(`/`)?e.slice(0,-1):e}function Qf(){let e=o.join(I.projectDir,`components.json`);return JSON.parse(u.readFileSync(e,`utf8`))}const $f={parser:`@typescript-eslint/parser`,parserOptions:{project:!0},plugins:[`@typescript-eslint`],extends:[`next/core-web-vitals`,`plugin:@typescript-eslint/recommended-type-checked`,`plugin:@typescript-eslint/stylistic-type-checked`],rules:{"@typescript-eslint/array-type":`off`,"@typescript-eslint/consistent-type-definitions":`off`,"@typescript-eslint/consistent-type-imports":[`warn`,{prefer:`type-imports`,fixStyle:`inline-type-imports`}],"@typescript-eslint/no-unused-vars":[`warn`,{argsIgnorePattern:`^_`}],"@typescript-eslint/require-await":`off`,"@typescript-eslint/no-explicit-any":`warn`,"@typescript-eslint/no-misused-promises":[`error`,{checksVoidReturn:{attributes:!1}}],"@typescript-eslint/no-floating-promises":`warn`}},ep=()=>{let e=[`/** @type {import("eslint").Linter.Config} */`,`const config = ${JSON.stringify($f,null,2)}`,`module.exports = config;`].join(`
88
- `),t=o.join(I.projectDir,`.eslintrc.cjs`);c.writeFileSync(t,e,`utf-8`)},tp=()=>({envVariables:{inUse:!0,installer:Rd},eslint:{inUse:!0,installer:ep}});async function np(){let e=B(),t=e.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===`filemaker`);if(!t)return!1;e.envFile&&ae.config({path:o.join(I.projectDir,e.envFile)});let n=process.env[t.envNames.apiKey],i=process.env[t.envNames.database],a=process.env[t.envNames.server],s=await Jd({dataApiKey:n,fmFile:i,server:a});return[`ProofKitWV`].every(e=>s.some(t=>t===e))?(console.log(r.green(`Successfully detected all required layouts for ProofKit WebViewer in your FileMaker file.`)),!0):(await Cf({addonName:`wv`}),!1)}async function rp(){let t=!1;for(;!t;)if(t=await np(),!t&&!V(await e.confirm({message:`I have followed the above instructions, continue installing`,initialValue:!0,active:`Continue`,inactive:`Abort`})))throw new uf}const ip=e=>(e.length>1&&e.endsWith(`/`)&&(e=e.slice(0,-1)),e),ap=e=>{let t=ip(e).split(`/`),n=t[t.length-1];if(n===`.`){let e=o.resolve(process.cwd());n=o.basename(e)}let r=t.findIndex(e=>e.startsWith(`@`));t.findIndex(e=>e.startsWith(`@`))!==-1&&(n=t.slice(r).join(`/`));let i=t.filter(e=>!e.startsWith(`@`)).join(`/`);return[n,i]},op=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,sp=e=>{let t=ip(e),n=t.split(`/`),r=n.findIndex(e=>e.startsWith(`@`)),i=n[n.length-1];if(n.findIndex(e=>e.startsWith(`@`))!==-1&&(i=n.slice(r).join(`/`)),!(t===`.`||op.test(i??``)))return`Name must consist of only lowercase alphanumeric characters, '-', and '_'`};async function cp({url:t}){let n=be.generate({length:18,charset:`alphanumeric`}),i=new URL(`/otto/wizard/${n}`,t.origin),a=i.toString();e.log.info(`${r.bold(`If the browser window didn't open automatically, please open the following link to login into your OttoFMS server:`)}\n\n${r.cyan(a)}`),ye(i.toString());let o=e.spinner();o.start(`Waiting for you to log in using the link above`);let s=await new Promise(e=>{let r=setInterval(()=>{_e.get(`${t.origin}/otto/api/cli/checkHash/${n}`,{headers:{"Accept-Encoding":`deflate`}}).then(a=>{e(a.data.response),clearTimeout(i),clearInterval(r),_e.delete(`${t.origin}/otto/api/cli/checkHash/${n}`,{headers:{"Accept-Encoding":`deflate`}})}).catch(()=>{})},500),i=setTimeout(()=>{clearInterval(r),o.stop(`Login timed out. No worries - it happens to the best of us.`)},18e4)});return o.stop(`Login complete.`),s}async function lp({url:e,token:t}){return(await _e.get(`${e.origin}/otto/fmi/admin/api/v2/databases`,{headers:{Authorization:`Bearer ${t}`}})).data.response.databases}async function up({url:e,token:t}){return(await _e.get(`${e.origin}/otto/api/api-key`,{headers:{Authorization:`Bearer ${t}`}})).data.response[`api-keys`]}async function dp({url:t,filename:n}){for(e.log.info(`${r.cyan(`Creating a Data API Key`)}\nEnter FileMaker credentials for ${r.bold(n)}.\n${r.dim(`The account must have the fmrest extended privilege enabled.`)}`);;){let i=V(await e.text({message:`Enter the account name for ${r.bold(n)}`})),a=V(await e.password({message:`Enter the password for ${r.bold(i)}`}));try{return await fp({url:t,filename:n,username:i,password:a})}catch(n){if(!(n instanceof ve))e.log.error(`${r.red(`Error creating Data API key:`)} Unknown error`);else{let i=n.response?.data&&`messages`in n.response.data?n.response.data.messages?.[0]?.text:void 0;e.log.error(`${r.red(`Error creating Data API key:`)} ${i??`Error code ${n.response?.status}`}
89
- ${r.dim(n.response?.status===400&&`Common reasons this might happen:
76
+ </Protect>`)}async function Fm(e,t){let n=V(),r=n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===`filemaker`);if(!r)return!1;n.envFile&&le.config({path:d.join(e,n.envFile)});let i=process.env[r.envNames.apiKey],a=process.env[r.envNames.database],o=process.env[r.envNames.server];if(!(i&&a&&o))return!1;let s=await em({dataApiKey:i,fmFile:a,server:o});return[`proofkit_auth_sessions`,`proofkit_auth_users`,`proofkit_auth_email_verification`,`proofkit_auth_password_reset`].every(e=>s.some(t=>t===e))?!0:(t.warn(`Required layouts not found`),await Om({addonName:`auth`}),!1)}async function Im({options:e,noInstall:t=!1,projectDir:n=process.cwd()}){let r=V();if(r.ui===`shadcn`)throw Error(`Shadcn projects should add auth using the template registry`);if(r.auth.type!==`none`)throw Error(`Auth already exists`);if(!r.dataSources.some(e=>e.type===`fm`)&&e.type===`fmaddon`)throw Error(`A FileMaker data source is required to use the FM Add-on Auth`);if(!r.dataSources.some(e=>e.type===`fm`)&&e.type===`better-auth`)throw Error(`A FileMaker data source is required to use the Better-Auth`);e.type===`clerk`?await Lm({projectDir:n}):e.type===`fmaddon`&&await Rm(),await zm(),t||await Hp({projectDir:n})}async function Lm({projectDir:e=process.cwd()}){await Zp({projectDir:e}),dm({auth:{type:`clerk`}})}async function Rm(){await Mm(),dm({auth:{type:`fmaddon`}})}async function zm(){let e=L.projectDir,t=await ne(`src/app/(main)/**/actions.ts`,{cwd:e});for(let n of t){let t=d.join(e,n);te(t,ee(t,`utf-8`).replace(/actionClient/g,`authedActionClient`))}}const Bm=new u(`--ci`,`Run in CI mode`).default(!1),Vm=new u(`--debug`,`Run in debug mode`).default(!1),Hm=e=>{let{packages:t}=e;z.info(`Adding boilerplate...`);for(let[n,r]of Object.entries(t))r.inUse&&r.installer(e);z.info(``)};async function Um(){let e=L.projectDir,t=d.join(_,`template/extras`),n=d.join(t,`_cursor/rules`),r=d.join(e,`.cursor/rules`);if(!p.existsSync(n))return;let i=zp();await p.ensureDir(r),await p.copy(n,r);let a=d.join(t,`_cursor/conditional-rules`),o={pnpm:`pnpm.mdc`,npm:`npm.mdc`,yarn:`yarn.mdc`}[i];if(o){let e=d.join(a,o),t=d.join(r,`package-manager.mdc`);p.existsSync(e)&&await p.copy(e,t,{overwrite:!0})}}const Wm=async({projectName:t,pkgManager:n,noInstall:r})=>{let i=L.projectDir,a=d.join(_,L.appType===`browser`?`template/${L.ui===`mantine`?`nextjs-mantine`:`nextjs-shadcn`}`:`template/vite-wv`);r?z.info(``):z.info(`\nUsing: ${c.cyan.bold(n)}\n`);let o=re(`Scaffolding in: ${i}...\n`).start();if(p.existsSync(i))if(p.readdirSync(i).length===0)t!==`.`&&o.info(`${c.cyan.bold(t)} exists but is empty, continuing...\n`);else{o.stopAndPersist();let n=await e.select({message:`${c.redBright.bold(`Warning:`)} ${c.cyan.bold(t)} already exists and isn't empty. How would you like to proceed?`,options:[{label:`Abort installation (recommended)`,value:`abort`},{label:`Clear the directory and continue installation`,value:`clear`},{label:`Continue installation and overwrite conflicting files`,value:`overwrite`}],initialValue:`abort`});n===`abort`&&(o.fail(`Aborting installation...`),process.exit(1));let r=n===`clear`?`clear the directory`:`overwrite conflicting files`;await e.confirm({message:`Are you sure you want to ${r}?`,initialValue:!1})||(o.fail(`Aborting installation...`),process.exit(1)),n===`clear`&&(o.info(`Emptying ${c.cyan.bold(t)} and creating new ProofKit app..\n`),p.emptyDirSync(i))}o.start(),p.copySync(a,i),Um(),p.renameSync(d.join(i,`_gitignore`),d.join(i,`.gitignore`));let s=t===`.`?`App`:c.cyan.bold(t);o.succeed(`${s} ${c.green(`scaffolded successfully!`)}\n`)};function Gm(e,t,n){let r=h.readdirSync(e);for(let i of r){let r=d.join(e,i);if(h.statSync(r).isDirectory())Gm(r,t,n);else{let e=h.readFileSync(r,`utf8`).replace(new RegExp(t,`g`),n);h.writeFileSync(r,e,`utf8`)}}}const Km=async({projectName:e,scopedAppName:t,packages:n,noInstall:r})=>{let i=zp();L.projectDir=d.resolve(process.cwd(),e),await Wm({projectName:e,pkgManager:i,scopedAppName:t,noInstall:r}),B({dependencies:[`@proofkit/cli`,`@types/node`],devMode:!0});let a=[`@radix-ui/react-slot`,`@tailwindcss/postcss`,`class-variance-authority`,`clsx`,`lucide-react`,`tailwind-merge`,`tailwindcss`,`tw-animate-css`,`next-themes`],o=[],s=[`@mantine/core`,`@mantine/dates`,`@mantine/hooks`,`@mantine/modals`,`@mantine/notifications`,`mantine-react-table`],c=[`postcss`,`postcss-preset-mantine`,`postcss-simple-vars`];if(L.ui===`mantine`)B({dependencies:s,devMode:!1}),B({dependencies:c,devMode:!0});else if(L.ui===`shadcn`)B({dependencies:a,devMode:!1}),B({dependencies:o,devMode:!0}),B({dependencies:[`zod`],devMode:!1});else throw Error(`Unsupported UI library: ${L.ui}`);Hm({projectName:e,scopedAppName:t,pkgManager:i,packages:n,noInstall:r});let l;return l=i===`pnpm`?`pnpm`:i===`bun`?`bun`:i===`yarn`?`yarn`:`npm run`,Gm(L.projectDir,`__PNPM_COMMAND__`,l),L.projectDir},qm=e=>{try{return ce(`git --version`,{cwd:e}),!0}catch{return!1}},Jm=e=>p.existsSync(d.join(e,`.git`)),Ym=async e=>{try{return await f(`git`,[`rev-parse`,`--is-inside-work-tree`],{cwd:e,stdout:`ignore`}),!0}catch{return!1}},Xm=()=>{let e=ce(`git --version`).toString().trim().split(` `)[2],t=e?.split(`.`)[0],n=e?.split(`.`)[1];return{major:Number(t),minor:Number(n)}},Zm=()=>ce(`git config --global init.defaultBranch || echo main`).toString().trim(),Qm=async t=>{if(z.info(`Initializing Git...`),!qm(t)){z.warn(`Git is not installed. Skipping Git initialization.`);return}let n=re(`Creating a new git repo...
77
+ `).start(),r=Jm(t),i=await Ym(t),a=d.parse(t).name;if(i&&r){if(n.stop(),!await e.confirm({message:`${c.redBright.bold(`Warning:`)} Git is already initialized in "${a}". Initializing a new git repository would delete the previous history. Would you like to continue anyways?`,initialValue:!1})){n.info(`Skipping Git initialization.`);return}p.removeSync(d.join(t,`.git`))}else if(i&&!r&&(n.stop(),!await e.confirm({message:`${c.redBright.bold(`Warning:`)} "${a}" is already in a git worktree. Would you still like to initialize a new git repository in this directory?`,initialValue:!1}))){n.info(`Skipping Git initialization.`);return}try{let e=Zm(),{major:r,minor:i}=Xm();r<2||r===2&&i<28?(await f(`git`,[`init`],{cwd:t}),await f(`git`,[`symbolic-ref`,`HEAD`,`refs/heads/${e}`],{cwd:t})):await f(`git`,[`init`,`--initial-branch=${e}`],{cwd:t}),await f(`git`,[`add`,`.`],{cwd:t}),await f(`git`,[`commit`,`-m`,`Initial commit`],{cwd:t}),n.succeed(`${c.green(`Successfully initialized and staged`)} ${c.green.bold(`git`)}\n`)}catch{n.fail(`${c.bold.red(`Failed:`)} could not initialize git. Update git to the latest version!\n`)}},$m=({projectName:e=qe,noInstall:t})=>{let n=zp();z.info(c.bold(`Next steps:`)),z.dim(`
78
+ Navigate to the project directory:`),e!==`.`&&z.info(` cd ${e}`),z.dim(`(or open in your code editor, and run the rest of these commands from there)`),t&&(z.dim(`
79
+ Install dependencies:`),n===`yarn`?z.info(` ${n}`):z.info(` ${n} install`)),z.dim(`
80
+ Start the dev server to view your app in a browser:`),[`npm`,`bun`].includes(n)?z.info(` ${n} run dev`):z.info(` ${n} dev`),z.dim(`
81
+ Or, run the ProofKit command again to add more to your project:`),[`npm`,`bun`].includes(n)?z.info(` ${n} run proofkit`):z.info(` ${n} proofkit`),z.dim(`(Must be inside the project directory)`)},eh=/[^/]$/,th=(e,t)=>{Gm(e,`~/`,t.replace(/\*/g,``).replace(eh,`$&/`))};async function nh(e,t){let n=[`shadcn@latest`,`add`,...Array.isArray(e)?e:[e]];try{await f(`pnpm`,[`dlx`,...n],{stdio:`inherit`,cwd:L.projectDir??process.cwd()})}catch(e){throw z.error(`Failed to run shadcn add: ${e}`),e}}function rh(){let e;try{e=V().registryUrl??Je}catch{e=Je}return e.endsWith(`/`)?e.slice(0,-1):e}function ih(){let e=d.join(L.projectDir,`components.json`);return JSON.parse(h.readFileSync(e,`utf8`))}const ah=()=>({envVariables:{inUse:!0,installer:Wp}});async function oh(){let e=V(),t=e.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===`filemaker`);if(!t)return!1;e.envFile&&le.config({path:d.join(L.projectDir,e.envFile)});let n=process.env[t.envNames.apiKey],r=process.env[t.envNames.database],i=process.env[t.envNames.server];if(!(n&&r&&i))return!1;let a=await em({dataApiKey:n,fmFile:r,server:i});return[`ProofKitWV`].every(e=>a.some(t=>t===e))?(console.log(c.green(`Successfully detected all required layouts for ProofKit WebViewer in your FileMaker file.`)),!0):(await Om({addonName:`wv`}),!1)}async function sh(){let t=!1;for(;!t;)if(t=await oh(),!t&&!H(await e.confirm({message:`I have followed the above instructions, continue installing`,initialValue:!0,active:`Continue`,inactive:`Abort`})))throw new hm}const ch=e=>e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e,lh=e=>{let t=ch(e).split(`/`),n=t.at(-1)??``;if(n===`.`){let e=d.resolve(process.cwd());n=d.basename(e)}let r=t.findIndex(e=>e.startsWith(`@`));t.findIndex(e=>e.startsWith(`@`))!==-1&&(n=t.slice(r).join(`/`));let i=t.filter(e=>!e.startsWith(`@`)).join(`/`);return[n,i]},uh=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,dh=e=>{let t=ch(e),n=t.split(`/`),r=n.findIndex(e=>e.startsWith(`@`)),i=n.at(-1);if(n.findIndex(e=>e.startsWith(`@`))!==-1&&(i=n.slice(r).join(`/`)),!(t===`.`||uh.test(i??``)))return`Name must consist of only lowercase alphanumeric characters, '-', and '_'`};async function fh({url:t}){let n=we.generate({length:18,charset:`alphanumeric`}),r=new URL(`/otto/wizard/${n}`,t.origin),i=r.toString();e.log.info(`${c.bold(`If the browser window didn't open automatically, please open the following link to login into your OttoFMS server:`)}\n\n${c.cyan(i)}`),Ce(r.toString()).catch(()=>{});let a=e.spinner();a.start(`Waiting for you to log in using the link above`);let o=await new Promise(e=>{let r=setInterval(()=>{xe.get(`${t.origin}/otto/api/cli/checkHash/${n}`,{headers:{"Accept-Encoding":`deflate`}}).then(a=>{e(a.data.response),clearTimeout(i),clearInterval(r),xe.delete(`${t.origin}/otto/api/cli/checkHash/${n}`,{headers:{"Accept-Encoding":`deflate`}}).catch(()=>{})}).catch(()=>{})},500),i=setTimeout(()=>{clearInterval(r),a.stop(`Login timed out. No worries - it happens to the best of us.`)},18e4)});return a.stop(`Login complete.`),o}async function ph({url:e,token:t}){return(await xe.get(`${e.origin}/otto/fmi/admin/api/v2/databases`,{headers:{Authorization:`Bearer ${t}`}})).data.response.databases}async function mh({url:e,token:t}){return(await xe.get(`${e.origin}/otto/api/api-key`,{headers:{Authorization:`Bearer ${t}`}})).data.response[`api-keys`]}async function hh({url:t,filename:n}){for(e.log.info(`${c.cyan(`Creating a Data API Key`)}\nEnter FileMaker credentials for ${c.bold(n)}.\n${c.dim(`The account must have the fmrest extended privilege enabled.`)}`);;){let r=H(await e.text({message:`Enter the account name for ${c.bold(n)}`})),i=H(await e.password({message:`Enter the password for ${c.bold(r)}`}));try{return await gh({url:t,filename:n,username:r,password:i})}catch(n){if(n instanceof Se){let r=n.response?.data&&`messages`in n.response.data?n.response.data.messages?.[0]?.text:void 0;e.log.error(`${c.red(`Error creating Data API key:`)} ${r??`Error code ${n.response?.status}`}
82
+ ${c.dim(n.response?.status===400&&`Common reasons this might happen:
90
83
  - The provided credentials are incorrect.
91
84
  - The account does not have the fmrest extended privilege enabled.
92
85
 
93
86
  You may also want to try to create an API directly in the OttoFMS dashboard:
94
87
  ${t.origin}/otto/app/api-keys`)}
95
- `)}if(!V(await e.confirm({message:`Do you want to try and enter credentials again?`,active:`Yes, try again`,inactive:`No, abort`})))throw Error(`User cancelled`)}}}async function fp({url:e,filename:t,username:n,password:r}){return{apiKey:(await _e.post(`${e.origin}/otto/api/api-key/create-only`,{database:t,label:`For FM Web App`,user:n,pass:r})).data.response.key}}async function pp({payload:e,url:t,token:n}){let r=N({response:N({started:Hl(),batchId:Pl(),subDeploymentIds:du(Pl())}),messages:du(N({code:Pl(),text:j()}))}),i=await _e.post(`${t.origin}/otto/api/deployment`,e,{headers:{Authorization:`Bearer ${n}`}}).catch(e=>{throw console.error(e.response.data),e});return r.parse(i.data)}async function mp({url:e,token:t,deploymentId:n}){let r=N({response:N({id:Pl(),status:P([`queued`,`running`,`scheduled`,`complete`,`aborted`,`unknown`]),running:Od(),created_at:j(),started_at:j(),updated_at:j()}),messages:du(N({code:Pl(),text:j()}))}),i=await _e.get(`${e.origin}/otto/api/deployment/${n}`,{headers:{Authorization:`Bearer ${t}`}});return r.parse(i.data)}const hp=()=>{};function gp(e,t,n){return new Proxy(hp,{get(n,r){if(!(typeof r!=`string`||r===`then`))return gp(e,[...t,r])},apply(n,r,i){let a=t[t.length-1],o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),e(o)}})}const _p=e=>gp(e,[]);function vp(e,...t){let n=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in n&&n[t]!==e[t])throw Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function yp(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function bp(e){return typeof e==`function`}function xp(e){return Object.assign(Object.create(null),e)}var Sp=class extends Error{};function Cp(e){if(e instanceof Error)return e;let t=typeof e;if(!(t===`undefined`||t===`function`||e===null)){if(t!==`object`)return Error(String(e));if(yp(e)){let t=new Sp;for(let n in e)t[n]=e[n];return t}}}function wp(e){if(e instanceof Tp||e instanceof Error&&e.name===`TRPCError`)return e;let t=new Tp({code:`INTERNAL_SERVER_ERROR`,cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}var Tp=class extends Error{constructor(e){let t=Cp(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),this.code=e.code,this.name=`TRPCError`,this.cause||=t}};function Ep(e){return`input`in e?e:{input:e,output:e}}const Dp={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},Op=({shape:e})=>e,kp=`middlewareMarker`;function Ap(){function e(t){return{_middlewares:t,unstable_pipe(n){let r=`_middlewares`in n?n._middlewares:[n];return e([...t,...r])}}}function t(t){return e([t])}return t}function jp(e){let t=async function(t){let n,r=await t.getRawInput();try{n=await e(r)}catch(e){throw new Tp({code:`BAD_REQUEST`,cause:e})}let i=yp(t.input)&&yp(n)?{...t.input,...n}:n;return t.next({input:i})};return t._type=`input`,t}function Mp(e){let t=async function({next:t}){let n=await t();if(!n.ok)return n;try{let t=await e(n.data);return{...n,data:t}}catch(e){throw new Tp({message:`Output validation failed`,code:`INTERNAL_SERVER_ERROR`,cause:e})}};return t._type=`output`,t}function Np(e){let t=e;if(typeof t==`function`)return t;if(typeof t.parseAsync==`function`)return t.parseAsync.bind(t);if(typeof t.parse==`function`)return t.parse.bind(t);if(typeof t.validateSync==`function`)return t.validateSync.bind(t);if(typeof t.create==`function`)return t.create.bind(t);if(typeof t.assert==`function`)return e=>(t.assert(e),e);throw Error(`Could not find a validator fn`)}function Pp(e,t){let{middlewares:n=[],inputs:r,meta:i,...a}=t;return Fp({...vp(e,a),inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&i?{...e.meta,...i}:i??e.meta})}function Fp(e={}){let t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){let n=Np(e);return Pp(t,{inputs:[e],middlewares:[jp(n)]})},output(e){return Pp(t,{output:e,middlewares:[Mp(Np(e))]})},meta(e){return Pp(t,{meta:e})},use(e){return Pp(t,{middlewares:`_middlewares`in e?e._middlewares:[e]})},unstable_concat(e){return Pp(t,e._def)},query(e){return Ip({...t,type:`query`},e)},mutation(e){return Ip({...t,type:`mutation`},e)},subscription(e){return Ip({...t,type:`subscription`},e)},experimental_caller(e){return Pp(t,{caller:e})}}}function Ip(e,t){let n=Pp(e,{resolver:t,middlewares:[async function(e){return{marker:kp,ok:!0,data:await t(e),ctx:e.ctx}}]}),r={...n._def,type:e.type,experimental_caller:!!n._def.caller,meta:n._def.meta,$types:null},i=Lp(n._def),a=n._def.caller;if(!a)return i;let o=async(...e)=>await a({args:e,invoke:i,_def:r});return o._def=r,o}function Lp(e){async function t(t){if(!t||!(`getRawInput`in t))throw Error(`This is a client-only function.
96
- If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls`);async function n(r={index:0,ctx:t.ctx}){try{let i=e.middlewares[r.index];return await i({ctx:r.ctx,type:t.type,path:t.path,getRawInput:r.getRawInput??t.getRawInput,meta:e.meta,input:r.input,next(e){let t=e;return n({index:r.index+1,ctx:t&&`ctx`in t?{...r.ctx,...t.ctx}:r.ctx,input:t&&`input`in t?t.input:r.input,getRawInput:t&&`getRawInput`in t?t.getRawInput:r.getRawInput})}})}catch(e){return{ok:!1,error:wp(e),marker:kp}}}let r=await n();if(!r)throw new Tp({code:`INTERNAL_SERVER_ERROR`,message:"No result from middlewares - did you forget to `return next()`?"});if(!r.ok)throw r.error;return r.data}return t._def=e,t}const Rp=typeof window>`u`||`Deno`in window||globalThis.process?.env?.NODE_ENV===`test`||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;function zp(e){return e._def&&`router`in e._def}const Bp={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Op,transformer:Dp},Vp=[`then`,`call`,`apply`];function Hp(e){function t(t){let n=new Set(Object.keys(t).filter(e=>Vp.includes(e)));if(n.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(n).join(`, `));let r=xp({});function i(e,t=[]){let n=xp({});for(let[a,o]of Object.entries(e??{})){if(zp(o)){n[a]=i(o._def.record,[...t,a]);continue}if(!Up(o)){n[a]=i(o,[...t,a]);continue}let e=[...t,a].join(`.`);if(r[e])throw Error(`Duplicate key: ${e}`);r[e]=o,n[a]=o}return n}let a=i(t),o={_config:e,router:!0,procedures:r,...Bp,record:a};return{...a,_def:o,createCaller:Wp()({_def:o})}}return t}function Up(e){return typeof e==`function`}function Wp(){return function(e){let t=e._def;return function(e,n){return _p(async({path:r,args:i})=>{let a=r.join(`.`);if(r.length===1&&r[0]===`_def`)return t;let o=t.procedures[a],s;try{return s=bp(e)?await Promise.resolve(e()):e,await o({path:a,getRawInput:async()=>i[0],ctx:s,type:o._def.type})}catch(e){throw n?.onError?.({ctx:s,error:wp(e),input:i[0],path:a,type:o._def.type}),e}})}}}function Gp(...e){let t=vp({},...e.map(e=>e._def.record));return Hp({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==Op){if(e!==Op&&e!==t._def._config.errorFormatter)throw Error(`You seem to have several error formatters`);return t._def._config.errorFormatter}return e},Op),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==Dp){if(e!==Dp&&e!==t._def._config.transformer)throw Error(`You seem to have several transformers`);return t._def._config.transformer}return e},Dp),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}new class e{context(){return new e}meta(){return new e}create(e){let t={transformer:Ep(e?.transformer??Dp),isDev:e?.isDev??globalThis.process?.env.NODE_ENV!==`production`,allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??Op,isServer:e?.isServer??Rp,$types:null,experimental:e?.experimental??{}};if(!(e?.isServer??Rp)&&e?.allowOutsideOfServer!==!0)throw Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`);return{_config:t,procedure:Fp({meta:e?.defaultMeta}),middleware:Ap(),router:Hp(t),mergeRouters:Gp,createCallerFactory:Wp()}}};async function Kp({url:e,ottoPort:t=3030}){return{fmsInfo:await Jp(e),ottoInfo:await Zp({url:e,ottoPort:t})}}const qp=F.object({data:F.object({APIVersion:F.number().optional(),AcceptEARPassword:F.boolean().optional(),AcceptEncrypted:F.boolean().optional(),AcceptUnencrypted:F.boolean().optional(),AdminLocalAuth:F.string().optional(),AllowChangeUploadDBFolder:F.boolean().optional(),AutoOpenForUpload:F.boolean().optional(),DenyGuestAndAutoLogin:F.string().optional(),Hostname:F.string().optional(),IsAppleInternal:F.boolean().optional(),IsETS:F.boolean().optional(),PremisesType:F.string().optional(),ProductVersion:F.string().optional(),PublicKey:F.string().optional(),RequiresDBPasswords:F.boolean().optional(),ServerID:F.string().optional(),ServerVersion:F.string()}),result:F.number()});async function Jp(e){let t=new URL(e);t.pathname=`/fmws/serverinfo`;let n=await em(t.toString()).then(e=>qp.safeParse(e.data));if(!n.success)throw console.error(`fmsInfoResult.error`,n.error.issues),new Tp({code:`BAD_REQUEST`,message:`Invalid FileMaker Server URL`});return n.data.data}const Yp=F.object({Otto:F.object({version:F.string(),serverNickname:F.string().default(``),isLicenseValid:F.boolean().optional()}),migratorVersion:F.string().optional(),FileMakerServer:F.object({version:F.object({long:F.string(),short:F.string()}),running:F.boolean().optional()}),isMac:F.boolean().optional(),platform:F.string().optional(),host:F.string().optional()}),Xp=F.object({response:Yp});async function Zp({url:e,ottoPort:t=3030}){let n=await Qp(e);return n||=await $p(e,t),n}async function Qp(e){try{let t=new URL(e);return t.pathname=`/otto/api/info`,await em(t.toString()).then(e=>Xp.parse(e.data).response)}catch{return console.log(`unable to fetch otto4 info, trying otto3`),null}}async function $p(e,t){try{let n=new URL(e);return n.port=t?t.toString():`3030`,n.pathname=`/api/otto/info`,await em(n.toString()).then(e=>Yp.parse(e.data))}catch(e){return e instanceof Error&&console.error(`otto3 fetch error`,e.message),null}}async function em(e){let t=new xe.Agent({rejectUnauthorized:!1});return await _e.get(e,{validateStatus:null,headers:{Connection:`close`},httpsAgent:t,timeout:1e4})}const tm=async t=>{let n=B(),i=I.projectDir,a=t?.sourceName;if(a)a=t?.sourceName;else if(n.dataSources.filter(e=>e.type===`fm`).length>1){let t=await e.select({message:`Which FileMaker data source do you want to add a layout to?`,options:n.dataSources.filter(e=>e.type===`fm`).map(e=>({label:e.name,value:e.name}))});e.isCancel(t)&&(e.cancel(),process.exit(0)),a=j().parse(t)}a||=`filemaker`;let s=n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===a);if(!s)throw Error(`FileMaker data source ${a} not found in your ProofKit config`);let c=e.spinner();c.start(`Loading layouts from your FileMaker file...`),n.envFile&&ae.config({path:o.join(i,n.envFile)});let l=process.env[s.envNames.apiKey],u=process.env[s.envNames.database],d=process.env[s.envNames.server],f=await Jd({dataApiKey:l,fmFile:u,server:d}),p=_f({projectDir:i,dataSourceName:a}),m=p.map(e=>e.layout).filter(Boolean),h=p.map(e=>e.schemaName).filter(Boolean);c.stop(`Loaded layouts from your FileMaker file`),m.length>0&&e.note(m.join(`
97
- `),`Detected existing layouts in your project`),m.push(`-`);let g=t?.layoutName;(g===``||!f.includes(g??``))&&(g=void 0);let ee=g??V(await e.select({message:`Select a new layout to read data from`,maxItems:10,options:f.filter(e=>!m.includes(e)).map(e=>({label:e,value:e}))})),_=rm(ee),te=t?.schemaName||V(await e.text({message:`Enter a friendly name for the new schema.\n${r.dim(`This will the name by which you refer to this layout in your codebase`)}`,defaultValue:_,placeholder:_,validate:e=>{if(e!==``){if(!/^[a-zA-Z_$][a-zA-Z_$0-9]*$/.test(e))return`Name must consist of only alphanumeric characters, '_', and must not start with a number`;if(h.includes(e))return`Schema name must be unique`}}})).toString(),ne=t?.valueLists??await e.select({message:`Should we use value lists on this layout?\n${r.dim(`This will allow fields that contain a value list to be auto-completed in typescript and also validated to prevent incorrect values`)}`,options:[{label:`Yes, but allow empty fields`,value:`allowEmpty`,hint:`Empty fields or values that don't match the value list will be converted to an empty string`},{label:`Yes; empty values should fail validation`,value:`strict`,hint:`Empty fields or values that don't match the value list will cause validation to fail`},{label:`No, ignore value lists`,value:`ignore`,hint:`Fields will just be typed as strings`}]}),re=P([`ignore`,`allowEmpty`,`strict`]).catch(`ignore`).parse(ne);await pf({runCodegen:!0,projectDir:i,dataSourceName:a,schemas:[{layoutName:ee,schemaName:te,valueLists:re}]}),e.outro(`Layout "${ee}" added to your project as "${te}"`)},nm=()=>new i(`layout`).alias(`schema`).description(`Add a new layout to your fmschema file`).action(async e=>{let t=e.settings;await tm({settings:t})});function rm(e){let t=e.replace(/[-\s]/g,`_`);for(let e of Xd)t.startsWith(e)&&(t=t.replace(e,``));return t}const im=`ProofKitDemo.fmp12`;async function am({url:t,token:n,operation:r}){let i={scheduled:!1,label:`Install ProofKit Demo`,deployments:[{name:`Install ProofKit Demo`,source:{type:`url`,url:`https://proofkit.dev/proofkit-demo/manifest.json`},fileOperations:[{target:{fileName:im},operation:r,source:{fileName:`ProofKitDemo.fmp12`},location:{folder:`default`,subFolder:``}}],concurrency:1,options:{closeFilesAfterBuild:!1,keepFilesClosedAfterComplete:!1,transferContainerData:!1}}],abortRemaining:!1},a=e.spinner();a.start(`Deploying ProofKit Demo file...`);let{response:{subDeploymentIds:o}}=await pp({payload:i,url:t,token:n}),s=o[0];for(;;){await new Promise(e=>setTimeout(e,2500));let{response:{status:e,running:r}}=await mp({url:t,token:n,deploymentId:s});if(!r){if(e!==`complete`)throw Error(`Deployment didn't complete`);break}}let{apiKey:c}=await fp({filename:im,username:`admin`,password:`admin`,url:t});return a.stop(),{apiKey:c}}async function om({projectDir:t,...n}){let i=B(),a=i.dataSources.filter(e=>e.type===`fm`).map(e=>e.name),o=await sm(n.server);if(!(o.ottoVersion&&o.ottoVersion.compare(new ge(`4.7.0`))>0)&&!n.adminApiKey)return e.cancel(`OttoFMS 4.7.0 or later is required to auto-login with this CLI. Please install/upgrade OttoFMS on your server, or pass an Admin API key with the --adminApiKey flag then try again`);let s=n.adminApiKey||(await cp({url:o.url})).token,c=await lp({url:o.url,token:s}),l=c.map(e=>e.filename.replace(`.fmp12`,``)).includes(im.replace(`.fmp12`,``)),u=n.fileName;for(;(u=n.fileName||V(await e.select({message:`Which file would you like to connect to? ${r.dim(`(TIP: Select the file where your data is stored)`)}`,maxItems:10,options:[{value:`$deployDemoFile`,label:`Deploy NEW ProofKit Demo File`,hint:`Use OttoFMS to deploy a new file for testing`},...c.sort((e,t)=>e.filename.localeCompare(t.filename)).map(e=>({value:e.filename,label:e.filename}))]})),u===`$deployDemoFile`)&&l&&!V(await e.confirm({message:`The demo file already exists, do you want to replace it with a fresh copy?`,active:`Yes, replace`,inactive:`No, select another file`,initialValue:!1})););if(!u)throw Error(`No file selected`);let d=n.dataApiKey;if(u===`$deployDemoFile`){let{apiKey:e}=await am({url:o.url,token:s,operation:l?`replace`:`install`});d=e,u=im,n.layoutName=n.layoutName??`API_Contacts`,n.schemaName=n.schemaName??`Contacts`}else{let t=(await up({url:o.url,token:s})).filter(e=>e.database===u);if(!d&&t.length>0){let n=V(await e.select({message:`Which OttoFMS Data API key would you like to use? ${r.dim(`(This determines the access that you'll have to the data in this file)`)}`,options:[...t.map(e=>({value:e.key,label:`${r.bold(e.label)} - ${e.user}`,hint:`${e.key.slice(0,5)}...${e.key.slice(-4)}`})),{value:`create`,label:`Create a new API key`,hint:`Requires FileMaker credentials for this file`}]}));if(typeof n!=`string`)throw Error(`Invalid key`);n!==`create`&&(d=n)}d||=(await dp({filename:u,url:o.url})).apiKey}if(!d)throw Error(`No API key`);let f=a.length===0?`filemaker`:n.name??V(await e.text({message:`What do you want to call this data source?`,validate:e=>e===`filemaker`?`That name is reserved`:a?.includes(e)?`That name is already in use in this project, pick something unique`:sp(e)})),p={type:`fm`,name:f,envNames:f===`filemaker`?{database:`FM_DATABASE`,server:`FM_SERVER`,apiKey:`OTTO_API_KEY`}:{database:`${f.toUpperCase()}_FM_DATABASE`,server:`${f.toUpperCase()}_FM_SERVER`,apiKey:`${f.toUpperCase()}_OTTO_API_KEY`}},m=Hd(t),h=await Ud({projectDir:t,project:m,envs:[{name:p.envNames.database,zodValue:`z.string().endsWith(".fmp12")`,defaultValue:u,type:`server`},{name:p.envNames.server,zodValue:`z.string().url()`,type:`server`,defaultValue:o.url.origin},{name:p.envNames.apiKey,zodValue:`z.string().startsWith("dk_") as z.ZodType<OttoAPIKey>`,type:`server`,defaultValue:d}]}),g=h.getImportDeclaration(e=>e.getModuleSpecifierValue()===`@proofkit/fmdapi`);g?(g.getNamedImports().find(e=>e.getName()===`OttoAPIKey`)?.remove(),g.addNamedImport({name:`OttoAPIKey`,isTypeOnly:!0})):h.addImportDeclaration({namedImports:[{name:`OttoAPIKey`,isTypeOnly:!0}],moduleSpecifier:`@proofkit/fmdapi`}),z({projectDir:t,dependencies:[`@proofkit/fmdapi`],devMode:!1}),i.dataSources.push(p),sf(i),vf({dataSourceName:f,envNames:f===`filemaker`?void 0:p.envNames}),await Bd(m),await tm({settings:i,sourceName:f,projectDir:t,layoutName:n.layoutName,schemaName:n.schemaName,valueLists:`allowEmpty`})}async function sm(t){let n=e.spinner(),i=null,a=null,o=null;for(;a===null;){let s=t??V(await e.text({message:`What is the URL of your FileMaker Server?\n${r.cyan(`TIP: You can copy any valid path on the server and paste it here.`)}`,validate:e=>{try{e.startsWith(`https://`)||(e=e.startsWith(`http://`)?e.replace(`http://`,`https://`):`https://${e}`),new URL(e);return}catch{return`Please enter a valid URL`}}}));try{i=new URL(s)}catch{e.log.error(`Invalid URL: ${s.toString()}`);continue}n.start(`Validating Server URL...`);let{fmsInfo:c,ottoInfo:l}=await Kp({url:i.origin});n.stop(),a=new ge(c.ServerVersion.split(` `)[0])??null,o=new ge(l?.Otto.version??``)??null,t=void 0}if(i===null)throw Error(`Unable to get FileMaker Server URL`);return e.note(`🎉 FileMaker Server version ${a} detected \n
98
- ${o?`🎉 OttoFMS version ${o} detected`:`❌ OttoFMS not detected`}`),{url:i,ottoVersion:o,fmsVersion:a}}const cm={noGit:!1,noInstall:!1,default:!1,CI:!1,tailwind:!1,trpc:!1,prisma:!1,drizzle:!1,importAlias:`~/`,appRouter:!1,auth:`none`,server:void 0,fileName:``,layoutName:``,schemaName:``,dataApiKey:``,fmServerURL:``,dataSource:void 0,ui:`shadcn`},lm=()=>{let e=new i(`init`).description(`Create a new project with ProofKit`).argument(`[dir]`,`The name of the application, as well as the name of the directory to create`).option(`--appType [type]`,`The type of app to create`,void 0).option(`--ui [ui]`,void 0,void 0).option(`--server [url]`,`The URL of your FileMaker Server`,void 0).option(`--adminApiKey [key]`,`Admin API key for OttoFMS. If provided, will skip login prompt`,void 0).option(`--fileName [name]`,`The name of the FileMaker file to use for the web app`,void 0).option(`--layoutName [name]`,`The name of the FileMaker layout to use for the web app`,void 0).option(`--schemaName [name]`,`The name for the generated layout client in your schemas`,void 0).option(`--dataApiKey [key]`,`The API key to use for the FileMaker Data API`,void 0).option(`--auth [type]`,`The authentication provider to use for the web app`,void 0).option(`--dataSource [type]`,`The data source to use for the web app (filemaker or none)`,void 0).option(`--noGit`,`Explicitly tell the CLI to not initialize a new git repo in the project`,!1).option(`--noInstall`,`Explicitly tell the CLI to not run the package manager's install command`,!1).addOption(Ff).addOption(If).action(dm);return e.hook(`preAction`,e=>{L(e.opts()),I.baseCommand=`init`}),e};async function um({projectDir:e}){let t=`none`;t===`clerk`?await jf({options:{type:`clerk`},projectDir:e,noInstall:!0}):t===`fmaddon`&&await jf({options:{type:`fmaddon`},projectDir:e,noInstall:!0})}const dm=async(t,n)=>{let r=Nd(),i=n??cm;I.ui=i.ui??`shadcn`;let a=t||V(await e.text({message:`What will your project be called?`,defaultValue:Ue,validate:sp})).toString();I.appType||=I.ci?`browser`:V(await e.select({message:`What kind of app do you want to build?`,options:[{value:`browser`,label:`Web App for Browsers`,hint:`Uses Next.js, will require hosting`},{value:`webviewer`,label:`FileMaker Web Viewer (beta)`,hint:`Uses Vite, can be embedded in FileMaker or hosted`}]}));let l=tp(),[u,d]=ap(a),f=await Vf({projectName:d,scopedAppName:u,packages:l,noInstall:i.noInstall,appRouter:i.appRouter});Yf(f,`@/`);let p=c.readJSONSync(o.join(f,`package.json`));if(p.name=u,p.proofkitMetadata={initVersion:Me()},r!==`bun`){let{stdout:e}=await s(r,[`-v`],{cwd:f});p.packageManager=`${r}@${e.trim()}`}c.writeJSONSync(o.join(f,`package.json`),p,{spaces:2});let{registryUrl:m}=sf(I.ui===`mantine`?{appType:I.appType??`browser`,ui:`mantine`,auth:{type:`none`},envFile:`.env`,dataSources:[],tanstackQuery:!1,replacedMainPage:!1,appliedUpgrades:[`cursorRules`],reactEmail:!1,reactEmailServer:!1,registryTemplates:[]}:{appType:I.appType??`browser`,ui:`shadcn`,envFile:`.env`,dataSources:[],replacedMainPage:!1,registryTemplates:[]}),h=I.appType===`webviewer`?`filemaker`:i.dataSource;h||=V(await e.select({message:`Do you want to connect to a FileMaker Database now?`,options:[{value:`filemaker`,label:`Yes`,hint:`Requires OttoFMS and Admin Server credentials`},{value:`none`,label:`No`,hint:`You'll be able to add a new data source later`}]})),h===`filemaker`&&(await om({projectDir:f,name:`filemaker`,adminApiKey:i.adminApiKey,dataApiKey:i.dataApiKey,server:i.server,fileName:i.fileName,layoutName:i.layoutName,schemaName:i.schemaName}),I.appType===`webviewer`&&await rp()),await um({projectDir:f}),await Id({projectDir:f}),I.ui===`shadcn`&&await Xf([`${Zf()}/r/components/mode-toggle`,`sonner`,`button`]),await hf(),i.noGit||await qf(f),Jf({projectName:d,noInstall:i.noInstall})},fm=Se(Object.values({purple:`#89216B`,lightPurple:`#D15ABB`,orange:`#FF595E`})),pm=()=>{let e=Nd();(e===`yarn`||e===`pnpm`)&&console.log(``),console.log(fm.multiline(He))},mm=async({noInstall:t,installServerFiles:n}={})=>{let r=e.spinner();r.start(`Adding React Email`),await wf({noInstall:t,installServerFiles:n}),r.stop(`React Email added`)},hm=async()=>{let t=e.spinner();t.start(`Adding Tanstack Query`),await Sf(),t.stop(`Tanstack Query added`)};async function gm(){let t=B();if(t.appType!==`browser`)return e.cancel(`Auth is not supported for your app type.`);if(t.ui===`shadcn`)return e.cancel(`Adding auth is not yet supported for shadcn-based projects.`);let n=I.authType??V(await e.select({message:`What auth provider do you want to use?`,options:[{value:`fmaddon`,label:`FM Add-on Auth`,hint:`Self-hosted auth with email/password`},{value:`clerk`,label:`Clerk`,hint:`Hosted auth service with many providers`}]})),i=P([`clerk`,`fmaddon`]).parse(n);if(I.authType=i,i===`fmaddon`){let t=(I.emailProvider?I.emailProvider:I.ci?`none`:void 0)??V(await e.select({message:`What email provider do you want to use?\n${r.dim(`Used to send email verification codes. If you skip this, the codes will be displayed here in your terminal.`)}`,options:[{label:`Resend`,value:`resend`,hint:`Great dev experience`},{label:`Plunk`,value:`plunk`,hint:`Cheapest for <20k emails/mo, self-hostable`},{label:`Other / I'll do it myself later`,value:`none`}]})),n=P([`plunk`,`resend`,`none`]).parse(t);I.emailProvider=n,await jf({options:{type:i,emailProvider:n===`none`?void 0:n}})}else await jf({options:{type:i}})}const _m=()=>{let e=new i(`auth`).description(`Add authentication to your project`).option(`--authType <authType>`,`Type of auth provider to use`).option(`--emailProvider <emailProvider>`,`Email provider to use (only for FM Add-on Auth)`).option(`--apiKey <apiKey>`,`API key to use for the email provider (only for FM Add-on Auth)`).addOption(Ff).addOption(If).action(async()=>{let e=B();if(e.ui===`shadcn`)throw Error(`Shadcn projects should add auth using the template registry`);if(e.auth.type!==`none`)throw Error(`Auth already exists`);await gm()});return e.hook(`preAction`,e=>{L(e.opts())}),e},vm=P([`fm`,`supabase`]),ym=async()=>{let t=vm.parse(await e.select({message:`Which data souce do you want to add?`,options:[{label:`FileMaker`,value:`fm`},{label:`Supabase`,value:`supabase`}]}));if(t===`supabase`)throw Error(`Not implemented`);if(t===`fm`)await om({projectDir:process.cwd()});else throw Error(`Invalid data source`)},bm=()=>{let e=new i(`data`);return e.description(`Add a new data source to your project`),e.hook(`preAction`,(e,t)=>{let n=lf({commandName:`add`});t.setOptionValue(`settings`,n)}),e},xm=async({projectDir:e,pageDir:t,dataSource:n,schemaName:r})=>{if(n)if(r){if(n.type!==`fm`)throw Error(`FileMaker DataSource is required for table page`)}else throw Error(`SchemaName is required for table page`);else throw Error(`DataSource is required for table page`);let i=gf({projectDir:e,dataSourceName:n.name}),a=yf({schemaName:r,dataSourceName:n.name}),s=B();if(s.ui===`shadcn`)return;let l=s.auth,u={__SOURCE_NAME__:n.name,__TYPE_NAME__:`T${r}`,__ZOD_TYPE_NAME__:`Z${r}`,__CLIENT_NAME__:`${r}${i}`,__SCHEMA_NAME__:r,__ACTION_CLIENT__:l.type===`none`?`actionClient`:`authedActionClient`,__FIRST_FIELD_NAME__:a[0]??`NO_FIELDS_ON_YOUR_LAYOUT`},d=await c.readdir(t);for await(let e of d){let n=o.join(t,e),r=await c.readFile(n,`utf8`);Object.entries(u).forEach(([e,t])=>{r=r.replace(new RegExp(e,`g`),t)}),await c.writeFile(n,r,`utf8`)}let f=Hd(e),p=f.addSourceFileAtPath(o.join(t,I.appType===`browser`?`table.tsx`:`index.tsx`)).getVariableDeclaration(`columns`)?.getInitializerIfKind(_.ArrayLiteralExpression),m=wm(a.filter(Boolean));for await(let e of m)p?.addElement(t=>t.inlineBlock(()=>{Sm(e)?t.write(`accessorFn: (row) => row["${e}"],`):t.write(`accessorFn: (row) => row.${e},`),t.write(`header: "${e}",`)}).write(`,`).newLine());I.appType===`webviewer`&&await Sf({project:f})&&await Id(),await Bd(f)};function Sm(e){return!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)}const Cm=[`id`,`pk`,`createdat`,`updatedat`,`primarykey`,`createdby`,`modifiedby`,`creationtimestamp`,`modificationtimestamp`];function wm(e){return e.filter(e=>!Cm.includes(e.toLowerCase())||e.startsWith(`_`))}const Tm=async e=>{await xm(e),await Sf()&&await Id()},Em={blank:{requireData:!1,label:`Blank`,templatePath:`nextjs/blank`},table:{requireData:!0,label:`Basic Table`,hint:`Use to load and show multiple records`,templatePath:`nextjs/table`,postIntallFn:xm},tableEdit:{requireData:!0,label:`Basic Table (editable)`,hint:`Use to load and show multiple records with inline edit functionality`,templatePath:`nextjs/table-edit`,postIntallFn:xm},tableInfinite:{requireData:!0,label:`Infinite Table`,hint:`Automatically load more records when the user scrolls to the bottom`,templatePath:`nextjs/table-infinite`,postIntallFn:Tm},tableInfiniteEdit:{requireData:!0,label:`Infinite Table (editable)`,hint:`Automatically load more records when the user scrolls to the bottom with inline edit functionality`,templatePath:`nextjs/table-infinite-edit`,postIntallFn:Tm}},Dm={blank:{requireData:!1,label:`Blank`,templatePath:`vite-wv/blank`},table:{requireData:!0,label:`Basic Table`,hint:`Use to load and show multiple records`,templatePath:`vite-wv/table`,postIntallFn:xm},tableEdit:{requireData:!0,label:`Basic Table (editable)`,hint:`Use to load and show multiple records with inline edit functionality`,templatePath:`vite-wv/table-edit`,postIntallFn:xm}};async function Om({projectDir:e,navType:t,...n}){let r=o.join(e,`src/app/navigation.tsx`);if(!c.existsSync(r))return;let i=Hd(e);i.addSourceFileAtPath(r).getVariableDeclaration(t===`primary`?`primaryRoutes`:`secondaryRoutes`)?.getInitializerIfKind(_.ArrayLiteralExpression)?.addElement(e=>e.block(()=>{e.write(`
88
+ `)}else e.log.error(`${c.red(`Error creating Data API key:`)} Unknown error`);if(!H(await e.confirm({message:`Do you want to try and enter credentials again?`,active:`Yes, try again`,inactive:`No, abort`})))throw Error(`User cancelled`)}}}async function gh({url:e,filename:t,username:n,password:r}){return{apiKey:(await xe.post(`${e.origin}/otto/api/api-key/create-only`,{database:t,label:`For FM Web App`,user:n,pass:r})).data.response.key}}async function _h({payload:e,url:t,token:n}){let r=P({response:P({started:Vd(),batchId:Nd(),subDeploymentIds:df(Nd())}),messages:df(P({code:Nd(),text:M()}))}),i=await xe.post(`${t.origin}/otto/api/deployment`,e,{headers:{Authorization:`Bearer ${n}`}}).catch(e=>{throw console.error(e.response.data),e});return r.parse(i.data)}async function vh({url:e,token:t,deploymentId:n}){let r=P({response:P({id:Nd(),status:F([`queued`,`running`,`scheduled`,`complete`,`aborted`,`unknown`]),running:Pp(),created_at:M(),started_at:M(),updated_at:M()}),messages:df(P({code:Nd(),text:M()}))}),i=await xe.get(`${e.origin}/otto/api/deployment/${n}`,{headers:{Authorization:`Bearer ${t}`}});return r.parse(i.data)}const yh=()=>{};function bh(e,t,n){return new Proxy(yh,{get(n,r){if(!(typeof r!=`string`||r===`then`))return bh(e,[...t,r])},apply(n,r,i){let a=t[t.length-1],o={args:i,path:t};return a===`call`?o={args:i.length>=2?[i[1]]:[],path:t.slice(0,-1)}:a===`apply`&&(o={args:i.length>=2?i[1]:[],path:t.slice(0,-1)}),e(o)}})}const xh=e=>bh(e,[]);function Sh(e,...t){let n=Object.assign(Object.create(null),e);for(let e of t)for(let t in e){if(t in n&&n[t]!==e[t])throw Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function Ch(e){return!!e&&!Array.isArray(e)&&typeof e==`object`}function wh(e){return typeof e==`function`}function Th(e){return Object.assign(Object.create(null),e)}var Eh=class extends Error{};function Dh(e){if(e instanceof Error)return e;let t=typeof e;if(!(t===`undefined`||t===`function`||e===null)){if(t!==`object`)return Error(String(e));if(Ch(e)){let t=new Eh;for(let n in e)t[n]=e[n];return t}}}function Oh(e){if(e instanceof kh||e instanceof Error&&e.name===`TRPCError`)return e;let t=new kh({code:`INTERNAL_SERVER_ERROR`,cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}var kh=class extends Error{constructor(e){let t=Dh(e.cause),n=e.message??t?.message??e.code;super(n,{cause:t}),this.code=e.code,this.name=`TRPCError`,this.cause||=t}};function Ah(e){return`input`in e?e:{input:e,output:e}}const jh={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}},Mh=({shape:e})=>e,Nh=`middlewareMarker`;function Ph(){function e(t){return{_middlewares:t,unstable_pipe(n){let r=`_middlewares`in n?n._middlewares:[n];return e([...t,...r])}}}function t(t){return e([t])}return t}function Fh(e){let t=async function(t){let n,r=await t.getRawInput();try{n=await e(r)}catch(e){throw new kh({code:`BAD_REQUEST`,cause:e})}let i=Ch(t.input)&&Ch(n)?{...t.input,...n}:n;return t.next({input:i})};return t._type=`input`,t}function Ih(e){let t=async function({next:t}){let n=await t();if(!n.ok)return n;try{let t=await e(n.data);return{...n,data:t}}catch(e){throw new kh({message:`Output validation failed`,code:`INTERNAL_SERVER_ERROR`,cause:e})}};return t._type=`output`,t}function Lh(e){let t=e;if(typeof t==`function`)return t;if(typeof t.parseAsync==`function`)return t.parseAsync.bind(t);if(typeof t.parse==`function`)return t.parse.bind(t);if(typeof t.validateSync==`function`)return t.validateSync.bind(t);if(typeof t.create==`function`)return t.create.bind(t);if(typeof t.assert==`function`)return e=>(t.assert(e),e);throw Error(`Could not find a validator fn`)}function Rh(e,t){let{middlewares:n=[],inputs:r,meta:i,...a}=t;return zh({...Sh(e,a),inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&i?{...e.meta,...i}:i??e.meta})}function zh(e={}){let t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){let n=Lh(e);return Rh(t,{inputs:[e],middlewares:[Fh(n)]})},output(e){return Rh(t,{output:e,middlewares:[Ih(Lh(e))]})},meta(e){return Rh(t,{meta:e})},use(e){return Rh(t,{middlewares:`_middlewares`in e?e._middlewares:[e]})},unstable_concat(e){return Rh(t,e._def)},query(e){return Bh({...t,type:`query`},e)},mutation(e){return Bh({...t,type:`mutation`},e)},subscription(e){return Bh({...t,type:`subscription`},e)},experimental_caller(e){return Rh(t,{caller:e})}}}function Bh(e,t){let n=Rh(e,{resolver:t,middlewares:[async function(e){return{marker:Nh,ok:!0,data:await t(e),ctx:e.ctx}}]}),r={...n._def,type:e.type,experimental_caller:!!n._def.caller,meta:n._def.meta,$types:null},i=Vh(n._def),a=n._def.caller;if(!a)return i;let o=async(...e)=>await a({args:e,invoke:i,_def:r});return o._def=r,o}function Vh(e){async function t(t){if(!t||!(`getRawInput`in t))throw Error(`This is a client-only function.
89
+ If you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls`);async function n(r={index:0,ctx:t.ctx}){try{let i=e.middlewares[r.index];return await i({ctx:r.ctx,type:t.type,path:t.path,getRawInput:r.getRawInput??t.getRawInput,meta:e.meta,input:r.input,next(e){let t=e;return n({index:r.index+1,ctx:t&&`ctx`in t?{...r.ctx,...t.ctx}:r.ctx,input:t&&`input`in t?t.input:r.input,getRawInput:t&&`getRawInput`in t?t.getRawInput:r.getRawInput})}})}catch(e){return{ok:!1,error:Oh(e),marker:Nh}}}let r=await n();if(!r)throw new kh({code:`INTERNAL_SERVER_ERROR`,message:"No result from middlewares - did you forget to `return next()`?"});if(!r.ok)throw r.error;return r.data}return t._def=e,t}const Hh=typeof window>`u`||`Deno`in window||globalThis.process?.env?.NODE_ENV===`test`||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;function Uh(e){return e._def&&`router`in e._def}const Wh={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:Mh,transformer:jh},Gh=[`then`,`call`,`apply`];function Kh(e){function t(t){let n=new Set(Object.keys(t).filter(e=>Gh.includes(e)));if(n.size>0)throw Error("Reserved words used in `router({})` call: "+Array.from(n).join(`, `));let r=Th({});function i(e,t=[]){let n=Th({});for(let[a,o]of Object.entries(e??{})){if(Uh(o)){n[a]=i(o._def.record,[...t,a]);continue}if(!qh(o)){n[a]=i(o,[...t,a]);continue}let e=[...t,a].join(`.`);if(r[e])throw Error(`Duplicate key: ${e}`);r[e]=o,n[a]=o}return n}let a=i(t),o={_config:e,router:!0,procedures:r,...Wh,record:a};return{...a,_def:o,createCaller:Jh()({_def:o})}}return t}function qh(e){return typeof e==`function`}function Jh(){return function(e){let t=e._def;return function(e,n){return xh(async({path:r,args:i})=>{let a=r.join(`.`);if(r.length===1&&r[0]===`_def`)return t;let o=t.procedures[a],s;try{return s=wh(e)?await Promise.resolve(e()):e,await o({path:a,getRawInput:async()=>i[0],ctx:s,type:o._def.type})}catch(e){throw n?.onError?.({ctx:s,error:Oh(e),input:i[0],path:a,type:o._def.type}),e}})}}}function Yh(...e){let t=Sh({},...e.map(e=>e._def.record));return Kh({errorFormatter:e.reduce((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==Mh){if(e!==Mh&&e!==t._def._config.errorFormatter)throw Error(`You seem to have several error formatters`);return t._def._config.errorFormatter}return e},Mh),transformer:e.reduce((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==jh){if(e!==jh&&e!==t._def._config.transformer)throw Error(`You seem to have several transformers`);return t._def._config.transformer}return e},jh),isDev:e.every(e=>e._def._config.isDev),allowOutsideOfServer:e.every(e=>e._def._config.allowOutsideOfServer),isServer:e.every(e=>e._def._config.isServer),$types:e[0]?._def._config.$types})(t)}new class e{context(){return new e}meta(){return new e}create(e){let t={transformer:Ah(e?.transformer??jh),isDev:e?.isDev??globalThis.process?.env.NODE_ENV!==`production`,allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??Mh,isServer:e?.isServer??Hh,$types:null,experimental:e?.experimental??{}};if(!(e?.isServer??Hh)&&e?.allowOutsideOfServer!==!0)throw Error(`You're trying to use @trpc/server in a non-server environment. This is not supported by default.`);return{_config:t,procedure:zh({meta:e?.defaultMeta}),middleware:Ph(),router:Kh(t),mergeRouters:Yh,createCallerFactory:Jh()}}};async function Xh({url:e,ottoPort:t=3030}){return{fmsInfo:await Qh(e),ottoInfo:await tg({url:e,ottoPort:t})}}const Zh=I.object({data:I.object({APIVersion:I.number().optional(),AcceptEARPassword:I.boolean().optional(),AcceptEncrypted:I.boolean().optional(),AcceptUnencrypted:I.boolean().optional(),AdminLocalAuth:I.string().optional(),AllowChangeUploadDBFolder:I.boolean().optional(),AutoOpenForUpload:I.boolean().optional(),DenyGuestAndAutoLogin:I.string().optional(),Hostname:I.string().optional(),IsAppleInternal:I.boolean().optional(),IsETS:I.boolean().optional(),PremisesType:I.string().optional(),ProductVersion:I.string().optional(),PublicKey:I.string().optional(),RequiresDBPasswords:I.boolean().optional(),ServerID:I.string().optional(),ServerVersion:I.string()}),result:I.number()});async function Qh(e){let t=new URL(e);t.pathname=`/fmws/serverinfo`;let n=await ig(t.toString()).then(e=>Zh.safeParse(e.data));if(!n.success)throw console.error(`fmsInfoResult.error`,n.error.issues),new kh({code:`BAD_REQUEST`,message:`Invalid FileMaker Server URL`});return n.data.data}const $h=I.object({Otto:I.object({version:I.string(),serverNickname:I.string().default(``),isLicenseValid:I.boolean().optional()}),migratorVersion:I.string().optional(),FileMakerServer:I.object({version:I.object({long:I.string(),short:I.string()}),running:I.boolean().optional()}),isMac:I.boolean().optional(),platform:I.string().optional(),host:I.string().optional()}),eg=I.object({response:$h});async function tg({url:e,ottoPort:t=3030}){let n=await ng(e);return n||=await rg(e,t),n}async function ng(e){try{let t=new URL(e);return t.pathname=`/otto/api/info`,await ig(t.toString()).then(e=>eg.parse(e.data).response)}catch{return console.log(`unable to fetch otto4 info, trying otto3`),null}}async function rg(e,t){try{let n=new URL(e);return n.port=t?t.toString():`3030`,n.pathname=`/api/otto/info`,await ig(n.toString()).then(e=>$h.parse(e.data))}catch(e){return e instanceof Error&&console.error(`otto3 fetch error`,e.message),null}}async function ig(e){let t=new Te.Agent({rejectUnauthorized:!1});return await xe.get(e,{validateStatus:null,headers:{Connection:`close`},httpsAgent:t,timeout:1e4})}const ag=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/,og=async t=>{let n=V(),r=L.projectDir,i=t?.sourceName;if(i)i=t?.sourceName;else if(n.dataSources.filter(e=>e.type===`fm`).length>1){let t=await e.select({message:`Which FileMaker data source do you want to add a layout to?`,options:n.dataSources.filter(e=>e.type===`fm`).map(e=>({label:e.name,value:e.name}))});e.isCancel(t)&&(e.cancel(),process.exit(0)),i=M().parse(t)}i||=`filemaker`;let a=n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===i);if(!a)throw Error(`FileMaker data source ${i} not found in your ProofKit config`);let o=e.spinner();o.start(`Loading layouts from your FileMaker file...`),n.envFile&&le.config({path:d.join(r,n.envFile)});let s=process.env[a.envNames.apiKey],l=process.env[a.envNames.database],u=process.env[a.envNames.server];s&&l&&u||(o.stop(`Failed to load layouts`),e.cancel(`Missing required environment variables. Please check your .env file.`),process.exit(1)),s.startsWith(`KEY_`)||s.startsWith(`dk_`)||(o.stop(`Failed to load layouts`),e.cancel(`Invalid API key format. API key must start with 'KEY_' or 'dk_'.`),process.exit(1));let f=await em({dataApiKey:s,fmFile:l,server:u}),p=Sm({projectDir:r,dataSourceName:i}),m=p.map(e=>e.layout).filter(Boolean),h=p.map(e=>e.schemaName).filter(Boolean);o.stop(`Loaded layouts from your FileMaker file`),m.length>0&&e.note(m.join(`
90
+ `),`Detected existing layouts in your project`),m.push(`-`);let ee=t?.layoutName;(ee===``||!f.includes(ee??``))&&(ee=void 0);let te=ee??H(await e.select({message:`Select a new layout to read data from`,maxItems:10,options:f.filter(e=>!m.includes(e)).map(e=>({label:e,value:e}))})),ne=cg(te),re=t?.schemaName||H(await e.text({message:`Enter a friendly name for the new schema.\n${c.dim(`This will the name by which you refer to this layout in your codebase`)}`,defaultValue:ne,placeholder:ne,validate:e=>{if(e!==``){if(!ag.test(e))return`Name must consist of only alphanumeric characters, '_', and must not start with a number`;if(h.includes(e))return`Schema name must be unique`}}})).toString(),ie=t?.valueLists??await e.select({message:`Should we use value lists on this layout?\n${c.dim(`This will allow fields that contain a value list to be auto-completed in typescript and also validated to prevent incorrect values`)}`,options:[{label:`Yes, but allow empty fields`,value:`allowEmpty`,hint:`Empty fields or values that don't match the value list will be converted to an empty string`},{label:`Yes; empty values should fail validation`,value:`strict`,hint:`Empty fields or values that don't match the value list will cause validation to fail`},{label:`No, ignore value lists`,value:`ignore`,hint:`Fields will just be typed as strings`}]}),ae=F([`ignore`,`allowEmpty`,`strict`]).catch(`ignore`).parse(ie);await vm({runCodegen:!0,projectDir:r,dataSourceName:i,schemas:[{layoutName:te,schemaName:re,valueLists:ae}]}),e.outro(`Layout "${te}" added to your project as "${re}"`)},sg=()=>new l(`layout`).alias(`schema`).description(`Add a new layout to your fmschema file`).action(async e=>{let t=e.settings;await og({settings:t})});function cg(e){let t=e.replace(/[-\s]/g,`_`);for(let e of nm)t.startsWith(e)&&(t=t.replace(e,``));return t}const lg=`ProofKitDemo.fmp12`;async function ug({url:t,token:n,operation:r}){let i={scheduled:!1,label:`Install ProofKit Demo`,deployments:[{name:`Install ProofKit Demo`,source:{type:`url`,url:`https://proofkit.dev/proofkit-demo/manifest.json`},fileOperations:[{target:{fileName:lg},operation:r,source:{fileName:`ProofKitDemo.fmp12`},location:{folder:`default`,subFolder:``}}],concurrency:1,options:{closeFilesAfterBuild:!1,keepFilesClosedAfterComplete:!1,transferContainerData:!1}}],abortRemaining:!1},a=e.spinner();a.start(`Deploying ProofKit Demo file...`);let{response:{subDeploymentIds:o}}=await _h({payload:i,url:t,token:n}),s=o[0];if(!s)throw Error(`No deployment ID returned from the server`);for(;;){await new Promise(e=>setTimeout(e,2500));let{response:{status:e,running:r}}=await vh({url:t,token:n,deploymentId:s});if(!r){if(e!==`complete`)throw Error(`Deployment didn't complete`);break}}let{apiKey:c}=await gh({filename:lg,username:`admin`,password:`admin`,url:t});return a.stop(),{apiKey:c}}async function dg({projectDir:t,...n}){let r=V(),i=r.dataSources.filter(e=>e.type===`fm`).map(e=>e.name),a=await fg(n.server);if(!(a.ottoVersion&&a.ottoVersion.compare(new be(`4.7.0`))>0||n.adminApiKey))return e.cancel(`OttoFMS 4.7.0 or later is required to auto-login with this CLI. Please install/upgrade OttoFMS on your server, or pass an Admin API key with the --adminApiKey flag then try again`);let o=n.adminApiKey||(await fh({url:a.url})).token,s=await ph({url:a.url,token:o}),l=s.map(e=>e.filename.replace(`.fmp12`,``)).includes(lg.replace(`.fmp12`,``)),u=n.fileName;for(;(u=n.fileName||H(await e.select({message:`Which file would you like to connect to? ${c.dim(`(TIP: Select the file where your data is stored)`)}`,maxItems:10,options:[{value:`$deployDemoFile`,label:`Deploy NEW ProofKit Demo File`,hint:`Use OttoFMS to deploy a new file for testing`},...s.sort((e,t)=>e.filename.localeCompare(t.filename)).map(e=>({value:e.filename,label:e.filename}))]})),u===`$deployDemoFile`)&&l&&!H(await e.confirm({message:`The demo file already exists, do you want to replace it with a fresh copy?`,active:`Yes, replace`,inactive:`No, select another file`,initialValue:!1})););if(!u)throw Error(`No file selected`);let d=n.dataApiKey;if(u===`$deployDemoFile`){let{apiKey:e}=await ug({url:a.url,token:o,operation:l?`replace`:`install`});d=e,u=lg,n.layoutName=n.layoutName??`API_Contacts`,n.schemaName=n.schemaName??`Contacts`}else{let t=(await mh({url:a.url,token:o})).filter(e=>e.database===u);if(!d&&t.length>0){let n=H(await e.select({message:`Which OttoFMS Data API key would you like to use? ${c.dim(`(This determines the access that you'll have to the data in this file)`)}`,options:[...t.map(e=>({value:e.key,label:`${c.bold(e.label)} - ${e.user}`,hint:`${e.key.slice(0,5)}...${e.key.slice(-4)}`})),{value:`create`,label:`Create a new API key`,hint:`Requires FileMaker credentials for this file`}]}));if(typeof n!=`string`)throw Error(`Invalid key`);n!==`create`&&(d=n)}d||=(await hh({filename:u,url:a.url})).apiKey}if(!d)throw Error(`No API key`);let f=i.length===0?`filemaker`:n.name??H(await e.text({message:`What do you want to call this data source?`,validate:e=>e===`filemaker`?`That name is reserved`:i?.includes(e)?`That name is already in use in this project, pick something unique`:dh(e)})),p={type:`fm`,name:f,envNames:f===`filemaker`?{database:`FM_DATABASE`,server:`FM_SERVER`,apiKey:`OTTO_API_KEY`}:{database:`${f.toUpperCase()}_FM_DATABASE`,server:`${f.toUpperCase()}_FM_SERVER`,apiKey:`${f.toUpperCase()}_OTTO_API_KEY`}},m=Jp(t),h=await Yp({projectDir:t,project:m,envs:[{name:p.envNames.database,zodValue:`z.string().endsWith(".fmp12")`,defaultValue:u,type:`server`},{name:p.envNames.server,zodValue:`z.string().url()`,type:`server`,defaultValue:a.url.origin},{name:p.envNames.apiKey,zodValue:`z.string().startsWith("dk_") as z.ZodType<OttoAPIKey>`,type:`server`,defaultValue:d}]}),ee=h.getImportDeclaration(e=>e.getModuleSpecifierValue()===`@proofkit/fmdapi`);ee?(ee.getNamedImports().find(e=>e.getName()===`OttoAPIKey`)?.remove(),ee.addNamedImport({name:`OttoAPIKey`,isTypeOnly:!0})):h.addImportDeclaration({namedImports:[{name:`OttoAPIKey`,isTypeOnly:!0}],moduleSpecifier:`@proofkit/fmdapi`}),B({projectDir:t,dependencies:[`@proofkit/fmdapi`],devMode:!1}),r.dataSources.push(p),fm(r),Cm({dataSourceName:f,envNames:f===`filemaker`?void 0:p.envNames}),await Kp(m),await og({settings:r,sourceName:f,projectDir:t,layoutName:n.layoutName,schemaName:n.schemaName,valueLists:`allowEmpty`})}async function fg(t){let n=e.spinner(),r=null,i=null,a=null,o=t;for(;i===null;){let t=o??H(await e.text({message:`What is the URL of your FileMaker Server?\n${c.cyan(`TIP: You can copy any valid path on the server and paste it here.`)}`,validate:e=>{try{let t=e;t.startsWith(`https://`)||(t=t.startsWith(`http://`)?t.replace(`http://`,`https://`):`https://${t}`),new URL(t);return}catch{return`Please enter a valid URL`}}}));try{r=new URL(t)}catch{e.log.error(`Invalid URL: ${t.toString()}`);continue}n.start(`Validating Server URL...`);let{fmsInfo:s,ottoInfo:l}=await Xh({url:r.origin});n.stop();let u=s.ServerVersion.split(` `)[0];if(!u){e.log.error(`Unable to parse FileMaker Server version`),o=void 0;continue}i=new be(u),a=l?.Otto.version?new be(l.Otto.version):null,o=void 0}if(r===null)throw Error(`Unable to get FileMaker Server URL`);return e.note(`🎉 FileMaker Server version ${i} detected \n
91
+ ${a?`🎉 OttoFMS version ${a} detected`:`❌ OttoFMS not detected`}`),{url:r,ottoVersion:a,fmsVersion:i}}const pg={noGit:!1,noInstall:!1,default:!1,CI:!1,tailwind:!1,trpc:!1,prisma:!1,drizzle:!1,importAlias:`~/`,appRouter:!1,auth:`none`,server:void 0,fileName:``,layoutName:``,schemaName:``,dataApiKey:``,fmServerURL:``,dataSource:void 0,ui:`shadcn`},mg=()=>{let e=new l(`init`).description(`Create a new project with ProofKit`).argument(`[dir]`,`The name of the application, as well as the name of the directory to create`).option(`--appType [type]`,`The type of app to create`,void 0).option(`--ui [ui]`,void 0,void 0).option(`--server [url]`,`The URL of your FileMaker Server`,void 0).option(`--adminApiKey [key]`,`Admin API key for OttoFMS. If provided, will skip login prompt`,void 0).option(`--fileName [name]`,`The name of the FileMaker file to use for the web app`,void 0).option(`--layoutName [name]`,`The name of the FileMaker layout to use for the web app`,void 0).option(`--schemaName [name]`,`The name for the generated layout client in your schemas`,void 0).option(`--dataApiKey [key]`,`The API key to use for the FileMaker Data API`,void 0).option(`--auth [type]`,`The authentication provider to use for the web app`,void 0).option(`--dataSource [type]`,`The data source to use for the web app (filemaker or none)`,void 0).option(`--noGit`,`Explicitly tell the CLI to not initialize a new git repo in the project`,!1).option(`--noInstall`,`Explicitly tell the CLI to not run the package manager's install command`,!1).addOption(Bm).addOption(Vm).action(gg);return e.hook(`preAction`,e=>{R(e.opts()),L.baseCommand=`init`}),e};async function hg({projectDir:e}){let t=`none`;t===`clerk`?await Im({options:{type:`clerk`},projectDir:e,noInstall:!0}):t===`fmaddon`&&await Im({options:{type:`fmaddon`},projectDir:e,noInstall:!0})}const gg=async(e,t)=>{let n=zp(),r=t??pg;L.ui=r.ui??`shadcn`;let i=e||H(await s({message:`What will your project be called?`,defaultValue:qe,validate:dh})).toString();L.appType||=L.ci?`browser`:H(await o({message:`What kind of app do you want to build?`,options:[{value:`browser`,label:`Web App for Browsers`,hint:`Uses Next.js, will require hosting`},{value:`webviewer`,label:`FileMaker Web Viewer (beta)`,hint:`Uses Vite, can be embedded in FileMaker or hosted`}]}));let a=ah(),[c,l]=lh(i),u=await Km({projectName:l,scopedAppName:c,packages:a,noInstall:r.noInstall,appRouter:r.appRouter});th(u,`@/`);let m=p.readJSONSync(d.join(u,`package.json`));if(m.name=c,m.proofkitMetadata={initVersion:Ie()},n!==`bun`){let{stdout:e}=await f(n,[`-v`],{cwd:u});m.packageManager=`${n}@${e.trim()}`}p.writeJSONSync(d.join(u,`package.json`),m,{spaces:2}),fm(L.ui===`mantine`?{appType:L.appType??`browser`,ui:`mantine`,auth:{type:`none`},envFile:`.env`,dataSources:[],tanstackQuery:!1,replacedMainPage:!1,appliedUpgrades:[`cursorRules`],reactEmail:!1,reactEmailServer:!1,registryTemplates:[]}:{appType:L.appType??`browser`,ui:`shadcn`,envFile:`.env`,dataSources:[],replacedMainPage:!1,registryTemplates:[]});let h=L.appType===`webviewer`?`filemaker`:r.dataSource;h||=H(await o({message:`Do you want to connect to a FileMaker Database now?`,options:[{value:`filemaker`,label:`Yes`,hint:`Requires OttoFMS and Admin Server credentials`},{value:`none`,label:`No`,hint:`You'll be able to add a new data source later`}]})),h===`filemaker`&&(await dg({projectDir:u,name:`filemaker`,adminApiKey:r.adminApiKey,dataApiKey:r.dataApiKey,server:r.server,fileName:r.fileName,layoutName:r.layoutName,schemaName:r.schemaName}),L.appType===`webviewer`&&await sh()),await hg({projectDir:u}),await Hp({projectDir:u}),L.ui===`shadcn`&&await nh([`${rh()}/r/components/mode-toggle`,`sonner`,`button`]),await bm(),r.noGit||await Qm(u),$m({projectName:l,noInstall:r.noInstall})},_g=Ee(Object.values({purple:`#89216B`,lightPurple:`#D15ABB`,orange:`#FF595E`})),vg=()=>{let e=zp();(e===`yarn`||e===`pnpm`)&&console.log(``),console.log(_g.multiline(Ke))},yg=async({noInstall:t,installServerFiles:n}={})=>{let r=e.spinner();r.start(`Adding React Email`),await km({noInstall:t,installServerFiles:n}),r.stop(`React Email added`)},bg=async()=>{let t=e.spinner();t.start(`Adding Tanstack Query`),await Dm(),t.stop(`Tanstack Query added`)};async function xg(){let e=V();if(e.appType!==`browser`)return t(`Auth is not supported for your app type.`);if(e.ui===`shadcn`)return t(`Adding auth is not yet supported for shadcn-based projects.`);let n=L.authType??H(await o({message:`What auth provider do you want to use?`,options:[{value:`fmaddon`,label:`FM Add-on Auth`,hint:`Self-hosted auth with email/password`},{value:`clerk`,label:`Clerk`,hint:`Hosted auth service with many providers`}]})),r=F([`clerk`,`fmaddon`]).parse(n);if(L.authType=r,r===`fmaddon`){let e=L.emailProvider??(L.ci?`none`:void 0)??H(await o({message:`What email provider do you want to use?\n${c.dim(`Used to send email verification codes. If you skip this, the codes will be displayed here in your terminal.`)}`,options:[{label:`Resend`,value:`resend`,hint:`Great dev experience`},{label:`Plunk`,value:`plunk`,hint:`Cheapest for <20k emails/mo, self-hostable`},{label:`Other / I'll do it myself later`,value:`none`}]})),t=F([`plunk`,`resend`,`none`]).parse(e);L.emailProvider=t,await Im({options:{type:r,emailProvider:t===`none`?void 0:t}})}else await Im({options:{type:r}})}const Sg=()=>{let e=new l(`auth`).description(`Add authentication to your project`).option(`--authType <authType>`,`Type of auth provider to use`).option(`--emailProvider <emailProvider>`,`Email provider to use (only for FM Add-on Auth)`).option(`--apiKey <apiKey>`,`API key to use for the email provider (only for FM Add-on Auth)`).addOption(Bm).addOption(Vm).action(async()=>{let e=V();if(e.ui===`shadcn`)throw Error(`Shadcn projects should add auth using the template registry`);if(e.auth.type!==`none`)throw Error(`Auth already exists`);await xg()});return e.hook(`preAction`,e=>{R(e.opts())}),e},Cg=F([`fm`,`supabase`]),wg=async()=>{let t=Cg.parse(await e.select({message:`Which data souce do you want to add?`,options:[{label:`FileMaker`,value:`fm`},{label:`Supabase`,value:`supabase`}]}));if(t===`supabase`)throw Error(`Not implemented`);if(t===`fm`)await dg({projectDir:process.cwd()});else throw Error(`Invalid data source`)},Tg=()=>{let e=new l(`data`);return e.description(`Add a new data source to your project`),e.hook(`preAction`,(e,t)=>{let n=mm({commandName:`add`});t.setOptionValue(`settings`,n)}),e},Eg=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,Dg=async({projectDir:e,pageDir:t,dataSource:n,schemaName:r})=>{if(!n)throw Error(`DataSource is required for table page`);if(!r)throw Error(`SchemaName is required for table page`);if(n.type!==`fm`)throw Error(`FileMaker DataSource is required for table page`);let i=xm({projectDir:e,dataSourceName:n.name}),a=wm({schemaName:r,dataSourceName:n.name}),o=V();if(o.ui===`shadcn`)return;let s=o.auth,c={__SOURCE_NAME__:n.name,__TYPE_NAME__:`T${r}`,__ZOD_TYPE_NAME__:`Z${r}`,__CLIENT_NAME__:`${r}${i}`,__SCHEMA_NAME__:r,__ACTION_CLIENT__:s.type===`none`?`actionClient`:`authedActionClient`,__FIRST_FIELD_NAME__:a[0]??`NO_FIELDS_ON_YOUR_LAYOUT`},l=await p.readdir(t);for await(let e of l){let n=d.join(t,e),r=await p.readFile(n,`utf8`);for(let[e,t]of Object.entries(c))r=r.replace(new RegExp(e,`g`),t);await p.writeFile(n,r,`utf8`)}let u=Jp(e),f=u.addSourceFileAtPath(d.join(t,L.appType===`browser`?`table.tsx`:`index.tsx`)).getVariableDeclaration(`columns`)?.getInitializerIfKind(g.ArrayLiteralExpression),m=Ag(a.filter(Boolean));for await(let e of m)f?.addElement(t=>t.inlineBlock(()=>{Og(e)?t.write(`accessorFn: (row) => row["${e}"],`):t.write(`accessorFn: (row) => row.${e},`),t.write(`header: "${e}",`)}).write(`,`).newLine());L.appType===`webviewer`&&await Dm({project:u})&&await Hp(),await Kp(u)};function Og(e){return!Eg.test(e)}const kg=[`id`,`pk`,`createdat`,`updatedat`,`primarykey`,`createdby`,`modifiedby`,`creationtimestamp`,`modificationtimestamp`];function Ag(e){return e.filter(e=>!kg.includes(e.toLowerCase())||e.startsWith(`_`))}const jg=async e=>{await Dg(e),await Dm()&&await Hp()},Mg={blank:{requireData:!1,label:`Blank`,templatePath:`nextjs/blank`},table:{requireData:!0,label:`Basic Table`,hint:`Use to load and show multiple records`,templatePath:`nextjs/table`,postIntallFn:Dg},tableEdit:{requireData:!0,label:`Basic Table (editable)`,hint:`Use to load and show multiple records with inline edit functionality`,templatePath:`nextjs/table-edit`,postIntallFn:Dg},tableInfinite:{requireData:!0,label:`Infinite Table`,hint:`Automatically load more records when the user scrolls to the bottom`,templatePath:`nextjs/table-infinite`,postIntallFn:jg},tableInfiniteEdit:{requireData:!0,label:`Infinite Table (editable)`,hint:`Automatically load more records when the user scrolls to the bottom with inline edit functionality`,templatePath:`nextjs/table-infinite-edit`,postIntallFn:jg}},Ng={blank:{requireData:!1,label:`Blank`,templatePath:`vite-wv/blank`},table:{requireData:!0,label:`Basic Table`,hint:`Use to load and show multiple records`,templatePath:`vite-wv/table`,postIntallFn:Dg},tableEdit:{requireData:!0,label:`Basic Table (editable)`,hint:`Use to load and show multiple records with inline edit functionality`,templatePath:`vite-wv/table-edit`,postIntallFn:Dg}};async function Pg({projectDir:e,navType:t,...n}){let r=d.join(e,`src/app/navigation.tsx`);if(!p.existsSync(r))return;let i=Jp(e);i.addSourceFileAtPath(r).getVariableDeclaration(t===`primary`?`primaryRoutes`:`secondaryRoutes`)?.getInitializerIfKind(g.ArrayLiteralExpression)?.addElement(e=>e.block(()=>{e.write(`
99
92
  label: "${n.label}",
100
93
  type: "link",
101
- href: "${n.href}",`)}).write(`,`)),await Bd(i)}const km=async t=>{let n=I.projectDir,i=B();if(i.ui===`shadcn`)return e.cancel(`Adding pages is not yet supported for shadcn-based projects.`);let a=I.appType===`browser`?Object.entries(Em):Object.entries(Dm);if(a.length===0)return e.cancel(`No templates found for your app type. Check back soon!`);let s=t?.routeName,l=i.replacedMainPage;if(I.appType===`webviewer`&&!l&&!I.ci&&!s){let t=V(await e.select({message:`Do you want to replace the default page?`,options:[{label:`Yes`,value:`yes`},{label:`No, maybe later`,value:`no`},{label:`No, don't ask again`,value:`never`}]}));(t===`never`||t===`yes`)&&(l=!0),t===`yes`&&(s=`/`)}s||=V(await e.text({message:`Enter the URL PATH for your new page`,placeholder:`/my-page`,validate:e=>{if(e.length===0)return`URL path is required`}})),s.startsWith(`/`)||(s=`/${s}`);let u=Ce(s.replace(`/`,``).trim()),d=t?.template??V(await e.select({message:`What template should be used for this page?`,options:a.map(([e,t])=>({value:e,label:`${t.label}`,hint:t.hint}))})),f=a.find(([e])=>e===d)?.[1];if(!f)return e.cancel(`Page template ${d} not found`);let p,m;if(f.requireData){if(i.dataSources.length===0)return e.cancel(`This template requires a data source, but you don't have any. Add a data source first, or choose another page template`);let r=t?.dataSourceName??(i.dataSources.length>1?V(await e.select({message:`Which data source should be used for this page?`,options:i.dataSources.map(e=>({value:e.name,label:e.name}))})):i.dataSources[0]?.name);if(p=i.dataSources.find(e=>e.name===r),!p)return e.cancel(`Data source ${r} not found`);m=await jm({projectDir:n,dataSource:p})}let h=e.spinner();h.start(`Adding page from template`);let g=o.join(v,`template/pages`,f.templatePath),ee=I.appType===`browser`?o.join(n,`src/app/(main)`,s):o.join(n,`src/routes`,s);await c.copy(g,ee),I.appType===`browser`?u&&u!==``&&await Om({projectDir:process.cwd(),navType:`primary`,label:u,href:s}):I.appType,await f.postIntallFn?.({projectDir:n,pageDir:ee,dataSource:p,schemaName:m}),l!==i.replacedMainPage&&of({replacedMainPage:l}),h.stop(`Added page!`);let _=Nd();console.log(`\n${r.green(`Next steps:`)}\nTo preview this page, restart your dev server using the ${r.cyan(`${_===`npm`?`npm run`:_} dev`)} command\n`)},Am=()=>{let e=new i(`page`).description(`Add a new page to your project`).action(async()=>{await km()});return e.addOption(Ff),e.addOption(If),e.hook(`preAction`,()=>{L(e.opts()),I.baseCommand=`add`,lf({commandName:`add`})}),e};async function jm({projectDir:t=process.cwd(),dataSource:n}){if(n.type===`supabase`)throw Error(`Not implemented`);{let r=_f({projectDir:t,dataSourceName:n.name}).map(e=>e.schemaName).filter(Boolean);if(r.length===0){e.cancel(`This data source doesn't have any schemas to load data from`);return}return r.length===1?r[0]:V(await e.select({message:`Which schema should this page load data from?`,options:r.map(e=>({label:e,value:e??``}))}))}}var H;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(H||={});var Mm;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Mm||={});const U=H.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),Nm=e=>{switch(typeof e){case`undefined`:return U.undefined;case`string`:return U.string;case`number`:return Number.isNaN(e)?U.nan:U.number;case`boolean`:return U.boolean;case`function`:return U.function;case`bigint`:return U.bigint;case`symbol`:return U.symbol;case`object`:return Array.isArray(e)?U.array:e===null?U.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?U.promise:typeof Map<`u`&&e instanceof Map?U.map:typeof Set<`u`&&e instanceof Set?U.set:typeof Date<`u`&&e instanceof Date?U.date:U.object;default:return U.unknown}},W=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 Pm=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw 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(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Pm.create=e=>new Pm(e);var Fm=(e,t)=>{let n;switch(e.code){case W.invalid_type:n=e.received===U.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case W.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,H.jsonStringifyReplacer)}`;break;case W.unrecognized_keys:n=`Unrecognized key(s) in object: ${H.joinValues(e.keys,`, `)}`;break;case W.invalid_union:n=`Invalid input`;break;case W.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${H.joinValues(e.options)}`;break;case W.invalid_enum_value:n=`Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;break;case W.invalid_arguments:n=`Invalid function arguments`;break;case W.invalid_return_type:n=`Invalid function return type`;break;case W.invalid_date:n=`Invalid date`;break;case W.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):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case W.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case W.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case W.custom:n=`Invalid input`;break;case W.invalid_intersection_types:n=`Intersection results could not be merged`;break;case W.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case W.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,H.assertNever(e)}return{message:n}};let Im=Fm;function Lm(){return Im}const Rm=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function G(e,t){let n=Lm(),r=Rm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Fm?void 0:Fm].filter(e=>!!e)});e.common.issues.push(r)}var K=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return q;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return q;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const q=Object.freeze({status:`aborted`}),zm=e=>({status:`dirty`,value:e}),J=e=>({status:`valid`,value:e}),Bm=e=>e.status===`aborted`,Vm=e=>e.status===`dirty`,Hm=e=>e.status===`valid`,Um=e=>typeof Promise<`u`&&e instanceof Promise;var Y;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Y||={});var Wm=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,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}};const Gm=(e,t)=>{if(Hm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new Pm(e.common.issues),this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Z=class{get description(){return this._def.description}_getType(e){return Nm(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Nm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new K,ctx:{common:e.parent.common,data:e.data,parsedType:Nm(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Um(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nm(e)};return Gm(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nm(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Hm(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Hm(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nm(e)},r=this._parse({data:e,path:n.path,parent:n});return Gm(n,await(Um(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:W.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new qh({schema:this,typeName:Q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Jh.create(this,this._def)}nullable(){return Yh.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oh.create(this)}promise(){return Kh.create(this,this._def)}or(e){return jh.create([this,e],this._def)}and(e){return Fh.create(this,e,this._def)}transform(e){return new qh({...X(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Xh({...X(this._def),innerType:this,defaultValue:t,typeName:Q.ZodDefault})}brand(){return new $h({typeName:Q.ZodBranded,type:this,...X(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Zh({...X(this._def),innerType:this,catchValue:t,typeName:Q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return eg.create(this,e)}readonly(){return tg.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const Km=/^c[^\s-]{8,}$/i,qm=/^[0-9a-z]+$/,Jm=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ym=/^[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,Xm=/^[a-z0-9_-]{21}$/i,Zm=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qm=/^[-+]?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)?)??$/,$m=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let eh;const th=/^(?:(?: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])$/,nh=/^(?:(?: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])$/,rh=/^(([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]))$/,ih=/^(([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])$/,ah=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oh=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,sh=`((\\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])))`,ch=RegExp(`^${sh}$`);function lh(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function uh(e){return RegExp(`^${lh(e)}$`)}function dh(e){let t=`${sh}T${lh(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function fh(e,t){return!!((t===`v4`||!t)&&th.test(e)||(t===`v6`||!t)&&rh.test(e))}function ph(e,t){if(!Zm.test(e))return!1;try{let[n]=e.split(`.`),r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function mh(e,t){return!!((t===`v4`||!t)&&nh.test(e)||(t===`v6`||!t)&&ih.test(e))}var hh=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.string,received:t.parsedType}),q}let t=new K,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?G(n,{code:W.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&G(n,{code:W.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)$m.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`email`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)eh||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),eh.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`emoji`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Ym.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`uuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Xm.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`nanoid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Km.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)qm.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cuid2`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)Jm.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ulid`,code:W.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),G(n,{validation:`url`,code:W.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`regex`,code:W.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?dh(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?ch.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?uh(r).test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:W.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Qm.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`duration`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?fh(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`ip`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?ph(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`jwt`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?mh(e.data,r.version)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`cidr`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?ah.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64`,code:W.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?oh.test(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{validation:`base64url`,code:W.invalid_string,message:r.message}),t.dirty()):H.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:W.invalid_string,...Y.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Y.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Y.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Y.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Y.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Y.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Y.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Y.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Y.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Y.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Y.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Y.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Y.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Y.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Y.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Y.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Y.errToObj(t)})}nonempty(e){return this.min(1,Y.errToObj(e))}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(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};hh.create=e=>new hh({checks:[],typeName:Q.ZodString,coerce:e?.coerce??!1,...X(e)});function gh(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var _h=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==U.number){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.number,received:t.parsedType}),q}let t,n=new K;for(let r of this._def.checks)r.kind===`int`?H.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?gh(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_finite,message:r.message}),n.dirty()):H.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Y.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Y.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Y.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&H.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};_h.create=e=>new _h({checks:[],typeName:Q.ZodNumber,coerce:e?.coerce||!1,...X(e)});var vh=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==U.bigint)return this._getInvalidInput(e);let t,n=new K;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),G(t,{code:W.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):H.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.bigint,received:t.parsedType}),q}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};vh.create=e=>new vh({checks:[],typeName:Q.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var yh=class extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==U.boolean){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.boolean,received:t.parsedType}),q}return J(e.data)}};yh.create=e=>new yh({typeName:Q.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var bh=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.date,received:t.parsedType}),q}if(Number.isNaN(e.data.getTime()))return G(this._getOrReturnCtx(e),{code:W.invalid_date}),q;let t=new K,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),G(n,{code:W.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):H.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Y.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};bh.create=e=>new bh({checks:[],coerce:e?.coerce||!1,typeName:Q.ZodDate,...X(e)});var xh=class extends Z{_parse(e){if(this._getType(e)!==U.symbol){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.symbol,received:t.parsedType}),q}return J(e.data)}};xh.create=e=>new xh({typeName:Q.ZodSymbol,...X(e)});var Sh=class extends Z{_parse(e){if(this._getType(e)!==U.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.undefined,received:t.parsedType}),q}return J(e.data)}};Sh.create=e=>new Sh({typeName:Q.ZodUndefined,...X(e)});var Ch=class extends Z{_parse(e){if(this._getType(e)!==U.null){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.null,received:t.parsedType}),q}return J(e.data)}};Ch.create=e=>new Ch({typeName:Q.ZodNull,...X(e)});var wh=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}};wh.create=e=>new wh({typeName:Q.ZodAny,...X(e)});var Th=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}};Th.create=e=>new Th({typeName:Q.ZodUnknown,...X(e)});var Eh=class extends Z{_parse(e){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.never,received:t.parsedType}),q}};Eh.create=e=>new Eh({typeName:Q.ZodNever,...X(e)});var Dh=class extends Z{_parse(e){if(this._getType(e)!==U.undefined){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.void,received:t.parsedType}),q}return J(e.data)}};Dh.create=e=>new Dh({typeName:Q.ZodVoid,...X(e)});var Oh=class e extends Z{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==U.array)return G(t,{code:W.invalid_type,expected:U.array,received:t.parsedType}),q;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(G(t,{code:e?W.too_big:W.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(G(t,{code:W.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(G(t,{code:W.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Wm(t,e,t.path,n)))).then(e=>K.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Wm(t,e,t.path,n)));return K.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Y.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Y.toString(n)}})}nonempty(e){return this.min(1,e)}};Oh.create=(e,t)=>new Oh({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...X(t)});function kh(e){if(e instanceof Ah){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Jh.create(kh(r))}return new Ah({...e._def,shape:()=>t})}else if(e instanceof Oh)return new Oh({...e._def,type:kh(e.element)});else if(e instanceof Jh)return Jh.create(kh(e.unwrap()));else if(e instanceof Yh)return Yh.create(kh(e.unwrap()));else if(e instanceof Ih)return Ih.create(e.items.map(e=>kh(e)));else return e}var Ah=class e extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:H.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==U.object){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.object,received:t.parsedType}),q}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Eh&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Wm(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Eh){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(G(n,{code:W.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Wm(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>K.mergeObjectSync(t,e)):K.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Y.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Y.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:Q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of H.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of H.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return kh(this)}partial(t){let n={};for(let e of H.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of H.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Jh;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Uh(H.objectKeys(this.shape))}};Ah.create=(e,t)=>new Ah({shape:()=>e,unknownKeys:`strip`,catchall:Eh.create(),typeName:Q.ZodObject,...X(t)}),Ah.strictCreate=(e,t)=>new Ah({shape:()=>e,unknownKeys:`strict`,catchall:Eh.create(),typeName:Q.ZodObject,...X(t)}),Ah.lazycreate=(e,t)=>new Ah({shape:e,unknownKeys:`strip`,catchall:Eh.create(),typeName:Q.ZodObject,...X(t)});var jh=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Pm(e.ctx.common.issues));return G(t,{code:W.invalid_union,unionErrors:n}),q}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Pm(e));return G(t,{code:W.invalid_union,unionErrors:i}),q}}get options(){return this._def.options}};jh.create=(e,t)=>new jh({options:e,typeName:Q.ZodUnion,...X(t)});const Mh=e=>e instanceof Vh?Mh(e.schema):e instanceof qh?Mh(e.innerType()):e instanceof Hh?[e.value]:e instanceof Wh?e.options:e instanceof Gh?H.objectValues(e.enum):e instanceof Xh?Mh(e._def.innerType):e instanceof Sh?[void 0]:e instanceof Ch?[null]:e instanceof Jh?[void 0,...Mh(e.unwrap())]:e instanceof Yh?[null,...Mh(e.unwrap())]:e instanceof $h||e instanceof tg?Mh(e.unwrap()):e instanceof Zh?Mh(e._def.innerType):[];var Nh=class e extends Z{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==U.object)return G(t,{code:W.invalid_type,expected:U.object,received:t.parsedType}),q;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(G(t,{code:W.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Mh(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...X(r)})}};function Ph(e,t){let n=Nm(e),r=Nm(t);if(e===t)return{valid:!0,data:e};if(n===U.object&&r===U.object){let n=H.objectKeys(t),r=H.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ph(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===U.array&&r===U.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ph(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===U.date&&r===U.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var Fh=class extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Bm(e)||Bm(r))return q;let i=Ph(e.value,r.value);return i.valid?((Vm(e)||Vm(r))&&t.dirty(),{status:t.value,value:i.data}):(G(n,{code:W.invalid_intersection_types}),q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Fh.create=(e,t,n)=>new Fh({left:e,right:t,typeName:Q.ZodIntersection,...X(n)});var Ih=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return G(n,{code:W.invalid_type,expected:U.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return G(n,{code:W.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),q;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:W.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Wm(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>K.mergeArray(t,e)):K.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ih.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Ih({items:e,typeName:Q.ZodTuple,rest:null,...X(t)})};var Lh=class e extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return G(n,{code:W.invalid_type,expected:U.object,received:n.parsedType}),q;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Wm(n,e,n.path,e)),value:a._parse(new Wm(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?K.mergeObjectAsync(t,r):K.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Z?new e({keyType:t,valueType:n,typeName:Q.ZodRecord,...X(r)}):new e({keyType:hh.create(),valueType:t,typeName:Q.ZodRecord,...X(n)})}},Rh=class extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return G(n,{code:W.invalid_type,expected:U.map,received:n.parsedType}),q;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Wm(n,e,n.path,[a,`key`])),value:i._parse(new Wm(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Rh.create=(e,t,n)=>new Rh({valueType:t,keyType:e,typeName:Q.ZodMap,...X(n)});var zh=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return G(n,{code:W.invalid_type,expected:U.set,received:n.parsedType}),q;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(G(n,{code:W.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(G(n,{code:W.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return q;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Wm(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Y.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};zh.create=(e,t)=>new zh({valueType:e,minSize:null,maxSize:null,typeName:Q.ZodSet,...X(t)});var Bh=class e extends Z{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==U.function)return G(t,{code:W.invalid_type,expected:U.function,received:t.parsedType}),q;function n(e,n){return Rm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lm(),Fm].filter(e=>!!e),issueData:{code:W.invalid_arguments,argumentsError:n}})}function r(e,n){return Rm({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Lm(),Fm].filter(e=>!!e),issueData:{code:W.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Kh){let e=this;return J(async function(...t){let o=new Pm([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return J(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Pm([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Pm([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ih.create(t).rest(Th.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Ih.create([]).rest(Th.create()),returns:n||Th.create(),typeName:Q.ZodFunction,...X(r)})}},Vh=class extends Z{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Vh.create=(e,t)=>new Vh({getter:e,typeName:Q.ZodLazy,...X(t)});var Hh=class extends Z{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return G(t,{received:t.data,code:W.invalid_literal,expected:this._def.value}),q}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Hh.create=(e,t)=>new Hh({value:e,typeName:Q.ZodLiteral,...X(t)});function Uh(e,t){return new Wh({values:e,typeName:Q.ZodEnum,...X(t)})}var Wh=class e extends Z{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{expected:H.joinValues(n),received:t.parsedType,code:W.invalid_type}),q}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return G(t,{received:t.data,code:W.invalid_enum_value,options:n}),q}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Wh.create=Uh;var Gh=class extends Z{_parse(e){let t=H.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let e=H.objectValues(t);return G(n,{expected:H.joinValues(e),received:n.parsedType,code:W.invalid_type}),q}if(this._cache||=new Set(H.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=H.objectValues(t);return G(n,{received:n.data,code:W.invalid_enum_value,options:e}),q}return J(e.data)}get enum(){return this._def.values}};Gh.create=(e,t)=>new Gh({values:e,typeName:Q.ZodNativeEnum,...X(t)});var Kh=class extends Z{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==U.promise&&t.common.async===!1?(G(t,{code:W.invalid_type,expected:U.promise,received:t.parsedType}),q):J((t.parsedType===U.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Kh.create=(e,t)=>new Kh({type:e,typeName:Q.ZodPromise,...X(t)});var qh=class extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{G(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return q;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?q:r.status===`dirty`||t.value===`dirty`?zm(r.value):r});{if(t.value===`aborted`)return q;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?q:r.status===`dirty`||t.value===`dirty`?zm(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?q:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?q:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Hm(e))return q;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Hm(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):q);H.assertNever(r)}};qh.create=(e,t,n)=>new qh({schema:e,typeName:Q.ZodEffects,effect:t,...X(n)}),qh.createWithPreprocess=(e,t,n)=>new qh({schema:t,effect:{type:`preprocess`,transform:e},typeName:Q.ZodEffects,...X(n)});var Jh=class extends Z{_parse(e){return this._getType(e)===U.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Jh.create=(e,t)=>new Jh({innerType:e,typeName:Q.ZodOptional,...X(t)});var Yh=class extends Z{_parse(e){return this._getType(e)===U.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Yh.create=(e,t)=>new Yh({innerType:e,typeName:Q.ZodNullable,...X(t)});var Xh=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Xh.create=(e,t)=>new Xh({innerType:e,typeName:Q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...X(t)});var Zh=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Um(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Pm(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Pm(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Zh.create=(e,t)=>new Zh({innerType:e,typeName:Q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...X(t)});var Qh=class extends Z{_parse(e){if(this._getType(e)!==U.nan){let t=this._getOrReturnCtx(e);return G(t,{code:W.invalid_type,expected:U.nan,received:t.parsedType}),q}return{status:`valid`,value:e.data}}};Qh.create=e=>new Qh({typeName:Q.ZodNaN,...X(e)});var $h=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},eg=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?q:e.status===`dirty`?(t.dirty(),zm(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?q:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Q.ZodPipeline})}},tg=class extends Z{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Hm(e)&&(e.value=Object.freeze(e.value)),e);return Um(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};tg.create=(e,t)=>new tg({innerType:e,typeName:Q.ZodReadonly,...X(t)}),Ah.lazycreate;var Q;(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`})(Q||={});const $=hh.create;_h.create,Qh.create,vh.create;const ng=yh.create;bh.create,xh.create,Sh.create,Ch.create,wh.create,Th.create,Eh.create,Dh.create;const rg=Oh.create,ig=Ah.create;Ah.strictCreate,jh.create;const ag=Nh.create;Fh.create,Ih.create,Lh.create,Rh.create,zh.create,Bh.create,Vh.create;const og=Hh.create,sg=Wh.create;Gh.create,Kh.create,qh.create,Jh.create,Yh.create,qh.createWithPreprocess,eg.create;const cg=sg([`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:example`,`registry:internal`]).describe(`The type property is used to specify the type of your registry item. This is used to determine the type and target path of the item when resolved for a project.`),lg=ag(`type`,[ig({sourceFileName:$(),destinationPath:$().optional(),type:cg.extract([`registry:file`,`registry:page`]),handlebars:ng().optional()}),ig({sourceFileName:$(),destinationPath:$().optional(),type:cg.exclude([`registry:file`,`registry:page`]),handlebars:ng().optional()})]),ug=(e,t)=>ig({action:og(e),data:t,_from:$().optional()}),dg=ag(`action`,[ug(`next-steps`,ig({message:$()})),ug(`package.json script`,ig({scriptName:$(),scriptCommand:$()})),ug(`env`,ig({envs:ig({name:$(),zodValue:$(),defaultValue:$().optional().describe("This value will be added to the .env file, unless `addToRuntimeEnv` is set to `false`."),type:sg([`server`,`client`]),addToRuntimeEnv:ng().optional().describe(`Whether to add the env to the runtime env.`)}).array()})),ug(`wrap provider`,ig({providerOpenTag:$().describe(`The opening tag to use for the provider. This is used to wrap the provider in the correct location.`),providerCloseTag:$().describe(`The closing tag to use for the provider.`),imports:rg(ig({moduleSpecifier:$().describe(`The module to import from (e.g., '@/config/query-provider')`),defaultImport:$().optional().describe(`The default import name (e.g., 'QueryProvider')`),namedImports:rg($()).optional().describe(`Array of named imports (e.g., ['QueryProvider', 'useQuery'])`)})).describe(`Array of import configurations for the provider. Each import should have either defaultImport or namedImports.`),parentTag:rg($()).optional().describe(`If set, the provider will attempt to go inside of the parent tag. The first found tag will be used as the parent. If not set or none of the tags are found, the provider will be wrapped at the very top level.`)}))]),fg=sg([`component`,`page`,`utility`,`hook`,`email`]),pg=sg([`next-pages`,`next-app`,`manual`]),mg=Ee.omit({name:!0,type:!0,files:!0,docs:!0}).extend({title:$(),description:$().optional(),category:fg,files:rg(lg),registryType:cg,postInstall:rg(dg).optional().describe(`Steps that should be run by the ProofKit CLI after shadcn CLI is done`),minimumProofKitVersion:$().describe(`The minimum version of ProofKit required to use this template`).optional(),allowedFrameworks:rg(pg).optional(),schemaRequired:ng().optional().describe(`Whether this template requires a database schema to be selected`)}),hg=mg.pick({title:!0,category:!0,description:!0}).extend({name:$()}).array(),gg=l(import.meta.url),_g=o.dirname(gg);o.resolve(_g,`../templates`);function vg(e){return e.replace(/^\/+|\/+$/g,``)}function yg(e){return(e.registryDependencies??[]).filter(e=>e.startsWith(`{proofkit}/r/`)).map(e=>e.replace(`{proofkit}/r/`,``)).map(vg)}const bg={"{{schema.schemaName}}":`__HB_SCHEMA_NAME__`,"{{schema.sourceName}}":`__HB_SOURCE_NAME__`,"{{schema.clientSuffix}}":`__HB_CLIENT_SUFFIX__`};function xg(e){let t=e;for(let[e,n]of Object.entries(bg))t=t.replace(new RegExp(Sg(n),`g`),e);return t}function Sg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const Cg=Oe({"@get/meta/:name":{output:mg},"@get/":{output:hg}}),wg=De({baseURL:`${Zf()}/r`,schema:Cg});async function Tg(e){try{let t=await wg(`@get/meta/:name`,{params:{name:e}});if(t.error){if(t.error.status===404)return null;throw Error(t.error.message)}return t.data}catch(e){throw e}}ke.registerHelper(`eq`,function(e,t){return e===t}),ke.registerHelper(`findFirst`,function(e,t,n){if(!e||!Array.isArray(e))return n.inverse(this);for(let r=0;r<e.length;r++){let i=e[r];if(t===`fm`&&i.type===`fm`)return n.fn(i)}return n.inverse(this)});const Eg=[`id`,`pk`,`createdat`,`updatedat`,`primarykey`,`createdby`,`modifiedby`,`creationtimestamp`,`modificationtimestamp`];function Dg(e){return e.filter(e=>!Eg.includes(e.toLowerCase())||e.startsWith(`_`))}function Og(e){let{dataSource:t,schemaName:n}=e,r=gf({projectDir:I.projectDir??process.cwd(),dataSourceName:t.name}),i=yf({schemaName:n,dataSourceName:t.name}).filter(Boolean);return{sourceName:t.name,schemaName:n,clientSuffix:r,allFieldNames:i,fieldNames:Dg(i)}}function kg(e){return{proofkit:B(),shadcn:Qf(),schema:e?Og(e):{sourceName:`UnknownDataSource`,schemaName:`UnknownSchema`,clientSuffix:`UnknownClientSuffix`,allFieldNames:[`UnknownFieldName`],fieldNames:[`UnknownFieldName`]}}}async function Ag(e,t){let n=jg(e,t),r=await c.readFile(n,`utf8`);r=xg(r);let i=ke.compile(r)(t);await c.writeFile(n,i)}function jg(e,t){let n=e.sourceFileName;if(e.destinationPath)return e.destinationPath;let r=I.projectDir??process.cwd(),{shadcn:i}=t,a={"registry:lib":i?.aliases?.lib||i?.aliases?.utils,"registry:component":i?.aliases?.components,"registry:ui":i?.aliases?.ui||i?.aliases?.components,"registry:hook":i?.aliases?.hooks,"registry:file":`src`,"registry:page":`src/app`,"registry:block":i?.aliases?.components?i.aliases.components.startsWith(`@/`)?`${i.aliases.components.replace(`@/`,`src/`)}/blocks`:`src/${i.aliases.components}/blocks`:`src/components/blocks`,"registry:theme":`src/theme`,"registry:style":`src/styles`}[e.type];if(a)if(a.startsWith(`@/`)){let e=a.replace(`@/`,`src/`);return o.join(r,e,n)}else if(a.startsWith(`/`)||a.includes(`src/`))return o.join(r,a,n);else return o.join(r,`src`,a,n);switch(e.type){case`registry:lib`:return o.join(r,`src`,`lib`,n);case`registry:file`:return o.join(r,`src`,n);case`registry:page`:let e=t.routeName;if(e){let t=e===`/`?``:e;return o.join(r,`src`,`app`,`(main)`,t,n)}return o.join(r,`src`,`app`,n);case`registry:block`:return o.join(r,`src`,`components`,`blocks`,n);case`registry:component`:return o.join(r,`src`,`components`,n);case`registry:ui`:return o.join(r,`src`,`components`,n);case`registry:hook`:return o.join(r,`src`,`hooks`,n);case`registry:theme`:return o.join(r,`src`,`theme`,n);case`registry:style`:return o.join(r,`src`,`styles`,n);default:return n}}function Mg(e){let t=o.join(I.projectDir,`package.json`),n=JSON.parse(u.readFileSync(t,`utf8`));n.scripts[e.data.scriptName]=e.data.scriptCommand,u.writeFileSync(t,JSON.stringify(n,null,2))}async function Ng(e){let{parentTag:t,imports:n,providerCloseTag:r,providerOpenTag:i}=e.data;try{let e=I.projectDir,a=Hd(e),s=(e=>e.startsWith(`@/`)?e.replace(`@/`,`src/`):e.startsWith(`./`)?e.substring(2):e)(Qf().aliases.components),c=o.join(e,s,`providers.tsx`),l=a.addSourceFileAtPath(c);for(let e of n){let t={moduleSpecifier:e.moduleSpecifier,kind:ee.ImportDeclaration};e.defaultImport&&(t.defaultImport=e.defaultImport),e.namedImports&&e.namedImports.length>0&&(t.namedImports=e.namedImports),l.addImportDeclaration(t)}let u=l.getFunction(e=>e.isDefaultExport());if(!u){R.warn(`No default export function found in ${c}`);return}let d=u?.getBody()?.getFirstDescendantByKind(_.ReturnStatement);if(!d){R.warn(`No return statement found in default export function`);return}let f;if(t&&t.length>0){for(let e of t)if(f=d?.getDescendantsOfKind(_.JsxOpeningElement).find(t=>t.getTagNameNode().getText()===e)?.getParentIfKind(_.JsxElement),f)break}if(f){let e=`${i}
94
+ href: "${n.href}",`)}).write(`,`)),await Kp(i)}const Fg=async t=>{let n=L.projectDir,r=V();if(r.ui===`shadcn`)return e.cancel(`Adding pages is not yet supported for shadcn-based projects.`);let i=L.appType===`browser`?Object.entries(Mg):Object.entries(Ng);if(i.length===0)return e.cancel(`No templates found for your app type. Check back soon!`);let a=t?.routeName,o=r.replacedMainPage;if(L.appType===`webviewer`&&!o&&!L.ci&&!a){let t=H(await e.select({message:`Do you want to replace the default page?`,options:[{label:`Yes`,value:`yes`},{label:`No, maybe later`,value:`no`},{label:`No, don't ask again`,value:`never`}]}));(t===`never`||t===`yes`)&&(o=!0),t===`yes`&&(a=`/`)}a||=H(await e.text({message:`Enter the URL PATH for your new page`,placeholder:`/my-page`,validate:e=>{if(e.length===0)return`URL path is required`}})),a.startsWith(`/`)||(a=`/${a}`);let s=De(a.replace(`/`,``).trim()),l=t?.template??H(await e.select({message:`What template should be used for this page?`,options:i.map(([e,t])=>({value:e,label:`${t.label}`,hint:t.hint}))})),u=i.find(([e])=>e===l)?.[1];if(!u)return e.cancel(`Page template ${l} not found`);let f,m;if(u.requireData){if(r.dataSources.length===0)return e.cancel(`This template requires a data source, but you don't have any. Add a data source first, or choose another page template`);let i=t?.dataSourceName??(r.dataSources.length>1?H(await e.select({message:`Which data source should be used for this page?`,options:r.dataSources.map(e=>({value:e.name,label:e.name}))})):r.dataSources[0]?.name);if(f=r.dataSources.find(e=>e.name===i),!f)return e.cancel(`Data source ${i} not found`);m=await Lg({projectDir:n,dataSource:f})}let h=e.spinner();h.start(`Adding page from template`);let ee=d.join(_,`template/pages`,u.templatePath),te=L.appType===`browser`?d.join(n,`src/app/(main)`,a):d.join(n,`src/routes`,a);await p.copy(ee,te),L.appType===`browser`?s&&s!==``&&await Pg({projectDir:process.cwd(),navType:`primary`,label:s,href:a}):L.appType,await u.postIntallFn?.({projectDir:n,pageDir:te,dataSource:f,schemaName:m}),o!==r.replacedMainPage&&dm({replacedMainPage:o}),h.stop(`Added page!`);let ne=zp();console.log(`\n${c.green(`Next steps:`)}\nTo preview this page, restart your dev server using the ${c.cyan(`${ne===`npm`?`npm run`:ne} dev`)} command\n`)},Ig=()=>{let e=new l(`page`).description(`Add a new page to your project`).action(async()=>{await Fg()});return e.addOption(Bm),e.addOption(Vm),e.hook(`preAction`,()=>{R(e.opts()),L.baseCommand=`add`,mm({commandName:`add`})}),e};async function Lg({projectDir:t=process.cwd(),dataSource:n}){if(n.type===`supabase`)throw Error(`Not implemented`);let r=Sm({projectDir:t,dataSourceName:n.name}).map(e=>e.schemaName).filter(Boolean);if(r.length===0){e.cancel(`This data source doesn't have any schemas to load data from`);return}return r.length===1?r[0]:H(await e.select({message:`Which schema should this page load data from?`,options:r.map(e=>({label:e,value:e??``}))}))}var U;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(U||={});var Rg;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Rg||={});const W=U.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),zg=e=>{switch(typeof e){case`undefined`:return W.undefined;case`string`:return W.string;case`number`:return Number.isNaN(e)?W.nan:W.number;case`boolean`:return W.boolean;case`function`:return W.function;case`bigint`:return W.bigint;case`symbol`:return W.symbol;case`object`:return Array.isArray(e)?W.array:e===null?W.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?W.promise:typeof Map<`u`&&e instanceof Map?W.map:typeof Set<`u`&&e instanceof Set?W.set:typeof Date<`u`&&e instanceof Date?W.date:W.object;default:return W.unknown}},G=U.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 Bg=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,U.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Bg.create=e=>new Bg(e);var Vg=(e,t)=>{let n;switch(e.code){case G.invalid_type:n=e.received===W.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,U.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${U.joinValues(e.keys,`, `)}`;break;case G.invalid_union:n=`Invalid input`;break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${U.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${U.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n=`Invalid function arguments`;break;case G.invalid_return_type:n=`Invalid function return type`;break;case G.invalid_date:n=`Invalid date`;break;case G.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}"`:U.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case G.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case G.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case G.custom:n=`Invalid input`;break;case G.invalid_intersection_types:n=`Intersection results could not be merged`;break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,U.assertNever(e)}return{message:n}};let Hg=Vg;function Ug(){return Hg}const Wg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function K(e,t){let n=Ug(),r=Wg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vg?void 0:Vg].filter(e=>!!e)});e.common.issues.push(r)}var Gg=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return q;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return q;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const q=Object.freeze({status:`aborted`}),Kg=e=>({status:`dirty`,value:e}),J=e=>({status:`valid`,value:e}),qg=e=>e.status===`aborted`,Jg=e=>e.status===`dirty`,Yg=e=>e.status===`valid`,Xg=e=>typeof Promise<`u`&&e instanceof Promise;var Y;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(Y||={});var Zg=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,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}};const Qg=(e,t)=>{if(Yg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new Bg(e.common.issues),this._error}}};function X(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Z=class{get description(){return this._def.description}_getType(e){return zg(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:zg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Gg,ctx:{common:e.parent.common,data:e.data,parsedType:zg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Xg(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zg(e)};return Qg(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zg(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Yg(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Yg(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zg(e)},r=this._parse({data:e,path:n.path,parent:n});return Qg(n,await(Xg(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:G.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new ev({schema:this,typeName:Q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return tv.create(this,this._def)}nullable(){return nv.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F_.create(this)}promise(){return $_.create(this,this._def)}or(e){return R_.create([this,e],this._def)}and(e){return H_.create(this,e,this._def)}transform(e){return new ev({...X(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new rv({...X(this._def),innerType:this,defaultValue:t,typeName:Q.ZodDefault})}brand(){return new ov({typeName:Q.ZodBranded,type:this,...X(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new iv({...X(this._def),innerType:this,catchValue:t,typeName:Q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return sv.create(this,e)}readonly(){return cv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const $g=/^c[^\s-]{8,}$/i,e_=/^[0-9a-z]+$/,t_=/^[0-9A-HJKMNP-TV-Z]{26}$/i,n_=/^[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,r_=/^[a-z0-9_-]{21}$/i,i_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,a_=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,o_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let s_;const c_=/^(?:(?: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])$/,l_=/^(?:(?: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])$/,u_=/^(([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]))$/,d_=/^(([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])$/,f_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,p_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,m_=`((\\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])))`,h_=RegExp(`^${m_}$`);function g_(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function __(e){return RegExp(`^${g_(e)}$`)}function v_(e){let t=`${m_}T${g_(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function y_(e,t){return!!((t===`v4`||!t)&&c_.test(e)||(t===`v6`||!t)&&u_.test(e))}function b_(e,t){if(!i_.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function x_(e,t){return!!((t===`v4`||!t)&&l_.test(e)||(t===`v6`||!t)&&d_.test(e))}var S_=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==W.string){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.string,received:t.parsedType}),q}let t=new Gg,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),K(n,{code:G.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),K(n,{code:G.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?K(n,{code:G.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&K(n,{code:G.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)o_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`email`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)s_||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),s_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`emoji`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)n_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`uuid`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)r_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`nanoid`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)$g.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`cuid`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)e_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`cuid2`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)t_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`ulid`,code:G.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),K(n,{validation:`url`,code:G.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`regex`,code:G.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?v_(r).test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?h_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?__(r).test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{code:G.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?a_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`duration`,code:G.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?y_(e.data,r.version)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`ip`,code:G.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?b_(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`jwt`,code:G.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?x_(e.data,r.version)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`cidr`,code:G.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?f_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`base64`,code:G.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?p_.test(e.data)||(n=this._getOrReturnCtx(e,n),K(n,{validation:`base64url`,code:G.invalid_string,message:r.message}),t.dirty()):U.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:G.invalid_string,...Y.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...Y.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...Y.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...Y.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...Y.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...Y.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...Y.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...Y.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...Y.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...Y.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...Y.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...Y.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...Y.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...Y.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...Y.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...Y.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...Y.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...Y.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...Y.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...Y.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...Y.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...Y.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...Y.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...Y.errToObj(t)})}nonempty(e){return this.min(1,Y.errToObj(e))}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(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};S_.create=e=>new S_({checks:[],typeName:Q.ZodString,coerce:e?.coerce??!1,...X(e)});function C_(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var w_=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==W.number){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.number,received:t.parsedType}),q}let t,n=new Gg;for(let r of this._def.checks)r.kind===`int`?U.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),K(t,{code:G.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?C_(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),K(t,{code:G.not_finite,message:r.message}),n.dirty()):U.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:Y.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:Y.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:Y.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:Y.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&U.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};w_.create=e=>new w_({checks:[],typeName:Q.ZodNumber,coerce:e?.coerce||!1,...X(e)});var T_=class e extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==W.bigint)return this._getInvalidInput(e);let t,n=new Gg;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),K(t,{code:G.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):U.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.bigint,received:t.parsedType}),q}gte(e,t){return this.setLimit(`min`,e,!0,Y.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,Y.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,Y.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,Y.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Y.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:Y.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:Y.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:Y.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};T_.create=e=>new T_({checks:[],typeName:Q.ZodBigInt,coerce:e?.coerce??!1,...X(e)});var E_=class extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==W.boolean){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.boolean,received:t.parsedType}),q}return J(e.data)}};E_.create=e=>new E_({typeName:Q.ZodBoolean,coerce:e?.coerce||!1,...X(e)});var D_=class e extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==W.date){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.date,received:t.parsedType}),q}if(Number.isNaN(e.data.getTime()))return K(this._getOrReturnCtx(e),{code:G.invalid_date}),q;let t=new Gg,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),K(n,{code:G.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),K(n,{code:G.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):U.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:Y.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:Y.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};D_.create=e=>new D_({checks:[],coerce:e?.coerce||!1,typeName:Q.ZodDate,...X(e)});var O_=class extends Z{_parse(e){if(this._getType(e)!==W.symbol){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.symbol,received:t.parsedType}),q}return J(e.data)}};O_.create=e=>new O_({typeName:Q.ZodSymbol,...X(e)});var k_=class extends Z{_parse(e){if(this._getType(e)!==W.undefined){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.undefined,received:t.parsedType}),q}return J(e.data)}};k_.create=e=>new k_({typeName:Q.ZodUndefined,...X(e)});var A_=class extends Z{_parse(e){if(this._getType(e)!==W.null){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.null,received:t.parsedType}),q}return J(e.data)}};A_.create=e=>new A_({typeName:Q.ZodNull,...X(e)});var j_=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return J(e.data)}};j_.create=e=>new j_({typeName:Q.ZodAny,...X(e)});var M_=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return J(e.data)}};M_.create=e=>new M_({typeName:Q.ZodUnknown,...X(e)});var N_=class extends Z{_parse(e){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.never,received:t.parsedType}),q}};N_.create=e=>new N_({typeName:Q.ZodNever,...X(e)});var P_=class extends Z{_parse(e){if(this._getType(e)!==W.undefined){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.void,received:t.parsedType}),q}return J(e.data)}};P_.create=e=>new P_({typeName:Q.ZodVoid,...X(e)});var F_=class e extends Z{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==W.array)return K(t,{code:G.invalid_type,expected:W.array,received:t.parsedType}),q;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(K(t,{code:e?G.too_big:G.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(K(t,{code:G.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(K(t,{code:G.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Zg(t,e,t.path,n)))).then(e=>Gg.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Zg(t,e,t.path,n)));return Gg.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Y.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Y.toString(n)}})}nonempty(e){return this.min(1,e)}};F_.create=(e,t)=>new F_({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...X(t)});function I_(e){if(e instanceof L_){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=tv.create(I_(r))}return new L_({...e._def,shape:()=>t})}else if(e instanceof F_)return new F_({...e._def,type:I_(e.element)});else if(e instanceof tv)return tv.create(I_(e.unwrap()));else if(e instanceof nv)return nv.create(I_(e.unwrap()));else if(e instanceof U_)return U_.create(e.items.map(e=>I_(e)));else return e}var L_=class e extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:U.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==W.object){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.object,received:t.parsedType}),q}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof N_&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Zg(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof N_){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(K(n,{code:G.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Zg(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Gg.mergeObjectSync(t,e)):Gg.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return Y.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:Y.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:Q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of U.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of U.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return I_(this)}partial(t){let n={};for(let e of U.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of U.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof tv;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return X_(U.objectKeys(this.shape))}};L_.create=(e,t)=>new L_({shape:()=>e,unknownKeys:`strip`,catchall:N_.create(),typeName:Q.ZodObject,...X(t)}),L_.strictCreate=(e,t)=>new L_({shape:()=>e,unknownKeys:`strict`,catchall:N_.create(),typeName:Q.ZodObject,...X(t)}),L_.lazycreate=(e,t)=>new L_({shape:e,unknownKeys:`strip`,catchall:N_.create(),typeName:Q.ZodObject,...X(t)});var R_=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Bg(e.ctx.common.issues));return K(t,{code:G.invalid_union,unionErrors:n}),q}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Bg(e));return K(t,{code:G.invalid_union,unionErrors:i}),q}}get options(){return this._def.options}};R_.create=(e,t)=>new R_({options:e,typeName:Q.ZodUnion,...X(t)});const z_=e=>e instanceof J_?z_(e.schema):e instanceof ev?z_(e.innerType()):e instanceof Y_?[e.value]:e instanceof Z_?e.options:e instanceof Q_?U.objectValues(e.enum):e instanceof rv?z_(e._def.innerType):e instanceof k_?[void 0]:e instanceof A_?[null]:e instanceof tv?[void 0,...z_(e.unwrap())]:e instanceof nv?[null,...z_(e.unwrap())]:e instanceof ov||e instanceof cv?z_(e.unwrap()):e instanceof iv?z_(e._def.innerType):[];var B_=class e extends Z{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.object)return K(t,{code:G.invalid_type,expected:W.object,received:t.parsedType}),q;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(K(t,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),q)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=z_(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...X(r)})}};function V_(e,t){let n=zg(e),r=zg(t);if(e===t)return{valid:!0,data:e};if(n===W.object&&r===W.object){let n=U.objectKeys(t),r=U.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=V_(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===W.array&&r===W.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=V_(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===W.date&&r===W.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var H_=class extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(qg(e)||qg(r))return q;let i=V_(e.value,r.value);return i.valid?((Jg(e)||Jg(r))&&t.dirty(),{status:t.value,value:i.data}):(K(n,{code:G.invalid_intersection_types}),q)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};H_.create=(e,t,n)=>new H_({left:e,right:t,typeName:Q.ZodIntersection,...X(n)});var U_=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.array)return K(n,{code:G.invalid_type,expected:W.array,received:n.parsedType}),q;if(n.data.length<this._def.items.length)return K(n,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),q;!this._def.rest&&n.data.length>this._def.items.length&&(K(n,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Zg(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Gg.mergeArray(t,e)):Gg.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};U_.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new U_({items:e,typeName:Q.ZodTuple,rest:null,...X(t)})};var W_=class e extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.object)return K(n,{code:G.invalid_type,expected:W.object,received:n.parsedType}),q;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Zg(n,e,n.path,e)),value:a._parse(new Zg(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Gg.mergeObjectAsync(t,r):Gg.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Z?new e({keyType:t,valueType:n,typeName:Q.ZodRecord,...X(r)}):new e({keyType:S_.create(),valueType:t,typeName:Q.ZodRecord,...X(n)})}},G_=class extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.map)return K(n,{code:G.invalid_type,expected:W.map,received:n.parsedType}),q;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Zg(n,e,n.path,[a,`key`])),value:i._parse(new Zg(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return q;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};G_.create=(e,t,n)=>new G_({valueType:t,keyType:e,typeName:Q.ZodMap,...X(n)});var K_=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==W.set)return K(n,{code:G.invalid_type,expected:W.set,received:n.parsedType}),q;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(K(n,{code:G.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(K(n,{code:G.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return q;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Zg(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:Y.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Y.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};K_.create=(e,t)=>new K_({valueType:e,minSize:null,maxSize:null,typeName:Q.ZodSet,...X(t)});var q_=class e extends Z{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==W.function)return K(t,{code:G.invalid_type,expected:W.function,received:t.parsedType}),q;function n(e,n){return Wg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ug(),Vg].filter(e=>!!e),issueData:{code:G.invalid_arguments,argumentsError:n}})}function r(e,n){return Wg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ug(),Vg].filter(e=>!!e),issueData:{code:G.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof $_){let e=this;return J(async function(...t){let o=new Bg([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return J(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Bg([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Bg([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:U_.create(t).rest(M_.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||U_.create([]).rest(M_.create()),returns:n||M_.create(),typeName:Q.ZodFunction,...X(r)})}},J_=class extends Z{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};J_.create=(e,t)=>new J_({getter:e,typeName:Q.ZodLazy,...X(t)});var Y_=class extends Z{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return K(t,{received:t.data,code:G.invalid_literal,expected:this._def.value}),q}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Y_.create=(e,t)=>new Y_({value:e,typeName:Q.ZodLiteral,...X(t)});function X_(e,t){return new Z_({values:e,typeName:Q.ZodEnum,...X(t)})}var Z_=class e extends Z{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return K(t,{expected:U.joinValues(n),received:t.parsedType,code:G.invalid_type}),q}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return K(t,{received:t.data,code:G.invalid_enum_value,options:n}),q}return J(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Z_.create=X_;var Q_=class extends Z{_parse(e){let t=U.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==W.string&&n.parsedType!==W.number){let e=U.objectValues(t);return K(n,{expected:U.joinValues(e),received:n.parsedType,code:G.invalid_type}),q}if(this._cache||=new Set(U.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=U.objectValues(t);return K(n,{received:n.data,code:G.invalid_enum_value,options:e}),q}return J(e.data)}get enum(){return this._def.values}};Q_.create=(e,t)=>new Q_({values:e,typeName:Q.ZodNativeEnum,...X(t)});var $_=class extends Z{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==W.promise&&t.common.async===!1?(K(t,{code:G.invalid_type,expected:W.promise,received:t.parsedType}),q):J((t.parsedType===W.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};$_.create=(e,t)=>new $_({type:e,typeName:Q.ZodPromise,...X(t)});var ev=class extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{K(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return q;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?q:r.status===`dirty`||t.value===`dirty`?Kg(r.value):r});{if(t.value===`aborted`)return q;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?q:r.status===`dirty`||t.value===`dirty`?Kg(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?q:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?q:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Yg(e))return q;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Yg(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):q);U.assertNever(r)}};ev.create=(e,t,n)=>new ev({schema:e,typeName:Q.ZodEffects,effect:t,...X(n)}),ev.createWithPreprocess=(e,t,n)=>new ev({schema:t,effect:{type:`preprocess`,transform:e},typeName:Q.ZodEffects,...X(n)});var tv=class extends Z{_parse(e){return this._getType(e)===W.undefined?J(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tv.create=(e,t)=>new tv({innerType:e,typeName:Q.ZodOptional,...X(t)});var nv=class extends Z{_parse(e){return this._getType(e)===W.null?J(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};nv.create=(e,t)=>new nv({innerType:e,typeName:Q.ZodNullable,...X(t)});var rv=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===W.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};rv.create=(e,t)=>new rv({innerType:e,typeName:Q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...X(t)});var iv=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Xg(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Bg(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Bg(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};iv.create=(e,t)=>new iv({innerType:e,typeName:Q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...X(t)});var av=class extends Z{_parse(e){if(this._getType(e)!==W.nan){let t=this._getOrReturnCtx(e);return K(t,{code:G.invalid_type,expected:W.nan,received:t.parsedType}),q}return{status:`valid`,value:e.data}}};av.create=e=>new av({typeName:Q.ZodNaN,...X(e)});var ov=class extends Z{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},sv=class e extends Z{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?q:e.status===`dirty`?(t.dirty(),Kg(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?q:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Q.ZodPipeline})}},cv=class extends Z{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Yg(e)&&(e.value=Object.freeze(e.value)),e);return Xg(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};cv.create=(e,t)=>new cv({innerType:e,typeName:Q.ZodReadonly,...X(t)}),L_.lazycreate;var Q;(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`})(Q||={});const $=S_.create;w_.create,av.create,T_.create;const lv=E_.create;D_.create,O_.create,k_.create,A_.create,j_.create,M_.create,N_.create,P_.create;const uv=F_.create,dv=L_.create;L_.strictCreate,R_.create;const fv=B_.create;H_.create,U_.create,W_.create,G_.create,K_.create,q_.create,J_.create;const pv=Y_.create,mv=Z_.create;Q_.create,$_.create,ev.create,tv.create,nv.create,ev.createWithPreprocess,sv.create;const hv=mv([`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:example`,`registry:internal`]).describe(`The type property is used to specify the type of your registry item. This is used to determine the type and target path of the item when resolved for a project.`),gv=fv(`type`,[dv({sourceFileName:$(),destinationPath:$().optional(),type:hv.extract([`registry:file`,`registry:page`]),handlebars:lv().optional()}),dv({sourceFileName:$(),destinationPath:$().optional(),type:hv.exclude([`registry:file`,`registry:page`]),handlebars:lv().optional()})]),_v=(e,t)=>dv({action:pv(e),data:t,_from:$().optional()}),vv=fv(`action`,[_v(`next-steps`,dv({message:$()})),_v(`package.json script`,dv({scriptName:$(),scriptCommand:$()})),_v(`env`,dv({envs:dv({name:$(),zodValue:$(),defaultValue:$().optional().describe("This value will be added to the .env file, unless `addToRuntimeEnv` is set to `false`."),type:mv([`server`,`client`]),addToRuntimeEnv:lv().optional().describe(`Whether to add the env to the runtime env.`)}).array()})),_v(`wrap provider`,dv({providerOpenTag:$().describe(`The opening tag to use for the provider. This is used to wrap the provider in the correct location.`),providerCloseTag:$().describe(`The closing tag to use for the provider.`),imports:uv(dv({moduleSpecifier:$().describe(`The module to import from (e.g., '@/config/query-provider')`),defaultImport:$().optional().describe(`The default import name (e.g., 'QueryProvider')`),namedImports:uv($()).optional().describe(`Array of named imports (e.g., ['QueryProvider', 'useQuery'])`)})).describe(`Array of import configurations for the provider. Each import should have either defaultImport or namedImports.`),parentTag:uv($()).optional().describe(`If set, the provider will attempt to go inside of the parent tag. The first found tag will be used as the parent. If not set or none of the tags are found, the provider will be wrapped at the very top level.`)}))]),yv=mv([`component`,`page`,`utility`,`hook`,`email`]),bv=mv([`next-pages`,`next-app`,`manual`]),xv=Ae.omit({name:!0,type:!0,files:!0,docs:!0}).extend({title:$(),description:$().optional(),category:yv,files:uv(gv),registryType:hv,postInstall:uv(vv).optional().describe(`Steps that should be run by the ProofKit CLI after shadcn CLI is done`),minimumProofKitVersion:$().describe(`The minimum version of ProofKit required to use this template`).optional(),allowedFrameworks:uv(bv).optional(),schemaRequired:lv().optional().describe(`Whether this template requires a database schema to be selected`)}),Sv=xv.pick({title:!0,category:!0,description:!0}).extend({name:$()}).array(),Cv=m(import.meta.url),wv=d.dirname(Cv);d.resolve(wv,`../templates`);function Tv(e){return e.replace(/^\/+|\/+$/g,``)}function Ev(e){return(e.registryDependencies??[]).filter(e=>e.startsWith(`{proofkit}/r/`)).map(e=>e.replace(`{proofkit}/r/`,``)).map(Tv)}const Dv={"{{schema.schemaName}}":`__HB_SCHEMA_NAME__`,"{{schema.sourceName}}":`__HB_SOURCE_NAME__`,"{{schema.clientSuffix}}":`__HB_CLIENT_SUFFIX__`};function Ov(e){let t=e;for(let[e,n]of Object.entries(Dv))t=t.replace(new RegExp(kv(n),`g`),e);return t}function kv(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}const Av=Me({"@get/meta/:name":{output:xv},"@get/":{output:Sv}}),jv=je({baseURL:`${rh()}/r`,schema:Av});async function Mv(e){let t=await jv(`@get/meta/:name`,{params:{name:e}});if(t.error){if(t.error.status===404)return null;throw Error(t.error.message)}return t.data}Ne.registerHelper(`eq`,(e,t)=>e===t),Ne.registerHelper(`findFirst`,function(e,t,n){if(!(e&&Array.isArray(e)))return n.inverse(this);for(let r of e)if(t===`fm`&&r.type===`fm`)return n.fn(r);return n.inverse(this)});const Nv=[`id`,`pk`,`createdat`,`updatedat`,`primarykey`,`createdby`,`modifiedby`,`creationtimestamp`,`modificationtimestamp`];function Pv(e){return e.filter(e=>!Nv.includes(e.toLowerCase())||e.startsWith(`_`))}function Fv(e){let{dataSource:t,schemaName:n}=e,r=xm({projectDir:L.projectDir??process.cwd(),dataSourceName:t.name}),i=wm({schemaName:n,dataSourceName:t.name}).filter(Boolean);return{sourceName:t.name,schemaName:n,clientSuffix:r,allFieldNames:i,fieldNames:Pv(i)}}function Iv(e){return{proofkit:V(),shadcn:ih(),schema:e?Fv(e):{sourceName:`UnknownDataSource`,schemaName:`UnknownSchema`,clientSuffix:`UnknownClientSuffix`,allFieldNames:[`UnknownFieldName`],fieldNames:[`UnknownFieldName`]}}}async function Lv(e,t){let n=Rv(e,t),r=await p.readFile(n,`utf8`);r=Ov(r);let i=Ne.compile(r)(t);await p.writeFile(n,i)}function Rv(e,t){let n=e.sourceFileName;if(e.destinationPath)return e.destinationPath;let r=L.projectDir??process.cwd(),{shadcn:i}=t,a=`src/components/blocks`;i?.aliases?.components&&(a=i.aliases.components.startsWith(`@/`)?`${i.aliases.components.replace(`@/`,`src/`)}/blocks`:`src/${i.aliases.components}/blocks`);let o={"registry:lib":i?.aliases?.lib||i?.aliases?.utils,"registry:component":i?.aliases?.components,"registry:ui":i?.aliases?.ui||i?.aliases?.components,"registry:hook":i?.aliases?.hooks,"registry:file":`src`,"registry:page":`src/app`,"registry:block":a,"registry:theme":`src/theme`,"registry:style":`src/styles`}[e.type];if(o){if(o.startsWith(`@/`)){let e=o.replace(`@/`,`src/`);return d.join(r,e,n)}return o.startsWith(`/`)||o.includes(`src/`)?d.join(r,o,n):d.join(r,`src`,o,n)}switch(e.type){case`registry:lib`:return d.join(r,`src`,`lib`,n);case`registry:file`:return d.join(r,`src`,n);case`registry:page`:{let e=`routeName`in t?t.routeName:void 0;if(e){let t=e===`/`?``:e;return d.join(r,`src`,`app`,`(main)`,t,n)}return d.join(r,`src`,`app`,n)}case`registry:block`:return d.join(r,`src`,`components`,`blocks`,n);case`registry:component`:return d.join(r,`src`,`components`,n);case`registry:ui`:return d.join(r,`src`,`components`,n);case`registry:hook`:return d.join(r,`src`,`hooks`,n);case`registry:theme`:return d.join(r,`src`,`theme`,n);case`registry:style`:return d.join(r,`src`,`styles`,n);default:return n}}function zv(e){let t=d.join(L.projectDir,`package.json`),n=JSON.parse(h.readFileSync(t,`utf8`));n.scripts[e.data.scriptName]=e.data.scriptCommand,h.writeFileSync(t,JSON.stringify(n,null,2))}async function Bv(e){let{parentTag:t,imports:n,providerCloseTag:r,providerOpenTag:i}=e.data;try{let e=L.projectDir,a=Jp(e),o=(e=>e.startsWith(`@/`)?e.replace(`@/`,`src/`):e.startsWith(`./`)?e.substring(2):e)(ih().aliases.components),s=d.join(e,o,`providers.tsx`),c=a.addSourceFileAtPath(s);for(let e of n){let t={moduleSpecifier:e.moduleSpecifier,kind:oe.ImportDeclaration};e.defaultImport&&(t.defaultImport=e.defaultImport),e.namedImports&&e.namedImports.length>0&&(t.namedImports=e.namedImports),c.addImportDeclaration(t)}let l=c.getFunction(e=>e.isDefaultExport());if(!l){z.warn(`No default export function found in ${s}`);return}let u=l?.getBody()?.getFirstDescendantByKind(g.ReturnStatement);if(!u){z.warn(`No return statement found in default export function`);return}let f;if(t&&t.length>0){for(let e of t)if(f=u?.getDescendantsOfKind(g.JsxOpeningElement).find(t=>t.getTagNameNode().getText()===e)?.getParentIfKind(g.JsxElement),f)break}if(f){let e=`${i}
102
95
  ${f?.getJsxChildren().map(e=>e.getText()).filter(Boolean).join(`
103
96
  `)}
104
- ${r}`;f.getChildSyntaxList()?.replaceWithText(e)}else{let e=d?.getExpression();if(e){let t=e.getKind()===_.ParenthesizedExpression,n;n=t?e.asKindOrThrow(_.ParenthesizedExpression).getExpression().getText():e.getText();let a=`return (
97
+ ${r}`;f.getChildSyntaxList()?.replaceWithText(e)}else{let e=u?.getExpression();if(e){let t=e.getKind()===g.ParenthesizedExpression,n;n=t?e.asKindOrThrow(g.ParenthesizedExpression).getExpression().getText():e.getText();let a=`return (
105
98
  ${i}
106
99
  ${n}
107
100
  ${r}
108
- );`;d?.replaceWithText(a)}else R.warn(`No return expression found to wrap`)}await Bd(a),R.success(`Successfully wrapped provider in ${c}`)}catch(e){throw R.error(`Failed to wrap provider: ${e}`),e}}async function Pg(e){e.action===`package.json script`?Mg(e):e.action===`wrap provider`?await Ng(e):e.action===`next-steps`?R.info(e.data.message):e.action===`env`?await Ud({envs:e.data.envs}):R.error(`Unknown post-install step: ${e}`)}async function Fg(){await c.pathExists(`proofkit.json`)||(sf(rf),cf())}async function Ig(){let e=I.projectDir??process.cwd();if(!await c.pathExists(o.join(e,`components.json`)))throw Error("Shadcn is not installed. Please run `pnpm dlx shadcn@latest init` to install it.");await Fg()}async function Lg({projectDir:t=process.cwd(),dataSource:n}){if(n.type===`supabase`)throw Error(`Not implemented`);{let r=_f({projectDir:t,dataSourceName:n.name}).map(e=>e.schemaName).filter(Boolean);if(r.length===0){e.cancel(`This data source doesn't have any schemas to load data from`);return}return r.length===1?r[0]:V(await e.select({message:`Which schema should this template use?`,options:r.map(e=>({label:e,value:e??``}))}))}}async function Rg(t){let n=m(`Validating template`).start();try{await Ig();let r=await Tg(t);if(!r){n.fail(`Template ${t} not found in the ProofKit registry`);return}if(r.minimumProofKitVersion&&he.gt(r.minimumProofKitVersion,Me())){R.error(`Template ${t} requires ProofKit version ${r.minimumProofKitVersion}, but you are using version ${Me()}`),n.fail(`Template is not compatible with your ProofKit version`);return}n.succeed();let i=yg(r),a=B().registryTemplates,o,s,c,l;if(r.schemaRequired){let t=B();if(t.dataSources.length===0){n.fail(`This template requires a data source, but you don't have any. Add a data source first.`);return}let r=t.dataSources.length>1?V(await e.select({message:`Which data source should be used for this template?`,options:t.dataSources.map(e=>({value:e.name,label:e.name}))})):t.dataSources[0]?.name;if(o=t.dataSources.find(e=>e.name===r),!o){n.fail(`Data source ${r} not found`);return}if(s=await Lg({projectDir:I.projectDir,dataSource:o}),!s){n.fail(`Schema selection was cancelled`);return}}r.category===`page`&&(c=V(await e.text({message:`Enter the URL PATH for your new page`,placeholder:`/my-page`,validate:e=>{if(e.length===0)return`URL path is required`}})),c.startsWith(`/`)&&(c=c.slice(1)),l=Ce(c.replace(`/`,``).trim()));let u=new URL(`${Zf()}/r/${t}`);r.category===`page`&&u.searchParams.set(`routeName`,`/(main)/${c??t}`),t===`fmdapi`&&!a.includes(`utils/t3-env`)&&r.registryDependencies?.find(e=>e.includes(`utils/t3-env`))===void 0&&(await Rg(`utils/t3-env`),a=B().registryTemplates),await Xf([u.toString()],r.title);let d=r.files.filter(e=>e.handlebars);if(d.length>0){let e=o&&s?kg({dataSource:o,schemaName:s}):kg();c&&(e.routeName=c),l&&(e.pageName=l);let n=d.map(e=>({...e,destinationPath:e.destinationPath?.replace(`__PATH__`,`/(main)/${c??t}`)}));for(let t of n)await Ag(t,e)}if(r.category===`page`&&c&&l&&await Om({projectDir:I.projectDir,navType:`primary`,label:l,href:`/${c}`}),r.postInstall)for(let e of r.postInstall)e._from&&a.includes(e._from)||await Pg(e);of({registryTemplates:Te([...a,t,...i])})}catch(e){n.fail(`Failed to fetch template metadata.`),R.error(e)}}async function zg(){let{data:e,error:t}=await wg(`@get/`);if(t)throw Error(`Failed to fetch items from registry: ${t.message}`);return e}const Bg=async t=>{let n=B(),r=m(`Loading available components...`).start(),i;try{i=await zg()}catch(e){r.fail(`Failed to load registry components`),R.error(e);return}let a=i.filter(e=>!n.registryTemplates.includes(e.name)),o=we(a,e=>e.category),s=Te(a.map(e=>e.category));r.succeed();let c=V(await e.select({message:`What do you want to add to your project?`,options:[...s.includes(`page`)?[{label:`Page`,value:`page`}]:[],...n.dataSources.length>0?[{label:`Schema`,value:`schema`,hint:`load data from a new table or layout from an existing data source`}]:[],{label:`Data Source`,value:`data`,hint:`to connect to a new database or FileMaker file`},...s.filter(e=>e!==`page`).map(e=>({label:Ce(e),value:e}))]}));if(c===`schema`)await tm();else if(c===`data`)await ym();else if(s.includes(c)){let t=o[c];await Rg(V(await e.select({message:`Select a ${c} to add to your project`,options:t.map(e=>({label:e.title,hint:e.description,value:e.name}))})))}else R.error(`Could not find any available components in the category "${c}"`)},Vg=async(t,n)=>{if(t===`tanstack-query`)return await hm();if(t!==void 0)return await Rg(t);let r;try{r=B()}catch{return await Ig(),await Bg(n)}if(r.ui===`shadcn`)return await Bg(n);lf({commandName:`add`});let i=V(await e.select({message:`What do you want to add to your project?`,options:[{label:`Page`,value:`page`},...r.dataSources.length>0?[{label:`Schema`,value:`schema`,hint:`load data from a new table or layout from an existing data source`}]:[],{label:`React Email`,value:`react-email`},{label:`Data Source`,value:`data`,hint:`to connect to a new database or FileMaker file`},...r.auth.type===`none`&&r.appType===`browser`?[{label:`Auth`,value:`auth`}]:[]]}));i===`auth`?await gm():i===`data`?await ym():i===`page`?await km():i===`schema`?await tm():i===`react-email`&&await mm({noInstall:n?.noInstall})},Hg=()=>{let e=new i(`add`).description(`Add a new component to your project`).argument(`[name]`,`Type of component to add`).addOption(Ff).addOption(If).option(`--noInstall`,`Do not run your package manager install command`,!1).action(async(e,t)=>{await Vg(e,t)});return e.hook(`preAction`,(e,t)=>{L(t.opts()),I.baseCommand=`add`}),e.hook(`preSubcommand`,(e,t)=>{L(t.opts()),I.baseCommand=`add`}),e.addCommand(_m()),e.addCommand(Am()),e.addCommand(nm()),e.addCommand(bm()),e};async function Ug(){try{return await s(`vercel`,[`--version`]),!0}catch{return!1}}async function Wg(){let t=Nd(),n=e.spinner();n.start(`Installing Vercel CLI...`);try{return await s(t,[t===`npm`?`install`:`add`,`-g`,`vercel`]),n.stop(`Vercel CLI installed successfully`),!0}catch(e){return n.stop(`Failed to install Vercel CLI`),console.error(r.red(`Error installing Vercel CLI:`),e),!1}}async function Gg(){try{return!!(await c.readJSON(`.vercel/project.json`)).projectId}catch{return I.debug&&console.log(`
109
- Debug: No Vercel project configuration found`),!1}}async function Kg(){try{I.debug&&console.log(`
110
- Debug: Running vercel teams list command...`);let e=await s(`vercel`,[`teams`,`list`],{all:!0});I.debug&&console.log(`
101
+ );`;u?.replaceWithText(a)}else z.warn(`No return expression found to wrap`)}await Kp(a),z.success(`Successfully wrapped provider in ${s}`)}catch(e){throw z.error(`Failed to wrap provider: ${e}`),e}}async function Vv(e){e.action===`package.json script`?zv(e):e.action===`wrap provider`?await Bv(e):e.action===`next-steps`?z.info(e.data.message):e.action===`env`?await Yp({envs:e.data.envs}):z.error(`Unknown post-install step: ${e}`)}async function Hv(){await p.pathExists(`proofkit.json`)||(fm(lm),pm())}async function Uv(){let e=L.projectDir??process.cwd();if(!await p.pathExists(d.join(e,`components.json`)))throw Error("Shadcn is not installed. Please run `pnpm dlx shadcn@latest init` to install it.");await Hv()}async function Wv({projectDir:t=process.cwd(),dataSource:n}){if(n.type===`supabase`)throw Error(`Not implemented`);let r=Sm({projectDir:t,dataSourceName:n.name}).map(e=>e.schemaName).filter(Boolean);if(r.length===0){e.cancel(`This data source doesn't have any schemas to load data from`);return}return r.length===1?r[0]:H(await e.select({message:`Which schema should this template use?`,options:r.map(e=>({label:e,value:e??``}))}))}async function Gv(t){let n=re(`Validating template`).start();try{await Uv();let r=await Mv(t);if(!r){n.fail(`Template ${t} not found in the ProofKit registry`);return}if(r.minimumProofKitVersion&&ye.gt(r.minimumProofKitVersion,Ie())){z.error(`Template ${t} requires ProofKit version ${r.minimumProofKitVersion}, but you are using version ${Ie()}`),n.fail(`Template is not compatible with your ProofKit version`);return}n.succeed();let i=Ev(r),a=V().registryTemplates,o,s,c,l;if(r.schemaRequired){let t=V();if(t.dataSources.length===0){n.fail(`This template requires a data source, but you don't have any. Add a data source first.`);return}let r=t.dataSources.length>1?H(await e.select({message:`Which data source should be used for this template?`,options:t.dataSources.map(e=>({value:e.name,label:e.name}))})):t.dataSources[0]?.name;if(o=t.dataSources.find(e=>e.name===r),!o){n.fail(`Data source ${r} not found`);return}if(s=await Wv({projectDir:L.projectDir,dataSource:o}),!s){n.fail(`Schema selection was cancelled`);return}}r.category===`page`&&(c=H(await e.text({message:`Enter the URL PATH for your new page`,placeholder:`/my-page`,validate:e=>{if(e.length===0)return`URL path is required`}})),c.startsWith(`/`)&&(c=c.slice(1)),l=De(c.replace(`/`,``).trim()));let u=new URL(`${rh()}/r/${t}`);r.category===`page`&&u.searchParams.set(`routeName`,`/(main)/${c??t}`),t===`fmdapi`&&!a.includes(`utils/t3-env`)&&r.registryDependencies?.find(e=>e.includes(`utils/t3-env`))===void 0&&(await Gv(`utils/t3-env`),a=V().registryTemplates),await nh([u.toString()],r.title);let d=r.files.filter(e=>e.handlebars);if(d.length>0){let e={...o&&s?Iv({dataSource:o,schemaName:s}):Iv(),...c&&{routeName:c},...l&&{pageName:l}},n=d.map(e=>({...e,destinationPath:e.destinationPath?.replace(`__PATH__`,`/(main)/${c??t}`)}));for(let t of n)await Lv(t,e)}if(r.category===`page`&&c&&l&&await Pg({projectDir:L.projectDir,navType:`primary`,label:l,href:`/${c}`}),r.postInstall)for(let e of r.postInstall)e._from&&a.includes(e._from)||await Vv(e);dm({registryTemplates:ke([...a,t,...i])})}catch(e){n.fail(`Failed to fetch template metadata.`),z.error(e)}}async function Kv(){let{data:e,error:t}=await jv(`@get/`);if(t)throw Error(`Failed to fetch items from registry: ${t.message}`);return e}const qv=async e=>{let t=V(),n=re(`Loading available components...`).start(),r;try{r=await Kv()}catch(e){n.fail(`Failed to load registry components`),z.error(e);return}let i=r.filter(e=>!t.registryTemplates.includes(e.name)),a=Oe(i,e=>e.category),s=ke(i.map(e=>e.category));n.succeed();let c=H(await o({message:`What do you want to add to your project?`,options:[...s.includes(`page`)?[{label:`Page`,value:`page`}]:[],...t.dataSources.length>0?[{label:`Schema`,value:`schema`,hint:`load data from a new table or layout from an existing data source`}]:[],{label:`Data Source`,value:`data`,hint:`to connect to a new database or FileMaker file`},...s.filter(e=>e!==`page`).map(e=>({label:De(e),value:e}))]}));if(c===`schema`)await og();else if(c===`data`)await wg();else if(s.includes(c)){let e=a[c];await Gv(H(await o({message:`Select a ${c} to add to your project`,options:e.map(e=>({label:e.title,hint:e.description,value:e.name}))})))}else z.error(`Could not find any available components in the category "${c}"`)},Jv=async(e,t)=>{if(e===`tanstack-query`)return await bg();if(e!==void 0)return await Gv(e);let n;try{n=V()}catch{return await Uv(),await qv(t)}if(n.ui===`shadcn`)return await qv(t);mm({commandName:`add`});let r=H(await o({message:`What do you want to add to your project?`,options:[{label:`Page`,value:`page`},...n.dataSources.length>0?[{label:`Schema`,value:`schema`,hint:`load data from a new table or layout from an existing data source`}]:[],{label:`React Email`,value:`react-email`},{label:`Data Source`,value:`data`,hint:`to connect to a new database or FileMaker file`},...n.auth.type===`none`&&n.appType===`browser`?[{label:`Auth`,value:`auth`}]:[]]}));r===`auth`?await xg():r===`data`?await wg():r===`page`?await Fg():r===`schema`?await og():r===`react-email`&&await yg({noInstall:t?.noInstall})},Yv=()=>{let e=new l(`add`).description(`Add a new component to your project`).argument(`[name]`,`Type of component to add`).addOption(Bm).addOption(Vm).option(`--noInstall`,`Do not run your package manager install command`,!1).action(async(e,t)=>{await Jv(e,t)});return e.hook(`preAction`,(e,t)=>{R(t.opts()),L.baseCommand=`add`}),e.hook(`preSubcommand`,(e,t)=>{R(t.opts()),L.baseCommand=`add`}),e.addCommand(Sg()),e.addCommand(Ig()),e.addCommand(sg()),e.addCommand(Tg()),e},Xv=/^[✔\s]+/,Zv=/\s{2,}/,Qv=/^v/;async function $v(){try{return await f(`vercel`,[`--version`]),!0}catch{return!1}}async function ey(){let t=zp(),n=e.spinner();n.start(`Installing Vercel CLI...`);try{return await f(t,[t===`npm`?`install`:`add`,`-g`,`vercel`]),n.stop(`Vercel CLI installed successfully`),!0}catch(e){return n.stop(`Failed to install Vercel CLI`),console.error(c.red(`Error installing Vercel CLI:`),e),!1}}async function ty(){try{return!!(await p.readJSON(`.vercel/project.json`)).projectId}catch{return L.debug&&console.log(`
102
+ Debug: No Vercel project configuration found`),!1}}async function ny(){try{L.debug&&console.log(`
103
+ Debug: Running vercel teams list command...`);let e=await f(`vercel`,[`teams`,`list`],{all:!0});L.debug&&console.log(`
111
104
  Debug: Command output:`,e.all);let t=(e.all??``).split(`
112
- `).filter(Boolean),n=t.findIndex(e=>e.includes(`id`));if(n===-1)return[];let r=t.slice(n+1);I.debug&&(console.log(`
113
- Debug: Team lines:`),r.forEach(e=>console.log(`"${e}"`)));let i=r.map(e=>{let[t,...n]=e.replace(/^[✔\s]+/,``).trim().split(/\s{2,}/);return!t||n.length===0?null:{slug:t,name:n.join(` `).trim()}}).filter(e=>e!==null);return I.debug&&console.log(`
114
- Debug: Parsed teams:`,i),i}catch(e){return I.debug&&console.error(`Error getting Vercel teams:`,e),[]}}async function qg(){let t=e.spinner();try{let n=(await c.readJSON(`package.json`)).name,i=await Kg(),a=``;if(i.length>1){let t=await e.select({message:`Select a team to deploy under:`,options:[...i.map(e=>({value:e.slug,label:e.name}))]});if(e.isCancel(t))return console.log(r.yellow(`
115
- Operation cancelled`)),!1;t&&typeof t==`string`&&(a=`--scope=${t}`)}return t.start(`Creating Vercel project...`),await s(`vercel`,[`link`,`--yes`,...a?[a]:[]],{env:{VERCEL_PROJECT_NAME:n}}),t.message(`Pulling project settings...`),await s(`vercel`,[`pull`,`--yes`],{stdio:`inherit`}),t.stop(`Vercel project created successfully`),!0}catch(e){return t.stop(`Failed to set up Vercel project`),console.error(r.red(`Error setting up Vercel project:`),e),!1}}async function Jg(){let t=e.spinner();t.start(`Pushing environment variables to Vercel...`);try{let e=B(),n=o.join(process.cwd(),e.envFile);if(!c.existsSync(n))return t.stop(`No environment file found`),!0;let i=(await c.readFile(n,`utf-8`)).split(`
116
- `).filter(e=>e.trim()&&!e.startsWith(`#`)).map(e=>{let[t,...n]=e.split(`=`);if(!t)return null;let r=n.join(`=`);return{key:t.trim(),value:r.trim()}}).filter(e=>e!==null);I.debug&&(t.stop(),console.log(`
117
- Debug: Parsed environment variables:`),i.forEach(({key:e,value:t})=>{console.log(` ${e}=${t.substring(0,3)}...`)}),t.start(`Pushing environment variables to Vercel...`));let a=0,l=i.length;for(let e=0;e<l;e++){let{key:n,value:o}=i[e];t.message(`Pushing environment variables to Vercel... (${e+1}/${l})`);try{I.debug&&console.log(`\nDebug: Attempting to add ${n} to Vercel...`);let e=await s(`vercel`,[`env`,`add`,n,`production`],{input:o,stdio:`pipe`,reject:!1});if(I.debug&&(console.log(`Debug: Command exit code: ${e.exitCode}`),e.stdout&&console.log(`Debug: stdout:`,e.stdout),e.stderr&&console.log(`Debug: stderr:`,e.stderr)),e.exitCode!==0)throw Error(`Command failed with exit code ${e.exitCode}`)}catch(e){a++,I.debug&&(console.error(r.yellow(`\nDebug: Failed to add ${n}`)),console.error(`Debug: Full error:`,e))}}return a>0?t.stop(r.yellow(`Environment variables pushed with ${a} failures`)):t.stop(`Environment variables pushed successfully`),a<l}catch(e){return t.stop(`Failed to push environment variables`),I.debug&&(console.error(`
118
- Debug: Top-level error in pushEnvironmentVariables:`),console.error(e)),!1}}async function Yg(){let e=process.version.replace(/^v/,``).split(`.`)[0];try{let t=`.vercel/project.json`;if(!c.existsSync(t))return I.debug&&console.log(`Debug: No project.json found`),!1;let n=await c.readJSON(t);return I.debug&&console.log(`Debug: Current project config:`,n),n.settings={...n.settings,nodeVersion:`${e}.x`},await c.writeJSON(t,n,{spaces:2}),I.debug&&console.log(`Debug: Updated Node.js version to ${e}.x`),!0}catch(e){return I.debug&&console.error(`Debug: Failed to update Node.js version:`,e),!1}}async function Xg(){try{let e=await s(`vercel`,[`whoami`],{stdio:`pipe`,reject:!1});return I.debug&&console.log(`
119
- Debug: Vercel whoami result:`,e),e.exitCode===0}catch(e){return I.debug&&console.error(`Debug: Error checking Vercel login status:`,e),!1}}async function Zg(){console.log(r.blue(`
120
- You need to log in to Vercel first.`));try{return await s(`vercel`,[`login`],{stdio:`inherit`}),!0}catch(e){return console.error(r.red(`
121
- Failed to log in to Vercel:`),e),!1}}async function Qg(){if(I.debug&&console.log(`Running deploy...`),!await Ug()&&!await Wg()){console.log(r.red(`
122
- Failed to install Vercel CLI. Please install it manually using:`)),console.log(r.blue(`
123
- npm install -g vercel`));return}if(!await Xg()&&!await Zg()){console.log(r.red(`
124
- Failed to log in to Vercel. Please try again.`));return}if(!await Gg()){if(console.log(r.blue(`
125
- Setting up new Vercel project...`)),!await qg()){console.log(r.red(`
126
- Failed to set up Vercel project automatically.`));return}if(!await Jg()){console.log(r.red(`
127
- Failed to push environment variables. Aborting deployment.`));return}}console.log(r.blue(`
128
- Pulling latest project settings...`));try{await s(`vercel`,[`pull`,`--yes`],{stdio:`inherit`})}catch(e){console.error(r.red(`
129
- Failed to pull project settings:`),e);return}if(await Yg()||console.error(r.red(`
130
- Failed to set Node.js version. Continuing anyway...`)),I.localBuild){console.log(r.blue(`
131
- Preparing local build for Vercel...`));try{if((await s(`vercel`,[`build`],{stdio:`inherit`,reject:!1})).exitCode===0)console.log(r.green(`
132
- ✓ Local build successful!`));else{console.error(r.red(`
133
- ✖ Local build failed`)),console.log(r.yellow(`Fix the errors above and then try again.`));return}}catch(e){console.error(r.red(`
134
- Vercel build failed:`),e);return}console.log(r.blue(`
135
- Deploying to Vercel...`)),(await s(`vercel`,[`deploy`,`--prebuilt`,`--yes`],{stdio:`inherit`,reject:!1})).exitCode===0&&console.log(r.green(`
136
- ✓ Deployment successful!`))}else{console.log(r.blue(`
137
- Deploying to Vercel...`));try{if((await s(`vercel`,[`deploy`,`--yes`],{stdio:`inherit`,reject:!1})).exitCode===0)console.log(r.green(`
138
- ✓ Deployment successful!`));else{let e=Nd(),t=e===`npm`?`npm run`:e;console.error(r.red(`
139
- ✖ Deployment failed`)),console.log(r.yellow(`
140
- Troubleshooting Tips:`)),console.log(r.dim(`You can check for most errors before deploying for a faster iteration cycle`)),console.log(r.dim(`Run`)+` ${t} tsc `+r.dim(`to check for TypeScript errors (most common build errors)`)),console.log(r.dim(`Run`)+` ${t} build `+r.dim(`to run the full production build locally`))}}catch{return}}}const $g=()=>{let e=new i(`deploy`).description(`Deploy your ProofKit application to Vercel`).addOption(Ff).addOption(If).addOption(new a(`--local-build`,`Build locally before deploying`)).action(Qg);return e.hook(`preAction`,e=>{L(e.opts()),I.baseCommand=`deploy`,lf({commandName:`deploy`})}),e},e_=[`@radix-ui/react-slot`,`@tailwindcss/postcss`,`class-variance-authority`,`clsx`,`lucide-react`,`tailwind-merge`,`tailwindcss`,`tw-animate-css`],t_=[`prettier`,`prettier-plugin-tailwindcss`];async function n_(){let e=I.projectDir,t=o.join(v,`template/nextjs`);z({dependencies:e_,devMode:!1,projectDir:e}),z({dependencies:t_,devMode:!0,projectDir:e}),c.copySync(o.join(t,`components.json`),o.join(e,`components.json`)),c.copySync(o.join(t,`.prettierrc`),o.join(e,`.prettierrc`)),c.copySync(o.join(t,`postcss.config.cjs`),o.join(e,`postcss.config.cjs`)),c.copySync(o.join(t,`src/utils/styles.ts`),o.join(e,`src/utils/styles.ts`)),c.copySync(o.join(t,`src/config/theme/globals.css`),o.join(e,`src/config/theme/globals.css`)),await Id(),console.log(`
105
+ `).filter(Boolean),n=t.findIndex(e=>e.includes(`id`));if(n===-1)return[];let r=t.slice(n+1);if(L.debug){console.log(`
106
+ Debug: Team lines:`);for(let e of r)console.log(`"${e}"`)}let i=r.map(e=>{let[t,...n]=e.replace(Xv,``).trim().split(Zv);return!t||n.length===0?null:{slug:t,name:n.join(` `).trim()}}).filter(e=>e!==null);return L.debug&&console.log(`
107
+ Debug: Parsed teams:`,i),i}catch(e){return L.debug&&console.error(`Error getting Vercel teams:`,e),[]}}async function ry(){let t=e.spinner();try{let n=(await p.readJSON(`package.json`)).name,r=await ny(),i=``;if(r.length>1){let t=await e.select({message:`Select a team to deploy under:`,options:[...r.map(e=>({value:e.slug,label:e.name}))]});if(e.isCancel(t))return console.log(c.yellow(`
108
+ Operation cancelled`)),!1;t&&typeof t==`string`&&(i=`--scope=${t}`)}return t.start(`Creating Vercel project...`),await f(`vercel`,[`link`,`--yes`,...i?[i]:[]],{env:{VERCEL_PROJECT_NAME:n}}),t.message(`Pulling project settings...`),await f(`vercel`,[`pull`,`--yes`],{stdio:`inherit`}),t.stop(`Vercel project created successfully`),!0}catch(e){return t.stop(`Failed to set up Vercel project`),console.error(c.red(`Error setting up Vercel project:`),e),!1}}async function iy(){let t=e.spinner();t.start(`Pushing environment variables to Vercel...`);try{let e=V(),n=d.join(process.cwd(),e.envFile);if(!p.existsSync(n))return t.stop(`No environment file found`),!0;let r=(await p.readFile(n,`utf-8`)).split(`
109
+ `).filter(e=>e.trim()&&!e.startsWith(`#`)).map(e=>{let[t,...n]=e.split(`=`);if(!t)return null;let r=n.join(`=`);return{key:t.trim(),value:r.trim()}}).filter(e=>e!==null);if(L.debug){t.stop(),console.log(`
110
+ Debug: Parsed environment variables:`);for(let{key:e,value:t}of r)console.log(` ${e}=${t.substring(0,3)}...`);t.start(`Pushing environment variables to Vercel...`)}let i=0,a=r.length;for(let e=0;e<a;e++){let n=r[e];if(!n)continue;let{key:o,value:s}=n;t.message(`Pushing environment variables to Vercel... (${e+1}/${a})`);try{L.debug&&console.log(`\nDebug: Attempting to add ${o} to Vercel...`);let e=await f(`vercel`,[`env`,`add`,o,`production`],{input:s,stdio:`pipe`,reject:!1});if(L.debug&&(console.log(`Debug: Command exit code: ${e.exitCode}`),e.stdout&&console.log(`Debug: stdout:`,e.stdout),e.stderr&&console.log(`Debug: stderr:`,e.stderr)),e.exitCode!==0)throw Error(`Command failed with exit code ${e.exitCode}`)}catch(e){i++,L.debug&&(console.error(c.yellow(`\nDebug: Failed to add ${o}`)),console.error(`Debug: Full error:`,e))}}return i>0?t.stop(c.yellow(`Environment variables pushed with ${i} failures`)):t.stop(`Environment variables pushed successfully`),i<a}catch(e){return t.stop(`Failed to push environment variables`),L.debug&&(console.error(`
111
+ Debug: Top-level error in pushEnvironmentVariables:`),console.error(e)),!1}}async function ay(){let e=process.version.replace(Qv,``).split(`.`)[0];try{let t=`.vercel/project.json`;if(!p.existsSync(t))return L.debug&&console.log(`Debug: No project.json found`),!1;let n=await p.readJSON(t);return L.debug&&console.log(`Debug: Current project config:`,n),n.settings={...n.settings,nodeVersion:`${e}.x`},await p.writeJSON(t,n,{spaces:2}),L.debug&&console.log(`Debug: Updated Node.js version to ${e}.x`),!0}catch(e){return L.debug&&console.error(`Debug: Failed to update Node.js version:`,e),!1}}async function oy(){try{let e=await f(`vercel`,[`whoami`],{stdio:`pipe`,reject:!1});return L.debug&&console.log(`
112
+ Debug: Vercel whoami result:`,e),e.exitCode===0}catch(e){return L.debug&&console.error(`Debug: Error checking Vercel login status:`,e),!1}}async function sy(){console.log(c.blue(`
113
+ You need to log in to Vercel first.`));try{return await f(`vercel`,[`login`],{stdio:`inherit`}),!0}catch(e){return console.error(c.red(`
114
+ Failed to log in to Vercel:`),e),!1}}async function cy(){if(L.debug&&console.log(`Running deploy...`),!await $v()&&!await ey()){console.log(c.red(`
115
+ Failed to install Vercel CLI. Please install it manually using:`)),console.log(c.blue(`
116
+ npm install -g vercel`));return}if(!await oy()&&!await sy()){console.log(c.red(`
117
+ Failed to log in to Vercel. Please try again.`));return}if(!await ty()){if(console.log(c.blue(`
118
+ Setting up new Vercel project...`)),!await ry()){console.log(c.red(`
119
+ Failed to set up Vercel project automatically.`));return}if(!await iy()){console.log(c.red(`
120
+ Failed to push environment variables. Aborting deployment.`));return}}console.log(c.blue(`
121
+ Pulling latest project settings...`));try{await f(`vercel`,[`pull`,`--yes`],{stdio:`inherit`})}catch(e){console.error(c.red(`
122
+ Failed to pull project settings:`),e);return}if(await ay()||console.error(c.red(`
123
+ Failed to set Node.js version. Continuing anyway...`)),L.localBuild){console.log(c.blue(`
124
+ Preparing local build for Vercel...`));try{if((await f(`vercel`,[`build`],{stdio:`inherit`,reject:!1})).exitCode===0)console.log(c.green(`
125
+ ✓ Local build successful!`));else{console.error(c.red(`
126
+ ✖ Local build failed`)),console.log(c.yellow(`Fix the errors above and then try again.`));return}}catch(e){console.error(c.red(`
127
+ Vercel build failed:`),e);return}console.log(c.blue(`
128
+ Deploying to Vercel...`)),(await f(`vercel`,[`deploy`,`--prebuilt`,`--yes`],{stdio:`inherit`,reject:!1})).exitCode===0&&console.log(c.green(`
129
+ ✓ Deployment successful!`))}else{console.log(c.blue(`
130
+ Deploying to Vercel...`));try{if((await f(`vercel`,[`deploy`,`--yes`],{stdio:`inherit`,reject:!1})).exitCode===0)console.log(c.green(`
131
+ ✓ Deployment successful!`));else{let e=zp(),t=e===`npm`?`npm run`:e;console.error(c.red(`
132
+ ✖ Deployment failed`)),console.log(c.yellow(`
133
+ Troubleshooting Tips:`)),console.log(c.dim(`You can check for most errors before deploying for a faster iteration cycle`)),console.log(`${c.dim(`Run`)} ${t} tsc ${c.dim(`to check for TypeScript errors (most common build errors)`)}`),console.log(`${c.dim(`Run`)} ${t} build ${c.dim(`to run the full production build locally`)}`)}}catch{return}}}const ly=()=>{let e=new l(`deploy`).description(`Deploy your ProofKit application to Vercel`).addOption(Bm).addOption(Vm).addOption(new u(`--local-build`,`Build locally before deploying`)).action(cy);return e.hook(`preAction`,e=>{R(e.opts()),L.baseCommand=`deploy`,mm({commandName:`deploy`})}),e},uy=[`@radix-ui/react-slot`,`@tailwindcss/postcss`,`class-variance-authority`,`clsx`,`lucide-react`,`tailwind-merge`,`tailwindcss`,`tw-animate-css`],dy=[];async function fy(){let e=L.projectDir,t=d.join(_,`template/nextjs`);B({dependencies:uy,devMode:!1,projectDir:e}),B({dependencies:dy,devMode:!0,projectDir:e}),p.copySync(d.join(t,`components.json`),d.join(e,`components.json`)),p.copySync(d.join(t,`postcss.config.cjs`),d.join(e,`postcss.config.cjs`)),p.copySync(d.join(t,`src/utils/styles.ts`),d.join(e,`src/utils/styles.ts`)),p.copySync(d.join(t,`src/config/theme/globals.css`),d.join(e,`src/config/theme/globals.css`)),await Hp(),console.log(`
141
134
  ✅ shadcn/ui + Tailwind v4 upgrade complete!
142
- `)}const r_=[{key:`cursorRules`,title:`Upgrade Cursor Rules`,description:`Upgrade the .cursor rules in your project to the latest version.`,appType:[`browser`],function:Rf},{key:`shadcn`,title:`Add Shadcn`,description:`Add Shadcn to your project, to support easily adding new components from a variety of component registries.`,appType:[`browser`,`webviewer`],function:n_}];function i_(){let e=B();if(e.ui===`shadcn`)return[];let t=e.appliedUpgrades;return r_.filter(n=>!t.includes(n.key)&&n.appType.includes(e.appType)).map(({key:e,title:t,description:n})=>({key:e,title:t,description:n}))}async function a_(){let e=i_(),t=B();if(t.ui!==`shadcn`)for(let n of e){let e=r_.find(e=>e.key===n.key)?.function;if(e){await e();let r=t.appliedUpgrades;of({appliedUpgrades:[...r,n.key]})}}}function o_(e){if(e.type!==`fm`)return e.type;let t=o.join(I.projectDir,`.env`);c.existsSync(t)&&ae.config({path:t});let n=process.env[e.envNames.server]||`unknown server`,r=process.env[e.envNames.database]||`unknown database`;try{return`${new URL(n).hostname}/${r}`}catch(e){return I.debug&&console.error(`Error parsing server URL:`,e),`${n}/${r}`}}const s_=async t=>{let n=B();if(n.dataSources.length===0){e.note(`No data sources found in your project.`);return}let r=t;if(!r)r=V(await e.select({message:`Which data source do you want to remove?`,options:n.dataSources.map(e=>{let t=``;try{t=o_(e)}catch(e){I.debug&&console.error(`Error getting data source info:`,e),t=`unknown connection`}return{label:`${e.name} (${t})`,value:e.name}})}));else if(!n.dataSources.some(e=>e.name===r))throw Error(`Data source "${r}" not found in your project.`);let i=!0;if(!I.ci&&(i=V(await e.confirm({message:`Are you sure you want to remove the data source "${r}"? This will only remove it from your configuration, not replace any possible usage, which may cause TypeScript errors.`})),!i))throw new uf;let a=n.dataSources.find(e=>e.name===r);if(n.dataSources=n.dataSources.filter(e=>e.name!==r),sf(n),a?.type===`fm`){bf({dataSourceName:r}),I.debug&&e.note(`Removed schemas from fmschema.config.mjs`);let t=o.join(I.projectDir,`src`,`config`,`schemas`,r);c.existsSync(t)&&(c.removeSync(t),I.debug&&e.note(`Removed schema folder at ${t}`)),await hf(),I.debug&&e.note(`Successfully regenerated types`)}e.note(`Successfully removed data source "${r}"`)},c_=()=>{let e=new i(`data`).description(`Remove a data source from your project`).option(`--name <name>`,`Name of the data source to remove`).addOption(Ff).addOption(If).action(async e=>{await s_(N({name:j().optional()}).parse(e).name)});return e.hook(`preAction`,(e,t)=>{L(t.opts()),I.baseCommand=`remove`,lf({commandName:`remove`})}),e},l_=e=>{let t=o.join(I.projectDir,`src/app/navigation.tsx`);if(!c.existsSync(t))return[];let n=e.addSourceFileAtPath(t),r=[];return(n.getVariableDeclaration(`primaryRoutes`)?.getInitializerIfKind(_.ArrayLiteralExpression)?.getElements())?.forEach(e=>{if(h.isObjectLiteralExpression(e)){let t=e.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`label`),n=e.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`href`),i=t?.getInitializer()?.getText().replace(/['"]/g,``),a=n?.getInitializer()?.getText().replace(/['"]/g,``);i&&a&&r.push({label:i,href:a})}}),(n.getVariableDeclaration(`secondaryRoutes`)?.getInitializerIfKind(_.ArrayLiteralExpression)?.getElements())?.forEach(e=>{if(h.isObjectLiteralExpression(e)){let t=e.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`label`),n=e.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`href`),i=t?.getInitializer()?.getText().replace(/['"]/g,``),a=n?.getInitializer()?.getText().replace(/['"]/g,``);i&&a&&r.push({label:i,href:a})}}),r},u_=async(e,t)=>{let n=o.join(I.projectDir,`src/app/navigation.tsx`);if(!c.existsSync(n))return;let r=e.addSourceFileAtPath(n),i=r.getVariableDeclaration(`primaryRoutes`)?.getInitializerIfKind(_.ArrayLiteralExpression);if(i){let e=i.getElements();for(let n=e.length-1;n>=0;n--){let r=e[n];h.isObjectLiteralExpression(r)&&r.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`href`)?.getInitializer()?.getText().replace(/['"]/g,``)===t&&i.removeElement(n)}}let a=r.getVariableDeclaration(`secondaryRoutes`)?.getInitializerIfKind(_.ArrayLiteralExpression);if(a){let e=a.getElements();for(let n=e.length-1;n>=0;n--){let r=e[n];h.isObjectLiteralExpression(r)&&r.getProperties().find(e=>h.isPropertyAssignment(e)&&e.getName()===`href`)?.getInitializer()?.getText().replace(/['"]/g,``)===t&&a.removeElement(n)}}await Bd(e)},d_=async t=>{B();let n=I.projectDir,r=Hd(n),i=l_(r);if(i.length===0)return e.cancel(`No pages found in the navigation.`);t||=V(await e.select({message:`Select the page to remove`,options:i.map(e=>({label:`${e.label} (${e.href})`,value:e.href}))})),t.startsWith(`/`)||(t=`/${t}`);let a=I.appType===`browser`?o.join(n,`src/app/(main)`,t):o.join(n,`src/routes`,t),s=e.spinner();s.start(`Removing page`);try{if(!c.existsSync(a))return s.stop(`Page not found!`),e.cancel(`Page at ${t} does not exist`);await u_(r,t),await c.remove(a),s.stop(`Page removed successfully!`)}catch(e){s.stop(`Failed to remove page!`),console.error(`Error removing page:`,e),process.exit(1)}},f_=()=>{let e=new i(`page`).description(`Remove a page from your project`).argument(`[route]`,`The route of the page to remove`).addOption(Ff).addOption(If).action(async e=>{await d_(e)});return e.hook(`preAction`,(e,t)=>{L(t.opts()),I.baseCommand=`remove`,lf({commandName:`remove`})}),e},p_=async t=>{let n=t?.settings??B(),r=t?.projectDir??I.projectDir,i=t?.sourceName;if(!i&&n.dataSources.filter(e=>e.type===`fm`).length>1){let t=await e.select({message:`Which FileMaker data source do you want to remove a layout from?`,options:n.dataSources.filter(e=>e.type===`fm`).map(e=>({label:e.name,value:e.name}))});e.isCancel(t)&&(e.cancel(),process.exit(0)),i=j().parse(t)}if(i||=`filemaker`,!n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===i))throw Error(`FileMaker data source ${i} not found in your ProofKit config`);let a=_f({projectDir:r,dataSourceName:i});if(a.length===0){e.note(`No layouts found in data source "${i}"`,`Nothing to remove`);return}let o=t?.schemaName??V(await e.select({message:`Select a layout to remove`,options:a.map(e=>({label:`${e.layout} (${e.schemaName})`,value:e.schemaName??``})).filter(e=>e.value!==``)})),s=await e.confirm({message:`Are you sure you want to remove the layout "${o}"?`,initialValue:!1});(e.isCancel(s)||!s)&&(e.cancel(`Operation cancelled`),process.exit(0)),await xf({projectDir:r,dataSourceName:i,schemaName:o,runCodegen:!0}),e.outro(`Layout "${o}" has been removed from your project`)},m_=()=>new i(`layout`).alias(`schema`).description(`Remove a layout from your fmschema file`).action(async e=>{let t=e.settings;await p_({settings:t})}),h_=async t=>{let n=B(),r=V(await e.select({message:`What do you want to remove from your project?`,options:[{label:`Page`,value:`page`},{label:`Schema`,value:`schema`,hint:`remove a table or layout schema`},...n.appType===`browser`?[{label:`Data Source`,value:`data`,hint:`remove a database or FileMaker connection`}]:[]]}));r===`data`?await s_():r===`page`?await d_():r===`schema`&&await p_()};function g_(){let e=new i(`remove`).description(`Remove a component from your project`).argument(`[name]`,`Type of component to remove`).addOption(Ff).addOption(If).action(h_);return e.hook(`preAction`,(e,t)=>{L(t.opts()),I.baseCommand=`remove`,lf({commandName:`remove`})}),e.hook(`preSubcommand`,(e,t)=>{L(t.opts()),I.baseCommand=`remove`,lf({commandName:`remove`})}),e.addCommand(c_()),e.addCommand(f_()),e.addCommand(m_()),e}async function __(e){let t=e.settings.dataSources,n=!1;for await(let e of t)if(e.type===`supabase`)throw Error(`Supabase is not supported yet`);else if(e.type===`fm`)console.log(`Detected FileMaker database, generating types for ${e.name}...`),n=!0;else throw Error(`Unable to generate types for unknown database type`);n&&await hf()}const v_=()=>{let e=new i(`typegen`).description(`Generate types for your project`).action(__);return e.hook(`preAction`,(e,t)=>{let n=lf({commandName:`typegen`});t.setOptionValue(`settings`,n)}),e},y_=async()=>{L({}),I.baseCommand=`upgrade`,lf({commandName:`upgrade`}),R.info(`
135
+ `)}const py=[{key:`cursorRules`,title:`Upgrade Cursor Rules`,description:`Upgrade the .cursor rules in your project to the latest version.`,appType:[`browser`],function:Um},{key:`shadcn`,title:`Add Shadcn`,description:`Add Shadcn to your project, to support easily adding new components from a variety of component registries.`,appType:[`browser`,`webviewer`],function:fy}];function my(){let e=V();if(e.ui===`shadcn`)return[];let t=e.appliedUpgrades;return py.filter(n=>!t.includes(n.key)&&n.appType.includes(e.appType)).map(({key:e,title:t,description:n})=>({key:e,title:t,description:n}))}async function hy(){let e=my(),t=V();if(t.ui!==`shadcn`)for(let n of e){let e=py.find(e=>e.key===n.key)?.function;if(e){await e();let r=t.appliedUpgrades;dm({appliedUpgrades:[...r,n.key]})}}}function gy(e){if(e.type!==`fm`)return e.type;let t=d.join(L.projectDir,`.env`);p.existsSync(t)&&le.config({path:t});let n=process.env[e.envNames.server]||`unknown server`,r=process.env[e.envNames.database]||`unknown database`;try{return`${new URL(n).hostname}/${r}`}catch(e){return L.debug&&console.error(`Error parsing server URL:`,e),`${n}/${r}`}}const _y=async t=>{let n=V();if(n.dataSources.length===0){e.note(`No data sources found in your project.`);return}let r=t;if(r){if(!n.dataSources.some(e=>e.name===r))throw Error(`Data source "${r}" not found in your project.`)}else r=H(await e.select({message:`Which data source do you want to remove?`,options:n.dataSources.map(e=>{let t=``;try{t=gy(e)}catch(e){L.debug&&console.error(`Error getting data source info:`,e),t=`unknown connection`}return{label:`${e.name} (${t})`,value:e.name}})}));let i=!0;if(!L.ci&&(i=H(await e.confirm({message:`Are you sure you want to remove the data source "${r}"? This will only remove it from your configuration, not replace any possible usage, which may cause TypeScript errors.`})),!i))throw new hm;let a=n.dataSources.find(e=>e.name===r);if(n.dataSources=n.dataSources.filter(e=>e.name!==r),fm(n),a?.type===`fm`){Tm({dataSourceName:r}),L.debug&&e.note(`Removed schemas from fmschema.config.mjs`);let t=d.join(L.projectDir,`src`,`config`,`schemas`,r);p.existsSync(t)&&(p.removeSync(t),L.debug&&e.note(`Removed schema folder at ${t}`)),await bm(),L.debug&&e.note(`Successfully regenerated types`)}e.note(`Successfully removed data source "${r}"`)},vy=()=>{let e=new l(`data`).description(`Remove a data source from your project`).option(`--name <name>`,`Name of the data source to remove`).addOption(Bm).addOption(Vm).action(async e=>{await _y(P({name:M().optional()}).parse(e).name)});return e.hook(`preAction`,(e,t)=>{R(t.opts()),L.baseCommand=`remove`,mm({commandName:`remove`})}),e},yy=e=>{let t=d.join(L.projectDir,`src/app/navigation.tsx`);if(!p.existsSync(t))return[];let n=e.addSourceFileAtPath(t),r=[],i=n.getVariableDeclaration(`primaryRoutes`)?.getInitializerIfKind(g.ArrayLiteralExpression)?.getElements();if(i){for(let e of i)if(ie.isObjectLiteralExpression(e)){let t=e.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`label`),n=e.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`href`),i=t?.getInitializer()?.getText().replace(/['"]/g,``),a=n?.getInitializer()?.getText().replace(/['"]/g,``);i&&a&&r.push({label:i,href:a})}}let a=n.getVariableDeclaration(`secondaryRoutes`)?.getInitializerIfKind(g.ArrayLiteralExpression)?.getElements();if(a){for(let e of a)if(ie.isObjectLiteralExpression(e)){let t=e.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`label`),n=e.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`href`),i=t?.getInitializer()?.getText().replace(/['"]/g,``),a=n?.getInitializer()?.getText().replace(/['"]/g,``);i&&a&&r.push({label:i,href:a})}}return r},by=async(e,t)=>{let n=d.join(L.projectDir,`src/app/navigation.tsx`);if(!p.existsSync(n))return;let r=e.addSourceFileAtPath(n),i=r.getVariableDeclaration(`primaryRoutes`)?.getInitializerIfKind(g.ArrayLiteralExpression);if(i){let e=i.getElements();for(let n=e.length-1;n>=0;n--){let r=e[n];ie.isObjectLiteralExpression(r)&&r.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`href`)?.getInitializer()?.getText().replace(/['"]/g,``)===t&&i.removeElement(n)}}let a=r.getVariableDeclaration(`secondaryRoutes`)?.getInitializerIfKind(g.ArrayLiteralExpression);if(a){let e=a.getElements();for(let n=e.length-1;n>=0;n--){let r=e[n];ie.isObjectLiteralExpression(r)&&r.getProperties().find(e=>ie.isPropertyAssignment(e)&&e.getName()===`href`)?.getInitializer()?.getText().replace(/['"]/g,``)===t&&a.removeElement(n)}}await Kp(e)},xy=async t=>{V();let n=L.projectDir,r=Jp(n),i=yy(r);if(i.length===0)return e.cancel(`No pages found in the navigation.`);let a=t;a||=H(await e.select({message:`Select the page to remove`,options:i.map(e=>({label:`${e.label} (${e.href})`,value:e.href}))})),a.startsWith(`/`)||(a=`/${a}`);let o=L.appType===`browser`?d.join(n,`src/app/(main)`,a):d.join(n,`src/routes`,a),s=e.spinner();s.start(`Removing page`);try{if(!p.existsSync(o))return s.stop(`Page not found!`),e.cancel(`Page at ${a} does not exist`);await by(r,a),await p.remove(o),s.stop(`Page removed successfully!`)}catch(e){s.stop(`Failed to remove page!`),console.error(`Error removing page:`,e),process.exit(1)}},Sy=()=>{let e=new l(`page`).description(`Remove a page from your project`).argument(`[route]`,`The route of the page to remove`).addOption(Bm).addOption(Vm).action(async e=>{await xy(e)});return e.hook(`preAction`,(e,t)=>{R(t.opts()),L.baseCommand=`remove`,mm({commandName:`remove`})}),e},Cy=async t=>{let n=t?.settings??V(),r=t?.projectDir??L.projectDir,i=t?.sourceName;if(!i&&n.dataSources.filter(e=>e.type===`fm`).length>1){let t=await e.select({message:`Which FileMaker data source do you want to remove a layout from?`,options:n.dataSources.filter(e=>e.type===`fm`).map(e=>({label:e.name,value:e.name}))});e.isCancel(t)&&(e.cancel(),process.exit(0)),i=M().parse(t)}if(i||=`filemaker`,!n.dataSources.filter(e=>e.type===`fm`).find(e=>e.name===i))throw Error(`FileMaker data source ${i} not found in your ProofKit config`);let a=Sm({projectDir:r,dataSourceName:i});if(a.length===0){e.note(`No layouts found in data source "${i}"`,`Nothing to remove`);return}let o=t?.schemaName??H(await e.select({message:`Select a layout to remove`,options:a.map(e=>({label:`${e.layout} (${e.schemaName})`,value:e.schemaName??``})).filter(e=>e.value!==``)})),s=await e.confirm({message:`Are you sure you want to remove the layout "${o}"?`,initialValue:!1});(e.isCancel(s)||!s)&&(e.cancel(`Operation cancelled`),process.exit(0)),await Em({projectDir:r,dataSourceName:i,schemaName:o,runCodegen:!0}),e.outro(`Layout "${o}" has been removed from your project`)},wy=()=>new l(`layout`).alias(`schema`).description(`Remove a layout from your fmschema file`).action(async e=>{let t=e.settings;await Cy({settings:t})}),Ty=async t=>{let n=V(),r=H(await e.select({message:`What do you want to remove from your project?`,options:[{label:`Page`,value:`page`},{label:`Schema`,value:`schema`,hint:`remove a table or layout schema`},...n.appType===`browser`?[{label:`Data Source`,value:`data`,hint:`remove a database or FileMaker connection`}]:[]]}));r===`data`?await _y():r===`page`?await xy():r===`schema`&&await Cy()};function Ey(){let e=new l(`remove`).description(`Remove a component from your project`).argument(`[name]`,`Type of component to remove`).addOption(Bm).addOption(Vm).action(Ty);return e.hook(`preAction`,(e,t)=>{R(t.opts()),L.baseCommand=`remove`,mm({commandName:`remove`})}),e.hook(`preSubcommand`,(e,t)=>{R(t.opts()),L.baseCommand=`remove`,mm({commandName:`remove`})}),e.addCommand(vy()),e.addCommand(Sy()),e.addCommand(wy()),e}async function Dy(e){let t=e.settings.dataSources,n=!1;for await(let e of t){if(e.type===`supabase`)throw Error(`Supabase is not supported yet`);if(e.type===`fm`)console.log(`Detected FileMaker database, generating types for ${e.name}...`),n=!0;else throw Error(`Unable to generate types for unknown database type`)}n&&await bm()}const Oy=()=>{let e=new l(`typegen`).description(`Generate types for your project`).action(Dy);return e.hook(`preAction`,(e,t)=>{let n=mm({commandName:`typegen`});t.setOptionValue(`settings`,n)}),e},ky=async()=>{R({}),L.baseCommand=`upgrade`,mm({commandName:`upgrade`}),z.info(`
143
136
  Upgrading ProofKit components...
144
- `);try{await a_(),R.info(r.green(`✔ Successfully upgraded components
145
- `))}catch(e){R.error(`Failed to upgrade components:`,e),process.exit(1)}};new i().name(`upgrade`).description(`Upgrade ProofKit components in your project`).action(y_);const b_=async()=>{let t=B(),n=i_();switch(n.length>0&&(e.log.info(`${r.yellow(`There are upgrades available for your ProofKit project`)}\n${n.map(e=>`- ${e.title}`).join(`
146
- `)}`),V(await e.confirm({message:`Would you like to run them now?`,initialValue:!0}))?(await a_(),e.log.success(r.green(`Successfully ran all upgrades`))):e.log.info(`You can apply the upgrades later by running ${r.cyan(`proofkit upgrade`)}`)),V(await e.select({message:`What would you like to do?`,options:[{label:`Add Components`,value:`add`,hint:`Add new pages, schemas, data sources, etc.`},{label:`Remove Components`,value:`remove`,hint:`Remove pages, schemas, data sources, etc.`},{label:`Generate Types`,value:`typegen`,hint:`Update field definitions from your data sources`},{label:`Deploy`,value:`deploy`,hint:`Deploy your app to Vercel`},{label:`Upgrade Components`,value:`upgrade`,hint:`Update ProofKit components to latest version`},{label:`View Documentation`,value:`docs`,hint:`Open ProofKit documentation`}]}))){case`add`:await Vg(void 0);break;case`remove`:await h_(void 0);break;case`docs`:e.log.info(`Opening ${r.cyan(ze)} in your browser...`),await ye(ze);break;case`typegen`:await __({settings:t});break;case`deploy`:await Qg();break;case`upgrade`:await y_();break}},x_=()=>{let e=new i(`upgrade`).description(`Upgrade ProofKit components in your project`).addOption(Ff).action(async e=>{L(e),await y_()});return e.hook(`preAction`,(e,t)=>{L(t.opts()),I.baseCommand=`upgrade`,lf({commandName:`upgrade`})}),e};function S_(){return new Promise((e,t)=>{xe.get(`https://registry.npmjs.org/-/package/@proofkit/cli/dist-tags`,n=>{if(n.statusCode===200){let t=``;n.on(`data`,e=>t+=e),n.on(`end`,()=>{e(JSON.parse(t).latest)})}else t()}).on(`error`,()=>{t()})})}const C_=async()=>S_().catch(()=>{try{return ne(`npm view proofkit version`).toString().trim()}catch{return null}}),w_=async()=>{let t=await C_(),n=Me();if(t&&me.valid(n)&&me.valid(t)&&me.lt(n,t)){let i=Nd();e.log.warn(`${r.yellow(`You are using an outdated version of proofkit.`)} Your version: ${n}. Latest version: ${t}.
147
- Run ${r.magenta.bold(`${i} install ${Re}@latest`)} to get the latest updates.`)}return{npmVersion:t,currentVersion:n}},T_=Me();(async()=>{let t=new i;pm(),await w_(),t.name(Re).version(T_).command(`default`,{hidden:!0,isDefault:!0}).addOption(Ff).action(async t=>{L(t);let n;try{n=B()}catch{}I.ci&&R.warn(`Running in CI mode`),n?(e.intro(`Found ${fm(`ProofKit`)} project`),await b_()):(e.intro(`No ${fm(`ProofKit`)} project found, running \`init\``),await dm())}).addHelpText(`afterAll`,`\n The ProofKit CLI was inspired by the ${r.hex(`#E8DCFF`).bold(`t3 stack`)}\n`),t.addCommand(lm()),t.addCommand(Hg()),t.addCommand(g_()),t.addCommand(v_()),t.addCommand($g()),t.addCommand(x_()),await t.parseAsync(process.argv),process.exit(0)})().catch(e=>{e instanceof uf?process.exit(0):e instanceof Error?(R.error(`Aborting installation...`),R.error(e)):(R.error(`An unknown error has occurred. Please open an issue on github with the below:`),console.log(e)),process.exit(1)});export{};
137
+ `);try{await hy(),z.info(c.green(`✔ Successfully upgraded components
138
+ `))}catch(e){z.error(`Failed to upgrade components:`,e),process.exit(1)}};new l().name(`upgrade`).description(`Upgrade ProofKit components in your project`).action(ky);const Ay=async()=>{let e=V(),t=my();t.length>0&&(a.info(`${c.yellow(`There are upgrades available for your ProofKit project`)}\n${t.map(e=>`- ${e.title}`).join(`
139
+ `)}`),H(await n({message:`Would you like to run them now?`,initialValue:!0}))?(await hy(),a.success(c.green(`Successfully ran all upgrades`))):a.info(`You can apply the upgrades later by running ${c.cyan(`proofkit upgrade`)}`));let r=H(await o({message:`What would you like to do?`,options:[{label:`Add Components`,value:`add`,hint:`Add new pages, schemas, data sources, etc.`},{label:`Remove Components`,value:`remove`,hint:`Remove pages, schemas, data sources, etc.`},{label:`Generate Types`,value:`typegen`,hint:`Update field definitions from your data sources`},{label:`Deploy`,value:`deploy`,hint:`Deploy your app to Vercel`},{label:`Upgrade Components`,value:`upgrade`,hint:`Update ProofKit components to latest version`},{label:`View Documentation`,value:`docs`,hint:`Open ProofKit documentation`}]}));switch(r){case`add`:await Jv(void 0);break;case`remove`:await Ty(void 0);break;case`docs`:a.info(`Opening ${c.cyan(Ue)} in your browser...`),await Ce(Ue);break;case`typegen`:await Dy({settings:e});break;case`deploy`:await cy();break;case`upgrade`:await ky();break;default:throw Error(`Unknown menu choice: ${r}`)}},jy=()=>{let e=new l(`upgrade`).description(`Upgrade ProofKit components in your project`).addOption(Bm).action(async e=>{R(e),await ky()});return e.hook(`preAction`,(e,t)=>{R(t.opts()),L.baseCommand=`upgrade`,mm({commandName:`upgrade`})}),e};function My(){return new Promise((e,t)=>{Te.get(`https://registry.npmjs.org/-/package/@proofkit/cli/dist-tags`,n=>{if(n.statusCode===200){let t=``;n.on(`data`,e=>{t+=e}),n.on(`end`,()=>{e(JSON.parse(t).latest)})}else t()}).on(`error`,()=>{t()})})}const Ny=async()=>My().catch(()=>{try{return ce(`npm view proofkit version`).toString().trim()}catch{return null}}),Py=async()=>{let t=await Ny(),n=Ie();if(t&&ve.valid(n)&&ve.valid(t)&&ve.lt(n,t)){let r=zp();e.log.warn(`${c.yellow(`You are using an outdated version of proofkit.`)} Your version: ${n}. Latest version: ${t}.
140
+ Run ${c.magenta.bold(`${r} install ${He}@latest`)} to get the latest updates.`)}return{npmVersion:t,currentVersion:n}},Fy=Ie();(async()=>{let e=new l;vg(),await Py(),e.name(He).version(Fy).command(`default`,{hidden:!0,isDefault:!0}).addOption(Bm).action(async e=>{R(e);let t;try{t=V()}catch{}L.ci&&z.warn(`Running in CI mode`),t?(r(`Found ${_g(`ProofKit`)} project`),await Ay()):(r(`No ${_g(`ProofKit`)} project found, running \`init\``),await gg())}).addHelpText(`afterAll`,`\n The ProofKit CLI was inspired by the ${c.hex(`#E8DCFF`).bold(`t3 stack`)}\n`),e.addCommand(mg()),e.addCommand(Yv()),e.addCommand(Ey()),e.addCommand(Oy()),e.addCommand(ly()),e.addCommand(jy()),await e.parseAsync(process.argv),process.exit(0)})().catch(e=>{e instanceof hm?process.exit(0):e instanceof Error?(z.error(`Aborting installation...`),z.error(e)):(z.error(`An unknown error has occurred. Please open an issue on github with the below:`),console.log(e)),process.exit(1)});export{};