octocode-cli 1.2.9 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,82 @@
1
1
  #!/usr/bin/env node
2
- var um=Object.defineProperty;var Re=(e,o)=>{for(var n in o)um(e,n,{get:o[n],enumerable:!0})};var Gc={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m"},s=(e,o)=>`${Gc[e]}${o}${Gc.reset}`,m=e=>s("bright",e),l=e=>s("dim",e);import{spawnSync as Jh}from"node:child_process";import{existsSync as jn,readFileSync as qu,writeFileSync as Ku,unlinkSync as Gu,statSync as gh,chmodSync as fh}from"node:fs";import{createCipheriv as hh,createDecipheriv as vh,randomBytes as Ju}from"node:crypto";import{existsSync as yh,mkdirSync as bh}from"node:fs";import{join as Oe}from"node:path";import Un from"node:os";import $h from"node:path";var I={};Re(I,{$brand:()=>pr,$input:()=>_s,$output:()=>Ss,NEVER:()=>dr,TimePrecision:()=>Es,ZodAny:()=>lu,ZodArray:()=>mu,ZodBase64:()=>La,ZodBase64URL:()=>Ra,ZodBigInt:()=>mo,ZodBigIntFormat:()=>Va,ZodBoolean:()=>po,ZodCIDRv4:()=>Da,ZodCIDRv6:()=>Ua,ZodCUID:()=>Oa,ZodCUID2:()=>Ta,ZodCatch:()=>Au,ZodCustom:()=>Nn,ZodCustomStringFormat:()=>ou,ZodDate:()=>An,ZodDefault:()=>_u,ZodDiscriminatedUnion:()=>gu,ZodE164:()=>Za,ZodEmail:()=>_a,ZodEmoji:()=>Ia,ZodEnum:()=>co,ZodError:()=>Kg,ZodFile:()=>xu,ZodGUID:()=>_n,ZodIPv4:()=>Na,ZodIPv6:()=>ja,ZodISODate:()=>wn,ZodISODateTime:()=>kn,ZodISODuration:()=>xn,ZodISOTime:()=>Cn,ZodIntersection:()=>fu,ZodIssueCode:()=>eh,ZodJWT:()=>Fa,ZodKSUID:()=>za,ZodLazy:()=>Uu,ZodLiteral:()=>wu,ZodMap:()=>bu,ZodNaN:()=>zu,ZodNanoID:()=>Ea,ZodNever:()=>du,ZodNonOptional:()=>Ja,ZodNull:()=>au,ZodNullable:()=>Su,ZodNumber:()=>uo,ZodNumberFormat:()=>vt,ZodObject:()=>Mn,ZodOptional:()=>Ka,ZodPipe:()=>Xa,ZodPrefault:()=>Iu,ZodPromise:()=>Ru,ZodReadonly:()=>Nu,ZodRealError:()=>ht,ZodRecord:()=>Wa,ZodSet:()=>$u,ZodString:()=>lo,ZodStringFormat:()=>Z,ZodSuccess:()=>Tu,ZodSymbol:()=>iu,ZodTemplateLiteral:()=>Du,ZodTransform:()=>Ha,ZodTuple:()=>vu,ZodType:()=>z,ZodULID:()=>Aa,ZodURL:()=>Pa,ZodUUID:()=>Ie,ZodUndefined:()=>su,ZodUnion:()=>Ba,ZodUnknown:()=>uu,ZodVoid:()=>pu,ZodXID:()=>Ma,_ZodString:()=>Sa,_default:()=>Pu,any:()=>Of,array:()=>Ga,base64:()=>hf,base64url:()=>vf,bigint:()=>Sf,boolean:()=>ru,catch:()=>Mu,check:()=>Zu,cidrv4:()=>gf,cidrv6:()=>ff,clone:()=>ce,coerce:()=>Ya,config:()=>K,core:()=>Pe,cuid:()=>af,cuid2:()=>cf,custom:()=>Kf,date:()=>Af,discriminatedUnion:()=>Df,e164:()=>yf,email:()=>Xg,emoji:()=>rf,endsWith:()=>eo,enum:()=>ku,file:()=>Vf,flattenError:()=>Lt,float32:()=>kf,float64:()=>wf,formatError:()=>Rt,function:()=>ma,getErrorMap:()=>oh,globalRegistry:()=>he,gt:()=>Se,gte:()=>re,guid:()=>Yg,includes:()=>Yt,instanceof:()=>Jf,int:()=>xa,int32:()=>Cf,int64:()=>_f,intersection:()=>hu,ipv4:()=>pf,ipv6:()=>mf,iso:()=>Sn,json:()=>Yf,jwt:()=>bf,keyof:()=>Mf,ksuid:()=>df,lazy:()=>Lu,length:()=>ft,literal:()=>Cu,locales:()=>Wt,looseObject:()=>jf,lowercase:()=>Jt,lt:()=>xe,lte:()=>me,map:()=>Rf,maxLength:()=>gt,maxSize:()=>mt,mime:()=>to,minLength:()=>Ne,minSize:()=>qe,multipleOf:()=>He,nan:()=>Wf,nanoid:()=>sf,nativeEnum:()=>Ff,negative:()=>na,never:()=>Tn,nonnegative:()=>ia,nonoptional:()=>Ou,nonpositive:()=>ra,normalize:()=>oo,null:()=>cu,nullable:()=>En,nullish:()=>Gf,number:()=>nu,object:()=>zf,optional:()=>In,overwrite:()=>_e,parse:()=>ba,parseAsync:()=>$a,partialRecord:()=>Lf,pipe:()=>On,positive:()=>oa,prefault:()=>Eu,preprocess:()=>Qf,prettifyError:()=>Sr,promise:()=>qf,property:()=>sa,readonly:()=>ju,record:()=>yu,refine:()=>Fu,regex:()=>Kt,regexes:()=>Ge,registry:()=>Xo,safeParse:()=>ka,safeParseAsync:()=>wa,set:()=>Zf,setErrorMap:()=>th,size:()=>qt,startsWith:()=>Qt,strictObject:()=>Nf,string:()=>Ca,stringFormat:()=>$f,stringbool:()=>Xf,success:()=>Bf,superRefine:()=>Vu,symbol:()=>If,templateLiteral:()=>Hf,toJSONSchema:()=>ga,toLowerCase:()=>ro,toUpperCase:()=>io,transform:()=>qa,treeifyError:()=>xr,trim:()=>no,tuple:()=>Uf,uint32:()=>xf,uint64:()=>Pf,ulid:()=>lf,undefined:()=>Ef,union:()=>zn,unknown:()=>Pn,uppercase:()=>Xt,url:()=>nf,uuid:()=>Qg,uuidv4:()=>ef,uuidv6:()=>tf,uuidv7:()=>of,void:()=>Tf,xid:()=>uf});var Pe={};Re(Pe,{$ZodAny:()=>Qi,$ZodArray:()=>Vt,$ZodAsyncError:()=>fe,$ZodBase64:()=>Vi,$ZodBase64URL:()=>Gi,$ZodBigInt:()=>qo,$ZodBigIntFormat:()=>Ki,$ZodBoolean:()=>Ft,$ZodCIDRv4:()=>Ri,$ZodCIDRv6:()=>Zi,$ZodCUID:()=>Ei,$ZodCUID2:()=>Oi,$ZodCatch:()=>ys,$ZodCheck:()=>B,$ZodCheckBigIntFormat:()=>ii,$ZodCheckEndsWith:()=>vi,$ZodCheckGreaterThan:()=>Go,$ZodCheckIncludes:()=>fi,$ZodCheckLengthEquals:()=>di,$ZodCheckLessThan:()=>Vo,$ZodCheckLowerCase:()=>mi,$ZodCheckMaxLength:()=>li,$ZodCheckMaxSize:()=>si,$ZodCheckMimeType:()=>bi,$ZodCheckMinLength:()=>ui,$ZodCheckMinSize:()=>ai,$ZodCheckMultipleOf:()=>ni,$ZodCheckNumberFormat:()=>ri,$ZodCheckOverwrite:()=>$i,$ZodCheckProperty:()=>yi,$ZodCheckRegex:()=>pi,$ZodCheckSizeEquals:()=>ci,$ZodCheckStartsWith:()=>hi,$ZodCheckStringFormat:()=>lt,$ZodCheckUpperCase:()=>gi,$ZodCustom:()=>xs,$ZodCustomStringFormat:()=>Hi,$ZodDate:()=>os,$ZodDefault:()=>gs,$ZodDiscriminatedUnion:()=>rs,$ZodE164:()=>Bi,$ZodEmail:()=>Si,$ZodEmoji:()=>Pi,$ZodEnum:()=>ls,$ZodError:()=>Ut,$ZodFile:()=>ds,$ZodFunction:()=>$n,$ZodGUID:()=>Ci,$ZodIPv4:()=>Ui,$ZodIPv6:()=>Li,$ZodISODate:()=>Ni,$ZodISODateTime:()=>zi,$ZodISODuration:()=>Di,$ZodISOTime:()=>ji,$ZodIntersection:()=>is,$ZodJWT:()=>Wi,$ZodKSUID:()=>Mi,$ZodLazy:()=>Cs,$ZodLiteral:()=>us,$ZodMap:()=>as,$ZodNaN:()=>bs,$ZodNanoID:()=>Ii,$ZodNever:()=>es,$ZodNonOptional:()=>hs,$ZodNull:()=>Yi,$ZodNullable:()=>ms,$ZodNumber:()=>Ho,$ZodNumberFormat:()=>qi,$ZodObject:()=>ns,$ZodOptional:()=>ps,$ZodPipe:()=>Bt,$ZodPrefault:()=>fs,$ZodPromise:()=>ws,$ZodReadonly:()=>$s,$ZodRealError:()=>ct,$ZodRecord:()=>ss,$ZodRegistry:()=>dt,$ZodSet:()=>cs,$ZodString:()=>Be,$ZodStringFormat:()=>L,$ZodSuccess:()=>vs,$ZodSymbol:()=>Ji,$ZodTemplateLiteral:()=>ks,$ZodTransform:()=>Gt,$ZodTuple:()=>We,$ZodType:()=>A,$ZodULID:()=>Ti,$ZodURL:()=>_i,$ZodUUID:()=>xi,$ZodUndefined:()=>Xi,$ZodUnion:()=>Ko,$ZodUnknown:()=>ut,$ZodVoid:()=>ts,$ZodXID:()=>Ai,$brand:()=>pr,$constructor:()=>g,$input:()=>_s,$output:()=>Ss,Doc:()=>Zt,JSONSchema:()=>Ql,JSONSchemaGenerator:()=>ao,NEVER:()=>dr,TimePrecision:()=>Es,_any:()=>Js,_array:()=>so,_base64:()=>hn,_base64url:()=>vn,_bigint:()=>Vs,_boolean:()=>Zs,_catch:()=>Fg,_cidrv4:()=>gn,_cidrv6:()=>fn,_coercedBigint:()=>Gs,_coercedBoolean:()=>Fs,_coercedDate:()=>ea,_coercedNumber:()=>Ns,_coercedString:()=>Is,_cuid:()=>an,_cuid2:()=>cn,_custom:()=>la,_date:()=>Qs,_default:()=>Lg,_discriminatedUnion:()=>Ig,_e164:()=>yn,_email:()=>Yo,_emoji:()=>rn,_endsWith:()=>eo,_enum:()=>Mg,_file:()=>ca,_float32:()=>Ds,_float64:()=>Us,_gt:()=>Se,_gte:()=>re,_guid:()=>Ht,_includes:()=>Yt,_int:()=>js,_int32:()=>Ls,_int64:()=>Bs,_intersection:()=>Eg,_ipv4:()=>pn,_ipv6:()=>mn,_isoDate:()=>Ts,_isoDateTime:()=>Os,_isoDuration:()=>Ms,_isoTime:()=>As,_jwt:()=>bn,_ksuid:()=>dn,_lazy:()=>Wg,_length:()=>ft,_literal:()=>Ng,_lowercase:()=>Jt,_lt:()=>xe,_lte:()=>me,_map:()=>Tg,_max:()=>me,_maxLength:()=>gt,_maxSize:()=>mt,_mime:()=>to,_min:()=>re,_minLength:()=>Ne,_minSize:()=>qe,_multipleOf:()=>He,_nan:()=>ta,_nanoid:()=>sn,_nativeEnum:()=>zg,_negative:()=>na,_never:()=>Xs,_nonnegative:()=>ia,_nonoptional:()=>Rg,_nonpositive:()=>ra,_normalize:()=>oo,_null:()=>Ks,_nullable:()=>Ug,_number:()=>zs,_optional:()=>Dg,_overwrite:()=>_e,_parse:()=>jo,_parseAsync:()=>Uo,_pipe:()=>Vg,_positive:()=>oa,_promise:()=>Hg,_property:()=>sa,_readonly:()=>Gg,_record:()=>Og,_refine:()=>ua,_regex:()=>Kt,_safeParse:()=>Ro,_safeParseAsync:()=>Zo,_set:()=>Ag,_size:()=>qt,_startsWith:()=>Qt,_string:()=>Ps,_stringFormat:()=>pa,_stringbool:()=>da,_success:()=>Zg,_symbol:()=>Hs,_templateLiteral:()=>Bg,_toLowerCase:()=>ro,_toUpperCase:()=>io,_transform:()=>jg,_trim:()=>no,_tuple:()=>aa,_uint32:()=>Rs,_uint64:()=>Ws,_ulid:()=>ln,_undefined:()=>qs,_union:()=>Pg,_unknown:()=>pt,_uppercase:()=>Xt,_url:()=>nn,_uuid:()=>Qo,_uuidv4:()=>en,_uuidv6:()=>tn,_uuidv7:()=>on,_void:()=>Ys,_xid:()=>un,clone:()=>ce,config:()=>K,flattenError:()=>Lt,formatError:()=>Rt,function:()=>ma,globalConfig:()=>Ot,globalRegistry:()=>he,isValidBase64:()=>Fi,isValidBase64URL:()=>ul,isValidJWT:()=>dl,locales:()=>Wt,parse:()=>Do,parseAsync:()=>Lo,prettifyError:()=>Sr,regexes:()=>Ge,registry:()=>Xo,safeParse:()=>_r,safeParseAsync:()=>Pr,toDotPath:()=>Wc,toJSONSchema:()=>ga,treeifyError:()=>xr,util:()=>x,version:()=>ki});var dr=Object.freeze({status:"aborted"});function g(e,o,n){function i(c,u){var p;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(p=c._zod).traits??(p.traits=new Set),c._zod.traits.add(e),o(c,u);for(let d in a.prototype)d in c||Object.defineProperty(c,d,{value:a.prototype[d].bind(c)});c._zod.constr=a,c._zod.def=u}let t=n?.Parent??Object;class r extends t{}Object.defineProperty(r,"name",{value:e});function a(c){var u;let p=n?.Parent?new r:this;i(p,c),(u=p._zod).deferred??(u.deferred=[]);for(let d of p._zod.deferred)d();return p}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}var pr=Symbol("zod_brand"),fe=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Ot={};function K(e){return e&&Object.assign(Ot,e),Ot}var x={};Re(x,{BIGINT_FORMAT_RANGES:()=>wr,Class:()=>gr,NUMBER_FORMAT_RANGES:()=>kr,aborted:()=>Fe,allowsEval:()=>yr,assert:()=>fm,assertEqual:()=>dm,assertIs:()=>mm,assertNever:()=>gm,assertNotEqual:()=>pm,assignProp:()=>vr,cached:()=>Mt,captureStackTrace:()=>No,cleanEnum:()=>Im,cleanRegex:()=>zt,clone:()=>ce,createTransparentProxy:()=>km,defineLazy:()=>U,esc:()=>Ze,escapeRegex:()=>Ce,extend:()=>xm,finalizeIssue:()=>le,floatSafeRemainder:()=>hr,getElementAtPath:()=>hm,getEnumValues:()=>At,getLengthableOrigin:()=>Dt,getParsedType:()=>$m,getSizableOrigin:()=>jt,isObject:()=>st,isPlainObject:()=>at,issue:()=>Cr,joinValues:()=>y,jsonStringifyReplacer:()=>fr,merge:()=>Sm,normalizeParams:()=>w,nullish:()=>ze,numKeys:()=>bm,omit:()=>Cm,optionalKeys:()=>$r,partial:()=>_m,pick:()=>wm,prefixIssues:()=>ne,primitiveTypes:()=>br,promiseAllObject:()=>vm,propertyKeyTypes:()=>Nt,randomString:()=>ym,required:()=>Pm,stringifyPrimitive:()=>C,unwrapMessage:()=>Tt});function dm(e){return e}function pm(e){return e}function mm(e){}function gm(e){throw new Error}function fm(e){}function At(e){let o=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,t])=>o.indexOf(+i)===-1).map(([i,t])=>t)}function y(e,o="|"){return e.map(n=>C(n)).join(o)}function fr(e,o){return typeof o=="bigint"?o.toString():o}function Mt(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function ze(e){return e==null}function zt(e){let o=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(o,n)}function hr(e,o){let n=(e.toString().split(".")[1]||"").length,i=(o.toString().split(".")[1]||"").length,t=n>i?n:i,r=Number.parseInt(e.toFixed(t).replace(".","")),a=Number.parseInt(o.toFixed(t).replace(".",""));return r%a/10**t}function U(e,o,n){Object.defineProperty(e,o,{get(){{let t=n();return e[o]=t,t}throw new Error("cached value already set")},set(t){Object.defineProperty(e,o,{value:t})},configurable:!0})}function vr(e,o,n){Object.defineProperty(e,o,{value:n,writable:!0,enumerable:!0,configurable:!0})}function hm(e,o){return o?o.reduce((n,i)=>n?.[i],e):e}function vm(e){let o=Object.keys(e),n=o.map(i=>e[i]);return Promise.all(n).then(i=>{let t={};for(let r=0;r<o.length;r++)t[o[r]]=i[r];return t})}function ym(e=10){let o="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=o[Math.floor(Math.random()*o.length)];return n}function Ze(e){return JSON.stringify(e)}var No=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var yr=Mt(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function at(e){if(st(e)===!1)return!1;let o=e.constructor;if(o===void 0)return!0;let n=o.prototype;return!(st(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function bm(e){let o=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&o++;return o}var $m=e=>{let o=typeof e;switch(o){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${o}`)}},Nt=new Set(["string","number","symbol"]),br=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ce(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ce(e,o,n){let i=new e._zod.constr(o??e._zod.def);return(!o||n?.parent)&&(i._zod.parent=e),i}function w(e){let o=e;if(!o)return{};if(typeof o=="string")return{error:()=>o};if(o?.message!==void 0){if(o?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");o.error=o.message}return delete o.message,typeof o.error=="string"?{...o,error:()=>o.error}:o}function km(e){let o;return new Proxy({},{get(n,i,t){return o??(o=e()),Reflect.get(o,i,t)},set(n,i,t,r){return o??(o=e()),Reflect.set(o,i,t,r)},has(n,i){return o??(o=e()),Reflect.has(o,i)},deleteProperty(n,i){return o??(o=e()),Reflect.deleteProperty(o,i)},ownKeys(n){return o??(o=e()),Reflect.ownKeys(o)},getOwnPropertyDescriptor(n,i){return o??(o=e()),Reflect.getOwnPropertyDescriptor(o,i)},defineProperty(n,i,t){return o??(o=e()),Reflect.defineProperty(o,i,t)}})}function C(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $r(e){return Object.keys(e).filter(o=>e[o]._zod.optin==="optional"&&e[o]._zod.optout==="optional")}var kr={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wm(e,o){let n={},i=e._zod.def;for(let t in o){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);o[t]&&(n[t]=i.shape[t])}return ce(e,{...e._zod.def,shape:n,checks:[]})}function Cm(e,o){let n={...e._zod.def.shape},i=e._zod.def;for(let t in o){if(!(t in i.shape))throw new Error(`Unrecognized key: "${t}"`);o[t]&&delete n[t]}return ce(e,{...e._zod.def,shape:n,checks:[]})}function xm(e,o){if(!at(o))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let i={...e._zod.def.shape,...o};return vr(this,"shape",i),i},checks:[]};return ce(e,n)}function Sm(e,o){return ce(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...o._zod.def.shape};return vr(this,"shape",n),n},catchall:o._zod.def.catchall,checks:[]})}function _m(e,o,n){let i=o._zod.def.shape,t={...i};if(n)for(let r in n){if(!(r in i))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(t[r]=e?new e({type:"optional",innerType:i[r]}):i[r])}else for(let r in i)t[r]=e?new e({type:"optional",innerType:i[r]}):i[r];return ce(o,{...o._zod.def,shape:t,checks:[]})}function Pm(e,o,n){let i=o._zod.def.shape,t={...i};if(n)for(let r in n){if(!(r in t))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(t[r]=new e({type:"nonoptional",innerType:i[r]}))}else for(let r in i)t[r]=new e({type:"nonoptional",innerType:i[r]});return ce(o,{...o._zod.def,shape:t,checks:[]})}function Fe(e,o=0){for(let n=o;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ne(e,o){return o.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}function Tt(e){return typeof e=="string"?e:e?.message}function le(e,o,n){let i={...e,path:e.path??[]};if(!e.message){let t=Tt(e.inst?._zod.def?.error?.(e))??Tt(o?.error?.(e))??Tt(n.customError?.(e))??Tt(n.localeError?.(e))??"Invalid input";i.message=t}return delete i.inst,delete i.continue,o?.reportInput||delete i.input,i}function jt(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Dt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Cr(...e){let[o,n,i]=e;return typeof o=="string"?{message:o,code:"custom",input:n,inst:i}:{...o}}function Im(e){return Object.entries(e).filter(([o,n])=>Number.isNaN(Number.parseInt(o,10))).map(o=>o[1])}var gr=class{constructor(...o){}};var Bc=(e,o)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:o,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(o,fr,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ut=g("$ZodError",Bc),ct=g("$ZodError",Bc,{Parent:Error});function Lt(e,o=n=>n.message){let n={},i=[];for(let t of e.issues)t.path.length>0?(n[t.path[0]]=n[t.path[0]]||[],n[t.path[0]].push(o(t))):i.push(o(t));return{formErrors:i,fieldErrors:n}}function Rt(e,o){let n=o||function(r){return r.message},i={_errors:[]},t=r=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>t({issues:c}));else if(a.code==="invalid_key")t({issues:a.issues});else if(a.code==="invalid_element")t({issues:a.issues});else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let p=a.path[u];u===a.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(n(a))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}};return t(e),i}function xr(e,o){let n=o||function(r){return r.message},i={errors:[]},t=(r,a=[])=>{var c,u;for(let p of r.issues)if(p.code==="invalid_union"&&p.errors.length)p.errors.map(d=>t({issues:d},p.path));else if(p.code==="invalid_key")t({issues:p.issues},p.path);else if(p.code==="invalid_element")t({issues:p.issues},p.path);else{let d=[...a,...p.path];if(d.length===0){i.errors.push(n(p));continue}let f=i,$=0;for(;$<d.length;){let b=d[$],h=$===d.length-1;typeof b=="string"?(f.properties??(f.properties={}),(c=f.properties)[b]??(c[b]={errors:[]}),f=f.properties[b]):(f.items??(f.items=[]),(u=f.items)[b]??(u[b]={errors:[]}),f=f.items[b]),h&&f.errors.push(n(p)),$++}}};return t(e),i}function Wc(e){let o=[];for(let n of e)typeof n=="number"?o.push(`[${n}]`):typeof n=="symbol"?o.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?o.push(`[${JSON.stringify(n)}]`):(o.length&&o.push("."),o.push(n));return o.join("")}function Sr(e){let o=[],n=[...e.issues].sort((i,t)=>i.path.length-t.path.length);for(let i of n)o.push(`\u2716 ${i.message}`),i.path?.length&&o.push(` \u2192 at ${Wc(i.path)}`);return o.join(`
3
- `)}var jo=e=>(o,n,i,t)=>{let r=i?Object.assign(i,{async:!1}):{async:!1},a=o._zod.run({value:n,issues:[]},r);if(a instanceof Promise)throw new fe;if(a.issues.length){let c=new(t?.Err??e)(a.issues.map(u=>le(u,r,K())));throw No(c,t?.callee),c}return a.value},Do=jo(ct),Uo=e=>async(o,n,i,t)=>{let r=i?Object.assign(i,{async:!0}):{async:!0},a=o._zod.run({value:n,issues:[]},r);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(t?.Err??e)(a.issues.map(u=>le(u,r,K())));throw No(c,t?.callee),c}return a.value},Lo=Uo(ct),Ro=e=>(o,n,i)=>{let t=i?{...i,async:!1}:{async:!1},r=o._zod.run({value:n,issues:[]},t);if(r instanceof Promise)throw new fe;return r.issues.length?{success:!1,error:new(e??Ut)(r.issues.map(a=>le(a,t,K())))}:{success:!0,data:r.value}},_r=Ro(ct),Zo=e=>async(o,n,i)=>{let t=i?Object.assign(i,{async:!0}):{async:!0},r=o._zod.run({value:n,issues:[]},t);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(a=>le(a,t,K())))}:{success:!0,data:r.value}},Pr=Zo(ct);var Ge={};Re(Ge,{_emoji:()=>Hc,base64:()=>Fr,base64url:()=>Fo,bigint:()=>Kr,boolean:()=>Yr,browserEmail:()=>Dm,cidrv4:()=>Rr,cidrv6:()=>Zr,cuid:()=>Ir,cuid2:()=>Er,date:()=>Br,datetime:()=>Hr,domain:()=>Um,duration:()=>zr,e164:()=>Gr,email:()=>jr,emoji:()=>Dr,extendedDuration:()=>Om,guid:()=>Nr,hostname:()=>Vr,html5Email:()=>zm,integer:()=>Jr,ipv4:()=>Ur,ipv6:()=>Lr,ksuid:()=>Ar,lowercase:()=>ti,nanoid:()=>Mr,null:()=>Qr,number:()=>Xr,rfc5322Email:()=>Nm,string:()=>qr,time:()=>Wr,ulid:()=>Or,undefined:()=>ei,unicodeEmail:()=>jm,uppercase:()=>oi,uuid:()=>Ve,uuid4:()=>Tm,uuid6:()=>Am,uuid7:()=>Mm,xid:()=>Tr});var Ir=/^[cC][^\s-]{8,}$/,Er=/^[0-9a-z]+$/,Or=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Tr=/^[0-9a-vA-V]{20}$/,Ar=/^[A-Za-z0-9]{27}$/,Mr=/^[a-zA-Z0-9_-]{21}$/,zr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Om=/^[-+]?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)?)??$/,Nr=/^([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})$/,Ve=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Tm=Ve(4),Am=Ve(6),Mm=Ve(7),jr=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zm=/^[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])?)*$/,Nm=/^(([^<>()\[\]\\.,;:\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,}))$/,jm=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Dm=/^[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])?)*$/,Hc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Dr(){return new RegExp(Hc,"u")}var Ur=/^(?:(?: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])$/,Lr=/^(([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})$/,Rr=/^((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])$/,Zr=/^(([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])$/,Fr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fo=/^[A-Za-z0-9_-]*$/,Vr=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Um=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Gr=/^\+(?:[0-9]){6,14}[0-9]$/,qc="(?:(?:\\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])))",Br=new RegExp(`^${qc}$`);function Kc(e){let o="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${o}`:e.precision===0?`${o}:[0-5]\\d`:`${o}:[0-5]\\d\\.\\d{${e.precision}}`:`${o}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wr(e){return new RegExp(`^${Kc(e)}$`)}function Hr(e){let o=Kc({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let i=`${o}(?:${n.join("|")})`;return new RegExp(`^${qc}T(?:${i})$`)}var qr=e=>{let o=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${o}$`)},Kr=/^\d+n?$/,Jr=/^\d+$/,Xr=/^-?\d+(?:\.\d+)?/i,Yr=/true|false/i,Qr=/null/i;var ei=/undefined/i;var ti=/^[^A-Z]*$/,oi=/^[^a-z]*$/;var B=g("$ZodCheck",(e,o)=>{var n;e._zod??(e._zod={}),e._zod.def=o,(n=e._zod).onattach??(n.onattach=[])}),Xc={number:"number",bigint:"bigint",object:"date"},Vo=g("$ZodCheckLessThan",(e,o)=>{B.init(e,o);let n=Xc[typeof o.value];e._zod.onattach.push(i=>{let t=i._zod.bag,r=(o.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;o.value<r&&(o.inclusive?t.maximum=o.value:t.exclusiveMaximum=o.value)}),e._zod.check=i=>{(o.inclusive?i.value<=o.value:i.value<o.value)||i.issues.push({origin:n,code:"too_big",maximum:o.value,input:i.value,inclusive:o.inclusive,inst:e,continue:!o.abort})}}),Go=g("$ZodCheckGreaterThan",(e,o)=>{B.init(e,o);let n=Xc[typeof o.value];e._zod.onattach.push(i=>{let t=i._zod.bag,r=(o.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;o.value>r&&(o.inclusive?t.minimum=o.value:t.exclusiveMinimum=o.value)}),e._zod.check=i=>{(o.inclusive?i.value>=o.value:i.value>o.value)||i.issues.push({origin:n,code:"too_small",minimum:o.value,input:i.value,inclusive:o.inclusive,inst:e,continue:!o.abort})}}),ni=g("$ZodCheckMultipleOf",(e,o)=>{B.init(e,o),e._zod.onattach.push(n=>{var i;(i=n._zod.bag).multipleOf??(i.multipleOf=o.value)}),e._zod.check=n=>{if(typeof n.value!=typeof o.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%o.value===BigInt(0):hr(n.value,o.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:o.value,input:n.value,inst:e,continue:!o.abort})}}),ri=g("$ZodCheckNumberFormat",(e,o)=>{B.init(e,o),o.format=o.format||"float64";let n=o.format?.includes("int"),i=n?"int":"number",[t,r]=kr[o.format];e._zod.onattach.push(a=>{let c=a._zod.bag;c.format=o.format,c.minimum=t,c.maximum=r,n&&(c.pattern=Jr)}),e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:o.format,code:"invalid_type",input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!o.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,continue:!o.abort});return}}c<t&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:t,inclusive:!0,inst:e,continue:!o.abort}),c>r&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:r,inst:e})}}),ii=g("$ZodCheckBigIntFormat",(e,o)=>{B.init(e,o);let[n,i]=wr[o.format];e._zod.onattach.push(t=>{let r=t._zod.bag;r.format=o.format,r.minimum=n,r.maximum=i}),e._zod.check=t=>{let r=t.value;r<n&&t.issues.push({origin:"bigint",input:r,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!o.abort}),r>i&&t.issues.push({origin:"bigint",input:r,code:"too_big",maximum:i,inst:e})}}),si=g("$ZodCheckMaxSize",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;o.maximum<t&&(i._zod.bag.maximum=o.maximum)}),e._zod.check=i=>{let t=i.value;t.size<=o.maximum||i.issues.push({origin:jt(t),code:"too_big",maximum:o.maximum,input:t,inst:e,continue:!o.abort})}}),ai=g("$ZodCheckMinSize",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;o.minimum>t&&(i._zod.bag.minimum=o.minimum)}),e._zod.check=i=>{let t=i.value;t.size>=o.minimum||i.issues.push({origin:jt(t),code:"too_small",minimum:o.minimum,input:t,inst:e,continue:!o.abort})}}),ci=g("$ZodCheckSizeEquals",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.size!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=o.size,t.maximum=o.size,t.size=o.size}),e._zod.check=i=>{let t=i.value,r=t.size;if(r===o.size)return;let a=r>o.size;i.issues.push({origin:jt(t),...a?{code:"too_big",maximum:o.size}:{code:"too_small",minimum:o.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!o.abort})}}),li=g("$ZodCheckMaxLength",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.maximum??Number.POSITIVE_INFINITY;o.maximum<t&&(i._zod.bag.maximum=o.maximum)}),e._zod.check=i=>{let t=i.value;if(t.length<=o.maximum)return;let a=Dt(t);i.issues.push({origin:a,code:"too_big",maximum:o.maximum,inclusive:!0,input:t,inst:e,continue:!o.abort})}}),ui=g("$ZodCheckMinLength",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;o.minimum>t&&(i._zod.bag.minimum=o.minimum)}),e._zod.check=i=>{let t=i.value;if(t.length>=o.minimum)return;let a=Dt(t);i.issues.push({origin:a,code:"too_small",minimum:o.minimum,inclusive:!0,input:t,inst:e,continue:!o.abort})}}),di=g("$ZodCheckLengthEquals",(e,o)=>{var n;B.init(e,o),(n=e._zod.def).when??(n.when=i=>{let t=i.value;return!ze(t)&&t.length!==void 0}),e._zod.onattach.push(i=>{let t=i._zod.bag;t.minimum=o.length,t.maximum=o.length,t.length=o.length}),e._zod.check=i=>{let t=i.value,r=t.length;if(r===o.length)return;let a=Dt(t),c=r>o.length;i.issues.push({origin:a,...c?{code:"too_big",maximum:o.length}:{code:"too_small",minimum:o.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!o.abort})}}),lt=g("$ZodCheckStringFormat",(e,o)=>{var n,i;B.init(e,o),e._zod.onattach.push(t=>{let r=t._zod.bag;r.format=o.format,o.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(o.pattern))}),o.pattern?(n=e._zod).check??(n.check=t=>{o.pattern.lastIndex=0,!o.pattern.test(t.value)&&t.issues.push({origin:"string",code:"invalid_format",format:o.format,input:t.value,...o.pattern?{pattern:o.pattern.toString()}:{},inst:e,continue:!o.abort})}):(i=e._zod).check??(i.check=()=>{})}),pi=g("$ZodCheckRegex",(e,o)=>{lt.init(e,o),e._zod.check=n=>{o.pattern.lastIndex=0,!o.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:o.pattern.toString(),inst:e,continue:!o.abort})}}),mi=g("$ZodCheckLowerCase",(e,o)=>{o.pattern??(o.pattern=ti),lt.init(e,o)}),gi=g("$ZodCheckUpperCase",(e,o)=>{o.pattern??(o.pattern=oi),lt.init(e,o)}),fi=g("$ZodCheckIncludes",(e,o)=>{B.init(e,o);let n=Ce(o.includes),i=new RegExp(typeof o.position=="number"?`^.{${o.position}}${n}`:n);o.pattern=i,e._zod.onattach.push(t=>{let r=t._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=t=>{t.value.includes(o.includes,o.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:o.includes,input:t.value,inst:e,continue:!o.abort})}}),hi=g("$ZodCheckStartsWith",(e,o)=>{B.init(e,o);let n=new RegExp(`^${Ce(o.prefix)}.*`);o.pattern??(o.pattern=n),e._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=i=>{i.value.startsWith(o.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:o.prefix,input:i.value,inst:e,continue:!o.abort})}}),vi=g("$ZodCheckEndsWith",(e,o)=>{B.init(e,o);let n=new RegExp(`.*${Ce(o.suffix)}$`);o.pattern??(o.pattern=n),e._zod.onattach.push(i=>{let t=i._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=i=>{i.value.endsWith(o.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:o.suffix,input:i.value,inst:e,continue:!o.abort})}});function Jc(e,o,n){e.issues.length&&o.issues.push(...ne(n,e.issues))}var yi=g("$ZodCheckProperty",(e,o)=>{B.init(e,o),e._zod.check=n=>{let i=o.schema._zod.run({value:n.value[o.property],issues:[]},{});if(i instanceof Promise)return i.then(t=>Jc(t,n,o.property));Jc(i,n,o.property)}}),bi=g("$ZodCheckMimeType",(e,o)=>{B.init(e,o);let n=new Set(o.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=o.mime}),e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:o.mime,input:i.value.type,inst:e})}}),$i=g("$ZodCheckOverwrite",(e,o)=>{B.init(e,o),e._zod.check=n=>{n.value=o.tx(n.value)}});var Zt=class{constructor(o=[]){this.content=[],this.indent=0,this&&(this.args=o)}indented(o){this.indent+=1,o(this),this.indent-=1}write(o){if(typeof o=="function"){o(this,{execution:"sync"}),o(this,{execution:"async"});return}let i=o.split(`
4
- `).filter(a=>a),t=Math.min(...i.map(a=>a.length-a.trimStart().length)),r=i.map(a=>a.slice(t)).map(a=>" ".repeat(this.indent*2)+a);for(let a of r)this.content.push(a)}compile(){let o=Function,n=this?.args,t=[...(this?.content??[""]).map(r=>` ${r}`)];return new o(...n,t.join(`
5
- `))}};var ki={major:4,minor:0,patch:0};var A=g("$ZodType",(e,o)=>{var n;e??(e={}),e._zod.def=o,e._zod.bag=e._zod.bag||{},e._zod.version=ki;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let t of i)for(let r of t._zod.onattach)r(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(r,a,c)=>{let u=Fe(r),p;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(r))continue}else if(u)continue;let f=r.issues.length,$=d._zod.check(r);if($ instanceof Promise&&c?.async===!1)throw new fe;if(p||$ instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await $,r.issues.length!==f&&(u||(u=Fe(r,f)))});else{if(r.issues.length===f)continue;u||(u=Fe(r,f))}}return p?p.then(()=>r):r};e._zod.run=(r,a)=>{let c=e._zod.parse(r,a);if(c instanceof Promise){if(a.async===!1)throw new fe;return c.then(u=>t(u,i,a))}return t(c,i,a)}}e["~standard"]={validate:t=>{try{let r=_r(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch{return Pr(e,t).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Be=g("$ZodString",(e,o)=>{A.init(e,o),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??qr(e._zod.bag),e._zod.parse=(n,i)=>{if(o.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}}),L=g("$ZodStringFormat",(e,o)=>{lt.init(e,o),Be.init(e,o)}),Ci=g("$ZodGUID",(e,o)=>{o.pattern??(o.pattern=Nr),L.init(e,o)}),xi=g("$ZodUUID",(e,o)=>{if(o.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[o.version];if(i===void 0)throw new Error(`Invalid UUID version: "${o.version}"`);o.pattern??(o.pattern=Ve(i))}else o.pattern??(o.pattern=Ve());L.init(e,o)}),Si=g("$ZodEmail",(e,o)=>{o.pattern??(o.pattern=jr),L.init(e,o)}),_i=g("$ZodURL",(e,o)=>{L.init(e,o),e._zod.check=n=>{try{let i=n.value,t=new URL(i),r=t.href;o.hostname&&(o.hostname.lastIndex=0,o.hostname.test(t.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Vr.source,input:n.value,inst:e,continue:!o.abort})),o.protocol&&(o.protocol.lastIndex=0,o.protocol.test(t.protocol.endsWith(":")?t.protocol.slice(0,-1):t.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:o.protocol.source,input:n.value,inst:e,continue:!o.abort})),!i.endsWith("/")&&r.endsWith("/")?n.value=r.slice(0,-1):n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!o.abort})}}}),Pi=g("$ZodEmoji",(e,o)=>{o.pattern??(o.pattern=Dr()),L.init(e,o)}),Ii=g("$ZodNanoID",(e,o)=>{o.pattern??(o.pattern=Mr),L.init(e,o)}),Ei=g("$ZodCUID",(e,o)=>{o.pattern??(o.pattern=Ir),L.init(e,o)}),Oi=g("$ZodCUID2",(e,o)=>{o.pattern??(o.pattern=Er),L.init(e,o)}),Ti=g("$ZodULID",(e,o)=>{o.pattern??(o.pattern=Or),L.init(e,o)}),Ai=g("$ZodXID",(e,o)=>{o.pattern??(o.pattern=Tr),L.init(e,o)}),Mi=g("$ZodKSUID",(e,o)=>{o.pattern??(o.pattern=Ar),L.init(e,o)}),zi=g("$ZodISODateTime",(e,o)=>{o.pattern??(o.pattern=Hr(o)),L.init(e,o)}),Ni=g("$ZodISODate",(e,o)=>{o.pattern??(o.pattern=Br),L.init(e,o)}),ji=g("$ZodISOTime",(e,o)=>{o.pattern??(o.pattern=Wr(o)),L.init(e,o)}),Di=g("$ZodISODuration",(e,o)=>{o.pattern??(o.pattern=zr),L.init(e,o)}),Ui=g("$ZodIPv4",(e,o)=>{o.pattern??(o.pattern=Ur),L.init(e,o),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format="ipv4"})}),Li=g("$ZodIPv6",(e,o)=>{o.pattern??(o.pattern=Lr),L.init(e,o),e._zod.onattach.push(n=>{let i=n._zod.bag;i.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:!o.abort})}}}),Ri=g("$ZodCIDRv4",(e,o)=>{o.pattern??(o.pattern=Rr),L.init(e,o)}),Zi=g("$ZodCIDRv6",(e,o)=>{o.pattern??(o.pattern=Zr),L.init(e,o),e._zod.check=n=>{let[i,t]=n.value.split("/");try{if(!t)throw new Error;let r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!o.abort})}}});function Fi(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Vi=g("$ZodBase64",(e,o)=>{o.pattern??(o.pattern=Fr),L.init(e,o),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Fi(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!o.abort})}});function ul(e){if(!Fo.test(e))return!1;let o=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),n=o.padEnd(Math.ceil(o.length/4)*4,"=");return Fi(n)}var Gi=g("$ZodBase64URL",(e,o)=>{o.pattern??(o.pattern=Fo),L.init(e,o),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{ul(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!o.abort})}}),Bi=g("$ZodE164",(e,o)=>{o.pattern??(o.pattern=Gr),L.init(e,o)});function dl(e,o=null){try{let n=e.split(".");if(n.length!==3)return!1;let[i]=n;if(!i)return!1;let t=JSON.parse(atob(i));return!("typ"in t&&t?.typ!=="JWT"||!t.alg||o&&(!("alg"in t)||t.alg!==o))}catch{return!1}}var Wi=g("$ZodJWT",(e,o)=>{L.init(e,o),e._zod.check=n=>{dl(n.value,o.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!o.abort})}}),Hi=g("$ZodCustomStringFormat",(e,o)=>{L.init(e,o),e._zod.check=n=>{o.fn(n.value)||n.issues.push({code:"invalid_format",format:o.format,input:n.value,inst:e,continue:!o.abort})}}),Ho=g("$ZodNumber",(e,o)=>{A.init(e,o),e._zod.pattern=e._zod.bag.pattern??Xr,e._zod.parse=(n,i)=>{if(o.coerce)try{n.value=Number(n.value)}catch{}let t=n.value;if(typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t))return n;let r=typeof t=="number"?Number.isNaN(t)?"NaN":Number.isFinite(t)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:t,inst:e,...r?{received:r}:{}}),n}}),qi=g("$ZodNumber",(e,o)=>{ri.init(e,o),Ho.init(e,o)}),Ft=g("$ZodBoolean",(e,o)=>{A.init(e,o),e._zod.pattern=Yr,e._zod.parse=(n,i)=>{if(o.coerce)try{n.value=!!n.value}catch{}let t=n.value;return typeof t=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:t,inst:e}),n}}),qo=g("$ZodBigInt",(e,o)=>{A.init(e,o),e._zod.pattern=Kr,e._zod.parse=(n,i)=>{if(o.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}}),Ki=g("$ZodBigInt",(e,o)=>{ii.init(e,o),qo.init(e,o)}),Ji=g("$ZodSymbol",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;return typeof t=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:t,inst:e}),n}}),Xi=g("$ZodUndefined",(e,o)=>{A.init(e,o),e._zod.pattern=ei,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,i)=>{let t=n.value;return typeof t>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:t,inst:e}),n}}),Yi=g("$ZodNull",(e,o)=>{A.init(e,o),e._zod.pattern=Qr,e._zod.values=new Set([null]),e._zod.parse=(n,i)=>{let t=n.value;return t===null||n.issues.push({expected:"null",code:"invalid_type",input:t,inst:e}),n}}),Qi=g("$ZodAny",(e,o)=>{A.init(e,o),e._zod.parse=n=>n}),ut=g("$ZodUnknown",(e,o)=>{A.init(e,o),e._zod.parse=n=>n}),es=g("$ZodNever",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),ts=g("$ZodVoid",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;return typeof t>"u"||n.issues.push({expected:"void",code:"invalid_type",input:t,inst:e}),n}}),os=g("$ZodDate",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{if(o.coerce)try{n.value=new Date(n.value)}catch{}let t=n.value,r=t instanceof Date;return r&&!Number.isNaN(t.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:t,...r?{received:"Invalid Date"}:{},inst:e}),n}});function Qc(e,o,n){e.issues.length&&o.issues.push(...ne(n,e.issues)),o.value[n]=e.value}var Vt=g("$ZodArray",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;if(!Array.isArray(t))return n.issues.push({expected:"array",code:"invalid_type",input:t,inst:e}),n;n.value=Array(t.length);let r=[];for(let a=0;a<t.length;a++){let c=t[a],u=o.element._zod.run({value:c,issues:[]},i);u instanceof Promise?r.push(u.then(p=>Qc(p,n,a))):Qc(u,n,a)}return r.length?Promise.all(r).then(()=>n):n}});function Bo(e,o,n){e.issues.length&&o.issues.push(...ne(n,e.issues)),o.value[n]=e.value}function el(e,o,n,i){e.issues.length?i[n]===void 0?n in i?o.value[n]=void 0:o.value[n]=e.value:o.issues.push(...ne(n,e.issues)):e.value===void 0?n in i&&(o.value[n]=void 0):o.value[n]=e.value}var ns=g("$ZodObject",(e,o)=>{A.init(e,o);let n=Mt(()=>{let f=Object.keys(o.shape);for(let b of f)if(!(o.shape[b]instanceof A))throw new Error(`Invalid element at key "${b}": expected a Zod schema`);let $=$r(o.shape);return{shape:o.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set($)}});U(e._zod,"propValues",()=>{let f=o.shape,$={};for(let b in f){let h=f[b]._zod;if(h.values){$[b]??($[b]=new Set);for(let k of h.values)$[b].add(k)}}return $});let i=f=>{let $=new Zt(["shape","payload","ctx"]),b=n.value,h=S=>{let P=Ze(S);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};$.write("const input = payload.value;");let k=Object.create(null),v=0;for(let S of b.keys)k[S]=`key_${v++}`;$.write("const newResult = {}");for(let S of b.keys)if(b.optionalKeys.has(S)){let P=k[S];$.write(`const ${P} = ${h(S)};`);let T=Ze(S);$.write(`
6
- if (${P}.issues.length) {
7
- if (input[${T}] === undefined) {
8
- if (${T} in input) {
9
- newResult[${T}] = undefined;
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __dirname_fn } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __dirname_fn(__filename);
8
+ var Uh=Object.create;var Ai=Object.defineProperty;var Bh=Object.getOwnPropertyDescriptor;var Rh=Object.getOwnPropertyNames;var Zh=Object.getPrototypeOf,Vh=Object.prototype.hasOwnProperty;var td=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,o)=>(typeof require<"u"?require:t)[o]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var jo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pt=(e,t)=>{for(var o in t)Ai(e,o,{get:t[o],enumerable:!0})},Gh=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Rh(t))!Vh.call(e,n)&&n!==o&&Ai(e,n,{get:()=>t[n],enumerable:!(r=Bh(t,n))||r.enumerable});return e};var No=(e,t,o)=>(o=e!=null?Uh(Zh(e)):{},Gh(t||!e||!e.__esModule?Ai(o,"default",{value:e,enumerable:!0}):o,e));var pm=jo((y0,so)=>{"use strict";var Br=function(){};Br.prototype=Object.create(null);var Lr=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Ur=/\\([\v\u0020-\u00ff])/gu,lm=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,$t={type:"",parameters:new Br};Object.freeze($t.parameters);Object.freeze($t);function um(e){if(typeof e!="string")throw new TypeError("argument header is required and must be a string");let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(lm.test(o)===!1)throw new TypeError("invalid media type");let r={type:o.toLowerCase(),parameters:new Br};if(t===-1)return r;let n,i,s;for(Lr.lastIndex=t;i=Lr.exec(e);){if(i.index!==t)throw new TypeError("invalid parameter format");t+=i[0].length,n=i[1].toLowerCase(),s=i[2],s[0]==='"'&&(s=s.slice(1,s.length-1),Ur.test(s)&&(s=s.replace(Ur,"$1"))),r.parameters[n]=s}if(t!==e.length)throw new TypeError("invalid parameter format");return r}function dm(e){if(typeof e!="string")return $t;let t=e.indexOf(";"),o=t!==-1?e.slice(0,t).trim():e.trim();if(lm.test(o)===!1)return $t;let r={type:o.toLowerCase(),parameters:new Br};if(t===-1)return r;let n,i,s;for(Lr.lastIndex=t;i=Lr.exec(e);){if(i.index!==t)return $t;t+=i[0].length,n=i[1].toLowerCase(),s=i[2],s[0]==='"'&&(s=s.slice(1,s.length-1),Ur.test(s)&&(s=s.replace(Ur,"$1"))),r.parameters[n]=s}return t!==e.length?$t:r}so.exports.default={parse:um,safeParse:dm};so.exports.parse=um;so.exports.safeParse=dm;so.exports.defaultContentType=$t});var Vm=jo((H_,Zm)=>{"use strict";Zm.exports=i$;function r$(e){let t={defaultWidth:0,output:process.stdout,tty:td("tty")};return e?(Object.keys(t).forEach(function(o){e[o]||(e[o]=t[o])}),e):t}function i$(e){let t=r$(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let o=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(o)&&o!==0)return o}return t.defaultWidth}});var Jm=jo((tP,Km)=>{Km.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var cg=jo((yP,ag)=>{var D$=td("stream"),Rl=class extends D${#n=null;constructor(t={}){super(t),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=t.replace,this._prompt=t.prompt||null,this._hadControl=!1}#t(t,o){return this._dest?this._dest[t]:this._src?this._src[t]:o}#e(t,...o){typeof this._dest?.[t]=="function"&&this._dest[t](...o),typeof this._src?.[t]=="function"&&this._src[t](...o)}get isTTY(){return this.#n!==null?this.#n:this.#t("isTTY",!1)}set isTTY(t){this.#n=t}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(t){this._src=t}pipe(t,o){return this._dest=t,super.pipe(t,o)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(t){if(this.muted){if(!this.replace)return!0;if(t.match(/^\u001b/))return t.indexOf(this._prompt)===0&&(t=t.slice(this._prompt.length),t=t.replace(/./g,this.replace),t=this._prompt+t),this._hadControl=!0,this.emit("data",t);this._prompt&&this._hadControl&&t.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),t=t.slice(this._prompt.length)),t=t.toString().replace(/./g,this.replace)}this.emit("data",t)}end(t){this.muted&&(t&&this.replace?t=t.toString().replace(/./g,this.replace):t=null),t&&this.emit("data",t),this.emit("end")}destroy(...t){return this.#e("destroy",...t)}destroySoon(...t){return this.#e("destroySoon",...t)}close(...t){return this.#e("close",...t)}};ag.exports=Rl});var nd={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",underscore:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m"},a=(e,t)=>`${nd[e]}${t}${nd.reset}`,f=e=>a("bright",e),l=e=>a("dim",e);import u_ from"node:fs";import p_ from"node:path";import{spawnSync as HD}from"node:child_process";import{existsSync as Rr,readFileSync as xm,writeFileSync as Sm,unlinkSync as $m,statSync as mD,chmodSync as gD}from"node:fs";import{createCipheriv as fD,createDecipheriv as hD,randomBytes as _m}from"node:crypto";import{existsSync as vD,mkdirSync as yD}from"node:fs";import{join as Qe}from"node:path";import Vr from"node:os";import bD from"node:path";var E={};pt(E,{$brand:()=>Oi,$input:()=>qa,$output:()=>Ha,NEVER:()=>Ti,TimePrecision:()=>Xa,ZodAny:()=>$p,ZodArray:()=>xp,ZodBase64:()=>al,ZodBase64URL:()=>cl,ZodBigInt:()=>ro,ZodBigIntFormat:()=>dl,ZodBoolean:()=>oo,ZodCIDRv4:()=>il,ZodCIDRv6:()=>sl,ZodCUID:()=>Yc,ZodCUID2:()=>Qc,ZodCatch:()=>Vp,ZodCustom:()=>Nr,ZodCustomStringFormat:()=>gp,ZodDate:()=>Mr,ZodDefault:()=>Np,ZodDiscriminatedUnion:()=>Sp,ZodE164:()=>ll,ZodEmail:()=>qc,ZodEmoji:()=>Jc,ZodEnum:()=>eo,ZodError:()=>Iy,ZodFile:()=>zp,ZodGUID:()=>Er,ZodIPv4:()=>ol,ZodIPv6:()=>rl,ZodISODate:()=>xr,ZodISODateTime:()=>wr,ZodISODuration:()=>_r,ZodISOTime:()=>Sr,ZodIntersection:()=>_p,ZodIssueCode:()=>Ob,ZodJWT:()=>ul,ZodKSUID:()=>nl,ZodLazy:()=>Jp,ZodLiteral:()=>Op,ZodMap:()=>Fp,ZodNaN:()=>Wp,ZodNanoID:()=>Xc,ZodNever:()=>kp,ZodNonOptional:()=>yl,ZodNull:()=>bp,ZodNullable:()=>jp,ZodNumber:()=>no,ZodNumberFormat:()=>Yt,ZodObject:()=>zr,ZodOptional:()=>vl,ZodPipe:()=>bl,ZodPrefault:()=>Up,ZodPromise:()=>Yp,ZodReadonly:()=>Hp,ZodRealError:()=>Xt,ZodRecord:()=>gl,ZodSet:()=>Ap,ZodString:()=>to,ZodStringFormat:()=>q,ZodSuccess:()=>Zp,ZodSymbol:()=>vp,ZodTemplateLiteral:()=>Kp,ZodTransform:()=>fl,ZodTuple:()=>Ep,ZodType:()=>N,ZodULID:()=>el,ZodURL:()=>Kc,ZodUUID:()=>Je,ZodUndefined:()=>yp,ZodUnion:()=>ml,ZodUnknown:()=>Cp,ZodVoid:()=>wp,ZodXID:()=>tl,_ZodString:()=>Hc,_default:()=>Lp,any:()=>ub,array:()=>pl,base64:()=>Jy,base64url:()=>Xy,bigint:()=>ib,boolean:()=>hp,catch:()=>Gp,check:()=>Qp,cidrv4:()=>qy,cidrv6:()=>Ky,clone:()=>ye,coerce:()=>Dl,config:()=>re,core:()=>Ke,cuid:()=>By,cuid2:()=>Ry,custom:()=>Eb,date:()=>pb,discriminatedUnion:()=>vb,e164:()=>Yy,email:()=>Ay,emoji:()=>Ly,endsWith:()=>Wn,enum:()=>Tp,file:()=>kb,flattenError:()=>Fn,float32:()=>tb,float64:()=>nb,formatError:()=>An,function:()=>Mc,getErrorMap:()=>zb,globalRegistry:()=>je,gt:()=>He,gte:()=>ge,guid:()=>Ty,includes:()=>Vn,instanceof:()=>Ib,int:()=>Wc,int32:()=>ob,int64:()=>sb,intersection:()=>Pp,ipv4:()=>Wy,ipv6:()=>Hy,iso:()=>Pr,json:()=>Ab,jwt:()=>Qy,keyof:()=>mb,ksuid:()=>Gy,lazy:()=>Xp,length:()=>Jt,literal:()=>Mp,locales:()=>Nn,looseObject:()=>hb,lowercase:()=>Rn,lt:()=>We,lte:()=>Se,map:()=>Db,maxLength:()=>Kt,maxSize:()=>qt,mime:()=>Hn,minLength:()=>it,minSize:()=>Dt,multipleOf:()=>bt,nan:()=>Sb,nanoid:()=>Uy,nativeEnum:()=>Cb,negative:()=>xc,never:()=>Or,nonnegative:()=>_c,nonoptional:()=>Rp,nonpositive:()=>Sc,normalize:()=>qn,null:()=>Dp,nullable:()=>Ar,nullish:()=>wb,number:()=>fp,object:()=>gb,optional:()=>Fr,overwrite:()=>qe,parse:()=>Bc,parseAsync:()=>Rc,partialRecord:()=>bb,pipe:()=>Tr,positive:()=>wc,prefault:()=>Bp,preprocess:()=>Tb,prettifyError:()=>Hi,promise:()=>Pb,property:()=>Pc,readonly:()=>qp,record:()=>Ip,refine:()=>em,regex:()=>Bn,regexes:()=>ht,registry:()=>tr,safeParse:()=>Zc,safeParseAsync:()=>Vc,set:()=>$b,setErrorMap:()=>Mb,size:()=>Un,startsWith:()=>Gn,strictObject:()=>fb,string:()=>Gc,stringFormat:()=>eb,stringbool:()=>Fb,success:()=>xb,superRefine:()=>tm,symbol:()=>cb,templateLiteral:()=>_b,toJSONSchema:()=>zc,toLowerCase:()=>Jn,toUpperCase:()=>Xn,transform:()=>hl,treeifyError:()=>Wi,trim:()=>Kn,tuple:()=>yb,uint32:()=>rb,uint64:()=>ab,ulid:()=>Zy,undefined:()=>lb,union:()=>jr,unknown:()=>Ir,uppercase:()=>Zn,url:()=>Ny,uuid:()=>Oy,uuidv4:()=>My,uuidv6:()=>zy,uuidv7:()=>jy,void:()=>db,xid:()=>Vy});var Ke={};pt(Ke,{$ZodAny:()=>$a,$ZodArray:()=>Mn,$ZodAsyncError:()=>ze,$ZodBase64:()=>da,$ZodBase64URL:()=>pa,$ZodBigInt:()=>Yo,$ZodBigIntFormat:()=>va,$ZodBoolean:()=>On,$ZodCIDRv4:()=>ca,$ZodCIDRv6:()=>la,$ZodCUID:()=>Xs,$ZodCUID2:()=>Ys,$ZodCatch:()=>Ua,$ZodCheck:()=>te,$ZodCheckBigIntFormat:()=>_s,$ZodCheckEndsWith:()=>Ls,$ZodCheckGreaterThan:()=>qo,$ZodCheckIncludes:()=>js,$ZodCheckLengthEquals:()=>Ts,$ZodCheckLessThan:()=>Ho,$ZodCheckLowerCase:()=>Ms,$ZodCheckMaxLength:()=>Fs,$ZodCheckMaxSize:()=>Ps,$ZodCheckMimeType:()=>Bs,$ZodCheckMinLength:()=>As,$ZodCheckMinSize:()=>Es,$ZodCheckMultipleOf:()=>xs,$ZodCheckNumberFormat:()=>Ss,$ZodCheckOverwrite:()=>Rs,$ZodCheckProperty:()=>Us,$ZodCheckRegex:()=>Os,$ZodCheckSizeEquals:()=>Is,$ZodCheckStartsWith:()=>Ns,$ZodCheckStringFormat:()=>Vt,$ZodCheckUpperCase:()=>zs,$ZodCustom:()=>Wa,$ZodCustomStringFormat:()=>fa,$ZodDate:()=>wa,$ZodDefault:()=>za,$ZodDiscriminatedUnion:()=>Sa,$ZodE164:()=>ma,$ZodEmail:()=>Hs,$ZodEmoji:()=>Ks,$ZodEnum:()=>Fa,$ZodError:()=>In,$ZodFile:()=>Ta,$ZodFunction:()=>kr,$ZodGUID:()=>Gs,$ZodIPv4:()=>sa,$ZodIPv6:()=>aa,$ZodISODate:()=>oa,$ZodISODateTime:()=>na,$ZodISODuration:()=>ia,$ZodISOTime:()=>ra,$ZodIntersection:()=>_a,$ZodJWT:()=>ga,$ZodKSUID:()=>ta,$ZodLazy:()=>Ga,$ZodLiteral:()=>Aa,$ZodMap:()=>Ea,$ZodNaN:()=>Ba,$ZodNanoID:()=>Js,$ZodNever:()=>Ca,$ZodNonOptional:()=>Na,$ZodNull:()=>Da,$ZodNullable:()=>Ma,$ZodNumber:()=>Xo,$ZodNumberFormat:()=>ha,$ZodObject:()=>xa,$ZodOptional:()=>Oa,$ZodPipe:()=>jn,$ZodPrefault:()=>ja,$ZodPromise:()=>Va,$ZodReadonly:()=>Ra,$ZodRealError:()=>Zt,$ZodRecord:()=>Pa,$ZodRegistry:()=>Wt,$ZodSet:()=>Ia,$ZodString:()=>vt,$ZodStringFormat:()=>W,$ZodSuccess:()=>La,$ZodSymbol:()=>ya,$ZodTemplateLiteral:()=>Za,$ZodTransform:()=>zn,$ZodTuple:()=>yt,$ZodType:()=>O,$ZodULID:()=>Qs,$ZodURL:()=>qs,$ZodUUID:()=>Ws,$ZodUndefined:()=>ba,$ZodUnion:()=>Qo,$ZodUnknown:()=>Gt,$ZodVoid:()=>ka,$ZodXID:()=>ea,$brand:()=>Oi,$constructor:()=>v,$input:()=>qa,$output:()=>Ha,Doc:()=>Tn,JSONSchema:()=>dp,JSONSchemaGenerator:()=>Qn,NEVER:()=>Ti,TimePrecision:()=>Xa,_any:()=>yc,_array:()=>Yn,_base64:()=>br,_base64url:()=>Dr,_bigint:()=>dc,_boolean:()=>lc,_catch:()=>ky,_cidrv4:()=>vr,_cidrv6:()=>yr,_coercedBigint:()=>pc,_coercedBoolean:()=>uc,_coercedDate:()=>Cc,_coercedNumber:()=>oc,_coercedString:()=>Ja,_cuid:()=>ur,_cuid2:()=>dr,_custom:()=>Fc,_date:()=>$c,_default:()=>Dy,_discriminatedUnion:()=>ly,_e164:()=>$r,_email:()=>nr,_emoji:()=>cr,_endsWith:()=>Wn,_enum:()=>gy,_file:()=>Ic,_float32:()=>ic,_float64:()=>sc,_gt:()=>He,_gte:()=>ge,_guid:()=>Ln,_includes:()=>Vn,_int:()=>rc,_int32:()=>ac,_int64:()=>mc,_intersection:()=>uy,_ipv4:()=>fr,_ipv6:()=>hr,_isoDate:()=>Qa,_isoDateTime:()=>Ya,_isoDuration:()=>tc,_isoTime:()=>ec,_jwt:()=>Cr,_ksuid:()=>gr,_lazy:()=>_y,_length:()=>Jt,_literal:()=>hy,_lowercase:()=>Rn,_lt:()=>We,_lte:()=>Se,_map:()=>py,_max:()=>Se,_maxLength:()=>Kt,_maxSize:()=>qt,_mime:()=>Hn,_min:()=>ge,_minLength:()=>it,_minSize:()=>Dt,_multipleOf:()=>bt,_nan:()=>kc,_nanoid:()=>lr,_nativeEnum:()=>fy,_negative:()=>xc,_never:()=>bc,_nonnegative:()=>_c,_nonoptional:()=>$y,_nonpositive:()=>Sc,_normalize:()=>qn,_null:()=>vc,_nullable:()=>by,_number:()=>nc,_optional:()=>yy,_overwrite:()=>qe,_parse:()=>Uo,_parseAsync:()=>Ro,_pipe:()=>wy,_positive:()=>wc,_promise:()=>Py,_property:()=>Pc,_readonly:()=>xy,_record:()=>dy,_refine:()=>Ac,_regex:()=>Bn,_safeParse:()=>Vo,_safeParseAsync:()=>Go,_set:()=>my,_size:()=>Un,_startsWith:()=>Gn,_string:()=>Ka,_stringFormat:()=>Oc,_stringbool:()=>Tc,_success:()=>Cy,_symbol:()=>fc,_templateLiteral:()=>Sy,_toLowerCase:()=>Jn,_toUpperCase:()=>Xn,_transform:()=>vy,_trim:()=>Kn,_tuple:()=>Ec,_uint32:()=>cc,_uint64:()=>gc,_ulid:()=>pr,_undefined:()=>hc,_union:()=>cy,_unknown:()=>Ht,_uppercase:()=>Zn,_url:()=>ar,_uuid:()=>or,_uuidv4:()=>rr,_uuidv6:()=>ir,_uuidv7:()=>sr,_void:()=>Dc,_xid:()=>mr,clone:()=>ye,config:()=>re,flattenError:()=>Fn,formatError:()=>An,function:()=>Mc,globalConfig:()=>Cn,globalRegistry:()=>je,isValidBase64:()=>ua,isValidBase64URL:()=>Cd,isValidJWT:()=>kd,locales:()=>Nn,parse:()=>Bo,parseAsync:()=>Zo,prettifyError:()=>Hi,regexes:()=>ht,registry:()=>tr,safeParse:()=>qi,safeParseAsync:()=>Ki,toDotPath:()=>rd,toJSONSchema:()=>zc,treeifyError:()=>Wi,util:()=>_,version:()=>Zs});var Ti=Object.freeze({status:"aborted"});function v(e,t,o){function r(c,u){var p;Object.defineProperty(c,"_zod",{value:c._zod??{},enumerable:!1}),(p=c._zod).traits??(p.traits=new Set),c._zod.traits.add(e),t(c,u);for(let d in s.prototype)d in c||Object.defineProperty(c,d,{value:s.prototype[d].bind(c)});c._zod.constr=s,c._zod.def=u}let n=o?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(c){var u;let p=o?.Parent?new i:this;r(p,c),(u=p._zod).deferred??(u.deferred=[]);for(let d of p._zod.deferred)d();return p}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:c=>o?.Parent&&c instanceof o.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var Oi=Symbol("zod_brand"),ze=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Cn={};function re(e){return e&&Object.assign(Cn,e),Cn}var _={};pt(_,{BIGINT_FORMAT_RANGES:()=>Vi,Class:()=>zi,NUMBER_FORMAT_RANGES:()=>Zi,aborted:()=>gt,allowsEval:()=>Ui,assert:()=>Jh,assertEqual:()=>Wh,assertIs:()=>qh,assertNever:()=>Kh,assertNotEqual:()=>Hh,assignProp:()=>Li,cached:()=>xn,captureStackTrace:()=>Lo,cleanEnum:()=>lv,cleanRegex:()=>Sn,clone:()=>ye,createTransparentProxy:()=>nv,defineLazy:()=>V,esc:()=>mt,escapeRegex:()=>Ge,extend:()=>iv,finalizeIssue:()=>be,floatSafeRemainder:()=>Ni,getElementAtPath:()=>Xh,getEnumValues:()=>wn,getLengthableOrigin:()=>En,getParsedType:()=>tv,getSizableOrigin:()=>Pn,isObject:()=>Bt,isPlainObject:()=>Rt,issue:()=>Gi,joinValues:()=>$,jsonStringifyReplacer:()=>ji,merge:()=>sv,normalizeParams:()=>x,nullish:()=>rt,numKeys:()=>ev,omit:()=>rv,optionalKeys:()=>Ri,partial:()=>av,pick:()=>ov,prefixIssues:()=>me,primitiveTypes:()=>Bi,promiseAllObject:()=>Yh,propertyKeyTypes:()=>_n,randomString:()=>Qh,required:()=>cv,stringifyPrimitive:()=>S,unwrapMessage:()=>kn});function Wh(e){return e}function Hh(e){return e}function qh(e){}function Kh(e){throw new Error}function Jh(e){}function wn(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function $(e,t="|"){return e.map(o=>S(o)).join(t)}function ji(e,t){return typeof t=="bigint"?t.toString():t}function xn(e){return{get value(){{let o=e();return Object.defineProperty(this,"value",{value:o}),o}throw new Error("cached value already set")}}}function rt(e){return e==null}function Sn(e){let t=e.startsWith("^")?1:0,o=e.endsWith("$")?e.length-1:e.length;return e.slice(t,o)}function Ni(e,t){let o=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=o>r?o:r,i=Number.parseInt(e.toFixed(n).replace(".","")),s=Number.parseInt(t.toFixed(n).replace(".",""));return i%s/10**n}function V(e,t,o){Object.defineProperty(e,t,{get(){{let n=o();return e[t]=n,n}throw new Error("cached value already set")},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Li(e,t,o){Object.defineProperty(e,t,{value:o,writable:!0,enumerable:!0,configurable:!0})}function Xh(e,t){return t?t.reduce((o,r)=>o?.[r],e):e}function Yh(e){let t=Object.keys(e),o=t.map(r=>e[r]);return Promise.all(o).then(r=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=r[i];return n})}function Qh(e=10){let t="abcdefghijklmnopqrstuvwxyz",o="";for(let r=0;r<e;r++)o+=t[Math.floor(Math.random()*t.length)];return o}function mt(e){return JSON.stringify(e)}var Lo=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Bt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ui=xn(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Rt(e){if(Bt(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let o=t.prototype;return!(Bt(o)===!1||Object.prototype.hasOwnProperty.call(o,"isPrototypeOf")===!1)}function ev(e){let t=0;for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&t++;return t}var tv=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},_n=new Set(["string","number","symbol"]),Bi=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ge(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ye(e,t,o){let r=new e._zod.constr(t??e._zod.def);return(!t||o?.parent)&&(r._zod.parent=e),r}function x(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function nv(e){let t;return new Proxy({},{get(o,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(o,r,n,i){return t??(t=e()),Reflect.set(t,r,n,i)},has(o,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(o,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(o){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(o,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(o,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function S(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Ri(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var Zi={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vi={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ov(e,t){let o={},r=e._zod.def;for(let n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(o[n]=r.shape[n])}return ye(e,{...e._zod.def,shape:o,checks:[]})}function rv(e,t){let o={...e._zod.def.shape},r=e._zod.def;for(let n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&delete o[n]}return ye(e,{...e._zod.def,shape:o,checks:[]})}function iv(e,t){if(!Rt(t))throw new Error("Invalid input to extend: expected a plain object");let o={...e._zod.def,get shape(){let r={...e._zod.def.shape,...t};return Li(this,"shape",r),r},checks:[]};return ye(e,o)}function sv(e,t){return ye(e,{...e._zod.def,get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Li(this,"shape",o),o},catchall:t._zod.def.catchall,checks:[]})}function av(e,t,o){let r=t._zod.def.shape,n={...r};if(o)for(let i in o){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(n[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(let i in r)n[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return ye(t,{...t._zod.def,shape:n,checks:[]})}function cv(e,t,o){let r=t._zod.def.shape,n={...r};if(o)for(let i in o){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);o[i]&&(n[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(let i in r)n[i]=new e({type:"nonoptional",innerType:r[i]});return ye(t,{...t._zod.def,shape:n,checks:[]})}function gt(e,t=0){for(let o=t;o<e.issues.length;o++)if(e.issues[o]?.continue!==!0)return!0;return!1}function me(e,t){return t.map(o=>{var r;return(r=o).path??(r.path=[]),o.path.unshift(e),o})}function kn(e){return typeof e=="string"?e:e?.message}function be(e,t,o){let r={...e,path:e.path??[]};if(!e.message){let n=kn(e.inst?._zod.def?.error?.(e))??kn(t?.error?.(e))??kn(o.customError?.(e))??kn(o.localeError?.(e))??"Invalid input";r.message=n}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Pn(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function En(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gi(...e){let[t,o,r]=e;return typeof t=="string"?{message:t,code:"custom",input:o,inst:r}:{...t}}function lv(e){return Object.entries(e).filter(([t,o])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var zi=class{constructor(...t){}};var od=(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,ji,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},In=v("$ZodError",od),Zt=v("$ZodError",od,{Parent:Error});function Fn(e,t=o=>o.message){let o={},r=[];for(let n of e.issues)n.path.length>0?(o[n.path[0]]=o[n.path[0]]||[],o[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:o}}function An(e,t){let o=t||function(i){return i.message},r={_errors:[]},n=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(c=>n({issues:c}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(o(s));else{let c=r,u=0;for(;u<s.path.length;){let p=s.path[u];u===s.path.length-1?(c[p]=c[p]||{_errors:[]},c[p]._errors.push(o(s))):c[p]=c[p]||{_errors:[]},c=c[p],u++}}};return n(e),r}function Wi(e,t){let o=t||function(i){return i.message},r={errors:[]},n=(i,s=[])=>{var c,u;for(let p of i.issues)if(p.code==="invalid_union"&&p.errors.length)p.errors.map(d=>n({issues:d},p.path));else if(p.code==="invalid_key")n({issues:p.issues},p.path);else if(p.code==="invalid_element")n({issues:p.issues},p.path);else{let d=[...s,...p.path];if(d.length===0){r.errors.push(o(p));continue}let m=r,h=0;for(;h<d.length;){let y=d[h],g=h===d.length-1;typeof y=="string"?(m.properties??(m.properties={}),(c=m.properties)[y]??(c[y]={errors:[]}),m=m.properties[y]):(m.items??(m.items=[]),(u=m.items)[y]??(u[y]={errors:[]}),m=m.items[y]),g&&m.errors.push(o(p)),h++}}};return n(e),r}function rd(e){let t=[];for(let o of e)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function Hi(e){let t=[],o=[...e.issues].sort((r,n)=>r.path.length-n.path.length);for(let r of o)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${rd(r.path)}`);return t.join(`
9
+ `)}var Uo=e=>(t,o,r,n)=>{let i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:o,issues:[]},i);if(s instanceof Promise)throw new ze;if(s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>be(u,i,re())));throw Lo(c,n?.callee),c}return s.value},Bo=Uo(Zt),Ro=e=>async(t,o,r,n)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:o,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let c=new(n?.Err??e)(s.issues.map(u=>be(u,i,re())));throw Lo(c,n?.callee),c}return s.value},Zo=Ro(Zt),Vo=e=>(t,o,r)=>{let n=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:o,issues:[]},n);if(i instanceof Promise)throw new ze;return i.issues.length?{success:!1,error:new(e??In)(i.issues.map(s=>be(s,n,re())))}:{success:!0,data:i.value}},qi=Vo(Zt),Go=e=>async(t,o,r)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},i=t._zod.run({value:o,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>be(s,n,re())))}:{success:!0,data:i.value}},Ki=Go(Zt);var ht={};pt(ht,{_emoji:()=>id,base64:()=>us,base64url:()=>Wo,bigint:()=>vs,boolean:()=>Ds,browserEmail:()=>yv,cidrv4:()=>cs,cidrv6:()=>ls,cuid:()=>Ji,cuid2:()=>Xi,date:()=>ms,datetime:()=>fs,domain:()=>bv,duration:()=>ns,e164:()=>ps,email:()=>rs,emoji:()=>is,extendedDuration:()=>dv,guid:()=>os,hostname:()=>ds,html5Email:()=>fv,integer:()=>ys,ipv4:()=>ss,ipv6:()=>as,ksuid:()=>es,lowercase:()=>ks,nanoid:()=>ts,null:()=>$s,number:()=>bs,rfc5322Email:()=>hv,string:()=>hs,time:()=>gs,ulid:()=>Yi,undefined:()=>Cs,unicodeEmail:()=>vv,uppercase:()=>ws,uuid:()=>ft,uuid4:()=>pv,uuid6:()=>mv,uuid7:()=>gv,xid:()=>Qi});var Ji=/^[cC][^\s-]{8,}$/,Xi=/^[0-9a-z]+$/,Yi=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qi=/^[0-9a-vA-V]{20}$/,es=/^[A-Za-z0-9]{27}$/,ts=/^[a-zA-Z0-9_-]{21}$/,ns=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dv=/^[-+]?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)?)??$/,os=/^([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})$/,ft=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,pv=ft(4),mv=ft(6),gv=ft(7),rs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fv=/^[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])?)*$/,hv=/^(([^<>()\[\]\\.,;:\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,}))$/,vv=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,yv=/^[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])?)*$/,id="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function is(){return new RegExp(id,"u")}var ss=/^(?:(?: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])$/,as=/^(([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})$/,cs=/^((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])$/,ls=/^(([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])$/,us=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wo=/^[A-Za-z0-9_-]*$/,ds=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,bv=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ps=/^\+(?:[0-9]){6,14}[0-9]$/,sd="(?:(?:\\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])))",ms=new RegExp(`^${sd}$`);function ad(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 gs(e){return new RegExp(`^${ad(e)}$`)}function fs(e){let t=ad({precision:e.precision}),o=["Z"];e.local&&o.push(""),e.offset&&o.push("([+-]\\d{2}:\\d{2})");let r=`${t}(?:${o.join("|")})`;return new RegExp(`^${sd}T(?:${r})$`)}var hs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vs=/^\d+n?$/,ys=/^\d+$/,bs=/^-?\d+(?:\.\d+)?/i,Ds=/true|false/i,$s=/null/i;var Cs=/undefined/i;var ks=/^[^A-Z]*$/,ws=/^[^a-z]*$/;var te=v("$ZodCheck",(e,t)=>{var o;e._zod??(e._zod={}),e._zod.def=t,(o=e._zod).onattach??(o.onattach=[])}),ld={number:"number",bigint:"bigint",object:"date"},Ho=v("$ZodCheckLessThan",(e,t)=>{te.init(e,t);let o=ld[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(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:o,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qo=v("$ZodCheckGreaterThan",(e,t)=>{te.init(e,t);let o=ld[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(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:o,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xs=v("$ZodCheckMultipleOf",(e,t)=>{te.init(e,t),e._zod.onattach.push(o=>{var r;(r=o._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=o=>{if(typeof o.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof o.value=="bigint"?o.value%t.value===BigInt(0):Ni(o.value,t.value)===0)||o.issues.push({origin:typeof o.value,code:"not_multiple_of",divisor:t.value,input:o.value,inst:e,continue:!t.abort})}}),Ss=v("$ZodCheckNumberFormat",(e,t)=>{te.init(e,t),t.format=t.format||"float64";let o=t.format?.includes("int"),r=o?"int":"number",[n,i]=Zi[t.format];e._zod.onattach.push(s=>{let c=s._zod.bag;c.format=t.format,c.minimum=n,c.maximum=i,o&&(c.pattern=ys)}),e._zod.check=s=>{let c=s.value;if(o){if(!Number.isInteger(c)){s.issues.push({expected:r,format:t.format,code:"invalid_type",input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}c<n&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),c>i&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inst:e})}}),_s=v("$ZodCheckBigIntFormat",(e,t)=>{te.init(e,t);let[o,r]=Vi[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=o,i.maximum=r}),e._zod.check=n=>{let i=n.value;i<o&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),i>r&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inst:e})}}),Ps=v("$ZodCheckMaxSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:Pn(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),Es=v("$ZodCheckMinSize",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:Pn(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),Is=v("$ZodCheckSizeEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:Pn(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Fs=v("$ZodCheckMaxLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let s=En(n);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),As=v("$ZodCheckMinLength",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let s=En(n);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ts=v("$ZodCheckLengthEquals",(e,t)=>{var o;te.init(e,t),(o=e._zod.def).when??(o.when=r=>{let n=r.value;return!rt(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let s=En(n),c=i>t.length;r.issues.push({origin:s,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Vt=v("$ZodCheckStringFormat",(e,t)=>{var o,r;te.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(o=e._zod).check??(o.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=()=>{})}),Os=v("$ZodCheckRegex",(e,t)=>{Vt.init(e,t),e._zod.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:"regex",input:o.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ms=v("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ks),Vt.init(e,t)}),zs=v("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ws),Vt.init(e,t)}),js=v("$ZodCheckIncludes",(e,t)=>{te.init(e,t);let o=Ge(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${o}`:o);t.pattern=r,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.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})}}),Ns=v("$ZodCheckStartsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`^${Ge(t.prefix)}.*`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Ls=v("$ZodCheckEndsWith",(e,t)=>{te.init(e,t);let o=new RegExp(`.*${Ge(t.suffix)}$`);t.pattern??(t.pattern=o),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(o)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function cd(e,t,o){e.issues.length&&t.issues.push(...me(o,e.issues))}var Us=v("$ZodCheckProperty",(e,t)=>{te.init(e,t),e._zod.check=o=>{let r=t.schema._zod.run({value:o.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>cd(n,o,t.property));cd(r,o,t.property)}}),Bs=v("$ZodCheckMimeType",(e,t)=>{te.init(e,t);let o=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{o.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e})}}),Rs=v("$ZodCheckOverwrite",(e,t)=>{te.init(e,t),e._zod.check=o=>{o.value=t.tx(o.value)}});var Tn=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
10
+ `).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,o=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...o,n.join(`
11
+ `))}};var Zs={major:4,minor:0,patch:0};var O=v("$ZodType",(e,t)=>{var o;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zs;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let n of r)for(let i of n._zod.onattach)i(e);if(r.length===0)(o=e._zod).deferred??(o.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(i,s,c)=>{let u=gt(i),p;for(let d of s){if(d._zod.def.when){if(!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new ze;if(p||h instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await h,i.issues.length!==m&&(u||(u=gt(i,m)))});else{if(i.issues.length===m)continue;u||(u=gt(i,m))}}return p?p.then(()=>i):i};e._zod.run=(i,s)=>{let c=e._zod.parse(i,s);if(c instanceof Promise){if(s.async===!1)throw new ze;return c.then(u=>n(u,r,s))}return n(c,r,s)}}e["~standard"]={validate:n=>{try{let i=qi(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Ki(e,n).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),vt=v("$ZodString",(e,t)=>{O.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??hs(e._zod.bag),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),W=v("$ZodStringFormat",(e,t)=>{Vt.init(e,t),vt.init(e,t)}),Gs=v("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=os),W.init(e,t)}),Ws=v("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ft(r))}else t.pattern??(t.pattern=ft());W.init(e,t)}),Hs=v("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rs),W.init(e,t)}),qs=v("$ZodURL",(e,t)=>{W.init(e,t),e._zod.check=o=>{try{let r=o.value,n=new URL(r),i=n.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:ds.source,input:o.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||o.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:o.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?o.value=i.slice(0,-1):o.value=i;return}catch{o.issues.push({code:"invalid_format",format:"url",input:o.value,inst:e,continue:!t.abort})}}}),Ks=v("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=is()),W.init(e,t)}),Js=v("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ts),W.init(e,t)}),Xs=v("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ji),W.init(e,t)}),Ys=v("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Xi),W.init(e,t)}),Qs=v("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Yi),W.init(e,t)}),ea=v("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Qi),W.init(e,t)}),ta=v("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=es),W.init(e,t)}),na=v("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=fs(t)),W.init(e,t)}),oa=v("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ms),W.init(e,t)}),ra=v("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=gs(t)),W.init(e,t)}),ia=v("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ns),W.init(e,t)}),sa=v("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ss),W.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv4"})}),aa=v("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=as),W.init(e,t),e._zod.onattach.push(o=>{let r=o._zod.bag;r.format="ipv6"}),e._zod.check=o=>{try{new URL(`http://[${o.value}]`)}catch{o.issues.push({code:"invalid_format",format:"ipv6",input:o.value,inst:e,continue:!t.abort})}}}),ca=v("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cs),W.init(e,t)}),la=v("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ls),W.init(e,t),e._zod.check=o=>{let[r,n]=o.value.split("/");try{if(!n)throw new Error;let i=Number(n);if(`${i}`!==n)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{o.issues.push({code:"invalid_format",format:"cidrv6",input:o.value,inst:e,continue:!t.abort})}}});function ua(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var da=v("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=us),W.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64"}),e._zod.check=o=>{ua(o.value)||o.issues.push({code:"invalid_format",format:"base64",input:o.value,inst:e,continue:!t.abort})}});function Cd(e){if(!Wo.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),o=t.padEnd(Math.ceil(t.length/4)*4,"=");return ua(o)}var pa=v("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wo),W.init(e,t),e._zod.onattach.push(o=>{o._zod.bag.contentEncoding="base64url"}),e._zod.check=o=>{Cd(o.value)||o.issues.push({code:"invalid_format",format:"base64url",input:o.value,inst:e,continue:!t.abort})}}),ma=v("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ps),W.init(e,t)});function kd(e,t=null){try{let o=e.split(".");if(o.length!==3)return!1;let[r]=o;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var ga=v("$ZodJWT",(e,t)=>{W.init(e,t),e._zod.check=o=>{kd(o.value,t.alg)||o.issues.push({code:"invalid_format",format:"jwt",input:o.value,inst:e,continue:!t.abort})}}),fa=v("$ZodCustomStringFormat",(e,t)=>{W.init(e,t),e._zod.check=o=>{t.fn(o.value)||o.issues.push({code:"invalid_format",format:t.format,input:o.value,inst:e,continue:!t.abort})}}),Xo=v("$ZodNumber",(e,t)=>{O.init(e,t),e._zod.pattern=e._zod.bag.pattern??bs,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=Number(o.value)}catch{}let n=o.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return o;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return o.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),o}}),ha=v("$ZodNumber",(e,t)=>{Ss.init(e,t),Xo.init(e,t)}),On=v("$ZodBoolean",(e,t)=>{O.init(e,t),e._zod.pattern=Ds,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=!!o.value}catch{}let n=o.value;return typeof n=="boolean"||o.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),o}}),Yo=v("$ZodBigInt",(e,t)=>{O.init(e,t),e._zod.pattern=vs,e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=BigInt(o.value)}catch{}return typeof o.value=="bigint"||o.issues.push({expected:"bigint",code:"invalid_type",input:o.value,inst:e}),o}}),va=v("$ZodBigInt",(e,t)=>{_s.init(e,t),Yo.init(e,t)}),ya=v("$ZodSymbol",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n=="symbol"||o.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),o}}),ba=v("$ZodUndefined",(e,t)=>{O.init(e,t),e._zod.pattern=Cs,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),o}}),Da=v("$ZodNull",(e,t)=>{O.init(e,t),e._zod.pattern=$s,e._zod.values=new Set([null]),e._zod.parse=(o,r)=>{let n=o.value;return n===null||o.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),o}}),$a=v("$ZodAny",(e,t)=>{O.init(e,t),e._zod.parse=o=>o}),Gt=v("$ZodUnknown",(e,t)=>{O.init(e,t),e._zod.parse=o=>o}),Ca=v("$ZodNever",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>(o.issues.push({expected:"never",code:"invalid_type",input:o.value,inst:e}),o)}),ka=v("$ZodVoid",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return typeof n>"u"||o.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),o}}),wa=v("$ZodDate",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{if(t.coerce)try{o.value=new Date(o.value)}catch{}let n=o.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||o.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),o}});function dd(e,t,o){e.issues.length&&t.issues.push(...me(o,e.issues)),t.value[o]=e.value}var Mn=v("$ZodArray",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Array.isArray(n))return o.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),o;o.value=Array(n.length);let i=[];for(let s=0;s<n.length;s++){let c=n[s],u=t.element._zod.run({value:c,issues:[]},r);u instanceof Promise?i.push(u.then(p=>dd(p,o,s))):dd(u,o,s)}return i.length?Promise.all(i).then(()=>o):o}});function Ko(e,t,o){e.issues.length&&t.issues.push(...me(o,e.issues)),t.value[o]=e.value}function pd(e,t,o,r){e.issues.length?r[o]===void 0?o in r?t.value[o]=void 0:t.value[o]=e.value:t.issues.push(...me(o,e.issues)):e.value===void 0?o in r&&(t.value[o]=void 0):t.value[o]=e.value}var xa=v("$ZodObject",(e,t)=>{O.init(e,t);let o=xn(()=>{let m=Object.keys(t.shape);for(let y of m)if(!(t.shape[y]instanceof O))throw new Error(`Invalid element at key "${y}": expected a Zod schema`);let h=Ri(t.shape);return{shape:t.shape,keys:m,keySet:new Set(m),numKeys:m.length,optionalKeys:new Set(h)}});V(e._zod,"propValues",()=>{let m=t.shape,h={};for(let y in m){let g=m[y]._zod;if(g.values){h[y]??(h[y]=new Set);for(let D of g.values)h[y].add(D)}}return h});let r=m=>{let h=new Tn(["shape","payload","ctx"]),y=o.value,g=C=>{let w=mt(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");let D=Object.create(null),b=0;for(let C of y.keys)D[C]=`key_${b++}`;h.write("const newResult = {}");for(let C of y.keys)if(y.optionalKeys.has(C)){let w=D[C];h.write(`const ${w} = ${g(C)};`);let P=mt(C);h.write(`
12
+ if (${w}.issues.length) {
13
+ if (input[${P}] === undefined) {
14
+ if (${P} in input) {
15
+ newResult[${P}] = undefined;
10
16
  }
11
17
  } else {
12
18
  payload.issues = payload.issues.concat(
13
- ${P}.issues.map((iss) => ({
19
+ ${w}.issues.map((iss) => ({
14
20
  ...iss,
15
- path: iss.path ? [${T}, ...iss.path] : [${T}],
21
+ path: iss.path ? [${P}, ...iss.path] : [${P}],
16
22
  }))
17
23
  );
18
24
  }
19
- } else if (${P}.value === undefined) {
20
- if (${T} in input) newResult[${T}] = undefined;
25
+ } else if (${w}.value === undefined) {
26
+ if (${P} in input) newResult[${P}] = undefined;
21
27
  } else {
22
- newResult[${T}] = ${P}.value;
28
+ newResult[${P}] = ${w}.value;
23
29
  }
24
- `)}else{let P=k[S];$.write(`const ${P} = ${h(S)};`),$.write(`
25
- if (${P}.issues.length) payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
30
+ `)}else{let w=D[C];h.write(`const ${w} = ${g(C)};`),h.write(`
31
+ if (${w}.issues.length) payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
26
32
  ...iss,
27
- path: iss.path ? [${Ze(S)}, ...iss.path] : [${Ze(S)}]
28
- })));`),$.write(`newResult[${Ze(S)}] = ${P}.value`)}$.write("payload.value = newResult;"),$.write("return payload;");let _=$.compile();return(S,P)=>_(f,S,P)},t,r=st,a=!Ot.jitless,u=a&&yr.value,p=o.catchall,d;e._zod.parse=(f,$)=>{d??(d=n.value);let b=f.value;if(!r(b))return f.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),f;let h=[];if(a&&u&&$?.async===!1&&$.jitless!==!0)t||(t=i(o.shape)),f=t(f,$);else{f.value={};let P=d.shape;for(let T of d.keys){let H=P[T],J=H._zod.run({value:b[T],issues:[]},$),oe=H._zod.optin==="optional"&&H._zod.optout==="optional";J instanceof Promise?h.push(J.then(Me=>oe?el(Me,f,T,b):Bo(Me,f,T))):oe?el(J,f,T,b):Bo(J,f,T)}}if(!p)return h.length?Promise.all(h).then(()=>f):f;let k=[],v=d.keySet,_=p._zod,S=_.def.type;for(let P of Object.keys(b)){if(v.has(P))continue;if(S==="never"){k.push(P);continue}let T=_.run({value:b[P],issues:[]},$);T instanceof Promise?h.push(T.then(H=>Bo(H,f,P))):Bo(T,f,P)}return k.length&&f.issues.push({code:"unrecognized_keys",keys:k,input:b,inst:e}),h.length?Promise.all(h).then(()=>f):f}});function tl(e,o,n,i){for(let t of e)if(t.issues.length===0)return o.value=t.value,o;return o.issues.push({code:"invalid_union",input:o.value,inst:n,errors:e.map(t=>t.issues.map(r=>le(r,i,K())))}),o}var Ko=g("$ZodUnion",(e,o)=>{A.init(e,o),U(e._zod,"optin",()=>o.options.some(n=>n._zod.optin==="optional")?"optional":void 0),U(e._zod,"optout",()=>o.options.some(n=>n._zod.optout==="optional")?"optional":void 0),U(e._zod,"values",()=>{if(o.options.every(n=>n._zod.values))return new Set(o.options.flatMap(n=>Array.from(n._zod.values)))}),U(e._zod,"pattern",()=>{if(o.options.every(n=>n._zod.pattern)){let n=o.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>zt(i.source)).join("|")})$`)}}),e._zod.parse=(n,i)=>{let t=!1,r=[];for(let a of o.options){let c=a._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)r.push(c),t=!0;else{if(c.issues.length===0)return c;r.push(c)}}return t?Promise.all(r).then(a=>tl(a,n,e,i)):tl(r,n,e,i)}}),rs=g("$ZodDiscriminatedUnion",(e,o)=>{Ko.init(e,o);let n=e._zod.parse;U(e._zod,"propValues",()=>{let t={};for(let r of o.options){let a=r._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${o.options.indexOf(r)}"`);for(let[c,u]of Object.entries(a)){t[c]||(t[c]=new Set);for(let p of u)t[c].add(p)}}return t});let i=Mt(()=>{let t=o.options,r=new Map;for(let a of t){let c=a._zod.propValues[o.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${o.options.indexOf(a)}"`);for(let u of c){if(r.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);r.set(u,a)}}return r});e._zod.parse=(t,r)=>{let a=t.value;if(!st(a))return t.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),t;let c=i.value.get(a?.[o.discriminator]);return c?c._zod.run(t,r):o.unionFallback?n(t,r):(t.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[o.discriminator],inst:e}),t)}}),is=g("$ZodIntersection",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value,r=o.left._zod.run({value:t,issues:[]},i),a=o.right._zod.run({value:t,issues:[]},i);return r instanceof Promise||a instanceof Promise?Promise.all([r,a]).then(([u,p])=>ol(n,u,p)):ol(n,r,a)}});function wi(e,o){if(e===o)return{valid:!0,data:e};if(e instanceof Date&&o instanceof Date&&+e==+o)return{valid:!0,data:e};if(at(e)&&at(o)){let n=Object.keys(o),i=Object.keys(e).filter(r=>n.indexOf(r)!==-1),t={...e,...o};for(let r of i){let a=wi(e[r],o[r]);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};t[r]=a.data}return{valid:!0,data:t}}if(Array.isArray(e)&&Array.isArray(o)){if(e.length!==o.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let i=0;i<e.length;i++){let t=e[i],r=o[i],a=wi(t,r);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function ol(e,o,n){if(o.issues.length&&e.issues.push(...o.issues),n.issues.length&&e.issues.push(...n.issues),Fe(e))return e;let i=wi(o.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}var We=g("$ZodTuple",(e,o)=>{A.init(e,o);let n=o.items,i=n.length-[...n].reverse().findIndex(t=>t._zod.optin!=="optional");e._zod.parse=(t,r)=>{let a=t.value;if(!Array.isArray(a))return t.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),t;t.value=[];let c=[];if(!o.rest){let p=a.length>n.length,d=a.length<i-1;if(p||d)return t.issues.push({input:a,inst:e,origin:"array",...p?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length}}),t}let u=-1;for(let p of n){if(u++,u>=a.length&&u>=i)continue;let d=p._zod.run({value:a[u],issues:[]},r);d instanceof Promise?c.push(d.then(f=>Wo(f,t,u))):Wo(d,t,u)}if(o.rest){let p=a.slice(n.length);for(let d of p){u++;let f=o.rest._zod.run({value:d,issues:[]},r);f instanceof Promise?c.push(f.then($=>Wo($,t,u))):Wo(f,t,u)}}return c.length?Promise.all(c).then(()=>t):t}});function Wo(e,o,n){e.issues.length&&o.issues.push(...ne(n,e.issues)),o.value[n]=e.value}var ss=g("$ZodRecord",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;if(!at(t))return n.issues.push({expected:"record",code:"invalid_type",input:t,inst:e}),n;let r=[];if(o.keyType._zod.values){let a=o.keyType._zod.values;n.value={};for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let p=o.valueType._zod.run({value:t[u],issues:[]},i);p instanceof Promise?r.push(p.then(d=>{d.issues.length&&n.issues.push(...ne(u,d.issues)),n.value[u]=d.value})):(p.issues.length&&n.issues.push(...ne(u,p.issues)),n.value[u]=p.value)}let c;for(let u in t)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:t,inst:e,keys:c})}else{n.value={};for(let a of Reflect.ownKeys(t)){if(a==="__proto__")continue;let c=o.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map(p=>le(p,i,K())),input:a,path:[a],inst:e}),n.value[c.value]=c.value;continue}let u=o.valueType._zod.run({value:t[a],issues:[]},i);u instanceof Promise?r.push(u.then(p=>{p.issues.length&&n.issues.push(...ne(a,p.issues)),n.value[c.value]=p.value})):(u.issues.length&&n.issues.push(...ne(a,u.issues)),n.value[c.value]=u.value)}}return r.length?Promise.all(r).then(()=>n):n}}),as=g("$ZodMap",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;if(!(t instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:t,inst:e}),n;let r=[];n.value=new Map;for(let[a,c]of t){let u=o.keyType._zod.run({value:a,issues:[]},i),p=o.valueType._zod.run({value:c,issues:[]},i);u instanceof Promise||p instanceof Promise?r.push(Promise.all([u,p]).then(([d,f])=>{nl(d,f,n,a,t,e,i)})):nl(u,p,n,a,t,e,i)}return r.length?Promise.all(r).then(()=>n):n}});function nl(e,o,n,i,t,r,a){e.issues.length&&(Nt.has(typeof i)?n.issues.push(...ne(i,e.issues)):n.issues.push({origin:"map",code:"invalid_key",input:t,inst:r,issues:e.issues.map(c=>le(c,a,K()))})),o.issues.length&&(Nt.has(typeof i)?n.issues.push(...ne(i,o.issues)):n.issues.push({origin:"map",code:"invalid_element",input:t,inst:r,key:i,issues:o.issues.map(c=>le(c,a,K()))})),n.value.set(e.value,o.value)}var cs=g("$ZodSet",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;if(!(t instanceof Set))return n.issues.push({input:t,inst:e,expected:"set",code:"invalid_type"}),n;let r=[];n.value=new Set;for(let a of t){let c=o.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise?r.push(c.then(u=>rl(u,n))):rl(c,n)}return r.length?Promise.all(r).then(()=>n):n}});function rl(e,o){e.issues.length&&o.issues.push(...e.issues),o.value.add(e.value)}var ls=g("$ZodEnum",(e,o)=>{A.init(e,o);let n=At(o.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(i=>Nt.has(typeof i)).map(i=>typeof i=="string"?Ce(i):i.toString()).join("|")})$`),e._zod.parse=(i,t)=>{let r=i.value;return e._zod.values.has(r)||i.issues.push({code:"invalid_value",values:n,input:r,inst:e}),i}}),us=g("$ZodLiteral",(e,o)=>{A.init(e,o),e._zod.values=new Set(o.values),e._zod.pattern=new RegExp(`^(${o.values.map(n=>typeof n=="string"?Ce(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let t=n.value;return e._zod.values.has(t)||n.issues.push({code:"invalid_value",values:o.values,input:t,inst:e}),n}}),ds=g("$ZodFile",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=n.value;return t instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:t,inst:e}),n}}),Gt=g("$ZodTransform",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=o.transform(n.value,n);if(i.async)return(t instanceof Promise?t:Promise.resolve(t)).then(a=>(n.value=a,n));if(t instanceof Promise)throw new fe;return n.value=t,n}}),ps=g("$ZodOptional",(e,o)=>{A.init(e,o),e._zod.optin="optional",e._zod.optout="optional",U(e._zod,"values",()=>o.innerType._zod.values?new Set([...o.innerType._zod.values,void 0]):void 0),U(e._zod,"pattern",()=>{let n=o.innerType._zod.pattern;return n?new RegExp(`^(${zt(n.source)})?$`):void 0}),e._zod.parse=(n,i)=>o.innerType._zod.optin==="optional"?o.innerType._zod.run(n,i):n.value===void 0?n:o.innerType._zod.run(n,i)}),ms=g("$ZodNullable",(e,o)=>{A.init(e,o),U(e._zod,"optin",()=>o.innerType._zod.optin),U(e._zod,"optout",()=>o.innerType._zod.optout),U(e._zod,"pattern",()=>{let n=o.innerType._zod.pattern;return n?new RegExp(`^(${zt(n.source)}|null)$`):void 0}),U(e._zod,"values",()=>o.innerType._zod.values?new Set([...o.innerType._zod.values,null]):void 0),e._zod.parse=(n,i)=>n.value===null?n:o.innerType._zod.run(n,i)}),gs=g("$ZodDefault",(e,o)=>{A.init(e,o),e._zod.optin="optional",U(e._zod,"values",()=>o.innerType._zod.values),e._zod.parse=(n,i)=>{if(n.value===void 0)return n.value=o.defaultValue,n;let t=o.innerType._zod.run(n,i);return t instanceof Promise?t.then(r=>il(r,o)):il(t,o)}});function il(e,o){return e.value===void 0&&(e.value=o.defaultValue),e}var fs=g("$ZodPrefault",(e,o)=>{A.init(e,o),e._zod.optin="optional",U(e._zod,"values",()=>o.innerType._zod.values),e._zod.parse=(n,i)=>(n.value===void 0&&(n.value=o.defaultValue),o.innerType._zod.run(n,i))}),hs=g("$ZodNonOptional",(e,o)=>{A.init(e,o),U(e._zod,"values",()=>{let n=o.innerType._zod.values;return n?new Set([...n].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,i)=>{let t=o.innerType._zod.run(n,i);return t instanceof Promise?t.then(r=>sl(r,e)):sl(t,e)}});function sl(e,o){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:o}),e}var vs=g("$ZodSuccess",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>{let t=o.innerType._zod.run(n,i);return t instanceof Promise?t.then(r=>(n.value=r.issues.length===0,n)):(n.value=t.issues.length===0,n)}}),ys=g("$ZodCatch",(e,o)=>{A.init(e,o),e._zod.optin="optional",U(e._zod,"optout",()=>o.innerType._zod.optout),U(e._zod,"values",()=>o.innerType._zod.values),e._zod.parse=(n,i)=>{let t=o.innerType._zod.run(n,i);return t instanceof Promise?t.then(r=>(n.value=r.value,r.issues.length&&(n.value=o.catchValue({...n,error:{issues:r.issues.map(a=>le(a,i,K()))},input:n.value}),n.issues=[]),n)):(n.value=t.value,t.issues.length&&(n.value=o.catchValue({...n,error:{issues:t.issues.map(r=>le(r,i,K()))},input:n.value}),n.issues=[]),n)}}),bs=g("$ZodNaN",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Bt=g("$ZodPipe",(e,o)=>{A.init(e,o),U(e._zod,"values",()=>o.in._zod.values),U(e._zod,"optin",()=>o.in._zod.optin),U(e._zod,"optout",()=>o.out._zod.optout),e._zod.parse=(n,i)=>{let t=o.in._zod.run(n,i);return t instanceof Promise?t.then(r=>al(r,o,i)):al(t,o,i)}});function al(e,o,n){return Fe(e)?e:o.out._zod.run({value:e.value,issues:e.issues},n)}var $s=g("$ZodReadonly",(e,o)=>{A.init(e,o),U(e._zod,"propValues",()=>o.innerType._zod.propValues),U(e._zod,"values",()=>o.innerType._zod.values),U(e._zod,"optin",()=>o.innerType._zod.optin),U(e._zod,"optout",()=>o.innerType._zod.optout),e._zod.parse=(n,i)=>{let t=o.innerType._zod.run(n,i);return t instanceof Promise?t.then(cl):cl(t)}});function cl(e){return e.value=Object.freeze(e.value),e}var ks=g("$ZodTemplateLiteral",(e,o)=>{A.init(e,o);let n=[];for(let i of o.parts)if(i instanceof A){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let t=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!t)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let r=t.startsWith("^")?1:0,a=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,a))}else if(i===null||br.has(typeof i))n.push(Ce(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(i,t)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:e,expected:"template_literal",code:"invalid_type"}),i):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),i)}),ws=g("$ZodPromise",(e,o)=>{A.init(e,o),e._zod.parse=(n,i)=>Promise.resolve(n.value).then(t=>o.innerType._zod.run({value:t,issues:[]},i))}),Cs=g("$ZodLazy",(e,o)=>{A.init(e,o),U(e._zod,"innerType",()=>o.getter()),U(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),U(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),U(e._zod,"optin",()=>e._zod.innerType._zod.optin),U(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,i)=>e._zod.innerType._zod.run(n,i)}),xs=g("$ZodCustom",(e,o)=>{B.init(e,o),A.init(e,o),e._zod.parse=(n,i)=>n,e._zod.check=n=>{let i=n.value,t=o.fn(i);if(t instanceof Promise)return t.then(r=>ll(r,n,i,e));ll(t,n,i,e)}});function ll(e,o,n,i){if(!e){let t={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(t.params=i._zod.def.params),o.issues.push(Cr(t))}}var Wt={};Re(Wt,{ar:()=>ml,az:()=>gl,be:()=>hl,ca:()=>vl,cs:()=>yl,de:()=>bl,en:()=>Jo,eo:()=>$l,es:()=>kl,fa:()=>wl,fi:()=>Cl,fr:()=>xl,frCA:()=>Sl,he:()=>_l,hu:()=>Pl,id:()=>Il,it:()=>El,ja:()=>Ol,kh:()=>Tl,ko:()=>Al,mk:()=>Ml,ms:()=>zl,nl:()=>Nl,no:()=>jl,ota:()=>Dl,pl:()=>Ll,ps:()=>Ul,pt:()=>Rl,ru:()=>Fl,sl:()=>Vl,sv:()=>Gl,ta:()=>Bl,th:()=>Wl,tr:()=>Hl,ua:()=>ql,ur:()=>Kl,vi:()=>Jl,zhCN:()=>Xl,zhTW:()=>Yl});var Lm=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return t=>{switch(t.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${t.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${C(t.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${r} ${t.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${t.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${r} ${t.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${t.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${t.prefix}"`:r.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${r.suffix}"`:r.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${r.includes}"`:r.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${r.pattern}`:`${i[r.format]??t.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${t.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${t.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${t.keys.length>1?"\u0629":""}: ${y(t.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${t.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function ml(){return{localeError:Lm()}}var Rm=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${t.expected}, daxil olan ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${C(t.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${r}${t.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${t.origin??"d\u0259y\u0259r"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${r.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:r.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${r.suffix}" il\u0259 bitm\u0259lidir`:r.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${r.includes}" daxil olmal\u0131d\u0131r`:r.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${r.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[r.format]??t.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${t.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${t.keys.length>1?"lar":""}: ${y(t.keys,", ")}`;case"invalid_key":return`${t.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${t.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function gl(){return{localeError:Rm()}}function fl(e,o,n,i){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?i:r===1?o:r>=2&&r<=4?n:i}var Zm=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(t))return"\u043C\u0430\u0441\u0456\u045E";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return t=>{switch(t.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${t.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${C(t.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);if(a){let c=Number(t.maximum),u=fl(c,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${r}${t.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);if(a){let c=Number(t.minimum),u=fl(c,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${r}${t.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${t.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${r.prefix}"`:r.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${r.suffix}"`:r.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${r.includes}"`:r.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${r.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[r.format]??t.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${t.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${y(t.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${t.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function hl(){return{localeError:Zm()}}var Fm=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return t=>{switch(t.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${t.expected}, s'ha rebut ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Valor inv\xE0lid: s'esperava ${C(t.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${y(t.values," o ")}`;case"too_big":{let r=t.inclusive?"com a m\xE0xim":"menys de",a=o(t.origin);return a?`Massa gran: s'esperava que ${t.origin??"el valor"} contingu\xE9s ${r} ${t.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${t.origin??"el valor"} fos ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"com a m\xEDnim":"m\xE9s de",a=o(t.origin);return a?`Massa petit: s'esperava que ${t.origin} contingu\xE9s ${r} ${t.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${t.origin} fos ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${r.prefix}"`:r.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${r.suffix}"`:r.format==="includes"?`Format inv\xE0lid: ha d'incloure "${r.includes}"`:r.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${r.pattern}`:`Format inv\xE0lid per a ${i[r.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${t.divisor}`;case"unrecognized_keys":return`Clau${t.keys.length>1?"s":""} no reconeguda${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${t.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${t.origin}`;default:return"Entrada inv\xE0lida"}}};function vl(){return{localeError:Fm()}}var Vm=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(t))return"pole";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return t=>{switch(t.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${t.expected}, obdr\u017Eeno ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${C(t.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${r}${t.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED m\xEDt ${r}${t.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${t.origin??"hodnota"} mus\xED b\xFDt ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${r.prefix}"`:r.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${r.suffix}"`:r.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${r.includes}"`:r.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${r.pattern}`:`Neplatn\xFD form\xE1t ${i[r.format]??t.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${t.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${y(t.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${t.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${t.origin}`;default:return"Neplatn\xFD vstup"}}};function yl(){return{localeError:Vm()}}var Gm=()=>{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 o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"Zahl";case"object":{if(Array.isArray(t))return"Array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${t.expected}, erhalten ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Ung\xFCltige Eingabe: erwartet ${C(t.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${t.origin??"Wert"} ${r}${t.maximum.toString()} ist`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${t.origin} ${r}${t.minimum.toString()} ist`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ung\xFCltiger String: muss mit "${r.prefix}" beginnen`:r.format==="ends_with"?`Ung\xFCltiger String: muss mit "${r.suffix}" enden`:r.format==="includes"?`Ung\xFCltiger String: muss "${r.includes}" enthalten`:r.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${r.pattern} entsprechen`:`Ung\xFCltig: ${i[r.format]??t.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${t.divisor} sein`;case"unrecognized_keys":return`${t.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${y(t.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${t.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${t.origin}`;default:return"Ung\xFCltige Eingabe"}}};function bl(){return{localeError:Gm()}}var Bm=e=>{let o=typeof e;switch(o){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 o},Wm=()=>{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 o(i){return e[i]??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 i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${Bm(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${C(i.values[0])}`:`Invalid option: expected one of ${y(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=o(i.origin);return r?`Too big: expected ${i.origin??"value"} to have ${t}${i.maximum.toString()} ${r.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=o(i.origin);return r?`Too small: expected ${i.origin} to have ${t}${i.minimum.toString()} ${r.unit}`:`Too small: expected ${i.origin} to be ${t}${i.minimum.toString()}`}case"invalid_format":{let t=i;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]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${y(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Jo(){return{localeError:Wm()}}var Hm=e=>{let o=typeof e;switch(o){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 o},qm=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function o(i){return e[i]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${Hm(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${C(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${y(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=o(i.origin);return r?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()} ${r.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=o(i.origin);return r?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${t}${i.minimum.toString()} ${r.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${t}${i.minimum.toString()}`}case"invalid_format":{let t=i;return t.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${t.prefix}"`:t.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di 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]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${y(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function $l(){return{localeError:qm()}}var Km=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(t))return"arreglo";if(t===null)return"nulo";if(Object.getPrototypeOf(t)!==Object.prototype)return t.constructor.name}}return r},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return t=>{switch(t.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${t.expected}, recibido ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: se esperaba ${C(t.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Demasiado grande: se esperaba que ${t.origin??"valor"} tuviera ${r}${t.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${t.origin??"valor"} fuera ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Demasiado peque\xF1o: se esperaba que ${t.origin} tuviera ${r}${t.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${t.origin} fuera ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${r.prefix}"`:r.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${r.suffix}"`:r.format==="includes"?`Cadena inv\xE1lida: debe incluir "${r.includes}"`:r.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${r.pattern}`:`Inv\xE1lido ${i[r.format]??t.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Llave${t.keys.length>1?"s":""} desconocida${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${t.origin}`;default:return"Entrada inv\xE1lida"}}};function kl(){return{localeError:Km()}}var Jm=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(t))return"\u0622\u0631\u0627\u06CC\u0647";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return t=>{switch(t.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${t.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(t.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return t.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${C(t.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${y(t.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${r}${t.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${t.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${r}${t.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${r}${t.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${t.origin} \u0628\u0627\u06CC\u062F ${r}${t.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${r.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:r.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${r.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:r.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${r.includes}" \u0628\u0627\u0634\u062F`:r.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${r.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[r.format]??t.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${t.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${t.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${y(t.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${t.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${t.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function wl(){return{localeError:Jm()}}var Xm=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return t=>{switch(t.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${t.expected}, oli ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${C(t.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${r}${t.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${r}${t.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${r.prefix}"`:r.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${r.suffix}"`:r.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${r.includes}"`:r.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${r.pattern}`:`Virheellinen ${i[r.format]??t.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${t.divisor} monikerta`;case"unrecognized_keys":return`${t.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${y(t.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Cl(){return{localeError:Xm()}}var Ym=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"nombre";case"object":{if(Array.isArray(t))return"tableau";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return t=>{switch(t.code){case"invalid_type":return`Entr\xE9e invalide : ${t.expected} attendu, ${n(t.input)} re\xE7u`;case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : ${C(t.values[0])} attendu`:`Option invalide : une valeur parmi ${y(t.values,"|")} attendue`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Trop grand : ${t.origin??"valeur"} doit ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${t.origin??"valeur"} doit \xEAtre ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Trop petit : ${t.origin} doit ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : ${t.origin} doit \xEAtre ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Cha\xEEne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${r.pattern}`:`${i[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${y(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function xl(){return{localeError:Ym()}}var Qm=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return t=>{switch(t.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${t.expected}, re\xE7u ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Entr\xE9e invalide : attendu ${C(t.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"\u2264":"<",a=o(t.origin);return a?`Trop grand : attendu que ${t.origin??"la valeur"} ait ${r}${t.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${t.origin??"la valeur"} soit ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"\u2265":">",a=o(t.origin);return a?`Trop petit : attendu que ${t.origin} ait ${r}${t.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${t.origin} soit ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Cha\xEEne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${r.pattern}`:`${i[r.format]??t.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${t.divisor}`;case"unrecognized_keys":return`Cl\xE9${t.keys.length>1?"s":""} non reconnue${t.keys.length>1?"s":""} : ${y(t.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${t.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${t.origin}`;default:return"Entr\xE9e invalide"}}};function Sl(){return{localeError:Qm()}}var eg=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return t=>{switch(t.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${t.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${C(t.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${t.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${r}${t.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${t.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${t.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${r}${t.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${t.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${r.prefix}"`:r.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${r.suffix}"`:r.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${r.includes}"`:r.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${r.pattern}`:`${i[r.format]??t.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${t.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${t.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${t.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${y(t.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${t.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${t.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function _l(){return{localeError:eg()}}var tg=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(t))return"t\xF6mb";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return t=>{switch(t.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${t.expected}, a kapott \xE9rt\xE9k ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${C(t.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`T\xFAl nagy: ${t.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${r}${t.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${t.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} m\xE9rete t\xFAl kicsi ${r}${t.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${t.origin} t\xFAl kicsi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\xC9rv\xE9nytelen string: "${r.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:r.format==="ends_with"?`\xC9rv\xE9nytelen string: "${r.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:r.format==="includes"?`\xC9rv\xE9nytelen string: "${r.includes}" \xE9rt\xE9ket kell tartalmaznia`:r.format==="regex"?`\xC9rv\xE9nytelen string: ${r.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[r.format]??t.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${t.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${t.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${t.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Pl(){return{localeError:tg()}}var og=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Input tidak valid: diharapkan ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Input tidak valid: diharapkan ${C(t.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Terlalu besar: diharapkan ${t.origin??"value"} memiliki ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${t.origin??"value"} menjadi ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Terlalu kecil: diharapkan ${t.origin} memiliki ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${t.origin} menjadi ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak valid: harus dimulai dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak valid: harus berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak valid: harus menyertakan "${r.includes}"`:r.format==="regex"?`String tidak valid: harus sesuai pola ${r.pattern}`:`${i[r.format]??t.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${t.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${t.origin}`;default:return"Input tidak valid"}}};function Il(){return{localeError:og()}}var ng=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"numero";case"object":{if(Array.isArray(t))return"vettore";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Input non valido: atteso ${t.expected}, ricevuto ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Input non valido: atteso ${C(t.values[0])}`:`Opzione non valida: atteso uno tra ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Troppo grande: ${t.origin??"valore"} deve avere ${r}${t.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${t.origin??"valore"} deve essere ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Troppo piccolo: ${t.origin} deve avere ${r}${t.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${t.origin} deve essere ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Stringa non valida: deve iniziare con "${r.prefix}"`:r.format==="ends_with"?`Stringa non valida: deve terminare con "${r.suffix}"`:r.format==="includes"?`Stringa non valida: deve includere "${r.includes}"`:r.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${r.pattern}`:`Invalid ${i[r.format]??t.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${t.divisor}`;case"unrecognized_keys":return`Chiav${t.keys.length>1?"i":"e"} non riconosciut${t.keys.length>1?"e":"a"}: ${y(t.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${t.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${t.origin}`;default:return"Input non valido"}}};function El(){return{localeError:ng()}}var rg=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(t))return"\u914D\u5217";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return t=>{switch(t.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${t.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(t.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return t.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${C(t.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${y(t.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let r=t.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=o(t.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${a.unit??"\u8981\u7D20"}${r}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${t.origin??"\u5024"}\u306F${t.maximum.toString()}${r}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let r=t.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=o(t.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${a.unit}${r}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${t.origin}\u306F${t.minimum.toString()}${r}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${r.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:r.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${r.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:r.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${r.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:r.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${r.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[r.format]??t.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${t.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${t.keys.length>1?"\u7FA4":""}: ${y(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${t.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Ol(){return{localeError:rg()}}var ig=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(t))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(t===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return t=>{switch(t.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${C(t.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${r} ${t.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${r} ${t.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${t.origin} ${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${r.prefix}"`:r.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${r.suffix}"`:r.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${r.includes}"`:r.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${r.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${t.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${y(t.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${t.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Tl(){return{localeError:ig()}}var sg=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return t=>{switch(t.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${t.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(t.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return t.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${C(t.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${y(t.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let r=t.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=r==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=o(t.origin),u=c?.unit??"\uC694\uC18C";return c?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()}${u} ${r}${a}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${t.maximum.toString()} ${r}${a}`}case"too_small":{let r=t.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=r==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=o(t.origin),u=c?.unit??"\uC694\uC18C";return c?`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()}${u} ${r}${a}`:`${t.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${t.minimum.toString()} ${r}${a}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${r.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:r.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${r.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:r.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${r.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:r.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${r.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[r.format]??t.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${t.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${y(t.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${t.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${t.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Al(){return{localeError:sg()}}var ag=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(t))return"\u043D\u0438\u0437\u0430";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return t=>{switch(t.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Invalid input: expected ${C(t.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${r}${t.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0438\u043C\u0430 ${r}${t.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${t.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${r.prefix}"`:r.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${r.suffix}"`:r.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${r.includes}"`:r.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${r.pattern}`:`Invalid ${i[r.format]??t.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${y(t.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${t.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${t.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Ml(){return{localeError:ag()}}var cg=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"nombor";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Input tidak sah: dijangka ${t.expected}, diterima ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Input tidak sah: dijangka ${C(t.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Terlalu besar: dijangka ${t.origin??"nilai"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${t.origin??"nilai"} adalah ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Terlalu kecil: dijangka ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${t.origin} adalah ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`String tidak sah: mesti bermula dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak sah: mesti mengandungi "${r.includes}"`:r.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${r.pattern}`:`${i[r.format]??t.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${t.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${y(t.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${t.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${t.origin}`;default:return"Input tidak sah"}}};function zl(){return{localeError:cg()}}var lg=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"getal";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={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 t=>{switch(t.code){case"invalid_type":return`Ongeldige invoer: verwacht ${t.expected}, ontving ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Ongeldige invoer: verwacht ${C(t.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Te lang: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${t.origin??"waarde"} ${r}${t.maximum.toString()} is`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Te kort: verwacht dat ${t.origin} ${r}${t.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${t.origin} ${r}${t.minimum.toString()} is`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ongeldige tekst: moet met "${r.prefix}" beginnen`:r.format==="ends_with"?`Ongeldige tekst: moet op "${r.suffix}" eindigen`:r.format==="includes"?`Ongeldige tekst: moet "${r.includes}" bevatten`:r.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`:`Ongeldig: ${i[r.format]??t.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${t.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${t.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${t.origin}`;default:return"Ongeldige invoer"}}};function Nl(){return{localeError:lg()}}var ug=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"tall";case"object":{if(Array.isArray(t))return"liste";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`Ugyldig input: forventet ${t.expected}, fikk ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Ugyldig verdi: forventet ${C(t.values[0])}`:`Ugyldig valg: forventet en av ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${r}${t.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${t.origin??"value"} til \xE5 ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`For lite(n): forventet ${t.origin} til \xE5 ha ${r}${t.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${t.origin} til \xE5 ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${r.pattern}`:`Ugyldig ${i[r.format]??t.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${y(t.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${t.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${t.origin}`;default:return"Ugyldig input"}}};function jl(){return{localeError:ug()}}var dg=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"numara";case"object":{if(Array.isArray(t))return"saf";if(t===null)return"gayb";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return t=>{switch(t.code){case"invalid_type":return`F\xE2sit giren: umulan ${t.expected}, al\u0131nan ${n(t.input)}`;case"invalid_value":return t.values.length===1?`F\xE2sit giren: umulan ${C(t.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${r}${t.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${t.origin??"value"}, ${r}${t.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${r}${t.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${t.origin}, ${r}${t.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let r=t;return r.format==="starts_with"?`F\xE2sit metin: "${r.prefix}" ile ba\u015Flamal\u0131.`:r.format==="ends_with"?`F\xE2sit metin: "${r.suffix}" ile bitmeli.`:r.format==="includes"?`F\xE2sit metin: "${r.includes}" ihtiv\xE2 etmeli.`:r.format==="regex"?`F\xE2sit metin: ${r.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[r.format]??t.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${t.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`${t.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${t.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Dl(){return{localeError:dg()}}var pg=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(t))return"\u0627\u0631\u06D0";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return t=>{switch(t.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${t.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(t.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return t.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${C(t.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${y(t.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${r}${t.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${t.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${r}${t.maximum.toString()} \u0648\u064A`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${r}${t.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${t.origin} \u0628\u0627\u06CC\u062F ${r}${t.minimum.toString()} \u0648\u064A`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${r.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:r.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${r.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:r.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${r.includes}" \u0648\u0644\u0631\u064A`:r.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${r.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[r.format]??t.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${t.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${t.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${y(t.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${t.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${t.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Ul(){return{localeError:pg()}}var mg=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"liczba";case"object":{if(Array.isArray(t))return"tablica";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return t=>{switch(t.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${t.expected}, otrzymano ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${C(t.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${r}${t.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${r}${t.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${t.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${r.prefix}"`:r.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${r.suffix}"`:r.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${r.includes}"`:r.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${r.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[r.format]??t.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${t.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${t.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${t.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Ll(){return{localeError:mg()}}var gg=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(t))return"array";if(t===null)return"nulo";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return t=>{switch(t.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${t.expected}, recebido ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Entrada inv\xE1lida: esperado ${C(t.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Muito grande: esperado que ${t.origin??"valor"} tivesse ${r}${t.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${t.origin??"valor"} fosse ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Muito pequeno: esperado que ${t.origin} tivesse ${r}${t.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${t.origin} fosse ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${r.prefix}"`:r.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${r.suffix}"`:r.format==="includes"?`Texto inv\xE1lido: deve incluir "${r.includes}"`:r.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${r.pattern}`:`${i[r.format]??t.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${t.divisor}`;case"unrecognized_keys":return`Chave${t.keys.length>1?"s":""} desconhecida${t.keys.length>1?"s":""}: ${y(t.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${t.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${t.origin}`;default:return"Campo inv\xE1lido"}}};function Rl(){return{localeError:gg()}}function Zl(e,o,n,i){let t=Math.abs(e),r=t%10,a=t%100;return a>=11&&a<=19?i:r===1?o:r>=2&&r<=4?n:i}var fg=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(t))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return t=>{switch(t.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${t.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${C(t.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);if(a){let c=Number(t.maximum),u=Zl(c,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${r}${t.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);if(a){let c=Number(t.minimum),u=Zl(c,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${r}${t.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${t.origin} \u0431\u0443\u0434\u0435\u0442 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${r.prefix}"`:r.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${r.suffix}"`:r.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${r.includes}"`:r.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${r.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${t.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0438":""}: ${y(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${t.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function Fl(){return{localeError:fg()}}var hg=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(t))return"tabela";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return t=>{switch(t.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${t.expected}, prejeto ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${C(t.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} imelo ${r}${t.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${t.origin??"vrednost"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${t.origin} imelo ${r}${t.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${r.prefix}"`:r.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${r.suffix}"`:r.format==="includes"?`Neveljaven niz: mora vsebovati "${r.includes}"`:r.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`:`Neveljaven ${i[r.format]??t.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${t.divisor}`;case"unrecognized_keys":return`Neprepoznan${t.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${y(t.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${t.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${t.origin}`;default:return"Neveljaven vnos"}}};function Vl(){return{localeError:hg()}}var vg=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"antal";case"object":{if(Array.isArray(t))return"lista";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return t=>{switch(t.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${t.expected}, fick ${n(t.input)}`;case"invalid_value":return t.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${C(t.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${r}${t.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${t.origin??"v\xE4rdet"} att ha ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${r}${t.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${t.origin??"v\xE4rdet"} att ha ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${r.prefix}"`:r.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${r.suffix}"`:r.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${r.includes}"`:r.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${r.pattern}"`:`Ogiltig(t) ${i[r.format]??t.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${t.divisor}`;case"unrecognized_keys":return`${t.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${y(t.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${t.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${t.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function Gl(){return{localeError:vg()}}var yg=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(t))return"\u0B85\u0BA3\u0BBF";if(t===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return t=>{switch(t.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${C(t.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${y(t.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${r}${t.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${r}${t.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${r}${t.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${t.origin} ${r}${t.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${r.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:r.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${r.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:r.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${r.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:r.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${r.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${t.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${t.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${y(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${t.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function Bl(){return{localeError:yg()}}var bg=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(t))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(t===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return t=>{switch(t.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${t.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${C(t.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=o(t.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${r} ${t.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${r} ${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=o(t.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${r} ${t.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${t.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${r} ${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${r.prefix}"`:r.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${r.suffix}"`:r.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${r.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:r.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${r.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[r.format]??t.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${t.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${y(t.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${t.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function Wl(){return{localeError:bg()}}var $g=e=>{let o=typeof e;switch(o){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 o},kg=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function o(i){return e[i]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${$g(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${C(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${y(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",r=o(i.origin);return r?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${t}${i.maximum.toString()} ${r.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",r=o(i.origin);return r?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${t}${i.minimum.toString()} ${r.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":{let t=i;return t.format==="starts_with"?`Ge\xE7ersiz metin: "${t.prefix}" ile ba\u015Flamal\u0131`:t.format==="ends_with"?`Ge\xE7ersiz metin: "${t.suffix}" ile bitmeli`:t.format==="includes"?`Ge\xE7ersiz metin: "${t.includes}" i\xE7ermeli`:t.format==="regex"?`Ge\xE7ersiz metin: ${t.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[t.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${y(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Hl(){return{localeError:kg()}}var wg=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(t))return"\u043C\u0430\u0441\u0438\u0432";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return t=>{switch(t.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${t.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${C(t.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${t.origin} \u0431\u0443\u0434\u0435 ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${r.prefix}"`:r.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${r.suffix}"`:r.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${r.includes}"`:r.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${r.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${t.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${t.keys.length>1?"\u0456":""}: ${y(t.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${t.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${t.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function ql(){return{localeError:wg()}}var Cg=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(t))return"\u0622\u0631\u06D2";if(t===null)return"\u0646\u0644";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return t=>{switch(t.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${t.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(t.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return t.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${C(t.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${y(t.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${r}${t.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${t.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${r}${t.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u06D2 ${r}${t.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${t.origin} \u06A9\u0627 ${r}${t.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${r.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:r.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${r.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:r.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${r.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:r.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${r.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${t.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${t.keys.length>1?"\u0632":""}: ${y(t.keys,"\u060C ")}`;case"invalid_key":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${t.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function Kl(){return{localeError:Cg()}}var xg=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(t))return"m\u1EA3ng";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return t=>{switch(t.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${t.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${C(t.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${r}${t.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${t.origin??"gi\xE1 tr\u1ECB"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${a.verb} ${r}${t.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${r.prefix}"`:r.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${r.suffix}"`:r.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${r.includes}"`:r.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${r.pattern}`:`${i[r.format]??t.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${t.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${y(t.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${t.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function Jl(){return{localeError:xg()}}var Sg=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(t))return"\u6570\u7EC4";if(t===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return t=>{switch(t.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${t.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${C(t.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${r}${t.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${t.origin??"\u503C"} ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${r}${t.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${t.origin} ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${r.prefix}" \u5F00\u5934`:r.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${r.suffix}" \u7ED3\u5C3E`:r.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${r.includes}"`:r.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${r.pattern}`:`\u65E0\u6548${i[r.format]??t.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${t.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${y(t.keys,", ")}`;case"invalid_key":return`${t.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${t.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function Xl(){return{localeError:Sg()}}var _g=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function o(t){return e[t]??null}let n=t=>{let r=typeof t;switch(r){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return r},i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return t=>{switch(t.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${t.expected}\uFF0C\u4F46\u6536\u5230 ${n(t.input)}`;case"invalid_value":return t.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${C(t.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${y(t.values,"|")}`;case"too_big":{let r=t.inclusive?"<=":"<",a=o(t.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${r}${t.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${t.origin??"\u503C"} \u61C9\u70BA ${r}${t.maximum.toString()}`}case"too_small":{let r=t.inclusive?">=":">",a=o(t.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${r}${t.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${t.origin} \u61C9\u70BA ${r}${t.minimum.toString()}`}case"invalid_format":{let r=t;return r.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${r.prefix}" \u958B\u982D`:r.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${r.suffix}" \u7D50\u5C3E`:r.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${r.includes}"`:r.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${r.pattern}`:`\u7121\u6548\u7684 ${i[r.format]??t.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${t.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${t.keys.length>1?"\u5011":""}\uFF1A${y(t.keys,"\u3001")}`;case"invalid_key":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${t.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function Yl(){return{localeError:_g()}}var Ss=Symbol("ZodOutput"),_s=Symbol("ZodInput"),dt=class{constructor(){this._map=new Map,this._idmap=new Map}add(o,...n){let i=n[0];if(this._map.set(o,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,o)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(o){let n=this._map.get(o);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(o),this}get(o){let n=o._zod.parent;if(n){let i={...this.get(n)??{}};return delete i.id,{...i,...this._map.get(o)}}return this._map.get(o)}has(o){return this._map.has(o)}};function Xo(){return new dt}var he=Xo();function Ps(e,o){return new e({type:"string",...w(o)})}function Is(e,o){return new e({type:"string",coerce:!0,...w(o)})}function Yo(e,o){return new e({type:"string",format:"email",check:"string_format",abort:!1,...w(o)})}function Ht(e,o){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...w(o)})}function Qo(e,o){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...w(o)})}function en(e,o){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...w(o)})}function tn(e,o){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...w(o)})}function on(e,o){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...w(o)})}function nn(e,o){return new e({type:"string",format:"url",check:"string_format",abort:!1,...w(o)})}function rn(e,o){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...w(o)})}function sn(e,o){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...w(o)})}function an(e,o){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...w(o)})}function cn(e,o){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...w(o)})}function ln(e,o){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...w(o)})}function un(e,o){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...w(o)})}function dn(e,o){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...w(o)})}function pn(e,o){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...w(o)})}function mn(e,o){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...w(o)})}function gn(e,o){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...w(o)})}function fn(e,o){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...w(o)})}function hn(e,o){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...w(o)})}function vn(e,o){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...w(o)})}function yn(e,o){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...w(o)})}function bn(e,o){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...w(o)})}var Es={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Os(e,o){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...w(o)})}function Ts(e,o){return new e({type:"string",format:"date",check:"string_format",...w(o)})}function As(e,o){return new e({type:"string",format:"time",check:"string_format",precision:null,...w(o)})}function Ms(e,o){return new e({type:"string",format:"duration",check:"string_format",...w(o)})}function zs(e,o){return new e({type:"number",checks:[],...w(o)})}function Ns(e,o){return new e({type:"number",coerce:!0,checks:[],...w(o)})}function js(e,o){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...w(o)})}function Ds(e,o){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...w(o)})}function Us(e,o){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...w(o)})}function Ls(e,o){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...w(o)})}function Rs(e,o){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...w(o)})}function Zs(e,o){return new e({type:"boolean",...w(o)})}function Fs(e,o){return new e({type:"boolean",coerce:!0,...w(o)})}function Vs(e,o){return new e({type:"bigint",...w(o)})}function Gs(e,o){return new e({type:"bigint",coerce:!0,...w(o)})}function Bs(e,o){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...w(o)})}function Ws(e,o){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...w(o)})}function Hs(e,o){return new e({type:"symbol",...w(o)})}function qs(e,o){return new e({type:"undefined",...w(o)})}function Ks(e,o){return new e({type:"null",...w(o)})}function Js(e){return new e({type:"any"})}function pt(e){return new e({type:"unknown"})}function Xs(e,o){return new e({type:"never",...w(o)})}function Ys(e,o){return new e({type:"void",...w(o)})}function Qs(e,o){return new e({type:"date",...w(o)})}function ea(e,o){return new e({type:"date",coerce:!0,...w(o)})}function ta(e,o){return new e({type:"nan",...w(o)})}function xe(e,o){return new Vo({check:"less_than",...w(o),value:e,inclusive:!1})}function me(e,o){return new Vo({check:"less_than",...w(o),value:e,inclusive:!0})}function Se(e,o){return new Go({check:"greater_than",...w(o),value:e,inclusive:!1})}function re(e,o){return new Go({check:"greater_than",...w(o),value:e,inclusive:!0})}function oa(e){return Se(0,e)}function na(e){return xe(0,e)}function ra(e){return me(0,e)}function ia(e){return re(0,e)}function He(e,o){return new ni({check:"multiple_of",...w(o),value:e})}function mt(e,o){return new si({check:"max_size",...w(o),maximum:e})}function qe(e,o){return new ai({check:"min_size",...w(o),minimum:e})}function qt(e,o){return new ci({check:"size_equals",...w(o),size:e})}function gt(e,o){return new li({check:"max_length",...w(o),maximum:e})}function Ne(e,o){return new ui({check:"min_length",...w(o),minimum:e})}function ft(e,o){return new di({check:"length_equals",...w(o),length:e})}function Kt(e,o){return new pi({check:"string_format",format:"regex",...w(o),pattern:e})}function Jt(e){return new mi({check:"string_format",format:"lowercase",...w(e)})}function Xt(e){return new gi({check:"string_format",format:"uppercase",...w(e)})}function Yt(e,o){return new fi({check:"string_format",format:"includes",...w(o),includes:e})}function Qt(e,o){return new hi({check:"string_format",format:"starts_with",...w(o),prefix:e})}function eo(e,o){return new vi({check:"string_format",format:"ends_with",...w(o),suffix:e})}function sa(e,o,n){return new yi({check:"property",property:e,schema:o,...w(n)})}function to(e,o){return new bi({check:"mime_type",mime:e,...w(o)})}function _e(e){return new $i({check:"overwrite",tx:e})}function oo(e){return _e(o=>o.normalize(e))}function no(){return _e(e=>e.trim())}function ro(){return _e(e=>e.toLowerCase())}function io(){return _e(e=>e.toUpperCase())}function so(e,o,n){return new e({type:"array",element:o,...w(n)})}function Pg(e,o,n){return new e({type:"union",options:o,...w(n)})}function Ig(e,o,n,i){return new e({type:"union",options:n,discriminator:o,...w(i)})}function Eg(e,o,n){return new e({type:"intersection",left:o,right:n})}function aa(e,o,n,i){let t=n instanceof A,r=t?i:n,a=t?n:null;return new e({type:"tuple",items:o,rest:a,...w(r)})}function Og(e,o,n,i){return new e({type:"record",keyType:o,valueType:n,...w(i)})}function Tg(e,o,n,i){return new e({type:"map",keyType:o,valueType:n,...w(i)})}function Ag(e,o,n){return new e({type:"set",valueType:o,...w(n)})}function Mg(e,o,n){let i=Array.isArray(o)?Object.fromEntries(o.map(t=>[t,t])):o;return new e({type:"enum",entries:i,...w(n)})}function zg(e,o,n){return new e({type:"enum",entries:o,...w(n)})}function Ng(e,o,n){return new e({type:"literal",values:Array.isArray(o)?o:[o],...w(n)})}function ca(e,o){return new e({type:"file",...w(o)})}function jg(e,o){return new e({type:"transform",transform:o})}function Dg(e,o){return new e({type:"optional",innerType:o})}function Ug(e,o){return new e({type:"nullable",innerType:o})}function Lg(e,o,n){return new e({type:"default",innerType:o,get defaultValue(){return typeof n=="function"?n():n}})}function Rg(e,o,n){return new e({type:"nonoptional",innerType:o,...w(n)})}function Zg(e,o){return new e({type:"success",innerType:o})}function Fg(e,o,n){return new e({type:"catch",innerType:o,catchValue:typeof n=="function"?n:()=>n})}function Vg(e,o,n){return new e({type:"pipe",in:o,out:n})}function Gg(e,o){return new e({type:"readonly",innerType:o})}function Bg(e,o,n){return new e({type:"template_literal",parts:o,...w(n)})}function Wg(e,o){return new e({type:"lazy",getter:o})}function Hg(e,o){return new e({type:"promise",innerType:o})}function la(e,o,n){let i=w(n);return i.abort??(i.abort=!0),new e({type:"custom",check:"custom",fn:o,...i})}function ua(e,o,n){return new e({type:"custom",check:"custom",fn:o,...w(n)})}function da(e,o){let n=w(o),i=n.truthy??["true","1","yes","on","y","enabled"],t=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(i=i.map(h=>typeof h=="string"?h.toLowerCase():h),t=t.map(h=>typeof h=="string"?h.toLowerCase():h));let r=new Set(i),a=new Set(t),c=e.Pipe??Bt,u=e.Boolean??Ft,p=e.String??Be,d=e.Transform??Gt,f=new d({type:"transform",transform:(h,k)=>{let v=h;return n.case!=="sensitive"&&(v=v.toLowerCase()),r.has(v)?!0:a.has(v)?!1:(k.issues.push({code:"invalid_value",expected:"stringbool",values:[...r,...a],input:k.value,inst:f}),{})},error:n.error}),$=new c({type:"pipe",in:new p({type:"string",error:n.error}),out:f,error:n.error});return new c({type:"pipe",in:$,out:new u({type:"boolean",error:n.error}),error:n.error})}function pa(e,o,n,i={}){let t=w(i),r={...w(i),check:"string_format",type:"string",format:o,fn:typeof n=="function"?n:c=>n.test(c),...t};return n instanceof RegExp&&(r.pattern=n),new e(r)}var $n=class{constructor(o){this._def=o,this.def=o}implement(o){if(typeof o!="function")throw new Error("implement() must be called with a function");let n=((...i)=>{let t=this._def.input?Do(this._def.input,i,void 0,{callee:n}):i;if(!Array.isArray(t))throw new Error("Invalid arguments schema: not an array or tuple schema.");let r=o(...t);return this._def.output?Do(this._def.output,r,void 0,{callee:n}):r});return n}implementAsync(o){if(typeof o!="function")throw new Error("implement() must be called with a function");let n=(async(...i)=>{let t=this._def.input?await Lo(this._def.input,i,void 0,{callee:n}):i;if(!Array.isArray(t))throw new Error("Invalid arguments schema: not an array or tuple schema.");let r=await o(...t);return this._def.output?Lo(this._def.output,r,void 0,{callee:n}):r});return n}input(...o){let n=this.constructor;return Array.isArray(o[0])?new n({type:"function",input:new We({type:"tuple",items:o[0],rest:o[1]}),output:this._def.output}):new n({type:"function",input:o[0],output:this._def.output})}output(o){let n=this.constructor;return new n({type:"function",input:this._def.input,output:o})}};function ma(e){return new $n({type:"function",input:Array.isArray(e?.input)?aa(We,e?.input):e?.input??so(Vt,pt(ut)),output:e?.output??pt(ut)})}var ao=class{constructor(o){this.counter=0,this.metadataRegistry=o?.metadata??he,this.target=o?.target??"draft-2020-12",this.unrepresentable=o?.unrepresentable??"throw",this.override=o?.override??(()=>{}),this.io=o?.io??"output",this.seen=new Map}process(o,n={path:[],schemaPath:[]}){var i;let t=o._zod.def,r={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(o);if(a)return a.count++,n.schemaPath.includes(o)&&(a.cycle=n.path),a.schema;let c={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(o,c);let u=o._zod.toJSONSchema?.();if(u)c.schema=u;else{let f={...n,schemaPath:[...n.schemaPath,o],path:n.path},$=o._zod.parent;if($)c.ref=$,this.process($,f),this.seen.get($).isParent=!0;else{let b=c.schema;switch(t.type){case"string":{let h=b;h.type="string";let{minimum:k,maximum:v,format:_,patterns:S,contentEncoding:P}=o._zod.bag;if(typeof k=="number"&&(h.minLength=k),typeof v=="number"&&(h.maxLength=v),_&&(h.format=r[_]??_,h.format===""&&delete h.format),P&&(h.contentEncoding=P),S&&S.size>0){let T=[...S];T.length===1?h.pattern=T[0].source:T.length>1&&(c.schema.allOf=[...T.map(H=>({...this.target==="draft-7"?{type:"string"}:{},pattern:H.source}))])}break}case"number":{let h=b,{minimum:k,maximum:v,format:_,multipleOf:S,exclusiveMaximum:P,exclusiveMinimum:T}=o._zod.bag;typeof _=="string"&&_.includes("int")?h.type="integer":h.type="number",typeof T=="number"&&(h.exclusiveMinimum=T),typeof k=="number"&&(h.minimum=k,typeof T=="number"&&(T>=k?delete h.minimum:delete h.exclusiveMinimum)),typeof P=="number"&&(h.exclusiveMaximum=P),typeof v=="number"&&(h.maximum=v,typeof P=="number"&&(P<=v?delete h.maximum:delete h.exclusiveMaximum)),typeof S=="number"&&(h.multipleOf=S);break}case"boolean":{let h=b;h.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{b.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{b.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let h=b,{minimum:k,maximum:v}=o._zod.bag;typeof k=="number"&&(h.minItems=k),typeof v=="number"&&(h.maxItems=v),h.type="array",h.items=this.process(t.element,{...f,path:[...f.path,"items"]});break}case"object":{let h=b;h.type="object",h.properties={};let k=t.shape;for(let S in k)h.properties[S]=this.process(k[S],{...f,path:[...f.path,"properties",S]});let v=new Set(Object.keys(k)),_=new Set([...v].filter(S=>{let P=t.shape[S]._zod;return this.io==="input"?P.optin===void 0:P.optout===void 0}));_.size>0&&(h.required=Array.from(_)),t.catchall?._zod.def.type==="never"?h.additionalProperties=!1:t.catchall?t.catchall&&(h.additionalProperties=this.process(t.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(h.additionalProperties=!1);break}case"union":{let h=b;h.anyOf=t.options.map((k,v)=>this.process(k,{...f,path:[...f.path,"anyOf",v]}));break}case"intersection":{let h=b,k=this.process(t.left,{...f,path:[...f.path,"allOf",0]}),v=this.process(t.right,{...f,path:[...f.path,"allOf",1]}),_=P=>"allOf"in P&&Object.keys(P).length===1,S=[..._(k)?k.allOf:[k],..._(v)?v.allOf:[v]];h.allOf=S;break}case"tuple":{let h=b;h.type="array";let k=t.items.map((S,P)=>this.process(S,{...f,path:[...f.path,"prefixItems",P]}));if(this.target==="draft-2020-12"?h.prefixItems=k:h.items=k,t.rest){let S=this.process(t.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?h.items=S:h.additionalItems=S}t.rest&&(h.items=this.process(t.rest,{...f,path:[...f.path,"items"]}));let{minimum:v,maximum:_}=o._zod.bag;typeof v=="number"&&(h.minItems=v),typeof _=="number"&&(h.maxItems=_);break}case"record":{let h=b;h.type="object",h.propertyNames=this.process(t.keyType,{...f,path:[...f.path,"propertyNames"]}),h.additionalProperties=this.process(t.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let h=b,k=At(t.entries);k.every(v=>typeof v=="number")&&(h.type="number"),k.every(v=>typeof v=="string")&&(h.type="string"),h.enum=k;break}case"literal":{let h=b,k=[];for(let v of t.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");k.push(Number(v))}else k.push(v);if(k.length!==0)if(k.length===1){let v=k[0];h.type=v===null?"null":typeof v,h.const=v}else k.every(v=>typeof v=="number")&&(h.type="number"),k.every(v=>typeof v=="string")&&(h.type="string"),k.every(v=>typeof v=="boolean")&&(h.type="string"),k.every(v=>v===null)&&(h.type="null"),h.enum=k;break}case"file":{let h=b,k={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:_,mime:S}=o._zod.bag;v!==void 0&&(k.minLength=v),_!==void 0&&(k.maxLength=_),S?S.length===1?(k.contentMediaType=S[0],Object.assign(h,k)):h.anyOf=S.map(P=>({...k,contentMediaType:P})):Object.assign(h,k);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let h=this.process(t.innerType,f);b.anyOf=[h,{type:"null"}];break}case"nonoptional":{this.process(t.innerType,f),c.ref=t.innerType;break}case"success":{let h=b;h.type="boolean";break}case"default":{this.process(t.innerType,f),c.ref=t.innerType,b.default=JSON.parse(JSON.stringify(t.defaultValue));break}case"prefault":{this.process(t.innerType,f),c.ref=t.innerType,this.io==="input"&&(b._prefault=JSON.parse(JSON.stringify(t.defaultValue)));break}case"catch":{this.process(t.innerType,f),c.ref=t.innerType;let h;try{h=t.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}b.default=h;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let h=b,k=o._zod.pattern;if(!k)throw new Error("Pattern not found in template literal");h.type="string",h.pattern=k.source;break}case"pipe":{let h=this.io==="input"?t.in._zod.def.type==="transform"?t.out:t.in:t.out;this.process(h,f),c.ref=h;break}case"readonly":{this.process(t.innerType,f),c.ref=t.innerType,b.readOnly=!0;break}case"promise":{this.process(t.innerType,f),c.ref=t.innerType;break}case"optional":{this.process(t.innerType,f),c.ref=t.innerType;break}case"lazy":{let h=o._zod.innerType;this.process(h,f),c.ref=h;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let p=this.metadataRegistry.get(o);return p&&Object.assign(c.schema,p),this.io==="input"&&X(o)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((i=c.schema).default??(i.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(o).schema}emit(o,n){let i={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},t=this.seen.get(o);if(!t)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=d=>{let f=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let k=i.external.registry.get(d[0])?.id,v=i.external.uri??(S=>S);if(k)return{ref:v(k)};let _=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=_,{defId:_,ref:`${v("__shared")}#/${f}/${_}`}}if(d[1]===t)return{ref:"#"};let b=`#/${f}/`,h=d[1].schema.id??`__schema${this.counter++}`;return{defId:h,ref:b+h}},a=d=>{if(d[1].schema.$ref)return;let f=d[1],{ref:$,defId:b}=r(d);f.def={...f.schema},b&&(f.defId=b);let h=f.schema;for(let k in h)delete h[k];h.$ref=$};if(i.cycles==="throw")for(let d of this.seen.entries()){let f=d[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
33
+ path: iss.path ? [${mt(C)}, ...iss.path] : [${mt(C)}]
34
+ })));`),h.write(`newResult[${mt(C)}] = ${w}.value`)}h.write("payload.value = newResult;"),h.write("return payload;");let k=h.compile();return(C,w)=>k(m,C,w)},n,i=Bt,s=!Cn.jitless,u=s&&Ui.value,p=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=o.value);let y=m.value;if(!i(y))return m.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),m;let g=[];if(s&&u&&h?.async===!1&&h.jitless!==!0)n||(n=r(t.shape)),m=n(m,h);else{m.value={};let w=d.shape;for(let P of d.keys){let U=w[P],B=U._zod.run({value:y[P],issues:[]},h),M=U._zod.optin==="optional"&&U._zod.optout==="optional";B instanceof Promise?g.push(B.then(Y=>M?pd(Y,m,P,y):Ko(Y,m,P))):M?pd(B,m,P,y):Ko(B,m,P)}}if(!p)return g.length?Promise.all(g).then(()=>m):m;let D=[],b=d.keySet,k=p._zod,C=k.def.type;for(let w of Object.keys(y)){if(b.has(w))continue;if(C==="never"){D.push(w);continue}let P=k.run({value:y[w],issues:[]},h);P instanceof Promise?g.push(P.then(U=>Ko(U,m,w))):Ko(P,m,w)}return D.length&&m.issues.push({code:"unrecognized_keys",keys:D,input:y,inst:e}),g.length?Promise.all(g).then(()=>m):m}});function md(e,t,o,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:o,errors:e.map(n=>n.issues.map(i=>be(i,r,re())))}),t}var Qo=v("$ZodUnion",(e,t)=>{O.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){let o=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${o.map(r=>Sn(r.source)).join("|")})$`)}}),e._zod.parse=(o,r)=>{let n=!1,i=[];for(let s of t.options){let c=s._zod.run({value:o.value,issues:[]},r);if(c instanceof Promise)i.push(c),n=!0;else{if(c.issues.length===0)return c;i.push(c)}}return n?Promise.all(i).then(s=>md(s,o,e,r)):md(i,o,e,r)}}),Sa=v("$ZodDiscriminatedUnion",(e,t)=>{Qo.init(e,t);let o=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[c,u]of Object.entries(s)){n[c]||(n[c]=new Set);for(let p of u)n[c].add(p)}}return n});let r=xn(()=>{let n=t.options,i=new Map;for(let s of n){let c=s._zod.propValues[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of c){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!Bt(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let c=r.value.get(s?.[t.discriminator]);return c?c._zod.run(n,i):t.unionFallback?o(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),n)}}),_a=v("$ZodIntersection",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value,i=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,p])=>gd(o,u,p)):gd(o,i,s)}});function Vs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Rt(e)&&Rt(t)){let o=Object.keys(t),r=Object.keys(e).filter(i=>o.indexOf(i)!==-1),n={...e,...t};for(let i of r){let s=Vs(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let o=[];for(let r=0;r<e.length;r++){let n=e[r],i=t[r],s=Vs(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};o.push(s.data)}return{valid:!0,data:o}}return{valid:!1,mergeErrorPath:[]}}function gd(e,t,o){if(t.issues.length&&e.issues.push(...t.issues),o.issues.length&&e.issues.push(...o.issues),gt(e))return e;let r=Vs(t.value,o.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var yt=v("$ZodTuple",(e,t)=>{O.init(e,t);let o=t.items,r=o.length-[...o].reverse().findIndex(n=>n._zod.optin!=="optional");e._zod.parse=(n,i)=>{let s=n.value;if(!Array.isArray(s))return n.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let c=[];if(!t.rest){let p=s.length>o.length,d=s.length<r-1;if(p||d)return n.issues.push({input:s,inst:e,origin:"array",...p?{code:"too_big",maximum:o.length}:{code:"too_small",minimum:o.length}}),n}let u=-1;for(let p of o){if(u++,u>=s.length&&u>=r)continue;let d=p._zod.run({value:s[u],issues:[]},i);d instanceof Promise?c.push(d.then(m=>Jo(m,n,u))):Jo(d,n,u)}if(t.rest){let p=s.slice(o.length);for(let d of p){u++;let m=t.rest._zod.run({value:d,issues:[]},i);m instanceof Promise?c.push(m.then(h=>Jo(h,n,u))):Jo(m,n,u)}}return c.length?Promise.all(c).then(()=>n):n}});function Jo(e,t,o){e.issues.length&&t.issues.push(...me(o,e.issues)),t.value[o]=e.value}var Pa=v("$ZodRecord",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!Rt(n))return o.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),o;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;o.value={};for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let p=t.valueType._zod.run({value:n[u],issues:[]},r);p instanceof Promise?i.push(p.then(d=>{d.issues.length&&o.issues.push(...me(u,d.issues)),o.value[u]=d.value})):(p.issues.length&&o.issues.push(...me(u,p.issues)),o.value[u]=p.value)}let c;for(let u in n)s.has(u)||(c=c??[],c.push(u));c&&c.length>0&&o.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{o.value={};for(let s of Reflect.ownKeys(n)){if(s==="__proto__")continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(c.issues.length){o.issues.push({origin:"record",code:"invalid_key",issues:c.issues.map(p=>be(p,r,re())),input:s,path:[s],inst:e}),o.value[c.value]=c.value;continue}let u=t.valueType._zod.run({value:n[s],issues:[]},r);u instanceof Promise?i.push(u.then(p=>{p.issues.length&&o.issues.push(...me(s,p.issues)),o.value[c.value]=p.value})):(u.issues.length&&o.issues.push(...me(s,u.issues)),o.value[c.value]=u.value)}}return i.length?Promise.all(i).then(()=>o):o}}),Ea=v("$ZodMap",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Map))return o.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),o;let i=[];o.value=new Map;for(let[s,c]of n){let u=t.keyType._zod.run({value:s,issues:[]},r),p=t.valueType._zod.run({value:c,issues:[]},r);u instanceof Promise||p instanceof Promise?i.push(Promise.all([u,p]).then(([d,m])=>{fd(d,m,o,s,n,e,r)})):fd(u,p,o,s,n,e,r)}return i.length?Promise.all(i).then(()=>o):o}});function fd(e,t,o,r,n,i,s){e.issues.length&&(_n.has(typeof r)?o.issues.push(...me(r,e.issues)):o.issues.push({origin:"map",code:"invalid_key",input:n,inst:i,issues:e.issues.map(c=>be(c,s,re()))})),t.issues.length&&(_n.has(typeof r)?o.issues.push(...me(r,t.issues)):o.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:r,issues:t.issues.map(c=>be(c,s,re()))})),o.value.set(e.value,t.value)}var Ia=v("$ZodSet",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;if(!(n instanceof Set))return o.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),o;let i=[];o.value=new Set;for(let s of n){let c=t.valueType._zod.run({value:s,issues:[]},r);c instanceof Promise?i.push(c.then(u=>hd(u,o))):hd(c,o)}return i.length?Promise.all(i).then(()=>o):o}});function hd(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var Fa=v("$ZodEnum",(e,t)=>{O.init(e,t);let o=wn(t.entries);e._zod.values=new Set(o),e._zod.pattern=new RegExp(`^(${o.filter(r=>_n.has(typeof r)).map(r=>typeof r=="string"?Ge(r):r.toString()).join("|")})$`),e._zod.parse=(r,n)=>{let i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:o,input:i,inst:e}),r}}),Aa=v("$ZodLiteral",(e,t)=>{O.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Ge(o):o?o.toString():String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let n=o.value;return e._zod.values.has(n)||o.issues.push({code:"invalid_value",values:t.values,input:n,inst:e}),o}}),Ta=v("$ZodFile",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=o.value;return n instanceof File||o.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),o}}),zn=v("$ZodTransform",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=t.transform(o.value,o);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(o.value=s,o));if(n instanceof Promise)throw new ze;return o.value=n,o}}),Oa=v("$ZodOptional",(e,t)=>{O.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Sn(o.source)})?$`):void 0}),e._zod.parse=(o,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(o,r):o.value===void 0?o:t.innerType._zod.run(o,r)}),Ma=v("$ZodNullable",(e,t)=>{O.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let o=t.innerType._zod.pattern;return o?new RegExp(`^(${Sn(o.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(o,r)=>o.value===null?o:t.innerType._zod.run(o,r)}),za=v("$ZodDefault",(e,t)=>{O.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{if(o.value===void 0)return o.value=t.defaultValue,o;let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(i=>vd(i,t)):vd(n,t)}});function vd(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ja=v("$ZodPrefault",(e,t)=>{O.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>(o.value===void 0&&(o.value=t.defaultValue),t.innerType._zod.run(o,r))}),Na=v("$ZodNonOptional",(e,t)=>{O.init(e,t),V(e._zod,"values",()=>{let o=t.innerType._zod.values;return o?new Set([...o].filter(r=>r!==void 0)):void 0}),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(i=>yd(i,e)):yd(n,e)}});function yd(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var La=v("$ZodSuccess",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(i=>(o.value=i.issues.length===0,o)):(o.value=n.issues.length===0,o)}}),Ua=v("$ZodCatch",(e,t)=>{O.init(e,t),e._zod.optin="optional",V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(i=>(o.value=i.value,i.issues.length&&(o.value=t.catchValue({...o,error:{issues:i.issues.map(s=>be(s,r,re()))},input:o.value}),o.issues=[]),o)):(o.value=n.value,n.issues.length&&(o.value=t.catchValue({...o,error:{issues:n.issues.map(i=>be(i,r,re()))},input:o.value}),o.issues=[]),o)}}),Ba=v("$ZodNaN",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>((typeof o.value!="number"||!Number.isNaN(o.value))&&o.issues.push({input:o.value,inst:e,expected:"nan",code:"invalid_type"}),o)}),jn=v("$ZodPipe",(e,t)=>{O.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(o,r)=>{let n=t.in._zod.run(o,r);return n instanceof Promise?n.then(i=>bd(i,t,r)):bd(n,t,r)}});function bd(e,t,o){return gt(e)?e:t.out._zod.run({value:e.value,issues:e.issues},o)}var Ra=v("$ZodReadonly",(e,t)=>{O.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(o,r)=>{let n=t.innerType._zod.run(o,r);return n instanceof Promise?n.then(Dd):Dd(n)}});function Dd(e){return e.value=Object.freeze(e.value),e}var Za=v("$ZodTemplateLiteral",(e,t)=>{O.init(e,t);let o=[];for(let r of t.parts)if(r instanceof O){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;o.push(n.slice(i,s))}else if(r===null||Bi.has(typeof r))o.push(Ge(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${o.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"template_literal",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),r)}),Va=v("$ZodPromise",(e,t)=>{O.init(e,t),e._zod.parse=(o,r)=>Promise.resolve(o.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),Ga=v("$ZodLazy",(e,t)=>{O.init(e,t),V(e._zod,"innerType",()=>t.getter()),V(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),V(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),V(e._zod,"optin",()=>e._zod.innerType._zod.optin),V(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(o,r)=>e._zod.innerType._zod.run(o,r)}),Wa=v("$ZodCustom",(e,t)=>{te.init(e,t),O.init(e,t),e._zod.parse=(o,r)=>o,e._zod.check=o=>{let r=o.value,n=t.fn(r);if(n instanceof Promise)return n.then(i=>$d(i,o,r,e));$d(n,o,r,e)}});function $d(e,t,o,r){if(!e){let n={code:"custom",input:o,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(Gi(n))}}var Nn={};pt(Nn,{ar:()=>xd,az:()=>Sd,be:()=>Pd,ca:()=>Ed,cs:()=>Id,de:()=>Fd,en:()=>er,eo:()=>Ad,es:()=>Td,fa:()=>Od,fi:()=>Md,fr:()=>zd,frCA:()=>jd,he:()=>Nd,hu:()=>Ld,id:()=>Ud,it:()=>Bd,ja:()=>Rd,kh:()=>Zd,ko:()=>Vd,mk:()=>Gd,ms:()=>Wd,nl:()=>Hd,no:()=>qd,ota:()=>Kd,pl:()=>Xd,ps:()=>Jd,pt:()=>Yd,ru:()=>ep,sl:()=>tp,sv:()=>np,ta:()=>op,th:()=>rp,tr:()=>ip,ua:()=>sp,ur:()=>ap,vi:()=>cp,zhCN:()=>lp,zhTW:()=>up});var Dv=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{switch(n.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${S(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${$(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function xd(){return{localeError:Dv()}}var $v=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${S(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${$(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Sd(){return{localeError:$v()}}function _d(e,t,o,r){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?r:i===1?t:i>=2&&i<=4?o:r}var Cv=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${S(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=_d(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=_d(c,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${$(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Pd(){return{localeError:Cv()}}var kv=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${S(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Ed(){return{localeError:kv()}}var wv=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${S(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${$(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Id(){return{localeError:wv()}}var xv=()=>{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(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${S(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${$(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function Fd(){return{localeError:xv()}}var Sv=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},_v=()=>{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(r){return e[r]??null}let o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Invalid input: expected ${r.expected}, received ${Sv(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${S(r.values[0])}`:`Invalid option: expected one of ${$(r.values,"|")}`;case"too_big":{let n=r.inclusive?"<=":"<",i=t(r.origin);return i?`Too big: expected ${r.origin??"value"} to have ${n}${r.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${n}${r.maximum.toString()}`}case"too_small":{let n=r.inclusive?">=":">",i=t(r.origin);return i?`Too small: expected ${r.origin} to have ${n}${r.minimum.toString()} ${i.unit}`:`Too small: expected ${r.origin} to be ${n}${r.minimum.toString()}`}case"invalid_format":{let n=r;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${o[n.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}};function er(){return{localeError:_v()}}var Pv=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},Ev=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let o={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return r=>{switch(r.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${r.expected}, ricevi\u011Dis ${Pv(r.input)}`;case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${S(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$(r.values,"|")}`;case"too_big":{let n=r.inclusive?"<=":"<",i=t(r.origin);return i?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${n}${r.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${n}${r.maximum.toString()}`}case"too_small":{let n=r.inclusive?">=":">",i=t(r.origin);return i?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${n}${r.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${n}${r.minimum.toString()}`}case"invalid_format":{let n=r;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${o[n.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}};function Ad(){return{localeError:Ev()}}var Iv=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return i},r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${n.expected}, recibido ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${S(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Demasiado peque\xF1o: se esperaba que ${n.origin} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${n.origin} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n.origin}`;default:return"Entrada inv\xE1lida"}}};function Td(){return{localeError:Iv()}}var Fv=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${o(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${S(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${$(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${$(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function Od(){return{localeError:Fv()}}var Av=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${S(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${$(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function Md(){return{localeError:Av()}}var Tv=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${o(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${S(n.values[0])} attendu`:`Option invalide : une valeur parmi ${$(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${$(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function zd(){return{localeError:Tv()}}var Ov=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${S(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${$(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function jd(){return{localeError:Ov()}}var Mv=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return n=>{switch(n.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${n.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${S(n.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${n.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${r[i.format]??n.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${n.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${n.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${n.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$(n.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function Nd(){return{localeError:Mv()}}var zv=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${S(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function Ld(){return{localeError:zv()}}var jv=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${S(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function Ud(){return{localeError:jv()}}var Nv=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${S(n.values[0])}`:`Opzione non valida: atteso uno tra ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${$(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function Bd(){return{localeError:Nv()}}var Lv=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${o(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${S(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${$(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function Rd(){return{localeError:Lv()}}var Uv=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{switch(n.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${S(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${$(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function Zd(){return{localeError:Uv()}}var Bv=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${o(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${S(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",c=t(n.origin),u=c?.unit??"\uC694\uC18C";return c?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${$(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function Vd(){return{localeError:Bv()}}var Rv=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${S(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${$(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Gd(){return{localeError:Rv()}}var Zv=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${S(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${$(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Wd(){return{localeError:Zv()}}var Vv=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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 n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${S(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Te lang: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Te kort: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Hd(){return{localeError:Vv()}}var Gv=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},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\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${S(n.values[0])}`:`Ugyldig valg: forventet en av ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${$(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function qd(){return{localeError:Gv()}}var Wv=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${o(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${S(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function Kd(){return{localeError:Wv()}}var Hv=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${o(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${S(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${$(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function Jd(){return{localeError:Hv()}}var qv=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${S(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function Xd(){return{localeError:qv()}}var Kv=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${S(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${$(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function Yd(){return{localeError:Kv()}}function Qd(e,t,o,r){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?r:i===1?t:i>=2&&i<=4?o:r}var Jv=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${S(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let c=Number(n.maximum),u=Qd(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let c=Number(n.minimum),u=Qd(c,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${$(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function ep(){return{localeError:Jv()}}var Xv=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${S(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${$(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function tp(){return{localeError:Xv()}}var Yv=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${o(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${S(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${$(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function np(){return{localeError:Yv()}}var Qv=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${S(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${$(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function op(){return{localeError:Qv()}}var ey=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{switch(n.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${S(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${$(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function rp(){return{localeError:ey()}}var ty=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},ny=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let o={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return r=>{switch(r.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${r.expected}, al\u0131nan ${ty(r.input)}`;case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${S(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$(r.values,"|")}`;case"too_big":{let n=r.inclusive?"<=":"<",i=t(r.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${n}${r.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${n}${r.maximum.toString()}`}case"too_small":{let n=r.inclusive?">=":">",i=t(r.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${n}${r.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${n}${r.minimum.toString()}`}case"invalid_format":{let n=r;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${o[n.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${$(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function ip(){return{localeError:ny()}}var oy=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${S(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${$(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function sp(){return{localeError:oy()}}var ry=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${o(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${S(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${$(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function ap(){return{localeError:ry()}}var iy=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${S(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${$(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function cp(){return{localeError:iy()}}var sy=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${S(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${$(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function lp(){return{localeError:sy()}}var ay=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let o=n=>{let i=typeof n;switch(i){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return i},r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${o(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${S(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${$(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function up(){return{localeError:ay()}}var Ha=Symbol("ZodOutput"),qa=Symbol("ZodInput"),Wt=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...o){let r=o[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let o=this._map.get(t);return o&&typeof o=="object"&&"id"in o&&this._idmap.delete(o.id),this._map.delete(t),this}get(t){let o=t._zod.parent;if(o){let r={...this.get(o)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};function tr(){return new Wt}var je=tr();function Ka(e,t){return new e({type:"string",...x(t)})}function Ja(e,t){return new e({type:"string",coerce:!0,...x(t)})}function nr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...x(t)})}function Ln(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...x(t)})}function or(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...x(t)})}function rr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...x(t)})}function ir(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...x(t)})}function sr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...x(t)})}function ar(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...x(t)})}function cr(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...x(t)})}function lr(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...x(t)})}function ur(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...x(t)})}function dr(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...x(t)})}function pr(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...x(t)})}function mr(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...x(t)})}function gr(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...x(t)})}function fr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...x(t)})}function hr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...x(t)})}function vr(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...x(t)})}function yr(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...x(t)})}function br(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...x(t)})}function Dr(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...x(t)})}function $r(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...x(t)})}function Cr(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...x(t)})}var Xa={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Ya(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...x(t)})}function Qa(e,t){return new e({type:"string",format:"date",check:"string_format",...x(t)})}function ec(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...x(t)})}function tc(e,t){return new e({type:"string",format:"duration",check:"string_format",...x(t)})}function nc(e,t){return new e({type:"number",checks:[],...x(t)})}function oc(e,t){return new e({type:"number",coerce:!0,checks:[],...x(t)})}function rc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...x(t)})}function ic(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...x(t)})}function sc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...x(t)})}function ac(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...x(t)})}function cc(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...x(t)})}function lc(e,t){return new e({type:"boolean",...x(t)})}function uc(e,t){return new e({type:"boolean",coerce:!0,...x(t)})}function dc(e,t){return new e({type:"bigint",...x(t)})}function pc(e,t){return new e({type:"bigint",coerce:!0,...x(t)})}function mc(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...x(t)})}function gc(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...x(t)})}function fc(e,t){return new e({type:"symbol",...x(t)})}function hc(e,t){return new e({type:"undefined",...x(t)})}function vc(e,t){return new e({type:"null",...x(t)})}function yc(e){return new e({type:"any"})}function Ht(e){return new e({type:"unknown"})}function bc(e,t){return new e({type:"never",...x(t)})}function Dc(e,t){return new e({type:"void",...x(t)})}function $c(e,t){return new e({type:"date",...x(t)})}function Cc(e,t){return new e({type:"date",coerce:!0,...x(t)})}function kc(e,t){return new e({type:"nan",...x(t)})}function We(e,t){return new Ho({check:"less_than",...x(t),value:e,inclusive:!1})}function Se(e,t){return new Ho({check:"less_than",...x(t),value:e,inclusive:!0})}function He(e,t){return new qo({check:"greater_than",...x(t),value:e,inclusive:!1})}function ge(e,t){return new qo({check:"greater_than",...x(t),value:e,inclusive:!0})}function wc(e){return He(0,e)}function xc(e){return We(0,e)}function Sc(e){return Se(0,e)}function _c(e){return ge(0,e)}function bt(e,t){return new xs({check:"multiple_of",...x(t),value:e})}function qt(e,t){return new Ps({check:"max_size",...x(t),maximum:e})}function Dt(e,t){return new Es({check:"min_size",...x(t),minimum:e})}function Un(e,t){return new Is({check:"size_equals",...x(t),size:e})}function Kt(e,t){return new Fs({check:"max_length",...x(t),maximum:e})}function it(e,t){return new As({check:"min_length",...x(t),minimum:e})}function Jt(e,t){return new Ts({check:"length_equals",...x(t),length:e})}function Bn(e,t){return new Os({check:"string_format",format:"regex",...x(t),pattern:e})}function Rn(e){return new Ms({check:"string_format",format:"lowercase",...x(e)})}function Zn(e){return new zs({check:"string_format",format:"uppercase",...x(e)})}function Vn(e,t){return new js({check:"string_format",format:"includes",...x(t),includes:e})}function Gn(e,t){return new Ns({check:"string_format",format:"starts_with",...x(t),prefix:e})}function Wn(e,t){return new Ls({check:"string_format",format:"ends_with",...x(t),suffix:e})}function Pc(e,t,o){return new Us({check:"property",property:e,schema:t,...x(o)})}function Hn(e,t){return new Bs({check:"mime_type",mime:e,...x(t)})}function qe(e){return new Rs({check:"overwrite",tx:e})}function qn(e){return qe(t=>t.normalize(e))}function Kn(){return qe(e=>e.trim())}function Jn(){return qe(e=>e.toLowerCase())}function Xn(){return qe(e=>e.toUpperCase())}function Yn(e,t,o){return new e({type:"array",element:t,...x(o)})}function cy(e,t,o){return new e({type:"union",options:t,...x(o)})}function ly(e,t,o,r){return new e({type:"union",options:o,discriminator:t,...x(r)})}function uy(e,t,o){return new e({type:"intersection",left:t,right:o})}function Ec(e,t,o,r){let n=o instanceof O,i=n?r:o,s=n?o:null;return new e({type:"tuple",items:t,rest:s,...x(i)})}function dy(e,t,o,r){return new e({type:"record",keyType:t,valueType:o,...x(r)})}function py(e,t,o,r){return new e({type:"map",keyType:t,valueType:o,...x(r)})}function my(e,t,o){return new e({type:"set",valueType:t,...x(o)})}function gy(e,t,o){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...x(o)})}function fy(e,t,o){return new e({type:"enum",entries:t,...x(o)})}function hy(e,t,o){return new e({type:"literal",values:Array.isArray(t)?t:[t],...x(o)})}function Ic(e,t){return new e({type:"file",...x(t)})}function vy(e,t){return new e({type:"transform",transform:t})}function yy(e,t){return new e({type:"optional",innerType:t})}function by(e,t){return new e({type:"nullable",innerType:t})}function Dy(e,t,o){return new e({type:"default",innerType:t,get defaultValue(){return typeof o=="function"?o():o}})}function $y(e,t,o){return new e({type:"nonoptional",innerType:t,...x(o)})}function Cy(e,t){return new e({type:"success",innerType:t})}function ky(e,t,o){return new e({type:"catch",innerType:t,catchValue:typeof o=="function"?o:()=>o})}function wy(e,t,o){return new e({type:"pipe",in:t,out:o})}function xy(e,t){return new e({type:"readonly",innerType:t})}function Sy(e,t,o){return new e({type:"template_literal",parts:t,...x(o)})}function _y(e,t){return new e({type:"lazy",getter:t})}function Py(e,t){return new e({type:"promise",innerType:t})}function Fc(e,t,o){let r=x(o);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Ac(e,t,o){return new e({type:"custom",check:"custom",fn:t,...x(o)})}function Tc(e,t){let o=x(t),r=o.truthy??["true","1","yes","on","y","enabled"],n=o.falsy??["false","0","no","off","n","disabled"];o.case!=="sensitive"&&(r=r.map(g=>typeof g=="string"?g.toLowerCase():g),n=n.map(g=>typeof g=="string"?g.toLowerCase():g));let i=new Set(r),s=new Set(n),c=e.Pipe??jn,u=e.Boolean??On,p=e.String??vt,d=e.Transform??zn,m=new d({type:"transform",transform:(g,D)=>{let b=g;return o.case!=="sensitive"&&(b=b.toLowerCase()),i.has(b)?!0:s.has(b)?!1:(D.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:D.value,inst:m}),{})},error:o.error}),h=new c({type:"pipe",in:new p({type:"string",error:o.error}),out:m,error:o.error});return new c({type:"pipe",in:h,out:new u({type:"boolean",error:o.error}),error:o.error})}function Oc(e,t,o,r={}){let n=x(r),i={...x(r),check:"string_format",type:"string",format:t,fn:typeof o=="function"?o:c=>o.test(c),...n};return o instanceof RegExp&&(i.pattern=o),new e(i)}var kr=class{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let o=((...r)=>{let n=this._def.input?Bo(this._def.input,r,void 0,{callee:o}):r;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=t(...n);return this._def.output?Bo(this._def.output,i,void 0,{callee:o}):i});return o}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let o=(async(...r)=>{let n=this._def.input?await Zo(this._def.input,r,void 0,{callee:o}):r;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=await t(...n);return this._def.output?Zo(this._def.output,i,void 0,{callee:o}):i});return o}input(...t){let o=this.constructor;return Array.isArray(t[0])?new o({type:"function",input:new yt({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new o({type:"function",input:t[0],output:this._def.output})}output(t){let o=this.constructor;return new o({type:"function",input:this._def.input,output:t})}};function Mc(e){return new kr({type:"function",input:Array.isArray(e?.input)?Ec(yt,e?.input):e?.input??Yn(Mn,Ht(Gt)),output:e?.output??Ht(Gt)})}var Qn=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??je,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,o={path:[],schemaPath:[]}){var r;let n=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,o.schemaPath.includes(t)&&(s.cycle=o.path),s.schema;let c={schema:{},count:1,cycle:void 0,path:o.path};this.seen.set(t,c);let u=t._zod.toJSONSchema?.();if(u)c.schema=u;else{let m={...o,schemaPath:[...o.schemaPath,t],path:o.path},h=t._zod.parent;if(h)c.ref=h,this.process(h,m),this.seen.get(h).isParent=!0;else{let y=c.schema;switch(n.type){case"string":{let g=y;g.type="string";let{minimum:D,maximum:b,format:k,patterns:C,contentEncoding:w}=t._zod.bag;if(typeof D=="number"&&(g.minLength=D),typeof b=="number"&&(g.maxLength=b),k&&(g.format=i[k]??k,g.format===""&&delete g.format),w&&(g.contentEncoding=w),C&&C.size>0){let P=[...C];P.length===1?g.pattern=P[0].source:P.length>1&&(c.schema.allOf=[...P.map(U=>({...this.target==="draft-7"?{type:"string"}:{},pattern:U.source}))])}break}case"number":{let g=y,{minimum:D,maximum:b,format:k,multipleOf:C,exclusiveMaximum:w,exclusiveMinimum:P}=t._zod.bag;typeof k=="string"&&k.includes("int")?g.type="integer":g.type="number",typeof P=="number"&&(g.exclusiveMinimum=P),typeof D=="number"&&(g.minimum=D,typeof P=="number"&&(P>=D?delete g.minimum:delete g.exclusiveMinimum)),typeof w=="number"&&(g.exclusiveMaximum=w),typeof b=="number"&&(g.maximum=b,typeof w=="number"&&(w<=b?delete g.maximum:delete g.exclusiveMaximum)),typeof C=="number"&&(g.multipleOf=C);break}case"boolean":{let g=y;g.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{y.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{y.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let g=y,{minimum:D,maximum:b}=t._zod.bag;typeof D=="number"&&(g.minItems=D),typeof b=="number"&&(g.maxItems=b),g.type="array",g.items=this.process(n.element,{...m,path:[...m.path,"items"]});break}case"object":{let g=y;g.type="object",g.properties={};let D=n.shape;for(let C in D)g.properties[C]=this.process(D[C],{...m,path:[...m.path,"properties",C]});let b=new Set(Object.keys(D)),k=new Set([...b].filter(C=>{let w=n.shape[C]._zod;return this.io==="input"?w.optin===void 0:w.optout===void 0}));k.size>0&&(g.required=Array.from(k)),n.catchall?._zod.def.type==="never"?g.additionalProperties=!1:n.catchall?n.catchall&&(g.additionalProperties=this.process(n.catchall,{...m,path:[...m.path,"additionalProperties"]})):this.io==="output"&&(g.additionalProperties=!1);break}case"union":{let g=y;g.anyOf=n.options.map((D,b)=>this.process(D,{...m,path:[...m.path,"anyOf",b]}));break}case"intersection":{let g=y,D=this.process(n.left,{...m,path:[...m.path,"allOf",0]}),b=this.process(n.right,{...m,path:[...m.path,"allOf",1]}),k=w=>"allOf"in w&&Object.keys(w).length===1,C=[...k(D)?D.allOf:[D],...k(b)?b.allOf:[b]];g.allOf=C;break}case"tuple":{let g=y;g.type="array";let D=n.items.map((C,w)=>this.process(C,{...m,path:[...m.path,"prefixItems",w]}));if(this.target==="draft-2020-12"?g.prefixItems=D:g.items=D,n.rest){let C=this.process(n.rest,{...m,path:[...m.path,"items"]});this.target==="draft-2020-12"?g.items=C:g.additionalItems=C}n.rest&&(g.items=this.process(n.rest,{...m,path:[...m.path,"items"]}));let{minimum:b,maximum:k}=t._zod.bag;typeof b=="number"&&(g.minItems=b),typeof k=="number"&&(g.maxItems=k);break}case"record":{let g=y;g.type="object",g.propertyNames=this.process(n.keyType,{...m,path:[...m.path,"propertyNames"]}),g.additionalProperties=this.process(n.valueType,{...m,path:[...m.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let g=y,D=wn(n.entries);D.every(b=>typeof b=="number")&&(g.type="number"),D.every(b=>typeof b=="string")&&(g.type="string"),g.enum=D;break}case"literal":{let g=y,D=[];for(let b of n.values)if(b===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");D.push(Number(b))}else D.push(b);if(D.length!==0)if(D.length===1){let b=D[0];g.type=b===null?"null":typeof b,g.const=b}else D.every(b=>typeof b=="number")&&(g.type="number"),D.every(b=>typeof b=="string")&&(g.type="string"),D.every(b=>typeof b=="boolean")&&(g.type="string"),D.every(b=>b===null)&&(g.type="null"),g.enum=D;break}case"file":{let g=y,D={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:k,mime:C}=t._zod.bag;b!==void 0&&(D.minLength=b),k!==void 0&&(D.maxLength=k),C?C.length===1?(D.contentMediaType=C[0],Object.assign(g,D)):g.anyOf=C.map(w=>({...D,contentMediaType:w})):Object.assign(g,D);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let g=this.process(n.innerType,m);y.anyOf=[g,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,m),c.ref=n.innerType;break}case"success":{let g=y;g.type="boolean";break}case"default":{this.process(n.innerType,m),c.ref=n.innerType,y.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,m),c.ref=n.innerType,this.io==="input"&&(y._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,m),c.ref=n.innerType;let g;try{g=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}y.default=g;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let g=y,D=t._zod.pattern;if(!D)throw new Error("Pattern not found in template literal");g.type="string",g.pattern=D.source;break}case"pipe":{let g=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(g,m),c.ref=g;break}case"readonly":{this.process(n.innerType,m),c.ref=n.innerType,y.readOnly=!0;break}case"promise":{this.process(n.innerType,m),c.ref=n.innerType;break}case"optional":{this.process(n.innerType,m),c.ref=n.innerType;break}case"lazy":{let g=t._zod.innerType;this.process(g,m),c.ref=g;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let p=this.metadataRegistry.get(t);return p&&Object.assign(c.schema,p),this.io==="input"&&se(t)&&(delete c.schema.examples,delete c.schema.default),this.io==="input"&&c.schema._prefault&&((r=c.schema).default??(r.default=c.schema._prefault)),delete c.schema._prefault,this.seen.get(t).schema}emit(t,o){let r={cycles:o?.cycles??"ref",reused:o?.reused??"inline",external:o?.external??void 0},n=this.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=d=>{let m=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){let D=r.external.registry.get(d[0])?.id,b=r.external.uri??(C=>C);if(D)return{ref:b(D)};let k=d[1].defId??d[1].schema.id??`schema${this.counter++}`;return d[1].defId=k,{defId:k,ref:`${b("__shared")}#/${m}/${k}`}}if(d[1]===n)return{ref:"#"};let y=`#/${m}/`,g=d[1].schema.id??`__schema${this.counter++}`;return{defId:g,ref:y+g}},s=d=>{if(d[1].schema.$ref)return;let m=d[1],{ref:h,defId:y}=i(d);m.def={...m.schema},y&&(m.defId=y);let g=m.schema;for(let D in g)delete g[D];g.$ref=h};if(r.cycles==="throw")for(let d of this.seen.entries()){let m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
29
35
 
30
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let f=d[1];if(o===d[0]){a(d);continue}if(i.external){let b=i.external.registry.get(d[0])?.id;if(o!==d[0]&&b){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(f.cycle){a(d);continue}if(f.count>1&&i.reused==="ref"){a(d);continue}}let c=(d,f)=>{let $=this.seen.get(d),b=$.def??$.schema,h={...b};if($.ref===null)return;let k=$.ref;if($.ref=null,k){c(k,f);let v=this.seen.get(k).schema;v.$ref&&f.target==="draft-7"?(b.allOf=b.allOf??[],b.allOf.push(v)):(Object.assign(b,v),Object.assign(b,h))}$.isParent||this.override({zodSchema:d,jsonSchema:b,path:$.path??[]})};for(let d of[...this.seen.entries()].reverse())c(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),i.external?.uri){let d=i.external.registry.get(o)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=i.external.uri(d)}Object.assign(u,t.def);let p=i.external?.defs??{};for(let d of this.seen.entries()){let f=d[1];f.def&&f.defId&&(p[f.defId]=f.def)}i.external||Object.keys(p).length>0&&(this.target==="draft-2020-12"?u.$defs=p:u.definitions=p);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function ga(e,o){if(e instanceof dt){let i=new ao(o),t={};for(let c of e._idmap.entries()){let[u,p]=c;i.process(p)}let r={},a={registry:e,uri:o?.uri,defs:t};for(let c of e._idmap.entries()){let[u,p]=c;r[u]=i.emit(p,{...o,external:a})}if(Object.keys(t).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";r.__shared={[c]:t}}return{schemas:r}}let n=new ao(o);return n.process(e),n.emit(e,o)}function X(e,o){let n=o??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let t=e._zod.def;switch(t.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 X(t.element,n);case"object":{for(let r in t.shape)if(X(t.shape[r],n))return!0;return!1}case"union":{for(let r of t.options)if(X(r,n))return!0;return!1}case"intersection":return X(t.left,n)||X(t.right,n);case"tuple":{for(let r of t.items)if(X(r,n))return!0;return!!(t.rest&&X(t.rest,n))}case"record":return X(t.keyType,n)||X(t.valueType,n);case"map":return X(t.keyType,n)||X(t.valueType,n);case"set":return X(t.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return X(t.innerType,n);case"lazy":return X(t.getter(),n);case"default":return X(t.innerType,n);case"prefault":return X(t.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return X(t.in,n)||X(t.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${t.type}`)}var Ql={};var Sn={};Re(Sn,{ZodISODate:()=>wn,ZodISODateTime:()=>kn,ZodISODuration:()=>xn,ZodISOTime:()=>Cn,date:()=>ha,datetime:()=>fa,duration:()=>ya,time:()=>va});var kn=g("ZodISODateTime",(e,o)=>{zi.init(e,o),Z.init(e,o)});function fa(e){return Os(kn,e)}var wn=g("ZodISODate",(e,o)=>{Ni.init(e,o),Z.init(e,o)});function ha(e){return Ts(wn,e)}var Cn=g("ZodISOTime",(e,o)=>{ji.init(e,o),Z.init(e,o)});function va(e){return As(Cn,e)}var xn=g("ZodISODuration",(e,o)=>{Di.init(e,o),Z.init(e,o)});function ya(e){return Ms(xn,e)}var tu=(e,o)=>{Ut.init(e,o),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Rt(e,n)},flatten:{value:n=>Lt(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Kg=g("ZodError",tu),ht=g("ZodError",tu,{Parent:Error});var ba=jo(ht),$a=Uo(ht),ka=Ro(ht),wa=Zo(ht);var z=g("ZodType",(e,o)=>(A.init(e,o),e.def=o,Object.defineProperty(e,"_def",{value:o}),e.check=(...n)=>e.clone({...o,checks:[...o.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),e.clone=(n,i)=>ce(e,n,i),e.brand=()=>e,e.register=((n,i)=>(n.add(e,i),e)),e.parse=(n,i)=>ba(e,n,i,{callee:e.parse}),e.safeParse=(n,i)=>ka(e,n,i),e.parseAsync=async(n,i)=>$a(e,n,i,{callee:e.parseAsync}),e.safeParseAsync=async(n,i)=>wa(e,n,i),e.spa=e.safeParseAsync,e.refine=(n,i)=>e.check(Fu(n,i)),e.superRefine=n=>e.check(Vu(n)),e.overwrite=n=>e.check(_e(n)),e.optional=()=>In(e),e.nullable=()=>En(e),e.nullish=()=>In(En(e)),e.nonoptional=n=>Ou(e,n),e.array=()=>Ga(e),e.or=n=>zn([e,n]),e.and=n=>hu(e,n),e.transform=n=>On(e,qa(n)),e.default=n=>Pu(e,n),e.prefault=n=>Eu(e,n),e.catch=n=>Mu(e,n),e.pipe=n=>On(e,n),e.readonly=()=>ju(e),e.describe=n=>{let i=e.clone();return he.add(i,{description:n}),i},Object.defineProperty(e,"description",{get(){return he.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return he.get(e);let i=e.clone();return he.add(i,n[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Sa=g("_ZodString",(e,o)=>{Be.init(e,o),z.init(e,o);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...i)=>e.check(Kt(...i)),e.includes=(...i)=>e.check(Yt(...i)),e.startsWith=(...i)=>e.check(Qt(...i)),e.endsWith=(...i)=>e.check(eo(...i)),e.min=(...i)=>e.check(Ne(...i)),e.max=(...i)=>e.check(gt(...i)),e.length=(...i)=>e.check(ft(...i)),e.nonempty=(...i)=>e.check(Ne(1,...i)),e.lowercase=i=>e.check(Jt(i)),e.uppercase=i=>e.check(Xt(i)),e.trim=()=>e.check(no()),e.normalize=(...i)=>e.check(oo(...i)),e.toLowerCase=()=>e.check(ro()),e.toUpperCase=()=>e.check(io())}),lo=g("ZodString",(e,o)=>{Be.init(e,o),Sa.init(e,o),e.email=n=>e.check(Yo(_a,n)),e.url=n=>e.check(nn(Pa,n)),e.jwt=n=>e.check(bn(Fa,n)),e.emoji=n=>e.check(rn(Ia,n)),e.guid=n=>e.check(Ht(_n,n)),e.uuid=n=>e.check(Qo(Ie,n)),e.uuidv4=n=>e.check(en(Ie,n)),e.uuidv6=n=>e.check(tn(Ie,n)),e.uuidv7=n=>e.check(on(Ie,n)),e.nanoid=n=>e.check(sn(Ea,n)),e.guid=n=>e.check(Ht(_n,n)),e.cuid=n=>e.check(an(Oa,n)),e.cuid2=n=>e.check(cn(Ta,n)),e.ulid=n=>e.check(ln(Aa,n)),e.base64=n=>e.check(hn(La,n)),e.base64url=n=>e.check(vn(Ra,n)),e.xid=n=>e.check(un(Ma,n)),e.ksuid=n=>e.check(dn(za,n)),e.ipv4=n=>e.check(pn(Na,n)),e.ipv6=n=>e.check(mn(ja,n)),e.cidrv4=n=>e.check(gn(Da,n)),e.cidrv6=n=>e.check(fn(Ua,n)),e.e164=n=>e.check(yn(Za,n)),e.datetime=n=>e.check(fa(n)),e.date=n=>e.check(ha(n)),e.time=n=>e.check(va(n)),e.duration=n=>e.check(ya(n))});function Ca(e){return Ps(lo,e)}var Z=g("ZodStringFormat",(e,o)=>{L.init(e,o),Sa.init(e,o)}),_a=g("ZodEmail",(e,o)=>{Si.init(e,o),Z.init(e,o)});function Xg(e){return Yo(_a,e)}var _n=g("ZodGUID",(e,o)=>{Ci.init(e,o),Z.init(e,o)});function Yg(e){return Ht(_n,e)}var Ie=g("ZodUUID",(e,o)=>{xi.init(e,o),Z.init(e,o)});function Qg(e){return Qo(Ie,e)}function ef(e){return en(Ie,e)}function tf(e){return tn(Ie,e)}function of(e){return on(Ie,e)}var Pa=g("ZodURL",(e,o)=>{_i.init(e,o),Z.init(e,o)});function nf(e){return nn(Pa,e)}var Ia=g("ZodEmoji",(e,o)=>{Pi.init(e,o),Z.init(e,o)});function rf(e){return rn(Ia,e)}var Ea=g("ZodNanoID",(e,o)=>{Ii.init(e,o),Z.init(e,o)});function sf(e){return sn(Ea,e)}var Oa=g("ZodCUID",(e,o)=>{Ei.init(e,o),Z.init(e,o)});function af(e){return an(Oa,e)}var Ta=g("ZodCUID2",(e,o)=>{Oi.init(e,o),Z.init(e,o)});function cf(e){return cn(Ta,e)}var Aa=g("ZodULID",(e,o)=>{Ti.init(e,o),Z.init(e,o)});function lf(e){return ln(Aa,e)}var Ma=g("ZodXID",(e,o)=>{Ai.init(e,o),Z.init(e,o)});function uf(e){return un(Ma,e)}var za=g("ZodKSUID",(e,o)=>{Mi.init(e,o),Z.init(e,o)});function df(e){return dn(za,e)}var Na=g("ZodIPv4",(e,o)=>{Ui.init(e,o),Z.init(e,o)});function pf(e){return pn(Na,e)}var ja=g("ZodIPv6",(e,o)=>{Li.init(e,o),Z.init(e,o)});function mf(e){return mn(ja,e)}var Da=g("ZodCIDRv4",(e,o)=>{Ri.init(e,o),Z.init(e,o)});function gf(e){return gn(Da,e)}var Ua=g("ZodCIDRv6",(e,o)=>{Zi.init(e,o),Z.init(e,o)});function ff(e){return fn(Ua,e)}var La=g("ZodBase64",(e,o)=>{Vi.init(e,o),Z.init(e,o)});function hf(e){return hn(La,e)}var Ra=g("ZodBase64URL",(e,o)=>{Gi.init(e,o),Z.init(e,o)});function vf(e){return vn(Ra,e)}var Za=g("ZodE164",(e,o)=>{Bi.init(e,o),Z.init(e,o)});function yf(e){return yn(Za,e)}var Fa=g("ZodJWT",(e,o)=>{Wi.init(e,o),Z.init(e,o)});function bf(e){return bn(Fa,e)}var ou=g("ZodCustomStringFormat",(e,o)=>{Hi.init(e,o),Z.init(e,o)});function $f(e,o,n={}){return pa(ou,e,o,n)}var uo=g("ZodNumber",(e,o)=>{Ho.init(e,o),z.init(e,o),e.gt=(i,t)=>e.check(Se(i,t)),e.gte=(i,t)=>e.check(re(i,t)),e.min=(i,t)=>e.check(re(i,t)),e.lt=(i,t)=>e.check(xe(i,t)),e.lte=(i,t)=>e.check(me(i,t)),e.max=(i,t)=>e.check(me(i,t)),e.int=i=>e.check(xa(i)),e.safe=i=>e.check(xa(i)),e.positive=i=>e.check(Se(0,i)),e.nonnegative=i=>e.check(re(0,i)),e.negative=i=>e.check(xe(0,i)),e.nonpositive=i=>e.check(me(0,i)),e.multipleOf=(i,t)=>e.check(He(i,t)),e.step=(i,t)=>e.check(He(i,t)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function nu(e){return zs(uo,e)}var vt=g("ZodNumberFormat",(e,o)=>{qi.init(e,o),uo.init(e,o)});function xa(e){return js(vt,e)}function kf(e){return Ds(vt,e)}function wf(e){return Us(vt,e)}function Cf(e){return Ls(vt,e)}function xf(e){return Rs(vt,e)}var po=g("ZodBoolean",(e,o)=>{Ft.init(e,o),z.init(e,o)});function ru(e){return Zs(po,e)}var mo=g("ZodBigInt",(e,o)=>{qo.init(e,o),z.init(e,o),e.gte=(i,t)=>e.check(re(i,t)),e.min=(i,t)=>e.check(re(i,t)),e.gt=(i,t)=>e.check(Se(i,t)),e.gte=(i,t)=>e.check(re(i,t)),e.min=(i,t)=>e.check(re(i,t)),e.lt=(i,t)=>e.check(xe(i,t)),e.lte=(i,t)=>e.check(me(i,t)),e.max=(i,t)=>e.check(me(i,t)),e.positive=i=>e.check(Se(BigInt(0),i)),e.negative=i=>e.check(xe(BigInt(0),i)),e.nonpositive=i=>e.check(me(BigInt(0),i)),e.nonnegative=i=>e.check(re(BigInt(0),i)),e.multipleOf=(i,t)=>e.check(He(i,t));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function Sf(e){return Vs(mo,e)}var Va=g("ZodBigIntFormat",(e,o)=>{Ki.init(e,o),mo.init(e,o)});function _f(e){return Bs(Va,e)}function Pf(e){return Ws(Va,e)}var iu=g("ZodSymbol",(e,o)=>{Ji.init(e,o),z.init(e,o)});function If(e){return Hs(iu,e)}var su=g("ZodUndefined",(e,o)=>{Xi.init(e,o),z.init(e,o)});function Ef(e){return qs(su,e)}var au=g("ZodNull",(e,o)=>{Yi.init(e,o),z.init(e,o)});function cu(e){return Ks(au,e)}var lu=g("ZodAny",(e,o)=>{Qi.init(e,o),z.init(e,o)});function Of(){return Js(lu)}var uu=g("ZodUnknown",(e,o)=>{ut.init(e,o),z.init(e,o)});function Pn(){return pt(uu)}var du=g("ZodNever",(e,o)=>{es.init(e,o),z.init(e,o)});function Tn(e){return Xs(du,e)}var pu=g("ZodVoid",(e,o)=>{ts.init(e,o),z.init(e,o)});function Tf(e){return Ys(pu,e)}var An=g("ZodDate",(e,o)=>{os.init(e,o),z.init(e,o),e.min=(i,t)=>e.check(re(i,t)),e.max=(i,t)=>e.check(me(i,t));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Af(e){return Qs(An,e)}var mu=g("ZodArray",(e,o)=>{Vt.init(e,o),z.init(e,o),e.element=o.element,e.min=(n,i)=>e.check(Ne(n,i)),e.nonempty=n=>e.check(Ne(1,n)),e.max=(n,i)=>e.check(gt(n,i)),e.length=(n,i)=>e.check(ft(n,i)),e.unwrap=()=>e.element});function Ga(e,o){return so(mu,e,o)}function Mf(e){let o=e._zod.def.shape;return Cu(Object.keys(o))}var Mn=g("ZodObject",(e,o)=>{ns.init(e,o),z.init(e,o),x.defineLazy(e,"shape",()=>o.shape),e.keyof=()=>ku(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Pn()}),e.loose=()=>e.clone({...e._zod.def,catchall:Pn()}),e.strict=()=>e.clone({...e._zod.def,catchall:Tn()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>x.extend(e,n),e.merge=n=>x.merge(e,n),e.pick=n=>x.pick(e,n),e.omit=n=>x.omit(e,n),e.partial=(...n)=>x.partial(Ka,e,n[0]),e.required=(...n)=>x.required(Ja,e,n[0])});function zf(e,o){let n={type:"object",get shape(){return x.assignProp(this,"shape",{...e}),this.shape},...x.normalizeParams(o)};return new Mn(n)}function Nf(e,o){return new Mn({type:"object",get shape(){return x.assignProp(this,"shape",{...e}),this.shape},catchall:Tn(),...x.normalizeParams(o)})}function jf(e,o){return new Mn({type:"object",get shape(){return x.assignProp(this,"shape",{...e}),this.shape},catchall:Pn(),...x.normalizeParams(o)})}var Ba=g("ZodUnion",(e,o)=>{Ko.init(e,o),z.init(e,o),e.options=o.options});function zn(e,o){return new Ba({type:"union",options:e,...x.normalizeParams(o)})}var gu=g("ZodDiscriminatedUnion",(e,o)=>{Ba.init(e,o),rs.init(e,o)});function Df(e,o,n){return new gu({type:"union",options:o,discriminator:e,...x.normalizeParams(n)})}var fu=g("ZodIntersection",(e,o)=>{is.init(e,o),z.init(e,o)});function hu(e,o){return new fu({type:"intersection",left:e,right:o})}var vu=g("ZodTuple",(e,o)=>{We.init(e,o),z.init(e,o),e.rest=n=>e.clone({...e._zod.def,rest:n})});function Uf(e,o,n){let i=o instanceof A,t=i?n:o,r=i?o:null;return new vu({type:"tuple",items:e,rest:r,...x.normalizeParams(t)})}var Wa=g("ZodRecord",(e,o)=>{ss.init(e,o),z.init(e,o),e.keyType=o.keyType,e.valueType=o.valueType});function yu(e,o,n){return new Wa({type:"record",keyType:e,valueType:o,...x.normalizeParams(n)})}function Lf(e,o,n){return new Wa({type:"record",keyType:zn([e,Tn()]),valueType:o,...x.normalizeParams(n)})}var bu=g("ZodMap",(e,o)=>{as.init(e,o),z.init(e,o),e.keyType=o.keyType,e.valueType=o.valueType});function Rf(e,o,n){return new bu({type:"map",keyType:e,valueType:o,...x.normalizeParams(n)})}var $u=g("ZodSet",(e,o)=>{cs.init(e,o),z.init(e,o),e.min=(...n)=>e.check(qe(...n)),e.nonempty=n=>e.check(qe(1,n)),e.max=(...n)=>e.check(mt(...n)),e.size=(...n)=>e.check(qt(...n))});function Zf(e,o){return new $u({type:"set",valueType:e,...x.normalizeParams(o)})}var co=g("ZodEnum",(e,o)=>{ls.init(e,o),z.init(e,o),e.enum=o.entries,e.options=Object.values(o.entries);let n=new Set(Object.keys(o.entries));e.extract=(i,t)=>{let r={};for(let a of i)if(n.has(a))r[a]=o.entries[a];else throw new Error(`Key ${a} not found in enum`);return new co({...o,checks:[],...x.normalizeParams(t),entries:r})},e.exclude=(i,t)=>{let r={...o.entries};for(let a of i)if(n.has(a))delete r[a];else throw new Error(`Key ${a} not found in enum`);return new co({...o,checks:[],...x.normalizeParams(t),entries:r})}});function ku(e,o){let n=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new co({type:"enum",entries:n,...x.normalizeParams(o)})}function Ff(e,o){return new co({type:"enum",entries:e,...x.normalizeParams(o)})}var wu=g("ZodLiteral",(e,o)=>{us.init(e,o),z.init(e,o),e.values=new Set(o.values),Object.defineProperty(e,"value",{get(){if(o.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return o.values[0]}})});function Cu(e,o){return new wu({type:"literal",values:Array.isArray(e)?e:[e],...x.normalizeParams(o)})}var xu=g("ZodFile",(e,o)=>{ds.init(e,o),z.init(e,o),e.min=(n,i)=>e.check(qe(n,i)),e.max=(n,i)=>e.check(mt(n,i)),e.mime=(n,i)=>e.check(to(Array.isArray(n)?n:[n],i))});function Vf(e){return ca(xu,e)}var Ha=g("ZodTransform",(e,o)=>{Gt.init(e,o),z.init(e,o),e._zod.parse=(n,i)=>{n.addIssue=r=>{if(typeof r=="string")n.issues.push(x.issue(r,n.value,o));else{let a=r;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=e),a.continue??(a.continue=!0),n.issues.push(x.issue(a))}};let t=o.transform(n.value,n);return t instanceof Promise?t.then(r=>(n.value=r,n)):(n.value=t,n)}});function qa(e){return new Ha({type:"transform",transform:e})}var Ka=g("ZodOptional",(e,o)=>{ps.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function In(e){return new Ka({type:"optional",innerType:e})}var Su=g("ZodNullable",(e,o)=>{ms.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function En(e){return new Su({type:"nullable",innerType:e})}function Gf(e){return In(En(e))}var _u=g("ZodDefault",(e,o)=>{gs.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Pu(e,o){return new _u({type:"default",innerType:e,get defaultValue(){return typeof o=="function"?o():o}})}var Iu=g("ZodPrefault",(e,o)=>{fs.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function Eu(e,o){return new Iu({type:"prefault",innerType:e,get defaultValue(){return typeof o=="function"?o():o}})}var Ja=g("ZodNonOptional",(e,o)=>{hs.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function Ou(e,o){return new Ja({type:"nonoptional",innerType:e,...x.normalizeParams(o)})}var Tu=g("ZodSuccess",(e,o)=>{vs.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function Bf(e){return new Tu({type:"success",innerType:e})}var Au=g("ZodCatch",(e,o)=>{ys.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mu(e,o){return new Au({type:"catch",innerType:e,catchValue:typeof o=="function"?o:()=>o})}var zu=g("ZodNaN",(e,o)=>{bs.init(e,o),z.init(e,o)});function Wf(e){return ta(zu,e)}var Xa=g("ZodPipe",(e,o)=>{Bt.init(e,o),z.init(e,o),e.in=o.in,e.out=o.out});function On(e,o){return new Xa({type:"pipe",in:e,out:o})}var Nu=g("ZodReadonly",(e,o)=>{$s.init(e,o),z.init(e,o)});function ju(e){return new Nu({type:"readonly",innerType:e})}var Du=g("ZodTemplateLiteral",(e,o)=>{ks.init(e,o),z.init(e,o)});function Hf(e,o){return new Du({type:"template_literal",parts:e,...x.normalizeParams(o)})}var Uu=g("ZodLazy",(e,o)=>{Cs.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.getter()});function Lu(e){return new Uu({type:"lazy",getter:e})}var Ru=g("ZodPromise",(e,o)=>{ws.init(e,o),z.init(e,o),e.unwrap=()=>e._zod.def.innerType});function qf(e){return new Ru({type:"promise",innerType:e})}var Nn=g("ZodCustom",(e,o)=>{xs.init(e,o),z.init(e,o)});function Zu(e){let o=new B({check:"custom"});return o._zod.check=e,o}function Kf(e,o){return la(Nn,e??(()=>!0),o)}function Fu(e,o={}){return ua(Nn,e,o)}function Vu(e){let o=Zu(n=>(n.addIssue=i=>{if(typeof i=="string")n.issues.push(x.issue(i,n.value,o._zod.def));else{let t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=o),t.continue??(t.continue=!o._zod.def.abort),n.issues.push(x.issue(t))}},e(n.value,n)));return o}function Jf(e,o={error:`Input not instance of ${e.name}`}){let n=new Nn({type:"custom",check:"custom",fn:i=>i instanceof e,abort:!0,...x.normalizeParams(o)});return n._zod.bag.Class=e,n}var Xf=(...e)=>da({Pipe:Xa,Boolean:po,String:lo,Transform:Ha},...e);function Yf(e){let o=Lu(()=>zn([Ca(e),nu(),ru(),cu(),Ga(o),yu(Ca(),o)]));return o}function Qf(e,o){return On(qa(e),o)}var eh={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 th(e){K({customError:e})}function oh(){return K().customError}var Ya={};Re(Ya,{bigint:()=>sh,boolean:()=>ih,date:()=>ah,number:()=>rh,string:()=>nh});function nh(e){return Is(lo,e)}function rh(e){return Ns(uo,e)}function ih(e){return Fs(po,e)}function sh(e){return Gs(mo,e)}function ah(e){return ea(An,e)}K(Jo());import{refreshToken as Ah}from"@octokit/oauth-methods";import{request as Mh}from"@octokit/request";import{existsSync as Wh,readdirSync as Hh,lstatSync as qh}from"node:fs";import{join as Kh}from"node:path";var ch=null;function lh(e){let o=`[${e.module}]`,n=e.data&&Object.keys(e.data).length>0?` ${JSON.stringify(e.data)}`:"";process.stderr.write(`${o} ${e.level}: ${e.message}${n}
31
- `)}function Dn(e){function o(n,i,t){let r={level:n,module:e,message:i,...t&&{data:t}};(ch??lh)(r)}return{debug:(n,i)=>o("debug",n,i),info:(n,i)=>o("info",n,i),warn:(n,i)=>o("warn",n,i),error:(n,i)=>o("error",n,i)}}function De(e){return e.toLowerCase().replace(/^https?:\/\//,"").replace(/\/$/,"")}function Je(e){if(!e.token.expiresAt)return!1;let o=new Date(e.token.expiresAt);if(isNaN(o.getTime()))return!0;let n=new Date;return o.getTime()-n.getTime()<300*1e3}function Wu(e){if(!e.token.refreshTokenExpiresAt)return!1;let o=new Date(e.token.refreshTokenExpiresAt);return isNaN(o.getTime())?!0:new Date>=o}var go=new Map,uh=300*1e3;function dh(e){let o=De(e),n=go.get(o);return!n||Date.now()-n.cachedAt>=uh?!1:n.credentials?!Je(n.credentials):!0}function Hu(e){e?go.delete(De(e)):go.clear()}function ph(e){let o=De(e);if(dh(o))return go.get(o).credentials}function mh(e,o){let n=De(e);go.set(n,{credentials:o,cachedAt:Date.now()})}var G=Un.platform()==="win32",ve=Un.platform()==="darwin",sw=Un.platform()==="linux",R=Un.homedir();function ue(){return G?process.env.APPDATA||$h.join(R,"AppData","Roaming"):R}var kh=Oe(R,".octocode"),wh=448,Ee=process.env.OCTOCODE_HOME||kh,ie={home:Ee,config:Oe(Ee,".octocoderc"),credentials:Oe(Ee,"credentials.json"),key:Oe(Ee,".key"),session:Oe(Ee,"session.json"),repos:Oe(Ee,"repos"),logs:Oe(Ee,"logs"),cliConfig:Oe(Ee,"config.json"),lspConfig:Oe(Ee,"lsp-servers.json")};function Ch(){yh(ie.home)||bh(ie.home,{recursive:!0,mode:wh})}var xh=I.object({token:I.string(),tokenType:I.literal("oauth"),scopes:I.array(I.string()).optional(),refreshToken:I.string().optional(),expiresAt:I.string().optional(),refreshTokenExpiresAt:I.string().optional()}),Sh=I.object({hostname:I.string(),username:I.string(),token:xh,gitProtocol:I.enum(["ssh","https"]),createdAt:I.string(),updatedAt:I.string()}),_h=I.object({version:I.number(),credentials:I.record(I.string(),Sh)}),Bu=Dn("token-storage");function Ph(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}var cw=ie.home,je=ie.credentials,Ke=ie.key,Xu="aes-256-gcm",Ih=16;function ec(){Ch()}function Yu(){if(ec(),jn(Ke))return gh(Ke).mode&511&63&&fh(Ke,384),Buffer.from(qu(Ke,"utf8"),"hex");let e=Ju(32);return Ku(Ke,e.toString("hex"),{mode:384}),e}function Eh(e){let o=Yu(),n=Ju(Ih),i=hh(Xu,o,n),t=i.update(e,"utf8","hex");t+=i.final("hex");let r=i.getAuthTag();return`${n.toString("hex")}:${r.toString("hex")}:${t}`}function Oh(e){let o=Yu(),[n,i,t]=e.split(":");if(!n||!i||!t)throw new Error("Invalid encrypted data format");let r=Buffer.from(n,"hex"),a=Buffer.from(i,"hex"),c=vh(Xu,o,r);c.setAuthTag(a);let u=c.update(t,"hex","utf8");return u+=c.final("utf8"),u}function Ln(){if(ec(),!jn(je))return{version:1,credentials:{}};try{let e=qu(je,"utf8"),o=Oh(e),n=JSON.parse(o),i=_h.safeParse(n);return i.success?i.data:(Bu.warn("Credentials file has invalid format \u2014 starting fresh",{file:je}),{version:1,credentials:{}})}catch(e){let o=e instanceof Error&&e.message?Ph(e.message):void 0;return Bu.warn("Could not read credentials file \u2014 you may need to login again",{file:je,...o&&{reason:o}}),{version:1,credentials:{}}}}function Qu(e){ec();let o=Eh(JSON.stringify(e,null,2));Ku(je,o,{mode:384})}function Th(){try{jn(je)&&Gu(je),jn(Ke)&&Gu(Ke)}catch{}}var ed="178c6fc778ccc68e1d6a",tc="github.com";function zh(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}function Nh(e){return e==="github.com"||e===tc?"https://api.github.com":`https://${e}/api/v3`}async function jh(e,o=tc,n=ed){let i=await e.getCredentials(o);if(!i)return{success:!1,error:`Not logged in to ${o}`};if(!i.token.refreshToken)return{success:!1,error:"Token does not support refresh (OAuth App tokens do not expire)"};if(Wu(i))return{success:!1,error:"Refresh token has expired. Please login again."};try{let t=await Ah({clientType:"github-app",clientId:n,clientSecret:"",refreshToken:i.token.refreshToken,request:Mh.defaults({baseUrl:Nh(o)})}),r={token:t.authentication.token,tokenType:"oauth",refreshToken:t.authentication.refreshToken,expiresAt:t.authentication.expiresAt,refreshTokenExpiresAt:t.authentication.refreshTokenExpiresAt};return await e.updateToken(o,r),{success:!0,username:i.username,hostname:o}}catch(t){return{success:!1,error:t instanceof Error?zh(t.message):"Token refresh failed"}}}async function Dh(e,o=tc,n=ed){let i=await e.getCredentials(o);if(!i||!i.token)return{token:null,source:"none"};if(!Je(i))return{token:i.token.token,source:"stored",username:i.username};if(i.token.refreshToken){let t=await jh(e,o,n);if(t.success){let r=await e.getCredentials(o);if(r?.token.token)return{token:r.token.token,source:"refreshed",username:r.username}}return{token:null,source:"none",refreshError:t.error}}return{token:null,source:"none",refreshError:"Token expired and no refresh token available"}}var td=["OCTOCODE_TOKEN","GH_TOKEN","GITHUB_TOKEN"];function od(){for(let e of td){let o=process.env[e];if(o&&o.trim())return o.trim()}return null}function fo(){for(let e of td){let o=process.env[e];if(o&&o.trim())return`env:${e}`}return null}function yt(){return od()!==null}var Uh="178c6fc778ccc68e1d6a",Lh="github.com",Qa=null;function Rh(e){Qa=e}function Zh(){if(!Qa)throw new Error("Token resolution not initialized. Call initTokenResolution() first.");return Qa}async function oc(e){let o=e?.hostname??Lh,n=e?.clientId??Uh,i=e?.getGhCliToken,t=od();if(t)return{token:t,source:fo()??"env:GITHUB_TOKEN",wasRefreshed:!1};let r=await Zh().getTokenWithRefresh(o,n);if(r.token)return{token:r.token,source:"file",wasRefreshed:r.source==="refreshed",username:r.username};let a=r.refreshError;if(i)try{let c=await Promise.resolve(i(o));if(c?.trim())return{token:c.trim(),source:"gh-cli",wasRefreshed:!1,refreshError:a}}catch{}return a?{token:"",source:null,wasRefreshed:!1,refreshError:a}:null}var Fh=Dn("token-storage");async function Rn(e){let o=De(e.hostname),n={...e,hostname:o,updatedAt:new Date().toISOString()};try{let i=Ln();return i.credentials[o]=n,Qu(i),Hu(o),{success:!0}}catch(i){let t=i instanceof Error?i.message:String(i);throw Fh.error("CRITICAL: Storage failed",{error:t.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}),new Error("Failed to store credentials")}}async function Te(e="github.com",o){let n=De(e);if(!o?.bypassCache){let r=ph(n);if(r!==void 0)return r}let t=Ln().credentials[n]||null;return mh(n,t),t}function nc(e="github.com"){let o=De(e);return Ln().credentials[o]||null}async function rc(e="github.com"){let o=De(e),n=!1,i=Ln();return i.credentials[o]&&(delete i.credentials[o],Object.keys(i.credentials).length===0?Th():Qu(i),n=!0),Hu(o),{success:n,deletedFromFile:n}}async function Vh(e,o){let n=await Te(e);return n?(n.token=o,n.updatedAt=new Date().toISOString(),await Rn(n),!0):!1}function ic(){return je}async function Gh(e="github.com"){let o=await Te(e);return!o||!o.token||Je(o)?null:o.token.token}async function Zn(e,o){return Dh({getCredentials:Te,updateToken:Vh},e,o)}Rh({getToken:Gh,getTokenWithRefresh:Zn});var Bh=I.object({toolCalls:I.number(),promptCalls:I.number(),errors:I.number(),rateLimits:I.number()}),pw=I.object({version:I.literal(1),sessionId:I.string(),createdAt:I.string(),lastActiveAt:I.string(),stats:Bh}),mw=Dn("session"),gw=ie.session;var hw=I.object({$schema:I.string().optional(),version:I.number().int().optional(),github:I.record(I.string(),I.unknown()).optional(),gitlab:I.record(I.string(),I.unknown()).optional(),bitbucket:I.record(I.string(),I.unknown()).optional(),local:I.record(I.string(),I.unknown()).optional(),tools:I.record(I.string(),I.unknown()).optional(),network:I.record(I.string(),I.unknown()).optional(),telemetry:I.record(I.string(),I.unknown()).optional(),lsp:I.record(I.string(),I.unknown()).optional(),output:I.record(I.string(),I.unknown()).optional()}).passthrough(),vw=ie.config;var yw=Dn("octocode-config");function Ue(e){if(!Wh(e))return 0;let o=0,n=[e];for(;n.length>0;){let i=n.pop(),t;try{t=Hh(i)}catch{continue}for(let r of t){let a=Kh(i,r);try{let c=qh(a);if(c.isSymbolicLink())continue;c.isDirectory()?n.push(a):c.isFile()&&(o+=c.size)}catch{}}}return o}function bt(e){if(e<1024)return`${e} B`;let o=e/1024;if(o<1024)return`${o.toFixed(1)} KB`;let n=o/1024;return n<1024?`${n.toFixed(1)} MB`:`${(n/1024).toFixed(2)} GB`}function Fn(){process.stdout.write("\x1B[2J\x1B[3J\x1B[H")}function sc(e,o){try{let n,i;return o?(n=o,i=[e]):ve?(n="open",i=[e]):G?(n="cmd",i=["/c","start",'""',e]):(n="xdg-open",i=[e]),Jh(n,i,{stdio:"ignore",shell:G&&!o}).status===0}catch{return!1}}function nd(e,o){switch(o){case"cursor":return sc(e,"cursor");case"vscode":return sc(e,"code");default:return sc(e)}}var ho=()=>{throw new Error("Inquirer not loaded. Call loadInquirer() first.")},O=ho,$t=ho,q=ho,vo=ho,kt=ho,E=class{type="separator";separator="";constructor(){throw new Error("Inquirer not loaded. Call loadInquirer() first.")}},rd=!1;async function W(){if(!rd)try{let e=await import("@inquirer/prompts");O=e.select,$t=e.confirm,q=e.input,vo=e.checkbox,kt=e.search,E=e.Separator,rd=!0}catch{console.error(`
32
- \u274C Missing dependency: @inquirer/prompts`),console.error(` Please install it first:
33
- `),console.error(` npm install @inquirer/prompts
34
- `),process.exit(1)}}async function Xe(e){return await(await import("@inquirer/prompts")).select(e)}import{homedir as Xh}from"node:os";import ac from"node:path";import{spawnSync as id}from"node:child_process";function Ye(e,o=[]){try{let n=id(e,o,{encoding:"utf8",stdio:["pipe","pipe","pipe"],shell:!1,timeout:3e4});return{success:n.status===0,stdout:n.stdout?.trim()||"",stderr:n.stderr?.trim()||"",exitCode:n.status}}catch(n){return{success:!1,stdout:"",stderr:n instanceof Error?n.message:"Unknown error",exitCode:null}}}function sd(e){let o=process.platform==="win32"?"where":"which";return Ye(o,[e]).success}function ad(e,o=[]){try{let n=id(e,o,{stdio:"inherit",shell:!1});return{success:n.status===0,exitCode:n.status}}catch{return{success:!1,exitCode:null}}}function cd(){return{cwd:Yh(),ide:Qh(),git:ev()}}function Yh(){let e=process.cwd(),o=Xh(),n=ac.normalize(e),i=ac.normalize(o);return n.toLowerCase().startsWith(i.toLowerCase())?"~"+n.slice(i.length):e}function Qh(){let e=process.env;return e.CURSOR_AGENT||e.CURSOR_TRACE_ID?"Cursor":e.TERM_PROGRAM==="vscode"||e.VSCODE_PID?"VS Code":(e.TERM_PROGRAM==="Apple_Terminal","Terminal")}function ev(){let e=Ye("git",["rev-parse","--show-toplevel"]);if(!e.success)return;let o=Ye("git",["branch","--show-current"]);return{root:ac.basename(e.stdout.trim())||"repo",branch:o.success?o.stdout:"HEAD"}}function tv(){let e=[" \u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584"," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584"," \u2590\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258C"," \u2590\u2588\u2588\u2580 \u2580\u2588\u2588\u2588\u2588\u2580 \u2580\u2588\u2588\u258C"," \u2590\u2588\u2588 \u2584 \u2588\u2588\u2588\u2588 \u2584 \u2588\u2588\u258C"," \u2590\u2588\u2588\u2588\u2588\u2584\u2584\u2580\u2580\u2580\u2580\u2584\u2584\u2588\u2588\u2588\u2588\u258C"," \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580"," \u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2580\u2580 \u2580\u2580\u2588\u2588\u2588\u2588\u2584\u2584\u2584"," \u2584\u2588\u2588\u2588\u2588\u2580\u2580\u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584\u2580\u2580\u2588\u2588\u2588\u2588\u2584","\u2590\u2588\u2588\u258C \u2584\u2588\u2588\u2580\u2580 \u2580\u2580\u2588\u2588\u2584 \u2590\u2588\u2588\u258C"," \u2580\u2580 \u2590\u2588\u2588\u258C \u2590\u2588\u2588\u258C \u2580\u2580"," \u2580\u2580 \u2580\u2580"];for(let o of e)console.log(s("magenta"," "+o))}function ov(){let e=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"];for(let o of e)console.log(s("magenta"," "+o))}function Vn(){console.log(),tv(),console.log(),ov(),console.log(),console.log();try{let e=cd(),o=e.ide==="Cursor"||e.ide==="VS Code",n=`${l("Path")} ${e.cwd}`,i=o?`${l("IDE")} ${m(e.ide)}`:"",t=e.git?`${e.git.root} ${l("(")}${e.git.branch}${l(")")}`:"",r=[i,t].filter(Boolean).join(" ");console.log(` ${n}${r?` ${r}`:""}`),console.log()}catch{console.log()}}function Gn(){console.log(),console.log(` ${s("cyan","Tip")} ${m("Quick tips for better AI coding with Octocode:")}`),console.log(),console.log(` ${s("green","-")} ${l("Prompts:")} Use ${s("cyan","/research")}, ${s("cyan","/plan")}, ${s("cyan","/implement")} in chat`),console.log(` ${s("green","-")} ${l("Skills:")} Add all via ${s("cyan","Octocode Skills")} or ${s("cyan","Manage System Skills")} -> ${s("cyan","Browse Marketplace")}`),console.log(` ${s("green","-")} ${l("Context:")} Add ${s("cyan","AGENTS.md")} to your project ${l("(you can ask octocode)")}`),console.log(),console.log(` Search${s("underscore","https://octocode.ai")}`),console.log()}var cc=new Set;function Bn(){process.stdout.write("\x1B[?25h")}var ld=!1;function nv(){ld||(ld=!0,process.on("exit",Bn),process.on("SIGINT",()=>{Bn(),process.exit(0)}),process.on("SIGTERM",()=>{Bn(),process.exit(0)}),process.on("uncaughtException",e=>{Bn(),console.error("Uncaught exception:",e),process.exit(1)}))}var N=class{text;frames;i;timer;constructor(o=""){this.text=o,this.frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],this.i=0,this.timer=null}start(o,n=0){o&&(this.text=o),this.timer&&(clearInterval(this.timer),this.timer=null),nv(),cc.add(this),process.stdout.write("\x1B[?25l");let i=" ".repeat(n);return this.timer=setInterval(()=>{let t=this.frames[this.i++%this.frames.length];process.stdout.write(`\r${i}${s("cyan",t)} ${this.text}`)},80),this}clear(){return this.timer&&(clearInterval(this.timer),this.timer=null),cc.delete(this),process.stdout.write("\r\x1B[2K"),process.stdout.write("\x1B[?25h"),this}stop(o="\u2713",n="green"){return this.timer&&(clearInterval(this.timer),this.timer=null),cc.delete(this),process.stdout.write(`\r\x1B[2K${s(n,o)} ${this.text}
35
- `),process.stdout.write("\x1B[?25h"),this}succeed(o){return o&&(this.text=o),this.stop("\u2713","green")}fail(o){return o&&(this.text=o),this.stop("\u2717","red")}info(o){return o&&(this.text=o),this.stop("\u2139","blue")}warn(o){return o&&(this.text=o),this.stop("\u26A0","yellow")}update(o){return this.text=o,this}};import j from"node:path";import de from"node:fs";import lc from"node:path";function M(e){try{return de.existsSync(e)&&de.statSync(e).isDirectory()}catch{return!1}}function Q(e){try{return de.existsSync(e)&&de.statSync(e).isFile()}catch{return!1}}function Qe(e){try{if(Q(e))return de.readFileSync(e,"utf8")}catch{}return null}function yo(e,o){try{let n=lc.dirname(e);return M(n)||de.mkdirSync(n,{recursive:!0,mode:448}),de.writeFileSync(e,o,{encoding:"utf8",mode:384}),!0}catch{return!1}}function ud(e){if(!Q(e))return null;try{let o=new Date().toISOString().replace(/[:.]/g,"-"),n=`${e}.backup-${o}`;return de.copyFileSync(e,n),n}catch{return null}}function dd(e){let o=Qe(e);if(!o)return null;try{return JSON.parse(o)}catch{return null}}function pd(e,o){try{let n=JSON.stringify(o,null,2)+`
36
- `;return yo(e,n)}catch{return!1}}function wt(e,o){try{if(!M(e))return!1;M(o)||de.mkdirSync(o,{recursive:!0});let n=de.readdirSync(e,{withFileTypes:!0});for(let i of n){let t=lc.join(e,i.name),r=lc.join(o,i.name);if(i.isDirectory()){if(!wt(t,r))return!1}else de.copyFileSync(t,r)}return!0}catch{return!1}}function ye(e){try{return M(e)?de.readdirSync(e,{withFileTypes:!0}).filter(o=>o.isDirectory()).map(o=>o.name):[]}catch{return[]}}function Ct(e){try{return M(e)?(de.rmSync(e,{recursive:!0,force:!0}),!0):!1}catch{return!1}}function md(){return G?ue():ve?j.join(R,"Library","Application Support"):process.env.XDG_CONFIG_HOME||j.join(R,".config")}function rv(){let e=md();return G?j.join(e,"Code","User","globalStorage"):ve?j.join(e,"Code","User","globalStorage"):j.join(e,"Code","User","globalStorage")}var D={cursor:{id:"cursor",name:"Cursor",description:"AI-first code editor",category:"ide",url:"https://cursor.sh",envVars:["CURSOR_AGENT","CURSOR_TRACE_ID","CURSOR_SESSION_ID","CURSOR"]},"claude-desktop":{id:"claude-desktop",name:"Claude Desktop",description:"Anthropic's desktop app",category:"desktop",url:"https://claude.ai/download"},"claude-code":{id:"claude-code",name:"Claude Code",description:"Claude CLI for terminal",category:"cli",url:"https://docs.anthropic.com/claude-code",envVars:["CLAUDE_CODE"]},"vscode-cline":{id:"vscode-cline",name:"Cline (VS Code)",description:"AI coding assistant extension",category:"extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev",envVars:["VSCODE_PID","TERM_PROGRAM"]},"vscode-roo":{id:"vscode-roo",name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",category:"extension",envVars:["VSCODE_PID"]},windsurf:{id:"windsurf",name:"Windsurf",description:"Codeium AI IDE",category:"ide",url:"https://codeium.com/windsurf",envVars:["WINDSURF_SESSION"]},trae:{id:"trae",name:"Trae",description:"Adaptive AI IDE",category:"ide",url:"https://trae.ai"},antigravity:{id:"antigravity",name:"Antigravity",description:"Gemini-powered AI IDE",category:"ide"},"vscode-continue":{id:"vscode-continue",name:"Continue (VS Code)",description:"Open-source AI assistant",category:"extension",url:"https://continue.dev",envVars:["VSCODE_PID"]},zed:{id:"zed",name:"Zed",description:"High-performance code editor",category:"ide",url:"https://zed.dev",envVars:["ZED_TERM"]},opencode:{id:"opencode",name:"Opencode",description:"AI coding agent CLI",category:"cli",url:"https://opencode.ai",envVars:["OPENCODE"]},codex:{id:"codex",name:"Codex",description:"OpenAI Codex CLI agent",category:"cli",url:"https://github.com/openai/codex",envVars:["CODEX_HOME","CODEX_SANDBOX_TYPE"]},"gemini-cli":{id:"gemini-cli",name:"Gemini CLI",description:"Google Gemini CLI",category:"cli",url:"https://github.com/google-gemini/gemini-cli",envVars:["GEMINI_API_KEY"]},goose:{id:"goose",name:"Goose",description:"Block AI coding agent",category:"desktop",url:"https://block.github.io/goose",envVars:["GOOSE_MODE"]},kiro:{id:"kiro",name:"Kiro",description:"AWS AI IDE",category:"ide",url:"https://kiro.dev"},custom:{id:"custom",name:"Custom Path",description:"Specify your own MCP config path",category:"cli"}};function F(e,o){if(e==="custom"&&o)return o;let n=md(),i=rv();switch(e){case"cursor":return G?j.join(ue(),"Cursor","mcp.json"):j.join(R,".cursor","mcp.json");case"claude-desktop":return G?j.join(n,"Claude","claude_desktop_config.json"):ve?j.join(n,"Claude","claude_desktop_config.json"):j.join(n,"claude","claude_desktop_config.json");case"claude-code":return j.join(R,".claude.json");case"vscode-cline":return j.join(i,"saoudrizwan.claude-dev","settings","cline_mcp_settings.json");case"vscode-roo":return j.join(i,"rooveterinaryinc.roo-cline","settings","mcp_settings.json");case"windsurf":return j.join(R,".codeium","windsurf","mcp_config.json");case"trae":return G?j.join(ue(),"Trae","mcp.json"):ve?j.join(n,"Trae","mcp.json"):j.join(n,"Trae","mcp.json");case"antigravity":return j.join(R,".gemini","antigravity","mcp_config.json");case"vscode-continue":return j.join(R,".continue","config.json");case"zed":return G?j.join(ue(),"Zed","settings.json"):ve?j.join(R,".config","zed","settings.json"):j.join(n,"zed","settings.json");case"opencode":return G?j.join(ue(),"opencode","config.json"):j.join(n,"opencode","config.json");case"codex":return j.join(R,".codex","config.toml");case"gemini-cli":return j.join(R,".gemini","settings.json");case"goose":return G?j.join(ue(),"goose","config.yaml"):ve?j.join(n,"goose","config.yaml"):j.join(n,"goose","config.yaml");case"kiro":return G?j.join(ue(),"Kiro","mcp.json"):j.join(R,".kiro","mcp.json");case"custom":throw new Error("Custom path requires customPath parameter");default:throw new Error(`Unknown MCP client: ${e}`)}}function be(e,o){try{let n=F(e,o),i=j.dirname(n);return M(i)}catch{return!1}}function Wn(e,o){try{let n=F(e,o);return Q(n)}catch{return!1}}function xt(){let e=process.env;return e.CURSOR_AGENT||e.CURSOR_TRACE_ID||e.CURSOR_SESSION_ID||e.CURSOR?"cursor":e.WINDSURF_SESSION?"windsurf":e.CLAUDE_CODE?"claude-code":e.ZED_TERM||e.ZED?"zed":e.OPENCODE?"opencode":e.CODEX_HOME||e.CODEX_SANDBOX_TYPE?"codex":e.GEMINI_API_KEY?"gemini-cli":e.GOOSE_MODE?"goose":e.VSCODE_PID||e.TERM_PROGRAM==="vscode"?e.ROO_CLINE||e.ROO?"vscode-roo":e.CONTINUE_GLOBAL_DIR?"vscode-continue":"vscode-cline":null}function gd(){let e=[],o=["cursor","claude-desktop","claude-code","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed","opencode","codex","gemini-cli","goose","kiro"];for(let n of o)be(n)&&e.push(n);return e}import iv from"node:path";import sv from"node:fs";function V(e){return Q(e)?dd(e):{mcpServers:{}}}function te(e,o,n=!0){try{let i;if(n&&Q(e)){let a=ud(e);a&&(i=a)}let t=iv.dirname(e);return M(t)||sv.mkdirSync(t,{recursive:!0,mode:448}),pd(e,o)?{success:!0,backupPath:i}:{success:!1,error:"Failed to write config file"}}catch(i){return{success:!1,error:i instanceof Error?i.message:"Unknown error"}}}function bo(e,o){let n;switch(e){case"direct":n={command:"bash",args:["-c",`set -euo pipefail; TMPDIR=$(mktemp -d); trap 'rm -rf "$TMPDIR"' EXIT; curl -fsSL https://octocodeai.com/octocode/latest/index.js -o "$TMPDIR/index.js"; node "$TMPDIR/index.js"`]};break;case"npx":n={command:"npx",args:["octocode-mcp@latest"]};break;default:throw new Error(`Unknown install method: ${e}`)}if(o){let i={};o.enableLocal&&(i.ENABLE_LOCAL="true"),o.githubToken&&(i.GITHUB_TOKEN=o.githubToken),Object.keys(i).length>0&&(n.env=i)}return n}function Hn(e,o){if(e==="direct"){let n={command:"powershell",args:["-Command","$tmpDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName()); New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null; $tmpFile = Join-Path $tmpDir 'index.js'; Invoke-WebRequest -Uri 'https://octocodeai.com/octocode/latest/index.js' -OutFile $tmpFile; node $tmpFile; Remove-Item -Recurse -Force $tmpDir"]};if(o){let i={};o.enableLocal&&(i.ENABLE_LOCAL="true"),o.githubToken&&(i.GITHUB_TOKEN=o.githubToken),Object.keys(i).length>0&&(n.env=i)}return n}return bo(e,o)}function uc(e,o,n){let i=G?Hn(o,n):bo(o,n);return{...e,mcpServers:{...e.mcpServers,octocode:i}}}function Ae(e){return!!e.mcpServers?.octocode}function qn(e){let o=e.mcpServers?.octocode;return o?o.command==="npx"?"npx":o.command==="bash"||o.command==="powershell"?"direct":null:null}function dc(e,o){let n=F(e,o),i=Wn(e,o),t=!1,r=null;if(i){let a=V(n);a&&(t=Ae(a),r=qn(a))}return{client:e,configExists:i,octocodeInstalled:t,method:r,configPath:n}}function Kn(){return["cursor","claude-desktop","claude-code","opencode","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed"].map(o=>dc(o))}function fd(e,o){if(!e.mcpServers?.[o])return e;let n=Object.fromEntries(Object.entries(e.mcpServers).filter(([i])=>i!==o));return{...e,mcpServers:n}}import pc from"node:path";function vd(e){return e.octocodeInstalled?s("green","\u2705 installed"):e.configExists?s("blue","\u25CB Ready"):be(e.client)?s("dim","\u25CB Available"):s("dim","\u25CB Not found")}function yd(){return["cursor","claude-desktop","claude-code","opencode","codex","gemini-cli","windsurf","trae","antigravity","goose","kiro","zed","vscode-cline","vscode-roo","vscode-continue"].map(o=>({clientId:o,status:dc(o),isAvailable:be(o)}))}async function $o(){let e=xt(),o=yd(),n=o.filter(t=>t.status.octocodeInstalled),i=o.filter(t=>t.isAvailable&&!t.status.octocodeInstalled);return n.length===0?await av(i,e):await bd(n,i,e)}async function av(e,o){if(console.log(),console.log(s("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","INFO")} No octocode configurations found`+" ".repeat(24)+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("Octocode is not configured in any MCP client yet.")}`),console.log(),e.length===0){console.log(` ${s("red","X")} ${l("No MCP clients detected on this system.")}`),console.log(),console.log(` ${l("Supported clients:")}`),console.log(` ${l("\u2022 Cursor, Claude Desktop, Claude Code")}`),console.log(` ${l("\u2022 Windsurf, Zed, VS Code (Cline/Roo/Continue)")}`),console.log(),console.log(` ${l("Install a supported client and try again,")}`),console.log(` ${l('or use "Custom Path" to specify a config file.')}`),console.log();let t=[{name:`${s("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"},new E,{name:`${s("dim","- Back")}`,value:"back"}],r=await O({message:"What would you like to do?",choices:t,loop:!1});if(r==="back")return null;if(r==="custom"){let a=await mc();return a?{client:"custom",customPath:a}:null}return null}let n=[];for(let{clientId:t,status:r}of e){let a=D[t],c=`${a.name} - ${l(a.description)}`;c+=` ${vd(r)}`,o===t&&(c=`${s("green","\u2605")} ${c} ${s("yellow","(Current)")}`),n.push({name:c,value:t})}n.sort((t,r)=>o===t.value?-1:o===r.value?1:0),n.push(new E),n.push({name:`${s("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"}),n.push(new E),n.push({name:`${s("dim","- Back")}`,value:"back"});let i=await O({message:"Select a client to install Octocode:",choices:n,loop:!1});if(i==="back")return null;if(i==="custom"){let t=await mc();return t?{client:"custom",customPath:t}:null}return{client:i}}async function bd(e,o,n){console.log(),console.log(` ${s("green","\u2705")} Found ${m(String(e.length))} octocode configuration${e.length>1?"s":""}`),console.log();let i=[];for(let{clientId:r}of e){let a=D[r],c=`${s("green","\u2705")} ${a.name} - ${l("View/Edit configuration")}`;n===r&&(c+=` ${s("yellow","(Current)")}`),i.push({name:c,value:r})}i.sort((r,a)=>n===r.value?-1:n===a.value?1:0),o.length>0&&(i.push(new E),i.push({name:`${s("blue","+")} Install to another client - ${l(`${o.length} available`)}`,value:"install-new"})),i.push(new E),i.push({name:`${s("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"}),i.push(new E),i.push({name:`${s("dim","- Back")}`,value:"back"});let t=await O({message:"Select configuration to manage:",choices:i,loop:!1});if(t==="back")return null;if(t==="install-new")return await cv(o,n);if(t==="custom"){let r=await mc();return r?{client:"custom",customPath:r}:null}return{client:t}}async function cv(e,o){console.log(),console.log(` ${s("blue","INFO")} Select a client for new installation:`),console.log();let n=[];for(let{clientId:t,status:r}of e){let a=D[t],c=`${a.name} - ${l(a.description)}`;c+=` ${vd(r)}`,o===t&&(c=`${s("green","\u2605")} ${c} ${s("yellow","(Current)")}`),n.push({name:c,value:t})}n.sort((t,r)=>o===t.value?-1:o===r.value?1:0),n.push(new E),n.push({name:`${s("dim","- Back to configurations")}`,value:"back"});let i=await O({message:"Select client to install Octocode:",choices:n,loop:!1});if(i==="back"){let r=yd().filter(a=>a.status.octocodeInstalled);return await bd(r,e,o)}return{client:i}}function hd(e){if(e.startsWith("~")){let o=process.env.HOME||process.env.USERPROFILE||"";return pc.join(o,e.slice(1))}return e}async function mc(){console.log(),console.log(` ${s("blue","INFO")} Enter the full path to your MCP config file (JSON)`),console.log(` ${l("Leave empty to go back")}`),console.log(),console.log(` ${l("Common paths:")}`),console.log(` ${l("\u2022")} ~/.cursor/mcp.json ${l("(Cursor)")}`),console.log(` ${l("\u2022")} ~/Library/Application Support/Claude/claude_desktop_config.json`),console.log(` ${l("(Claude Desktop)")}`),console.log(` ${l("\u2022")} ~/.claude.json ${l("(Claude Code)")}`),console.log(` ${l("\u2022")} ~/.config/opencode/config.json ${l("(Opencode)")}`),console.log(` ${l("\u2022")} ~/.codeium/windsurf/mcp_config.json ${l("(Windsurf)")}`),console.log(` ${l("\u2022")} ~/Library/Application Support/Trae/mcp.json ${l("(Trae)")}`),console.log(` ${l("\u2022")} ~/.gemini/antigravity/mcp_config.json ${l("(Antigravity)")}`),console.log(` ${l("\u2022")} ~/.config/zed/settings.json ${l("(Zed)")}`),console.log(` ${l("\u2022")} ~/.continue/config.json ${l("(Continue)")}`),console.log(` ${l("\u2022")} ~/.codex/config.toml ${l("(Codex - TOML format)")}`),console.log(` ${l("\u2022")} ~/.gemini/settings.json ${l("(Gemini CLI)")}`),console.log(` ${l("\u2022")} ~/.kiro/mcp.json ${l("(Kiro)")}`),console.log();let e=await q({message:"MCP config path (or press Enter to go back):",validate:o=>{if(!o.trim())return!0;let n=hd(o);if(!n.endsWith(".json"))return"Path must be a .json file (e.g., mcp.json, config.json)";if(!pc.isAbsolute(n))return"Please provide an absolute path (starting with / or ~)";let i=pc.dirname(n);return M(i)?!0:`Parent directory does not exist: ${i}
37
- Create it first or choose a different location.`}});return!e||!e.trim()?null:hd(e)}async function $d(){console.log(),console.log(` ${s("blue","INFO")} ${m("Local Tools")}`),console.log(` ${l("Enable local filesystem tools for searching and reading files")}`),console.log(` ${l("in your local codebase.")}`),console.log();let e=await O({message:"Enable local tools?",choices:[{name:`${s("green","\u25CF")} Disable ${l("(Recommended)")} - ${l("Use only GitHub tools")}`,value:"disable"},{name:`${s("yellow","\u25CB")} Enable - ${l("Allow local file exploration")}`,value:"enable"},new E,{name:`${s("dim","- Back")}`,value:"back"}],loop:!1});return e==="back"?null:e==="enable"}async function kd(){console.log(),console.log(` ${s("blue","INFO")} ${m("GitHub Authentication")}`),console.log(` ${l("Required for accessing GitHub repositories.")}`),console.log();let e=await O({message:"How would you like to authenticate with GitHub?",choices:[{name:`${s("green","\u25CF")} gh CLI ${l("(Recommended)")} - ${l("Uses existing gh auth")}`,value:"gh-cli"},{name:`${s("yellow","\u25CF")} GITHUB_TOKEN - ${l("Enter personal access token")}`,value:"token"},{name:`${s("dim","\u25CB")} Skip - ${l("Configure manually later")}`,value:"skip"},new E,{name:`${s("dim","- Back")}`,value:"back"}],loop:!1});if(e==="back")return null;if(e==="gh-cli")return console.log(),console.log(` ${s("cyan","->")} Make sure gh CLI is installed and authenticated:`),console.log(` ${l("https://cli.github.com/")}`),console.log(),console.log(` ${l("Run")} ${s("cyan","gh auth login")} ${l("if not already authenticated.")}`),console.log(),{method:"gh-cli"};if(e==="token"){console.log(),console.log(` ${l("Leave empty and press Enter to go back")}`),console.log();let o=await q({message:"Enter your GitHub personal access token:",validate:n=>n.trim()&&n.length<20?"Token appears too short":!0});return!o||!o.trim()?null:(console.log(),console.log(` ${s("yellow","WARN")} ${m("Security Note:")}`),console.log(` ${l("Your token will be saved in the MCP configuration file.")}`),console.log(` ${l("Make sure this file is not committed to version control.")}`),console.log(),{method:"token",token:o})}return{method:"skip"}}function wd(e){let o=e.env&&Object.keys(e.env).length>0,n=e.args??[];if(console.log(),console.log(s("dim"," {")),console.log(s("dim",' "mcpServers": {')),console.log(s("magenta",' "octocode"')+s("dim",": {")),console.log(s("dim",' "command": ')+s("green",`"${e.command}"`)+s("dim",",")),console.log(s("dim",' "args": [')),n.forEach((i,t)=>{let r=t===n.length-1,a=i.length>50?i.slice(0,47)+"...":i;console.log(s("dim"," ")+s("green",`"${a}"`)+(r&&!o?"":s("dim",",")))}),console.log(s("dim"," ]")+(o?s("dim",","):"")),o&&e.env){console.log(s("dim",' "env": {'));let i=Object.entries(e.env);i.forEach(([t,r],a)=>{let c=a===i.length-1,u=t.toLowerCase(),d=u.includes("token")||u.includes("secret")?"***":r;console.log(s("dim"," ")+s("cyan",`"${t}"`)+s("dim",": ")+s("green",`"${d}"`)+(c?"":s("dim",",")))}),console.log(s("dim"," }"))}console.log(s("dim"," }")),console.log(s("dim"," }")),console.log(s("dim"," }")),console.log()}function Cd(e){console.log(),console.log(` ${s("red","X")} ${m("Installation failed")}`),e.error&&console.log(` ${l("Error:")} ${e.error}`),console.log()}function xd(e){console.log(),console.log(s("cyan"," \u250C"+"\u2500".repeat(60)+"\u2510"));let n;if(e.url)n=e.url;else{let a=e.args??[];n=e.command?`${e.command} ${a.join(" ")}`.trim():"(no command configured)"}let i=56,t=n.length>i?n.slice(0,i-3)+"...":n,r=Math.max(0,58-t.length);if(console.log(s("cyan"," \u2502 ")+l(t)+" ".repeat(r)+s("cyan","\u2502")),e.env&&Object.keys(e.env).length>0){console.log(s("cyan"," \u2502")+" ".repeat(60)+s("cyan","\u2502"));let a="Environment:",c=58-a.length;console.log(s("cyan"," \u2502 ")+m(a)+" ".repeat(c)+s("cyan","\u2502"));for(let[u,p]of Object.entries(e.env)){let d=u.toLowerCase(),$=d.includes("token")||d.includes("secret")?"***":p,b=` ${u}: ${$}`,h=b.length>i?b.slice(0,i-3)+"...":b,k=Math.max(0,58-h.length);console.log(s("cyan"," \u2502 ")+l(h)+" ".repeat(k)+s("cyan","\u2502"))}}console.log(s("cyan"," \u2514"+"\u2500".repeat(60)+"\u2518"))}function gc(e){return e==="claude"?"claude-desktop":e}function Sd(){let e=[];return be("cursor")&&e.push("cursor"),be("claude-desktop")&&e.push("claude"),e}function lv(e){let o=F(gc(e));if(!Q(o))return{installed:!1,configPath:o,configExists:!1};let i=V(o);return i?{installed:Ae(i),configPath:o,configExists:!0}:{installed:!1,configPath:o,configExists:!0}}function _d(e){let{ide:o,method:n,force:i=!1}=e,t=F(gc(o)),r=V(t)||{mcpServers:{}};if(Ae(r)&&!i)return{success:!1,configPath:t,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};r=uc(r,n);let a=te(t,r);return a.success?{success:!0,configPath:t,backupPath:a.backupPath}:{success:!1,configPath:t,error:a.error||"Failed to write config"}}function Pd(e,o){let n=F(gc(e)),i=lv(e),t=V(n),r=G?Hn(o):bo(o),a="create";return i.installed?a="override":i.configExists&&(a="add"),{ide:e,method:o,configPath:n,serverConfig:r,action:a,existingMethod:t?qn(t):null}}function uv(e,o){let n=e==="custom"&&o?o:F(e,o);if(!Q(n))return{installed:!1,configPath:n,configExists:!1};let t=V(n);return t?{installed:Ae(t),configPath:n,configExists:!0}:{installed:!1,configPath:n,configExists:!0}}function Id(e){let{client:o,method:n,customPath:i,force:t=!1,envOptions:r}=e,a=o==="custom"&&i?i:F(o,i),c=V(a)||{mcpServers:{}};if(Ae(c)&&!t)return{success:!1,configPath:a,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};c=uc(c,n,r);let u=te(a,c);return u.success?{success:!0,configPath:a,backupPath:u.backupPath}:{success:!1,configPath:a,error:u.error||"Failed to write config"}}function fc(e,o,n,i){let t=e==="custom"&&n?n:F(e,n),r=uv(e,n),a=V(t),c=G?Hn(o,i):bo(o,i),u="create";return r.installed?u="override":r.configExists&&(u="add"),{client:e,method:o,configPath:t,serverConfig:c,action:u,existingMethod:a?qn(a):null}}async function hc(){await W(),console.log(),console.log(s("blue","\u2501".repeat(66))),console.log(` ${m("Configure MCP server for your environment")}`),console.log(s("blue","\u2501".repeat(66))),console.log();let e={client:null,hasExistingOctocode:!1,enableLocal:!1,githubAuth:{method:"skip"}},o="client";for(;o!=="done";)switch(o){case"client":{let n=await $o();if(!n)return;e.client=n.client,e.customPath=n.customPath;let i=e.customPath||F(e.client),t=V(i);e.hasExistingOctocode=!!t?.mcpServers?.octocode,e.hasExistingOctocode?o="updateConfirm":o="localTools";break}case"updateConfirm":{let n=e.customPath||F(e.client),i=V(n);console.log(),console.log(s("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","WARN")} ${m("Octocode is already configured!")}`+" ".repeat(28)+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${m("Current octocode configuration:")}`),xd(i.mcpServers.octocode),console.log(),console.log(` ${l("Config file:")} ${s("cyan",n)}`),console.log(),await O({message:"What would you like to do?",choices:[{name:`${s("green","\u2705")} Update existing configuration`,value:"update"},new E,{name:`${s("dim","- Back to client selection")}`,value:"back"}],loop:!1})==="back"?o="client":o="localTools";break}case"localTools":{let n=await $d();n===null?o=e.hasExistingOctocode?"updateConfirm":"client":(e.enableLocal=n,o="githubAuth");break}case"githubAuth":{let n=await kd();n===null?o="localTools":(e.githubAuth=n,o="confirm");break}case"confirm":{let n=await dv(e);if(n==="proceed")o="install";else if(n==="back")o="githubAuth";else{console.log(` ${l("Configuration cancelled.")}`);return}break}case"install":{await pv(e),o="done";break}default:break}}async function dv(e){let o=D[e.client],n="npx",i={};e.enableLocal&&(i.enableLocal=!0),e.githubAuth.method==="token"&&e.githubAuth.token&&(i.githubToken=e.githubAuth.token);let t=fc(e.client,n,e.customPath,i);console.log(),e.hasExistingOctocode?console.log(` ${s("yellow","WARN")} Will ${s("yellow","UPDATE")} existing octocode configuration`):t.action==="add"?console.log(` ${s("blue","INFO")} Config file exists, will ${s("green","ADD")} octocode entry`):console.log(` ${s("green","\u2705")} Will ${s("green","CREATE")} new config file`),console.log(),console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+m("Configuration to be added:")+" ".repeat(33)+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),wd(t.serverConfig),console.log(),console.log(` ${m("Summary:")}`),console.log(` ${l("Client:")} ${o.name}`),console.log(` ${l("Method:")} npx (octocode-mcp@latest)`);let r=e.enableLocal?s("green","Enabled"):s("dim","Disabled");console.log(` ${l("Local Tools:")} ${r}`);let a;e.githubAuth.method==="token"?a=s("green","Token configured"):e.githubAuth.method==="gh-cli"?a=s("cyan","Using gh CLI"):a=s("dim","Not configured"),console.log(` ${l("GitHub Auth:")} ${a}`);let c;return e.hasExistingOctocode?c=s("yellow","UPDATE"):t.action==="add"?c=s("green","ADD"):c=s("green","CREATE"),console.log(` ${l("Action:")} ${c}`),console.log(),console.log(` ${s("yellow","WARN")} ${m("Note:")}`),console.log(` ${l("Nothing is saved to any server. Configuration is stored locally at:")}`),console.log(` ${s("cyan",t.configPath)}`),console.log(),await O({message:"What would you like to do?",choices:[{name:`${s("green","\u2705")} Proceed with configuration`,value:"proceed"},new E,{name:`${s("dim","- Back to edit options")}`,value:"back"},{name:`${s("dim","X Cancel")}`,value:"cancel"}],loop:!1})}async function pv(e){let n={};e.enableLocal&&(n.enableLocal=!0),e.githubAuth.method==="token"&&e.githubAuth.token&&(n.githubToken=e.githubAuth.token);let i=fc(e.client,"npx",e.customPath,n),t=new N("Configuring octocode-mcp...").start(),r=Id({client:e.client,method:"npx",customPath:e.customPath,force:e.hasExistingOctocode,envOptions:n});r.success?(t.succeed("Octocode configured successfully!"),mv(r,e.client,i.configPath)):(t.fail("Configuration failed"),Cd(r))}function mv(e,o,n){let i=D[o];console.log(),console.log(s("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("green"," \u2502 ")+`${s("green","\u2705")} ${m("Octocode installed successfully!")}`+" ".repeat(26)+s("green","\u2502")),console.log(s("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${m("Configuration saved to:")}`),console.log(` ${s("cyan",n)}`),console.log(),e.backupPath&&(console.log(` ${l("Backup saved to:")} ${e.backupPath}`),console.log()),console.log(` ${m("Next steps:")}`),console.log(` 1. Restart ${i?.name||o}`),console.log(` 2. Look for ${s("cyan","octocode")} in MCP servers`),console.log()}import{execSync as Ed,exec as gv}from"node:child_process";import{promisify as fv}from"node:util";var SC=fv(gv),hv=1e3,vv=3e3,yv=4e3;function Jn(){try{return{installed:!0,version:Ed("node --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}}catch{return{installed:!1,version:null}}}function Xn(){try{return{installed:!0,version:`v${Ed("npm --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}`}}catch{return{installed:!1,version:null}}}async function Od(){let e="https://registry.npmjs.org";try{let o=Date.now(),n=new AbortController,i=setTimeout(()=>n.abort(),yv),t=await fetch(e,{method:"HEAD",signal:n.signal});clearTimeout(i);let r=Date.now()-o;return t.ok?r>vv?{status:"slow",latency:r}:r>hv?{status:"slow",latency:r}:{status:"ok",latency:r}:{status:"failed",latency:r}}catch{return{status:"failed",latency:null}}}var $e=null;function Td(e,o){console.log(e?` ${s("green","\u2705")} Node ${m(o||"unknown")}`:` ${s("red","X")} Node ${s("red","not found")}`)}function Ad(e,o){console.log(e?` ${s("green","\u2705")} npm ${m(o||"unknown")}`:` ${s("yellow","WARN")} npm ${s("yellow","not found")}`)}function Md(e,o){let n=o!==null?`(${o}ms)`:"";switch(e){case"ok":console.log(` ${s("green","\u2705")} Registry ${l(n)}`);break;case"slow":console.log(` ${s("yellow","WARN")} Registry ${s("yellow","slow")} ${l(n)}`);break;case"failed":console.log(` ${s("red","X")} Registry ${s("red","unreachable")} ${o!==null?l(n):""}`);break;default:break}}async function ko(){if($e)return Td($e.nodeInstalled,$e.nodeVersion),Ad($e.npmInstalled,$e.npmVersion),Md($e.registryStatus,$e.registryLatency),$e;let e=Jn();Td(e.installed,e.version);let o=Xn();Ad(o.installed,o.version);let n=new N(" Registry: Checking...").start(),i=await Od();return n.clear(),Md(i.status,i.latency),$e={nodeInstalled:e.installed,nodeVersion:e.version,npmInstalled:o.installed,npmVersion:o.version,registryStatus:i.status,registryLatency:i.latency,octocodePackageAvailable:o.installed&&i.status==="ok",octocodePackageVersion:null},$e}function vc(){console.log(` ${l("For deeper diagnostics:")} ${s("cyan","npx node-doctor")}`)}function wo(e){return!e.nodeInstalled||!e.npmInstalled||e.registryStatus==="slow"||e.registryStatus==="failed"}function bv(e){let o=D[e.client]?.name||e.client;return e.octocodeInstalled?`${o} ${l("(Octocode installed)")}`:o}async function $v(e,o,n){if(console.log(),console.log(s("blue","\u2501".repeat(66))),console.log(` ${m("MCP Server Details")}`),console.log(s("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("ID:")} ${s("cyan",o)}`),console.log(` ${l("Command:")} ${s("green",n.command||"unknown")}`),n.args&&n.args.length>0&&(console.log(` ${l("Args:")}`),n.args.forEach(t=>{console.log(` ${t}`)})),n.env&&Object.keys(n.env).length>0&&(console.log(` ${l("Environment:")}`),Object.entries(n.env).forEach(([t,r])=>{let c=t.includes("KEY")||t.includes("TOKEN")||t.includes("SECRET")?"********":r;console.log(` ${t}=${c}`)})),console.log(),await O({message:"",choices:[{name:`${s("red","Delete")} - Remove Server`,value:"remove",description:"Remove this server from configuration"},new E,{name:`${s("dim","- Back")}`,value:"back"}],loop:!1,theme:{prefix:" ",style:{highlight:t=>s("cyan",t)}}})==="remove"&&await $t({message:`Are you sure you want to remove "${o}" from ${D[e.client]?.name}?`,default:!1})){let r=e.configPath,a=V(r);if(a){let c=new N("Removing server...").start(),u=fd(a,o),p=te(r,u);p.success?c.succeed(`Removed ${o}`):c.fail(`Failed to remove: ${p.error}`),console.log(),await new Promise(d=>setTimeout(d,1e3))}}}async function kv(e){let o=!0;for(;o;){let n=e.configPath,i=V(n);if(!i||!i.mcpServers){console.log(),console.log(` ${s("yellow","WARN")} No MCP configuration found or empty.`),console.log(),await new Promise(c=>setTimeout(c,1500));return}let t=Object.keys(i.mcpServers);if(t.length===0){console.log(),console.log(` ${s("yellow","WARN")} No MCP servers configured.`),console.log(),await new Promise(c=>setTimeout(c,1500));return}console.log(),console.log(` ${m(D[e.client]?.name||e.client)}`),console.log(` ${l(n)}`),console.log();let r=t.map(c=>({name:c==="octocode"?`${c}`:`MCP ${c}`,value:c,description:i.mcpServers[c].command}));r.push(new E),r.push({name:`${s("dim","- Back")}`,value:"back"});let a=await O({message:"Select an MCP server to inspect:",choices:r,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:c=>s("cyan",c),message:c=>m(c)}}});a==="back"?o=!1:await $v(e,a,i.mcpServers[a])}}async function yc(){await W();let e=!0;for(;e;){let n=Kn().filter(r=>r.configExists);if(n.length===0){console.log(),console.log(` ${s("yellow","WARN")} No configured MCP clients found.`),console.log();return}console.log(),console.log(s("blue","\u2501".repeat(66))),console.log(` Info: ${m("MCP Configuration Details")}`),console.log(s("blue","\u2501".repeat(66))),console.log();let i=n.map(r=>({name:bv(r),value:r.client,description:r.configPath}));i.push(new E),i.push({name:`${s("dim","- Back")}`,value:"back"});let t=await O({message:"Select a client to inspect:",choices:i,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:r=>s("cyan",r),message:r=>m(r)}}});if(t==="back")e=!1;else{let r=n.find(a=>a.client===t);r&&await kv(r)}}}var zd={github:[{id:"githubSearchCode",name:"Search Code",description:"Search for code patterns in GitHub repositories"},{id:"githubGetFileContent",name:"Get File Content",description:"Fetch file content from GitHub repositories"},{id:"githubViewRepoStructure",name:"View Repo Structure",description:"Browse repository directory structure"},{id:"githubSearchRepositories",name:"Search Repositories",description:"Search for GitHub repositories"},{id:"githubSearchPullRequests",name:"Search Pull Requests",description:"Search for pull requests and view diffs"},{id:"packageSearch",name:"Package Search",description:"Search npm/Python packages and find their repos"}],local:[{id:"localSearchCode",name:"Ripgrep Search",description:"Fast content search with regex support"},{id:"localViewStructure",name:"View Structure",description:"Browse local directory structure"},{id:"localFindFiles",name:"Find Files",description:"Find files by name, time, size, permissions"},{id:"localGetFileContent",name:"Fetch Content",description:"Read targeted sections of local files"}]},et=[{id:"enableLocal",envVar:"ENABLE_LOCAL",name:"Local File Tools",description:"Enable local file exploration tools for searching and browsing local files",type:"boolean",defaultValue:"false"},{id:"githubApiUrl",envVar:"GITHUB_API_URL",name:"GitHub API URL",description:"Custom GitHub API endpoint (for GitHub Enterprise)",type:"string",defaultValue:"https://api.github.com"},{id:"toolsToRun",envVar:"TOOLS_TO_RUN",name:"Tools to Run",description:"Specific tools to enable (all others disabled)",type:"array",defaultValue:"",toolCategory:"all"},{id:"enableTools",envVar:"ENABLE_TOOLS",name:"Enable Tools",description:"Additional tools to enable",type:"array",defaultValue:"",toolCategory:"all"},{id:"disableTools",envVar:"DISABLE_TOOLS",name:"Disable Tools",description:"Tools to disable",type:"array",defaultValue:"",toolCategory:"all"},{id:"requestTimeout",envVar:"REQUEST_TIMEOUT",name:"Request Timeout",description:"API request timeout in milliseconds",type:"number",defaultValue:"30000",validation:{min:3e4,max:6e5}},{id:"maxRetries",envVar:"MAX_RETRIES",name:"Max Retries",description:"Maximum number of API retry attempts",type:"number",defaultValue:"3",validation:{min:0,max:10}}];function wv(){return[...zd.github.map(e=>({...e,category:"github"})),...zd.local.map(e=>({...e,category:"local"}))]}function Co(e,o){let n=e[o.envVar];return n==null||n===""?o.defaultValue:n}function Yn(e,o,n=!1){let i=n?s("yellow"," \u2022"):"";if(e.type==="boolean"){let t=o==="1"||o.toLowerCase()==="true",r=t?s("green","\u2705"):s("dim","\u25CB"),a=t?s("green","enabled"):s("dim","disabled");return`${r} ${a}${i}`}if(e.type==="array"){if(!o||o===""){let a=e.id==="toolsToRun"?"(all tools)":"(none)";return`${s("dim","\u25CB")} ${s("dim",a)}${i}`}let t=o.split(",").filter(a=>a.trim()),r=t.length>2?`${t.slice(0,2).join(", ")} ${s("dim",`+${t.length-2} more`)}`:t.join(", ");return`${s("green","\u25CF")} ${r}${i}`}return e.type==="number"?o===e.defaultValue?`${s("dim","\u25CB")} ${o} ${s("dim","(default)")}${i}`:`${s("cyan","\u25CF")} ${s("cyan",o)}${i}`:o===e.defaultValue?`${s("dim","\u25CB")} ${s("dim",o)}${i}`:`${s("cyan","\u25CF")} ${s("cyan",o)}${i}`}function Cv(e){return e==="1"||e.toLowerCase()==="true"}async function xv(){return await O({message:"",choices:[{name:"- Edit configuration",value:"edit",description:"Configure all octocode-mcp settings for a client"},{name:"- View all configuration options",value:"view",description:"Show available environment variables and their defaults"},{name:"- Show current JSON config",value:"show-json",description:"Display the actual MCP config JSON for a client"},new E,{name:`${s("dim","- Back to main menu")}`,value:"back"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:o=>s("cyan",o)}}})}async function Nd(){switch(await W(),await xv()){case"view":jv(),await Sv();break;case"edit":await Av();break;case"show-json":await Mv();break;default:break}}async function Sv(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}async function jd(e){console.log();let o=await O({message:"Open config file?",choices:[{name:"- Open in Cursor",value:"cursor",description:"Open in Cursor IDE"},{name:"- Open in VS Code",value:"vscode",description:"Open in Visual Studio Code"},{name:"- Open in default app",value:"default",description:"Open with system default application"},new E,{name:`${s("dim","- Skip")}`,value:"no"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:i=>s("cyan",i),message:i=>m(i)}}});if(o==="no")return;nd(e,o)?console.log(` ${s("green","\u2705")} Opened ${e}`):(console.log(` ${s("yellow","WARN")} Could not open file automatically`),console.log(` ${l("Try opening manually:")} ${s("cyan",e)}`)),console.log()}async function _v(e,o){let i=Cv(o)?s("green","enabled"):s("dim","disabled");console.log(),console.log(` ${m(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${i}`),console.log();let t=await O({message:`${e.name}:`,choices:[{name:`${s("green","\u2705")} Enable`,value:"enable"},{name:`${s("yellow","\u25CB")} Disable`,value:"disable"},new E,{name:`${s("dim","- Cancel")}`,value:"cancel"}],loop:!1});return t==="cancel"?null:t==="enable"?"1":"false"}async function Pv(e,o){let n=o&&o!==e.defaultValue?s("cyan",o):s("dim",o||e.defaultValue);console.log(),console.log(` ${m(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${n}`),console.log(` ${l("Default:")} ${e.defaultValue}`),console.log(` ${l("(Leave empty and press Enter to cancel)")}`),console.log();let i=await q({message:`${e.name}:`,default:"",validate:t=>t.trim()&&e.validation?.pattern&&!e.validation.pattern.test(t)?"Invalid format":!0});return i.trim()?i===e.defaultValue?"":i:null}async function Iv(e,o){let n=o&&o!==e.defaultValue?s("cyan",o):s("dim",o||e.defaultValue);if(console.log(),console.log(` ${m(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${n}`),e.validation?.min!==void 0||e.validation?.max!==void 0){let t=e.validation?.min??0,r=e.validation?.max??1/0;console.log(` ${l("Range:")} ${t} - ${r===1/0?"\u221E":r}`)}console.log(` ${l("Default:")} ${e.defaultValue}`),console.log(` ${l("(Leave empty and press Enter to cancel)")}`),console.log();let i=await q({message:`${e.name}:`,default:"",validate:t=>{if(!t.trim())return!0;let r=parseInt(t,10);return isNaN(r)?"Please enter a valid number":e.validation?.min!==void 0&&r<e.validation.min?`Minimum value is ${e.validation.min}`:e.validation?.max!==void 0&&r>e.validation.max?`Maximum value is ${e.validation.max}`:!0}});return i.trim()?i===e.defaultValue?"":i:null}async function Ev(e,o){let n=wv(),i=o?o.split(",").map(p=>p.trim()).filter(Boolean):[],t=i.length>0?i.join(", "):e.id==="toolsToRun"?s("dim","(all tools)"):s("dim","(none)");console.log(),console.log(` ${m(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${t}`),console.log();let r=await O({message:`${e.name}:`,choices:[{name:"EDIT Select tools",value:"select",description:"Choose which tools to include"},{name:`${s("yellow","\u21BA")} Clear all`,value:"clear",description:e.id==="toolsToRun"?"Reset to all tools enabled":"Remove all tools from this list"},new E,{name:`${s("dim","- Cancel")}`,value:"cancel"}],loop:!1});if(r==="cancel")return null;if(r==="clear")return"";let a=[];a.push({name:s("blue","\u2500\u2500 GitHub Tools \u2500\u2500"),value:"__separator_github__",disabled:!0});for(let p of n.filter(d=>d.category==="github"))a.push({name:`${p.name} ${s("dim",`(${p.id})`)}`,value:p.id,checked:i.includes(p.id),description:p.description});a.push({name:s("yellow","\u2500\u2500 Local Tools \u2500\u2500"),value:"__separator_local__",disabled:!0});for(let p of n.filter(d=>d.category==="local"))a.push({name:`${p.name} ${s("dim",`(${p.id})`)}`,value:p.id,checked:i.includes(p.id),description:p.description});a.push({name:s("dim","\u2500\u2500 Actions \u2500\u2500"),value:"__separator_actions__",disabled:!0}),a.push({name:`${s("dim","- Cancel (keep current)")}`,value:"__cancel__",checked:!1,description:"Go back without changes"}),console.log(),console.log(` ${l("Use Space to select/deselect, Enter to confirm, or select Cancel")}`);let c=await vo({message:`Select tools for ${e.name}:`,choices:a,pageSize:16,loop:!1,theme:{prefix:" ",style:{highlight:p=>s("cyan",p),message:p=>m(p)}}});if(c.includes("__cancel__"))return null;let u=c.filter(p=>!p.startsWith("__separator")&&p!=="__cancel__");return u.length>0?u.join(","):""}function xo(e,o,n){let i=e[n.envVar]??"",t=o[n.envVar]??"";return i!==t}function Ov(e,o){let n=0;for(let i of et)xo(e,o,i)&&n++;return n}async function Tv(e,o){let n=[],i=et.filter(d=>d.type==="boolean"),t=et.filter(d=>d.type==="string"),r=et.filter(d=>d.type==="number"),a=et.filter(d=>d.type==="array"),c=Ov(o,e),u=c>0?`${s("yellow","\u25CF")} ${c} unsaved ${c===1?"change":"changes"}`:`${s("green","\u25CF")} No unsaved changes`;if(n.push({name:`${s("dim","\u2500\u2500")} ${u} ${s("dim","\u2500\u2500")}`,value:"__status__"}),i.length>0){n.push({name:s("dim","\u2500\u2500 Features \u2500\u2500"),value:"__sep1__"});for(let d of i){let f=Co(e,d),$=xo(o,e,d),b=Yn(d,f,$);n.push({name:`${d.name}: ${b}`,value:d.id,description:d.description})}}if(t.length>0){n.push({name:s("dim","\u2500\u2500 Endpoints \u2500\u2500"),value:"__sep2__"});for(let d of t){let f=Co(e,d),$=xo(o,e,d),b=Yn(d,f,$);n.push({name:`${d.name}: ${b}`,value:d.id,description:d.description})}}if(r.length>0){n.push({name:s("dim","\u2500\u2500 Performance \u2500\u2500"),value:"__sep3__"});for(let d of r){let f=Co(e,d),$=xo(o,e,d),b=Yn(d,f,$);n.push({name:`${d.name}: ${b}`,value:d.id,description:d.description})}}if(a.length>0){n.push({name:s("dim","\u2500\u2500 Tool Selection \u2500\u2500"),value:"__sep4__"});for(let d of a){let f=Co(e,d),$=xo(o,e,d),b=Yn(d,f,$);n.push({name:`${d.name}: ${b}`,value:d.id,description:d.description})}}return n.push({name:s("dim","\u2500\u2500 Actions \u2500\u2500"),value:"__sep5__"}),c>0?n.push({name:`${s("green","Save")} Save changes ${s("yellow",`(${c})`)}`,value:"save",description:"Save configuration and exit"}):n.push({name:`${s("dim","Save")} Save changes`,value:"save",description:l("No changes to save")}),n.push({name:`${s("yellow","\u21BA")} Reset to defaults`,value:"reset",description:"Clear all custom configuration"}),n.push({name:`${s("dim","- Back")}`,value:"back"}),await O({message:"Select option to configure:",choices:n,pageSize:20,loop:!1,theme:{prefix:" ",style:{highlight:d=>s("cyan",d),message:d=>m(d)}}})}async function Av(){let e=await $o();if(!e)return;let{client:o,customPath:n}=e,i=D[o],t=n||F(o),r=V(t);if(!r){console.log(),console.log(` ${s("red","X")} Failed to read config file: ${t}`),console.log();return}if(!Ae(r)){console.log(),console.log(` ${s("yellow","WARN")} Octocode is not configured for ${i.name}.`),console.log(` ${l('Please install Octocode first using "Install octocode-mcp".')}`),console.log();return}console.log(),console.log(` ${l("Config file:")} ${s("cyan",t)}`),console.log(` ${l("Client:")} ${i.name}`),console.log();let a={...r.mcpServers?.octocode?.env||{}},c={...a},u=!0;for(;u;){let p=await Tv(c,a);if(!(p.startsWith("__sep")||p==="__status__"))switch(p){case"save":{if(!(JSON.stringify(a)!==JSON.stringify(c))){console.log(),console.log(` ${l("No changes to save.")}`),console.log(),u=!1;break}let f=new N("Saving configuration...").start(),$={};for(let[k,v]of Object.entries(c))v&&v!==""&&($[k]=v);let b={...r,mcpServers:{...r.mcpServers,octocode:{...r.mcpServers.octocode,env:Object.keys($).length>0?$:void 0}}};b.mcpServers?.octocode?.env&&Object.keys(b.mcpServers.octocode.env).length===0&&delete b.mcpServers.octocode.env;let h=te(t,b);h.success?(f.succeed("Configuration saved!"),console.log(),console.log(` ${s("green","\u2705")} Config saved to: ${t}`),h.backupPath&&console.log(` ${l("Backup:")} ${h.backupPath}`),console.log(),console.log(` ${m("Note:")} Restart ${i.name} for changes to take effect.`),await jd(t)):(f.fail("Failed to save configuration"),console.log(),console.log(` ${s("red","X")} ${h.error||"Unknown error"}`),console.log()),u=!1;break}case"reset":{if(await $t({message:"Reset all configuration to defaults?",default:!1})){for(let f of Object.keys(c))delete c[f];console.log(` ${s("yellow","\u21BA")} Configuration reset to defaults`)}break}case"back":{if(JSON.stringify(a)!==JSON.stringify(c)&&!await $t({message:"Discard unsaved changes?",default:!1}))break;u=!1;break}default:{let d=et.find(b=>b.id===p);if(!d)break;let f=Co(c,d),$=null;switch(d.type){case"boolean":$=await _v(d,f);break;case"string":$=await Pv(d,f);break;case"number":$=await Iv(d,f);break;case"array":$=await Ev(d,f);break;default:break}$!==null&&($===""||$===d.defaultValue?delete c[d.envVar]:c[d.envVar]=$);break}}}}async function Mv(){let e=await $o();if(!e)return;let{client:o,customPath:n}=e,i=D[o],t=n||F(o),r=V(t);if(!r){console.log(),console.log(` ${s("red","X")} Failed to read config file: ${t}`),console.log();return}if(!Ae(r)){console.log(),console.log(` ${s("yellow","WARN")} Octocode is not configured for ${i.name}.`),console.log(` ${l('Please install Octocode first using "Install octocode-mcp".')}`),console.log();return}let a=r.mcpServers?.octocode;console.log(),console.log(` ${l("Client:")} ${i.name} ${l("\u2022")} ${s("cyan",t)}`),console.log();let u=JSON.stringify({octocode:a},null,2).split(`
38
- `);for(let p of u){let d=p.replace(/"([^"]+)":/g,`${s("cyan",'"$1"')}:`).replace(/: "([^"]+)"/g,`: ${s("green",'"$1"')}`).replace(/: (\d+)/g,`: ${s("yellow","$1")}`).replace(/: (true|false)/g,`: ${s("magenta","$1")}`);console.log(` ${d}`)}console.log(),await jd(t)}function zv(e){switch(e.id){case"enableLocal":return"ENABLE_LOCAL=1";case"githubApiUrl":return"GITHUB_API_URL=https://github.mycompany.com/api/v3";case"toolsToRun":return"TOOLS_TO_RUN=githubSearchCode,githubGetFileContent";case"enableTools":return"ENABLE_TOOLS=localSearchCode,localFindFiles";case"disableTools":return"DISABLE_TOOLS=githubSearchPullRequests";case"requestTimeout":return"REQUEST_TIMEOUT=60000";case"maxRetries":return"MAX_RETRIES=5";default:return`${e.envVar}=${e.defaultValue}`}}function Nv(e){return e.type==="array"?e.id==="toolsToRun"?"(all tools)":"(none)":e.defaultValue}function jv(){console.log(),console.log(` ${m("All Available Configuration Options")}`),console.log(),console.log(` ${l("These options can be set as environment variables in your MCP config.")}`),console.log(` ${l('Add them to the "env" object in your octocode server configuration.')}`),console.log(),console.log(` ${l("Example config:")}`),console.log(` ${l("{")}
36
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let m=d[1];if(t===d[0]){s(d);continue}if(r.external){let y=r.external.registry.get(d[0])?.id;if(t!==d[0]&&y){s(d);continue}}if(this.metadataRegistry.get(d[0])?.id){s(d);continue}if(m.cycle){s(d);continue}if(m.count>1&&r.reused==="ref"){s(d);continue}}let c=(d,m)=>{let h=this.seen.get(d),y=h.def??h.schema,g={...y};if(h.ref===null)return;let D=h.ref;if(h.ref=null,D){c(D,m);let b=this.seen.get(D).schema;b.$ref&&m.target==="draft-7"?(y.allOf=y.allOf??[],y.allOf.push(b)):(Object.assign(y,b),Object.assign(y,g))}h.isParent||this.override({zodSchema:d,jsonSchema:y,path:h.path??[]})};for(let d of[...this.seen.entries()].reverse())c(d[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){let d=r.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");u.$id=r.external.uri(d)}Object.assign(u,n.def);let p=r.external?.defs??{};for(let d of this.seen.entries()){let m=d[1];m.def&&m.defId&&(p[m.defId]=m.def)}r.external||Object.keys(p).length>0&&(this.target==="draft-2020-12"?u.$defs=p:u.definitions=p);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}};function zc(e,t){if(e instanceof Wt){let r=new Qn(t),n={};for(let c of e._idmap.entries()){let[u,p]=c;r.process(p)}let i={},s={registry:e,uri:t?.uri,defs:n};for(let c of e._idmap.entries()){let[u,p]=c;i[u]=r.emit(p,{...t,external:s})}if(Object.keys(n).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:n}}return{schemas:i}}let o=new Qn(t);return o.process(e),o.emit(e,t)}function se(e,t){let o=t??{seen:new Set};if(o.seen.has(e))return!1;o.seen.add(e);let n=e._zod.def;switch(n.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 se(n.element,o);case"object":{for(let i in n.shape)if(se(n.shape[i],o))return!0;return!1}case"union":{for(let i of n.options)if(se(i,o))return!0;return!1}case"intersection":return se(n.left,o)||se(n.right,o);case"tuple":{for(let i of n.items)if(se(i,o))return!0;return!!(n.rest&&se(n.rest,o))}case"record":return se(n.keyType,o)||se(n.valueType,o);case"map":return se(n.keyType,o)||se(n.valueType,o);case"set":return se(n.valueType,o);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return se(n.innerType,o);case"lazy":return se(n.getter(),o);case"default":return se(n.innerType,o);case"prefault":return se(n.innerType,o);case"custom":return!1;case"transform":return!0;case"pipe":return se(n.in,o)||se(n.out,o);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${n.type}`)}var dp={};var Pr={};pt(Pr,{ZodISODate:()=>xr,ZodISODateTime:()=>wr,ZodISODuration:()=>_r,ZodISOTime:()=>Sr,date:()=>Nc,datetime:()=>jc,duration:()=>Uc,time:()=>Lc});var wr=v("ZodISODateTime",(e,t)=>{na.init(e,t),q.init(e,t)});function jc(e){return Ya(wr,e)}var xr=v("ZodISODate",(e,t)=>{oa.init(e,t),q.init(e,t)});function Nc(e){return Qa(xr,e)}var Sr=v("ZodISOTime",(e,t)=>{ra.init(e,t),q.init(e,t)});function Lc(e){return ec(Sr,e)}var _r=v("ZodISODuration",(e,t)=>{ia.init(e,t),q.init(e,t)});function Uc(e){return tc(_r,e)}var mp=(e,t)=>{In.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:o=>An(e,o)},flatten:{value:o=>Fn(e,o)},addIssue:{value:o=>e.issues.push(o)},addIssues:{value:o=>e.issues.push(...o)},isEmpty:{get(){return e.issues.length===0}}})},Iy=v("ZodError",mp),Xt=v("ZodError",mp,{Parent:Error});var Bc=Uo(Xt),Rc=Ro(Xt),Zc=Vo(Xt),Vc=Go(Xt);var N=v("ZodType",(e,t)=>(O.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...o)=>e.clone({...t,checks:[...t.checks??[],...o.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(o,r)=>ye(e,o,r),e.brand=()=>e,e.register=((o,r)=>(o.add(e,r),e)),e.parse=(o,r)=>Bc(e,o,r,{callee:e.parse}),e.safeParse=(o,r)=>Zc(e,o,r),e.parseAsync=async(o,r)=>Rc(e,o,r,{callee:e.parseAsync}),e.safeParseAsync=async(o,r)=>Vc(e,o,r),e.spa=e.safeParseAsync,e.refine=(o,r)=>e.check(em(o,r)),e.superRefine=o=>e.check(tm(o)),e.overwrite=o=>e.check(qe(o)),e.optional=()=>Fr(e),e.nullable=()=>Ar(e),e.nullish=()=>Fr(Ar(e)),e.nonoptional=o=>Rp(e,o),e.array=()=>pl(e),e.or=o=>jr([e,o]),e.and=o=>Pp(e,o),e.transform=o=>Tr(e,hl(o)),e.default=o=>Lp(e,o),e.prefault=o=>Bp(e,o),e.catch=o=>Gp(e,o),e.pipe=o=>Tr(e,o),e.readonly=()=>qp(e),e.describe=o=>{let r=e.clone();return je.add(r,{description:o}),r},Object.defineProperty(e,"description",{get(){return je.get(e)?.description},configurable:!0}),e.meta=(...o)=>{if(o.length===0)return je.get(e);let r=e.clone();return je.add(r,o[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Hc=v("_ZodString",(e,t)=>{vt.init(e,t),N.init(e,t);let o=e._zod.bag;e.format=o.format??null,e.minLength=o.minimum??null,e.maxLength=o.maximum??null,e.regex=(...r)=>e.check(Bn(...r)),e.includes=(...r)=>e.check(Vn(...r)),e.startsWith=(...r)=>e.check(Gn(...r)),e.endsWith=(...r)=>e.check(Wn(...r)),e.min=(...r)=>e.check(it(...r)),e.max=(...r)=>e.check(Kt(...r)),e.length=(...r)=>e.check(Jt(...r)),e.nonempty=(...r)=>e.check(it(1,...r)),e.lowercase=r=>e.check(Rn(r)),e.uppercase=r=>e.check(Zn(r)),e.trim=()=>e.check(Kn()),e.normalize=(...r)=>e.check(qn(...r)),e.toLowerCase=()=>e.check(Jn()),e.toUpperCase=()=>e.check(Xn())}),to=v("ZodString",(e,t)=>{vt.init(e,t),Hc.init(e,t),e.email=o=>e.check(nr(qc,o)),e.url=o=>e.check(ar(Kc,o)),e.jwt=o=>e.check(Cr(ul,o)),e.emoji=o=>e.check(cr(Jc,o)),e.guid=o=>e.check(Ln(Er,o)),e.uuid=o=>e.check(or(Je,o)),e.uuidv4=o=>e.check(rr(Je,o)),e.uuidv6=o=>e.check(ir(Je,o)),e.uuidv7=o=>e.check(sr(Je,o)),e.nanoid=o=>e.check(lr(Xc,o)),e.guid=o=>e.check(Ln(Er,o)),e.cuid=o=>e.check(ur(Yc,o)),e.cuid2=o=>e.check(dr(Qc,o)),e.ulid=o=>e.check(pr(el,o)),e.base64=o=>e.check(br(al,o)),e.base64url=o=>e.check(Dr(cl,o)),e.xid=o=>e.check(mr(tl,o)),e.ksuid=o=>e.check(gr(nl,o)),e.ipv4=o=>e.check(fr(ol,o)),e.ipv6=o=>e.check(hr(rl,o)),e.cidrv4=o=>e.check(vr(il,o)),e.cidrv6=o=>e.check(yr(sl,o)),e.e164=o=>e.check($r(ll,o)),e.datetime=o=>e.check(jc(o)),e.date=o=>e.check(Nc(o)),e.time=o=>e.check(Lc(o)),e.duration=o=>e.check(Uc(o))});function Gc(e){return Ka(to,e)}var q=v("ZodStringFormat",(e,t)=>{W.init(e,t),Hc.init(e,t)}),qc=v("ZodEmail",(e,t)=>{Hs.init(e,t),q.init(e,t)});function Ay(e){return nr(qc,e)}var Er=v("ZodGUID",(e,t)=>{Gs.init(e,t),q.init(e,t)});function Ty(e){return Ln(Er,e)}var Je=v("ZodUUID",(e,t)=>{Ws.init(e,t),q.init(e,t)});function Oy(e){return or(Je,e)}function My(e){return rr(Je,e)}function zy(e){return ir(Je,e)}function jy(e){return sr(Je,e)}var Kc=v("ZodURL",(e,t)=>{qs.init(e,t),q.init(e,t)});function Ny(e){return ar(Kc,e)}var Jc=v("ZodEmoji",(e,t)=>{Ks.init(e,t),q.init(e,t)});function Ly(e){return cr(Jc,e)}var Xc=v("ZodNanoID",(e,t)=>{Js.init(e,t),q.init(e,t)});function Uy(e){return lr(Xc,e)}var Yc=v("ZodCUID",(e,t)=>{Xs.init(e,t),q.init(e,t)});function By(e){return ur(Yc,e)}var Qc=v("ZodCUID2",(e,t)=>{Ys.init(e,t),q.init(e,t)});function Ry(e){return dr(Qc,e)}var el=v("ZodULID",(e,t)=>{Qs.init(e,t),q.init(e,t)});function Zy(e){return pr(el,e)}var tl=v("ZodXID",(e,t)=>{ea.init(e,t),q.init(e,t)});function Vy(e){return mr(tl,e)}var nl=v("ZodKSUID",(e,t)=>{ta.init(e,t),q.init(e,t)});function Gy(e){return gr(nl,e)}var ol=v("ZodIPv4",(e,t)=>{sa.init(e,t),q.init(e,t)});function Wy(e){return fr(ol,e)}var rl=v("ZodIPv6",(e,t)=>{aa.init(e,t),q.init(e,t)});function Hy(e){return hr(rl,e)}var il=v("ZodCIDRv4",(e,t)=>{ca.init(e,t),q.init(e,t)});function qy(e){return vr(il,e)}var sl=v("ZodCIDRv6",(e,t)=>{la.init(e,t),q.init(e,t)});function Ky(e){return yr(sl,e)}var al=v("ZodBase64",(e,t)=>{da.init(e,t),q.init(e,t)});function Jy(e){return br(al,e)}var cl=v("ZodBase64URL",(e,t)=>{pa.init(e,t),q.init(e,t)});function Xy(e){return Dr(cl,e)}var ll=v("ZodE164",(e,t)=>{ma.init(e,t),q.init(e,t)});function Yy(e){return $r(ll,e)}var ul=v("ZodJWT",(e,t)=>{ga.init(e,t),q.init(e,t)});function Qy(e){return Cr(ul,e)}var gp=v("ZodCustomStringFormat",(e,t)=>{fa.init(e,t),q.init(e,t)});function eb(e,t,o={}){return Oc(gp,e,t,o)}var no=v("ZodNumber",(e,t)=>{Xo.init(e,t),N.init(e,t),e.gt=(r,n)=>e.check(He(r,n)),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.lt=(r,n)=>e.check(We(r,n)),e.lte=(r,n)=>e.check(Se(r,n)),e.max=(r,n)=>e.check(Se(r,n)),e.int=r=>e.check(Wc(r)),e.safe=r=>e.check(Wc(r)),e.positive=r=>e.check(He(0,r)),e.nonnegative=r=>e.check(ge(0,r)),e.negative=r=>e.check(We(0,r)),e.nonpositive=r=>e.check(Se(0,r)),e.multipleOf=(r,n)=>e.check(bt(r,n)),e.step=(r,n)=>e.check(bt(r,n)),e.finite=()=>e;let o=e._zod.bag;e.minValue=Math.max(o.minimum??Number.NEGATIVE_INFINITY,o.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(o.maximum??Number.POSITIVE_INFINITY,o.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(o.format??"").includes("int")||Number.isSafeInteger(o.multipleOf??.5),e.isFinite=!0,e.format=o.format??null});function fp(e){return nc(no,e)}var Yt=v("ZodNumberFormat",(e,t)=>{ha.init(e,t),no.init(e,t)});function Wc(e){return rc(Yt,e)}function tb(e){return ic(Yt,e)}function nb(e){return sc(Yt,e)}function ob(e){return ac(Yt,e)}function rb(e){return cc(Yt,e)}var oo=v("ZodBoolean",(e,t)=>{On.init(e,t),N.init(e,t)});function hp(e){return lc(oo,e)}var ro=v("ZodBigInt",(e,t)=>{Yo.init(e,t),N.init(e,t),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.gt=(r,n)=>e.check(He(r,n)),e.gte=(r,n)=>e.check(ge(r,n)),e.min=(r,n)=>e.check(ge(r,n)),e.lt=(r,n)=>e.check(We(r,n)),e.lte=(r,n)=>e.check(Se(r,n)),e.max=(r,n)=>e.check(Se(r,n)),e.positive=r=>e.check(He(BigInt(0),r)),e.negative=r=>e.check(We(BigInt(0),r)),e.nonpositive=r=>e.check(Se(BigInt(0),r)),e.nonnegative=r=>e.check(ge(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(bt(r,n));let o=e._zod.bag;e.minValue=o.minimum??null,e.maxValue=o.maximum??null,e.format=o.format??null});function ib(e){return dc(ro,e)}var dl=v("ZodBigIntFormat",(e,t)=>{va.init(e,t),ro.init(e,t)});function sb(e){return mc(dl,e)}function ab(e){return gc(dl,e)}var vp=v("ZodSymbol",(e,t)=>{ya.init(e,t),N.init(e,t)});function cb(e){return fc(vp,e)}var yp=v("ZodUndefined",(e,t)=>{ba.init(e,t),N.init(e,t)});function lb(e){return hc(yp,e)}var bp=v("ZodNull",(e,t)=>{Da.init(e,t),N.init(e,t)});function Dp(e){return vc(bp,e)}var $p=v("ZodAny",(e,t)=>{$a.init(e,t),N.init(e,t)});function ub(){return yc($p)}var Cp=v("ZodUnknown",(e,t)=>{Gt.init(e,t),N.init(e,t)});function Ir(){return Ht(Cp)}var kp=v("ZodNever",(e,t)=>{Ca.init(e,t),N.init(e,t)});function Or(e){return bc(kp,e)}var wp=v("ZodVoid",(e,t)=>{ka.init(e,t),N.init(e,t)});function db(e){return Dc(wp,e)}var Mr=v("ZodDate",(e,t)=>{wa.init(e,t),N.init(e,t),e.min=(r,n)=>e.check(ge(r,n)),e.max=(r,n)=>e.check(Se(r,n));let o=e._zod.bag;e.minDate=o.minimum?new Date(o.minimum):null,e.maxDate=o.maximum?new Date(o.maximum):null});function pb(e){return $c(Mr,e)}var xp=v("ZodArray",(e,t)=>{Mn.init(e,t),N.init(e,t),e.element=t.element,e.min=(o,r)=>e.check(it(o,r)),e.nonempty=o=>e.check(it(1,o)),e.max=(o,r)=>e.check(Kt(o,r)),e.length=(o,r)=>e.check(Jt(o,r)),e.unwrap=()=>e.element});function pl(e,t){return Yn(xp,e,t)}function mb(e){let t=e._zod.def.shape;return Mp(Object.keys(t))}var zr=v("ZodObject",(e,t)=>{xa.init(e,t),N.init(e,t),_.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Tp(Object.keys(e._zod.def.shape)),e.catchall=o=>e.clone({...e._zod.def,catchall:o}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ir()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ir()}),e.strict=()=>e.clone({...e._zod.def,catchall:Or()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=o=>_.extend(e,o),e.merge=o=>_.merge(e,o),e.pick=o=>_.pick(e,o),e.omit=o=>_.omit(e,o),e.partial=(...o)=>_.partial(vl,e,o[0]),e.required=(...o)=>_.required(yl,e,o[0])});function gb(e,t){let o={type:"object",get shape(){return _.assignProp(this,"shape",{...e}),this.shape},..._.normalizeParams(t)};return new zr(o)}function fb(e,t){return new zr({type:"object",get shape(){return _.assignProp(this,"shape",{...e}),this.shape},catchall:Or(),..._.normalizeParams(t)})}function hb(e,t){return new zr({type:"object",get shape(){return _.assignProp(this,"shape",{...e}),this.shape},catchall:Ir(),..._.normalizeParams(t)})}var ml=v("ZodUnion",(e,t)=>{Qo.init(e,t),N.init(e,t),e.options=t.options});function jr(e,t){return new ml({type:"union",options:e,..._.normalizeParams(t)})}var Sp=v("ZodDiscriminatedUnion",(e,t)=>{ml.init(e,t),Sa.init(e,t)});function vb(e,t,o){return new Sp({type:"union",options:t,discriminator:e,..._.normalizeParams(o)})}var _p=v("ZodIntersection",(e,t)=>{_a.init(e,t),N.init(e,t)});function Pp(e,t){return new _p({type:"intersection",left:e,right:t})}var Ep=v("ZodTuple",(e,t)=>{yt.init(e,t),N.init(e,t),e.rest=o=>e.clone({...e._zod.def,rest:o})});function yb(e,t,o){let r=t instanceof O,n=r?o:t,i=r?t:null;return new Ep({type:"tuple",items:e,rest:i,..._.normalizeParams(n)})}var gl=v("ZodRecord",(e,t)=>{Pa.init(e,t),N.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Ip(e,t,o){return new gl({type:"record",keyType:e,valueType:t,..._.normalizeParams(o)})}function bb(e,t,o){return new gl({type:"record",keyType:jr([e,Or()]),valueType:t,..._.normalizeParams(o)})}var Fp=v("ZodMap",(e,t)=>{Ea.init(e,t),N.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function Db(e,t,o){return new Fp({type:"map",keyType:e,valueType:t,..._.normalizeParams(o)})}var Ap=v("ZodSet",(e,t)=>{Ia.init(e,t),N.init(e,t),e.min=(...o)=>e.check(Dt(...o)),e.nonempty=o=>e.check(Dt(1,o)),e.max=(...o)=>e.check(qt(...o)),e.size=(...o)=>e.check(Un(...o))});function $b(e,t){return new Ap({type:"set",valueType:e,..._.normalizeParams(t)})}var eo=v("ZodEnum",(e,t)=>{Fa.init(e,t),N.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let o=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let i={};for(let s of r)if(o.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new eo({...t,checks:[],..._.normalizeParams(n),entries:i})},e.exclude=(r,n)=>{let i={...t.entries};for(let s of r)if(o.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new eo({...t,checks:[],..._.normalizeParams(n),entries:i})}});function Tp(e,t){let o=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new eo({type:"enum",entries:o,..._.normalizeParams(t)})}function Cb(e,t){return new eo({type:"enum",entries:e,..._.normalizeParams(t)})}var Op=v("ZodLiteral",(e,t)=>{Aa.init(e,t),N.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Mp(e,t){return new Op({type:"literal",values:Array.isArray(e)?e:[e],..._.normalizeParams(t)})}var zp=v("ZodFile",(e,t)=>{Ta.init(e,t),N.init(e,t),e.min=(o,r)=>e.check(Dt(o,r)),e.max=(o,r)=>e.check(qt(o,r)),e.mime=(o,r)=>e.check(Hn(Array.isArray(o)?o:[o],r))});function kb(e){return Ic(zp,e)}var fl=v("ZodTransform",(e,t)=>{zn.init(e,t),N.init(e,t),e._zod.parse=(o,r)=>{o.addIssue=i=>{if(typeof i=="string")o.issues.push(_.issue(i,o.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=o.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),o.issues.push(_.issue(s))}};let n=t.transform(o.value,o);return n instanceof Promise?n.then(i=>(o.value=i,o)):(o.value=n,o)}});function hl(e){return new fl({type:"transform",transform:e})}var vl=v("ZodOptional",(e,t)=>{Oa.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Fr(e){return new vl({type:"optional",innerType:e})}var jp=v("ZodNullable",(e,t)=>{Ma.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Ar(e){return new jp({type:"nullable",innerType:e})}function wb(e){return Fr(Ar(e))}var Np=v("ZodDefault",(e,t)=>{za.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Lp(e,t){return new Np({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var Up=v("ZodPrefault",(e,t)=>{ja.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bp(e,t){return new Up({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}var yl=v("ZodNonOptional",(e,t)=>{Na.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Rp(e,t){return new yl({type:"nonoptional",innerType:e,..._.normalizeParams(t)})}var Zp=v("ZodSuccess",(e,t)=>{La.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xb(e){return new Zp({type:"success",innerType:e})}var Vp=v("ZodCatch",(e,t)=>{Ua.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Gp(e,t){return new Vp({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var Wp=v("ZodNaN",(e,t)=>{Ba.init(e,t),N.init(e,t)});function Sb(e){return kc(Wp,e)}var bl=v("ZodPipe",(e,t)=>{jn.init(e,t),N.init(e,t),e.in=t.in,e.out=t.out});function Tr(e,t){return new bl({type:"pipe",in:e,out:t})}var Hp=v("ZodReadonly",(e,t)=>{Ra.init(e,t),N.init(e,t)});function qp(e){return new Hp({type:"readonly",innerType:e})}var Kp=v("ZodTemplateLiteral",(e,t)=>{Za.init(e,t),N.init(e,t)});function _b(e,t){return new Kp({type:"template_literal",parts:e,..._.normalizeParams(t)})}var Jp=v("ZodLazy",(e,t)=>{Ga.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.getter()});function Xp(e){return new Jp({type:"lazy",getter:e})}var Yp=v("ZodPromise",(e,t)=>{Va.init(e,t),N.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Pb(e){return new Yp({type:"promise",innerType:e})}var Nr=v("ZodCustom",(e,t)=>{Wa.init(e,t),N.init(e,t)});function Qp(e){let t=new te({check:"custom"});return t._zod.check=e,t}function Eb(e,t){return Fc(Nr,e??(()=>!0),t)}function em(e,t={}){return Ac(Nr,e,t)}function tm(e){let t=Qp(o=>(o.addIssue=r=>{if(typeof r=="string")o.issues.push(_.issue(r,o.value,t._zod.def));else{let n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=o.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),o.issues.push(_.issue(n))}},e(o.value,o)));return t}function Ib(e,t={error:`Input not instance of ${e.name}`}){let o=new Nr({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,..._.normalizeParams(t)});return o._zod.bag.Class=e,o}var Fb=(...e)=>Tc({Pipe:bl,Boolean:oo,String:to,Transform:fl},...e);function Ab(e){let t=Xp(()=>jr([Gc(e),fp(),hp(),Dp(),pl(t),Ip(Gc(),t)]));return t}function Tb(e,t){return Tr(hl(e),t)}var Ob={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 Mb(e){re({customError:e})}function zb(){return re().customError}var Dl={};pt(Dl,{bigint:()=>Ub,boolean:()=>Lb,date:()=>Bb,number:()=>Nb,string:()=>jb});function jb(e){return Ja(to,e)}function Nb(e){return oc(no,e)}function Lb(e){return uc(oo,e)}function Ub(e){return pc(ro,e)}function Bb(e){return Cc(Mr,e)}re(er());function Qt(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}var Rb="0.0.0-development",Zb=`octokit-endpoint.js/${Rb} ${Qt()}`,Vb={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Zb},mediaType:{format:""}};function Gb(e){return e?Object.keys(e).reduce((t,o)=>(t[o.toLowerCase()]=e[o],t),{}):{}}function Wb(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}function rm(e,t){let o=Object.assign({},e);return Object.keys(t).forEach(r=>{Wb(t[r])?r in e?o[r]=rm(e[r],t[r]):Object.assign(o,{[r]:t[r]}):Object.assign(o,{[r]:t[r]})}),o}function nm(e){for(let t in e)e[t]===void 0&&delete e[t];return e}function Cl(e,t,o){if(typeof t=="string"){let[n,i]=t.split(" ");o=Object.assign(i?{method:n,url:i}:{url:n},o)}else o=Object.assign({},t);o.headers=Gb(o.headers),nm(o),nm(o.headers);let r=rm(e||{},o);return o.url==="/graphql"&&(e&&e.mediaType.previews?.length&&(r.mediaType.previews=e.mediaType.previews.filter(n=>!r.mediaType.previews.includes(n)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(n=>n.replace(/-preview/,""))),r}function Hb(e,t){let o=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+o+r.map(n=>n==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${n}=${encodeURIComponent(t[n])}`).join("&")}var qb=/\{[^{}}]+\}/g;function Kb(e){return e.replace(/(?:^\W+)|(?:(?<!\W)\W+$)/g,"").split(/,/)}function Jb(e){let t=e.match(qb);return t?t.map(Kb).reduce((o,r)=>o.concat(r),[]):[]}function om(e,t){let o={__proto__:null};for(let r of Object.keys(e))t.indexOf(r)===-1&&(o[r]=e[r]);return o}function im(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function tn(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function io(e,t,o){return t=e==="+"||e==="#"?im(t):tn(t),o?tn(o)+"="+t:t}function en(e){return e!=null}function $l(e){return e===";"||e==="&"||e==="?"}function Xb(e,t,o,r){var n=e[o],i=[];if(en(n)&&n!=="")if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")n=n.toString(),r&&r!=="*"&&(n=n.substring(0,parseInt(r,10))),i.push(io(t,n,$l(t)?o:""));else if(r==="*")Array.isArray(n)?n.filter(en).forEach(function(s){i.push(io(t,s,$l(t)?o:""))}):Object.keys(n).forEach(function(s){en(n[s])&&i.push(io(t,n[s],s))});else{let s=[];Array.isArray(n)?n.filter(en).forEach(function(c){s.push(io(t,c))}):Object.keys(n).forEach(function(c){en(n[c])&&(s.push(tn(c)),s.push(io(t,n[c].toString())))}),$l(t)?i.push(tn(o)+"="+s.join(",")):s.length!==0&&i.push(s.join(","))}else t===";"?en(n)&&i.push(tn(o)):n===""&&(t==="&"||t==="?")?i.push(tn(o)+"="):n===""&&i.push("");return i}function Yb(e){return{expand:Qb.bind(null,e)}}function Qb(e,t){var o=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,n,i){if(n){let c="",u=[];if(o.indexOf(n.charAt(0))!==-1&&(c=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(p){var d=/([^:\*]*)(?::(\d+)|(\*))?/.exec(p);u.push(Xb(t,c,d[1],d[2]||d[3]))}),c&&c!=="+"){var s=",";return c==="?"?s="&":c!=="#"&&(s=c),(u.length!==0?c:"")+u.join(s)}else return u.join(",")}else return im(i)}),e==="/"?e:e.replace(/\/$/,"")}function sm(e){let t=e.method.toUpperCase(),o=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),n,i=om(e,["method","baseUrl","url","headers","request","mediaType"]),s=Jb(o);o=Yb(o).expand(i),/^http/.test(o)||(o=e.baseUrl+o);let c=Object.keys(e).filter(d=>s.includes(d)).concat("baseUrl"),u=om(i,c);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(d=>d.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),o.endsWith("/graphql")&&e.mediaType.previews?.length)){let d=r.accept.match(/(?<![\w-])[\w-]+(?=-preview)/g)||[];r.accept=d.concat(e.mediaType.previews).map(m=>{let h=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${m}-preview${h}`}).join(",")}return["GET","HEAD"].includes(t)?o=Hb(o,u):"data"in u?n=u.data:Object.keys(u).length&&(n=u),!r["content-type"]&&typeof n<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof n>"u"&&(n=""),Object.assign({method:t,url:o,headers:r},typeof n<"u"?{body:n}:null,e.request?{request:e.request}:null)}function eD(e,t,o){return sm(Cl(e,t,o))}function am(e,t){let o=Cl(e,t),r=eD.bind(null,o);return Object.assign(r,{DEFAULTS:o,defaults:am.bind(null,o),merge:Cl.bind(null,o),parse:sm})}var cm=am(null,Vb);var fm=No(pm(),1);var Xe=class extends Error{name;status;request;response;constructor(t,o,r){super(t,{cause:r.cause}),this.name="HttpError",this.status=Number.parseInt(o),Number.isNaN(this.status)&&(this.status=0);"response"in r&&(this.response=r.response);let n=Object.assign({},r.request);r.request.headers.authorization&&(n.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/(?<! ) .*$/," [REDACTED]")})),n.url=n.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=n}};var tD="10.0.7",nD={headers:{"user-agent":`octokit-request.js/${tD} ${Qt()}`}};function oD(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);if(t===null)return!0;let o=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof o=="function"&&o instanceof o&&Function.prototype.call(o)===Function.prototype.call(e)}var mm=()=>"";async function gm(e){let t=e.request?.fetch||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");let o=e.request?.log||console,r=e.request?.parseSuccessResponseBody!==!1,n=oD(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,i=Object.fromEntries(Object.entries(e.headers).map(([m,h])=>[m,String(h)])),s;try{s=await t(e.url,{method:e.method,body:n,redirect:e.request?.redirect,headers:i,signal:e.request?.signal,...e.body&&{duplex:"half"}})}catch(m){let h="Unknown Error";if(m instanceof Error){if(m.name==="AbortError")throw m.status=500,m;h=m.message,m.name==="TypeError"&&"cause"in m&&(m.cause instanceof Error?h=m.cause.message:typeof m.cause=="string"&&(h=m.cause))}let y=new Xe(h,500,{request:e});throw y.cause=m,y}let c=s.status,u=s.url,p={};for(let[m,h]of s.headers)p[m]=h;let d={url:u,status:c,headers:p,data:""};if("deprecation"in p){let m=p.link&&p.link.match(/<([^<>]+)>; rel="deprecation"/),h=m&&m.pop();o.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${p.sunset}${h?`. See ${h}`:""}`)}if(c===204||c===205)return d;if(e.method==="HEAD"){if(c<400)return d;throw new Xe(s.statusText,c,{response:d,request:e})}if(c===304)throw d.data=await kl(s),new Xe("Not modified",c,{response:d,request:e});if(c>=400)throw d.data=await kl(s),new Xe(iD(d.data),c,{response:d,request:e});return d.data=r?await kl(s):s.body,d}async function kl(e){let t=e.headers.get("content-type");if(!t)return e.text().catch(mm);let o=(0,fm.safeParse)(t);if(rD(o)){let r="";try{return r=await e.text(),JSON.parse(r)}catch{return r}}else return o.type.startsWith("text/")||o.parameters.charset?.toLowerCase()==="utf-8"?e.text().catch(mm):e.arrayBuffer().catch(()=>new ArrayBuffer(0))}function rD(e){return e.type==="application/json"||e.type==="application/scim+json"}function iD(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){let t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(o=>JSON.stringify(o)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function wl(e,t){let o=e.defaults(t);return Object.assign(function(n,i){let s=o.merge(n,i);if(!s.request||!s.request.hook)return gm(o.parse(s));let c=(u,p)=>gm(o.parse(o.merge(u,p)));return Object.assign(c,{endpoint:o,defaults:wl.bind(null,o)}),s.request.hook(c,s)},{endpoint:o,defaults:wl.bind(null,o)})}var le=wl(cm,nD);function sD(e){let t=e.endpoint.DEFAULTS;return/^https:\/\/(api\.)?github\.com$/.test(t.baseUrl)?"https://github.com":t.baseUrl.replace("/api/v3","")}async function xl(e,t,o){let r={baseUrl:sD(e),headers:{accept:"application/json"},...o},n=await e(t,r);if("error"in n.data){let i=new Xe(`${n.data.error_description} (${n.data.error}, ${n.data.error_uri})`,400,{request:e.endpoint.merge(t,r)});throw i.response=n,i}return n}async function ym(e){let t=e.request||le,o={client_id:e.clientId};return"scopes"in e&&Array.isArray(e.scopes)&&(o.scope=e.scopes.join(" ")),xl(t,"POST /login/device/code",o)}async function Sl(e){let t=e.request||le,o=await xl(t,"POST /login/oauth/access_token",{client_id:e.clientId,device_code:e.code,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),r={clientType:e.clientType,clientId:e.clientId,token:o.data.access_token,scopes:o.data.scope.split(/\s+/).filter(Boolean)};if("clientSecret"in e&&(r.clientSecret=e.clientSecret),e.clientType==="github-app"){if("refresh_token"in o.data){let n=new Date(o.headers.date).getTime();r.refreshToken=o.data.refresh_token,r.expiresAt=hm(n,o.data.expires_in),r.refreshTokenExpiresAt=hm(n,o.data.refresh_token_expires_in)}delete r.scopes}return{...o,authentication:r}}function hm(e,t){return new Date(e+t*1e3).toISOString()}async function bm(e){let t=e.request||le,o=await xl(t,"POST /login/oauth/access_token",{client_id:e.clientId,client_secret:e.clientSecret,grant_type:"refresh_token",refresh_token:e.refreshToken}),r=new Date(o.headers.date).getTime(),n={clientType:"github-app",clientId:e.clientId,clientSecret:e.clientSecret,token:o.data.access_token,refreshToken:o.data.refresh_token,expiresAt:vm(r,o.data.expires_in),refreshTokenExpiresAt:vm(r,o.data.refresh_token_expires_in)};return{...o,authentication:n}}function vm(e,t){return new Date(e+t*1e3).toISOString()}async function Dm(e){let t=e.request||le,o=btoa(`${e.clientId}:${e.clientSecret}`);return t("DELETE /applications/{client_id}/token",{headers:{authorization:`basic ${o}`},client_id:e.clientId,access_token:e.token})}import{randomUUID as R0}from"node:crypto";import{existsSync as V0,readFileSync as G0,writeFileSync as W0,unlinkSync as H0,renameSync as q0}from"node:fs";import{existsSync as e_,readFileSync as t_}from"node:fs";import{existsSync as ZD,readdirSync as VD,lstatSync as GD}from"node:fs";import{join as WD}from"node:path";var aD=null;function cD(e){let t=`[${e.module}]`,o=e.data&&Object.keys(e.data).length>0?` ${JSON.stringify(e.data)}`:"";process.stderr.write(`${t} ${e.level}: ${e.message}${o}
37
+ `)}function Zr(e){function t(o,r,n){let i={level:o,module:e,message:r,...n&&{data:n}};(aD??cD)(i)}return{debug:(o,r)=>t("debug",o,r),info:(o,r)=>t("info",o,r),warn:(o,r)=>t("warn",o,r),error:(o,r)=>t("error",o,r)}}function at(e){return e.toLowerCase().replace(/^https?:\/\//,"").replace(/\/$/,"")}function kt(e){if(!e.token.expiresAt)return!1;let t=new Date(e.token.expiresAt);if(isNaN(t.getTime()))return!0;let o=new Date;return t.getTime()-o.getTime()<300*1e3}function km(e){if(!e.token.refreshTokenExpiresAt)return!1;let t=new Date(e.token.refreshTokenExpiresAt);return isNaN(t.getTime())?!0:new Date>=t}var ao=new Map,lD=300*1e3;function uD(e){let t=at(e),o=ao.get(t);return!o||Date.now()-o.cachedAt>=lD?!1:o.credentials?!kt(o.credentials):!0}function wm(e){e?ao.delete(at(e)):ao.clear()}function dD(e){let t=at(e);if(uD(t))return ao.get(t).credentials}function pD(e,t){let o=at(e);ao.set(o,{credentials:t,cachedAt:Date.now()})}var X=Vr.platform()==="win32",Ne=Vr.platform()==="darwin",z0=Vr.platform()==="linux",H=Vr.homedir();function De(){return X?process.env.APPDATA||bD.join(H,"AppData","Roaming"):H}var DD=Qe(H,".octocode"),$D=448,Ye=process.env.OCTOCODE_HOME||DD,fe={home:Ye,config:Qe(Ye,".octocoderc"),credentials:Qe(Ye,"credentials.json"),key:Qe(Ye,".key"),session:Qe(Ye,"session.json"),repos:Qe(Ye,"repos"),logs:Qe(Ye,"logs"),cliConfig:Qe(Ye,"config.json"),lspConfig:Qe(Ye,"lsp-servers.json")};function CD(){vD(fe.home)||yD(fe.home,{recursive:!0,mode:$D})}var kD=E.object({token:E.string(),tokenType:E.literal("oauth"),scopes:E.array(E.string()).optional(),refreshToken:E.string().optional(),expiresAt:E.string().optional(),refreshTokenExpiresAt:E.string().optional()}),wD=E.object({hostname:E.string(),username:E.string(),token:kD,gitProtocol:E.enum(["ssh","https"]),createdAt:E.string(),updatedAt:E.string()}),xD=E.object({version:E.number(),credentials:E.record(E.string(),wD)}),Cm=Zr("token-storage");function SD(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}var N0=fe.home,st=fe.credentials,Ct=fe.key,Pm="aes-256-gcm",_D=16;function Pl(){CD()}function Em(){if(Pl(),Rr(Ct))return mD(Ct).mode&511&63&&gD(Ct,384),Buffer.from(xm(Ct,"utf8"),"hex");let e=_m(32);return Sm(Ct,e.toString("hex"),{mode:384}),e}function PD(e){let t=Em(),o=_m(_D),r=fD(Pm,t,o),n=r.update(e,"utf8","hex");n+=r.final("hex");let i=r.getAuthTag();return`${o.toString("hex")}:${i.toString("hex")}:${n}`}function ED(e){let t=Em(),[o,r,n]=e.split(":");if(!o||!r||!n)throw new Error("Invalid encrypted data format");let i=Buffer.from(o,"hex"),s=Buffer.from(r,"hex"),c=hD(Pm,t,i);c.setAuthTag(s);let u=c.update(n,"hex","utf8");return u+=c.final("utf8"),u}function Gr(){if(Pl(),!Rr(st))return{version:1,credentials:{}};try{let e=xm(st,"utf8"),t=ED(e),o=JSON.parse(t),r=xD.safeParse(o);return r.success?r.data:(Cm.warn("Credentials file has invalid format \u2014 starting fresh",{file:st}),{version:1,credentials:{}})}catch(e){let t=e instanceof Error&&e.message?SD(e.message):void 0;return Cm.warn("Could not read credentials file \u2014 you may need to login again",{file:st,...t&&{reason:t}}),{version:1,credentials:{}}}}function Im(e){Pl();let t=PD(JSON.stringify(e,null,2));Sm(st,t,{mode:384})}function ID(){try{Rr(st)&&$m(st),Rr(Ct)&&$m(Ct)}catch{}}var Fm="178c6fc778ccc68e1d6a",El="github.com";function FD(e){return e.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}function AD(e){return e==="github.com"||e===El?"https://api.github.com":`https://${e}/api/v3`}async function TD(e,t=El,o=Fm){let r=await e.getCredentials(t);if(!r)return{success:!1,error:`Not logged in to ${t}`};if(!r.token.refreshToken)return{success:!1,error:"Token does not support refresh (OAuth App tokens do not expire)"};if(km(r))return{success:!1,error:"Refresh token has expired. Please login again."};try{let n=await bm({clientType:"github-app",clientId:o,clientSecret:"",refreshToken:r.token.refreshToken,request:le.defaults({baseUrl:AD(t)})}),i={token:n.authentication.token,tokenType:"oauth",refreshToken:n.authentication.refreshToken,expiresAt:n.authentication.expiresAt,refreshTokenExpiresAt:n.authentication.refreshTokenExpiresAt};return await e.updateToken(t,i),{success:!0,username:r.username,hostname:t}}catch(n){return{success:!1,error:n instanceof Error?FD(n.message):"Token refresh failed"}}}async function OD(e,t=El,o=Fm){let r=await e.getCredentials(t);if(!r||!r.token)return{token:null,source:"none"};if(!kt(r))return{token:r.token.token,source:"stored",username:r.username};if(r.token.refreshToken){let n=await TD(e,t,o);if(n.success){let i=await e.getCredentials(t);if(i?.token.token)return{token:i.token.token,source:"refreshed",username:i.username}}return{token:null,source:"none",refreshError:n.error}}return{token:null,source:"none",refreshError:"Token expired and no refresh token available"}}var Am=["OCTOCODE_TOKEN","GH_TOKEN","GITHUB_TOKEN"];function Tm(){for(let e of Am){let t=process.env[e];if(t&&t.trim())return t.trim()}return null}function co(){for(let e of Am){let t=process.env[e];if(t&&t.trim())return`env:${e}`}return null}function nn(){return Tm()!==null}var MD="178c6fc778ccc68e1d6a",zD="github.com",_l=null;function jD(e){_l=e}function ND(){if(!_l)throw new Error("Token resolution not initialized. Call initTokenResolution() first.");return _l}async function Il(e){let t=e?.hostname??zD,o=e?.clientId??MD,r=e?.getGhCliToken,n=Tm();if(n)return{token:n,source:co()??"env:GITHUB_TOKEN",wasRefreshed:!1};let i=await ND().getTokenWithRefresh(t,o);if(i.token)return{token:i.token,source:"file",wasRefreshed:i.source==="refreshed",username:i.username};let s=i.refreshError;if(r)try{let c=await Promise.resolve(r(t));if(c?.trim())return{token:c.trim(),source:"gh-cli",wasRefreshed:!1,refreshError:s}}catch{}return s?{token:"",source:null,wasRefreshed:!1,refreshError:s}:null}var LD=Zr("token-storage");async function Wr(e){let t=at(e.hostname),o={...e,hostname:t,updatedAt:new Date().toISOString()};try{let r=Gr();return r.credentials[t]=o,Im(r),wm(t),{success:!0}}catch(r){let n=r instanceof Error?r.message:String(r);throw LD.error("CRITICAL: Storage failed",{error:n.replace(/\b(ghp_|gho_|ghu_|ghs_|ghr_)[a-zA-Z0-9]{36,}\b/g,"***MASKED***").replace(/\b[a-zA-Z0-9]{40,}\b/g,"***MASKED***")}),new Error("Failed to store credentials")}}async function et(e="github.com",t){let o=at(e);if(!t?.bypassCache){let i=dD(o);if(i!==void 0)return i}let n=Gr().credentials[o]||null;return pD(o,n),n}function Fl(e="github.com"){let t=at(e);return Gr().credentials[t]||null}async function Al(e="github.com"){let t=at(e),o=!1,r=Gr();return r.credentials[t]&&(delete r.credentials[t],Object.keys(r.credentials).length===0?ID():Im(r),o=!0),wm(t),{success:o,deletedFromFile:o}}async function UD(e,t){let o=await et(e);return o?(o.token=t,o.updatedAt=new Date().toISOString(),await Wr(o),!0):!1}function Tl(){return st}async function BD(e="github.com"){let t=await et(e);return!t||!t.token||kt(t)?null:t.token.token}async function Hr(e,t){return OD({getCredentials:et,updateToken:UD},e,t)}jD({getToken:BD,getTokenWithRefresh:Hr});var RD=E.object({toolCalls:E.number(),promptCalls:E.number(),errors:E.number(),rateLimits:E.number()}),J0=E.object({version:E.literal(1),sessionId:E.string(),createdAt:E.string(),lastActiveAt:E.string(),stats:RD}),X0=Zr("session"),Y0=fe.session;var o_=E.object({$schema:E.string().optional(),version:E.number().int().optional(),github:E.record(E.string(),E.unknown()).optional(),gitlab:E.record(E.string(),E.unknown()).optional(),bitbucket:E.record(E.string(),E.unknown()).optional(),local:E.record(E.string(),E.unknown()).optional(),tools:E.record(E.string(),E.unknown()).optional(),network:E.record(E.string(),E.unknown()).optional(),telemetry:E.record(E.string(),E.unknown()).optional(),lsp:E.record(E.string(),E.unknown()).optional(),output:E.record(E.string(),E.unknown()).optional()}).passthrough(),r_=fe.config;var i_=Zr("octocode-config");function ct(e){if(!ZD(e))return 0;let t=0,o=[e];for(;o.length>0;){let r=o.pop(),n;try{n=VD(r)}catch{continue}for(let i of n){let s=WD(r,i);try{let c=GD(s);if(c.isSymbolicLink())continue;c.isDirectory()?o.push(s):c.isFile()&&(t+=c.size)}catch{}}}return t}function on(e){if(e<1024)return`${e} B`;let t=e/1024;if(t<1024)return`${t.toFixed(1)} KB`;let o=t/1024;return o<1024?`${o.toFixed(1)} MB`:`${(o/1024).toFixed(2)} GB`}function qr(){process.stdout.write("\x1B[2J\x1B[3J\x1B[H")}function Ol(e,t){try{let o,r;return t?(o=t,r=[e]):Ne?(o="open",r=[e]):X?(o="cmd",r=["/c","start",'""',e]):(o="xdg-open",r=[e]),HD(o,r,{stdio:"ignore",shell:X&&!t}).status===0}catch{return!1}}function Om(e,t){switch(t){case"cursor":return Ol(e,"cursor");case"vscode":return Ol(e,"code");default:return Ol(e)}}var $e=(e,t=[])=>e.name==="up"||t.includes("vim")&&e.name==="k"||t.includes("emacs")&&e.ctrl&&e.name==="p",Le=(e,t=[])=>e.name==="down"||t.includes("vim")&&e.name==="j"||t.includes("emacs")&&e.ctrl&&e.name==="n",Ml=e=>e.name==="space",lo=e=>e.name==="backspace",wt=e=>e.name==="tab",uo=e=>"1234567890".includes(e.name),Ee=e=>e.name==="enter"||e.name==="return";var Kr=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(t){super(),this.cause=t?.cause}},Jr=class extends Error{name="CancelPromptError";message="Prompt was canceled"},po=class extends Error{name="ExitPromptError"},Xr=class extends Error{name="HookError"},lt=class extends Error{name="ValidationError"};import{AsyncResource as XD}from"node:async_hooks";import{AsyncLocalStorage as qD,AsyncResource as KD}from"node:async_hooks";var Mm=new qD;function JD(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function zm(e,t){let o=JD(e);return Mm.run(o,()=>{function r(n){o.handleChange=()=>{o.index=0,n()},o.handleChange()}return t(r)})}function xt(){let e=Mm.getStore();if(!e)throw new Xr("[Inquirer] Hook functions can only be called from within a prompt");return e}function zl(){return xt().rl}function jl(e){let t=(...o)=>{let r=xt(),n=!1,i=r.handleChange;r.handleChange=()=>{n=!0};let s=e(...o);return n&&i(),r.handleChange=i,s};return KD.bind(t)}function rn(e){let t=xt(),{index:o}=t,r={get(){return t.hooks[o]},set(i){t.hooks[o]=i},initialized:o in t.hooks},n=e(r);return t.index++,n}function jm(){xt().handleChange()}var St={queue(e){let t=xt(),{index:o}=t;t.hooksEffect.push(()=>{t.hooksCleanup[o]?.();let r=e(zl());if(r!=null&&typeof r!="function")throw new lt("useEffect return value must be a cleanup function or nothing.");t.hooksCleanup[o]=r})},run(){let e=xt();jl(()=>{e.hooksEffect.forEach(t=>{t()}),e.hooksEffect.length=0})()},clearAll(){let e=xt();e.hooksCleanup.forEach(t=>{t?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function G(e){return rn(t=>{let o=XD.bind(function(i){t.get()!==i&&(t.set(i),jm())});if(t.initialized)return[t.get(),o];let r=typeof e=="function"?e():e;return t.set(r),[r,o]})}function Ie(e,t){rn(o=>{let r=o.get();(!Array.isArray(r)||t.some((i,s)=>!Object.is(i,r[s])))&&St.queue(e),o.set(t)})}import{styleText as Fe}from"node:util";import Ue from"node:process";function YD(){return Ue.platform!=="win32"?Ue.env.TERM!=="linux":!!Ue.env.WT_SESSION||!!Ue.env.TERMINUS_SUBLIME||Ue.env.ConEmuTask==="{cmd::Cmder}"||Ue.env.TERM_PROGRAM==="Terminus-Sublime"||Ue.env.TERM_PROGRAM==="vscode"||Ue.env.TERM==="xterm-256color"||Ue.env.TERM==="alacritty"||Ue.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Nm={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Lm={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},QD={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},e$={...Nm,...Lm},t$={...Nm,...QD},n$=YD(),o$=n$?e$:t$,_e=o$,P_=Object.entries(Lm);var Um={prefix:{idle:Fe("blue","?"),done:Fe("green",_e.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(e=>Fe("yellow",e))},style:{answer:e=>Fe("cyan",e),message:e=>Fe("bold",e),error:e=>Fe("red",`> ${e}`),defaultAnswer:e=>Fe("dim",`(${e})`),help:e=>Fe("dim",e),highlight:e=>Fe("cyan",e),key:e=>Fe("cyan",Fe("bold",`<${e}>`))}};function Bm(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Rm(...e){let t={};for(let o of e)for(let[r,n]of Object.entries(o)){let i=t[r];t[r]=Bm(i)&&Bm(n)?Rm(i,n):n}return t}function Ce(...e){let t=[Um,...e.filter(o=>o!=null)];return Rm(...t)}function Ae({status:e="idle",theme:t}){let[o,r]=G(!1),[n,i]=G(0),{prefix:s,spinner:c}=Ce(t);return Ie(()=>{if(e==="loading"){let p,d=-1,m=setTimeout(()=>{r(!0),p=setInterval(()=>{d=d+1,i(d%c.frames.length)},c.interval)},300);return()=>{clearTimeout(m),clearInterval(p)}}else r(!1)},[e]),o?c.frames[n]:typeof s=="string"?s:s[e==="loading"?"idle":e]??s.idle}function tt(e,t){return rn(o=>{let r=o.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((n,i)=>n!==t[i])){let n=e();return o.set({value:n,dependencies:t}),n}return r.value})}function _t(e){return G({current:e})[0]}function Te(e){let t=_t(e);t.current=e,Ie(o=>{let r=!1,n=jl((i,s)=>{r||t.current(s,o)});return o.input.on("keypress",n),()=>{r=!0,o.input.removeListener("keypress",n)}},[])}var sg=No(Vm(),1);function Nl({onlyFirst:e=!1}={}){let n="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(n,e?void 0:"g")}var s$=Nl();function mo(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(s$,"")}function Gm(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function Wm(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Hm(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function a$(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function qm(e,{ambiguousAsWide:t=!1}={}){return a$(e),Wm(e)||Hm(e)||t&&Gm(e)?2:1}var Xm=No(Jm(),1),c$=new Intl.Segmenter,l$=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function Pt(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:o=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=mo(e)),e.length===0)return 0;let n=0,i={ambiguousAsWide:!o};for(let{segment:s}of c$.segment(e)){let c=s.codePointAt(0);if(!(c<=31||c>=127&&c<=159)&&!(c>=8203&&c<=8207||c===65279)&&!(c>=768&&c<=879||c>=6832&&c<=6911||c>=7616&&c<=7679||c>=8400&&c<=8447||c>=65056&&c<=65071)&&!(c>=55296&&c<=57343)&&!(c>=65024&&c<=65039)&&!l$.test(s)){if((0,Xm.default)().test(s)){n+=2;continue}n+=qm(c,i)}}return n}var Ym=(e=0)=>t=>`\x1B[${t+e}m`,Qm=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,eg=(e=0)=>(t,o,r)=>`\x1B[${38+e};2;${t};${o};${r}m`,ee={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},iP=Object.keys(ee.modifier),u$=Object.keys(ee.color),d$=Object.keys(ee.bgColor),sP=[...u$,...d$];function p$(){let e=new Map;for(let[t,o]of Object.entries(ee)){for(let[r,n]of Object.entries(o))ee[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[r]=ee[r],e.set(n[0],n[1]);Object.defineProperty(ee,t,{value:o,enumerable:!1})}return Object.defineProperty(ee,"codes",{value:e,enumerable:!1}),ee.color.close="\x1B[39m",ee.bgColor.close="\x1B[49m",ee.color.ansi=Ym(),ee.color.ansi256=Qm(),ee.color.ansi16m=eg(),ee.bgColor.ansi=Ym(10),ee.bgColor.ansi256=Qm(10),ee.bgColor.ansi16m=eg(10),Object.defineProperties(ee,{rgbToAnsi256:{value(t,o,r){return t===o&&o===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(t){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!o)return[0,0,0];let[r]=o;r.length===3&&(r=[...r].map(i=>i+i).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:t=>ee.rgbToAnsi256(...ee.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,r,n;if(t>=232)o=((t-232)*10+8)/255,r=o,n=o;else{t-=16;let c=t%36;o=Math.floor(t/36)/5,r=Math.floor(c/6)/5,n=c%6/5}let i=Math.max(o,r,n)*2;if(i===0)return 30;let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(o));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,o,r)=>ee.ansi256ToAnsi(ee.rgbToAnsi256(t,o,r)),enumerable:!1},hexToAnsi:{value:t=>ee.ansi256ToAnsi(ee.hexToAnsi256(t)),enumerable:!1}}),ee}var m$=p$(),tg=m$;var Qr=new Set(["\x1B","\x9B"]),g$=39,Ul="\x07",rg="[",f$="]",ig="m",Yr=`${f$}8;;`,ng=e=>`${Qr.values().next().value}${rg}${e}${ig}`,og=e=>`${Qr.values().next().value}${Yr}${e}${Ul}`,h$=e=>e.split(" ").map(t=>Pt(t)),Ll=(e,t,o)=>{let r=[...t],n=!1,i=!1,s=Pt(mo(e.at(-1)));for(let[c,u]of r.entries()){let p=Pt(u);if(s+p<=o?e[e.length-1]+=u:(e.push(u),s=0),Qr.has(u)&&(n=!0,i=r.slice(c+1,c+1+Yr.length).join("")===Yr),n){i?u===Ul&&(n=!1,i=!1):u===ig&&(n=!1);continue}s+=p,s===o&&c<r.length-1&&(e.push(""),s=0)}!s&&e.at(-1).length>0&&e.length>1&&(e[e.length-2]+=e.pop())},v$=e=>{let t=e.split(" "),o=t.length;for(;o>0&&!(Pt(t[o-1])>0);)o--;return o===t.length?e:t.slice(0,o).join(" ")+t.slice(o).join("")},y$=(e,t,o={})=>{if(o.trim!==!1&&e.trim()==="")return"";let r="",n,i,s=h$(e),c=[""];for(let[m,h]of e.split(" ").entries()){o.trim!==!1&&(c[c.length-1]=c.at(-1).trimStart());let y=Pt(c.at(-1));if(m!==0&&(y>=t&&(o.wordWrap===!1||o.trim===!1)&&(c.push(""),y=0),(y>0||o.trim===!1)&&(c[c.length-1]+=" ",y++)),o.hard&&s[m]>t){let g=t-y,D=1+Math.floor((s[m]-g-1)/t);Math.floor((s[m]-1)/t)<D&&c.push(""),Ll(c,h,t);continue}if(y+s[m]>t&&y>0&&s[m]>0){if(o.wordWrap===!1&&y<t){Ll(c,h,t);continue}c.push("")}if(y+s[m]>t&&o.wordWrap===!1){Ll(c,h,t);continue}c[c.length-1]+=h}o.trim!==!1&&(c=c.map(m=>v$(m)));let u=c.join(`
38
+ `),p=[...u],d=0;for(let[m,h]of p.entries()){if(r+=h,Qr.has(h)){let{groups:g}=new RegExp(`(?:\\${rg}(?<code>\\d+)m|\\${Yr}(?<uri>.*)${Ul})`).exec(u.slice(d))||{groups:{}};if(g.code!==void 0){let D=Number.parseFloat(g.code);n=D===g$?void 0:D}else g.uri!==void 0&&(i=g.uri.length===0?void 0:g.uri)}let y=tg.codes.get(Number(n));p[m+1]===`
39
+ `?(i&&(r+=og("")),n&&y&&(r+=ng(y))):h===`
40
+ `&&(n&&y&&(r+=ng(n)),i&&(r+=og(i))),d+=h.length}return r};function Bl(e,t,o){return String(e).normalize().replaceAll(`\r
41
+ `,`
42
+ `).split(`
43
+ `).map(r=>y$(r,t,o)).join(`
44
+ `)}function go(e,t){return e.split(`
45
+ `).flatMap(o=>Bl(o,t,{trim:!1,hard:!0}).split(`
46
+ `).map(r=>r.trimEnd())).join(`
47
+ `)}function ei(){return(0,sg.default)({defaultWidth:80,output:zl().output})}function b$({active:e,renderedItems:t,pageSize:o,loop:r}){let n=_t({lastPointer:e,lastActive:void 0}),{lastPointer:i,lastActive:s}=n.current,c=Math.floor(o/2),u=t.reduce((m,h)=>m+h.length,0),p=t.slice(0,e).reduce((m,h)=>m+h.length,0),d=p;if(u>o)if(r)d=i,s!=null&&s<e&&e-s<o&&(d=Math.min(c,Math.abs(e-s)===1?Math.min(i+(t[s]?.length??0),Math.max(p,i)):i+e-s));else{let m=t.slice(e).reduce((h,y)=>h+y.length,0);d=m<o-c?o-m:Math.min(p,c)}return n.current.lastPointer=d,n.current.lastActive=e,d}function Et({items:e,active:t,renderItem:o,pageSize:r,loop:n=!0}){let i=ei(),s=k=>(k%e.length+e.length)%e.length,c=e.map((k,C)=>k==null?[]:go(o({item:k,index:C,isActive:C===t}),i).split(`
48
+ `)),u=c.reduce((k,C)=>k+C.length,0),p=k=>c[k]??[],d=b$({active:t,renderedItems:c,pageSize:r,loop:n}),m=p(t).slice(0,r),h=d+m.length<=r?d:r-m.length,y=Array.from({length:r});y.splice(h,m.length,...m);let g=new Set([t]),D=h+m.length,b=s(t+1);for(;D<r&&!g.has(b)&&(n&&u>r?b!==t:b>t);){let C=p(b).slice(0,r-D);y.splice(D,C.length,...C),g.add(b),D+=C.length,b=s(b+1)}for(D=h-1,b=s(t-1);D>=0&&!g.has(b)&&(n&&u>r?b!==t:b<t);){let k=p(b),C=k.slice(Math.max(0,k.length-D-1));y.splice(D-C.length+1,C.length,...C),g.add(b),D-=C.length,b=s(b-1)}return y.filter(k=>typeof k=="string").join(`
49
+ `)}var gg=No(cg(),1);import*as mg from"node:readline";import{AsyncResource as x$}from"node:async_hooks";var It=[];It.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&It.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&It.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var ti=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Zl=Symbol.for("signal-exit emitter"),Vl=globalThis,$$=Object.defineProperty.bind(Object),Gl=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Vl[Zl])return Vl[Zl];$$(Vl,Zl,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,o){this.listeners[t].push(o)}removeListener(t,o){let r=this.listeners[t],n=r.indexOf(o);n!==-1&&(n===0&&r.length===1?r.length=0:r.splice(n,1))}emit(t,o,r){if(this.emitted[t])return!1;this.emitted[t]=!0;let n=!1;for(let i of this.listeners[t])n=i(o,r)===!0||n;return t==="exit"&&(n=this.emit("afterExit",o,r)||n),n}},ni=class{},C$=e=>({onExit(t,o){return e.onExit(t,o)},load(){return e.load()},unload(){return e.unload()}}),Wl=class extends ni{onExit(){return()=>{}}load(){}unload(){}},Hl=class extends ni{#n=ql.platform==="win32"?"SIGINT":"SIGHUP";#t=new Gl;#e;#i;#s;#r={};#o=!1;constructor(t){super(),this.#e=t,this.#r={};for(let o of It)this.#r[o]=()=>{let r=this.#e.listeners(o),{count:n}=this.#t,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(n+=i.__signal_exit_emitter__.count),r.length===n){this.unload();let s=this.#t.emit("exit",null,o),c=o==="SIGHUP"?this.#n:o;s||t.kill(t.pid,c)}};this.#s=t.reallyExit,this.#i=t.emit}onExit(t,o){if(!ti(this.#e))return()=>{};this.#o===!1&&this.load();let r=o?.alwaysLast?"afterExit":"exit";return this.#t.on(r,t),()=>{this.#t.removeListener(r,t),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(let t of It)try{let o=this.#r[t];o&&this.#e.on(t,o)}catch{}this.#e.emit=(t,...o)=>this.#c(t,...o),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#o&&(this.#o=!1,It.forEach(t=>{let o=this.#r[t];if(!o)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,o)}catch{}}),this.#e.emit=this.#i,this.#e.reallyExit=this.#s,this.#t.count-=1)}#a(t){return ti(this.#e)?(this.#e.exitCode=t||0,this.#t.emit("exit",this.#e.exitCode,null),this.#s.call(this.#e,this.#e.exitCode)):0}#c(t,...o){let r=this.#i;if(t==="exit"&&ti(this.#e)){typeof o[0]=="number"&&(this.#e.exitCode=o[0]);let n=r.call(this.#e,t,...o);return this.#t.emit("exit",this.#e.exitCode,null),n}else return r.call(this.#e,t,...o)}},ql=globalThis.process,{onExit:lg,load:$P,unload:CP}=C$(ti(ql)?new Hl(ql):new Wl);import{stripVTControlCharacters as k$}from"node:util";var oi="\x1B[?25l",dg="\x1B[?25h",Kl=(e=1)=>e>0?`\x1B[${e}A`:"",Jl=(e=1)=>e>0?`\x1B[${e}B`:"",Xl=(e,t)=>typeof t=="number"&&!Number.isNaN(t)?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`,ug="\x1B[2K",Yl=e=>e>0?(ug+Kl(1)).repeat(e-1)+ug+"\x1B[G":"";var pg=e=>e.split(`
50
+ `).length,w$=e=>e.split(`
51
+ `).pop()??"",fo=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(t){this.rl=t,this.cursorPos=t.getCursorPos()}write(t){this.rl.output.unmute(),this.rl.output.write(t),this.rl.output.mute()}render(t,o=""){let r=w$(t),n=k$(r),i=n;this.rl.line.length>0&&(i=i.slice(0,-this.rl.line.length)),this.rl.setPrompt(i),this.cursorPos=this.rl.getCursorPos();let s=ei();t=go(t,s),o=go(o,s),n.length%s===0&&(t+=`
52
+ `);let c=t+(o?`
53
+ `+o:""),p=Math.floor(n.length/s)-this.cursorPos.rows+(o?pg(o):0);p>0&&(c+=Kl(p)),c+=Xl(this.cursorPos.cols),this.write(Jl(this.extraLinesUnderPrompt)+Yl(this.height)+c),this.extraLinesUnderPrompt=p,this.height=pg(c)}checkCursorPos(){let t=this.rl.getCursorPos();t.cols!==this.cursorPos.cols&&(this.write(Xl(t.cols)),this.cursorPos=t)}done({clearContent:t}){this.rl.setPrompt("");let o=Jl(this.extraLinesUnderPrompt);o+=t?Yl(this.height):`
54
+ `,o+=dg,this.write(o),this.rl.close()}};var ri=class extends Promise{static withResolver(){let t,o;return{promise:new Promise((n,i)=>{t=n,o=i}),resolve:t,reject:o}}};function S$(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(o,r)=>{let n=r.slice(1);return t=n,n},new Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Oe(e){let t=S$();return(r,n={})=>{let{input:i=process.stdin,signal:s}=n,c=new Set,u=new gg.default;u.pipe(n.output??process.stdout);let p=mg.createInterface({terminal:!0,input:i,output:u}),d=new fo(p),{promise:m,resolve:h,reject:y}=ri.withResolver(),g=()=>y(new Jr);if(s){let k=()=>y(new Kr({cause:s.reason}));if(s.aborted)return k(),Object.assign(m,{cancel:g});s.addEventListener("abort",k),c.add(()=>s.removeEventListener("abort",k))}c.add(lg((k,C)=>{y(new po(`User force closed the prompt with ${k} ${C}`))}));let D=()=>y(new po("User force closed the prompt with SIGINT"));p.on("SIGINT",D),c.add(()=>p.removeListener("SIGINT",D));let b=()=>d.checkCursorPos();return p.input.on("keypress",b),c.add(()=>p.input.removeListener("keypress",b)),zm(p,k=>{let C=x$.bind(()=>St.clearAll());return p.on("close",C),c.add(()=>p.removeListener("close",C)),k(()=>{try{let w=e(r,B=>{setImmediate(()=>h(B))});if(w===void 0){let B=t[1]?.getFileName();throw new Error(`Prompt functions must return a string.
55
+ at ${B}`)}let[P,U]=typeof w=="string"?[w]:w;d.render(P,U),St.run()}catch(w){y(w)}}),Object.assign(m.then(w=>(St.clearAll(),w),w=>{throw St.clearAll(),w}).finally(()=>{c.forEach(w=>w()),d.done({clearContent:!!n.clearPromptOnDone}),u.end()}).then(()=>m),{cancel:g})})}}import{styleText as _$}from"node:util";var ne=class{separator=_$("dim",Array.from({length:15}).join(_e.line));type="separator";constructor(t){t&&(this.separator=t)}static isSeparator(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="separator")}};import{styleText as sn}from"node:util";var P$={icon:{checked:sn("green",_e.circleFilled),unchecked:_e.circle,cursor:_e.pointer},style:{disabledChoice:e=>sn("dim",`- ${e}`),renderSelectedChoices:e=>e.map(t=>t.short).join(", "),description:e=>sn("cyan",e),keysHelpTip:e=>e.map(([t,o])=>`${sn("bold",t)} ${sn("dim",o)}`).join(sn("dim"," \u2022 "))},keybindings:[]};function ut(e){return!ne.isSeparator(e)&&!e.disabled}function Ql(e){return ut(e)&&e.checked}function eu(e){return ut(e)?{...e,checked:!e.checked}:e}function E$(e){return function(t){return ut(t)?{...t,checked:e}:t}}function I$(e){return e.map(t=>{if(ne.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,checkedName:t,disabled:!1,checked:!1};let o=t.name??String(t.value),r={value:t.value,name:o,short:t.short??o,checkedName:t.checkedName??o,disabled:t.disabled??!1,checked:t.checked??!1};return t.description&&(r.description=t.description),r})}var tu=Oe((e,t)=>{let{pageSize:o=7,loop:r=!0,required:n,validate:i=()=>!0}=e,s={all:"a",invert:"i",...e.shortcuts},c=Ce(P$,e.theme),{keybindings:u}=c,[p,d]=G("idle"),m=Ae({status:p,theme:c}),[h,y]=G(I$(e.choices)),g=tt(()=>{let T=h.findIndex(ut),I=h.findLastIndex(ut);if(T===-1)throw new lt("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:T,last:I}},[h]),[D,b]=G(g.first),[k,C]=G();Te(async T=>{if(Ee(T)){let I=h.filter(Ql),j=await i([...I]);n&&!h.some(Ql)?C("At least one choice must be selected"):j===!0?(d("done"),t(I.map(Q=>Q.value))):C(j||"You must select a valid value")}else if($e(T,u)||Le(T,u)){if(r||$e(T,u)&&D!==g.first||Le(T,u)&&D!==g.last){let I=$e(T,u)?-1:1,j=D;do j=(j+I+h.length)%h.length;while(!ut(h[j]));b(j)}}else if(Ml(T))C(void 0),y(h.map((I,j)=>j===D?eu(I):I));else if(T.name===s.all){let I=h.some(j=>ut(j)&&!j.checked);y(h.map(E$(I)))}else if(T.name===s.invert)y(h.map(eu));else if(uo(T)){let I=Number(T.name)-1,j=-1,Q=h.findIndex(Me=>ne.isSeparator(Me)?!1:(j++,j===I)),ce=h[Q];ce&&ut(ce)&&(b(Q),y(h.map((Me,$n)=>$n===Q?eu(Me):Me)))}});let w=c.style.message(e.message,p),P,U=Et({items:h,active:D,renderItem({item:T,isActive:I}){if(ne.isSeparator(T))return` ${T.separator}`;if(T.disabled){let $n=typeof T.disabled=="string"?T.disabled:"(disabled)";return c.style.disabledChoice(`${T.name} ${$n}`)}I&&(P=T.description);let j=T.checked?c.icon.checked:c.icon.unchecked,Q=T.checked?T.checkedName:T.name,ce=I?c.style.highlight:$n=>$n,Me=I?c.icon.cursor:" ";return ce(`${Me}${j} ${Q}`)},pageSize:o,loop:r});if(p==="done"){let T=h.filter(Ql),I=c.style.answer(c.style.renderSelectedChoices(T,h));return[m,w,I].filter(Boolean).join(" ")}let B=[["\u2191\u2193","navigate"],["space","select"]];s.all&&B.push([s.all,"all"]),s.invert&&B.push([s.invert,"invert"]),B.push(["\u23CE","submit"]);let M=c.style.keysHelpTip(B);return`${[[m,w].filter(Boolean).join(" "),U," ",P?c.style.description(P):"",k?c.style.error(k):"",M].filter(Boolean).join(`
56
+ `).trimEnd()}${oi}`});function fg(e,t){let o=t!==!1;return/^(y|yes)/i.test(e)?o=!0:/^(n|no)/i.test(e)&&(o=!1),o}function hg(e){return e?"Yes":"No"}var nu=Oe((e,t)=>{let{transformer:o=hg}=e,[r,n]=G("idle"),[i,s]=G(""),c=Ce(e.theme),u=Ae({status:r,theme:c});Te((h,y)=>{if(r==="idle")if(Ee(h)){let g=fg(i,e.default);s(o(g)),n("done"),t(g)}else if(wt(h)){let g=hg(!fg(i,e.default));y.clearLine(0),y.write(g),s(g)}else s(y.line)});let p=i,d="";r==="done"?p=c.style.answer(i):d=` ${c.style.defaultAnswer(e.default===!1?"y/N":"Y/n")}`;let m=c.style.message(e.message,r);return`${u} ${m}${d} ${p}`});var F$={validationFailureMode:"keep"},ou=Oe((e,t)=>{let{prefill:o="tab"}=e,r=Ce(F$,e.theme),[n,i]=G("idle"),[s="",c]=G(e.default),[u,p]=G(),[d,m]=G(""),h=Ae({status:n,theme:r});async function y(C){let{required:w,pattern:P,patternError:U="Invalid input"}=e;return w&&!C?"You must provide a value":P&&!P.test(C)?U:typeof e.validate=="function"?await e.validate(C)||"You must provide a valid value":!0}Te(async(C,w)=>{if(n==="idle")if(Ee(C)){let P=d||s;i("loading");let U=await y(P);U===!0?(m(P),i("done"),t(P)):(r.validationFailureMode==="clear"?m(""):w.write(d),p(U),i("idle"))}else lo(C)&&!d?c(void 0):wt(C)&&!d?(c(void 0),w.clearLine(0),w.write(s),m(s)):(m(w.line),p(void 0))}),Ie(C=>{o==="editable"&&s&&(C.write(s),m(s))},[]);let g=r.style.message(e.message,n),D=d;typeof e.transformer=="function"?D=e.transformer(d,{isFinal:n==="done"}):n==="done"&&(D=r.style.answer(d));let b;s&&n!=="done"&&!d&&(b=r.style.defaultAnswer(s));let k="";return u&&(k=r.style.error(u)),[[h,g,b,D].filter(C=>C!==void 0).join(" "),k]});import{styleText as an}from"node:util";var A$={icon:{cursor:_e.pointer},style:{disabled:e=>an("dim",`- ${e}`),searchTerm:e=>an("cyan",e),description:e=>an("cyan",e),keysHelpTip:e=>e.map(([t,o])=>`${an("bold",t)} ${an("dim",o)}`).join(an("dim"," \u2022 "))}};function ru(e){return!ne.isSeparator(e)&&!e.disabled}function T$(e){return e.map(t=>{if(ne.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let o=t.name??String(t.value),r={value:t.value,name:o,short:t.short??o,disabled:t.disabled??!1};return t.description&&(r.description=t.description),r})}var iu=Oe((e,t)=>{let{pageSize:o=7,validate:r=()=>!0}=e,n=Ce(A$,e.theme),[i,s]=G("loading"),[c,u]=G(""),[p,d]=G([]),[m,h]=G(),y=Ae({status:i,theme:n}),g=tt(()=>{let I=p.findIndex(ru),j=p.findLastIndex(ru);return{first:I,last:j}},[p]),[D=g.first,b]=G();Ie(()=>{let I=new AbortController;return s("loading"),h(void 0),(async()=>{try{let Q=await e.source(c||void 0,{signal:I.signal});I.signal.aborted||(b(void 0),h(void 0),d(T$(Q)),s("idle"))}catch(Q){!I.signal.aborted&&Q instanceof Error&&h(Q.message)}})(),()=>{I.abort()}},[c]);let k=p[D];Te(async(I,j)=>{if(Ee(I))if(k){s("loading");let Q=await r(k.value);s("idle"),Q===!0?(s("done"),t(k.value)):k.name===c?h(Q||"You must provide a valid value"):(j.write(k.name),u(k.name))}else j.write(c);else if(wt(I)&&k)j.clearLine(0),j.write(k.name),u(k.name);else if(i!=="loading"&&($e(I)||Le(I))){if(j.clearLine(0),$e(I)&&D!==g.first||Le(I)&&D!==g.last){let Q=$e(I)?-1:1,ce=D;do ce=(ce+Q+p.length)%p.length;while(!ru(p[ce]));b(ce)}}else u(j.line)});let C=n.style.message(e.message,i),w=n.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),P=Et({items:p,active:D,renderItem({item:I,isActive:j}){if(ne.isSeparator(I))return` ${I.separator}`;if(I.disabled){let Me=typeof I.disabled=="string"?I.disabled:"(disabled)";return n.style.disabled(`${I.name} ${Me}`)}let Q=j?n.style.highlight:Me=>Me,ce=j?n.icon.cursor:" ";return Q(`${ce} ${I.name}`)},pageSize:o,loop:!1}),U;m?U=n.style.error(m):p.length===0&&c!==""&&i==="idle"&&(U=n.style.error("No results found"));let B;if(i==="done"&&k)return[y,C,n.style.answer(k.short)].filter(Boolean).join(" ").trimEnd();B=n.style.searchTerm(c);let M=k?.description,Y=[y,C,B].filter(Boolean).join(" ").trimEnd(),T=[U??P," ",M?n.style.description(M):"",w].filter(Boolean).join(`
57
+ `).trimEnd();return[Y,T]});import{styleText as ho}from"node:util";var O$={icon:{cursor:_e.pointer},style:{disabled:e=>ho("dim",`- ${e}`),description:e=>ho("cyan",e),keysHelpTip:e=>e.map(([t,o])=>`${ho("bold",t)} ${ho("dim",o)}`).join(ho("dim"," \u2022 "))},indexMode:"hidden",keybindings:[]};function cn(e){return!ne.isSeparator(e)&&!e.disabled}function M$(e){return e.map(t=>{if(ne.isSeparator(t))return t;if(typeof t!="object"||t===null||!("value"in t)){let n=String(t);return{value:t,name:n,short:n,disabled:!1}}let o=t.name??String(t.value),r={value:t.value,name:o,short:t.short??o,disabled:t.disabled??!1};return t.description&&(r.description=t.description),r})}var su=Oe((e,t)=>{let{loop:o=!0,pageSize:r=7}=e,n=Ce(O$,e.theme),{keybindings:i}=n,[s,c]=G("idle"),u=Ae({status:s,theme:n}),p=_t(),d=!i.includes("vim"),m=tt(()=>M$(e.choices),[e.choices]),h=tt(()=>{let M=m.findIndex(cn),Y=m.findLastIndex(cn);if(M===-1)throw new lt("[select prompt] No selectable choices. All choices are disabled.");return{first:M,last:Y}},[m]),y=tt(()=>"default"in e?m.findIndex(M=>cn(M)&&M.value===e.default):-1,[e.default,m]),[g,D]=G(y===-1?h.first:y),b=m[g];Te((M,Y)=>{if(clearTimeout(p.current),Ee(M))c("done"),t(b.value);else if($e(M,i)||Le(M,i)){if(Y.clearLine(0),o||$e(M,i)&&g!==h.first||Le(M,i)&&g!==h.last){let T=$e(M,i)?-1:1,I=g;do I=(I+T+m.length)%m.length;while(!cn(m[I]));D(I)}}else if(uo(M)&&!Number.isNaN(Number(Y.line))){let T=Number(Y.line)-1,I=-1,j=m.findIndex(ce=>ne.isSeparator(ce)?!1:(I++,I===T)),Q=m[j];Q!=null&&cn(Q)&&D(j),p.current=setTimeout(()=>{Y.clearLine(0)},700)}else if(lo(M))Y.clearLine(0);else if(d){let T=Y.line.toLowerCase(),I=m.findIndex(j=>ne.isSeparator(j)||!cn(j)?!1:j.name.toLowerCase().startsWith(T));I!==-1&&D(I),p.current=setTimeout(()=>{Y.clearLine(0)},700)}}),Ie(()=>()=>{clearTimeout(p.current)},[]);let k=n.style.message(e.message,s),C=n.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]),w=0,P=Et({items:m,active:g,renderItem({item:M,isActive:Y,index:T}){if(ne.isSeparator(M))return w++,` ${M.separator}`;let I=n.indexMode==="number"?`${T+1-w}. `:"";if(M.disabled){let ce=typeof M.disabled=="string"?M.disabled:"(disabled)";return n.style.disabled(`${I}${M.name} ${ce}`)}let j=Y?n.style.highlight:ce=>ce,Q=Y?n.icon.cursor:" ";return j(`${Q} ${I}${M.name}`)},pageSize:r,loop:o});if(s==="done")return[u,k,n.style.answer(b.short)].filter(Boolean).join(" ");let{description:U}=b;return`${[[u,k].filter(Boolean).join(" "),P," ",U?n.style.description(U):"",C].filter(Boolean).join(`
58
+ `).trimEnd()}${oi}`});var A=su,vo=nu,ie=ou,ii=tu,yo=iu,F=ne;async function oe(){}async function Ft(e){return await A(e)}import{homedir as z$}from"node:os";import au from"node:path";import{spawnSync as vg}from"node:child_process";function At(e,t=[]){try{let o=vg(e,t,{encoding:"utf8",stdio:["pipe","pipe","pipe"],shell:!1,timeout:3e4});return{success:o.status===0,stdout:o.stdout?.trim()||"",stderr:o.stderr?.trim()||"",exitCode:o.status}}catch(o){return{success:!1,stdout:"",stderr:o instanceof Error?o.message:"Unknown error",exitCode:null}}}function yg(e){let t=process.platform==="win32"?"where":"which";return At(t,[e]).success}function bg(e,t=[]){try{let o=vg(e,t,{stdio:"inherit",shell:!1});return{success:o.status===0,exitCode:o.status}}catch{return{success:!1,exitCode:null}}}function Dg(){return{cwd:j$(),ide:N$(),git:L$()}}function j$(){let e=process.cwd(),t=z$(),o=au.normalize(e),r=au.normalize(t);return o.toLowerCase().startsWith(r.toLowerCase())?"~"+o.slice(r.length):e}function N$(){let e=process.env;return e.CURSOR_AGENT||e.CURSOR_TRACE_ID?"Cursor":e.TERM_PROGRAM==="vscode"||e.VSCODE_PID?"VS Code":(e.TERM_PROGRAM==="Apple_Terminal","Terminal")}function L$(){let e=At("git",["rev-parse","--show-toplevel"]);if(!e.success)return;let t=At("git",["branch","--show-current"]);return{root:au.basename(e.stdout.trim())||"repo",branch:t.success?t.stdout:"HEAD"}}function U$(){let e=[" \u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584"," \u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584"," \u2590\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258C"," \u2590\u2588\u2588\u2580 \u2580\u2588\u2588\u2588\u2588\u2580 \u2580\u2588\u2588\u258C"," \u2590\u2588\u2588 \u2584 \u2588\u2588\u2588\u2588 \u2584 \u2588\u2588\u258C"," \u2590\u2588\u2588\u2588\u2588\u2584\u2584\u2580\u2580\u2580\u2580\u2584\u2584\u2588\u2588\u2588\u2588\u258C"," \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580"," \u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2580\u2580 \u2580\u2580\u2588\u2588\u2588\u2588\u2584\u2584\u2584"," \u2584\u2588\u2588\u2588\u2588\u2580\u2580\u2584\u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584\u2580\u2580\u2588\u2588\u2588\u2588\u2584","\u2590\u2588\u2588\u258C \u2584\u2588\u2588\u2580\u2580 \u2580\u2580\u2588\u2588\u2584 \u2590\u2588\u2588\u258C"," \u2580\u2580 \u2590\u2588\u2588\u258C \u2590\u2588\u2588\u258C \u2580\u2580"," \u2580\u2580 \u2580\u2580"];for(let t of e)console.log(a("magenta"," "+t))}function B$(){let e=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"];for(let t of e)console.log(a("magenta"," "+t))}function si(){console.log(),U$(),console.log(),B$(),console.log(),console.log();try{let e=Dg(),t=e.ide==="Cursor"||e.ide==="VS Code",o=`${l("Path")} ${e.cwd}`,r=t?`${l("IDE")} ${f(e.ide)}`:"",n=e.git?`${e.git.root} ${l("(")}${e.git.branch}${l(")")}`:"",i=[r,n].filter(Boolean).join(" ");console.log(` ${o}${i?` ${i}`:""}`),console.log()}catch{console.log()}}function ai(){console.log(),console.log(` ${a("cyan","Tip")} ${f("Quick tips for better AI coding with Octocode:")}`),console.log(),console.log(` ${a("green","-")} ${l("Prompts:")} Use ${a("cyan","/research")}, ${a("cyan","/plan")}, ${a("cyan","/implement")} in chat`),console.log(` ${a("green","-")} ${l("Skills:")} Add all via ${a("cyan","Octocode Skills")} or ${a("cyan","Manage System Skills")} -> ${a("cyan","Browse Marketplace")}`),console.log(` ${a("green","-")} ${l("Context:")} Add ${a("cyan","AGENTS.md")} to your project ${l("(you can ask octocode)")}`),console.log(),console.log(` Search${a("underscore","https://octocode.ai")}`),console.log()}var cu=new Set;function ci(){process.stdout.write("\x1B[?25h")}var $g=!1;function R$(){$g||($g=!0,process.on("exit",ci),process.on("SIGINT",()=>{ci(),process.exit(0)}),process.on("SIGTERM",()=>{ci(),process.exit(0)}),process.on("uncaughtException",e=>{ci(),console.error("Uncaught exception:",e),process.exit(1)}))}var L=class{text;frames;i;timer;constructor(t=""){this.text=t,this.frames=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],this.i=0,this.timer=null}start(t,o=0){t&&(this.text=t),this.timer&&(clearInterval(this.timer),this.timer=null),R$(),cu.add(this),process.stdout.write("\x1B[?25l");let r=" ".repeat(o);return this.timer=setInterval(()=>{let n=this.frames[this.i++%this.frames.length];process.stdout.write(`\r${r}${a("cyan",n)} ${this.text}`)},80),this}clear(){return this.timer&&(clearInterval(this.timer),this.timer=null),cu.delete(this),process.stdout.write("\r\x1B[2K"),process.stdout.write("\x1B[?25h"),this}stop(t="\u2713",o="green"){return this.timer&&(clearInterval(this.timer),this.timer=null),cu.delete(this),process.stdout.write(`\r\x1B[2K${a(o,t)} ${this.text}
59
+ `),process.stdout.write("\x1B[?25h"),this}succeed(t){return t&&(this.text=t),this.stop("\u2713","green")}fail(t){return t&&(this.text=t),this.stop("\u2717","red")}info(t){return t&&(this.text=t),this.stop("\u2139","blue")}warn(t){return t&&(this.text=t),this.stop("\u26A0","yellow")}update(t){return this.text=t,this}};import R from"node:path";import ke from"node:fs";import lu from"node:path";function z(e){try{return ke.existsSync(e)&&ke.statSync(e).isDirectory()}catch{return!1}}function ue(e){try{return ke.existsSync(e)&&ke.statSync(e).isFile()}catch{return!1}}function Tt(e){try{if(ue(e))return ke.readFileSync(e,"utf8")}catch{}return null}function bo(e,t){try{let o=lu.dirname(e);return z(o)||ke.mkdirSync(o,{recursive:!0,mode:448}),ke.writeFileSync(e,t,{encoding:"utf8",mode:384}),!0}catch{return!1}}function Cg(e){if(!ue(e))return null;try{let t=new Date().toISOString().replace(/[:.]/g,"-"),o=`${e}.backup-${t}`;return ke.copyFileSync(e,o),o}catch{return null}}function kg(e){let t=Tt(e);if(!t)return null;try{return JSON.parse(t)}catch{return null}}function wg(e,t){try{let o=JSON.stringify(t,null,2)+`
60
+ `;return bo(e,o)}catch{return!1}}function ln(e,t){try{if(!z(e))return!1;z(t)||ke.mkdirSync(t,{recursive:!0});let o=ke.readdirSync(e,{withFileTypes:!0});for(let r of o){let n=lu.join(e,r.name),i=lu.join(t,r.name);if(r.isDirectory()){if(!ln(n,i))return!1}else ke.copyFileSync(n,i)}return!0}catch{return!1}}function Be(e){try{return z(e)?ke.readdirSync(e,{withFileTypes:!0}).filter(t=>t.isDirectory()).map(t=>t.name):[]}catch{return[]}}function un(e){try{return z(e)?(ke.rmSync(e,{recursive:!0,force:!0}),!0):!1}catch{return!1}}function xg(){return X?De():Ne?R.join(H,"Library","Application Support"):process.env.XDG_CONFIG_HOME||R.join(H,".config")}function Z$(){let e=xg();return X?R.join(e,"Code","User","globalStorage"):Ne?R.join(e,"Code","User","globalStorage"):R.join(e,"Code","User","globalStorage")}var Z={cursor:{id:"cursor",name:"Cursor",description:"AI-first code editor",category:"ide",url:"https://cursor.sh",envVars:["CURSOR_AGENT","CURSOR_TRACE_ID","CURSOR_SESSION_ID","CURSOR"]},"claude-desktop":{id:"claude-desktop",name:"Claude Desktop",description:"Anthropic's desktop app",category:"desktop",url:"https://claude.ai/download"},"claude-code":{id:"claude-code",name:"Claude Code",description:"Claude CLI for terminal",category:"cli",url:"https://docs.anthropic.com/claude-code",envVars:["CLAUDE_CODE"]},"vscode-cline":{id:"vscode-cline",name:"Cline (VS Code)",description:"AI coding assistant extension",category:"extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev",envVars:["VSCODE_PID","TERM_PROGRAM"]},"vscode-roo":{id:"vscode-roo",name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",category:"extension",envVars:["VSCODE_PID"]},windsurf:{id:"windsurf",name:"Windsurf",description:"Codeium AI IDE",category:"ide",url:"https://codeium.com/windsurf",envVars:["WINDSURF_SESSION"]},trae:{id:"trae",name:"Trae",description:"Adaptive AI IDE",category:"ide",url:"https://trae.ai"},antigravity:{id:"antigravity",name:"Antigravity",description:"Gemini-powered AI IDE",category:"ide"},"vscode-continue":{id:"vscode-continue",name:"Continue (VS Code)",description:"Open-source AI assistant",category:"extension",url:"https://continue.dev",envVars:["VSCODE_PID"]},zed:{id:"zed",name:"Zed",description:"High-performance code editor",category:"ide",url:"https://zed.dev",envVars:["ZED_TERM"]},opencode:{id:"opencode",name:"Opencode",description:"AI coding agent CLI",category:"cli",url:"https://opencode.ai",envVars:["OPENCODE"]},codex:{id:"codex",name:"Codex",description:"OpenAI Codex CLI agent",category:"cli",url:"https://github.com/openai/codex",envVars:["CODEX_HOME","CODEX_SANDBOX_TYPE"]},"gemini-cli":{id:"gemini-cli",name:"Gemini CLI",description:"Google Gemini CLI",category:"cli",url:"https://github.com/google-gemini/gemini-cli",envVars:["GEMINI_API_KEY"]},goose:{id:"goose",name:"Goose",description:"Block AI coding agent",category:"desktop",url:"https://block.github.io/goose",envVars:["GOOSE_MODE"]},kiro:{id:"kiro",name:"Kiro",description:"AWS AI IDE",category:"ide",url:"https://kiro.dev"},custom:{id:"custom",name:"Custom Path",description:"Specify your own MCP config path",category:"cli"}};function K(e,t){if(e==="custom"&&t)return t;let o=xg(),r=Z$();switch(e){case"cursor":return X?R.join(De(),"Cursor","mcp.json"):R.join(H,".cursor","mcp.json");case"claude-desktop":return X?R.join(o,"Claude","claude_desktop_config.json"):Ne?R.join(o,"Claude","claude_desktop_config.json"):R.join(o,"claude","claude_desktop_config.json");case"claude-code":return R.join(H,".claude.json");case"vscode-cline":return R.join(r,"saoudrizwan.claude-dev","settings","cline_mcp_settings.json");case"vscode-roo":return R.join(r,"rooveterinaryinc.roo-cline","settings","mcp_settings.json");case"windsurf":return R.join(H,".codeium","windsurf","mcp_config.json");case"trae":return X?R.join(De(),"Trae","mcp.json"):Ne?R.join(o,"Trae","mcp.json"):R.join(o,"Trae","mcp.json");case"antigravity":return R.join(H,".gemini","antigravity","mcp_config.json");case"vscode-continue":return R.join(H,".continue","config.json");case"zed":return X?R.join(De(),"Zed","settings.json"):Ne?R.join(H,".config","zed","settings.json"):R.join(o,"zed","settings.json");case"opencode":return X?R.join(De(),"opencode","config.json"):R.join(o,"opencode","config.json");case"codex":return R.join(H,".codex","config.toml");case"gemini-cli":return R.join(H,".gemini","settings.json");case"goose":return X?R.join(De(),"goose","config.yaml"):Ne?R.join(o,"goose","config.yaml"):R.join(o,"goose","config.yaml");case"kiro":return X?R.join(De(),"Kiro","mcp.json"):R.join(H,".kiro","mcp.json");case"custom":throw new Error("Custom path requires customPath parameter");default:throw new Error(`Unknown MCP client: ${e}`)}}function Re(e,t){try{let o=K(e,t),r=R.dirname(o);return z(r)}catch{return!1}}function li(e,t){try{let o=K(e,t);return ue(o)}catch{return!1}}function dn(){let e=process.env;return e.CURSOR_AGENT||e.CURSOR_TRACE_ID||e.CURSOR_SESSION_ID||e.CURSOR?"cursor":e.WINDSURF_SESSION?"windsurf":e.CLAUDE_CODE?"claude-code":e.ZED_TERM||e.ZED?"zed":e.OPENCODE?"opencode":e.CODEX_HOME||e.CODEX_SANDBOX_TYPE?"codex":e.GEMINI_API_KEY?"gemini-cli":e.GOOSE_MODE?"goose":e.VSCODE_PID||e.TERM_PROGRAM==="vscode"?e.ROO_CLINE||e.ROO?"vscode-roo":e.CONTINUE_GLOBAL_DIR?"vscode-continue":"vscode-cline":null}function Sg(){let e=[],t=["cursor","claude-desktop","claude-code","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed","opencode","codex","gemini-cli","goose","kiro"];for(let o of t)Re(o)&&e.push(o);return e}import V$ from"node:path";import G$ from"node:fs";function J(e){return ue(e)?kg(e):{mcpServers:{}}}function pe(e,t,o=!0){try{let r;if(o&&ue(e)){let s=Cg(e);s&&(r=s)}let n=V$.dirname(e);return z(n)||G$.mkdirSync(n,{recursive:!0,mode:448}),wg(e,t)?{success:!0,backupPath:r}:{success:!1,error:"Failed to write config file"}}catch(r){return{success:!1,error:r instanceof Error?r.message:"Unknown error"}}}function Do(e,t){let o;switch(e){case"direct":o={command:"bash",args:["-c",`set -euo pipefail; TMPDIR=$(mktemp -d); trap 'rm -rf "$TMPDIR"' EXIT; curl -fsSL https://octocodeai.com/octocode/latest/index.js -o "$TMPDIR/index.js"; node "$TMPDIR/index.js"`]};break;case"npx":o={command:"npx",args:["octocode-mcp@latest"]};break;default:throw new Error(`Unknown install method: ${e}`)}if(t){let r={};t.enableLocal&&(r.ENABLE_LOCAL="true"),t.githubToken&&(r.GITHUB_TOKEN=t.githubToken),Object.keys(r).length>0&&(o.env=r)}return o}function ui(e,t){if(e==="direct"){let o={command:"powershell",args:["-Command","$tmpDir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.IO.Path]::GetRandomFileName()); New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null; $tmpFile = Join-Path $tmpDir 'index.js'; Invoke-WebRequest -Uri 'https://octocodeai.com/octocode/latest/index.js' -OutFile $tmpFile; node $tmpFile; Remove-Item -Recurse -Force $tmpDir"]};if(t){let r={};t.enableLocal&&(r.ENABLE_LOCAL="true"),t.githubToken&&(r.GITHUB_TOKEN=t.githubToken),Object.keys(r).length>0&&(o.env=r)}return o}return Do(e,t)}function uu(e,t,o){let r=X?ui(t,o):Do(t,o);return{...e,mcpServers:{...e.mcpServers,octocode:r}}}function nt(e){return!!e.mcpServers?.octocode}function di(e){let t=e.mcpServers?.octocode;return t?t.command==="npx"?"npx":t.command==="bash"||t.command==="powershell"?"direct":null:null}function du(e,t){let o=K(e,t),r=li(e,t),n=!1,i=null;if(r){let s=J(o);s&&(n=nt(s),i=di(s))}return{client:e,configExists:r,octocodeInstalled:n,method:i,configPath:o}}function pi(){return["cursor","claude-desktop","claude-code","opencode","vscode-cline","vscode-roo","vscode-continue","windsurf","trae","antigravity","zed"].map(t=>du(t))}function _g(e,t){if(!e.mcpServers?.[t])return e;let o=Object.fromEntries(Object.entries(e.mcpServers).filter(([r])=>r!==t));return{...e,mcpServers:o}}import pu from"node:path";function Eg(e){return e.octocodeInstalled?a("green","\u2705 installed"):e.configExists?a("blue","\u25CB Ready"):Re(e.client)?a("dim","\u25CB Available"):a("dim","\u25CB Not found")}function Ig(){return["cursor","claude-desktop","claude-code","opencode","codex","gemini-cli","windsurf","trae","antigravity","goose","kiro","zed","vscode-cline","vscode-roo","vscode-continue"].map(t=>({clientId:t,status:du(t),isAvailable:Re(t)}))}async function $o(){let e=dn(),t=Ig(),o=t.filter(n=>n.status.octocodeInstalled),r=t.filter(n=>n.isAvailable&&!n.status.octocodeInstalled);return o.length===0?await W$(r,e):await Fg(o,r,e)}async function W$(e,t){if(console.log(),console.log(a("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","INFO")} No octocode configurations found`+" ".repeat(24)+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("Octocode is not configured in any MCP client yet.")}`),console.log(),e.length===0){console.log(` ${a("red","X")} ${l("No MCP clients detected on this system.")}`),console.log(),console.log(` ${l("Supported clients:")}`),console.log(` ${l("\u2022 Cursor, Claude Desktop, Claude Code")}`),console.log(` ${l("\u2022 Windsurf, Zed, VS Code (Cline/Roo/Continue)")}`),console.log(),console.log(` ${l("Install a supported client and try again,")}`),console.log(` ${l('or use "Custom Path" to specify a config file.')}`),console.log();let n=[{name:`${a("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"},new F,{name:`${a("dim","- Back")}`,value:"back"}],i=await A({message:"What would you like to do?",choices:n,loop:!1});if(i==="back")return null;if(i==="custom"){let s=await mu();return s?{client:"custom",customPath:s}:null}return null}let o=[];for(let{clientId:n,status:i}of e){let s=Z[n],c=`${s.name} - ${l(s.description)}`;c+=` ${Eg(i)}`,t===n&&(c=`${a("green","\u2605")} ${c} ${a("yellow","(Current)")}`),o.push({name:c,value:n})}o.sort((n,i)=>t===n.value?-1:t===i.value?1:0),o.push(new F),o.push({name:`${a("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"}),o.push(new F),o.push({name:`${a("dim","- Back")}`,value:"back"});let r=await A({message:"Select a client to install Octocode:",choices:o,loop:!1});if(r==="back")return null;if(r==="custom"){let n=await mu();return n?{client:"custom",customPath:n}:null}return{client:r}}async function Fg(e,t,o){console.log(),console.log(` ${a("green","\u2705")} Found ${f(String(e.length))} octocode configuration${e.length>1?"s":""}`),console.log();let r=[];for(let{clientId:i}of e){let s=Z[i],c=`${a("green","\u2705")} ${s.name} - ${l("View/Edit configuration")}`;o===i&&(c+=` ${a("yellow","(Current)")}`),r.push({name:c,value:i})}r.sort((i,s)=>o===i.value?-1:o===s.value?1:0),t.length>0&&(r.push(new F),r.push({name:`${a("blue","+")} Install to another client - ${l(`${t.length} available`)}`,value:"install-new"})),r.push(new F),r.push({name:`${a("cyan","-")} Custom Path - ${l("Specify your own MCP config path")}`,value:"custom"}),r.push(new F),r.push({name:`${a("dim","- Back")}`,value:"back"});let n=await A({message:"Select configuration to manage:",choices:r,loop:!1});if(n==="back")return null;if(n==="install-new")return await H$(t,o);if(n==="custom"){let i=await mu();return i?{client:"custom",customPath:i}:null}return{client:n}}async function H$(e,t){console.log(),console.log(` ${a("blue","INFO")} Select a client for new installation:`),console.log();let o=[];for(let{clientId:n,status:i}of e){let s=Z[n],c=`${s.name} - ${l(s.description)}`;c+=` ${Eg(i)}`,t===n&&(c=`${a("green","\u2605")} ${c} ${a("yellow","(Current)")}`),o.push({name:c,value:n})}o.sort((n,i)=>t===n.value?-1:t===i.value?1:0),o.push(new F),o.push({name:`${a("dim","- Back to configurations")}`,value:"back"});let r=await A({message:"Select client to install Octocode:",choices:o,loop:!1});if(r==="back"){let i=Ig().filter(s=>s.status.octocodeInstalled);return await Fg(i,e,t)}return{client:r}}function Pg(e){if(e.startsWith("~")){let t=process.env.HOME||process.env.USERPROFILE||"";return pu.join(t,e.slice(1))}return e}async function mu(){console.log(),console.log(` ${a("blue","INFO")} Enter the full path to your MCP config file (JSON)`),console.log(` ${l("Leave empty to go back")}`),console.log(),console.log(` ${l("Common paths:")}`),console.log(` ${l("\u2022")} ~/.cursor/mcp.json ${l("(Cursor)")}`),console.log(` ${l("\u2022")} ~/Library/Application Support/Claude/claude_desktop_config.json`),console.log(` ${l("(Claude Desktop)")}`),console.log(` ${l("\u2022")} ~/.claude.json ${l("(Claude Code)")}`),console.log(` ${l("\u2022")} ~/.config/opencode/config.json ${l("(Opencode)")}`),console.log(` ${l("\u2022")} ~/.codeium/windsurf/mcp_config.json ${l("(Windsurf)")}`),console.log(` ${l("\u2022")} ~/Library/Application Support/Trae/mcp.json ${l("(Trae)")}`),console.log(` ${l("\u2022")} ~/.gemini/antigravity/mcp_config.json ${l("(Antigravity)")}`),console.log(` ${l("\u2022")} ~/.config/zed/settings.json ${l("(Zed)")}`),console.log(` ${l("\u2022")} ~/.continue/config.json ${l("(Continue)")}`),console.log(` ${l("\u2022")} ~/.codex/config.toml ${l("(Codex - TOML format)")}`),console.log(` ${l("\u2022")} ~/.gemini/settings.json ${l("(Gemini CLI)")}`),console.log(` ${l("\u2022")} ~/.kiro/mcp.json ${l("(Kiro)")}`),console.log();let e=await ie({message:"MCP config path (or press Enter to go back):",validate:t=>{if(!t.trim())return!0;let o=Pg(t);if(!o.endsWith(".json"))return"Path must be a .json file (e.g., mcp.json, config.json)";if(!pu.isAbsolute(o))return"Please provide an absolute path (starting with / or ~)";let r=pu.dirname(o);return z(r)?!0:`Parent directory does not exist: ${r}
61
+ Create it first or choose a different location.`}});return!e||!e.trim()?null:Pg(e)}async function Ag(){console.log(),console.log(` ${a("blue","INFO")} ${f("Local Tools")}`),console.log(` ${l("Enable local filesystem tools for searching and reading files")}`),console.log(` ${l("in your local codebase.")}`),console.log();let e=await A({message:"Enable local tools?",choices:[{name:`${a("green","\u25CF")} Disable ${l("(Recommended)")} - ${l("Use only GitHub tools")}`,value:"disable"},{name:`${a("yellow","\u25CB")} Enable - ${l("Allow local file exploration")}`,value:"enable"},new F,{name:`${a("dim","- Back")}`,value:"back"}],loop:!1});return e==="back"?null:e==="enable"}async function Tg(){console.log(),console.log(` ${a("blue","INFO")} ${f("GitHub Authentication")}`),console.log(` ${l("Required for accessing GitHub repositories.")}`),console.log();let e=await A({message:"How would you like to authenticate with GitHub?",choices:[{name:`${a("green","\u25CF")} gh CLI ${l("(Recommended)")} - ${l("Uses existing gh auth")}`,value:"gh-cli"},{name:`${a("yellow","\u25CF")} GITHUB_TOKEN - ${l("Enter personal access token")}`,value:"token"},{name:`${a("dim","\u25CB")} Skip - ${l("Configure manually later")}`,value:"skip"},new F,{name:`${a("dim","- Back")}`,value:"back"}],loop:!1});if(e==="back")return null;if(e==="gh-cli")return console.log(),console.log(` ${a("cyan","->")} Make sure gh CLI is installed and authenticated:`),console.log(` ${l("https://cli.github.com/")}`),console.log(),console.log(` ${l("Run")} ${a("cyan","gh auth login")} ${l("if not already authenticated.")}`),console.log(),{method:"gh-cli"};if(e==="token"){console.log(),console.log(` ${l("Leave empty and press Enter to go back")}`),console.log();let t=await ie({message:"Enter your GitHub personal access token:",validate:o=>o.trim()&&o.length<20?"Token appears too short":!0});return!t||!t.trim()?null:(console.log(),console.log(` ${a("yellow","WARN")} ${f("Security Note:")}`),console.log(` ${l("Your token will be saved in the MCP configuration file.")}`),console.log(` ${l("Make sure this file is not committed to version control.")}`),console.log(),{method:"token",token:t})}return{method:"skip"}}function Og(e){let t=e.env&&Object.keys(e.env).length>0,o=e.args??[];if(console.log(),console.log(a("dim"," {")),console.log(a("dim",' "mcpServers": {')),console.log(a("magenta",' "octocode"')+a("dim",": {")),console.log(a("dim",' "command": ')+a("green",`"${e.command}"`)+a("dim",",")),console.log(a("dim",' "args": [')),o.forEach((r,n)=>{let i=n===o.length-1,s=r.length>50?r.slice(0,47)+"...":r;console.log(a("dim"," ")+a("green",`"${s}"`)+(i&&!t?"":a("dim",",")))}),console.log(a("dim"," ]")+(t?a("dim",","):"")),t&&e.env){console.log(a("dim",' "env": {'));let r=Object.entries(e.env);r.forEach(([n,i],s)=>{let c=s===r.length-1,u=n.toLowerCase(),d=u.includes("token")||u.includes("secret")?"***":i;console.log(a("dim"," ")+a("cyan",`"${n}"`)+a("dim",": ")+a("green",`"${d}"`)+(c?"":a("dim",",")))}),console.log(a("dim"," }"))}console.log(a("dim"," }")),console.log(a("dim"," }")),console.log(a("dim"," }")),console.log()}function Mg(e){console.log(),console.log(` ${a("red","X")} ${f("Installation failed")}`),e.error&&console.log(` ${l("Error:")} ${e.error}`),console.log()}function zg(e){console.log(),console.log(a("cyan"," \u250C"+"\u2500".repeat(60)+"\u2510"));let o;if(e.url)o=e.url;else{let s=e.args??[];o=e.command?`${e.command} ${s.join(" ")}`.trim():"(no command configured)"}let r=56,n=o.length>r?o.slice(0,r-3)+"...":o,i=Math.max(0,58-n.length);if(console.log(a("cyan"," \u2502 ")+l(n)+" ".repeat(i)+a("cyan","\u2502")),e.env&&Object.keys(e.env).length>0){console.log(a("cyan"," \u2502")+" ".repeat(60)+a("cyan","\u2502"));let s="Environment:",c=58-s.length;console.log(a("cyan"," \u2502 ")+f(s)+" ".repeat(c)+a("cyan","\u2502"));for(let[u,p]of Object.entries(e.env)){let d=u.toLowerCase(),h=d.includes("token")||d.includes("secret")?"***":p,y=` ${u}: ${h}`,g=y.length>r?y.slice(0,r-3)+"...":y,D=Math.max(0,58-g.length);console.log(a("cyan"," \u2502 ")+l(g)+" ".repeat(D)+a("cyan","\u2502"))}}console.log(a("cyan"," \u2514"+"\u2500".repeat(60)+"\u2518"))}function gu(e){return e==="claude"?"claude-desktop":e}function jg(){let e=[];return Re("cursor")&&e.push("cursor"),Re("claude-desktop")&&e.push("claude"),e}function q$(e){let t=K(gu(e));if(!ue(t))return{installed:!1,configPath:t,configExists:!1};let r=J(t);return r?{installed:nt(r),configPath:t,configExists:!0}:{installed:!1,configPath:t,configExists:!0}}function Ng(e){let{ide:t,method:o,force:r=!1}=e,n=K(gu(t)),i=J(n)||{mcpServers:{}};if(nt(i)&&!r)return{success:!1,configPath:n,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};i=uu(i,o);let s=pe(n,i);return s.success?{success:!0,configPath:n,backupPath:s.backupPath}:{success:!1,configPath:n,error:s.error||"Failed to write config"}}function Lg(e,t){let o=K(gu(e)),r=q$(e),n=J(o),i=X?ui(t):Do(t),s="create";return r.installed?s="override":r.configExists&&(s="add"),{ide:e,method:t,configPath:o,serverConfig:i,action:s,existingMethod:n?di(n):null}}function K$(e,t){let o=e==="custom"&&t?t:K(e,t);if(!ue(o))return{installed:!1,configPath:o,configExists:!1};let n=J(o);return n?{installed:nt(n),configPath:o,configExists:!0}:{installed:!1,configPath:o,configExists:!0}}function Ug(e){let{client:t,method:o,customPath:r,force:n=!1,envOptions:i}=e,s=t==="custom"&&r?r:K(t,r),c=J(s)||{mcpServers:{}};if(nt(c)&&!n)return{success:!1,configPath:s,alreadyInstalled:!0,error:"Octocode is already configured. Use --force to overwrite."};c=uu(c,o,i);let u=pe(s,c);return u.success?{success:!0,configPath:s,backupPath:u.backupPath}:{success:!1,configPath:s,error:u.error||"Failed to write config"}}function fu(e,t,o,r){let n=e==="custom"&&o?o:K(e,o),i=K$(e,o),s=J(n),c=X?ui(t,r):Do(t,r),u="create";return i.installed?u="override":i.configExists&&(u="add"),{client:e,method:t,configPath:n,serverConfig:c,action:u,existingMethod:s?di(s):null}}async function hu(){await oe(),console.log(),console.log(a("blue","\u2501".repeat(66))),console.log(` ${f("Configure MCP server for your environment")}`),console.log(a("blue","\u2501".repeat(66))),console.log();let e={client:null,hasExistingOctocode:!1,enableLocal:!1,githubAuth:{method:"skip"}},t="client";for(;t!=="done";)switch(t){case"client":{let o=await $o();if(!o)return;e.client=o.client,e.customPath=o.customPath;let r=e.customPath||K(e.client),n=J(r);e.hasExistingOctocode=!!n?.mcpServers?.octocode,e.hasExistingOctocode?t="updateConfirm":t="localTools";break}case"updateConfirm":{let o=e.customPath||K(e.client),r=J(o);console.log(),console.log(a("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","WARN")} ${f("Octocode is already configured!")}`+" ".repeat(28)+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${f("Current octocode configuration:")}`),zg(r.mcpServers.octocode),console.log(),console.log(` ${l("Config file:")} ${a("cyan",o)}`),console.log(),await A({message:"What would you like to do?",choices:[{name:`${a("green","\u2705")} Update existing configuration`,value:"update"},new F,{name:`${a("dim","- Back to client selection")}`,value:"back"}],loop:!1})==="back"?t="client":t="localTools";break}case"localTools":{let o=await Ag();o===null?t=e.hasExistingOctocode?"updateConfirm":"client":(e.enableLocal=o,t="githubAuth");break}case"githubAuth":{let o=await Tg();o===null?t="localTools":(e.githubAuth=o,t="confirm");break}case"confirm":{let o=await J$(e);if(o==="proceed")t="install";else if(o==="back")t="githubAuth";else{console.log(` ${l("Configuration cancelled.")}`);return}break}case"install":{await X$(e),t="done";break}default:break}}async function J$(e){let t=Z[e.client],o="npx",r={};e.enableLocal&&(r.enableLocal=!0),e.githubAuth.method==="token"&&e.githubAuth.token&&(r.githubToken=e.githubAuth.token);let n=fu(e.client,o,e.customPath,r);console.log(),e.hasExistingOctocode?console.log(` ${a("yellow","WARN")} Will ${a("yellow","UPDATE")} existing octocode configuration`):n.action==="add"?console.log(` ${a("blue","INFO")} Config file exists, will ${a("green","ADD")} octocode entry`):console.log(` ${a("green","\u2705")} Will ${a("green","CREATE")} new config file`),console.log(),console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+f("Configuration to be added:")+" ".repeat(33)+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),Og(n.serverConfig),console.log(),console.log(` ${f("Summary:")}`),console.log(` ${l("Client:")} ${t.name}`),console.log(` ${l("Method:")} npx (octocode-mcp@latest)`);let i=e.enableLocal?a("green","Enabled"):a("dim","Disabled");console.log(` ${l("Local Tools:")} ${i}`);let s;e.githubAuth.method==="token"?s=a("green","Token configured"):e.githubAuth.method==="gh-cli"?s=a("cyan","Using gh CLI"):s=a("dim","Not configured"),console.log(` ${l("GitHub Auth:")} ${s}`);let c;return e.hasExistingOctocode?c=a("yellow","UPDATE"):n.action==="add"?c=a("green","ADD"):c=a("green","CREATE"),console.log(` ${l("Action:")} ${c}`),console.log(),console.log(` ${a("yellow","WARN")} ${f("Note:")}`),console.log(` ${l("Nothing is saved to any server. Configuration is stored locally at:")}`),console.log(` ${a("cyan",n.configPath)}`),console.log(),await A({message:"What would you like to do?",choices:[{name:`${a("green","\u2705")} Proceed with configuration`,value:"proceed"},new F,{name:`${a("dim","- Back to edit options")}`,value:"back"},{name:`${a("dim","X Cancel")}`,value:"cancel"}],loop:!1})}async function X$(e){let o={};e.enableLocal&&(o.enableLocal=!0),e.githubAuth.method==="token"&&e.githubAuth.token&&(o.githubToken=e.githubAuth.token);let r=fu(e.client,"npx",e.customPath,o),n=new L("Configuring octocode-mcp...").start(),i=Ug({client:e.client,method:"npx",customPath:e.customPath,force:e.hasExistingOctocode,envOptions:o});i.success?(n.succeed("Octocode configured successfully!"),Y$(i,e.client,r.configPath)):(n.fail("Configuration failed"),Mg(i))}function Y$(e,t,o){let r=Z[t];console.log(),console.log(a("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("green"," \u2502 ")+`${a("green","\u2705")} ${f("Octocode installed successfully!")}`+" ".repeat(26)+a("green","\u2502")),console.log(a("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${f("Configuration saved to:")}`),console.log(` ${a("cyan",o)}`),console.log(),e.backupPath&&(console.log(` ${l("Backup saved to:")} ${e.backupPath}`),console.log()),console.log(` ${f("Next steps:")}`),console.log(` 1. Restart ${r?.name||t}`),console.log(` 2. Look for ${a("cyan","octocode")} in MCP servers`),console.log()}import{execSync as Bg,exec as Q$}from"node:child_process";import{promisify as eC}from"node:util";var wI=eC(Q$),tC=1e3,nC=3e3,oC=4e3;function mi(){try{return{installed:!0,version:Bg("node --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}}catch{return{installed:!1,version:null}}}function gi(){try{return{installed:!0,version:`v${Bg("npm --version",{encoding:"utf-8",timeout:5e3,stdio:["pipe","pipe","pipe"]}).trim()}`}}catch{return{installed:!1,version:null}}}async function Rg(){let e="https://registry.npmjs.org";try{let t=Date.now(),o=new AbortController,r=setTimeout(()=>o.abort(),oC),n=await fetch(e,{method:"HEAD",signal:o.signal});clearTimeout(r);let i=Date.now()-t;return n.ok?i>nC?{status:"slow",latency:i}:i>tC?{status:"slow",latency:i}:{status:"ok",latency:i}:{status:"failed",latency:i}}catch{return{status:"failed",latency:null}}}var Ze=null;function Zg(e,t){console.log(e?` ${a("green","\u2705")} Node ${f(t||"unknown")}`:` ${a("red","X")} Node ${a("red","not found")}`)}function Vg(e,t){console.log(e?` ${a("green","\u2705")} npm ${f(t||"unknown")}`:` ${a("yellow","WARN")} npm ${a("yellow","not found")}`)}function Gg(e,t){let o=t!==null?`(${t}ms)`:"";switch(e){case"ok":console.log(` ${a("green","\u2705")} Registry ${l(o)}`);break;case"slow":console.log(` ${a("yellow","WARN")} Registry ${a("yellow","slow")} ${l(o)}`);break;case"failed":console.log(` ${a("red","X")} Registry ${a("red","unreachable")} ${t!==null?l(o):""}`);break;default:break}}async function Co(){if(Ze)return Zg(Ze.nodeInstalled,Ze.nodeVersion),Vg(Ze.npmInstalled,Ze.npmVersion),Gg(Ze.registryStatus,Ze.registryLatency),Ze;let e=mi();Zg(e.installed,e.version);let t=gi();Vg(t.installed,t.version);let o=new L(" Registry: Checking...").start(),r=await Rg();return o.clear(),Gg(r.status,r.latency),Ze={nodeInstalled:e.installed,nodeVersion:e.version,npmInstalled:t.installed,npmVersion:t.version,registryStatus:r.status,registryLatency:r.latency,octocodePackageAvailable:t.installed&&r.status==="ok",octocodePackageVersion:null},Ze}function vu(){console.log(` ${l("For deeper diagnostics:")} ${a("cyan","npx node-doctor")}`)}function ko(e){return!e.nodeInstalled||!e.npmInstalled||e.registryStatus==="slow"||e.registryStatus==="failed"}function rC(e){let t=Z[e.client]?.name||e.client;return e.octocodeInstalled?`${t} ${l("(Octocode installed)")}`:t}async function iC(e,t,o){if(console.log(),console.log(a("blue","\u2501".repeat(66))),console.log(` ${f("MCP Server Details")}`),console.log(a("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("ID:")} ${a("cyan",t)}`),console.log(` ${l("Command:")} ${a("green",o.command||"unknown")}`),o.args&&o.args.length>0&&(console.log(` ${l("Args:")}`),o.args.forEach(n=>{console.log(` ${n}`)})),o.env&&Object.keys(o.env).length>0&&(console.log(` ${l("Environment:")}`),Object.entries(o.env).forEach(([n,i])=>{let c=n.includes("KEY")||n.includes("TOKEN")||n.includes("SECRET")?"********":i;console.log(` ${n}=${c}`)})),console.log(),await A({message:"",choices:[{name:`${a("red","Delete")} - Remove Server`,value:"remove",description:"Remove this server from configuration"},new F,{name:`${a("dim","- Back")}`,value:"back"}],loop:!1,theme:{prefix:" ",style:{highlight:n=>a("cyan",n)}}})==="remove"&&await vo({message:`Are you sure you want to remove "${t}" from ${Z[e.client]?.name}?`,default:!1})){let i=e.configPath,s=J(i);if(s){let c=new L("Removing server...").start(),u=_g(s,t),p=pe(i,u);p.success?c.succeed(`Removed ${t}`):c.fail(`Failed to remove: ${p.error}`),console.log(),await new Promise(d=>setTimeout(d,1e3))}}}async function sC(e){let t=!0;for(;t;){let o=e.configPath,r=J(o);if(!r||!r.mcpServers){console.log(),console.log(` ${a("yellow","WARN")} No MCP configuration found or empty.`),console.log(),await new Promise(c=>setTimeout(c,1500));return}let n=Object.keys(r.mcpServers);if(n.length===0){console.log(),console.log(` ${a("yellow","WARN")} No MCP servers configured.`),console.log(),await new Promise(c=>setTimeout(c,1500));return}console.log(),console.log(` ${f(Z[e.client]?.name||e.client)}`),console.log(` ${l(o)}`),console.log();let i=n.map(c=>({name:c==="octocode"?`${c}`:`MCP ${c}`,value:c,description:r.mcpServers[c].command}));i.push(new F),i.push({name:`${a("dim","- Back")}`,value:"back"});let s=await A({message:"Select an MCP server to inspect:",choices:i,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:c=>a("cyan",c),message:c=>f(c)}}});s==="back"?t=!1:await iC(e,s,r.mcpServers[s])}}async function yu(){await oe();let e=!0;for(;e;){let o=pi().filter(i=>i.configExists);if(o.length===0){console.log(),console.log(` ${a("yellow","WARN")} No configured MCP clients found.`),console.log();return}console.log(),console.log(a("blue","\u2501".repeat(66))),console.log(` Info: ${f("MCP Configuration Details")}`),console.log(a("blue","\u2501".repeat(66))),console.log();let r=o.map(i=>({name:rC(i),value:i.client,description:i.configPath}));r.push(new F),r.push({name:`${a("dim","- Back")}`,value:"back"});let n=await A({message:"Select a client to inspect:",choices:r,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:i=>a("cyan",i),message:i=>f(i)}}});if(n==="back")e=!1;else{let i=o.find(s=>s.client===n);i&&await sC(i)}}}var Wg={github:[{id:"githubSearchCode",name:"Search Code",description:"Search for code patterns in GitHub repositories"},{id:"githubGetFileContent",name:"Get File Content",description:"Fetch file content from GitHub repositories"},{id:"githubViewRepoStructure",name:"View Repo Structure",description:"Browse repository directory structure"},{id:"githubSearchRepositories",name:"Search Repositories",description:"Search for GitHub repositories"},{id:"githubSearchPullRequests",name:"Search Pull Requests",description:"Search for pull requests and view diffs"},{id:"packageSearch",name:"Package Search",description:"Search npm/Python packages and find their repos"}],local:[{id:"localSearchCode",name:"Ripgrep Search",description:"Fast content search with regex support"},{id:"localViewStructure",name:"View Structure",description:"Browse local directory structure"},{id:"localFindFiles",name:"Find Files",description:"Find files by name, time, size, permissions"},{id:"localGetFileContent",name:"Fetch Content",description:"Read targeted sections of local files"}]},Ot=[{id:"enableLocal",envVar:"ENABLE_LOCAL",name:"Local File Tools",description:"Enable local file exploration tools for searching and browsing local files",type:"boolean",defaultValue:"false"},{id:"githubApiUrl",envVar:"GITHUB_API_URL",name:"GitHub API URL",description:"Custom GitHub API endpoint (for GitHub Enterprise)",type:"string",defaultValue:"https://api.github.com"},{id:"toolsToRun",envVar:"TOOLS_TO_RUN",name:"Tools to Run",description:"Specific tools to enable (all others disabled)",type:"array",defaultValue:"",toolCategory:"all"},{id:"enableTools",envVar:"ENABLE_TOOLS",name:"Enable Tools",description:"Additional tools to enable",type:"array",defaultValue:"",toolCategory:"all"},{id:"disableTools",envVar:"DISABLE_TOOLS",name:"Disable Tools",description:"Tools to disable",type:"array",defaultValue:"",toolCategory:"all"},{id:"requestTimeout",envVar:"REQUEST_TIMEOUT",name:"Request Timeout",description:"API request timeout in milliseconds",type:"number",defaultValue:"30000",validation:{min:3e4,max:6e5}},{id:"maxRetries",envVar:"MAX_RETRIES",name:"Max Retries",description:"Maximum number of API retry attempts",type:"number",defaultValue:"3",validation:{min:0,max:10}}];function aC(){return[...Wg.github.map(e=>({...e,category:"github"})),...Wg.local.map(e=>({...e,category:"local"}))]}function wo(e,t){let o=e[t.envVar];return o==null||o===""?t.defaultValue:o}function fi(e,t,o=!1){let r=o?a("yellow"," \u2022"):"";if(e.type==="boolean"){let n=t==="1"||t.toLowerCase()==="true",i=n?a("green","\u2705"):a("dim","\u25CB"),s=n?a("green","enabled"):a("dim","disabled");return`${i} ${s}${r}`}if(e.type==="array"){if(!t||t===""){let s=e.id==="toolsToRun"?"(all tools)":"(none)";return`${a("dim","\u25CB")} ${a("dim",s)}${r}`}let n=t.split(",").filter(s=>s.trim()),i=n.length>2?`${n.slice(0,2).join(", ")} ${a("dim",`+${n.length-2} more`)}`:n.join(", ");return`${a("green","\u25CF")} ${i}${r}`}return e.type==="number"?t===e.defaultValue?`${a("dim","\u25CB")} ${t} ${a("dim","(default)")}${r}`:`${a("cyan","\u25CF")} ${a("cyan",t)}${r}`:t===e.defaultValue?`${a("dim","\u25CB")} ${a("dim",t)}${r}`:`${a("cyan","\u25CF")} ${a("cyan",t)}${r}`}function cC(e){return e==="1"||e.toLowerCase()==="true"}async function lC(){return await A({message:"",choices:[{name:"- Edit configuration",value:"edit",description:"Configure all octocode-mcp settings for a client"},{name:"- View all configuration options",value:"view",description:"Show available environment variables and their defaults"},{name:"- Show current JSON config",value:"show-json",description:"Display the actual MCP config JSON for a client"},new F,{name:`${a("dim","- Back to main menu")}`,value:"back"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:t=>a("cyan",t)}}})}async function Hg(){switch(await oe(),await lC()){case"view":$C(),await uC();break;case"edit":await vC();break;case"show-json":await yC();break;default:break}}async function uC(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}async function qg(e){console.log();let t=await A({message:"Open config file?",choices:[{name:"- Open in Cursor",value:"cursor",description:"Open in Cursor IDE"},{name:"- Open in VS Code",value:"vscode",description:"Open in Visual Studio Code"},{name:"- Open in default app",value:"default",description:"Open with system default application"},new F,{name:`${a("dim","- Skip")}`,value:"no"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:r=>a("cyan",r),message:r=>f(r)}}});if(t==="no")return;Om(e,t)?console.log(` ${a("green","\u2705")} Opened ${e}`):(console.log(` ${a("yellow","WARN")} Could not open file automatically`),console.log(` ${l("Try opening manually:")} ${a("cyan",e)}`)),console.log()}async function dC(e,t){let r=cC(t)?a("green","enabled"):a("dim","disabled");console.log(),console.log(` ${f(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${r}`),console.log();let n=await A({message:`${e.name}:`,choices:[{name:`${a("green","\u2705")} Enable`,value:"enable"},{name:`${a("yellow","\u25CB")} Disable`,value:"disable"},new F,{name:`${a("dim","- Cancel")}`,value:"cancel"}],loop:!1});return n==="cancel"?null:n==="enable"?"1":"false"}async function pC(e,t){let o=t&&t!==e.defaultValue?a("cyan",t):a("dim",t||e.defaultValue);console.log(),console.log(` ${f(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${o}`),console.log(` ${l("Default:")} ${e.defaultValue}`),console.log(` ${l("(Leave empty and press Enter to cancel)")}`),console.log();let r=await ie({message:`${e.name}:`,default:"",validate:n=>n.trim()&&e.validation?.pattern&&!e.validation.pattern.test(n)?"Invalid format":!0});return r.trim()?r===e.defaultValue?"":r:null}async function mC(e,t){let o=t&&t!==e.defaultValue?a("cyan",t):a("dim",t||e.defaultValue);if(console.log(),console.log(` ${f(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${o}`),e.validation?.min!==void 0||e.validation?.max!==void 0){let n=e.validation?.min??0,i=e.validation?.max??1/0;console.log(` ${l("Range:")} ${n} - ${i===1/0?"\u221E":i}`)}console.log(` ${l("Default:")} ${e.defaultValue}`),console.log(` ${l("(Leave empty and press Enter to cancel)")}`),console.log();let r=await ie({message:`${e.name}:`,default:"",validate:n=>{if(!n.trim())return!0;let i=parseInt(n,10);return isNaN(i)?"Please enter a valid number":e.validation?.min!==void 0&&i<e.validation.min?`Minimum value is ${e.validation.min}`:e.validation?.max!==void 0&&i>e.validation.max?`Maximum value is ${e.validation.max}`:!0}});return r.trim()?r===e.defaultValue?"":r:null}async function gC(e,t){let o=aC(),r=t?t.split(",").map(p=>p.trim()).filter(Boolean):[],n=r.length>0?r.join(", "):e.id==="toolsToRun"?a("dim","(all tools)"):a("dim","(none)");console.log(),console.log(` ${f(e.name)}`),console.log(` ${l(e.description)}`),console.log(` ${l("Current:")} ${n}`),console.log();let i=await A({message:`${e.name}:`,choices:[{name:"EDIT Select tools",value:"select",description:"Choose which tools to include"},{name:`${a("yellow","\u21BA")} Clear all`,value:"clear",description:e.id==="toolsToRun"?"Reset to all tools enabled":"Remove all tools from this list"},new F,{name:`${a("dim","- Cancel")}`,value:"cancel"}],loop:!1});if(i==="cancel")return null;if(i==="clear")return"";let s=[];s.push({name:a("blue","\u2500\u2500 GitHub Tools \u2500\u2500"),value:"__separator_github__",disabled:!0});for(let p of o.filter(d=>d.category==="github"))s.push({name:`${p.name} ${a("dim",`(${p.id})`)}`,value:p.id,checked:r.includes(p.id),description:p.description});s.push({name:a("yellow","\u2500\u2500 Local Tools \u2500\u2500"),value:"__separator_local__",disabled:!0});for(let p of o.filter(d=>d.category==="local"))s.push({name:`${p.name} ${a("dim",`(${p.id})`)}`,value:p.id,checked:r.includes(p.id),description:p.description});s.push({name:a("dim","\u2500\u2500 Actions \u2500\u2500"),value:"__separator_actions__",disabled:!0}),s.push({name:`${a("dim","- Cancel (keep current)")}`,value:"__cancel__",checked:!1,description:"Go back without changes"}),console.log(),console.log(` ${l("Use Space to select/deselect, Enter to confirm, or select Cancel")}`);let c=await ii({message:`Select tools for ${e.name}:`,choices:s,pageSize:16,loop:!1,theme:{prefix:" ",style:{highlight:p=>a("cyan",p),message:p=>f(p)}}});if(c.includes("__cancel__"))return null;let u=c.filter(p=>!p.startsWith("__separator")&&p!=="__cancel__");return u.length>0?u.join(","):""}function xo(e,t,o){let r=e[o.envVar]??"",n=t[o.envVar]??"";return r!==n}function fC(e,t){let o=0;for(let r of Ot)xo(e,t,r)&&o++;return o}async function hC(e,t){let o=[],r=Ot.filter(d=>d.type==="boolean"),n=Ot.filter(d=>d.type==="string"),i=Ot.filter(d=>d.type==="number"),s=Ot.filter(d=>d.type==="array"),c=fC(t,e),u=c>0?`${a("yellow","\u25CF")} ${c} unsaved ${c===1?"change":"changes"}`:`${a("green","\u25CF")} No unsaved changes`;if(o.push({name:`${a("dim","\u2500\u2500")} ${u} ${a("dim","\u2500\u2500")}`,value:"__status__"}),r.length>0){o.push({name:a("dim","\u2500\u2500 Features \u2500\u2500"),value:"__sep1__"});for(let d of r){let m=wo(e,d),h=xo(t,e,d),y=fi(d,m,h);o.push({name:`${d.name}: ${y}`,value:d.id,description:d.description})}}if(n.length>0){o.push({name:a("dim","\u2500\u2500 Endpoints \u2500\u2500"),value:"__sep2__"});for(let d of n){let m=wo(e,d),h=xo(t,e,d),y=fi(d,m,h);o.push({name:`${d.name}: ${y}`,value:d.id,description:d.description})}}if(i.length>0){o.push({name:a("dim","\u2500\u2500 Performance \u2500\u2500"),value:"__sep3__"});for(let d of i){let m=wo(e,d),h=xo(t,e,d),y=fi(d,m,h);o.push({name:`${d.name}: ${y}`,value:d.id,description:d.description})}}if(s.length>0){o.push({name:a("dim","\u2500\u2500 Tool Selection \u2500\u2500"),value:"__sep4__"});for(let d of s){let m=wo(e,d),h=xo(t,e,d),y=fi(d,m,h);o.push({name:`${d.name}: ${y}`,value:d.id,description:d.description})}}return o.push({name:a("dim","\u2500\u2500 Actions \u2500\u2500"),value:"__sep5__"}),c>0?o.push({name:`${a("green","Save")} Save changes ${a("yellow",`(${c})`)}`,value:"save",description:"Save configuration and exit"}):o.push({name:`${a("dim","Save")} Save changes`,value:"save",description:l("No changes to save")}),o.push({name:`${a("yellow","\u21BA")} Reset to defaults`,value:"reset",description:"Clear all custom configuration"}),o.push({name:`${a("dim","- Back")}`,value:"back"}),await A({message:"Select option to configure:",choices:o,pageSize:20,loop:!1,theme:{prefix:" ",style:{highlight:d=>a("cyan",d),message:d=>f(d)}}})}async function vC(){let e=await $o();if(!e)return;let{client:t,customPath:o}=e,r=Z[t],n=o||K(t),i=J(n);if(!i){console.log(),console.log(` ${a("red","X")} Failed to read config file: ${n}`),console.log();return}if(!nt(i)){console.log(),console.log(` ${a("yellow","WARN")} Octocode is not configured for ${r.name}.`),console.log(` ${l('Please install Octocode first using "Install octocode-mcp".')}`),console.log();return}console.log(),console.log(` ${l("Config file:")} ${a("cyan",n)}`),console.log(` ${l("Client:")} ${r.name}`),console.log();let s={...i.mcpServers?.octocode?.env||{}},c={...s},u=!0;for(;u;){let p=await hC(c,s);if(!(p.startsWith("__sep")||p==="__status__"))switch(p){case"save":{if(!(JSON.stringify(s)!==JSON.stringify(c))){console.log(),console.log(` ${l("No changes to save.")}`),console.log(),u=!1;break}let m=new L("Saving configuration...").start(),h={};for(let[D,b]of Object.entries(c))b&&b!==""&&(h[D]=b);let y={...i,mcpServers:{...i.mcpServers,octocode:{...i.mcpServers.octocode,env:Object.keys(h).length>0?h:void 0}}};y.mcpServers?.octocode?.env&&Object.keys(y.mcpServers.octocode.env).length===0&&delete y.mcpServers.octocode.env;let g=pe(n,y);g.success?(m.succeed("Configuration saved!"),console.log(),console.log(` ${a("green","\u2705")} Config saved to: ${n}`),g.backupPath&&console.log(` ${l("Backup:")} ${g.backupPath}`),console.log(),console.log(` ${f("Note:")} Restart ${r.name} for changes to take effect.`),await qg(n)):(m.fail("Failed to save configuration"),console.log(),console.log(` ${a("red","X")} ${g.error||"Unknown error"}`),console.log()),u=!1;break}case"reset":{if(await vo({message:"Reset all configuration to defaults?",default:!1})){for(let m of Object.keys(c))delete c[m];console.log(` ${a("yellow","\u21BA")} Configuration reset to defaults`)}break}case"back":{if(JSON.stringify(s)!==JSON.stringify(c)&&!await vo({message:"Discard unsaved changes?",default:!1}))break;u=!1;break}default:{let d=Ot.find(y=>y.id===p);if(!d)break;let m=wo(c,d),h=null;switch(d.type){case"boolean":h=await dC(d,m);break;case"string":h=await pC(d,m);break;case"number":h=await mC(d,m);break;case"array":h=await gC(d,m);break;default:break}h!==null&&(h===""||h===d.defaultValue?delete c[d.envVar]:c[d.envVar]=h);break}}}}async function yC(){let e=await $o();if(!e)return;let{client:t,customPath:o}=e,r=Z[t],n=o||K(t),i=J(n);if(!i){console.log(),console.log(` ${a("red","X")} Failed to read config file: ${n}`),console.log();return}if(!nt(i)){console.log(),console.log(` ${a("yellow","WARN")} Octocode is not configured for ${r.name}.`),console.log(` ${l('Please install Octocode first using "Install octocode-mcp".')}`),console.log();return}let s=i.mcpServers?.octocode;console.log(),console.log(` ${l("Client:")} ${r.name} ${l("\u2022")} ${a("cyan",n)}`),console.log();let u=JSON.stringify({octocode:s},null,2).split(`
62
+ `);for(let p of u){let d=p.replace(/"([^"]+)":/g,`${a("cyan",'"$1"')}:`).replace(/: "([^"]+)"/g,`: ${a("green",'"$1"')}`).replace(/: (\d+)/g,`: ${a("yellow","$1")}`).replace(/: (true|false)/g,`: ${a("magenta","$1")}`);console.log(` ${d}`)}console.log(),await qg(n)}function bC(e){switch(e.id){case"enableLocal":return"ENABLE_LOCAL=1";case"githubApiUrl":return"GITHUB_API_URL=https://github.mycompany.com/api/v3";case"toolsToRun":return"TOOLS_TO_RUN=githubSearchCode,githubGetFileContent";case"enableTools":return"ENABLE_TOOLS=localSearchCode,localFindFiles";case"disableTools":return"DISABLE_TOOLS=githubSearchPullRequests";case"requestTimeout":return"REQUEST_TIMEOUT=60000";case"maxRetries":return"MAX_RETRIES=5";default:return`${e.envVar}=${e.defaultValue}`}}function DC(e){return e.type==="array"?e.id==="toolsToRun"?"(all tools)":"(none)":e.defaultValue}function $C(){console.log(),console.log(` ${f("All Available Configuration Options")}`),console.log(),console.log(` ${l("These options can be set as environment variables in your MCP config.")}`),console.log(` ${l('Add them to the "env" object in your octocode server configuration.')}`),console.log(),console.log(` ${l("Example config:")}`),console.log(` ${l("{")}
39
63
  ${l(' "mcpServers": {')}
40
64
  ${l(' "octocode": {')}
41
65
  ${l(' "command": "npx",')}
42
66
  ${l(' "args": ["octocode-mcp@latest"],')}
43
- ${s("green",' "env": { "ENABLE_LOCAL": "1" }')}
67
+ ${a("green",' "env": { "ENABLE_LOCAL": "1" }')}
44
68
  ${l(" }")}
45
69
  ${l(" }")}
46
- ${l("}")}`),console.log(),console.log(s("blue","\u2501".repeat(66))),console.log();for(let e of et){let o=e.type==="boolean"?"green":e.type==="number"?"yellow":e.type==="array"?"magenta":"cyan";console.log(` ${s("cyan",e.envVar)} ${l(`(${e.type})`)}`),console.log(` ${e.description}`),console.log(` ${l("Default:")} ${Nv(e)}`),console.log(` ${l("Example:")} ${s(o,zv(e))}`),console.log()}}function ge(e,o){if(e==null)throw new Error(`Assertion failed: ${o}`);return e}var se=[{id:"playwright-mcp",name:"Playwright MCP",description:"Official Microsoft Playwright MCP server for browser automation via accessibility snapshots",category:"browser-automation",repository:"https://github.com/microsoft/playwright-mcp",website:"https://playwright.dev",installationType:"npx",npmPackage:"@playwright/mcp",official:!0,installConfig:{command:"npx",args:["-y","@playwright/mcp@latest"]},tags:["browser","automation","testing","microsoft","official"]},{id:"firecrawl-mcp-server",name:"Firecrawl MCP",description:"Powerful web scraping and search for Claude, Cursor and LLM clients",category:"browser-automation",repository:"https://github.com/firecrawl/firecrawl-mcp-server",website:"https://firecrawl.dev",installationType:"npx",npmPackage:"firecrawl-mcp",official:!0,installConfig:{command:"npx",args:["-y","firecrawl-mcp"]},requiredEnvVars:[{name:"FIRECRAWL_API_KEY",description:"Firecrawl API key",example:"fc-xxxxx"}],tags:["scraping","web","search","official"]},{id:"browserbase-mcp",name:"Browserbase MCP",description:"Cloud browser automation for web navigation, data extraction, form filling",category:"browser-automation",repository:"https://github.com/browserbase/mcp-server-browserbase",website:"https://browserbase.com",installationType:"npx",npmPackage:"@browserbasehq/mcp-server-browserbase",official:!0,installConfig:{command:"npx",args:["-y","@browserbasehq/mcp-server-browserbase"]},requiredEnvVars:[{name:"BROWSERBASE_API_KEY",description:"Browserbase API key"},{name:"BROWSERBASE_PROJECT_ID",description:"Browserbase project ID"}],tags:["browser","cloud","automation","official"]},{id:"chrome-devtools-mcp",name:"Chrome DevTools MCP",description:"Chrome DevTools for coding agents - debugging and browser control",category:"browser-automation",repository:"https://github.com/ChromeDevTools/chrome-devtools-mcp",installationType:"npx",npmPackage:"chrome-devtools-mcp",official:!0,installConfig:{command:"npx",args:["-y","chrome-devtools-mcp"]},tags:["chrome","devtools","debugging","official"]},{id:"github-mcp-server",name:"GitHub MCP",description:"GitHub's official MCP Server for repository management, PRs, issues, and more",category:"version-control",repository:"https://github.com/github/github-mcp-server",website:"https://github.com",installationType:"docker",dockerImage:"ghcr.io/github/github-mcp-server",official:!0,installConfig:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},requiredEnvVars:[{name:"GITHUB_PERSONAL_ACCESS_TOKEN",description:"GitHub Personal Access Token"}],tags:["github","git","repository","official"]},{id:"sqlite-mcp",name:"SQLite MCP",description:"Comprehensive SQLite database interaction capabilities for Cursor, Windsurf, and AI tools",category:"database",repository:"https://github.com/jparkerweb/mcp-sqlite",installationType:"npx",npmPackage:"mcp-sqlite",installConfig:{command:"npx",args:["-y","mcp-sqlite","${DATABASE_PATH}"]},requiredEnvVars:[{name:"DATABASE_PATH",description:"Path to SQLite database file",example:"/path/to/database.db"}],tags:["database","sqlite","sql","cursor","windsurf"]},{id:"mysql-mcp",name:"MySQL MCP",description:"MySQL database integration with configurable access controls and schema inspection",category:"database",repository:"https://github.com/designcomputer/mysql_mcp_server",installationType:"pip",pipPackage:"mysql-mcp-server",installConfig:{command:"uvx",args:["mysql-mcp-server"]},requiredEnvVars:[{name:"MYSQL_HOST",description:"MySQL host"},{name:"MYSQL_USER",description:"MySQL username"},{name:"MYSQL_PASSWORD",description:"MySQL password"},{name:"MYSQL_DATABASE",description:"MySQL database name"}],tags:["database","mysql","sql"]},{id:"mongodb-mcp",name:"MongoDB MCP",description:"MongoDB integration for querying and analyzing collections",category:"database",repository:"https://github.com/kiliczsh/mcp-mongo-server",installationType:"npx",npmPackage:"mcp-mongo-server",installConfig:{command:"npx",args:["-y","mcp-mongo-server"]},requiredEnvVars:[{name:"MONGODB_URI",description:"MongoDB connection URI",example:"mongodb://localhost:27017/mydb"}],tags:["database","mongodb","nosql"]},{id:"redis-mcp",name:"Redis MCP",description:"Natural language interface for managing and searching data in Redis",category:"database",repository:"https://github.com/redis/mcp-redis",website:"https://redis.io",installationType:"pip",pipPackage:"redis-mcp-server",official:!0,installConfig:{command:"uvx",args:["redis-mcp-server"]},requiredEnvVars:[{name:"REDIS_URL",description:"Redis connection URL",example:"redis://localhost:6379"}],tags:["database","redis","cache","official"]},{id:"neon-mcp",name:"Neon MCP",description:"Neon Serverless Postgres - create and manage databases with natural language",category:"database",repository:"https://github.com/neondatabase/mcp-server-neon",website:"https://neon.tech",installationType:"npx",npmPackage:"@neondatabase/mcp-server-neon",official:!0,installConfig:{command:"npx",args:["-y","@neondatabase/mcp-server-neon"]},requiredEnvVars:[{name:"NEON_API_KEY",description:"Neon API key"}],tags:["database","postgres","serverless","official"]},{id:"qdrant-mcp",name:"Qdrant MCP",description:"Vector search engine for keeping and retrieving memories",category:"database",repository:"https://github.com/qdrant/mcp-server-qdrant",website:"https://qdrant.tech",installationType:"pip",pipPackage:"mcp-server-qdrant",official:!0,installConfig:{command:"uvx",args:["mcp-server-qdrant"]},requiredEnvVars:[{name:"QDRANT_URL",description:"Qdrant server URL"},{name:"QDRANT_API_KEY",description:"Qdrant API key (optional)"}],tags:["database","vector","search","official"]},{id:"snowflake-mcp",name:"Snowflake MCP",description:"Snowflake data warehouse integration with read/write capabilities",category:"database",repository:"https://github.com/isaacwasserman/mcp-snowflake-server",website:"https://snowflake.com",installationType:"pip",pipPackage:"mcp-snowflake-server",installConfig:{command:"uvx",args:["mcp-snowflake-server"]},requiredEnvVars:[{name:"SNOWFLAKE_ACCOUNT",description:"Snowflake account identifier"},{name:"SNOWFLAKE_USER",description:"Snowflake username"},{name:"SNOWFLAKE_PASSWORD",description:"Snowflake password"}],tags:["database","snowflake","data-warehouse"]},{id:"bigquery-mcp",name:"BigQuery MCP",description:"Google BigQuery integration for schema inspection and queries",category:"database",repository:"https://github.com/LucasHild/mcp-server-bigquery",website:"https://cloud.google.com/bigquery",installationType:"pip",pipPackage:"mcp-server-bigquery",installConfig:{command:"uvx",args:["mcp-server-bigquery"]},requiredEnvVars:[{name:"GOOGLE_APPLICATION_CREDENTIALS",description:"Path to GCP service account JSON"}],tags:["database","bigquery","google","analytics"]},{id:"dbhub-mcp",name:"DBHub MCP",description:"Zero-dependency, token-efficient database MCP for Postgres, MySQL, SQL Server, MariaDB, SQLite",category:"database",repository:"https://github.com/bytebase/dbhub",installationType:"npx",npmPackage:"dbhub",installConfig:{command:"npx",args:["-y","dbhub"]},requiredEnvVars:[{name:"DATABASE_URL",description:"Database connection URL",example:"postgres://user:pass@localhost:5432/db"}],tags:["database","postgres","mysql","sqlite","mariadb","sqlserver","multi-database"]},{id:"pg-aiguide-mcp",name:"PostgreSQL AI Guide MCP",description:"PostgreSQL documentation and best practices through semantic search and curated skills",category:"database",repository:"https://github.com/timescale/pg-aiguide",website:"https://tigerdata.com",installationType:"npx",npmPackage:"@tigerdata/pg-aiguide",installConfig:{command:"npx",args:["-y","@tigerdata/pg-aiguide"]},tags:["database","postgres","postgresql","documentation","timescale"]},{id:"cloudflare-mcp",name:"Cloudflare MCP",description:"Integration with Cloudflare Workers, KV, R2, and D1",category:"cloud-platform",repository:"https://github.com/cloudflare/mcp-server-cloudflare",website:"https://cloudflare.com",installationType:"npx",npmPackage:"@cloudflare/mcp-server-cloudflare",official:!0,installConfig:{command:"npx",args:["-y","@cloudflare/mcp-server-cloudflare"]},requiredEnvVars:[{name:"CLOUDFLARE_API_TOKEN",description:"Cloudflare API Token"},{name:"CLOUDFLARE_ACCOUNT_ID",description:"Cloudflare Account ID"}],tags:["cloudflare","cloud","workers","official"]},{id:"docker-mcp",name:"Docker MCP",description:"Docker operations for container and compose stack management",category:"cloud-platform",repository:"https://github.com/sondt2709/docker-mcp",installationType:"npx",npmPackage:"docker-mcp",installConfig:{command:"npx",args:["-y","docker-mcp"]},tags:["docker","containers","devops"]},{id:"filesystem-mcp",name:"Filesystem MCP",description:"Direct local file system access with configurable permissions",category:"file-system",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",installationType:"npx",npmPackage:"@modelcontextprotocol/server-filesystem",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","${ALLOWED_DIRECTORIES}"]},requiredEnvVars:[{name:"ALLOWED_DIRECTORIES",description:"Comma-separated list of allowed directories",example:"/home/user/projects,/tmp"}],tags:["filesystem","files","local","official"]},{id:"git-mcp-official",name:"Git MCP",description:"Official Git integration for repository operations, commits, and history",category:"version-control",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",installationType:"pip",pipPackage:"mcp-server-git",official:!0,installConfig:{command:"uvx",args:["mcp-server-git"]},tags:["git","version-control","repository","official"]},{id:"memory-mcp",name:"Memory MCP",description:"Official memory/persistence server for maintaining context across sessions",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",installationType:"npx",npmPackage:"@modelcontextprotocol/server-memory",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},tags:["memory","persistence","context","official"]},{id:"fetch-mcp",name:"Fetch MCP",description:"Official HTTP fetch server for making web requests",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",installationType:"pip",pipPackage:"mcp-server-fetch",official:!0,installConfig:{command:"uvx",args:["mcp-server-fetch"]},tags:["fetch","http","web","requests","official"]},{id:"time-mcp",name:"Time MCP",description:"Official time server for date/time operations and timezones",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",installationType:"pip",pipPackage:"mcp-server-time",official:!0,installConfig:{command:"uvx",args:["mcp-server-time"]},tags:["time","date","timezone","official"]},{id:"sequential-thinking-mcp",name:"Sequential Thinking MCP",description:"Official server for step-by-step reasoning and problem solving",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",installationType:"npx",npmPackage:"@modelcontextprotocol/server-sequential-thinking",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},tags:["reasoning","thinking","problem-solving","official"]},{id:"everything-mcp",name:"Everything MCP",description:"Official demo server showcasing all MCP capabilities in one package",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",installationType:"npx",npmPackage:"@modelcontextprotocol/server-everything",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},tags:["demo","all-in-one","example","official"]},{id:"exa-mcp",name:"Exa Search MCP",description:"Exa AI Search API for real-time web information retrieval",category:"search-web",repository:"https://github.com/exa-labs/exa-mcp-server",website:"https://exa.ai",installationType:"npx",npmPackage:"exa-mcp-server",official:!0,installConfig:{command:"npx",args:["-y","exa-mcp-server"]},requiredEnvVars:[{name:"EXA_API_KEY",description:"Exa API key"}],tags:["search","exa","ai","official"]},{id:"perplexity-mcp",name:"Perplexity MCP",description:"Official Perplexity AI search and research integration",category:"search-web",repository:"https://github.com/perplexityai/modelcontextprotocol",website:"https://perplexity.ai",installationType:"npx",npmPackage:"@perplexity-ai/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@perplexity-ai/mcp-server"]},requiredEnvVars:[{name:"PERPLEXITY_API_KEY",description:"Perplexity API key"}],tags:["search","perplexity","ai","research","official"]},{id:"kagi-mcp",name:"Kagi MCP",description:"Official Kagi search and tools integration",category:"search-web",repository:"https://github.com/kagisearch/kagi-mcp",website:"https://kagi.com",installationType:"pip",pipPackage:"kagimcp",official:!0,installConfig:{command:"uvx",args:["kagimcp"]},requiredEnvVars:[{name:"KAGI_API_KEY",description:"Kagi API key"}],tags:["search","kagi","official"]},{id:"tavily-mcp",name:"Tavily MCP",description:"Tavily AI search API for intelligent web search",category:"search-web",repository:"https://github.com/tavily-ai/tavily-mcp",website:"https://tavily.com",installationType:"npx",npmPackage:"tavily-mcp",official:!0,installConfig:{command:"npx",args:["-y","tavily-mcp"]},requiredEnvVars:[{name:"TAVILY_API_KEY",description:"Tavily API key"}],tags:["search","tavily","ai","official"]},{id:"slack-mcp",name:"Slack MCP",description:"Most powerful MCP server for Slack with Stdio and SSE transports",category:"communication",repository:"https://github.com/korotovsky/slack-mcp-server",website:"https://slack.com",installationType:"npx",npmPackage:"slack-mcp-server",installConfig:{command:"npx",args:["-y","slack-mcp-server"]},requiredEnvVars:[{name:"SLACK_BOT_TOKEN",description:"Slack Bot OAuth Token"}],tags:["slack","chat","team"]},{id:"discord-mcp",name:"Discord MCP",description:"Discord API integration via JDA for seamless bot interaction with MCP clients",category:"communication",repository:"https://github.com/SaseQ/discord-mcp",website:"https://discord.com",installationType:"docker",dockerImage:"saseq/discord-mcp:latest",installConfig:{command:"docker",args:["run","--rm","-i","-e","DISCORD_TOKEN","-e","DISCORD_GUILD_ID","saseq/discord-mcp:latest"]},requiredEnvVars:[{name:"DISCORD_TOKEN",description:"Discord Bot Token"},{name:"DISCORD_GUILD_ID",description:"Default Discord Server ID (optional)"}],tags:["discord","chat","community","bot"]},{id:"linear-mcp",name:"Linear MCP",description:"Linear project management integration for issues, projects, and teams",category:"communication",repository:"https://github.com/tacticlaunch/mcp-linear",website:"https://linear.app",installationType:"npx",npmPackage:"@tacticlaunch/mcp-linear",installConfig:{command:"npx",args:["-y","@tacticlaunch/mcp-linear"]},requiredEnvVars:[{name:"LINEAR_API_KEY",description:"Linear API key"}],tags:["linear","issues","project-management"]},{id:"atlassian-mcp",name:"Atlassian MCP",description:"Confluence and Jira integration for documentation and issue tracking",category:"communication",repository:"https://github.com/sooperset/mcp-atlassian",website:"https://atlassian.com",installationType:"pip",pipPackage:"mcp-atlassian",installConfig:{command:"uvx",args:["mcp-atlassian"]},requiredEnvVars:[{name:"ATLASSIAN_URL",description:"Atlassian instance URL"},{name:"ATLASSIAN_EMAIL",description:"Atlassian email"},{name:"ATLASSIAN_API_TOKEN",description:"Atlassian API token"}],tags:["atlassian","jira","confluence"]},{id:"notion-mcp",name:"Notion MCP",description:"Official Notion integration for pages, databases, and blocks",category:"productivity",repository:"https://github.com/makenotion/notion-mcp-server",website:"https://notion.so",installationType:"npx",npmPackage:"@notionhq/notion-mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},requiredEnvVars:[{name:"NOTION_API_KEY",description:"Notion API integration token"}],tags:["notion","productivity","notes","database","official"]},{id:"obsidian-mcp",name:"Obsidian MCP",description:"Obsidian vault integration for file management, search, and manipulation",category:"productivity",repository:"https://github.com/MarkusPfundstein/mcp-obsidian",website:"https://obsidian.md",installationType:"npx",npmPackage:"mcp-obsidian",installConfig:{command:"npx",args:["-y","mcp-obsidian"]},requiredEnvVars:[{name:"OBSIDIAN_VAULT_PATH",description:"Path to Obsidian vault"}],tags:["obsidian","notes","markdown"]},{id:"todoist-mcp",name:"Todoist MCP",description:"Natural language task management with Todoist",category:"productivity",repository:"https://github.com/stevengonsalvez/todoist-mcp",website:"https://todoist.com",installationType:"npx",npmPackage:"todoist-mcp-server",installConfig:{command:"npx",args:["-y","todoist-mcp-server"]},requiredEnvVars:[{name:"TODOIST_API_TOKEN",description:"Todoist API token"}],tags:["todoist","tasks","productivity"]},{id:"google-workspace-mcp",name:"Google Workspace MCP",description:"Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Drive and more",category:"productivity",repository:"https://github.com/taylorwilsdon/google_workspace_mcp",website:"https://workspace.google.com",installationType:"pip",pipPackage:"google-workspace-mcp",installConfig:{command:"uvx",args:["google-workspace-mcp"]},requiredEnvVars:[{name:"GOOGLE_APPLICATION_CREDENTIALS",description:"Path to Google credentials"}],tags:["google","workspace","gmail","docs"]},{id:"context7-mcp",name:"Context7 MCP",description:"Up-to-date code documentation for LLMs and AI code editors",category:"developer-tools",repository:"https://github.com/upstash/context7",website:"https://context7.com",installationType:"npx",npmPackage:"@upstash/context7-mcp",official:!0,installConfig:{command:"npx",args:["-y","@upstash/context7-mcp"]},tags:["documentation","context","code","official"]},{id:"desktop-commander-mcp",name:"Desktop Commander MCP",description:"Terminal control, file system search, and diff file editing capabilities",category:"developer-tools",repository:"https://github.com/wonderwhy-er/DesktopCommanderMCP",installationType:"npx",npmPackage:"@wonderwhy-er/desktop-commander",installConfig:{command:"npx",args:["-y","@wonderwhy-er/desktop-commander"]},tags:["terminal","file-editing","diff","command-line","process"]},{id:"gemini-mcp-tool",name:"Gemini MCP Tool",description:"Interact with Google Gemini CLI for large file analysis and codebase exploration",category:"ai-services",repository:"https://github.com/jamubc/gemini-mcp-tool",installationType:"npx",npmPackage:"gemini-mcp-tool",installConfig:{command:"npx",args:["-y","gemini-mcp-tool"]},tags:["gemini","google","ai","file-analysis","codebase"]},{id:"sentry-mcp",name:"Sentry MCP",description:"Sentry.io integration for error tracking and performance monitoring",category:"developer-tools",repository:"https://github.com/getsentry/sentry-mcp",website:"https://sentry.io",installationType:"npx",npmPackage:"@sentry/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@sentry/mcp-server"]},requiredEnvVars:[{name:"SENTRY_AUTH_TOKEN",description:"Sentry Auth Token"},{name:"SENTRY_ORG",description:"Sentry Organization Slug"}],tags:["sentry","errors","monitoring","official"]},{id:"mcp-memory-service",name:"Memory Service MCP",description:"Automatic context memory for Claude, VS Code, Cursor - stop re-explaining",category:"developer-tools",repository:"https://github.com/doobidoo/mcp-memory-service",installationType:"pip",pipPackage:"mcp-memory-service",installConfig:{command:"uvx",args:["mcp-memory-service"]},tags:["memory","context","persistence"]},{id:"serena-mcp",name:"Serena MCP",description:"Powerful coding agent with semantic retrieval and editing via language servers",category:"coding-agents",repository:"https://github.com/oraios/serena",installationType:"pip",installConfig:{command:"uvx",args:["--from","git+https://github.com/oraios/serena","serena","start-mcp-server"]},tags:["coding","agent","language-server"]},{id:"figma-mcp",name:"Figma Context MCP",description:"Get Figma design data in ready-to-implement format",category:"developer-tools",repository:"https://github.com/GLips/Figma-Context-MCP",website:"https://figma.com",installationType:"npx",npmPackage:"figma-context-mcp",installConfig:{command:"npx",args:["-y","figma-context-mcp"]},requiredEnvVars:[{name:"FIGMA_ACCESS_TOKEN",description:"Figma Personal Access Token"}],tags:["figma","design","ui"]},{id:"talk-to-figma-mcp",name:"Talk to Figma MCP",description:"Cursor + Figma integration for reading and modifying designs",category:"developer-tools",repository:"https://github.com/grab/cursor-talk-to-figma-mcp",website:"https://figma.com",installationType:"npx",npmPackage:"cursor-talk-to-figma-mcp",installConfig:{command:"npx",args:["-y","cursor-talk-to-figma-mcp"]},requiredEnvVars:[{name:"FIGMA_ACCESS_TOKEN",description:"Figma Personal Access Token"}],tags:["figma","cursor","design"]},{id:"xcodebuild-mcp",name:"XcodeBuild MCP",description:"Xcode-related tools for building, testing, and managing iOS/macOS projects",category:"developer-tools",repository:"https://github.com/cameroncooke/XcodeBuildMCP",website:"https://developer.apple.com/xcode",installationType:"npx",npmPackage:"xcodebuildmcp",installConfig:{command:"npx",args:["-y","xcodebuildmcp"]},tags:["xcode","ios","macos","apple","swift"]},{id:"markdownify-mcp",name:"Markdownify MCP",description:"Convert almost anything to Markdown - PDFs, URLs, images, and more",category:"developer-tools",repository:"https://github.com/zcaceres/markdownify-mcp",installationType:"npx",npmPackage:"mcp-markdownify-server",installConfig:{command:"npx",args:["-y","mcp-markdownify-server"]},tags:["markdown","converter","pdf","ocr"]},{id:"elevenlabs-mcp",name:"ElevenLabs MCP",description:"Official ElevenLabs text-to-speech, voice cloning, and audio generation",category:"ai-services",repository:"https://github.com/elevenlabs/elevenlabs-mcp",website:"https://elevenlabs.io",installationType:"pip",pipPackage:"elevenlabs-mcp",official:!0,installConfig:{command:"uvx",args:["elevenlabs-mcp"]},requiredEnvVars:[{name:"ELEVENLABS_API_KEY",description:"ElevenLabs API key"}],tags:["elevenlabs","tts","voice","audio","official"]},{id:"llamacloud-mcp",name:"LlamaCloud MCP",description:"Connect to managed indices on LlamaCloud",category:"ai-services",repository:"https://github.com/run-llama/mcp-server-llamacloud",website:"https://cloud.llamaindex.ai",installationType:"npx",npmPackage:"@llamaindex/mcp-server-llamacloud",official:!0,installConfig:{command:"npx",args:["-y","@llamaindex/mcp-server-llamacloud"]},requiredEnvVars:[{name:"LLAMA_CLOUD_API_KEY",description:"LlamaCloud API key"}],tags:["llamaindex","rag","index","official"]},{id:"huggingface-spaces-mcp",name:"HuggingFace Spaces MCP",description:"Use HuggingFace Spaces from your MCP Client - images, audio, text",category:"ai-services",repository:"https://github.com/evalstate/mcp-hfspace",website:"https://huggingface.co/spaces",installationType:"npx",npmPackage:"@llmindset/mcp-hfspace",installConfig:{command:"npx",args:["-y","@llmindset/mcp-hfspace"]},requiredEnvVars:[{name:"HF_TOKEN",description:"HuggingFace API token"}],tags:["huggingface","spaces","models"]},{id:"n8n-mcp",name:"n8n MCP",description:"Build n8n workflows using Claude Desktop, Cursor, or Windsurf",category:"workflow-automation",repository:"https://github.com/czlonkowski/n8n-mcp",website:"https://n8n.io",installationType:"npx",npmPackage:"n8n-mcp",installConfig:{command:"npx",args:["-y","n8n-mcp"]},requiredEnvVars:[{name:"N8N_API_URL",description:"n8n instance URL"},{name:"N8N_API_KEY",description:"n8n API key"}],tags:["n8n","automation","workflows"]},{id:"echarts-mcp",name:"ECharts MCP",description:"Generate visual charts using Apache ECharts dynamically",category:"data-visualization",repository:"https://github.com/hustcc/mcp-echarts",website:"https://echarts.apache.org",installationType:"npx",npmPackage:"mcp-echarts",installConfig:{command:"npx",args:["-y","mcp-echarts"]},tags:["visualization","charts","echarts"]},{id:"mermaid-mcp",name:"Mermaid MCP",description:"Generate Mermaid diagrams and charts dynamically",category:"data-visualization",repository:"https://github.com/hustcc/mcp-mermaid",website:"https://mermaid.js.org",installationType:"npx",npmPackage:"mcp-mermaid",installConfig:{command:"npx",args:["-y","mcp-mermaid"]},tags:["diagrams","mermaid","flowcharts"]},{id:"datadog-mcp",name:"Datadog MCP",description:"Datadog monitoring and observability integration",category:"monitoring",repository:"https://github.com/winor30/mcp-server-datadog",website:"https://datadoghq.com",installationType:"npx",npmPackage:"@winor30/mcp-server-datadog",installConfig:{command:"npx",args:["-y","@winor30/mcp-server-datadog"]},requiredEnvVars:[{name:"DD_API_KEY",description:"Datadog API key"},{name:"DD_APP_KEY",description:"Datadog Application key"}],tags:["datadog","monitoring","observability"]},{id:"browserstack-mcp",name:"BrowserStack MCP",description:"Official BrowserStack testing and automation integration",category:"developer-tools",repository:"https://github.com/browserstack/mcp-server",website:"https://browserstack.com",installationType:"npx",npmPackage:"@browserstack/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@browserstack/mcp-server"]},requiredEnvVars:[{name:"BROWSERSTACK_USERNAME",description:"BrowserStack username"},{name:"BROWSERSTACK_ACCESS_KEY",description:"BrowserStack access key"}],tags:["browserstack","testing","automation","official"]},{id:"tableau-mcp",name:"Tableau MCP",description:"Official Tableau data visualization and analytics integration",category:"data-visualization",repository:"https://github.com/tableau/tableau-mcp",website:"https://tableau.com",installationType:"npx",npmPackage:"@tableau/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@tableau/mcp-server"]},requiredEnvVars:[{name:"TABLEAU_TOKEN",description:"Tableau API token"},{name:"TABLEAU_SITE",description:"Tableau site name"}],tags:["tableau","visualization","analytics","official"]},{id:"stripe-mcp",name:"Stripe MCP",description:"Official Stripe Agent Toolkit for payment integration",category:"finance",repository:"https://github.com/stripe/agent-toolkit",website:"https://stripe.com",installationType:"npx",npmPackage:"@stripe/agent-toolkit",official:!0,installConfig:{command:"npx",args:["-y","@stripe/agent-toolkit","mcp"]},requiredEnvVars:[{name:"STRIPE_SECRET_KEY",description:"Stripe Secret Key"}],tags:["stripe","payments","finance","official"]},{id:"alpaca-mcp",name:"Alpaca MCP",description:"Official Alpaca trading - stocks, ETFs, crypto, and options in plain English",category:"finance",repository:"https://github.com/alpacahq/alpaca-mcp-server",website:"https://alpaca.markets",installationType:"pip",pipPackage:"alpaca-mcp-server",official:!0,installConfig:{command:"uvx",args:["alpaca-mcp-server"]},requiredEnvVars:[{name:"ALPACA_API_KEY",description:"Alpaca API key"},{name:"ALPACA_SECRET_KEY",description:"Alpaca secret key"}],tags:["alpaca","trading","stocks","crypto","finance","official"]},{id:"paypal-mcp",name:"PayPal MCP",description:"PayPal Agent Toolkit for payment integration",category:"finance",repository:"https://github.com/paypal/agent-toolkit",website:"https://paypal.com",installationType:"npx",npmPackage:"@paypal/agent-toolkit",official:!0,installConfig:{command:"npx",args:["-y","@paypal/agent-toolkit"]},requiredEnvVars:[{name:"PAYPAL_CLIENT_ID",description:"PayPal Client ID"},{name:"PAYPAL_CLIENT_SECRET",description:"PayPal Client Secret"}],tags:["paypal","payments","finance","official"]},{id:"semgrep-mcp",name:"Semgrep MCP",description:"Static code analysis and security scanning with Semgrep integration",category:"security",repository:"https://github.com/Szowesgad/mcp-server-semgrep",website:"https://semgrep.dev",installationType:"npx",npmPackage:"mcp-server-semgrep",installConfig:{command:"npx",args:["-y","mcp-server-semgrep"]},tags:["semgrep","security","sast","static-analysis"]},{id:"pipedream-mcp",name:"Pipedream MCP",description:"Connect with 2,500+ APIs with 8,000+ prebuilt tools",category:"aggregator",repository:"https://github.com/PipedreamHQ/pipedream/tree/master/modelcontextprotocol",website:"https://pipedream.com",installationType:"npx",npmPackage:"@pipedream/mcp",official:!0,installConfig:{command:"npx",args:["-y","@pipedream/mcp"]},requiredEnvVars:[{name:"PIPEDREAM_API_KEY",description:"Pipedream API key"}],tags:["pipedream","integrations","apis","official"]},{id:"fastmcp",name:"FastMCP",description:"The fast, Pythonic way to build MCP servers and clients",category:"developer-tools",repository:"https://github.com/jlowin/fastmcp",installationType:"pip",pipPackage:"fastmcp",installConfig:{command:"pip",args:["install","fastmcp"]},tags:["framework","python","sdk"]},{id:"mcp-use",name:"MCP Use",description:"Easiest way to interact with MCP servers with custom agents",category:"developer-tools",repository:"https://github.com/mcp-use/mcp-use",installationType:"pip",pipPackage:"mcp-use",installConfig:{command:"pip",args:["install","mcp-use"]},tags:["framework","agents","python"]},{id:"unity-mcp",name:"Unity MCP",description:"MCP server for Unity Editor - designed for Claude, Cursor, Gemini and more",category:"developer-tools",repository:"https://github.com/CoplayDev/unity-mcp",website:"https://unity.com",installationType:"pip",installConfig:{command:"uvx",args:["--from","git+https://github.com/CoplayDev/unity-mcp","unity-mcp"]},tags:["unity","game-dev","editor","gamedev"]},{id:"arxiv-mcp",name:"ArXiv MCP",description:"Search ArXiv research papers",category:"other",repository:"https://github.com/blazickjp/arxiv-mcp-server",website:"https://arxiv.org",installationType:"pip",pipPackage:"arxiv-mcp-server",installConfig:{command:"uvx",args:["arxiv-mcp-server"]},tags:["arxiv","research","papers"]},{id:"octocode-mcp",name:"Octocode MCP",description:"AI-powered developer assistant for GitHub and NPM research",category:"developer-tools",repository:"https://github.com/bgauryy/octocode-mcp",installationType:"npx",npmPackage:"octocode-mcp",installConfig:{command:"npx",args:["-y","octocode-mcp"]},requiredEnvVars:[{name:"GITHUB_PERSONAL_ACCESS_TOKEN",description:"GitHub Personal Access Token"}],tags:["github","npm","research","code"]},{id:"gpt-researcher-mcp",name:"GPT Researcher MCP",description:"Deep research agent with MCP support for comprehensive web research and report generation",category:"search-web",repository:"https://github.com/assafelovic/gptr-mcp",website:"https://gptr.dev",stars:24750,installationType:"source",installConfig:{command:"python",args:["server.py"]},requiredEnvVars:[{name:"OPENAI_API_KEY",description:"OpenAI API key for LLM capabilities",example:"sk-xxxxx"},{name:"TAVILY_API_KEY",description:"Tavily API key for web search",example:"tvly-xxxxx"}],tags:["research","web-search","deep-research","ai","tavily"]},{id:"mcp-chrome",name:"Chrome MCP",description:"Chrome extension-based MCP server for browser automation, screenshots, and content analysis",category:"browser-automation",repository:"https://github.com/hangwin/mcp-chrome",stars:9803,installationType:"npx",npmPackage:"mcp-chrome-bridge",installConfig:{command:"npx",args:["-y","mcp-chrome-bridge"]},tags:["chrome","browser","automation","extension","screenshot"]},{id:"aws-mcp",name:"AWS Core MCP",description:"AWS MCP Servers - dynamic orchestrator for specialized AWS services including Bedrock, Lambda, S3, and CloudWatch",category:"cloud-platform",repository:"https://github.com/awslabs/mcp",website:"https://awslabs.github.io/mcp/",stars:7801,installationType:"pip",pipPackage:"awslabs.core-mcp-server",official:!0,installConfig:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},requiredEnvVars:[{name:"AWS_PROFILE",description:"AWS profile name for credentials",example:"default"},{name:"AWS_REGION",description:"AWS region",example:"us-east-1"}],tags:["aws","cloud","bedrock","lambda","s3","cloudwatch","official"]},{id:"git-mcp",name:"GitMCP",description:"Remote MCP server that transforms GitHub projects into documentation hubs for AI tools",category:"version-control",repository:"https://github.com/idosal/git-mcp",website:"https://gitmcp.io",stars:7328,installationType:"npx",npmPackage:"mcp-remote",installConfig:{command:"npx",args:["-y","mcp-remote","https://gitmcp.io/docs"]},tags:["git","github","documentation","remote","version-control"]},{id:"browser-tools-mcp",name:"BrowserTools MCP",description:"Monitor browser logs and capture browser data from Cursor and MCP-compatible IDEs via Chrome extension",category:"browser-automation",repository:"https://github.com/AgentDeskAI/browser-tools-mcp",website:"https://browsertools.agentdesk.ai",stars:6961,installationType:"npx",npmPackage:"@agentdeskai/browser-tools-mcp",installConfig:{command:"npx",args:["-y","@agentdeskai/browser-tools-mcp@latest"]},tags:["browser","devtools","chrome","logs","debugging"]},{id:"hexstrike-ai",name:"HexStrike AI",description:"Advanced MCP server for AI agents to run 150+ cybersecurity tools for pentesting and vulnerability discovery",category:"security",repository:"https://github.com/0x4m4/hexstrike-ai",stars:5690,installationType:"source",installConfig:{command:"python3",args:["hexstrike_mcp.py","--server","http://localhost:8888"]},requiredEnvVars:[{name:"HEXSTRIKE_PATH",description:"Path to cloned hexstrike-ai repository",example:"/path/to/hexstrike-ai"}],tags:["security","pentesting","cybersecurity","vulnerability"]},{id:"spec-workflow-mcp",name:"Spec Workflow MCP",description:"Structured spec-driven development workflow tools for AI-assisted software development with real-time web dashboard",category:"developer-tools",repository:"https://github.com/Pimzino/spec-workflow-mcp",stars:3569,installationType:"npx",npmPackage:"@pimzino/spec-workflow-mcp",installConfig:{command:"npx",args:["-y","@pimzino/spec-workflow-mcp@latest","${PROJECT_PATH}"]},requiredEnvVars:[{name:"PROJECT_PATH",description:"Path to your project directory",example:"/path/to/your/project"}],tags:["workflow","spec-driven","dashboard","vscode","development"]},{id:"excel-mcp-server",name:"Excel MCP",description:"Manipulate Excel files without Microsoft Excel - create, read, modify workbooks with formulas, formatting, and charts",category:"productivity",repository:"https://github.com/haris-musa/excel-mcp-server",stars:3079,installationType:"pip",pipPackage:"excel-mcp-server",installConfig:{command:"uvx",args:["excel-mcp-server","stdio"]},tags:["excel","spreadsheet","office","xlsx","formulas","charts"]},{id:"mcp-context-forge",name:"MCP Context Forge",description:"IBM MCP Gateway & Registry - federates MCP and REST services with discovery, auth, rate-limiting, and observability",category:"aggregator",repository:"https://github.com/IBM/mcp-context-forge",website:"https://ibm.github.io/mcp-context-forge/",stars:3056,installationType:"pip",pipPackage:"mcp-contextforge-gateway",official:!0,installConfig:{command:"uvx",args:["--from","mcp-contextforge-gateway","mcpgateway","--host","0.0.0.0","--port","4444"]},requiredEnvVars:[{name:"JWT_SECRET_KEY",description:"JWT secret key for authentication",example:"my-secret-key"}],tags:["ibm","gateway","registry","federation","proxy","official","enterprise"]},{id:"mobile-mcp",name:"Mobile MCP",description:"Scalable mobile automation and development through a platform-agnostic interface for iOS and Android devices",category:"developer-tools",repository:"https://github.com/mobile-next/mobile-mcp",stars:2969,installationType:"npx",npmPackage:"@mobilenext/mobile-mcp",installConfig:{command:"npx",args:["-y","@mobilenext/mobile-mcp@latest"]},tags:["mobile","ios","android","automation","simulator","emulator","testing"]},{id:"claude-code-mcp",name:"Claude Code MCP",description:"Run Claude Code in one-shot mode with permissions bypassed for direct agent access to file editing and terminal",category:"coding-agents",repository:"https://github.com/steipete/claude-code-mcp",stars:989,installationType:"npx",npmPackage:"@steipete/claude-code-mcp",installConfig:{command:"npx",args:["-y","@steipete/claude-code-mcp@latest"]},tags:["claude","coding","agent","cursor","windsurf"]},{id:"ros-mcp-server",name:"ROS MCP Server",description:"Connect LLMs with ROS/ROS2 robots for natural language robot commanding and real-time sensor visibility",category:"other",repository:"https://github.com/robotmcp/ros-mcp-server",stars:913,installationType:"pip",pipPackage:"ros-mcp-server",official:!0,installConfig:{command:"python",args:["-m","ros_mcp_server.server"]},tags:["ros","ros2","robotics","robots","sensors"]},{id:"gmail-mcp",name:"Gmail MCP",description:"Gmail integration with auto authentication for AI assistants to manage email through natural language",category:"communication",repository:"https://github.com/GongRzhe/Gmail-MCP-Server",website:"https://gmail.google.com",stars:895,installationType:"npx",npmPackage:"@gongrzhe/server-gmail-autoauth-mcp",installConfig:{command:"npx",args:["-y","@gongrzhe/server-gmail-autoauth-mcp"]},requiredEnvVars:[{name:"GMAIL_OAUTH_PATH",description:"Path to GCP OAuth credentials JSON file",example:"/path/to/gcp-oauth.keys.json"},{name:"GMAIL_CREDENTIALS_PATH",description:"Path where authenticated tokens are stored",example:"/path/to/credentials.json"}],tags:["gmail","email","google","communication","oauth"]},{id:"mcp-knowledge-graph",name:"MCP Knowledge Graph",description:"Persistent memory for AI models through a local knowledge graph with entities, relations, and observations",category:"developer-tools",repository:"https://github.com/shaneholloman/mcp-knowledge-graph",stars:764,installationType:"npx",npmPackage:"mcp-knowledge-graph",installConfig:{command:"npx",args:["-y","mcp-knowledge-graph","--memory-path","${MEMORY_PATH}"]},requiredEnvVars:[{name:"MEMORY_PATH",description:"Directory path where memory files are stored",example:"/Users/username/.aim"}],tags:["memory","knowledge-graph","persistence","context","entities"]},{id:"kubectl-mcp",name:"kubectl MCP",description:"Kubernetes cluster management for AI assistants with pod, service, Helm, and monitoring capabilities",category:"cloud-platform",repository:"https://github.com/rohitg00/kubectl-mcp-server",stars:750,installationType:"pip",pipPackage:"kubectl-mcp-tool",installConfig:{command:"python",args:["-m","kubectl_mcp_tool.mcp_server"]},requiredEnvVars:[{name:"KUBECONFIG",description:"Path to Kubernetes config file",example:"~/.kube/config"}],tags:["kubernetes","k8s","kubectl","helm","cloud","devops"]},{id:"apple-docs-mcp",name:"Apple Docs MCP",description:"Access Apple developer documentation, frameworks, APIs, SwiftUI, UIKit, and WWDC videos through MCP",category:"developer-tools",repository:"https://github.com/kimsungwhee/apple-docs-mcp",website:"https://developer.apple.com",stars:697,installationType:"npx",npmPackage:"@kimsungwhee/apple-docs-mcp",installConfig:{command:"npx",args:["-y","@kimsungwhee/apple-docs-mcp"]},tags:["apple","documentation","swiftui","uikit","wwdc","ios","macos"]},{id:"linkedin-mcp",name:"LinkedIn MCP",description:"LinkedIn integration for AI assistants to scrape profiles, companies, and search jobs",category:"social-media",repository:"https://github.com/stickerdaniel/linkedin-mcp-server",website:"https://linkedin.com",stars:685,installationType:"docker",dockerImage:"stickerdaniel/linkedin-mcp-server:latest",installConfig:{command:"docker",args:["run","--rm","-i","-e","LINKEDIN_COOKIE","stickerdaniel/linkedin-mcp-server:latest"]},requiredEnvVars:[{name:"LINKEDIN_COOKIE",description:"LinkedIn session cookie for authentication",example:"li_at=YOUR_COOKIE_VALUE"}],tags:["linkedin","social","jobs","profiles","scraping"]},{id:"mcp-proxy",name:"MCP Proxy",description:"Aggregates multiple MCP servers behind a single HTTP entrypoint with SSE and streamable HTTP support",category:"aggregator",repository:"https://github.com/TBXark/mcp-proxy",stars:612,installationType:"docker",dockerImage:"ghcr.io/tbxark/mcp-proxy:latest",installConfig:{command:"docker",args:["run","-i","--rm","-p","9090:9090","-v","${MCP_PROXY_CONFIG}:/config/config.json","ghcr.io/tbxark/mcp-proxy:latest"]},requiredEnvVars:[{name:"MCP_PROXY_CONFIG",description:"Path to MCP proxy configuration JSON file",example:"/path/to/config.json"}],tags:["proxy","aggregator","sse","http","multi-server"]},{id:"iterm-mcp",name:"iTerm MCP",description:"Execute commands in active iTerm sessions with REPL interactions and CLI assistance",category:"developer-tools",repository:"https://github.com/ferrislucas/iterm-mcp",stars:505,installationType:"npx",npmPackage:"iterm-mcp",installConfig:{command:"npx",args:["-y","iterm-mcp"]},tags:["iterm","terminal","macos","repl","cli"]},{id:"genai-toolbox-mcp",name:"GenAI Toolbox MCP",description:"Google's official MCP Toolbox for Databases - Postgres, MySQL, MongoDB, Redis, BigQuery, Spanner, and more",category:"database",repository:"https://github.com/googleapis/genai-toolbox",website:"https://googleapis.github.io/genai-toolbox/",stars:12234,installationType:"pip",pipPackage:"toolbox-core",official:!0,installConfig:{command:"uvx",args:["toolbox-langchain"]},tags:["google","database","postgres","mysql","mongodb","redis","bigquery","spanner","official"]},{id:"fastapi-mcp",name:"FastAPI MCP",description:"Expose FastAPI endpoints as MCP tools with authentication and authorization support",category:"developer-tools",repository:"https://github.com/tadata-org/fastapi_mcp",stars:11346,installationType:"pip",pipPackage:"fastapi-mcp",installConfig:{command:"pip",args:["install","fastapi-mcp"]},tags:["fastapi","api","rest","python","authentication","framework"]},{id:"claude-flow-mcp",name:"Claude Flow MCP",description:"Agent orchestration platform for Claude - deploy multi-agent swarms and coordinate autonomous workflows",category:"coding-agents",repository:"https://github.com/ruvnet/claude-flow",stars:11184,installationType:"npx",npmPackage:"claude-flow",installConfig:{command:"npx",args:["-y","claude-flow@alpha","init"]},tags:["claude","multi-agent","swarm","orchestration","workflow","autonomous"]},{id:"pal-mcp-server",name:"PAL MCP Server",description:"Multi-model support for Claude Code - use Gemini, OpenAI, OpenRouter, Azure, Grok, Ollama together",category:"ai-services",repository:"https://github.com/BeehiveInnovations/pal-mcp-server",stars:10758,installationType:"source",installConfig:{command:"python",args:["-m","pal_mcp_server"]},requiredEnvVars:[{name:"OPENROUTER_API_KEY",description:"OpenRouter API key (optional)",example:"sk-or-xxxxx"}],tags:["multi-model","gemini","openai","ollama","azure","grok","openrouter"]},{id:"browser-mcp",name:"Browser MCP",description:"Browser control MCP server via Chrome extension - navigate, click, type, and extract data",category:"browser-automation",repository:"https://github.com/BrowserMCP/mcp",stars:5362,installationType:"npx",npmPackage:"@anthropic/browser-mcp",installConfig:{command:"npx",args:["-y","@anthropic/browser-mcp"]},tags:["browser","chrome","extension","automation","web"]},{id:"mcp-playwright-ea",name:"Playwright MCP (ExecuteAutomation)",description:"Alternative Playwright MCP server for browser and API automation in Claude, Cursor, and more",category:"browser-automation",repository:"https://github.com/executeautomation/mcp-playwright",stars:5116,installationType:"npx",npmPackage:"@executeautomation/playwright-mcp-server",installConfig:{command:"npx",args:["-y","@executeautomation/playwright-mcp-server"]},tags:["playwright","browser","automation","testing","api"]},{id:"claude-context-mcp",name:"Claude Context MCP",description:"Code search MCP for Claude Code using vector database - make entire codebase the context",category:"developer-tools",repository:"https://github.com/zilliztech/claude-context",stars:4955,installationType:"npx",npmPackage:"@anthropic/claude-context",installConfig:{command:"npx",args:["-y","@anthropic/claude-context"]},tags:["code-search","vector-db","context","semantic-search","zilliz","milvus"]},{id:"ida-pro-mcp",name:"IDA Pro MCP",description:"AI-powered reverse engineering assistant bridging IDA Pro with language models",category:"security",repository:"https://github.com/mrexodia/ida-pro-mcp",stars:4906,installationType:"pip",pipPackage:"ida-pro-mcp",installConfig:{command:"pip",args:["install","ida-pro-mcp"]},tags:["ida-pro","reverse-engineering","binary-analysis","security","malware"]},{id:"deep-research-mcp",name:"Deep Research MCP",description:"Use any LLM for deep research with SSE API and MCP server support",category:"search-web",repository:"https://github.com/u14app/deep-research",stars:4302,installationType:"pip",pipPackage:"deep-research",installConfig:{command:"uvx",args:["deep-research"]},requiredEnvVars:[{name:"OPENAI_API_KEY",description:"OpenAI API key for LLM"}],tags:["research","deep-research","llm","sse","web-search"]},{id:"cipher-mcp",name:"Cipher MCP",description:"Memory layer for coding agents - persistent context for Cursor, Claude Code, Windsurf, and Cline",category:"developer-tools",repository:"https://github.com/campfirein/cipher",stars:3399,installationType:"npx",npmPackage:"@byterover/cipher-mcp",installConfig:{command:"npx",args:["-y","@byterover/cipher-mcp"]},tags:["memory","context","persistence","coding-agents","byterover"]},{id:"metorial-mcp",name:"Metorial MCP",description:"Connect any AI model to 600+ integrations powered by MCP with containerized security",category:"aggregator",repository:"https://github.com/metorial/metorial",stars:3201,installationType:"docker",dockerImage:"metorial/metorial:latest",installConfig:{command:"docker",args:["run","-i","--rm","metorial/metorial:latest"]},tags:["integrations","aggregator","docker","multi-tool","security"]},{id:"osaurus-mcp",name:"Osaurus MCP",description:"macOS LLM server - run local or cloud models with OpenAI/Anthropic compatible APIs",category:"ai-services",repository:"https://github.com/dinoki-ai/osaurus",stars:2962,installationType:"source",installConfig:{command:"osaurus",args:["serve"]},tags:["macos","local-llm","mlx","apple-silicon","openai-compatible","swift"]},{id:"shadcn-ui-mcp",name:"shadcn/ui MCP",description:"Context about shadcn/ui components for LLMs - React, Vue, Svelte, and React Native support",category:"developer-tools",repository:"https://github.com/Jpisnice/shadcn-ui-mcp-server",stars:2582,installationType:"npx",npmPackage:"shadcn-ui-mcp",installConfig:{command:"npx",args:["-y","shadcn-ui-mcp"]},tags:["shadcn","ui","react","vue","svelte","react-native","tailwind"]},{id:"shippie-mcp",name:"Shippie MCP",description:"Extendable code review and QA agent for CI/CD pipelines and GitHub",category:"developer-tools",repository:"https://github.com/mattzcarey/shippie",stars:2317,installationType:"npx",npmPackage:"shippie",installConfig:{command:"npx",args:["-y","shippie"]},tags:["code-review","qa","ci-cd","github","agent"]},{id:"devdocs-mcp",name:"DevDocs MCP",description:"Free, private, UI-based tech documentation MCP server for coders and developers",category:"developer-tools",repository:"https://github.com/cyberagiinc/DevDocs",stars:2003,installationType:"source",installConfig:{command:"python",args:["-m","devdocs"]},tags:["documentation","docs","reference","api-docs","crawler"]},{id:"brightdata-mcp",name:"Bright Data MCP",description:"Official Bright Data MCP for web scraping, data extraction, and anti-bot bypass",category:"browser-automation",repository:"https://github.com/brightdata/brightdata-mcp",website:"https://brightdata.com",stars:1845,installationType:"npx",npmPackage:"@anthropic/brightdata-mcp",official:!0,installConfig:{command:"npx",args:["-y","@anthropic/brightdata-mcp"]},requiredEnvVars:[{name:"BRIGHTDATA_API_KEY",description:"Bright Data API key"}],tags:["scraping","web-data","anti-bot","proxy","data-extraction","official"]},{id:"mcpjam-inspector",name:"MCP Inspector",description:"Build ChatGPT Apps and MCP servers locally with inspection and debugging tools",category:"developer-tools",repository:"https://github.com/MCPJam/inspector",stars:1545,installationType:"npx",npmPackage:"@mcpjam/inspector",installConfig:{command:"npx",args:["-y","@mcpjam/inspector"]},tags:["inspector","debugging","chatgpt","development","testing"]},{id:"mcptools",name:"MCP Tools CLI",description:"Command-line interface for interacting with MCP servers via stdio and HTTP transport",category:"developer-tools",repository:"https://github.com/f/mcptools",stars:1426,installationType:"npx",npmPackage:"mcptools",installConfig:{command:"npx",args:["-y","mcptools"]},tags:["cli","tools","stdio","http","debugging"]},{id:"mcp-scan",name:"MCP Scan",description:"Security vulnerability scanner for MCP connections - constrain, log, and audit",category:"security",repository:"https://github.com/invariantlabs-ai/mcp-scan",stars:1381,installationType:"pip",pipPackage:"mcp-scan",installConfig:{command:"uvx",args:["mcp-scan"]},tags:["security","vulnerability","audit","scanning","compliance"]},{id:"unreal-mcp",name:"Unreal Engine MCP",description:"Control Unreal Engine 5 through natural language via MCP for Cursor, Windsurf, and Claude",category:"developer-tools",repository:"https://github.com/chongdashu/unreal-mcp",stars:1239,installationType:"pip",pipPackage:"unreal-mcp",installConfig:{command:"uvx",args:["unreal-mcp"]},tags:["unreal-engine","ue5","game-dev","editor","blueprints"]},{id:"web-eval-agent",name:"Web Eval Agent MCP",description:"Autonomous web application evaluation and testing with Playwright integration",category:"developer-tools",repository:"https://github.com/refreshdotdev/web-eval-agent",stars:1231,installationType:"npx",npmPackage:"@refreshdotdev/web-eval-agent",installConfig:{command:"npx",args:["-y","@refreshdotdev/web-eval-agent"]},tags:["testing","qa","evaluation","playwright","autonomous"]},{id:"mcp-unity-alt",name:"MCP Unity (CoderGamester)",description:"Unity Editor MCP plugin for OpenAI, Gemini, Claude, Deepseek, and Grok integration",category:"developer-tools",repository:"https://github.com/CoderGamester/mcp-unity",stars:1193,installationType:"npx",npmPackage:"mcp-unity",installConfig:{command:"npx",args:["-y","mcp-unity"]},tags:["unity","game-dev","editor","c-sharp","multi-model"]},{id:"xmcp-framework",name:"xMCP Framework",description:"TypeScript MCP framework for building MCP servers with type safety and DX focus",category:"developer-tools",repository:"https://github.com/basementstudio/xmcp",stars:1168,installationType:"npm",npmPackage:"xmcp",installConfig:{command:"npm",args:["install","xmcp"]},tags:["framework","typescript","sdk","type-safe","developer-tools"]}];function So(e){return se.filter(o=>o.category===e)}function Dd(e){let o=e.toLowerCase();return se.filter(n=>n.name.toLowerCase().includes(o)||n.description.toLowerCase().includes(o)||n.tags?.some(i=>i.toLowerCase().includes(o)))}function bc(){return Array.from(new Set(se.map(e=>e.category)))}function Qn(){let e=new Map;return se.forEach(o=>{o.tags?.forEach(n=>{e.set(n,(e.get(n)||0)+1)})}),Array.from(e.keys()).sort((o,n)=>{let i=(e.get(n)||0)-(e.get(o)||0);return i!==0?i:o.localeCompare(n)})}function Ud(e){return se.filter(o=>o.tags?.includes(e))}function Ld(e){return se.filter(o=>o.tags?.includes(e)).length}function Rd(e){return e.split("-").map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}function Fd(e){return{"browser-automation":"WEB",database:"DB","cloud-platform":"CLOUD","developer-tools":"DEV","file-system":"FS",communication:"CHAT","search-web":"Search","ai-services":"AI","workflow-automation":"Fast","version-control":"EDIT","data-visualization":"DATA","coding-agents":"AGENT",security:"SEC",productivity:"List",monitoring:"MON",finance:"FIN","social-media":"SOCIAL",aggregator:"LINK",other:"Package"}[e]||"Package"}function $c(e){let o=`${Fd(e.category)} ${e.name}`;return e.official&&(o+=` ${s("cyan","[Official]")}`),o+=` - ${l(e.description.slice(0,45))}${e.description.length>45?"...":""}`,o}async function Vd(){let e=xt();console.log(),console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+l("[Step 1/6]")+" "+m("Select Target Client")+" ".repeat(28)+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log();let o=["cursor","claude-desktop","claude-code","opencode","codex","gemini-cli","windsurf","trae","antigravity","goose","kiro","zed","vscode-cline","vscode-roo","vscode-continue"],n=[];for(let t of o){let r=D[t],a=be(t),c=`${r.name} - ${l(r.description)}`;a?c+=` ${s("green","\u25CB")}`:c+=` ${s("dim","X")}`,e===t&&(c=`${s("green","\u2605")} ${c} ${s("yellow","(Current)")}`),n.push({name:c,value:t,disabled:a?!1:"Not installed"})}n.sort((t,r)=>t.disabled&&!r.disabled?1:!t.disabled&&r.disabled||e===t.value?-1:e===r.value?1:0),n.push(new E),n.push({name:`${s("cyan","-")} Custom Path - ${l("Specify your own config path")}`,value:"custom"}),n.push(new E),n.push({name:`${s("dim","- Back")}`,value:"back"});let i=await O({message:"Where would you like to install the MCP?",choices:n,loop:!1,pageSize:15});if(i==="back")return null;if(i==="custom"){let t=await Dv();return t?{client:"custom",customPath:t}:null}return{client:i}}async function Dv(){console.log(),console.log(` ${s("blue","INFO")} Enter the full path to your MCP config file`),console.log(` ${l("Leave empty to go back")}`),console.log();let e=await q({message:"Config path (or Enter to go back):",validate:o=>o.trim()?o.endsWith(".json")?!0:"Path must be a .json file":!0});if(!e||!e.trim())return null;if(e.startsWith("~")){let o=process.env.HOME||process.env.USERPROFILE||"";return e.replace("~",o)}return e}async function Gd(){console.log(),console.log(` ${l("[Step 2/6]")} ${m("Browse Method")}`),console.log();let e=[{name:`- Search MCPs - ${l("Find by name, description, or tags")}`,value:"search"},{name:`- Browse by Category - ${l(`${bc().length} categories`)}`,value:"category"},{name:`- Browse by Tag - ${l(`${Qn().length} tags`)}`,value:"tag"},{name:`- Popular MCPs - ${l("Top 20 most popular")}`,value:"popular"},{name:`- Full List (A-Z) - ${l(`All ${se.length} MCPs alphabetically`)}`,value:"all"},new E,{name:`${s("dim","- Back")}`,value:"back"}];return await O({message:"",choices:e,loop:!1})}async function Bd(){return console.log(),console.log(` ${l("[Step 3/6]")} ${m("Select MCP")}`),console.log(),console.log(` ${s("blue","INFO")} Type to search by name, description, or tags`),console.log(),await kt({message:"Search MCPs:",source:o=>{let n={name:`${s("dim","- Back to browse options")}`,value:"back"};if(!o||!o.trim())return[...se.slice(0,15).map(t=>({name:$c(t),value:t,description:t.tags?.slice(0,3).join(", ")})),{name:"\u2500".repeat(40),value:"back",disabled:!0},n];let i=Dd(o.trim());return i.length===0?[{name:`${s("yellow","WARN")} No MCPs found matching "${o}"`,value:"back",disabled:"Try different keywords"},n]:[...i.map(t=>({name:$c(t),value:t,description:t.tags?.slice(0,3).join(", ")})),{name:"\u2500".repeat(40),value:"back",disabled:!0},n]},pageSize:12})}async function Wd(){console.log(),console.log(` ${l("[Step 3/6]")} ${m("Select MCP")}`),console.log();let o=bc().map(t=>({name:`${Fd(t)} ${Rd(t)} (${So(t).length})`,value:t}));o.sort((t,r)=>{let a=So(t.value).length;return So(r.value).length-a}),o.push(new E),o.push({name:`${s("dim","- Back")}`,value:"back"});let n=await O({message:"Select a category:",choices:o,loop:!1,pageSize:15});if(n==="back")return"back";let i=So(n);return await er(i,Rd(n))}function Zd(e){return e.charAt(0).toUpperCase()+e.slice(1)}async function Hd(){console.log(),console.log(` ${l("[Step 3/6]")} ${m("Select MCP")}`),console.log(),console.log(` ${s("blue","INFO")} Type to filter ${Qn().length} tags`),console.log();let e=Qn(),o=await kt({message:"Search tags:",source:i=>{let t={name:`${s("dim","- Back to browse options")}`,value:"back"},r=!i||!i.trim()?e.slice(0,20):e.filter(a=>a.toLowerCase().includes(i.toLowerCase().trim()));return r.length===0?[{name:`${s("yellow","WARN")} No tags found matching "${i}"`,value:"back",disabled:"Try different keywords"},t]:[...r.map(a=>({name:`- ${Zd(a)} (${Ld(a)} MCPs)`,value:a})),{name:"\u2500".repeat(40),value:"back",disabled:!0},t]},pageSize:15});if(o==="back")return"back";let n=Ud(o);return await er(n,`Tag: ${Zd(o)}`)}async function qd(){console.log(),console.log(` ${l("[Step 3/6]")} ${m("Select MCP")}`);let e=[...se].sort((o,n)=>(n.stars??0)-(o.stars??0)).slice(0,20);return await er(e,"Popular MCPs")}async function Kd(){console.log(),console.log(` ${l("[Step 3/6]")} ${m("Select MCP")}`);let e=[...se].sort((o,n)=>o.name.localeCompare(n.name));return await er(e,`All MCPs (A-Z) - ${e.length} total`)}async function er(e,o){console.log(),console.log(` ${m(o)}`),console.log();let n=e.map(t=>({name:$c(t),value:t}));return n.push(new E),n.push({name:`${s("dim","- Back")}`,value:"back"}),await O({message:"Select an MCP to install:",choices:n,loop:!1,pageSize:15})}async function Jd(e){let o=e.requiredEnvVars;if(!o||o.length===0)return{};console.log(),console.log(` ${l("[Step 5/6]")} ${m("Environment Variables")}`),console.log(),console.log(s("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","WARN")} ${m("Environment Variables Required")}`+" ".repeat(26)+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("This MCP requires the following environment variables:")}`),console.log();for(let t of o)console.log(` ${s("cyan",t.name)}`),console.log(` ${l(t.description)}`),t.example&&console.log(` ${l("Example:")} ${s("dim",t.example)}`),console.log();let n=await O({message:"Would you like to configure these now?",choices:[{name:`${s("green","\u2705")} Configure environment variables`,value:"configure"},{name:`${s("yellow","\u25CB")} Skip - ${l("Configure later manually")}`,value:"skip"},new E,{name:`${s("dim","- Back")}`,value:"back"}],loop:!1});if(n==="back")return"back";if(n==="skip")return{};let i={};for(let t of o){console.log(),console.log(` ${s("cyan",t.name)}: ${l(t.description)}`),t.example&&console.log(` ${l("Example:")} ${t.example}`);let r=await q({message:`${t.name}:`,validate:a=>!a.trim()&&!t.name.includes("OPTIONAL")?`${t.name} is required`:!0});r.trim()&&(i[t.name]=r.trim())}return i}async function Xd(e,o){let n=D[o];return console.log(),await O({message:`Install ${e.name} to ${n?.name||o}?`,choices:[{name:`${s("green","\u2705")} Proceed with installation`,value:"proceed"},new E,{name:`${s("dim","- Back to edit options")}`,value:"back"},{name:`${s("dim","X Cancel")}`,value:"cancel"}],loop:!1})}function Yd(e){console.log(),console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+m(e.name)+(e.official?` ${s("cyan","[Official]")}`:"")+" ".repeat(Math.max(0,60-e.name.length-(e.official?12:0)))+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("Description:")} ${e.description}`),console.log(` ${l("Category:")} ${s("cyan",e.category)}`),console.log(` ${l("Installation:")} ${s("yellow",e.installationType)}`),e.website&&console.log(` ${l("Website:")} ${s("blue",e.website)}`),console.log(` ${l("Repository:")} ${s("blue",e.repository)}`),e.tags&&e.tags.length>0&&console.log(` ${l("Tags:")} ${e.tags.map(o=>s("dim",o)).join(", ")}`),console.log()}function Qd(e,o,n,i){let t=D[o];console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+m("Configuration Preview")+" ".repeat(39)+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log();let r={...e.installConfig.env||{},...i},a={command:e.installConfig.command,args:[...e.installConfig.args],...Object.keys(r).length>0&&{env:r}};if(console.log(` ${l("Server ID:")} ${s("cyan",e.id)}`),console.log(` ${l("Command:")} ${s("green",a.command)}`),console.log(` ${l("Args:")} ${s("yellow",a.args.join(" "))}`),Object.keys(r).length>0){console.log(` ${l("Environment Variables:")}`);for(let[c,u]of Object.entries(r)){let p=u.length>30?u.slice(0,27)+"...":u;console.log(` ${s("cyan",c)}: ${l(p)}`)}}console.log(),console.log(` ${m("Target:")}`),console.log(` ${l("Client:")} ${t?.name||o}`),console.log(` ${l("Config:")} ${s("cyan",n)}`),console.log()}function ep(e,o,n,i){let t=D[o];console.log(),console.log(s("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("green"," \u2502 ")+`${s("green","\u2705")} ${m("MCP installed successfully!")}`+" ".repeat(30)+s("green","\u2502")),console.log(s("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${m("Installed:")} ${e.name}`),console.log(` ${m("To:")} ${t?.name||o}`),console.log(` ${l("Config:")} ${s("cyan",n)}`),i&&console.log(` ${l("Backup:")} ${i}`),console.log(),console.log(` ${m("Next steps:")}`),console.log(` 1. Restart ${t?.name||o}`),console.log(` 2. Look for ${s("cyan",e.id)} in MCP servers`),e.website&&console.log(` 3. Check ${s("blue",e.website)} for usage docs`),console.log()}function tp(e){console.log(),console.log(s("red"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("red"," \u2502 ")+`${s("red","X")} ${m("Installation failed")}`+" ".repeat(38)+s("red","\u2502")),console.log(s("red"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${s("red","Error:")} ${e}`),console.log()}var op=["npx","node","python","python3","uvx","uv","docker","deno","bun","bunx","pnpm","yarn","npm"];function Uv(e){if(!e||typeof e!="string")return{valid:!1,error:"Command is required"};let o=e.trim();if(o.includes("..")||o.includes("\0"))return{valid:!1,error:"Command contains invalid characters"};let n=o.split(/[/\\]/),i=n[n.length-1]?.split(/\s+/)[0]||"";return op.includes(i)?{valid:!0}:{valid:!1,error:`Untrusted command: "${i}". Allowed: ${op.join(", ")}`}}var Lv=[/[;&|`$]/,/[(){}[\]]/,/[<>]/,/[!^]/,/\\(?!["'\\])/,/[\n\r\x00]/,/'.*'/,/".*\$.*"/],Rv=/^--?[a-zA-Z][a-zA-Z0-9-]*(=\S+)?$/;function Zv(e){return Rv.test(e)}function Fv(e){if(!Array.isArray(e))return{valid:!1,error:"Arguments must be an array"};for(let o of e){if(typeof o!="string")return{valid:!1,problematic:String(o),error:"Argument must be a string"};if(!Zv(o)){for(let n of Lv)if(n.test(o))return{valid:!1,problematic:o,error:`Potentially unsafe argument: "${o.slice(0,50)}${o.length>50?"...":""}"`};if(o.length>4096)return{valid:!1,problematic:o.slice(0,50)+"...",error:"Argument exceeds maximum length (4096 chars)"}}}return{valid:!0}}function Vv(e){if(!e||typeof e!="object")return{valid:!0};let o=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let[n,i]of Object.entries(e)){if(!o.test(n))return{valid:!1,problematic:n,error:`Invalid environment variable name: "${n}"`};if(typeof i!="string")return{valid:!1,problematic:n,error:`Environment variable value must be a string: "${n}"`};if(/[\x00-\x08\x0B\x0C\x0E-\x1F]/.test(i))return{valid:!1,problematic:n,error:`Environment variable "${n}" contains invalid control characters`};if(i.length>32768)return{valid:!1,problematic:n,error:`Environment variable "${n}" exceeds maximum length (32KB)`}}return{valid:!0}}function Gv(e,o){let n=Uv(e.installConfig.command);if(!n.valid)throw new Error(n.error||"Invalid command");let i=Fv(e.installConfig.args);if(!i.valid)throw new Error(i.error||`Potentially unsafe argument: "${i.problematic}"`);let t={...e.installConfig.env||{},...o},r=Vv(t);if(!r.valid)throw new Error(r.error||`Invalid environment variable: "${r.problematic}"`);let a={command:e.installConfig.command,args:[...e.installConfig.args]};return Object.keys(t).length>0&&(a.env=t),a}function Bv(e,o,n){let i=o==="custom"&&n?n:F(o,n),t=V(i);return!t||!t.mcpServers?!1:e in t.mcpServers}function Wv(e,o,n,i){let t=o==="custom"&&n?n:F(o,n),r=V(t)||{mcpServers:{}},a=Gv(e,i);r={...r,mcpServers:{...r.mcpServers,[e.id]:a}};let c=te(t,r);return c.success?{success:!0,configPath:t,backupPath:c.backupPath}:{success:!1,configPath:t,error:c.error||"Failed to write config"}}async function Hv(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}async function kc(){await W(),console.log(),console.log(` ${s("yellow","WARN")} ${l("70+ community servers \u2022 MCPs install on your behalf")}`);let e={client:null,browseMode:null,selectedMCP:null,envValues:{}},o="client";for(;o!=="done";)switch(o){case"client":{let n=await Vd();if(!n)return;e.client=n.client,e.customPath=n.customPath,o="browse";break}case"browse":{let n=await Gd();if(n==="back"||n===null){o="client";break}e.browseMode=n,o="selectMCP";break}case"selectMCP":{let n=null;switch(e.browseMode){case"search":n=await Bd();break;case"category":n=await Wd();break;case"tag":n=await Hd();break;case"popular":n=await qd();break;case"all":n=await Kd();break;default:break}if(n==="back"){o="browse";break}if(n===null){o="browse";break}e.selectedMCP=n,o="details";break}case"details":{let n=ge(e.selectedMCP,"selectedMCP should be set before details step");if(console.log(),console.log(` ${l("[Step 4/6]")} ${m("MCP Details")}`),Yd(n),await O({message:"What would you like to do?",choices:[{name:`${s("green","\u2705")} Continue to install`,value:"continue"},new E,{name:`${s("dim","- Back to MCP list")}`,value:"back"}],loop:!1})==="back"){o="selectMCP";break}o="envVars";break}case"envVars":{let n=ge(e.selectedMCP,"selectedMCP should be set before envVars step"),i=await Jd(n);if(i==="back"){o="details";break}if(i===null){o="details";break}e.envValues=i,o="confirm";break}case"confirm":{let n=ge(e.selectedMCP,"selectedMCP should be set before confirm step"),i=ge(e.client,"client should be set before confirm step");console.log(),console.log(` ${l("[Step 6/6]")} ${m("Confirm Installation")}`);let t=i==="custom"&&e.customPath?e.customPath:F(i,e.customPath);if(Bv(n.id,i,e.customPath)){console.log(),console.log(` ${s("yellow","\u26A0")} MCP "${m(n.name)}" is already installed.`),console.log();let c=await O({message:"What would you like to do?",choices:[{name:`${s("blue","\u21BB")} Update configuration`,value:"update"},{name:`${s("dim","\u23ED")} Skip (keep existing)`,value:"skip"},new E,{name:`${s("dim","\u2190 Back")}`,value:"back"}],loop:!1});if(c==="skip"){console.log(),console.log(` ${l("Skipped - keeping existing configuration.")}`),o="browse";break}if(c==="back"){o="envVars";break}console.log(),console.log(` ${s("blue","\u2192")} Updating MCP configuration...`)}Qd(n,i,t,e.envValues);let a=await Xd(n,i);if(a==="back"){o="envVars";break}if(a==="cancel"){console.log(),console.log(` ${l("Installation cancelled.")}`);return}o="install";break}case"install":{let n=ge(e.selectedMCP,"selectedMCP should be set before install step"),i=ge(e.client,"client should be set before install step"),t=new N("Installing MCP...").start(),r=Wv(n,i,e.customPath,e.envValues);r.success?(t.succeed("MCP installed successfully!"),ep(n,i,r.configPath,r.backupPath)):(t.fail("Installation failed"),tp(r.error||"Unknown error")),await Hv(),o="done";break}default:break}}function _o(){let e=gd(),o=[];for(let n of e){let i=F(n),t=Wn(n),r=null,a=0;t&&(r=V(i),r?.mcpServers&&(a=Object.keys(r.mcpServers).length)),o.push({client:n,configPath:i,config:r,exists:t,mcpCount:a})}return o}function qv(e,o){if(e.command!==o.command)return!1;let n=e.args||[],i=o.args||[];if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++)if(n[a]!==i[a])return!1;let t=Object.keys(e.env||{}).sort(),r=Object.keys(o.env||{}).sort();if(t.length!==r.length)return!1;for(let a=0;a<t.length;a++)if(t[a]!==r[a]||(e.env||{})[t[a]]!==(o.env||{})[r[a]])return!1;return!0}function Po(e){let o=e.filter(p=>p.exists&&p.config),n=new Set,i=new Map;for(let p of o)if(p.config?.mcpServers)for(let[d,f]of Object.entries(p.config.mcpServers))n.add(d),i.has(d)||i.set(d,new Map),i.get(d).set(p.client,f);let t=[],r=o.map(p=>p.client);for(let p of n){let d=i.get(p)||new Map,f=Array.from(d.keys()),$=r.filter(k=>!d.has(k)),b=!1,h=Array.from(d.values());if(h.length>1){let k=h[0];for(let v=1;v<h.length;v++)if(!qv(k,h[v])){b=!0;break}}t.push({mcpId:p,presentIn:f,missingIn:$,hasConflict:b,variants:d})}let a=t.filter(p=>p.missingIn.length===0&&!p.hasConflict),c=t.filter(p=>p.missingIn.length>0&&!p.hasConflict),u=t.filter(p=>p.hasConflict);return{clients:e,allMCPs:n,diffs:t,fullyConsistent:a,needsSync:c,conflicts:u,summary:{totalClients:e.length,clientsWithConfig:o.length,totalUniqueMCPs:n.size,consistentMCPs:a.length,needsSyncCount:c.length,conflictCount:u.length}}}function Kv(e,o){let n={mcpServers:{...e?.mcpServers||{}}};for(let{mcpId:i,server:t}of o)n.mcpServers[i]=t;return n}function Jv(e,o){return o?o.chosenConfig:!e.hasConflict&&e.variants.size>0?Array.from(e.variants.values())[0]:null}function wc(e,o,n){let i=new Map,t=[],r=[],a=n?e.filter(u=>n.includes(u.client)):e.filter(u=>u.exists);for(let u of a){if(u.exists&&u.config===null){i.set(u.client,{success:!1,error:"Config file exists but could not be parsed (corrupt JSON?) \u2014 skipping to avoid data loss"}),t.push(`${D[u.client]?.name||u.client}: corrupt config \u2014 skipped`);continue}let p=Kv(u.config,o),d=te(u.configPath,p);if(d.success)i.set(u.client,{success:!0,backupPath:d.backupPath});else{let f=d.error||"Unknown write error";i.set(u.client,{success:!1,error:f}),t.push(`${D[u.client]?.name||u.client}: ${f}`)}}for(let{mcpId:u}of o)r.includes(u)||r.push(u);return{success:Array.from(i.values()).every(u=>u.success),clientResults:i,mcpsSynced:r,errors:t}}function tr(e,o){let n=[],i=new Map(o.map(t=>[t.mcpId,t]));for(let t of e.needsSync){let r=Jv(t);r&&n.push({mcpId:t.mcpId,server:r})}for(let t of e.conflicts){let r=i.get(t.mcpId);r&&n.push({mcpId:t.mcpId,server:r.chosenConfig})}return n}function Cc(e){return e.summary.needsSyncCount>0||e.summary.conflictCount>0}function ae(e){return D[e]?.name||e}function rp(e){let{summary:o}=e;if(console.log(),console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+m("MCP Sync Status")+" ".repeat(44)+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${m("Clients:")}`),console.log(` ${s("cyan","\u2022")} ${o.clientsWithConfig} of ${o.totalClients} with MCP configs`),console.log(),console.log(` ${m("MCPs:")}`),console.log(` ${s("cyan","\u2022")} ${o.totalUniqueMCPs} unique MCPs found`),o.consistentMCPs>0){console.log(` ${s("green","\u2705")} ${o.consistentMCPs} fully synced`);for(let n of e.fullyConsistent)console.log(` ${l("\u2022")} ${n.mcpId}`)}if(o.needsSyncCount>0){let n=o.needsSyncCount;console.log(` ${s("yellow","\u25CB")} ${n} can be synced`);for(let i of e.needsSync){let t=i.missingIn.map(ae).join(", ");console.log(` ${s("yellow","\u2022")} ${i.mcpId}`),console.log(` ${l(`missing from: ${t}`)}`)}}if(o.conflictCount>0){console.log(` ${s("red","!")} ${o.conflictCount} have conflicts`);for(let n of e.conflicts){let i=Array.from(n.variants.keys()).map(ae).join(" vs ");console.log(` ${s("red","\u2022")} ${n.mcpId}`),console.log(` ${l(`different in: ${i}`)}`)}console.log(),console.log(` ${s("cyan","INFO")} ${l("Continue to choose which config to use for each conflict")}`)}console.log()}function ip(e){console.log(` ${m("Client Configurations:")}`),console.log();for(let o of e){let n=ae(o.client),i=o.exists?s("green","\u25CF"):s("dim","\u25CB"),t=o.exists?`${o.mcpCount} MCPs`:l("no config");console.log(` ${i} ${n}`),console.log(` ${l(o.configPath)}`),console.log(` ${l(t)}`),console.log()}}function np(e){let o=e.hasConflict?s("red","!"):e.missingIn.length>0?s("yellow","\u25CB"):s("green","\u2705");console.log(` ${o} ${m(e.mcpId)}`);let n=e.presentIn.map(ae).join(", ");if(console.log(` ${l("Present in:")} ${n}`),e.missingIn.length>0){let i=e.missingIn.map(ae).join(", ");console.log(` ${s("yellow","Missing from:")} ${i}`)}e.hasConflict&&console.log(` ${s("red","Conflict:")} Different configurations detected`),console.log()}function sp(e){if(e.fullyConsistent.length>0){console.log(` ${s("green","\u2705")} ${m("Fully Synced:")}`);for(let o of e.fullyConsistent)console.log(` ${s("dim","\u2022")} ${o.mcpId}`);console.log()}if(e.needsSync.length>0){console.log(` ${s("yellow","\u25CB")} ${m("Needs Sync (auto-resolvable):")}`);for(let o of e.needsSync)np(o)}if(e.conflicts.length>0){console.log(` ${s("red","!")} ${m("Conflicts (requires resolution):")}`);for(let o of e.conflicts)np(o)}}function Xv(e,o=" "){console.log(`${o}${l("command:")} ${e.command||l("(none)")}`);let n=e.args?.join(" ")||"";if(n&&console.log(`${o}${l("args:")} ${n}`),e.env&&Object.keys(e.env).length>0){console.log(`${o}${l("env:")}`);for(let[i,t]of Object.entries(e.env)){let a=/token|secret|key|password|auth|credential/i.test(i)?"***":t&&t.length>30?t.slice(0,30)+"...":t||"";console.log(`${o} ${s("cyan",i)}: ${a}`)}}}function ap(e,o=!1){console.log(),console.log(s("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","WARN")} Conflict: ${m(e.mcpId)}`+" ".repeat(Math.max(0,43-e.mcpId.length))+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("This MCP has different configurations across clients:")}`),console.log();let n=1;for(let[i,t]of e.variants){let r=ae(i);if(console.log(` ${s("cyan",`[${n}]`)} ${m(r)}`),o)Xv(t," ");else{let a=t.args?.join(" ")||"",c=[t.command,a].filter(Boolean).join(" ");console.log(` ${l("command:")} ${c||l("(none)")}`),t.env&&Object.keys(t.env).length>0&&console.log(` ${l("env:")} ${Object.keys(t.env).length} variables`)}console.log(),n++}}function cp(e,o){console.log(),console.log(s("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("blue"," \u2502 ")+m("Sync Preview")+" ".repeat(47)+s("blue","\u2502")),console.log(s("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${m("MCPs to sync:")} ${e.length}`);for(let{mcpId:n}of e)console.log(` ${s("cyan","\u2022")} ${n}`);console.log(),console.log(` ${m("Target clients:")} ${o.length}`);for(let n of o){let i=ae(n.client);console.log(` ${s("cyan","\u2022")} ${i}`),console.log(` ${l(n.configPath)}`)}console.log(),console.log(` ${s("yellow","WARN")} ${m("Note:")}`),console.log(` ${l("Backups will be created before modifying any config.")}`),console.log()}function lp(e){if(console.log(),e.success?(console.log(s("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("green"," \u2502 ")+`${s("green","\u2705")} ${m("Sync Complete!")}`+" ".repeat(43)+s("green","\u2502")),console.log(s("green"," \u2514"+"\u2500".repeat(60)+"\u2518"))):(console.log(s("red"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("red"," \u2502 ")+`${s("red","X")} ${m("Sync completed with errors")}`+" ".repeat(32)+s("red","\u2502")),console.log(s("red"," \u2514"+"\u2500".repeat(60)+"\u2518"))),console.log(),e.mcpsSynced.length>0){console.log(` ${m("Synced MCPs:")} ${e.mcpsSynced.length}`);for(let o of e.mcpsSynced)console.log(` ${s("green","\u2705")} ${o}`);console.log()}console.log(` ${m("Client Results:")}`);for(let[o,n]of e.clientResults){let i=ae(o);n.success?(console.log(` ${s("green","\u2705")} ${i}`),n.backupPath&&console.log(` ${l("Backup:")} ${n.backupPath}`)):(console.log(` ${s("red","X")} ${i}`),n.error&&console.log(` ${s("red","Error:")} ${n.error}`))}if(e.errors.length>0){console.log(),console.log(` ${s("red","Errors:")}`);for(let o of e.errors)console.log(` ${s("red","\u2022")} ${o}`)}console.log()}function up(){console.log(),console.log(s("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(s("green"," \u2502 ")+`${s("green","\u2705")} ${m("All MCPs are already in sync!")}`+" ".repeat(28)+s("green","\u2502")),console.log(s("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("All your MCP configurations are consistent across clients.")}`),console.log()}async function St(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}async function Yv(e){ap(e,!0);let o=[],n=1;for(let[t,r]of e.variants){let a=ae(t),c=r.args?.join(" ")||"",u=[r.command,c].filter(Boolean).join(" ");o.push({name:`${s("cyan",`[${n}]`)} Use config from ${m(a)}`,value:{client:t,server:r},description:u||"(no command)"}),n++}o.push(new E),o.push({name:`${s("yellow","Skip")} Skip this MCP (don't sync)`,value:"skip"}),o.push({name:`${s("dim","- Back")}`,value:"back"});let i=await O({message:`Choose config for ${m(e.mcpId)}:`,choices:o,loop:!1});return i==="back"||i==="skip"?null:{mcpId:e.mcpId,chosenConfig:i.server,sourceClient:i.client}}async function xc(){await W(),console.log(),console.log(s("blue","\u2501".repeat(66))),console.log(` Sync ${m("Sync System MCP")}`),console.log(s("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("Synchronize MCP servers across all your IDE clients")}`);let e={analysis:null,resolutions:[],currentConflictIndex:0},o="analyze";for(;o!=="done";)switch(o){case"analyze":{let n=new N("Scanning client configurations...").start(),i=_o();if(e.analysis=Po(i),n.succeed("Configuration scan complete!"),e.analysis.summary.clientsWithConfig<2){console.log(),console.log(` ${s("yellow","WARN")} ${m("Not enough clients to sync")}`),console.log(` ${l("Found only")} ${e.analysis.summary.clientsWithConfig} ${l("client(s) with MCP configs.")}`),console.log(` ${l("Need at least 2 clients to sync.")}`),console.log(),await St();return}o="showStatus";break}case"showStatus":{let n=ge(e.analysis,"Analysis should be populated before showStatus step");if(rp(n),!Cc(n)){up(),await St();return}let i=await O({message:"What would you like to do?",choices:[{name:`${s("green","\u2705")} Continue to sync`,value:"continue"},{name:`${s("cyan","INFO")} Show MCP details`,value:"details"},{name:`${s("cyan","INFO")} Show client details`,value:"clients"},new E,{name:`${s("dim","- Back to menu")}`,value:"back"}],loop:!1});if(i==="back")return;if(i==="details"){console.log(),sp(n),await St();break}if(i==="clients"){console.log(),ip(n.clients),await St();break}n.conflicts.length>0?o="resolveConflicts":o="preview";break}case"resolveConflicts":{let i=ge(e.analysis,"Analysis should be populated before resolveConflicts step").conflicts;console.log(),console.log(` ${s("yellow","WARN")} ${m(`Resolve ${i.length} conflict(s)`)}`),console.log(` ${l("You need to choose which configuration to use for each conflicting MCP.")}`),e.resolutions=[];for(let t=0;t<i.length;t++){console.log(),console.log(` ${l(`Conflict ${t+1} of ${i.length}`)}`);let r=await Yv(i[t]);if(r===null){console.log(` ${s("yellow","Skip")} Skipping ${m(i[t].mcpId)}`);continue}e.resolutions.push(r),console.log(` ${s("green","\u2705")} Using config from ${m(ae(r.sourceClient))}`)}o="preview";break}case"preview":{let n=ge(e.analysis,"Analysis should be populated before preview step"),i=tr(n,e.resolutions);if(i.length===0){console.log(),console.log(` ${s("yellow","WARN")} ${m("No MCPs to sync")}`),console.log(` ${l("All conflicts were skipped or no sync is needed.")}`),console.log(),await St();return}let t=n.clients.filter(r=>r.exists);cp(i.map(r=>({mcpId:r.mcpId})),t),o="confirm";break}case"confirm":{let n=await O({message:"Proceed with sync?",choices:[{name:`${s("green","\u2705")} Yes, sync all clients`,value:"proceed"},new E,{name:`${s("dim","- Back to review")}`,value:"back"},{name:`${s("dim","X Cancel")}`,value:"cancel"}],loop:!1});if(n==="cancel"){console.log(` ${l("Sync cancelled.")}`);return}if(n==="back"){o="showStatus";break}o="execute";break}case"execute":{let n=ge(e.analysis,"Analysis should be populated before execute step"),i=tr(n,e.resolutions),t=n.clients.filter(c=>c.exists),r=new N("Syncing configurations...").start(),a=wc(n.clients,i,t.map(c=>c.client));a.success?r.succeed("Sync complete!"):r.fail("Sync completed with errors"),lp(a),console.log(` ${m("Next steps:")}`),console.log(` ${l("Restart your IDEs to apply the changes.")}`),console.log(),await St(),o="done";break}default:break}}async function Sc(e){let o=_o(),n=Po(o);if(n.summary.clientsWithConfig<2)return{success:!1,message:`Not enough clients to sync (found ${n.summary.clientsWithConfig})`,syncPerformed:!1};if(!Cc(n))return{success:!0,message:"All MCPs are already in sync",syncPerformed:!1};if(n.conflicts.length>0&&!e.force)return{success:!1,message:`${n.conflicts.length} conflict(s) found. Use --force to auto-resolve or run interactive mode.`,syncPerformed:!1};let i=[];if(e.force)for(let c of n.conflicts){let u=Array.from(c.variants.entries())[0];u&&i.push({mcpId:c.mcpId,chosenConfig:u[1],sourceClient:u[0]})}let t=tr(n,i);if(e.dryRun)return{success:!0,message:`Would sync ${t.length} MCP(s) to ${n.summary.clientsWithConfig} client(s)`,syncPerformed:!1};let r=n.clients.filter(c=>c.exists),a=wc(n.clients,t,r.map(c=>c.client));return a.success?{success:!0,message:`Synced ${a.mcpsSynced.length} MCP(s) to ${r.length} client(s)`,syncPerformed:!0}:{success:!1,message:`Sync failed: ${a.errors.join(", ")}`,syncPerformed:!0}}import{fileURLToPath as pp}from"node:url";import{dirname as mp,join as ot,resolve as or}from"node:path";import{existsSync as Qv,readFileSync as ey,writeFileSync as Mx,mkdirSync as zx}from"node:fs";function tt(e){let o=e.match(/^---\s*\n([\s\S]*?)\n---/);if(!o)return null;let n=o[1],i=n.match(/^name:\s*(.+)$/m),t=n.match(/^description:\s*(.+)$/m),r=n.match(/^category:\s*(.+)$/m);return{name:i?.[1].trim(),description:t?.[1].trim(),category:r?.[1].trim()}}var ty=ie.home||process.env.OCTOCODE_HOME||ot(R,".octocode"),dp=ie.cliConfig||ot(ty,"config.json");function oy(){try{if(Qv(dp)){let e=ey(dp,"utf-8");return JSON.parse(e)}}catch{}return{}}function ny(){return oy().skillsDestDir||null}function ry(){if(G){let e=ue();return ot(e,"Claude","skills")}return ot(R,".claude","skills")}function nr(){let e=pp(import.meta.url),o=mp(e),n=[ot(o,"..","skills"),ot(o,"..","..","..","..","skills"),ot(o,"..","..","..","skills")];for(let i of n)if(M(i))return i;throw new Error("Skills directory not found")}function gp(){let e=nr();return ye(e).filter(o=>o.startsWith("octocode-"))}function nt(){let e=pp(import.meta.url),o=mp(e),n=[or(o,"..","skills"),or(o,"..","..","..","..","skills"),or(o,"..","..","..","skills")];for(let i of n)if(M(i))return i;return or(o,"..","skills")}function pe(){let e=ny();return e||ry()}import Pt from"node:path";import xy from"open";var Io=[{id:"octocode-skills",name:"Octocode",type:"github",owner:"bgauryy",repo:"octocode-mcp",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Research, planning, code review & documentation",url:"https://github.com/bgauryy/octocode-mcp/tree/main/skills"},{id:"anthropic-skills",name:"Anthropic Official",type:"github",owner:"anthropics",repo:"skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Official Anthropic skills \u2014 artifacts, design & docs",url:"https://github.com/anthropics/skills/tree/main/skills"},{id:"superpowers",name:"Superpowers",type:"github",owner:"obra",repo:"superpowers",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"TDD, debugging, worktrees & disciplined development",url:"https://github.com/obra/superpowers"},{id:"everything-claude-code",name:"Everything Claude Code",type:"github",owner:"affaan-m",repo:"everything-claude-code",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Performance, security, memory & agent harness",url:"https://github.com/affaan-m/everything-claude-code/tree/main/skills"},{id:"composio-skills",name:"Composio Skills",type:"github",owner:"ComposioHQ",repo:"awesome-claude-skills",branch:"master",skillsPath:"",skillPattern:"skill-folders",description:"Brand, canvas, MCP builder, invoicing & testing",url:"https://github.com/ComposioHQ/awesome-claude-skills"},{id:"antigravity-awesome-skills",name:"Antigravity Awesome",type:"github",owner:"sickn33",repo:"antigravity-awesome-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"1,300+ agentic skills across all coding domains",url:"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills"},{id:"obsidian-skills",name:"Obsidian Skills",type:"github",owner:"kepano",repo:"obsidian-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Markdown editing & Obsidian vault productivity",url:"https://github.com/kepano/obsidian-skills/tree/main/skills"},{id:"planning-with-files",name:"Planning with Files",type:"github",owner:"OthmanAdi",repo:"planning-with-files",branch:"master",skillsPath:"skills",skillPattern:"skill-folders",description:"Manus-style persistent markdown planning workflow",url:"https://github.com/OthmanAdi/planning-with-files/tree/master/skills"},{id:"marketing-skills",name:"Marketing Skills",type:"github",owner:"coreyhaines31",repo:"marketingskills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"SEO, copywriting, CRO, analytics & growth engineering",url:"https://github.com/coreyhaines31/marketingskills/tree/main/skills"},{id:"claude-scientific-skills",name:"Scientific Skills",type:"github",owner:"K-Dense-AI",repo:"claude-scientific-skills",branch:"main",skillsPath:"scientific-skills",skillPattern:"skill-folders",description:"Biopython, astropy, deepchem & scientific computing",url:"https://github.com/K-Dense-AI/claude-scientific-skills"},{id:"dev-browser",name:"Dev Browser",type:"github",owner:"SawyerHood",repo:"dev-browser",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Browser control via Playwright with persistent state",url:"https://github.com/SawyerHood/dev-browser"},{id:"aris-research",name:"ARIS Research",type:"github",owner:"wanshuiyin",repo:"Auto-claude-code-research-in-sleep",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Autonomous ML research \u2014 papers, reviews & experiments",url:"https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/tree/main/skills"},{id:"buildwithclaude",name:"Build With Claude",type:"github",owner:"davepoon",repo:"buildwithclaude",branch:"main",skillsPath:"commands",skillPattern:"flat-md",description:"170+ commands, agents & skills hub",url:"https://github.com/davepoon/buildwithclaude"},{id:"claude-code-plugins-plus-skills",name:"Plugins + Skills",type:"github",owner:"jeremylongshore",repo:"claude-code-plugins-plus-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"1,300+ skills with tutorials & orchestration",url:"https://github.com/jeremylongshore/claude-code-plugins-plus-skills"},{id:"ui-ux-pro-max",name:"UI/UX Pro Max",type:"github",owner:"nextlevelbuilder",repo:"ui-ux-pro-max-skill",branch:"main",skillsPath:".claude/skills",skillPattern:"skill-folders",description:"UI/UX, brand guidelines, design systems & styling",url:"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/tree/main/.claude/skills"},{id:"ctf-skills",name:"CTF Skills",type:"github",owner:"ljagiello",repo:"ctf-skills",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Web exploitation, crypto, pwn, reverse & forensics",url:"https://github.com/ljagiello/ctf-skills"},{id:"vltansky-skills",name:"Vltansky Skills",type:"github",owner:"vltansky",repo:"skills",branch:"master",skillsPath:"skills",skillPattern:"skill-folders",description:"QA, interviews, retros, RFC research & code reviews",url:"https://github.com/vltansky/skills/tree/master/skills"},{id:"claude-skills-marketplace",name:"Claude Skills Marketplace",type:"github",owner:"mhattingpete",repo:"claude-skills-marketplace",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Git automation, testing & code review",url:"https://github.com/mhattingpete/claude-skills-marketplace"},{id:"daymade-claude-code-skills",name:"Daymade Skills",type:"github",owner:"daymade",repo:"claude-code-skills",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Production-ready development workflows",url:"https://github.com/daymade/claude-code-skills"},{id:"webmaxru-agent-skills",name:"Web AI Skills",type:"github",owner:"webmaxru",repo:"agent-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Web APIs for Web AI \u2014 auto-updated, manually reviewed",url:"https://github.com/webmaxru/agent-skills/tree/main/skills"}];var fp=new Map,iy=300*1e3;function rt(e){return e.type==="local"}async function sy(e){if(e.type==="local")return null;let o=`${e.owner}/${e.repo}`,n=fp.get(o);if(n&&Date.now()-n.timestamp<iy)return n.stars;try{let i=`https://api.github.com/repos/${e.owner}/${e.repo}`,t=await fetch(i,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"octocode-cli"}});if(!t.ok)return null;let a=(await t.json()).stargazers_count;return fp.set(o,{stars:a,timestamp:Date.now()}),a}catch{return null}}async function hp(){let e=new Map,o=Io.map(async n=>{let i=await sy(n);i!==null&&e.set(n.id,i)});return await Promise.all(o),e}import{join as ee,resolve as vp,relative as ay,isAbsolute as $p,sep as cy}from"node:path";import{mkdirSync as _c,statSync as ly,readdirSync as uy,unlinkSync as dy,rmSync as py}from"node:fs";import yp from"node:os";var kp=1440*60*1e3;function Ic(){let e=yp.homedir(),o=process.env.npm_config_cache||ee(e,".npm"),n=ee(o,"_cacache","octocode-skills"),t=yp.platform()==="win32"?ee(process.env.LOCALAPPDATA||ee(e,"AppData","Local"),"octocode","cache","skills"):ee(e,".cache","octocode","skills");return M(o)?n:t}function my(){let e=Ic();return M(e)||_c(e,{recursive:!0,mode:448}),e}function bp(e,o){let n=vp(e),i=vp(o),t=ay(n,i);return t!==".."&&!t.startsWith(`..${cy}`)&&!$p(t)}function wp(e){let o=my();return ee(o,`${e.id}.json`)}function gy(e){try{if(!Q(e))return!1;let o=ly(e);return Date.now()-o.mtimeMs<kp}catch{return!1}}function fy(e){try{let o=wp(e);if(!gy(o))return null;let n=Qe(o);if(!n)return null;let i=JSON.parse(n);return Date.now()-i.timestamp>kp?null:i.skills.map(t=>({...t,source:e}))}catch{return null}}function hy(e,o){try{let n=wp(e),i=o.map(({source:r,...a})=>a),t={timestamp:Date.now(),skills:i};yo(n,JSON.stringify(t,null,2))}catch{}}function Pc(e){let o=["PR","API","UI","CLI","MCP","AI"];return e.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,n=>n.toUpperCase()).replace(new RegExp(`\\b(${o.join("|")})\\b`,"gi"),n=>n.toUpperCase())}function vy(e){try{let o=nr(),n=gp(),i=[];for(let t of n){let r=ee(o,t),a=ee(r,"SKILL.md");if(Q(a)){let c=Qe(a);if(c){let u=tt(c);i.push({name:t,displayName:Pc(t),description:u?.description||xp(c)||"No description",category:u?.category||"Official",path:t,source:e})}}}return i}catch{return[]}}function yy(e,o){try{let n=nr(),i=ee(n,e.name),t=ee(o,e.name);return M(i)?(M(t)&&py(t,{recursive:!0,force:!0}),wt(i,t),{success:!0}):{success:!1,error:"Skill not found in bundled source"}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}async function Cp(e){let o=`https://api.github.com/repos/${e.owner}/${e.repo}/git/trees/${e.branch}?recursive=1`,n=await fetch(o,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"octocode-cli"}});if(!n.ok)throw n.status===403?new Error("GitHub API rate limit exceeded. Try again later."):new Error(`Failed to fetch marketplace: ${n.statusText}`);let i=await n.json();return i.truncated&&console.warn(`[octocode] GitHub tree response was truncated for ${e.owner}/${e.repo}. Some skills may be missing.`),i.tree}var rr=1024*1024;async function ir(e,o){let n=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.branch}/${o}`,i=await fetch(n,{headers:{"User-Agent":"octocode-cli"}});if(!i.ok)throw new Error(`Failed to fetch content: ${i.statusText}`);let t=i.headers?.get?.("Content-Length"),r=t?Number(t):NaN;if(Number.isFinite(r)&&r>rr)throw new Error(`Content too large: ${r} bytes exceeds ${rr} byte limit`);let a=await i.text(),c=Buffer.byteLength(a,"utf8");if(c>rr)throw new Error(`Content too large: ${c} bytes exceeds ${rr} byte limit`);return a}async function Ec(e,o={}){if(rt(e))return vy(e);if(!o.skipCache){let t=fy(e);if(t)return t}let n=await Cp(e),i=[];if(e.skillPattern==="flat-md"){let t=e.skillsPath?`${e.skillsPath}/`:"",a=n.filter(u=>u.type==="blob"&&u.path.startsWith(t)&&u.path.endsWith(".md")&&!u.path.includes("/")==(t==="")&&(t===""||u.path.split("/").length===2)).slice(0,100),c=await Promise.all(a.map(async u=>{try{let p=await ir(e,u.path),d=tt(p),f=u.path.split("/").pop()||u.path;return{name:f.replace(/\.md$/i,""),displayName:Pc(f),description:d?.description||"No description available",category:d?.category,path:u.path,source:e}}catch{return null}}));i.push(...c.filter(u=>u!==null))}else{let t=e.skillsPath?`${e.skillsPath}/`:"",r=n.filter(c=>c.type==="tree"&&(t===""||c.path.startsWith(t))&&!c.path.includes(".")&&!c.path.startsWith(".")),a=await Promise.all(r.slice(0,50).map(async c=>{let u=`${c.path}/SKILL.md`,p=`${c.path}/README.md`,d=n.some(b=>b.path===u&&b.type==="blob"),f=n.some(b=>b.path===p&&b.type==="blob"),$=d?u:f?p:null;if(!$)return null;try{let b=await ir(e,$),h=tt(b),k=c.path.split("/").pop()||c.path;return{name:k,displayName:Pc(k),description:h?.description||xp(b)||"No description",category:h?.category,path:c.path,source:e}}catch{return null}}));i.push(...a.filter(c=>c!==null))}return hy(e,i),i}function xp(e){let n=e.replace(/^---[\s\S]*?---\s*/,"").split(`
47
- `),i="";for(let t of n){let r=t.trim();if(!r){if(i)break;continue}r.startsWith("#")||(i+=(i?" ":"")+r)}return i?i.slice(0,200):null}async function Oc(e,o){try{let n=e.source;if(rt(n))return yy(e,o);let i=await Cp(n),t=ee(o,e.name);if(M(t)||_c(t,{recursive:!0,mode:448}),n.skillPattern==="flat-md"){let r=await ir(n,e.path),a=ee(t,"SKILL.md");if(!bp(t,a))throw new Error("Invalid skill destination path");yo(a,r)}else{let r=`${e.path}/`,a=i.filter(c=>c.type==="blob"&&c.path.startsWith(r));for(let c of a){let u=c.path.slice(r.length);if(!u||$p(u))throw new Error("Invalid skill file path");let p=ee(t,u);if(!bp(t,p))throw new Error("Invalid skill file path traversal");let d=ee(t,u.split("/").slice(0,-1).join("/"));d!==t&&!M(d)&&_c(d,{recursive:!0,mode:448})}await Promise.all(a.map(async c=>{let u=c.path.slice(r.length),p=ee(t,u),d=await ir(n,c.path);yo(p,d)}))}return{success:!0}}catch(n){return{success:!1,error:n instanceof Error?n.message:"Unknown error"}}}function Sp(){try{let e=Ic();if(M(e)){let o=uy(e);for(let n of o)n.endsWith(".json")&&dy(ee(e,n))}}catch{}}function _p(){return Ic()}import ar from"node:path";var sr=new Set(["octocode-research","octocode-pull-request-reviewer","octocode-researcher"]);async function ke(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}function by(e,o){if(rt(e))return`${m(e.name)} ${s("cyan","bundled")} - ${l(e.description)}`;let n=o?` ${o.toLocaleString()}`:"";return`${m(e.name)}${s("yellow",n)} - ${l(e.description)}`}function $y(e,o){let n=o?s("green","\u2705 "):"",i=sr.has(e.name)?s("yellow"," *"):"",t=e.description.slice(0,50),r=e.description.length>50?"...":"";return`${n}${e.displayName}${i} ${l(t)}${l(r)}`}function _t(e){let o=pe();return M(ar.join(o,e))}async function ky(e){console.log(),console.log(` ${m("Select a marketplace to browse:")}`),console.log();let o=Io.filter(c=>rt(c)),i=[...Io.filter(c=>!rt(c))].sort((c,u)=>(e.get(u.id)??0)-(e.get(c.id)??0)),t=[...o,...i],r=[];for(let c of t)r.push({name:by(c,e.get(c.id)),value:c,description:l(c.url)});return r.push(new E),r.push({name:`${s("dim","- Back to skills menu")}`,value:"back"}),await O({message:"",choices:r,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:c=>s("magenta",c)}}})}async function Pp(e,o){console.log(),console.log(` ${m(e.name)} - ${o.length} skills available`),console.log(` ${l(e.url)}`),console.log();let i=[...o].sort((a,c)=>{let u=_t(a.name),p=_t(c.name);if(u!==p)return u?-1:1;let d=sr.has(a.name),f=sr.has(c.name);return d!==f?d?-1:1:a.displayName.localeCompare(c.displayName)}).map(a=>{let c=_t(a.name);return{name:$y(a,c),value:a,description:a.category?`[${a.category}]`:void 0}}),t={name:`${s("dim","- Back to marketplaces")}`,value:"back"};return await kt({message:`Type to filter skills (${o.length} available)`,source:a=>{if(!a||!a.trim())return[...i,t];let c=a.toLowerCase();return[...i.filter(p=>{if(typeof p.value=="string")return!1;let d=p.value;return d.name.toLowerCase().includes(c)||d.displayName.toLowerCase().includes(c)||d.description.toLowerCase().includes(c)||d.category?.toLowerCase().includes(c)}),t]},pageSize:20,theme:{prefix:" ",style:{highlight:a=>s("magenta",a)}}})}async function Ip(e){let o=_t(e.name),n=pe(),i=sr.has(e.name)?s("yellow"," recommended"):"";console.log(),console.log(` ${m(e.displayName)}${i}`),console.log(` ${l(e.description)}`),console.log(),e.category&&(console.log(` ${m("Category:")} ${e.category}`),console.log()),console.log(` ${m("Source:")} ${e.source.name}`),console.log(` ${l(e.source.url)}`),console.log(),console.log(` ${m("Install path:")}`),console.log(` ${s("cyan",ar.join(n,e.name))}`),console.log();let t=[{name:o?`${s("yellow","\u2B06")} Reinstall skill`:`${s("green","\u2705")} Install skill`,value:"install"}];return o&&t.push({name:`${s("red","Delete")} Delete skill`,value:"delete"}),t.push(new E),t.push({name:`${s("dim","- Back")}`,value:"back"}),await O({message:o?"Choose an action:":"Install this skill?",choices:t,loop:!1,theme:{prefix:" ",style:{highlight:a=>s("magenta",a),message:a=>m(a)}}})}async function Ep(e){let o=pe();console.log();let n=new N(`Installing ${e.displayName}...`).start(),i=await Oc(e,o);return i.success?(n.succeed(`Installed ${e.displayName}!`),console.log(),console.log(` ${s("green","\u2705")} Skill installed successfully`),console.log(` ${l("Location:")} ${s("cyan",ar.join(o,e.name))}`),console.log(),console.log(` ${m("The skill is now available in your AI client!")}`)):(n.fail(`Failed to install ${e.displayName}`),console.log(),console.log(` ${s("red","X")} Installation failed: ${i.error}`)),console.log(),await ke(),i.success}async function Op(e){let o=pe(),n=ar.join(o,e.name);if(console.log(),await O({message:"Delete this installed skill?",choices:[{name:`${s("red","Delete")} Yes, delete skill`,value:"yes"},new E,{name:`${s("dim","- Cancel")}`,value:"no"}],loop:!1,theme:{prefix:" ",style:{highlight:r=>s("magenta",r),message:r=>m(r)}}})!=="yes")return!1;console.log();let t=new N(`Deleting ${e.displayName}...`).start();return Ct(n)?(t.succeed(`Deleted ${e.displayName}`),console.log(),console.log(` ${s("green","\u2705")} Skill deleted successfully`),console.log(),await ke(),!0):(t.fail(`Failed to delete ${e.displayName}`),console.log(),console.log(` ${s("red","X")} Could not delete skill directory`),console.log(` ${l("Path:")} ${s("cyan",n)}`),console.log(),await ke(),!1)}async function wy(e,o){console.log(),console.log(` ${m("Octocode Skills")}`),console.log(` ${l(`${e} skills available`)}`),console.log();let n=[];return o>0?(n.push({name:`${s("green","Fast")} Install All Skills (${o} to install)`,value:"install-all",description:l("One-click install of all Octocode skills")}),n.push({name:`${s("cyan","List")} Browse Skills Individually`,value:"browse",description:l("View details and install one by one")})):n.push({name:`${s("green","\u2705")} All skills installed \u2014 Browse to reinstall or view details`,value:"browse",description:l("View details and reinstall individually")}),n.push(new E),n.push({name:`${s("dim","- Back")}`,value:"back"}),await O({message:"",choices:n,loop:!1,theme:{prefix:" ",style:{highlight:t=>s("magenta",t)}}})}async function Cy(e){let o=pe(),n=e.filter(c=>!_t(c.name));if(n.length===0){console.log(),console.log(` ${s("green","\u2705")} All skills are already installed!`),console.log(),await ke();return}console.log(),console.log(` ${m("Installing")} ${n.length} ${m("skills...")}`),console.log();let i=new N(`Installing ${n.length} skills...`).start(),t=0,r=0,a=[];for(let c of n){i.update(`Installing ${c.displayName}... (${t+r+1}/${n.length})`);let u=await Oc(c,o);u.success?t++:(r++,a.push({skill:c.displayName,error:u.error||"Unknown error"}))}if(r===0?i.succeed(`All ${t} skills installed successfully!`):i.warn(`Installed ${t} skills, ${r} failed`),console.log(),t>0&&(console.log(` ${s("green","\u2705")} Successfully installed ${t} skill(s)`),console.log(` ${l("Location:")} ${s("cyan",o)}`)),a.length>0){console.log(),console.log(` ${s("red","X")} Failed to install:`);for(let{skill:c,error:u}of a)console.log(` ${s("red","\u2022")} ${c}: ${l(u)}`)}console.log(),console.log(` ${m("Skills are now available in your AI client!")}`),console.log(),await ke()}async function Tp(){console.log(),console.log(` ${s("yellow","WARN")} ${l("Community list \u2022 Skills install on your behalf")}`);let e=new N("Fetching marketplace info...").start(),o;try{o=await hp(),e.succeed("Loaded marketplace info")}catch{e.fail("Could not fetch stars"),o=new Map}let n=!0;for(;n;){let i=await ky(o);if(i==="back"){n=!1;continue}console.log();let t=new N(`Loading skills from ${i.name}...`).start(),r;try{r=await Ec(i),t.stop()}catch(c){t.fail("Failed to load skills"),console.log(),console.log(` ${s("red","X")} ${c instanceof Error?c.message:"Unknown error"}`),console.log(),await ke();continue}if(r.length===0){console.log(),console.log(` ${s("yellow","WARN")} No skills found in this marketplace`),console.log(),await ke();continue}let a=!0;for(;a;){let c=await Pp(i,r);if(c==="back"){a=!1;continue}let u=await Ip(c);u==="install"?await Ep(c):u==="delete"&&await Op(c)}}}async function Ap(){let e=Io.find(t=>t.id==="octocode-skills");if(!e){console.log(),console.log(` ${s("red","X")} Octocode Skills source not found`),console.log(),await ke();return}console.log();let o=new N("Loading Octocode Skills...").start(),n;try{n=await Ec(e),o.stop()}catch(t){o.fail("Failed to load skills"),console.log(),console.log(` ${s("red","X")} ${t instanceof Error?t.message:"Unknown error"}`),console.log(),await ke();return}if(n.length===0){console.log(),console.log(` ${s("yellow","WARN")} No skills found`),console.log(),await ke();return}let i=!0;for(;i;){let t=n.filter(a=>!_t(a.name)).length;switch(await wy(n.length,t)){case"install-all":await Cy(n),i=!1;break;case"browse":{let a=!0;for(;a;){let c=await Pp(e,n);if(c==="back"){a=!1;continue}let u=await Ip(c);u==="install"?await Ep(c):u==="delete"&&await Op(c)}break}default:i=!1;break}}}var Sy=new Set(["octocode-research","octocode-pull-request-reviewer","octocode-researcher"]);async function Eo(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}function zp(){let e=pe(),o=nt();if(!M(e))return[];let n=ye(e).filter(t=>!t.startsWith(".")),i=[];for(let t of n){let r=Pt.join(e,t),a=Pt.join(r,"SKILL.md"),c=t.startsWith("octocode-")&&M(o)&&M(Pt.join(o,t)),u=Sy.has(t);if(Q(a)){let p=Qe(a);if(p){let d=tt(p);if(d?.name&&d.description){i.push({name:d.name,description:d.description,folder:t,path:r,isBundled:c,isRecommended:u});continue}}}i.push({name:Py(t),description:"No description available",folder:t,path:r,isBundled:c,isRecommended:u})}return i.sort((t,r)=>t.isRecommended!==r.isRecommended?t.isRecommended?-1:1:t.name.localeCompare(r.name)),i}function Mp(){let e=nt(),o=pe();if(!M(e))return{srcDir:e,destDir:o,skillsStatus:[],notInstalled:[],sourceExists:!1};let i=ye(e).filter(r=>!r.startsWith(".")).map(r=>({name:r,installed:M(Pt.join(o,r)),srcPath:Pt.join(e,r),destPath:Pt.join(o,r)})),t=i.filter(r=>!r.installed);return{srcDir:e,destDir:o,skillsStatus:i,notInstalled:t,sourceExists:!0}}async function _y(e){let o=[];return e>0&&o.push({name:`- Manage installed skills ${l(`(${e})`)}`,value:"manage",description:"View, remove, or inspect individual skills"}),o.push({name:"- Browse Marketplace",value:"marketplace",description:"Community skills \u2022 installs on your behalf"}),o.push(new E),o.push({name:`${s("dim","- Back to main menu")}`,value:"back"}),await O({message:"",choices:o,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:i=>s("magenta",i)}}})}function Py(e){let o=["PR","API","UI","CLI","MCP","AI"];return e.replace(/^octocode-/,"").split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ").replace(new RegExp(`\\b(${o.join("|")})\\b`,"gi"),i=>i.toUpperCase())}async function Iy(e){console.log(),console.log(` ${m("Installed Skills")} ${l(`(${e.length} total)`)}`),console.log(` ${l("Select a skill to manage")}`),console.log();let o=[];for(let i of e){let t=i.isRecommended?s("yellow","\u2605 "):"",r=i.isBundled?s("cyan"," [bundled]"):s("magenta"," [community]"),a=i.description.slice(0,40),c=i.description.length>40?"...":"";o.push({name:`${t}${i.name}${r} - ${l(a)}${l(c)}`,value:i})}return o.push(new E),o.push({name:`${s("dim","- Back to skills menu")}`,value:"back"}),await O({message:"",choices:o,pageSize:15,loop:!1,theme:{prefix:" ",style:{highlight:i=>s("magenta",i)}}})}async function Ey(e){let o=e.isRecommended?s("yellow","recommended "):"",n=e.isBundled?s("cyan","[bundled]"):s("magenta","[community]");console.log(),console.log(` ${m(e.name)} ${o}${n}`),console.log(` ${l(e.description)}`),console.log(` ${l(e.path)}`),console.log();let i=[{name:`${s("red","Delete")} Remove this skill`,value:"remove"},{name:"- Open skill location",value:"view"},new E,{name:`${s("dim","- Back")}`,value:"back"}];return await O({message:"",choices:i,loop:!1,theme:{prefix:" ",style:{highlight:r=>s("magenta",r)}}})}async function Oy(e){console.log(),console.log(` ${s("cyan","Path")} Opening ${m(e.name)} location...`),console.log(` ${l(e.path)}`),console.log();try{await xy(e.path),console.log(` ${s("green","\u2705")} Opened in file explorer`)}catch{console.log(` ${s("yellow","!")} Could not open location automatically`),console.log(` ${l("Path:")} ${s("cyan",e.path)}`)}console.log()}async function Ty(e){console.log(),console.log(` ${s("yellow","WARN")} You are about to remove:`),console.log(` ${m(e.name)}`),console.log(` ${l(e.path)}`),console.log();let o=[{name:`${s("red","Delete")} Yes, remove this skill`,value:!0},new E,{name:`${s("dim","- Cancel")}`,value:!1}];if(!await O({message:"Confirm removal?",choices:o,loop:!1,theme:{prefix:" ",style:{highlight:t=>s("magenta",t),message:t=>m(t)}}}))return!1;console.log();let i=new N(`Removing ${e.name}...`).start();return Ct(e.path)?(i.succeed(`Removed ${e.name}`),console.log(),console.log(` ${s("green","\u2705")} Skill removed successfully`),!0):(i.fail(`Failed to remove ${e.name}`),console.log(),console.log(` ${s("red","X")} Could not remove skill directory`),!1)}async function Ay(){let e=!0;for(;e;){let o=zp();if(o.length===0){console.log(),console.log(` ${s("yellow","INFO")} No skills installed`),console.log(` ${l("Browse the marketplace to install skills")}`),console.log(),await Eo();return}let n=await Iy(o);if(n==="back"){e=!1;continue}let i=!0;for(;i;)switch(await Ey(n)){case"remove":{await Ty(n)&&(await Eo(),i=!1);break}case"view":await Oy(n),await Eo();break;default:i=!1;break}}}async function Np(){await W();let e=Mp();if(!e.sourceExists){console.log(` ${s("yellow","WARN")} Skills source directory not found.`),console.log(` ${l("This may happen if running from source.")}`),console.log(),await Eo();return}if(e.skillsStatus.length===0){console.log(` ${l("No skills available.")}`),console.log(),await Eo();return}let o=!0;for(;o;){e=Mp();let i=zp().length;switch(await _y(i)){case"manage":await Ay();break;case"marketplace":await Tp();break;default:o=!1;break}}}function jp(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}import{request as My}from"@octokit/request";import{createDeviceCode as zy,exchangeDeviceCode as Dp}from"@octokit/oauth-methods";async function Lp(e,o){let n=Ny(e,o.auth);if(n)return n;let{data:i}=await zy({clientType:e.clientType,clientId:e.clientId,request:o.request||e.request,scopes:o.auth.scopes||e.scopes});await e.onVerification(i);let t=await Tc(o.request||e.request,e.clientId,e.clientType,i);return e.authentication=t,t}function Ny(e,o){if(o.refresh===!0||!e.authentication)return!1;if(e.clientType==="github-app")return e.authentication;let n=e.authentication,i=("scopes"in o&&o.scopes||e.scopes).join(" "),t=n.scopes.join(" ");return i===t?n:!1}async function Up(e){await new Promise(o=>setTimeout(o,e*1e3))}async function Tc(e,o,n,i){try{let t={clientId:o,request:e,code:i.device_code},{authentication:r}=n==="oauth-app"?await Dp({...t,clientType:"oauth-app"}):await Dp({...t,clientType:"github-app"});return{type:"token",tokenType:"oauth",...r}}catch(t){if(!t.response)throw t;let r=t.response.data.error;if(r==="authorization_pending")return await Up(i.interval),Tc(e,o,n,i);if(r==="slow_down")return await Up(i.interval+7),Tc(e,o,n,i);throw t}}async function jy(e,o){return Lp(e,{auth:o})}async function Dy(e,o,n,i){let t=o.endpoint.merge(n,i);if(/\/login\/(oauth\/access_token|device\/code)$/.test(t.url))return o(t);let{token:r}=await Lp(e,{request:o,auth:{type:"oauth"}});return t.headers.authorization=`token ${r}`,o(t)}var Uy="0.0.0-development";function Rp(e){let o=e.request||My.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${Uy} ${jp()}`}}),{request:n=o,...i}=e,t=e.clientType==="github-app"?{...i,clientType:"github-app",request:n}:{...i,clientType:"oauth-app",request:n,scopes:e.scopes||[]};if(!e.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!e.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(jy.bind(null,t),{hook:Dy.bind(null,t)})}import{deleteToken as Ry}from"@octokit/oauth-methods";import{request as Ac}from"@octokit/request";import Zy from"open";var Zp="https://cli.github.com/";function Fp(){return sd("gh")}function it(){if(!Fp())return{installed:!1,authenticated:!1,error:"GitHub CLI (gh) is not installed"};let e=Ye("gh",["auth","status"]);if(e.success){let o=e.stdout.match(/Logged in to \S+.*account\s+(\S+)/i);return{installed:!0,authenticated:!0,username:o?o[1]:void 0}}return{installed:!0,authenticated:!1,error:e.stderr||"Not authenticated"}}function Vp(e){let o=["auth","logout"];return e&&o.push("--hostname",e),ad("gh",o)}function Oo(e){if(!Fp())return null;let o=["auth","token"];e&&o.push("--hostname",e);let n=Ye("gh",o);return n.success&&n.stdout.trim()?n.stdout.trim():null}var Mc="178c6fc778ccc68e1d6a",Fy=["repo","read:org","gist"],Le="github.com";function zc(e){return e==="github.com"||e===Le?"https://api.github.com":`https://${e}/api/v3`}async function Vy(e,o){let n=zc(o);return(await Ac("GET /user",{headers:{authorization:`token ${e}`},baseUrl:n})).data.login}async function cr(e={}){let{hostname:o=Le,scopes:n=Fy,gitProtocol:i="https",clientId:t=Mc,onVerification:r,openBrowser:a=!0}=e;try{let u=await Rp({clientType:"oauth-app",clientId:t,scopes:n,onVerification:async $=>{if(r&&r($),a)try{await Zy($.verification_uri)}catch{console.log(),console.log(" \u26A0 Could not open browser automatically."),console.log(" \u2192 Please open this URL manually:"),console.log(` ${$.verification_uri}`),console.log()}},request:Ac.defaults({baseUrl:zc(o)})})({type:"oauth"}),p=await Vy(u.token,o),d={token:u.token,tokenType:"oauth",scopes:"scopes"in u?u.scopes:void 0};"refreshToken"in u&&u.refreshToken&&(d.refreshToken=u.refreshToken,d.expiresAt="expiresAt"in u?u.expiresAt:void 0,d.refreshTokenExpiresAt="refreshTokenExpiresAt"in u?u.refreshTokenExpiresAt:void 0);let f={hostname:o,username:p,token:d,gitProtocol:i,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return await Rn(f),{success:!0,username:p,hostname:o}}catch(c){return{success:!1,error:c instanceof Error?c.message:"Authentication failed"}}}async function It(e=Le,o){let n=await Te(e);if(!n)return{success:!1,error:`Not logged in to ${e}`};if(o?.clientSecret)try{await Ry({clientType:"oauth-app",clientId:Mc,clientSecret:o.clientSecret,token:n.token.token,request:Ac.defaults({baseUrl:zc(e)})})}catch(i){console.error(`[github-oauth] Token revocation failed: ${i instanceof Error?i.message:String(i)}`)}return await rc(e),{success:!0}}function Et(e=Le){if(yt()){let i=fo();return{authenticated:!0,hostname:e,username:void 0,tokenSource:"env",envTokenSource:i??void 0}}let o=nc(e);if(o){let i=Je(o);return{authenticated:!i,hostname:o.hostname,username:o.username,tokenExpired:i,tokenSource:"octocode"}}let n=it();return n.authenticated?{authenticated:!0,hostname:e,username:n.username,tokenSource:"gh-cli"}:{authenticated:!1,tokenSource:"none"}}async function To(e=Le){if(yt()){let i=fo();return{authenticated:!0,hostname:e,username:void 0,tokenSource:"env",envTokenSource:i??void 0}}let o=await Te(e);if(o){let i=Je(o);return{authenticated:!i,hostname:o.hostname,username:o.username,tokenExpired:i,tokenSource:"octocode"}}let n=it();return n.authenticated?{authenticated:!0,hostname:e,username:n.username,tokenSource:"gh-cli"}:{authenticated:!1,tokenSource:"none"}}async function Nc(e=Le){let o=await Zn(e,Mc);return o.token?{token:o.token,source:"octocode",username:o.username}:{token:null,source:"none"}}function jc(e=Le){let o=Oo(e);if(o){let n=it();return{token:o,source:"gh-cli",username:n.username}}return{token:null,source:"none"}}async function Gp(e=Le,o="auto"){if(o==="octocode")return Nc(e);if(o==="gh")return jc(e);let n=await oc({hostname:e,getGhCliToken:Oo});if(n?.token){let i=n.source==="gh-cli"?"gh-cli":n.source?.startsWith("env:")?"env":"octocode";return{token:n.token,source:i,username:n.username,envSource:n.source?.startsWith("env:")?n.source:void 0}}return{token:null,source:"none"}}function Ao(){return ic()}function Bp(e,o){switch(e){case"env":return o??"env:GITHUB_TOKEN";case"gh-cli":return"gh-cli";case"octocode":return"octocode-storage";default:return"none"}}import Dc from"node:path";function Gy(){let e=Kn(),o=e.filter(i=>i.octocodeInstalled),n=e.filter(i=>i.configExists&&!i.octocodeInstalled);return{installedClients:o,availableClients:n,installedCount:o.length,availableCount:n.length,isInstalled:o.length>0,hasMoreToInstall:n.length>0}}function By(){let e=nt(),o=pe(),n=M(o)?ye(o).filter(c=>!c.startsWith(".")).length:0;if(!M(e))return{sourceExists:!1,destDir:o,skills:[],installedCount:0,notInstalledCount:0,totalInstalledCount:n,allInstalled:!1,hasSkills:!1};let t=ye(e).filter(c=>!c.startsWith(".")).map(c=>({name:c,installed:M(Dc.join(o,c)),srcPath:Dc.join(e,c),destPath:Dc.join(o,c)})),r=t.filter(c=>c.installed).length,a=t.filter(c=>!c.installed).length;return{sourceExists:!0,destDir:o,skills:t,installedCount:r,notInstalledCount:a,totalInstalledCount:n,allInstalled:a===0&&t.length>0,hasSkills:t.length>0}}async function Mo(){return{octocode:Gy(),skills:By(),currentClient:xt(),githubAuth:await To()}}import Wy from"open";async function lr(){console.log(),await q({message:l("Press Enter to continue..."),default:""})}function Hy(e){return e.map(o=>D[o.client]?.name||o.client).join(", ")}function qy(e){if(e.length===0){console.log(` ${l("No IDEs configured yet")}`);return}console.log(` ${l("Installed on:")}`);for(let o of e){let n=D[o.client]?.name||o.client;console.log(` ${l("\u2022")} ${l(n)} ${l("->")} ${s("cyan",o.configPath)}`)}}function Ky(e){return!e.sourceExists||!e.hasSkills?{name:`${l("- Manage System Skills")}`,value:"skills",description:l("Not available \u2014 no skill sources found")}:e.allInstalled?{name:`- Manage System Skills ${s("green","\u2705")}`,value:"skills",description:`${e.totalInstalledCount} installed \u2022 Research, PR Review & more`}:e.totalInstalledCount>0?{name:"- Manage System Skills",value:"skills",description:`${e.totalInstalledCount}/${e.skills.length} installed \u2022 Get more skills!`}:{name:`- ${m("Manage System Skills")} ${s("cyan","[NEW]")}`,value:"skills",description:"Install skills for AI-powered coding workflows"}}function Jy(e){let o=e.skills.filter(n=>n.name.startsWith("octocode-")&&n.installed).length;return o>0?{name:`- Octocode Skills ${s("green","\u2705")}`,value:"octocode-skills",description:`${o} installed \u2022 Research, planning & review`}:{name:"- Octocode Skills",value:"octocode-skills",description:"Install AI-powered research, planning & review skills"}}function Xy(e){switch(e.tokenSource){case"gh-cli":return"gh CLI";case"env":return e.envTokenSource?`env (${e.envTokenSource.replace("env:","")})`:"env var";case"octocode":return"Octocode";default:return"unknown"}}function Yy(e){if(e.authenticated){let o=Xy(e),n=e.username?`@${e.username}`:"",i=n?`${n} `:"";return{name:`- Manage Auth ${s("green","\u2705")}`,value:"auth",description:`${i}via ${o}`}}return{name:`- ${m("Manage Auth")} ${s("red","[Required]")}`,value:"auth",description:"Sign in to access GitHub"}}function Qy(e){let o=[];if(e.octocode.isInstalled){let n=e.octocode.installedCount===1?"client":"clients";o.push(`${s("green","\u25CF")} ${e.octocode.installedCount} ${n}`)}else o.push(`${s("yellow","\u25CB")} Not installed`);return e.skills.totalInstalledCount>0?o.push(`${s("green","\u25CF")} ${e.skills.totalInstalledCount} skills`):e.skills.sourceExists&&e.skills.hasSkills&&o.push(`${s("yellow","\u25CB")} ${e.skills.skills.length} skills`),o.join(l(" \u2502 "))}function eb(e){if(e.octocode.isInstalled){let o=e.octocode.installedCount===1?"IDE":"IDEs";return e.githubAuth.authenticated?{name:`- Octocode MCP ${s("green","\u2705")}`,value:"octocode",description:`Configure Octocode MCP - ${e.octocode.installedCount} ${o} configured`}:{name:`- Octocode MCP ${s("red","[X]")}`,value:"octocode",description:`Configure Octocode MCP - ${e.octocode.installedCount} ${o} configured`}}return{name:`- ${m("Octocode Configuration")}`,value:"octocode",description:"Configure Octocode MCP - 0 IDEs configured"}}function tb(e){e.githubAuth.authenticated?e.octocode.isInstalled&&e.skills.totalInstalledCount===0&&(console.log(),console.log(` ${s("cyan","Tip:")} ${l("Boost your AI coding:")} Install ${s("magenta","Skills")} for research, PR review & more!`)):(console.log(),console.log(` ${s("yellow","Warning:")} ${m("Auth required!")} Run ${s("cyan","Manage Auth")} to access GitHub repos`))}async function ob(e){console.log(),console.log(` ${l("Status:")} ${Qy(e)}`),tb(e);let o=[];return o.push(eb(e)),o.push(Jy(e.skills)),o.push(Ky(e.skills)),o.push(Yy(e.githubAuth)),o.push({name:"- Manage System MCP",value:"mcp-config",description:"Add, sync and configure MCP across all IDEs"}),o.push(new E),o.push({name:l("Exit"),value:"exit"}),console.log(),await Xe({message:"What would you like to do?",choices:o,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:i=>s("magenta",i),message:i=>m(i)}}})}async function nb(e){let o=[];if(e.octocode.isInstalled){if(e.octocode.hasMoreToInstall){let i=Hy(e.octocode.availableClients);o.push({name:"- Add Octocode",value:"install",description:i})}}else o.push({name:`- ${m("Install")} ${s("red","[X]")}`,value:"install",description:"Setup for Cursor, Claude, Windsurf..."});return e.octocode.isInstalled&&o.push({name:"- Configure Octocode",value:"configure",description:"Server options & preferences"}),o.push(new E),o.push({name:`${s("dim","- Back to main menu")}`,value:"back"}),await Xe({message:"",choices:o,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:i=>s("magenta",i)}}})}async function rb(){await W();let e=await Mo();console.log(),qy(e.octocode.installedClients);let o=!0,n=!0;for(;o;){if(n)n=!1;else{let t=new N(" Refreshing...").start();e=await Mo(),t.clear()}switch(await nb(e)){case"install":await hc(),console.log();break;case"configure":await Nd(),console.log();break;default:o=!1;break}}}async function ib(){let e=[];return e.push({name:"- Show MCP details",value:"inspect",description:"View and manage configured MCP servers"}),e.push({name:"- Sync Configurations",value:"sync",description:"Sync MCP configs across all IDEs"}),e.push({name:"- MCP Marketplace",value:"marketplace",description:"Browse and install community MCP servers"}),e.push(new E),e.push({name:`${s("dim","- Back to main menu")}`,value:"back"}),await Xe({message:"",choices:e,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:n=>s("magenta",n)}}})}async function sb(){await W(),console.log();let e=!0;for(;e;)switch(await ib()){case"inspect":await yc();break;case"sync":await xc(),console.log();break;case"marketplace":await kc(),console.log();break;default:e=!1;break}}async function ab(e){let o=[],n=e.tokenSource==="env",i=Oo(),t=it(),r=await Te(),a=!!i,c=!!r,u=yt();if(n&&u){let d=e.envTokenSource?.replace("env:","")||"environment variable";o.push(new E(` ${s("green","\u2705")} Using ${s("cyan",d)} ${l("(takes priority)")}`)),o.push(new E)}if(a){let d=t.username?` (@${t.username})`:"";o.push({name:`- Delete gh CLI token${d}`,value:"gh-logout",description:"Opens gh auth logout"})}if(c){let d=r.username?` (@${r.username})`:"";o.push({name:`- Delete Octocode token${d}`,value:"logout",description:"Remove from file"})}return c||o.push({name:`- Sign In via Octocode ${s("green","(Recommended)")}`,value:"login",description:"Quick browser sign in"}),a||o.push({name:"- Sign In via gh CLI",value:"gh-guidance",description:t.installed?"Use existing GitHub CLI":"GitHub CLI not installed"}),o.push(new E),o.push({name:`${s("dim","- Back")}`,value:"back"}),await Xe({message:"",choices:o,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:d=>s("magenta",d)}}})}async function cb(){console.log(),console.log(s("blue","\u2501".repeat(66))),console.log(` ${m("GitHub Authentication")}`),console.log(s("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("This will open your browser to authenticate with GitHub.")}`),console.log();let e=!1,o=null,n=new N("Connecting to GitHub...").start(),i=await cr({onVerification:t=>{n.stop(),e=!0,console.log(),console.log(s("yellow"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","!")} Your one-time code: ${m(s("cyan",t.user_code))}`+" ".repeat(24-t.user_code.length)+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${m("1.")} Copy the code above`),console.log(` ${m("2.")} ${m("Press Enter")} to open ${s("cyan",t.verification_uri)}`),console.log(` ${m("3.")} Paste the code in your browser`),console.log(),o=new N(`Waiting for browser authentication... ${l("(typically 10-30 seconds)")}`).start()}});return o&&o.stop(),e||n.stop(),console.log(),i.success?(console.log(s("green"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(s("green"," \u2502 ")+`${s("green","\u2705")} ${m("Authentication successful!")}`+" ".repeat(22)+s("green","\u2502")),console.log(s("green"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${s("green","\u2705")} Logged in as ${s("cyan","@"+(i.username||"unknown"))}`),console.log(` ${l("Credentials stored in:")} ${Ao()}`),console.log(),console.log(` ${s("cyan","Tip:")} ${m("What's next?")}`),console.log(` ${l("\u2022")} Install ${s("magenta","Skills")} for AI-powered research & PR reviews`),console.log(` ${l("\u2022")} Use ${s("cyan","/research")} prompt to explore any GitHub repo`),console.log(` ${l("\u2022")} Add ${s("cyan","AGENTS.md")} to your project for better AI context`)):(console.log(s("red"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(s("red"," \u2502 ")+`${s("red","X")} ${m("Authentication failed")}`+" ".repeat(27)+s("red","\u2502")),console.log(s("red"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${s("red","Error:")} ${i.error||"Unknown error"}`),console.log(),console.log(` ${m("Troubleshooting:")}`),console.log(` ${l("\u2022")} Make sure you copied the code correctly`),console.log(` ${l("\u2022")} Check your browser didn't block the popup`),console.log(` ${l("\u2022")} Try running ${s("cyan","octocode login")} again`)),console.log(),await lr(),i.success}async function lb(){let e=await To();console.log(),console.log(` ${m("Sign Out")}`),console.log(` ${l("Signed in as:")} ${s("cyan","@"+(e.username||"unknown"))}`),console.log();let o=await It();if(o.success){console.log(` ${s("green","\u2705")} Signed out successfully`);let n=it();n.authenticated&&console.log(` ${l("Tip:")} You can still use gh CLI (@${n.username||"unknown"})`)}else console.log(` ${s("red","X")} Sign out failed: ${o.error||"Unknown error"}`);return console.log(),await lr(),o.success}async function ub(){let e="https://cli.github.com/";console.log(),console.log(` ${m("Setup Instructions:")}`),console.log(),console.log(" 1. Install GitHub CLI from:"),console.log(` ${s("cyan",e)}`),console.log(),console.log(" 2. Run the following command to authenticate:"),console.log(` ${s("cyan","gh auth login")}`),console.log(),console.log(` ${l("Once authenticated, octocode will automatically")}`),console.log(` ${l("use your gh CLI token.")}`),console.log();let o=await Xe({message:"",choices:[{name:"- Open GitHub CLI website",value:"open-site"},new E,{name:`${s("dim","- Back")}`,value:"back"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:n=>s("cyan",n),message:n=>n}}});if(o!=="back"&&o==="open-site"){try{await Wy(e),console.log(),console.log(` ${s("green","\u2705")} Opened ${s("cyan",e)} in browser`)}catch{console.log(),console.log(` ${s("yellow","!")} Could not open browser automatically`),console.log(` ${l("Please visit:")} ${s("cyan",e)}`)}console.log(),await lr()}}function db(e){switch(e.tokenSource){case"gh-cli":return"gh CLI";case"env":return e.envTokenSource?`${e.envTokenSource.replace("env:","")} env var`:"environment variable";case"octocode":return"file";default:return"unknown"}}function pb(e){if(console.log(` ${m("GitHub Authentication")}`),console.log(),e.authenticated){let o=db(e);if(e.tokenSource==="env"){let n=e.envTokenSource?e.envTokenSource.replace("env:",""):"environment variable";console.log(` ${s("green","\u2705")} Using ${s("cyan",n)} ${l("(token configured)")}`)}else console.log(` ${s("green","\u2705")} Signed in as ${s("cyan","@"+(e.username||"unknown"))} ${l(`via ${o}`)}`);e.tokenExpired&&console.log(` ${s("yellow","Warning:")} Session expired - please sign in again`),console.log(),console.log(` ${s("green","\u2705")} ${l("Ready to access GitHub repositories!")}`)}else console.log(s("yellow"," \u250C"+"\u2500".repeat(56)+"\u2510")),console.log(s("yellow"," \u2502 ")+`${s("yellow","Warning:")} ${m("Authentication Required")}`+" ".repeat(31)+s("yellow","\u2502")),console.log(s("yellow"," \u2514"+"\u2500".repeat(56)+"\u2518")),console.log(),console.log(` ${l("Without auth, Octocode cannot:")}`),console.log(` ${s("red","X")} Access private repositories`),console.log(` ${s("red","X")} Search code in your organization`),console.log(` ${s("red","X")} Provide full GitHub research capabilities`),console.log(),console.log(` ${s("cyan","->")} Select ${s("green",'"Sign In via Octocode"')} below to authenticate`);console.log()}async function mb(){await W(),console.log();let e=!0;for(;e;){let o=await To();switch(pb(o),await ab(o)){case"login":{let i=await cb();console.log(),i&&(e=!1);break}case"gh-guidance":await ub();break;case"logout":await lb(),console.log();break;case"gh-logout":{if(await Xe({message:"Sign out of gh CLI?",choices:[{name:"Yes, sign out",value:"yes"},{name:"No, cancel",value:"no"}],theme:{prefix:" ",style:{highlight:r=>s("red",r)}}})!=="yes")break;console.log(),console.log(` ${l("Opening gh auth logout...")}`),console.log(),Vp().success?(console.log(),console.log(` ${s("green","\u2705")} Signed out of gh CLI`)):(console.log(),console.log(` ${s("yellow","!")} Sign out was cancelled`)),console.log(),await lr();break}default:e=!1;break}}}async function gb(e){switch(e){case"octocode":return await rb(),!0;case"octocode-skills":return await Ap(),!0;case"skills":return await Np(),!0;case"auth":return await mb(),!0;case"mcp-config":return await sb(),!0;case"exit":return Gn(),!1;default:return!0}}function fb(){console.log(` ${m("Environment")}`)}async function hb(){fb();let e=await ko();wo(e)&&(console.log(),console.log(` ${l("Tip:")} ${l("Run")} ${s("cyan","npx node-doctor")} ${l("for diagnostics")}`))}async function Wp(){let e=!0,o=!0;for(;o;){let n;if(e)n=await Mo();else{let t=new N(" Loading...").start();n=await Mo(),t.clear()}e||(Fn(),Vn(),await hb()),e=!1;let i=await ob(n);o=await gb(i)}}var Hp=new Set(["ide","method","m","output","o","hostname","H","git-protocol","p","type","t","skill","k","targets","mode","model","resume","r","id","client","c","search","category","env","config"]);function qp(e=process.argv.slice(2)){let o={command:null,args:[],options:{}},n=0;for(;n<e.length;){let i=e[n];if(i.startsWith("--")){let[t,r]=i.slice(2).split("=");r!==void 0?o.options[t]=r:Hp.has(t)&&n+1<e.length&&!e[n+1].startsWith("-")?(o.options[t]=e[n+1],n++):o.options[t]=!0}else if(i.startsWith("-")&&i.length>1){let t=i.slice(1),r=t[t.length-1];if(t.length===1&&Hp.has(r)&&n+1<e.length&&!e[n+1].startsWith("-"))o.options[r]=e[n+1],n++;else for(let a of t)o.options[a]=!0}else o.command?o.args.push(i):o.command=i;n++}return o}function Kp(e){return!!(e.options.help||e.options.h)}function Jp(e){return!!(e.options.version||e.options.v)}var zo={cursor:{name:"Cursor",description:"AI-first code editor",url:"https://cursor.sh"},"claude-desktop":{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"},"claude-code":{name:"Claude Code",description:"Claude CLI for terminal",url:"https://docs.anthropic.com/claude-code"},opencode:{name:"Opencode",description:"AI coding agent CLI",url:"https://opencode.ai"},"vscode-cline":{name:"Cline (VS Code)",description:"AI coding assistant extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev"},"vscode-roo":{name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",url:"https://github.com/RooVetGit/Roo-Cline"},"vscode-continue":{name:"Continue (VS Code)",description:"Open-source AI assistant",url:"https://continue.dev"},windsurf:{name:"Windsurf",description:"Codeium AI IDE",url:"https://codeium.com/windsurf"},trae:{name:"Trae",description:"Adaptive AI IDE",url:"https://trae.ai"},antigravity:{name:"Antigravity",description:"Gemini-powered AI IDE",url:"https://antigravity.dev"},zed:{name:"Zed",description:"High-performance code editor",url:"https://zed.dev"},codex:{name:"Codex",description:"OpenAI Codex CLI agent",url:"https://github.com/openai/codex"},"gemini-cli":{name:"Gemini CLI",description:"Google Gemini CLI",url:"https://github.com/google-gemini/gemini-cli"},goose:{name:"Goose",description:"Block AI coding agent",url:"https://block.github.io/goose"},kiro:{name:"Kiro",description:"AWS AI IDE",url:"https://kiro.dev"},custom:{name:"Custom Path",description:"Specify your own MCP config path",url:""},claude:{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"}},Uc={cursor:zo.cursor,claude:zo.claude},Xp={direct:{name:"Direct (curl)",description:"Download and run directly from octocode.ai",pros:["Always latest version","No npm required"],cons:["Requires curl (or PowerShell on Windows)","Slower startup"]},npx:{name:"NPX",description:"Run via npx from npm registry",pros:["Standard npm workflow","Faster after first run (cached)"],cons:["Requires Node.js/npm"]}};import Y from"node:path";import{existsSync as Lc,rmSync as Rc,mkdirSync as Qp,symlinkSync as vb}from"node:fs";function Yp(e){return e in zo?zo[e].name:e in Uc?Uc[e].name:e.charAt(0).toUpperCase()+e.slice(1)}function yb(e){switch(e.trim().toLowerCase()){case"claude":case"claude-code":case"claudecode":return"claude-code";case"claude-desktop":case"claudedesktop":return"claude-desktop";case"cursor":return"cursor";case"codex":return"codex";case"opencode":return"opencode";default:return null}}function bb(e,o){if(e==="claude-code")return o;if(G){let n=ue();switch(e){case"claude-desktop":return Y.join(n,"Claude Desktop","skills");case"cursor":return Y.join(R,".cursor","skills");case"codex":return Y.join(R,".codex","skills");case"opencode":return Y.join(R,".opencode","skills");default:return o}}switch(e){case"claude-desktop":return Y.join(R,".claude-desktop","skills");case"cursor":return Y.join(R,".cursor","skills");case"codex":return Y.join(R,".codex","skills");case"opencode":return Y.join(R,".opencode","skills");default:return o}}function em(e,o,n,i){try{if(Lc(o)){if(!i)return"skipped";Rc(o,{recursive:!0,force:!0})}return n==="symlink"?(vb(e,o,G?"junction":"dir"),"installed"):wt(e,o)?"installed":"failed"}catch{return"failed"}}function $b(e){return e==="claude-code"||e==="claude-desktop"}function tm(e,o){return e==="hybrid"?$b(o)?"copy":"symlink":e}async function kb(){await W();let e=await O({message:"Install skills to which platforms?",choices:[{name:"- Claude locations (claude-code + claude-desktop)",value:"claude-only"},{name:"- All supported platforms",value:"all"},{name:"- Custom selection",value:"custom"},{name:`${l("- Cancel")}`,value:"cancel"}],loop:!1});return e==="cancel"?[]:e==="claude-only"?["claude-code","claude-desktop"]:e==="all"?["claude-code","claude-desktop","cursor","codex","opencode"]:await vo({message:"Select target platforms",choices:[{name:"- claude-code",value:"claude-code",checked:!0},{name:"- claude-desktop",value:"claude-desktop",checked:!0},{name:"- cursor",value:"cursor"},{name:"- codex",value:"codex"},{name:"- opencode",value:"opencode"}],required:!0,loop:!1})}async function wb(){await W();let e=await O({message:"How should skills be installed?",choices:[{name:"- Hybrid (copy for Claude targets, symlink for others)",value:"hybrid"},{name:"- Full copies everywhere",value:"copy"},{name:"- Symlinks everywhere",value:"symlink"},{name:`${l("- Cancel")}`,value:"cancel"}],loop:!1});return e==="cancel"?null:e}function Cb(e){switch(e.trim().toLowerCase()){case"claude":case"claude-desktop":case"claudedesktop":return"claude-desktop";case"claude-code":case"claudecode":return"claude-code";case"cursor":return"cursor";case"windsurf":return"windsurf";case"trae":return"trae";case"antigravity":return"antigravity";case"zed":return"zed";case"vscode-cline":case"cline":return"vscode-cline";case"vscode-roo":case"roo":case"roo-cline":return"vscode-roo";case"vscode-continue":case"continue":return"vscode-continue";case"opencode":return"opencode";case"codex":return"codex";case"gemini":case"gemini-cli":case"geminicli":return"gemini-cli";case"goose":return"goose";case"kiro":return"kiro";case"custom":return"custom";default:return null}}function xb(e){if(!e||e.trim().length===0)return{values:{}};let o=e.split(",").map(t=>t.trim()).filter(Boolean),n={},i=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let t of o){let r=t.indexOf("=");if(r<=0)return{values:{},error:`Invalid --env pair: "${t}" (expected KEY=VALUE)`};let a=t.slice(0,r).trim(),c=t.slice(r+1);if(!i.test(a))return{values:{},error:`Invalid env var name: "${a}"`};n[a]=c}return{values:n}}function om(){console.log(` ${l("For deeper diagnostics:")} ${s("cyan","npx node-doctor")}`),console.log()}function Zc(e,o){switch(e){case"octocode":return s("cyan","octocode");case"gh-cli":return s("magenta","gh cli");case"env":if(o){let n=o.replace("env:","");return s("green",n)}return s("green","environment variable");default:return l("none")}}var Sb={name:"install",aliases:["i"],description:"Install octocode-mcp for an IDE",usage:"octocode install --ide <ide> [--method <npx|direct>] [--force]",options:[{name:"ide",description:"IDE to configure: cursor, claude-desktop, claude-code, windsurf, zed, vscode-cline, vscode-roo, vscode-continue, opencode, trae, antigravity, codex, gemini-cli, goose, kiro",hasValue:!0},{name:"method",short:"m",description:"Installation method (npx or direct)",hasValue:!0,default:"npx"},{name:"force",short:"f",description:"Overwrite existing configuration"}],handler:async e=>{let o=e.options.ide,n=e.options.method||"npx",i=!!(e.options.force||e.options.f);if(n==="npx"){let u=Jn(),p=Xn();if(!u.installed){console.log(),console.log(` ${s("red","\u2717")} Node.js is ${s("red","not found in PATH")}`),console.log(` ${l("Node.js is required for npx installation method.")}`),console.log(),om(),process.exitCode=1;return}if(!p.installed){console.log(),console.log(` ${s("yellow","\u26A0")} npm is ${s("yellow","not found in PATH")}`),console.log(` ${l("npm is required for npx installation method.")}`),console.log(),om(),process.exitCode=1;return}}if(!o){let u=Sd();if(console.log(),console.log(` ${s("red","\u2717")} Missing required option: ${s("cyan","--ide")}`),console.log(),u.length>0){console.log(` ${m("Available IDEs:")}`);for(let p of u)console.log(` ${s("cyan","\u2022")} ${p}`)}else console.log(` ${s("yellow","\u26A0")} No supported IDEs detected.`),console.log(` ${l("Install Cursor or Claude Desktop first.")}`);console.log(),console.log(` ${l("Usage:")} octocode install --ide cursor --method npx`),console.log(),process.exitCode=1;return}let t=["cursor","claude","claude-desktop","claude-code","windsurf","zed","vscode-cline","vscode-roo","vscode-continue","opencode","trae","antigravity","codex","gemini-cli","goose","kiro"];if(!t.includes(o)){console.log(),console.log(` ${s("red","\u2717")} Invalid IDE: ${o}`),console.log(` ${l("Supported:")} ${t.join(", ")}`),console.log(),process.exitCode=1;return}if(!["npx","direct"].includes(n)){console.log(),console.log(` ${s("red","\u2717")} Invalid method: ${n}`),console.log(` ${l("Supported:")} npx, direct`),console.log(),process.exitCode=1;return}let r=Pd(o,n);if(r.action==="override"&&!i){console.log(),console.log(` ${s("yellow","\u26A0")} Octocode is already configured.`),console.log(` ${l("Use")} ${s("cyan","--force")} ${l("to overwrite.")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${m("Installing octocode-mcp")}`),console.log(` ${l("IDE:")} ${Yp(o)}`),console.log(` ${l("Method:")} ${Xp[n].name}`),console.log(` ${l("Action:")} ${r.action.toUpperCase()}`),console.log();let a=new N("Writing configuration...").start(),c=_d({ide:o,method:n,force:i});c.success?(a.succeed("Installation complete!"),console.log(),console.log(` ${s("green","\u2713")} Config saved to: ${r.configPath}`),c.backupPath&&console.log(` ${l("Backup:")} ${c.backupPath}`),console.log(),console.log(` ${m("Next:")} Restart ${Yp(o)} to activate.`),console.log()):(a.fail("Installation failed"),console.log(),c.error&&console.log(` ${s("red","\u2717")} ${c.error}`),console.log(),process.exitCode=1)}},ur={name:"login",aliases:["l"],description:"Authenticate with GitHub",usage:"octocode login [--hostname <host>] [--git-protocol <ssh|https>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0},{name:"git-protocol",short:"p",description:"Git protocol to use (ssh or https)",hasValue:!0}],handler:async e=>{let o=e.options.hostname??e.options.H,n=(typeof o=="string"?o:void 0)||"github.com",i=Et(n);if(i.authenticated){console.log(),console.log(` ${s("green","\u2713")} Already authenticated as ${s("cyan",i.username||"unknown")}`),console.log(),console.log(` ${l("To switch accounts, logout first:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode logout")}`),console.log();return}console.log(),console.log(` ${m("\u{1F510} GitHub Authentication")}`),console.log();let t=e.options["git-protocol"],r=typeof t=="string"?t:"https",a=!1,c=new N("Waiting for GitHub authentication...").start(),u=await cr({hostname:n,gitProtocol:r,onVerification:p=>{c.stop(),a=!0,console.log(` ${s("yellow","!")} First copy your one-time code: ${m(p.user_code)}`),console.log(),console.log(` ${m("Press Enter")} to open ${s("cyan",p.verification_uri)} in your browser...`),console.log(),console.log(` ${l("Waiting for authentication...")}`)}});a||c.stop(),console.log(),u.success?(console.log(` ${s("green","\u2713")} Authentication complete!`),console.log(` ${s("green","\u2713")} Logged in as ${s("cyan",u.username||"unknown")}`),console.log(),console.log(` ${l("Credentials stored in:")} ${Ao()}`)):(console.log(` ${s("red","\u2717")} Authentication failed: ${u.error||"Unknown error"}`),process.exitCode=1),console.log()}},rm={name:"logout",description:"Sign out from GitHub",usage:"octocode logout [--hostname <host>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname",hasValue:!0}],handler:async e=>{let o=e.options.hostname??e.options.H,n=(typeof o=="string"?o:void 0)||"github.com",i=Et(n);if(!i.authenticated){console.log(),console.log(` ${s("yellow","\u26A0")} Not currently authenticated to ${n}`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode login")}`),console.log();return}console.log(),console.log(` ${m("\u{1F510} GitHub Logout")}`),console.log(` ${l("Currently authenticated as:")} ${s("cyan",i.username||"unknown")}`),console.log();let t=await It(n);t.success?console.log(` ${s("green","\u2713")} Successfully logged out from ${n}`):(console.log(` ${s("red","\u2717")} Logout failed: ${t.error||"Unknown error"}`),process.exitCode=1),console.log()}},_b={name:"auth",aliases:["a","gh"],description:"Manage GitHub authentication",usage:"octocode auth [login|logout|status|token]",handler:async e=>{let o=e.args[0],n=e.options.hostname||"github.com";if(o==="login")return ur.handler(e);if(o==="logout")return rm.handler(e);if(o==="status")return nm();if(o==="token"){let a=await Nc(n);if(a.token){console.log(a.token);return}let c=jc(n);if(c.token){console.log(c.token);return}console.log(),console.log(` ${s("yellow","\u26A0")} No GitHub token found.`),console.log(),console.log(` ${l("GitHub authentication is required to access private repositories.")}`),console.log(),console.log(` ${m("To authenticate, choose one of:")}`),console.log(),console.log(` ${s("cyan","octocode auth login")} ${l("Recommended - stores token securely")}`),console.log(` ${s("cyan","gh auth login")} ${l("Use existing GitHub CLI")}`),console.log(),console.log(` ${l("Learn more:")} ${s("blue",Zp)}`),console.log(),process.exitCode=1;return}let i=Et(n);await nm(n),await W();let t=i.authenticated?[{name:"\u{1F513} Logout from GitHub",value:"logout"},{name:"\u{1F504} Switch account (logout & login)",value:"switch"},{name:"\u2190 Back",value:"back"}]:[{name:"\u{1F510} Login to GitHub",value:"login"},{name:"\u2190 Back",value:"back"}],r=await O({message:"What would you like to do?",choices:t});r==="login"?await ur.handler({command:"login",args:[],options:{}}):r==="logout"?(await It(n),console.log(),console.log(` ${s("green","\u2713")} Successfully logged out`),console.log()):r==="switch"&&(console.log(),console.log(` ${l("Logging out...")}`),await It(),console.log(` ${s("green","\u2713")} Logged out`),console.log(),console.log(` ${l("Starting new login...")}`),await ur.handler({command:"login",args:[],options:{}}))}};async function nm(e="github.com"){console.log(),console.log(` ${m("\u{1F510} GitHub Authentication")}`),console.log();let o=Et(e);o.authenticated?(console.log(` ${s("green","\u2713")} Authenticated as ${s("cyan",o.username||"unknown")}`),o.tokenExpired&&console.log(` ${s("yellow","\u26A0")} Token has expired - please login again`),console.log(` ${l("Host:")} ${o.hostname}`),console.log(` ${l("Source:")} ${Zc(o.tokenSource||"none",o.envTokenSource)}`)):(console.log(` ${s("yellow","\u26A0")} ${s("yellow","Not authenticated")}`),console.log(),console.log(` ${m("To authenticate:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","gh auth login")}`)),console.log(),console.log(` ${l("Credentials stored in:")} ${Ao()}`),console.log()}var Pb={name:"skills",aliases:["sk"],description:"Install Octocode skills across AI clients",usage:"octocode skills [install|remove|list] [--skill <name>] [--targets <list>] [--mode <copy|symlink>]",options:[{name:"force",short:"f",description:"Overwrite existing skills"},{name:"skill",short:"k",description:"Skill folder name (used by install/remove)",hasValue:!0},{name:"targets",short:"t",description:"Comma-separated targets: claude-code, claude-desktop, cursor, codex, opencode",hasValue:!0},{name:"mode",short:"m",description:"Install mode: copy (default) or symlink",hasValue:!0,default:"copy"}],handler:async e=>{let o=e.args[0]||"list",n=!!(e.options.force||e.options.f),i=e.options.skill??e.options.k,t=typeof i=="string"&&i.length>0?i:void 0,r=o==="remove"?void 0:e.options.targets??e.options.t,a=o==="remove"?void 0:e.options.mode??e.options.m,c="copy";if(typeof a=="string"&&a.trim().length>0){let v=a.trim().toLowerCase();if(v!=="copy"&&v!=="symlink"){console.log(),console.log(` ${s("red","X")} Invalid --mode value: ${s("yellow",a)}`),console.log(` ${l("Allowed values:")} copy, symlink`),console.log(` ${l("Example:")} octocode skills install --mode symlink`),console.log(),process.exitCode=1;return}c=v}let u=typeof r=="string"&&r.trim().length>0,p=typeof a=="string"&&a.length>0,d=nt(),f=pe(),$=["claude-code"];if(typeof r=="string"&&r.trim().length>0){let v=r.split(",").map(_=>yb(_)).filter(_=>_!==null);if($=[...new Set(v)],$.length===0){console.log(),console.log(` ${s("red","X")} No valid targets provided`),console.log(` ${l("Valid targets:")} claude-code, claude-desktop, cursor, codex, opencode`),console.log(),process.exitCode=1;return}}let b=c;if(o==="install"&&process.stdout.isTTY&&(!u||!p)){let v=await kb();if(v.length===0){console.log(),console.log(` ${s("yellow","WARN")} Skills install cancelled`),console.log();return}$=v;let _=await wb();if(!_){console.log(),console.log(` ${s("yellow","WARN")} Skills install cancelled`),console.log();return}b=_}let h=$.map(v=>({target:v,destDir:bb(v,f)}));if(!M(d)){console.log(),console.log(` ${s("red","\u2717")} Skills directory not found`),console.log(` ${l("Expected:")} ${d}`),console.log(),process.exitCode=1;return}let k=ye(d).filter(v=>!v.startsWith("."));if(o==="list"){console.log(),console.log(` ${m("Available Octocode Skills")}`),console.log(),console.log(` ${m("Install destinations:")}`);for(let v of h)console.log(` ${s("cyan","\u2022")} ${v.target}: ${v.destDir}`);if(console.log(),k.length===0)console.log(` ${l("No skills available.")}`);else for(let v of k){let S=h.every(P=>M(Y.join(P.destDir,v)))?s("green","installed"):l("not installed");console.log(` ${s("cyan","\u2022")} ${v} ${S}`)}console.log(),console.log(` ${l("To install all:")} octocode skills install`),console.log(` ${l("To install one:")} octocode skills install --skill <name> ${l("(or -k <name>)")}`),console.log(` ${l("Multi-install:")} octocode skills install --targets claude-code,cursor,codex --mode symlink`),console.log();return}if(o==="install"){if(t){if(console.log(),console.log(` ${m(`Installing skill: ${t}`)}`),console.log(),!k.includes(t)){console.log(` ${s("red","\u2717")} Skill not found: ${t}`),console.log(),console.log(` ${l("Available skills:")}`);for(let we of k)console.log(` ${s("cyan","\u2022")} ${we}`);console.log(),process.exitCode=1;return}let T=new N(`Installing ${t}...`).start(),H=Y.join(d,t),J=0,oe=0,Me=0;for(let we of h){M(we.destDir)||Qp(we.destDir,{recursive:!0,mode:448});let Vc=em(H,Y.join(we.destDir,t),tm(b,we.target),n);Vc==="installed"?J++:Vc==="skipped"?oe++:Me++}if(Me===0){T.succeed(`Installed ${t}!`),console.log(),console.log(` ${s("green","\u2705")} Installed to ${J}/${h.length} targets`);for(let we of h)console.log(` ${s("cyan","\u2022")} ${we.target}: ${Y.join(we.destDir,t)}`);oe>0&&console.log(` ${s("yellow","WARN")} Skipped ${oe} existing target(s) ${l("(use --force to overwrite)")}`)}else T.fail(`Failed to install ${t}`),process.exitCode=1;console.log();return}if(console.log(),console.log(` ${m("Installing Octocode Skills")}`),console.log(),k.length===0){console.log(` ${s("yellow","\u26A0")} No skills to install.`),console.log();return}let v=new N("Installing skills...").start(),_=0,S=0,P=0;for(let T of k){let H=Y.join(d,T);for(let J of h){M(J.destDir)||Qp(J.destDir,{recursive:!0,mode:448});let oe=em(H,Y.join(J.destDir,T),tm(b,J.target),n);oe==="installed"?_++:oe==="skipped"?S++:P++}}P===0?v.succeed("Skills installation complete!"):v.fail("Skills installation completed with errors"),console.log(),_>0&&console.log(` ${s("green","\u2705")} Installed ${_} skill target(s)`),S>0&&(console.log(` ${s("yellow","WARN")} Skipped ${S} existing skill target(s)`),console.log(` ${l("Use")} ${s("cyan","--force")} ${l("to overwrite.")}`)),P>0&&(console.log(` ${s("red","X")} Failed ${P} skill target(s)`),process.exitCode=1),console.log(),console.log(` ${m("Targets:")}`);for(let T of h)console.log(` ${s("cyan","\u2022")} ${T.target}: ${T.destDir}`);console.log(),console.log(` ${m("Skills installation finished.")}`),console.log();return}if(o==="remove"){if(!t){console.log(),console.log(` ${s("red","X")} Missing required option: ${s("cyan","--skill <name>")}`),console.log(),console.log(` ${l("Usage:")} octocode skills remove --skill <name>`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${m(`Removing skill: ${t}`)}`),console.log();let v=0,_=0;for(let S of h){let P=Y.join(S.destDir,t);if(!M(P)){_++;continue}Ct(P)?v++:(console.log(` ${s("red","X")} Failed to remove from ${S.target}: ${P}`),process.exitCode=1)}v>0&&console.log(` ${s("green","\u2705")} Removed from ${v}/${h.length} targets`),_>0&&console.log(` ${s("yellow","WARN")} Not found in ${_} target(s) ${l("(already absent)")}`),console.log();return}console.log(),console.log(` ${s("red","\u2717")} Unknown subcommand: ${o}`),console.log(` ${l("Usage:")} octocode skills [install|remove|list] [--skill <name>]`),console.log(),process.exitCode=1}},Ib={name:"token",aliases:["t"],description:"Print the GitHub token (matches octocode-mcp priority)",usage:"octocode token [--type <auto|octocode|gh>] [--hostname <host>] [--source] [--json]",options:[{name:"type",short:"t",description:"Token source: auto (default: env\u2192gh\u2192octocode), octocode, gh",hasValue:!0,default:"auto"},{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0},{name:"source",short:"s",description:"Show token source and user info"},{name:"json",short:"j",description:'Output as JSON: {"token": "...", "type": "..."}'}],handler:async e=>{let o=e.options.hostname??e.options.H,n=(typeof o=="string"?o:void 0)||"github.com",i=!!(e.options.source||e.options.s),t=!!(e.options.json||e.options.j),r=e.options.type??e.options.t,a=(typeof r=="string"?r:void 0)||"auto",c;switch(a.toLowerCase()){case"octocode":case"o":c="octocode";break;case"gh":case"gh-cli":case"g":c="gh";break;case"auto":case"a":c="auto";break;default:if(t){console.log(JSON.stringify({token:null,type:"none"})),process.exitCode=1;return}console.log(),console.log(` ${s("red","\u2717")} Invalid token type: ${a}`),console.log(` ${l("Valid options:")} octocode, gh, auto`),console.log(),process.exitCode=1;return}let u=await Gp(n,c);if(t){let p={token:u.token,type:Bp(u.source,u.envSource)};console.log(JSON.stringify(p)),u.token||(process.exitCode=1);return}if(!u.token){console.log(),c==="octocode"?(console.log(` ${s("yellow","\u26A0")} No Octocode token found for ${n}`),console.log(),console.log(` ${l("To login with Octocode:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode login")}`),console.log(),console.log(` ${l("Or use gh CLI token:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode token --type=gh")}`)):c==="gh"?(console.log(` ${s("yellow","\u26A0")} No gh CLI token found for ${n}`),console.log(),console.log(` ${l("To login with gh CLI:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","gh auth login")}`),console.log(),console.log(` ${l("Or use Octocode token:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode token --type=octocode")}`)):(console.log(` ${s("yellow","\u26A0")} Not authenticated to ${n}`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","gh auth login")}`)),console.log(),process.exitCode=1;return}i?(console.log(),console.log(` ${s("green","\u2713")} Token found`),console.log(` ${l("Source:")} ${Zc(u.source,u.envSource)}`),u.username&&console.log(` ${l("User:")} ${s("cyan","@"+u.username)}`),console.log(),console.log(` ${l("Token:")} ${u.token}`),console.log()):console.log(u.token)}},Eb={name:"status",aliases:["s"],description:"Show GitHub authentication status",usage:"octocode status [--hostname <host>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0}],handler:async e=>{let o=e.options.hostname??e.options.H,i=Et((typeof o=="string"?o:void 0)||"github.com");console.log(),i.authenticated?(console.log(` ${s("green","\u2713")} Logged in as ${s("cyan",i.username||"unknown")}`),console.log(` ${l("Host:")} ${i.hostname}`),console.log(` ${l("Source:")} ${Zc(i.tokenSource||"none",i.envTokenSource)}`),i.tokenExpired&&console.log(` ${s("yellow","\u26A0")} Token has expired - please login again`)):(console.log(` ${s("yellow","\u26A0")} Not logged in`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${s("cyan","\u2192")} ${s("yellow","gh auth login")}`)),console.log()}},Ob={name:"sync",aliases:["sy"],description:"Sync MCP configurations across all IDE clients",usage:"octocode sync [--force] [--dry-run] [--status]",options:[{name:"force",short:"f",description:"Auto-resolve conflicts (use first variant)"},{name:"dry-run",short:"n",description:"Show what would be synced without making changes"},{name:"status",short:"s",description:"Show sync status without syncing"}],handler:async e=>{let o=!!(e.options.force||e.options.f),n=!!(e.options["dry-run"]||e.options.n);if(!!(e.options.status||e.options.s)){console.log(),console.log(` ${m("\u{1F504} MCP Sync Status")}`),console.log();let a=new N("Scanning configurations...").start(),c=_o(),u=Po(c);a.stop(),console.log(` ${m("Clients:")} ${u.summary.clientsWithConfig} with MCP configs`),console.log();for(let p of u.clients){let d=ae(p.client),f=p.exists?s("green","\u25CF"):s("dim","\u25CB"),$=p.exists?`${p.mcpCount} MCPs`:l("no config");console.log(` ${f} ${d}: ${$}`)}console.log(),console.log(` ${m("MCPs:")}`),console.log(` ${s("cyan","\u2022")} ${u.summary.totalUniqueMCPs} unique MCPs`),u.summary.consistentMCPs>0&&console.log(` ${s("green","\u2713")} ${u.summary.consistentMCPs} fully synced`),u.summary.needsSyncCount>0&&console.log(` ${s("yellow","\u25CB")} ${u.summary.needsSyncCount} can be auto-synced`),u.summary.conflictCount>0&&console.log(` ${s("red","!")} ${u.summary.conflictCount} have conflicts`),console.log(),(u.summary.needsSyncCount>0||u.summary.conflictCount>0)&&(console.log(` ${l("Run")} ${s("cyan","octocode sync")} ${l("to synchronize.")}`),u.summary.conflictCount>0&&console.log(` ${l("Use")} ${s("cyan","--force")} ${l("to auto-resolve conflicts.")}`),console.log());return}console.log(),console.log(` ${m("\u{1F504} MCP Sync")}`),console.log();let t=new N("Analyzing configurations...").start(),r=await Sc({force:o,dryRun:n});r.syncPerformed?r.success?(t.succeed(r.message),console.log(),console.log(` ${m("Next:")} Restart your IDEs to apply changes.`)):(t.fail(r.message),process.exitCode=1):(t.stop(),r.success?console.log(` ${s("green","\u2713")} ${r.message}`):(console.log(` ${s("yellow","\u26A0")} ${r.message}`),!o&&r.message.includes("conflict")&&(console.log(),console.log(` ${l("Options:")}`),console.log(` ${s("cyan","\u2022")} Run ${s("cyan","octocode")} for interactive mode`),console.log(` ${s("cyan","\u2022")} Use ${s("cyan","--force")} to auto-resolve`)),process.exitCode=1)),console.log()}},Tb={name:"mcp",description:"Non-interactive MCP marketplace management",usage:"octocode mcp [list|install|remove|status] [--id <mcp-id>] [--client <client>|--config <path>] [--search <text>] [--category <name>] [--env KEY=VALUE[,KEY=VALUE]] [--force]",options:[{name:"id",description:"MCP registry id (required for install/remove)",hasValue:!0},{name:"client",short:"c",description:"Target client: cursor, claude-desktop, claude-code, windsurf, trae, antigravity, zed, vscode-cline, vscode-roo, vscode-continue, opencode, codex, gemini-cli, goose, kiro",hasValue:!0},{name:"config",description:"Custom MCP config path (uses custom client)",hasValue:!0},{name:"search",description:"Filter list by id/name/description/tags",hasValue:!0},{name:"category",description:"Filter list by category",hasValue:!0},{name:"env",description:"Comma-separated env values: KEY=VALUE,KEY2=VALUE2",hasValue:!0},{name:"installed",description:"List only MCPs installed in target config"},{name:"force",short:"f",description:"Overwrite existing MCP entry on install"}],handler:async e=>{let o=(e.args[0]||"list").toLowerCase(),n=e.options.id,i=typeof n=="string"&&n.trim().length>0?n.trim():void 0,t=e.options.client??e.options.c,r=e.options.config,a=e.options.search,c=e.options.category,u=e.options.env,p=!!e.options.installed,d=!!(e.options.force||e.options.f),f="claude-code",$;if(typeof r=="string"&&r.trim().length>0)f="custom",$=r.trim();else if(typeof t=="string"&&t.trim().length>0){let v=Cb(t);if(!v){console.log(),console.log(` ${s("red","X")} Invalid --client value: ${s("yellow",t)}`),console.log(` ${l("Allowed values:")} cursor, claude-desktop, claude-code, windsurf, trae, antigravity, zed, vscode-cline, vscode-roo, vscode-continue, opencode, codex, gemini-cli, goose, kiro`),console.log(),process.exitCode=1;return}f=v}let b=F(f,$),h=V(b)||{mcpServers:{}},k=h.mcpServers||{};if(o==="list"){let v=se;if(typeof a=="string"&&a.trim().length>0){let _=a.trim().toLowerCase();v=v.filter(S=>S.id.toLowerCase().includes(_)||S.name.toLowerCase().includes(_)||S.description.toLowerCase().includes(_)||S.tags?.some(P=>P.toLowerCase().includes(_)))}if(typeof c=="string"&&c.trim().length>0){let _=c.trim().toLowerCase();v=v.filter(S=>S.category===_)}if(p){let _=new Set(Object.keys(k));v=v.filter(S=>_.has(S.id))}if(console.log(),console.log(` ${m("MCP Marketplace (non-interactive)")}`),console.log(` ${l("Config:")} ${b}`),console.log(` ${l("Results:")} ${v.length}`),console.log(),v.length===0){console.log(` ${l("No MCP entries matched your filters.")}`),console.log();return}for(let _ of v){let S=k[_.id]?s("green","installed"):l("not installed");console.log(` ${s("cyan","\u2022")} ${_.id} ${l("("+_.category+")")} ${S}`)}console.log();return}if(o==="status"){let v=Object.keys(k).sort((_,S)=>_.localeCompare(S));console.log(),console.log(` ${m("MCP Config Status")}`),console.log(` ${l("Client:")} ${D[f]?.name||f}`),console.log(` ${l("Config:")} ${b}`),console.log(` ${l("Installed MCPs:")} ${v.length}`),console.log();for(let _ of v)console.log(` ${s("cyan","\u2022")} ${_}`);v.length===0&&console.log(` ${l("No MCP servers configured yet.")}`),console.log();return}if(o==="install"){if(!i){console.log(),console.log(` ${s("red","X")} Missing required option: --id <mcp-id>`),console.log(),process.exitCode=1;return}let v=se.find(J=>J.id.toLowerCase()===i.toLowerCase());if(!v){console.log(),console.log(` ${s("red","X")} MCP not found in registry: ${i}`),console.log(),process.exitCode=1;return}let _=xb(typeof u=="string"?u:void 0);if(_.error){console.log(),console.log(` ${s("red","X")} ${_.error}`),console.log(),process.exitCode=1;return}if(k[v.id]&&!d){console.log(),console.log(` ${s("yellow","WARN")} MCP already installed: ${v.id}`),console.log(` ${l("Use --force to overwrite existing configuration.")}`),console.log(),process.exitCode=1;return}let S={command:v.installConfig.command,args:[...v.installConfig.args]},P={...v.installConfig.env||{},..._.values};Object.keys(P).length>0&&(S.env=P);let T={...h,mcpServers:{...k,[v.id]:S}},H=te(b,T);if(!H.success){console.log(),console.log(` ${s("red","X")} Failed to write MCP config`),console.log(` ${l(H.error||"Unknown write error")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${s("green","\u2705")} Installed MCP: ${v.id}`),console.log(` ${l("Client:")} ${D[f]?.name||f}`),console.log(` ${l("Config:")} ${b}`),console.log();return}if(o==="remove"){if(!i){console.log(),console.log(` ${s("red","X")} Missing required option: --id <mcp-id>`),console.log(),process.exitCode=1;return}let v=Object.keys(k).find(P=>P.toLowerCase()===i.toLowerCase());if(!v){console.log(),console.log(` ${s("yellow","WARN")} MCP not installed: ${i}`),console.log(` ${l("Nothing to remove from target config.")}`),console.log(),process.exitCode=1;return}let _={...k};delete _[v];let S=te(b,{...h,mcpServers:_});if(!S.success){console.log(),console.log(` ${s("red","X")} Failed to update MCP config`),console.log(` ${l(S.error||"Unknown write error")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${s("green","\u2705")} Removed MCP: ${i}`),console.log(` ${l("Client:")} ${D[f]?.name||f}`),console.log(` ${l("Config:")} ${b}`),console.log();return}console.log(),console.log(` ${s("red","X")} Unknown mcp subcommand: ${o}`),console.log(` ${l("Usage:")} octocode mcp [list|install|remove|status]`),console.log(),process.exitCode=1}},Ab={name:"cache",description:"Inspect and clean Octocode cache and logs",usage:"octocode cache [status|clean] [--repos] [--skills] [--logs] [--tools|--local|--lsp|--api] [--all]",options:[{name:"repos",description:"Target cloned repositories cache"},{name:"skills",description:"Target marketplace skills cache"},{name:"logs",description:"Target Octocode logs directory"},{name:"all",short:"a",description:"Target repos + skills + logs (tool flags are advisory)"},{name:"tools",description:"Target tool caches (local + lsp + api). In-memory caches clear on MCP restart."},{name:"local",description:"Target local tool cache. In-memory cache clears on MCP restart."},{name:"lsp",description:"Target LSP tool cache. In-memory cache clears on MCP restart."},{name:"api",description:"Target remote API tool cache. In-memory cache clears on MCP restart."}],handler:async e=>{let o=(e.args[0]||"status").toLowerCase(),n=ie.home||process.env.OCTOCODE_HOME||Y.join(process.env.HOME||"",".octocode"),i=ie.repos||Y.join(n,"repos"),t=ie.logs||Y.join(n,"logs"),r=_p(),a=!!e.options.repos,c=!!e.options.skills,u=!!e.options.logs,p=!!e.options.tools,d=!!e.options.local,f=!!e.options.lsp,$=!!e.options.api,b=!!(e.options.all||e.options.a),h=b||a,k=b||c,v=b||u,_=p||d||f||$;if(o==="status"){let S=Ue(i),P=Ue(r),T=Ue(t),H=S+P+T;console.log(),console.log(` ${m("\u{1F9F9} Octocode Cache Status")}`),console.log(),console.log(` ${l("Home:")} ${n}`),console.log(),console.log(` ${s("cyan","\u2022")} repos: ${bt(S)} ${l(`(${i})`)}`),console.log(` ${s("cyan","\u2022")} skills: ${bt(P)} ${l(`(${r})`)}`),console.log(` ${s("cyan","\u2022")} logs: ${bt(T)} ${l(`(${t})`)}`),console.log(),console.log(` ${m("Total:")} ${bt(H)}`),console.log(),console.log(` ${l("Clean examples:")}`),console.log(` ${s("yellow","octocode cache clean --repos")}`),console.log(` ${s("yellow","octocode cache clean --tools")}`),console.log(` ${s("yellow","octocode cache clean --all")}`),console.log();return}if(o==="clean"){if(!h&&!k&&!v&&!_){console.log(),console.log(` ${s("red","X")} Missing clean target. Use --repos, --skills, --logs, --tools, or --all`),console.log(` ${l("Example:")} octocode cache clean --all`),console.log(),process.exitCode=1;return}let S=h,P=k,T=v,H=!1,J=0;if(S&&Lc(i)&&(J+=Ue(i),Rc(i,{recursive:!0,force:!0}),H=!0),P){let oe=Ue(r);Sp();let Me=Ue(r);(oe>0||Me===0)&&(J+=Math.max(0,oe-Me),H=!0)}if(T&&Lc(t)&&(J+=Ue(t),Rc(t,{recursive:!0,force:!0}),H=!0),_){let oe=[p?"--tools":"",d?"--local":"",f?"--lsp":"",$?"--api":""].filter(Boolean).join(", ");console.log(` ${s("yellow","\u2139")} ${oe}: No disk caches to clean. Tool caches are in-memory and clear on MCP server restart.`)}console.log(),H?(console.log(` ${s("green","\u2713")} Cache cleanup complete`),console.log(` ${l("Freed:")} ${bt(J)}`)):_||console.log(` ${s("yellow","\u26A0")} Nothing to clean`),console.log();return}console.log(),console.log(` ${s("red","\u2717")} Unknown cache subcommand: ${o}`),console.log(` ${l("Usage:")} octocode cache [status|clean] [--repos] [--skills] [--logs] [--tools|--local|--lsp|--api] [--all]`),console.log(),process.exitCode=1}},Mb=[Sb,_b,ur,rm,Pb,Tb,Ab,Ib,Eb,Ob];function Fc(e){return Mb.find(o=>o.name===e||o.aliases?.includes(e))}function im(){console.log(),console.log(` ${s("magenta",m("\u{1F50D}\u{1F419} Octocode CLI"))} - Install and configure octocode-mcp`),console.log(),console.log(` ${m("USAGE")}`),console.log(` ${s("magenta","octocode")} [command] [options]`),console.log(),console.log(` ${m("COMMANDS")}`),console.log(` ${s("magenta","install")} Configure octocode-mcp for an IDE`),console.log(` ${s("magenta","skills")} Install Octocode skills across AI clients`),console.log(` ${s("magenta","cache")} Inspect and clean Octocode cache directories`),console.log(` ${s("magenta","sync")} Sync MCP configurations across all IDEs`),console.log(` ${s("magenta","mcp")} Manage MCP marketplace non-interactively`),console.log(` ${s("magenta","auth")} Manage GitHub authentication`),console.log(` ${s("magenta","login")} Authenticate with GitHub`),console.log(` ${s("magenta","logout")} Sign out from GitHub`),console.log(` ${s("magenta","status")} Show GitHub authentication status`),console.log(` ${s("magenta","token")} Print the stored GitHub OAuth token`),console.log(),console.log(` ${m("OPTIONS")}`),console.log(` ${s("cyan","-h, --help")} Show this help message`),console.log(` ${s("cyan","-v, --version")} Show version number`),console.log(),console.log(` ${m("EXAMPLES")}`),console.log(` ${l("# Interactive mode")}`),console.log(` ${s("yellow","octocode")}`),console.log(),console.log(` ${l("# Install for Cursor using npx")}`),console.log(` ${s("yellow","octocode install --ide cursor --method npx")}`),console.log(),console.log(` ${l("# Install for Claude Desktop using direct method")}`),console.log(` ${s("yellow","octocode install --ide claude --method direct")}`),console.log(),console.log(` ${l("# Check GitHub authentication")}`),console.log(` ${s("yellow","octocode auth")}`),console.log(),console.log(` ${l("# Get token from Octocode (default)")}`),console.log(` ${s("yellow","octocode token")}`),console.log(),console.log(` ${l("# Get token from gh CLI")}`),console.log(` ${s("yellow","octocode token --type=gh")}`),console.log(),console.log(` ${l("# Sync MCP configs across all IDEs")}`),console.log(` ${s("yellow","octocode sync")}`),console.log(` ${s("yellow","octocode sync --status")}`),console.log(),console.log(` ${l("# MCP marketplace via CLI")}`),console.log(` ${s("yellow","octocode mcp list --search browser")}`),console.log(` ${s("yellow","octocode mcp install --id playwright-mcp --client cursor --force")}`),console.log(` ${s("yellow","octocode mcp remove --id playwright-mcp --client cursor")}`),console.log(),console.log(` ${l("# Install Octocode skills")}`),console.log(` ${s("yellow","octocode skills install")}`),console.log(` ${s("yellow","octocode skills install --skill octocode-researcher")}`),console.log(` ${s("yellow","octocode skills install --targets claude-code,cursor,codex --mode symlink")}`),console.log(),console.log(` ${l("# Remove one installed skill")}`),console.log(` ${s("yellow","octocode skills remove --skill octocode-researcher --targets claude-code,cursor")}`),console.log(),console.log(s("magenta",` \u2500\u2500\u2500 \u{1F50D}\u{1F419} ${m("https://octocode.ai")} \u2500\u2500\u2500`)),console.log()}function sm(e){if(console.log(),console.log(` ${s("magenta",m("\u{1F50D}\u{1F419} octocode "+e.name))}`),console.log(),console.log(` ${e.description}`),console.log(),e.usage&&(console.log(` ${m("USAGE")}`),console.log(` ${e.usage}`),console.log()),e.options&&e.options.length>0){console.log(` ${m("OPTIONS")}`);for(let o of e.options){let n=o.short?`-${o.short}, `:" ",i=`--${o.name}`,t=o.hasValue?" <value>":"",r=o.default!==void 0?l(` (default: ${o.default})`):"";console.log(` ${s("cyan",n+i+t)}${r}`),console.log(` ${o.description}`)}console.log()}}function am(){console.log("octocode v1.2.9")}async function cm(e){let o=qp(e);if(Kp(o)){if(o.command){let i=Fc(o.command);if(i)return sm(i),!0}return im(),!0}if(Jp(o))return am(),!0;if(!o.command)return!1;let n=Fc(o.command);return n?(await n.handler(o),!0):(console.log(),console.log(` Unknown command: ${o.command}`),console.log(" Run 'octocode --help' to see available commands."),console.log(),process.exitCode=1,!0)}function zb(){console.log(s("blue","\u2501".repeat(66))),console.log(` \u{1F50D} ${m("Environment")}`),console.log(s("blue","\u2501".repeat(66)))}async function Nb(){let e=new N(" Starting...").start();await W(),e.clear(),Fn(),Vn(),zb();let o=await ko();if(wo(o)&&(console.log(),console.log(` ${l("\u{1F4A1}")} ${l("Run")} ${s("cyan","npx node-doctor")} ${l("for diagnostics")}`)),!o.nodeInstalled){console.log(),console.log(` ${s("red","\u2717")} ${m("Node.js is required to run octocode-mcp")}`),vc(),Gn();return}await Wp()}async function jb(){await cm()||await Nb()}function lm(){process.stdout.write("\x1B[?25h"),console.log(),console.log(l(" Goodbye! \u{1F44B}")),process.exit(0)}process.on("SIGINT",lm);process.on("SIGTERM",lm);jb().catch(e=>{e?.name==="ExitPromptError"&&(console.log(),console.log(l(" Goodbye! \u{1F44B}")),process.exit(0)),console.error("Error:",e),process.exit(1)});
70
+ ${l("}")}`),console.log(),console.log(a("blue","\u2501".repeat(66))),console.log();for(let e of Ot){let t=e.type==="boolean"?"green":e.type==="number"?"yellow":e.type==="array"?"magenta":"cyan";console.log(` ${a("cyan",e.envVar)} ${l(`(${e.type})`)}`),console.log(` ${e.description}`),console.log(` ${l("Default:")} ${DC(e)}`),console.log(` ${l("Example:")} ${a(t,bC(e))}`),console.log()}}function Pe(e,t){if(e==null)throw new Error(`Assertion failed: ${t}`);return e}var he=[{id:"playwright-mcp",name:"Playwright MCP",description:"Official Microsoft Playwright MCP server for browser automation via accessibility snapshots",category:"browser-automation",repository:"https://github.com/microsoft/playwright-mcp",website:"https://playwright.dev",installationType:"npx",npmPackage:"@playwright/mcp",official:!0,installConfig:{command:"npx",args:["-y","@playwright/mcp@latest"]},tags:["browser","automation","testing","microsoft","official"]},{id:"firecrawl-mcp-server",name:"Firecrawl MCP",description:"Powerful web scraping and search for Claude, Cursor and LLM clients",category:"browser-automation",repository:"https://github.com/firecrawl/firecrawl-mcp-server",website:"https://firecrawl.dev",installationType:"npx",npmPackage:"firecrawl-mcp",official:!0,installConfig:{command:"npx",args:["-y","firecrawl-mcp"]},requiredEnvVars:[{name:"FIRECRAWL_API_KEY",description:"Firecrawl API key",example:"fc-xxxxx"}],tags:["scraping","web","search","official"]},{id:"browserbase-mcp",name:"Browserbase MCP",description:"Cloud browser automation for web navigation, data extraction, form filling",category:"browser-automation",repository:"https://github.com/browserbase/mcp-server-browserbase",website:"https://browserbase.com",installationType:"npx",npmPackage:"@browserbasehq/mcp-server-browserbase",official:!0,installConfig:{command:"npx",args:["-y","@browserbasehq/mcp-server-browserbase"]},requiredEnvVars:[{name:"BROWSERBASE_API_KEY",description:"Browserbase API key"},{name:"BROWSERBASE_PROJECT_ID",description:"Browserbase project ID"}],tags:["browser","cloud","automation","official"]},{id:"chrome-devtools-mcp",name:"Chrome DevTools MCP",description:"Chrome DevTools for coding agents - debugging and browser control",category:"browser-automation",repository:"https://github.com/ChromeDevTools/chrome-devtools-mcp",installationType:"npx",npmPackage:"chrome-devtools-mcp",official:!0,installConfig:{command:"npx",args:["-y","chrome-devtools-mcp"]},tags:["chrome","devtools","debugging","official"]},{id:"github-mcp-server",name:"GitHub MCP",description:"GitHub's official MCP Server for repository management, PRs, issues, and more",category:"version-control",repository:"https://github.com/github/github-mcp-server",website:"https://github.com",installationType:"docker",dockerImage:"ghcr.io/github/github-mcp-server",official:!0,installConfig:{command:"docker",args:["run","-i","--rm","-e","GITHUB_PERSONAL_ACCESS_TOKEN","ghcr.io/github/github-mcp-server"]},requiredEnvVars:[{name:"GITHUB_PERSONAL_ACCESS_TOKEN",description:"GitHub Personal Access Token"}],tags:["github","git","repository","official"]},{id:"sqlite-mcp",name:"SQLite MCP",description:"Comprehensive SQLite database interaction capabilities for Cursor, Windsurf, and AI tools",category:"database",repository:"https://github.com/jparkerweb/mcp-sqlite",installationType:"npx",npmPackage:"mcp-sqlite",installConfig:{command:"npx",args:["-y","mcp-sqlite","${DATABASE_PATH}"]},requiredEnvVars:[{name:"DATABASE_PATH",description:"Path to SQLite database file",example:"/path/to/database.db"}],tags:["database","sqlite","sql","cursor","windsurf"]},{id:"mysql-mcp",name:"MySQL MCP",description:"MySQL database integration with configurable access controls and schema inspection",category:"database",repository:"https://github.com/designcomputer/mysql_mcp_server",installationType:"pip",pipPackage:"mysql-mcp-server",installConfig:{command:"uvx",args:["mysql-mcp-server"]},requiredEnvVars:[{name:"MYSQL_HOST",description:"MySQL host"},{name:"MYSQL_USER",description:"MySQL username"},{name:"MYSQL_PASSWORD",description:"MySQL password"},{name:"MYSQL_DATABASE",description:"MySQL database name"}],tags:["database","mysql","sql"]},{id:"mongodb-mcp",name:"MongoDB MCP",description:"MongoDB integration for querying and analyzing collections",category:"database",repository:"https://github.com/kiliczsh/mcp-mongo-server",installationType:"npx",npmPackage:"mcp-mongo-server",installConfig:{command:"npx",args:["-y","mcp-mongo-server"]},requiredEnvVars:[{name:"MONGODB_URI",description:"MongoDB connection URI",example:"mongodb://localhost:27017/mydb"}],tags:["database","mongodb","nosql"]},{id:"redis-mcp",name:"Redis MCP",description:"Natural language interface for managing and searching data in Redis",category:"database",repository:"https://github.com/redis/mcp-redis",website:"https://redis.io",installationType:"pip",pipPackage:"redis-mcp-server",official:!0,installConfig:{command:"uvx",args:["redis-mcp-server"]},requiredEnvVars:[{name:"REDIS_URL",description:"Redis connection URL",example:"redis://localhost:6379"}],tags:["database","redis","cache","official"]},{id:"neon-mcp",name:"Neon MCP",description:"Neon Serverless Postgres - create and manage databases with natural language",category:"database",repository:"https://github.com/neondatabase/mcp-server-neon",website:"https://neon.tech",installationType:"npx",npmPackage:"@neondatabase/mcp-server-neon",official:!0,installConfig:{command:"npx",args:["-y","@neondatabase/mcp-server-neon"]},requiredEnvVars:[{name:"NEON_API_KEY",description:"Neon API key"}],tags:["database","postgres","serverless","official"]},{id:"qdrant-mcp",name:"Qdrant MCP",description:"Vector search engine for keeping and retrieving memories",category:"database",repository:"https://github.com/qdrant/mcp-server-qdrant",website:"https://qdrant.tech",installationType:"pip",pipPackage:"mcp-server-qdrant",official:!0,installConfig:{command:"uvx",args:["mcp-server-qdrant"]},requiredEnvVars:[{name:"QDRANT_URL",description:"Qdrant server URL"},{name:"QDRANT_API_KEY",description:"Qdrant API key (optional)"}],tags:["database","vector","search","official"]},{id:"snowflake-mcp",name:"Snowflake MCP",description:"Snowflake data warehouse integration with read/write capabilities",category:"database",repository:"https://github.com/isaacwasserman/mcp-snowflake-server",website:"https://snowflake.com",installationType:"pip",pipPackage:"mcp-snowflake-server",installConfig:{command:"uvx",args:["mcp-snowflake-server"]},requiredEnvVars:[{name:"SNOWFLAKE_ACCOUNT",description:"Snowflake account identifier"},{name:"SNOWFLAKE_USER",description:"Snowflake username"},{name:"SNOWFLAKE_PASSWORD",description:"Snowflake password"}],tags:["database","snowflake","data-warehouse"]},{id:"bigquery-mcp",name:"BigQuery MCP",description:"Google BigQuery integration for schema inspection and queries",category:"database",repository:"https://github.com/LucasHild/mcp-server-bigquery",website:"https://cloud.google.com/bigquery",installationType:"pip",pipPackage:"mcp-server-bigquery",installConfig:{command:"uvx",args:["mcp-server-bigquery"]},requiredEnvVars:[{name:"GOOGLE_APPLICATION_CREDENTIALS",description:"Path to GCP service account JSON"}],tags:["database","bigquery","google","analytics"]},{id:"dbhub-mcp",name:"DBHub MCP",description:"Zero-dependency, token-efficient database MCP for Postgres, MySQL, SQL Server, MariaDB, SQLite",category:"database",repository:"https://github.com/bytebase/dbhub",installationType:"npx",npmPackage:"dbhub",installConfig:{command:"npx",args:["-y","dbhub"]},requiredEnvVars:[{name:"DATABASE_URL",description:"Database connection URL",example:"postgres://user:pass@localhost:5432/db"}],tags:["database","postgres","mysql","sqlite","mariadb","sqlserver","multi-database"]},{id:"pg-aiguide-mcp",name:"PostgreSQL AI Guide MCP",description:"PostgreSQL documentation and best practices through semantic search and curated skills",category:"database",repository:"https://github.com/timescale/pg-aiguide",website:"https://tigerdata.com",installationType:"npx",npmPackage:"@tigerdata/pg-aiguide",installConfig:{command:"npx",args:["-y","@tigerdata/pg-aiguide"]},tags:["database","postgres","postgresql","documentation","timescale"]},{id:"cloudflare-mcp",name:"Cloudflare MCP",description:"Integration with Cloudflare Workers, KV, R2, and D1",category:"cloud-platform",repository:"https://github.com/cloudflare/mcp-server-cloudflare",website:"https://cloudflare.com",installationType:"npx",npmPackage:"@cloudflare/mcp-server-cloudflare",official:!0,installConfig:{command:"npx",args:["-y","@cloudflare/mcp-server-cloudflare"]},requiredEnvVars:[{name:"CLOUDFLARE_API_TOKEN",description:"Cloudflare API Token"},{name:"CLOUDFLARE_ACCOUNT_ID",description:"Cloudflare Account ID"}],tags:["cloudflare","cloud","workers","official"]},{id:"docker-mcp",name:"Docker MCP",description:"Docker operations for container and compose stack management",category:"cloud-platform",repository:"https://github.com/sondt2709/docker-mcp",installationType:"npx",npmPackage:"docker-mcp",installConfig:{command:"npx",args:["-y","docker-mcp"]},tags:["docker","containers","devops"]},{id:"filesystem-mcp",name:"Filesystem MCP",description:"Direct local file system access with configurable permissions",category:"file-system",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/filesystem",installationType:"npx",npmPackage:"@modelcontextprotocol/server-filesystem",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-filesystem","${ALLOWED_DIRECTORIES}"]},requiredEnvVars:[{name:"ALLOWED_DIRECTORIES",description:"Comma-separated list of allowed directories",example:"/home/user/projects,/tmp"}],tags:["filesystem","files","local","official"]},{id:"git-mcp-official",name:"Git MCP",description:"Official Git integration for repository operations, commits, and history",category:"version-control",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/git",installationType:"pip",pipPackage:"mcp-server-git",official:!0,installConfig:{command:"uvx",args:["mcp-server-git"]},tags:["git","version-control","repository","official"]},{id:"memory-mcp",name:"Memory MCP",description:"Official memory/persistence server for maintaining context across sessions",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/memory",installationType:"npx",npmPackage:"@modelcontextprotocol/server-memory",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-memory"]},tags:["memory","persistence","context","official"]},{id:"fetch-mcp",name:"Fetch MCP",description:"Official HTTP fetch server for making web requests",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/fetch",installationType:"pip",pipPackage:"mcp-server-fetch",official:!0,installConfig:{command:"uvx",args:["mcp-server-fetch"]},tags:["fetch","http","web","requests","official"]},{id:"time-mcp",name:"Time MCP",description:"Official time server for date/time operations and timezones",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/time",installationType:"pip",pipPackage:"mcp-server-time",official:!0,installConfig:{command:"uvx",args:["mcp-server-time"]},tags:["time","date","timezone","official"]},{id:"sequential-thinking-mcp",name:"Sequential Thinking MCP",description:"Official server for step-by-step reasoning and problem solving",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/sequentialthinking",installationType:"npx",npmPackage:"@modelcontextprotocol/server-sequential-thinking",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-sequential-thinking"]},tags:["reasoning","thinking","problem-solving","official"]},{id:"everything-mcp",name:"Everything MCP",description:"Official demo server showcasing all MCP capabilities in one package",category:"developer-tools",repository:"https://github.com/modelcontextprotocol/servers/tree/main/src/everything",installationType:"npx",npmPackage:"@modelcontextprotocol/server-everything",official:!0,installConfig:{command:"npx",args:["-y","@modelcontextprotocol/server-everything"]},tags:["demo","all-in-one","example","official"]},{id:"exa-mcp",name:"Exa Search MCP",description:"Exa AI Search API for real-time web information retrieval",category:"search-web",repository:"https://github.com/exa-labs/exa-mcp-server",website:"https://exa.ai",installationType:"npx",npmPackage:"exa-mcp-server",official:!0,installConfig:{command:"npx",args:["-y","exa-mcp-server"]},requiredEnvVars:[{name:"EXA_API_KEY",description:"Exa API key"}],tags:["search","exa","ai","official"]},{id:"perplexity-mcp",name:"Perplexity MCP",description:"Official Perplexity AI search and research integration",category:"search-web",repository:"https://github.com/perplexityai/modelcontextprotocol",website:"https://perplexity.ai",installationType:"npx",npmPackage:"@perplexity-ai/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@perplexity-ai/mcp-server"]},requiredEnvVars:[{name:"PERPLEXITY_API_KEY",description:"Perplexity API key"}],tags:["search","perplexity","ai","research","official"]},{id:"kagi-mcp",name:"Kagi MCP",description:"Official Kagi search and tools integration",category:"search-web",repository:"https://github.com/kagisearch/kagi-mcp",website:"https://kagi.com",installationType:"pip",pipPackage:"kagimcp",official:!0,installConfig:{command:"uvx",args:["kagimcp"]},requiredEnvVars:[{name:"KAGI_API_KEY",description:"Kagi API key"}],tags:["search","kagi","official"]},{id:"tavily-mcp",name:"Tavily MCP",description:"Tavily AI search API for intelligent web search",category:"search-web",repository:"https://github.com/tavily-ai/tavily-mcp",website:"https://tavily.com",installationType:"npx",npmPackage:"tavily-mcp",official:!0,installConfig:{command:"npx",args:["-y","tavily-mcp"]},requiredEnvVars:[{name:"TAVILY_API_KEY",description:"Tavily API key"}],tags:["search","tavily","ai","official"]},{id:"slack-mcp",name:"Slack MCP",description:"Most powerful MCP server for Slack with Stdio and SSE transports",category:"communication",repository:"https://github.com/korotovsky/slack-mcp-server",website:"https://slack.com",installationType:"npx",npmPackage:"slack-mcp-server",installConfig:{command:"npx",args:["-y","slack-mcp-server"]},requiredEnvVars:[{name:"SLACK_BOT_TOKEN",description:"Slack Bot OAuth Token"}],tags:["slack","chat","team"]},{id:"discord-mcp",name:"Discord MCP",description:"Discord API integration via JDA for seamless bot interaction with MCP clients",category:"communication",repository:"https://github.com/SaseQ/discord-mcp",website:"https://discord.com",installationType:"docker",dockerImage:"saseq/discord-mcp:latest",installConfig:{command:"docker",args:["run","--rm","-i","-e","DISCORD_TOKEN","-e","DISCORD_GUILD_ID","saseq/discord-mcp:latest"]},requiredEnvVars:[{name:"DISCORD_TOKEN",description:"Discord Bot Token"},{name:"DISCORD_GUILD_ID",description:"Default Discord Server ID (optional)"}],tags:["discord","chat","community","bot"]},{id:"linear-mcp",name:"Linear MCP",description:"Linear project management integration for issues, projects, and teams",category:"communication",repository:"https://github.com/tacticlaunch/mcp-linear",website:"https://linear.app",installationType:"npx",npmPackage:"@tacticlaunch/mcp-linear",installConfig:{command:"npx",args:["-y","@tacticlaunch/mcp-linear"]},requiredEnvVars:[{name:"LINEAR_API_KEY",description:"Linear API key"}],tags:["linear","issues","project-management"]},{id:"atlassian-mcp",name:"Atlassian MCP",description:"Confluence and Jira integration for documentation and issue tracking",category:"communication",repository:"https://github.com/sooperset/mcp-atlassian",website:"https://atlassian.com",installationType:"pip",pipPackage:"mcp-atlassian",installConfig:{command:"uvx",args:["mcp-atlassian"]},requiredEnvVars:[{name:"ATLASSIAN_URL",description:"Atlassian instance URL"},{name:"ATLASSIAN_EMAIL",description:"Atlassian email"},{name:"ATLASSIAN_API_TOKEN",description:"Atlassian API token"}],tags:["atlassian","jira","confluence"]},{id:"notion-mcp",name:"Notion MCP",description:"Official Notion integration for pages, databases, and blocks",category:"productivity",repository:"https://github.com/makenotion/notion-mcp-server",website:"https://notion.so",installationType:"npx",npmPackage:"@notionhq/notion-mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@notionhq/notion-mcp-server"]},requiredEnvVars:[{name:"NOTION_API_KEY",description:"Notion API integration token"}],tags:["notion","productivity","notes","database","official"]},{id:"obsidian-mcp",name:"Obsidian MCP",description:"Obsidian vault integration for file management, search, and manipulation",category:"productivity",repository:"https://github.com/MarkusPfundstein/mcp-obsidian",website:"https://obsidian.md",installationType:"npx",npmPackage:"mcp-obsidian",installConfig:{command:"npx",args:["-y","mcp-obsidian"]},requiredEnvVars:[{name:"OBSIDIAN_VAULT_PATH",description:"Path to Obsidian vault"}],tags:["obsidian","notes","markdown"]},{id:"todoist-mcp",name:"Todoist MCP",description:"Natural language task management with Todoist",category:"productivity",repository:"https://github.com/stevengonsalvez/todoist-mcp",website:"https://todoist.com",installationType:"npx",npmPackage:"todoist-mcp-server",installConfig:{command:"npx",args:["-y","todoist-mcp-server"]},requiredEnvVars:[{name:"TODOIST_API_TOKEN",description:"Todoist API token"}],tags:["todoist","tasks","productivity"]},{id:"google-workspace-mcp",name:"Google Workspace MCP",description:"Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Drive and more",category:"productivity",repository:"https://github.com/taylorwilsdon/google_workspace_mcp",website:"https://workspace.google.com",installationType:"pip",pipPackage:"google-workspace-mcp",installConfig:{command:"uvx",args:["google-workspace-mcp"]},requiredEnvVars:[{name:"GOOGLE_APPLICATION_CREDENTIALS",description:"Path to Google credentials"}],tags:["google","workspace","gmail","docs"]},{id:"context7-mcp",name:"Context7 MCP",description:"Up-to-date code documentation for LLMs and AI code editors",category:"developer-tools",repository:"https://github.com/upstash/context7",website:"https://context7.com",installationType:"npx",npmPackage:"@upstash/context7-mcp",official:!0,installConfig:{command:"npx",args:["-y","@upstash/context7-mcp"]},tags:["documentation","context","code","official"]},{id:"desktop-commander-mcp",name:"Desktop Commander MCP",description:"Terminal control, file system search, and diff file editing capabilities",category:"developer-tools",repository:"https://github.com/wonderwhy-er/DesktopCommanderMCP",installationType:"npx",npmPackage:"@wonderwhy-er/desktop-commander",installConfig:{command:"npx",args:["-y","@wonderwhy-er/desktop-commander"]},tags:["terminal","file-editing","diff","command-line","process"]},{id:"gemini-mcp-tool",name:"Gemini MCP Tool",description:"Interact with Google Gemini CLI for large file analysis and codebase exploration",category:"ai-services",repository:"https://github.com/jamubc/gemini-mcp-tool",installationType:"npx",npmPackage:"gemini-mcp-tool",installConfig:{command:"npx",args:["-y","gemini-mcp-tool"]},tags:["gemini","google","ai","file-analysis","codebase"]},{id:"sentry-mcp",name:"Sentry MCP",description:"Sentry.io integration for error tracking and performance monitoring",category:"developer-tools",repository:"https://github.com/getsentry/sentry-mcp",website:"https://sentry.io",installationType:"npx",npmPackage:"@sentry/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@sentry/mcp-server"]},requiredEnvVars:[{name:"SENTRY_AUTH_TOKEN",description:"Sentry Auth Token"},{name:"SENTRY_ORG",description:"Sentry Organization Slug"}],tags:["sentry","errors","monitoring","official"]},{id:"mcp-memory-service",name:"Memory Service MCP",description:"Automatic context memory for Claude, VS Code, Cursor - stop re-explaining",category:"developer-tools",repository:"https://github.com/doobidoo/mcp-memory-service",installationType:"pip",pipPackage:"mcp-memory-service",installConfig:{command:"uvx",args:["mcp-memory-service"]},tags:["memory","context","persistence"]},{id:"serena-mcp",name:"Serena MCP",description:"Powerful coding agent with semantic retrieval and editing via language servers",category:"coding-agents",repository:"https://github.com/oraios/serena",installationType:"pip",installConfig:{command:"uvx",args:["--from","git+https://github.com/oraios/serena","serena","start-mcp-server"]},tags:["coding","agent","language-server"]},{id:"figma-mcp",name:"Figma Context MCP",description:"Get Figma design data in ready-to-implement format",category:"developer-tools",repository:"https://github.com/GLips/Figma-Context-MCP",website:"https://figma.com",installationType:"npx",npmPackage:"figma-context-mcp",installConfig:{command:"npx",args:["-y","figma-context-mcp"]},requiredEnvVars:[{name:"FIGMA_ACCESS_TOKEN",description:"Figma Personal Access Token"}],tags:["figma","design","ui"]},{id:"talk-to-figma-mcp",name:"Talk to Figma MCP",description:"Cursor + Figma integration for reading and modifying designs",category:"developer-tools",repository:"https://github.com/grab/cursor-talk-to-figma-mcp",website:"https://figma.com",installationType:"npx",npmPackage:"cursor-talk-to-figma-mcp",installConfig:{command:"npx",args:["-y","cursor-talk-to-figma-mcp"]},requiredEnvVars:[{name:"FIGMA_ACCESS_TOKEN",description:"Figma Personal Access Token"}],tags:["figma","cursor","design"]},{id:"xcodebuild-mcp",name:"XcodeBuild MCP",description:"Xcode-related tools for building, testing, and managing iOS/macOS projects",category:"developer-tools",repository:"https://github.com/cameroncooke/XcodeBuildMCP",website:"https://developer.apple.com/xcode",installationType:"npx",npmPackage:"xcodebuildmcp",installConfig:{command:"npx",args:["-y","xcodebuildmcp"]},tags:["xcode","ios","macos","apple","swift"]},{id:"markdownify-mcp",name:"Markdownify MCP",description:"Convert almost anything to Markdown - PDFs, URLs, images, and more",category:"developer-tools",repository:"https://github.com/zcaceres/markdownify-mcp",installationType:"npx",npmPackage:"mcp-markdownify-server",installConfig:{command:"npx",args:["-y","mcp-markdownify-server"]},tags:["markdown","converter","pdf","ocr"]},{id:"elevenlabs-mcp",name:"ElevenLabs MCP",description:"Official ElevenLabs text-to-speech, voice cloning, and audio generation",category:"ai-services",repository:"https://github.com/elevenlabs/elevenlabs-mcp",website:"https://elevenlabs.io",installationType:"pip",pipPackage:"elevenlabs-mcp",official:!0,installConfig:{command:"uvx",args:["elevenlabs-mcp"]},requiredEnvVars:[{name:"ELEVENLABS_API_KEY",description:"ElevenLabs API key"}],tags:["elevenlabs","tts","voice","audio","official"]},{id:"llamacloud-mcp",name:"LlamaCloud MCP",description:"Connect to managed indices on LlamaCloud",category:"ai-services",repository:"https://github.com/run-llama/mcp-server-llamacloud",website:"https://cloud.llamaindex.ai",installationType:"npx",npmPackage:"@llamaindex/mcp-server-llamacloud",official:!0,installConfig:{command:"npx",args:["-y","@llamaindex/mcp-server-llamacloud"]},requiredEnvVars:[{name:"LLAMA_CLOUD_API_KEY",description:"LlamaCloud API key"}],tags:["llamaindex","rag","index","official"]},{id:"huggingface-spaces-mcp",name:"HuggingFace Spaces MCP",description:"Use HuggingFace Spaces from your MCP Client - images, audio, text",category:"ai-services",repository:"https://github.com/evalstate/mcp-hfspace",website:"https://huggingface.co/spaces",installationType:"npx",npmPackage:"@llmindset/mcp-hfspace",installConfig:{command:"npx",args:["-y","@llmindset/mcp-hfspace"]},requiredEnvVars:[{name:"HF_TOKEN",description:"HuggingFace API token"}],tags:["huggingface","spaces","models"]},{id:"n8n-mcp",name:"n8n MCP",description:"Build n8n workflows using Claude Desktop, Cursor, or Windsurf",category:"workflow-automation",repository:"https://github.com/czlonkowski/n8n-mcp",website:"https://n8n.io",installationType:"npx",npmPackage:"n8n-mcp",installConfig:{command:"npx",args:["-y","n8n-mcp"]},requiredEnvVars:[{name:"N8N_API_URL",description:"n8n instance URL"},{name:"N8N_API_KEY",description:"n8n API key"}],tags:["n8n","automation","workflows"]},{id:"echarts-mcp",name:"ECharts MCP",description:"Generate visual charts using Apache ECharts dynamically",category:"data-visualization",repository:"https://github.com/hustcc/mcp-echarts",website:"https://echarts.apache.org",installationType:"npx",npmPackage:"mcp-echarts",installConfig:{command:"npx",args:["-y","mcp-echarts"]},tags:["visualization","charts","echarts"]},{id:"mermaid-mcp",name:"Mermaid MCP",description:"Generate Mermaid diagrams and charts dynamically",category:"data-visualization",repository:"https://github.com/hustcc/mcp-mermaid",website:"https://mermaid.js.org",installationType:"npx",npmPackage:"mcp-mermaid",installConfig:{command:"npx",args:["-y","mcp-mermaid"]},tags:["diagrams","mermaid","flowcharts"]},{id:"datadog-mcp",name:"Datadog MCP",description:"Datadog monitoring and observability integration",category:"monitoring",repository:"https://github.com/winor30/mcp-server-datadog",website:"https://datadoghq.com",installationType:"npx",npmPackage:"@winor30/mcp-server-datadog",installConfig:{command:"npx",args:["-y","@winor30/mcp-server-datadog"]},requiredEnvVars:[{name:"DD_API_KEY",description:"Datadog API key"},{name:"DD_APP_KEY",description:"Datadog Application key"}],tags:["datadog","monitoring","observability"]},{id:"browserstack-mcp",name:"BrowserStack MCP",description:"Official BrowserStack testing and automation integration",category:"developer-tools",repository:"https://github.com/browserstack/mcp-server",website:"https://browserstack.com",installationType:"npx",npmPackage:"@browserstack/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@browserstack/mcp-server"]},requiredEnvVars:[{name:"BROWSERSTACK_USERNAME",description:"BrowserStack username"},{name:"BROWSERSTACK_ACCESS_KEY",description:"BrowserStack access key"}],tags:["browserstack","testing","automation","official"]},{id:"tableau-mcp",name:"Tableau MCP",description:"Official Tableau data visualization and analytics integration",category:"data-visualization",repository:"https://github.com/tableau/tableau-mcp",website:"https://tableau.com",installationType:"npx",npmPackage:"@tableau/mcp-server",official:!0,installConfig:{command:"npx",args:["-y","@tableau/mcp-server"]},requiredEnvVars:[{name:"TABLEAU_TOKEN",description:"Tableau API token"},{name:"TABLEAU_SITE",description:"Tableau site name"}],tags:["tableau","visualization","analytics","official"]},{id:"stripe-mcp",name:"Stripe MCP",description:"Official Stripe Agent Toolkit for payment integration",category:"finance",repository:"https://github.com/stripe/agent-toolkit",website:"https://stripe.com",installationType:"npx",npmPackage:"@stripe/agent-toolkit",official:!0,installConfig:{command:"npx",args:["-y","@stripe/agent-toolkit","mcp"]},requiredEnvVars:[{name:"STRIPE_SECRET_KEY",description:"Stripe Secret Key"}],tags:["stripe","payments","finance","official"]},{id:"alpaca-mcp",name:"Alpaca MCP",description:"Official Alpaca trading - stocks, ETFs, crypto, and options in plain English",category:"finance",repository:"https://github.com/alpacahq/alpaca-mcp-server",website:"https://alpaca.markets",installationType:"pip",pipPackage:"alpaca-mcp-server",official:!0,installConfig:{command:"uvx",args:["alpaca-mcp-server"]},requiredEnvVars:[{name:"ALPACA_API_KEY",description:"Alpaca API key"},{name:"ALPACA_SECRET_KEY",description:"Alpaca secret key"}],tags:["alpaca","trading","stocks","crypto","finance","official"]},{id:"paypal-mcp",name:"PayPal MCP",description:"PayPal Agent Toolkit for payment integration",category:"finance",repository:"https://github.com/paypal/agent-toolkit",website:"https://paypal.com",installationType:"npx",npmPackage:"@paypal/agent-toolkit",official:!0,installConfig:{command:"npx",args:["-y","@paypal/agent-toolkit"]},requiredEnvVars:[{name:"PAYPAL_CLIENT_ID",description:"PayPal Client ID"},{name:"PAYPAL_CLIENT_SECRET",description:"PayPal Client Secret"}],tags:["paypal","payments","finance","official"]},{id:"semgrep-mcp",name:"Semgrep MCP",description:"Static code analysis and security scanning with Semgrep integration",category:"security",repository:"https://github.com/Szowesgad/mcp-server-semgrep",website:"https://semgrep.dev",installationType:"npx",npmPackage:"mcp-server-semgrep",installConfig:{command:"npx",args:["-y","mcp-server-semgrep"]},tags:["semgrep","security","sast","static-analysis"]},{id:"pipedream-mcp",name:"Pipedream MCP",description:"Connect with 2,500+ APIs with 8,000+ prebuilt tools",category:"aggregator",repository:"https://github.com/PipedreamHQ/pipedream/tree/master/modelcontextprotocol",website:"https://pipedream.com",installationType:"npx",npmPackage:"@pipedream/mcp",official:!0,installConfig:{command:"npx",args:["-y","@pipedream/mcp"]},requiredEnvVars:[{name:"PIPEDREAM_API_KEY",description:"Pipedream API key"}],tags:["pipedream","integrations","apis","official"]},{id:"fastmcp",name:"FastMCP",description:"The fast, Pythonic way to build MCP servers and clients",category:"developer-tools",repository:"https://github.com/jlowin/fastmcp",installationType:"pip",pipPackage:"fastmcp",installConfig:{command:"pip",args:["install","fastmcp"]},tags:["framework","python","sdk"]},{id:"mcp-use",name:"MCP Use",description:"Easiest way to interact with MCP servers with custom agents",category:"developer-tools",repository:"https://github.com/mcp-use/mcp-use",installationType:"pip",pipPackage:"mcp-use",installConfig:{command:"pip",args:["install","mcp-use"]},tags:["framework","agents","python"]},{id:"unity-mcp",name:"Unity MCP",description:"MCP server for Unity Editor - designed for Claude, Cursor, Gemini and more",category:"developer-tools",repository:"https://github.com/CoplayDev/unity-mcp",website:"https://unity.com",installationType:"pip",installConfig:{command:"uvx",args:["--from","git+https://github.com/CoplayDev/unity-mcp","unity-mcp"]},tags:["unity","game-dev","editor","gamedev"]},{id:"arxiv-mcp",name:"ArXiv MCP",description:"Search ArXiv research papers",category:"other",repository:"https://github.com/blazickjp/arxiv-mcp-server",website:"https://arxiv.org",installationType:"pip",pipPackage:"arxiv-mcp-server",installConfig:{command:"uvx",args:["arxiv-mcp-server"]},tags:["arxiv","research","papers"]},{id:"octocode-mcp",name:"Octocode MCP",description:"AI-powered developer assistant for GitHub and NPM research",category:"developer-tools",repository:"https://github.com/bgauryy/octocode-mcp",installationType:"npx",npmPackage:"octocode-mcp",installConfig:{command:"npx",args:["-y","octocode-mcp"]},requiredEnvVars:[{name:"GITHUB_PERSONAL_ACCESS_TOKEN",description:"GitHub Personal Access Token"}],tags:["github","npm","research","code"]},{id:"gpt-researcher-mcp",name:"GPT Researcher MCP",description:"Deep research agent with MCP support for comprehensive web research and report generation",category:"search-web",repository:"https://github.com/assafelovic/gptr-mcp",website:"https://gptr.dev",stars:24750,installationType:"source",installConfig:{command:"python",args:["server.py"]},requiredEnvVars:[{name:"OPENAI_API_KEY",description:"OpenAI API key for LLM capabilities",example:"sk-xxxxx"},{name:"TAVILY_API_KEY",description:"Tavily API key for web search",example:"tvly-xxxxx"}],tags:["research","web-search","deep-research","ai","tavily"]},{id:"mcp-chrome",name:"Chrome MCP",description:"Chrome extension-based MCP server for browser automation, screenshots, and content analysis",category:"browser-automation",repository:"https://github.com/hangwin/mcp-chrome",stars:9803,installationType:"npx",npmPackage:"mcp-chrome-bridge",installConfig:{command:"npx",args:["-y","mcp-chrome-bridge"]},tags:["chrome","browser","automation","extension","screenshot"]},{id:"aws-mcp",name:"AWS Core MCP",description:"AWS MCP Servers - dynamic orchestrator for specialized AWS services including Bedrock, Lambda, S3, and CloudWatch",category:"cloud-platform",repository:"https://github.com/awslabs/mcp",website:"https://awslabs.github.io/mcp/",stars:7801,installationType:"pip",pipPackage:"awslabs.core-mcp-server",official:!0,installConfig:{command:"uvx",args:["awslabs.core-mcp-server@latest"]},requiredEnvVars:[{name:"AWS_PROFILE",description:"AWS profile name for credentials",example:"default"},{name:"AWS_REGION",description:"AWS region",example:"us-east-1"}],tags:["aws","cloud","bedrock","lambda","s3","cloudwatch","official"]},{id:"git-mcp",name:"GitMCP",description:"Remote MCP server that transforms GitHub projects into documentation hubs for AI tools",category:"version-control",repository:"https://github.com/idosal/git-mcp",website:"https://gitmcp.io",stars:7328,installationType:"npx",npmPackage:"mcp-remote",installConfig:{command:"npx",args:["-y","mcp-remote","https://gitmcp.io/docs"]},tags:["git","github","documentation","remote","version-control"]},{id:"browser-tools-mcp",name:"BrowserTools MCP",description:"Monitor browser logs and capture browser data from Cursor and MCP-compatible IDEs via Chrome extension",category:"browser-automation",repository:"https://github.com/AgentDeskAI/browser-tools-mcp",website:"https://browsertools.agentdesk.ai",stars:6961,installationType:"npx",npmPackage:"@agentdeskai/browser-tools-mcp",installConfig:{command:"npx",args:["-y","@agentdeskai/browser-tools-mcp@latest"]},tags:["browser","devtools","chrome","logs","debugging"]},{id:"hexstrike-ai",name:"HexStrike AI",description:"Advanced MCP server for AI agents to run 150+ cybersecurity tools for pentesting and vulnerability discovery",category:"security",repository:"https://github.com/0x4m4/hexstrike-ai",stars:5690,installationType:"source",installConfig:{command:"python3",args:["hexstrike_mcp.py","--server","http://localhost:8888"]},requiredEnvVars:[{name:"HEXSTRIKE_PATH",description:"Path to cloned hexstrike-ai repository",example:"/path/to/hexstrike-ai"}],tags:["security","pentesting","cybersecurity","vulnerability"]},{id:"spec-workflow-mcp",name:"Spec Workflow MCP",description:"Structured spec-driven development workflow tools for AI-assisted software development with real-time web dashboard",category:"developer-tools",repository:"https://github.com/Pimzino/spec-workflow-mcp",stars:3569,installationType:"npx",npmPackage:"@pimzino/spec-workflow-mcp",installConfig:{command:"npx",args:["-y","@pimzino/spec-workflow-mcp@latest","${PROJECT_PATH}"]},requiredEnvVars:[{name:"PROJECT_PATH",description:"Path to your project directory",example:"/path/to/your/project"}],tags:["workflow","spec-driven","dashboard","vscode","development"]},{id:"excel-mcp-server",name:"Excel MCP",description:"Manipulate Excel files without Microsoft Excel - create, read, modify workbooks with formulas, formatting, and charts",category:"productivity",repository:"https://github.com/haris-musa/excel-mcp-server",stars:3079,installationType:"pip",pipPackage:"excel-mcp-server",installConfig:{command:"uvx",args:["excel-mcp-server","stdio"]},tags:["excel","spreadsheet","office","xlsx","formulas","charts"]},{id:"mcp-context-forge",name:"MCP Context Forge",description:"IBM MCP Gateway & Registry - federates MCP and REST services with discovery, auth, rate-limiting, and observability",category:"aggregator",repository:"https://github.com/IBM/mcp-context-forge",website:"https://ibm.github.io/mcp-context-forge/",stars:3056,installationType:"pip",pipPackage:"mcp-contextforge-gateway",official:!0,installConfig:{command:"uvx",args:["--from","mcp-contextforge-gateway","mcpgateway","--host","0.0.0.0","--port","4444"]},requiredEnvVars:[{name:"JWT_SECRET_KEY",description:"JWT secret key for authentication",example:"my-secret-key"}],tags:["ibm","gateway","registry","federation","proxy","official","enterprise"]},{id:"mobile-mcp",name:"Mobile MCP",description:"Scalable mobile automation and development through a platform-agnostic interface for iOS and Android devices",category:"developer-tools",repository:"https://github.com/mobile-next/mobile-mcp",stars:2969,installationType:"npx",npmPackage:"@mobilenext/mobile-mcp",installConfig:{command:"npx",args:["-y","@mobilenext/mobile-mcp@latest"]},tags:["mobile","ios","android","automation","simulator","emulator","testing"]},{id:"claude-code-mcp",name:"Claude Code MCP",description:"Run Claude Code in one-shot mode with permissions bypassed for direct agent access to file editing and terminal",category:"coding-agents",repository:"https://github.com/steipete/claude-code-mcp",stars:989,installationType:"npx",npmPackage:"@steipete/claude-code-mcp",installConfig:{command:"npx",args:["-y","@steipete/claude-code-mcp@latest"]},tags:["claude","coding","agent","cursor","windsurf"]},{id:"ros-mcp-server",name:"ROS MCP Server",description:"Connect LLMs with ROS/ROS2 robots for natural language robot commanding and real-time sensor visibility",category:"other",repository:"https://github.com/robotmcp/ros-mcp-server",stars:913,installationType:"pip",pipPackage:"ros-mcp-server",official:!0,installConfig:{command:"python",args:["-m","ros_mcp_server.server"]},tags:["ros","ros2","robotics","robots","sensors"]},{id:"gmail-mcp",name:"Gmail MCP",description:"Gmail integration with auto authentication for AI assistants to manage email through natural language",category:"communication",repository:"https://github.com/GongRzhe/Gmail-MCP-Server",website:"https://gmail.google.com",stars:895,installationType:"npx",npmPackage:"@gongrzhe/server-gmail-autoauth-mcp",installConfig:{command:"npx",args:["-y","@gongrzhe/server-gmail-autoauth-mcp"]},requiredEnvVars:[{name:"GMAIL_OAUTH_PATH",description:"Path to GCP OAuth credentials JSON file",example:"/path/to/gcp-oauth.keys.json"},{name:"GMAIL_CREDENTIALS_PATH",description:"Path where authenticated tokens are stored",example:"/path/to/credentials.json"}],tags:["gmail","email","google","communication","oauth"]},{id:"mcp-knowledge-graph",name:"MCP Knowledge Graph",description:"Persistent memory for AI models through a local knowledge graph with entities, relations, and observations",category:"developer-tools",repository:"https://github.com/shaneholloman/mcp-knowledge-graph",stars:764,installationType:"npx",npmPackage:"mcp-knowledge-graph",installConfig:{command:"npx",args:["-y","mcp-knowledge-graph","--memory-path","${MEMORY_PATH}"]},requiredEnvVars:[{name:"MEMORY_PATH",description:"Directory path where memory files are stored",example:"/Users/username/.aim"}],tags:["memory","knowledge-graph","persistence","context","entities"]},{id:"kubectl-mcp",name:"kubectl MCP",description:"Kubernetes cluster management for AI assistants with pod, service, Helm, and monitoring capabilities",category:"cloud-platform",repository:"https://github.com/rohitg00/kubectl-mcp-server",stars:750,installationType:"pip",pipPackage:"kubectl-mcp-tool",installConfig:{command:"python",args:["-m","kubectl_mcp_tool.mcp_server"]},requiredEnvVars:[{name:"KUBECONFIG",description:"Path to Kubernetes config file",example:"~/.kube/config"}],tags:["kubernetes","k8s","kubectl","helm","cloud","devops"]},{id:"apple-docs-mcp",name:"Apple Docs MCP",description:"Access Apple developer documentation, frameworks, APIs, SwiftUI, UIKit, and WWDC videos through MCP",category:"developer-tools",repository:"https://github.com/kimsungwhee/apple-docs-mcp",website:"https://developer.apple.com",stars:697,installationType:"npx",npmPackage:"@kimsungwhee/apple-docs-mcp",installConfig:{command:"npx",args:["-y","@kimsungwhee/apple-docs-mcp"]},tags:["apple","documentation","swiftui","uikit","wwdc","ios","macos"]},{id:"linkedin-mcp",name:"LinkedIn MCP",description:"LinkedIn integration for AI assistants to scrape profiles, companies, and search jobs",category:"social-media",repository:"https://github.com/stickerdaniel/linkedin-mcp-server",website:"https://linkedin.com",stars:685,installationType:"docker",dockerImage:"stickerdaniel/linkedin-mcp-server:latest",installConfig:{command:"docker",args:["run","--rm","-i","-e","LINKEDIN_COOKIE","stickerdaniel/linkedin-mcp-server:latest"]},requiredEnvVars:[{name:"LINKEDIN_COOKIE",description:"LinkedIn session cookie for authentication",example:"li_at=YOUR_COOKIE_VALUE"}],tags:["linkedin","social","jobs","profiles","scraping"]},{id:"mcp-proxy",name:"MCP Proxy",description:"Aggregates multiple MCP servers behind a single HTTP entrypoint with SSE and streamable HTTP support",category:"aggregator",repository:"https://github.com/TBXark/mcp-proxy",stars:612,installationType:"docker",dockerImage:"ghcr.io/tbxark/mcp-proxy:latest",installConfig:{command:"docker",args:["run","-i","--rm","-p","9090:9090","-v","${MCP_PROXY_CONFIG}:/config/config.json","ghcr.io/tbxark/mcp-proxy:latest"]},requiredEnvVars:[{name:"MCP_PROXY_CONFIG",description:"Path to MCP proxy configuration JSON file",example:"/path/to/config.json"}],tags:["proxy","aggregator","sse","http","multi-server"]},{id:"iterm-mcp",name:"iTerm MCP",description:"Execute commands in active iTerm sessions with REPL interactions and CLI assistance",category:"developer-tools",repository:"https://github.com/ferrislucas/iterm-mcp",stars:505,installationType:"npx",npmPackage:"iterm-mcp",installConfig:{command:"npx",args:["-y","iterm-mcp"]},tags:["iterm","terminal","macos","repl","cli"]},{id:"genai-toolbox-mcp",name:"GenAI Toolbox MCP",description:"Google's official MCP Toolbox for Databases - Postgres, MySQL, MongoDB, Redis, BigQuery, Spanner, and more",category:"database",repository:"https://github.com/googleapis/genai-toolbox",website:"https://googleapis.github.io/genai-toolbox/",stars:12234,installationType:"pip",pipPackage:"toolbox-core",official:!0,installConfig:{command:"uvx",args:["toolbox-langchain"]},tags:["google","database","postgres","mysql","mongodb","redis","bigquery","spanner","official"]},{id:"fastapi-mcp",name:"FastAPI MCP",description:"Expose FastAPI endpoints as MCP tools with authentication and authorization support",category:"developer-tools",repository:"https://github.com/tadata-org/fastapi_mcp",stars:11346,installationType:"pip",pipPackage:"fastapi-mcp",installConfig:{command:"pip",args:["install","fastapi-mcp"]},tags:["fastapi","api","rest","python","authentication","framework"]},{id:"claude-flow-mcp",name:"Claude Flow MCP",description:"Agent orchestration platform for Claude - deploy multi-agent swarms and coordinate autonomous workflows",category:"coding-agents",repository:"https://github.com/ruvnet/claude-flow",stars:11184,installationType:"npx",npmPackage:"claude-flow",installConfig:{command:"npx",args:["-y","claude-flow@alpha","init"]},tags:["claude","multi-agent","swarm","orchestration","workflow","autonomous"]},{id:"pal-mcp-server",name:"PAL MCP Server",description:"Multi-model support for Claude Code - use Gemini, OpenAI, OpenRouter, Azure, Grok, Ollama together",category:"ai-services",repository:"https://github.com/BeehiveInnovations/pal-mcp-server",stars:10758,installationType:"source",installConfig:{command:"python",args:["-m","pal_mcp_server"]},requiredEnvVars:[{name:"OPENROUTER_API_KEY",description:"OpenRouter API key (optional)",example:"sk-or-xxxxx"}],tags:["multi-model","gemini","openai","ollama","azure","grok","openrouter"]},{id:"browser-mcp",name:"Browser MCP",description:"Browser control MCP server via Chrome extension - navigate, click, type, and extract data",category:"browser-automation",repository:"https://github.com/BrowserMCP/mcp",stars:5362,installationType:"npx",npmPackage:"@anthropic/browser-mcp",installConfig:{command:"npx",args:["-y","@anthropic/browser-mcp"]},tags:["browser","chrome","extension","automation","web"]},{id:"mcp-playwright-ea",name:"Playwright MCP (ExecuteAutomation)",description:"Alternative Playwright MCP server for browser and API automation in Claude, Cursor, and more",category:"browser-automation",repository:"https://github.com/executeautomation/mcp-playwright",stars:5116,installationType:"npx",npmPackage:"@executeautomation/playwright-mcp-server",installConfig:{command:"npx",args:["-y","@executeautomation/playwright-mcp-server"]},tags:["playwright","browser","automation","testing","api"]},{id:"claude-context-mcp",name:"Claude Context MCP",description:"Code search MCP for Claude Code using vector database - make entire codebase the context",category:"developer-tools",repository:"https://github.com/zilliztech/claude-context",stars:4955,installationType:"npx",npmPackage:"@anthropic/claude-context",installConfig:{command:"npx",args:["-y","@anthropic/claude-context"]},tags:["code-search","vector-db","context","semantic-search","zilliz","milvus"]},{id:"ida-pro-mcp",name:"IDA Pro MCP",description:"AI-powered reverse engineering assistant bridging IDA Pro with language models",category:"security",repository:"https://github.com/mrexodia/ida-pro-mcp",stars:4906,installationType:"pip",pipPackage:"ida-pro-mcp",installConfig:{command:"pip",args:["install","ida-pro-mcp"]},tags:["ida-pro","reverse-engineering","binary-analysis","security","malware"]},{id:"deep-research-mcp",name:"Deep Research MCP",description:"Use any LLM for deep research with SSE API and MCP server support",category:"search-web",repository:"https://github.com/u14app/deep-research",stars:4302,installationType:"pip",pipPackage:"deep-research",installConfig:{command:"uvx",args:["deep-research"]},requiredEnvVars:[{name:"OPENAI_API_KEY",description:"OpenAI API key for LLM"}],tags:["research","deep-research","llm","sse","web-search"]},{id:"cipher-mcp",name:"Cipher MCP",description:"Memory layer for coding agents - persistent context for Cursor, Claude Code, Windsurf, and Cline",category:"developer-tools",repository:"https://github.com/campfirein/cipher",stars:3399,installationType:"npx",npmPackage:"@byterover/cipher-mcp",installConfig:{command:"npx",args:["-y","@byterover/cipher-mcp"]},tags:["memory","context","persistence","coding-agents","byterover"]},{id:"metorial-mcp",name:"Metorial MCP",description:"Connect any AI model to 600+ integrations powered by MCP with containerized security",category:"aggregator",repository:"https://github.com/metorial/metorial",stars:3201,installationType:"docker",dockerImage:"metorial/metorial:latest",installConfig:{command:"docker",args:["run","-i","--rm","metorial/metorial:latest"]},tags:["integrations","aggregator","docker","multi-tool","security"]},{id:"osaurus-mcp",name:"Osaurus MCP",description:"macOS LLM server - run local or cloud models with OpenAI/Anthropic compatible APIs",category:"ai-services",repository:"https://github.com/dinoki-ai/osaurus",stars:2962,installationType:"source",installConfig:{command:"osaurus",args:["serve"]},tags:["macos","local-llm","mlx","apple-silicon","openai-compatible","swift"]},{id:"shadcn-ui-mcp",name:"shadcn/ui MCP",description:"Context about shadcn/ui components for LLMs - React, Vue, Svelte, and React Native support",category:"developer-tools",repository:"https://github.com/Jpisnice/shadcn-ui-mcp-server",stars:2582,installationType:"npx",npmPackage:"shadcn-ui-mcp",installConfig:{command:"npx",args:["-y","shadcn-ui-mcp"]},tags:["shadcn","ui","react","vue","svelte","react-native","tailwind"]},{id:"shippie-mcp",name:"Shippie MCP",description:"Extendable code review and QA agent for CI/CD pipelines and GitHub",category:"developer-tools",repository:"https://github.com/mattzcarey/shippie",stars:2317,installationType:"npx",npmPackage:"shippie",installConfig:{command:"npx",args:["-y","shippie"]},tags:["code-review","qa","ci-cd","github","agent"]},{id:"devdocs-mcp",name:"DevDocs MCP",description:"Free, private, UI-based tech documentation MCP server for coders and developers",category:"developer-tools",repository:"https://github.com/cyberagiinc/DevDocs",stars:2003,installationType:"source",installConfig:{command:"python",args:["-m","devdocs"]},tags:["documentation","docs","reference","api-docs","crawler"]},{id:"brightdata-mcp",name:"Bright Data MCP",description:"Official Bright Data MCP for web scraping, data extraction, and anti-bot bypass",category:"browser-automation",repository:"https://github.com/brightdata/brightdata-mcp",website:"https://brightdata.com",stars:1845,installationType:"npx",npmPackage:"@anthropic/brightdata-mcp",official:!0,installConfig:{command:"npx",args:["-y","@anthropic/brightdata-mcp"]},requiredEnvVars:[{name:"BRIGHTDATA_API_KEY",description:"Bright Data API key"}],tags:["scraping","web-data","anti-bot","proxy","data-extraction","official"]},{id:"mcpjam-inspector",name:"MCP Inspector",description:"Build ChatGPT Apps and MCP servers locally with inspection and debugging tools",category:"developer-tools",repository:"https://github.com/MCPJam/inspector",stars:1545,installationType:"npx",npmPackage:"@mcpjam/inspector",installConfig:{command:"npx",args:["-y","@mcpjam/inspector"]},tags:["inspector","debugging","chatgpt","development","testing"]},{id:"mcptools",name:"MCP Tools CLI",description:"Command-line interface for interacting with MCP servers via stdio and HTTP transport",category:"developer-tools",repository:"https://github.com/f/mcptools",stars:1426,installationType:"npx",npmPackage:"mcptools",installConfig:{command:"npx",args:["-y","mcptools"]},tags:["cli","tools","stdio","http","debugging"]},{id:"mcp-scan",name:"MCP Scan",description:"Security vulnerability scanner for MCP connections - constrain, log, and audit",category:"security",repository:"https://github.com/invariantlabs-ai/mcp-scan",stars:1381,installationType:"pip",pipPackage:"mcp-scan",installConfig:{command:"uvx",args:["mcp-scan"]},tags:["security","vulnerability","audit","scanning","compliance"]},{id:"unreal-mcp",name:"Unreal Engine MCP",description:"Control Unreal Engine 5 through natural language via MCP for Cursor, Windsurf, and Claude",category:"developer-tools",repository:"https://github.com/chongdashu/unreal-mcp",stars:1239,installationType:"pip",pipPackage:"unreal-mcp",installConfig:{command:"uvx",args:["unreal-mcp"]},tags:["unreal-engine","ue5","game-dev","editor","blueprints"]},{id:"web-eval-agent",name:"Web Eval Agent MCP",description:"Autonomous web application evaluation and testing with Playwright integration",category:"developer-tools",repository:"https://github.com/refreshdotdev/web-eval-agent",stars:1231,installationType:"npx",npmPackage:"@refreshdotdev/web-eval-agent",installConfig:{command:"npx",args:["-y","@refreshdotdev/web-eval-agent"]},tags:["testing","qa","evaluation","playwright","autonomous"]},{id:"mcp-unity-alt",name:"MCP Unity (CoderGamester)",description:"Unity Editor MCP plugin for OpenAI, Gemini, Claude, Deepseek, and Grok integration",category:"developer-tools",repository:"https://github.com/CoderGamester/mcp-unity",stars:1193,installationType:"npx",npmPackage:"mcp-unity",installConfig:{command:"npx",args:["-y","mcp-unity"]},tags:["unity","game-dev","editor","c-sharp","multi-model"]},{id:"xmcp-framework",name:"xMCP Framework",description:"TypeScript MCP framework for building MCP servers with type safety and DX focus",category:"developer-tools",repository:"https://github.com/basementstudio/xmcp",stars:1168,installationType:"npm",npmPackage:"xmcp",installConfig:{command:"npm",args:["install","xmcp"]},tags:["framework","typescript","sdk","type-safe","developer-tools"]}];function So(e){return he.filter(t=>t.category===e)}function Kg(e){let t=e.toLowerCase();return he.filter(o=>o.name.toLowerCase().includes(t)||o.description.toLowerCase().includes(t)||o.tags?.some(r=>r.toLowerCase().includes(t)))}function bu(){return Array.from(new Set(he.map(e=>e.category)))}function hi(){let e=new Map;return he.forEach(t=>{t.tags?.forEach(o=>{e.set(o,(e.get(o)||0)+1)})}),Array.from(e.keys()).sort((t,o)=>{let r=(e.get(o)||0)-(e.get(t)||0);return r!==0?r:t.localeCompare(o)})}function Jg(e){return he.filter(t=>t.tags?.includes(e))}function Xg(e){return he.filter(t=>t.tags?.includes(e)).length}function Yg(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function ef(e){return{"browser-automation":"WEB",database:"DB","cloud-platform":"CLOUD","developer-tools":"DEV","file-system":"FS",communication:"CHAT","search-web":"Search","ai-services":"AI","workflow-automation":"Fast","version-control":"EDIT","data-visualization":"DATA","coding-agents":"AGENT",security:"SEC",productivity:"List",monitoring:"MON",finance:"FIN","social-media":"SOCIAL",aggregator:"LINK",other:"Package"}[e]||"Package"}function Du(e){let t=`${ef(e.category)} ${e.name}`;return e.official&&(t+=` ${a("cyan","[Official]")}`),t+=` - ${l(e.description.slice(0,45))}${e.description.length>45?"...":""}`,t}async function tf(){let e=dn();console.log(),console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+l("[Step 1/6]")+" "+f("Select Target Client")+" ".repeat(28)+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log();let t=["cursor","claude-desktop","claude-code","opencode","codex","gemini-cli","windsurf","trae","antigravity","goose","kiro","zed","vscode-cline","vscode-roo","vscode-continue"],o=[];for(let n of t){let i=Z[n],s=Re(n),c=`${i.name} - ${l(i.description)}`;s?c+=` ${a("green","\u25CB")}`:c+=` ${a("dim","X")}`,e===n&&(c=`${a("green","\u2605")} ${c} ${a("yellow","(Current)")}`),o.push({name:c,value:n,disabled:s?!1:"Not installed"})}o.sort((n,i)=>n.disabled&&!i.disabled?1:!n.disabled&&i.disabled||e===n.value?-1:e===i.value?1:0),o.push(new F),o.push({name:`${a("cyan","-")} Custom Path - ${l("Specify your own config path")}`,value:"custom"}),o.push(new F),o.push({name:`${a("dim","- Back")}`,value:"back"});let r=await A({message:"Where would you like to install the MCP?",choices:o,loop:!1,pageSize:15});if(r==="back")return null;if(r==="custom"){let n=await CC();return n?{client:"custom",customPath:n}:null}return{client:r}}async function CC(){console.log(),console.log(` ${a("blue","INFO")} Enter the full path to your MCP config file`),console.log(` ${l("Leave empty to go back")}`),console.log();let e=await ie({message:"Config path (or Enter to go back):",validate:t=>t.trim()?t.endsWith(".json")?!0:"Path must be a .json file":!0});if(!e||!e.trim())return null;if(e.startsWith("~")){let t=process.env.HOME||process.env.USERPROFILE||"";return e.replace("~",t)}return e}async function nf(){console.log(),console.log(` ${l("[Step 2/6]")} ${f("Browse Method")}`),console.log();let e=[{name:`- Search MCPs - ${l("Find by name, description, or tags")}`,value:"search"},{name:`- Browse by Category - ${l(`${bu().length} categories`)}`,value:"category"},{name:`- Browse by Tag - ${l(`${hi().length} tags`)}`,value:"tag"},{name:`- Popular MCPs - ${l("Top 20 most popular")}`,value:"popular"},{name:`- Full List (A-Z) - ${l(`All ${he.length} MCPs alphabetically`)}`,value:"all"},new F,{name:`${a("dim","- Back")}`,value:"back"}];return await A({message:"",choices:e,loop:!1})}async function of(){return console.log(),console.log(` ${l("[Step 3/6]")} ${f("Select MCP")}`),console.log(),console.log(` ${a("blue","INFO")} Type to search by name, description, or tags`),console.log(),await yo({message:"Search MCPs:",source:t=>{let o={name:`${a("dim","- Back to browse options")}`,value:"back"};if(!t||!t.trim())return[...he.slice(0,15).map(n=>({name:Du(n),value:n,description:n.tags?.slice(0,3).join(", ")})),{name:"\u2500".repeat(40),value:"back",disabled:!0},o];let r=Kg(t.trim());return r.length===0?[{name:`${a("yellow","WARN")} No MCPs found matching "${t}"`,value:"back",disabled:"Try different keywords"},o]:[...r.map(n=>({name:Du(n),value:n,description:n.tags?.slice(0,3).join(", ")})),{name:"\u2500".repeat(40),value:"back",disabled:!0},o]},pageSize:12})}async function rf(){console.log(),console.log(` ${l("[Step 3/6]")} ${f("Select MCP")}`),console.log();let t=bu().map(n=>({name:`${ef(n)} ${Yg(n)} (${So(n).length})`,value:n}));t.sort((n,i)=>{let s=So(n.value).length;return So(i.value).length-s}),t.push(new F),t.push({name:`${a("dim","- Back")}`,value:"back"});let o=await A({message:"Select a category:",choices:t,loop:!1,pageSize:15});if(o==="back")return"back";let r=So(o);return await vi(r,Yg(o))}function Qg(e){return e.charAt(0).toUpperCase()+e.slice(1)}async function sf(){console.log(),console.log(` ${l("[Step 3/6]")} ${f("Select MCP")}`),console.log(),console.log(` ${a("blue","INFO")} Type to filter ${hi().length} tags`),console.log();let e=hi(),t=await yo({message:"Search tags:",source:r=>{let n={name:`${a("dim","- Back to browse options")}`,value:"back"},i=!r||!r.trim()?e.slice(0,20):e.filter(s=>s.toLowerCase().includes(r.toLowerCase().trim()));return i.length===0?[{name:`${a("yellow","WARN")} No tags found matching "${r}"`,value:"back",disabled:"Try different keywords"},n]:[...i.map(s=>({name:`- ${Qg(s)} (${Xg(s)} MCPs)`,value:s})),{name:"\u2500".repeat(40),value:"back",disabled:!0},n]},pageSize:15});if(t==="back")return"back";let o=Jg(t);return await vi(o,`Tag: ${Qg(t)}`)}async function af(){console.log(),console.log(` ${l("[Step 3/6]")} ${f("Select MCP")}`);let e=[...he].sort((t,o)=>(o.stars??0)-(t.stars??0)).slice(0,20);return await vi(e,"Popular MCPs")}async function cf(){console.log(),console.log(` ${l("[Step 3/6]")} ${f("Select MCP")}`);let e=[...he].sort((t,o)=>t.name.localeCompare(o.name));return await vi(e,`All MCPs (A-Z) - ${e.length} total`)}async function vi(e,t){console.log(),console.log(` ${f(t)}`),console.log();let o=e.map(n=>({name:Du(n),value:n}));return o.push(new F),o.push({name:`${a("dim","- Back")}`,value:"back"}),await A({message:"Select an MCP to install:",choices:o,loop:!1,pageSize:15})}async function lf(e){let t=e.requiredEnvVars;if(!t||t.length===0)return{};console.log(),console.log(` ${l("[Step 5/6]")} ${f("Environment Variables")}`),console.log(),console.log(a("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","WARN")} ${f("Environment Variables Required")}`+" ".repeat(26)+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("This MCP requires the following environment variables:")}`),console.log();for(let n of t)console.log(` ${a("cyan",n.name)}`),console.log(` ${l(n.description)}`),n.example&&console.log(` ${l("Example:")} ${a("dim",n.example)}`),console.log();let o=await A({message:"Would you like to configure these now?",choices:[{name:`${a("green","\u2705")} Configure environment variables`,value:"configure"},{name:`${a("yellow","\u25CB")} Skip - ${l("Configure later manually")}`,value:"skip"},new F,{name:`${a("dim","- Back")}`,value:"back"}],loop:!1});if(o==="back")return"back";if(o==="skip")return{};let r={};for(let n of t){console.log(),console.log(` ${a("cyan",n.name)}: ${l(n.description)}`),n.example&&console.log(` ${l("Example:")} ${n.example}`);let i=await ie({message:`${n.name}:`,validate:s=>!s.trim()&&!n.name.includes("OPTIONAL")?`${n.name} is required`:!0});i.trim()&&(r[n.name]=i.trim())}return r}async function uf(e,t){let o=Z[t];return console.log(),await A({message:`Install ${e.name} to ${o?.name||t}?`,choices:[{name:`${a("green","\u2705")} Proceed with installation`,value:"proceed"},new F,{name:`${a("dim","- Back to edit options")}`,value:"back"},{name:`${a("dim","X Cancel")}`,value:"cancel"}],loop:!1})}function df(e){console.log(),console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+f(e.name)+(e.official?` ${a("cyan","[Official]")}`:"")+" ".repeat(Math.max(0,60-e.name.length-(e.official?12:0)))+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("Description:")} ${e.description}`),console.log(` ${l("Category:")} ${a("cyan",e.category)}`),console.log(` ${l("Installation:")} ${a("yellow",e.installationType)}`),e.website&&console.log(` ${l("Website:")} ${a("blue",e.website)}`),console.log(` ${l("Repository:")} ${a("blue",e.repository)}`),e.tags&&e.tags.length>0&&console.log(` ${l("Tags:")} ${e.tags.map(t=>a("dim",t)).join(", ")}`),console.log()}function pf(e,t,o,r){let n=Z[t];console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+f("Configuration Preview")+" ".repeat(39)+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log();let i={...e.installConfig.env||{},...r},s={command:e.installConfig.command,args:[...e.installConfig.args],...Object.keys(i).length>0&&{env:i}};if(console.log(` ${l("Server ID:")} ${a("cyan",e.id)}`),console.log(` ${l("Command:")} ${a("green",s.command)}`),console.log(` ${l("Args:")} ${a("yellow",s.args.join(" "))}`),Object.keys(i).length>0){console.log(` ${l("Environment Variables:")}`);for(let[c,u]of Object.entries(i)){let p=u.length>30?u.slice(0,27)+"...":u;console.log(` ${a("cyan",c)}: ${l(p)}`)}}console.log(),console.log(` ${f("Target:")}`),console.log(` ${l("Client:")} ${n?.name||t}`),console.log(` ${l("Config:")} ${a("cyan",o)}`),console.log()}function mf(e,t,o,r){let n=Z[t];console.log(),console.log(a("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("green"," \u2502 ")+`${a("green","\u2705")} ${f("MCP installed successfully!")}`+" ".repeat(30)+a("green","\u2502")),console.log(a("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${f("Installed:")} ${e.name}`),console.log(` ${f("To:")} ${n?.name||t}`),console.log(` ${l("Config:")} ${a("cyan",o)}`),r&&console.log(` ${l("Backup:")} ${r}`),console.log(),console.log(` ${f("Next steps:")}`),console.log(` 1. Restart ${n?.name||t}`),console.log(` 2. Look for ${a("cyan",e.id)} in MCP servers`),e.website&&console.log(` 3. Check ${a("blue",e.website)} for usage docs`),console.log()}function gf(e){console.log(),console.log(a("red"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("red"," \u2502 ")+`${a("red","X")} ${f("Installation failed")}`+" ".repeat(38)+a("red","\u2502")),console.log(a("red"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${a("red","Error:")} ${e}`),console.log()}var ff=["npx","node","python","python3","uvx","uv","docker","deno","bun","bunx","pnpm","yarn","npm"];function kC(e){if(!e||typeof e!="string")return{valid:!1,error:"Command is required"};let t=e.trim();if(t.includes("..")||t.includes("\0"))return{valid:!1,error:"Command contains invalid characters"};let o=t.split(/[/\\]/),r=o[o.length-1]?.split(/\s+/)[0]||"";return ff.includes(r)?{valid:!0}:{valid:!1,error:`Untrusted command: "${r}". Allowed: ${ff.join(", ")}`}}var wC=[/[;&|`$]/,/[(){}[\]]/,/[<>]/,/[!^]/,/\\(?!["'\\])/,/[\n\r\x00]/,/'.*'/,/".*\$.*"/],xC=/^--?[a-zA-Z][a-zA-Z0-9-]*(=\S+)?$/;function SC(e){return xC.test(e)}function _C(e){if(!Array.isArray(e))return{valid:!1,error:"Arguments must be an array"};for(let t of e){if(typeof t!="string")return{valid:!1,problematic:String(t),error:"Argument must be a string"};if(!SC(t)){for(let o of wC)if(o.test(t))return{valid:!1,problematic:t,error:`Potentially unsafe argument: "${t.slice(0,50)}${t.length>50?"...":""}"`};if(t.length>4096)return{valid:!1,problematic:t.slice(0,50)+"...",error:"Argument exceeds maximum length (4096 chars)"}}}return{valid:!0}}function PC(e){if(!e||typeof e!="object")return{valid:!0};let t=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let[o,r]of Object.entries(e)){if(!t.test(o))return{valid:!1,problematic:o,error:`Invalid environment variable name: "${o}"`};if(typeof r!="string")return{valid:!1,problematic:o,error:`Environment variable value must be a string: "${o}"`};if(/[\x00-\x08\x0B\x0C\x0E-\x1F]/.test(r))return{valid:!1,problematic:o,error:`Environment variable "${o}" contains invalid control characters`};if(r.length>32768)return{valid:!1,problematic:o,error:`Environment variable "${o}" exceeds maximum length (32KB)`}}return{valid:!0}}function EC(e,t){let o=kC(e.installConfig.command);if(!o.valid)throw new Error(o.error||"Invalid command");let r=_C(e.installConfig.args);if(!r.valid)throw new Error(r.error||`Potentially unsafe argument: "${r.problematic}"`);let n={...e.installConfig.env||{},...t},i=PC(n);if(!i.valid)throw new Error(i.error||`Invalid environment variable: "${i.problematic}"`);let s={command:e.installConfig.command,args:[...e.installConfig.args]};return Object.keys(n).length>0&&(s.env=n),s}function IC(e,t,o){let r=t==="custom"&&o?o:K(t,o),n=J(r);return!n||!n.mcpServers?!1:e in n.mcpServers}function FC(e,t,o,r){let n=t==="custom"&&o?o:K(t,o),i=J(n)||{mcpServers:{}},s=EC(e,r);i={...i,mcpServers:{...i.mcpServers,[e.id]:s}};let c=pe(n,i);return c.success?{success:!0,configPath:n,backupPath:c.backupPath}:{success:!1,configPath:n,error:c.error||"Failed to write config"}}async function AC(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}async function $u(){await oe(),console.log(),console.log(` ${a("yellow","WARN")} ${l("70+ community servers \u2022 MCPs install on your behalf")}`);let e={client:null,browseMode:null,selectedMCP:null,envValues:{}},t="client";for(;t!=="done";)switch(t){case"client":{let o=await tf();if(!o)return;e.client=o.client,e.customPath=o.customPath,t="browse";break}case"browse":{let o=await nf();if(o==="back"||o===null){t="client";break}e.browseMode=o,t="selectMCP";break}case"selectMCP":{let o=null;switch(e.browseMode){case"search":o=await of();break;case"category":o=await rf();break;case"tag":o=await sf();break;case"popular":o=await af();break;case"all":o=await cf();break;default:break}if(o==="back"){t="browse";break}if(o===null){t="browse";break}e.selectedMCP=o,t="details";break}case"details":{let o=Pe(e.selectedMCP,"selectedMCP should be set before details step");if(console.log(),console.log(` ${l("[Step 4/6]")} ${f("MCP Details")}`),df(o),await A({message:"What would you like to do?",choices:[{name:`${a("green","\u2705")} Continue to install`,value:"continue"},new F,{name:`${a("dim","- Back to MCP list")}`,value:"back"}],loop:!1})==="back"){t="selectMCP";break}t="envVars";break}case"envVars":{let o=Pe(e.selectedMCP,"selectedMCP should be set before envVars step"),r=await lf(o);if(r==="back"){t="details";break}if(r===null){t="details";break}e.envValues=r,t="confirm";break}case"confirm":{let o=Pe(e.selectedMCP,"selectedMCP should be set before confirm step"),r=Pe(e.client,"client should be set before confirm step");console.log(),console.log(` ${l("[Step 6/6]")} ${f("Confirm Installation")}`);let n=r==="custom"&&e.customPath?e.customPath:K(r,e.customPath);if(IC(o.id,r,e.customPath)){console.log(),console.log(` ${a("yellow","\u26A0")} MCP "${f(o.name)}" is already installed.`),console.log();let c=await A({message:"What would you like to do?",choices:[{name:`${a("blue","\u21BB")} Update configuration`,value:"update"},{name:`${a("dim","\u23ED")} Skip (keep existing)`,value:"skip"},new F,{name:`${a("dim","\u2190 Back")}`,value:"back"}],loop:!1});if(c==="skip"){console.log(),console.log(` ${l("Skipped - keeping existing configuration.")}`),t="browse";break}if(c==="back"){t="envVars";break}console.log(),console.log(` ${a("blue","\u2192")} Updating MCP configuration...`)}pf(o,r,n,e.envValues);let s=await uf(o,r);if(s==="back"){t="envVars";break}if(s==="cancel"){console.log(),console.log(` ${l("Installation cancelled.")}`);return}t="install";break}case"install":{let o=Pe(e.selectedMCP,"selectedMCP should be set before install step"),r=Pe(e.client,"client should be set before install step"),n=new L("Installing MCP...").start(),i=FC(o,r,e.customPath,e.envValues);i.success?(n.succeed("MCP installed successfully!"),mf(o,r,i.configPath,i.backupPath)):(n.fail("Installation failed"),gf(i.error||"Unknown error")),await AC(),t="done";break}default:break}}function _o(){let e=Sg(),t=[];for(let o of e){let r=K(o),n=li(o),i=null,s=0;n&&(i=J(r),i?.mcpServers&&(s=Object.keys(i.mcpServers).length)),t.push({client:o,configPath:r,config:i,exists:n,mcpCount:s})}return t}function TC(e,t){if(e.command!==t.command)return!1;let o=e.args||[],r=t.args||[];if(o.length!==r.length)return!1;for(let s=0;s<o.length;s++)if(o[s]!==r[s])return!1;let n=Object.keys(e.env||{}).sort(),i=Object.keys(t.env||{}).sort();if(n.length!==i.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==i[s]||(e.env||{})[n[s]]!==(t.env||{})[i[s]])return!1;return!0}function Po(e){let t=e.filter(p=>p.exists&&p.config),o=new Set,r=new Map;for(let p of t)if(p.config?.mcpServers)for(let[d,m]of Object.entries(p.config.mcpServers))o.add(d),r.has(d)||r.set(d,new Map),r.get(d).set(p.client,m);let n=[],i=t.map(p=>p.client);for(let p of o){let d=r.get(p)||new Map,m=Array.from(d.keys()),h=i.filter(D=>!d.has(D)),y=!1,g=Array.from(d.values());if(g.length>1){let D=g[0];for(let b=1;b<g.length;b++)if(!TC(D,g[b])){y=!0;break}}n.push({mcpId:p,presentIn:m,missingIn:h,hasConflict:y,variants:d})}let s=n.filter(p=>p.missingIn.length===0&&!p.hasConflict),c=n.filter(p=>p.missingIn.length>0&&!p.hasConflict),u=n.filter(p=>p.hasConflict);return{clients:e,allMCPs:o,diffs:n,fullyConsistent:s,needsSync:c,conflicts:u,summary:{totalClients:e.length,clientsWithConfig:t.length,totalUniqueMCPs:o.size,consistentMCPs:s.length,needsSyncCount:c.length,conflictCount:u.length}}}function OC(e,t){let o={mcpServers:{...e?.mcpServers||{}}};for(let{mcpId:r,server:n}of t)o.mcpServers[r]=n;return o}function MC(e,t){return t?t.chosenConfig:!e.hasConflict&&e.variants.size>0?Array.from(e.variants.values())[0]:null}function Cu(e,t,o){let r=new Map,n=[],i=[],s=o?e.filter(u=>o.includes(u.client)):e.filter(u=>u.exists);for(let u of s){if(u.exists&&u.config===null){r.set(u.client,{success:!1,error:"Config file exists but could not be parsed (corrupt JSON?) \u2014 skipping to avoid data loss"}),n.push(`${Z[u.client]?.name||u.client}: corrupt config \u2014 skipped`);continue}let p=OC(u.config,t),d=pe(u.configPath,p);if(d.success)r.set(u.client,{success:!0,backupPath:d.backupPath});else{let m=d.error||"Unknown write error";r.set(u.client,{success:!1,error:m}),n.push(`${Z[u.client]?.name||u.client}: ${m}`)}}for(let{mcpId:u}of t)i.includes(u)||i.push(u);return{success:Array.from(r.values()).every(u=>u.success),clientResults:r,mcpsSynced:i,errors:n}}function yi(e,t){let o=[],r=new Map(t.map(n=>[n.mcpId,n]));for(let n of e.needsSync){let i=MC(n);i&&o.push({mcpId:n.mcpId,server:i})}for(let n of e.conflicts){let i=r.get(n.mcpId);i&&o.push({mcpId:n.mcpId,server:i.chosenConfig})}return o}function ku(e){return e.summary.needsSyncCount>0||e.summary.conflictCount>0}function ve(e){return Z[e]?.name||e}function vf(e){let{summary:t}=e;if(console.log(),console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+f("MCP Sync Status")+" ".repeat(44)+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${f("Clients:")}`),console.log(` ${a("cyan","\u2022")} ${t.clientsWithConfig} of ${t.totalClients} with MCP configs`),console.log(),console.log(` ${f("MCPs:")}`),console.log(` ${a("cyan","\u2022")} ${t.totalUniqueMCPs} unique MCPs found`),t.consistentMCPs>0){console.log(` ${a("green","\u2705")} ${t.consistentMCPs} fully synced`);for(let o of e.fullyConsistent)console.log(` ${l("\u2022")} ${o.mcpId}`)}if(t.needsSyncCount>0){let o=t.needsSyncCount;console.log(` ${a("yellow","\u25CB")} ${o} can be synced`);for(let r of e.needsSync){let n=r.missingIn.map(ve).join(", ");console.log(` ${a("yellow","\u2022")} ${r.mcpId}`),console.log(` ${l(`missing from: ${n}`)}`)}}if(t.conflictCount>0){console.log(` ${a("red","!")} ${t.conflictCount} have conflicts`);for(let o of e.conflicts){let r=Array.from(o.variants.keys()).map(ve).join(" vs ");console.log(` ${a("red","\u2022")} ${o.mcpId}`),console.log(` ${l(`different in: ${r}`)}`)}console.log(),console.log(` ${a("cyan","INFO")} ${l("Continue to choose which config to use for each conflict")}`)}console.log()}function yf(e){console.log(` ${f("Client Configurations:")}`),console.log();for(let t of e){let o=ve(t.client),r=t.exists?a("green","\u25CF"):a("dim","\u25CB"),n=t.exists?`${t.mcpCount} MCPs`:l("no config");console.log(` ${r} ${o}`),console.log(` ${l(t.configPath)}`),console.log(` ${l(n)}`),console.log()}}function hf(e){let t=e.hasConflict?a("red","!"):e.missingIn.length>0?a("yellow","\u25CB"):a("green","\u2705");console.log(` ${t} ${f(e.mcpId)}`);let o=e.presentIn.map(ve).join(", ");if(console.log(` ${l("Present in:")} ${o}`),e.missingIn.length>0){let r=e.missingIn.map(ve).join(", ");console.log(` ${a("yellow","Missing from:")} ${r}`)}e.hasConflict&&console.log(` ${a("red","Conflict:")} Different configurations detected`),console.log()}function bf(e){if(e.fullyConsistent.length>0){console.log(` ${a("green","\u2705")} ${f("Fully Synced:")}`);for(let t of e.fullyConsistent)console.log(` ${a("dim","\u2022")} ${t.mcpId}`);console.log()}if(e.needsSync.length>0){console.log(` ${a("yellow","\u25CB")} ${f("Needs Sync (auto-resolvable):")}`);for(let t of e.needsSync)hf(t)}if(e.conflicts.length>0){console.log(` ${a("red","!")} ${f("Conflicts (requires resolution):")}`);for(let t of e.conflicts)hf(t)}}function zC(e,t=" "){console.log(`${t}${l("command:")} ${e.command||l("(none)")}`);let o=e.args?.join(" ")||"";if(o&&console.log(`${t}${l("args:")} ${o}`),e.env&&Object.keys(e.env).length>0){console.log(`${t}${l("env:")}`);for(let[r,n]of Object.entries(e.env)){let s=/token|secret|key|password|auth|credential/i.test(r)?"***":n&&n.length>30?n.slice(0,30)+"...":n||"";console.log(`${t} ${a("cyan",r)}: ${s}`)}}}function Df(e,t=!1){console.log(),console.log(a("yellow"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","WARN")} Conflict: ${f(e.mcpId)}`+" ".repeat(Math.max(0,43-e.mcpId.length))+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("This MCP has different configurations across clients:")}`),console.log();let o=1;for(let[r,n]of e.variants){let i=ve(r);if(console.log(` ${a("cyan",`[${o}]`)} ${f(i)}`),t)zC(n," ");else{let s=n.args?.join(" ")||"",c=[n.command,s].filter(Boolean).join(" ");console.log(` ${l("command:")} ${c||l("(none)")}`),n.env&&Object.keys(n.env).length>0&&console.log(` ${l("env:")} ${Object.keys(n.env).length} variables`)}console.log(),o++}}function $f(e,t){console.log(),console.log(a("blue"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("blue"," \u2502 ")+f("Sync Preview")+" ".repeat(47)+a("blue","\u2502")),console.log(a("blue"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${f("MCPs to sync:")} ${e.length}`);for(let{mcpId:o}of e)console.log(` ${a("cyan","\u2022")} ${o}`);console.log(),console.log(` ${f("Target clients:")} ${t.length}`);for(let o of t){let r=ve(o.client);console.log(` ${a("cyan","\u2022")} ${r}`),console.log(` ${l(o.configPath)}`)}console.log(),console.log(` ${a("yellow","WARN")} ${f("Note:")}`),console.log(` ${l("Backups will be created before modifying any config.")}`),console.log()}function Cf(e){if(console.log(),e.success?(console.log(a("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("green"," \u2502 ")+`${a("green","\u2705")} ${f("Sync Complete!")}`+" ".repeat(43)+a("green","\u2502")),console.log(a("green"," \u2514"+"\u2500".repeat(60)+"\u2518"))):(console.log(a("red"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("red"," \u2502 ")+`${a("red","X")} ${f("Sync completed with errors")}`+" ".repeat(32)+a("red","\u2502")),console.log(a("red"," \u2514"+"\u2500".repeat(60)+"\u2518"))),console.log(),e.mcpsSynced.length>0){console.log(` ${f("Synced MCPs:")} ${e.mcpsSynced.length}`);for(let t of e.mcpsSynced)console.log(` ${a("green","\u2705")} ${t}`);console.log()}console.log(` ${f("Client Results:")}`);for(let[t,o]of e.clientResults){let r=ve(t);o.success?(console.log(` ${a("green","\u2705")} ${r}`),o.backupPath&&console.log(` ${l("Backup:")} ${o.backupPath}`)):(console.log(` ${a("red","X")} ${r}`),o.error&&console.log(` ${a("red","Error:")} ${o.error}`))}if(e.errors.length>0){console.log(),console.log(` ${a("red","Errors:")}`);for(let t of e.errors)console.log(` ${a("red","\u2022")} ${t}`)}console.log()}function kf(){console.log(),console.log(a("green"," \u250C"+"\u2500".repeat(60)+"\u2510")),console.log(a("green"," \u2502 ")+`${a("green","\u2705")} ${f("All MCPs are already in sync!")}`+" ".repeat(28)+a("green","\u2502")),console.log(a("green"," \u2514"+"\u2500".repeat(60)+"\u2518")),console.log(),console.log(` ${l("All your MCP configurations are consistent across clients.")}`),console.log()}async function pn(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}async function jC(e){Df(e,!0);let t=[],o=1;for(let[n,i]of e.variants){let s=ve(n),c=i.args?.join(" ")||"",u=[i.command,c].filter(Boolean).join(" ");t.push({name:`${a("cyan",`[${o}]`)} Use config from ${f(s)}`,value:{client:n,server:i},description:u||"(no command)"}),o++}t.push(new F),t.push({name:`${a("yellow","Skip")} Skip this MCP (don't sync)`,value:"skip"}),t.push({name:`${a("dim","- Back")}`,value:"back"});let r=await A({message:`Choose config for ${f(e.mcpId)}:`,choices:t,loop:!1});return r==="back"||r==="skip"?null:{mcpId:e.mcpId,chosenConfig:r.server,sourceClient:r.client}}async function wu(){await oe(),console.log(),console.log(a("blue","\u2501".repeat(66))),console.log(` Sync ${f("Sync System MCP")}`),console.log(a("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("Synchronize MCP servers across all your IDE clients")}`);let e={analysis:null,resolutions:[],currentConflictIndex:0},t="analyze";for(;t!=="done";)switch(t){case"analyze":{let o=new L("Scanning client configurations...").start(),r=_o();if(e.analysis=Po(r),o.succeed("Configuration scan complete!"),e.analysis.summary.clientsWithConfig<2){console.log(),console.log(` ${a("yellow","WARN")} ${f("Not enough clients to sync")}`),console.log(` ${l("Found only")} ${e.analysis.summary.clientsWithConfig} ${l("client(s) with MCP configs.")}`),console.log(` ${l("Need at least 2 clients to sync.")}`),console.log(),await pn();return}t="showStatus";break}case"showStatus":{let o=Pe(e.analysis,"Analysis should be populated before showStatus step");if(vf(o),!ku(o)){kf(),await pn();return}let r=await A({message:"What would you like to do?",choices:[{name:`${a("green","\u2705")} Continue to sync`,value:"continue"},{name:`${a("cyan","INFO")} Show MCP details`,value:"details"},{name:`${a("cyan","INFO")} Show client details`,value:"clients"},new F,{name:`${a("dim","- Back to menu")}`,value:"back"}],loop:!1});if(r==="back")return;if(r==="details"){console.log(),bf(o),await pn();break}if(r==="clients"){console.log(),yf(o.clients),await pn();break}o.conflicts.length>0?t="resolveConflicts":t="preview";break}case"resolveConflicts":{let r=Pe(e.analysis,"Analysis should be populated before resolveConflicts step").conflicts;console.log(),console.log(` ${a("yellow","WARN")} ${f(`Resolve ${r.length} conflict(s)`)}`),console.log(` ${l("You need to choose which configuration to use for each conflicting MCP.")}`),e.resolutions=[];for(let n=0;n<r.length;n++){console.log(),console.log(` ${l(`Conflict ${n+1} of ${r.length}`)}`);let i=await jC(r[n]);if(i===null){console.log(` ${a("yellow","Skip")} Skipping ${f(r[n].mcpId)}`);continue}e.resolutions.push(i),console.log(` ${a("green","\u2705")} Using config from ${f(ve(i.sourceClient))}`)}t="preview";break}case"preview":{let o=Pe(e.analysis,"Analysis should be populated before preview step"),r=yi(o,e.resolutions);if(r.length===0){console.log(),console.log(` ${a("yellow","WARN")} ${f("No MCPs to sync")}`),console.log(` ${l("All conflicts were skipped or no sync is needed.")}`),console.log(),await pn();return}let n=o.clients.filter(i=>i.exists);$f(r.map(i=>({mcpId:i.mcpId})),n),t="confirm";break}case"confirm":{let o=await A({message:"Proceed with sync?",choices:[{name:`${a("green","\u2705")} Yes, sync all clients`,value:"proceed"},new F,{name:`${a("dim","- Back to review")}`,value:"back"},{name:`${a("dim","X Cancel")}`,value:"cancel"}],loop:!1});if(o==="cancel"){console.log(` ${l("Sync cancelled.")}`);return}if(o==="back"){t="showStatus";break}t="execute";break}case"execute":{let o=Pe(e.analysis,"Analysis should be populated before execute step"),r=yi(o,e.resolutions),n=o.clients.filter(c=>c.exists),i=new L("Syncing configurations...").start(),s=Cu(o.clients,r,n.map(c=>c.client));s.success?i.succeed("Sync complete!"):i.fail("Sync completed with errors"),Cf(s),console.log(` ${f("Next steps:")}`),console.log(` ${l("Restart your IDEs to apply the changes.")}`),console.log(),await pn(),t="done";break}default:break}}async function xu(e){let t=_o(),o=Po(t);if(o.summary.clientsWithConfig<2)return{success:!1,message:`Not enough clients to sync (found ${o.summary.clientsWithConfig})`,syncPerformed:!1};if(!ku(o))return{success:!0,message:"All MCPs are already in sync",syncPerformed:!1};if(o.conflicts.length>0&&!e.force)return{success:!1,message:`${o.conflicts.length} conflict(s) found. Use --force to auto-resolve or run interactive mode.`,syncPerformed:!1};let r=[];if(e.force)for(let c of o.conflicts){let u=Array.from(c.variants.entries())[0];u&&r.push({mcpId:c.mcpId,chosenConfig:u[1],sourceClient:u[0]})}let n=yi(o,r);if(e.dryRun)return{success:!0,message:`Would sync ${n.length} MCP(s) to ${o.summary.clientsWithConfig} client(s)`,syncPerformed:!1};let i=o.clients.filter(c=>c.exists),s=Cu(o.clients,n,i.map(c=>c.client));return s.success?{success:!0,message:`Synced ${s.mcpsSynced.length} MCP(s) to ${i.length} client(s)`,syncPerformed:!0}:{success:!1,message:`Sync failed: ${s.errors.join(", ")}`,syncPerformed:!0}}import{fileURLToPath as xf}from"node:url";import{dirname as Sf,join as zt,resolve as bi}from"node:path";import{existsSync as NC,readFileSync as LC,writeFileSync as AF,mkdirSync as TF}from"node:fs";function Mt(e){let t=e.match(/^---\s*\n([\s\S]*?)\n---/);if(!t)return null;let o=t[1],r=o.match(/^name:\s*(.+)$/m),n=o.match(/^description:\s*(.+)$/m),i=o.match(/^category:\s*(.+)$/m);return{name:r?.[1].trim(),description:n?.[1].trim(),category:i?.[1].trim()}}var UC=fe.home||process.env.OCTOCODE_HOME||zt(H,".octocode"),wf=fe.cliConfig||zt(UC,"config.json");function BC(){try{if(NC(wf)){let e=LC(wf,"utf-8");return JSON.parse(e)}}catch{}return{}}function RC(){return BC().skillsDestDir||null}function ZC(){if(X){let e=De();return zt(e,"Claude","skills")}return zt(H,".claude","skills")}function Di(){let e=xf(import.meta.url),t=Sf(e),o=[zt(t,"..","skills"),zt(t,"..","..","..","..","skills"),zt(t,"..","..","..","skills")];for(let r of o)if(z(r))return r;throw new Error("Skills directory not found")}function _f(){let e=Di();return Be(e).filter(t=>t.startsWith("octocode-"))}function jt(){let e=xf(import.meta.url),t=Sf(e),o=[bi(t,"..","skills"),bi(t,"..","..","..","..","skills"),bi(t,"..","..","..","skills")];for(let r of o)if(z(r))return r;return bi(t,"..","skills")}function we(){let e=RC();return e||ZC()}import yn from"node:path";import Gf from"node:process";import Wf from"node:path";import{fileURLToPath as $k}from"node:url";import Ck from"node:child_process";import kk,{constants as wk}from"node:fs/promises";import{promisify as ek}from"node:util";import tk from"node:child_process";import Iu,{constants as Of}from"node:fs/promises";import If from"node:process";import qC from"node:os";import KC from"node:fs";import WC from"node:fs";import Pf from"node:fs";var Su;function VC(){try{return Pf.statSync("/.dockerenv"),!0}catch{return!1}}function GC(){try{return Pf.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function _u(){return Su===void 0&&(Su=VC()||GC()),Su}var Pu,HC=()=>{try{return WC.statSync("/run/.containerenv"),!0}catch{return!1}};function mn(){return Pu===void 0&&(Pu=HC()||_u()),Pu}var Ef=()=>{if(If.platform!=="linux")return!1;if(qC.release().toLowerCase().includes("microsoft"))return!mn();try{return KC.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!mn():!1}catch{return!1}},ot=If.env.__IS_WSL_TEST__?Ef:Ef();import Ff from"node:process";import{Buffer as JC}from"node:buffer";import{promisify as XC}from"node:util";import YC from"node:child_process";import eA,{constants as tA}from"node:fs/promises";var QC=XC(YC.execFile),Eu=()=>`${Ff.env.SYSTEMROOT||Ff.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;var xe=async(e,t={})=>{let{powerShellPath:o,...r}=t,n=xe.encodeCommand(e);return QC(o??Eu(),[...xe.argumentsPrefix,n],{encoding:"utf8",...r})};xe.argumentsPrefix=["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"];xe.encodeCommand=e=>JC.from(e,"utf16le").toString("base64");xe.escapeArgument=e=>`'${String(e).replaceAll("'","''")}'`;function Af(e){for(let t of e.split(`
71
+ `)){if(/^\s*#/.test(t))continue;let o=/^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(t);if(o)return o.groups.mountPoint.trim().replaceAll(/^["']|["']$/g,"")}}var nk=ek(tk.execFile),ok=(()=>{let e="/mnt/",t;return async function(){if(t)return t;let o="/etc/wsl.conf",r=!1;try{await Iu.access(o,Of.F_OK),r=!0}catch{}if(!r)return e;let n=await Iu.readFile(o,{encoding:"utf8"}),i=Af(n);return i===void 0?e:(t=i,t=t.endsWith("/")?t:`${t}/`,t)}})(),rk=async()=>`${await ok()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`,$i=ot?rk:Eu,Tf,Mf=async()=>(Tf??=(async()=>{try{let e=await $i();return await Iu.access(e,Of.X_OK),!0}catch{return!1}})(),Tf),zf=async()=>{let e=await $i(),t=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,{stdout:o}=await xe(t,{powerShellPath:e});return o.trim()},jf=async e=>{if(/^[a-z]+:\/\//i.test(e))return e;try{let{stdout:t}=await nk("wslpath",["-aw",e],{encoding:"utf8"});return t.trim()}catch{return e}};function Nt(e,t,o){let r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){let n=o();return r(n),n},set(n){r(n)}}),e}import{promisify as hk}from"node:util";import Mu from"node:process";import{execFile as vk}from"node:child_process";import{promisify as ik}from"node:util";import sk from"node:process";import{execFile as ak}from"node:child_process";var ck=ik(ak);async function Fu(){if(sk.platform!=="darwin")throw new Error("macOS only");let{stdout:e}=await ck("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),o=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e)?.groups.id??"com.apple.Safari";return o==="com.apple.safari"?"com.apple.Safari":o}import lk from"node:process";import{promisify as uk}from"node:util";import{execFile as dk,execFileSync as DA}from"node:child_process";var pk=uk(dk);async function Nf(e,{humanReadableOutput:t=!0,signal:o}={}){if(lk.platform!=="darwin")throw new Error("macOS only");let r=t?[]:["-ss"],n={};o&&(n.signal=o);let{stdout:i}=await pk("osascript",["-e",e,r],n);return i.trim()}async function Au(e){return Nf(`tell application "Finder" to set app_path to application file id "${e}" as string
72
+ tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as mk}from"node:util";import{execFile as gk}from"node:child_process";var fk=mk(gk),Lf={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},Tu=new Map(Object.entries(Lf)),Ci=class extends Error{};async function Ou(e=fk){let{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),o=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!o)throw new Ci(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);let{id:r}=o.groups,n=Lf[r];if(!n)throw new Ci(`Unknown browser ID: ${r}`);return n}var yk=hk(vk),bk=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,t=>t.toUpperCase());async function zu(){if(Mu.platform==="darwin"){let e=await Fu();return{name:await Au(e),id:e}}if(Mu.platform==="linux"){let{stdout:e}=await yk("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:bk(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if(Mu.platform==="win32")return Ou();throw new Error("Only macOS, Linux, and Windows are supported")}import ju from"node:process";var Dk=!!(ju.env.SSH_CONNECTION||ju.env.SSH_CLIENT||ju.env.SSH_TTY),Uf=Dk;var ki=Symbol("fallbackAttempt"),Nu=import.meta.url?Wf.dirname($k(import.meta.url)):"",Bf=Wf.join(Nu,"xdg-open"),{platform:gn,arch:Rf}=Gf,Zf=async(e,t)=>{if(e.length===0)return;let o=[];for(let r of e)try{return await t(r)}catch(n){o.push(n)}throw new AggregateError(o,"Failed to open in all supported apps")},wi=async e=>{e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e};let t=e[ki]===!0;if(delete e[ki],Array.isArray(e.app))return Zf(e.app,p=>wi({...e,app:p,[ki]:!0}));let{name:o,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(o))return Zf(o,p=>wi({...e,app:{name:p,arguments:r},[ki]:!0}));if(o==="browser"||o==="browserPrivate"){let p={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge","com.apple.safari":"safari"},d={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},m;if(ot){let h=await zf();m=Tu.get(h)??{}}else m=await zu();if(m.id in p){let h=p[m.id.toLowerCase()];if(o==="browserPrivate"){if(h==="safari")throw new Error("Safari doesn't support opening in private mode via command line");r.push(d[h])}return wi({...e,app:{name:fn[h],arguments:r}})}throw new Error(`${m.name} is not supported as a default browser`)}let n,i=[],s={},c=!1;if(ot&&!mn()&&!Uf&&!o&&(c=await Mf()),gn==="darwin")n="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),o&&i.push("-a",o);else if(gn==="win32"||c){n=await $i(),i.push(...xe.argumentsPrefix),ot||(s.windowsVerbatimArguments=!0),ot&&e.target&&(e.target=await jf(e.target));let p=["$ProgressPreference = 'SilentlyContinue';","Start"];e.wait&&p.push("-Wait"),o?(p.push(xe.escapeArgument(o)),e.target&&r.push(e.target)):e.target&&p.push(xe.escapeArgument(e.target)),r.length>0&&(r=r.map(d=>xe.escapeArgument(d)),p.push("-ArgumentList",r.join(","))),e.target=xe.encodeCommand(p.join(" ")),e.wait||(s.stdio="ignore")}else{if(o)n=o;else{let p=!Nu||Nu==="/",d=!1;try{await kk.access(Bf,wk.X_OK),d=!0}catch{}n=Gf.versions.electron??(gn==="android"||p||!d)?"xdg-open":Bf}r.length>0&&i.push(...r),e.wait||(s.stdio="ignore",s.detached=!0)}gn==="darwin"&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);let u=Ck.spawn(n,i,s);return e.wait?new Promise((p,d)=>{u.once("error",d),u.once("close",m=>{if(!e.allowNonzeroExitCode&&m!==0){d(new Error(`Exited with code ${m}`));return}p(u)})}):t?new Promise((p,d)=>{u.once("error",d),u.once("spawn",()=>{u.once("close",m=>{if(u.off("error",d),m!==0){d(new Error(`Exited with code ${m}`));return}u.unref(),p(u)})})}):(u.unref(),new Promise((p,d)=>{u.once("error",d),u.once("spawn",()=>{u.off("error",d),p(u)})}))},xk=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a `target`");return wi({...t,target:e})};function Vf(e){if(typeof e=="string"||Array.isArray(e))return e;let{[Rf]:t}=e;if(!t)throw new Error(`${Rf} is not supported`);return t}function Eo({[gn]:e},{wsl:t}={}){if(t&&ot)return Vf(t);if(!e)throw new Error(`${gn} is not supported`);return Vf(e)}var fn={browser:"browser",browserPrivate:"browserPrivate"};Nt(fn,"chrome",()=>Eo({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium","chromium-browser"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));Nt(fn,"brave",()=>Eo({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));Nt(fn,"firefox",()=>Eo({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));Nt(fn,"edge",()=>Eo({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));Nt(fn,"safari",()=>Eo({darwin:"Safari"}));var hn=xk;var Io=[{id:"octocode-skills",name:"Octocode",type:"github",owner:"bgauryy",repo:"octocode-mcp",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Research, planning, code review & documentation",url:"https://github.com/bgauryy/octocode-mcp/tree/main/skills"},{id:"anthropic-skills",name:"Anthropic Official",type:"github",owner:"anthropics",repo:"skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Official Anthropic skills \u2014 artifacts, design & docs",url:"https://github.com/anthropics/skills/tree/main/skills"},{id:"superpowers",name:"Superpowers",type:"github",owner:"obra",repo:"superpowers",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"TDD, debugging, worktrees & disciplined development",url:"https://github.com/obra/superpowers"},{id:"everything-claude-code",name:"Everything Claude Code",type:"github",owner:"affaan-m",repo:"everything-claude-code",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Performance, security, memory & agent harness",url:"https://github.com/affaan-m/everything-claude-code/tree/main/skills"},{id:"composio-skills",name:"Composio Skills",type:"github",owner:"ComposioHQ",repo:"awesome-claude-skills",branch:"master",skillsPath:"",skillPattern:"skill-folders",description:"Brand, canvas, MCP builder, invoicing & testing",url:"https://github.com/ComposioHQ/awesome-claude-skills"},{id:"antigravity-awesome-skills",name:"Antigravity Awesome",type:"github",owner:"sickn33",repo:"antigravity-awesome-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"1,300+ agentic skills across all coding domains",url:"https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills"},{id:"obsidian-skills",name:"Obsidian Skills",type:"github",owner:"kepano",repo:"obsidian-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Markdown editing & Obsidian vault productivity",url:"https://github.com/kepano/obsidian-skills/tree/main/skills"},{id:"planning-with-files",name:"Planning with Files",type:"github",owner:"OthmanAdi",repo:"planning-with-files",branch:"master",skillsPath:"skills",skillPattern:"skill-folders",description:"Manus-style persistent markdown planning workflow",url:"https://github.com/OthmanAdi/planning-with-files/tree/master/skills"},{id:"marketing-skills",name:"Marketing Skills",type:"github",owner:"coreyhaines31",repo:"marketingskills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"SEO, copywriting, CRO, analytics & growth engineering",url:"https://github.com/coreyhaines31/marketingskills/tree/main/skills"},{id:"claude-scientific-skills",name:"Scientific Skills",type:"github",owner:"K-Dense-AI",repo:"claude-scientific-skills",branch:"main",skillsPath:"scientific-skills",skillPattern:"skill-folders",description:"Biopython, astropy, deepchem & scientific computing",url:"https://github.com/K-Dense-AI/claude-scientific-skills"},{id:"dev-browser",name:"Dev Browser",type:"github",owner:"SawyerHood",repo:"dev-browser",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Browser control via Playwright with persistent state",url:"https://github.com/SawyerHood/dev-browser"},{id:"aris-research",name:"ARIS Research",type:"github",owner:"wanshuiyin",repo:"Auto-claude-code-research-in-sleep",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Autonomous ML research \u2014 papers, reviews & experiments",url:"https://github.com/wanshuiyin/Auto-claude-code-research-in-sleep/tree/main/skills"},{id:"buildwithclaude",name:"Build With Claude",type:"github",owner:"davepoon",repo:"buildwithclaude",branch:"main",skillsPath:"commands",skillPattern:"flat-md",description:"170+ commands, agents & skills hub",url:"https://github.com/davepoon/buildwithclaude"},{id:"claude-code-plugins-plus-skills",name:"Plugins + Skills",type:"github",owner:"jeremylongshore",repo:"claude-code-plugins-plus-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"1,300+ skills with tutorials & orchestration",url:"https://github.com/jeremylongshore/claude-code-plugins-plus-skills"},{id:"ui-ux-pro-max",name:"UI/UX Pro Max",type:"github",owner:"nextlevelbuilder",repo:"ui-ux-pro-max-skill",branch:"main",skillsPath:".claude/skills",skillPattern:"skill-folders",description:"UI/UX, brand guidelines, design systems & styling",url:"https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/tree/main/.claude/skills"},{id:"ctf-skills",name:"CTF Skills",type:"github",owner:"ljagiello",repo:"ctf-skills",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Web exploitation, crypto, pwn, reverse & forensics",url:"https://github.com/ljagiello/ctf-skills"},{id:"vltansky-skills",name:"Vltansky Skills",type:"github",owner:"vltansky",repo:"skills",branch:"master",skillsPath:"skills",skillPattern:"skill-folders",description:"QA, interviews, retros, RFC research & code reviews",url:"https://github.com/vltansky/skills/tree/master/skills"},{id:"claude-skills-marketplace",name:"Claude Skills Marketplace",type:"github",owner:"mhattingpete",repo:"claude-skills-marketplace",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Git automation, testing & code review",url:"https://github.com/mhattingpete/claude-skills-marketplace"},{id:"daymade-claude-code-skills",name:"Daymade Skills",type:"github",owner:"daymade",repo:"claude-code-skills",branch:"main",skillsPath:"",skillPattern:"skill-folders",description:"Production-ready development workflows",url:"https://github.com/daymade/claude-code-skills"},{id:"webmaxru-agent-skills",name:"Web AI Skills",type:"github",owner:"webmaxru",repo:"agent-skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Web APIs for Web AI \u2014 auto-updated, manually reviewed",url:"https://github.com/webmaxru/agent-skills/tree/main/skills"},{id:"vercel-labs-skills",name:"Vercel Labs",type:"github",owner:"vercel-labs",repo:"skills",branch:"main",skillsPath:"skills",skillPattern:"skill-folders",description:"Open agent skills ecosystem CLI by Vercel",url:"https://github.com/vercel-labs/skills/tree/main/skills"}];var Hf=new Map,Sk=300*1e3;function Lt(e){return e.type==="local"}async function _k(e){if(e.type==="local")return null;let t=`${e.owner}/${e.repo}`,o=Hf.get(t);if(o&&Date.now()-o.timestamp<Sk)return o.stars;try{let r=`https://api.github.com/repos/${e.owner}/${e.repo}`,n=await fetch(r,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"octocode-cli"}});if(!n.ok)return null;let s=(await n.json()).stargazers_count;return Hf.set(t,{stars:s,timestamp:Date.now()}),s}catch{return null}}async function qf(){let e=new Map,t=Io.map(async o=>{let r=await _k(o);r!==null&&e.set(o.id,r)});return await Promise.all(t),e}import{join as de,resolve as Kf,relative as Pk,isAbsolute as Yf,sep as Ek}from"node:path";import{mkdirSync as Lu,statSync as Ik,readdirSync as Fk,unlinkSync as Ak,rmSync as Tk}from"node:fs";import Jf from"node:os";var Qf=1440*60*1e3;function Bu(){let e=Jf.homedir(),t=process.env.npm_config_cache||de(e,".npm"),o=de(t,"_cacache","octocode-skills"),n=Jf.platform()==="win32"?de(process.env.LOCALAPPDATA||de(e,"AppData","Local"),"octocode","cache","skills"):de(e,".cache","octocode","skills");return z(t)?o:n}function Ok(){let e=Bu();return z(e)||Lu(e,{recursive:!0,mode:448}),e}function Xf(e,t){let o=Kf(e),r=Kf(t),n=Pk(o,r);return n!==".."&&!n.startsWith(`..${Ek}`)&&!Yf(n)}function eh(e){let t=Ok();return de(t,`${e.id}.json`)}function Mk(e){try{if(!ue(e))return!1;let t=Ik(e);return Date.now()-t.mtimeMs<Qf}catch{return!1}}function zk(e){try{let t=eh(e);if(!Mk(t))return null;let o=Tt(t);if(!o)return null;let r=JSON.parse(o);return Date.now()-r.timestamp>Qf?null:r.skills.map(n=>({...n,source:e}))}catch{return null}}function jk(e,t){try{let o=eh(e),r=t.map(({source:i,...s})=>s),n={timestamp:Date.now(),skills:r};bo(o,JSON.stringify(n,null,2))}catch{}}function Uu(e){let t=["PR","API","UI","CLI","MCP","AI"];return e.replace(/\.md$/i,"").replace(/[-_]/g," ").replace(/\b\w/g,o=>o.toUpperCase()).replace(new RegExp(`\\b(${t.join("|")})\\b`,"gi"),o=>o.toUpperCase())}function Nk(e){try{let t=Di(),o=_f(),r=[];for(let n of o){let i=de(t,n),s=de(i,"SKILL.md");if(ue(s)){let c=Tt(s);if(c){let u=Mt(c);r.push({name:n,displayName:Uu(n),description:u?.description||nh(c)||"No description",category:u?.category||"Official",path:n,source:e})}}}return r}catch{return[]}}function Lk(e,t){try{let o=Di(),r=de(o,e.name),n=de(t,e.name);return z(r)?(z(n)&&Tk(n,{recursive:!0,force:!0}),ln(r,n),{success:!0}):{success:!1,error:"Skill not found in bundled source"}}catch(o){return{success:!1,error:o instanceof Error?o.message:"Unknown error"}}}async function th(e){let t=`https://api.github.com/repos/${e.owner}/${e.repo}/git/trees/${e.branch}?recursive=1`,o=await fetch(t,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":"octocode-cli"}});if(!o.ok)throw o.status===403?new Error("GitHub API rate limit exceeded. Try again later."):new Error(`Failed to fetch marketplace: ${o.statusText}`);let r=await o.json();return r.truncated&&console.warn(`[octocode] GitHub tree response was truncated for ${e.owner}/${e.repo}. Some skills may be missing.`),r.tree}var xi=1024*1024;async function Si(e,t){let o=`https://raw.githubusercontent.com/${e.owner}/${e.repo}/${e.branch}/${t}`,r=await fetch(o,{headers:{"User-Agent":"octocode-cli"}});if(!r.ok)throw new Error(`Failed to fetch content: ${r.statusText}`);let n=r.headers?.get?.("Content-Length"),i=n?Number(n):NaN;if(Number.isFinite(i)&&i>xi)throw new Error(`Content too large: ${i} bytes exceeds ${xi} byte limit`);let s=await r.text(),c=Buffer.byteLength(s,"utf8");if(c>xi)throw new Error(`Content too large: ${c} bytes exceeds ${xi} byte limit`);return s}async function Ru(e,t={}){if(Lt(e))return Nk(e);if(!t.skipCache){let n=zk(e);if(n)return n}let o=await th(e),r=[];if(e.skillPattern==="flat-md"){let n=e.skillsPath?`${e.skillsPath}/`:"",s=o.filter(u=>u.type==="blob"&&u.path.startsWith(n)&&u.path.endsWith(".md")&&!u.path.includes("/")==(n==="")&&(n===""||u.path.split("/").length===2)).slice(0,100),c=await Promise.all(s.map(async u=>{try{let p=await Si(e,u.path),d=Mt(p),m=u.path.split("/").pop()||u.path;return{name:m.replace(/\.md$/i,""),displayName:Uu(m),description:d?.description||"No description available",category:d?.category,path:u.path,source:e}}catch{return null}}));r.push(...c.filter(u=>u!==null))}else{let n=e.skillsPath?`${e.skillsPath}/`:"",i=o.filter(c=>c.type==="tree"&&(n===""||c.path.startsWith(n))&&!c.path.includes(".")&&!c.path.startsWith(".")),s=await Promise.all(i.slice(0,50).map(async c=>{let u=`${c.path}/SKILL.md`,p=`${c.path}/README.md`,d=o.some(y=>y.path===u&&y.type==="blob"),m=o.some(y=>y.path===p&&y.type==="blob"),h=d?u:m?p:null;if(!h)return null;try{let y=await Si(e,h),g=Mt(y),D=c.path.split("/").pop()||c.path;return{name:D,displayName:Uu(D),description:g?.description||nh(y)||"No description",category:g?.category,path:c.path,source:e}}catch{return null}}));r.push(...s.filter(c=>c!==null))}return jk(e,r),r}function nh(e){let o=e.replace(/^---[\s\S]*?---\s*/,"").split(`
73
+ `),r="";for(let n of o){let i=n.trim();if(!i){if(r)break;continue}i.startsWith("#")||(r+=(r?" ":"")+i)}return r?r.slice(0,200):null}async function Zu(e,t){try{let o=e.source;if(Lt(o))return Lk(e,t);let r=await th(o),n=de(t,e.name);if(z(n)||Lu(n,{recursive:!0,mode:448}),o.skillPattern==="flat-md"){let i=await Si(o,e.path),s=de(n,"SKILL.md");if(!Xf(n,s))throw new Error("Invalid skill destination path");bo(s,i)}else{let i=`${e.path}/`,s=r.filter(c=>c.type==="blob"&&c.path.startsWith(i));for(let c of s){let u=c.path.slice(i.length);if(!u||Yf(u))throw new Error("Invalid skill file path");let p=de(n,u);if(!Xf(n,p))throw new Error("Invalid skill file path traversal");let d=de(n,u.split("/").slice(0,-1).join("/"));d!==n&&!z(d)&&Lu(d,{recursive:!0,mode:448})}await Promise.all(s.map(async c=>{let u=c.path.slice(i.length),p=de(n,u),d=await Si(o,c.path);bo(p,d)}))}return{success:!0}}catch(o){return{success:!1,error:o instanceof Error?o.message:"Unknown error"}}}function oh(){try{let e=Bu();if(z(e)){let t=Fk(e);for(let o of t)o.endsWith(".json")&&Ak(de(e,o))}}catch{}}function rh(){return Bu()}import Pi from"node:path";var _i=new Set(["octocode-research","octocode-pull-request-reviewer","octocode-researcher"]);async function Ve(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}function Uk(e,t){if(Lt(e))return`${f(e.name)} ${a("cyan","bundled")} - ${l(e.description)}`;let o=t?` ${t.toLocaleString()}`:"";return`${f(e.name)}${a("yellow",o)} - ${l(e.description)}`}function Bk(e,t){let o=t?a("green","\u2705 "):"",r=_i.has(e.name)?a("yellow"," *"):"",n=e.description.slice(0,50),i=e.description.length>50?"...":"";return`${o}${e.displayName}${r} ${l(n)}${l(i)}`}function vn(e){let t=we();return z(Pi.join(t,e))}async function Rk(e){console.log(),console.log(` ${f("Select a marketplace to browse:")}`),console.log();let t=Io.filter(c=>Lt(c)),r=[...Io.filter(c=>!Lt(c))].sort((c,u)=>(e.get(u.id)??0)-(e.get(c.id)??0)),n=[...t,...r],i=[];for(let c of n)i.push({name:Uk(c,e.get(c.id)),value:c,description:l(c.url)});return i.push(new F),i.push({name:`${a("dim","- Back to skills menu")}`,value:"back"}),await A({message:"",choices:i,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:c=>a("magenta",c)}}})}async function ih(e,t){console.log(),console.log(` ${f(e.name)} - ${t.length} skills available`),console.log(` ${l(e.url)}`),console.log();let r=[...t].sort((s,c)=>{let u=vn(s.name),p=vn(c.name);if(u!==p)return u?-1:1;let d=_i.has(s.name),m=_i.has(c.name);return d!==m?d?-1:1:s.displayName.localeCompare(c.displayName)}).map(s=>{let c=vn(s.name);return{name:Bk(s,c),value:s,description:s.category?`[${s.category}]`:void 0}}),n={name:`${a("dim","- Back to marketplaces")}`,value:"back"};return await yo({message:`Type to filter skills (${t.length} available)`,source:s=>{if(!s||!s.trim())return[...r,n];let c=s.toLowerCase();return[...r.filter(p=>{if(typeof p.value=="string")return!1;let d=p.value;return d.name.toLowerCase().includes(c)||d.displayName.toLowerCase().includes(c)||d.description.toLowerCase().includes(c)||d.category?.toLowerCase().includes(c)}),n]},pageSize:20,theme:{prefix:" ",style:{highlight:s=>a("magenta",s)}}})}async function sh(e){let t=vn(e.name),o=we(),r=_i.has(e.name)?a("yellow"," recommended"):"";console.log(),console.log(` ${f(e.displayName)}${r}`),console.log(` ${l(e.description)}`),console.log(),e.category&&(console.log(` ${f("Category:")} ${e.category}`),console.log()),console.log(` ${f("Source:")} ${e.source.name}`),console.log(` ${l(e.source.url)}`),console.log(),console.log(` ${f("Install path:")}`),console.log(` ${a("cyan",Pi.join(o,e.name))}`),console.log();let n=[{name:t?`${a("yellow","\u2B06")} Reinstall skill`:`${a("green","\u2705")} Install skill`,value:"install"}];return t&&n.push({name:`${a("red","Delete")} Delete skill`,value:"delete"}),n.push(new F),n.push({name:`${a("dim","- Back")}`,value:"back"}),await A({message:t?"Choose an action:":"Install this skill?",choices:n,loop:!1,theme:{prefix:" ",style:{highlight:s=>a("magenta",s),message:s=>f(s)}}})}async function ah(e){let t=we();console.log();let o=new L(`Installing ${e.displayName}...`).start(),r=await Zu(e,t);return r.success?(o.succeed(`Installed ${e.displayName}!`),console.log(),console.log(` ${a("green","\u2705")} Skill installed successfully`),console.log(` ${l("Location:")} ${a("cyan",Pi.join(t,e.name))}`),console.log(),console.log(` ${f("The skill is now available in your AI client!")}`)):(o.fail(`Failed to install ${e.displayName}`),console.log(),console.log(` ${a("red","X")} Installation failed: ${r.error}`)),console.log(),await Ve(),r.success}async function ch(e){let t=we(),o=Pi.join(t,e.name);if(console.log(),await A({message:"Delete this installed skill?",choices:[{name:`${a("red","Delete")} Yes, delete skill`,value:"yes"},new F,{name:`${a("dim","- Cancel")}`,value:"no"}],loop:!1,theme:{prefix:" ",style:{highlight:i=>a("magenta",i),message:i=>f(i)}}})!=="yes")return!1;console.log();let n=new L(`Deleting ${e.displayName}...`).start();return un(o)?(n.succeed(`Deleted ${e.displayName}`),console.log(),console.log(` ${a("green","\u2705")} Skill deleted successfully`),console.log(),await Ve(),!0):(n.fail(`Failed to delete ${e.displayName}`),console.log(),console.log(` ${a("red","X")} Could not delete skill directory`),console.log(` ${l("Path:")} ${a("cyan",o)}`),console.log(),await Ve(),!1)}async function Zk(e,t){console.log(),console.log(` ${f("Octocode Skills")}`),console.log(` ${l(`${e} skills available`)}`),console.log();let o=[];return t>0?(o.push({name:`${a("green","Fast")} Install All Skills (${t} to install)`,value:"install-all",description:l("One-click install of all Octocode skills")}),o.push({name:`${a("cyan","List")} Browse Skills Individually`,value:"browse",description:l("View details and install one by one")})):o.push({name:`${a("green","\u2705")} All skills installed \u2014 Browse to reinstall or view details`,value:"browse",description:l("View details and reinstall individually")}),o.push(new F),o.push({name:`${a("dim","- Back")}`,value:"back"}),await A({message:"",choices:o,loop:!1,theme:{prefix:" ",style:{highlight:n=>a("magenta",n)}}})}async function Vk(e){let t=we(),o=e.filter(c=>!vn(c.name));if(o.length===0){console.log(),console.log(` ${a("green","\u2705")} All skills are already installed!`),console.log(),await Ve();return}console.log(),console.log(` ${f("Installing")} ${o.length} ${f("skills...")}`),console.log();let r=new L(`Installing ${o.length} skills...`).start(),n=0,i=0,s=[];for(let c of o){r.update(`Installing ${c.displayName}... (${n+i+1}/${o.length})`);let u=await Zu(c,t);u.success?n++:(i++,s.push({skill:c.displayName,error:u.error||"Unknown error"}))}if(i===0?r.succeed(`All ${n} skills installed successfully!`):r.warn(`Installed ${n} skills, ${i} failed`),console.log(),n>0&&(console.log(` ${a("green","\u2705")} Successfully installed ${n} skill(s)`),console.log(` ${l("Location:")} ${a("cyan",t)}`)),s.length>0){console.log(),console.log(` ${a("red","X")} Failed to install:`);for(let{skill:c,error:u}of s)console.log(` ${a("red","\u2022")} ${c}: ${l(u)}`)}console.log(),console.log(` ${f("Skills are now available in your AI client!")}`),console.log(),await Ve()}async function lh(){console.log(),console.log(` ${a("yellow","WARN")} ${l("Community list \u2022 Skills install on your behalf")}`);let e=new L("Fetching marketplace info...").start(),t;try{t=await qf(),e.succeed("Loaded marketplace info")}catch{e.fail("Could not fetch stars"),t=new Map}let o=!0;for(;o;){let r=await Rk(t);if(r==="back"){o=!1;continue}console.log();let n=new L(`Loading skills from ${r.name}...`).start(),i;try{i=await Ru(r),n.stop()}catch(c){n.fail("Failed to load skills"),console.log(),console.log(` ${a("red","X")} ${c instanceof Error?c.message:"Unknown error"}`),console.log(),await Ve();continue}if(i.length===0){console.log(),console.log(` ${a("yellow","WARN")} No skills found in this marketplace`),console.log(),await Ve();continue}let s=!0;for(;s;){let c=await ih(r,i);if(c==="back"){s=!1;continue}let u=await sh(c);u==="install"?await ah(c):u==="delete"&&await ch(c)}}}async function uh(){let e=Io.find(n=>n.id==="octocode-skills");if(!e){console.log(),console.log(` ${a("red","X")} Octocode Skills source not found`),console.log(),await Ve();return}console.log();let t=new L("Loading Octocode Skills...").start(),o;try{o=await Ru(e),t.stop()}catch(n){t.fail("Failed to load skills"),console.log(),console.log(` ${a("red","X")} ${n instanceof Error?n.message:"Unknown error"}`),console.log(),await Ve();return}if(o.length===0){console.log(),console.log(` ${a("yellow","WARN")} No skills found`),console.log(),await Ve();return}let r=!0;for(;r;){let n=o.filter(s=>!vn(s.name)).length;switch(await Zk(o.length,n)){case"install-all":await Vk(o),r=!1;break;case"browse":{let s=!0;for(;s;){let c=await ih(e,o);if(c==="back"){s=!1;continue}let u=await sh(c);u==="install"?await ah(c):u==="delete"&&await ch(c)}break}default:r=!1;break}}}var Gk=new Set(["octocode-research","octocode-pull-request-reviewer","octocode-researcher"]);async function Fo(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}function ph(){let e=we(),t=jt();if(!z(e))return[];let o=Be(e).filter(n=>!n.startsWith(".")),r=[];for(let n of o){let i=yn.join(e,n),s=yn.join(i,"SKILL.md"),c=n.startsWith("octocode-")&&z(t)&&z(yn.join(t,n)),u=Gk.has(n);if(ue(s)){let p=Tt(s);if(p){let d=Mt(p);if(d?.name&&d.description){r.push({name:d.name,description:d.description,folder:n,path:i,isBundled:c,isRecommended:u});continue}}}r.push({name:Hk(n),description:"No description available",folder:n,path:i,isBundled:c,isRecommended:u})}return r.sort((n,i)=>n.isRecommended!==i.isRecommended?n.isRecommended?-1:1:n.name.localeCompare(i.name)),r}function dh(){let e=jt(),t=we();if(!z(e))return{srcDir:e,destDir:t,skillsStatus:[],notInstalled:[],sourceExists:!1};let r=Be(e).filter(i=>!i.startsWith(".")).map(i=>({name:i,installed:z(yn.join(t,i)),srcPath:yn.join(e,i),destPath:yn.join(t,i)})),n=r.filter(i=>!i.installed);return{srcDir:e,destDir:t,skillsStatus:r,notInstalled:n,sourceExists:!0}}async function Wk(e){let t=[];return e>0&&t.push({name:`- Manage installed skills ${l(`(${e})`)}`,value:"manage",description:"View, remove, or inspect individual skills"}),t.push({name:"- Browse Marketplace",value:"marketplace",description:"Community skills \u2022 installs on your behalf"}),t.push(new F),t.push({name:`${a("dim","- Back to main menu")}`,value:"back"}),await A({message:"",choices:t,pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:r=>a("magenta",r)}}})}function Hk(e){let t=["PR","API","UI","CLI","MCP","AI"];return e.replace(/^octocode-/,"").split("-").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ").replace(new RegExp(`\\b(${t.join("|")})\\b`,"gi"),r=>r.toUpperCase())}async function qk(e){console.log(),console.log(` ${f("Installed Skills")} ${l(`(${e.length} total)`)}`),console.log(` ${l("Select a skill to manage")}`),console.log();let t=[];for(let r of e){let n=r.isRecommended?a("yellow","\u2605 "):"",i=r.isBundled?a("cyan"," [bundled]"):a("magenta"," [community]"),s=r.description.slice(0,40),c=r.description.length>40?"...":"";t.push({name:`${n}${r.name}${i} - ${l(s)}${l(c)}`,value:r})}return t.push(new F),t.push({name:`${a("dim","- Back to skills menu")}`,value:"back"}),await A({message:"",choices:t,pageSize:15,loop:!1,theme:{prefix:" ",style:{highlight:r=>a("magenta",r)}}})}async function Kk(e){let t=e.isRecommended?a("yellow","recommended "):"",o=e.isBundled?a("cyan","[bundled]"):a("magenta","[community]");console.log(),console.log(` ${f(e.name)} ${t}${o}`),console.log(` ${l(e.description)}`),console.log(` ${l(e.path)}`),console.log();let r=[{name:`${a("red","Delete")} Remove this skill`,value:"remove"},{name:"- Open skill location",value:"view"},new F,{name:`${a("dim","- Back")}`,value:"back"}];return await A({message:"",choices:r,loop:!1,theme:{prefix:" ",style:{highlight:i=>a("magenta",i)}}})}async function Jk(e){console.log(),console.log(` ${a("cyan","Path")} Opening ${f(e.name)} location...`),console.log(` ${l(e.path)}`),console.log();try{await hn(e.path),console.log(` ${a("green","\u2705")} Opened in file explorer`)}catch{console.log(` ${a("yellow","!")} Could not open location automatically`),console.log(` ${l("Path:")} ${a("cyan",e.path)}`)}console.log()}async function Xk(e){console.log(),console.log(` ${a("yellow","WARN")} You are about to remove:`),console.log(` ${f(e.name)}`),console.log(` ${l(e.path)}`),console.log();let t=[{name:`${a("red","Delete")} Yes, remove this skill`,value:!0},new F,{name:`${a("dim","- Cancel")}`,value:!1}];if(!await A({message:"Confirm removal?",choices:t,loop:!1,theme:{prefix:" ",style:{highlight:n=>a("magenta",n),message:n=>f(n)}}}))return!1;console.log();let r=new L(`Removing ${e.name}...`).start();return un(e.path)?(r.succeed(`Removed ${e.name}`),console.log(),console.log(` ${a("green","\u2705")} Skill removed successfully`),!0):(r.fail(`Failed to remove ${e.name}`),console.log(),console.log(` ${a("red","X")} Could not remove skill directory`),!1)}async function Yk(){let e=!0;for(;e;){let t=ph();if(t.length===0){console.log(),console.log(` ${a("yellow","INFO")} No skills installed`),console.log(` ${l("Browse the marketplace to install skills")}`),console.log(),await Fo();return}let o=await qk(t);if(o==="back"){e=!1;continue}let r=!0;for(;r;)switch(await Kk(o)){case"remove":{await Xk(o)&&(await Fo(),r=!1);break}case"view":await Jk(o),await Fo();break;default:r=!1;break}}}async function mh(){await oe();let e=dh();if(!e.sourceExists){console.log(` ${a("yellow","WARN")} Skills source directory not found.`),console.log(` ${l("This may happen if running from source.")}`),console.log(),await Fo();return}if(e.skillsStatus.length===0){console.log(` ${l("No skills available.")}`),console.log(),await Fo();return}let t=!0;for(;t;){e=dh();let r=ph().length;switch(await Wk(r)){case"manage":await Yk();break;case"marketplace":await lh();break;default:t=!1;break}}}async function fh(e,t){let o=Qk(e,t.auth);if(o)return o;let{data:r}=await ym({clientType:e.clientType,clientId:e.clientId,request:t.request||e.request,scopes:t.auth.scopes||e.scopes});await e.onVerification(r);let n=await Vu(t.request||e.request,e.clientId,e.clientType,r);return e.authentication=n,n}function Qk(e,t){if(t.refresh===!0||!e.authentication)return!1;if(e.clientType==="github-app")return e.authentication;let o=e.authentication,r=("scopes"in t&&t.scopes||e.scopes).join(" "),n=o.scopes.join(" ");return r===n?o:!1}async function gh(e){await new Promise(t=>setTimeout(t,e*1e3))}async function Vu(e,t,o,r){try{let n={clientId:t,request:e,code:r.device_code},{authentication:i}=o==="oauth-app"?await Sl({...n,clientType:"oauth-app"}):await Sl({...n,clientType:"github-app"});return{type:"token",tokenType:"oauth",...i}}catch(n){if(!n.response)throw n;let i=n.response.data.error;if(i==="authorization_pending")return await gh(r.interval),Vu(e,t,o,r);if(i==="slow_down")return await gh(r.interval+7),Vu(e,t,o,r);throw n}}async function ew(e,t){return fh(e,{auth:t})}async function tw(e,t,o,r){let n=t.endpoint.merge(o,r);if(/\/login\/(oauth\/access_token|device\/code)$/.test(n.url))return t(n);let{token:i}=await fh(e,{request:t,auth:{type:"oauth"}});return n.headers.authorization=`token ${i}`,t(n)}var nw="0.0.0-development";function hh(e){let t=e.request||le.defaults({headers:{"user-agent":`octokit-auth-oauth-device.js/${nw} ${Qt()}`}}),{request:o=t,...r}=e,n=e.clientType==="github-app"?{...r,clientType:"github-app",request:o}:{...r,clientType:"oauth-app",request:o,scopes:e.scopes||[]};if(!e.clientId)throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');if(!e.onVerification)throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');return Object.assign(ew.bind(null,n),{hook:tw.bind(null,n)})}var vh="https://cli.github.com/";function yh(){return yg("gh")}function Ut(){if(!yh())return{installed:!1,authenticated:!1,error:"GitHub CLI (gh) is not installed"};let e=At("gh",["auth","status"]);if(e.success){let t=e.stdout.match(/Logged in to \S+.*account\s+(\S+)/i);return{installed:!0,authenticated:!0,username:t?t[1]:void 0}}return{installed:!0,authenticated:!1,error:e.stderr||"Not authenticated"}}function bh(e){let t=["auth","logout"];return e&&t.push("--hostname",e),bg("gh",t)}function Ao(e){if(!yh())return null;let t=["auth","token"];e&&t.push("--hostname",e);let o=At("gh",t);return o.success&&o.stdout.trim()?o.stdout.trim():null}var Gu="178c6fc778ccc68e1d6a",rw=["repo","read:org","gist"],dt="github.com";function Wu(e){return e==="github.com"||e===dt?"https://api.github.com":`https://${e}/api/v3`}async function iw(e,t){let o=Wu(t);return(await le("GET /user",{headers:{authorization:`token ${e}`},baseUrl:o})).data.login}async function Ei(e={}){let{hostname:t=dt,scopes:o=rw,gitProtocol:r="https",clientId:n=Gu,onVerification:i,openBrowser:s=!0}=e;try{let u=await hh({clientType:"oauth-app",clientId:n,scopes:o,onVerification:async h=>{if(i&&i(h),s)try{await hn(h.verification_uri)}catch{console.log(),console.log(" \u26A0 Could not open browser automatically."),console.log(" \u2192 Please open this URL manually:"),console.log(` ${h.verification_uri}`),console.log()}},request:le.defaults({baseUrl:Wu(t)})})({type:"oauth"}),p=await iw(u.token,t),d={token:u.token,tokenType:"oauth",scopes:"scopes"in u?u.scopes:void 0};"refreshToken"in u&&u.refreshToken&&(d.refreshToken=u.refreshToken,d.expiresAt="expiresAt"in u?u.expiresAt:void 0,d.refreshTokenExpiresAt="refreshTokenExpiresAt"in u?u.refreshTokenExpiresAt:void 0);let m={hostname:t,username:p,token:d,gitProtocol:r,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};return await Wr(m),{success:!0,username:p,hostname:t}}catch(c){return{success:!1,error:c instanceof Error?c.message:"Authentication failed"}}}async function bn(e=dt,t){let o=await et(e);if(!o)return{success:!1,error:`Not logged in to ${e}`};if(t?.clientSecret)try{await Dm({clientType:"oauth-app",clientId:Gu,clientSecret:t.clientSecret,token:o.token.token,request:le.defaults({baseUrl:Wu(e)})})}catch(r){console.error(`[github-oauth] Token revocation failed: ${r instanceof Error?r.message:String(r)}`)}return await Al(e),{success:!0}}function Dn(e=dt){if(nn()){let r=co();return{authenticated:!0,hostname:e,username:void 0,tokenSource:"env",envTokenSource:r??void 0}}let t=Fl(e);if(t){let r=kt(t);return{authenticated:!r,hostname:t.hostname,username:t.username,tokenExpired:r,tokenSource:"octocode"}}let o=Ut();return o.authenticated?{authenticated:!0,hostname:e,username:o.username,tokenSource:"gh-cli"}:{authenticated:!1,tokenSource:"none"}}async function To(e=dt){if(nn()){let r=co();return{authenticated:!0,hostname:e,username:void 0,tokenSource:"env",envTokenSource:r??void 0}}let t=await et(e);if(t){let r=kt(t);return{authenticated:!r,hostname:t.hostname,username:t.username,tokenExpired:r,tokenSource:"octocode"}}let o=Ut();return o.authenticated?{authenticated:!0,hostname:e,username:o.username,tokenSource:"gh-cli"}:{authenticated:!1,tokenSource:"none"}}async function Hu(e=dt){let t=await Hr(e,Gu);return t.token?{token:t.token,source:"octocode",username:t.username}:{token:null,source:"none"}}function qu(e=dt){let t=Ao(e);if(t){let o=Ut();return{token:t,source:"gh-cli",username:o.username}}return{token:null,source:"none"}}async function Dh(e=dt,t="auto"){if(t==="octocode")return Hu(e);if(t==="gh")return qu(e);let o=await Il({hostname:e,getGhCliToken:Ao});if(o?.token){let r=o.source==="gh-cli"?"gh-cli":o.source?.startsWith("env:")?"env":"octocode";return{token:o.token,source:r,username:o.username,envSource:o.source?.startsWith("env:")?o.source:void 0}}return{token:null,source:"none"}}function Oo(){return Tl()}function $h(e,t){switch(e){case"env":return t??"env:GITHUB_TOKEN";case"gh-cli":return"gh-cli";case"octocode":return"octocode-storage";default:return"none"}}import Ku from"node:path";function sw(){let e=pi(),t=e.filter(r=>r.octocodeInstalled),o=e.filter(r=>r.configExists&&!r.octocodeInstalled);return{installedClients:t,availableClients:o,installedCount:t.length,availableCount:o.length,isInstalled:t.length>0,hasMoreToInstall:o.length>0}}function aw(){let e=jt(),t=we(),o=z(t)?Be(t).filter(c=>!c.startsWith(".")).length:0;if(!z(e))return{sourceExists:!1,destDir:t,skills:[],installedCount:0,notInstalledCount:0,totalInstalledCount:o,allInstalled:!1,hasSkills:!1};let n=Be(e).filter(c=>!c.startsWith(".")).map(c=>({name:c,installed:z(Ku.join(t,c)),srcPath:Ku.join(e,c),destPath:Ku.join(t,c)})),i=n.filter(c=>c.installed).length,s=n.filter(c=>!c.installed).length;return{sourceExists:!0,destDir:t,skills:n,installedCount:i,notInstalledCount:s,totalInstalledCount:o,allInstalled:s===0&&n.length>0,hasSkills:n.length>0}}async function Mo(){return{octocode:sw(),skills:aw(),currentClient:dn(),githubAuth:await To()}}async function Ii(){console.log(),await ie({message:l("Press Enter to continue..."),default:""})}function cw(e){return e.map(t=>Z[t.client]?.name||t.client).join(", ")}function lw(e){if(e.length===0){console.log(` ${l("No IDEs configured yet")}`);return}console.log(` ${l("Installed on:")}`);for(let t of e){let o=Z[t.client]?.name||t.client;console.log(` ${l("\u2022")} ${l(o)} ${l("->")} ${a("cyan",t.configPath)}`)}}function uw(e){return!e.sourceExists||!e.hasSkills?{name:`${l("- Manage System Skills")}`,value:"skills",description:l("Not available \u2014 no skill sources found")}:e.allInstalled?{name:`- Manage System Skills ${a("green","\u2705")}`,value:"skills",description:`${e.totalInstalledCount} installed \u2022 Research, PR Review & more`}:e.totalInstalledCount>0?{name:"- Manage System Skills",value:"skills",description:`${e.totalInstalledCount}/${e.skills.length} installed \u2022 Get more skills!`}:{name:`- ${f("Manage System Skills")} ${a("cyan","[NEW]")}`,value:"skills",description:"Install skills for AI-powered coding workflows"}}function dw(e){let t=e.skills.filter(o=>o.name.startsWith("octocode-")&&o.installed).length;return t>0?{name:`- Octocode Skills ${a("green","\u2705")}`,value:"octocode-skills",description:`${t} installed \u2022 Research, planning & review`}:{name:"- Octocode Skills",value:"octocode-skills",description:"Install AI-powered research, planning & review skills"}}function pw(e){switch(e.tokenSource){case"gh-cli":return"gh CLI";case"env":return e.envTokenSource?`env (${e.envTokenSource.replace("env:","")})`:"env var";case"octocode":return"Octocode";default:return"unknown"}}function mw(e){if(e.authenticated){let t=pw(e),o=e.username?`@${e.username}`:"",r=o?`${o} `:"";return{name:`- Manage Auth ${a("green","\u2705")}`,value:"auth",description:`${r}via ${t}`}}return{name:`- ${f("Manage Auth")} ${a("red","[Required]")}`,value:"auth",description:"Sign in to access GitHub"}}function gw(e){let t=[];if(e.octocode.isInstalled){let o=e.octocode.installedCount===1?"client":"clients";t.push(`${a("green","\u25CF")} ${e.octocode.installedCount} ${o}`)}else t.push(`${a("yellow","\u25CB")} Not installed`);return e.skills.totalInstalledCount>0?t.push(`${a("green","\u25CF")} ${e.skills.totalInstalledCount} skills`):e.skills.sourceExists&&e.skills.hasSkills&&t.push(`${a("yellow","\u25CB")} ${e.skills.skills.length} skills`),t.join(l(" \u2502 "))}function fw(e){if(e.octocode.isInstalled){let t=e.octocode.installedCount===1?"IDE":"IDEs";return e.githubAuth.authenticated?{name:`- Octocode MCP ${a("green","\u2705")}`,value:"octocode",description:`Configure Octocode MCP - ${e.octocode.installedCount} ${t} configured`}:{name:`- Octocode MCP ${a("red","[X]")}`,value:"octocode",description:`Configure Octocode MCP - ${e.octocode.installedCount} ${t} configured`}}return{name:`- ${f("Octocode Configuration")}`,value:"octocode",description:"Configure Octocode MCP - 0 IDEs configured"}}function hw(e){e.githubAuth.authenticated?e.octocode.isInstalled&&e.skills.totalInstalledCount===0&&(console.log(),console.log(` ${a("cyan","Tip:")} ${l("Boost your AI coding:")} Install ${a("magenta","Skills")} for research, PR review & more!`)):(console.log(),console.log(` ${a("yellow","Warning:")} ${f("Auth required!")} Run ${a("cyan","Manage Auth")} to access GitHub repos`))}async function vw(e){console.log(),console.log(` ${l("Status:")} ${gw(e)}`),hw(e);let t=[];return t.push(fw(e)),t.push(dw(e.skills)),t.push(uw(e.skills)),t.push(mw(e.githubAuth)),t.push({name:"- Manage System MCP",value:"mcp-config",description:"Add, sync and configure MCP across all IDEs"}),t.push(new F),t.push({name:l("Exit"),value:"exit"}),console.log(),await Ft({message:"What would you like to do?",choices:t,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:r=>a("magenta",r),message:r=>f(r)}}})}async function yw(e){let t=[];if(e.octocode.isInstalled){if(e.octocode.hasMoreToInstall){let r=cw(e.octocode.availableClients);t.push({name:"- Add Octocode",value:"install",description:r})}}else t.push({name:`- ${f("Install")} ${a("red","[X]")}`,value:"install",description:"Setup for Cursor, Claude, Windsurf..."});return e.octocode.isInstalled&&t.push({name:"- Configure Octocode",value:"configure",description:"Server options & preferences"}),t.push(new F),t.push({name:`${a("dim","- Back to main menu")}`,value:"back"}),await Ft({message:"",choices:t,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:r=>a("magenta",r)}}})}async function bw(){await oe();let e=await Mo();console.log(),lw(e.octocode.installedClients);let t=!0,o=!0;for(;t;){if(o)o=!1;else{let n=new L(" Refreshing...").start();e=await Mo(),n.clear()}switch(await yw(e)){case"install":await hu(),console.log();break;case"configure":await Hg(),console.log();break;default:t=!1;break}}}async function Dw(){let e=[];return e.push({name:"- Show MCP details",value:"inspect",description:"View and manage configured MCP servers"}),e.push({name:"- Sync Configurations",value:"sync",description:"Sync MCP configs across all IDEs"}),e.push({name:"- MCP Marketplace",value:"marketplace",description:"Browse and install community MCP servers"}),e.push(new F),e.push({name:`${a("dim","- Back to main menu")}`,value:"back"}),await Ft({message:"",choices:e,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:o=>a("magenta",o)}}})}async function $w(){await oe(),console.log();let e=!0;for(;e;)switch(await Dw()){case"inspect":await yu();break;case"sync":await wu(),console.log();break;case"marketplace":await $u(),console.log();break;default:e=!1;break}}async function Cw(e){let t=[],o=e.tokenSource==="env",r=Ao(),n=Ut(),i=await et(),s=!!r,c=!!i,u=nn();if(o&&u){let d=e.envTokenSource?.replace("env:","")||"environment variable";t.push(new F(` ${a("green","\u2705")} Using ${a("cyan",d)} ${l("(takes priority)")}`)),t.push(new F)}if(s){let d=n.username?` (@${n.username})`:"";t.push({name:`- Delete gh CLI token${d}`,value:"gh-logout",description:"Opens gh auth logout"})}if(c){let d=i.username?` (@${i.username})`:"";t.push({name:`- Delete Octocode token${d}`,value:"logout",description:"Remove from file"})}return c||t.push({name:`- Sign In via Octocode ${a("green","(Recommended)")}`,value:"login",description:"Quick browser sign in"}),s||t.push({name:"- Sign In via gh CLI",value:"gh-guidance",description:n.installed?"Use existing GitHub CLI":"GitHub CLI not installed"}),t.push(new F),t.push({name:`${a("dim","- Back")}`,value:"back"}),await Ft({message:"",choices:t,pageSize:12,loop:!1,theme:{prefix:" ",style:{highlight:d=>a("magenta",d)}}})}async function kw(){console.log(),console.log(a("blue","\u2501".repeat(66))),console.log(` ${f("GitHub Authentication")}`),console.log(a("blue","\u2501".repeat(66))),console.log(),console.log(` ${l("This will open your browser to authenticate with GitHub.")}`),console.log();let e=!1,t=null,o=new L("Connecting to GitHub...").start(),r=await Ei({onVerification:n=>{o.stop(),e=!0,console.log(),console.log(a("yellow"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","!")} Your one-time code: ${f(a("cyan",n.user_code))}`+" ".repeat(24-n.user_code.length)+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${f("1.")} Copy the code above`),console.log(` ${f("2.")} ${f("Press Enter")} to open ${a("cyan",n.verification_uri)}`),console.log(` ${f("3.")} Paste the code in your browser`),console.log(),t=new L(`Waiting for browser authentication... ${l("(typically 10-30 seconds)")}`).start()}});return t&&t.stop(),e||o.stop(),console.log(),r.success?(console.log(a("green"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(a("green"," \u2502 ")+`${a("green","\u2705")} ${f("Authentication successful!")}`+" ".repeat(22)+a("green","\u2502")),console.log(a("green"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${a("green","\u2705")} Logged in as ${a("cyan","@"+(r.username||"unknown"))}`),console.log(` ${l("Credentials stored in:")} ${Oo()}`),console.log(),console.log(` ${a("cyan","Tip:")} ${f("What's next?")}`),console.log(` ${l("\u2022")} Install ${a("magenta","Skills")} for AI-powered research & PR reviews`),console.log(` ${l("\u2022")} Use ${a("cyan","/research")} prompt to explore any GitHub repo`),console.log(` ${l("\u2022")} Add ${a("cyan","AGENTS.md")} to your project for better AI context`)):(console.log(a("red"," \u250C"+"\u2500".repeat(50)+"\u2510")),console.log(a("red"," \u2502 ")+`${a("red","X")} ${f("Authentication failed")}`+" ".repeat(27)+a("red","\u2502")),console.log(a("red"," \u2514"+"\u2500".repeat(50)+"\u2518")),console.log(),console.log(` ${a("red","Error:")} ${r.error||"Unknown error"}`),console.log(),console.log(` ${f("Troubleshooting:")}`),console.log(` ${l("\u2022")} Make sure you copied the code correctly`),console.log(` ${l("\u2022")} Check your browser didn't block the popup`),console.log(` ${l("\u2022")} Try running ${a("cyan","octocode login")} again`)),console.log(),await Ii(),r.success}async function ww(){let e=await To();console.log(),console.log(` ${f("Sign Out")}`),console.log(` ${l("Signed in as:")} ${a("cyan","@"+(e.username||"unknown"))}`),console.log();let t=await bn();if(t.success){console.log(` ${a("green","\u2705")} Signed out successfully`);let o=Ut();o.authenticated&&console.log(` ${l("Tip:")} You can still use gh CLI (@${o.username||"unknown"})`)}else console.log(` ${a("red","X")} Sign out failed: ${t.error||"Unknown error"}`);return console.log(),await Ii(),t.success}async function xw(){let e="https://cli.github.com/";console.log(),console.log(` ${f("Setup Instructions:")}`),console.log(),console.log(" 1. Install GitHub CLI from:"),console.log(` ${a("cyan",e)}`),console.log(),console.log(" 2. Run the following command to authenticate:"),console.log(` ${a("cyan","gh auth login")}`),console.log(),console.log(` ${l("Once authenticated, octocode will automatically")}`),console.log(` ${l("use your gh CLI token.")}`),console.log();let t=await Ft({message:"",choices:[{name:"- Open GitHub CLI website",value:"open-site"},new F,{name:`${a("dim","- Back")}`,value:"back"}],pageSize:10,loop:!1,theme:{prefix:" ",style:{highlight:o=>a("cyan",o),message:o=>o}}});if(t!=="back"&&t==="open-site"){try{await hn(e),console.log(),console.log(` ${a("green","\u2705")} Opened ${a("cyan",e)} in browser`)}catch{console.log(),console.log(` ${a("yellow","!")} Could not open browser automatically`),console.log(` ${l("Please visit:")} ${a("cyan",e)}`)}console.log(),await Ii()}}function Sw(e){switch(e.tokenSource){case"gh-cli":return"gh CLI";case"env":return e.envTokenSource?`${e.envTokenSource.replace("env:","")} env var`:"environment variable";case"octocode":return"file";default:return"unknown"}}function _w(e){if(console.log(` ${f("GitHub Authentication")}`),console.log(),e.authenticated){let t=Sw(e);if(e.tokenSource==="env"){let o=e.envTokenSource?e.envTokenSource.replace("env:",""):"environment variable";console.log(` ${a("green","\u2705")} Using ${a("cyan",o)} ${l("(token configured)")}`)}else console.log(` ${a("green","\u2705")} Signed in as ${a("cyan","@"+(e.username||"unknown"))} ${l(`via ${t}`)}`);e.tokenExpired&&console.log(` ${a("yellow","Warning:")} Session expired - please sign in again`),console.log(),console.log(` ${a("green","\u2705")} ${l("Ready to access GitHub repositories!")}`)}else console.log(a("yellow"," \u250C"+"\u2500".repeat(56)+"\u2510")),console.log(a("yellow"," \u2502 ")+`${a("yellow","Warning:")} ${f("Authentication Required")}`+" ".repeat(31)+a("yellow","\u2502")),console.log(a("yellow"," \u2514"+"\u2500".repeat(56)+"\u2518")),console.log(),console.log(` ${l("Without auth, Octocode cannot:")}`),console.log(` ${a("red","X")} Access private repositories`),console.log(` ${a("red","X")} Search code in your organization`),console.log(` ${a("red","X")} Provide full GitHub research capabilities`),console.log(),console.log(` ${a("cyan","->")} Select ${a("green",'"Sign In via Octocode"')} below to authenticate`);console.log()}async function Pw(){await oe(),console.log();let e=!0;for(;e;){let t=await To();switch(_w(t),await Cw(t)){case"login":{let r=await kw();console.log(),r&&(e=!1);break}case"gh-guidance":await xw();break;case"logout":await ww(),console.log();break;case"gh-logout":{if(await Ft({message:"Sign out of gh CLI?",choices:[{name:"Yes, sign out",value:"yes"},{name:"No, cancel",value:"no"}],theme:{prefix:" ",style:{highlight:i=>a("red",i)}}})!=="yes")break;console.log(),console.log(` ${l("Opening gh auth logout...")}`),console.log(),bh().success?(console.log(),console.log(` ${a("green","\u2705")} Signed out of gh CLI`)):(console.log(),console.log(` ${a("yellow","!")} Sign out was cancelled`)),console.log(),await Ii();break}default:e=!1;break}}}async function Ew(e){switch(e){case"octocode":return await bw(),!0;case"octocode-skills":return await uh(),!0;case"skills":return await mh(),!0;case"auth":return await Pw(),!0;case"mcp-config":return await $w(),!0;case"exit":return ai(),!1;default:return!0}}function Iw(){console.log(` ${f("Environment")}`)}async function Fw(){Iw();let e=await Co();ko(e)&&(console.log(),console.log(` ${l("Tip:")} ${l("Run")} ${a("cyan","npx node-doctor")} ${l("for diagnostics")}`))}async function Ch(){let e=!0,t=!0;for(;t;){let o;if(e)o=await Mo();else{let n=new L(" Loading...").start();o=await Mo(),n.clear()}e||(qr(),si(),await Fw()),e=!1;let r=await vw(o);t=await Ew(r)}}var kh=new Set(["ide","method","m","output","o","hostname","H","git-protocol","p","type","t","skill","k","targets","mode","model","resume","r","id","client","c","search","category","env","config"]);function wh(e=process.argv.slice(2)){let t={command:null,args:[],options:{}},o=0;for(;o<e.length;){let r=e[o];if(r.startsWith("--")){let[n,i]=r.slice(2).split("=");i!==void 0?t.options[n]=i:kh.has(n)&&o+1<e.length&&!e[o+1].startsWith("-")?(t.options[n]=e[o+1],o++):t.options[n]=!0}else if(r.startsWith("-")&&r.length>1){let n=r.slice(1),i=n[n.length-1];if(n.length===1&&kh.has(i)&&o+1<e.length&&!e[o+1].startsWith("-"))t.options[i]=e[o+1],o++;else for(let s of n)t.options[s]=!0}else t.command?t.args.push(r):t.command=r;o++}return t}function xh(e){return!!(e.options.help||e.options.h)}function Sh(e){return!!(e.options.version||e.options.v)}var zo={cursor:{name:"Cursor",description:"AI-first code editor",url:"https://cursor.sh"},"claude-desktop":{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"},"claude-code":{name:"Claude Code",description:"Claude CLI for terminal",url:"https://docs.anthropic.com/claude-code"},opencode:{name:"Opencode",description:"AI coding agent CLI",url:"https://opencode.ai"},"vscode-cline":{name:"Cline (VS Code)",description:"AI coding assistant extension",url:"https://marketplace.visualstudio.com/items?itemName=saoudrizwan.claude-dev"},"vscode-roo":{name:"Roo-Cline (VS Code)",description:"Roo AI coding extension",url:"https://github.com/RooVetGit/Roo-Cline"},"vscode-continue":{name:"Continue (VS Code)",description:"Open-source AI assistant",url:"https://continue.dev"},windsurf:{name:"Windsurf",description:"Codeium AI IDE",url:"https://codeium.com/windsurf"},trae:{name:"Trae",description:"Adaptive AI IDE",url:"https://trae.ai"},antigravity:{name:"Antigravity",description:"Gemini-powered AI IDE",url:"https://antigravity.dev"},zed:{name:"Zed",description:"High-performance code editor",url:"https://zed.dev"},codex:{name:"Codex",description:"OpenAI Codex CLI agent",url:"https://github.com/openai/codex"},"gemini-cli":{name:"Gemini CLI",description:"Google Gemini CLI",url:"https://github.com/google-gemini/gemini-cli"},goose:{name:"Goose",description:"Block AI coding agent",url:"https://block.github.io/goose"},kiro:{name:"Kiro",description:"AWS AI IDE",url:"https://kiro.dev"},custom:{name:"Custom Path",description:"Specify your own MCP config path",url:""},claude:{name:"Claude Desktop",description:"Anthropic's Claude desktop app",url:"https://claude.ai/download"}},Ju={cursor:zo.cursor,claude:zo.claude},_h={direct:{name:"Direct (curl)",description:"Download and run directly from octocode.ai",pros:["Always latest version","No npm required"],cons:["Requires curl (or PowerShell on Windows)","Slower startup"]},npx:{name:"NPX",description:"Run via npx from npm registry",pros:["Standard npm workflow","Faster after first run (cached)"],cons:["Requires Node.js/npm"]}};import ae from"node:path";import{existsSync as Xu,rmSync as Yu,mkdirSync as Eh,symlinkSync as Aw}from"node:fs";function Ph(e){return e in zo?zo[e].name:e in Ju?Ju[e].name:e.charAt(0).toUpperCase()+e.slice(1)}function Tw(e){switch(e.trim().toLowerCase()){case"claude":case"claude-code":case"claudecode":return"claude-code";case"claude-desktop":case"claudedesktop":return"claude-desktop";case"cursor":return"cursor";case"codex":return"codex";case"opencode":return"opencode";default:return null}}function Ow(e,t){if(e==="claude-code")return t;if(X){let o=De();switch(e){case"claude-desktop":return ae.join(o,"Claude Desktop","skills");case"cursor":return ae.join(H,".cursor","skills");case"codex":return ae.join(H,".codex","skills");case"opencode":return ae.join(H,".opencode","skills");default:return t}}switch(e){case"claude-desktop":return ae.join(H,".claude-desktop","skills");case"cursor":return ae.join(H,".cursor","skills");case"codex":return ae.join(H,".codex","skills");case"opencode":return ae.join(H,".opencode","skills");default:return t}}function Ih(e,t,o,r){try{if(Xu(t)){if(!r)return"skipped";Yu(t,{recursive:!0,force:!0})}return o==="symlink"?(Aw(e,t,X?"junction":"dir"),"installed"):ln(e,t)?"installed":"failed"}catch{return"failed"}}function Mw(e){return e==="claude-code"||e==="claude-desktop"}function Fh(e,t){return e==="hybrid"?Mw(t)?"copy":"symlink":e}async function zw(){await oe();let e=await A({message:"Install skills to which platforms?",choices:[{name:"- Claude locations (claude-code + claude-desktop)",value:"claude-only"},{name:"- All supported platforms",value:"all"},{name:"- Custom selection",value:"custom"},{name:`${l("- Cancel")}`,value:"cancel"}],loop:!1});return e==="cancel"?[]:e==="claude-only"?["claude-code","claude-desktop"]:e==="all"?["claude-code","claude-desktop","cursor","codex","opencode"]:await ii({message:"Select target platforms",choices:[{name:"- claude-code",value:"claude-code",checked:!0},{name:"- claude-desktop",value:"claude-desktop",checked:!0},{name:"- cursor",value:"cursor"},{name:"- codex",value:"codex"},{name:"- opencode",value:"opencode"}],required:!0,loop:!1})}async function jw(){await oe();let e=await A({message:"How should skills be installed?",choices:[{name:"- Hybrid (copy for Claude targets, symlink for others)",value:"hybrid"},{name:"- Full copies everywhere",value:"copy"},{name:"- Symlinks everywhere",value:"symlink"},{name:`${l("- Cancel")}`,value:"cancel"}],loop:!1});return e==="cancel"?null:e}function Nw(e){switch(e.trim().toLowerCase()){case"claude":case"claude-desktop":case"claudedesktop":return"claude-desktop";case"claude-code":case"claudecode":return"claude-code";case"cursor":return"cursor";case"windsurf":return"windsurf";case"trae":return"trae";case"antigravity":return"antigravity";case"zed":return"zed";case"vscode-cline":case"cline":return"vscode-cline";case"vscode-roo":case"roo":case"roo-cline":return"vscode-roo";case"vscode-continue":case"continue":return"vscode-continue";case"opencode":return"opencode";case"codex":return"codex";case"gemini":case"gemini-cli":case"geminicli":return"gemini-cli";case"goose":return"goose";case"kiro":return"kiro";case"custom":return"custom";default:return null}}function Lw(e){if(!e||e.trim().length===0)return{values:{}};let t=e.split(",").map(n=>n.trim()).filter(Boolean),o={},r=/^[A-Za-z_][A-Za-z0-9_]*$/;for(let n of t){let i=n.indexOf("=");if(i<=0)return{values:{},error:`Invalid --env pair: "${n}" (expected KEY=VALUE)`};let s=n.slice(0,i).trim(),c=n.slice(i+1);if(!r.test(s))return{values:{},error:`Invalid env var name: "${s}"`};o[s]=c}return{values:o}}function Ah(){console.log(` ${l("For deeper diagnostics:")} ${a("cyan","npx node-doctor")}`),console.log()}function Qu(e,t){switch(e){case"octocode":return a("cyan","octocode");case"gh-cli":return a("magenta","gh cli");case"env":if(t){let o=t.replace("env:","");return a("green",o)}return a("green","environment variable");default:return l("none")}}var Uw={name:"install",aliases:["i"],description:"Install octocode-mcp for an IDE",usage:"octocode install --ide <ide> [--method <npx|direct>] [--force]",options:[{name:"ide",description:"IDE to configure: cursor, claude-desktop, claude-code, windsurf, zed, vscode-cline, vscode-roo, vscode-continue, opencode, trae, antigravity, codex, gemini-cli, goose, kiro",hasValue:!0},{name:"method",short:"m",description:"Installation method (npx or direct)",hasValue:!0,default:"npx"},{name:"force",short:"f",description:"Overwrite existing configuration"}],handler:async e=>{let t=e.options.ide,o=e.options.method||"npx",r=!!(e.options.force||e.options.f);if(o==="npx"){let u=mi(),p=gi();if(!u.installed){console.log(),console.log(` ${a("red","\u2717")} Node.js is ${a("red","not found in PATH")}`),console.log(` ${l("Node.js is required for npx installation method.")}`),console.log(),Ah(),process.exitCode=1;return}if(!p.installed){console.log(),console.log(` ${a("yellow","\u26A0")} npm is ${a("yellow","not found in PATH")}`),console.log(` ${l("npm is required for npx installation method.")}`),console.log(),Ah(),process.exitCode=1;return}}if(!t){let u=jg();if(console.log(),console.log(` ${a("red","\u2717")} Missing required option: ${a("cyan","--ide")}`),console.log(),u.length>0){console.log(` ${f("Available IDEs:")}`);for(let p of u)console.log(` ${a("cyan","\u2022")} ${p}`)}else console.log(` ${a("yellow","\u26A0")} No supported IDEs detected.`),console.log(` ${l("Install Cursor or Claude Desktop first.")}`);console.log(),console.log(` ${l("Usage:")} octocode install --ide cursor --method npx`),console.log(),process.exitCode=1;return}let n=["cursor","claude","claude-desktop","claude-code","windsurf","zed","vscode-cline","vscode-roo","vscode-continue","opencode","trae","antigravity","codex","gemini-cli","goose","kiro"];if(!n.includes(t)){console.log(),console.log(` ${a("red","\u2717")} Invalid IDE: ${t}`),console.log(` ${l("Supported:")} ${n.join(", ")}`),console.log(),process.exitCode=1;return}if(!["npx","direct"].includes(o)){console.log(),console.log(` ${a("red","\u2717")} Invalid method: ${o}`),console.log(` ${l("Supported:")} npx, direct`),console.log(),process.exitCode=1;return}let i=Lg(t,o);if(i.action==="override"&&!r){console.log(),console.log(` ${a("yellow","\u26A0")} Octocode is already configured.`),console.log(` ${l("Use")} ${a("cyan","--force")} ${l("to overwrite.")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${f("Installing octocode-mcp")}`),console.log(` ${l("IDE:")} ${Ph(t)}`),console.log(` ${l("Method:")} ${_h[o].name}`),console.log(` ${l("Action:")} ${i.action.toUpperCase()}`),console.log();let s=new L("Writing configuration...").start(),c=Ng({ide:t,method:o,force:r});c.success?(s.succeed("Installation complete!"),console.log(),console.log(` ${a("green","\u2713")} Config saved to: ${i.configPath}`),c.backupPath&&console.log(` ${l("Backup:")} ${c.backupPath}`),console.log(),console.log(` ${f("Next:")} Restart ${Ph(t)} to activate.`),console.log()):(s.fail("Installation failed"),console.log(),c.error&&console.log(` ${a("red","\u2717")} ${c.error}`),console.log(),process.exitCode=1)}},Fi={name:"login",aliases:["l"],description:"Authenticate with GitHub",usage:"octocode login [--hostname <host>] [--git-protocol <ssh|https>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0},{name:"git-protocol",short:"p",description:"Git protocol to use (ssh or https)",hasValue:!0}],handler:async e=>{let t=e.options.hostname??e.options.H,o=(typeof t=="string"?t:void 0)||"github.com",r=Dn(o);if(r.authenticated){console.log(),console.log(` ${a("green","\u2713")} Already authenticated as ${a("cyan",r.username||"unknown")}`),console.log(),console.log(` ${l("To switch accounts, logout first:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode logout")}`),console.log();return}console.log(),console.log(` ${f("\u{1F510} GitHub Authentication")}`),console.log();let n=e.options["git-protocol"],i=typeof n=="string"?n:"https",s=!1,c=new L("Waiting for GitHub authentication...").start(),u=await Ei({hostname:o,gitProtocol:i,onVerification:p=>{c.stop(),s=!0,console.log(` ${a("yellow","!")} First copy your one-time code: ${f(p.user_code)}`),console.log(),console.log(` ${f("Press Enter")} to open ${a("cyan",p.verification_uri)} in your browser...`),console.log(),console.log(` ${l("Waiting for authentication...")}`)}});s||c.stop(),console.log(),u.success?(console.log(` ${a("green","\u2713")} Authentication complete!`),console.log(` ${a("green","\u2713")} Logged in as ${a("cyan",u.username||"unknown")}`),console.log(),console.log(` ${l("Credentials stored in:")} ${Oo()}`)):(console.log(` ${a("red","\u2717")} Authentication failed: ${u.error||"Unknown error"}`),process.exitCode=1),console.log()}},Oh={name:"logout",description:"Sign out from GitHub",usage:"octocode logout [--hostname <host>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname",hasValue:!0}],handler:async e=>{let t=e.options.hostname??e.options.H,o=(typeof t=="string"?t:void 0)||"github.com",r=Dn(o);if(!r.authenticated){console.log(),console.log(` ${a("yellow","\u26A0")} Not currently authenticated to ${o}`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode login")}`),console.log();return}console.log(),console.log(` ${f("\u{1F510} GitHub Logout")}`),console.log(` ${l("Currently authenticated as:")} ${a("cyan",r.username||"unknown")}`),console.log();let n=await bn(o);n.success?console.log(` ${a("green","\u2713")} Successfully logged out from ${o}`):(console.log(` ${a("red","\u2717")} Logout failed: ${n.error||"Unknown error"}`),process.exitCode=1),console.log()}},Bw={name:"auth",aliases:["a","gh"],description:"Manage GitHub authentication",usage:"octocode auth [login|logout|status|token]",handler:async e=>{let t=e.args[0],o=e.options.hostname||"github.com";if(t==="login")return Fi.handler(e);if(t==="logout")return Oh.handler(e);if(t==="status")return Th();if(t==="token"){let s=await Hu(o);if(s.token){console.log(s.token);return}let c=qu(o);if(c.token){console.log(c.token);return}console.log(),console.log(` ${a("yellow","\u26A0")} No GitHub token found.`),console.log(),console.log(` ${l("GitHub authentication is required to access private repositories.")}`),console.log(),console.log(` ${f("To authenticate, choose one of:")}`),console.log(),console.log(` ${a("cyan","octocode auth login")} ${l("Recommended - stores token securely")}`),console.log(` ${a("cyan","gh auth login")} ${l("Use existing GitHub CLI")}`),console.log(),console.log(` ${l("Learn more:")} ${a("blue",vh)}`),console.log(),process.exitCode=1;return}let r=Dn(o);await Th(o),await oe();let n=r.authenticated?[{name:"\u{1F513} Logout from GitHub",value:"logout"},{name:"\u{1F504} Switch account (logout & login)",value:"switch"},{name:"\u2190 Back",value:"back"}]:[{name:"\u{1F510} Login to GitHub",value:"login"},{name:"\u2190 Back",value:"back"}],i=await A({message:"What would you like to do?",choices:n});i==="login"?await Fi.handler({command:"login",args:[],options:{}}):i==="logout"?(await bn(o),console.log(),console.log(` ${a("green","\u2713")} Successfully logged out`),console.log()):i==="switch"&&(console.log(),console.log(` ${l("Logging out...")}`),await bn(),console.log(` ${a("green","\u2713")} Logged out`),console.log(),console.log(` ${l("Starting new login...")}`),await Fi.handler({command:"login",args:[],options:{}}))}};async function Th(e="github.com"){console.log(),console.log(` ${f("\u{1F510} GitHub Authentication")}`),console.log();let t=Dn(e);t.authenticated?(console.log(` ${a("green","\u2713")} Authenticated as ${a("cyan",t.username||"unknown")}`),t.tokenExpired&&console.log(` ${a("yellow","\u26A0")} Token has expired - please login again`),console.log(` ${l("Host:")} ${t.hostname}`),console.log(` ${l("Source:")} ${Qu(t.tokenSource||"none",t.envTokenSource)}`)):(console.log(` ${a("yellow","\u26A0")} ${a("yellow","Not authenticated")}`),console.log(),console.log(` ${f("To authenticate:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","gh auth login")}`)),console.log(),console.log(` ${l("Credentials stored in:")} ${Oo()}`),console.log()}var Rw={name:"skills",aliases:["sk"],description:"Install Octocode skills across AI clients",usage:"octocode skills [install|remove|list] [--skill <name>] [--targets <list>] [--mode <copy|symlink>]",options:[{name:"force",short:"f",description:"Overwrite existing skills"},{name:"skill",short:"k",description:"Skill folder name (used by install/remove)",hasValue:!0},{name:"targets",short:"t",description:"Comma-separated targets: claude-code, claude-desktop, cursor, codex, opencode",hasValue:!0},{name:"mode",short:"m",description:"Install mode: copy (default) or symlink",hasValue:!0,default:"copy"}],handler:async e=>{let t=e.args[0]||"list",o=!!(e.options.force||e.options.f),r=e.options.skill??e.options.k,n=typeof r=="string"&&r.length>0?r:void 0,i=t==="remove"?void 0:e.options.targets??e.options.t,s=t==="remove"?void 0:e.options.mode??e.options.m,c="copy";if(typeof s=="string"&&s.trim().length>0){let b=s.trim().toLowerCase();if(b!=="copy"&&b!=="symlink"){console.log(),console.log(` ${a("red","X")} Invalid --mode value: ${a("yellow",s)}`),console.log(` ${l("Allowed values:")} copy, symlink`),console.log(` ${l("Example:")} octocode skills install --mode symlink`),console.log(),process.exitCode=1;return}c=b}let u=typeof i=="string"&&i.trim().length>0,p=typeof s=="string"&&s.length>0,d=jt(),m=we(),h=["claude-code"];if(typeof i=="string"&&i.trim().length>0){let b=i.split(",").map(k=>Tw(k)).filter(k=>k!==null);if(h=[...new Set(b)],h.length===0){console.log(),console.log(` ${a("red","X")} No valid targets provided`),console.log(` ${l("Valid targets:")} claude-code, claude-desktop, cursor, codex, opencode`),console.log(),process.exitCode=1;return}}let y=c;if(t==="install"&&process.stdout.isTTY&&(!u||!p)){let b=await zw();if(b.length===0){console.log(),console.log(` ${a("yellow","WARN")} Skills install cancelled`),console.log();return}h=b;let k=await jw();if(!k){console.log(),console.log(` ${a("yellow","WARN")} Skills install cancelled`),console.log();return}y=k}let g=h.map(b=>({target:b,destDir:Ow(b,m)}));if(!z(d)){console.log(),console.log(` ${a("red","\u2717")} Skills directory not found`),console.log(` ${l("Expected:")} ${d}`),console.log(),process.exitCode=1;return}let D=Be(d).filter(b=>!b.startsWith("."));if(t==="list"){console.log(),console.log(` ${f("Available Octocode Skills")}`),console.log(),console.log(` ${f("Install destinations:")}`);for(let b of g)console.log(` ${a("cyan","\u2022")} ${b.target}: ${b.destDir}`);if(console.log(),D.length===0)console.log(` ${l("No skills available.")}`);else for(let b of D){let C=g.every(w=>z(ae.join(w.destDir,b)))?a("green","installed"):l("not installed");console.log(` ${a("cyan","\u2022")} ${b} ${C}`)}console.log(),console.log(` ${l("To install all:")} octocode skills install`),console.log(` ${l("To install one:")} octocode skills install --skill <name> ${l("(or -k <name>)")}`),console.log(` ${l("Multi-install:")} octocode skills install --targets claude-code,cursor,codex --mode symlink`),console.log();return}if(t==="install"){if(n){if(console.log(),console.log(` ${f(`Installing skill: ${n}`)}`),console.log(),!D.includes(n)){console.log(` ${a("red","\u2717")} Skill not found: ${n}`),console.log(),console.log(` ${l("Available skills:")}`);for(let T of D)console.log(` ${a("cyan","\u2022")} ${T}`);console.log(),process.exitCode=1;return}let P=new L(`Installing ${n}...`).start(),U=ae.join(d,n),B=0,M=0,Y=0;for(let T of g){z(T.destDir)||Eh(T.destDir,{recursive:!0,mode:448});let I=Ih(U,ae.join(T.destDir,n),Fh(y,T.target),o);I==="installed"?B++:I==="skipped"?M++:Y++}if(Y===0){P.succeed(`Installed ${n}!`),console.log(),console.log(` ${a("green","\u2705")} Installed to ${B}/${g.length} targets`);for(let T of g)console.log(` ${a("cyan","\u2022")} ${T.target}: ${ae.join(T.destDir,n)}`);M>0&&console.log(` ${a("yellow","WARN")} Skipped ${M} existing target(s) ${l("(use --force to overwrite)")}`)}else P.fail(`Failed to install ${n}`),process.exitCode=1;console.log();return}if(console.log(),console.log(` ${f("Installing Octocode Skills")}`),console.log(),D.length===0){console.log(` ${a("yellow","\u26A0")} No skills to install.`),console.log();return}let b=new L("Installing skills...").start(),k=0,C=0,w=0;for(let P of D){let U=ae.join(d,P);for(let B of g){z(B.destDir)||Eh(B.destDir,{recursive:!0,mode:448});let M=Ih(U,ae.join(B.destDir,P),Fh(y,B.target),o);M==="installed"?k++:M==="skipped"?C++:w++}}w===0?b.succeed("Skills installation complete!"):b.fail("Skills installation completed with errors"),console.log(),k>0&&console.log(` ${a("green","\u2705")} Installed ${k} skill target(s)`),C>0&&(console.log(` ${a("yellow","WARN")} Skipped ${C} existing skill target(s)`),console.log(` ${l("Use")} ${a("cyan","--force")} ${l("to overwrite.")}`)),w>0&&(console.log(` ${a("red","X")} Failed ${w} skill target(s)`),process.exitCode=1),console.log(),console.log(` ${f("Targets:")}`);for(let P of g)console.log(` ${a("cyan","\u2022")} ${P.target}: ${P.destDir}`);console.log(),console.log(` ${f("Skills installation finished.")}`),console.log();return}if(t==="remove"){if(!n){console.log(),console.log(` ${a("red","X")} Missing required option: ${a("cyan","--skill <name>")}`),console.log(),console.log(` ${l("Usage:")} octocode skills remove --skill <name>`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${f(`Removing skill: ${n}`)}`),console.log();let b=0,k=0;for(let C of g){let w=ae.join(C.destDir,n);if(!z(w)){k++;continue}un(w)?b++:(console.log(` ${a("red","X")} Failed to remove from ${C.target}: ${w}`),process.exitCode=1)}b>0&&console.log(` ${a("green","\u2705")} Removed from ${b}/${g.length} targets`),k>0&&console.log(` ${a("yellow","WARN")} Not found in ${k} target(s) ${l("(already absent)")}`),console.log();return}console.log(),console.log(` ${a("red","\u2717")} Unknown subcommand: ${t}`),console.log(` ${l("Usage:")} octocode skills [install|remove|list] [--skill <name>]`),console.log(),process.exitCode=1}},Zw={name:"token",aliases:["t"],description:"Print the GitHub token (matches octocode-mcp priority)",usage:"octocode token [--type <auto|octocode|gh>] [--hostname <host>] [--source] [--json]",options:[{name:"type",short:"t",description:"Token source: auto (default: env\u2192gh\u2192octocode), octocode, gh",hasValue:!0,default:"auto"},{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0},{name:"source",short:"s",description:"Show token source and user info"},{name:"json",short:"j",description:'Output as JSON: {"token": "...", "type": "..."}'}],handler:async e=>{let t=e.options.hostname??e.options.H,o=(typeof t=="string"?t:void 0)||"github.com",r=!!(e.options.source||e.options.s),n=!!(e.options.json||e.options.j),i=e.options.type??e.options.t,s=(typeof i=="string"?i:void 0)||"auto",c;switch(s.toLowerCase()){case"octocode":case"o":c="octocode";break;case"gh":case"gh-cli":case"g":c="gh";break;case"auto":case"a":c="auto";break;default:if(n){console.log(JSON.stringify({token:null,type:"none"})),process.exitCode=1;return}console.log(),console.log(` ${a("red","\u2717")} Invalid token type: ${s}`),console.log(` ${l("Valid options:")} octocode, gh, auto`),console.log(),process.exitCode=1;return}let u=await Dh(o,c);if(n){let p={token:u.token,type:$h(u.source,u.envSource)};console.log(JSON.stringify(p)),u.token||(process.exitCode=1);return}if(!u.token){console.log(),c==="octocode"?(console.log(` ${a("yellow","\u26A0")} No Octocode token found for ${o}`),console.log(),console.log(` ${l("To login with Octocode:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode login")}`),console.log(),console.log(` ${l("Or use gh CLI token:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode token --type=gh")}`)):c==="gh"?(console.log(` ${a("yellow","\u26A0")} No gh CLI token found for ${o}`),console.log(),console.log(` ${l("To login with gh CLI:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","gh auth login")}`),console.log(),console.log(` ${l("Or use Octocode token:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode token --type=octocode")}`)):(console.log(` ${a("yellow","\u26A0")} Not authenticated to ${o}`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","gh auth login")}`)),console.log(),process.exitCode=1;return}r?(console.log(),console.log(` ${a("green","\u2713")} Token found`),console.log(` ${l("Source:")} ${Qu(u.source,u.envSource)}`),u.username&&console.log(` ${l("User:")} ${a("cyan","@"+u.username)}`),console.log(),console.log(` ${l("Token:")} ${u.token}`),console.log()):console.log(u.token)}},Vw={name:"status",aliases:["s"],description:"Show GitHub authentication status",usage:"octocode status [--hostname <host>]",options:[{name:"hostname",short:"H",description:"GitHub Enterprise hostname (default: github.com)",hasValue:!0}],handler:async e=>{let t=e.options.hostname??e.options.H,r=Dn((typeof t=="string"?t:void 0)||"github.com");console.log(),r.authenticated?(console.log(` ${a("green","\u2713")} Logged in as ${a("cyan",r.username||"unknown")}`),console.log(` ${l("Host:")} ${r.hostname}`),console.log(` ${l("Source:")} ${Qu(r.tokenSource||"none",r.envTokenSource)}`),r.tokenExpired&&console.log(` ${a("yellow","\u26A0")} Token has expired - please login again`)):(console.log(` ${a("yellow","\u26A0")} Not logged in`),console.log(),console.log(` ${l("To login:")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","octocode login")}`),console.log(` ${l("or")}`),console.log(` ${a("cyan","\u2192")} ${a("yellow","gh auth login")}`)),console.log()}},Gw={name:"sync",aliases:["sy"],description:"Sync MCP configurations across all IDE clients",usage:"octocode sync [--force] [--dry-run] [--status]",options:[{name:"force",short:"f",description:"Auto-resolve conflicts (use first variant)"},{name:"dry-run",short:"n",description:"Show what would be synced without making changes"},{name:"status",short:"s",description:"Show sync status without syncing"}],handler:async e=>{let t=!!(e.options.force||e.options.f),o=!!(e.options["dry-run"]||e.options.n);if(!!(e.options.status||e.options.s)){console.log(),console.log(` ${f("\u{1F504} MCP Sync Status")}`),console.log();let s=new L("Scanning configurations...").start(),c=_o(),u=Po(c);s.stop(),console.log(` ${f("Clients:")} ${u.summary.clientsWithConfig} with MCP configs`),console.log();for(let p of u.clients){let d=ve(p.client),m=p.exists?a("green","\u25CF"):a("dim","\u25CB"),h=p.exists?`${p.mcpCount} MCPs`:l("no config");console.log(` ${m} ${d}: ${h}`)}console.log(),console.log(` ${f("MCPs:")}`),console.log(` ${a("cyan","\u2022")} ${u.summary.totalUniqueMCPs} unique MCPs`),u.summary.consistentMCPs>0&&console.log(` ${a("green","\u2713")} ${u.summary.consistentMCPs} fully synced`),u.summary.needsSyncCount>0&&console.log(` ${a("yellow","\u25CB")} ${u.summary.needsSyncCount} can be auto-synced`),u.summary.conflictCount>0&&console.log(` ${a("red","!")} ${u.summary.conflictCount} have conflicts`),console.log(),(u.summary.needsSyncCount>0||u.summary.conflictCount>0)&&(console.log(` ${l("Run")} ${a("cyan","octocode sync")} ${l("to synchronize.")}`),u.summary.conflictCount>0&&console.log(` ${l("Use")} ${a("cyan","--force")} ${l("to auto-resolve conflicts.")}`),console.log());return}console.log(),console.log(` ${f("\u{1F504} MCP Sync")}`),console.log();let n=new L("Analyzing configurations...").start(),i=await xu({force:t,dryRun:o});i.syncPerformed?i.success?(n.succeed(i.message),console.log(),console.log(` ${f("Next:")} Restart your IDEs to apply changes.`)):(n.fail(i.message),process.exitCode=1):(n.stop(),i.success?console.log(` ${a("green","\u2713")} ${i.message}`):(console.log(` ${a("yellow","\u26A0")} ${i.message}`),!t&&i.message.includes("conflict")&&(console.log(),console.log(` ${l("Options:")}`),console.log(` ${a("cyan","\u2022")} Run ${a("cyan","octocode")} for interactive mode`),console.log(` ${a("cyan","\u2022")} Use ${a("cyan","--force")} to auto-resolve`)),process.exitCode=1)),console.log()}},Ww={name:"mcp",description:"Non-interactive MCP marketplace management",usage:"octocode mcp [list|install|remove|status] [--id <mcp-id>] [--client <client>|--config <path>] [--search <text>] [--category <name>] [--env KEY=VALUE[,KEY=VALUE]] [--force]",options:[{name:"id",description:"MCP registry id (required for install/remove)",hasValue:!0},{name:"client",short:"c",description:"Target client: cursor, claude-desktop, claude-code, windsurf, trae, antigravity, zed, vscode-cline, vscode-roo, vscode-continue, opencode, codex, gemini-cli, goose, kiro",hasValue:!0},{name:"config",description:"Custom MCP config path (uses custom client)",hasValue:!0},{name:"search",description:"Filter list by id/name/description/tags",hasValue:!0},{name:"category",description:"Filter list by category",hasValue:!0},{name:"env",description:"Comma-separated env values: KEY=VALUE,KEY2=VALUE2",hasValue:!0},{name:"installed",description:"List only MCPs installed in target config"},{name:"force",short:"f",description:"Overwrite existing MCP entry on install"}],handler:async e=>{let t=(e.args[0]||"list").toLowerCase(),o=e.options.id,r=typeof o=="string"&&o.trim().length>0?o.trim():void 0,n=e.options.client??e.options.c,i=e.options.config,s=e.options.search,c=e.options.category,u=e.options.env,p=!!e.options.installed,d=!!(e.options.force||e.options.f),m="claude-code",h;if(typeof i=="string"&&i.trim().length>0)m="custom",h=i.trim();else if(typeof n=="string"&&n.trim().length>0){let b=Nw(n);if(!b){console.log(),console.log(` ${a("red","X")} Invalid --client value: ${a("yellow",n)}`),console.log(` ${l("Allowed values:")} cursor, claude-desktop, claude-code, windsurf, trae, antigravity, zed, vscode-cline, vscode-roo, vscode-continue, opencode, codex, gemini-cli, goose, kiro`),console.log(),process.exitCode=1;return}m=b}let y=K(m,h),g=J(y)||{mcpServers:{}},D=g.mcpServers||{};if(t==="list"){let b=he;if(typeof s=="string"&&s.trim().length>0){let k=s.trim().toLowerCase();b=b.filter(C=>C.id.toLowerCase().includes(k)||C.name.toLowerCase().includes(k)||C.description.toLowerCase().includes(k)||C.tags?.some(w=>w.toLowerCase().includes(k)))}if(typeof c=="string"&&c.trim().length>0){let k=c.trim().toLowerCase();b=b.filter(C=>C.category===k)}if(p){let k=new Set(Object.keys(D));b=b.filter(C=>k.has(C.id))}if(console.log(),console.log(` ${f("MCP Marketplace (non-interactive)")}`),console.log(` ${l("Config:")} ${y}`),console.log(` ${l("Results:")} ${b.length}`),console.log(),b.length===0){console.log(` ${l("No MCP entries matched your filters.")}`),console.log();return}for(let k of b){let C=D[k.id]?a("green","installed"):l("not installed");console.log(` ${a("cyan","\u2022")} ${k.id} ${l("("+k.category+")")} ${C}`)}console.log();return}if(t==="status"){let b=Object.keys(D).sort((k,C)=>k.localeCompare(C));console.log(),console.log(` ${f("MCP Config Status")}`),console.log(` ${l("Client:")} ${Z[m]?.name||m}`),console.log(` ${l("Config:")} ${y}`),console.log(` ${l("Installed MCPs:")} ${b.length}`),console.log();for(let k of b)console.log(` ${a("cyan","\u2022")} ${k}`);b.length===0&&console.log(` ${l("No MCP servers configured yet.")}`),console.log();return}if(t==="install"){if(!r){console.log(),console.log(` ${a("red","X")} Missing required option: --id <mcp-id>`),console.log(),process.exitCode=1;return}let b=he.find(B=>B.id.toLowerCase()===r.toLowerCase());if(!b){console.log(),console.log(` ${a("red","X")} MCP not found in registry: ${r}`),console.log(),process.exitCode=1;return}let k=Lw(typeof u=="string"?u:void 0);if(k.error){console.log(),console.log(` ${a("red","X")} ${k.error}`),console.log(),process.exitCode=1;return}if(D[b.id]&&!d){console.log(),console.log(` ${a("yellow","WARN")} MCP already installed: ${b.id}`),console.log(` ${l("Use --force to overwrite existing configuration.")}`),console.log(),process.exitCode=1;return}let C={command:b.installConfig.command,args:[...b.installConfig.args]},w={...b.installConfig.env||{},...k.values};Object.keys(w).length>0&&(C.env=w);let P={...g,mcpServers:{...D,[b.id]:C}},U=pe(y,P);if(!U.success){console.log(),console.log(` ${a("red","X")} Failed to write MCP config`),console.log(` ${l(U.error||"Unknown write error")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${a("green","\u2705")} Installed MCP: ${b.id}`),console.log(` ${l("Client:")} ${Z[m]?.name||m}`),console.log(` ${l("Config:")} ${y}`),console.log();return}if(t==="remove"){if(!r){console.log(),console.log(` ${a("red","X")} Missing required option: --id <mcp-id>`),console.log(),process.exitCode=1;return}let b=Object.keys(D).find(w=>w.toLowerCase()===r.toLowerCase());if(!b){console.log(),console.log(` ${a("yellow","WARN")} MCP not installed: ${r}`),console.log(` ${l("Nothing to remove from target config.")}`),console.log(),process.exitCode=1;return}let k={...D};delete k[b];let C=pe(y,{...g,mcpServers:k});if(!C.success){console.log(),console.log(` ${a("red","X")} Failed to update MCP config`),console.log(` ${l(C.error||"Unknown write error")}`),console.log(),process.exitCode=1;return}console.log(),console.log(` ${a("green","\u2705")} Removed MCP: ${r}`),console.log(` ${l("Client:")} ${Z[m]?.name||m}`),console.log(` ${l("Config:")} ${y}`),console.log();return}console.log(),console.log(` ${a("red","X")} Unknown mcp subcommand: ${t}`),console.log(` ${l("Usage:")} octocode mcp [list|install|remove|status]`),console.log(),process.exitCode=1}},Hw={name:"cache",description:"Inspect and clean Octocode cache and logs",usage:"octocode cache [status|clean] [--repos] [--skills] [--logs] [--tools|--local|--lsp|--api] [--all]",options:[{name:"repos",description:"Target cloned repositories cache"},{name:"skills",description:"Target marketplace skills cache"},{name:"logs",description:"Target Octocode logs directory"},{name:"all",short:"a",description:"Target repos + skills + logs (tool flags are advisory)"},{name:"tools",description:"Target tool caches (local + lsp + api). In-memory caches clear on MCP restart."},{name:"local",description:"Target local tool cache. In-memory cache clears on MCP restart."},{name:"lsp",description:"Target LSP tool cache. In-memory cache clears on MCP restart."},{name:"api",description:"Target remote API tool cache. In-memory cache clears on MCP restart."}],handler:async e=>{let t=(e.args[0]||"status").toLowerCase(),o=fe.home||process.env.OCTOCODE_HOME||ae.join(process.env.HOME||"",".octocode"),r=fe.repos||ae.join(o,"repos"),n=fe.logs||ae.join(o,"logs"),i=rh(),s=!!e.options.repos,c=!!e.options.skills,u=!!e.options.logs,p=!!e.options.tools,d=!!e.options.local,m=!!e.options.lsp,h=!!e.options.api,y=!!(e.options.all||e.options.a),g=y||s,D=y||c,b=y||u,k=p||d||m||h;if(t==="status"){let C=ct(r),w=ct(i),P=ct(n),U=C+w+P;console.log(),console.log(` ${f("\u{1F9F9} Octocode Cache Status")}`),console.log(),console.log(` ${l("Home:")} ${o}`),console.log(),console.log(` ${a("cyan","\u2022")} repos: ${on(C)} ${l(`(${r})`)}`),console.log(` ${a("cyan","\u2022")} skills: ${on(w)} ${l(`(${i})`)}`),console.log(` ${a("cyan","\u2022")} logs: ${on(P)} ${l(`(${n})`)}`),console.log(),console.log(` ${f("Total:")} ${on(U)}`),console.log(),console.log(` ${l("Clean examples:")}`),console.log(` ${a("yellow","octocode cache clean --repos")}`),console.log(` ${a("yellow","octocode cache clean --tools")}`),console.log(` ${a("yellow","octocode cache clean --all")}`),console.log();return}if(t==="clean"){if(!g&&!D&&!b&&!k){console.log(),console.log(` ${a("red","X")} Missing clean target. Use --repos, --skills, --logs, --tools, or --all`),console.log(` ${l("Example:")} octocode cache clean --all`),console.log(),process.exitCode=1;return}let C=g,w=D,P=b,U=!1,B=0;if(C&&Xu(r)&&(B+=ct(r),Yu(r,{recursive:!0,force:!0}),U=!0),w){let M=ct(i);oh();let Y=ct(i);(M>0||Y===0)&&(B+=Math.max(0,M-Y),U=!0)}if(P&&Xu(n)&&(B+=ct(n),Yu(n,{recursive:!0,force:!0}),U=!0),k){let M=[p?"--tools":"",d?"--local":"",m?"--lsp":"",h?"--api":""].filter(Boolean).join(", ");console.log(` ${a("yellow","\u2139")} ${M}: No disk caches to clean. Tool caches are in-memory and clear on MCP server restart.`)}console.log(),U?(console.log(` ${a("green","\u2713")} Cache cleanup complete`),console.log(` ${l("Freed:")} ${on(B)}`)):k||console.log(` ${a("yellow","\u26A0")} Nothing to clean`),console.log();return}console.log(),console.log(` ${a("red","\u2717")} Unknown cache subcommand: ${t}`),console.log(` ${l("Usage:")} octocode cache [status|clean] [--repos] [--skills] [--logs] [--tools|--local|--lsp|--api] [--all]`),console.log(),process.exitCode=1}},qw=[Uw,Bw,Fi,Oh,Rw,Ww,Hw,Zw,Vw,Gw];function ed(e){return qw.find(t=>t.name===e||t.aliases?.includes(e))}function Mh(){console.log(),console.log(` ${a("magenta",f("\u{1F50D}\u{1F419} Octocode CLI"))} - Install and configure octocode-mcp`),console.log(),console.log(` ${f("USAGE")}`),console.log(` ${a("magenta","octocode")} [command] [options]`),console.log(),console.log(` ${f("COMMANDS")}`),console.log(` ${a("magenta","install")} Configure octocode-mcp for an IDE`),console.log(` ${a("magenta","skills")} Install Octocode skills across AI clients`),console.log(` ${a("magenta","cache")} Inspect and clean Octocode cache directories`),console.log(` ${a("magenta","sync")} Sync MCP configurations across all IDEs`),console.log(` ${a("magenta","mcp")} Manage MCP marketplace non-interactively`),console.log(` ${a("magenta","auth")} Manage GitHub authentication`),console.log(` ${a("magenta","login")} Authenticate with GitHub`),console.log(` ${a("magenta","logout")} Sign out from GitHub`),console.log(` ${a("magenta","status")} Show GitHub authentication status`),console.log(` ${a("magenta","token")} Print the stored GitHub OAuth token`),console.log(),console.log(` ${f("OPTIONS")}`),console.log(` ${a("cyan","-h, --help")} Show this help message`),console.log(` ${a("cyan","-v, --version")} Show version number`),console.log(),console.log(` ${f("EXAMPLES")}`),console.log(` ${l("# Interactive mode")}`),console.log(` ${a("yellow","octocode")}`),console.log(),console.log(` ${l("# Install for Cursor using npx")}`),console.log(` ${a("yellow","octocode install --ide cursor --method npx")}`),console.log(),console.log(` ${l("# Install for Claude Desktop using direct method")}`),console.log(` ${a("yellow","octocode install --ide claude --method direct")}`),console.log(),console.log(` ${l("# Check GitHub authentication")}`),console.log(` ${a("yellow","octocode auth")}`),console.log(),console.log(` ${l("# Get token from Octocode (default)")}`),console.log(` ${a("yellow","octocode token")}`),console.log(),console.log(` ${l("# Get token from gh CLI")}`),console.log(` ${a("yellow","octocode token --type=gh")}`),console.log(),console.log(` ${l("# Sync MCP configs across all IDEs")}`),console.log(` ${a("yellow","octocode sync")}`),console.log(` ${a("yellow","octocode sync --status")}`),console.log(),console.log(` ${l("# MCP marketplace via CLI")}`),console.log(` ${a("yellow","octocode mcp list --search browser")}`),console.log(` ${a("yellow","octocode mcp install --id playwright-mcp --client cursor --force")}`),console.log(` ${a("yellow","octocode mcp remove --id playwright-mcp --client cursor")}`),console.log(),console.log(` ${l("# Install Octocode skills")}`),console.log(` ${a("yellow","octocode skills install")}`),console.log(` ${a("yellow","octocode skills install --skill octocode-researcher")}`),console.log(` ${a("yellow","octocode skills install --targets claude-code,cursor,codex --mode symlink")}`),console.log(),console.log(` ${l("# Remove one installed skill")}`),console.log(` ${a("yellow","octocode skills remove --skill octocode-researcher --targets claude-code,cursor")}`),console.log(),console.log(a("magenta",` \u2500\u2500\u2500 \u{1F50D}\u{1F419} ${f("https://octocode.ai")} \u2500\u2500\u2500`)),console.log()}function zh(e){if(console.log(),console.log(` ${a("magenta",f("\u{1F50D}\u{1F419} octocode "+e.name))}`),console.log(),console.log(` ${e.description}`),console.log(),e.usage&&(console.log(` ${f("USAGE")}`),console.log(` ${e.usage}`),console.log()),e.options&&e.options.length>0){console.log(` ${f("OPTIONS")}`);for(let t of e.options){let o=t.short?`-${t.short}, `:" ",r=`--${t.name}`,n=t.hasValue?" <value>":"",i=t.default!==void 0?l(` (default: ${t.default})`):"";console.log(` ${a("cyan",o+r+n)}${i}`),console.log(` ${t.description}`)}console.log()}}function jh(){console.log("octocode v1.2.11")}async function Nh(e){let t=wh(e);if(xh(t)){if(t.command){let r=ed(t.command);if(r)return zh(r),!0}return Mh(),!0}if(Sh(t))return jh(),!0;if(!t.command)return!1;let o=ed(t.command);return o?(await o.handler(t),!0):(console.log(),console.log(` Unknown command: ${t.command}`),console.log(" Run 'octocode --help' to see available commands."),console.log(),process.exitCode=1,!0)}function Kw(){console.log(a("blue","\u2501".repeat(66))),console.log(` \u{1F50D} ${f("Environment")}`),console.log(a("blue","\u2501".repeat(66)))}async function Jw(){let e=new L(" Starting...").start();await oe(),e.clear(),qr(),si(),Kw();let t=await Co();if(ko(t)&&(console.log(),console.log(` ${l("\u{1F4A1}")} ${l("Run")} ${a("cyan","npx node-doctor")} ${l("for diagnostics")}`)),!t.nodeInstalled){console.log(),console.log(` ${a("red","\u2717")} ${f("Node.js is required to run octocode-mcp")}`),vu(),ai();return}await Ch()}async function Xw(){await Nh()||await Jw()}function Lh(){process.stdout.write("\x1B[?25h"),console.log(),console.log(l(" Goodbye! \u{1F44B}")),process.exit(0)}process.on("SIGINT",Lh);process.on("SIGTERM",Lh);Xw().catch(e=>{e?.name==="ExitPromptError"&&(console.log(),console.log(l(" Goodbye! \u{1F44B}")),process.exit(0)),console.error("Error:",e),process.exit(1)});
74
+ /*! Bundled license information:
75
+
76
+ @octokit/request-error/dist-src/index.js:
77
+ (* v8 ignore else -- @preserve -- Bug with vitest coverage where it sees an else branch that doesn't exist *)
78
+
79
+ @octokit/request/dist-bundle/index.js:
80
+ (* v8 ignore next -- @preserve *)
81
+ (* v8 ignore else -- @preserve *)
82
+ */